diff options
author | Darin Adler <darin@src.gnome.org> | 2000-04-06 23:39:11 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2000-04-06 23:39:11 +0000 |
commit | 1ae3a2426a4e21d7db61e5e5885cd513c68716c3 (patch) | |
tree | 71d547d56b7e1fe2b1f5e6a1754e68db70567dfc /libnautilus-private/nautilus-directory.h | |
parent | 50206e4a0093a53ceb58ff424cd0e40bd82fcceb (diff) | |
download | nautilus-1ae3a2426a4e21d7db61e5e5885cd513c68716c3.tar.gz |
Added the hooks needed to make metafile reading asynchronous.
Next I'll change the actual metafile access to work that way.
* libnautilus/nautilus-directory.h:
* libnautilus/nautilus-directory.c:
(nautilus_directory_metadata_call_when_ready): Added function
that requests a read of some metadata and calls back when the
data is ready.
* src/ntl-app.c: (nautilus_app_startup): Got rid of call to
nautilus_navinfo_init.
* src/ntl-types.h: Moved the NautilusNavigationInfo struct
and related defines to ntl-uri-map.h.
* src/ntl-uri-map.h:
* src/ntl-uri-map.c:
Reformatted and changed the names of many functions.
Added code to use the new metadata callback.
* src/ntl-index-panel.c:
* src/ntl-main.c:
* src/ntl-view.h:
* src/ntl-window-msgs.c:
* src/ntl-window.c:
* src/ntl-window.h:
Had to change includes a bit because of my changes to what
header files are including.
* src/ntl-window-msgs.c: (nautilus_window_update_state):
* src/ntl-window.h:
Use the new nautilus_navigation_info_cancel call instead of
reaching right in to cancel the underlying call.
* src/ntl-view-private.h:
Reformatting.
Diffstat (limited to 'libnautilus-private/nautilus-directory.h')
-rw-r--r-- | libnautilus-private/nautilus-directory.h | 79 |
1 files changed, 45 insertions, 34 deletions
diff --git a/libnautilus-private/nautilus-directory.h b/libnautilus-private/nautilus-directory.h index 978c29635..3083e4084 100644 --- a/libnautilus-private/nautilus-directory.h +++ b/libnautilus-private/nautilus-directory.h @@ -56,66 +56,77 @@ typedef struct NautilusDirectoryClass NautilusDirectoryClass; #define NAUTILUS_IS_DIRECTORY_CLASS(klass) \ (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_DIRECTORY)) +typedef void (*NautilusMetadataCallback) (NautilusDirectory *directory, + gpointer callback_data); typedef void (*NautilusFileListCallback) (NautilusDirectory *directory, GList *files, gpointer callback_data); /* Basic GtkObject requirements. */ -GtkType nautilus_directory_get_type (void); +GtkType nautilus_directory_get_type (void); /* Get a directory given a uri. * Creates the appropriate subclass given the uri mappings. * Returns a referenced object, not a floating one. Unref when finished. * If two windows are viewing the same uri, the directory object is shared. */ -NautilusDirectory *nautilus_directory_get (const char *uri); +NautilusDirectory *nautilus_directory_get (const char *uri); /* Convenience functions, since we do a lot of ref'ing and unref'ing. */ -void nautilus_directory_ref (NautilusDirectory *directory); -void nautilus_directory_unref (NautilusDirectory *directory); +void nautilus_directory_ref (NautilusDirectory *directory); +void nautilus_directory_unref (NautilusDirectory *directory); /* Access to a URI. */ -char * nautilus_directory_get_uri (NautilusDirectory *directory); - -/* Simple preliminary interface for getting and setting metadata. */ -char * nautilus_directory_get_metadata (NautilusDirectory *directory, - const char *tag, - const char *default_metadata); -void nautilus_directory_set_metadata (NautilusDirectory *directory, - const char *tag, - const char *default_metadata, - const char *metadata); -gboolean nautilus_directory_get_boolean_metadata (NautilusDirectory *directory, - const char *tag, - gboolean default_metadata); -void nautilus_directory_set_boolean_metadata (NautilusDirectory *directory, - const char *tag, - gboolean default_metadata, - gboolean metadata); -int nautilus_directory_get_integer_metadata (NautilusDirectory *directory, - const char *tag, - int default_metadata); -void nautilus_directory_set_integer_metadata (NautilusDirectory *directory, - const char *tag, - int default_metadata, - int metadata); +char * nautilus_directory_get_uri (NautilusDirectory *directory); + +/* Getting and setting metadata. */ +char * nautilus_directory_get_metadata (NautilusDirectory *directory, + const char *tag, + const char *default_metadata); +void nautilus_directory_set_metadata (NautilusDirectory *directory, + const char *tag, + const char *default_metadata, + const char *metadata); +void nautilus_directory_metadata_call_when_ready (NautilusDirectory *directory, + GList *tags, + NautilusMetadataCallback callback, + gpointer callback_data); +void nautilus_directory_metadata_callback_cancel (NautilusDirectory *directory, + NautilusMetadataCallback callback, + gpointer callback_data); + +/* Covers for common data types. */ +gboolean nautilus_directory_get_boolean_metadata (NautilusDirectory *directory, + const char *tag, + gboolean default_metadata); +void nautilus_directory_set_boolean_metadata (NautilusDirectory *directory, + const char *tag, + gboolean default_metadata, + gboolean metadata); +int nautilus_directory_get_integer_metadata (NautilusDirectory *directory, + const char *tag, + int default_metadata); +void nautilus_directory_set_integer_metadata (NautilusDirectory *directory, + const char *tag, + int default_metadata, + int metadata); /* Monitor the files in a directory. */ -void nautilus_directory_monitor_files_ref (NautilusDirectory *directory, - NautilusFileListCallback initial_files_callback, - gpointer callback_data); -void nautilus_directory_monitor_files_unref (NautilusDirectory *directory); +void nautilus_directory_monitor_files_ref (NautilusDirectory *directory, + NautilusFileListCallback initial_files_callback, + gpointer callback_data); +void nautilus_directory_monitor_files_unref (NautilusDirectory *directory); /* Return true if the directory has information about all the files. * This will be false until the directory has been read at least once. */ -gboolean nautilus_directory_are_all_files_seen (NautilusDirectory *directory); +gboolean nautilus_directory_are_all_files_seen (NautilusDirectory *directory); /* Return true if the directory metadata has been loaded. * Until this is true, get_metadata calls will return defaults. * (We could have another way to indicate "don't know".) */ -gboolean nautilus_directory_metadata_loaded (NautilusDirectory *directory); +gboolean nautilus_directory_metadata_loaded (NautilusDirectory *directory); typedef struct NautilusDirectoryDetails NautilusDirectoryDetails; |