nautilus/libnautilus-private/nautilus-file-utilities.h

57 lines
2.2 KiB
C
Raw Normal View History

/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-file-utilities.h - interface for file manipulation routines.
Copyright (C) 1999, 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: John Sullivan <sullivan@eazel.com>
*/
#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);
Small updates. * RENAMING: Small updates. * components/help/converters/gnome-info2html2/main.c: (main): * components/html/glibwww-init.c: (glibwww_parse_proxy_env): * components/html/ntl-web-browser.c: (main): * components/loser/content/nautilus-content-loser.c: (ensure_fail_env): * components/loser/sidebar/nautilus-sidebar-loser.c: (ensure_fail_env): * components/notes/nautilus-notes.c: (main): * libnautilus-extensions/nautilus-view-identifier.c: (get_lang_list): * src/nautilus-application.c: (nautilus_app_startup): * src/nautilus-main.c: (main): Changed from getenv to g_getenv, even though it makes no difference right now, because it's "the right thing to do (tm)". * components/services/time/nautilus-view/trilobite-eazel-time-view.h: Fixed include (the build was broken for me or anyone who doesn't have old .h files sitting around in their install directory). * libnautilus-extensions/nautilus-directory.c: (construct_alternate_metafile_uri): Use nautilus_get_user_directory instead of hard-coding the name of the user directory. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_user_directory), (nautilus_get_user_main_directory): Use #defines instead of global constants since these are things that do not change and this is not C++ :-) Added "get_" to the names of these functions so they would be verbs instead of nouns. (nautilus_get_desktop_directory): Added this new function for use by the desktop code. * libnautilus-extensions/nautilus-global-preferences.c: (global_preferences_create_dialog), (nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers), (nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers), (global_preferences_register_sidebar_panels_preferences_for_ui): * libnautilus-extensions/nautilus-view-identifier.h: * libnautilus-extensions/nautilus-view-identifier.c: (nautilus_view_identifier_list_free): * src/nautilus-applicable-views.c: (nautilus_navigation_info_free): Changed nautilus_view_identifier_free_list to *_list_free to match other calls with similar names. * libnautilus-extensions/nautilus-global-preferences.c: (user_level_changed_callback): * libnautilus-extensions/nautilus-icon-factory.c: (get_themed_icon_file_path): * src/file-manager/fm-properties-window.c: (get_property_names): * src/nautilus-bookmark-list.c: (nautilus_bookmark_list_get_file_path): * src/nautilus-property-browser.c: (nautilus_property_browser_drag_data_get), (make_drag_image), (remove_color), (remove_background), (remove_emblem), (get_xml_path), (add_background_to_browser), (add_color_to_file), (emblem_dialog_clicked), (make_properties_from_directory): Change to use directory calls by new "get_" names. * src/Makefile.am: Removed nautilus.h since it is long gone, and fixed spelling of nautlus-window-state.h. * src/file-manager/.cvsignore: Stop ignoring things that we no longer generated. * src/file-manager/desktop-item.c: [removed] * src/file-manager/desktop-item.h: [removed] * src/file-manager/desktop-layout.c: [removed] * src/file-manager/desktop-layout.h: [removed] * src/file-manager/desktop-window.c: [removed] * src/file-manager/desktop-window.h: [removed] The rest of the code has been harvested from the desktop implementation. As I said before we can always recover it if we decide we want to reuse it. * src/file-manager/fm-main.c: [removed] This was no longer used and was getting out of date. The file manager is now compiled in rather than being a separate process. * src/nautilus-desktop-window.c: (nautilus_desktop_window_initialize_class), (nautilus_desktop_window_initialize), (nautilus_desktop_window_new), (realize): Another cut at the desktop code. Still not working too well, but way further along. * src/nautilus-sidebar.h: * src/nautilus-sidebar.c: * src/nautilus-view-frame.c: (nautilus_view_frame_handle_client_destroy_2): * src/nautilus-window-manage-views.c: * src/nautilus-window.h: * src/nautilus-window.c: * src/nautilus-window-private.h: Changed the names to use Sidebar instead of IndexPanel. Also changed to say sidebar panel instead of meta view in many places.
2000-05-31 15:53:21 +00:00
char * nautilus_make_path (const char *path,
const char *name);
Some build fixes. * acconfig.h: * configure.in: Removed the NAUTILUS_PREFIX that I added. I did it wrong. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_pixmap_file): * components/hardware/nautilus-hardware-view.c: (setup_overview_form): * components/services/startup/nautilus-view/nautilus-service-startup-view.c: (setup_form_title), (setup_signup_form), (setup_config_form): * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf): * libnautilus-extensions/nautilus-icon-factory.c: (make_full_icon_path): * src/nautilus-application.c: (display_caveat): * src/nautilus-property-browser.c: (nautilus_property_browser_initialize), (nautilus_emblem_dialog_new), (make_category_link): * src/nautilus-zoom-control.c: (nautilus_zoom_control_initialize): Replaced most uses of gnome_pixmap_file on "nautilus/" with a call to a new nautilus_pixmap_file in an attempt to make installations where nautilus has a different prefix from gnome-libs work. I now think this is a waste of time, but Mathieu Lacage says this is still an improvement. * components/help/Makefile.am: * components/help/hyperbola-filefmt.c: (fmt_map_entry): Use HYPERBOLA_DATADIR instead of NAUTILUS_PREFIX. * components/websearch/ntl-web-search.c: (web_search_populate_engines): Use WEB_SEARCH_DATADIR instead of NAUTILUS_PREFIX. * components/mozilla/nautilus-mozilla-content-view.c: (nautilus_mozilla_content_view_initialize), (mozilla_content_view_set_busy_cursor), (mozilla_content_view_request_progress_change), (mozilla_content_view_clear_busy_cursor), (mozilla_load_location_callback), (bonobo_mozilla_callback), (mozilla_merge_bonobo_items_callback), (mozilla_title_changed_callback), (mozilla_location_changed_callback), (mozilla_net_status_callback), (mozilla_link_message_callback), (mozilla_progress_callback), (mozilla_open_uri_callback): Took a cut at fixing the Mozilla component for the new API. Ramiro will have to take care of the rest. * components/services/install/lib/Makefile.am: * components/services/time/command-line/Makefile.am: * components/services/time/nautilus-view/Makefile.am: * components/services/time/service/Makefile.am: * components/services/trilobite/libtrilobite/Makefile.am: * components/services/trilobite/sample/command-line/Makefile.am: * components/services/trilobite/sample/service/Makefile.am: * libnautilus/Makefile.am: Updated all ORBit IDL compiles to use IDL_CFLAGS as suggested in the form of a patch by Martijn van Beers. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_user_main_directory), (nautilus_get_pixmap_directory): * libnautilus-extensions/nautilus-link-set.c: (get_link_set_document): * src/Makefile.am: * src/nautilus-property-browser.c: (nautilus_property_browser_drag_data_get), (make_drag_image), (get_xml_path), (make_properties_from_directory): * src/nautilus-link-set-window.c: (get_link_set_names): * src/file-manager/Makefile.am: * src/file-manager/fm-properties-window.c: (get_property_names): Used NAUTILUS_DATADIR and DATADIR instead of NAUTILUS_PREFIX. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_uri_from_local_path): Added a new helper function for use when you have a path and need a URI. This does a better job than just adding a "file://" on the front. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (get_first_callback), (nautilus_gtk_container_get_first_child): * src/nautilus-window-toolbars.c: (setup_button): * src/nautilus-window.c: (replace_special_current_view_in_content_view_menu): Implemented the first_child function and used it where appropriate. * libnautilus-extensions/nautilus-preferences-item.c: (add_icon_themes): Use nautilus_get_pixmap_directory intead of misusing gnome_pixmap_file by calling it on a directory name. * nautilus-installer/src/support.c: (create_pixmap), (create_image): Added FIXMEs since it isn't clear if this code will work with a Nautilus prefix that's not the same as the gnome-libs prefix. * Makefile.am: Tweaked white space.
2000-06-13 19:05:33 +00:00
/* 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.
*/
Small updates. * RENAMING: Small updates. * components/help/converters/gnome-info2html2/main.c: (main): * components/html/glibwww-init.c: (glibwww_parse_proxy_env): * components/html/ntl-web-browser.c: (main): * components/loser/content/nautilus-content-loser.c: (ensure_fail_env): * components/loser/sidebar/nautilus-sidebar-loser.c: (ensure_fail_env): * components/notes/nautilus-notes.c: (main): * libnautilus-extensions/nautilus-view-identifier.c: (get_lang_list): * src/nautilus-application.c: (nautilus_app_startup): * src/nautilus-main.c: (main): Changed from getenv to g_getenv, even though it makes no difference right now, because it's "the right thing to do (tm)". * components/services/time/nautilus-view/trilobite-eazel-time-view.h: Fixed include (the build was broken for me or anyone who doesn't have old .h files sitting around in their install directory). * libnautilus-extensions/nautilus-directory.c: (construct_alternate_metafile_uri): Use nautilus_get_user_directory instead of hard-coding the name of the user directory. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_user_directory), (nautilus_get_user_main_directory): Use #defines instead of global constants since these are things that do not change and this is not C++ :-) Added "get_" to the names of these functions so they would be verbs instead of nouns. (nautilus_get_desktop_directory): Added this new function for use by the desktop code. * libnautilus-extensions/nautilus-global-preferences.c: (global_preferences_create_dialog), (nautilus_global_preferences_get_enabled_sidebar_panel_view_identifiers), (nautilus_global_preferences_get_disabled_sidebar_panel_view_identifiers), (global_preferences_register_sidebar_panels_preferences_for_ui): * libnautilus-extensions/nautilus-view-identifier.h: * libnautilus-extensions/nautilus-view-identifier.c: (nautilus_view_identifier_list_free): * src/nautilus-applicable-views.c: (nautilus_navigation_info_free): Changed nautilus_view_identifier_free_list to *_list_free to match other calls with similar names. * libnautilus-extensions/nautilus-global-preferences.c: (user_level_changed_callback): * libnautilus-extensions/nautilus-icon-factory.c: (get_themed_icon_file_path): * src/file-manager/fm-properties-window.c: (get_property_names): * src/nautilus-bookmark-list.c: (nautilus_bookmark_list_get_file_path): * src/nautilus-property-browser.c: (nautilus_property_browser_drag_data_get), (make_drag_image), (remove_color), (remove_background), (remove_emblem), (get_xml_path), (add_background_to_browser), (add_color_to_file), (emblem_dialog_clicked), (make_properties_from_directory): Change to use directory calls by new "get_" names. * src/Makefile.am: Removed nautilus.h since it is long gone, and fixed spelling of nautlus-window-state.h. * src/file-manager/.cvsignore: Stop ignoring things that we no longer generated. * src/file-manager/desktop-item.c: [removed] * src/file-manager/desktop-item.h: [removed] * src/file-manager/desktop-layout.c: [removed] * src/file-manager/desktop-layout.h: [removed] * src/file-manager/desktop-window.c: [removed] * src/file-manager/desktop-window.h: [removed] The rest of the code has been harvested from the desktop implementation. As I said before we can always recover it if we decide we want to reuse it. * src/file-manager/fm-main.c: [removed] This was no longer used and was getting out of date. The file manager is now compiled in rather than being a separate process. * src/nautilus-desktop-window.c: (nautilus_desktop_window_initialize_class), (nautilus_desktop_window_initialize), (nautilus_desktop_window_new), (realize): Another cut at the desktop code. Still not working too well, but way further along. * src/nautilus-sidebar.h: * src/nautilus-sidebar.c: * src/nautilus-view-frame.c: (nautilus_view_frame_handle_client_destroy_2): * src/nautilus-window-manage-views.c: * src/nautilus-window.h: * src/nautilus-window.c: * src/nautilus-window-private.h: Changed the names to use Sidebar instead of IndexPanel. Also changed to say sidebar panel instead of meta view in many places.
2000-05-31 15:53:21 +00:00
const char *nautilus_get_user_directory (void);
const char *nautilus_get_user_main_directory (void);
const char *nautilus_get_desktop_directory (void);
Some build fixes. * acconfig.h: * configure.in: Removed the NAUTILUS_PREFIX that I added. I did it wrong. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_pixmap_file): * components/hardware/nautilus-hardware-view.c: (setup_overview_form): * components/services/startup/nautilus-view/nautilus-service-startup-view.c: (setup_form_title), (setup_signup_form), (setup_config_form): * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf): * libnautilus-extensions/nautilus-icon-factory.c: (make_full_icon_path): * src/nautilus-application.c: (display_caveat): * src/nautilus-property-browser.c: (nautilus_property_browser_initialize), (nautilus_emblem_dialog_new), (make_category_link): * src/nautilus-zoom-control.c: (nautilus_zoom_control_initialize): Replaced most uses of gnome_pixmap_file on "nautilus/" with a call to a new nautilus_pixmap_file in an attempt to make installations where nautilus has a different prefix from gnome-libs work. I now think this is a waste of time, but Mathieu Lacage says this is still an improvement. * components/help/Makefile.am: * components/help/hyperbola-filefmt.c: (fmt_map_entry): Use HYPERBOLA_DATADIR instead of NAUTILUS_PREFIX. * components/websearch/ntl-web-search.c: (web_search_populate_engines): Use WEB_SEARCH_DATADIR instead of NAUTILUS_PREFIX. * components/mozilla/nautilus-mozilla-content-view.c: (nautilus_mozilla_content_view_initialize), (mozilla_content_view_set_busy_cursor), (mozilla_content_view_request_progress_change), (mozilla_content_view_clear_busy_cursor), (mozilla_load_location_callback), (bonobo_mozilla_callback), (mozilla_merge_bonobo_items_callback), (mozilla_title_changed_callback), (mozilla_location_changed_callback), (mozilla_net_status_callback), (mozilla_link_message_callback), (mozilla_progress_callback), (mozilla_open_uri_callback): Took a cut at fixing the Mozilla component for the new API. Ramiro will have to take care of the rest. * components/services/install/lib/Makefile.am: * components/services/time/command-line/Makefile.am: * components/services/time/nautilus-view/Makefile.am: * components/services/time/service/Makefile.am: * components/services/trilobite/libtrilobite/Makefile.am: * components/services/trilobite/sample/command-line/Makefile.am: * components/services/trilobite/sample/service/Makefile.am: * libnautilus/Makefile.am: Updated all ORBit IDL compiles to use IDL_CFLAGS as suggested in the form of a patch by Martijn van Beers. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_user_main_directory), (nautilus_get_pixmap_directory): * libnautilus-extensions/nautilus-link-set.c: (get_link_set_document): * src/Makefile.am: * src/nautilus-property-browser.c: (nautilus_property_browser_drag_data_get), (make_drag_image), (get_xml_path), (make_properties_from_directory): * src/nautilus-link-set-window.c: (get_link_set_names): * src/file-manager/Makefile.am: * src/file-manager/fm-properties-window.c: (get_property_names): Used NAUTILUS_DATADIR and DATADIR instead of NAUTILUS_PREFIX. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_uri_from_local_path): Added a new helper function for use when you have a path and need a URI. This does a better job than just adding a "file://" on the front. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (get_first_callback), (nautilus_gtk_container_get_first_child): * src/nautilus-window-toolbars.c: (setup_button): * src/nautilus-window.c: (replace_special_current_view_in_content_view_menu): Implemented the first_child function and used it where appropriate. * libnautilus-extensions/nautilus-preferences-item.c: (add_icon_themes): Use nautilus_get_pixmap_directory intead of misusing gnome_pixmap_file by calling it on a directory name. * nautilus-installer/src/support.c: (create_pixmap), (create_image): Added FIXMEs since it isn't clear if this code will work with a Nautilus prefix that's not the same as the gnome-libs prefix. * Makefile.am: Tweaked white space.
2000-06-13 19:05:33 +00:00
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);
Some build fixes. * acconfig.h: * configure.in: Removed the NAUTILUS_PREFIX that I added. I did it wrong. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_pixmap_file): * components/hardware/nautilus-hardware-view.c: (setup_overview_form): * components/services/startup/nautilus-view/nautilus-service-startup-view.c: (setup_form_title), (setup_signup_form), (setup_config_form): * libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf): * libnautilus-extensions/nautilus-icon-factory.c: (make_full_icon_path): * src/nautilus-application.c: (display_caveat): * src/nautilus-property-browser.c: (nautilus_property_browser_initialize), (nautilus_emblem_dialog_new), (make_category_link): * src/nautilus-zoom-control.c: (nautilus_zoom_control_initialize): Replaced most uses of gnome_pixmap_file on "nautilus/" with a call to a new nautilus_pixmap_file in an attempt to make installations where nautilus has a different prefix from gnome-libs work. I now think this is a waste of time, but Mathieu Lacage says this is still an improvement. * components/help/Makefile.am: * components/help/hyperbola-filefmt.c: (fmt_map_entry): Use HYPERBOLA_DATADIR instead of NAUTILUS_PREFIX. * components/websearch/ntl-web-search.c: (web_search_populate_engines): Use WEB_SEARCH_DATADIR instead of NAUTILUS_PREFIX. * components/mozilla/nautilus-mozilla-content-view.c: (nautilus_mozilla_content_view_initialize), (mozilla_content_view_set_busy_cursor), (mozilla_content_view_request_progress_change), (mozilla_content_view_clear_busy_cursor), (mozilla_load_location_callback), (bonobo_mozilla_callback), (mozilla_merge_bonobo_items_callback), (mozilla_title_changed_callback), (mozilla_location_changed_callback), (mozilla_net_status_callback), (mozilla_link_message_callback), (mozilla_progress_callback), (mozilla_open_uri_callback): Took a cut at fixing the Mozilla component for the new API. Ramiro will have to take care of the rest. * components/services/install/lib/Makefile.am: * components/services/time/command-line/Makefile.am: * components/services/time/nautilus-view/Makefile.am: * components/services/time/service/Makefile.am: * components/services/trilobite/libtrilobite/Makefile.am: * components/services/trilobite/sample/command-line/Makefile.am: * components/services/trilobite/sample/service/Makefile.am: * libnautilus/Makefile.am: Updated all ORBit IDL compiles to use IDL_CFLAGS as suggested in the form of a patch by Martijn van Beers. * libnautilus-extensions/Makefile.am: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_user_main_directory), (nautilus_get_pixmap_directory): * libnautilus-extensions/nautilus-link-set.c: (get_link_set_document): * src/Makefile.am: * src/nautilus-property-browser.c: (nautilus_property_browser_drag_data_get), (make_drag_image), (get_xml_path), (make_properties_from_directory): * src/nautilus-link-set-window.c: (get_link_set_names): * src/file-manager/Makefile.am: * src/file-manager/fm-properties-window.c: (get_property_names): Used NAUTILUS_DATADIR and DATADIR instead of NAUTILUS_PREFIX. * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_get_uri_from_local_path): Added a new helper function for use when you have a path and need a URI. This does a better job than just adding a "file://" on the front. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (get_first_callback), (nautilus_gtk_container_get_first_child): * src/nautilus-window-toolbars.c: (setup_button): * src/nautilus-window.c: (replace_special_current_view_in_content_view_menu): Implemented the first_child function and used it where appropriate. * libnautilus-extensions/nautilus-preferences-item.c: (add_icon_themes): Use nautilus_get_pixmap_directory intead of misusing gnome_pixmap_file by calling it on a directory name. * nautilus-installer/src/support.c: (create_pixmap), (create_image): Added FIXMEs since it isn't clear if this code will work with a Nautilus prefix that's not the same as the gnome-libs prefix. * Makefile.am: Tweaked white space.
2000-06-13 19:05:33 +00:00
/* Turn a path into a "file://" URI. */
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);
#endif /* NAUTILUS_FILE_UTILITIES_H */