├── NEWS ├── intltool-merge.in ├── intltool-update.in ├── intltool-extract.in ├── distros └── debian │ ├── compat │ ├── install │ ├── docs │ ├── source │ └── format │ ├── watch │ ├── menu │ ├── changelog │ ├── rules │ ├── rules-gtk3 │ ├── rules-hal │ ├── copyright │ ├── postrm │ ├── control-gtk3 │ ├── control │ ├── postinst │ ├── control-hal │ └── README-DEBIAN ├── po ├── POTFILES.skip ├── LINGUAS ├── update-pot ├── POTFILES.in └── ChangeLog ├── data ├── spacefm.png ├── spacefm-find.png ├── spacefm-root.png ├── faenza │ ├── spacefm.png │ ├── spacefm-find.png │ └── spacefm-root.png ├── spacefm-48-cube-red.png ├── spacefm-128-cube-blue.png ├── spacefm-128-cube-green.png ├── spacefm-128-cube-red.png ├── spacefm-48-cube-blue.png ├── spacefm-48-cube-green.png ├── spacefm-48-faenza-blue.png ├── spacefm-48-faenza-find.png ├── spacefm-48-faenza-red.png ├── spacefm-48-folder-blue.png ├── spacefm-48-folder-red.png ├── spacefm-48-pyramid-red.png ├── spacefm-128-pyramid-blue.png ├── spacefm-128-pyramid-red.png ├── spacefm-48-pyramid-blue.png ├── spacefm-48-pyramid-green.png ├── spacefm-128-pyramid-green.png ├── spacefm-folder-handler.desktop.in ├── spacefm-find.desktop.in ├── spacefm.desktop.in ├── mount.rules ├── ui │ ├── godlg.ui │ └── about-dlg.ui └── Makefile.am ├── src ├── desktop │ ├── working-area.h │ ├── desktop.h │ └── working-area.c ├── go-dialog.h ├── pref-dialog.h ├── vfs │ ├── vfs-volume-hal-options.h │ ├── vfs-execute.h │ ├── vfs-utils.h │ ├── vfs-volume-hal-options.c │ ├── vfs-app-desktop.h │ ├── vfs-thumbnail-loader.h │ ├── vfs-async-task.h │ ├── vfs-mime-type.h │ ├── vfs-file-monitor.h │ ├── vfs-dir.h │ └── vfs-volume.h ├── ptk │ ├── ptk-console-output.h │ ├── ptk-path-entry.h │ ├── ptk-file-properties.h │ ├── ptk-dir-tree-view.h │ ├── ptk-file-archiver.h │ ├── ptk-input-dialog.h │ ├── ptk-app-chooser.h │ ├── ptk-clipboard.h │ ├── ptk-file-icon-renderer.h │ ├── ptk-file-menu.h │ ├── ptk-dir-tree.h │ ├── ptk-text-renderer.h │ ├── ptk-file-misc.h │ ├── ptk-location-view.h │ ├── ptk-input-dialog.c │ ├── ptk-file-list.h │ ├── ptk-handler.h │ ├── ptk-file-task.h │ └── ptk-utils.h ├── compat │ ├── glib-utils.h │ ├── glib-mem.h │ └── glib-utils.c ├── private.h ├── find-files.h ├── exo │ ├── exo-common.h │ ├── exo-gtk-extensions.h │ ├── exo-utils.h │ ├── exo-string.h │ ├── exo-thumbnail-preview.h │ ├── exo-gdk-pixbuf-extensions.h │ ├── exo-cell-renderer-icon.h │ ├── exo-cell-renderer-ellipsized-text.h │ ├── exo-icon-chooser-dialog.h │ ├── exo-marshal.h │ ├── exo-tree-view.h │ ├── exo-string.c │ ├── exo-binding.h │ ├── exo-icon-chooser-model.h │ ├── exo-utils.c │ └── exo-private.c ├── spacefm-auth ├── spacefm-auth.bash ├── pcmanfm.h ├── item-prop.h ├── mime-type │ ├── spacefm-mime.xml │ ├── mime-cache.h │ └── mime-action.h ├── go-dialog.c ├── xml-purge.c ├── libmd5-rfc │ └── md5.h ├── gtk2-compat.h └── Makefile.am ├── .gitignore ├── etc ├── Makefile.am └── spacefm.conf ├── Makefile.am ├── AUTHORS ├── mkinstalldirs └── autogen.sh /NEWS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /intltool-merge.in: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /intltool-update.in: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /intltool-extract.in: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /distros/debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /distros/debian/install: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /distros/debian/docs: -------------------------------------------------------------------------------- 1 | NEWS 2 | README 3 | -------------------------------------------------------------------------------- /distros/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /po/POTFILES.skip: -------------------------------------------------------------------------------- 1 | src/exo/exo-icon-view.c 2 | src/exo/exo-tree-view.c 3 | -------------------------------------------------------------------------------- /data/spacefm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm.png -------------------------------------------------------------------------------- /data/spacefm-find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-find.png -------------------------------------------------------------------------------- /data/spacefm-root.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-root.png -------------------------------------------------------------------------------- /data/faenza/spacefm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/faenza/spacefm.png -------------------------------------------------------------------------------- /distros/debian/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | https://github.com/IgnorantGuru/spacefm/tags .*/tarball/(\d[\d\.]+) 3 | -------------------------------------------------------------------------------- /data/faenza/spacefm-find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/faenza/spacefm-find.png -------------------------------------------------------------------------------- /data/faenza/spacefm-root.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/faenza/spacefm-root.png -------------------------------------------------------------------------------- /data/spacefm-48-cube-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-48-cube-red.png -------------------------------------------------------------------------------- /data/spacefm-128-cube-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-128-cube-blue.png -------------------------------------------------------------------------------- /data/spacefm-128-cube-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-128-cube-green.png -------------------------------------------------------------------------------- /data/spacefm-128-cube-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-128-cube-red.png -------------------------------------------------------------------------------- /data/spacefm-48-cube-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-48-cube-blue.png -------------------------------------------------------------------------------- /data/spacefm-48-cube-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-48-cube-green.png -------------------------------------------------------------------------------- /data/spacefm-48-faenza-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-48-faenza-blue.png -------------------------------------------------------------------------------- /data/spacefm-48-faenza-find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-48-faenza-find.png -------------------------------------------------------------------------------- /data/spacefm-48-faenza-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-48-faenza-red.png -------------------------------------------------------------------------------- /data/spacefm-48-folder-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-48-folder-blue.png -------------------------------------------------------------------------------- /data/spacefm-48-folder-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-48-folder-red.png -------------------------------------------------------------------------------- /data/spacefm-48-pyramid-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-48-pyramid-red.png -------------------------------------------------------------------------------- /data/spacefm-128-pyramid-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-128-pyramid-blue.png -------------------------------------------------------------------------------- /data/spacefm-128-pyramid-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-128-pyramid-red.png -------------------------------------------------------------------------------- /data/spacefm-48-pyramid-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-48-pyramid-blue.png -------------------------------------------------------------------------------- /data/spacefm-48-pyramid-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-48-pyramid-green.png -------------------------------------------------------------------------------- /data/spacefm-128-pyramid-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgnorantGuru/spacefm/HEAD/data/spacefm-128-pyramid-green.png -------------------------------------------------------------------------------- /distros/debian/menu: -------------------------------------------------------------------------------- 1 | ?package(spacefm): needs=X11 \ 2 | section="Applications/File Management" \ 3 | title="SpaceFM" command="/usr/bin/spacefm" 4 | -------------------------------------------------------------------------------- /distros/debian/changelog: -------------------------------------------------------------------------------- 1 | spacefm (1.0.6-1) unstable; urgency=low 2 | 3 | * release 4 | 5 | -- IgnorantGuru Sun, 04 Mar 2018 16:02:11 +0000 6 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | af ar bg bn_IN ca cs da de el es et eu fa fi fr gl he hr hu id it ja km ko lt ltg ml ms nb nl nn pl ps pt_BR pt ru sk sl sr sr@latin sv tr uk ur_PK ur vi zh_CN zh_TW 2 | -------------------------------------------------------------------------------- /src/desktop/working-area.h: -------------------------------------------------------------------------------- 1 | #ifndef WORKING_AREA_H 2 | #define WORKING_AREA_H 3 | 4 | #include 5 | void get_working_area(GdkScreen* screen, GdkRectangle *rect); 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /src/go-dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef _GO_DLG_H_ 2 | #define _GO_DLG_H_ 3 | 4 | #include "main-window.h" 5 | #include 6 | 7 | G_BEGIN_DECLS 8 | 9 | gboolean fm_go( FMMainWindow* parent ); 10 | 11 | G_END_DECLS 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /data/spacefm-folder-handler.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | _Name=SpaceFM Open Folder 3 | _Comment=Open folder 4 | TryExec=spacefm 5 | Exec=spacefm %U 6 | NoDisplay=true 7 | Terminal=false 8 | Icon=spacefm 9 | StartupNotify=true 10 | Type=Application 11 | MimeType=inode/directory; 12 | 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | autom4te.cache/ 2 | Makefile 3 | config.log 4 | config.status 5 | *.desktop 6 | libtool 7 | po/.intltool-merge-cache 8 | po/POTFILES 9 | po/*.gmo 10 | po/stamp-it 11 | po/Makefile.in 12 | src/.deps/ 13 | src/*/.deps/ 14 | src/*/.dirstamp 15 | src/spacefm 16 | src/xml-purge 17 | *.o 18 | -------------------------------------------------------------------------------- /data/spacefm-find.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | _Name=SpaceFM File Search 4 | Categories=Utility;GTK; 5 | Exec=spacefm --find-files %F 6 | Icon=spacefm-find 7 | StartupNotify=true 8 | Type=Application 9 | Terminal=false 10 | MimeType=inode/directory; 11 | _Comment=Search for files and folders 12 | -------------------------------------------------------------------------------- /etc/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = spacefm.conf 2 | 3 | install-data-hook: 4 | test -d $(DESTDIR)/$(sysconfdir)/spacefm || mkdir -p -- \ 5 | $(DESTDIR)/$(sysconfdir)/spacefm 6 | test -f $(DESTDIR)/$(sysconfdir)/spacefm/spacefm.conf || $(INSTALL_DATA) \ 7 | $(srcdir)/spacefm.conf \ 8 | $(DESTDIR)/$(sysconfdir)/spacefm/spacefm.conf 9 | 10 | -------------------------------------------------------------------------------- /src/pref-dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef _PREF_DLG_H_ 2 | #define _PREF_DLG_H_ 3 | 4 | #include 5 | 6 | G_BEGIN_DECLS 7 | 8 | typedef enum { 9 | PREF_GENERAL, 10 | PREF_INTERFACE, 11 | PREF_DESKTOP, 12 | PREF_VOLMAN, 13 | PREF_ADVANCED 14 | }PrefDlgPage; 15 | 16 | gboolean fm_edit_preference( GtkWindow* parent, int page ); 17 | 18 | G_END_DECLS 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /src/vfs/vfs-volume-hal-options.h: -------------------------------------------------------------------------------- 1 | #ifndef _VFS_VOLUME_HAL_OPTIONS_H_ 2 | #define _VFS_VOLUME_HAL_OPTIONS_H_ 3 | 4 | #include 5 | 6 | G_BEGIN_DECLS 7 | 8 | typedef struct _VFSVolumeOptions { 9 | char** mount_options; 10 | char* fstype_override; 11 | }VFSVolumeOptions; 12 | 13 | gboolean vfs_volume_hal_get_options( const char* fs, VFSVolumeOptions* ret ); 14 | 15 | G_END_DECLS 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/ptk/ptk-console-output.h: -------------------------------------------------------------------------------- 1 | #ifndef _PTK_CONSOLE_OUTPUT_H_ 2 | #define _PTK_CONSOLE_OUTPUT_H_ 3 | 4 | #include 5 | 6 | G_BEGIN_DECLS 7 | 8 | int ptk_console_output_run( GtkWindow* parent_win, 9 | const char* title, 10 | const char* desc, 11 | const char* working_dir, 12 | int argc, char* argv[] ); 13 | 14 | G_END_DECLS 15 | #endif 16 | -------------------------------------------------------------------------------- /distros/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | %: 13 | dh $@ 14 | 15 | override_dh_auto_configure: 16 | dh_auto_configure -- --with-gtk2 17 | -------------------------------------------------------------------------------- /distros/debian/rules-gtk3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | %: 13 | dh $@ 14 | 15 | override_dh_auto_configure: 16 | dh_auto_configure -- --with-gtk3 17 | -------------------------------------------------------------------------------- /distros/debian/rules-hal: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | %: 13 | dh $@ 14 | 15 | override_dh_auto_configure: 16 | dh_auto_configure -- --enable-hal --with-gtk2 17 | -------------------------------------------------------------------------------- /data/spacefm.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | _Name=SpaceFM 4 | Categories=System;FileTools;Utility;Core;GTK;FileManager; 5 | Exec=spacefm %F 6 | Icon=spacefm 7 | StartupNotify=true 8 | Type=Application 9 | Terminal=false 10 | MimeType=inode/directory;inode/mount-point;x-scheme-handler/ssh;x-scheme-handler/smb;x-scheme-handler/nfs;x-scheme-handler/ftp;x-scheme-handler/ptp;x-scheme-handler/mtp;x-scheme-handler/webdav;x-scheme-handler/http;x-scheme-handler/https; 11 | X-KDE-Protocols=ftp,smb,ssh,ptp,mtp,nfs,webdav,http,https 12 | _GenericName=File Manager 13 | _Comment=Browse the file system 14 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | SUBDIRS = etc src data po 4 | 5 | mimedir = $(datadir)/mime/packages 6 | mime_DATA = src/mime-type/spacefm-mime.xml 7 | 8 | bin_SCRIPTS = spacefm-installer 9 | 10 | EXTRA_DIST = \ 11 | autogen.sh \ 12 | $(mime_DATA) \ 13 | intltool-extract.in \ 14 | intltool-merge.in \ 15 | intltool-update.in 16 | 17 | if NO_PIXMAPS 18 | all-local: 19 | @echo 20 | @echo "IMPORTANT: After installation, run:" 21 | @echo " sudo gtk-update-icon-cache -q -t -f $(datadir)/icons/hicolor" 22 | @echo " sudo gtk-update-icon-cache -q -t -f $(datadir)/icons/Faenza" 23 | @echo 24 | endif 25 | -------------------------------------------------------------------------------- /etc/spacefm.conf: -------------------------------------------------------------------------------- 1 | # spacefm.conf 2 | # This file affects all users of SpaceFM on this system. 3 | 4 | # Documentation: /usr/share/doc/spacefm/spacefm-manual-en.html#programfiles-etc 5 | # http://ignorantguru.github.io/spacefm/spacefm-manual-en.html#programfiles-etc 6 | 7 | # tmp_dir must be a root-protected user-writable dir like /tmp 8 | # ALL users must be able to write to this dir. 9 | # tmp_dir must NOT contain spaces or special chars - keep it simple 10 | #tmp_dir=/tmp 11 | 12 | # Specify an absolute path to an additional terminal su or sudo program: 13 | #terminal_su=/bin/su 14 | 15 | # Specify an absolute path to an additional graphical su program: 16 | #graphical_su=/usr/bin/gksu 17 | 18 | -------------------------------------------------------------------------------- /src/compat/glib-utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C++ Interface: glib-mem 3 | * 4 | * Description: Compatibility macros for older versions of glib 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _GLIB_UTILS_H_ 14 | #define _GLIB_UTILS_H_ 15 | 16 | #include 17 | 18 | /* older versions of glib don't provde these API */ 19 | 20 | #if ! GLIB_CHECK_VERSION(2, 8, 0) 21 | int g_mkdir_with_parents(const gchar *pathname, int mode); 22 | #endif 23 | 24 | #if ! GLIB_CHECK_VERSION(2, 16, 0) 25 | int g_strcmp0(const char *str1, const char *str2); 26 | #endif 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /src/ptk/ptk-path-entry.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: ptk-path-entry 3 | * 4 | * Description: A custom entry widget with auto-completion 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _PTK_PATH_ENTRY_ 14 | #define _PTK_PATH_ENTRY_ 15 | 16 | #include 17 | #include "ptk-file-browser.h" 18 | 19 | G_BEGIN_DECLS 20 | 21 | typedef struct 22 | { 23 | PtkFileBrowser* browser; 24 | guint seek_timer; 25 | } EntryData; 26 | 27 | GtkWidget* ptk_path_entry_new( PtkFileBrowser* file_browser ); 28 | void ptk_path_entry_help( GtkWidget* widget, GtkWidget* parent ); 29 | 30 | G_END_DECLS 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/compat/glib-mem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C++ Interface: glib-mem 3 | * 4 | * Description: Compatibility macros for older versions of glib 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _GLIB_MEM_H_ 14 | #define _GLIB_MEM_H_ 15 | 16 | #include 17 | 18 | #if ! GLIB_CHECK_VERSION(2, 10, 0) 19 | /* older versions of glib don't provde g_slice API */ 20 | #define g_slice_alloc(size) g_malloc(size) 21 | #define g_slice_alloc0(size) g_malloc0(size) 22 | #define g_slice_new(type) g_new(type, 1) 23 | #define g_slice_new0(type) g_new0(type, 1) 24 | #define g_slice_free(type, mem) g_free(mem) 25 | #define g_slice_free1(size, mem) g_free(mem) 26 | #endif 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /src/private.h: -------------------------------------------------------------------------------- 1 | #ifndef PCMANFM_PRIVATE_H 2 | #define PCMANFM_PRIVATE_H 3 | 4 | #ifdef ENABLE_NLS 5 | # include 6 | # undef _ 7 | # define _(String) dgettext (GETTEXT_PACKAGE, String) 8 | # define C_(CString, MString) dpgettext (GETTEXT_PACKAGE, CString, MString) 9 | # define Q_(String) g_strip_context ((String), gettext (String)) 10 | # ifdef gettext_noop 11 | # define N_(String) gettext_noop (String) 12 | # else 13 | # define N_(String) (String) 14 | # endif 15 | #else 16 | # define textdomain(String) (String) 17 | # define gettext(String) (String) 18 | # define dgettext(Domain,Message) (Message) 19 | # define dcgettext(Domain,Message,Type) (Message) 20 | # define bindtextdomain(Domain,Directory) (Domain) 21 | # define _(String) (String) 22 | # define Q_(String) g_strip_context ((String), (String)) 23 | # define N_(String) (String) 24 | #endif 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /src/ptk/ptk-file-properties.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: file_properties 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _FILE_PROPERTIES_H_ 14 | #define _FILE_PROPERTIES_H_ 15 | 16 | #include 17 | 18 | G_BEGIN_DECLS 19 | 20 | GtkWidget* file_properties_dlg_new( GtkWindow* parent, 21 | const char* dir_path, 22 | GList* sel_files, int page ); 23 | 24 | void on_filePropertiesDlg_response (GtkDialog *dialog, 25 | gint response_id, 26 | gpointer user_data); 27 | 28 | G_END_DECLS 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /distros/debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://dep.debian.net/deps/dep5 2 | Upstream-Name: spacefm 3 | Source: https://github.com/IgnorantGuru/spacefm/tree/master/packages/ 4 | 5 | Files: * 6 | Copyright: 2012 IgnorantGuru 7 | License: GPL-3+ 8 | 9 | License: GPL-3+ 10 | This package is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation; either version 3 of the License, or 13 | (at your option) any later version. 14 | . 15 | This package is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | . 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see 22 | . 23 | On Debian systems, the complete text of the GNU General 24 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". 25 | -------------------------------------------------------------------------------- /src/ptk/ptk-dir-tree-view.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: ptkdirtreeview 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _PTK_DIR_TREE_VIEW_H_ 14 | #define _PTK_DIR_TREE_VIEW_H_ 15 | 16 | #include 17 | #include "ptk-file-browser.h" 18 | 19 | G_BEGIN_DECLS 20 | 21 | /* Create a new dir tree view */ 22 | GtkWidget* ptk_dir_tree_view_new( PtkFileBrowser* browser, 23 | gboolean show_hidden ); 24 | 25 | gboolean ptk_dir_tree_view_chdir( GtkTreeView* dir_tree_view, const char* path ); 26 | 27 | /* Return a newly allocated string containing path of current selected dir. */ 28 | char* ptk_dir_tree_view_get_selected_dir( GtkTreeView* dir_tree_view ); 29 | 30 | void ptk_dir_tree_view_show_hidden_files( GtkTreeView* dir_tree_view, 31 | gboolean show_hidden ); 32 | 33 | char* ptk_dir_view_get_dir_path( GtkTreeModel* model, GtkTreeIter* it ); 34 | 35 | G_END_DECLS 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /src/find-files.h: -------------------------------------------------------------------------------- 1 | /* 2 | * find-files.h 3 | * 4 | * Copyright 2008 PCMan 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _FIND_FILES_H 23 | #define _FIND_FILES_H 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | void fm_find_files( const char** search_dirs ); 30 | 31 | G_END_DECLS 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/vfs/vfs-execute.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: vfs-execute 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _VFS_EXECUTE_H_ 14 | #define _VFS_EXECUTE_H_ 15 | 16 | #include 17 | #include 18 | 19 | G_BEGIN_DECLS 20 | 21 | #define VFS_EXEC_DEFAULT_FLAGS (G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL) 22 | 23 | gboolean vfs_exec( const char* work_dir, 24 | char** argv, char** envp, 25 | const char* disp_name, 26 | GSpawnFlags flags, 27 | GError **err ); 28 | 29 | gboolean vfs_exec_on_screen( GdkScreen* screen, 30 | const char* work_dir, 31 | char** argv, char** envp, 32 | const char* disp_name, 33 | GSpawnFlags flags, 34 | gboolean use_startup_notify, 35 | GError **err ); 36 | 37 | G_END_DECLS 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /distros/debian/postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script for pcmanfm-mod 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `purge' 11 | # * `upgrade' 12 | # * `failed-upgrade' 13 | # * `abort-install' 14 | # * `abort-install' 15 | # * `abort-upgrade' 16 | # * `disappear' 17 | # 18 | # for details, see http://www.debian.org/doc/debian-policy/ or 19 | # the debian-policy package 20 | 21 | 22 | case "$1" in 23 | purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 24 | update-mime-database /usr/share/mime > /dev/null 25 | update-desktop-database -q 26 | ;; 27 | 28 | *) 29 | echo "postrm called with unknown argument \`$1'" >&2 30 | exit 1 31 | ;; 32 | esac 33 | 34 | # dh_installdeb will replace this with shell code automatically 35 | # generated by other debhelper scripts. 36 | 37 | #DEBHELPER# 38 | 39 | exit 0 40 | -------------------------------------------------------------------------------- /src/exo/exo-common.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXO_COMMON_H__ 2 | #define __EXO_COMMON_H__ 3 | 4 | /* Taken from exo v0.10.2 (Debian package libexo-1-0), according to changelog 5 | * commit f455681554ca205ffe49bd616310b19f5f9f8ef1 Dec 27 13:50:21 2012 */ 6 | 7 | G_BEGIN_DECLS 8 | 9 | #if defined(G_PARAM_STATIC_NAME) && defined(G_PARAM_STATIC_NICK) && defined(G_PARAM_STATIC_BLURB) 10 | #define EXO_PARAM_READABLE (G_PARAM_READABLE \ 11 | | G_PARAM_STATIC_NAME \ 12 | | G_PARAM_STATIC_NICK \ 13 | | G_PARAM_STATIC_BLURB) 14 | #define EXO_PARAM_WRITABLE (G_PARAM_WRITABLE \ 15 | | G_PARAM_STATIC_NAME \ 16 | | G_PARAM_STATIC_NICK \ 17 | | G_PARAM_STATIC_BLURB) 18 | #define EXO_PARAM_READWRITE (G_PARAM_READWRITE \ 19 | | G_PARAM_STATIC_NAME \ 20 | | G_PARAM_STATIC_NICK \ 21 | | G_PARAM_STATIC_BLURB) 22 | #else 23 | #define EXO_PARAM_READABLE (G_PARAM_READABLE) 24 | #define EXO_PARAM_WRITABLE (G_PARAM_WRITABLE) 25 | #define EXO_PARAM_READWRITE (G_PARAM_READWRITE) 26 | #endif 27 | 28 | G_END_DECLS 29 | 30 | #endif /* !__EXO_COMMON_H__ */ 31 | -------------------------------------------------------------------------------- /data/mount.rules: -------------------------------------------------------------------------------- 1 | # This file contains default HAL mount options for SpaceFM 2 | # This file is only used if SpaceFM is built with HAL support (which is no 3 | # longer the default.) 4 | 5 | # Notes from pcmanfm legacy: 6 | # If mount options are already specfied for a volume in /etc/fstab, then 7 | # 'mount' command will be used, and it will follow /etc/fstab. 8 | # If a volume is not defined in /etc/fstab, such as removable usb disk, 9 | # the mount options defined in this file will be used. 10 | # I know this sucks. Personally, I don't like to do this either. 11 | # However, unfortunately the latest HAL forced us to do so. 12 | # http://www.linuxfromscratch.org/blfs/view/svn/general/hal.html 13 | 14 | [vfat] 15 | mount_options=shortname=mixed;uid=;utf8;umask=077;exec 16 | 17 | # mount_options=shortname=mixed;uid=;utf8;umask=077;exec;usefree 18 | # Sometimes, adding a 'usefree' option is required due to bugs in the kernel. 19 | # See: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/133567 20 | 21 | [udf] 22 | mount_options=uid=;exec 23 | 24 | [ntfs-3g] 25 | mount_options=locale=;exec 26 | 27 | [ntfs] 28 | mount_options=umask=222;utf8;exec 29 | fstype_override=ntfs-3g 30 | 31 | [iso9660] 32 | mount_options=uid=;utf8;exec 33 | 34 | [hfs] 35 | mount_options=uid= 36 | -------------------------------------------------------------------------------- /distros/debian/control-gtk3: -------------------------------------------------------------------------------- 1 | Source: spacefm-gtk3 2 | Section: utils 3 | Priority: optional 4 | Maintainer: IgnorantGuru 5 | Build-Depends: debhelper (>= 7.0.50~), autotools-dev, build-essential, 6 | desktop-file-utils, libc6, libcairo2, libglib2.0-0, libglib2.0-dev, 7 | libgtk-3-0, libgtk-3-dev, libgtk-3-bin, libpango1.0-0, libx11-6, 8 | shared-mime-info, intltool, pkg-config, fakeroot, 9 | libudev0 (>=143) | libudev1, libudev-dev, libffmpegthumbnailer-dev 10 | Standards-Version: 3.9.1 11 | Homepage: http://ignorantguru.github.com/spacefm/ 12 | 13 | Package: spacefm-gtk3 14 | Architecture: any 15 | Depends: desktop-file-utils, bash (>=2.0), libc6, libcairo2, libglib2.0-0, 16 | libgtk-3-0, libgtk-3-bin, libpango1.0-0, libx11-6, shared-mime-info, 17 | libudev0 (>=143) | libudev1, 18 | libffmpegthumbnailer4 | libffmpegthumbnailer4v5 19 | Recommends: 20 | Suggests: udevil, pmount, eject, udisks, lsof, wget, ktsuss, gksu, dbus, 21 | libdbus-1-3, libdbus-1-dev, libstartup-notification0, 22 | libstartup-notification0-dev, jmtpfs, fuseiso 23 | Conflicts: spacefm, spacefm-hal, spacefm-common 24 | Description: A multi-panel tabbed file manager with built-in VFS, udev-based 25 | device manager, customizable menu system, and bash integration. GTK3 version. 26 | 27 | -------------------------------------------------------------------------------- /distros/debian/control: -------------------------------------------------------------------------------- 1 | Source: spacefm 2 | Section: utils 3 | Priority: optional 4 | Maintainer: IgnorantGuru 5 | Build-Depends: debhelper (>= 7.0.50~), autotools-dev, bash, build-essential, 6 | desktop-file-utils, libc6, libcairo2, libglib2.0-0, libglib2.0-dev, 7 | libgtk2.0-0 (>= 2.18), libgtk2.0-dev, libgtk2.0-bin, libpango1.0-0, libx11-6, 8 | shared-mime-info, intltool, pkg-config, fakeroot, 9 | libudev0 (>=143) | libudev1, libudev-dev, libffmpegthumbnailer-dev 10 | Standards-Version: 3.9.1 11 | Homepage: http://ignorantguru.github.com/spacefm/ 12 | 13 | Package: spacefm 14 | Architecture: any 15 | Depends: desktop-file-utils, bash (>=2.0), libc6, libcairo2, libglib2.0-0, 16 | libgtk2.0-0 (>= 2.18), libgtk2.0-bin, libpango1.0-0, libx11-6, 17 | shared-mime-info, libudev0 (>=143) | libudev1, 18 | libffmpegthumbnailer4 | libffmpegthumbnailer4v5 19 | Recommends: 20 | Suggests: udevil, pmount, eject, udisks, lsof, wget, ktsuss, gksu, dbus, 21 | libdbus-1-3, libdbus-1-dev, libstartup-notification0, 22 | libstartup-notification0-dev, jmtpfs, fuseiso 23 | Conflicts: spacefm-hal, spacefm-gtk3, spacefm-common 24 | Description: A multi-panel tabbed file manager with built-in VFS, udev-based 25 | device manager, customizable menu system, and bash integration. 26 | 27 | -------------------------------------------------------------------------------- /src/spacefm-auth: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script (spacefm-auth) is used internally by spacefm to authenticate 3 | # temporary scripts run as another user. This file should not be modified 4 | # or run directly. 5 | 6 | if [ "$1" = "root" ]; then 7 | shift 8 | fm_root=1 9 | else 10 | fm_root=0 11 | fi 12 | 13 | if [ "$2" = "" ]; then 14 | echo "spacefm-auth: This script is used internally by spacefm and is not" 1>&2 15 | echo " designed to be run directly." 1>&2 16 | exit 1 17 | fi 18 | 19 | fm_source="$1" 20 | fm_sum="$2" 21 | 22 | if [ ! -f "$fm_source" ]; then 23 | echo "spacefm-auth: error: missing file" 24 | exit 1 25 | fi 26 | 27 | if [ ${#fm_sum} -eq 64 ]; then 28 | fm_sha=/usr/bin/sha256sum 29 | elif [ ${#fm_sum} -eq 128 ]; then 30 | fm_sha=/usr/bin/sha512sum 31 | else 32 | echo "spacefm-auth: error: invalid sum" 1>&2 33 | exit 1 34 | fi 35 | 36 | if (( fm_root == 1 )); then 37 | chown root:root "$(dirname "$fm_source")" || exit 1 38 | chmod ugo+rwx,+t "$(dirname "$fm_source")" || exit 1 39 | chmod go-rwx "$fm_source" || exit 1 40 | fi 41 | 42 | if [ "$($fm_sha "$fm_source")" != "$fm_sum $fm_source" ]; then 43 | echo "spacefm-auth: error: $fm_sha mismatch" 1>&2 44 | exit 1 45 | fi 46 | 47 | export fm_sum 48 | /bin/bash "$fm_source" run 49 | exit $? 50 | 51 | -------------------------------------------------------------------------------- /src/spacefm-auth.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script (spacefm-auth) is used internally by spacefm to authenticate 3 | # temporary scripts run as another user. This file should not be modified 4 | # or run directly. 5 | 6 | if [ "$1" = "root" ]; then 7 | shift 8 | fm_root=1 9 | else 10 | fm_root=0 11 | fi 12 | 13 | if [ "$2" = "" ]; then 14 | echo "spacefm-auth: This script is used internally by spacefm and is not" 1>&2 15 | echo " designed to be run directly." 1>&2 16 | exit 1 17 | fi 18 | 19 | fm_source="$1" 20 | fm_sum="$2" 21 | 22 | if [ ! -f "$fm_source" ]; then 23 | echo "spacefm-auth: error: missing file" 24 | exit 1 25 | fi 26 | 27 | if [ ${#fm_sum} -eq 64 ]; then 28 | fm_sha=/usr/bin/sha256sum 29 | elif [ ${#fm_sum} -eq 128 ]; then 30 | fm_sha=/usr/bin/sha512sum 31 | else 32 | echo "spacefm-auth: error: invalid sum" 1>&2 33 | exit 1 34 | fi 35 | 36 | if (( fm_root == 1 )); then 37 | chown root:root "$(dirname "$fm_source")" || exit 1 38 | chmod ugo+rwx,+t "$(dirname "$fm_source")" || exit 1 39 | chmod go-rwx "$fm_source" || exit 1 40 | fi 41 | 42 | if [ "$($fm_sha "$fm_source")" != "$fm_sum $fm_source" ]; then 43 | echo "spacefm-auth: error: $fm_sha mismatch" 1>&2 44 | exit 1 45 | fi 46 | 47 | export fm_sum 48 | /bin/bash "$fm_source" run 49 | exit $? 50 | 51 | -------------------------------------------------------------------------------- /distros/debian/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postinst script for pcmanfm-mod 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-remove' 14 | # * `abort-deconfigure' `in-favour' 15 | # `removing' 16 | # 17 | # for details, see http://www.debian.org/doc/debian-policy/ or 18 | # the debian-policy package 19 | 20 | 21 | case "$1" in 22 | configure) 23 | update-mime-database /usr/share/mime > /dev/null 24 | update-desktop-database -q 25 | gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor 26 | gtk-update-icon-cache -q -t -f /usr/share/icons/Faenza 27 | ;; 28 | 29 | abort-upgrade|abort-remove|abort-deconfigure) 30 | ;; 31 | 32 | *) 33 | echo "postinst called with unknown argument \`$1'" >&2 34 | exit 1 35 | ;; 36 | esac 37 | 38 | # dh_installdeb will replace this with shell code automatically 39 | # generated by other debhelper scripts. 40 | 41 | #DEBHELPER# 42 | 43 | exit 0 44 | -------------------------------------------------------------------------------- /src/pcmanfm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pcmanfm.h 3 | * 4 | * Copyright 2008 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _PCMANFM_H_ 23 | #define _PCMANFM_H_ 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | /* After opening any window/dialog/tool, this should be called. */ 30 | void pcmanfm_ref(); 31 | 32 | /* After closing any window/dialog/tool, this should be called. 33 | * If the last window is closed and we are not a deamon, pcmanfm will quit. 34 | */ 35 | gboolean pcmanfm_unref(); 36 | 37 | G_END_DECLS 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/exo/exo-gtk-extensions.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004-2006 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 3 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef __EXO_GTK_EXTENSIONS_H__ 23 | #define __EXO_GTK_EXTENSIONS_H__ 24 | 25 | #include 26 | 27 | /* Taken from exo v0.10.2 (Debian package libexo-1-0), according to changelog 28 | * commit f455681554ca205ffe49bd616310b19f5f9f8ef1 Dec 27 13:50:21 2012 */ 29 | 30 | G_BEGIN_DECLS 31 | 32 | void exo_gtk_file_chooser_add_thumbnail_preview (GtkFileChooser *chooser); 33 | 34 | G_END_DECLS 35 | 36 | #endif /* !__EXO_GTK_EXTENSIONS_H__ */ 37 | -------------------------------------------------------------------------------- /src/vfs/vfs-utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * vfs-utils.h 3 | * 4 | * Copyright 2008 PCMan 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _VFS_UTILS_H_ 23 | #define _VFS_UTILS_H_ 24 | 25 | #include 26 | 27 | GdkPixbuf* vfs_load_icon( GtkIconTheme* theme, const char* icon_name, int size ); 28 | 29 | /* execute programs with sudo */ 30 | #ifdef HAVE_HAL 31 | gboolean vfs_sudo_cmd_sync( const char* cwd, char* argv[], 32 | int* exit_status, 33 | char** pstdout, char** pstderr, GError** err ); //MOD 34 | 35 | //gboolean vfs_sudo_cmd_async( const char* cwd, char* argv[], GError** err ); //MOD 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /distros/debian/control-hal: -------------------------------------------------------------------------------- 1 | Source: spacefm-hal 2 | Section: utils 3 | Priority: optional 4 | Maintainer: IgnorantGuru 5 | Build-Depends: debhelper (>= 7.0.50~), autotools-dev, build-essential, dbus, 6 | desktop-file-utils, libc6, libcairo2, libdbus-1-3, libglib2.0-0, bash, 7 | libgtk2.0-0 (>= 2.18), libgtk2.0-bin, libpango1.0-0, libstartup-notification0, 8 | libx11-6, shared-mime-info, intltool, pkg-config, libgtk2.0-dev (>= 2.18), 9 | libglib2.0-dev, fakeroot, libstartup-notification0-dev, libdbus-1-dev, hal, 10 | libhal-dev, libhal-storage-dev, libdbus-glib-1-dev, libhal-storage1, libhal1, 11 | libdbus-glib-1-2, libffmpegthumbnailer-dev 12 | Standards-Version: 3.9.1 13 | Homepage: http://ignorantguru.github.com/spacefm/ 14 | 15 | Package: spacefm-hal 16 | Architecture: any 17 | Depends: dbus, desktop-file-utils, bash (>=2.0), libc6, libcairo2, libdbus-1-3, 18 | libglib2.0-0, libgtk2.0-0 (>= 2.18), libgtk2.0-bin, libpango1.0-0, 19 | libstartup-notification0, libx11-6, shared-mime-info, 20 | hal, libhal-storage1, libhal1, libdbus-glib-1-2, 21 | libffmpegthumbnailer4 | libffmpegthumbnailer4v5 22 | Recommends: 23 | Suggests: eject, lsof, wget, ktsuss, gksu 24 | Conflicts: spacefm, spacefm-gtk3, spacefm-common 25 | Description: A multi-panel tabbed file manager with built-in VFS, udev-based 26 | device manager*, customizable menu system, and bash integration. 27 | * This package is built with deprecated HAL support in place of udev 28 | (HAL device manager functions are very limited). 29 | 30 | -------------------------------------------------------------------------------- /po/update-pot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script updates spacefm.pot and modifies comments 4 | 5 | curdir=`pwd` 6 | if [ "$(basename "$curdir")" != "po" ] || [ ! -e POTFILES.in ]; then 7 | echo "spacefm: update-pot: This script must be run from spacefm's po subdirectory" 8 | exit 1 9 | fi 10 | 11 | # get configure version 12 | ver=`grep -m 1 "^AC_INIT(\[spacefm\], \[" "../configure.ac" \ 13 | | sed "s/AC_INIT(\[spacefm\], \[\(.*\)\])/\1/"` 14 | if [ "$ver" = "" ]; then 15 | echo "spacefm: update-pot: cannot get configure.ac version" 16 | exit 1 17 | fi 18 | 19 | rm -f spacefm.pot 20 | intltool-update --pot 21 | if [ $? -ne 0 ] || [ ! -s spacefm.pot ]; then 22 | echo "spacefm: update-pot: error creating spacefm.pot" 23 | exit 2 24 | fi 25 | sed -i 's/# SOME DESCRIPTIVE TITLE\./# SpaceFM PO Template http:\/\/ignorantguru.github.io\/spacefm\//' spacefm.pot 26 | sed -i "/# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER/d" spacefm.pot 27 | sed -i 's/# This file is distributed under the same license as the PACKAGE package\./# This file is distributed under the same copyright and license as the SpaceFM\x0A# package./' spacefm.pot 28 | sed -i s/'"Project-Id-Version: PACKAGE VERSION\\n"'/"\"Project-Id-Version: spacefm ${ver}\\\n\""/ spacefm.pot 29 | sed -i s/'"POT-Creation-Date: .*\\n"'/"\"POT-Creation-Date: $(date -u '+%Y-%m-%d %H:%M+0000')\\\n\""/ spacefm.pot 30 | 31 | head -n 20 spacefm.pot 32 | echo 33 | # Check for unincluded files because this warning causes a Debian build error 34 | intltool-update --maintain 35 | -------------------------------------------------------------------------------- /src/item-prop.h: -------------------------------------------------------------------------------- 1 | #ifndef _ITEM_PROP_H_ 2 | #define _ITEM_PROP_H_ 3 | 4 | #include 5 | 6 | G_BEGIN_DECLS 7 | 8 | enum { 9 | CONTEXT_SHOW, 10 | CONTEXT_ENABLE, 11 | CONTEXT_HIDE, 12 | CONTEXT_DISABLE 13 | }; 14 | 15 | enum { 16 | CONTEXT_MIME, 17 | CONTEXT_NAME, 18 | CONTEXT_DIR, 19 | CONTEXT_WRITE_ACCESS, 20 | CONTEXT_IS_TEXT, 21 | CONTEXT_IS_DIR, 22 | CONTEXT_IS_LINK, 23 | CONTEXT_IS_ROOT, 24 | CONTEXT_MUL_SEL, 25 | CONTEXT_CLIP_FILES, 26 | CONTEXT_CLIP_TEXT, 27 | CONTEXT_PANEL, 28 | CONTEXT_PANEL_COUNT, 29 | CONTEXT_TAB, 30 | CONTEXT_TAB_COUNT, 31 | CONTEXT_BOOKMARK, 32 | CONTEXT_DEVICE, 33 | CONTEXT_DEVICE_MOUNT_POINT, 34 | CONTEXT_DEVICE_LABEL, 35 | CONTEXT_DEVICE_FSTYPE, 36 | CONTEXT_DEVICE_UDI, 37 | CONTEXT_DEVICE_PROP, 38 | CONTEXT_TASK_COUNT, 39 | CONTEXT_TASK_DIR, 40 | CONTEXT_TASK_TYPE, 41 | CONTEXT_TASK_NAME, 42 | CONTEXT_PANEL1_DIR, 43 | CONTEXT_PANEL2_DIR, 44 | CONTEXT_PANEL3_DIR, 45 | CONTEXT_PANEL4_DIR, 46 | CONTEXT_PANEL1_SEL, 47 | CONTEXT_PANEL2_SEL, 48 | CONTEXT_PANEL3_SEL, 49 | CONTEXT_PANEL4_SEL, 50 | CONTEXT_PANEL1_DEVICE, 51 | CONTEXT_PANEL2_DEVICE, 52 | CONTEXT_PANEL3_DEVICE, 53 | CONTEXT_PANEL4_DEVICE, 54 | CONTEXT_END 55 | }; 56 | 57 | void xset_item_prop_dlg( XSetContext* context, XSet* set, int page ); 58 | int xset_context_test( XSetContext* context, char* rules, gboolean def_disable ); 59 | 60 | G_END_DECLS 61 | 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /src/desktop/desktop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * desktop.h 3 | * 4 | * Copyright 2008 PCMan 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _DESKTOP_H_ 23 | #define _DESKTOP_H_ 24 | 25 | #ifdef HAVE_CONFIG_H 26 | # include 27 | #endif 28 | 29 | #include 30 | #include "desktop-window.h" 31 | 32 | 33 | G_BEGIN_DECLS 34 | 35 | void fm_turn_on_desktop_icons( gboolean transparent ); 36 | void fm_turn_off_desktop_icons(); 37 | void fm_desktop_update_thumbnails(); 38 | void fm_desktop_update_wallpaper( gboolean transparency_changed ); 39 | void fm_desktop_update_colors(); 40 | void fm_desktop_update_icons(); 41 | void fm_desktop_set_single_click( gboolean single_click ); 42 | 43 | G_END_DECLS 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | [encoding: UTF-8] 2 | # List of source files containing translatable strings. 3 | data/spacefm-folder-handler.desktop.in 4 | data/spacefm-find.desktop.in 5 | data/spacefm.desktop.in 6 | [type: gettext/glade]data/ui/about-dlg.ui 7 | [type: gettext/glade]data/ui/appchooserdlg.ui 8 | [type: gettext/glade]data/ui/file_properties.ui 9 | [type: gettext/glade]data/ui/find-files.ui 10 | [type: gettext/glade]data/ui/find-files2.ui 11 | [type: gettext/glade]data/ui/godlg.ui 12 | [type: gettext/glade]data/ui/prefdlg.ui 13 | [type: gettext/glade]data/ui/prefdlg2.ui 14 | src/cust-dialog.c 15 | src/cust-dialog.h 16 | src/main.c 17 | src/main-window.c 18 | src/pref-dialog.c 19 | src/settings.c 20 | src/ptk/ptk-file-browser.c 21 | src/ptk/ptk-location-view.c 22 | src/ptk/ptk-file-task.c 23 | src/ptk/ptk-file-archiver.c 24 | src/ptk/ptk-console-output.c 25 | src/ptk/ptk-dir-tree.c 26 | src/ptk/ptk-file-menu.c 27 | src/ptk/ptk-file-misc.c 28 | src/ptk/ptk-file-properties.c 29 | src/ptk/ptk-path-entry.c 30 | src/ptk/ptk-handler.c 31 | src/ptk/ptk-app-chooser.c 32 | src/vfs/vfs-app-desktop.c 33 | src/vfs/vfs-file-info.c 34 | src/vfs/vfs-file-task.c 35 | src/vfs/vfs-volume-hal.c 36 | src/vfs/vfs-volume-nohal.c 37 | src/desktop/desktop.c 38 | src/desktop/desktop-window.c 39 | src/find-files.c 40 | src/item-prop.c 41 | src/exo/exo-cell-renderer-ellipsized-text.c 42 | src/exo/exo-cell-renderer-icon.c 43 | src/exo/exo-gdk-pixbuf-extensions.c 44 | src/exo/exo-gtk-extensions.c 45 | src/exo/exo-icon-chooser-dialog.c 46 | src/exo/exo-icon-chooser-model.c 47 | src/exo/exo-thumbnail-preview.c 48 | -------------------------------------------------------------------------------- /src/ptk/ptk-file-archiver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpaceFM ptk-file-archiver.h 3 | * 4 | * Copyright (C) 2013-2014 OmegaPhil 5 | * Copyright (C) 2014 IgnorantGuru 6 | * Copyright (C) 2006 Hong Jen Yee (PCMan) 7 | * 8 | * License: See COPYING file 9 | * 10 | */ 11 | 12 | #ifndef _PTK_FILE_ARCHIVER_H_ 13 | #define _PTK_FILE_ARCHIVER_H_ 14 | 15 | #include 16 | #include 17 | 18 | #include "vfs-mime-type.h" 19 | #include "ptk-file-browser.h" 20 | 21 | G_BEGIN_DECLS 22 | 23 | 24 | // Archive operations enum 25 | enum { 26 | ARC_COMPRESS, 27 | ARC_EXTRACT, 28 | ARC_LIST 29 | }; 30 | 31 | // Pass file_browser or desktop depending on where you're calling from 32 | void ptk_file_archiver_create( DesktopWindow *desktop, 33 | PtkFileBrowser *file_browser, GList *files, 34 | const char *cwd ); 35 | void ptk_file_archiver_extract( DesktopWindow *desktop, 36 | PtkFileBrowser *file_browser, 37 | GList *files, const char *cwd, 38 | const char *dest_dir, int job, 39 | gboolean archive_presence_checked ); 40 | 41 | // At least a mime type or extension is required - mime type preferred 42 | gboolean ptk_file_archiver_is_format_supported( VFSMimeType* mime, 43 | const char* extension, 44 | int operation ); 45 | 46 | G_END_DECLS 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /src/exo/exo-utils.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 3 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __EXO_UTILS_H__ 21 | #define __EXO_UTILS_H__ 22 | 23 | #include 24 | 25 | /* Taken from exo v0.10.2 (Debian package libexo-1-0), according to changelog 26 | * commit f455681554ca205ffe49bd616310b19f5f9f8ef1 Dec 27 13:50:21 2012 */ 27 | 28 | G_BEGIN_DECLS 29 | 30 | void exo_noop (void) G_GNUC_PURE; 31 | gint exo_noop_one (void) G_GNUC_PURE; 32 | gint exo_noop_zero (void) G_GNUC_PURE; 33 | gpointer exo_noop_null (void) G_GNUC_PURE; 34 | gboolean exo_noop_true (void) G_GNUC_PURE; 35 | gboolean exo_noop_false (void) G_GNUC_PURE; 36 | 37 | 38 | G_END_DECLS 39 | 40 | #endif /* !__EXO_UTILS_H__ */ 41 | -------------------------------------------------------------------------------- /src/ptk/ptk-input-dialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: ptk-input-dialog 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2005 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _PTK_INPUT_DIALOG_H_ 14 | #define _PTK_INPUT_DIALOG_H_ 15 | 16 | #include 17 | 18 | /* 19 | * Create a dialog used to prompt the user to input a string. 20 | * title: the title of dialog. 21 | * prompt: prompt showed to the user 22 | */ 23 | GtkWidget* ptk_input_dialog_new( const char* title, 24 | const char* prompt, 25 | const char* default_text, 26 | GtkWindow* parent ); 27 | 28 | /* 29 | * Get user input from the text entry of the input dialog. 30 | * The returned string should be freed when no longer needed. 31 | * widget: the input dialog 32 | */ 33 | gchar* ptk_input_dialog_get_text( GtkWidget* input_dialog ); 34 | 35 | /* 36 | * Get the prompt label of the input dialog. 37 | * input_dialog: the input dialog 38 | */ 39 | GtkWidget* ptk_input_dialog_get_label( GtkWidget* input_dialog ); 40 | 41 | /* 42 | * Get the text entry widget of the input dialog. 43 | * input_dialog: the input dialog 44 | */ 45 | GtkWidget* ptk_input_dialog_get_entry( GtkWidget* input_dialog ); 46 | 47 | /* 48 | * Used to prompt the user to input a string. 49 | * The returned string should be freed when no longer needed. 50 | */ 51 | /* 52 | char* ptk_input_dialog_get_user_input( const char* title, 53 | const char* prompt ); 54 | */ 55 | 56 | #endif 57 | 58 | -------------------------------------------------------------------------------- /po/ChangeLog: -------------------------------------------------------------------------------- 1 | 2013-05-04 miroslav 2 | 3 | * added sr@latin.po 4 | 5 | 2013-04-29 IgnorantGuru 6 | 7 | * removed translable strings from exo-icon-view.c exo-tree-view.c 8 | * removed exo-icon-view.c exo-tree-view.c from potfiles.in 9 | 10 | 2013-02-13 IgnorantGuru 11 | 12 | * merged all po files for upload 13 | * see https://www.transifex.com/projects/p/spacefm/ 14 | 15 | 2012-10-25 IgnorantGuru 16 | 17 | * POTFILES.in updated for prefdlg2.ui 18 | 19 | 2012-10-16 tct1501 20 | 21 | * partial nl.po 22 | 23 | 2012-09-10 IgnorantGuru 24 | 25 | * POTFILES.in updated for cust-dialog.c cust-dialog.h 26 | 27 | 2012-07-16 Vladimir Kudrya 28 | 29 | * completed ru.po 30 | 31 | 2012-06-24 Tomas Forsman 32 | 33 | * partially completed new sv.po 34 | 35 | 2012-06-13 Jean-Philippe Fleury 36 | 37 | * updated fr.po 38 | 39 | 2012-02-08 IgnorantGuru 40 | 41 | * spacefm POTFILES.in and translatable strings updated 42 | 43 | 2009-04-27 Og Maciel 44 | 45 | * pt_BR.po: Updated Brazilian Portuguese translation by 46 | Henrique P. Machado. 47 | 48 | 2009-01-26 Og Maciel 49 | 50 | * pcmanfm.pot: Updated. 51 | * POTFILES.in: Updated. 52 | * pt.po: Renamed from pt_PT.po as there is no pt_PT. 53 | * .po: Updated all message catalogs against the updated pcmanfm.pot file. 54 | * LINGUAS: Added with available languages. 55 | -------------------------------------------------------------------------------- /distros/debian/README-DEBIAN: -------------------------------------------------------------------------------- 1 | README-DEBIAN for SpaceFM 2 | 3 | The files in distros/debian/ may be used to build a binary deb package of 4 | SpaceFM for use on Debian-based distros (Lenny and later). 5 | 6 | For official Debian packages, please see Debian repositories: 7 | http://packages.debian.org/search?keywords=spacefm&searchon=names&suite=all§ion=all 8 | or the SpaceFM Debian Wiki: 9 | https://github.com/IgnorantGuru/spacefm/wiki/Debian 10 | 11 | To build a Debian package: 12 | 13 | 1) Install build dependencies for your build (see DEPENDENCIES in README), 14 | plus debhelper. 15 | 16 | 2) Download and extract the desired SpaceFM version. See DOWNLOAD in README. 17 | 18 | 3) Move the distros/debian directory into the source directory: 19 | 20 | mv distros/debian . 21 | 22 | NOTE: For some Debian versions, some adjustments to the 'control' file 23 | (package names used for dependencies) may be necessary. 24 | 25 | 4) IF GTK3 support IS desired: 26 | 27 | cp debian/control-gtk3 debian/control 28 | cp debian/rules-gtk3 debian/rules 29 | sed -i 's/^spacefm \(.*\)/spacefm-gtk3 \1/' debian/changelog 30 | 31 | 5) IF hal support IS desired (cannot be used with GTK3 unless you edit rules): 32 | 33 | cp debian/control-hal debian/control 34 | cp debian/rules-hal debian/rules 35 | sed -i 's/^spacefm \(.*\)/spacefm-hal \1/' debian/changelog 36 | 37 | 6) Build package: 38 | 39 | dpkg-buildpackage -b -uc 40 | 41 | # The package files will appear in the parent directory: 42 | cd .. 43 | # Clean up: 44 | rm -rf spacefm-* spacefm.tar.gz 45 | 46 | 7) To install the package you built: 47 | 48 | dpkg -i spacefm*.deb 49 | -------------------------------------------------------------------------------- /src/mime-type/spacefm-mime.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Windows installer 19 | Windows 安裝程式 20 | 21 | 22 | 23 | 24 | MS VBScript 25 | 26 | 27 | 28 | 29 | C# source 30 | C# 程式碼 31 | 32 | 33 | 34 | 35 | 應用程式捷徑 36 | 37 | 38 | 39 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/ptk/ptk-app-chooser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: appchooserdlg 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _APP_CHOOSER_DLG_H_ 14 | #define _APP_CHOOSER_DLG_H_ 15 | 16 | #include 17 | #include "vfs-mime-type.h" 18 | 19 | G_BEGIN_DECLS 20 | 21 | /* Let the user choose a application */ 22 | gchar* ptk_choose_app_for_mime_type( GtkWindow* parent, 23 | VFSMimeType* mime_type, 24 | gboolean focus_all_apps, 25 | gboolean show_command, 26 | gboolean show_default, 27 | gboolean dir_default ); 28 | 29 | 30 | /* 31 | * Return selected application in a ``newly allocated'' string. 32 | * Returned string is the file name of the *.desktop file or a command line. 33 | * These two can be separated by check if the returned string is ended 34 | * with ".desktop". 35 | */ 36 | gchar* app_chooser_dialog_get_selected_app( GtkWidget* dlg ); 37 | 38 | /* 39 | * Check if the user set the selected app default handler. 40 | */ 41 | gboolean app_chooser_dialog_get_set_default( GtkWidget* dlg ); 42 | void ptk_app_chooser_has_handler_warn( GtkWidget* parent, VFSMimeType* mime_type ); 43 | 44 | 45 | void 46 | on_notebook_switch_page (GtkNotebook *notebook, 47 | GtkWidget *page, 48 | guint page_num, 49 | gpointer user_data); 50 | 51 | void 52 | on_browse_btn_clicked (GtkButton *button, 53 | gpointer user_data); 54 | 55 | 56 | G_END_DECLS 57 | 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /src/ptk/ptk-clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: ptk-clipboard 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _PTK_CLIPBOARD_H_ 14 | #define _PTK_CLIPBOARD_H_ 15 | 16 | #include 17 | #include 18 | 19 | G_BEGIN_DECLS 20 | 21 | void ptk_clipboard_cut_or_copy_files( const char* working_dir, 22 | GList* files, 23 | gboolean copy ); 24 | 25 | void ptk_clipboard_copy_as_text( const char* working_dir, 26 | GList* files ); //MOD added 27 | 28 | void ptk_clipboard_copy_name( const char* working_dir, 29 | GList* files ); //MOD added 30 | 31 | void ptk_clipboard_paste_files( GtkWindow* parent_win, 32 | const char* dest_dir, GtkTreeView* task_view, 33 | GFunc callback, GtkWindow* callback_win ); 34 | 35 | void ptk_clipboard_paste_links( GtkWindow* parent_win, 36 | const char* dest_dir, 37 | GtkTreeView* task_view, 38 | GFunc callback, GtkWindow* callback_win ); 39 | 40 | void ptk_clipboard_paste_targets( GtkWindow* parent_win, 41 | const char* dest_dir, 42 | GtkTreeView* task_view, 43 | GFunc callback, GtkWindow* callback_win ); 44 | 45 | void ptk_clipboard_copy_text( const char* text ); //MOD added 46 | 47 | void ptk_clipboard_copy_file_list( char** path, gboolean copy ); //sfm 48 | 49 | GList* ptk_clipboard_get_file_paths( const char* cwd, gboolean* is_cut, 50 | gint* missing_targets ); //sfm 51 | 52 | G_END_DECLS 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/ptk/ptk-file-icon-renderer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: ptkfileiconrenderer 3 | * 4 | * Description: PtkFileIconRenderer is used to render file icons 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | 14 | #ifndef _PTK_FILE_ICON_RENDERER_H_ 15 | #define _PTK_FILE_ICON_RENDERER_H_ 16 | 17 | #include 18 | #include "vfs-file-info.h" 19 | 20 | G_BEGIN_DECLS 21 | 22 | #define PTK_TYPE_FILE_ICON_RENDERER (ptk_file_icon_renderer_get_type()) 23 | #define PTK_FILE_ICON_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PTK_TYPE_FILE_ICON_RENDERER, PtkFileIconRenderer)) 24 | #define PTK_FILE_ICON_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PTK_TYPE_FILE_ICON_RENDERER, PtkFileIconRendererClass)) 25 | #define PTK_IS_FILE_ICON_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PTK_TYPE_FILE_ICON_RENDERER)) 26 | #define PTK_IS_FILE_ICON_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PTK_TYPE_FILE_ICON_RENDERER)) 27 | #define PTK_FILE_ICON_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PTK_TYPE_FILE_ICON_RENDERER, PtkFileIconRendererClass)) 28 | 29 | typedef struct _PtkFileIconRenderer PtkFileIconRenderer; 30 | typedef struct _PtkFileIconRendererClass PtkFileIconRendererClass; 31 | 32 | struct _PtkFileIconRenderer 33 | { 34 | GtkCellRendererPixbuf parent; 35 | 36 | /* Private */ 37 | /* FIXME: draw some additional marks for symlinks */ 38 | VFSFileInfo* info; 39 | /* long flags; */ 40 | gboolean follow_state; 41 | }; 42 | 43 | struct _PtkFileIconRendererClass 44 | { 45 | GtkCellRendererPixbufClass parent_class; 46 | }; 47 | 48 | GType ptk_file_icon_renderer_get_type (void); 49 | 50 | GtkCellRenderer *ptk_file_icon_renderer_new (void); 51 | 52 | 53 | G_END_DECLS 54 | 55 | #endif /* _PTK_FILE_ICON_RENDERER_H_ */ 56 | 57 | -------------------------------------------------------------------------------- /src/vfs/vfs-volume-hal-options.c: -------------------------------------------------------------------------------- 1 | #ifdef HAVE_CONFIG_H 2 | #include 3 | #endif 4 | 5 | #include "vfs-volume-hal-options.h" 6 | 7 | #include 8 | #include /* for getuid() */ 9 | #include 10 | 11 | #include /* for setlocale() */ 12 | 13 | #define CONFIG_FILE PACKAGE_DATA_DIR "/mount.rules" 14 | 15 | gboolean vfs_volume_hal_get_options( const char* fs, VFSVolumeOptions* ret ) 16 | { 17 | GKeyFile* f; 18 | if( fs == NULL || ! *fs) 19 | return FALSE; 20 | g_return_val_if_fail( ret != NULL, FALSE ); 21 | 22 | f = g_key_file_new(); 23 | if( g_key_file_load_from_file( f, CONFIG_FILE, 0, NULL) ) 24 | { 25 | gsize n = 0; 26 | int i; 27 | ret->mount_options = g_key_file_get_string_list( f, fs, "mount_options", &n, NULL ); 28 | ret->fstype_override = g_key_file_get_string(f, fs, "fstype_override", NULL ); 29 | 30 | for( i = 0; i < n; ++i ) 31 | { 32 | /* replace "uid=" with "uid=" */ 33 | #ifndef __FreeBSD__ 34 | if (strcmp (ret->mount_options[i], "uid=") == 0) { 35 | g_free (ret->mount_options[i]); 36 | ret->mount_options[i] = g_strdup_printf ("uid=%u", getuid ()); 37 | } 38 | #else 39 | if (strcmp (ret->mount_options[i], "-u=") == 0) { 40 | g_free (ret->mount_options[i]); 41 | ret->mount_options[i] = g_strdup_printf ("-u=%u", getuid ()); 42 | } 43 | #endif 44 | /* for ntfs-3g */ 45 | if (strcmp (ret->mount_options[i], "locale=") == 0) { 46 | g_free (ret->mount_options[i]); 47 | ret->mount_options[i] = g_strdup_printf ("locale=%s", setlocale (LC_ALL, "")); 48 | } 49 | } 50 | } 51 | else 52 | { 53 | ret->mount_options = NULL; 54 | ret->fstype_override = NULL; 55 | } 56 | g_key_file_free(f); 57 | return (ret->mount_options || ret->fstype_override); 58 | } 59 | -------------------------------------------------------------------------------- /src/compat/glib-utils.c: -------------------------------------------------------------------------------- 1 | /* 2 | * C++ Interface: glib-mem 3 | * 4 | * Description: Compatibility macros for older versions of glib 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #include "glib-utils.h" 14 | 15 | /* older versions of glib don't provde these API */ 16 | #if ! GLIB_CHECK_VERSION(2, 8, 0) 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | int g_mkdir_with_parents(const gchar *pathname, int mode) 25 | { 26 | struct stat statbuf; 27 | char *dir, *sep; 28 | dir = g_strdup( pathname ); 29 | sep = dir[0] == '/' ? dir + 1 : dir; 30 | do { 31 | sep = strchr( sep, '/' ); 32 | if( G_LIKELY( sep ) ) 33 | *sep = '\0'; 34 | 35 | if( stat( dir, &statbuf) == 0 ) 36 | { 37 | if( ! S_ISDIR(statbuf.st_mode) ) /* parent not dir */ 38 | goto err; 39 | } 40 | else /* stat failed */ 41 | { 42 | if( errno == ENOENT ) /* not exists */ 43 | { 44 | if( mkdir( dir, mode ) == -1 ) 45 | goto err; 46 | } 47 | else 48 | goto err; /* unknown error */ 49 | } 50 | 51 | if( G_LIKELY( sep ) ) 52 | { 53 | *sep = '/'; 54 | ++sep; 55 | } 56 | else 57 | break; 58 | }while( sep ); 59 | g_free( dir ); 60 | return 0; 61 | err: 62 | g_free( dir ); 63 | return -1; 64 | } 65 | #endif 66 | 67 | #if ! GLIB_CHECK_VERSION(2, 16, 0) 68 | 69 | #include 70 | 71 | int g_strcmp0(const char *str1, const char *str2) 72 | { 73 | if( G_UNLIKELY(str1 == str2) ) /* the same string or both NULL */ 74 | return 0; 75 | if( G_UNLIKELY(str1 == NULL) ) /* str2 is non-NULL */ 76 | return -1; 77 | else if( G_UNLIKELY(str2 == NULL) ) /* str1 is non-NULL */ 78 | return 1; 79 | return strcmp( str1, str2 ); 80 | } 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /src/vfs/vfs-app-desktop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: vfs-app-desktop 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _VFS_APP_DESKTOP_H_ 14 | #define _VFS_APP_DESKTOP_H_ 15 | 16 | #include 17 | #include 18 | 19 | G_BEGIN_DECLS 20 | 21 | typedef struct _VFSAppDesktop VFSAppDesktop; 22 | 23 | struct _VFSAppDesktop 24 | { 25 | char* file_name; 26 | char* disp_name; 27 | char* comment; 28 | char* exec; 29 | char* icon_name; 30 | char* path; // working dir 31 | char* full_path; // path of desktop file 32 | gboolean terminal : 1; 33 | gboolean hidden : 1; 34 | gboolean startup : 1; 35 | 36 | /* */ 37 | int n_ref; 38 | }; 39 | 40 | /* 41 | * If file_name is not a full path, this function searches default paths 42 | * for the desktop file. 43 | */ 44 | VFSAppDesktop* vfs_app_desktop_new( const char* file_name ); 45 | 46 | void vfs_app_desktop_ref( VFSAppDesktop* app ); 47 | 48 | void vfs_app_desktop_unref( gpointer data ); 49 | 50 | const char* vfs_app_desktop_get_name( VFSAppDesktop* app ); 51 | 52 | const char* vfs_app_desktop_get_disp_name( VFSAppDesktop* app ); 53 | 54 | const char* vfs_app_desktop_get_exec( VFSAppDesktop* app ); 55 | 56 | GdkPixbuf* vfs_app_desktop_get_icon( VFSAppDesktop* app, int size, gboolean use_fallback ); 57 | 58 | const char* vfs_app_desktop_get_icon_name( VFSAppDesktop* app ); 59 | 60 | gboolean vfs_app_desktop_open_multiple_files( VFSAppDesktop* app ); 61 | 62 | gboolean vfs_app_desktop_open_in_terminal( VFSAppDesktop* app ); 63 | 64 | gboolean vfs_app_desktop_is_hidden( VFSAppDesktop* app ); 65 | 66 | gboolean vfs_app_desktop_open_files( GdkScreen* screen, 67 | const char* working_dir, 68 | VFSAppDesktop* app, 69 | GList* file_paths, 70 | GError** err ); 71 | gboolean vfs_app_desktop_rename( char* desktop_file_path, char* new_name ); //sfm 72 | 73 | G_END_DECLS 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /src/ptk/ptk-file-menu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: ptk-file-menu 3 | * 4 | * Description: Popup menu for files 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _PTK_FILE_MENU_H_ 14 | #define _PTK_FILE_MENU_H_ 15 | 16 | #include 17 | #include "ptk-file-browser.h" 18 | #include "vfs-file-info.h" 19 | #include "desktop-window.h" 20 | 21 | G_BEGIN_DECLS 22 | 23 | /* sel_files is a list containing VFSFileInfo structures 24 | * The list will be freed in this function, so the caller mustn't 25 | * free the list after calling this function. 26 | */ 27 | 28 | typedef struct _PtkFileMenu PtkFileMenu; 29 | struct _PtkFileMenu 30 | { 31 | PtkFileBrowser* browser; 32 | DesktopWindow* desktop; 33 | char* cwd; 34 | char* file_path; 35 | VFSFileInfo* info; 36 | GList* sel_files; 37 | GtkAccelGroup *accel_group; 38 | }; 39 | 40 | 41 | GtkWidget* ptk_file_menu_new( DesktopWindow* desktop, PtkFileBrowser* browser, 42 | const char* file_path, VFSFileInfo* info, 43 | const char* cwd, GList* sel_files ); 44 | 45 | void ptk_file_menu_add_panel_view_menu( PtkFileBrowser* browser, 46 | GtkWidget* menu, 47 | GtkAccelGroup* accel_group ); 48 | 49 | void on_popup_open_in_new_tab_here( GtkMenuItem *menuitem, 50 | PtkFileMenu* data ); 51 | 52 | void ptk_file_menu_action( DesktopWindow* desktop, PtkFileBrowser* browser, 53 | char* setname ); 54 | 55 | void on_popup_sortby( GtkMenuItem *menuitem, PtkFileBrowser* file_browser, int order ); 56 | void on_popup_list_detailed( GtkMenuItem *menuitem, PtkFileBrowser* browser ); 57 | void on_popup_list_icons( GtkMenuItem *menuitem, PtkFileBrowser* browser ); 58 | void on_popup_list_compact( GtkMenuItem *menuitem, PtkFileBrowser* browser ); 59 | void on_popup_list_large( GtkMenuItem *menuitem, PtkFileBrowser* browser ); 60 | void on_popup_rubber( GtkMenuItem *menuitem, PtkFileBrowser* file_browser ); 61 | 62 | G_END_DECLS 63 | 64 | #endif 65 | 66 | -------------------------------------------------------------------------------- /src/exo/exo-string.h: -------------------------------------------------------------------------------- 1 | /* $Id: exo-string.h 47 2006-01-30 02:32:10Z pcmanx $ */ 2 | /*- 3 | * Copyright (c) 2004 os-cillation e.K. 4 | * 5 | * Written by Benedikt Meurer . 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 3 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | /* 2006.01.23 modified by Hong Jen Yee (PCMan) to used in PCMan File Manager */ 24 | 25 | #ifndef __EXO_STRING_H__ 26 | #define __EXO_STRING_H__ 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS; 31 | 32 | gchar *exo_str_elide_underscores (const gchar *text); 33 | 34 | gboolean exo_str_is_equal (const gchar *a, 35 | const gchar *b); 36 | 37 | gchar **exo_strndupv (gchar **strv, 38 | gint num); 39 | 40 | /** 41 | * exo_str_is_empty: 42 | * @string : a string 43 | * 44 | * Macro to check if a string is %NULL or empty. You should prefer 45 | * this function over strlen (str) == 0. 46 | * 47 | * Returns: %TRUE if the string is not %NULL and its length > 1, 48 | * %FALSE otherwise. 49 | * 50 | * Since : 0.5.0 51 | **/ 52 | #define exo_str_is_empty(string) ((string) == NULL || *(string) == '\0') 53 | 54 | /** 55 | * I_: 56 | * @string : A static string. 57 | * 58 | * Shortcut for g_intern_static_string() to return a 59 | * canonical representation for @string. 60 | * 61 | * Returns: a canonical representation for the string. 62 | * 63 | * Since : 0.3.1.1 64 | **/ 65 | #define I_(string) (g_intern_static_string ((string))) 66 | 67 | G_END_DECLS; 68 | 69 | #endif /* !__EXO_STRING_H__ */ 70 | -------------------------------------------------------------------------------- /src/vfs/vfs-thumbnail-loader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * vfs-thumbnail-loader.h 3 | * 4 | * Copyright 2008 PCMan 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _VFS_THUMBNAIL_LOADER_H_ 23 | #define _VFS_THUMBNAIL_LOADER_H_ 24 | 25 | #include 26 | #include 27 | #include "vfs-dir.h" 28 | #include "vfs-file-info.h" 29 | #include "vfs-async-task.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | typedef struct _VFSThumbnailLoader VFSThumbnailLoader; 34 | 35 | VFSThumbnailLoader* vfs_thumbnail_loader_new( VFSDir* dir ); 36 | void vfs_thumbnail_loader_free( VFSThumbnailLoader* loader ); 37 | 38 | void vfs_thumbnail_loader_request( VFSDir* dir, VFSFileInfo* file, gboolean is_big ); 39 | void vfs_thumbnail_loader_cancel_all_requests( VFSDir* dir, gboolean is_big ); 40 | 41 | /* Load thumbnail for the specified file 42 | * If the caller knows mtime of the file, it should pass mtime to this function to 43 | * prevent unnecessary disk I/O and this can speed up the loading. 44 | * Otherwise, it should pass 0 for mtime, and the function will do stat() on the file 45 | * to get mtime. 46 | */ 47 | GdkPixbuf* vfs_thumbnail_load_for_uri( const char* uri, int size, time_t mtime ); 48 | GdkPixbuf* vfs_thumbnail_load_for_file( const char* file, int size, time_t mtime ); 49 | 50 | void vfs_thumbnail_init(); 51 | 52 | /* 53 | void vfs_thumbnail_delete_for _file(); 54 | void vfs_thumbnail_delete_for _uri(); 55 | void vfs_thumbnail_delete_all(); 56 | */ 57 | 58 | G_END_DECLS 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/ptk/ptk-dir-tree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: ptk-dir-tree 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _PTK_DIR_TREE_H_ 14 | #define _PTK_DIR_TREE_H_ 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | G_BEGIN_DECLS 23 | 24 | #define PTK_TYPE_DIR_TREE (ptk_dir_tree_get_type()) 25 | #define PTK_DIR_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PTK_TYPE_DIR_TREE, PtkDirTree)) 26 | #define PTK_DIR_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PTK_TYPE_DIR_TREE, PtkDirTreeClass)) 27 | #define PTK_IS_DIR_TREE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PTK_TYPE_DIR_TREE)) 28 | #define PTK_IS_DIR_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PTK_TYPE_DIR_TREE)) 29 | #define PTK_DIR_TREE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PTK_TYPE_DIR_TREE, PtkDirTreeClass)) 30 | 31 | /* Columns of folder view */ 32 | enum{ 33 | COL_DIR_TREE_ICON, 34 | COL_DIR_TREE_DISP_NAME, 35 | COL_DIR_TREE_INFO, 36 | N_DIR_TREE_COLS 37 | }; 38 | 39 | typedef struct _PtkDirTree PtkDirTree; 40 | typedef struct _PtkDirTreeClass PtkDirTreeClass; 41 | 42 | typedef struct _PtkDirTreeNode PtkDirTreeNode; 43 | 44 | struct _PtkDirTree 45 | { 46 | GObject parent; 47 | /* */ 48 | 49 | PtkDirTreeNode* root; 50 | /* GtkSortType sort_order; */ /* I don't want to support this :-( */ 51 | /* Random integer to check whether an iter belongs to our model */ 52 | gint stamp; 53 | }; 54 | 55 | struct _PtkDirTreeClass 56 | { 57 | GObjectClass parent; 58 | /* Default signal handlers */ 59 | }; 60 | 61 | GType ptk_dir_tree_get_type (void); 62 | 63 | PtkDirTree *ptk_dir_tree_new (); 64 | 65 | void ptk_dir_tree_expand_row ( PtkDirTree* tree, 66 | GtkTreeIter* iter, 67 | GtkTreePath *path ); 68 | 69 | void ptk_dir_tree_collapse_row ( PtkDirTree* tree, 70 | GtkTreeIter* iter, 71 | GtkTreePath *path ); 72 | 73 | char* ptk_dir_tree_get_dir_path( PtkDirTree* tree, GtkTreeIter* iter ); 74 | 75 | G_END_DECLS 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/go-dialog.c: -------------------------------------------------------------------------------- 1 | #ifdef HAVE_CONFIG_H 2 | # include 3 | #endif 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #include "go-dialog.h" 12 | #include "main-window.h" 13 | #include "ptk-file-browser.h" 14 | #include "ptk-path-entry.h" 15 | #include "ptk-utils.h" 16 | 17 | static const char * chosen_path; 18 | 19 | static gboolean show_go_dialog( GtkWindow* parent, char * initial_path ) 20 | { 21 | GtkBuilder* builder = _gtk_builder_new_from_file( PACKAGE_UI_DIR "/godlg.ui", NULL ); 22 | GtkDialog* dlg = GTK_DIALOG(gtk_builder_get_object( builder, "godlg" )); 23 | 24 | GtkEntry* path_entry = ( GtkEntry* ) ptk_path_entry_new ( NULL ); 25 | gtk_entry_set_activates_default( path_entry, TRUE ); 26 | gtk_entry_set_text( path_entry, initial_path ); 27 | 28 | gtk_container_add( GTK_CONTAINER( gtk_dialog_get_content_area( dlg ) ), GTK_WIDGET( path_entry ) ); 29 | gtk_widget_show_all( gtk_dialog_get_content_area( dlg ) ); 30 | gtk_widget_grab_focus( GTK_WIDGET( path_entry ) ); 31 | 32 | gboolean ret = ( gtk_dialog_run( GTK_DIALOG( dlg ) ) == GTK_RESPONSE_OK ); 33 | if ( ret ) 34 | { 35 | chosen_path = strdup( gtk_entry_get_text( path_entry ) ); 36 | } 37 | gtk_widget_destroy( GTK_WIDGET( dlg ) ); 38 | return ret; 39 | } 40 | 41 | gboolean fm_go( FMMainWindow* main_window ) 42 | { 43 | int i = gtk_notebook_get_current_page( GTK_NOTEBOOK( main_window->notebook ) ); 44 | PtkFileBrowser* file_browser = PTK_FILE_BROWSER( gtk_notebook_get_nth_page( 45 | GTK_NOTEBOOK( main_window->notebook ), i ) ); 46 | 47 | if( file_browser->dir ) 48 | { 49 | char* disp_path = file_browser->dir->disp_path; 50 | if( disp_path ) 51 | { 52 | 53 | if( show_go_dialog( GTK_WINDOW( main_window ), disp_path ) ) 54 | { 55 | char* dir_path = g_filename_from_utf8( chosen_path , -1, NULL, NULL, NULL ); 56 | free( (char*)chosen_path ); 57 | char* final_path = vfs_file_resolve_path( ptk_file_browser_get_cwd(file_browser), dir_path ); 58 | g_free( dir_path ); 59 | ptk_file_browser_chdir( file_browser, final_path, PTK_FB_CHDIR_ADD_HISTORY ); 60 | g_free( final_path ); 61 | gtk_widget_grab_focus( GTK_WIDGET( file_browser->folder_view ) ); 62 | } 63 | } 64 | } 65 | return TRUE; 66 | } 67 | -------------------------------------------------------------------------------- /src/exo/exo-thumbnail-preview.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Benedikt Meurer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 3 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __EXO_THUMBNAIL_PREVIEW_H__ 21 | #define __EXO_THUMBNAIL_PREVIEW_H__ 22 | 23 | /* Taken from exo v0.10.2 (Debian package libexo-1-0), according to changelog 24 | * commit f455681554ca205ffe49bd616310b19f5f9f8ef1 Dec 27 13:50:21 2012 */ 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | typedef struct _ExoThumbnailPreviewClass ExoThumbnailPreviewClass; 31 | typedef struct _ExoThumbnailPreview ExoThumbnailPreview; 32 | 33 | #define EXO_TYPE_THUMBNAIL_PREVIEW (exo_thumbnail_preview_get_type ()) 34 | #define EXO_THUMBNAIL_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_THUMBNAIL_PREVIEW, ExoThumbnailPreview)) 35 | #define EXO_THUMBNAIL_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_THUMBNAIL_PREVIEW, ExoThumbnailPreviewClass)) 36 | #define EXO_IS_THUMBNAIL_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_THUMBNAIL_PREVIEW)) 37 | #define EXO_IS_THUMBNAIL_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_THUMBNAIL_PREVIEW)) 38 | #define EXO_THUMBNAIL_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_THUMBNAIL_PREVIEW, ExoThumbnailPreviewClass)) 39 | 40 | G_GNUC_INTERNAL GType exo_thumbnail_preview_get_type (void) G_GNUC_CONST; 41 | 42 | G_GNUC_INTERNAL GtkWidget *_exo_thumbnail_preview_new (void) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 43 | 44 | G_GNUC_INTERNAL void _exo_thumbnail_preview_set_uri (ExoThumbnailPreview *thumbnail_preview, 45 | const gchar *uri); 46 | 47 | G_END_DECLS 48 | 49 | #endif /* !__EXO_THUMBNAIL_PREVIEW_H__ */ 50 | -------------------------------------------------------------------------------- /src/exo/exo-gdk-pixbuf-extensions.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004-2006 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 3 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef __EXO_GDK_PIXBUF_EXTENSIONS_H__ 23 | #define __EXO_GDK_PIXBUF_EXTENSIONS_H__ 24 | 25 | #include 26 | 27 | /* Taken from exo v0.10.2 (Debian package libexo-1-0), according to changelog 28 | * commit f455681554ca205ffe49bd616310b19f5f9f8ef1 Dec 27 13:50:21 2012 */ 29 | 30 | G_BEGIN_DECLS 31 | 32 | GdkPixbuf *exo_gdk_pixbuf_scale_down (GdkPixbuf *source, 33 | gboolean preserve_aspect_ratio, 34 | gint dest_width, 35 | gint dest_height) G_GNUC_WARN_UNUSED_RESULT; 36 | 37 | GdkPixbuf *exo_gdk_pixbuf_colorize (const GdkPixbuf *source, 38 | const GdkColor *color) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 39 | 40 | GdkPixbuf *exo_gdk_pixbuf_spotlight (const GdkPixbuf *source) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 41 | 42 | GdkPixbuf *exo_gdk_pixbuf_frame (const GdkPixbuf *source, 43 | const GdkPixbuf *frame, 44 | gint left_offset, 45 | gint top_offset, 46 | gint right_offset, 47 | gint bottom_offset) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 48 | 49 | G_END_DECLS 50 | 51 | #endif /* !__EXO_GDK_PIXBUF_EXTENSIONS_H__ */ 52 | 53 | -------------------------------------------------------------------------------- /src/xml-purge.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #define IS_BLANK(ch) strchr(" \t\n\r", ch) 11 | 12 | static void purge_file( const char* file ) 13 | { 14 | struct stat statbuf; 15 | int fd; 16 | char* buf, *pbuf; 17 | int in_tag = 0, in_quote = 0; 18 | FILE* fo; 19 | 20 | fd = open( file, O_RDONLY ); 21 | if( fd == -1 ) 22 | return; 23 | 24 | if( fstat( fd, &statbuf) == -1 ) 25 | return; 26 | 27 | if( buf = (char*)malloc( statbuf.st_size + 1 ) ) 28 | { 29 | if( read( fd, buf, statbuf.st_size) == -1 ) 30 | { 31 | free( buf ); 32 | return; 33 | } 34 | buf[ statbuf.st_size ] = '\0'; 35 | } 36 | close( fd ); 37 | 38 | fo = fopen( file, "w" ); 39 | if( ! fo ) 40 | goto error; 41 | 42 | for( pbuf = buf; *pbuf; ++pbuf ) 43 | { 44 | if( in_tag > 0 ) 45 | { 46 | if( in_quote ) 47 | { 48 | if( *pbuf == '\"' ) 49 | in_quote = 0; 50 | } 51 | else 52 | { 53 | if( *pbuf == '\"' ) 54 | ++in_quote; 55 | if( ! in_quote && IS_BLANK(*pbuf) ) /* skip unnecessary blanks */ 56 | { 57 | do{ 58 | ++pbuf; 59 | }while( IS_BLANK( *pbuf ) ); 60 | 61 | if( *pbuf != '>' ) 62 | fputc( ' ', fo ); 63 | --pbuf; 64 | continue; 65 | } 66 | } 67 | if( *pbuf == '>' ) 68 | --in_tag; 69 | fputc( *pbuf, fo ); 70 | } 71 | else 72 | { 73 | if( *pbuf == '<' ) 74 | { 75 | if( 0 == strncmp( pbuf, "" ); 78 | if( ! pbuf ) 79 | goto error; 80 | pbuf += 2; 81 | continue; 82 | } 83 | ++in_tag; 84 | fputc( '<', fo ); 85 | } 86 | else 87 | { 88 | char* tmp = pbuf; 89 | while( *tmp && IS_BLANK( *tmp ) && *tmp != '<' ) 90 | ++tmp; 91 | if( *tmp == '<' ) /* all cdata are blank characters */ 92 | pbuf = tmp - 1; 93 | else /* not blank, keep the cdata */ 94 | { 95 | if( tmp == pbuf ) 96 | fputc( *pbuf, fo ); 97 | else 98 | { 99 | fwrite( pbuf, 1, tmp - pbuf, fo ); 100 | pbuf = tmp - 1; 101 | } 102 | } 103 | } 104 | } 105 | } 106 | 107 | fclose( fo ); 108 | 109 | error: 110 | free( buf ); 111 | } 112 | 113 | int main( int argc, char** argv ) 114 | { 115 | int i; 116 | if( argc < 2 ) 117 | return 1; 118 | 119 | for( i = 1; i < argc; ++i ) 120 | purge_file( argv[ i] ); 121 | 122 | return 0; 123 | } 124 | -------------------------------------------------------------------------------- /data/ui/godlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | True 6 | Go to folder 7 | True 8 | GTK_WIN_POS_CENTER_ON_PARENT 9 | GDK_WINDOW_TYPE_HINT_DIALOG 10 | False 11 | 12 | 13 | True 14 | 15 | 16 | 17 | 18 | 19 | True 20 | GTK_BUTTONBOX_END 21 | 22 | 23 | True 24 | True 25 | True 26 | gtk-cancel 27 | True 28 | 29 | 30 | 31 | 32 | True 33 | True 34 | True 35 | True 36 | gtk-ok 37 | True 38 | 39 | 40 | 1 41 | 42 | 43 | 44 | 45 | False 46 | False 47 | GTK_PACK_END 48 | 1 49 | 50 | 51 | 52 | 53 | 54 | cancelbutton 55 | okbutton 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/mime-type/mime-cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mime-cache.h 3 | * 4 | * Copyright 2007 PCMan 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _MIME_CACHE_H_INCLUDED_ 23 | #define _MIME_CACHE_H_INCLUDED_ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | struct _MimeCache 32 | { 33 | char* file_path; 34 | gboolean has_reverse_suffix : 1; /* since mime.cache v1.1, shared mime info v0.4 */ 35 | gboolean has_str_weight : 1; /* since mime.cache v1.1, shared mime info v0.4 */ 36 | const char* buffer; 37 | guint size; 38 | 39 | guint32 n_alias; 40 | const char* alias; 41 | 42 | guint32 n_parents; 43 | const char* parents; 44 | 45 | guint32 n_literals; 46 | const char* literals; 47 | 48 | guint32 n_globs; 49 | const char* globs; 50 | 51 | guint32 n_suffix_roots; 52 | const char* suffix_roots; 53 | 54 | guint32 n_magics; 55 | guint32 magic_max_extent; 56 | const char* magics; 57 | }; 58 | typedef struct _MimeCache MimeCache; 59 | 60 | MimeCache* mime_cache_new( const char* file_path ); 61 | gboolean mime_cache_load( MimeCache* cache, const char* file_path ); 62 | gboolean mime_cache_reload( MimeCache* cache ); 63 | void mime_cache_free( MimeCache* cache ); 64 | 65 | const char* mime_cache_lookup_literal( MimeCache* cache, const char* filename ); 66 | const char* mime_cache_lookup_glob( MimeCache* cache, const char* filename, int *glob_len ); 67 | const char* mime_cache_lookup_suffix( MimeCache* cache, const char* filename, const char** suffix_pos ); 68 | const char* mime_cache_lookup_magic( MimeCache* cache, const char* data, int len ); 69 | const char** mime_cache_lookup_parents( MimeCache* cache, const char* mime_type ); 70 | const char* mime_cache_lookup_alias( MimeCache* cache, const char* mime_type ); 71 | 72 | G_END_DECLS 73 | #endif 74 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | SpaceFM Contributors 2 | 3 | Developer: IgnorantGuru 4 | 5 | Contributors: BwackNinja 6 | OmegaPhil 7 | 8 | Artwork: SpaceFM icons and logo by Goran Simovic 9 | Additional icons from the Tango Desktop Project icon set 10 | 11 | Thanks to SpaceFM users for valuable feedback and to SpaceFM translators and 12 | packagers! 13 | 14 | Special thanks to: 15 | 16 | Jean-Philippe Fleury 17 | Vladimir Kudrya 18 | VastOne 19 | Hasufell 20 | 21 | SpaceFM is developed on geany, gcc, and git, with a little help from gdb. 22 | 23 | 24 | ============================================================================== 25 | 26 | PCManFM Legacy Code: 27 | 28 | Developer: (Hong Jen Yee, aka PCMan) 29 | Contributors: (in alphabetical order ) 30 | Cantona 31 | Orlando Fiol 32 | Jim Huang (jserv) 33 | Ying-Chun Liu (PaulLiu) 34 | Mamoru Tasaka 35 | Kirilov Georgi 36 | Martijn Dekker 37 | Eugene Arshinov (statc) 38 | 39 | PCManFM Legacy Translators: ( in alphabetical order ) 40 | 41 | Johan Andersson 42 | Fábio Antunes 43 | Inko Illarramendi Arancibia 44 | Rüdiger Arp 45 | SZERVÁC Attila 46 | Frederic Bezies 47 | Xisco Bonet 48 | Haifeng Chen 49 | Héonium - Christophe CRIER 50 | Flávio Costa 51 | Ersplus - Fraide 52 | Roxana Kolosova 53 | Hironao Komatsu 54 | Muhammad Ali Makki 55 | mario 56 | mazdac 57 | Nuno Miguel 58 | Claudio Riva 59 | Bekir SONAT 60 | Anton Dobkin 61 | 62 | External source code taken from other projects: 63 | pcmanfm-mod: IgnorantGuru 64 | pcmanfm v0.5.2: (Hong Jen Yee, aka PCMan) 65 | libmd5-rfc: Aladdin Enterprises 66 | Working area detection: Gary Kramlich 67 | ExoIconView: os-cillation e.K, Anders Carlsson, & Benedikt Meurer 68 | Text and icon renderer uses code from Jonathan Blandford 69 | Desktop icons use code from Brian Tarricone 70 | HAL support (deprecated): gnome-vfs, thunar-vfs, libexo, gnome-mount 71 | 72 | -------------------------------------------------------------------------------- /src/ptk/ptk-text-renderer.h: -------------------------------------------------------------------------------- 1 | /* ptk-text-renderer.h 2 | * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 3 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | This file is originally copied from gtkcellrenderertext.h of gtk+ library. 22 | 2006.07.16 modified by Hong Jen Yee to produce a simplified text renderer 23 | which supports center alignment of text to be used in PCMan File Manager 24 | */ 25 | 26 | #ifndef __PTK_TEXT_RENDERER_H__ 27 | #define __PTK_TEXT_RENDERER_H__ 28 | 29 | #include 30 | #include 31 | 32 | 33 | G_BEGIN_DECLS 34 | 35 | 36 | #define PTK_TYPE_TEXT_RENDERER (ptk_text_renderer_get_type ()) 37 | #define PTK_TEXT_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PTK_TYPE_TEXT_RENDERER, PtkTextRenderer)) 38 | #define PTK_TEXT_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PTK_TYPE_TEXT_RENDERER, PtkTextRendererClass)) 39 | #define PTK_IS_TEXT_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PTK_TYPE_TEXT_RENDERER)) 40 | #define PTK_IS_TEXT_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PTK_TYPE_TEXT_RENDERER)) 41 | #define PTK_TEXT_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PTK_TYPE_TEXT_RENDERER, PtkTextRendererClass)) 42 | 43 | typedef struct _PtkTextRenderer PtkTextRenderer; 44 | typedef struct _PtkTextRendererClass PtkTextRendererClass; 45 | 46 | struct _PtkTextRenderer 47 | { 48 | GtkCellRenderer parent; 49 | 50 | /*< private >*/ 51 | gchar *text; 52 | PangoFontDescription *font; 53 | PangoColor foreground; 54 | PangoColor background; 55 | 56 | PangoUnderline underline_style; 57 | 58 | guint foreground_set : 1; 59 | guint background_set : 1; 60 | guint underline_set : 1; 61 | guint ellipsize_set : 1; 62 | 63 | gint wrap_width; 64 | PangoEllipsizeMode ellipsize; 65 | PangoWrapMode wrap_mode; 66 | }; 67 | 68 | struct _PtkTextRendererClass 69 | { 70 | GtkCellRendererClass parent_class; 71 | }; 72 | 73 | GType ptk_text_renderer_get_type ( void ) G_GNUC_CONST; 74 | GtkCellRenderer *ptk_text_renderer_new ( void ); 75 | 76 | 77 | G_END_DECLS 78 | 79 | 80 | #endif /* __PTK_TEXT_RENDERER_H__ */ 81 | -------------------------------------------------------------------------------- /src/ptk/ptk-file-misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: ptk-file-misc 3 | * 4 | * Description: Miscellaneous GUI-realated functions for files 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _PTK_FILE_MISC_H_ 14 | #define _PTK_FILE_MISC_H_ 15 | 16 | #include 17 | #include "vfs-file-info.h" 18 | #include "ptk-file-browser.h" 19 | #include "desktop-window.h" 20 | 21 | G_BEGIN_DECLS 22 | 23 | typedef struct _AutoOpenCreate 24 | { 25 | char* path; 26 | PtkFileBrowser* file_browser; 27 | DesktopWindow* desktop; 28 | GFunc callback; 29 | gboolean open_file; 30 | }AutoOpenCreate; 31 | 32 | typedef enum { 33 | PTK_RENAME, 34 | PTK_RENAME_NEW_FILE, 35 | PTK_RENAME_NEW_DIR, 36 | PTK_RENAME_NEW_LINK 37 | } PtkRenameMode; 38 | 39 | void ptk_delete_files( GtkWindow* parent_win, 40 | const char* cwd, 41 | GList* sel_files, 42 | GtkTreeView* task_view ); 43 | 44 | int ptk_rename_file( DesktopWindow* desktop, PtkFileBrowser* file_browser, 45 | const char* file_dir, VFSFileInfo* file, 46 | const char* dest_dir, gboolean clip_copy, 47 | PtkRenameMode create_new, 48 | AutoOpenCreate* auto_open ); 49 | 50 | gboolean ptk_create_new_file( GtkWindow* parent_win, 51 | const char* cwd, 52 | gboolean create_folder, 53 | VFSFileInfo** file ); 54 | 55 | void ptk_show_file_properties( GtkWindow* parent_win, 56 | const char* cwd, 57 | GList* sel_files, int page ); 58 | 59 | /* sel_files is a list of VFSFileInfo 60 | * app_desktop is the application used to open the files. 61 | * If app_desktop == NULL, each file will be opened with its 62 | * default application. */ 63 | void ptk_open_files_with_app( const char* cwd, 64 | GList* sel_files, 65 | const char* app_desktop, 66 | DesktopWindow* desktop, 67 | PtkFileBrowser* file_browser, 68 | gboolean xforce, gboolean xnever ); 69 | 70 | void ptk_file_misc_paste_as( DesktopWindow* desktop, PtkFileBrowser* file_browser, 71 | const char* cwd, GFunc callback ); //sfm 72 | 73 | void ptk_file_misc_rootcmd( DesktopWindow* desktop, PtkFileBrowser* file_browser, 74 | GList* sel_files, 75 | char* cwd, char* setname ); //sfm 76 | 77 | char* get_real_link_target( const char* link_path ); 78 | 79 | G_END_DECLS 80 | 81 | #endif 82 | 83 | -------------------------------------------------------------------------------- /src/exo/exo-cell-renderer-icon.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2006 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 3 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __EXO_CELL_RENDERER_ICON_H__ 21 | #define __EXO_CELL_RENDERER_ICON_H__ 22 | 23 | #include 24 | 25 | /* Taken from exo v0.10.2 (Debian package libexo-1-0), according to changelog 26 | * commit f455681554ca205ffe49bd616310b19f5f9f8ef1 Dec 27 13:50:21 2012 */ 27 | 28 | G_BEGIN_DECLS 29 | 30 | typedef struct _ExoCellRendererIconPrivate ExoCellRendererIconPrivate; 31 | typedef struct _ExoCellRendererIconClass ExoCellRendererIconClass; 32 | typedef struct _ExoCellRendererIcon ExoCellRendererIcon; 33 | 34 | #define EXO_TYPE_CELL_RENDERER_ICON (exo_cell_renderer_icon_get_type ()) 35 | #define EXO_CELL_RENDERER_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_CELL_RENDERER_ICON, ExoCellRendererIcon)) 36 | #define EXO_CELL_RENDERER_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_CELL_RENDERER_ICON, ExoCellRendererIconClass)) 37 | #define EXO_IS_CELL_RENDERER_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_CELL_RENDERER_ICON)) 38 | #define EXO_IS_CELL_RENDERER_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_CELL_RENDERER_ICON)) 39 | #define EXO_CELL_RENDERER_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_CELL_RENDERER_ICON, ExoCellRendererIconClass)) 40 | 41 | struct _ExoCellRendererIconClass 42 | { 43 | /*< private >*/ 44 | GtkCellRendererClass __parent__; 45 | 46 | /* reserved for future expansion */ 47 | void (*reserved1) (void); 48 | void (*reserved2) (void); 49 | void (*reserved3) (void); 50 | void (*reserved4) (void); 51 | void (*reserved5) (void); 52 | void (*reserved6) (void); 53 | }; 54 | 55 | /** 56 | * ExoCellRendererIcon: 57 | * 58 | * The #ExoIconChooserDialog struct contains only private fields and 59 | * should not be directly accessed. 60 | **/ 61 | struct _ExoCellRendererIcon 62 | { 63 | /*< private >*/ 64 | GtkCellRenderer __parent__; 65 | }; 66 | 67 | GType exo_cell_renderer_icon_get_type (void) G_GNUC_CONST; 68 | 69 | GtkCellRenderer *exo_cell_renderer_icon_new (void) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 70 | 71 | G_END_DECLS 72 | 73 | #endif /* !__EXO_CELL_RENDERER_ICON_H__ */ 74 | -------------------------------------------------------------------------------- /src/ptk/ptk-location-view.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpaceFM ptk-location-view.h 3 | * 4 | * Copyright (C) 2015 IgnorantGuru 5 | * Copyright (C) 2006 Hong Jen Yee (PCMan) 6 | * 7 | * License: See COPYING file 8 | * 9 | */ 10 | 11 | #ifndef _PTK_LOCATION_VIEW_H_ 12 | #define _PTK_LOCATION_VIEW_H_ 13 | 14 | #include 15 | #include 16 | 17 | #include "vfs-volume.h" 18 | 19 | G_BEGIN_DECLS 20 | 21 | // Location View 22 | GtkWidget* ptk_location_view_new( PtkFileBrowser* file_browser ); 23 | gboolean ptk_location_view_chdir( GtkTreeView* location_view, const char* path ); 24 | char* ptk_location_view_get_selected_dir( GtkTreeView* location_view ); 25 | gboolean ptk_location_view_is_item_volume( GtkTreeView* location_view, GtkTreeIter* it ); 26 | VFSVolume* ptk_location_view_get_volume( GtkTreeView* location_view, GtkTreeIter* it ); 27 | void ptk_location_view_show_trash_can( gboolean show ); 28 | void ptk_location_view_on_action( GtkWidget* view, XSet* set ); 29 | VFSVolume* ptk_location_view_get_selected_vol( GtkTreeView* location_view ); 30 | void update_volume_icons(); 31 | void ptk_location_view_mount_network( PtkFileBrowser* file_browser, 32 | const char* url, 33 | gboolean new_tab, 34 | gboolean force_new_mount ); 35 | void mount_iso( PtkFileBrowser* file_browser, const char* path ); 36 | void ptk_location_view_dev_menu( GtkWidget* parent, PtkFileBrowser* file_browser, 37 | GtkWidget* menu ); 38 | char* ptk_location_view_create_mount_point( int mode, VFSVolume* vol, 39 | netmount_t* netmount, const char* path ); 40 | char* ptk_location_view_get_mount_point_dir( const char* name ); 41 | void ptk_location_view_clean_mount_points(); 42 | gboolean ptk_location_view_open_block( const char* block, gboolean new_tab ); 43 | 44 | 45 | // Bookmark View 46 | GtkWidget* ptk_bookmark_view_new( PtkFileBrowser* file_browser ); 47 | gboolean ptk_bookmark_view_chdir( GtkTreeView* view, 48 | PtkFileBrowser* file_browser, 49 | gboolean recurse ); 50 | void ptk_bookmark_view_add_bookmark( GtkMenuItem *menuitem, 51 | PtkFileBrowser* file_browser, 52 | const char* url ); 53 | char* ptk_bookmark_view_get_selected_dir( GtkTreeView* view ); 54 | void ptk_bookmark_view_update_icons( GtkIconTheme* icon_theme, 55 | PtkFileBrowser* file_browser ); 56 | void ptk_bookmark_view_xset_changed( GtkTreeView* view, 57 | PtkFileBrowser* file_browser, const char* changed_name ); 58 | XSet* ptk_bookmark_view_get_first_bookmark( XSet* book_set ); 59 | void ptk_bookmark_view_import_gtk( const char* path, XSet* book_set ); 60 | void ptk_bookmark_view_on_open_reverse( GtkMenuItem* item, 61 | PtkFileBrowser* file_browser ); 62 | 63 | 64 | G_END_DECLS 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /data/Makefile.am: -------------------------------------------------------------------------------- 1 | desktopdir = $(datadir)/applications 2 | dt_in_files = spacefm.desktop.in \ 3 | spacefm-find.desktop.in \ 4 | spacefm-folder-handler.desktop.in 5 | desktop_DATA = $(dt_in_files:.desktop.in=.desktop) 6 | @INTLTOOL_DESKTOP_RULE@ 7 | 8 | DISTCLEANFILES = spacefm.desktop \ 9 | spacefm-find.desktop \ 10 | spacefm-folder-handler.desktop 11 | 12 | if NO_PIXMAPS 13 | icon48dir = $(datadir)/icons/hicolor/48x48/apps 14 | icon48_DATA = \ 15 | spacefm.png \ 16 | spacefm-root.png \ 17 | spacefm-find.png \ 18 | spacefm-48-cube-blue.png \ 19 | spacefm-48-cube-green.png \ 20 | spacefm-48-cube-red.png \ 21 | spacefm-48-folder-blue.png \ 22 | spacefm-48-folder-red.png \ 23 | spacefm-48-pyramid-blue.png \ 24 | spacefm-48-pyramid-green.png \ 25 | spacefm-48-pyramid-red.png 26 | 27 | icon128dir = $(datadir)/icons/hicolor/128x128/apps 28 | icon128_DATA = \ 29 | spacefm-128-cube-blue.png \ 30 | spacefm-128-cube-green.png \ 31 | spacefm-128-cube-red.png \ 32 | spacefm-128-pyramid-blue.png \ 33 | spacefm-128-pyramid-green.png \ 34 | spacefm-128-pyramid-red.png 35 | 36 | faenzadir = $(datadir)/icons/Faenza/apps/48 37 | faenza_DATA = \ 38 | faenza/spacefm.png \ 39 | faenza/spacefm-root.png \ 40 | faenza/spacefm-find.png 41 | else 42 | icondir = $(datadir)/pixmaps 43 | icon_DATA = \ 44 | spacefm.png \ 45 | spacefm-root.png \ 46 | spacefm-find.png \ 47 | spacefm-128-cube-blue.png \ 48 | spacefm-128-cube-green.png \ 49 | spacefm-128-cube-red.png \ 50 | spacefm-128-pyramid-blue.png \ 51 | spacefm-128-pyramid-green.png \ 52 | spacefm-128-pyramid-red.png \ 53 | spacefm-48-cube-blue.png \ 54 | spacefm-48-cube-green.png \ 55 | spacefm-48-cube-red.png \ 56 | spacefm-48-faenza-blue.png \ 57 | spacefm-48-faenza-find.png \ 58 | spacefm-48-faenza-red.png \ 59 | spacefm-48-folder-blue.png \ 60 | spacefm-48-folder-red.png \ 61 | spacefm-48-pyramid-blue.png \ 62 | spacefm-48-pyramid-green.png \ 63 | spacefm-48-pyramid-red.png 64 | endif 65 | 66 | filedir = $(datadir)/spacefm 67 | uidir=$(filedir)/ui 68 | 69 | # sfm don't install mount.rules for no-hal build 70 | if USE_HAL 71 | file_DATA = \ 72 | mount.rules 73 | endif 74 | 75 | # html-doc 76 | htmldir = @htmldir@ 77 | html_DATA = spacefm-manual-en.html 78 | 79 | # GtkBuilder UI definition files 80 | ui_in_files= \ 81 | ui/prefdlg.glade \ 82 | ui/prefdlg2.glade \ 83 | ui/appchooserdlg.glade \ 84 | ui/file_properties.glade \ 85 | ui/about-dlg.glade \ 86 | ui/find-files.glade \ 87 | ui/find-files2.glade \ 88 | ui/godlg.glade 89 | ui_DATA = $(ui_in_files:.glade=.ui) 90 | 91 | EXTRA_DIST = \ 92 | $(desktop_DATA) \ 93 | $(icon_DATA) \ 94 | $(file_DATA) \ 95 | $(ui_DATA) 96 | 97 | CLEANFILES = spacefm.desktop \ 98 | spacefm-find.desktop \ 99 | spacefm-folder-handler.desktop 100 | 101 | # Generate GtkBuilder UI files from Glade files 102 | # was with GNU extension: %.ui: %.glade 103 | .glade.ui: 104 | # $(GTK_BUILDER_CONVERT) $< $@ 105 | $(top_srcdir)/gtk-builder-convert $< $@ 106 | # $(top_builddir)/src/xml-purge $@ 107 | 108 | -------------------------------------------------------------------------------- /src/ptk/ptk-input-dialog.c: -------------------------------------------------------------------------------- 1 | /* 2 | * C Implementation: ptk-input-dialog 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2005 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #include "ptk-input-dialog.h" 14 | #include 15 | 16 | /* 17 | * Create a dialog used to prompt the user to input a string. 18 | * title: the title of dialog. 19 | * prompt: prompt showed to the user 20 | */ 21 | GtkWidget* ptk_input_dialog_new( const char* title, 22 | const char* prompt, 23 | const char* default_text, 24 | GtkWindow* parent ) 25 | { 26 | GtkWidget * dlg; 27 | GtkWidget* box; 28 | GtkWidget* label; 29 | GtkWidget* entry; 30 | dlg = gtk_dialog_new_with_buttons( title, 31 | parent, 32 | 0, 33 | GTK_STOCK_CANCEL, 34 | GTK_RESPONSE_CANCEL, 35 | GTK_STOCK_OK, 36 | GTK_RESPONSE_OK, 37 | NULL ); 38 | gtk_dialog_set_alternative_button_order( GTK_DIALOG(dlg), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1 ); 39 | 40 | box = gtk_dialog_get_content_area ( GTK_DIALOG(dlg) ); 41 | label = gtk_label_new( prompt ); 42 | gtk_box_pack_start( GTK_BOX( box ), label, FALSE, FALSE, 4 ); 43 | 44 | entry = gtk_entry_new(); 45 | gtk_entry_set_text( GTK_ENTRY( entry ), 46 | default_text ? default_text : "" ); 47 | gtk_box_pack_start( GTK_BOX( box ), entry, FALSE, FALSE, 4 ); 48 | 49 | g_object_set_data( G_OBJECT( dlg ), "prompt", label ); 50 | g_object_set_data( G_OBJECT( dlg ), "entry", entry ); 51 | 52 | gtk_dialog_set_default_response( ( GtkDialog* ) dlg, 53 | GTK_RESPONSE_OK ); 54 | gtk_entry_set_activates_default ( GTK_ENTRY( entry ), TRUE ); 55 | 56 | gtk_widget_show_all( box ); 57 | return dlg; 58 | } 59 | 60 | /* 61 | * Get user input from the text entry of the input dialog. 62 | * The returned string should be freed when no longer needed. 63 | * input_dialog: the input dialog 64 | */ 65 | gchar* ptk_input_dialog_get_text( GtkWidget* input_dialog ) 66 | { 67 | GtkWidget * entry = ptk_input_dialog_get_entry( input_dialog ); 68 | return g_strdup( gtk_entry_get_text( GTK_ENTRY( entry ) ) ); 69 | } 70 | 71 | /* 72 | * Get the prompt label of the input dialog. 73 | * input_dialog: the input dialog 74 | */ 75 | GtkWidget* ptk_input_dialog_get_label( GtkWidget* input_dialog ) 76 | { 77 | return GTK_WIDGET( g_object_get_data( 78 | G_OBJECT( input_dialog ), "prompt" ) ); 79 | } 80 | 81 | 82 | /* 83 | * Get the text entry widget of the input dialog. 84 | * input_dialog: the input dialog 85 | */ 86 | GtkWidget* ptk_input_dialog_get_entry( GtkWidget* input_dialog ) 87 | { 88 | return GTK_WIDGET( g_object_get_data( 89 | G_OBJECT( input_dialog ), "entry" ) ); 90 | } 91 | 92 | -------------------------------------------------------------------------------- /src/exo/exo-cell-renderer-ellipsized-text.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004-2006 os-cillation e.K. 3 | * 4 | * Written by Benedikt Meurer . 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Library General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 3 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Library General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef __EXO_CELL_RENDERER_ELLIPSIZED_TEXT_H__ 23 | #define __EXO_CELL_RENDERER_ELLIPSIZED_TEXT_H__ 24 | 25 | #include 26 | 27 | /* Taken from exo v0.10.2 (Debian package libexo-1-0), according to changelog 28 | * commit f455681554ca205ffe49bd616310b19f5f9f8ef1 Dec 27 13:50:21 2012 */ 29 | 30 | G_BEGIN_DECLS 31 | 32 | typedef struct _ExoCellRendererEllipsizedTextPrivate ExoCellRendererEllipsizedTextPrivate; 33 | typedef struct _ExoCellRendererEllipsizedTextClass ExoCellRendererEllipsizedTextClass; 34 | typedef struct _ExoCellRendererEllipsizedText ExoCellRendererEllipsizedText; 35 | 36 | #define EXO_TYPE_CELL_RENDERER_ELLIPSIZED_TEXT (exo_cell_renderer_ellipsized_text_get_type ()) 37 | #define EXO_CELL_RENDERER_ELLIPSIZED_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_CELL_RENDERER_ELLIPSIZED_TEXT, ExoCellRendererEllipsizedText)) 38 | #define EXO_CELL_RENDERER_ELLIPSIZED_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((obj), EXO_TYPE_CELL_RENDERER_ELLIPSIZED_TEXT, ExoCellRendererEllipsizedTextClass)) 39 | #define EXO_IS_CELL_RENDERER_ELLIPSIZED_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_CELL_RENDERER_ELLIPSIZED_TEXT)) 40 | #define EXO_IS_CELL_RENDERER_ELLIPSIZED_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EXO_TYPE_CELL_RENDERER_ELLIPSIZED_TEXT)) 41 | #define EXO_CELL_RENDERER_ELLIPSIZED_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_CELL_RENDERER_ELLIPSIZED_TEXT, ExoCellRendererEllipsizedTextClass)) 42 | 43 | struct _ExoCellRendererEllipsizedTextClass 44 | { 45 | /*< private >*/ 46 | GtkCellRendererTextClass __parent__; 47 | }; 48 | 49 | /** 50 | * ExoCellRendererEllipsizedText: 51 | * 52 | * The #ExoIconCellRendererEllipsizedText 53 | * struct contains only private fields and should not be directly accessed. 54 | **/ 55 | struct _ExoCellRendererEllipsizedText 56 | { 57 | /*< private >*/ 58 | GtkCellRendererText __parent__; 59 | ExoCellRendererEllipsizedTextPrivate *priv; 60 | }; 61 | 62 | GType exo_cell_renderer_ellipsized_text_get_type (void) G_GNUC_CONST; 63 | 64 | GtkCellRenderer *exo_cell_renderer_ellipsized_text_new (void) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 65 | 66 | G_END_DECLS 67 | 68 | #endif /* !__EXO_CELL_RENDERER_ELLIPSIZED_TEXT_H__ */ 69 | -------------------------------------------------------------------------------- /src/mime-type/mime-action.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mime-action.h 3 | * 4 | * Copyright 2007 PCMan 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef _MIME_ACTION_H_INCLUDED_ 23 | #define _MIME_ACTION_H_INCLUDED_ 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | enum { 30 | MIME_TYPE_ACTION_DEFAULT, 31 | MIME_TYPE_ACTION_APPEND, 32 | MIME_TYPE_ACTION_REMOVE 33 | }; 34 | 35 | /* 36 | * Get a list of applications supporting this mime-type 37 | * The returned string array was newly allocated, and should be 38 | * freed with g_strfreev() when no longer used. 39 | */ 40 | char** mime_type_get_actions( const char* type ); 41 | 42 | /* 43 | * Add an applications used to open this mime-type 44 | * desktop_id is the name of *.desktop file. 45 | * 46 | * custom_desktop: used to store name of the newly created user-custom desktop file, can be NULL. 47 | */ 48 | void mime_type_add_action( const char* type, const char* desktop_id, char** custom_desktop ); 49 | 50 | /* 51 | * Check if an applications currently set to open this mime-type 52 | * desktop_id is the name of *.desktop file. 53 | */ 54 | gboolean mime_type_has_action( const char* type, const char* desktop_id ); 55 | 56 | /* 57 | * Get default applications used to open this mime-type 58 | * 59 | * The returned string was newly allocated, and should be freed when no longer 60 | * used. If NULL is returned, that means a default app is not set for this 61 | * mime-type. This is very roughly based on specs: 62 | * http://standards.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html 63 | * 64 | * The old defaults.list is also checked. 65 | */ 66 | char* mime_type_get_default_action( const char* type ); 67 | 68 | /* 69 | * Set applications used to open or never used to open this mime-type 70 | * desktop_id is the name of *.desktop file. 71 | * action == 72 | * MIME_TYPE_ACTION_DEFAULT - make desktop_id the default app 73 | * MIME_TYPE_ACTION_APPEND - add desktop_id to Default and Added apps 74 | * MIME_TYPE_ACTION_REMOVE - add desktop id to Removed apps 75 | * 76 | * http://standards.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html 77 | */ 78 | void mime_type_update_association( const char* type, const char* desktop_id, 79 | int action ); 80 | 81 | /* Locate the file path of desktop file by desktop_id */ 82 | char* mime_type_locate_desktop_file( const char* dir, const char* desktop_id ); 83 | 84 | G_END_DECLS 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /src/vfs/vfs-async-task.h: -------------------------------------------------------------------------------- 1 | /* 2 | * vfs-async-task.h 3 | * 4 | * Copyright 2008 PCMan 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301, USA. 20 | */ 21 | 22 | 23 | #ifndef __VFS_ASYNC_TASK_H__ 24 | #define __VFS_ASYNC_TASK_H__ 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define VFS_ASYNC_TASK_TYPE (vfs_async_task_get_type()) 32 | #define VFS_ASYNC_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\ 33 | VFS_ASYNC_TASK_TYPE, VFSAsyncTask)) 34 | #define VFS_ASYNC_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),\ 35 | VFS_ASYNC_TASK_TYPE, VFSAsyncTaskClass)) 36 | #define VFS_IS_ASYNC_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\ 37 | VFS_ASYNC_TASK_TYPE)) 38 | #define VFS_IS_ASYNC_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),\ 39 | VFS_ASYNC_TASK_TYPE)) 40 | 41 | typedef struct _VFSAsyncTask VFSAsyncTask; 42 | typedef struct _VFSAsyncTaskClass VFSAsyncTaskClass; 43 | 44 | typedef gpointer (*VFSAsyncFunc)( VFSAsyncTask*, gpointer ); 45 | 46 | struct _VFSAsyncTask 47 | { 48 | GObject parent; 49 | VFSAsyncFunc func; 50 | gpointer user_data; 51 | gpointer ret_val; 52 | 53 | GThread* thread; 54 | GMutex* lock; 55 | 56 | guint idle_id; 57 | gboolean cancel : 1; 58 | gboolean cancelled : 1; 59 | gboolean finished : 1; 60 | }; 61 | 62 | struct _VFSAsyncTaskClass 63 | { 64 | GObjectClass parent_class; 65 | void (*finish)( VFSAsyncTask* task, gboolean is_cancelled ); 66 | }; 67 | 68 | GType vfs_async_task_get_type (void); 69 | VFSAsyncTask* vfs_async_task_new ( VFSAsyncFunc task_func, gpointer user_data ); 70 | 71 | gpointer vfs_async_task_get_data( VFSAsyncTask* task ); 72 | void vfs_async_task_set_data( VFSAsyncTask* task, gpointer user_data ); 73 | gpointer vfs_async_task_get_return_value( VFSAsyncTask* task ); 74 | 75 | /* Execute the async task */ 76 | void vfs_async_task_execute( VFSAsyncTask* task ); 77 | 78 | gboolean vfs_async_task_is_finished( VFSAsyncTask* task ); 79 | gboolean vfs_async_task_is_cancelled( VFSAsyncTask* task ); 80 | 81 | /* 82 | * Cancel the async task running in another thread. 83 | * NOTE: Only can be called from main thread. 84 | */ 85 | void vfs_async_task_cancel( VFSAsyncTask* task ); 86 | 87 | void vfs_async_task_lock( VFSAsyncTask* task ); 88 | void vfs_async_task_unlock( VFSAsyncTask* task ); 89 | 90 | G_END_DECLS 91 | 92 | #endif /* __VFS_ASYNC_TASK_H__ */ 93 | -------------------------------------------------------------------------------- /src/exo/exo-icon-chooser-dialog.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2006 Benedikt Meurer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 3 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __EXO_ICON_CHOOSER_DIALOG_H__ 21 | #define __EXO_ICON_CHOOSER_DIALOG_H__ 22 | 23 | #include 24 | 25 | /* Taken from exo v0.10.2 (Debian package libexo-1-0), according to changelog 26 | * commit f455681554ca205ffe49bd616310b19f5f9f8ef1 Dec 27 13:50:21 2012 */ 27 | 28 | G_BEGIN_DECLS 29 | 30 | typedef struct _ExoIconChooserDialogPrivate ExoIconChooserDialogPrivate; 31 | typedef struct _ExoIconChooserDialogClass ExoIconChooserDialogClass; 32 | typedef struct _ExoIconChooserDialog ExoIconChooserDialog; 33 | 34 | #define EXO_TYPE_ICON_CHOOSER_DIALOG (exo_icon_chooser_dialog_get_type ()) 35 | #define EXO_ICON_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_ICON_CHOOSER_DIALOG, ExoIconChooserDialog)) 36 | #define EXO_ICON_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_ICON_CHOOSER_DIALOG, ExoIconChooserDialogClass)) 37 | #define EXO_IS_ICON_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_ICON_CHOOSER_DIALOG)) 38 | #define EXO_IS_ICON_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_ICON_CHOOSER_DIALOG)) 39 | #define EXO_ICON_CHOOSER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_ICON_CHOOSER_DIALOG, ExoIconChooserDialogClass)) 40 | 41 | struct _ExoIconChooserDialogClass 42 | { 43 | /*< private >*/ 44 | GtkDialogClass __parent__; 45 | 46 | /* reserved for future expansion */ 47 | void (*reserved1) (void); 48 | void (*reserved2) (void); 49 | void (*reserved3) (void); 50 | void (*reserved4) (void); 51 | void (*reserved5) (void); 52 | void (*reserved6) (void); 53 | }; 54 | 55 | struct _ExoIconChooserDialog 56 | { 57 | /*< private >*/ 58 | GtkDialog __parent__; 59 | }; 60 | 61 | GType exo_icon_chooser_dialog_get_type (void) G_GNUC_CONST; 62 | 63 | GtkWidget *exo_icon_chooser_dialog_new (const gchar *title, 64 | GtkWindow *parent, 65 | const gchar *first_button_text, 66 | ...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT; 67 | 68 | gchar *exo_icon_chooser_dialog_get_icon (ExoIconChooserDialog *icon_chooser_dialog) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; 69 | gboolean exo_icon_chooser_dialog_set_icon (ExoIconChooserDialog *icon_chooser_dialog, 70 | const gchar *icon); 71 | 72 | G_END_DECLS 73 | 74 | #endif /* !__EXO_ICON_CHOOSER_DIALOG_H__ */ 75 | -------------------------------------------------------------------------------- /src/vfs/vfs-mime-type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: vfs-mime_type-type 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING mimele that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _VFS_MIME_TYPE_H_ 14 | #define _VFS_MIME_TYPE_H_ 15 | 16 | #include 17 | #include "mime-type.h" 18 | 19 | G_BEGIN_DECLS 20 | 21 | typedef struct _VFSMimeType VFSMimeType; 22 | 23 | struct _VFSMimeType 24 | { 25 | char* type; /* mime_type-type string */ 26 | char* description; /* description of the mimele type */ 27 | GdkPixbuf* big_icon; 28 | GdkPixbuf* small_icon; 29 | /**/ 30 | int n_ref; 31 | /* FIXME: Don't cache mime actions 32 | char** actions; 33 | */ 34 | }; 35 | 36 | void vfs_mime_type_init(); 37 | 38 | void vfs_mime_type_clean(); 39 | 40 | /* file name used in this API should be encoded in UTF-8 */ 41 | VFSMimeType* vfs_mime_type_get_from_file_name( const char* ufile_name ); 42 | 43 | VFSMimeType* vfs_mime_type_get_from_file( const char* file_path, /* Should be on-disk encoding */ 44 | const char* base_name, /* Should be in UTF-8 */ 45 | struct stat64* pstat ); /* Can be NULL */ 46 | 47 | VFSMimeType* vfs_mime_type_get_from_type( const char* type ); 48 | 49 | VFSMimeType* vfs_mime_type_new( const char* type_name ); 50 | void vfs_mime_type_ref( VFSMimeType* mime_type ); 51 | void vfs_mime_type_unref( gpointer mime_type_ ); 52 | 53 | GdkPixbuf* vfs_mime_type_get_icon( VFSMimeType* mime_type, gboolean big ); 54 | 55 | void vfs_mime_type_set_icon_size( int big, int small ); 56 | void vfs_mime_type_get_icon_size( int* big, int* small ); 57 | 58 | /* Get mime-type string */ 59 | const char* vfs_mime_type_get_type( VFSMimeType* mime_type ); 60 | 61 | /* Get human-readable description of mime-type */ 62 | const char* vfs_mime_type_get_description( VFSMimeType* mime_type ); 63 | 64 | /* 65 | * Get available actions (applications) for this mime-type 66 | * returned vector should be freed with g_strfreev when not needed. 67 | */ 68 | char** vfs_mime_type_get_actions( VFSMimeType* mime_type ); 69 | 70 | /* returned string should be freed with g_strfreev when not needed. */ 71 | char* vfs_mime_type_get_default_action( VFSMimeType* mime_type ); 72 | 73 | void vfs_mime_type_set_default_action( VFSMimeType* mime_type, 74 | const char* desktop_id ); 75 | 76 | void vfs_mime_type_remove_action( VFSMimeType* mime_type, 77 | const char* desktop_id ); 78 | 79 | /* If user-custom desktop file is created, it's returned in custom_desktop. */ 80 | void vfs_mime_type_add_action( VFSMimeType* mime_type, 81 | const char* desktop_id, 82 | char** custom_desktop ); 83 | 84 | void vfs_mime_type_append_action( const char* type, const char* desktop_id ); 85 | 86 | char** vfs_mime_type_get_all_known_apps(); 87 | 88 | char** vfs_mime_type_join_actions( char** list1, gsize len1, 89 | char** list2, gsize len2 ); 90 | 91 | GList* vfs_mime_type_add_reload_cb( GFreeFunc cb, gpointer user_data ); 92 | 93 | void vfs_mime_type_remove_reload_cb( GList* cb ); 94 | 95 | char* vfs_mime_type_locate_desktop_file( const char* dir, const char* desktop_id ); 96 | 97 | gboolean vfs_mime_type_is_iso( VFSMimeType* vfs_mime_type, const char* path ); 98 | 99 | G_END_DECLS 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /src/libmd5-rfc/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would be 15 | appreciated but is not required. 16 | 2. Altered source versions must be plainly marked as such, and must not be 17 | misrepresented as being the original software. 18 | 3. This notice may not be removed or altered from any source distribution. 19 | 20 | L. Peter Deutsch 21 | ghost@aladdin.com 22 | 23 | */ 24 | /* $Id: md5.h,v 1.4 2002/04/13 19:20:28 lpd Exp $ */ 25 | /* 26 | Independent implementation of MD5 (RFC 1321). 27 | 28 | This code implements the MD5 Algorithm defined in RFC 1321, whose 29 | text is available at 30 | http://www.ietf.org/rfc/rfc1321.txt 31 | The code is derived from the text of the RFC, including the test suite 32 | (section A.5) but excluding the rest of Appendix A. It does not include 33 | any code or documentation that is identified in the RFC as being 34 | copyrighted. 35 | 36 | The original and principal author of md5.h is L. Peter Deutsch 37 | . Other authors are noted in the change history 38 | that follows (in reverse chronological order): 39 | 40 | 2002-04-13 lpd Removed support for non-ANSI compilers; removed 41 | references to Ghostscript; clarified derivation from RFC 1321; 42 | now handles byte order either statically or dynamically. 43 | 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 44 | 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); 45 | added conditionalization for C++ compilation from Martin 46 | Purschke . 47 | 1999-05-03 lpd Original version. 48 | */ 49 | 50 | #ifndef md5_INCLUDED 51 | # define md5_INCLUDED 52 | 53 | /* 54 | * This package supports both compile-time and run-time determination of CPU 55 | * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be 56 | * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is 57 | * defined as non-zero, the code will be compiled to run only on big-endian 58 | * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to 59 | * run on either big- or little-endian CPUs, but will run slightly less 60 | * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. 61 | */ 62 | 63 | typedef unsigned char md5_byte_t; /* 8-bit byte */ 64 | typedef unsigned int md5_word_t; /* 32-bit word */ 65 | 66 | /* Define the state of the MD5 Algorithm. */ 67 | typedef struct md5_state_s { 68 | md5_word_t count[2]; /* message length in bits, lsw first */ 69 | md5_word_t abcd[4]; /* digest buffer */ 70 | md5_byte_t buf[64]; /* accumulate block */ 71 | } md5_state_t; 72 | 73 | #ifdef __cplusplus 74 | extern "C" 75 | { 76 | #endif 77 | 78 | /* Initialize the algorithm. */ 79 | void md5_init(md5_state_t *pms); 80 | 81 | /* Append a string to the message. */ 82 | void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); 83 | 84 | /* Finish the message and return the digest. */ 85 | void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); 86 | 87 | #ifdef __cplusplus 88 | } /* end extern "C" */ 89 | #endif 90 | 91 | #endif /* md5_INCLUDED */ 92 | -------------------------------------------------------------------------------- /src/ptk/ptk-file-list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: ptk-file-list 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _PTK_FILE_LIST_H_ 14 | #define _PTK_FILE_LIST_H_ 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | #include "vfs-dir.h" 23 | 24 | G_BEGIN_DECLS 25 | 26 | #define PTK_TYPE_FILE_LIST (ptk_file_list_get_type()) 27 | #define PTK_FILE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PTK_TYPE_FILE_LIST, PtkFileList)) 28 | #define PTK_FILE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PTK_TYPE_FILE_LIST, PtkFileListClass)) 29 | #define PTK_IS_FILE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PTK_TYPE_FILE_LIST)) 30 | #define PTK_IS_FILE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PTK_TYPE_FILE_LIST)) 31 | #define PTK_FILE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PTK_TYPE_FILE_LIST, PtkFileListClass)) 32 | 33 | /* Columns of folder view */ 34 | enum{ 35 | COL_FILE_BIG_ICON = 0, 36 | COL_FILE_SMALL_ICON, 37 | COL_FILE_NAME, 38 | COL_FILE_SIZE, 39 | COL_FILE_DESC, 40 | COL_FILE_PERM, 41 | COL_FILE_OWNER, 42 | COL_FILE_MTIME, 43 | COL_FILE_INFO, 44 | N_FILE_LIST_COLS 45 | }; 46 | 47 | // sort_dir of folder view - do not change order, saved 48 | // see also: main-window.c main_window_socket_command() get sort_first 49 | enum{ 50 | PTK_LIST_SORT_DIR_MIXED = 0, 51 | PTK_LIST_SORT_DIR_FIRST, 52 | PTK_LIST_SORT_DIR_LAST 53 | }; 54 | 55 | typedef struct _PtkFileList PtkFileList; 56 | typedef struct _PtkFileListClass PtkFileListClass; 57 | 58 | struct _PtkFileList 59 | { 60 | GObject parent; 61 | /* */ 62 | VFSDir* dir; 63 | GList* files; 64 | guint n_files; 65 | 66 | gboolean show_hidden : 1; 67 | gboolean big_thumbnail : 1; 68 | int max_thumbnail; 69 | 70 | int sort_col; 71 | GtkSortType sort_order; 72 | gboolean sort_natural; //sfm 73 | gboolean sort_case; //sfm 74 | gboolean sort_hidden_first; //sfm 75 | char sort_dir; //sfm 76 | /* Random integer to check whether an iter belongs to our model */ 77 | gint stamp; 78 | }; 79 | 80 | struct _PtkFileListClass 81 | { 82 | GObjectClass parent; 83 | /* Default signal handlers */ 84 | void ( *file_created ) ( VFSDir* dir, const char* file_name ); 85 | void ( *file_deleted ) ( VFSDir* dir, const char* file_name ); 86 | void ( *file_changed ) ( VFSDir* dir, const char* file_name ); 87 | void ( *load_complete ) ( VFSDir* dir ); 88 | }; 89 | 90 | GType ptk_file_list_get_type (void); 91 | 92 | PtkFileList *ptk_file_list_new ( VFSDir* dir, gboolean show_hidden ); 93 | 94 | void ptk_file_list_set_dir( PtkFileList* list, VFSDir* dir ); 95 | 96 | gboolean ptk_file_list_find_iter( PtkFileList* list, GtkTreeIter* it, VFSFileInfo* fi ); 97 | 98 | void ptk_file_list_file_created( VFSDir* dir, VFSFileInfo* file, 99 | PtkFileList* list ); 100 | 101 | void ptk_file_list_file_deleted( VFSDir* dir, VFSFileInfo* file, 102 | PtkFileList* list ); 103 | 104 | void ptk_file_list_file_changed( VFSDir* dir, VFSFileInfo* file, 105 | PtkFileList* list ); 106 | 107 | void ptk_file_list_show_thumbnails( PtkFileList* list, gboolean is_big, 108 | int max_file_size ); 109 | void ptk_file_list_sort ( PtkFileList* list ); //sfm 110 | 111 | G_END_DECLS 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /src/ptk/ptk-handler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpaceFM ptk-handler.h 3 | * 4 | * Copyright (C) 2015 IgnorantGuru 5 | * Copyright (C) 2013-2014 OmegaPhil 6 | * Copyright (C) 2014 IgnorantGuru 7 | * Copyright (C) 2006 Hong Jen Yee (PCMan) 8 | * 9 | * License: See COPYING file 10 | * 11 | */ 12 | 13 | #ifndef _PTK_HANDLER_H_ 14 | #define _PTK_HANDLER_H_ 15 | 16 | #include 17 | #include 18 | 19 | #include "settings.h" 20 | #include "ptk-file-browser.h" 21 | 22 | G_BEGIN_DECLS 23 | 24 | #define MOUNT_EXAMPLE "# Enter mount command or leave blank for auto:\n\n\n# # Examples: (remove # to enable a mount command)\n#\n# # udevil:\n# udevil mount -o '%o' %v\n#\n# # pmount: (does not accept mount options)\n# pmount %v\n#\n# # udisks v2:\n# udisksctl mount -b %v -o '%o'\n#\n# # udisks v1: (enable all three lines!)\n# fm_udisks=`udisks --mount %v --mount-options '%o' 2>&1`\n# echo \"$fm_udisks\"\n# [[ \"$fm_udisks\" = \"${fm_udisks/ount failed:/}\" ]]\n\n" 25 | 26 | #define UNMOUNT_EXAMPLE "# Enter unmount command or leave blank for auto:\n\n\n# # Examples: (remove # to enable an unmount command)\n#\n# # udevil:\n# udevil umount %v\n#\n# # pmount:\n# pumount %v\n#\n# # udisks v2:\n# udisksctl unmount -b %v\n#\n# # udisks v1: (enable all three lines!)\n# fm_udisks=`udisks --unmount %v 2>&1`\n# echo \"$fm_udisks\"\n# [[ \"$fm_udisks\" = \"${fm_udisks/ount failed:/}\" ]]\n\n" 27 | 28 | #define INFO_EXAMPLE "# Enter command to show properties or leave blank for auto:\n\n\n# # Example:\n\n# echo MOUNT\n# mount | grep \" on %a \"\n# echo\n# echo PROCESSES\n# /usr/bin/lsof -w \"%a\" | head -n 500\n" 29 | 30 | enum { 31 | HANDLER_COMPRESS, 32 | HANDLER_EXTRACT, 33 | HANDLER_LIST 34 | }; 35 | 36 | enum { 37 | HANDLER_MOUNT, 38 | HANDLER_UNMOUNT, 39 | HANDLER_PROP 40 | }; 41 | 42 | enum { 43 | HANDLER_MODE_ARC, 44 | HANDLER_MODE_FS, 45 | HANDLER_MODE_NET, 46 | HANDLER_MODE_FILE 47 | }; 48 | 49 | void ptk_handler_add_new_default( int mode, const char* default_name, 50 | gboolean start ); 51 | void ptk_handler_add_defaults( int mode, gboolean overwrite, 52 | gboolean add_missing ); 53 | void ptk_handler_import( int mode, GtkWidget* handler_dlg, XSet* set ); 54 | gboolean ptk_handler_equals_default( XSet* set ); 55 | void ptk_handler_show_config( int mode, DesktopWindow* desktop, 56 | PtkFileBrowser* file_browser, 57 | XSet* def_handler_set ); 58 | gboolean ptk_handler_values_in_list( const char* list, GSList* values, 59 | char** msg ); 60 | XSet* add_new_handler( int mode ); // for settings.c upgrade 61 | char* ptk_handler_load_script( int mode, int cmd, XSet* handler_set, 62 | GtkTextView* view, char** text ); 63 | char* ptk_handler_save_script( int mode, int cmd, XSet* handler_set, 64 | GtkTextView* view, const char* command ); 65 | char* ptk_handler_get_command( int mode, int cmd, XSet* handler_set ); 66 | gboolean ptk_handler_command_is_empty( const char* command ); 67 | void ptk_handler_load_text_view( GtkTextView* view, const char* text ); 68 | GSList* ptk_handler_file_has_handlers( int mode, int cmd, 69 | const char* path, 70 | VFSMimeType* mime_type, 71 | gboolean test_cmd, 72 | gboolean multiple, 73 | gboolean enabled_only ); 74 | 75 | 76 | G_END_DECLS 77 | #endif 78 | 79 | -------------------------------------------------------------------------------- /src/ptk/ptk-file-task.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: ptk-file-task 3 | * 4 | * Description: 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #include "vfs-file-task.h" 14 | #include 15 | #include "settings.h" 16 | 17 | 18 | #ifndef _PTK_FILE_TASK_ 19 | #define _PTK_FILE_TASK_ 20 | 21 | typedef struct _PtkFileTask PtkFileTask; 22 | 23 | enum { 24 | PTASK_ERROR_FIRST, 25 | PTASK_ERROR_ANY, 26 | PTASK_ERROR_CONT 27 | }; 28 | 29 | struct _PtkFileTask 30 | { 31 | VFSFileTask* task; 32 | 33 | GtkWidget* progress_dlg; 34 | GtkWidget* progress_btn_close; 35 | GtkWidget* progress_btn_stop; 36 | GtkWidget* progress_btn_pause; 37 | GtkWindow* parent_window; 38 | GtkWidget* task_view; 39 | GtkLabel* from; 40 | GtkLabel* to; 41 | GtkLabel* src_dir; 42 | GtkLabel* current; 43 | GtkProgressBar* progress_bar; 44 | GtkLabel* errors; 45 | GtkWidget* error_view; 46 | GtkScrolledWindow* scroll; 47 | GtkWidget* overwrite_combo; 48 | GtkWidget* error_combo; 49 | 50 | GtkTextBuffer* log_buf; 51 | GtkTextMark* log_end; 52 | gboolean log_appended; 53 | guint err_count; 54 | char err_mode; 55 | 56 | /* 57 | int percent; 58 | off64_t total_size; // Total size of the files to be processed, in bytes 59 | off64_t progress; // Total size of current processed files, in btytes 60 | guint item_count; 61 | guint old_err_count; 62 | */ 63 | gboolean complete; 64 | gboolean aborted; 65 | gboolean pause_change; 66 | gboolean pause_change_view; 67 | gboolean force_scroll; 68 | 69 | /* */ 70 | guint timeout; 71 | gboolean restart_timeout; 72 | guint progress_timer; 73 | char progress_count; 74 | GFunc complete_notify; 75 | gpointer user_data; 76 | gboolean keep_dlg; 77 | gboolean pop_detail; 78 | char* pop_handler; 79 | 80 | GCond* query_cond; 81 | GCond* query_cond_last; 82 | char** query_new_dest; 83 | GtkEntry* query_entry; 84 | gboolean query_ret; 85 | 86 | char* dsp_file_count; 87 | char* dsp_size_tally; 88 | char* dsp_elapsed; 89 | char* dsp_curspeed; 90 | char* dsp_curest; 91 | char* dsp_avgspeed; 92 | char* dsp_avgest; 93 | 94 | }; 95 | 96 | PtkFileTask* ptk_file_task_new( VFSFileTaskType type, 97 | GList* src_files, 98 | const char* dest_dir, 99 | GtkWindow* parent_window, 100 | GtkWidget* task_view ); 101 | PtkFileTask* ptk_file_exec_new( const char* item_name, const char* dir, 102 | GtkWidget* parent, GtkWidget* task_view ); 103 | 104 | void ptk_file_task_destroy( PtkFileTask* ptask ); 105 | 106 | void ptk_file_task_set_complete_notify( PtkFileTask* ptask, 107 | GFunc callback, 108 | gpointer user_data ); 109 | 110 | void ptk_file_task_set_chmod( PtkFileTask* ptask, 111 | guchar* chmod_actions ); 112 | 113 | void ptk_file_task_set_chown( PtkFileTask* ptask, 114 | uid_t uid, gid_t gid ); 115 | 116 | void ptk_file_task_set_recursive( PtkFileTask* ptask, gboolean recursive ); 117 | 118 | void ptk_file_task_run( PtkFileTask* ptask ); 119 | 120 | gboolean ptk_file_task_cancel( PtkFileTask* ptask ); 121 | 122 | void ptk_file_task_pause( PtkFileTask* ptask, int state ); 123 | 124 | void ptk_file_task_progress_open( PtkFileTask* ptask ); 125 | 126 | #endif 127 | 128 | -------------------------------------------------------------------------------- /src/exo/exo-marshal.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ___exo_marshal_MARSHAL_H__ 3 | #define ___exo_marshal_MARSHAL_H__ 4 | 5 | #include 6 | 7 | G_BEGIN_DECLS 8 | 9 | /* VOID:INT,INT (exo-marshal.list:1) */ 10 | extern void _exo_marshal_VOID__INT_INT (GClosure *closure, 11 | GValue *return_value, 12 | guint n_param_values, 13 | const GValue *param_values, 14 | gpointer invocation_hint, 15 | gpointer marshal_data); 16 | 17 | /* VOID:OBJECT,OBJECT (exo-marshal.list:2) */ 18 | extern void _exo_marshal_VOID__OBJECT_OBJECT (GClosure *closure, 19 | GValue *return_value, 20 | guint n_param_values, 21 | const GValue *param_values, 22 | gpointer invocation_hint, 23 | gpointer marshal_data); 24 | 25 | /* STRING:POINTER (exo-marshal.list:3) */ 26 | extern void _exo_marshal_STRING__POINTER (GClosure *closure, 27 | GValue *return_value, 28 | guint n_param_values, 29 | const GValue *param_values, 30 | gpointer invocation_hint, 31 | gpointer marshal_data); 32 | 33 | /* STRING:STRING,STRING (exo-marshal.list:4) */ 34 | extern void _exo_marshal_STRING__STRING_STRING (GClosure *closure, 35 | GValue *return_value, 36 | guint n_param_values, 37 | const GValue *param_values, 38 | gpointer invocation_hint, 39 | gpointer marshal_data); 40 | 41 | /* BOOLEAN:VOID (exo-marshal.list:5) */ 42 | extern void _exo_marshal_BOOLEAN__VOID (GClosure *closure, 43 | GValue *return_value, 44 | guint n_param_values, 45 | const GValue *param_values, 46 | gpointer invocation_hint, 47 | gpointer marshal_data); 48 | 49 | /* BOOLEAN:ENUM,INT (exo-marshal.list:6) */ 50 | extern void _exo_marshal_BOOLEAN__ENUM_INT (GClosure *closure, 51 | GValue *return_value, 52 | guint n_param_values, 53 | const GValue *param_values, 54 | gpointer invocation_hint, 55 | gpointer marshal_data); 56 | 57 | /* BOOLEAN:INT,ENUM,BOOLEAN,ENUM,BOOLEAN (exo-marshal.list:7) */ 58 | extern void _exo_marshal_BOOLEAN__INT_ENUM_BOOLEAN_ENUM_BOOLEAN (GClosure *closure, 59 | GValue *return_value, 60 | guint n_param_values, 61 | const GValue *param_values, 62 | gpointer invocation_hint, 63 | gpointer marshal_data); 64 | 65 | G_END_DECLS 66 | 67 | #endif /* ___exo_marshal_MARSHAL_H__ */ 68 | 69 | -------------------------------------------------------------------------------- /src/vfs/vfs-file-monitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: vfs-monitor 3 | * 4 | * Description: File alteration monitor 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifdef HAVE_CONFIG_H 14 | #include 15 | #endif 16 | 17 | /* 18 | FIXME: VFSFileMonitor can support at most 1024 monitored files. 19 | This is caused by the limit of FAM/gamin itself. 20 | Maybe using inotify directly can solve this? 21 | */ 22 | 23 | #ifndef _VFS_FILE_MONITOR_H_ 24 | #define _VFS_FILE_MONITOR_H_ 25 | 26 | #include 27 | 28 | #ifdef USE_INOTIFY 29 | #include 30 | #include 31 | #else /* Use FAM|gamin */ 32 | #include 33 | #endif 34 | 35 | G_BEGIN_DECLS 36 | 37 | #ifdef USE_INOTIFY 38 | typedef enum{ 39 | VFS_FILE_MONITOR_CREATE, 40 | VFS_FILE_MONITOR_DELETE, 41 | VFS_FILE_MONITOR_CHANGE 42 | }VFSFileMonitorEvent; 43 | #else 44 | typedef enum{ 45 | VFS_FILE_MONITOR_CREATE = FAMCreated, 46 | VFS_FILE_MONITOR_DELETE = FAMDeleted, 47 | VFS_FILE_MONITOR_CHANGE = FAMChanged 48 | }VFSFileMonitorEvent; 49 | #endif 50 | 51 | typedef struct _VFSFileMonitor VFSFileMonitor; 52 | 53 | struct _VFSFileMonitor{ 54 | gchar* path; 55 | /**/ 56 | int n_ref; 57 | #ifdef USE_INOTIFY 58 | int wd; 59 | #else 60 | FAMRequest request; 61 | #endif 62 | GArray* callbacks; 63 | }; 64 | 65 | /* Callback function which will be called when monitored events happen 66 | * NOTE: GDK_THREADS_ENTER and GDK_THREADS_LEAVE might be needed 67 | * if gtk+ APIs are called in this callback, since the callback is called from 68 | * IO channel handler. 69 | */ 70 | typedef void (*VFSFileMonitorCallback)( VFSFileMonitor* fm, 71 | VFSFileMonitorEvent event, 72 | const char* file_name, 73 | gpointer user_data ); 74 | 75 | /* 76 | * Init monitor: 77 | * Establish connection with gamin/fam. 78 | */ 79 | gboolean vfs_file_monitor_init(); 80 | 81 | /* 82 | * Monitor changes of a file or directory. 83 | * 84 | * Parameters: 85 | * path: the file/dir to be monitored 86 | * cb: callback function to be called when file event happens. 87 | * user_data: user data to be passed to callback function. 88 | */ 89 | VFSFileMonitor* vfs_file_monitor_add( char* path, 90 | gboolean is_dir, 91 | VFSFileMonitorCallback cb, 92 | gpointer user_data ); 93 | 94 | /* 95 | * Monitor changes of a file. 96 | * 97 | * Parameters: 98 | * path: the file/dir to be monitored 99 | * cb: callback function to be called when file event happens. 100 | * user_data: user data to be passed to callback function. 101 | */ 102 | #define vfs_file_monitor_add_file( path, cb, user_data ) \ 103 | vfs_file_monitor_add(path, FALSE, cb, user_data ) 104 | 105 | /* 106 | * Monitor changes of a directory. 107 | * 108 | * Parameters: 109 | * path: the file/dir to be monitored 110 | * cb: callback function to be called when file event happens. 111 | * user_data: user data to be passed to callback function. 112 | */ 113 | #define vfs_file_monitor_add_dir( path, cb, user_data ) \ 114 | vfs_file_monitor_add(path, TRUE, cb, user_data ) 115 | 116 | /* 117 | * Remove previously installed monitor. 118 | */ 119 | void vfs_file_monitor_remove( VFSFileMonitor* fm, 120 | VFSFileMonitorCallback cb, 121 | gpointer user_data ); 122 | 123 | /* 124 | * Clearn up and shutdown file alteration monitor. 125 | */ 126 | void vfs_file_monitor_clean(); 127 | 128 | G_END_DECLS 129 | 130 | #endif 131 | -------------------------------------------------------------------------------- /src/exo/exo-tree-view.h: -------------------------------------------------------------------------------- 1 | /* $Id: exo-tree-view.h 20828 2006-04-09 17:16:48Z benny $ */ 2 | /*- 3 | * Copyright (c) 2004-2006 Benedikt Meurer 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 3 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | /* Modified by Hong Jen Yee (PCMan) 22 | * on 2008.07.13 for use in PCManFM */ 23 | 24 | /* 25 | #if !defined (EXO_INSIDE_EXO_H) && !defined (EXO_COMPILATION) 26 | #error "Only can be included directly, this file may disappear or change contents." 27 | #endif 28 | */ 29 | 30 | #ifndef __EXO_TREE_VIEW_H__ 31 | #define __EXO_TREE_VIEW_H__ 32 | 33 | #include 34 | 35 | G_BEGIN_DECLS; 36 | 37 | typedef struct _ExoTreeViewPrivate ExoTreeViewPrivate; 38 | typedef struct _ExoTreeViewClass ExoTreeViewClass; 39 | typedef struct _ExoTreeView ExoTreeView; 40 | 41 | #define EXO_TYPE_TREE_VIEW (exo_tree_view_get_type ()) 42 | #define EXO_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_TREE_VIEW, ExoTreeView)) 43 | #define EXO_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_TREE_VIEW, ExoTreeViewClass)) 44 | #define EXO_IS_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_TREE_VIEW)) 45 | #define EXO_IS_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_TREE_VIEW)) 46 | #define EXO_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_TREE_VIEW, ExoTreeViewClass)) 47 | 48 | struct _ExoTreeViewClass 49 | { 50 | /*< private >*/ 51 | GtkTreeViewClass __parent__; 52 | 53 | /*< private >*/ 54 | /* 55 | void (*reserved1) (void); 56 | void (*reserved2) (void); 57 | void (*reserved3) (void); 58 | void (*reserved4) (void); 59 | void (*reserved5) (void); 60 | void (*reserved6) (void); 61 | void (*reserved7) (void); 62 | void (*reserved8) (void); 63 | */ 64 | }; 65 | 66 | struct _ExoTreeView 67 | { 68 | /*< private >*/ 69 | GtkTreeView __parent__; 70 | 71 | /*< private >*/ 72 | ExoTreeViewPrivate *priv; 73 | }; 74 | 75 | GType exo_tree_view_get_type (void) G_GNUC_CONST; 76 | 77 | GtkWidget *exo_tree_view_new (void) G_GNUC_MALLOC; 78 | 79 | gboolean exo_tree_view_get_single_click (const ExoTreeView *tree_view); 80 | void exo_tree_view_set_single_click (ExoTreeView *tree_view, 81 | gboolean single_click); 82 | 83 | guint exo_tree_view_get_single_click_timeout (const ExoTreeView *tree_view); 84 | void exo_tree_view_set_single_click_timeout (ExoTreeView *tree_view, 85 | guint single_click_timeout); 86 | 87 | /* 2008.07.16 added by Hong Jen Yee for PCManFM. 88 | * If activable column is set, only the specified column can be activated. 89 | * Other columns are viewed as blank area and won't receive mouse clicks. 90 | */ 91 | GtkTreeViewColumn* exo_tree_view_get_activable_column( ExoTreeView *tree_view ); 92 | void exo_tree_view_set_activable_column( ExoTreeView *tree_view, 93 | GtkTreeViewColumn* column ); 94 | 95 | G_END_DECLS; 96 | 97 | #endif /* !__EXO_TREE_VIEW_H__ */ 98 | -------------------------------------------------------------------------------- /src/exo/exo-string.c: -------------------------------------------------------------------------------- 1 | /* $Id: exo-string.c 47 2006-01-30 02:32:10Z pcmanx $ */ 2 | /*- 3 | * Copyright (c) 2004 os-cillation e.K. 4 | * 5 | * Written by Benedikt Meurer . 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 3 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifdef HAVE_CONFIG_H 24 | #include 25 | #endif 26 | 27 | #ifdef HAVE_MEMORY_H 28 | #include 29 | #endif 30 | #ifdef HAVE_STRING_H 31 | #include 32 | #endif 33 | 34 | #include "exo-string.h" 35 | 36 | 37 | 38 | /** 39 | * exo_str_elide_underscores: 40 | * @text : A zero terminated string. 41 | * 42 | * Returns a copy of @text with all mnemonic underscores 43 | * stripped off. 44 | * 45 | * Return value: A copy of @text without underscores. The 46 | * returned string must be freed when no 47 | * longer required. 48 | **/ 49 | gchar* 50 | exo_str_elide_underscores (const gchar *text) 51 | { 52 | const gchar *s; 53 | gboolean last_underscore = FALSE; 54 | gchar *result; 55 | gchar *t; 56 | 57 | g_return_val_if_fail (text != NULL, NULL); 58 | 59 | result = g_malloc (strlen (text) + 1); 60 | 61 | for (s = text, t = result; *s != '\0'; ++s) 62 | if (!last_underscore && *s == '_') 63 | { 64 | last_underscore = TRUE; 65 | } 66 | else 67 | { 68 | last_underscore = FALSE; 69 | *t++ = *s; 70 | } 71 | 72 | *t = '\0'; 73 | 74 | return result; 75 | } 76 | 77 | 78 | 79 | /** 80 | * exo_str_is_equal: 81 | * @a : A pointer to first string or %NULL. 82 | * @b : A pointer to second string or %NULL. 83 | * 84 | * %NULL-safe string comparison. Returns %TRUE if both @a and @b are 85 | * %NULL or if @a and @b refer to valid strings which are equal. 86 | * 87 | * You should always prefer this function over strcmp(). 88 | * 89 | * Return value: %TRUE if @a equals @b, else %FALSE. 90 | **/ 91 | gboolean 92 | exo_str_is_equal (const gchar *a, 93 | const gchar *b) 94 | { 95 | if (a == NULL && b == NULL) 96 | return TRUE; 97 | else if (a == NULL || b == NULL) 98 | return FALSE; 99 | 100 | while (*a == *b++) 101 | if (*a++ == '\0') 102 | return TRUE; 103 | 104 | return FALSE; 105 | } 106 | 107 | 108 | 109 | /** 110 | * exo_strndupv: 111 | * @strv : String vector to duplicate. 112 | * @num : Number of strings in @strv to 113 | * duplicate. 114 | * 115 | * Creates a new string vector containing the 116 | * first @n elements of @strv. 117 | * 118 | * Return value: The new string vector. Should be 119 | * freed using g_strfreev() when no 120 | * longer needed. 121 | **/ 122 | gchar** 123 | exo_strndupv (gchar **strv, 124 | gint num) 125 | { 126 | gchar **result; 127 | 128 | g_return_val_if_fail (strv != NULL, NULL); 129 | g_return_val_if_fail (num >= 0, NULL); 130 | 131 | result = g_new (gchar *, num + 1); 132 | result[num--] = NULL; 133 | for (; num >= 0; --num) 134 | result[num] = g_strdup (strv[num]); 135 | 136 | return result; 137 | } 138 | 139 | -------------------------------------------------------------------------------- /data/ui/about-dlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 5 | GTK_WIN_POS_CENTER_ON_PARENT 6 | GDK_WINDOW_TYPE_HINT_DIALOG 7 | SpaceFM 8 | by IgnorantGuru 9 | Copyright (C) 2018 GPL3+ 10 | http://ignorantguru.github.io/spacefm/ 11 | SpaceFM - Copyright (C) 2018 IgnorantGuru GPL3+ 12 | 13 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 14 | 15 | USE AT YOUR OWN RISK. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 16 | 17 | The 'exo' libraries and source code used by this software are licensed under the GNU General Public License and the GNU Lesser General Public License version 3 (LGPL3). 18 | 19 | You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 | Lead Developer: 21 | IgnorantGuru <igsw@fastmail.com> 22 | 23 | Contributors: 24 | BwackNinja <BwackNinja@gmail.com> 25 | OmegaPhil <OmegaPhil@startmail.com> 26 | 27 | Artwork: 28 | SpaceFM icons and logo by Goran Simovic 29 | 30 | Thanks to SpaceFM users for valuable feedback and to SpaceFM translators and 31 | packagers! 32 | 33 | Special thanks to: 34 | Jean-Philippe Fleury 35 | Vladimir Kudrya 36 | VastOne 37 | Hasufell 38 | 39 | SpaceFM is developed on geany, gcc, and git, with a little help from gdb. 40 | 41 | Source code taken from other projects: 42 | * pcmanfm-mod: IgnorantGuru 43 | * pcmanfm v0.5.2: Hon Jen Yee (PCMan) 44 | * libmd5-rfc: Aladdin Enterprises 45 | * Working area detection: Gary Kramlich 46 | * ExoIconView: os-cillation e.K, Anders Carlsson, Benedikt Meurer 47 | * Text and icon renderer uses code from Jonathan Blandford 48 | * Desktop icons use code from Brian Tarricone 49 | * HAL support (deprecated): gnome-vfs, thunar-vfs, libexo, gnome-mount 50 | SpaceFM icons and logo by Goran Simovic 51 | 52 | Additional icons were taken from the Tango Desktop Project icon set 53 | translator-credits 54 | 55 | spacefm 56 | True 57 | 58 | 59 | True 60 | 2 61 | 62 | 63 | 64 | 65 | 66 | True 67 | GTK_BUTTONBOX_END 68 | 69 | 70 | False 71 | GTK_PACK_END 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/gtk2-compat.h: -------------------------------------------------------------------------------- 1 | #ifndef __GTK2_COMPAT_H 2 | #define __GTK2_COMPAT_H 3 | 4 | #if GTK_CHECK_VERSION(3, 0, 0) 5 | #else 6 | #define gtk_menu_shell_get_selected_item(mc) mc->active_menu_item 7 | #endif 8 | 9 | #if GTK_CHECK_VERSION(2, 24, 0) 10 | #else 11 | #define gtk_combo_box_text_new_with_entry gtk_combo_box_entry_new_text 12 | #define gtk_combo_box_text_new gtk_combo_box_new_text 13 | #define gtk_combo_box_text_get_active_text gtk_combo_box_get_active_text 14 | #define gtk_combo_box_text_append_text gtk_combo_box_append_text 15 | static inline void gtk_combo_box_set_entry_text_column( 16 | GtkComboBox *combo_box, gint text_column ) 17 | { 18 | gtk_combo_box_entry_set_text_column( GTK_COMBO_BOX_ENTRY( combo_box ), 19 | text_column ); 20 | } 21 | #define gtk_combo_box_text_prepend_text gtk_combo_box_prepend_text 22 | #define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX 23 | static inline gint gdk_window_get_width (GdkWindow *window) 24 | { 25 | gint width; 26 | gdk_drawable_get_size(GDK_DRAWABLE(window), &width, NULL); 27 | return width; 28 | } 29 | static inline gint gdk_window_get_height (GdkWindow *window) 30 | { 31 | gint height; 32 | gdk_drawable_get_size(GDK_DRAWABLE(window), NULL, &height); 33 | return height; 34 | } 35 | #define gdk_x11_window_lookup_for_display gdk_window_lookup_for_display 36 | #endif 37 | 38 | #if GTK_CHECK_VERSION(2, 22, 0) 39 | #else 40 | #define gdk_drag_context_get_suggested_action(dc) dc->suggested_action 41 | #define gdk_drag_context_get_selected_action(dc) dc->action 42 | #define gdk_drag_context_get_actions(dc) dc->actions 43 | #define gdk_drag_context_list_targets(dc) dc->targets 44 | #define gtk_window_has_group(window) (window->group != NULL) 45 | 46 | #define GDK_KEY_space GDK_space 47 | #define GDK_KEY_Return GDK_Return 48 | #define GDK_KEY_ISO_Enter GDK_ISO_Enter 49 | #define GDK_KEY_KP_Enter GDK_KP_Enter 50 | #define GDK_KEY_Up GDK_Up 51 | #define GDK_KEY_KP_Up GDK_KP_Up 52 | #define GDK_KEY_Down GDK_Down 53 | #define GDK_KEY_KP_Down GDK_KP_Down 54 | #define GDK_KEY_Home GDK_Home 55 | #define GDK_KEY_KP_Home GDK_KP_Home 56 | #define GDK_KEY_End GDK_End 57 | #define GDK_KEY_KP_End GDK_KP_End 58 | #define GDK_KEY_Page_Up GDK_Page_Up 59 | #define GDK_KEY_KP_Page_Up GDK_KP_Page_Up 60 | #define GDK_KEY_Page_Down GDK_Page_Down 61 | #define GDK_KEY_KP_Page_Down GDK_KP_Page_Down 62 | #define GDK_KEY_Right GDK_Right 63 | #define GDK_KEY_KP_Right GDK_KP_Right 64 | #define GDK_KEY_Left GDK_Left 65 | #define GDK_KEY_KP_Left GDK_KP_Left 66 | #define GDK_KEY_Escape GDK_Escape 67 | #define GDK_KEY_Delete GDK_Delete 68 | #define GDK_KEY_BackSpace GDK_BackSpace 69 | #define GDK_KEY_Menu GDK_Menu 70 | #define GDK_KEY_Tab GDK_Tab 71 | #define GDK_KEY_F1 GDK_F1 72 | #define GDK_KEY_F2 GDK_F2 73 | #define GDK_KEY_F3 GDK_F3 74 | #define GDK_KEY_F4 GDK_F4 75 | #define GDK_KEY_Insert GDK_Insert 76 | #define GDK_KEY_0 GDK_0 77 | #define GDK_KEY_9 GDK_9 78 | #define GDK_KEY_a GDK_a 79 | #define GDK_KEY_c GDK_c 80 | #define GDK_KEY_e GDK_e 81 | #define GDK_KEY_g GDK_g 82 | #define GDK_KEY_i GDK_i 83 | #define GDK_KEY_k GDK_k 84 | #define GDK_KEY_n GDK_n 85 | #define GDK_KEY_p GDK_p 86 | #define GDK_KEY_v GDK_v 87 | #define GDK_KEY_w GDK_w 88 | #define GDK_KEY_x GDK_x 89 | #define GDK_KEY_z GDK_z 90 | #define GDK_KEY_A GDK_A 91 | #define GDK_KEY_F GDK_F 92 | #define GDK_KEY_G GDK_G 93 | #define GDK_KEY_W GDK_W 94 | #define GDK_KEY_Z GDK_Z 95 | 96 | #endif 97 | 98 | #if GTK_CHECK_VERSION(2, 20, 0) 99 | #else 100 | #define gtk_statusbar_get_message_area(widget) widget->frame 101 | #define gtk_widget_get_realized GTK_WIDGET_REALIZED 102 | #define gtk_widget_get_mapped GTK_WIDGET_MAPPED 103 | static inline void gtk_widget_set_realized( GtkWidget *widget, 104 | gboolean realized ) 105 | { 106 | if ( realized ) 107 | GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); 108 | else 109 | GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED); 110 | } 111 | #endif 112 | 113 | #endif /* __GTK2_COMPAT_H */ 114 | -------------------------------------------------------------------------------- /src/exo/exo-binding.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 os-cillation e.K. 3 | * Copyright (c) 2004 Victor Porton (http://ex-code.com/~porton/) 4 | * 5 | * Written by Benedikt Meurer . 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 3 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 20 | * MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef __EXO_BINDING_H__ 24 | #define __EXO_BINDING_H__ 25 | 26 | #include 27 | 28 | /* Taken from exo v0.10.2 (Debian package libexo-1-0), according to changelog 29 | * commit f455681554ca205ffe49bd616310b19f5f9f8ef1 Dec 27 13:50:21 2012 */ 30 | 31 | G_BEGIN_DECLS 32 | 33 | typedef struct _ExoBinding ExoBinding; 34 | typedef struct _ExoMutualBinding ExoMutualBinding; 35 | 36 | /** 37 | * ExoBindingTransform: 38 | * @src_value : Value to transform. 39 | * @dst_value : Value to store the result of the transformation into. 40 | * @user_data : User data supplied at binding creation. 41 | * 42 | * Function type used for binding transformation functions. 43 | * 44 | * Accomplished transformation from @src_value to @dst_value. 45 | * @src_value and @dst_value are already initialized before 46 | * this function gets called. 47 | * 48 | * Returns: %FALSE if transformation failed, else %TRUE. 49 | **/ 50 | typedef gboolean (*ExoBindingTransform) (const GValue *src_value, 51 | GValue *dst_value, 52 | gpointer user_data); 53 | 54 | ExoBinding *exo_binding_new (GObject *src_object, 55 | const gchar *src_property, 56 | GObject *dst_object, 57 | const gchar *dst_property); 58 | 59 | ExoBinding *exo_binding_new_full (GObject *src_object, 60 | const gchar *src_property, 61 | GObject *dst_object, 62 | const gchar *dst_property, 63 | ExoBindingTransform transform, 64 | GDestroyNotify destroy_notify, 65 | gpointer user_data); 66 | 67 | ExoMutualBinding *exo_mutual_binding_new (GObject *object1, 68 | const gchar *property1, 69 | GObject *object2, 70 | const gchar *property2); 71 | 72 | ExoMutualBinding *exo_mutual_binding_new_full (GObject *object1, 73 | const gchar *property1, 74 | GObject *object2, 75 | const gchar *property2, 76 | ExoBindingTransform transform, 77 | ExoBindingTransform reverse_transform, 78 | GDestroyNotify destroy_notify, 79 | gpointer user_data); 80 | 81 | G_END_DECLS 82 | 83 | #endif /* !__EXO_BINDING_H__ */ 84 | -------------------------------------------------------------------------------- /mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Original author: Noah Friedman 7 | # Created: 1993-05-16 8 | # Public domain. 9 | # 10 | # This file is maintained in Automake, please report 11 | # bugs to or send patches to 12 | # . 13 | 14 | nl=' 15 | ' 16 | IFS=" "" $nl" 17 | errstatus=0 18 | dirmode= 19 | 20 | usage="\ 21 | Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... 22 | 23 | Create each directory DIR (with mode MODE, if specified), including all 24 | leading file name components. 25 | 26 | Report bugs to ." 27 | 28 | # process command line arguments 29 | while test $# -gt 0 ; do 30 | case $1 in 31 | -h | --help | --h*) # -h for help 32 | echo "$usage" 33 | exit $? 34 | ;; 35 | -m) # -m PERM arg 36 | shift 37 | test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } 38 | dirmode=$1 39 | shift 40 | ;; 41 | --version) 42 | echo "$0 $scriptversion" 43 | exit $? 44 | ;; 45 | --) # stop option processing 46 | shift 47 | break 48 | ;; 49 | -*) # unknown option 50 | echo "$usage" 1>&2 51 | exit 1 52 | ;; 53 | *) # first non-opt arg 54 | break 55 | ;; 56 | esac 57 | done 58 | 59 | for file 60 | do 61 | if test -d "$file"; then 62 | shift 63 | else 64 | break 65 | fi 66 | done 67 | 68 | case $# in 69 | 0) exit 0 ;; 70 | esac 71 | 72 | # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and 73 | # mkdir -p a/c at the same time, both will detect that a is missing, 74 | # one will create a, then the other will try to create a and die with 75 | # a "File exists" error. This is a problem when calling mkinstalldirs 76 | # from a parallel make. We use --version in the probe to restrict 77 | # ourselves to GNU mkdir, which is thread-safe. 78 | case $dirmode in 79 | '') 80 | if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then 81 | echo "mkdir -p -- $*" 82 | exec mkdir -p -- "$@" 83 | else 84 | # On NextStep and OpenStep, the `mkdir' command does not 85 | # recognize any option. It will interpret all options as 86 | # directories to create, and then abort because `.' already 87 | # exists. 88 | test -d ./-p && rmdir ./-p 89 | test -d ./--version && rmdir ./--version 90 | fi 91 | ;; 92 | *) 93 | if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && 94 | test ! -d ./--version; then 95 | echo "mkdir -m $dirmode -p -- $*" 96 | exec mkdir -m "$dirmode" -p -- "$@" 97 | else 98 | # Clean up after NextStep and OpenStep mkdir. 99 | for d in ./-m ./-p ./--version "./$dirmode"; 100 | do 101 | test -d $d && rmdir $d 102 | done 103 | fi 104 | ;; 105 | esac 106 | 107 | for file 108 | do 109 | case $file in 110 | /*) pathcomp=/ ;; 111 | *) pathcomp= ;; 112 | esac 113 | oIFS=$IFS 114 | IFS=/ 115 | set fnord $file 116 | shift 117 | IFS=$oIFS 118 | 119 | for d 120 | do 121 | test "x$d" = x && continue 122 | 123 | pathcomp=$pathcomp$d 124 | case $pathcomp in 125 | -*) pathcomp=./$pathcomp ;; 126 | esac 127 | 128 | if test ! -d "$pathcomp"; then 129 | echo "mkdir $pathcomp" 130 | 131 | mkdir "$pathcomp" || lasterr=$? 132 | 133 | if test ! -d "$pathcomp"; then 134 | errstatus=$lasterr 135 | else 136 | if test ! -z "$dirmode"; then 137 | echo "chmod $dirmode $pathcomp" 138 | lasterr= 139 | chmod "$dirmode" "$pathcomp" || lasterr=$? 140 | 141 | if test ! -z "$lasterr"; then 142 | errstatus=$lasterr 143 | fi 144 | fi 145 | fi 146 | fi 147 | 148 | pathcomp=$pathcomp/ 149 | done 150 | done 151 | 152 | exit $errstatus 153 | 154 | # Local Variables: 155 | # mode: shell-script 156 | # sh-indentation: 2 157 | # eval: (add-hook 'write-file-hooks 'time-stamp) 158 | # time-stamp-start: "scriptversion=" 159 | # time-stamp-format: "%:y-%02m-%02d.%02H" 160 | # time-stamp-time-zone: "UTC" 161 | # time-stamp-end: "; # UTC" 162 | # End: 163 | -------------------------------------------------------------------------------- /src/exo/exo-icon-chooser-model.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005-2006 Benedikt Meurer 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 3 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __EXO_ICON_CHOOSER_MODEL_H__ 21 | #define __EXO_ICON_CHOOSER_MODEL_H__ 22 | 23 | /* Taken from exo v0.10.2 (Debian package libexo-1-0), according to changelog 24 | * commit f455681554ca205ffe49bd616310b19f5f9f8ef1 Dec 27 13:50:21 2012 */ 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | typedef struct _ExoIconChooserModelClass ExoIconChooserModelClass; 31 | typedef struct _ExoIconChooserModel ExoIconChooserModel; 32 | 33 | #define EXO_TYPE_ICON_CHOOSER_MODEL (exo_icon_chooser_model_get_type ()) 34 | #define EXO_ICON_CHOOSER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXO_TYPE_ICON_CHOOSER_MODEL, ExoIconChooserModel)) 35 | #define EXO_ICON_CHOOSER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXO_TYPE_ICON_CHOOSER_MODEL, ExoIconChooserModelClass)) 36 | #define EXO_IS_ICON_CHOOSER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXO_TYPE_ICON_CHOOSER_MODEL)) 37 | #define EXO_IS_ICON_CHOOSER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXO_TYPE_ICON_CHOOSER_MODEL)) 38 | #define EXO_ICON_CHOOSER_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXO_TYPE_ICON_CHOOSER_MODEL, ExoIconChooserModelClass)) 39 | 40 | /** 41 | * ExoIconChooserContexts: 42 | * 43 | * The list of default contexts for the icon themes 44 | * according to the Icon Naming Spec, Version 0.7. 45 | **/ 46 | typedef enum 47 | { 48 | /* the contexts provided by the model */ 49 | EXO_ICON_CHOOSER_CONTEXT_ACTIONS, 50 | EXO_ICON_CHOOSER_CONTEXT_ANIMATIONS, 51 | EXO_ICON_CHOOSER_CONTEXT_APPLICATIONS, 52 | EXO_ICON_CHOOSER_CONTEXT_CATEGORIES, 53 | EXO_ICON_CHOOSER_CONTEXT_DEVICES, 54 | EXO_ICON_CHOOSER_CONTEXT_EMBLEMS, 55 | EXO_ICON_CHOOSER_CONTEXT_EMOTES, 56 | EXO_ICON_CHOOSER_CONTEXT_INTERNATIONAL, 57 | EXO_ICON_CHOOSER_CONTEXT_MIME_TYPES, 58 | EXO_ICON_CHOOSER_CONTEXT_PLACES, 59 | EXO_ICON_CHOOSER_CONTEXT_STATUS, 60 | EXO_ICON_CHOOSER_CONTEXT_OTHER, 61 | EXO_ICON_CHOOSER_N_CONTEXTS, 62 | 63 | /* not provided by the model (plus separators before them) */ 64 | EXO_ICON_CHOOSER_CONTEXT_ALL = EXO_ICON_CHOOSER_CONTEXT_OTHER + 2, 65 | EXO_ICON_CHOOSER_CONTEXT_FILE = EXO_ICON_CHOOSER_CONTEXT_OTHER + 4, 66 | } ExoIconChooserContext; 67 | 68 | /** 69 | * ExoIconChooserModelColumns: 70 | * @EXO_ICON_CHOOSER_MODEL_COLUMN_CONTEXT : the context of the icon. 71 | * @EXO_ICON_CHOOSER_MODEL_COLUMN_ICON_NAME : the name of the icon. 72 | * @EXO_ICON_CHOOSER_MODEL_N_COLUMNS : the number of columns. 73 | * 74 | * The columns provided by the #ExoIconChooserModel. 75 | **/ 76 | typedef enum 77 | { 78 | EXO_ICON_CHOOSER_MODEL_COLUMN_CONTEXT, 79 | EXO_ICON_CHOOSER_MODEL_COLUMN_ICON_NAME, 80 | EXO_ICON_CHOOSER_MODEL_N_COLUMNS, 81 | } ExoIconChooserModelColumn; 82 | 83 | G_GNUC_INTERNAL GType exo_icon_chooser_model_get_type (void) G_GNUC_CONST; 84 | 85 | G_GNUC_INTERNAL ExoIconChooserModel *_exo_icon_chooser_model_get_for_widget (GtkWidget *widget) G_GNUC_WARN_UNUSED_RESULT; 86 | G_GNUC_INTERNAL ExoIconChooserModel *_exo_icon_chooser_model_get_for_icon_theme (GtkIconTheme *icon_theme) G_GNUC_WARN_UNUSED_RESULT; 87 | 88 | G_GNUC_INTERNAL gboolean _exo_icon_chooser_model_get_iter_for_icon_name (ExoIconChooserModel *model, 89 | GtkTreeIter *iter, 90 | const gchar *icon_name) ; 91 | 92 | G_END_DECLS 93 | 94 | #endif /* !__EXO_ICON_CHOOSER_MODEL_H__ */ 95 | -------------------------------------------------------------------------------- /src/exo/exo-utils.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005 Benedikt Meurer . 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 3 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 | * MA 02110-1301 USA 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | /* Taken from exo v0.10.2 (Debian package libexo-1-0), according to changelog 25 | * commit f455681554ca205ffe49bd616310b19f5f9f8ef1 Dec 27 13:50:21 2012 */ 26 | 27 | /* implement exo-utils's inline functions */ 28 | #define G_IMPLEMENT_INLINES 1 29 | #define __EXO_UTILS_C__ 30 | #include "exo-utils.h" 31 | 32 | /** 33 | * SECTION: exo-utils 34 | * @title: Miscellaneous Utility Functions 35 | * @short_description: Various utility functions 36 | * @include: exo/exo.h 37 | * @see_also: 38 | * GLib Atomic Operations 39 | * 40 | * This module contains various utility functions that extend the basic 41 | * utility functions provided by the GLib library. 43 | **/ 44 | 45 | 46 | 47 | /** 48 | * exo_noop: 49 | * 50 | * This function has no effect. It does nothing but 51 | * returning instantly. It is mostly useful in 52 | * situations that require a function to be called, 53 | * but that function does not need to do anything 54 | * useful. 55 | * 56 | * Since: 0.3.1 57 | **/ 58 | void 59 | exo_noop (void) 60 | { 61 | } 62 | 63 | 64 | 65 | /** 66 | * exo_noop_one: 67 | * 68 | * This function has no effect but simply returns 69 | * the integer value %1. It is mostly useful in 70 | * situations where you just need a function that 71 | * returns %1, but don't want to perform any other 72 | * actions. 73 | * 74 | * Returns: the integer value %1. 75 | * 76 | * Since: 0.3.1 77 | **/ 78 | gint 79 | exo_noop_one (void) 80 | { 81 | return 1; 82 | } 83 | 84 | 85 | 86 | /** 87 | * exo_noop_zero: 88 | * 89 | * This function has no effect but simply returns 90 | * the integer value %0. It is mostly useful in 91 | * situations where you just need a function that 92 | * returns %0, but don't want to perform any other 93 | * actions. 94 | * 95 | * Returns: the integer value %0. 96 | * 97 | * Since: 0.3.1 98 | **/ 99 | gint 100 | exo_noop_zero (void) 101 | { 102 | return 0; 103 | } 104 | 105 | 106 | 107 | /** 108 | * exo_noop_null: 109 | * 110 | * This function has no effect but simply returns 111 | * a %NULL pointer. It is mostly useful in 112 | * situations where you just need a function that 113 | * returns %NULL, but don't want to perform any 114 | * other actions. 115 | * 116 | * Returns: a %NULL pointer. 117 | * 118 | * Since: 0.3.1 119 | **/ 120 | gpointer 121 | exo_noop_null (void) 122 | { 123 | return NULL; 124 | } 125 | 126 | 127 | 128 | /** 129 | * exo_noop_true: 130 | * 131 | * This function has no effect, but simply returns 132 | * the boolean value %TRUE. It is mostly useful in 133 | * situations where you just need a function that 134 | * returns %TRUE, but don't want to perform any 135 | * other actions. 136 | * 137 | * Returns: the boolean value %TRUE. 138 | * 139 | * Since: 0.3.1 140 | **/ 141 | gboolean 142 | exo_noop_true (void) 143 | { 144 | return TRUE; 145 | } 146 | 147 | 148 | 149 | /** 150 | * exo_noop_false: 151 | * 152 | * This function has no effect, but simply returns 153 | * the boolean value %FALSE. It is mostly useful in 154 | * situations where you just need a function that 155 | * returns %FALSE, but don't want to perform any 156 | * other actions. 157 | * 158 | * Returns: the boolean value %FALSE. 159 | * 160 | * Since: 0.3.1 161 | **/ 162 | gboolean 163 | exo_noop_false (void) 164 | { 165 | return FALSE; 166 | } 167 | 168 | 169 | #define __EXO_UTILS_C__ 170 | -------------------------------------------------------------------------------- /src/desktop/working-area.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Guifications - The end all, be all, toaster popup plugin 3 | * Copyright (C) 2003-2004 Gary Kramlich 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 3 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | 2005.07.22 Modified by Hong Jen Yee (PCMan) 22 | This piece of code detecting working area is got from Guifications, a plug-in for Gaim. 23 | */ 24 | 25 | # include 26 | # include 27 | # include 28 | # include 29 | # include 30 | 31 | gboolean 32 | gf_display_get_workarea(GdkScreen* g_screen, GdkRectangle *rect) { 33 | Atom xa_desktops, xa_current, xa_workarea, xa_type; 34 | Display *x_display; 35 | Window x_root; 36 | guint32 desktops = 0, current = 0; 37 | gulong *workareas, len, fill; 38 | guchar *data; 39 | gint format; 40 | 41 | GdkDisplay *g_display; 42 | Screen *x_screen; 43 | 44 | /* get the gdk display */ 45 | g_display = gdk_display_get_default(); 46 | if(!g_display) 47 | return FALSE; 48 | 49 | /* get the x display from the gdk display */ 50 | x_display = gdk_x11_display_get_xdisplay(g_display); 51 | if(!x_display) 52 | return FALSE; 53 | 54 | /* get the x screen from the gdk screen */ 55 | x_screen = gdk_x11_screen_get_xscreen(g_screen); 56 | if(!x_screen) 57 | return FALSE; 58 | 59 | /* get the root window from the screen */ 60 | x_root = XRootWindowOfScreen(x_screen); 61 | 62 | /* find the _NET_NUMBER_OF_DESKTOPS atom */ 63 | xa_desktops = XInternAtom(x_display, "_NET_NUMBER_OF_DESKTOPS", True); 64 | if(xa_desktops == None) 65 | return FALSE; 66 | 67 | /* get the number of desktops */ 68 | if(XGetWindowProperty(x_display, x_root, xa_desktops, 0, 1, False, 69 | XA_CARDINAL, &xa_type, &format, &len, &fill, 70 | &data) != Success) 71 | { 72 | return FALSE; 73 | } 74 | 75 | if(!data) 76 | return FALSE; 77 | 78 | desktops = *(guint32 *)data; 79 | XFree(data); 80 | 81 | /* find the _NET_CURRENT_DESKTOP atom */ 82 | xa_current = XInternAtom(x_display, "_NET_CURRENT_DESKTOP", True); 83 | if(xa_current == None) 84 | return FALSE; 85 | 86 | /* get the current desktop */ 87 | if(XGetWindowProperty(x_display, x_root, xa_current, 0, 1, False, 88 | XA_CARDINAL, &xa_type, &format, &len, &fill, 89 | &data) != Success) 90 | { 91 | return FALSE; 92 | } 93 | 94 | if(!data) 95 | return FALSE; 96 | 97 | current = *(guint32 *)data; 98 | XFree(data); 99 | 100 | /* find the _NET_WORKAREA atom */ 101 | xa_workarea = XInternAtom(x_display, "_NET_WORKAREA", True); 102 | if(xa_workarea == None) 103 | return FALSE; 104 | 105 | if(XGetWindowProperty(x_display, x_root, xa_workarea, 0, (glong)(4 * 32), 106 | False, AnyPropertyType, &xa_type, &format, &len, 107 | &fill, &data) != Success) 108 | { 109 | return FALSE; 110 | } 111 | 112 | /* make sure the type and format are good */ 113 | if(xa_type == None || format == 0) 114 | return FALSE; 115 | 116 | /* make sure we don't have any leftovers */ 117 | if(fill) 118 | return FALSE; 119 | 120 | /* make sure len divides evenly by 4 */ 121 | if(len % 4) 122 | return FALSE; 123 | 124 | /* it's good, lets use it */ 125 | workareas = (gulong *)(guint32 *)data; 126 | 127 | rect->x = (guint32)workareas[current * 4]; 128 | rect->y = (guint32)workareas[current * 4 + 1]; 129 | rect->width = (guint32)workareas[current * 4 + 2]; 130 | rect->height = (guint32)workareas[current * 4 + 3]; 131 | 132 | /* clean up our memory */ 133 | XFree(data); 134 | 135 | return TRUE; 136 | } 137 | 138 | void get_working_area( GdkScreen* screen, GdkRectangle* area ) 139 | { 140 | if( !gf_display_get_workarea(screen, area) ) 141 | { 142 | area->x = 0; 143 | area->y = 0; 144 | area->width = gdk_screen_get_width( screen ); 145 | area->height = gdk_screen_get_height( screen ); 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /src/vfs/vfs-dir.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: vfs-dir 3 | * 4 | * Description: Object used to present a directory 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | #ifndef _VFS_DIR_H_ 14 | #define _VFS_DIR_H_ 15 | 16 | #include 17 | #include 18 | 19 | #include "vfs-file-monitor.h" 20 | #include "vfs-file-info.h" 21 | #include "vfs-async-task.h" 22 | 23 | G_BEGIN_DECLS 24 | 25 | #define VFS_TYPE_DIR (vfs_dir_get_type()) 26 | #define VFS_DIR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), VFS_TYPE_DIR, VFSDir)) 27 | #define VFS_DIR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VFS_TYPE_DIR, VFSDirClass)) 28 | #define VFS_IS_DIR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VFS_TYPE_DIR)) 29 | #define VFS_IS_DIR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VFS_TYPE_DIR)) 30 | #define VFS_DIR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VFS_TYPE_DIR, VFSDirClass)) 31 | 32 | typedef struct _VFSDir VFSDir; 33 | typedef struct _VFSDirClass VFSDirClass; 34 | 35 | struct _VFSDir 36 | { 37 | GObject parent; 38 | 39 | char* path; 40 | char* disp_path; 41 | GList* file_list; 42 | int n_files; 43 | 44 | union { 45 | int flags; 46 | struct { 47 | gboolean is_home : 1; 48 | gboolean is_desktop : 1; 49 | gboolean is_trash : 1; 50 | gboolean is_mount_point : 1; 51 | gboolean is_remote : 1; 52 | gboolean is_virtual : 1; 53 | }; 54 | }; 55 | 56 | /**/ 57 | VFSFileMonitor* monitor; 58 | GMutex* mutex; /* Used to guard file_list */ 59 | VFSAsyncTask* task; 60 | gboolean file_listed : 1; 61 | gboolean load_complete : 1; 62 | gboolean cancel: 1; 63 | gboolean show_hidden : 1; 64 | gboolean avoid_changes : 1; //sfm 65 | 66 | struct _VFSThumbnailLoader* thumbnail_loader; 67 | 68 | GSList* changed_files; 69 | GSList* created_files; //MOD 70 | glong xhidden_count; //MOD 71 | }; 72 | 73 | struct _VFSDirClass 74 | { 75 | GObjectClass parent; 76 | /* Default signal handlers */ 77 | void ( *file_created ) ( VFSDir* dir, VFSFileInfo* file ); 78 | void ( *file_deleted ) ( VFSDir* dir, VFSFileInfo* file ); 79 | void ( *file_changed ) ( VFSDir* dir, VFSFileInfo* file ); 80 | void ( *thumbnail_loaded ) ( VFSDir* dir, VFSFileInfo* file ); 81 | void ( *file_listed ) ( VFSDir* dir ); 82 | void ( *load_complete ) ( VFSDir* dir ); 83 | /* void (*need_reload) ( VFSDir* dir ); */ 84 | /* void (*update_mime) ( VFSDir* dir ); */ 85 | }; 86 | 87 | typedef void ( *VFSDirStateCallback ) ( VFSDir* dir, int state, gpointer user_data ); 88 | 89 | GType vfs_dir_get_type ( void ); 90 | 91 | VFSDir* vfs_dir_get_by_path( const char* path ); 92 | VFSDir* vfs_dir_get_by_path_soft( const char* path ); 93 | 94 | gboolean vfs_dir_is_loading( VFSDir* dir ); 95 | void vfs_dir_cancel_load( VFSDir* dir ); 96 | gboolean vfs_dir_is_file_listed( VFSDir* dir ); 97 | 98 | void vfs_dir_unload_thumbnails( VFSDir* dir, gboolean is_big ); 99 | 100 | /* emit signals */ 101 | void vfs_dir_emit_file_created( VFSDir* dir, const char* file_name, gboolean force ); 102 | void vfs_dir_emit_file_deleted( VFSDir* dir, const char* file_name, VFSFileInfo* file ); 103 | void vfs_dir_emit_file_changed( VFSDir* dir, const char* file_name, 104 | VFSFileInfo* file, gboolean force ); 105 | void vfs_dir_emit_thumbnail_loaded( VFSDir* dir, VFSFileInfo* file ); 106 | void vfs_dir_flush_notify_cache(); 107 | 108 | /* get the path of desktop dir */ 109 | const char* vfs_get_desktop_dir(); 110 | 111 | gboolean vfs_dir_add_hidden( const char* path, const char* file_name ); //MOD added 112 | 113 | /* Get the path of user's trash dir under home dir. 114 | * NOTE: 115 | * According to the spec, there are many legal trash dirs on the system 116 | * located at various places. However, because that spec is poor and try 117 | * very hard to make simple things more complicated, we only support 118 | * home trash dir instead. They are good at making things complicated and 119 | * hard to implement. This time, they did it again. 120 | */ 121 | const char* vfs_get_trash_dir(); 122 | 123 | /* call function "func" for every VFSDir instances */ 124 | void vfs_dir_foreach( GHFunc func, gpointer user_data ); 125 | 126 | void vfs_dir_monitor_mime(); 127 | 128 | G_END_DECLS 129 | 130 | #endif 131 | -------------------------------------------------------------------------------- /src/ptk/ptk-utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * C Interface: ptkutils 3 | * 4 | * Description: Some GUI utilities 5 | * 6 | * 7 | * Author: Hong Jen Yee (PCMan) , (C) 2006 8 | * 9 | * Copyright: See COPYING file that comes with this distribution 10 | * 11 | */ 12 | 13 | /* 14 | I don't like GtkUIManager provided by gtk+, so I implement my own. ;-) 15 | */ 16 | 17 | #ifndef _PTK_UTILS_H_ 18 | #define _PTK_UTILS_H_ 19 | 20 | #include 21 | #include 22 | 23 | G_BEGIN_DECLS 24 | 25 | #define PTK_STOCK_MENU_ITEM( id, cb ) { id, NULL, G_CALLBACK(cb), 0, 0, NULL, NULL } 26 | #define PTK_MENU_ITEM( label, cb, key, mod ) { label, NULL, G_CALLBACK(cb), key, mod, NULL, NULL } 27 | #define PTK_CHECK_MENU_ITEM( label, cb, key, mod ) { label, (char*)1, G_CALLBACK(cb), key, mod, NULL, NULL } 28 | #define PTK_RADIO_MENU_ITEM( label, cb, key, mod ) { label, (char*)2, G_CALLBACK(cb), key, mod, NULL, NULL } 29 | #define PTK_IMG_MENU_ITEM( label, icon, cb, key, mod ) { label, icon, G_CALLBACK(cb), key, mod, NULL, NULL } 30 | #define PTK_POPUP_MENU( label, sub ) { label, NULL, NULL, 0, 0, sub, NULL } 31 | #define PTK_POPUP_IMG_MENU( label, icon, sub ) { label, icon, NULL, 0, 0, sub, NULL } 32 | #define PTK_SEPARATOR_MENU_ITEM { NULL, (char *)(-1), NULL, 0, 0, NULL, 0} 33 | #define PTK_MENU_END {0} 34 | #define PTK_IS_STOCK_ITEM( ent ) ( ent->label && (*(guint32*)ent->label) == *(guint32*)"gtk-" ) 35 | #define PTK_IS_CHECK_MENU_ITEM( ent ) ( ent->stock_icon == (char*)1 ) 36 | #define PTK_IS_RADIO_MENU_ITEM( ent ) ( ent->stock_icon == (char*)2 ) 37 | 38 | struct _PtkMenuItemEntry 39 | { 40 | const char* label; /* or stock id */ 41 | const char* stock_icon; /* or menu type 1: check, 2: radio */ 42 | GCallback callback; 43 | guint key; 44 | GdkModifierType mod; 45 | struct _PtkMenuItemEntry* sub_menu; 46 | GtkWidget** ret; 47 | GtkWidget* menu; //MOD 48 | }; 49 | typedef struct _PtkMenuItemEntry PtkMenuItemEntry; 50 | 51 | #define PTK_STOCK_TOOL_ITEM( id, cb ) { id, NULL, NULL, G_CALLBACK(cb), NULL, NULL } 52 | #define PTK_TOOL_ITEM( label, icon, tooltip, cb ) { label, icon, tooltip, G_CALLBACK(cb), NULL, NULL } 53 | #define PTK_CHECK_TOOL_ITEM( label, icon, tooltip, cb ) { label, icon, tooltip, G_CALLBACK(cb), (PtkMenuItemEntry*)1, NULL } 54 | #define PTK_RADIO_TOOL_ITEM( label, icon, tooltip, cb ) { label, icon, tooltip, G_CALLBACK(cb), (PtkMenuItemEntry*)2, NULL } 55 | #define PTK_EMPTY_MENU ((gpointer)3) 56 | #define PTK_MENU_TOOL_ITEM( label, icon, tooltip, cb, menu ) { label, icon, tooltip, cb, menu, NULL } 57 | #define PTK_SEPARATOR_TOOL_ITEM { NULL, NULL, NULL, -1, NULL, NULL} 58 | #define PTK_TOOL_END {0} 59 | #define PTK_IS_CHECK_TOOL_ITEM( ent ) ( ent->menu == (PtkMenuItemEntry*)1 ) 60 | #define PTK_IS_RADIO_TOOL_ITEM( ent ) ( ent->menu == (PtkMenuItemEntry*)2 ) 61 | #define PTK_IS_SEPARATOR_TOOL_ITEM( ent ) ( ent->callback == G_CALLBACK(-1) ) 62 | 63 | struct _PtkToolItemEntry 64 | { 65 | const char* label; /* or stock id */ 66 | const char* stock_icon; /* or menu type 1: check, 2: radio */ 67 | const char* tooltip; 68 | GCallback callback; 69 | struct _PtkMenuItemEntry* menu; /* NULL: normal, 1: check, 2: radio, 3: empty menu, > 3: menu */ 70 | GtkWidget** ret; 71 | }; 72 | typedef struct _PtkToolItemEntry PtkToolItemEntry; 73 | 74 | GtkWidget* ptk_menu_new_from_data( PtkMenuItemEntry* entries, 75 | gpointer cb_data, 76 | GtkAccelGroup* accel_group ); 77 | 78 | void ptk_menu_add_items_from_data( GtkWidget* menu, 79 | PtkMenuItemEntry* entries, 80 | gpointer cb_data, 81 | GtkAccelGroup* accel_group ); 82 | 83 | GtkWidget* ptk_toolbar_add_items_from_data( GtkWidget* toolbar, 84 | PtkToolItemEntry* entries, 85 | gpointer cb_data ); 86 | 87 | /* The string 'message' can contain pango markups. 88 | * If special characters like < and > are used in the string, 89 | * they should be escaped with g_markup_escape_text(). 90 | */ 91 | void ptk_show_error(GtkWindow* parent, const char* title, const char* message ); 92 | 93 | /* Because GNOME HIG causes some usability problems under limited screen size, 94 | * this API is provided to adjust the dialogs, and try to fit them into 95 | * small screens via totally breaking GNOME HIG and compress spacings. 96 | */ 97 | void ptk_dialog_fit_small_screen( GtkDialog* dlg ); 98 | 99 | /* gtk_dialog_run will disable all parent windows of the dialog. 100 | * However, sometimes we need modaless dialogs. So here it is. 101 | */ 102 | int ptk_dialog_run_modaless( GtkDialog* dlg ); 103 | 104 | GtkBuilder* _gtk_builder_new_from_file( const char* file, GError** err ); 105 | 106 | void transpose_nonlatin_keypress( GdkEventKey* event ); 107 | 108 | G_END_DECLS 109 | 110 | #endif 111 | 112 | -------------------------------------------------------------------------------- /src/exo/exo-private.c: -------------------------------------------------------------------------------- 1 | /* $Id: exo-private.c 22884 2006-08-26 12:40:43Z benny $ */ 2 | /*- 3 | * Copyright (c) 2004-2006 os-cillation e.K. 4 | * 5 | * Written by Benedikt Meurer . 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Library General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 3 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Library General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Library General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifdef HAVE_CONFIG_H 24 | #include 25 | #endif 26 | 27 | #ifdef HAVE_LIBINTL_H 28 | #include 29 | #endif 30 | #ifdef HAVE_LOCALE_H 31 | #include 32 | #endif 33 | 34 | #include "exo-private.h" 35 | #include "exo-string.h" 36 | 37 | /* 38 | void 39 | _exo_i18n_init (void) 40 | { 41 | static gboolean inited = FALSE; 42 | 43 | if (G_UNLIKELY (!inited)) 44 | { 45 | inited = TRUE; 46 | 47 | bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); 48 | #ifdef HAVE_BIND_TEXTDOMAIN_CODESET 49 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 50 | #endif 51 | } 52 | } 53 | */ 54 | 55 | 56 | void 57 | _exo_gtk_widget_send_focus_change (GtkWidget *widget, 58 | gboolean in) 59 | { 60 | #if !GTK_CHECK_VERSION (2, 22, 0) 61 | if (in) 62 | GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS); 63 | else 64 | GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS); 65 | #endif 66 | 67 | GdkEvent *fevent; 68 | g_object_ref (G_OBJECT (widget)); 69 | fevent = gdk_event_new (GDK_FOCUS_CHANGE); 70 | fevent->focus_change.type = GDK_FOCUS_CHANGE; 71 | fevent->focus_change.window = g_object_ref (gtk_widget_get_window (widget)); 72 | fevent->focus_change.in = in; 73 | 74 | #if GTK_CHECK_VERSION (2, 22, 0) 75 | gtk_widget_send_focus_change (widget, fevent); 76 | #else 77 | gtk_widget_event (widget, fevent); 78 | 79 | g_object_notify (G_OBJECT (widget), "has-focus"); 80 | #endif 81 | 82 | g_object_unref (G_OBJECT (widget)); 83 | gdk_event_free (fevent); 84 | 85 | } 86 | 87 | 88 | 89 | /** 90 | * _exo_g_type_register_simple: 91 | * @type_parent : the parent #GType. 92 | * @type_name_static : the name of the new #GType, must reside in static 93 | * storage and remain unchanged during the lifetime 94 | * of the process. 95 | * @class_size : the size of the class structure in bytes. 96 | * @class_init : the class init function or %NULL. 97 | * @instance_size : the size of the instance structure in bytes. 98 | * @instance_init : the constructor function or %NULL. 99 | * 100 | * Simple wrapper for g_type_register_static(), which takes the most 101 | * important aspects of the type as parameters to avoid relocations 102 | * when using static constant #GTypeInfos. 103 | * 104 | * Return value: the newly registered #GType. 105 | **/ 106 | GType 107 | _exo_g_type_register_simple (GType type_parent, 108 | const gchar *type_name_static, 109 | guint class_size, 110 | gpointer class_init, 111 | guint instance_size, 112 | gpointer instance_init) 113 | { 114 | /* generate the type info (on the stack) */ 115 | GTypeInfo info = 116 | { 117 | class_size, 118 | NULL, 119 | NULL, 120 | class_init, 121 | NULL, 122 | NULL, 123 | instance_size, 124 | 0, 125 | instance_init, 126 | NULL, 127 | }; 128 | 129 | /* register the static type */ 130 | return g_type_register_static (type_parent, I_(type_name_static), &info, 0); 131 | } 132 | 133 | 134 | 135 | /** 136 | * _exo_g_type_add_interface_simple: 137 | * @instance_type : the #GType which should implement the @interface_type. 138 | * @interface_type : the #GType of the interface. 139 | * @interface_init_func : initialization function for the interface. 140 | * 141 | * Simple wrapper for g_type_add_interface_static(), which helps to avoid unnecessary 142 | * relocations for the #GInterfaceInfos. 143 | **/ 144 | void 145 | _exo_g_type_add_interface_simple (GType instance_type, 146 | GType interface_type, 147 | GInterfaceInitFunc interface_init_func) 148 | { 149 | GInterfaceInfo info = 150 | { 151 | interface_init_func, 152 | NULL, 153 | NULL, 154 | }; 155 | 156 | g_type_add_interface_static (instance_type, interface_type, &info); 157 | } 158 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | AM_CPPFLAGS = \ 4 | -I$(top_srcdir)/src/mime-type \ 5 | -I$(top_srcdir)/src/compat \ 6 | -I$(top_srcdir)/src/ptk \ 7 | -I$(top_srcdir)/src/vfs \ 8 | -I$(top_srcdir)/src/libmd5-rfc \ 9 | -I$(top_srcdir)/src/desktop \ 10 | -I$(top_srcdir)/src/exo \ 11 | -DPACKAGE_DATA_DIR=\""$(datadir)/spacefm"\" \ 12 | -DPACKAGE_UI_DIR=\""$(datadir)/spacefm/ui"\" \ 13 | -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ 14 | -DSYSCONFDIR=\""$(sysconfdir)"\" 15 | 16 | bin_PROGRAMS = spacefm 17 | 18 | bin_SCRIPTS = spacefm-auth 19 | 20 | MIMETYE_SOURCES = \ 21 | mime-type/mime-type.c mime-type/mime-type.h \ 22 | mime-type/mime-action.c mime-type/mime-action.h \ 23 | mime-type/mime-cache.c mime-type/mime-cache.h 24 | 25 | MD5_SOURCES = \ 26 | libmd5-rfc/md5.c libmd5-rfc/md5.h 27 | 28 | VOLUME_HAL_SOURCES= \ 29 | vfs/vfs-volume-hal.c \ 30 | vfs/vfs-volume-hal-options.h \ 31 | vfs/vfs-volume-hal-options.c 32 | 33 | VOLUME_NOHAL_SOURCES= \ 34 | vfs/vfs-volume-nohal.c 35 | 36 | if USE_HAL 37 | VOLUME_SOURCES= \ 38 | $(VOLUME_HAL_SOURCES) 39 | else 40 | VOLUME_SOURCES= \ 41 | $(VOLUME_NOHAL_SOURCES) 42 | endif 43 | 44 | VFS_SOURCES = \ 45 | vfs/vfs-file-monitor.c vfs/vfs-file-monitor.h \ 46 | vfs/vfs-mime-type.c vfs/vfs-mime-type.h \ 47 | vfs/vfs-file-info.c vfs/vfs-file-info.h \ 48 | vfs/vfs-dir.c vfs/vfs-dir.h \ 49 | vfs/vfs-app-desktop.c vfs/vfs-app-desktop.h \ 50 | vfs/vfs-file-task.c vfs/vfs-file-task.h \ 51 | vfs/vfs-volume.h \ 52 | $(VOLUME_SOURCES) \ 53 | vfs/vfs-execute.c vfs/vfs-execute.h \ 54 | vfs/vfs-async-task.c vfs/vfs-async-task.h \ 55 | vfs/vfs-thumbnail-loader.c vfs/vfs-thumbnail-loader.h \ 56 | vfs/vfs-utils.c vfs/vfs-utils.h 57 | 58 | if DESKTOP_INTEGRATION 59 | DESKTOP_SOURCES = \ 60 | desktop/desktop-window.c desktop/desktop-window.h \ 61 | desktop/desktop.c desktop/desktop.h 62 | else 63 | DESKTOP_SOURCES = desktop/desktop.c desktop/desktop.h 64 | endif 65 | 66 | PTK_SOURCES = \ 67 | ptk/ptk-file-browser.c ptk/ptk-file-browser.h \ 68 | ptk/ptk-file-list.c ptk/ptk-file-list.h \ 69 | ptk/ptk-path-entry.c ptk/ptk-path-entry.h \ 70 | ptk/ptk-text-renderer.c ptk/ptk-text-renderer.h \ 71 | ptk/ptk-file-icon-renderer.c ptk/ptk-file-icon-renderer.h \ 72 | ptk/ptk-utils.c ptk/ptk-utils.h \ 73 | desktop/working-area.c desktop/working-area.h \ 74 | ptk/ptk-dir-tree-view.c ptk/ptk-dir-tree-view.h \ 75 | ptk/ptk-dir-tree.c ptk/ptk-dir-tree.h \ 76 | ptk/ptk-location-view.c ptk/ptk-location-view.h \ 77 | ptk/ptk-input-dialog.c ptk/ptk-input-dialog.h \ 78 | ptk/ptk-file-task.c ptk/ptk-file-task.h \ 79 | ptk/ptk-file-archiver.c ptk/ptk-file-archiver.h \ 80 | ptk/ptk-handler.c ptk/ptk-handler.h \ 81 | ptk/ptk-clipboard.c ptk/ptk-clipboard.h \ 82 | ptk/ptk-file-menu.c ptk/ptk-file-menu.h \ 83 | ptk/ptk-file-misc.c ptk/ptk-file-misc.h \ 84 | ptk/ptk-file-properties.c ptk/ptk-file-properties.h \ 85 | ptk/ptk-app-chooser.c ptk/ptk-app-chooser.h 86 | 87 | EXO_SOURCES = \ 88 | exo/exo-icon-view.c exo/exo-icon-view.h \ 89 | exo/exo-tree-view.c exo/exo-tree-view.h \ 90 | exo/exo-private.c exo/exo-private.h \ 91 | exo/exo-string.c exo/exo-string.h \ 92 | exo/exo-marshal.c exo/exo-marshal.h \ 93 | exo/exo-cell-renderer-icon.c exo/exo-cell-renderer-icon.h \ 94 | exo/exo-gtk-extensions.c exo/exo-gtk-extensions.h \ 95 | exo/exo-icon-chooser-dialog.c exo/exo-icon-chooser-dialog.h \ 96 | exo/exo-icon-chooser-model.c exo/exo-icon-chooser-model.h \ 97 | exo/exo-gdk-pixbuf-extensions.c exo/exo-gdk-pixbuf-extensions.h \ 98 | exo/exo-thumbnail-preview.c exo/exo-thumbnail-preview.h \ 99 | exo/exo-utils.c exo/exo-utils.h \ 100 | exo/exo-binding.c exo/exo-binding.h \ 101 | exo/exo-cell-renderer-ellipsized-text.c exo/exo-cell-renderer-ellipsized-text.h \ 102 | exo/exo-common.h 103 | 104 | COMPAT_SOURCES = \ 105 | compat/glib-mem.h \ 106 | compat/glib-utils.h \ 107 | compat/glib-utils.c 108 | 109 | spacefm_SOURCES = \ 110 | $(MIMETYE_SOURCES) \ 111 | $(VFS_SOURCES) \ 112 | $(MD5_SOURCES) \ 113 | $(COMPAT_SOURCES) \ 114 | $(PTK_SOURCES) \ 115 | $(EXO_SOURCES) \ 116 | $(DESKTOP_SOURCES) \ 117 | private.h \ 118 | main.c pcmanfm.h \ 119 | main-window.c main-window.h \ 120 | settings.c settings.h \ 121 | pref-dialog.c pref-dialog.h \ 122 | find-files.c find-files.h \ 123 | go-dialog.c go-dialog.h \ 124 | cust-dialog.c cust-dialog.h \ 125 | item-prop.c item-prop.h 126 | 127 | spacefm_CFLAGS = \ 128 | @GTK_CFLAGS@ \ 129 | @SN_CFLAGS@ \ 130 | @HAL_CFLAGS@ \ 131 | @LIBUDEV_CFLAGS@ \ 132 | @FFMPEG_CFLAGS@ \ 133 | @G_CAST_CHECKS@ \ 134 | -Werror-implicit-function-declaration 135 | 136 | spacefm_LDADD = \ 137 | @GTK_LIBS@ \ 138 | $(INTLLIBS) \ 139 | @FAM_LIBS@ \ 140 | @HAL_LIBS@ \ 141 | @SN_LIBS@ \ 142 | @LIBUDEV_LIBS@ \ 143 | @FFMPEG_LIBS@ 144 | 145 | noinst_PROGRAMS=xml-purge 146 | xml_purge_SOURCES=xml-purge.c 147 | xml_purge_CFLAGS=@GTK_CFLAGS@ 148 | xml_purge_LDADD=@GTK_LIBS@ 149 | 150 | -------------------------------------------------------------------------------- /src/vfs/vfs-volume.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpaceFM vfs-volume.h 3 | * 4 | * Copyright (C) 2014 IgnorantGuru 5 | * Copyright (C) 2006 Hong Jen Yee (PCMan) 6 | * 7 | * License: See COPYING file 8 | * 9 | */ 10 | 11 | 12 | #ifndef _VFS_VOLUME_H_ 13 | #define _VFS_VOLUME_H_ 14 | 15 | #include 16 | #include "settings.h" 17 | 18 | G_BEGIN_DECLS 19 | 20 | typedef struct _VFSVolume VFSVolume; 21 | 22 | typedef enum{ 23 | VFS_VOLUME_ADDED, 24 | VFS_VOLUME_REMOVED, 25 | VFS_VOLUME_MOUNTED, /* Not implemented */ 26 | VFS_VOLUME_UNMOUNTED, /* Not implemented */ 27 | VFS_VOLUME_EJECT, 28 | VFS_VOLUME_CHANGED 29 | }VFSVolumeState; 30 | 31 | typedef void ( *VFSVolumeCallback ) ( VFSVolume* vol, 32 | VFSVolumeState state, 33 | gpointer user_data ); 34 | 35 | gboolean vfs_volume_init(); 36 | 37 | gboolean vfs_volume_finalize(); 38 | 39 | const GList* vfs_volume_get_all_volumes(); 40 | 41 | void vfs_volume_add_callback( VFSVolumeCallback cb, gpointer user_data ); 42 | 43 | void vfs_volume_remove_callback( VFSVolumeCallback cb, gpointer user_data ); 44 | 45 | gboolean vfs_volume_mount( VFSVolume* vol, GError** err ); 46 | 47 | gboolean vfs_volume_umount( VFSVolume *vol, GError** err ); 48 | 49 | gboolean vfs_volume_eject( VFSVolume *vol, GError** err ); 50 | 51 | const char* vfs_volume_get_disp_name( VFSVolume *vol ); 52 | 53 | const char* vfs_volume_get_mount_point( VFSVolume *vol ); 54 | 55 | const char* vfs_volume_get_device( VFSVolume *vol ); 56 | 57 | const char* vfs_volume_get_fstype( VFSVolume *vol ); 58 | 59 | const char* vfs_volume_get_icon( VFSVolume *vol ); 60 | 61 | gboolean vfs_volume_is_removable( VFSVolume *vol ); 62 | 63 | gboolean vfs_volume_is_mounted( VFSVolume *vol ); 64 | 65 | gboolean vfs_volume_requires_eject( VFSVolume *vol ); 66 | 67 | /* HAL build also needs this for file handler 68 | * ptk_location_view_create_mount_point() */ 69 | typedef struct netmount_t { 70 | char* url; 71 | char* fstype; 72 | char* host; 73 | char* ip; 74 | char* port; 75 | char* user; 76 | char* pass; 77 | char* path; 78 | } netmount_t; 79 | 80 | #ifdef HAVE_HAL 81 | gboolean vfs_volume_mount_by_udi( const char* udi, GError** err ); 82 | 83 | gboolean vfs_volume_umount_by_udi( const char* udi, GError** err ); 84 | 85 | gboolean vfs_volume_eject_by_udi( const char* udi, GError** err ); 86 | 87 | #else 88 | 89 | enum{ 90 | DEVICE_TYPE_BLOCK, 91 | DEVICE_TYPE_NETWORK, 92 | DEVICE_TYPE_OTHER // eg fuseiso mounted file 93 | }; 94 | 95 | struct _VFSVolume 96 | { 97 | dev_t devnum; 98 | int device_type; 99 | char* device_file; 100 | char* udi; 101 | char* disp_name; 102 | char* icon; 103 | char* mount_point; 104 | guint64 size; 105 | char* label; 106 | char* fs_type; 107 | gboolean should_autounmount : 1; // a network or ISO file was mounted 108 | gboolean is_mounted : 1; 109 | gboolean is_removable : 1; 110 | gboolean is_mountable : 1; 111 | gboolean is_audiocd : 1; 112 | gboolean is_dvd : 1; 113 | gboolean is_blank : 1; 114 | gboolean requires_eject : 1; 115 | gboolean is_user_visible : 1; 116 | gboolean nopolicy : 1; 117 | gboolean is_optical : 1; 118 | gboolean is_floppy : 1; 119 | gboolean is_table : 1; 120 | gboolean ever_mounted : 1; 121 | gboolean inhibit_auto : 1; 122 | time_t automount_time; 123 | gpointer open_main_window; 124 | }; 125 | 126 | gboolean vfs_volume_command( char* command, char** output ); 127 | char* vfs_volume_get_mount_command( VFSVolume* vol, char* default_options, 128 | gboolean* run_in_terminal ); 129 | char* vfs_volume_get_mount_options( VFSVolume* vol, char* options ); 130 | void vfs_volume_automount( VFSVolume* vol ); 131 | void vfs_volume_set_info( VFSVolume* volume ); 132 | char* vfs_volume_device_mount_cmd( VFSVolume* vol, const char* options, 133 | gboolean* run_in_terminal ); 134 | char* vfs_volume_device_unmount_cmd( VFSVolume* vol, gboolean* run_in_terminal ); 135 | char* vfs_volume_device_info( VFSVolume* vol ); 136 | char* vfs_volume_handler_cmd( int mode, int action, VFSVolume* vol, 137 | const char* options, netmount_t* netmount, 138 | gboolean* run_in_terminal, char** mount_point ); 139 | void vfs_volume_clean_mount_points(); 140 | 141 | int split_network_url( const char* url, netmount_t** netmount ); 142 | void vfs_volume_special_mounted( const char* device_file ); 143 | gboolean vfs_volume_dir_avoid_changes( const char* dir ); 144 | dev_t get_device_parent( dev_t dev ); 145 | gboolean path_is_mounted_mtab( const char* mtab_file, 146 | const char* path, 147 | char** device_file, 148 | char** fs_type ); 149 | gboolean mtab_fstype_is_handled_by_protocol( const char* mtab_fstype ); 150 | VFSVolume* vfs_volume_get_by_device_or_point( const char* device_file, 151 | const char* point ); 152 | 153 | 154 | #endif 155 | 156 | G_END_DECLS 157 | 158 | #endif 159 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Run this to generate all the initial makefiles, etc. 3 | 4 | srcdir=`dirname $0` 5 | test -z "$srcdir" && srcdir=. 6 | configure_ac=configure.ac 7 | 8 | DIE=0 9 | 10 | if [ -n "$GNOME2_DIR" ]; then 11 | ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS" 12 | LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH" 13 | PATH="$GNOME2_DIR/bin:$PATH" 14 | export PATH 15 | export LD_LIBRARY_PATH 16 | fi 17 | 18 | (test -f $srcdir/$configure_ac) || { 19 | echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" 20 | echo " top-level package directory" 21 | exit 1 22 | } 23 | 24 | (autoconf --version) < /dev/null > /dev/null 2>&1 || { 25 | echo 26 | echo "**Error**: You must have \`autoconf' installed." 27 | echo "Download the appropriate package for your distribution," 28 | echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" 29 | DIE=1 30 | } 31 | 32 | (grep "^AC_PROG_INTLTOOL" $srcdir/$configure_ac >/dev/null) && { 33 | (intltoolize --version) < /dev/null > /dev/null 2>&1 || { 34 | echo 35 | echo "**Error**: You must have \`intltool' installed." 36 | echo "You can get it from:" 37 | echo " ftp://ftp.gnome.org/pub/GNOME/" 38 | DIE=1 39 | } 40 | } 41 | 42 | (grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/$configure_ac >/dev/null) && { 43 | (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || { 44 | echo 45 | echo "**Error**: You must have \`xml-i18n-toolize' installed." 46 | echo "You can get it from:" 47 | echo " ftp://ftp.gnome.org/pub/GNOME/" 48 | DIE=1 49 | } 50 | } 51 | 52 | (grep "^AM_PROG_LIBTOOL" $srcdir/$configure_ac >/dev/null) && { 53 | (libtool --version) < /dev/null > /dev/null 2>&1 || { 54 | echo 55 | echo "**Error**: You must have \`libtool' installed." 56 | echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" 57 | DIE=1 58 | } 59 | } 60 | 61 | (grep "^AM_GLIB_GNU_GETTEXT" $srcdir/$configure_ac >/dev/null) && { 62 | (grep "sed.*POTFILES" $srcdir/$configure_ac) > /dev/null || \ 63 | (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { 64 | echo 65 | echo "**Error**: You must have \`glib' installed." 66 | echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" 67 | DIE=1 68 | } 69 | } 70 | 71 | (automake --version) < /dev/null > /dev/null 2>&1 || { 72 | echo 73 | echo "**Error**: You must have \`automake' installed." 74 | echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" 75 | DIE=1 76 | NO_AUTOMAKE=yes 77 | } 78 | 79 | 80 | # if no automake, don't bother testing for aclocal 81 | test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { 82 | echo 83 | echo "**Error**: Missing \`aclocal'. The version of \`automake'" 84 | echo "installed doesn't appear recent enough." 85 | echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" 86 | DIE=1 87 | } 88 | 89 | if test "$DIE" -eq 1; then 90 | exit 1 91 | fi 92 | 93 | if test -z "$*"; then 94 | echo "**Warning**: I am going to run \`configure' with no arguments." 95 | echo "If you wish to pass any to it, please specify them on the" 96 | echo \`$0\'" command line." 97 | echo 98 | fi 99 | 100 | case $CC in 101 | xlc ) 102 | am_opt=--include-deps;; 103 | esac 104 | 105 | for coin in `find $srcdir -name $configure_ac -print` 106 | do 107 | dr=`dirname $coin` 108 | if test -f $dr/NO-AUTO-GEN; then 109 | echo skipping $dr -- flagged as no auto-gen 110 | else 111 | echo processing $dr 112 | ( cd $dr 113 | 114 | aclocalinclude="$ACLOCAL_FLAGS" 115 | 116 | if grep "^AM_GLIB_GNU_GETTEXT" $configure_ac >/dev/null; then 117 | echo "Creating $dr/aclocal.m4 ..." 118 | test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 119 | echo "Running glib-gettextize... Ignore non-fatal messages." 120 | echo "no" | glib-gettextize --force --copy 121 | echo "Making $dr/aclocal.m4 writable ..." 122 | test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 123 | fi 124 | if grep "^AC_PROG_INTLTOOL" $configure_ac >/dev/null; then 125 | echo "Running intltoolize..." 126 | intltoolize --copy --force --automake 127 | fi 128 | if grep "^AM_PROG_XML_I18N_TOOLS" $configure_ac >/dev/null; then 129 | echo "Running xml-i18n-toolize..." 130 | xml-i18n-toolize --copy --force --automake 131 | fi 132 | if grep "^AM_PROG_LIBTOOL" $configure_ac >/dev/null; then 133 | if test -z "$NO_LIBTOOLIZE" ; then 134 | echo "Running libtoolize..." 135 | libtoolize --force --copy 136 | fi 137 | fi 138 | echo "Running aclocal $aclocalinclude ..." 139 | aclocal $aclocalinclude 140 | if grep "^AM_CONFIG_HEADER" $configure_ac >/dev/null; then 141 | echo "Running autoheader..." 142 | autoheader 143 | fi 144 | echo "Running automake --gnu $am_opt ..." 145 | automake --add-missing --gnu $am_opt 146 | echo "Running autoconf ..." 147 | autoconf 148 | ) 149 | fi 150 | done 151 | 152 | conf_flags="--enable-maintainer-mode" 153 | 154 | # ensure pot file is not deleted by make clean 155 | sed -i 's/\(.*rm -f.*\)\$(GETTEXT_PACKAGE)\.pot \(.*\)/\1 \2/' po/Makefile.in.in 156 | 157 | if test x$NOCONFIGURE = x; then 158 | echo Running $srcdir/configure $conf_flags "$@" ... 159 | $srcdir/configure $conf_flags "$@" \ 160 | && echo "Now type 'make' to compile, then 'sudo make install' to install." || exit 1 161 | else 162 | echo Skipping configure process. 163 | fi 164 | --------------------------------------------------------------------------------