gtk2/gtk/gtkfilesystem.h

449 lines
18 KiB
C
Raw Normal View History

2003-03-21 20:34:02 +00:00
/* GTK - The GIMP Toolkit
* gtkfilesystem.h: Abstract file system interfaces
* Copyright (C) 2003, Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_FILE_SYSTEM_H__
#define __GTK_FILE_SYSTEM_H__
/* This is a "semi-private" header; it is meant only for
* alternate GtkFileChooser backend modules; no stability guarantees
* are made at this point
*/
#ifndef GTK_FILE_SYSTEM_ENABLE_UNSUPPORTED
#error "GtkFileSystem is not supported API for general use"
#endif
2003-03-21 20:34:02 +00:00
#include <glib-object.h>
#include <gtk/gtkwidget.h> /* For icon handling */
2003-03-21 20:34:02 +00:00
G_BEGIN_DECLS
typedef gint64 GtkFileTime;
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().
2003-12-17 05:55:16 +00:00
typedef struct _GtkFileFolder GtkFileFolder;
typedef struct _GtkFileFolderIface GtkFileFolderIface;
typedef struct _GtkFileInfo GtkFileInfo;
typedef struct _GtkFileSystem GtkFileSystem;
typedef struct _GtkFileSystemIface GtkFileSystemIface;
typedef struct _GtkFileSystemVolume GtkFileSystemVolume;
2003-03-21 20:34:02 +00:00
typedef struct _GtkFilePath GtkFilePath;
2003-03-21 20:34:02 +00:00
/* Mask of information about a file, for monitoring and
* gtk_file_system_get_info()
*/
typedef enum {
GTK_FILE_INFO_DISPLAY_NAME = 1 << 0,
GTK_FILE_INFO_IS_FOLDER = 1 << 1,
GTK_FILE_INFO_IS_HIDDEN = 1 << 2,
GTK_FILE_INFO_MIME_TYPE = 1 << 3,
GTK_FILE_INFO_MODIFICATION_TIME = 1 << 4,
GTK_FILE_INFO_SIZE = 1 << 5,
GTK_FILE_INFO_ICON = 1 << 6,
GTK_FILE_INFO_ALL = (1 << 7) - 1
2003-03-21 20:34:02 +00:00
} GtkFileInfoType;
/* GError enumeration for GtkFileSystem
*/
#define GTK_FILE_SYSTEM_ERROR (gtk_file_system_error_quark ())
typedef enum
{
GTK_FILE_SYSTEM_ERROR_NONEXISTENT,
2003-03-21 20:34:02 +00:00
GTK_FILE_SYSTEM_ERROR_NOT_FOLDER,
GTK_FILE_SYSTEM_ERROR_INVALID_URI,
GTK_FILE_SYSTEM_ERROR_BAD_FILENAME,
GTK_FILE_SYSTEM_ERROR_FAILED,
GTK_FILE_SYSTEM_ERROR_ALREADY_EXISTS
2003-03-21 20:34:02 +00:00
} GtkFileSystemError;
GQuark gtk_file_system_error_quark (void);
/* Boxed-type for gtk_file_folder_get_info() results
*/
#define GTK_TYPE_FILE_INFO (gtk_file_info_get_type ())
Mark as const. 2004-11-23 Matthias Clasen <mclasen@redhat.com> * gtk/gtkuimanager.h (gtk_ui_manager_get_type): * gtk/gtktreeview.h (gtk_tree_view_get_type): * gtk/gtktreeviewcolumn.h (gtk_tree_view_column_get_type): * gtk/gtktreestore.h (gtk_tree_store_get_type): * gtk/gtktreeselection.h (gtk_tree_selection_get_type): * gtk/gtktreemodelfilter.h (gtk_tree_model_filter_get_type): * gtk/gtktreemodel.h (gtk_tree_iter_get_type): (gtk_tree_path_get_type): (gtk_tree_row_reference_get_type): * gtk/gtktoolitem.h (gtk_tool_item_get_type): * gtk/gtktoolbutton.h (gtk_tool_button_get_type): * gtk/gtktoggleaction.h (gtk_toggle_action_get_type): * gtk/gtkthemes.h (gtk_theme_engine_get_type): * gtk/gtktextiter.h (gtk_text_iter_get_type): * gtk/gtksettings.h (gtk_settings_get_type): * gtk/gtkselection.h (gtk_selection_data_get_type): * gtk/gtkradioaction.h (gtk_radio_action_get_type): * gtk/gtkmenutoolbutton.h (gtk_menu_tool_button_get_type): * gtk/gtkliststore.h (gtk_list_store_get_type): * gtk/gtkiconview.h (gtk_icon_view_get_type): * gtk/gtkicontheme.h (gtk_icon_info_get_type): * gtk/gtkiconfactory.h (gtk_icon_factory_get_type): (gtk_icon_set_get_type): (gtk_icon_source_get_type): * gtk/gtkfilesystemwin32.h (gtk_file_system_win32_get_type): * gtk/gtkfilesystemunix.h (gtk_file_system_unix_get_type): * gtk/gtkfilesystem.h (gtk_file_folder_get_type): (gtk_file_info_get_type, gtk_file_path_get_type): (gtk_file_system_get_type): * gtk/gtkfilefilter.h (gtk_file_filter_get_type): * gtk/gtkfilechooserwidget.h (gtk_file_chooser_widget_get_type): * gtk/gtkfilechooser.h (gtk_file_chooser_get_type): * gtk/gtkfilechooserdialog.h (gtk_file_chooser_dialog_get_type): * gtk/gtkexpander.h (gtk_expander_get_type): * gtk/gtkentrycompletion.h (gtk_entry_completion_get_type): * gtk/gtkcombobox.h (gtk_combo_box_get_type): * gtk/gtkcomboboxentry.h (gtk_combo_box_entry_get_type): * gtk/gtkclipboard.h (gtk_clipboard_get_type): * gtk/gtkcellview.h (gtk_cell_view_get_type): * gtk/gtkcellrenderertoggle.h (gtk_cell_renderer_toggle_get_type): * gtk/gtkcellrenderertext.h (gtk_cell_renderer_text_get_type): * gtk/gtkcellrendererprogress.h (gtk_cell_renderer_progress_get_type): * gtk/gtkcellrendererpixbuf.h (gtk_cell_renderer_pixbuf_get_type): * gtk/gtkcellrenderercombo.h (gtk_cell_renderer_combo_get_type): * gtk/gtkcelllayout.h (gtk_cell_layout_get_type): * gtk/gtkactiongroup.h (gtk_action_group_get_type): * gtk/gtkaction.h (gtk_action_get_type): * gtk/gtkaccessible.h (gtk_accessible_get_type): * gtk/gtkaccelmap.h (gtk_accel_map_get_type): * gtk/gtkaccelgroup.h (gtk_accel_group_get_type): * gtk/gtkmessagedialog.h (gtk_message_dialog_get_type): Mark as const. * gtk/gtkicontheme.h: Don't mark gtk_icon_theme_error_quark() as const, to be consistent with all the other error_quark functions. (technically they are const, but since these are called only in error paths, giving the compiler better optimization opportunities doesn't matter much) * gtk/gtk.symbols: * gdk/gdk.symbols: Add attribute annotations. * gtk/makegtkalias.pl: * gdk/makegdkalias.pl: Keep attribute annotations, but strip PRIVATE. * gtk/Makefile.am (gtk.def): * gdk/Makefile.am (gdk.def): Strip attribute annotations, but keep PRIVATE.
2004-11-23 20:02:15 +00:00
GType gtk_file_info_get_type (void) G_GNUC_CONST;
2003-03-21 20:34:02 +00:00
GtkFileInfo *gtk_file_info_new (void);
GtkFileInfo *gtk_file_info_copy (GtkFileInfo *info);
void gtk_file_info_free (GtkFileInfo *info);
G_CONST_RETURN gchar *gtk_file_info_get_display_name (const GtkFileInfo *info);
G_CONST_RETURN gchar *gtk_file_info_get_display_key (const GtkFileInfo *info);
2003-03-21 20:34:02 +00:00
void gtk_file_info_set_display_name (GtkFileInfo *info,
const gchar *display_name);
gboolean gtk_file_info_get_is_folder (const GtkFileInfo *info);
void gtk_file_info_set_is_folder (GtkFileInfo *info,
gboolean is_folder);
gboolean gtk_file_info_get_is_hidden (const GtkFileInfo *info);
void gtk_file_info_set_is_hidden (GtkFileInfo *info,
gboolean is_hidden);
G_CONST_RETURN gchar *gtk_file_info_get_mime_type (const GtkFileInfo *info);
void gtk_file_info_set_mime_type (GtkFileInfo *info,
const gchar *mime_type);
GtkFileTime gtk_file_info_get_modification_time (const GtkFileInfo *info);
void gtk_file_info_set_modification_time (GtkFileInfo *info,
GtkFileTime modification_time);
gint64 gtk_file_info_get_size (const GtkFileInfo *info);
void gtk_file_info_set_size (GtkFileInfo *info,
gint64 size);
void gtk_file_info_set_icon_name (GtkFileInfo *info,
const gchar *con_name);
G_CONST_RETURN gchar *gtk_file_info_get_icon_name (const GtkFileInfo *info);
GdkPixbuf *gtk_file_info_render_icon (const GtkFileInfo *info,
GtkWidget *widget,
gint pixel_size,
GError **error);
/* GtkFileSystemHandle
*/
#define GTK_TYPE_FILE_SYSTEM_HANDLE (gtk_file_system_handle_get_type ())
#define GTK_FILE_SYSTEM_HANDLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_SYSTEM_HANDLE, GtkFileSystemHandle))
#define GTK_IS_FILE_SYSTEM_HANDLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FILE_SYSTEM_HANDLE))
#define GTK_FILE_SYSTEM_HANDLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FILE_SYSTEM_HANDLE, GtkFileSystemHandleUnixClass))
#define GTK_IS_FILE_SYSTEM_HANDLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_SYSTEM_HANDLE))
#define GTK_FILE_SYSTEM_HANDLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FILE_SYSTEM_HANDLE, GtkFileSystemHandleClass))
typedef struct _GtkFileSystemHandle GtkFileSystemHandle;
typedef struct _GtkFileSystemHandleClass GtkFileSystemHandleClass;
struct _GtkFileSystemHandle
{
GObject parent_instance;
GtkFileSystem *file_system;
guint cancelled : 1;
};
struct _GtkFileSystemHandleClass
{
GObjectClass parent_class;
};
GType gtk_file_system_handle_get_type (void);
2003-03-21 20:34:02 +00:00
/* The base GtkFileSystem interface
*/
#define GTK_TYPE_FILE_SYSTEM (gtk_file_system_get_type ())
#define GTK_FILE_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_SYSTEM, GtkFileSystem))
#define GTK_IS_FILE_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FILE_SYSTEM))
#define GTK_FILE_SYSTEM_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GTK_TYPE_FILE_SYSTEM, GtkFileSystemIface))
/* Callbacks for the asynchronous GtkFileSystem operations
*/
typedef void (* GtkFileSystemGetInfoCallback) (GtkFileSystemHandle *handle,
const GtkFileInfo *file_info,
const GError *error,
gpointer data);
typedef void (* GtkFileSystemGetFolderCallback) (GtkFileSystemHandle *handle,
GtkFileFolder *folder,
const GError *error,
gpointer data);
typedef void (* GtkFileSystemCreateFolderCallback) (GtkFileSystemHandle *handle,
const GtkFilePath *path,
const GError *error,
gpointer data);
typedef void (* GtkFileSystemVolumeMountCallback) (GtkFileSystemHandle *handle,
GtkFileSystemVolume *volume,
const GError *error,
gpointer data);
/*
*/
2003-03-21 20:34:02 +00:00
struct _GtkFileSystemIface
{
GTypeInterface base_iface;
/* Methods
*/
GSList * (*list_volumes) (GtkFileSystem *file_system);
GtkFileSystemVolume * (*get_volume_for_path) (GtkFileSystem *file_system,
const GtkFilePath *path);
GtkFileSystemHandle * (*get_folder) (GtkFileSystem *file_system,
const GtkFilePath *path,
GtkFileInfoType types,
GtkFileSystemGetFolderCallback callback,
gpointer data);
GtkFileSystemHandle * (*get_info) (GtkFileSystem *file_system,
const GtkFilePath *path,
GtkFileInfoType types,
GtkFileSystemGetInfoCallback callback,
gpointer data);
GtkFileSystemHandle * (*create_folder) (GtkFileSystem *file_system,
const GtkFilePath *path,
GtkFileSystemCreateFolderCallback callback,
gpointer data);
void (*cancel_operation) (GtkFileSystemHandle *handle);
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().
2003-12-17 05:55:16 +00:00
/* 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);
GtkFileSystemHandle * (*volume_mount) (GtkFileSystem *file_system,
GtkFileSystemVolume *volume,
GtkFileSystemVolumeMountCallback callback,
gpointer data);
char * (*volume_get_display_name) (GtkFileSystem *file_system,
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().
2003-12-17 05:55:16 +00:00
GtkFileSystemVolume *volume);
gchar * (*volume_get_icon_name) (GtkFileSystem *file_system,
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().
2003-12-17 05:55:16 +00:00
GtkFileSystemVolume *volume,
GError **error);
/* Path Manipulation
2003-03-21 20:34:02 +00:00
*/
gboolean (*get_parent) (GtkFileSystem *file_system,
const GtkFilePath *path,
GtkFilePath **parent,
GError **error);
GtkFilePath * (*make_path) (GtkFileSystem *file_system,
const GtkFilePath *base_path,
const gchar *display_name,
GError **error);
gboolean (*parse) (GtkFileSystem *file_system,
const GtkFilePath *base_path,
const gchar *str,
GtkFilePath **folder,
gchar **file_part,
GError **error);
gchar * (*path_to_uri) (GtkFileSystem *file_system,
const GtkFilePath *path);
gchar * (*path_to_filename) (GtkFileSystem *file_system,
const GtkFilePath *path);
GtkFilePath *(*uri_to_path) (GtkFileSystem *file_system,
const gchar *uri);
GtkFilePath *(*filename_to_path) (GtkFileSystem *file_system,
const gchar *path);
/* Bookmarks
*/
gboolean (*insert_bookmark) (GtkFileSystem *file_system,
Removed. (gtk_file_system_gnome_vfs_set_bookmarks): Removed. 2003-10-17 Federico Mena Quintero <federico@ximian.com> * gtkfilesystemgnomevfs.c (gtk_file_system_gnome_vfs_get_supports_bookmarks): Removed. (gtk_file_system_gnome_vfs_set_bookmarks): Removed. (gtk_file_system_gnome_vfs_add_bookmark): Implement. (gtk_file_system_gnome_vfs_remove_bookmark): Implement. * gtkfilechooserprivate.h (struct _GtkFileChooserIface): Replaced the ::set_shortcut_folders() method with :;add_shortcut_folder() and ::remove_shortcut_folder(). * gtkfilechooserutils.c (delegate_add_shortcut_folder): New function. (delegate_remove_shortcut_folder): New function. (delegate_list_shortcut_folders): New function. * gtkfilechooserimpldefault.c (create_shortcuts_model): Insert the Desktop directory as well. (shortcuts_insert_path): Renamed from shortcuts_append_path; now takes a position index instead of a parent node iter. Also takes a GError argument. (struct _GtkFileChooserImplDefault): Removed the shortcuts_folder list. It is all kept in the model now. (shortcuts_append_home): Save whether adding a shortcut for the home directory was successful. (shortcuts_append_desktop): Likewise for the desktop. (shortcuts_append_file_system_roots): Count and save the number of roots added. (shortcuts_append_shortcut_folders): Removed. (gtk_file_chooser_impl_default_add_shortcut_folder): Implement. (shortcuts_append_bookmarks): Now that we don't have a bookmarks parent node, don't expand the tree. (add_bookmark_button_clicked_cb): Use gtk_file_system_add_bookmark(). (remove_bookmark_button_clicked_cb): Use gtk_file_system_remove_bookmark(). (gtk_file_chooser_impl_default_list_shortcut_folders): Get the folders from the shortcuts model; we no longer keep a separate list. * gtkfilesystem.h (struct _GtkFileSystemIface): Oops, there shouldn't be shortcuts-related virtual methods here. * gtkfilechooser.c (file_paths_to_strings): New helper function. (gtk_file_chooser_get_filenames): Use file_paths_to_strings(). (gtk_file_chooser_get_uris): Likewise. (gtk_file_chooser_set_shortcut_folders): Removed. (gtk_file_chooser_list_shortcut_folders): Return a list of strings, not of GtkFilePath*. (gtk_file_chooser_list_shortcut_folder_uris): New function. (gtk_file_chooser_add_shortcut_folder): New function. (gtk_file_chooser_remove_shortcut_folder): New function. (gtk_file_chooser_add_shortcut_folder_uri): New function. (gtk_file_chooser_remove_shortcut_folder_uri): New function. (_gtk_file_chooser_add_shortcut_folder): New function. (_gtk_file_chooser_remove_shortcut_folder): New function. * gtkfilechooser.h: New enum. * gtkfilechooser.c (gtk_file_chooser_error_quark): New function. * gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): Removed. (gtk_file_system_set_bookmarks): Removed. (gtk_file_system_add_bookmark): New function. (gtk_file_system_remove_bookmark): New function. * gtkfilesystemunix.c (gtk_file_system_unix_get_supports_bookmarks): Removed. (gtk_file_system_unix_set_bookmarks): Removed. (gtk_file_system_unix_add_bookmark): Just a stub for now. (gtk_file_system_unix_remove_bookmark): Likewise. * testfilechooser.c (main): Add a shortcut for testing purposes.
2003-10-18 04:29:40 +00:00
const GtkFilePath *path,
gint position,
Removed. (gtk_file_system_gnome_vfs_set_bookmarks): Removed. 2003-10-17 Federico Mena Quintero <federico@ximian.com> * gtkfilesystemgnomevfs.c (gtk_file_system_gnome_vfs_get_supports_bookmarks): Removed. (gtk_file_system_gnome_vfs_set_bookmarks): Removed. (gtk_file_system_gnome_vfs_add_bookmark): Implement. (gtk_file_system_gnome_vfs_remove_bookmark): Implement. * gtkfilechooserprivate.h (struct _GtkFileChooserIface): Replaced the ::set_shortcut_folders() method with :;add_shortcut_folder() and ::remove_shortcut_folder(). * gtkfilechooserutils.c (delegate_add_shortcut_folder): New function. (delegate_remove_shortcut_folder): New function. (delegate_list_shortcut_folders): New function. * gtkfilechooserimpldefault.c (create_shortcuts_model): Insert the Desktop directory as well. (shortcuts_insert_path): Renamed from shortcuts_append_path; now takes a position index instead of a parent node iter. Also takes a GError argument. (struct _GtkFileChooserImplDefault): Removed the shortcuts_folder list. It is all kept in the model now. (shortcuts_append_home): Save whether adding a shortcut for the home directory was successful. (shortcuts_append_desktop): Likewise for the desktop. (shortcuts_append_file_system_roots): Count and save the number of roots added. (shortcuts_append_shortcut_folders): Removed. (gtk_file_chooser_impl_default_add_shortcut_folder): Implement. (shortcuts_append_bookmarks): Now that we don't have a bookmarks parent node, don't expand the tree. (add_bookmark_button_clicked_cb): Use gtk_file_system_add_bookmark(). (remove_bookmark_button_clicked_cb): Use gtk_file_system_remove_bookmark(). (gtk_file_chooser_impl_default_list_shortcut_folders): Get the folders from the shortcuts model; we no longer keep a separate list. * gtkfilesystem.h (struct _GtkFileSystemIface): Oops, there shouldn't be shortcuts-related virtual methods here. * gtkfilechooser.c (file_paths_to_strings): New helper function. (gtk_file_chooser_get_filenames): Use file_paths_to_strings(). (gtk_file_chooser_get_uris): Likewise. (gtk_file_chooser_set_shortcut_folders): Removed. (gtk_file_chooser_list_shortcut_folders): Return a list of strings, not of GtkFilePath*. (gtk_file_chooser_list_shortcut_folder_uris): New function. (gtk_file_chooser_add_shortcut_folder): New function. (gtk_file_chooser_remove_shortcut_folder): New function. (gtk_file_chooser_add_shortcut_folder_uri): New function. (gtk_file_chooser_remove_shortcut_folder_uri): New function. (_gtk_file_chooser_add_shortcut_folder): New function. (_gtk_file_chooser_remove_shortcut_folder): New function. * gtkfilechooser.h: New enum. * gtkfilechooser.c (gtk_file_chooser_error_quark): New function. * gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): Removed. (gtk_file_system_set_bookmarks): Removed. (gtk_file_system_add_bookmark): New function. (gtk_file_system_remove_bookmark): New function. * gtkfilesystemunix.c (gtk_file_system_unix_get_supports_bookmarks): Removed. (gtk_file_system_unix_set_bookmarks): Removed. (gtk_file_system_unix_add_bookmark): Just a stub for now. (gtk_file_system_unix_remove_bookmark): Likewise. * testfilechooser.c (main): Add a shortcut for testing purposes.
2003-10-18 04:29:40 +00:00
GError **error);
gboolean (*remove_bookmark) (GtkFileSystem *file_system,
const GtkFilePath *path,
GError **error);
GSList * (*list_bookmarks) (GtkFileSystem *file_system);
Added methods for ::get_supports_bookmarks(), ::set_bookmarks(), 2003-10-07 Federico Mena Quintero <federico@ximian.com> * gtkfilesystem.h (struct _GtkFileSystemIface): Added methods for ::get_supports_bookmarks(), ::set_bookmarks(), ::list_bookmarks(). Added a ::bookmarks_changed() signal. * gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): New function. (gtk_file_system_set_bookmarks): New function. (gtk_file_system_list_bookmarks): New function. (gtk_file_system_base_init): Create the "bookmarks-changed" signal. (gtk_file_paths_copy): New function. * gtkfilesystemunix.c (gtk_file_system_unix_get_supports_bookmarks): Implement. (gtk_file_system_unix_set_bookmarks): Implement. (gtk_file_system_unix_get_bookmarks): Implement. * gtkfilesystemgnomevfs.c (struct _GtkFileSystemGnomeVFS): Added fields for the bookmarks and the GConfClient. (gtk_file_system_gnome_vfs_set_bookmarks): Implement. (gtk_file_system_gnome_vfs_list_bookmarks): Implement. * gtkfilechooserprivate.h (struct _GtkFileChooserIface): Added methods for ::set_shortcut_folders(), ::list_shortcut_folders(). * gtkfilechooser.c (gtk_file_chooser_set_shortcut_folders): New function. (gtk_file_chooser_list_shortcut_folders): New function. * gtkfilechooserimpldefault.c (create_shortcuts_model): Unref the old shortcuts model if it exists. Create the nodes for the app-specific shortcut folders. (struct _GtkFileChooserImplDefault): Added a field for the shortcut_folders. (gtk_file_chooser_impl_default_set_shortcut_folders): Implement. (select_shortcuts_folder): New helper function. (gtk_file_chooser_impl_default_set_current_folder): Use select_shortcuts_folder(). (shortcuts_append_path): Get the file info here, instead of the caller. (shortcuts_append_home): Use shortcuts_append_path(). (shortcuts_append_file_system_roots): Likewise. (create_shortcuts_model): Add the app-specific shortcut folders and the bookmarks. (gtk_file_chooser_impl_default_list_shortcut_folders): Implement. (create_shortcuts_tree): Added a button to let the user add the current folder to the bookmarks. (gtk_file_chooser_impl_default_set_property): Connect to "bookmarks-changed" on the file system. (shortcuts_append_bookmarks): New function. * configure.ac: Depend on GConf.
2003-10-08 04:14:55 +00:00
/* Signals
2003-03-21 20:34:02 +00:00
*/
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().
2003-12-17 05:55:16 +00:00
void (*volumes_changed) (GtkFileSystem *file_system);
Added methods for ::get_supports_bookmarks(), ::set_bookmarks(), 2003-10-07 Federico Mena Quintero <federico@ximian.com> * gtkfilesystem.h (struct _GtkFileSystemIface): Added methods for ::get_supports_bookmarks(), ::set_bookmarks(), ::list_bookmarks(). Added a ::bookmarks_changed() signal. * gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): New function. (gtk_file_system_set_bookmarks): New function. (gtk_file_system_list_bookmarks): New function. (gtk_file_system_base_init): Create the "bookmarks-changed" signal. (gtk_file_paths_copy): New function. * gtkfilesystemunix.c (gtk_file_system_unix_get_supports_bookmarks): Implement. (gtk_file_system_unix_set_bookmarks): Implement. (gtk_file_system_unix_get_bookmarks): Implement. * gtkfilesystemgnomevfs.c (struct _GtkFileSystemGnomeVFS): Added fields for the bookmarks and the GConfClient. (gtk_file_system_gnome_vfs_set_bookmarks): Implement. (gtk_file_system_gnome_vfs_list_bookmarks): Implement. * gtkfilechooserprivate.h (struct _GtkFileChooserIface): Added methods for ::set_shortcut_folders(), ::list_shortcut_folders(). * gtkfilechooser.c (gtk_file_chooser_set_shortcut_folders): New function. (gtk_file_chooser_list_shortcut_folders): New function. * gtkfilechooserimpldefault.c (create_shortcuts_model): Unref the old shortcuts model if it exists. Create the nodes for the app-specific shortcut folders. (struct _GtkFileChooserImplDefault): Added a field for the shortcut_folders. (gtk_file_chooser_impl_default_set_shortcut_folders): Implement. (select_shortcuts_folder): New helper function. (gtk_file_chooser_impl_default_set_current_folder): Use select_shortcuts_folder(). (shortcuts_append_path): Get the file info here, instead of the caller. (shortcuts_append_home): Use shortcuts_append_path(). (shortcuts_append_file_system_roots): Likewise. (create_shortcuts_model): Add the app-specific shortcut folders and the bookmarks. (gtk_file_chooser_impl_default_list_shortcut_folders): Implement. (create_shortcuts_tree): Added a button to let the user add the current folder to the bookmarks. (gtk_file_chooser_impl_default_set_property): Connect to "bookmarks-changed" on the file system. (shortcuts_append_bookmarks): New function. * configure.ac: Depend on GConf.
2003-10-08 04:14:55 +00:00
void (*bookmarks_changed) (GtkFileSystem *file_system);
/* Bookmark labels
*/
gchar * (*get_bookmark_label) (GtkFileSystem *file_system,
const GtkFilePath *path);
void (*set_bookmark_label) (GtkFileSystem *file_system,
const GtkFilePath *path,
const gchar *label);
2003-03-21 20:34:02 +00:00
};
Mark as const. 2004-11-23 Matthias Clasen <mclasen@redhat.com> * gtk/gtkuimanager.h (gtk_ui_manager_get_type): * gtk/gtktreeview.h (gtk_tree_view_get_type): * gtk/gtktreeviewcolumn.h (gtk_tree_view_column_get_type): * gtk/gtktreestore.h (gtk_tree_store_get_type): * gtk/gtktreeselection.h (gtk_tree_selection_get_type): * gtk/gtktreemodelfilter.h (gtk_tree_model_filter_get_type): * gtk/gtktreemodel.h (gtk_tree_iter_get_type): (gtk_tree_path_get_type): (gtk_tree_row_reference_get_type): * gtk/gtktoolitem.h (gtk_tool_item_get_type): * gtk/gtktoolbutton.h (gtk_tool_button_get_type): * gtk/gtktoggleaction.h (gtk_toggle_action_get_type): * gtk/gtkthemes.h (gtk_theme_engine_get_type): * gtk/gtktextiter.h (gtk_text_iter_get_type): * gtk/gtksettings.h (gtk_settings_get_type): * gtk/gtkselection.h (gtk_selection_data_get_type): * gtk/gtkradioaction.h (gtk_radio_action_get_type): * gtk/gtkmenutoolbutton.h (gtk_menu_tool_button_get_type): * gtk/gtkliststore.h (gtk_list_store_get_type): * gtk/gtkiconview.h (gtk_icon_view_get_type): * gtk/gtkicontheme.h (gtk_icon_info_get_type): * gtk/gtkiconfactory.h (gtk_icon_factory_get_type): (gtk_icon_set_get_type): (gtk_icon_source_get_type): * gtk/gtkfilesystemwin32.h (gtk_file_system_win32_get_type): * gtk/gtkfilesystemunix.h (gtk_file_system_unix_get_type): * gtk/gtkfilesystem.h (gtk_file_folder_get_type): (gtk_file_info_get_type, gtk_file_path_get_type): (gtk_file_system_get_type): * gtk/gtkfilefilter.h (gtk_file_filter_get_type): * gtk/gtkfilechooserwidget.h (gtk_file_chooser_widget_get_type): * gtk/gtkfilechooser.h (gtk_file_chooser_get_type): * gtk/gtkfilechooserdialog.h (gtk_file_chooser_dialog_get_type): * gtk/gtkexpander.h (gtk_expander_get_type): * gtk/gtkentrycompletion.h (gtk_entry_completion_get_type): * gtk/gtkcombobox.h (gtk_combo_box_get_type): * gtk/gtkcomboboxentry.h (gtk_combo_box_entry_get_type): * gtk/gtkclipboard.h (gtk_clipboard_get_type): * gtk/gtkcellview.h (gtk_cell_view_get_type): * gtk/gtkcellrenderertoggle.h (gtk_cell_renderer_toggle_get_type): * gtk/gtkcellrenderertext.h (gtk_cell_renderer_text_get_type): * gtk/gtkcellrendererprogress.h (gtk_cell_renderer_progress_get_type): * gtk/gtkcellrendererpixbuf.h (gtk_cell_renderer_pixbuf_get_type): * gtk/gtkcellrenderercombo.h (gtk_cell_renderer_combo_get_type): * gtk/gtkcelllayout.h (gtk_cell_layout_get_type): * gtk/gtkactiongroup.h (gtk_action_group_get_type): * gtk/gtkaction.h (gtk_action_get_type): * gtk/gtkaccessible.h (gtk_accessible_get_type): * gtk/gtkaccelmap.h (gtk_accel_map_get_type): * gtk/gtkaccelgroup.h (gtk_accel_group_get_type): * gtk/gtkmessagedialog.h (gtk_message_dialog_get_type): Mark as const. * gtk/gtkicontheme.h: Don't mark gtk_icon_theme_error_quark() as const, to be consistent with all the other error_quark functions. (technically they are const, but since these are called only in error paths, giving the compiler better optimization opportunities doesn't matter much) * gtk/gtk.symbols: * gdk/gdk.symbols: Add attribute annotations. * gtk/makegtkalias.pl: * gdk/makegdkalias.pl: Keep attribute annotations, but strip PRIVATE. * gtk/Makefile.am (gtk.def): * gdk/Makefile.am (gdk.def): Strip attribute annotations, but keep PRIVATE.
2004-11-23 20:02:15 +00:00
GType gtk_file_system_get_type (void) G_GNUC_CONST;
2003-03-21 20:34:02 +00:00
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().
2003-12-17 05:55:16 +00:00
GSList * gtk_file_system_list_volumes (GtkFileSystem *file_system);
GtkFileSystemVolume *gtk_file_system_get_volume_for_path (GtkFileSystem *file_system,
const GtkFilePath *path);
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().
2003-12-17 05:55:16 +00:00
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);
GtkFileSystemHandle *gtk_file_system_volume_mount (GtkFileSystem *file_system,
GtkFileSystemVolume *volume,
GtkFileSystemVolumeMountCallback callback,
gpointer data);
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().
2003-12-17 05:55:16 +00:00
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);
gchar * gtk_file_system_volume_get_icon_name (GtkFileSystem *file_system,
GtkFileSystemVolume *volume,
GError **error);
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().
2003-12-17 05:55:16 +00:00
gboolean gtk_file_system_get_parent (GtkFileSystem *file_system,
const GtkFilePath *path,
GtkFilePath **parent,
GError **error);
GtkFileSystemHandle *gtk_file_system_get_folder (GtkFileSystem *file_system,
const GtkFilePath *path,
GtkFileInfoType types,
GtkFileSystemGetFolderCallback callback,
gpointer data);
GtkFileSystemHandle *gtk_file_system_get_info (GtkFileSystem *file_system,
const GtkFilePath *path,
GtkFileInfoType types,
GtkFileSystemGetInfoCallback callback,
gpointer data);
GtkFileSystemHandle *gtk_file_system_create_folder (GtkFileSystem *file_system,
const GtkFilePath *path,
GtkFileSystemCreateFolderCallback callback,
gpointer data);
void gtk_file_system_cancel_operation (GtkFileSystemHandle *handle);
GtkFilePath * gtk_file_system_make_path (GtkFileSystem *file_system,
const GtkFilePath *base_path,
const gchar *display_name,
GError **error);
gboolean gtk_file_system_parse (GtkFileSystem *file_system,
const GtkFilePath *base_path,
const gchar *str,
GtkFilePath **folder,
gchar **file_part,
GError **error);
gchar * gtk_file_system_path_to_uri (GtkFileSystem *file_system,
const GtkFilePath *path);
gchar * gtk_file_system_path_to_filename (GtkFileSystem *file_system,
const GtkFilePath *path);
GtkFilePath *gtk_file_system_uri_to_path (GtkFileSystem *file_system,
const gchar *uri);
GtkFilePath *gtk_file_system_filename_to_path (GtkFileSystem *file_system,
const gchar *filename);
gboolean gtk_file_system_path_is_local (GtkFileSystem *filesystem,
const GtkFilePath *path);
gboolean gtk_file_system_insert_bookmark (GtkFileSystem *file_system,
Removed. (gtk_file_system_gnome_vfs_set_bookmarks): Removed. 2003-10-17 Federico Mena Quintero <federico@ximian.com> * gtkfilesystemgnomevfs.c (gtk_file_system_gnome_vfs_get_supports_bookmarks): Removed. (gtk_file_system_gnome_vfs_set_bookmarks): Removed. (gtk_file_system_gnome_vfs_add_bookmark): Implement. (gtk_file_system_gnome_vfs_remove_bookmark): Implement. * gtkfilechooserprivate.h (struct _GtkFileChooserIface): Replaced the ::set_shortcut_folders() method with :;add_shortcut_folder() and ::remove_shortcut_folder(). * gtkfilechooserutils.c (delegate_add_shortcut_folder): New function. (delegate_remove_shortcut_folder): New function. (delegate_list_shortcut_folders): New function. * gtkfilechooserimpldefault.c (create_shortcuts_model): Insert the Desktop directory as well. (shortcuts_insert_path): Renamed from shortcuts_append_path; now takes a position index instead of a parent node iter. Also takes a GError argument. (struct _GtkFileChooserImplDefault): Removed the shortcuts_folder list. It is all kept in the model now. (shortcuts_append_home): Save whether adding a shortcut for the home directory was successful. (shortcuts_append_desktop): Likewise for the desktop. (shortcuts_append_file_system_roots): Count and save the number of roots added. (shortcuts_append_shortcut_folders): Removed. (gtk_file_chooser_impl_default_add_shortcut_folder): Implement. (shortcuts_append_bookmarks): Now that we don't have a bookmarks parent node, don't expand the tree. (add_bookmark_button_clicked_cb): Use gtk_file_system_add_bookmark(). (remove_bookmark_button_clicked_cb): Use gtk_file_system_remove_bookmark(). (gtk_file_chooser_impl_default_list_shortcut_folders): Get the folders from the shortcuts model; we no longer keep a separate list. * gtkfilesystem.h (struct _GtkFileSystemIface): Oops, there shouldn't be shortcuts-related virtual methods here. * gtkfilechooser.c (file_paths_to_strings): New helper function. (gtk_file_chooser_get_filenames): Use file_paths_to_strings(). (gtk_file_chooser_get_uris): Likewise. (gtk_file_chooser_set_shortcut_folders): Removed. (gtk_file_chooser_list_shortcut_folders): Return a list of strings, not of GtkFilePath*. (gtk_file_chooser_list_shortcut_folder_uris): New function. (gtk_file_chooser_add_shortcut_folder): New function. (gtk_file_chooser_remove_shortcut_folder): New function. (gtk_file_chooser_add_shortcut_folder_uri): New function. (gtk_file_chooser_remove_shortcut_folder_uri): New function. (_gtk_file_chooser_add_shortcut_folder): New function. (_gtk_file_chooser_remove_shortcut_folder): New function. * gtkfilechooser.h: New enum. * gtkfilechooser.c (gtk_file_chooser_error_quark): New function. * gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): Removed. (gtk_file_system_set_bookmarks): Removed. (gtk_file_system_add_bookmark): New function. (gtk_file_system_remove_bookmark): New function. * gtkfilesystemunix.c (gtk_file_system_unix_get_supports_bookmarks): Removed. (gtk_file_system_unix_set_bookmarks): Removed. (gtk_file_system_unix_add_bookmark): Just a stub for now. (gtk_file_system_unix_remove_bookmark): Likewise. * testfilechooser.c (main): Add a shortcut for testing purposes.
2003-10-18 04:29:40 +00:00
const GtkFilePath *path,
gint position,
Removed. (gtk_file_system_gnome_vfs_set_bookmarks): Removed. 2003-10-17 Federico Mena Quintero <federico@ximian.com> * gtkfilesystemgnomevfs.c (gtk_file_system_gnome_vfs_get_supports_bookmarks): Removed. (gtk_file_system_gnome_vfs_set_bookmarks): Removed. (gtk_file_system_gnome_vfs_add_bookmark): Implement. (gtk_file_system_gnome_vfs_remove_bookmark): Implement. * gtkfilechooserprivate.h (struct _GtkFileChooserIface): Replaced the ::set_shortcut_folders() method with :;add_shortcut_folder() and ::remove_shortcut_folder(). * gtkfilechooserutils.c (delegate_add_shortcut_folder): New function. (delegate_remove_shortcut_folder): New function. (delegate_list_shortcut_folders): New function. * gtkfilechooserimpldefault.c (create_shortcuts_model): Insert the Desktop directory as well. (shortcuts_insert_path): Renamed from shortcuts_append_path; now takes a position index instead of a parent node iter. Also takes a GError argument. (struct _GtkFileChooserImplDefault): Removed the shortcuts_folder list. It is all kept in the model now. (shortcuts_append_home): Save whether adding a shortcut for the home directory was successful. (shortcuts_append_desktop): Likewise for the desktop. (shortcuts_append_file_system_roots): Count and save the number of roots added. (shortcuts_append_shortcut_folders): Removed. (gtk_file_chooser_impl_default_add_shortcut_folder): Implement. (shortcuts_append_bookmarks): Now that we don't have a bookmarks parent node, don't expand the tree. (add_bookmark_button_clicked_cb): Use gtk_file_system_add_bookmark(). (remove_bookmark_button_clicked_cb): Use gtk_file_system_remove_bookmark(). (gtk_file_chooser_impl_default_list_shortcut_folders): Get the folders from the shortcuts model; we no longer keep a separate list. * gtkfilesystem.h (struct _GtkFileSystemIface): Oops, there shouldn't be shortcuts-related virtual methods here. * gtkfilechooser.c (file_paths_to_strings): New helper function. (gtk_file_chooser_get_filenames): Use file_paths_to_strings(). (gtk_file_chooser_get_uris): Likewise. (gtk_file_chooser_set_shortcut_folders): Removed. (gtk_file_chooser_list_shortcut_folders): Return a list of strings, not of GtkFilePath*. (gtk_file_chooser_list_shortcut_folder_uris): New function. (gtk_file_chooser_add_shortcut_folder): New function. (gtk_file_chooser_remove_shortcut_folder): New function. (gtk_file_chooser_add_shortcut_folder_uri): New function. (gtk_file_chooser_remove_shortcut_folder_uri): New function. (_gtk_file_chooser_add_shortcut_folder): New function. (_gtk_file_chooser_remove_shortcut_folder): New function. * gtkfilechooser.h: New enum. * gtkfilechooser.c (gtk_file_chooser_error_quark): New function. * gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): Removed. (gtk_file_system_set_bookmarks): Removed. (gtk_file_system_add_bookmark): New function. (gtk_file_system_remove_bookmark): New function. * gtkfilesystemunix.c (gtk_file_system_unix_get_supports_bookmarks): Removed. (gtk_file_system_unix_set_bookmarks): Removed. (gtk_file_system_unix_add_bookmark): Just a stub for now. (gtk_file_system_unix_remove_bookmark): Likewise. * testfilechooser.c (main): Add a shortcut for testing purposes.
2003-10-18 04:29:40 +00:00
GError **error);
gboolean gtk_file_system_remove_bookmark (GtkFileSystem *file_system,
const GtkFilePath *path,
GError **error);
GSList *gtk_file_system_list_bookmarks (GtkFileSystem *file_system);
Added methods for ::get_supports_bookmarks(), ::set_bookmarks(), 2003-10-07 Federico Mena Quintero <federico@ximian.com> * gtkfilesystem.h (struct _GtkFileSystemIface): Added methods for ::get_supports_bookmarks(), ::set_bookmarks(), ::list_bookmarks(). Added a ::bookmarks_changed() signal. * gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): New function. (gtk_file_system_set_bookmarks): New function. (gtk_file_system_list_bookmarks): New function. (gtk_file_system_base_init): Create the "bookmarks-changed" signal. (gtk_file_paths_copy): New function. * gtkfilesystemunix.c (gtk_file_system_unix_get_supports_bookmarks): Implement. (gtk_file_system_unix_set_bookmarks): Implement. (gtk_file_system_unix_get_bookmarks): Implement. * gtkfilesystemgnomevfs.c (struct _GtkFileSystemGnomeVFS): Added fields for the bookmarks and the GConfClient. (gtk_file_system_gnome_vfs_set_bookmarks): Implement. (gtk_file_system_gnome_vfs_list_bookmarks): Implement. * gtkfilechooserprivate.h (struct _GtkFileChooserIface): Added methods for ::set_shortcut_folders(), ::list_shortcut_folders(). * gtkfilechooser.c (gtk_file_chooser_set_shortcut_folders): New function. (gtk_file_chooser_list_shortcut_folders): New function. * gtkfilechooserimpldefault.c (create_shortcuts_model): Unref the old shortcuts model if it exists. Create the nodes for the app-specific shortcut folders. (struct _GtkFileChooserImplDefault): Added a field for the shortcut_folders. (gtk_file_chooser_impl_default_set_shortcut_folders): Implement. (select_shortcuts_folder): New helper function. (gtk_file_chooser_impl_default_set_current_folder): Use select_shortcuts_folder(). (shortcuts_append_path): Get the file info here, instead of the caller. (shortcuts_append_home): Use shortcuts_append_path(). (shortcuts_append_file_system_roots): Likewise. (create_shortcuts_model): Add the app-specific shortcut folders and the bookmarks. (gtk_file_chooser_impl_default_list_shortcut_folders): Implement. (create_shortcuts_tree): Added a button to let the user add the current folder to the bookmarks. (gtk_file_chooser_impl_default_set_property): Connect to "bookmarks-changed" on the file system. (shortcuts_append_bookmarks): New function. * configure.ac: Depend on GConf.
2003-10-08 04:14:55 +00:00
gchar *gtk_file_system_get_bookmark_label (GtkFileSystem *file_system,
const GtkFilePath *path);
void gtk_file_system_set_bookmark_label (GtkFileSystem *file_system,
const GtkFilePath *path,
const gchar *label);
Added methods for ::get_supports_bookmarks(), ::set_bookmarks(), 2003-10-07 Federico Mena Quintero <federico@ximian.com> * gtkfilesystem.h (struct _GtkFileSystemIface): Added methods for ::get_supports_bookmarks(), ::set_bookmarks(), ::list_bookmarks(). Added a ::bookmarks_changed() signal. * gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): New function. (gtk_file_system_set_bookmarks): New function. (gtk_file_system_list_bookmarks): New function. (gtk_file_system_base_init): Create the "bookmarks-changed" signal. (gtk_file_paths_copy): New function. * gtkfilesystemunix.c (gtk_file_system_unix_get_supports_bookmarks): Implement. (gtk_file_system_unix_set_bookmarks): Implement. (gtk_file_system_unix_get_bookmarks): Implement. * gtkfilesystemgnomevfs.c (struct _GtkFileSystemGnomeVFS): Added fields for the bookmarks and the GConfClient. (gtk_file_system_gnome_vfs_set_bookmarks): Implement. (gtk_file_system_gnome_vfs_list_bookmarks): Implement. * gtkfilechooserprivate.h (struct _GtkFileChooserIface): Added methods for ::set_shortcut_folders(), ::list_shortcut_folders(). * gtkfilechooser.c (gtk_file_chooser_set_shortcut_folders): New function. (gtk_file_chooser_list_shortcut_folders): New function. * gtkfilechooserimpldefault.c (create_shortcuts_model): Unref the old shortcuts model if it exists. Create the nodes for the app-specific shortcut folders. (struct _GtkFileChooserImplDefault): Added a field for the shortcut_folders. (gtk_file_chooser_impl_default_set_shortcut_folders): Implement. (select_shortcuts_folder): New helper function. (gtk_file_chooser_impl_default_set_current_folder): Use select_shortcuts_folder(). (shortcuts_append_path): Get the file info here, instead of the caller. (shortcuts_append_home): Use shortcuts_append_path(). (shortcuts_append_file_system_roots): Likewise. (create_shortcuts_model): Add the app-specific shortcut folders and the bookmarks. (gtk_file_chooser_impl_default_list_shortcut_folders): Implement. (create_shortcuts_tree): Added a button to let the user add the current folder to the bookmarks. (gtk_file_chooser_impl_default_set_property): Connect to "bookmarks-changed" on the file system. (shortcuts_append_bookmarks): New function. * configure.ac: Depend on GConf.
2003-10-08 04:14:55 +00:00
2003-03-21 20:34:02 +00:00
/*
* Detailed information about a particular folder
*/
#define GTK_TYPE_FILE_FOLDER (gtk_file_folder_get_type ())
#define GTK_FILE_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_FOLDER, GtkFileFolder))
#define GTK_IS_FILE_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FILE_FOLDER))
#define GTK_FILE_FOLDER_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GTK_TYPE_FILE_FOLDER, GtkFileFolderIface))
struct _GtkFileFolderIface
{
GTypeInterface base_iface;
/* Methods
*/
GtkFileInfo * (*get_info) (GtkFileFolder *folder,
const GtkFilePath *path,
GError **error);
gboolean (*list_children) (GtkFileFolder *folder,
GSList **children,
GError **error);
2003-03-21 20:34:02 +00:00
/* ??? refresh() ??? */
/* Signals
*/
void (*deleted) (GtkFileFolder *monitor);
void (*files_added) (GtkFileFolder *monitor,
GSList *paths);
void (*files_changed) (GtkFileFolder *monitor,
GSList *paths);
void (*files_removed) (GtkFileFolder *monitor,
GSList *paths);
Fix #137520. 2004-03-29 Federico Mena Quintero <federico@ximian.com> Fix #137520. * gtk/gtkfilesystem.h (struct _GtkFileFolderIface): Added slots for an ::is_finished_loading() method and a ::finished_loading() signal at the end of the struct. * gtk/gtkfilesystem.c (gtk_file_folder_base_init): Create the "finished-loading" signal. (gtk_file_folder_is_finished_loading): New function. * gtk/gtkfilesystemunix.c (gtk_file_folder_unix_is_finished_loading): Implement. * gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModelClass): New slot for a "finished-loading" signal. (gtk_file_system_model_class_init): Create the "finished-loading" signal. (struct _GtkFileSystemModel): New field idle_finished_loading_source. We emit the "finished-loading" signal in an idle if the root folder was done loading right in _gtk_file_system_model_new(), so that the caller has a chance to connect to the signal. (_gtk_file_system_model_new): Connect to the normal signals of the folder even if the initial _list_children() fails. Also, see if the folder is finished loading; connect to the "finished-loading" signal otherwise. (gtk_file_system_model_finalize): Remove the idle handler. * gtk/gtkfilechooserdefault.c (set_list_model): Set a busy cursor and connect to the model's "finished-loading" signal. (get_toplevel): New helper function. (error_message): Use get_toplevel(). (trap_activate_cb): Likewise. (location_popup_handler): Likewise. (set_busy_cursor): New function. (browse_files_model_finished_loading_cb): New callback.
2004-03-29 19:52:16 +00:00
/* Method / signal */
gboolean (*is_finished_loading) (GtkFileFolder *folder);
void (*finished_loading) (GtkFileFolder *folder);
2003-03-21 20:34:02 +00:00
};
Mark as const. 2004-11-23 Matthias Clasen <mclasen@redhat.com> * gtk/gtkuimanager.h (gtk_ui_manager_get_type): * gtk/gtktreeview.h (gtk_tree_view_get_type): * gtk/gtktreeviewcolumn.h (gtk_tree_view_column_get_type): * gtk/gtktreestore.h (gtk_tree_store_get_type): * gtk/gtktreeselection.h (gtk_tree_selection_get_type): * gtk/gtktreemodelfilter.h (gtk_tree_model_filter_get_type): * gtk/gtktreemodel.h (gtk_tree_iter_get_type): (gtk_tree_path_get_type): (gtk_tree_row_reference_get_type): * gtk/gtktoolitem.h (gtk_tool_item_get_type): * gtk/gtktoolbutton.h (gtk_tool_button_get_type): * gtk/gtktoggleaction.h (gtk_toggle_action_get_type): * gtk/gtkthemes.h (gtk_theme_engine_get_type): * gtk/gtktextiter.h (gtk_text_iter_get_type): * gtk/gtksettings.h (gtk_settings_get_type): * gtk/gtkselection.h (gtk_selection_data_get_type): * gtk/gtkradioaction.h (gtk_radio_action_get_type): * gtk/gtkmenutoolbutton.h (gtk_menu_tool_button_get_type): * gtk/gtkliststore.h (gtk_list_store_get_type): * gtk/gtkiconview.h (gtk_icon_view_get_type): * gtk/gtkicontheme.h (gtk_icon_info_get_type): * gtk/gtkiconfactory.h (gtk_icon_factory_get_type): (gtk_icon_set_get_type): (gtk_icon_source_get_type): * gtk/gtkfilesystemwin32.h (gtk_file_system_win32_get_type): * gtk/gtkfilesystemunix.h (gtk_file_system_unix_get_type): * gtk/gtkfilesystem.h (gtk_file_folder_get_type): (gtk_file_info_get_type, gtk_file_path_get_type): (gtk_file_system_get_type): * gtk/gtkfilefilter.h (gtk_file_filter_get_type): * gtk/gtkfilechooserwidget.h (gtk_file_chooser_widget_get_type): * gtk/gtkfilechooser.h (gtk_file_chooser_get_type): * gtk/gtkfilechooserdialog.h (gtk_file_chooser_dialog_get_type): * gtk/gtkexpander.h (gtk_expander_get_type): * gtk/gtkentrycompletion.h (gtk_entry_completion_get_type): * gtk/gtkcombobox.h (gtk_combo_box_get_type): * gtk/gtkcomboboxentry.h (gtk_combo_box_entry_get_type): * gtk/gtkclipboard.h (gtk_clipboard_get_type): * gtk/gtkcellview.h (gtk_cell_view_get_type): * gtk/gtkcellrenderertoggle.h (gtk_cell_renderer_toggle_get_type): * gtk/gtkcellrenderertext.h (gtk_cell_renderer_text_get_type): * gtk/gtkcellrendererprogress.h (gtk_cell_renderer_progress_get_type): * gtk/gtkcellrendererpixbuf.h (gtk_cell_renderer_pixbuf_get_type): * gtk/gtkcellrenderercombo.h (gtk_cell_renderer_combo_get_type): * gtk/gtkcelllayout.h (gtk_cell_layout_get_type): * gtk/gtkactiongroup.h (gtk_action_group_get_type): * gtk/gtkaction.h (gtk_action_get_type): * gtk/gtkaccessible.h (gtk_accessible_get_type): * gtk/gtkaccelmap.h (gtk_accel_map_get_type): * gtk/gtkaccelgroup.h (gtk_accel_group_get_type): * gtk/gtkmessagedialog.h (gtk_message_dialog_get_type): Mark as const. * gtk/gtkicontheme.h: Don't mark gtk_icon_theme_error_quark() as const, to be consistent with all the other error_quark functions. (technically they are const, but since these are called only in error paths, giving the compiler better optimization opportunities doesn't matter much) * gtk/gtk.symbols: * gdk/gdk.symbols: Add attribute annotations. * gtk/makegtkalias.pl: * gdk/makegdkalias.pl: Keep attribute annotations, but strip PRIVATE. * gtk/Makefile.am (gtk.def): * gdk/Makefile.am (gdk.def): Strip attribute annotations, but keep PRIVATE.
2004-11-23 20:02:15 +00:00
GType gtk_file_folder_get_type (void) G_GNUC_CONST;
gboolean gtk_file_folder_list_children (GtkFileFolder *folder,
GSList **children,
GError **error);
GtkFileInfo *gtk_file_folder_get_info (GtkFileFolder *folder,
const GtkFilePath *path,
GError **error);
Fix #137520. 2004-03-29 Federico Mena Quintero <federico@ximian.com> Fix #137520. * gtk/gtkfilesystem.h (struct _GtkFileFolderIface): Added slots for an ::is_finished_loading() method and a ::finished_loading() signal at the end of the struct. * gtk/gtkfilesystem.c (gtk_file_folder_base_init): Create the "finished-loading" signal. (gtk_file_folder_is_finished_loading): New function. * gtk/gtkfilesystemunix.c (gtk_file_folder_unix_is_finished_loading): Implement. * gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModelClass): New slot for a "finished-loading" signal. (gtk_file_system_model_class_init): Create the "finished-loading" signal. (struct _GtkFileSystemModel): New field idle_finished_loading_source. We emit the "finished-loading" signal in an idle if the root folder was done loading right in _gtk_file_system_model_new(), so that the caller has a chance to connect to the signal. (_gtk_file_system_model_new): Connect to the normal signals of the folder even if the initial _list_children() fails. Also, see if the folder is finished loading; connect to the "finished-loading" signal otherwise. (gtk_file_system_model_finalize): Remove the idle handler. * gtk/gtkfilechooserdefault.c (set_list_model): Set a busy cursor and connect to the model's "finished-loading" signal. (get_toplevel): New helper function. (error_message): Use get_toplevel(). (trap_activate_cb): Likewise. (location_popup_handler): Likewise. (set_busy_cursor): New function. (browse_files_model_finished_loading_cb): New callback.
2004-03-29 19:52:16 +00:00
gboolean gtk_file_folder_is_finished_loading (GtkFileFolder *folder);
/* GtkFilePath */
#define GTK_TYPE_FILE_PATH (gtk_file_path_get_type ())
Mark as const. 2004-11-23 Matthias Clasen <mclasen@redhat.com> * gtk/gtkuimanager.h (gtk_ui_manager_get_type): * gtk/gtktreeview.h (gtk_tree_view_get_type): * gtk/gtktreeviewcolumn.h (gtk_tree_view_column_get_type): * gtk/gtktreestore.h (gtk_tree_store_get_type): * gtk/gtktreeselection.h (gtk_tree_selection_get_type): * gtk/gtktreemodelfilter.h (gtk_tree_model_filter_get_type): * gtk/gtktreemodel.h (gtk_tree_iter_get_type): (gtk_tree_path_get_type): (gtk_tree_row_reference_get_type): * gtk/gtktoolitem.h (gtk_tool_item_get_type): * gtk/gtktoolbutton.h (gtk_tool_button_get_type): * gtk/gtktoggleaction.h (gtk_toggle_action_get_type): * gtk/gtkthemes.h (gtk_theme_engine_get_type): * gtk/gtktextiter.h (gtk_text_iter_get_type): * gtk/gtksettings.h (gtk_settings_get_type): * gtk/gtkselection.h (gtk_selection_data_get_type): * gtk/gtkradioaction.h (gtk_radio_action_get_type): * gtk/gtkmenutoolbutton.h (gtk_menu_tool_button_get_type): * gtk/gtkliststore.h (gtk_list_store_get_type): * gtk/gtkiconview.h (gtk_icon_view_get_type): * gtk/gtkicontheme.h (gtk_icon_info_get_type): * gtk/gtkiconfactory.h (gtk_icon_factory_get_type): (gtk_icon_set_get_type): (gtk_icon_source_get_type): * gtk/gtkfilesystemwin32.h (gtk_file_system_win32_get_type): * gtk/gtkfilesystemunix.h (gtk_file_system_unix_get_type): * gtk/gtkfilesystem.h (gtk_file_folder_get_type): (gtk_file_info_get_type, gtk_file_path_get_type): (gtk_file_system_get_type): * gtk/gtkfilefilter.h (gtk_file_filter_get_type): * gtk/gtkfilechooserwidget.h (gtk_file_chooser_widget_get_type): * gtk/gtkfilechooser.h (gtk_file_chooser_get_type): * gtk/gtkfilechooserdialog.h (gtk_file_chooser_dialog_get_type): * gtk/gtkexpander.h (gtk_expander_get_type): * gtk/gtkentrycompletion.h (gtk_entry_completion_get_type): * gtk/gtkcombobox.h (gtk_combo_box_get_type): * gtk/gtkcomboboxentry.h (gtk_combo_box_entry_get_type): * gtk/gtkclipboard.h (gtk_clipboard_get_type): * gtk/gtkcellview.h (gtk_cell_view_get_type): * gtk/gtkcellrenderertoggle.h (gtk_cell_renderer_toggle_get_type): * gtk/gtkcellrenderertext.h (gtk_cell_renderer_text_get_type): * gtk/gtkcellrendererprogress.h (gtk_cell_renderer_progress_get_type): * gtk/gtkcellrendererpixbuf.h (gtk_cell_renderer_pixbuf_get_type): * gtk/gtkcellrenderercombo.h (gtk_cell_renderer_combo_get_type): * gtk/gtkcelllayout.h (gtk_cell_layout_get_type): * gtk/gtkactiongroup.h (gtk_action_group_get_type): * gtk/gtkaction.h (gtk_action_get_type): * gtk/gtkaccessible.h (gtk_accessible_get_type): * gtk/gtkaccelmap.h (gtk_accel_map_get_type): * gtk/gtkaccelgroup.h (gtk_accel_group_get_type): * gtk/gtkmessagedialog.h (gtk_message_dialog_get_type): Mark as const. * gtk/gtkicontheme.h: Don't mark gtk_icon_theme_error_quark() as const, to be consistent with all the other error_quark functions. (technically they are const, but since these are called only in error paths, giving the compiler better optimization opportunities doesn't matter much) * gtk/gtk.symbols: * gdk/gdk.symbols: Add attribute annotations. * gtk/makegtkalias.pl: * gdk/makegdkalias.pl: Keep attribute annotations, but strip PRIVATE. * gtk/Makefile.am (gtk.def): * gdk/Makefile.am (gdk.def): Strip attribute annotations, but keep PRIVATE.
2004-11-23 20:02:15 +00:00
GType gtk_file_path_get_type (void) G_GNUC_CONST;
#ifdef __GNUC__
#define gtk_file_path_new_dup(str) \
({ const gchar *__s = (str); (GtkFilePath *)g_strdup(__s); })
#define gtk_file_path_new_steal(str) \
({ gchar *__s = (str); (GtkFilePath *)__s; })
#define gtk_file_path_get_string(path) \
({ const GtkFilePath *__p = (path); (const gchar *)__p; })
#define gtk_file_path_free(path) \
({ GtkFilePath *__p = (path); g_free (__p); })
#else /* __GNUC__ */
#define gtk_file_path_new_dup(str) ((GtkFilePath *)g_strdup(str))
#define gtk_file_path_new_steal(str) ((GtkFilePath *)(str))
#define gtk_file_path_get_string(str) ((const gchar *)(str))
#define gtk_file_path_free(path) g_free (path)
#endif/* __GNUC__ */
#define gtk_file_path_copy(path) gtk_file_path_new_dup (gtk_file_path_get_string(path))
Add -lole32, needed for CoTaskMemFree in get_special_folder() below. 2005-01-02 Tor Lillqvist <tml@iki.fi> * gtk/Makefile.am (libgtk_target_ldflags): Add -lole32, needed for CoTaskMemFree in get_special_folder() below. * gtk/gtkfilesystem.h: Implement case-insensitive path compare on Win32 using _gtk_file_system_win32_path_compare(). * gtk/gtk.symbols: Add _gtk_file_system_win32_path_compare. * gtk/gtkfilechooserbutton.c (model_add_special) * gtk/gtkfilechooserdefault.c (shortcuts_append_desktop): Use _gtk_file_system_win32_get_desktop() to get correct Desktop folder on Win32. (#144003) * gtk/gtkfilesystemwin32.c: Remove unnecessary includes. Do consider all drives "mounted", including floppies. Trying to inspect the contents of a nonexistent floppy will cause errors later that are handled normally, no need to avoid them completely. Keep the drive type in the GtkFileSystemVolume. Support UNC paths. (#161797) Fix error message capitalizations as in gtkfilesystemunix.c. (gtk_file_system_win32_init): Start one timeout per GtkFileSystemWin32. (gtk_file_system_win32_finalize): Remove the timeout. (get_special_folder): Copied from GLib. (_gtk_file_system_win32_get_desktop): New function, uses get_special_folder(). (gtk_file_system_win32_list_volumes): Don't start a timeout at each call to this function. Don't assume A: and B: are floppies. (gtk_file_system_win32_get_volume_for_path): Don't assume all volumes are drive roots, i.e. support share roots of UNC paths (\\server\share). (gtk_file_system_win32_get_folder): Don't assume errno is set after g_file_test() returns FALSE. It isn't on Win32 (and even on Unix I don't think one should assume anything about errno after g_file_test()). (gtk_file_system_win32_volume_get_is_mounted): Always return TRUE. (gtk_file_system_win32_volume_get_display_name): Don't call GetVolumeInformation() on drives A: or B: if they are removable, as they might then be floppies, causing an unnecessary delay. (#157820) (gtk_file_system_win32_volume_render_icon): Use network icon for unrecognized drive types. (canonicalize_filename, gtk_file_system_win32_parse): Don't get confused by UNC paths. (bookmarks_serialize): Use _gtk_file_system_win32_path_compare() for case-insensitive UTF-8 path comparison. (extract_icon): Use SHGetFileInfo() which is faster than ExtractAssociatedIcon(). Icon extraction is still slow, though, needs work. (win32_pseudo_mime_lookup): Don't use the same icon for all shortcuts or executables. Cache only other file type icons. (gtk_file_system_win32_render_icon): Use network stock icon for remote drives and UNC server share roots. Compare home directory case-insensitively. Do lookup icons also for executable files, after all, it's these files that can have individual icons in the first place. Yes, it can be slow. Needs work. (filename_is_drive_root): Require also the slash after the colon. (filename_is_server_share): New function. (_gtk_file_system_win32_path_compare): New function, does case-folded UTF-8 comparison. * gtk/gtkfilesystemwin32.h: Declare _gtk_file_system_win32_path_compare().
2005-01-02 23:15:21 +00:00
#ifdef G_OS_WIN32
int _gtk_file_system_win32_path_compare (const gchar *path1,
const gchar *path2);
#define gtk_file_path_compare(path1,path2) \
_gtk_file_system_win32_path_compare (gtk_file_path_get_string (path1), \
gtk_file_path_get_string (path2))
#else
#define gtk_file_path_compare(path1,path2) strcmp (gtk_file_path_get_string (path1), \
gtk_file_path_get_string (path2))
Add -lole32, needed for CoTaskMemFree in get_special_folder() below. 2005-01-02 Tor Lillqvist <tml@iki.fi> * gtk/Makefile.am (libgtk_target_ldflags): Add -lole32, needed for CoTaskMemFree in get_special_folder() below. * gtk/gtkfilesystem.h: Implement case-insensitive path compare on Win32 using _gtk_file_system_win32_path_compare(). * gtk/gtk.symbols: Add _gtk_file_system_win32_path_compare. * gtk/gtkfilechooserbutton.c (model_add_special) * gtk/gtkfilechooserdefault.c (shortcuts_append_desktop): Use _gtk_file_system_win32_get_desktop() to get correct Desktop folder on Win32. (#144003) * gtk/gtkfilesystemwin32.c: Remove unnecessary includes. Do consider all drives "mounted", including floppies. Trying to inspect the contents of a nonexistent floppy will cause errors later that are handled normally, no need to avoid them completely. Keep the drive type in the GtkFileSystemVolume. Support UNC paths. (#161797) Fix error message capitalizations as in gtkfilesystemunix.c. (gtk_file_system_win32_init): Start one timeout per GtkFileSystemWin32. (gtk_file_system_win32_finalize): Remove the timeout. (get_special_folder): Copied from GLib. (_gtk_file_system_win32_get_desktop): New function, uses get_special_folder(). (gtk_file_system_win32_list_volumes): Don't start a timeout at each call to this function. Don't assume A: and B: are floppies. (gtk_file_system_win32_get_volume_for_path): Don't assume all volumes are drive roots, i.e. support share roots of UNC paths (\\server\share). (gtk_file_system_win32_get_folder): Don't assume errno is set after g_file_test() returns FALSE. It isn't on Win32 (and even on Unix I don't think one should assume anything about errno after g_file_test()). (gtk_file_system_win32_volume_get_is_mounted): Always return TRUE. (gtk_file_system_win32_volume_get_display_name): Don't call GetVolumeInformation() on drives A: or B: if they are removable, as they might then be floppies, causing an unnecessary delay. (#157820) (gtk_file_system_win32_volume_render_icon): Use network icon for unrecognized drive types. (canonicalize_filename, gtk_file_system_win32_parse): Don't get confused by UNC paths. (bookmarks_serialize): Use _gtk_file_system_win32_path_compare() for case-insensitive UTF-8 path comparison. (extract_icon): Use SHGetFileInfo() which is faster than ExtractAssociatedIcon(). Icon extraction is still slow, though, needs work. (win32_pseudo_mime_lookup): Don't use the same icon for all shortcuts or executables. Cache only other file type icons. (gtk_file_system_win32_render_icon): Use network stock icon for remote drives and UNC server share roots. Compare home directory case-insensitively. Do lookup icons also for executable files, after all, it's these files that can have individual icons in the first place. Yes, it can be slow. Needs work. (filename_is_drive_root): Require also the slash after the colon. (filename_is_server_share): New function. (_gtk_file_system_win32_path_compare): New function, does case-folded UTF-8 comparison. * gtk/gtkfilesystemwin32.h: Declare _gtk_file_system_win32_path_compare().
2005-01-02 23:15:21 +00:00
#endif
GSList *gtk_file_paths_sort (GSList *paths);
Added methods for ::get_supports_bookmarks(), ::set_bookmarks(), 2003-10-07 Federico Mena Quintero <federico@ximian.com> * gtkfilesystem.h (struct _GtkFileSystemIface): Added methods for ::get_supports_bookmarks(), ::set_bookmarks(), ::list_bookmarks(). Added a ::bookmarks_changed() signal. * gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): New function. (gtk_file_system_set_bookmarks): New function. (gtk_file_system_list_bookmarks): New function. (gtk_file_system_base_init): Create the "bookmarks-changed" signal. (gtk_file_paths_copy): New function. * gtkfilesystemunix.c (gtk_file_system_unix_get_supports_bookmarks): Implement. (gtk_file_system_unix_set_bookmarks): Implement. (gtk_file_system_unix_get_bookmarks): Implement. * gtkfilesystemgnomevfs.c (struct _GtkFileSystemGnomeVFS): Added fields for the bookmarks and the GConfClient. (gtk_file_system_gnome_vfs_set_bookmarks): Implement. (gtk_file_system_gnome_vfs_list_bookmarks): Implement. * gtkfilechooserprivate.h (struct _GtkFileChooserIface): Added methods for ::set_shortcut_folders(), ::list_shortcut_folders(). * gtkfilechooser.c (gtk_file_chooser_set_shortcut_folders): New function. (gtk_file_chooser_list_shortcut_folders): New function. * gtkfilechooserimpldefault.c (create_shortcuts_model): Unref the old shortcuts model if it exists. Create the nodes for the app-specific shortcut folders. (struct _GtkFileChooserImplDefault): Added a field for the shortcut_folders. (gtk_file_chooser_impl_default_set_shortcut_folders): Implement. (select_shortcuts_folder): New helper function. (gtk_file_chooser_impl_default_set_current_folder): Use select_shortcuts_folder(). (shortcuts_append_path): Get the file info here, instead of the caller. (shortcuts_append_home): Use shortcuts_append_path(). (shortcuts_append_file_system_roots): Likewise. (create_shortcuts_model): Add the app-specific shortcut folders and the bookmarks. (gtk_file_chooser_impl_default_list_shortcut_folders): Implement. (create_shortcuts_tree): Added a button to let the user add the current folder to the bookmarks. (gtk_file_chooser_impl_default_set_property): Connect to "bookmarks-changed" on the file system. (shortcuts_append_bookmarks): New function. * configure.ac: Depend on GConf.
2003-10-08 04:14:55 +00:00
GSList *gtk_file_paths_copy (GSList *paths);
void gtk_file_paths_free (GSList *paths);
2003-03-21 20:34:02 +00:00
/* GtkFileSystem modules support */
GtkFileSystem *gtk_file_system_create (const char *file_system_name);
2003-03-21 20:34:02 +00:00
G_END_DECLS
#endif /* __GTK_FILE_SYSTEM_H__ */