summaryrefslogtreecommitdiff
path: root/gtk/gtkfilesystem.h
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2003-12-17 05:55:16 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2003-12-17 05:55:16 +0000
commit8baf8571b52f21c0012420669483f4769cfa13ca (patch)
tree56b9ae2e89c29cd6647295ec52ef4cfc327f0487 /gtk/gtkfilesystem.h
parent6b80f394a59244ab7a2e04fa6649728743469702 (diff)
downloadgtk+-8baf8571b52f21c0012420669483f4769cfa13ca.tar.gz
Added a "volumes-changed" signal. Added the following methods:
2003-12-16 Federico Mena Quintero <federico@ximian.com> * gtk/gtkfilesystem.h (struct _GtkFileSystemIface): Added a "volumes-changed" signal. Added the following methods: list_volumes volume_free volume_get_base_path volume_get_is_mounted volume_mount volume_get_display_name volume_render_icon * gtk/gtkfilesystem.c (gtk_file_system_base_init): Create the "volumes-changed" signal. (gtk_file_system_list_volumes): New function. (gtk_file_system_volume_free): New function. (gtk_file_system_volume_get_base_path): New function. (gtk_file_system_volume_get_is_mounted): New function. (gtk_file_system_volume_mount): New function. (gtk_file_system_volume_get_display_name): New function. (gtk_file_system_volume_render_icon): New function. * gtk/gtkfilesystemunix.c (gtk_file_system_unix_volume_free): Implement. (gtk_file_system_unix_volume_get_base_path): Implement. (gtk_file_system_unix_volume_get_is_mounted): Implement. (gtk_file_system_unix_volume_mount): Implement. (gtk_file_system_unix_volume_get_display_name): Implement. (gtk_file_system_unix_volume_render_icon): Implement. * gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault): Added a field for the "volumes-changed" signal connection. (gtk_file_chooser_default_set_property): Connect to "volumes-changed" on the file system. (gtk_file_chooser_default_finalize): Disconnect from "volumes-changed". * gtk/gtkfilechooserdefault.c (shortcuts_remove_rows): New helper function. (shortcuts_get_index): New helper function. (shortcuts_insert_path): Can now insert volumes as well as paths. (shortcuts_append_paths): Don't take is_file_system_root. (shortcuts_add_volumes): New function. (shortcuts_append_file_system_roots): Removed. (create_shortcuts_model): Use shortcuts_add_volumes(). (remove_bookmark_button_clicked_cb): Check that the index is within range. (bookmarks_check_add_sensitivity): Take volumes into account. (shortcuts_get_selected_index): New helper function. (remove_bookmark_button_clicked_cb): Use shortcuts_get_selected_index(). (bookmarks_check_remove_sensitivity): Likewise. (shortcuts_select_func): Likewise. (shortcuts_row_activated_cb): Handle volumes as well as normal paths. (shortcuts_activate_volume): New function. (struct _GtkFileChooserDefault): Removed the bookmarks_set and bookmarks_iter fields. (shortcuts_append_bookmarks): Use shortcuts_remove_rows(). (bookmarks_changed_cb): Use shortcuts_add_bookmarks(). (remove_bookmark_rows): Removed. (shortcuts_add_bookmarks): New function; moved most of the code over from shortcuts_append_bookmarks(). (shortcuts_append_bookmarks): Add the separator node here, and then call shortcuts_add_bookmarks().
Diffstat (limited to 'gtk/gtkfilesystem.h')
-rw-r--r--gtk/gtkfilesystem.h51
1 files changed, 46 insertions, 5 deletions
diff --git a/gtk/gtkfilesystem.h b/gtk/gtkfilesystem.h
index e3c061870d..3949388645 100644
--- a/gtk/gtkfilesystem.h
+++ b/gtk/gtkfilesystem.h
@@ -36,11 +36,12 @@ G_BEGIN_DECLS
typedef gint64 GtkFileTime;
-typedef struct _GtkFileFolder GtkFileFolder;
-typedef struct _GtkFileFolderIface GtkFileFolderIface;
-typedef struct _GtkFileInfo GtkFileInfo;
-typedef struct _GtkFileSystem GtkFileSystem;
-typedef struct _GtkFileSystemIface GtkFileSystemIface;
+typedef struct _GtkFileFolder GtkFileFolder;
+typedef struct _GtkFileFolderIface GtkFileFolderIface;
+typedef struct _GtkFileInfo GtkFileInfo;
+typedef struct _GtkFileSystem GtkFileSystem;
+typedef struct _GtkFileSystemIface GtkFileSystemIface;
+typedef struct _GtkFileSystemVolume GtkFileSystemVolume;
typedef struct _GtkFilePath GtkFilePath;
@@ -143,6 +144,7 @@ struct _GtkFileSystemIface
/* Methods
*/
+ GSList * (*list_volumes) (GtkFileSystem *file_system);
GSList * (*list_roots) (GtkFileSystem *file_system);
GtkFileInfo * (*get_root_info) (GtkFileSystem *file_system,
@@ -158,6 +160,26 @@ struct _GtkFileSystemIface
const GtkFilePath *path,
GError **error);
+ /* Volumes
+ */
+
+ void (*volume_free) (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume);
+ GtkFilePath * (*volume_get_base_path) (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume);
+ gboolean (*volume_get_is_mounted) (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume);
+ gboolean (*volume_mount) (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume,
+ GError **error);
+ char * (*volume_get_display_name) (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume);
+ GdkPixbuf * (*volume_render_icon) (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume,
+ GtkWidget *widget,
+ gint pixel_size,
+ GError **error);
+
/* Path Manipulation
*/
gboolean (*get_parent) (GtkFileSystem *file_system,
@@ -203,18 +225,37 @@ struct _GtkFileSystemIface
/* Signals
*/
+ void (*volumes_changed) (GtkFileSystem *file_system);
void (*roots_changed) (GtkFileSystem *file_system);
void (*bookmarks_changed) (GtkFileSystem *file_system);
};
GType gtk_file_system_get_type (void);
+GSList * gtk_file_system_list_volumes (GtkFileSystem *file_system);
GSList * gtk_file_system_list_roots (GtkFileSystem *file_system);
GtkFileInfo * gtk_file_system_get_root_info (GtkFileSystem *file_system,
const GtkFilePath *path,
GtkFileInfoType types,
GError **error);
+void gtk_file_system_volume_free (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume);
+GtkFilePath * gtk_file_system_volume_get_base_path (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume);
+gboolean gtk_file_system_volume_get_is_mounted (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume);
+gboolean gtk_file_system_volume_mount (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume,
+ GError **error);
+char * gtk_file_system_volume_get_display_name (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume);
+GdkPixbuf * gtk_file_system_volume_render_icon (GtkFileSystem *file_system,
+ GtkFileSystemVolume *volume,
+ GtkWidget *widget,
+ gint pixel_size,
+ GError **error);
+
gboolean gtk_file_system_get_parent (GtkFileSystem *file_system,
const GtkFilePath *path,
GtkFilePath **parent,