summaryrefslogtreecommitdiff
path: root/libnautilus-extensions/nautilus-file-utilities.h
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-06-20 22:09:36 +0000
committerDarin Adler <darin@src.gnome.org>2000-06-20 22:09:36 +0000
commite1f2a77d0879e58c20b1bbc5ef183ccbce16bdb6 (patch)
treed43d3123880d5b752c6dea4e0d4358c1b4259ab8 /libnautilus-extensions/nautilus-file-utilities.h
parenta72a5ed00038078a6dbc762257d68b57ac913af4 (diff)
downloadnautilus-e1f2a77d0879e58c20b1bbc5ef183ccbce16bdb6.tar.gz
Made NautilusFile async. like NautilusDirectory already was.
* RENAMING: Added a renaming idea. * libnautilus-extensions/nautilus-directory-async.c: (cancel_get_info), (cancel_metafile_read), (nautilus_directory_cancel): Added the new getting of file info to the cancel logic. (nautilus_compare_file_with_name): Changed to get the name in a way that works with files with no info. (nautilus_async_destroying_file): Handle the cancelling for the get_file_info case. (lacks_info), (wants_info), (request_is_satisfied): Add code to handle the need for file info for a newly created NautilusFile. (get_info_callback), (start_getting_file_info), (state_changed): Add code to get file info for files that lack it. * libnautilus-extensions/nautilus-directory-private.h: Add fields for getting file info for new files. * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_notify_files_moved): Moved the logic about updating the name on a file as it is moved into nautilus-file.c. * libnautilus-extensions/nautilus-file-attributes.h: Added a "deep count" attribute and function as a placeholder for work that I'll be doing for John shortly. * libnautilus-extensions/nautilus-file-private.h: Moved the calls relating to updating an existing NautilusFile so they are private and added one for a name change. * libnautilus-extensions/nautilus-file-utilities.h: Added interface for new nautilus_read_entire_file family of calls that I still need to implement. * libnautilus-extensions/nautilus-file.h: * libnautilus-extensions/nautilus-file.c: (nautilus_file_new_from_name), (nautilus_file_new_from_info): Added a way to create a file without having GnomeVFSFileInfo yet. (nautilus_file_get): Don't get the GnomeVFSFileInfo; let the async. logic handler that. (rename_update_info_and_metafile): Handle new name field. (nautilus_file_rename): Use new name field. (nautilus_file_get_gnome_vfs_uri): Common code shared in a couple of places. Started fixing the "no file object for root" problem. (nautilus_file_matches_uri): Use nautilus_file_get_gnome_vfs_uri. (nautilus_file_update_info): Handle NULL case and new name field. (nautilus_file_update_name): New function used by move code in nautilus-directory.c. (nautilus_file_compare_by_type): Handle NULL info case. (nautilus_file_compare_for_sort_internal): Handle NULL info case. (nautilus_file_compare_name): Use new name field. (nautilus_file_get_metadata), (nautilus_file_get_metadata_list): Handle NULL file and use new name field. (nautilus_file_set_metadata), (nautilus_file_set_metadata_list): Use new name field. (nautilus_file_get_name): Handle NULL file and use new name field. (nautilus_file_get_uri): Use nautilus_file_get_gnome_vfs_uri. (info_missing): New function to handle NULL file case, NULL info case, and check the valid_fields more thoroughly. (nautilus_file_get_date_as_string), (nautilus_file_get_size), (nautilus_file_can_get_permissions), (nautilus_file_get_owner_as_string), (nautilus_file_get_group_as_string), (nautilus_file_get_size_as_string), (nautilus_file_get_type_as_string), (nautilus_file_get_file_type), (nautilus_file_get_mime_type), (nautilus_file_is_mime_type), (nautilus_file_is_symbolic_link), Use info_missing to handle NULL file and NULL info cases and to do valid_fields checks as needed. (nautilus_file_get_permissions_as_string): Move file check so the NULL case will work properly. (nautilus_file_get_mime_type_as_string_attribute): Got rid of redundant g_free call. (nautilus_file_get_string_attribute): Remove file check so NULL case will work properly. (nautilus_file_get_emblem_names): Handle NULL file case. (nautilus_file_get_keywords): Handle NULL file case. (nautilus_file_is_executable): Remove file check so NULL case will work properly. (nautilus_file_mark_gone): Add code to get rid of info which we don't need to keep around for files that are gone. (nautilus_file_activate_custom): Added FIXME comments. * libnautilus-extensions/nautilus-gdk-extensions.c: (nautilus_get_largest_fitting_font): Changed so it handles the case of NULL for passed-in text properly. * libnautilus-extensions/nautilus-icon-factory.c: (nautilus_icon_factory_get_icon_for_file): Formatting. (nautilus_icon_factory_get_pixbuf_for_file): Handle NULL file by returning NULL for the pixbuf. (nautilus_icon_factory_get_pixmap_and_mask_for_file): Handle NULL for the pixbuf by return NULL for the pixmap/mask. * src/nautilus-main.c: (print_leaks), (main): Do the leak printing from an atexit function so more of the cleanup will run first. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (nautilus_gtk_pixmap_new_empty): A simple cover for allocating a GtkPixmap before we have a GdkPixmap to display. * src/nautilus-sidebar-title.c: (nautilus_sidebar_title_initialize): Create the widgets when the title is set up instead of creating them "as needed". (update_icon): Always update the icon, even if the file is NULL. (update_title): Always update the title, even if the file is NULL. Also got rid of the line-breaking code. We instead use the line- breaking code inside GtkLabel, which we can tweak as needed by setting a line width. We may need to revisit this, but lets not re-add our own line-break code unless we have to. (append_and_eat), (update_more_info): Always update the info field, even if the file is NULL. I rewrote this. (add_emblem), (update_emblems): Always update the emblems, even if the file is NULL. (update_notes): Always update the notes, even if the file is NULL. (update_all): Update all the pieces separately (the old code was doing them strangely bunched up). (nautilus_sidebar_title_set_uri): Always ask for the directory item count, even when the item is not yet known to be a directory. * src/nautilus-window.c: (nautilus_window_constructed): Get rid of the call to gtk_widget_show_all that was showhing things that were intentionally hidden. (nautilus_window_load_content_view_menu): Removed an unused variable that was set up but never examined.
Diffstat (limited to 'libnautilus-extensions/nautilus-file-utilities.h')
-rw-r--r--libnautilus-extensions/nautilus-file-utilities.h36
1 files changed, 25 insertions, 11 deletions
diff --git a/libnautilus-extensions/nautilus-file-utilities.h b/libnautilus-extensions/nautilus-file-utilities.h
index 0dce1ed5a..bf2c51432 100644
--- a/libnautilus-extensions/nautilus-file-utilities.h
+++ b/libnautilus-extensions/nautilus-file-utilities.h
@@ -25,32 +25,46 @@
#ifndef NAUTILUS_FILE_UTILITIES_H
#define NAUTILUS_FILE_UTILITIES_H
-char * nautilus_format_uri_for_display (const char *uri);
-char * nautilus_make_uri_from_input(const char *location);
-char * nautilus_make_path (const char *path,
- const char *name);
+#include <libgnomevfs/gnome-vfs-types.h>
+
+typedef void (* NautilusReadFileCallback) (int file_size, char *file_contents, gpointer callback_data);
+typedef struct NautilusReadFileHandle NautilusReadFileHandle;
+
+char * nautilus_format_uri_for_display (const char *uri);
+char * nautilus_make_uri_from_input (const char *location);
+char * nautilus_make_path (const char *path,
+ const char *name);
/* Return paths that don't need to be destroyed. We will probably
* change these to return ones that do need to be destroyed for
* consistency soon.
*/
-const char *nautilus_get_user_directory (void);
-const char *nautilus_get_user_main_directory (void);
-const char *nautilus_get_desktop_directory (void);
-const char *nautilus_get_pixmap_directory (void);
+const char * nautilus_get_user_directory (void);
+const char * nautilus_get_user_main_directory (void);
+const char * nautilus_get_desktop_directory (void);
+const char * nautilus_get_pixmap_directory (void);
/* Turn a "file://" URI into a local path.
* Returns NULL if it's not a URI that can be converted.
*/
-char * nautilus_get_local_path_from_uri (const char *uri);
+char * nautilus_get_local_path_from_uri (const char *uri);
/* Turn a path into a "file://" URI. */
-char * nautilus_get_uri_from_local_path (const char *local_full_path);
+char * nautilus_get_uri_from_local_path (const char *local_full_path);
/* A version of gnome's gnome_pixmap_file that works for the nautilus prefix.
* Otherwise similar to gnome_pixmap_file in that it checks to see if the file
* exists and returns NULL if it doesn't.
*/
-char * nautilus_pixmap_file (const char *partial_path);
+char * nautilus_pixmap_file (const char *partial_path);
+
+/* Read an entire file at once with gnome-vfs. */
+GnomeVFSResult nautilus_read_entire_file (const char *uri,
+ int *file_size,
+ char **file_contents);
+NautilusReadFileHandle *nautilus_read_entire_file_async (const char *uri,
+ NautilusReadFileCallback calllback,
+ gpointer callback_data);
+void nautilus_read_entire_file_cancel (NautilusReadFileHandle *handle);
#endif /* NAUTILUS_FILE_UTILITIES_H */