diff options
author | Darin Adler <darin@src.gnome.org> | 2001-10-28 20:21:52 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2001-10-28 20:21:52 +0000 |
commit | 5abcc1995419a91bebe2e42a5218a374e36533c3 (patch) | |
tree | 2f6c9699dc992039a973b0bd058aebfa2d820669 /libnautilus-private | |
parent | b36a91ca55636af4137615a88c6e70a6dffe7802 (diff) | |
download | nautilus-5abcc1995419a91bebe2e42a5218a374e36533c3.tar.gz |
More GNOME 2 work. We now compile up to libnautilus-private and I'm
* Lots of files:
More GNOME 2 work. We now compile up to libnautilus-private and
I'm working my way through the files in there. Also changed all
the initialize_class and initialize to class_init and init.
Diffstat (limited to 'libnautilus-private')
69 files changed, 802 insertions, 1834 deletions
diff --git a/libnautilus-private/Makefile.am b/libnautilus-private/Makefile.am index ffdf58b5d..5a0461b8c 100644 --- a/libnautilus-private/Makefile.am +++ b/libnautilus-private/Makefile.am @@ -6,10 +6,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_srcdir)/cut-n-paste-code/widgets/e-paned \ - $(NAUTILUS_PRIVATE_CFLAGS) \ - $(ESD_CFLAGS) \ - $(MEDUSA_CFLAGS) \ - $(LIBRSVG_CFLAGS) \ + $(LIBNAUTILUS_PRIVATE_CFLAGS) \ -DDATADIR=\""$(datadir)"\" \ -DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \ $(NULL) @@ -27,10 +24,7 @@ endif libnautilus_private_la_LDFLAGS = \ $(dependency_static_libs) \ - $(ESD_LIBS) \ - $(LIBJPEG) \ - $(MEDUSA_LIBS) \ - $(FAM_LIBS) \ + $(LIBNAUTILUS_PRIVATE_LIBS) \ $(CDDALIBADD) \ $(NULL) @@ -55,8 +49,6 @@ libnautilus_private_la_SOURCES = \ nautilus-directory-metafile.c \ nautilus-directory.c \ nautilus-drag-window.c \ - nautilus-druid-page-eazel.c \ - nautilus-druid.c \ nautilus-entry.c \ nautilus-file-changes-queue.c \ nautilus-file-dnd.c \ @@ -184,8 +176,8 @@ $(lib_LTLIBRARIES): $(dependency_static_libs) $(nautilus_metafile_server_idl_sources): nautilus_metafile_server_idl_stamp nautilus_metafile_server_idl_stamp: nautilus-metafile-server.idl $(ORBIT_IDL) - $(ORBIT_IDL) $(IDL_CFLAGS) $(srcdir)/nautilus-metafile-server.idl - touch nautilus_metafile_server_idl_stamp + $(ORBIT_IDL) -I$(top_srcdir) $(LIBNAUTILUS_PRIVATE_IDL_INCLUDES) $< + touch $@ $(libnautilus_private_la_OBJECTS): nautilus_metafile_server_idl_stamp diff --git a/libnautilus-private/nautilus-authn-manager.c b/libnautilus-private/nautilus-authn-manager.c index 57e5706d8..e40b3011d 100644 --- a/libnautilus-private/nautilus-authn-manager.c +++ b/libnautilus-private/nautilus-authn-manager.c @@ -251,7 +251,7 @@ vfs_authentication_callback (gconstpointer in, size_t in_size, } void -nautilus_authentication_manager_initialize (void) +nautilus_authentication_manager_init (void) { callback_cond = g_cond_new (); callback_mutex = g_mutex_new (); diff --git a/libnautilus-private/nautilus-authn-manager.h b/libnautilus-private/nautilus-authn-manager.h index f6c6ff42e..9db9feb7e 100644 --- a/libnautilus-private/nautilus-authn-manager.h +++ b/libnautilus-private/nautilus-authn-manager.h @@ -25,6 +25,6 @@ #ifndef NAUTILUS_AUTHN_MANAGER_H #define NAUTILUS_AUTHN_MANAGER_H -void nautilus_authentication_manager_initialize (void); +void nautilus_authentication_manager_init (void); #endif /* NAUTILUS_AUTHN_MANAGER_H */ diff --git a/libnautilus-private/nautilus-bonobo-extensions.c b/libnautilus-private/nautilus-bonobo-extensions.c index f4cc80391..1c38ff29a 100644 --- a/libnautilus-private/nautilus-bonobo-extensions.c +++ b/libnautilus-private/nautilus-bonobo-extensions.c @@ -32,7 +32,6 @@ #include <bonobo/bonobo-ui-util.h> #include <gtk/gtkmain.h> #include <libgnomevfs/gnome-vfs-utils.h> -#include <liboaf/oaf-async.h> struct NautilusBonoboActivationHandle { NautilusBonoboActivationHandle **early_completion_hook; @@ -548,7 +547,7 @@ activation_cancel (NautilusBonoboActivationHandle *handle) } static void -oaf_activation_callback (Bonobo_Unknown activated_object, +bonobo_activation_activation_callback (Bonobo_Unknown activated_object, const char *error_reason, gpointer callback_data) { @@ -591,8 +590,8 @@ nautilus_bonobo_activate_from_id (const char *iid, handle->callback = callback; handle->callback_data = callback_data; - oaf_activate_from_id_async ((char *) iid, 0, - oaf_activation_callback, + bonobo_activation_activate_from_id_async ((char *) iid, 0, + bonobo_activation_activation_callback, handle, NULL); if (handle != NULL) { diff --git a/libnautilus-private/nautilus-bookmark.c b/libnautilus-private/nautilus-bookmark.c index 3c16da5fe..48c125761 100644 --- a/libnautilus-private/nautilus-bookmark.c +++ b/libnautilus-private/nautilus-bookmark.c @@ -33,9 +33,7 @@ #include <eel/eel-vfs-extensions.h> #include <gtk/gtkaccellabel.h> #include <gtk/gtksignal.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-util.h> -#include <libgnomeui/gtkpixmapmenuitem.h> #include <libgnomevfs/gnome-vfs-types.h> #include <libgnomevfs/gnome-vfs-uri.h> #include <libgnomevfs/gnome-vfs-utils.h> @@ -61,8 +59,8 @@ struct NautilusBookmarkDetails static void nautilus_bookmark_connect_file (NautilusBookmark *file); static void nautilus_bookmark_disconnect_file (NautilusBookmark *file); -static void nautilus_bookmark_initialize_class (NautilusBookmarkClass *class); -static void nautilus_bookmark_initialize (NautilusBookmark *bookmark); +static void nautilus_bookmark_class_init (NautilusBookmarkClass *class); +static void nautilus_bookmark_init (NautilusBookmark *bookmark); static GtkWidget *create_pixmap_widget_for_bookmark (NautilusBookmark *bookmark); EEL_DEFINE_CLASS_BOILERPLATE (NautilusBookmark, nautilus_bookmark, GTK_TYPE_OBJECT) @@ -91,7 +89,7 @@ nautilus_bookmark_destroy (GtkObject *object) /* Initialization. */ static void -nautilus_bookmark_initialize_class (NautilusBookmarkClass *class) +nautilus_bookmark_class_init (NautilusBookmarkClass *class) { GtkObjectClass *object_class; @@ -100,27 +98,27 @@ nautilus_bookmark_initialize_class (NautilusBookmarkClass *class) object_class->destroy = nautilus_bookmark_destroy; signals[APPEARANCE_CHANGED] = - gtk_signal_new ("appearance_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusBookmarkClass, appearance_changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("appearance_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusBookmarkClass, appearance_changed), + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); signals[CONTENTS_CHANGED] = - gtk_signal_new ("contents_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusBookmarkClass, contents_changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + g_signal_new ("contents_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusBookmarkClass, contents_changed), + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); } static void -nautilus_bookmark_initialize (NautilusBookmark *bookmark) +nautilus_bookmark_init (NautilusBookmark *bookmark) { bookmark->details = g_new0 (NautilusBookmarkDetails, 1); } @@ -472,7 +470,7 @@ nautilus_bookmark_disconnect_file (NautilusBookmark *bookmark) if (bookmark->details->file != NULL) { gtk_signal_disconnect_by_func (GTK_OBJECT (bookmark->details->file), - bookmark_file_changed_callback, + G_CALLBACK (bookmark_file_changed_callback), bookmark); nautilus_file_unref (bookmark->details->file); bookmark->details->file = NULL; @@ -499,7 +497,7 @@ nautilus_bookmark_connect_file (NautilusBookmark *bookmark) gtk_signal_connect (GTK_OBJECT (bookmark->details->file), "changed", - bookmark_file_changed_callback, + G_CALLBACK (bookmark_file_changed_callback), bookmark); } @@ -572,12 +570,18 @@ nautilus_bookmark_menu_item_new (NautilusBookmark *bookmark) * user data. For now let's not let them be turn-offable and see if * anyone objects strenuously. */ +#if GNOME2_CONVERSION_COMPLETE menu_item = gtk_pixmap_menu_item_new (); +#else + menu_item = NULL; +#endif pixmap_widget = create_pixmap_widget_for_bookmark (bookmark); if (pixmap_widget != NULL) { gtk_widget_show (pixmap_widget); +#if GNOME2_CONVERSION_COMPLETE gtk_pixmap_menu_item_set_pixmap (GTK_PIXMAP_MENU_ITEM (menu_item), pixmap_widget); +#endif } display_name = eel_truncate_text_for_menu_item (bookmark->details->name); label = gtk_label_new (display_name); diff --git a/libnautilus-private/nautilus-customization-data.c b/libnautilus-private/nautilus-customization-data.c index db3ee6af5..bbd5a2e34 100644 --- a/libnautilus-private/nautilus-customization-data.c +++ b/libnautilus-private/nautilus-customization-data.c @@ -28,7 +28,6 @@ #include <config.h> #include <ctype.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-util.h> #include <libgnome/gnome-i18n.h> @@ -40,7 +39,6 @@ #include <gtk/gtk.h> #include <libgnomevfs/gnome-vfs.h> #include <string.h> -#include <libgnome/gnome-defs.h> #include <stdlib.h> #include "nautilus-customization-data.h" @@ -110,7 +108,7 @@ nautilus_customization_data_new (const char *customization_name, public_result = gnome_vfs_directory_list_load (&data->public_file_list, public_directory_uri, GNOME_VFS_FILE_INFO_GET_MIME_TYPE - | GNOME_VFS_FILE_INFO_FOLLOW_LINKS, NULL); + | GNOME_VFS_FILE_INFO_FOLLOW_LINKS); g_free (public_directory_uri); } @@ -118,7 +116,7 @@ nautilus_customization_data_new (const char *customization_name, private_result = gnome_vfs_directory_list_load (&data->private_file_list, private_directory_uri, GNOME_VFS_FILE_INFO_GET_MIME_TYPE - | GNOME_VFS_FILE_INFO_FOLLOW_LINKS, NULL); + | GNOME_VFS_FILE_INFO_FOLLOW_LINKS); g_free (private_directory_uri); if (public_result != GNOME_VFS_OK && private_result != GNOME_VFS_OK) { @@ -138,7 +136,7 @@ nautilus_customization_data_new (const char *customization_name, /* load the frame if necessary */ if (!strcmp(customization_name, "patterns")) { temp_str = nautilus_pixmap_file ("chit_frame.png"); - data->pattern_frame = gdk_pixbuf_new_from_file (temp_str); + data->pattern_frame = gdk_pixbuf_new_from_file (temp_str, NULL); g_free (temp_str); } else { data->pattern_frame = NULL; @@ -208,7 +206,7 @@ nautilus_customization_data_get_next_element_for_display (NautilusCustomizationD image_file_name = get_file_path_for_mode (data, current_file_info->name); - orig_pixbuf = gdk_pixbuf_new_from_file (image_file_name); + orig_pixbuf = gdk_pixbuf_new_from_file (image_file_name, NULL); g_free (image_file_name); is_reset_image = eel_strcmp(current_file_info->name, RESET_IMAGE_NAME) == 0; @@ -266,7 +264,7 @@ nautilus_customization_data_destroy (NautilusCustomizationData *data) gnome_vfs_file_info_list_free (data->private_file_list); if (data->name_map_hash != NULL) { - eel_g_hash_table_destroy_deep (data->name_map_hash); + g_hash_table_destroy (data->name_map_hash); } g_free (data->customization_name); @@ -454,7 +452,7 @@ load_name_map_hash_table (NautilusCustomizationData *data) xmlNodePtr category_node, current_node; /* allocate the hash table */ - data->name_map_hash = g_hash_table_new (g_str_hash, g_str_equal); + data->name_map_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); /* build the path name to the browser.xml file and load it */ xml_path = nautilus_make_path (NAUTILUS_DATADIR, "browser.xml"); @@ -465,14 +463,14 @@ load_name_map_hash_table (NautilusCustomizationData *data) if (browser_data) { /* get the category node */ category_node = eel_xml_get_root_child_by_name_and_property (browser_data, "category", "name", data->customization_name); - current_node = category_node->childs; + current_node = category_node->children; /* loop through the entries, adding a mapping to the hash table */ while (current_node != NULL) { display_name = eel_xml_get_property_translated (current_node, "display_name"); filename = xmlGetProp (current_node, "filename"); if (display_name && filename) { - g_hash_table_insert (data->name_map_hash, g_strdup (filename), g_strdup (display_name)); + g_hash_table_replace (data->name_map_hash, g_strdup (filename), g_strdup (display_name)); } xmlFree (filename); xmlFree (display_name); diff --git a/libnautilus-private/nautilus-desktop-file-loader.c b/libnautilus-private/nautilus-desktop-file-loader.c index 734afdf9f..2100e8fc4 100644 --- a/libnautilus-private/nautilus-desktop-file-loader.c +++ b/libnautilus-private/nautilus-desktop-file-loader.c @@ -1172,7 +1172,7 @@ nautilus_desktop_file_launch (NautilusDesktopFile *df) nautilus_desktop_file_get_string (df, NULL, "URL", &url); if (url != NULL) { - gnome_url_show (url); + gnome_url_show (url, NULL); } g_free (url); diff --git a/libnautilus-private/nautilus-directory-async.c b/libnautilus-private/nautilus-directory-async.c index 2ac0a4210..22f68093d 100644 --- a/libnautilus-private/nautilus-directory-async.c +++ b/libnautilus-private/nautilus-directory-async.c @@ -38,8 +38,6 @@ #include <ctype.h> #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include <libgnome/gnome-metadata.h> -#include <libgnome/gnome-mime-info.h> #include <gtk/gtkmain.h> #include <stdlib.h> #include <stdio.h> @@ -133,7 +131,7 @@ static void move_file_to_low_priority_queue (NautilusDirectory *directory static gboolean istr_equal (gconstpointer v, gconstpointer v2) { - return g_strcasecmp (v, v2) == 0; + return g_ascii_strcasecmp (v, v2) == 0; } static guint @@ -144,7 +142,7 @@ istr_hash (gconstpointer key) h = 0; for (p = key; *p != '\0'; p++) { - h = (h << 5) - h + tolower ((guchar) *p); + h = (h << 5) - h + g_ascii_tolower (*p); } return h; @@ -153,7 +151,7 @@ istr_hash (gconstpointer key) static GHashTable * istr_set_new (void) { - return g_hash_table_new (istr_hash, istr_equal); + return g_hash_table_new_full (istr_hash, istr_equal, g_free, NULL); } static void @@ -161,10 +159,8 @@ istr_set_insert (GHashTable *table, const char *istr) { char *key; - if (g_hash_table_lookup (table, istr) == NULL) { - key = g_strdup (istr); - g_hash_table_insert (table, key, key); - } + key = g_strdup (istr); + g_hash_table_replace (table, key, key); } static void @@ -189,7 +185,7 @@ istr_set_get_as_list (GHashTable *table) static void istr_set_destroy (GHashTable *table) { - eel_g_hash_table_destroy_deep (table); + g_hash_table_destroy (table); } /* Start a job. This is really just a way of limiting the number of @@ -676,6 +672,8 @@ set_file_unconfirmed (NautilusFile *file, gboolean unconfirmed) } } +#if GNOME2_CONVERSION_COMPLETE + static gboolean show_hidden_files = TRUE; static gboolean show_backup_files = TRUE; @@ -733,6 +731,8 @@ get_filter_options_for_directory_count (void) return filter_options; } +#endif + static void load_directory_state_destroy (NautilusDirectory *directory) { @@ -754,9 +754,6 @@ load_directory_state_destroy (NautilusDirectory *directory) nautilus_file_unref (file); } - - gnome_vfs_directory_filter_destroy (directory->details->load_file_count_filter); - directory->details->load_file_count_filter = NULL; } static void @@ -806,10 +803,11 @@ dequeue_pending_idle_callback (gpointer callback_data) * moving this into the actual callback instead of * waiting for the idle function. */ - if (gnome_vfs_directory_filter_apply (directory->details->load_file_count_filter, - file_info)) { - directory->details->load_file_count += 1; - } +#if GNOME2_CONVERSION_COMPLETE + /* if (gnome_vfs_directory_filter_apply (directory->details->load_file_count_filter, + file_info)) */ +#endif + directory->details->load_file_count += 1; /* Add the MIME type to the set. */ if ((file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE) != 0 @@ -1434,6 +1432,7 @@ nautilus_directory_get_info_for_new_files (NautilusDirectory *directory, vfs_uri_list, (GNOME_VFS_FILE_INFO_GET_MIME_TYPE | GNOME_VFS_FILE_INFO_FOLLOW_LINKS), + GNOME_VFS_PRIORITY_DEFAULT, new_files_callback, directory); @@ -1779,6 +1778,8 @@ mark_all_files_unconfirmed (NautilusDirectory *directory) } } +#if GNOME2_CONVERSION_COMPLETE + static gboolean should_display_file_name (const char *name, GnomeVFSDirectoryFilterOptions options) @@ -1842,6 +1843,8 @@ get_file_count_filter (NautilusDirectory *directory) NULL); } +#endif + /* Start monitoring the file list if it isn't already. */ static void start_monitoring_file_list (NautilusDirectory *directory) @@ -1869,7 +1872,9 @@ start_monitoring_file_list (NautilusDirectory *directory) directory->details->load_directory_file->details->loading_directory = TRUE; directory->details->load_file_count = 0; +#if GNOME2_CONVERSION_COMPLETE directory->details->load_file_count_filter = get_file_count_filter (directory); +#endif directory->details->load_mime_list_hash = istr_set_new (); #ifdef DEBUG_LOAD_DIRECTORY g_message ("load_directory called to monitor file list of %s", directory->details->uri); @@ -1879,11 +1884,8 @@ start_monitoring_file_list (NautilusDirectory *directory) directory->details->uri, /* uri */ (GNOME_VFS_FILE_INFO_GET_MIME_TYPE /* options */ | GNOME_VFS_FILE_INFO_FOLLOW_LINKS), - GNOME_VFS_DIRECTORY_FILTER_NONE, /* filter_type */ - (GNOME_VFS_DIRECTORY_FILTER_NOSELFDIR /* filter_options */ - | GNOME_VFS_DIRECTORY_FILTER_NOPARENTDIR), - NULL, /* filter_pattern */ DIRECTORY_LOAD_ITEMS_PER_CALLBACK, /* items_per_notification */ + GNOME_VFS_PRIORITY_DEFAULT, directory_load_callback, /* callback */ directory); } @@ -2102,10 +2104,8 @@ directory_count_start (NautilusDirectory *directory, (&directory->details->count_in_progress, uri, GNOME_VFS_FILE_INFO_DEFAULT, - GNOME_VFS_DIRECTORY_FILTER_NONE, - get_filter_options_for_directory_count (), - NULL, G_MAXINT, + GNOME_VFS_PRIORITY_DEFAULT, directory_count_callback, directory); g_free (uri); @@ -2213,11 +2213,8 @@ deep_count_load (NautilusDirectory *directory, const char *uri) (&directory->details->deep_count_in_progress, uri, GNOME_VFS_FILE_INFO_DEFAULT, - GNOME_VFS_DIRECTORY_FILTER_NONE, - (GNOME_VFS_DIRECTORY_FILTER_NOSELFDIR - | GNOME_VFS_DIRECTORY_FILTER_NOPARENTDIR), - NULL, G_MAXINT, + GNOME_VFS_PRIORITY_DEFAULT, deep_count_callback, directory); } @@ -2360,11 +2357,8 @@ mime_list_load (NautilusDirectory *directory, const char *uri) (&directory->details->mime_list_in_progress, uri, GNOME_VFS_FILE_INFO_GET_MIME_TYPE, - GNOME_VFS_DIRECTORY_FILTER_NONE, - (GNOME_VFS_DIRECTORY_FILTER_NOSELFDIR - | GNOME_VFS_DIRECTORY_FILTER_NOPARENTDIR), - NULL, DIRECTORY_LOAD_ITEMS_PER_CALLBACK, + GNOME_VFS_PRIORITY_DEFAULT, mime_list_callback, directory); } @@ -2558,6 +2552,7 @@ top_left_start (NautilusDirectory *directory, uri = nautilus_file_get_uri (file); directory->details->top_left_read_state->handle = eel_read_file_async (uri, + GNOME_VFS_PRIORITY_DEFAULT, top_left_read_callback, top_left_read_more_callback, directory); @@ -2687,6 +2682,7 @@ file_info_start (NautilusDirectory *directory, &fake_list, GNOME_VFS_FILE_INFO_GET_MIME_TYPE | GNOME_VFS_FILE_INFO_FOLLOW_LINKS, + GNOME_VFS_PRIORITY_DEFAULT, get_info_callback, directory); gnome_vfs_uri_unref (vfs_uri); @@ -2755,7 +2751,7 @@ link_info_nautilus_link_read_callback (GnomeVFSResult result, name = NULL; icon = NULL; } else { - /* The gnome-xml parser requires a zero-terminated array. */ + /* The libxml parser requires a zero-terminated array. */ buffer = g_realloc (file_contents, bytes_read + 1); buffer[bytes_read] = '\0'; uri = nautilus_link_get_link_uri_given_file_contents (buffer, bytes_read); @@ -2789,12 +2785,14 @@ link_info_gmc_link_read_callback (GnomeVFSResult result, nautilus_directory_ref (directory); + uri = NULL; + name = NULL; + icon = NULL; + icon_path = NULL; + /* Handle the case where we read the GMC link. */ if (result != GNOME_VFS_OK || !eel_str_has_prefix (file_contents, "URL: ")) { /* FIXME bugzilla.gnome.org 42433: We should report this error to the user. */ - uri = NULL; - name = NULL; - icon = NULL; } else { /* Make sure we don't run off the end of the buffer. */ end_of_line = memchr (file_contents, '\n', bytes_read); @@ -2811,21 +2809,29 @@ link_info_gmc_link_read_callback (GnomeVFSResult result, * have it here where the results will at least be cached than in * nautilus_file_get_display_name. */ +#if GNOME2_CONVERSION_COMPLETE res = gnome_metadata_get (path, "icon-name", &size, &name); + if (res != 0) { + name = NULL; + } +#else + size = 0; + res = -1; +#endif } else { res = -1; } - if (res != 0) { - name = NULL; - } - if (path != NULL) { /* FIXME: this gnome_metata_get call is synchronous, but better to * have it here where the results will at least be cached than in * nautilus_file_get_display_name. */ +#if GNOME2_CONVERSION_COMPLETE res = gnome_metadata_get (path, "icon-filename", &size, &icon_path); +#else + res = -1; +#endif } else { res = -1; } @@ -2954,18 +2960,21 @@ link_info_start (NautilusDirectory *directory, if (gmc_style_link) { directory->details->link_info_read_state->handle = eel_read_file_async (uri, + GNOME_VFS_PRIORITY_DEFAULT, link_info_gmc_link_read_callback, link_info_gmc_link_read_more_callback, directory); } else if (is_directory) { directory->details->link_info_read_state->handle = eel_read_entire_file_async (dot_directory_uri, + GNOME_VFS_PRIORITY_DEFAULT, link_info_nautilus_link_read_callback, directory); g_free (dot_directory_uri); } else { directory->details->link_info_read_state->handle = eel_read_entire_file_async (uri, + GNOME_VFS_PRIORITY_DEFAULT, link_info_nautilus_link_read_callback, directory); } diff --git a/libnautilus-private/nautilus-directory-background.c b/libnautilus-private/nautilus-directory-background.c index 72176fc04..2cf4b71f7 100644 --- a/libnautilus-private/nautilus-directory-background.c +++ b/libnautilus-private/nautilus-directory-background.c @@ -42,6 +42,9 @@ #include <libgnome/gnome-util.h> #include <libgnomevfs/gnome-vfs-utils.h> +/* FIXME: Is there a better way to do this? */ +extern char *_gdk_display_name; + static void background_changed_callback (EelBackground *background, NautilusFile *file); static void background_reset_callback (EelBackground *background, @@ -493,7 +496,7 @@ nautilus_file_background_event_filter (GdkXEvent *gdk_xevent, GdkEvent *event, g xevent = (XEvent *) gdk_xevent; - if (xevent->type == PropertyNotify && xevent->xproperty.atom == gdk_atom_intern("ESETROOT_PMAP_ID", TRUE)) { + if (xevent->type == PropertyNotify && xevent->xproperty.atom == gdk_x11_get_xatom_by_name ("ESETROOT_PMAP_ID")) { /* If we caused it, ignore it. */ @@ -545,7 +548,7 @@ nautilus_file_background_receive_root_window_changes (EelBackground *background) NULL); } -/* Create a persistant pixmap. We create a separate display +/* Create a persistent pixmap. We create a separate display * and set the closedown mode on it to RetainPermanent * (copied from gnome-source/control-panels/capplets/background-properties/render-background.c) */ @@ -557,7 +560,7 @@ make_root_pixmap (gint width, gint height) gdk_flush (); - display = XOpenDisplay (gdk_display_name); + display = XOpenDisplay (_gdk_display_name); XSetCloseDownMode (display, RetainPermanent); @@ -571,24 +574,6 @@ make_root_pixmap (gint width, gint height) return gdk_pixmap_foreign_new (result); } -/* (copied from gnome-source/control-panels/capplets/background-properties/render-background.c) - */ -static void -dispose_root_pixmap (GdkPixmap *pixmap) -{ - /* Unrefing a foreign pixmap causes it to be destroyed - so we include - * this bad hack, that will work for GTK+-1.2 until the problem - * is fixed in the next release - */ - - GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap; - - gdk_xid_table_remove (private->xwindow); - g_dataset_destroy (private); - g_free (private); - -} - /* Set the root pixmap, and properties pointing to it. We * do this atomically with XGrabServer to make sure that * we won't leak the pixmap if somebody else it setting @@ -605,14 +590,14 @@ set_root_pixmap (GdkPixmap *pixmap) gulong bytes_after; guchar *data_esetroot; Pixmap pixmap_id; - GdkAtom type; + Atom type; data_esetroot = NULL; XGrabServer (GDK_DISPLAY()); result = XGetWindowProperty (GDK_DISPLAY(), GDK_ROOT_WINDOW(), - gdk_atom_intern("ESETROOT_PMAP_ID", FALSE), + gdk_x11_get_xatom_by_name ("ESETROOT_PMAP_ID"), 0L, 1L, False, XA_PIXMAP, &type, &format, &nitems, &bytes_after, &data_esetroot); @@ -632,15 +617,15 @@ set_root_pixmap (GdkPixmap *pixmap) pixmap_id = GDK_WINDOW_XWINDOW (pixmap); XChangeProperty (GDK_DISPLAY(), GDK_ROOT_WINDOW(), - gdk_atom_intern("ESETROOT_PMAP_ID", FALSE), XA_PIXMAP, + gdk_x11_get_xatom_by_name ("ESETROOT_PMAP_ID"), XA_PIXMAP, 32, PropModeReplace, (guchar *) &pixmap_id, 1); XChangeProperty (GDK_DISPLAY(), GDK_ROOT_WINDOW(), - gdk_atom_intern("_XROOTPMAP_ID", FALSE), XA_PIXMAP, + gdk_x11_get_xatom_by_name ("_XROOTPMAP_ID"), XA_PIXMAP, 32, PropModeReplace, (guchar *) &pixmap_id, 1); - XSetWindowBackgroundPixmap (GDK_DISPLAY(), GDK_ROOT_WINDOW(), pixmap_id); + XSetWindowBackgroundPixmap (GDK_DISPLAY (), GDK_ROOT_WINDOW (), pixmap_id); XClearWindow (GDK_DISPLAY (), GDK_ROOT_WINDOW ()); XUngrabServer (GDK_DISPLAY()); @@ -678,14 +663,7 @@ image_loading_done_callback (EelBackground *background, gboolean successful_load gdk_window_set_back_pixmap (background_window, pixmap, FALSE); } - /* We'd like to simply unref pixmap here, but due to a bug in gdk's handling of - * foreign pixmaps, we can't - it would free the X resource. - * - * gdk_window_set_back_pixmap does not need the gdk pixmap object to stick around. - * It simply uses X resource inside it. dispose_root_pixmap free's the gdk object - * and not the X resource. - */ - dispose_root_pixmap (pixmap); + gdk_pixmap_unref (pixmap); } static void @@ -777,7 +755,7 @@ background_changed_callback (EelBackground *background, * try to change the background. */ gtk_signal_handler_block_by_func (GTK_OBJECT (file), - saved_settings_changed_callback, + G_CALLBACK (saved_settings_changed_callback), background); nautilus_file_set_metadata (file, @@ -792,7 +770,7 @@ background_changed_callback (EelBackground *background, /* Unblock the handler. */ gtk_signal_handler_unblock_by_func (GTK_OBJECT (file), - saved_settings_changed_callback, + G_CALLBACK (saved_settings_changed_callback), background); } @@ -840,7 +818,7 @@ initialize_background_from_settings (NautilusFile *file, * in the metadata so it doesn't try to change the metadata. */ gtk_signal_handler_block_by_func (GTK_OBJECT (background), - background_changed_callback, + G_CALLBACK (background_changed_callback), file); eel_background_set_color (background, color); @@ -849,7 +827,7 @@ initialize_background_from_settings (NautilusFile *file, /* Unblock the handler. */ gtk_signal_handler_unblock_by_func (GTK_OBJECT (background), - background_changed_callback, + G_CALLBACK (background_changed_callback), file); g_free (color); @@ -894,7 +872,7 @@ background_reset_callback (EelBackground *background, * try to change the background. */ gtk_signal_handler_block_by_func (GTK_OBJECT (file), - saved_settings_changed_callback, + G_CALLBACK (saved_settings_changed_callback), background); /* reset the metadata */ @@ -909,7 +887,7 @@ background_reset_callback (EelBackground *background, NULL); /* Unblock the handler. */ gtk_signal_handler_unblock_by_func (GTK_OBJECT (file), - saved_settings_changed_callback, + G_CALLBACK (saved_settings_changed_callback), background); } diff --git a/libnautilus-private/nautilus-directory-metafile-monitor.c b/libnautilus-private/nautilus-directory-metafile-monitor.c index 1188d011f..9b966ce21 100644 --- a/libnautilus-private/nautilus-directory-metafile-monitor.c +++ b/libnautilus-private/nautilus-directory-metafile-monitor.c @@ -47,7 +47,7 @@ static void corba_metafile_changed (PortableServer_Servant servant, static void corba_metafile_ready (PortableServer_Servant servant, CORBA_Environment *ev); -NAUTILUS_BONOBO_X_BOILERPLATE (NautilusMetafileMonitor, Nautilus_MetafileMonitor, BONOBO_X_OBJECT_TYPE, nautilus_metafile_monitor) +EEL_DEFINE_BONOBO_BOILERPLATE (NautilusMetafileMonitor, nautilus_metafile_monitor, BONOBO_OBJECT_TYPE) static void nautilus_metafile_monitor_class_init (NautilusMetafileMonitorClass *klass) diff --git a/libnautilus-private/nautilus-directory-metafile.c b/libnautilus-private/nautilus-directory-metafile.c index d375e0867..11429f83d 100644 --- a/libnautilus-private/nautilus-directory-metafile.c +++ b/libnautilus-private/nautilus-directory-metafile.c @@ -31,7 +31,7 @@ #include "nautilus-directory-metafile-monitor.h" #include "nautilus-metafile-server.h" #include <eel/eel-string.h> -#include <liboaf/liboaf.h> +#include <bonobo-activation/bonobo-activation.h> #include <stdio.h> static Nautilus_MetafileFactory factory = CORBA_OBJECT_NIL; @@ -61,7 +61,7 @@ die_on_failed_activation (const char *server_name, */ const char *details; - OAF_GeneralError *general_error; + Bonobo_GeneralError *general_error; switch (ev->_major) { case CORBA_NO_EXCEPTION: @@ -71,7 +71,7 @@ die_on_failed_activation (const char *server_name, case CORBA_SYSTEM_EXCEPTION: case CORBA_USER_EXCEPTION: details = CORBA_exception_id (ev); - if (strcmp (details, "IDL:OAF/GeneralError:1.0") == 0) { + if (strcmp (details, "IDL:Bonobo/GeneralError:1.0") == 0) { general_error = CORBA_exception_value (ev); details = general_error->description; } @@ -83,7 +83,7 @@ die_on_failed_activation (const char *server_name, } g_error ("Failed to activate the server %s; this may indicate a broken\n" - "Nautilus or OAF installation, or may reflect a bug in something,\n" + "Nautilus or Bonobo installation, or may reflect a bug in something,\n" "or may mean that your PATH or LD_LIBRARY_PATH or the like is\n" "incorrect. Nautilus will dump core and exit.\n" "Details: '%s'", server_name, details); @@ -99,7 +99,7 @@ get_factory (void) if (get_factory_from_oaf) { CORBA_exception_init (&ev); - factory = oaf_activate_from_id (METAFILE_FACTORY_IID, 0, + factory = bonobo_activation_activate_from_id (METAFILE_FACTORY_IID, 0, NULL, &ev); if (ev._major != CORBA_NO_EXCEPTION || factory == CORBA_OBJECT_NIL) { die_on_failed_activation ("Nautilus_MetafileFactory", &ev); diff --git a/libnautilus-private/nautilus-directory-private.h b/libnautilus-private/nautilus-directory-private.h index 0546990cf..e80ce6634 100644 --- a/libnautilus-private/nautilus-directory-private.h +++ b/libnautilus-private/nautilus-directory-private.h @@ -81,7 +81,6 @@ struct NautilusDirectoryDetails NautilusFile *load_directory_file; int load_file_count; - GnomeVFSDirectoryFilter *load_file_count_filter; GHashTable *load_mime_list_hash; GList *get_file_infos_in_progress; /* list of GnomeVFSAsyncHandle * */ diff --git a/libnautilus-private/nautilus-directory.c b/libnautilus-private/nautilus-directory.c index 8fd819f59..b352e2d8a 100644 --- a/libnautilus-private/nautilus-directory.c +++ b/libnautilus-private/nautilus-directory.c @@ -64,9 +64,9 @@ static guint signals[LAST_SIGNAL]; static GHashTable *directories; static void nautilus_directory_destroy (GtkObject *object); -static void nautilus_directory_initialize (gpointer object, +static void nautilus_directory_init (gpointer object, gpointer klass); -static void nautilus_directory_initialize_class (NautilusDirectoryClass *klass); +static void nautilus_directory_class_init (NautilusDirectoryClass *klass); static NautilusDirectory *nautilus_directory_new (const char *uri); static char * real_get_name_for_self_as_new_file (NautilusDirectory *directory); static void set_directory_uri (NautilusDirectory *directory, @@ -77,7 +77,7 @@ EEL_DEFINE_CLASS_BOILERPLATE (NautilusDirectory, GTK_TYPE_OBJECT) static void -nautilus_directory_initialize_class (NautilusDirectoryClass *klass) +nautilus_directory_class_init (NautilusDirectoryClass *klass) { GtkObjectClass *object_class; @@ -86,41 +86,43 @@ nautilus_directory_initialize_class (NautilusDirectoryClass *klass) object_class->destroy = nautilus_directory_destroy; signals[FILES_ADDED] = - gtk_signal_new ("files_added", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusDirectoryClass, files_added), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + g_signal_new ("files_added", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusDirectoryClass, files_added), + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[FILES_CHANGED] = - gtk_signal_new ("files_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusDirectoryClass, files_changed), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + g_signal_new ("files_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusDirectoryClass, files_changed), + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[DONE_LOADING] = - gtk_signal_new ("done_loading", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusDirectoryClass, done_loading), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("done_loading", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusDirectoryClass, done_loading), + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); signals[LOAD_ERROR] = - gtk_signal_new ("load_error", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusDirectoryClass, load_error), - gtk_marshal_NONE__INT, - GTK_TYPE_NONE, 1, GTK_TYPE_INT); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + g_signal_new ("load_error", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusDirectoryClass, load_error), + NULL, NULL, + gtk_marshal_NONE__INT, + G_TYPE_NONE, 1, GTK_TYPE_INT); klass->get_name_for_self_as_new_file = real_get_name_for_self_as_new_file; } static void -nautilus_directory_initialize (gpointer object, gpointer klass) +nautilus_directory_init (gpointer object, gpointer klass) { NautilusDirectory *directory; @@ -1562,7 +1564,7 @@ nautilus_directory_list_ref (GList *list) void nautilus_directory_list_unref (GList *list) { - eel_g_list_safe_for_each (list, (GFunc) nautilus_directory_unref, NULL); + g_list_foreach (list, (GFunc) nautilus_directory_unref, NULL); } /** diff --git a/libnautilus-private/nautilus-drag-window.c b/libnautilus-private/nautilus-drag-window.c index 0f039875e..fb83d7478 100644 --- a/libnautilus-private/nautilus-drag-window.c +++ b/libnautilus-private/nautilus-drag-window.c @@ -114,6 +114,8 @@ execute_pending_requests (GtkWindow *window, } } +#if GNOME2_CONVERSION_COMPLETE + /* Called when no button-press event arrived occurred shortly after * receiving a TAKE_FOCUS or RAISE_WINDOW request. So just commit * the pending requests. @@ -137,6 +139,8 @@ focus_timeout_callback (gpointer data) return FALSE; } +#endif + static void remove_focus_timeout (GtkWindow *window) { @@ -150,6 +154,8 @@ remove_focus_timeout (GtkWindow *window) } } +#if GNOME2_CONVERSION_COMPLETE + static void set_focus_timeout (GtkWindow *window) { @@ -165,10 +171,12 @@ set_focus_timeout (GtkWindow *window) } } +#endif + /* Called for all button-press events; sets the `in_button_press' flag */ static gboolean -button_press_emission_callback (GtkObject *object, guint signal_id, - guint n_params, GtkArg *params, +button_press_emission_callback (GSignalInvocationHint *ihint, + guint n_params, const GValue *params, gpointer data) { GtkWidget *window; @@ -178,7 +186,7 @@ button_press_emission_callback (GtkObject *object, guint signal_id, * otherwise we can get duped into counting unbalanced * press/release events, which isn't healthy */ - window = get_ancestor_blocked_by (GTK_WIDGET (object), + window = get_ancestor_blocked_by (GTK_WIDGET (g_value_get_object (¶ms[0])), GTK_TYPE_WINDOW, GTK_TYPE_MENU_SHELL); if (window != NULL) { @@ -204,14 +212,14 @@ button_press_emission_callback (GtkObject *object, guint signal_id, /* Called for button-release events; commits any pending focus/raise */ static gboolean -button_release_emission_callback (GtkObject *object, guint signal_id, - guint n_params, GtkArg *params, +button_release_emission_callback (GSignalInvocationHint *ihint, + guint n_params, const GValue *params, gpointer data) { GtkWidget *window; NautilusDragWindowDetails *details; - window = get_ancestor_blocked_by (GTK_WIDGET (object), + window = get_ancestor_blocked_by (GTK_WIDGET (g_value_get_object (¶ms[0])), GTK_TYPE_WINDOW, GTK_TYPE_MENU_SHELL); if (window != NULL) { @@ -230,14 +238,14 @@ button_release_emission_callback (GtkObject *object, guint signal_id, * widget emitting the signal, cancel any pending focus/raise requests */ static gboolean -drag_begin_emission_callback (GtkObject *object, guint signal_id, - guint n_params, GtkArg *params, +drag_begin_emission_callback (GSignalInvocationHint *ihint, + guint n_params, const GValue *params, gpointer data) { GtkWidget *window; NautilusDragWindowDetails *details; - window = gtk_widget_get_ancestor (GTK_WIDGET (object), + window = gtk_widget_get_ancestor (GTK_WIDGET (g_value_get_object (¶ms[0])), GTK_TYPE_WINDOW); if (window != NULL) { details = get_details (GTK_WINDOW (window)); @@ -250,6 +258,8 @@ drag_begin_emission_callback (GtkObject *object, guint signal_id, return TRUE; } +#if GNOME2_CONVERSION_COMPLETE + /* The process-wide filter for WM_PROTOCOLS client messages */ static GdkFilterReturn wm_protocols_filter (GdkXEvent *xev, GdkEvent *event, gpointer data) @@ -313,6 +323,8 @@ wm_protocols_filter (GdkXEvent *xev, GdkEvent *event, gpointer data) } } +#endif + static void nautilus_drag_window_destroy (GtkObject *object, gpointer data) { @@ -328,6 +340,7 @@ nautilus_drag_window_destroy (GtkObject *object, gpointer data) static void nautilus_drag_window_realize (GtkWidget *widget, gpointer data) { +#if GNOME2_CONVERSION_COMPLETE GdkAtom protocols[3]; /* Tell the window manager _not_ to focus this window by itself */ @@ -342,9 +355,9 @@ nautilus_drag_window_realize (GtkWidget *widget, gpointer data) protocols[1] = gdk_wm_take_focus; protocols[2] = sawfish_wm_raise_window; eel_gdk_window_set_wm_protocols (widget->window, protocols, 3); +#endif } - /* Public entry point */ /* initialize the instance's fields */ @@ -359,21 +372,18 @@ nautilus_drag_window_register (GtkWindow *window) if (!initialized) { /* Add emission hooks for the signals we need to monitor */ - signal_id = gtk_signal_lookup ("button_press_event", - GTK_TYPE_WIDGET); - gtk_signal_add_emission_hook (signal_id, - button_press_emission_callback, - NULL); - signal_id = gtk_signal_lookup ("button_release_event", - GTK_TYPE_WIDGET); - gtk_signal_add_emission_hook (signal_id, - button_release_emission_callback, - NULL); - signal_id = gtk_signal_lookup ("drag_begin", - GTK_TYPE_WIDGET); - gtk_signal_add_emission_hook (signal_id, - drag_begin_emission_callback, - NULL); + signal_id = g_signal_lookup ("button_press_event", + GTK_TYPE_WIDGET); + g_signal_add_emission_hook (signal_id, 0, + button_press_emission_callback, NULL, NULL); + signal_id = g_signal_lookup ("button_release_event", + GTK_TYPE_WIDGET); + g_signal_add_emission_hook (signal_id, 0, + button_release_emission_callback, NULL, NULL); + signal_id = g_signal_lookup ("drag_begin", + GTK_TYPE_WIDGET); + g_signal_add_emission_hook (signal_id, 0, + drag_begin_emission_callback, NULL, NULL); /* Intern the necessary X atoms */ @@ -381,11 +391,13 @@ nautilus_drag_window_register (GtkWindow *window) "_SAWFISH_WM_RAISE_WINDOW", False); +#if GNOME2_CONVERSION_COMPLETE /* Override the standard GTK filter for handling WM_PROTOCOLS * client messages */ gdk_add_client_message_filter (gdk_wm_protocols, wm_protocols_filter, NULL); +#endif initialized = TRUE; } @@ -397,7 +409,7 @@ nautilus_drag_window_register (GtkWindow *window) details, g_free); gtk_signal_connect (GTK_OBJECT (window), "realize", - nautilus_drag_window_realize, NULL); + G_CALLBACK (nautilus_drag_window_realize), NULL); gtk_signal_connect (GTK_OBJECT (window), "destroy", - nautilus_drag_window_destroy, NULL); + G_CALLBACK (nautilus_drag_window_destroy), NULL); } diff --git a/libnautilus-private/nautilus-druid-page-eazel.c b/libnautilus-private/nautilus-druid-page-eazel.c deleted file mode 100644 index 030bcb45f..000000000 --- a/libnautilus-private/nautilus-druid-page-eazel.c +++ /dev/null @@ -1,697 +0,0 @@ -/* gnome-druid-page-eazel.c - * Copyright (C) 1999 Red Hat, Inc. - * Copyright (C) 2000 Eazel, Inc. - * - * All rights reserved. - * - * This 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. - * - * 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library 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. - */ -/* - @NOTATION@ -*/ - -#include <config.h> - -#include "nautilus-druid-page-eazel.h" - -#include <eel/eel-gtk-macros.h> - -#include <libgnomeui/gnome-uidefs.h> -#include <libgnomeui/libgnomeui.h> -#include <libgnomeui/gnome-druid.h> -#include <libgnomeui/gnome-druid-page.h> - -#include <gdk-pixbuf/gnome-canvas-pixbuf.h> -#include "nautilus-druid.h" -#include <libgnome/gnome-i18n.h> - -#include "nautilus-file-utilities.h" - -struct NautilusDruidPageEazelDetails -{ - GnomeCanvasItem *background_item; - GnomeCanvasItem *background_image_item; - GnomeCanvasItem *topbar_image_item; - int topbar_image_width; - GnomeCanvasItem *topbar_image_stretch_item; - GnomeCanvasItem *title_item; - GtkWidget *title_label; - guint title_label_signal_id; - GnomeCanvasItem *text_item; - GnomeCanvasItem *sidebar_image_item; - GnomeCanvasItem *title_image_item; - GnomeCanvasItem *widget_item; -}; - -static void nautilus_druid_page_eazel_initialize (NautilusDruidPageEazel *druid_page_eazel); -static void nautilus_druid_page_eazel_initialize_class (NautilusDruidPageEazelClass *klass); -static void nautilus_druid_page_eazel_destroy (GtkObject *object); -static void nautilus_druid_page_eazel_finalize (GtkObject *object); -static void nautilus_druid_page_eazel_construct (NautilusDruidPageEazel *druid_page_eazel); -static void nautilus_druid_page_eazel_configure_size(NautilusDruidPageEazel *druid_page_eazel, - gint width, - gint height); -static void nautilus_druid_page_eazel_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static void nautilus_druid_page_eazel_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void nautilus_druid_page_eazel_prepare (GnomeDruidPage *page, - GtkWidget *druid, - gpointer *data); - -#define TITLE_X 60.0 -#define TITLE_Y 60.0 -#define CONTENT_PADDING 15.0 -#define DEFAULT_CONTENT_X 34.0 -#define DRUID_PAGE_MIN_HEIGHT 322 -#define DRUID_PAGE_MIN_WIDTH 516 -#define DRUID_PAGE_BORDER 24 - -EEL_DEFINE_CLASS_BOILERPLATE (NautilusDruidPageEazel, nautilus_druid_page_eazel, GNOME_TYPE_DRUID_PAGE) - -static void -nautilus_druid_page_eazel_initialize_class (NautilusDruidPageEazelClass *klass) -{ - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - - object_class = (GtkObjectClass*) klass; - widget_class = (GtkWidgetClass*) klass; - - parent_class = gtk_type_class (gnome_druid_page_get_type ()); - - object_class->destroy = nautilus_druid_page_eazel_destroy; - object_class->finalize = nautilus_druid_page_eazel_finalize; - - widget_class->size_allocate = nautilus_druid_page_eazel_size_allocate; - widget_class->size_request = nautilus_druid_page_eazel_size_request; -} - -static void -nautilus_druid_page_eazel_initialize (NautilusDruidPageEazel *druid_page_eazel) -{ - druid_page_eazel->details = g_new0(NautilusDruidPageEazelDetails, 1); - - /* Set up the canvas */ - gtk_container_set_border_width (GTK_CONTAINER (druid_page_eazel), 0); - gtk_widget_push_visual (gdk_rgb_get_visual ()); - gtk_widget_push_colormap (gdk_rgb_get_cmap ()); - druid_page_eazel->canvas = gnome_canvas_new_aa (); - gtk_widget_pop_visual (); - gtk_widget_pop_colormap (); - gtk_widget_show (druid_page_eazel->canvas); - gtk_container_add (GTK_CONTAINER (druid_page_eazel), druid_page_eazel->canvas); - nautilus_druid_page_eazel_configure_size (druid_page_eazel, - DRUID_PAGE_MIN_WIDTH, - DRUID_PAGE_MIN_HEIGHT); -} - -static void -nautilus_druid_page_eazel_destroy(GtkObject *object) -{ - NautilusDruidPageEazel *druid_page_eazel = - NAUTILUS_DRUID_PAGE_EAZEL(object); - - druid_page_eazel->canvas = NULL; - druid_page_eazel->widget = NULL; - - g_free (druid_page_eazel->title); - druid_page_eazel->title = NULL; - g_free (druid_page_eazel->text); - druid_page_eazel->text = NULL; - - if (druid_page_eazel->title_image != NULL) - gdk_pixbuf_unref (druid_page_eazel->title_image); - druid_page_eazel->title_image = NULL; - if (druid_page_eazel->sidebar_image != NULL) - gdk_pixbuf_unref (druid_page_eazel->sidebar_image); - druid_page_eazel->sidebar_image = NULL; - - if (druid_page_eazel->widget != NULL) - gtk_widget_unref (druid_page_eazel->widget); - druid_page_eazel->widget = NULL; - - /* Chain destroy */ - EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object)); -} - -static void -nautilus_druid_page_eazel_finalize (GtkObject *object) -{ - NautilusDruidPageEazel *druid_page_eazel = - NAUTILUS_DRUID_PAGE_EAZEL(object); - - g_free(druid_page_eazel->details); - druid_page_eazel->details = NULL; - - /* Chain finalize */ - EEL_CALL_PARENT (GTK_OBJECT_CLASS, finalize, (object)); -} - -static void -get_content_xy (NautilusDruidPageEazel *druid_page_eazel, - double *content_x, double *content_y) -{ - double title_height; - - if (druid_page_eazel->sidebar_image) { - *content_x = gdk_pixbuf_get_width (druid_page_eazel->sidebar_image); - } else { - *content_x = DEFAULT_CONTENT_X; - } - - if (druid_page_eazel->title_image) { - *content_y = gdk_pixbuf_get_height (druid_page_eazel->title_image) + TITLE_Y + CONTENT_PADDING; - } else { - *content_y = TITLE_Y; - } - - title_height = 0.0; - if (druid_page_eazel->title && druid_page_eazel->title[0] != '\0') { - gtk_object_get (GTK_OBJECT (druid_page_eazel->details->title_item), - "height", &title_height, - NULL); - title_height += CONTENT_PADDING; - } - - if (*content_y < title_height + TITLE_Y) { - *content_y = title_height + TITLE_Y; - } -} - - -static void -nautilus_druid_page_eazel_configure_size (NautilusDruidPageEazel *druid_page_eazel, gint width, gint height) -{ - double content_x; - double content_y; - - g_return_if_fail (druid_page_eazel != NULL); - g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel)); - - get_content_xy (druid_page_eazel, &content_x, &content_y); - - gnome_canvas_set_scroll_region (GNOME_CANVAS (druid_page_eazel->canvas), - 0.0, 0.0, width, height); - - if (druid_page_eazel->details->background_item != NULL) { - gnome_canvas_item_set (druid_page_eazel->details->background_item, - "x1", 0.0, - "y1", 0.0, - "x2", (gfloat) width, - "y2", (gfloat) height, - NULL); - } - - if (druid_page_eazel->details->topbar_image_stretch_item != NULL) { - gnome_canvas_item_set (druid_page_eazel->details->topbar_image_stretch_item, - "width", (double) (width - druid_page_eazel->details->topbar_image_width), - "width_set", TRUE, - NULL); - } - - if (druid_page_eazel->details->widget_item != NULL) { - gnome_canvas_item_set (druid_page_eazel->details->widget_item, - "x", content_x, - "y", content_y, - NULL); - - /* Event boxes can handle not having the size set, and - * not doing so allows them to scale with their child - * widget. On the other hand, some other widgets require - * the size to be set, otherwise they won't appear on the - * canvas! - */ - if (druid_page_eazel->widget != NULL && !GTK_IS_EVENT_BOX (druid_page_eazel->widget)) { - gnome_canvas_item_set (druid_page_eazel->details->widget_item, - "width", (gfloat) width - content_x, - "height", (gfloat) height - content_y, - NULL); - } - } - - if (druid_page_eazel->details->text_item != NULL) { - gnome_canvas_item_set (druid_page_eazel->details->text_item, - "x", content_x, - "y", content_y, - NULL); - } -} - -static void -set_image (GnomeCanvasItem *item, const char *file, - int *width, int *height) -{ - char *fullname; - - if (width != NULL) - *width = 0; - if (height != NULL) - *height = 0; - - fullname = nautilus_pixmap_file (file); - if (fullname != NULL) { - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (fullname); - if (pixbuf != NULL) { - if (width != NULL) - *width = gdk_pixbuf_get_width (pixbuf); - if (height != NULL) - *height = gdk_pixbuf_get_height (pixbuf); - gnome_canvas_item_set (item, - "pixbuf", pixbuf, - NULL); - gdk_pixbuf_unref (pixbuf); - } - g_free (fullname); - } -} - -static void -title_label_size_allocated (GtkWidget *widget, GtkAllocation *allocation, gpointer data) -{ - NautilusDruidPageEazel *druid_page_eazel = NAUTILUS_DRUID_PAGE_EAZEL (data); - gnome_canvas_item_set (druid_page_eazel->details->title_item, - "size_pixels", TRUE, - "height", (double) allocation->height, - "width", (double) allocation->width, - NULL); -} - - -static void -nautilus_druid_page_eazel_construct (NautilusDruidPageEazel *druid_page_eazel) -{ - druid_page_eazel->details->background_item = - gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)), - gnome_canvas_rect_get_type (), - "x1", 0.0, - "y1", 0.0, - "fill_color", "white", - NULL); - - druid_page_eazel->details->background_image_item = - gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)), - gnome_canvas_pixbuf_get_type (), - "x", 0.0, - "y", 0.0, - "x_in_pixels", TRUE, - "y_in_pixels", TRUE, - NULL); - if (druid_page_eazel->background_image) - gnome_canvas_item_set (druid_page_eazel->details->background_image_item, - "pixbuf", druid_page_eazel->background_image, - NULL); - - druid_page_eazel->details->sidebar_image_item = - gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)), - gnome_canvas_pixbuf_get_type (), - "x", 0.0, - "y", 0.0, - "x_in_pixels", TRUE, - "y_in_pixels", TRUE, - NULL); - if (druid_page_eazel->sidebar_image) - gnome_canvas_item_set (druid_page_eazel->details->sidebar_image_item, - "pixbuf", druid_page_eazel->sidebar_image, - NULL); - - druid_page_eazel->details->topbar_image_item = - gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)), - gnome_canvas_pixbuf_get_type (), - "x", 0.0, - "y", 0.0, - "x_in_pixels", TRUE, - "y_in_pixels", TRUE, - NULL); - set_image (druid_page_eazel->details->topbar_image_item, - "druid_header.png", - &druid_page_eazel->details->topbar_image_width, - NULL); - - druid_page_eazel->details->topbar_image_stretch_item = - gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)), - gnome_canvas_pixbuf_get_type (), - "x", (double)druid_page_eazel->details->topbar_image_width, - "y", 0.0, - "x_in_pixels", TRUE, - "y_in_pixels", TRUE, - NULL); - set_image (druid_page_eazel->details->topbar_image_stretch_item, - "druid_header_stretch.png", NULL, NULL); - - druid_page_eazel->details->title_image_item = - gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)), - gnome_canvas_pixbuf_get_type (), - "x", TITLE_X, - "y", TITLE_Y, - "x_in_pixels", TRUE, - "y_in_pixels", TRUE, - NULL); - if (druid_page_eazel->title_image) - gnome_canvas_item_set (druid_page_eazel->details->title_image_item, - "pixbuf", druid_page_eazel->title_image, - NULL); - - druid_page_eazel->details->title_item = - gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)), - gnome_canvas_widget_get_type (), - "x", TITLE_X, - "y", TITLE_Y, - NULL); - - druid_page_eazel->details->text_item = - gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)), - gnome_canvas_text_get_type (), - "text", druid_page_eazel->text, - "fill_color", "black", - /* Note to localizers: this font is used for text items in Druid pages */ - "fontset", _("-adobe-helvetica-bold-r-normal-*-*-120-*-*-p-*-*-*,*-r-*"), - "anchor", GTK_ANCHOR_NW, - NULL); - - nautilus_druid_page_eazel_configure_size (druid_page_eazel, DRUID_PAGE_MIN_WIDTH, DRUID_PAGE_MIN_HEIGHT); - gtk_signal_connect (GTK_OBJECT (druid_page_eazel), - "prepare", - nautilus_druid_page_eazel_prepare, - NULL); -} - -static void -nautilus_druid_page_eazel_prepare (GnomeDruidPage *page, - GtkWidget *druid, - gpointer *data) -{ - switch (NAUTILUS_DRUID_PAGE_EAZEL (page)->position) { - case NAUTILUS_DRUID_PAGE_EAZEL_START: - gnome_druid_set_buttons_sensitive (GNOME_DRUID (druid), FALSE, TRUE, TRUE); - gnome_druid_set_show_finish (GNOME_DRUID (druid), FALSE); - gtk_widget_grab_default (GNOME_DRUID (druid)->next); - break; - case NAUTILUS_DRUID_PAGE_EAZEL_FINISH: - gnome_druid_set_buttons_sensitive (GNOME_DRUID (druid), TRUE, FALSE, TRUE); - gnome_druid_set_show_finish (GNOME_DRUID (druid), TRUE); - gtk_widget_grab_default (GNOME_DRUID (druid)->finish); - break; - case NAUTILUS_DRUID_PAGE_EAZEL_OTHER: - gnome_druid_set_buttons_sensitive (GNOME_DRUID (druid), TRUE, TRUE, TRUE); - gnome_druid_set_show_finish (GNOME_DRUID (druid), FALSE); - default: - break; - } -} - - -static void -nautilus_druid_page_eazel_size_allocate(GtkWidget *widget, - GtkAllocation *allocation) -{ - EEL_CALL_PARENT (GTK_WIDGET_CLASS, size_allocate, - (widget, allocation)); - - gnome_canvas_set_scroll_region (GNOME_CANVAS (NAUTILUS_DRUID_PAGE_EAZEL (widget)->canvas), - 0.0, 0.0, - allocation->width, - allocation->height); - - nautilus_druid_page_eazel_configure_size (NAUTILUS_DRUID_PAGE_EAZEL (widget), - allocation->width, - allocation->height); -} - -static void -nautilus_druid_page_eazel_size_request(GtkWidget *widget, - GtkRequisition *requisition) -{ - NautilusDruidPageEazel *druid_page_eazel; - - druid_page_eazel = NAUTILUS_DRUID_PAGE_EAZEL (widget); - - EEL_CALL_PARENT (GTK_WIDGET_CLASS, size_request, - (widget, requisition)); - - if (druid_page_eazel->widget) { - GtkRequisition child_requisition; - double x, y; - - g_assert (druid_page_eazel->details->widget_item != NULL); - - get_content_xy (druid_page_eazel, &x, &y); - - gtk_widget_get_child_requisition (druid_page_eazel->widget, - &child_requisition); - - if (child_requisition.width + x > requisition->width) { - requisition->width = child_requisition.width + x + DRUID_PAGE_BORDER; - } - if (child_requisition.height + y > requisition->height) { - requisition->height = child_requisition.height + y + DRUID_PAGE_BORDER; - } - } -} - - -/** - * nautilus_druid_page_eazel_new: - * - * Creates a new NautilusDruidPageEazel widget. - * - * Return value: Pointer to new NautilusDruidPageEazel - **/ -/* Public functions */ -GtkWidget * -nautilus_druid_page_eazel_new (NautilusDruidPageEazelPosition position) -{ - NautilusDruidPageEazel *page; - - page = NAUTILUS_DRUID_PAGE_EAZEL (gtk_widget_new (nautilus_druid_page_eazel_get_type (), NULL)); - - page->position = position; - page->title = g_strdup (""); - page->text = g_strdup (""); - page->title_image = NULL; - page->sidebar_image = NULL; - page->background_image = NULL; - nautilus_druid_page_eazel_construct (page); - - return GTK_WIDGET (page); -} -/** - * nautilus_druid_page_eazel_new_with_vals: - * @title: The title. - * @text: The introduction text. - * @logo: The logo in the upper right corner. - * @watermark: The watermark on the left. - * - * This will create a new GNOME Druid Eazel page, with the values - * given. It is acceptable for any of them to be %NULL. - * - * Return value: GtkWidget pointer to new NautilusDruidPageEazel. - **/ -GtkWidget * -nautilus_druid_page_eazel_new_with_vals (NautilusDruidPageEazelPosition position, - const gchar *title, - const gchar* text, - GdkPixbuf *title_image, - GdkPixbuf *sidebar_image, - GdkPixbuf *background_image) -{ - NautilusDruidPageEazel *page; - - page = NAUTILUS_DRUID_PAGE_EAZEL (gtk_widget_new (nautilus_druid_page_eazel_get_type (), NULL)); - - page->position = position; - page->title = g_strdup (title ? title : ""); - page->text = g_strdup (text ? text : ""); - - if (title_image) - gdk_pixbuf_ref (title_image); - page->title_image = title_image; - - if (sidebar_image) - gdk_pixbuf_ref (sidebar_image); - page->sidebar_image = sidebar_image; - - if (background_image) - gdk_pixbuf_ref (background_image); - page->background_image = background_image; - - nautilus_druid_page_eazel_construct (page); - - return GTK_WIDGET (page); -} - -void -nautilus_druid_page_eazel_set_text (NautilusDruidPageEazel *druid_page_eazel, - const gchar *text) -{ - g_return_if_fail (druid_page_eazel != NULL); - g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel)); - - g_free (druid_page_eazel->text); - druid_page_eazel->text = g_strdup (text ? text : ""); - gnome_canvas_item_set (druid_page_eazel->details->text_item, - "text", druid_page_eazel->text, - NULL); -} - -static GtkWidget * -make_title_label (const char *text) -{ - GtkWidget *label; - GtkStyle *new_style; - GdkFont *font; - - label = gtk_label_new (text); - - /* Note to localizers: this font is used for page titles in Druid pages */ - font = gdk_fontset_load (_("-adobe-helvetica-bold-r-normal-*-*-180-*-*-p-*-*-*,*-r-*")); - if (font != NULL) { - new_style = gtk_style_copy (gtk_widget_get_style (label)); - gdk_font_unref (new_style->font); - new_style->font = font; - gtk_widget_set_style (label, new_style); - gtk_style_unref (new_style); - } - - return label; -} - -void -nautilus_druid_page_eazel_set_title (NautilusDruidPageEazel *druid_page_eazel, - const gchar *title) -{ - GtkWidget *label; - - g_return_if_fail (druid_page_eazel != NULL); - g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel)); - - g_free (druid_page_eazel->title); - druid_page_eazel->title = g_strdup (title ? title : ""); - - if (druid_page_eazel->details->title_label == NULL) { - label = make_title_label (druid_page_eazel->title); - nautilus_druid_page_eazel_set_title_label (druid_page_eazel, GTK_LABEL (label)); - } else { - gtk_label_set_text (GTK_LABEL (druid_page_eazel->details->title_label), druid_page_eazel->title); - } -} - -void -nautilus_druid_page_eazel_set_title_label (NautilusDruidPageEazel *druid_page_eazel, - GtkLabel *label) -{ - g_return_if_fail (druid_page_eazel != NULL); - g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel)); - g_return_if_fail (GTK_IS_LABEL (label)); - - if (druid_page_eazel->details->title_label != NULL) { - gtk_signal_disconnect (GTK_OBJECT (druid_page_eazel->details->title_label), - druid_page_eazel->details->title_label_signal_id); - } - - gtk_widget_show (GTK_WIDGET (label)); - gnome_canvas_item_set (druid_page_eazel->details->title_item, - "widget", label, - NULL); - druid_page_eazel->details->title_label = GTK_WIDGET (label); - druid_page_eazel->details->title_label_signal_id = - gtk_signal_connect (GTK_OBJECT (label), "size_allocate", - title_label_size_allocated, - druid_page_eazel); - - if (druid_page_eazel->title != NULL) { - g_free (druid_page_eazel->title); - } - druid_page_eazel->title = g_strdup (label->label); -} - -void -nautilus_druid_page_eazel_set_title_image (NautilusDruidPageEazel *druid_page_eazel, - GdkPixbuf *title_image) -{ - g_return_if_fail (druid_page_eazel != NULL); - g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel)); - - if (druid_page_eazel->title_image) - gdk_pixbuf_unref (druid_page_eazel->title_image); - - druid_page_eazel->title_image = title_image; - if (title_image != NULL) - gdk_pixbuf_ref (title_image); - gnome_canvas_item_set (druid_page_eazel->details->title_image_item, - "pixbuf", druid_page_eazel->title_image, NULL); -} - -void -nautilus_druid_page_eazel_set_sidebar_image (NautilusDruidPageEazel *druid_page_eazel, - GdkPixbuf *sidebar_image) -{ - g_return_if_fail (druid_page_eazel != NULL); - g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel)); - - if (druid_page_eazel->sidebar_image) - gdk_pixbuf_unref (druid_page_eazel->sidebar_image); - - druid_page_eazel->sidebar_image = sidebar_image; - if (sidebar_image != NULL) - gdk_pixbuf_ref (sidebar_image); - gnome_canvas_item_set (druid_page_eazel->details->sidebar_image_item, - "pixbuf", druid_page_eazel->sidebar_image, NULL); -} - -void -nautilus_druid_page_eazel_set_background_image (NautilusDruidPageEazel *druid_page_eazel, - GdkPixbuf *background_image) -{ - g_return_if_fail (druid_page_eazel != NULL); - g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel)); - - if (druid_page_eazel->background_image) - gdk_pixbuf_unref (druid_page_eazel->background_image); - - druid_page_eazel->background_image = background_image; - if (background_image != NULL) - gdk_pixbuf_ref (background_image); - gnome_canvas_item_set (druid_page_eazel->details->background_image_item, - "pixbuf", druid_page_eazel->background_image, NULL); -} - -void -nautilus_druid_page_eazel_put_widget (NautilusDruidPageEazel *druid_page_eazel, - GtkWidget *widget) -{ - g_return_if_fail (druid_page_eazel != NULL); - g_return_if_fail (NAUTILUS_IS_DRUID_PAGE_EAZEL (druid_page_eazel)); - - if (druid_page_eazel->details->widget_item != NULL) { - gtk_object_destroy (GTK_OBJECT (druid_page_eazel->details->widget_item)); - } - if (druid_page_eazel->widget != NULL) { - gtk_widget_unref (druid_page_eazel->widget); - } - - druid_page_eazel->widget = widget; - if (widget != NULL) - gtk_widget_ref (widget); - - druid_page_eazel->details->widget_item = - gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (druid_page_eazel->canvas)), - gnome_canvas_widget_get_type (), - "widget", widget, - NULL); - - gtk_widget_queue_resize (GTK_WIDGET (druid_page_eazel)); -} diff --git a/libnautilus-private/nautilus-druid-page-eazel.h b/libnautilus-private/nautilus-druid-page-eazel.h deleted file mode 100644 index d0e51cfd9..000000000 --- a/libnautilus-private/nautilus-druid-page-eazel.h +++ /dev/null @@ -1,100 +0,0 @@ -/* nautilus-druid-page-eazel.h - * Copyright (C) 1999 Red Hat, Inc. - * - * All rights reserved. - * - * This 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. - * - * 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library 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. - */ -/* - @NOTATION@ -*/ -#ifndef NAUTILUS_DRUID_PAGE_EAZEL_H -#define NAUTILUS_DRUID_PAGE_EAZEL_H - -#include <libgnomeui/gnome-canvas.h> -#include <libgnomeui/gnome-druid-page.h> -#include <gdk-pixbuf/gdk-pixbuf.h> - -G_BEGIN_DECLS - -#define NAUTILUS_TYPE_DRUID_PAGE_EAZEL (nautilus_druid_page_eazel_get_type ()) -#define NAUTILUS_DRUID_PAGE_EAZEL(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_DRUID_PAGE_EAZEL, NautilusDruidPageEazel)) -#define NAUTILUS_DRUID_PAGE_EAZEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_DRUID_PAGE_EAZEL, NautilusDruidPageEazelClass)) -#define NAUTILUS_IS_DRUID_PAGE_EAZEL(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_DRUID_PAGE_EAZEL)) -#define NAUTILUS_IS_DRUID_PAGE_EAZEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_DRUID_PAGE_EAZEL)) - -typedef enum { - /* update structure when adding enums */ - NAUTILUS_DRUID_PAGE_EAZEL_START, - NAUTILUS_DRUID_PAGE_EAZEL_FINISH, - NAUTILUS_DRUID_PAGE_EAZEL_OTHER -} NautilusDruidPageEazelPosition; - - -typedef struct NautilusDruidPageEazel NautilusDruidPageEazel; -typedef struct NautilusDruidPageEazelDetails NautilusDruidPageEazelDetails; -typedef struct NautilusDruidPageEazelClass NautilusDruidPageEazelClass; - -struct NautilusDruidPageEazel -{ - GnomeDruidPage parent; - - GtkWidget *canvas; - char *title; - char *text; - GdkPixbuf *title_image; - GdkPixbuf *sidebar_image; - GdkPixbuf *background_image; - - GtkWidget *widget; - - NautilusDruidPageEazelPosition position : 2; - - /*< private >*/ - NautilusDruidPageEazelDetails *details; -}; - -struct NautilusDruidPageEazelClass -{ - GnomeDruidPageClass parent_class; -}; - -GtkType nautilus_druid_page_eazel_get_type (void); -GtkWidget *nautilus_druid_page_eazel_new (NautilusDruidPageEazelPosition position); -GtkWidget *nautilus_druid_page_eazel_new_with_vals (NautilusDruidPageEazelPosition position, - const gchar *title, - const gchar *text, - GdkPixbuf *title_image, - GdkPixbuf *sidebar_image, - GdkPixbuf *background_image); -void nautilus_druid_page_eazel_put_widget (NautilusDruidPageEazel *druid_page_eazel, - GtkWidget *widget); -void nautilus_druid_page_eazel_set_text (NautilusDruidPageEazel *druid_page_eazel, - const gchar *text); -void nautilus_druid_page_eazel_set_title (NautilusDruidPageEazel *druid_page_eazel, - const gchar *title); -void nautilus_druid_page_eazel_set_title_label (NautilusDruidPageEazel *druid_page_eazel, - GtkLabel *label); -void nautilus_druid_page_eazel_set_title_image (NautilusDruidPageEazel *druid_page_eazel, - GdkPixbuf *title_image); -void nautilus_druid_page_eazel_set_sidebar_image (NautilusDruidPageEazel *druid_page_eazel, - GdkPixbuf *sidebar_image); -void nautilus_druid_page_eazel_set_background_image(NautilusDruidPageEazel *druid_page_eazel, - GdkPixbuf *background_image); - -G_END_DECLS - -#endif /* NAUTILUS_DRUID_PAGE_EAZEL_H */ diff --git a/libnautilus-private/nautilus-druid.c b/libnautilus-private/nautilus-druid.c deleted file mode 100644 index 49eeff81d..000000000 --- a/libnautilus-private/nautilus-druid.c +++ /dev/null @@ -1,204 +0,0 @@ -/* gnome-druid.c - * Copyright (C) 1999 Red Hat, Inc. - * Copyright (C) 2000 Eazel, Inc. - * All rights reserved. - * - * This 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. - * - * 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library 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. - */ -/* - @NOTATION@ -*/ -#include <config.h> - -#include "nautilus-druid.h" -#include <libgnomeui/gnome-stock.h> -#include <libgnomeui/gnome-uidefs.h> -#include <libgnome/gnome-i18n.h> - -#include <eel/eel-gtk-macros.h> - -static void nautilus_druid_initialize (NautilusDruid *druid); -static void nautilus_druid_initialize_class(NautilusDruidClass *klass); -static void nautilus_druid_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void nautilus_druid_size_allocate(GtkWidget *widget, - GtkAllocation *allocation); - -EEL_DEFINE_CLASS_BOILERPLATE (NautilusDruid, nautilus_druid, GNOME_TYPE_DRUID) - -static void -nautilus_druid_initialize_class (NautilusDruidClass *klass) -{ - GtkWidgetClass *widget_class; - - widget_class = (GtkWidgetClass*) klass; - - parent_class = gtk_type_class (gtk_container_get_type ()); - - widget_class->size_request = nautilus_druid_size_request; - widget_class->size_allocate = nautilus_druid_size_allocate; -} - -static void -nautilus_druid_initialize (NautilusDruid *druid) -{ -} - -static void -nautilus_druid_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - guint16 temp_width, temp_height; - GList *list; - GnomeDruid *druid; - GtkRequisition child_requisition; - GnomeDruidPage *child; - int border; - - g_return_if_fail (widget != NULL); - g_return_if_fail (NAUTILUS_IS_DRUID (widget)); - - border = GTK_CONTAINER(widget)->border_width; - - druid = GNOME_DRUID (widget); - temp_height = temp_width = 0; - - /* We find the maximum size of all children widgets */ - for (list = druid->children; list; list = list->next) { - child = GNOME_DRUID_PAGE (list->data); - if (GTK_WIDGET_VISIBLE (child)) { - gtk_widget_size_request (GTK_WIDGET (child), &child_requisition); - temp_width = MAX (temp_width, child_requisition.width); - temp_height = MAX (temp_height, child_requisition.height); - if (GTK_WIDGET_MAPPED (child) && child != druid->current) - gtk_widget_unmap (GTK_WIDGET(child)); - } - } - - requisition->width = temp_width + 2 * border; - requisition->height = temp_height + 2 * border; - - /* In an Attempt to show how the widgets are packed, - * here's a little diagram. - * - * [ Cancel ] ------------- [ Back ] [ Next ] - * | - * This part needs to be at least 1 button width. - * In addition, there is a GNOME_PAD_SMALL between Next and Back. - */ - /* our_button width is temp_width and temp_height */ - temp_height = 0; - temp_width = 0; - - gtk_widget_size_request (druid->back, &child_requisition); - temp_width = MAX (temp_width, child_requisition.width); - temp_height = MAX (temp_height, child_requisition.height); - - gtk_widget_size_request (druid->next, &child_requisition); - temp_width = MAX (temp_width, child_requisition.width); - temp_height = MAX (temp_height, child_requisition.height); - - gtk_widget_size_request (druid->cancel, &child_requisition); - temp_width = MAX (temp_width, child_requisition.width); - temp_height = MAX (temp_height, child_requisition.height); - - gtk_widget_size_request (druid->finish, &child_requisition); - temp_width = MAX (temp_width, child_requisition.width); - temp_height = MAX (temp_height, child_requisition.height); - - temp_width += border * 2; - temp_height += GNOME_PAD_SMALL; - temp_width = temp_width * 4 + GNOME_PAD_SMALL * 3; - - /* pick which is bigger, the buttons, or the NautilusDruidPages */ - requisition->width = MAX (temp_width, requisition->width); - requisition->height += temp_height; -} - -static void -nautilus_druid_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GnomeDruid *druid; - GtkAllocation child_allocation; - gint button_height; - GList *list; - int border; - - g_return_if_fail (widget != NULL); - g_return_if_fail (NAUTILUS_IS_DRUID (widget)); - - druid = GNOME_DRUID (widget); - widget->allocation = *allocation; - - /* deal with the buttons */ - child_allocation.width = child_allocation.height = 0; - child_allocation.width = druid->back->requisition.width; - child_allocation.height = druid->back->requisition.height; - child_allocation.width = MAX (child_allocation.width, - druid->next->requisition.width); - child_allocation.height = MAX (child_allocation.height, - druid->next->requisition.height); - child_allocation.width = MAX (child_allocation.width, - druid->cancel->requisition.width); - child_allocation.height = MAX (child_allocation.height, - druid->cancel->requisition.height); - - child_allocation.height += GNOME_PAD_SMALL; - button_height = child_allocation.height; - child_allocation.width += 2 * GNOME_PAD_SMALL; - child_allocation.y = allocation->y + allocation->height - - GNOME_PAD_SMALL - child_allocation.height; - - /* allocate cancel */ - child_allocation.x = allocation->x + GNOME_PAD_SMALL; - gtk_widget_size_allocate (druid->cancel, &child_allocation); - - - /* Allocate next/finish */ - child_allocation.x = allocation->x + allocation->width - - GNOME_PAD_SMALL - child_allocation.width; - gtk_widget_size_allocate (druid->next, &child_allocation); - gtk_widget_size_allocate (druid->finish, &child_allocation); - - /* Allocate back */ - child_allocation.x -= (GNOME_PAD_SMALL + child_allocation.width); - gtk_widget_size_allocate (druid->back, &child_allocation); - - border = GTK_CONTAINER (widget)->border_width; - - /* Put up the GnomeDruidPage */ - child_allocation.x = allocation->x + border; - child_allocation.y = allocation->y + border; - child_allocation.width = - ((allocation->width - 2 * border) > 0) ? - (allocation->width - 2 * border):0; - child_allocation.height = - ((allocation->height - 2 * border - GNOME_PAD_SMALL - button_height) > 0) ? - (allocation->height - 2 * border - GNOME_PAD_SMALL - button_height):0; - for (list = druid->children; list; list=list->next) { - if (GTK_WIDGET_VISIBLE (list->data)) { - gtk_widget_size_allocate (GTK_WIDGET (list->data), &child_allocation); - } - } -} - -/* Public methods */ -GtkWidget * -nautilus_druid_new (void) -{ - return gtk_widget_new (NAUTILUS_TYPE_DRUID, NULL); -} diff --git a/libnautilus-private/nautilus-druid.h b/libnautilus-private/nautilus-druid.h deleted file mode 100644 index 950035cf9..000000000 --- a/libnautilus-private/nautilus-druid.h +++ /dev/null @@ -1,57 +0,0 @@ -/* nautilus-druid.h - * Copyright (C) 1999 Red Hat, Inc. - * Copyright (C) 2000 Eazel, Inc. - * All rights reserved. - * - * This 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. - * - * 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library 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. - */ -/* - @NOTATION@ -*/ -#ifndef NAUTILUS_DRUID_H -#define NAUTILUS_DRUID_H - -#include <libgnome/gnome-defs.h> -#include <libgnomeui/gnome-druid.h> - -G_BEGIN_DECLS - -#define NAUTILUS_TYPE_DRUID (nautilus_druid_get_type ()) -#define NAUTILUS_DRUID(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_DRUID, NautilusDruid)) -#define NAUTILUS_DRUID_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_DRUID, NautilusDruidClass)) -#define NAUTILUS_IS_DRUID(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_DRUID)) -#define NAUTILUS_IS_DRUID_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_DRUID)) - - -typedef struct NautilusDruid NautilusDruid; -typedef struct NautilusDruidClass NautilusDruidClass; - -struct NautilusDruid -{ - GnomeDruid gnome_druid; -}; -struct NautilusDruidClass -{ - GnomeDruidClass parent_class; -}; - - -GtkType nautilus_druid_get_type (void); -GtkWidget *nautilus_druid_new (void); - -G_END_DECLS - -#endif /* NAUTILUS_DRUID_H */ diff --git a/libnautilus-private/nautilus-entry.c b/libnautilus-private/nautilus-entry.c index 264ee39c8..fd57448e3 100644 --- a/libnautilus-private/nautilus-entry.c +++ b/libnautilus-private/nautilus-entry.c @@ -27,15 +27,15 @@ #include <config.h> #include "nautilus-entry.h" +#include <string.h> +#include "nautilus-global-preferences.h" +#include "nautilus-undo-signal-handlers.h" +#include <eel/eel-gdk-extensions.h> #include <eel/eel-gtk-macros.h> #include <gdk/gdkkeysyms.h> #include <gtk/gtkmain.h> #include <gtk/gtksignal.h> #include <libgnome/gnome-i18n.h> -#include <eel/eel-gdk-extensions.h> -#include "nautilus-global-preferences.h" -#include "nautilus-undo-signal-handlers.h" -#include <orb/orbit.h> struct NautilusEntryDetails { gboolean use_emacs_shortcuts; @@ -51,8 +51,8 @@ enum { }; static guint signals[LAST_SIGNAL]; -static void nautilus_entry_initialize (NautilusEntry *entry); -static void nautilus_entry_initialize_class (NautilusEntryClass *class); +static void nautilus_entry_init (NautilusEntry *entry); +static void nautilus_entry_class_init (NautilusEntryClass *class); EEL_DEFINE_CLASS_BOILERPLATE (NautilusEntry, nautilus_entry, @@ -70,7 +70,7 @@ emacs_shortcuts_preference_changed_callback (gpointer callback_data) } static void -nautilus_entry_initialize (NautilusEntry *entry) +nautilus_entry_init (NautilusEntry *entry) { GtkWidget *widget; @@ -140,13 +140,13 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event) NautilusEntry *entry; GtkEditable *editable; int position; - gboolean had_selection; + gboolean old_has, new_has; gboolean result; entry = NAUTILUS_ENTRY (widget); editable = GTK_EDITABLE (widget); - if (!editable->editable) { + if (!gtk_editable_get_editable (editable)) { return FALSE; } @@ -158,7 +158,7 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event) * should position the insertion point at the end of * the selection. */ - if (entry->details->special_tab_handling && editable->has_selection) { + if (entry->details->special_tab_handling && gtk_editable_get_selection_bounds (editable, NULL, NULL)) { position = strlen (gtk_entry_get_text (GTK_ENTRY (editable))); gtk_entry_select_region (GTK_ENTRY (editable), position, position); return TRUE; @@ -189,7 +189,7 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event) obscure_cursor (entry); - had_selection = editable->has_selection; + old_has = gtk_editable_get_selection_bounds (editable, NULL, NULL); result = EEL_CALL_PARENT_WITH_RETURN_VALUE (GTK_WIDGET_CLASS, key_press_event, (widget, event)); @@ -197,8 +197,11 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event) /* Pressing a key usually changes the selection if there is a selection. * If there is not selection, we can save work by not emitting a signal. */ - if (result && (had_selection || editable->has_selection)) { - gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]); + if (result) { + new_has = gtk_editable_get_selection_bounds (editable, NULL, NULL); + if (old_has || new_has) { + gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]); + } } return result; @@ -209,7 +212,8 @@ static gboolean nautilus_entry_motion_notify (GtkWidget *widget, GdkEventMotion *event) { int result; - guint old_start_pos, old_end_pos; + gboolean old_had, new_had; + int old_start, old_end, new_start, new_end; GdkCursor *cursor; NautilusEntry *entry; GtkEditable *editable; @@ -225,16 +229,17 @@ nautilus_entry_motion_notify (GtkWidget *widget, GdkEventMotion *event) entry->details->cursor_obscured = FALSE; } - old_start_pos = editable->selection_start_pos; - old_end_pos = editable->selection_end_pos; + old_had = gtk_editable_get_selection_bounds (editable, &old_start, &old_end); result = EEL_CALL_PARENT_WITH_RETURN_VALUE (GTK_WIDGET_CLASS, motion_notify_event, (widget, event)); /* Send a signal if dragging the mouse caused the selection to change. */ - if (result && (old_start_pos != editable->selection_start_pos - || old_end_pos != editable->selection_end_pos)) { - gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]); + if (result) { + new_had = gtk_editable_get_selection_bounds (editable, &new_start, &new_end); + if (old_had != new_had || (old_had && (old_start != new_start || old_end != new_end))) { + gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]); + } } return result; @@ -317,12 +322,12 @@ nautilus_entry_set_text (NautilusEntry *entry, const gchar *text) } static void -nautilus_entry_set_selection (GtkEditable *editable, - int start_pos, - int end_pos) +nautilus_entry_set_selection_bounds (GtkEditable *editable, + int start_pos, + int end_pos) { - EEL_CALL_PARENT (GTK_EDITABLE_CLASS, set_selection, - (editable, start_pos, end_pos)); + EEL_CALL_PARENT (GTK_EDITABLE_CLASS, set_selection_bounds, + (editable, start_pos, end_pos)); gtk_signal_emit (GTK_OBJECT (editable), signals[SELECTION_CHANGED]); } @@ -419,7 +424,7 @@ nautilus_entry_selection_clear (GtkWidget *widget, } static void -nautilus_entry_initialize_class (NautilusEntryClass *class) +nautilus_entry_class_init (NautilusEntryClass *class) { GtkWidgetClass *widget_class; GtkObjectClass *object_class; @@ -439,26 +444,27 @@ nautilus_entry_initialize_class (NautilusEntryClass *class) editable_class->insert_text = nautilus_entry_insert_text; editable_class->delete_text = nautilus_entry_delete_text; - editable_class->set_selection = nautilus_entry_set_selection; + editable_class->set_selection_bounds = nautilus_entry_set_selection_bounds; /* Set up signals */ - signals[USER_CHANGED] = gtk_signal_new + signals[USER_CHANGED] = g_signal_new ("user_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusEntryClass, + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusEntryClass, user_changed), + NULL, NULL, gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - signals[SELECTION_CHANGED] = gtk_signal_new + G_TYPE_NONE, 0); + signals[SELECTION_CHANGED] = g_signal_new ("selection_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusEntryClass, + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusEntryClass, selection_changed), + NULL, NULL, gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + G_TYPE_NONE, 0); } void diff --git a/libnautilus-private/nautilus-entry.h b/libnautilus-private/nautilus-entry.h index c77c2f058..74126e2d2 100644 --- a/libnautilus-private/nautilus-entry.h +++ b/libnautilus-private/nautilus-entry.h @@ -27,7 +27,6 @@ #ifndef NAUTILUS_ENTRY_H #define NAUTILUS_ENTRY_H -#include <libgnome/gnome-defs.h> #include <gtk/gtkentry.h> G_BEGIN_DECLS diff --git a/libnautilus-private/nautilus-file-operations-progress.c b/libnautilus-private/nautilus-file-operations-progress.c index a72340a5c..c49d46c34 100644 --- a/libnautilus-private/nautilus-file-operations-progress.c +++ b/libnautilus-private/nautilus-file-operations-progress.c @@ -39,7 +39,7 @@ #include <gtk/gtkprogressbar.h> #include <gtk/gtktable.h> #include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-stock.h> +#include <libgnomeui/gnome-stock-icons.h> #include <libgnomevfs/gnome-vfs-utils.h> /* The width of the progress bar determines the minimum width of the @@ -53,8 +53,8 @@ #define MINIMUM_TIME_UP 1000 -static void nautilus_file_operations_progress_initialize_class (NautilusFileOperationsProgressClass *klass); -static void nautilus_file_operations_progress_initialize (NautilusFileOperationsProgress *dialog); +static void nautilus_file_operations_progress_class_init (NautilusFileOperationsProgressClass *klass); +static void nautilus_file_operations_progress_init (NautilusFileOperationsProgress *dialog); EEL_DEFINE_CLASS_BOILERPLATE (NautilusFileOperationsProgress, nautilus_file_operations_progress, @@ -193,7 +193,7 @@ delete_event_callback (GtkWidget *widget, } static void -nautilus_file_operations_progress_initialize (NautilusFileOperationsProgress *progress) +nautilus_file_operations_progress_init (NautilusFileOperationsProgress *progress) { GtkBox *vbox; GtkWidget *hbox; @@ -256,7 +256,7 @@ nautilus_file_operations_progress_initialize (NautilusFileOperationsProgress *pr } static void -nautilus_file_operations_progress_initialize_class (NautilusFileOperationsProgressClass *klass) +nautilus_file_operations_progress_class_init (NautilusFileOperationsProgressClass *klass) { GtkObjectClass *object_class; GtkWidgetClass *widget_class; diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c index 1f6a300ba..511a6ebd6 100644 --- a/libnautilus-private/nautilus-file-operations.c +++ b/libnautilus-private/nautilus-file-operations.c @@ -102,8 +102,7 @@ transfer_info_destroy (TransferInfo *transfer_info) } if (transfer_info->debuting_uris != NULL) { - eel_g_hash_table_destroy_deep_custom - (transfer_info->debuting_uris, (GFunc) g_free, NULL, NULL, NULL); + g_hash_table_destroy (transfer_info->debuting_uris); } g_free (transfer_info); @@ -196,14 +195,8 @@ icon_position_iterator_get_next (IconPositionIterator *position_iterator, return TRUE; } -/* Hack to get the GdkFont used by a GtkLabel in an error dialog. - * We need to do this because the string truncation needs to be - * done before a dialog is instantiated. - * - * This is probably not super fast but it is not a problem in the - * context we are using it, truncating a string while displaying an - * error dialog. - */ +#if GNOME2_CONVERSION_COMPLETE + static GdkFont * get_label_font (void) { @@ -225,12 +218,15 @@ get_label_font (void) return font; } +#endif + static char * ellipsize_string_for_dialog (const char *str) { + char *result; +#ifdef GNOME2_CONVERSION_COMPLETE GdkFont *font; int maximum_width; - char *result; /* get a nice length to ellipsize to, based on the font */ font = get_label_font (); @@ -238,6 +234,9 @@ ellipsize_string_for_dialog (const char *str) result = eel_string_ellipsize (str, font, maximum_width, EEL_ELLIPSIZE_MIDDLE); gdk_font_unref (font); +#else + result = g_strdup (str); +#endif return result; } @@ -1619,9 +1618,9 @@ sync_transfer_callback (GnomeVFSXferProgressInfo *progress_info, gpointer data) progress_info->target_name); } if (debuting_uris != NULL) { - g_hash_table_insert (debuting_uris, - g_strdup (progress_info->target_name), - GINT_TO_POINTER (TRUE)); + g_hash_table_replace (debuting_uris, + g_strdup (progress_info->target_name), + GINT_TO_POINTER (TRUE)); } } nautilus_file_changes_queue_file_added (progress_info->target_name); @@ -1652,9 +1651,9 @@ sync_transfer_callback (GnomeVFSXferProgressInfo *progress_info, gpointer data) } if (debuting_uris != NULL) { - g_hash_table_insert (debuting_uris, - g_strdup (progress_info->target_name), - GINT_TO_POINTER (really_moved)); + g_hash_table_replace (debuting_uris, + g_strdup (progress_info->target_name), + GINT_TO_POINTER (really_moved)); } } if (really_moved) { @@ -2036,7 +2035,7 @@ nautilus_file_operations_copy_move (const GList *item_uris, transfer_info->overwrite_mode = GNOME_VFS_XFER_OVERWRITE_MODE_QUERY; transfer_info->done_callback = done_callback; transfer_info->done_callback_data = done_callback_data; - transfer_info->debuting_uris = g_hash_table_new (g_str_hash, g_str_equal); + transfer_info->debuting_uris = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); sync_transfer_info = g_new (SyncTransferInfo, 1); sync_transfer_info->iterator = icon_position_iterator; @@ -2046,6 +2045,7 @@ nautilus_file_operations_copy_move (const GList *item_uris, gnome_vfs_async_xfer (&transfer_info->handle, source_uri_list, target_uri_list, move_options, GNOME_VFS_XFER_ERROR_MODE_QUERY, GNOME_VFS_XFER_OVERWRITE_MODE_QUERY, + GNOME_VFS_PRIORITY_DEFAULT, update_transfer_callback, transfer_info, sync_transfer_callback, sync_transfer_info); } @@ -2178,6 +2178,7 @@ nautilus_file_operations_new_folder (GtkWidget *parent_view, GNOME_VFS_XFER_NEW_UNIQUE_DIRECTORY, GNOME_VFS_XFER_ERROR_MODE_QUERY, GNOME_VFS_XFER_OVERWRITE_MODE_QUERY, + GNOME_VFS_PRIORITY_DEFAULT, new_folder_transfer_callback, state, sync_transfer_callback, NULL); @@ -2220,6 +2221,7 @@ nautilus_file_operations_delete (const GList *item_uris, GNOME_VFS_XFER_DELETE_ITEMS | GNOME_VFS_XFER_RECURSIVE, GNOME_VFS_XFER_ERROR_MODE_QUERY, GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE, + GNOME_VFS_PRIORITY_DEFAULT, update_transfer_callback, transfer_info, sync_transfer_callback, NULL); @@ -2254,6 +2256,7 @@ do_empty_trash (GtkWidget *parent_view) GNOME_VFS_XFER_EMPTY_DIRECTORIES, GNOME_VFS_XFER_ERROR_MODE_QUERY, GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE, + GNOME_VFS_PRIORITY_DEFAULT, update_transfer_callback, transfer_info, sync_transfer_callback, NULL); } @@ -2264,7 +2267,7 @@ do_empty_trash (GtkWidget *parent_view) static gboolean confirm_empty_trash (GtkWidget *parent_view) { - GnomeDialog *dialog; + GtkDialog *dialog; GtkWindow *parent_window; /* Just Say Yes if the preference says not to confirm. */ @@ -2282,9 +2285,9 @@ confirm_empty_trash (GtkWidget *parent_view) GNOME_STOCK_BUTTON_CANCEL, parent_window); - gnome_dialog_set_default (dialog, GNOME_CANCEL); + gtk_dialog_set_default_response (dialog, GTK_RESPONSE_CANCEL); - return gnome_dialog_run (dialog) == GNOME_OK; + return gtk_dialog_run (dialog) == GTK_RESPONSE_OK; } void diff --git a/libnautilus-private/nautilus-file-utilities.c b/libnautilus-private/nautilus-file-utilities.c index 53397c2b3..a5b05aab5 100644 --- a/libnautilus-private/nautilus-file-utilities.c +++ b/libnautilus-private/nautilus-file-utilities.c @@ -36,6 +36,7 @@ #include <libgnomevfs/gnome-vfs-ops.h> #include <libgnomevfs/gnome-vfs-uri.h> #include <libgnomevfs/gnome-vfs-utils.h> +#include <unistd.h> #define NAUTILUS_USER_DIRECTORY_NAME ".nautilus" #define DEFAULT_NAUTILUS_DIRECTORY_MODE (0755) diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c index 531109c84..a856ee1b2 100644 --- a/libnautilus-private/nautilus-file.c +++ b/libnautilus-private/nautilus-file.c @@ -46,11 +46,7 @@ #include <libxml/parser.h> #include <grp.h> #include <gtk/gtksignal.h> -#include <libgnome/gnome-defs.h> -#include <libgnome/gnome-dentry.h> #include <libgnome/gnome-i18n.h> -#include <libgnome/gnome-metadata.h> -#include <libgnome/gnome-mime.h> #include <libgnomevfs/gnome-vfs-file-info.h> #include <libgnomevfs/gnome-vfs-mime-handlers.h> #include <libgnomevfs/gnome-vfs-mime-info.h> @@ -59,6 +55,7 @@ #include <stdlib.h> #include <unistd.h> #include <sys/time.h> +#include <time.h> /* Time in seconds to cache getpwuid results */ #define GETPWUID_CACHE_TIME (5*60) @@ -104,8 +101,8 @@ static guint signals[LAST_SIGNAL]; static GHashTable *symbolic_links; -static void nautilus_file_initialize_class (NautilusFileClass *klass); -static void nautilus_file_initialize (NautilusFile *file); +static void nautilus_file_class_init (NautilusFileClass *klass); +static void nautilus_file_init (NautilusFile *file); static void destroy (GtkObject *object); static char * nautilus_file_get_owner_as_string (NautilusFile *file, gboolean include_real_name); @@ -116,7 +113,7 @@ static gboolean update_info_and_name (NautilusFile *file, EEL_DEFINE_CLASS_BOILERPLATE (NautilusFile, nautilus_file, GTK_TYPE_OBJECT) static void -nautilus_file_initialize_class (NautilusFileClass *klass) +nautilus_file_class_init (NautilusFileClass *klass) { GtkObjectClass *object_class; @@ -125,26 +122,26 @@ nautilus_file_initialize_class (NautilusFileClass *klass) object_class->destroy = destroy; signals[CHANGED] = - gtk_signal_new ("changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusFileClass, changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusFileClass, changed), + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); signals[UPDATED_DEEP_COUNT_IN_PROGRESS] = - gtk_signal_new ("updated_deep_count_in_progress", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusFileClass, updated_deep_count_in_progress), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + g_signal_new ("updated_deep_count_in_progress", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusFileClass, updated_deep_count_in_progress), + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); } static void -nautilus_file_initialize (NautilusFile *file) +nautilus_file_init (NautilusFile *file) { file->details = g_new0 (NautilusFileDetails, 1); } @@ -1013,7 +1010,9 @@ nautilus_file_rename (NautilusFile *file, g_free (uri); if (path != NULL) { +#ifdef GNOME2_CONVERSION_COMPLETE gnome_metadata_set (path, "icon-caption", strlen (new_name) + 1, new_name); +#endif g_free (path); (* callback) (file, GNOME_VFS_OK, callback_data); @@ -1078,6 +1077,7 @@ nautilus_file_rename (NautilusFile *file, GNOME_VFS_SET_FILE_INFO_NAME, (GNOME_VFS_FILE_INFO_GET_MIME_TYPE | GNOME_VFS_FILE_INFO_FOLLOW_LINKS), + GNOME_VFS_PRIORITY_DEFAULT, rename_callback, op); gnome_vfs_file_info_unref (partial_file_info); gnome_vfs_uri_unref (vfs_uri); @@ -2144,7 +2144,9 @@ nautilus_file_set_metadata (NautilusFile *file, icon_path = gnome_vfs_get_local_path_from_uri (metadata); if (local_path != NULL && icon_path != NULL) { +#ifdef GNOME2_CONVERSION_COMPLETE gnome_metadata_set (local_path, "icon-filename", strlen (icon_path)+1, icon_path); +#endif } g_free (icon_path); @@ -3027,6 +3029,7 @@ nautilus_file_set_permissions (NautilusFile *file, GNOME_VFS_SET_FILE_INFO_PERMISSIONS, (GNOME_VFS_FILE_INFO_GET_MIME_TYPE | GNOME_VFS_FILE_INFO_FOLLOW_LINKS), + GNOME_VFS_PRIORITY_DEFAULT, set_permissions_callback, op); gnome_vfs_file_info_unref (partial_file_info); gnome_vfs_uri_unref (vfs_uri); @@ -3285,6 +3288,7 @@ set_owner_and_group (NautilusFile *file, GNOME_VFS_SET_FILE_INFO_OWNER, (GNOME_VFS_FILE_INFO_GET_MIME_TYPE | GNOME_VFS_FILE_INFO_FOLLOW_LINKS), + GNOME_VFS_PRIORITY_DEFAULT, set_owner_and_group_callback, op); gnome_vfs_file_info_unref (partial_file_info); gnome_vfs_uri_unref (uri); @@ -5036,7 +5040,7 @@ nautilus_file_list_ref (GList *list) void nautilus_file_list_unref (GList *list) { - eel_g_list_safe_for_each (list, (GFunc) nautilus_file_unref, NULL); + g_list_foreach (list, (GFunc) nautilus_file_unref, NULL); } /** @@ -5161,8 +5165,8 @@ nautilus_self_check_file (void) file_1 = nautilus_file_get ("file:///home/"); - EEL_CHECK_INTEGER_RESULT (GTK_OBJECT (file_1)->ref_count, 1); - EEL_CHECK_INTEGER_RESULT (GTK_OBJECT (file_1->details->directory)->ref_count, 1); + EEL_CHECK_INTEGER_RESULT (G_OBJECT (file_1)->ref_count, 1); + EEL_CHECK_INTEGER_RESULT (G_OBJECT (file_1->details->directory)->ref_count, 1); EEL_CHECK_INTEGER_RESULT (nautilus_directory_number_outstanding (), 1); nautilus_file_unref (file_1); @@ -5178,13 +5182,13 @@ nautilus_self_check_file (void) nautilus_file_list_ref (list); - EEL_CHECK_INTEGER_RESULT (GTK_OBJECT (file_1)->ref_count, 2); - EEL_CHECK_INTEGER_RESULT (GTK_OBJECT (file_2)->ref_count, 2); + EEL_CHECK_INTEGER_RESULT (G_OBJECT (file_1)->ref_count, 2); + EEL_CHECK_INTEGER_RESULT (G_OBJECT (file_2)->ref_count, 2); nautilus_file_list_unref (list); - EEL_CHECK_INTEGER_RESULT (GTK_OBJECT (file_1)->ref_count, 1); - EEL_CHECK_INTEGER_RESULT (GTK_OBJECT (file_2)->ref_count, 1); + EEL_CHECK_INTEGER_RESULT (G_OBJECT (file_1)->ref_count, 1); + EEL_CHECK_INTEGER_RESULT (G_OBJECT (file_2)->ref_count, 1); nautilus_file_list_free (list); @@ -5224,8 +5228,8 @@ nautilus_self_check_file (void) file_1 = nautilus_file_get ("file:///etc"); file_2 = nautilus_file_get ("file:///usr"); - EEL_CHECK_INTEGER_RESULT (GTK_OBJECT (file_1)->ref_count, 1); - EEL_CHECK_INTEGER_RESULT (GTK_OBJECT (file_2)->ref_count, 1); + EEL_CHECK_INTEGER_RESULT (G_OBJECT (file_1)->ref_count, 1); + EEL_CHECK_INTEGER_RESULT (G_OBJECT (file_2)->ref_count, 1); EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_2, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME, FALSE, FALSE) < 0, TRUE); EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_2, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME, FALSE, TRUE) > 0, TRUE); diff --git a/libnautilus-private/nautilus-find-icon-image.c b/libnautilus-private/nautilus-find-icon-image.c index ba6a7595d..404568698 100644 --- a/libnautilus-private/nautilus-find-icon-image.c +++ b/libnautilus-private/nautilus-find-icon-image.c @@ -32,7 +32,6 @@ #include <eel/eel-glib-extensions.h> #include <eel/eel-string.h> #include <eel/eel-xml-extensions.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-util.h> #include <libxml/parser.h> #include <libxml/xmlmemory.h> @@ -197,7 +196,7 @@ get_themed_icon_file_path (const NautilusIconTheme *icon_theme, include_size = icon_size != NAUTILUS_ICON_SIZE_STANDARD; /* Try each suffix. */ - for (i = 0; i < EEL_N_ELEMENTS (icon_file_name_suffixes); i++) { + for (i = 0; i < G_N_ELEMENTS (icon_file_name_suffixes); i++) { if (include_size && g_strcasecmp (icon_file_name_suffixes[i], ".svg") != 0) { /* Build a path for this icon. */ partial_path = g_strdup_printf ("%s-%u", @@ -314,7 +313,7 @@ get_user_emblem_path (const char *name, guint icon_size) user_directory = nautilus_get_user_directory (); path = NULL; - for (i = 0; i < EEL_N_ELEMENTS (icon_file_name_suffixes); i++) { + for (i = 0; i < G_N_ELEMENTS (icon_file_name_suffixes); i++) { path = g_strdup_printf ("%s/emblems/%s%s", user_directory, name + strlen (NAUTILUS_EMBLEM_NAME_PREFIX), @@ -387,7 +386,7 @@ nautilus_remove_icon_file_name_suffix (const char *icon_name) guint i; const char *suffix; - for (i = 0; i < EEL_N_ELEMENTS (icon_file_name_suffixes); i++) { + for (i = 0; i < G_N_ELEMENTS (icon_file_name_suffixes); i++) { suffix = icon_file_name_suffixes[i]; if (eel_str_has_suffix (icon_name, suffix)) { return eel_str_strip_trailing_str (icon_name, suffix); diff --git a/libnautilus-private/nautilus-font-factory.c b/libnautilus-private/nautilus-font-factory.c index 9041efcf8..732d92371 100644 --- a/libnautilus-private/nautilus-font-factory.c +++ b/libnautilus-private/nautilus-font-factory.c @@ -66,8 +66,8 @@ typedef struct { static NautilusFontFactory *global_font_factory = NULL; static GtkType nautilus_font_factory_get_type (void); -static void nautilus_font_factory_initialize_class (NautilusFontFactoryClass *class); -static void nautilus_font_factory_initialize (NautilusFontFactory *factory); +static void nautilus_font_factory_class_init (NautilusFontFactoryClass *class); +static void nautilus_font_factory_init (NautilusFontFactory *factory); static void destroy (GtkObject *object); EEL_DEFINE_CLASS_BOILERPLATE (NautilusFontFactory, @@ -101,13 +101,13 @@ nautilus_font_factory_get (void) } static void -nautilus_font_factory_initialize (NautilusFontFactory *factory) +nautilus_font_factory_init (NautilusFontFactory *factory) { factory->fonts = g_hash_table_new (g_str_hash, g_str_equal); } static void -nautilus_font_factory_initialize_class (NautilusFontFactoryClass *class) +nautilus_font_factory_class_init (NautilusFontFactoryClass *class) { GtkObjectClass *object_class; @@ -115,6 +115,8 @@ nautilus_font_factory_initialize_class (NautilusFontFactoryClass *class) object_class->destroy = destroy; } +#if GNOME2_CONVERSION_COMPLETE + static FontHashNode * font_hash_node_alloc (const char *name) { @@ -128,6 +130,8 @@ font_hash_node_alloc (const char *name) return node; } +#endif + static void font_hash_node_free (FontHashNode *node) { @@ -168,6 +172,8 @@ destroy (GtkObject *object) EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object)); } +#if GNOME2_CONVERSION_COMPLETE + static FontHashNode * font_hash_node_lookup (const char *name) { @@ -276,7 +282,7 @@ nautilus_font_factory_get_font_from_preferences (guint size_in_pixels) static gboolean icon_view_font_auto_value_registered; static const char *icon_view_font_auto_value; - /* Can't initialize this in initialize_class, because no font factory + /* Can't initialize this in class_init, because no font factory * instance may yet exist when this is called. */ if (!icon_view_font_auto_value_registered) { @@ -290,3 +296,5 @@ nautilus_font_factory_get_font_from_preferences (guint size_in_pixels) */ return nautilus_font_factory_get_font_by_family (icon_view_font_auto_value, size_in_pixels); } + +#endif diff --git a/libnautilus-private/nautilus-global-preferences.c b/libnautilus-private/nautilus-global-preferences.c index 225bf418c..b7ed52222 100644 --- a/libnautilus-private/nautilus-global-preferences.c +++ b/libnautilus-private/nautilus-global-preferences.c @@ -882,18 +882,18 @@ get_default_folder_viewer_preference_from_iid (const char *iid) static gpointer default_default_folder_viewer_callback (int user_level) { - OAF_ServerInfo *oaf_info; + Bonobo_ServerInfo *bonobo_activation_info; int result; - oaf_info = gnome_vfs_mime_get_default_component ("x-directory/normal"); - if (oaf_info == NULL) { + bonobo_activation_info = gnome_vfs_mime_get_default_component ("x-directory/normal"); + if (bonobo_activation_info == NULL) { result = NAUTILUS_DEFAULT_FOLDER_VIEWER_ICON_VIEW; } else { - result = get_default_folder_viewer_preference_from_iid (oaf_info->iid); + result = get_default_folder_viewer_preference_from_iid (bonobo_activation_info->iid); if (result == NAUTILUS_DEFAULT_FOLDER_VIEWER_OTHER) { result = NAUTILUS_DEFAULT_FOLDER_VIEWER_ICON_VIEW; } - CORBA_free (oaf_info); + CORBA_free (bonobo_activation_info); } return GINT_TO_POINTER (result); @@ -1072,7 +1072,7 @@ default_icon_view_sort_order_or_manual_layout_changed_callback (gpointer callbac } void -nautilus_global_preferences_initialize (void) +nautilus_global_preferences_init (void) { static gboolean initialized = FALSE; @@ -1082,7 +1082,7 @@ nautilus_global_preferences_initialize (void) initialized = TRUE; - eel_preferences_initialize ("/apps/nautilus"); + eel_preferences_init ("/apps/nautilus"); /* Install defaults */ global_preferences_install_defaults (); diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h index 32c943b75..da9f15a4c 100644 --- a/libnautilus-private/nautilus-global-preferences.h +++ b/libnautilus-private/nautilus-global-preferences.h @@ -188,7 +188,7 @@ typedef enum #define NAUTILUS_PREFERENCES_ADD_TO_SESSION "preferences/add_to_session" -void nautilus_global_preferences_initialize (void); +void nautilus_global_preferences_init (void); /* Sidebar */ struct EelScalableFont *nautilus_global_preferences_get_icon_view_smooth_font (void); diff --git a/libnautilus-private/nautilus-horizontal-splitter.c b/libnautilus-private/nautilus-horizontal-splitter.c index 615b46102..f904a7ae4 100644 --- a/libnautilus-private/nautilus-horizontal-splitter.c +++ b/libnautilus-private/nautilus-horizontal-splitter.c @@ -44,8 +44,8 @@ struct NautilusHorizontalSplitterDetails { #define SPLITTER_CLICK_TIMEOUT 400 /* NautilusHorizontalSplitterClass methods */ -static void nautilus_horizontal_splitter_initialize_class (NautilusHorizontalSplitterClass *horizontal_splitter_class); -static void nautilus_horizontal_splitter_initialize (NautilusHorizontalSplitter *horizontal_splitter); +static void nautilus_horizontal_splitter_class_init (NautilusHorizontalSplitterClass *horizontal_splitter_class); +static void nautilus_horizontal_splitter_init (NautilusHorizontalSplitter *horizontal_splitter); static gboolean nautilus_horizontal_splitter_button_press (GtkWidget *widget, GdkEventButton *event); static gboolean nautilus_horizontal_splitter_button_release (GtkWidget *widget, @@ -66,7 +66,7 @@ EEL_DEFINE_CLASS_BOILERPLATE (NautilusHorizontalSplitter, /* GtkObjectClass methods */ static void -nautilus_horizontal_splitter_initialize_class (NautilusHorizontalSplitterClass *horizontal_splitter_class) +nautilus_horizontal_splitter_class_init (NautilusHorizontalSplitterClass *horizontal_splitter_class) { GtkObjectClass *object_class; GtkWidgetClass *widget_class; @@ -86,7 +86,7 @@ nautilus_horizontal_splitter_initialize_class (NautilusHorizontalSplitterClass * } static void -nautilus_horizontal_splitter_initialize (NautilusHorizontalSplitter *horizontal_splitter) +nautilus_horizontal_splitter_init (NautilusHorizontalSplitter *horizontal_splitter) { horizontal_splitter->details = g_new0 (NautilusHorizontalSplitterDetails, 1); e_paned_set_handle_size (E_PANED (horizontal_splitter), BAR_WIDTH); diff --git a/libnautilus-private/nautilus-horizontal-splitter.h b/libnautilus-private/nautilus-horizontal-splitter.h index 30f94834a..4db95128b 100644 --- a/libnautilus-private/nautilus-horizontal-splitter.h +++ b/libnautilus-private/nautilus-horizontal-splitter.h @@ -25,7 +25,6 @@ #ifndef NAUTILUS_HORIZONTAL_SPLITTER_H #define NAUTILUS_HORIZONTAL_SPLITTER_H -#include <libgnome/gnome-defs.h> #include "e-hpaned.h" G_BEGIN_DECLS diff --git a/libnautilus-private/nautilus-icon-canvas-item.c b/libnautilus-private/nautilus-icon-canvas-item.c index 50eb59280..52e4ad23f 100644 --- a/libnautilus-private/nautilus-icon-canvas-item.c +++ b/libnautilus-private/nautilus-icon-canvas-item.c @@ -31,8 +31,8 @@ #include <gtk/gtksignal.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-canvas-util.h> -#include <libgnomeui/gnome-icon-text.h> +#include <libgnomecanvas/gnome-canvas-util.h> +#include <libgnomecanvas/gnome-icon-text.h> #include <libart_lgpl/art_rgb.h> #include <libart_lgpl/art_rgb_affine.h> #include <libart_lgpl/art_rgb_rgba_affine.h> @@ -156,8 +156,8 @@ static guint32 highlight_text_info_color = EEL_RGBA_COLOR_PACK (0xCC, 0xCC, 0x static int click_policy_auto_value; /* GtkObject */ -static void nautilus_icon_canvas_item_initialize_class (NautilusIconCanvasItemClass *class); -static void nautilus_icon_canvas_item_initialize (NautilusIconCanvasItem *item); +static void nautilus_icon_canvas_item_class_init (NautilusIconCanvasItemClass *class); +static void nautilus_icon_canvas_item_init (NautilusIconCanvasItem *item); static void nautilus_icon_canvas_item_destroy (GtkObject *object); static int nautilus_icon_canvas_item_event (GnomeCanvasItem *item, GdkEvent *event); @@ -235,7 +235,7 @@ free_layout_cache (void) /* Class initialization function for the icon canvas item. */ static void -nautilus_icon_canvas_item_initialize_class (NautilusIconCanvasItemClass *class) +nautilus_icon_canvas_item_class_init (NautilusIconCanvasItemClass *class) { GtkObjectClass *object_class; GnomeCanvasItemClass *item_class; @@ -249,9 +249,9 @@ nautilus_icon_canvas_item_initialize_class (NautilusIconCanvasItemClass *class) item_class = GNOME_CANVAS_ITEM_CLASS (class); gtk_object_add_arg_type ("NautilusIconCanvasItem::editable_text", - GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_EDITABLE_TEXT); + G_TYPE_STRING, GTK_ARG_READWRITE, ARG_EDITABLE_TEXT); gtk_object_add_arg_type ("NautilusIconCanvasItem::additional_text", - GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ADDITIONAL_TEXT); + G_TYPE_STRING, GTK_ARG_READWRITE, ARG_ADDITIONAL_TEXT); gtk_object_add_arg_type ("NautilusIconCanvasItem::font", GTK_TYPE_BOXED, GTK_ARG_READWRITE, ARG_FONT); gtk_object_add_arg_type ("NautilusIconCanvasItem::highlighted_for_selection", @@ -270,15 +270,14 @@ nautilus_icon_canvas_item_initialize_class (NautilusIconCanvasItemClass *class) object_class->get_arg = nautilus_icon_canvas_item_get_arg; signals[BOUNDS_CHANGED] - = gtk_signal_new ("bounds_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconCanvasItemClass, + = g_signal_new ("bounds_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconCanvasItemClass, bounds_changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); item_class->update = nautilus_icon_canvas_item_update; item_class->draw = nautilus_icon_canvas_item_draw; @@ -293,7 +292,7 @@ nautilus_icon_canvas_item_initialize_class (NautilusIconCanvasItemClass *class) /* Object initialization function for the icon item. */ static void -nautilus_icon_canvas_item_initialize (NautilusIconCanvasItem *icon_item) +nautilus_icon_canvas_item_init (NautilusIconCanvasItem *icon_item) { NautilusIconCanvasItemDetails *details; @@ -981,7 +980,7 @@ draw_stretch_handles (NautilusIconCanvasItem *item, GdkDrawable *drawable, gc = gdk_gc_new (drawable); knob_filename = nautilus_theme_get_image_path ("knob.png"); - knob_pixbuf = gdk_pixbuf_new_from_file (knob_filename); + knob_pixbuf = gdk_pixbuf_new_from_file (knob_filename, NULL); knob_width = gdk_pixbuf_get_width (knob_pixbuf); knob_height = gdk_pixbuf_get_height (knob_pixbuf); @@ -1084,7 +1083,7 @@ draw_stretch_handles_aa (NautilusIconCanvasItem *item, GnomeCanvasBuf *buf, canvas_item = GNOME_CANVAS_ITEM (item); knob_filename = nautilus_theme_get_image_path ("knob.png"); - knob_pixbuf = gdk_pixbuf_new_from_file (knob_filename); + knob_pixbuf = gdk_pixbuf_new_from_file (knob_filename, NULL); knob_width = gdk_pixbuf_get_width (knob_pixbuf); knob_height = gdk_pixbuf_get_height (knob_pixbuf); @@ -1292,7 +1291,7 @@ real_map_pixbuf (NautilusIconCanvasItem *icon_item) /* Load the audio symbol. */ audio_filename = nautilus_pixmap_file ("audio.png"); if (audio_filename != NULL) { - audio_pixbuf = gdk_pixbuf_new_from_file (audio_filename); + audio_pixbuf = gdk_pixbuf_new_from_file (audio_filename, NULL); } else { audio_pixbuf = NULL; } @@ -2104,7 +2103,7 @@ hit_test_stretch_handle (NautilusIconCanvasItem *item, } knob_filename = nautilus_theme_get_image_path ("knob.png"); - knob_pixbuf = gdk_pixbuf_new_from_file (knob_filename); + knob_pixbuf = gdk_pixbuf_new_from_file (knob_filename, NULL); knob_width = gdk_pixbuf_get_width (knob_pixbuf); knob_height = gdk_pixbuf_get_height (knob_pixbuf); diff --git a/libnautilus-private/nautilus-icon-canvas-item.h b/libnautilus-private/nautilus-icon-canvas-item.h index 0672cc96b..23db9117c 100644 --- a/libnautilus-private/nautilus-icon-canvas-item.h +++ b/libnautilus-private/nautilus-icon-canvas-item.h @@ -25,8 +25,7 @@ #ifndef NAUTILUS_ICON_CANVAS_ITEM_H #define NAUTILUS_ICON_CANVAS_ITEM_H -#include <libgnome/gnome-defs.h> -#include <libgnomeui/gnome-canvas.h> +#include <libgnomecanvas/gnome-canvas.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include "nautilus-icon-factory.h" #include <eel/eel-scalable-font.h> diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index e736edf51..06b9d3f94 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -42,7 +42,7 @@ #include <eel/eel-gtk-extensions.h> #include <eel/eel-gtk-macros.h> #include <eel/eel-string.h> -#include <gdk-pixbuf/gnome-canvas-pixbuf.h> +#include <libgnomecanvas/gnome-canvas-pixbuf.h> #include <gdk/gdkkeysyms.h> #include <gtk/gtklayout.h> #include <gtk/gtkmain.h> @@ -120,8 +120,8 @@ enum { }; static void activate_selected_items (NautilusIconContainer *container); -static void nautilus_icon_container_initialize_class (NautilusIconContainerClass *class); -static void nautilus_icon_container_initialize (NautilusIconContainer *container); +static void nautilus_icon_container_class_init (NautilusIconContainerClass *class); +static void nautilus_icon_container_init (NautilusIconContainer *container); static void nautilus_icon_container_theme_changed (gpointer user_data); static void compute_stretch (StretchState *start, @@ -2314,7 +2314,7 @@ destroy (GtkObject *object) gtk_idle_remove (container->details->stretch_idle_id); } - for (i = 0; i < EEL_N_ELEMENTS (container->details->label_font); i++) { + for (i = 0; i < G_N_ELEMENTS (container->details->label_font); i++) { if (container->details->label_font[i] != NULL) gdk_font_unref (container->details->label_font[i]); } @@ -3031,7 +3031,7 @@ key_press_event (GtkWidget *widget, /* Initialization. */ static void -nautilus_icon_container_initialize_class (NautilusIconContainerClass *class) +nautilus_icon_container_class_init (NautilusIconContainerClass *class) { GtkObjectClass *object_class; GtkWidgetClass *widget_class; @@ -3048,173 +3048,191 @@ nautilus_icon_container_initialize_class (NautilusIconContainerClass *class) /* Signals. */ signals[SELECTION_CHANGED] - = gtk_signal_new ("selection_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("selection_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, selection_changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); signals[BUTTON_PRESS] - = gtk_signal_new ("button_press", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("button_press", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, button_press), - gtk_marshal_BOOL__POINTER, - GTK_TYPE_BOOL, 1, - GTK_TYPE_GDK_EVENT); + NULL, NULL, + gtk_marshal_BOOL__POINTER, + GTK_TYPE_BOOL, 1, + GDK_TYPE_EVENT); signals[ACTIVATE] - = gtk_signal_new ("activate", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("activate", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, activate), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[CONTEXT_CLICK_SELECTION] - = gtk_signal_new ("context_click_selection", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("context_click_selection", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, context_click_selection), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[CONTEXT_CLICK_BACKGROUND] - = gtk_signal_new ("context_click_background", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("context_click_background", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, context_click_background), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[MIDDLE_CLICK] - = gtk_signal_new ("middle_click", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("middle_click", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, middle_click), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[ICON_POSITION_CHANGED] - = gtk_signal_new ("icon_position_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("icon_position_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, icon_position_changed), - gtk_marshal_NONE__POINTER_POINTER, - GTK_TYPE_NONE, 2, + NULL, NULL, + gtk_marshal_NONE__POINTER_POINTER, + G_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_POINTER); signals[ICON_TEXT_CHANGED] - = gtk_signal_new ("icon_text_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("icon_text_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, icon_text_changed), - gtk_marshal_NONE__POINTER_POINTER, - GTK_TYPE_NONE, 2, + NULL, NULL, + gtk_marshal_NONE__POINTER_POINTER, + G_TYPE_NONE, 2, GTK_TYPE_POINTER, - GTK_TYPE_STRING); + G_TYPE_STRING); signals[ICON_STRETCH_STARTED] - = gtk_signal_new ("icon_stretch_started", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("icon_stretch_started", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, icon_stretch_started), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[ICON_STRETCH_ENDED] - = gtk_signal_new ("icon_stretch_ended", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("icon_stretch_ended", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, icon_stretch_ended), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[RENAMING_ICON] - = gtk_signal_new ("renaming_icon", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("renaming_icon", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, renaming_icon), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[GET_ICON_IMAGES] - = gtk_signal_new ("get_icon_images", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("get_icon_images", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, get_icon_images), - eel_gtk_marshal_POINTER__POINTER_STRING_POINTER, - GTK_TYPE_POINTER, 3, + NULL, NULL, + eel_gtk_marshal_POINTER__POINTER_STRING_POINTER, + GTK_TYPE_POINTER, 3, GTK_TYPE_POINTER, - GTK_TYPE_STRING, + G_TYPE_STRING, GTK_TYPE_POINTER); signals[GET_ICON_TEXT] - = gtk_signal_new ("get_icon_text", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("get_icon_text", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, get_icon_text), - eel_gtk_marshal_NONE__POINTER_STRING_STRING, - GTK_TYPE_NONE, 3, + NULL, NULL, + eel_gtk_marshal_NONE__POINTER_STRING_STRING, + G_TYPE_NONE, 3, GTK_TYPE_POINTER, - GTK_TYPE_STRING, - GTK_TYPE_STRING); + G_TYPE_STRING, + G_TYPE_STRING); signals[GET_ICON_URI] - = gtk_signal_new ("get_icon_uri", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("get_icon_uri", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, get_icon_uri), - eel_gtk_marshal_STRING__POINTER, - GTK_TYPE_STRING, 1, + NULL, NULL, + eel_gtk_marshal_STRING__POINTER, + G_TYPE_STRING, 1, GTK_TYPE_POINTER); signals[GET_ICON_DROP_TARGET_URI] - = gtk_signal_new ("get_icon_drop_target_uri", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("get_icon_drop_target_uri", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, get_icon_drop_target_uri), - eel_gtk_marshal_STRING__POINTER, - GTK_TYPE_STRING, 1, + NULL, NULL, + eel_gtk_marshal_STRING__POINTER, + G_TYPE_STRING, 1, GTK_TYPE_POINTER); signals[COMPARE_ICONS] - = gtk_signal_new ("compare_icons", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("compare_icons", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, compare_icons), - eel_gtk_marshal_INT__POINTER_POINTER, - GTK_TYPE_INT, 2, + NULL, NULL, + eel_gtk_marshal_INT__POINTER_POINTER, + GTK_TYPE_INT, 2, GTK_TYPE_POINTER, GTK_TYPE_POINTER); signals[COMPARE_ICONS_BY_NAME] - = gtk_signal_new ("compare_icons_by_name", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("compare_icons_by_name", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, compare_icons_by_name), - eel_gtk_marshal_INT__POINTER_POINTER, - GTK_TYPE_INT, 2, + NULL, NULL, + eel_gtk_marshal_INT__POINTER_POINTER, + GTK_TYPE_INT, 2, GTK_TYPE_POINTER, GTK_TYPE_POINTER); signals[MOVE_COPY_ITEMS] - = gtk_signal_new ("move_copy_items", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("move_copy_items", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, move_copy_items), - eel_gtk_marshal_NONE__POINTER_POINTER_POINTER_INT_INT_INT, - GTK_TYPE_NONE, 6, + NULL, NULL, + eel_gtk_marshal_NONE__POINTER_POINTER_POINTER_INT_INT_INT, + G_TYPE_NONE, 6, GTK_TYPE_POINTER, GTK_TYPE_POINTER, GTK_TYPE_POINTER, @@ -3222,82 +3240,88 @@ nautilus_icon_container_initialize_class (NautilusIconContainerClass *class) GTK_TYPE_INT, GTK_TYPE_INT); signals[HANDLE_URI_LIST] - = gtk_signal_new ("handle_uri_list", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("handle_uri_list", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, handle_uri_list), - eel_gtk_marshal_NONE__POINTER_INT_INT_INT, - GTK_TYPE_NONE, 4, + NULL, NULL, + eel_gtk_marshal_NONE__POINTER_INT_INT_INT, + G_TYPE_NONE, 4, GTK_TYPE_POINTER, GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT); signals[GET_CONTAINER_URI] - = gtk_signal_new ("get_container_uri", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("get_container_uri", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, get_container_uri), - eel_gtk_marshal_STRING__NONE, - GTK_TYPE_STRING, 0); + NULL, NULL, + eel_gtk_marshal_STRING__NONE, + G_TYPE_STRING, 0); signals[CAN_ACCEPT_ITEM] - = gtk_signal_new ("can_accept_item", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("can_accept_item", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, can_accept_item), - eel_gtk_marshal_INT__POINTER_STRING, - GTK_TYPE_INT, 2, + NULL, NULL, + eel_gtk_marshal_INT__POINTER_STRING, + GTK_TYPE_INT, 2, GTK_TYPE_POINTER, - GTK_TYPE_STRING); + G_TYPE_STRING); signals[GET_STORED_ICON_POSITION] - = gtk_signal_new ("get_stored_icon_position", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("get_stored_icon_position", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, get_stored_icon_position), - eel_gtk_marshal_BOOL__POINTER_POINTER, - GTK_TYPE_BOOL, 2, + NULL, NULL, + eel_gtk_marshal_BOOL__POINTER_POINTER, + GTK_TYPE_BOOL, 2, GTK_TYPE_POINTER, GTK_TYPE_POINTER); signals[LAYOUT_CHANGED] - = gtk_signal_new ("layout_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("layout_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, layout_changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); signals[PREVIEW] - = gtk_signal_new ("preview", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("preview", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, preview), - eel_gtk_marshal_INT__POINTER_INT, - GTK_TYPE_INT, 2, + NULL, NULL, + eel_gtk_marshal_INT__POINTER_INT, + GTK_TYPE_INT, 2, GTK_TYPE_POINTER, GTK_TYPE_BOOL); signals[BAND_SELECT_STARTED] - = gtk_signal_new ("band_select_started", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("band_select_started", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, band_select_started), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); signals[BAND_SELECT_ENDED] - = gtk_signal_new ("band_select_ended", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconContainerClass, + = g_signal_new ("band_select_ended", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconContainerClass, band_select_ended), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); /* GtkWidget class. */ @@ -3327,7 +3351,7 @@ handle_focus_out_event (GtkWidget *widget, GdkEventFocus *event, gpointer user_d } static void -nautilus_icon_container_initialize (NautilusIconContainer *container) +nautilus_icon_container_init (NautilusIconContainer *container) { NautilusIconContainerDetails *details; EelBackground *background; @@ -5128,7 +5152,7 @@ nautilus_icon_container_theme_changed (gpointer user_data) gdk_pixbuf_unref (container->details->highlight_frame); } - container->details->highlight_frame = gdk_pixbuf_new_from_file (text_frame_path); + container->details->highlight_frame = gdk_pixbuf_new_from_file (text_frame_path, NULL); g_free (text_frame_path); /* load the highlight color */ diff --git a/libnautilus-private/nautilus-icon-container.h b/libnautilus-private/nautilus-icon-container.h index 77748c6d6..02385a6cd 100644 --- a/libnautilus-private/nautilus-icon-container.h +++ b/libnautilus-private/nautilus-icon-container.h @@ -26,7 +26,7 @@ #ifndef NAUTILUS_ICON_CONTAINER_H #define NAUTILUS_ICON_CONTAINER_H -#include <libgnomeui/gnome-canvas.h> +#include <libgnomecanvas/gnome-canvas.h> #include "nautilus-icon-factory.h" #include <eel/eel-scalable-font.h> diff --git a/libnautilus-private/nautilus-icon-dnd.c b/libnautilus-private/nautilus-icon-dnd.c index e94d76452..82b79e1ec 100644 --- a/libnautilus-private/nautilus-icon-dnd.c +++ b/libnautilus-private/nautilus-icon-dnd.c @@ -48,8 +48,8 @@ #include <gtk/gtkmain.h> #include <gtk/gtksignal.h> #include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-canvas-rect-ellipse.h> -#include <libgnomeui/gnome-stock.h> +#include <libgnomecanvas/gnome-canvas-rect-ellipse.h> +#include <libgnomeui/gnome-stock-icons.h> #include <libgnomeui/gnome-uidefs.h> #include <libgnomevfs/gnome-vfs-uri.h> #include <libgnomevfs/gnome-vfs-utils.h> @@ -496,7 +496,7 @@ get_data_on_first_target_we_support (GtkWidget *widget, GdkDragContext *context, if (drop_types_list == NULL) drop_types_list = gtk_target_list_new (drop_types, - EEL_N_ELEMENTS (drop_types)); + G_N_ELEMENTS (drop_types)); for (target = context->targets; target != NULL; target = target->next) { guint dummy_info; @@ -1211,7 +1211,7 @@ nautilus_icon_dnd_init (NautilusIconContainer *container, container->details->dnd_info = g_new0 (NautilusIconDndInfo, 1); eel_drag_init (&container->details->dnd_info->drag_info, - drag_types, EEL_N_ELEMENTS (drag_types), stipple); + drag_types, G_N_ELEMENTS (drag_types), stipple); /* Set up the widget as a drag destination. * (But not a source, as drags starting from this widget will be @@ -1219,7 +1219,7 @@ nautilus_icon_dnd_init (NautilusIconContainer *container, */ gtk_drag_dest_set (GTK_WIDGET (container), 0, - drop_types, EEL_N_ELEMENTS (drop_types), + drop_types, G_N_ELEMENTS (drop_types), GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK); diff --git a/libnautilus-private/nautilus-icon-factory.c b/libnautilus-private/nautilus-icon-factory.c index 294766e6a..02c8f73b1 100644 --- a/libnautilus-private/nautilus-icon-factory.c +++ b/libnautilus-private/nautilus-icon-factory.c @@ -49,7 +49,6 @@ #include <eel/eel-string.h> #include <eel/eel-vfs-extensions.h> #include <gtk/gtksignal.h> -#include <libgnome/gnome-dentry.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> #include <libgnomevfs/gnome-vfs-file-info.h> @@ -232,8 +231,8 @@ static int cached_thumbnail_limit; /* forward declarations */ static guint nautilus_icon_factory_get_type (void); -static void nautilus_icon_factory_initialize_class (NautilusIconFactoryClass *class); -static void nautilus_icon_factory_initialize (NautilusIconFactory *factory); +static void nautilus_icon_factory_class_init (NautilusIconFactoryClass *class); +static void nautilus_icon_factory_init (NautilusIconFactory *factory); static void nautilus_icon_factory_destroy (GtkObject *object); static void icon_theme_changed_callback (gpointer user_data); static void thumbnail_limit_changed_callback (gpointer user_data); @@ -346,19 +345,19 @@ load_thumbnail_frames (NautilusIconFactory *factory) if (factory->thumbnail_frame != NULL) { gdk_pixbuf_unref (factory->thumbnail_frame); } - factory->thumbnail_frame = gdk_pixbuf_new_from_file (image_path); + factory->thumbnail_frame = gdk_pixbuf_new_from_file (image_path, NULL); g_free (image_path); image_path = nautilus_theme_get_image_path ("thumbnail_frame.aa.png"); if (factory->thumbnail_frame_aa != NULL) { gdk_pixbuf_unref (factory->thumbnail_frame_aa); } - factory->thumbnail_frame_aa = gdk_pixbuf_new_from_file (image_path); + factory->thumbnail_frame_aa = gdk_pixbuf_new_from_file (image_path, NULL); g_free (image_path); } static void -nautilus_icon_factory_initialize (NautilusIconFactory *factory) +nautilus_icon_factory_init (NautilusIconFactory *factory) { factory->scalable_icons = g_hash_table_new (nautilus_scalable_icon_hash, nautilus_scalable_icon_equal); @@ -374,21 +373,20 @@ nautilus_icon_factory_initialize (NautilusIconFactory *factory) } static void -nautilus_icon_factory_initialize_class (NautilusIconFactoryClass *class) +nautilus_icon_factory_class_init (NautilusIconFactoryClass *class) { GtkObjectClass *object_class; object_class = GTK_OBJECT_CLASS (class); signals[ICONS_CHANGED] - = gtk_signal_new ("icons_changed", - GTK_RUN_LAST, - object_class->type, - 0, - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + = g_signal_new ("icons_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + gtk_marshal_NONE__NONE, + G_TYPE_NONE, 0); object_class->destroy = nautilus_icon_factory_destroy; } @@ -1537,7 +1535,7 @@ load_icon_from_path (const char *path, return nautilus_thumbnail_load_framed_image (path, optimized_for_aa); } - return gdk_pixbuf_new_from_file (path); + return gdk_pixbuf_new_from_file (path, NULL); } static GdkPixbuf * @@ -1664,7 +1662,7 @@ load_icon_for_scaling (NautilusScalableIcon *scalable_icon, size_request.maximum_height = size_request.maximum_width; size_request.optimized_for_aa = optimized_for_aa; - for (i = 0; i < EEL_N_ELEMENTS (requests); i++) { + for (i = 0; i < G_N_ELEMENTS (requests); i++) { actual_size = 0; while (get_next_icon_size_to_try (requested_size, &actual_size)) { size_request.nominal_width = actual_size; diff --git a/libnautilus-private/nautilus-icon-factory.h b/libnautilus-private/nautilus-icon-factory.h index 4286d69dc..448389425 100644 --- a/libnautilus-private/nautilus-icon-factory.h +++ b/libnautilus-private/nautilus-icon-factory.h @@ -26,10 +26,11 @@ #ifndef NAUTILUS_ICON_FACTORY_H #define NAUTILUS_ICON_FACTORY_H -#include <gdk-pixbuf/gdk-pixbuf.h> -#include <libnautilus-private/nautilus-file.h> #include <eel/eel-string-list.h> +#include <gdk/gdktypes.h> +#include <gdk-pixbuf/gdk-pixbuf.h> #include <gtk/gtkobject.h> +#include <libnautilus-private/nautilus-file.h> /* NautilusIconFactory is a class that knows how to hand out icons to be * used for representing files and some other objects. It was designed diff --git a/libnautilus-private/nautilus-icon-text-item.c b/libnautilus-private/nautilus-icon-text-item.c index ac8940d35..35f747167 100644 --- a/libnautilus-private/nautilus-icon-text-item.c +++ b/libnautilus-private/nautilus-icon-text-item.c @@ -1170,71 +1170,77 @@ iti_class_init (NautilusIconTextItemClass *text_item_class) parent_class = gtk_type_class (gnome_canvas_item_get_type ()); - iti_signals [TEXT_CHANGED] = gtk_signal_new + iti_signals [TEXT_CHANGED] = g_signal_new ("text_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, text_changed), + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconTextItemClass, text_changed), + NULL, NULL, gtk_marshal_BOOL__NONE, GTK_TYPE_BOOL, 0); - iti_signals [TEXT_EDITED] = gtk_signal_new + iti_signals [TEXT_EDITED] = g_signal_new ("text_edited", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, text_edited), + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconTextItemClass, text_edited), + NULL, NULL, gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_NONE, 0); - iti_signals [HEIGHT_CHANGED] = gtk_signal_new + iti_signals [HEIGHT_CHANGED] = g_signal_new ("height_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, height_changed), + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconTextItemClass, height_changed), + NULL, NULL, gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_NONE, 0); - iti_signals [WIDTH_CHANGED] = gtk_signal_new + iti_signals [WIDTH_CHANGED] = g_signal_new ("width_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, width_changed), + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconTextItemClass, width_changed), + NULL, NULL, gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_NONE, 0); - iti_signals[EDITING_STARTED] = gtk_signal_new + iti_signals[EDITING_STARTED] = g_signal_new ("editing_started", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, editing_started), + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconTextItemClass, editing_started), + NULL, NULL, gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_NONE, 0); - iti_signals[EDITING_STOPPED] = gtk_signal_new + iti_signals[EDITING_STOPPED] = g_signal_new ("editing_stopped", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, editing_stopped), + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconTextItemClass, editing_stopped), + NULL, NULL, gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_NONE, 0); - iti_signals[SELECTION_STARTED] = gtk_signal_new + iti_signals[SELECTION_STARTED] = g_signal_new ("selection_started", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, selection_started), + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconTextItemClass, selection_started), + NULL, NULL, gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + G_TYPE_NONE, 0); - iti_signals[SELECTION_STOPPED] = gtk_signal_new + iti_signals[SELECTION_STOPPED] = g_signal_new ("selection_stopped", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusIconTextItemClass, selection_stopped), + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusIconTextItemClass, selection_stopped), + NULL, NULL, gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - - gtk_object_class_add_signals (object_class, iti_signals, LAST_SIGNAL); + G_TYPE_NONE, 0); object_class->destroy = iti_destroy; object_class->set_arg = iti_set_arg; diff --git a/libnautilus-private/nautilus-icon-text-item.h b/libnautilus-private/nautilus-icon-text-item.h index e895acaed..dddd53794 100644 --- a/libnautilus-private/nautilus-icon-text-item.h +++ b/libnautilus-private/nautilus-icon-text-item.h @@ -11,9 +11,8 @@ #define NAUTILUS_ICON_TEXT_ITEM_H #include <gtk/gtkeditable.h> -#include <libgnome/gnome-defs.h> -#include <libgnomeui/gnome-canvas.h> -#include <libgnomeui/gnome-icon-text.h> +#include <libgnomecanvas/gnome-canvas.h> +#include <libgnomecanvas/gnome-icon-text.h> #define NAUTILUS_ICON_TEXT_ITEM(obj) (GTK_CHECK_CAST((obj), \ nautilus_icon_text_item_get_type (), NautilusIconTextItem)) diff --git a/libnautilus-private/nautilus-keep-last-vertical-box.c b/libnautilus-private/nautilus-keep-last-vertical-box.c index a9036895b..eabdb9786 100644 --- a/libnautilus-private/nautilus-keep-last-vertical-box.c +++ b/libnautilus-private/nautilus-keep-last-vertical-box.c @@ -28,8 +28,8 @@ #include <eel/eel-gtk-macros.h> -static void nautilus_keep_last_vertical_box_initialize_class (NautilusKeepLastVerticalBoxClass *class); -static void nautilus_keep_last_vertical_box_initialize (NautilusKeepLastVerticalBox *box); +static void nautilus_keep_last_vertical_box_class_init (NautilusKeepLastVerticalBoxClass *class); +static void nautilus_keep_last_vertical_box_init (NautilusKeepLastVerticalBox *box); static void nautilus_keep_last_vertical_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation); @@ -37,7 +37,7 @@ EEL_DEFINE_CLASS_BOILERPLATE (NautilusKeepLastVerticalBox, nautilus_keep_last_ve /* Standard class initialization function */ static void -nautilus_keep_last_vertical_box_initialize_class (NautilusKeepLastVerticalBoxClass *klass) +nautilus_keep_last_vertical_box_class_init (NautilusKeepLastVerticalBoxClass *klass) { GtkWidgetClass *widget_class; @@ -48,7 +48,7 @@ nautilus_keep_last_vertical_box_initialize_class (NautilusKeepLastVerticalBoxCla /* Standard object initialization function */ static void -nautilus_keep_last_vertical_box_initialize (NautilusKeepLastVerticalBox *box) +nautilus_keep_last_vertical_box_init (NautilusKeepLastVerticalBox *box) { } diff --git a/libnautilus-private/nautilus-link-desktop-file.c b/libnautilus-private/nautilus-link-desktop-file.c index af2f0e92c..d852a485e 100644 --- a/libnautilus-private/nautilus-link-desktop-file.c +++ b/libnautilus-private/nautilus-link-desktop-file.c @@ -37,8 +37,8 @@ #include <eel/eel-stock-dialogs.h> #include <eel/eel-string.h> #include <eel/eel-xml-extensions.h> -#include <gnome-xml/parser.h> -#include <gnome-xml/xmlmemory.h> +#include <libxml/parser.h> +#include <libxml/xmlmemory.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> #include <libgnomevfs/gnome-vfs-mime.h> diff --git a/libnautilus-private/nautilus-link-desktop-file.h b/libnautilus-private/nautilus-link-desktop-file.h index 4a4d8fb22..792b88c13 100644 --- a/libnautilus-private/nautilus-link-desktop-file.h +++ b/libnautilus-private/nautilus-link-desktop-file.h @@ -27,8 +27,6 @@ #include "nautilus-file.h" #include <gdk/gdk.h> -#include <libgnome/gnome-defs.h> -#include <libgnome/gnome-dentry.h> gboolean nautilus_link_desktop_file_local_create (const char *directory_path, diff --git a/libnautilus-private/nautilus-link-historical.c b/libnautilus-private/nautilus-link-historical.c index 4640f6600..b3dadc3d2 100644 --- a/libnautilus-private/nautilus-link-historical.c +++ b/libnautilus-private/nautilus-link-historical.c @@ -38,8 +38,8 @@ #include <eel/eel-string.h> #include <eel/eel-vfs-extensions.h> #include <eel/eel-xml-extensions.h> -#include <gnome-xml/parser.h> -#include <gnome-xml/xmlmemory.h> +#include <libxml/parser.h> +#include <libxml/xmlmemory.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> #include <libgnomevfs/gnome-vfs-mime.h> diff --git a/libnautilus-private/nautilus-link-historical.h b/libnautilus-private/nautilus-link-historical.h index b181ec7af..b9781d04e 100644 --- a/libnautilus-private/nautilus-link-historical.h +++ b/libnautilus-private/nautilus-link-historical.h @@ -28,8 +28,6 @@ #include "nautilus-file.h" #include <gdk/gdk.h> -#include <libgnome/gnome-defs.h> -#include <libgnome/gnome-dentry.h> gboolean nautilus_link_historical_local_create (const char *directory_path, const char *name, diff --git a/libnautilus-private/nautilus-link.h b/libnautilus-private/nautilus-link.h index a1864b91d..4fa6f7875 100644 --- a/libnautilus-private/nautilus-link.h +++ b/libnautilus-private/nautilus-link.h @@ -28,8 +28,6 @@ #include "nautilus-file.h" #include <gdk/gdk.h> -#include <libgnome/gnome-defs.h> -#include <libgnome/gnome-dentry.h> /* Link types */ typedef enum { @@ -112,8 +110,11 @@ char * nautilus_link_get_link_name_given_file_contents (const char int link_file_size); char * nautilus_link_get_link_icon_given_file_contents (const char *file_contents, int link_file_size); + +#ifdef GNOME2_CONVERSION_COMPLETE void nautilus_link_local_create_from_gnome_entry (GnomeDesktopEntry *entry, const char *dest_path, const GdkPoint *position); +#endif #endif /* NAUTILUS_LINK_H */ diff --git a/libnautilus-private/nautilus-medusa-support.c b/libnautilus-private/nautilus-medusa-support.c index 0af87810e..92f5d23e1 100644 --- a/libnautilus-private/nautilus-medusa-support.c +++ b/libnautilus-private/nautilus-medusa-support.c @@ -26,7 +26,6 @@ #include <config.h> #include "nautilus-medusa-support.h" -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> #include <eel/eel-glib-extensions.h> diff --git a/libnautilus-private/nautilus-merged-directory.c b/libnautilus-private/nautilus-merged-directory.c index 5cff8e9b0..c641c32ee 100644 --- a/libnautilus-private/nautilus-merged-directory.c +++ b/libnautilus-private/nautilus-merged-directory.c @@ -68,9 +68,9 @@ enum { static guint signals[LAST_SIGNAL]; -static void nautilus_merged_directory_initialize (gpointer object, +static void nautilus_merged_directory_init (gpointer object, gpointer klass); -static void nautilus_merged_directory_initialize_class (gpointer klass); +static void nautilus_merged_directory_class_init (gpointer klass); static void remove_all_real_directories (NautilusMergedDirectory *merged); static guint merged_callback_hash (gconstpointer merged_callback); static gboolean merged_callback_equal (gconstpointer merged_callback, @@ -81,7 +81,7 @@ EEL_DEFINE_CLASS_BOILERPLATE (NautilusMergedDirectory, NAUTILUS_TYPE_DIRECTORY) static void -nautilus_merged_directory_initialize (gpointer object, gpointer klass) +nautilus_merged_directory_init (gpointer object, gpointer klass) { NautilusMergedDirectory *merged; @@ -622,7 +622,7 @@ remove_all_real_directories (NautilusMergedDirectory *merged) } static void -nautilus_merged_directory_initialize_class (gpointer klass) +nautilus_merged_directory_class_init (gpointer klass) { GtkObjectClass *object_class; NautilusDirectoryClass *directory_class; @@ -647,21 +647,21 @@ nautilus_merged_directory_initialize_class (gpointer klass) merged_directory_class->remove_real_directory = merged_remove_real_directory; signals[ADD_REAL_DIRECTORY] - = gtk_signal_new ("add_real_directory", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusMergedDirectoryClass, + = g_signal_new ("add_real_directory", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusMergedDirectoryClass, add_real_directory), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[REMOVE_REAL_DIRECTORY] - = gtk_signal_new ("remove_real_directory", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusMergedDirectoryClass, + = g_signal_new ("remove_real_directory", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusMergedDirectoryClass, remove_real_directory), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); } diff --git a/libnautilus-private/nautilus-metafile.c b/libnautilus-private/nautilus-metafile.c index d5eb04488..df3deb6ac 100644 --- a/libnautilus-private/nautilus-metafile.c +++ b/libnautilus-private/nautilus-metafile.c @@ -1852,7 +1852,7 @@ metafile_read_done_callback (GnomeVFSResult result, return; } - /* The gnome-xml parser requires a zero-terminated array. */ + /* The libxml parser requires a zero-terminated array. */ buffer = g_realloc (file_contents, size + 1); buffer[size] = '\0'; nautilus_metafile_set_metafile_contents (metafile, diff --git a/libnautilus-private/nautilus-mime-actions.c b/libnautilus-private/nautilus-mime-actions.c index 28bc9e44f..0728493aa 100644 --- a/libnautilus-private/nautilus-mime-actions.c +++ b/libnautilus-private/nautilus-mime-actions.c @@ -46,7 +46,7 @@ static gboolean string_not_in_list (const char GList *list); static char *mime_type_get_supertype (const char *mime_type); static GList *get_explicit_content_view_iids_from_metafile (NautilusFile *file); -static gboolean server_has_content_requirements (OAF_ServerInfo *server); +static gboolean server_has_content_requirements (Bonobo_ServerInfo *server); static gboolean application_supports_uri_scheme (gpointer data, gpointer uri_scheme); static GList *nautilus_do_component_query (const char *mime_type, @@ -297,10 +297,10 @@ nautilus_mime_get_default_component_sort_conditions (NautilusFile *file, char *d prev = sort_conditions[1]; if (p->next != NULL) { - sort_conditions[1] = g_strconcat (prev, ((OAF_ServerInfo *) (p->data))->iid, + sort_conditions[1] = g_strconcat (prev, ((Bonobo_ServerInfo *) (p->data))->iid, "','", NULL); } else { - sort_conditions[1] = g_strconcat (prev, ((OAF_ServerInfo *) (p->data))->iid, + sort_conditions[1] = g_strconcat (prev, ((Bonobo_ServerInfo *) (p->data))->iid, "'])", NULL); } g_free (prev); @@ -334,18 +334,18 @@ nautilus_mime_get_default_component_sort_conditions (NautilusFile *file, char *d return sort_conditions; } -static OAF_ServerInfo * +static Bonobo_ServerInfo * nautilus_mime_get_default_component_for_file_internal (NautilusFile *file, gboolean *user_chosen) { GList *info_list; - OAF_ServerInfo *mime_default; + Bonobo_ServerInfo *mime_default; char *default_component_string; char *mime_type; char *uri_scheme; GList *item_mime_types; GList *explicit_iids; - OAF_ServerInfo *server; + Bonobo_ServerInfo *server; char **sort_conditions; char *extra_requirements; gboolean used_user_chosen_info; @@ -408,7 +408,7 @@ nautilus_mime_get_default_component_for_file_internal (NautilusFile *file, } if (info_list != NULL) { - server = OAF_ServerInfo_duplicate (info_list->data); + server = Bonobo_ServerInfo_duplicate (info_list->data); gnome_vfs_mime_component_list_free (info_list); if (default_component_string != NULL && strcmp (server->iid, default_component_string) == 0) { @@ -433,7 +433,7 @@ nautilus_mime_get_default_component_for_file_internal (NautilusFile *file, } -OAF_ServerInfo * +Bonobo_ServerInfo * nautilus_mime_get_default_component_for_file (NautilusFile *file) { return nautilus_mime_get_default_component_for_file_internal (file, NULL); @@ -442,7 +442,7 @@ nautilus_mime_get_default_component_for_file (NautilusFile *file) gboolean nautilus_mime_is_default_component_for_file_user_chosen (NautilusFile *file) { - OAF_ServerInfo *component; + Bonobo_ServerInfo *component; gboolean user_chosen; component = nautilus_mime_get_default_component_for_file_internal (file, &user_chosen); @@ -557,7 +557,7 @@ nautilus_mime_get_short_list_components_for_file (NautilusFile *file) GList *metadata_component_add_ids; GList *metadata_component_remove_ids; GList *p; - OAF_ServerInfo *component; + Bonobo_ServerInfo *component; GList *explicit_iids; char *extra_sort_conditions[2]; char *extra_requirements; @@ -589,7 +589,7 @@ nautilus_mime_get_short_list_components_for_file (NautilusFile *file) iids = NULL; for (p = servers; p != NULL; p = p->next) { - component = (OAF_ServerInfo *) p->data; + component = (Bonobo_ServerInfo *) p->data; iids = g_list_prepend (iids, component->iid); } @@ -751,7 +751,7 @@ nautilus_mime_actions_file_needs_full_file_attributes (NautilusFile *file) needs_full_attributes = FALSE; for (p = info_list; p != NULL; p = p->next) { - needs_full_attributes |= server_has_content_requirements ((OAF_ServerInfo *) (p->data)); + needs_full_attributes |= server_has_content_requirements ((Bonobo_ServerInfo *) (p->data)); } gnome_vfs_mime_component_list_free (info_list); @@ -968,7 +968,7 @@ nautilus_mime_set_short_list_components_for_file (NautilusFile *file, normal_short_list_ids = NULL; for (p = normal_short_list; p != NULL; p = p->next) { - normal_short_list_ids = g_list_prepend (normal_short_list_ids, ((OAF_ServerInfo *) p->data)->iid); + normal_short_list_ids = g_list_prepend (normal_short_list_ids, ((Bonobo_ServerInfo *) p->data)->iid); } /* compute delta */ @@ -1241,7 +1241,7 @@ get_explicit_content_view_iids_from_metafile (NautilusFile *file) } static char * -make_oaf_query_for_explicit_content_view_iids (GList *view_iids) +make_bonobo_activation_query_for_explicit_content_view_iids (GList *view_iids) { GList *p; char *iid; @@ -1278,7 +1278,7 @@ make_oaf_query_for_explicit_content_view_iids (GList *view_iids) } static char * -make_oaf_query_with_known_mime_type (const char *mime_type, +make_bonobo_activation_query_with_known_mime_type (const char *mime_type, const char *uri_scheme, GList *explicit_iids, const char *extra_requirements) @@ -1289,7 +1289,7 @@ make_oaf_query_with_known_mime_type (const char *mime_type, mime_supertype = mime_type_get_supertype (mime_type); - explicit_iid_query = make_oaf_query_for_explicit_content_view_iids (explicit_iids); + explicit_iid_query = make_bonobo_activation_query_for_explicit_content_view_iids (explicit_iids); result = g_strdup_printf ( @@ -1380,14 +1380,14 @@ make_oaf_query_with_known_mime_type (const char *mime_type, } static char * -make_oaf_query_with_uri_scheme_only (const char *uri_scheme, +make_bonobo_activation_query_with_uri_scheme_only (const char *uri_scheme, GList *explicit_iids, const char *extra_requirements) { char *result; char *explicit_iid_query; - explicit_iid_query = make_oaf_query_for_explicit_content_view_iids (explicit_iids); + explicit_iid_query = make_bonobo_activation_query_for_explicit_content_view_iids (explicit_iids); result = g_strdup_printf ( @@ -1495,11 +1495,11 @@ mime_type_hash_table_destroy (GHashTable *table) static gboolean -server_has_content_requirements (OAF_ServerInfo *server) +server_has_content_requirements (Bonobo_ServerInfo *server) { OAF_Property *prop; - prop = oaf_server_info_prop_find (server, "nautilus:required_directory_content_mime_types"); + prop = bonobo_activation_server_info_prop_find (server, "nautilus:required_directory_content_mime_types"); if (prop == NULL || prop->v._d != OAF_P_STRINGV) { return FALSE; @@ -1509,7 +1509,7 @@ server_has_content_requirements (OAF_ServerInfo *server) } static gboolean -server_matches_content_requirements (OAF_ServerInfo *server, +server_matches_content_requirements (Bonobo_ServerInfo *server, GHashTable *type_table, GList *explicit_iids) { @@ -1525,7 +1525,7 @@ server_matches_content_requirements (OAF_ServerInfo *server, if (!server_has_content_requirements (server)) { return TRUE; } else { - prop = oaf_server_info_prop_find (server, "nautilus:required_directory_content_mime_types"); + prop = bonobo_activation_server_info_prop_find (server, "nautilus:required_directory_content_mime_types"); types = prop->v._u.value_stringv; @@ -1560,42 +1560,42 @@ nautilus_do_component_query (const char *mime_type, char **extra_sort_criteria, char *extra_requirements) { - OAF_ServerInfoList *oaf_result; + Bonobo_ServerInfoList *bonobo_activation_result; char *query; GList *retval; char **all_sort_criteria; CORBA_Environment ev; - oaf_result = NULL; + bonobo_activation_result = NULL; query = NULL; if (is_known_mime_type (mime_type)) { - query = make_oaf_query_with_known_mime_type (mime_type, uri_scheme, explicit_iids, extra_requirements); + query = make_bonobo_activation_query_with_known_mime_type (mime_type, uri_scheme, explicit_iids, extra_requirements); } else { - query = make_oaf_query_with_uri_scheme_only (uri_scheme, explicit_iids, extra_requirements); + query = make_bonobo_activation_query_with_uri_scheme_only (uri_scheme, explicit_iids, extra_requirements); } all_sort_criteria = strv_concat (extra_sort_criteria, nautilus_sort_criteria); CORBA_exception_init (&ev); - oaf_result = oaf_query (query, all_sort_criteria, &ev); + bonobo_activation_result = bonobo_activation_query (query, all_sort_criteria, &ev); g_free (all_sort_criteria); g_free (query); retval = NULL; - if (ev._major == CORBA_NO_EXCEPTION && oaf_result != NULL && oaf_result->_length > 0) { + if (ev._major == CORBA_NO_EXCEPTION && bonobo_activation_result != NULL && bonobo_activation_result->_length > 0) { GHashTable *content_types; guint i; content_types = mime_type_list_to_hash_table (item_mime_types); - for (i = 0; i < oaf_result->_length; i++) { - OAF_ServerInfo *server; + for (i = 0; i < bonobo_activation_result->_length; i++) { + Bonobo_ServerInfo *server; - server = &oaf_result->_buffer[i]; + server = &bonobo_activation_result->_buffer[i]; if (ignore_content_mime_types || server_matches_content_requirements (server, content_types, explicit_iids)) { @@ -1605,7 +1605,7 @@ nautilus_do_component_query (const char *mime_type, if (server->iid != NULL && strcmp (server->iid, "OAFIID:Bonobo_Sample_Text") != 0) { retval = g_list_prepend (retval, - OAF_ServerInfo_duplicate (server)); + Bonobo_ServerInfo_duplicate (server)); } } } @@ -1613,7 +1613,7 @@ nautilus_do_component_query (const char *mime_type, mime_type_hash_table_destroy (content_types); } - CORBA_free (oaf_result); + CORBA_free (bonobo_activation_result); CORBA_exception_free (&ev); diff --git a/libnautilus-private/nautilus-monitor.c b/libnautilus-private/nautilus-monitor.c index a0155838a..6d679005d 100644 --- a/libnautilus-private/nautilus-monitor.c +++ b/libnautilus-private/nautilus-monitor.c @@ -35,7 +35,6 @@ #include <fam.h> #include <gdk/gdk.h> #include <gmodule.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-util.h> #include <libgnomevfs/gnome-vfs-utils.h> diff --git a/libnautilus-private/nautilus-program-chooser.c b/libnautilus-private/nautilus-program-chooser.c index fb1d96c9a..49ba03218 100644 --- a/libnautilus-private/nautilus-program-chooser.c +++ b/libnautilus-private/nautilus-program-chooser.c @@ -42,9 +42,8 @@ #include <gtk/gtkradiobutton.h> #include <gtk/gtkscrolledwindow.h> #include <gtk/gtkvbox.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-stock.h> +#include <libgnomeui/gnome-stock-icons.h> #include <libgnomeui/gnome-uidefs.h> enum { @@ -146,7 +145,7 @@ program_file_pair_set_file (ProgramFilePair *pair, NautilusFile *file) } static ProgramFilePair * -program_file_pair_new_from_content_view (OAF_ServerInfo *content_view, NautilusFile *file) +program_file_pair_new_from_content_view (Bonobo_ServerInfo *content_view, NautilusFile *file) { ProgramFilePair *new_pair; @@ -358,7 +357,7 @@ repopulate_program_list (GnomeDialog *program_chooser, if (type == GNOME_VFS_MIME_ACTION_TYPE_COMPONENT) { pair = program_file_pair_new_from_content_view - ((OAF_ServerInfo *)program->data, file); + ((Bonobo_ServerInfo *)program->data, file); } else { pair = program_file_pair_new_from_application ((GnomeVFSMimeApplication *)program->data, file); @@ -468,7 +467,7 @@ compare_mime_applications (GnomeVFSMimeApplication *app_1, GnomeVFSMimeApplicati } static gint -compare_component_with_view (OAF_ServerInfo *info, NautilusViewIdentifier *identifier) +compare_component_with_view (Bonobo_ServerInfo *info, NautilusViewIdentifier *identifier) { return strcmp (info->iid, identifier->iid); } @@ -492,7 +491,7 @@ is_application_default_for_type (GnomeVFSMimeApplication *application, const cha static gboolean is_component_default_for_type (NautilusViewIdentifier *identifier, const char *mime_type) { - OAF_ServerInfo *default_component; + Bonobo_ServerInfo *default_component; gboolean result; g_assert (identifier != NULL); @@ -525,7 +524,7 @@ is_application_default_for_file (GnomeVFSMimeApplication *application, static gboolean is_component_default_for_file (NautilusViewIdentifier *identifier, NautilusFile *file) { - OAF_ServerInfo *default_component; + Bonobo_ServerInfo *default_component; gboolean result; g_assert (identifier != NULL); diff --git a/libnautilus-private/nautilus-search-uri.c b/libnautilus-private/nautilus-search-uri.c index 67337b2ac..7bfba1fd1 100644 --- a/libnautilus-private/nautilus-search-uri.c +++ b/libnautilus-private/nautilus-search-uri.c @@ -25,7 +25,6 @@ #include "nautilus-search-uri.h" /* Must be included before other libgnome headers. */ -#include <libgnome/gnome-defs.h> #include "nautilus-lib-self-check-functions.h" #include <eel/eel-glib-extensions.h> diff --git a/libnautilus-private/nautilus-sidebar-functions.c b/libnautilus-private/nautilus-sidebar-functions.c index f456d6056..f691a8441 100644 --- a/libnautilus-private/nautilus-sidebar-functions.c +++ b/libnautilus-private/nautilus-sidebar-functions.c @@ -29,7 +29,7 @@ #include "nautilus-view-identifier.h" #include <eel/eel-glib-extensions.h> #include <eel/eel-string.h> -#include <liboaf/liboaf.h> +#include <bonobo-activation/bonobo-activation.h> #define PREFERENCES_SIDEBAR_PANEL_PREFIX "sidebar-panels" @@ -97,7 +97,7 @@ sidebar_get_sidebar_panel_view_identifiers (void) { CORBA_Environment ev; const char *query; - OAF_ServerInfoList *oaf_result; + Bonobo_ServerInfoList *bonobo_activation_result; guint i; NautilusViewIdentifier *id; GList *view_identifiers; @@ -106,21 +106,21 @@ sidebar_get_sidebar_panel_view_identifiers (void) query = "nautilus:sidebar_panel_name.defined() AND repo_ids.has ('IDL:Bonobo/Control:1.0')"; - oaf_result = oaf_query (query, NULL, &ev); + bonobo_activation_result = bonobo_activation_query (query, NULL, &ev); view_identifiers = NULL; - if (ev._major == CORBA_NO_EXCEPTION && oaf_result != NULL) { - for (i = 0; i < oaf_result->_length; i++) { + if (ev._major == CORBA_NO_EXCEPTION && bonobo_activation_result != NULL) { + for (i = 0; i < bonobo_activation_result->_length; i++) { id = nautilus_view_identifier_new_from_sidebar_panel - (&oaf_result->_buffer[i]); + (&bonobo_activation_result->_buffer[i]); view_identifiers = g_list_prepend (view_identifiers, id); } view_identifiers = g_list_reverse (view_identifiers); } - if (oaf_result != NULL) { - CORBA_free (oaf_result); + if (bonobo_activation_result != NULL) { + CORBA_free (bonobo_activation_result); } CORBA_exception_free (&ev); diff --git a/libnautilus-private/nautilus-sound.c b/libnautilus-private/nautilus-sound.c index 618d32747..22920a940 100644 --- a/libnautilus-private/nautilus-sound.c +++ b/libnautilus-private/nautilus-sound.c @@ -64,7 +64,7 @@ kill_sound_if_necessary (void) /* initialize_sound is called at application start up time. It puts the sound system into a quiescent state */ void -nautilus_sound_initialize (void) +nautilus_sound_init (void) { eel_gconf_set_integer (CURRENT_SOUND_STATE_KEY, 0); eel_gconf_suggest_sync (); @@ -96,7 +96,7 @@ nautilus_sound_register_sound (pid_t sound_process) /* This function does two things. First it checks to see a sound is currently playing. If it is, * it returns the process id of the external application playing the sound. If no sound is playing, - * it return the value set in nautilus_sound_initialize() when system audio output capabilites + * it return the value set in nautilus_sound_init() when system audio output capabilites * were queried. */ gboolean diff --git a/libnautilus-private/nautilus-sound.h b/libnautilus-private/nautilus-sound.h index 3083c32a9..f71694809 100644 --- a/libnautilus-private/nautilus-sound.h +++ b/libnautilus-private/nautilus-sound.h @@ -28,7 +28,7 @@ #include <glib.h> #include <sys/wait.h> -void nautilus_sound_initialize (void); +void nautilus_sound_init (void); gboolean nautilus_sound_can_play_sound (void); void nautilus_sound_kill_sound (void); void nautilus_sound_register_sound (pid_t sound_process); diff --git a/libnautilus-private/nautilus-theme.c b/libnautilus-private/nautilus-theme.c index 1c1492f4f..cfcd50304 100644 --- a/libnautilus-private/nautilus-theme.c +++ b/libnautilus-private/nautilus-theme.c @@ -37,7 +37,6 @@ #include <eel/eel-xml-extensions.h> #include <libxml/parser.h> #include <libxml/xmlmemory.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> #include <libgnome/gnome-util.h> @@ -338,7 +337,7 @@ nautilus_theme_make_preview_pixbuf (const char *theme_name) pixbuf_file = nautilus_pixmap_file (theme_preview_name); if (pixbuf_file != NULL) { - pixbuf = gdk_pixbuf_new_from_file (pixbuf_file); + pixbuf = gdk_pixbuf_new_from_file (pixbuf_file, NULL); g_free (pixbuf_file); return pixbuf; } else { @@ -348,7 +347,7 @@ nautilus_theme_make_preview_pixbuf (const char *theme_name) g_free (user_themes_directory); if (g_file_exists (pixbuf_file)) { - pixbuf = gdk_pixbuf_new_from_file (pixbuf_file); + pixbuf = gdk_pixbuf_new_from_file (pixbuf_file, NULL); g_free (pixbuf_file); return pixbuf; } else { @@ -406,7 +405,7 @@ nautilus_theme_make_preview_pixbuf (const char *theme_name) } } else { - pixbuf = gdk_pixbuf_new_from_file (pixbuf_file); + pixbuf = gdk_pixbuf_new_from_file (pixbuf_file, NULL); } g_free (pixbuf_file); diff --git a/libnautilus-private/nautilus-thumbnails-jpeg.c b/libnautilus-private/nautilus-thumbnails-jpeg.c index d4f1bf11b..0afea9e90 100644 --- a/libnautilus-private/nautilus-thumbnails-jpeg.c +++ b/libnautilus-private/nautilus-thumbnails-jpeg.c @@ -83,7 +83,7 @@ fill_input_buffer (j_decompress_ptr cinfo) src = (Source *) cinfo->src; result = gnome_vfs_read (src->handle, src->buffer, - EEL_N_ELEMENTS (src->buffer), + G_N_ELEMENTS (src->buffer), &nbytes); if (result != GNOME_VFS_OK || nbytes == 0) { diff --git a/libnautilus-private/nautilus-thumbnails.c b/libnautilus-private/nautilus-thumbnails.c index 83b233865..2df7d4526 100644 --- a/libnautilus-private/nautilus-thumbnails.c +++ b/libnautilus-private/nautilus-thumbnails.c @@ -687,7 +687,7 @@ nautilus_thumbnail_load_framed_image (const char *path, gboolean anti_aliased_fr int left_offset, top_offset, right_offset, bottom_offset; char c; - pixbuf = gdk_pixbuf_new_from_file (path); + pixbuf = gdk_pixbuf_new_from_file (path, NULL); if (pixbuf == NULL || pixbuf_is_framed (pixbuf)) { return pixbuf; } diff --git a/libnautilus-private/nautilus-trash-directory.c b/libnautilus-private/nautilus-trash-directory.c index 95297faff..6c80505fc 100644 --- a/libnautilus-private/nautilus-trash-directory.c +++ b/libnautilus-private/nautilus-trash-directory.c @@ -35,7 +35,6 @@ #include "nautilus-volume-monitor.h" #include <gtk/gtksignal.h> #include <gtk/gtkmain.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> struct NautilusTrashDirectoryDetails { @@ -50,9 +49,9 @@ typedef struct { NautilusDirectory *real_directory; } TrashVolume; -static void nautilus_trash_directory_initialize (gpointer object, +static void nautilus_trash_directory_init (gpointer object, gpointer klass); -static void nautilus_trash_directory_initialize_class (gpointer klass); +static void nautilus_trash_directory_class_init (gpointer klass); static void add_volume (NautilusTrashDirectory *trash, NautilusVolume *volume); @@ -305,7 +304,7 @@ volume_mounted_callback (NautilusVolumeMonitor *monitor, } static void -nautilus_trash_directory_initialize (gpointer object, gpointer klass) +nautilus_trash_directory_init (gpointer object, gpointer klass) { NautilusTrashDirectory *trash; NautilusVolumeMonitor *volume_monitor; @@ -326,7 +325,7 @@ nautilus_trash_directory_initialize (gpointer object, gpointer klass) } /* Finish initializing a new NautilusTrashDirectory. We have to do the - * remaining initialization here rather than in nautilus_trash_directory_initialize + * remaining initialization here rather than in nautilus_trash_directory_init * because of a cyclic dependency between the NautilusTrashDirectory and * NautilusTrashMonitor instances. */ @@ -389,7 +388,7 @@ trash_get_name_for_self_as_new_file (NautilusDirectory *directory) } static void -nautilus_trash_directory_initialize_class (gpointer klass) +nautilus_trash_directory_class_init (gpointer klass) { GtkObjectClass *object_class; NautilusDirectoryClass *directory_class; diff --git a/libnautilus-private/nautilus-trash-file.c b/libnautilus-private/nautilus-trash-file.c index b51849bb9..cb0070dc2 100644 --- a/libnautilus-private/nautilus-trash-file.c +++ b/libnautilus-private/nautilus-trash-file.c @@ -35,7 +35,6 @@ #include <eel/eel-gtk-macros.h> #include "nautilus-trash-directory.h" #include <gtk/gtksignal.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> #include <string.h> @@ -77,9 +76,9 @@ static const char * const delegated_attributes[] = { NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_MIME_TYPES }; -static void nautilus_trash_file_initialize (gpointer object, +static void nautilus_trash_file_init (gpointer object, gpointer klass); -static void nautilus_trash_file_initialize_class (gpointer klass); +static void nautilus_trash_file_class_init (gpointer klass); EEL_DEFINE_CLASS_BOILERPLATE (NautilusTrashFile, nautilus_trash_file, @@ -92,7 +91,7 @@ is_delegated_attribute (const char *attribute) g_return_val_if_fail (attribute != NULL, FALSE); - for (i = 0; i < EEL_N_ELEMENTS (delegated_attributes); i++) { + for (i = 0; i < G_N_ELEMENTS (delegated_attributes); i++) { if (strcmp (attribute, delegated_attributes[i]) == 0) { return TRUE; } @@ -735,7 +734,7 @@ remove_all_real_files (NautilusTrashFile *trash) } static void -nautilus_trash_file_initialize (gpointer object, gpointer klass) +nautilus_trash_file_init (gpointer object, gpointer klass) { NautilusTrashFile *trash_file; NautilusTrashDirectory *trash_directory; @@ -805,7 +804,7 @@ trash_destroy (GtkObject *object) } static void -nautilus_trash_file_initialize_class (gpointer klass) +nautilus_trash_file_class_init (gpointer klass) { GtkObjectClass *object_class; NautilusFileClass *file_class; diff --git a/libnautilus-private/nautilus-trash-monitor.c b/libnautilus-private/nautilus-trash-monitor.c index 64da6584d..a53c3dc33 100644 --- a/libnautilus-private/nautilus-trash-monitor.c +++ b/libnautilus-private/nautilus-trash-monitor.c @@ -51,15 +51,15 @@ enum { static guint signals[LAST_SIGNAL]; static NautilusTrashMonitor *nautilus_trash_monitor; -static void nautilus_trash_monitor_initialize_class (NautilusTrashMonitorClass *klass); -static void nautilus_trash_monitor_initialize (gpointer object, +static void nautilus_trash_monitor_class_init (NautilusTrashMonitorClass *klass); +static void nautilus_trash_monitor_init (gpointer object, gpointer klass); static void destroy (GtkObject *object); EEL_DEFINE_CLASS_BOILERPLATE (NautilusTrashMonitor, nautilus_trash_monitor, GTK_TYPE_OBJECT) static void -nautilus_trash_monitor_initialize_class (NautilusTrashMonitorClass *klass) +nautilus_trash_monitor_class_init (NautilusTrashMonitorClass *klass) { GtkObjectClass *object_class; @@ -67,25 +67,25 @@ nautilus_trash_monitor_initialize_class (NautilusTrashMonitorClass *klass) object_class->destroy = destroy; - signals[TRASH_STATE_CHANGED] = gtk_signal_new + signals[TRASH_STATE_CHANGED] = g_signal_new ("trash_state_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusTrashMonitorClass, trash_state_changed), + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusTrashMonitorClass, trash_state_changed), + NULL, NULL, gtk_marshal_NONE__BOOL, - GTK_TYPE_NONE, 1, + G_TYPE_NONE, 1, GTK_TYPE_BOOL); - signals[CHECK_TRASH_DIRECTORY_ADDED] = gtk_signal_new + signals[CHECK_TRASH_DIRECTORY_ADDED] = g_signal_new ("check_trash_directory_added", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusTrashMonitorClass, check_trash_directory_added), + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusTrashMonitorClass, check_trash_directory_added), + NULL, NULL, gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); } static void @@ -119,7 +119,7 @@ nautilus_trash_files_changed_callback (NautilusDirectory *directory, GList *file } static void -nautilus_trash_monitor_initialize (gpointer object, gpointer klass) +nautilus_trash_monitor_init (gpointer object, gpointer klass) { NautilusDirectory *trash_directory; NautilusTrashMonitor *trash_monitor; diff --git a/libnautilus-private/nautilus-undo-context.c b/libnautilus-private/nautilus-undo-context.c index 279d010b9..d12c34ce8 100644 --- a/libnautilus-private/nautilus-undo-context.c +++ b/libnautilus-private/nautilus-undo-context.c @@ -37,8 +37,8 @@ typedef struct { } impl_POA_Nautilus_Undo_Context; /* GtkObject */ -static void nautilus_undo_context_initialize_class (NautilusUndoContextClass *class); -static void nautilus_undo_context_initialize (NautilusUndoContext *item); +static void nautilus_undo_context_class_init (NautilusUndoContextClass *class); +static void nautilus_undo_context_init (NautilusUndoContext *item); static void destroy (GtkObject *object); /* CORBA/Bonobo */ @@ -128,7 +128,7 @@ nautilus_undo_context_new (Nautilus_Undo_Manager undo_manager) } static void -nautilus_undo_context_initialize (NautilusUndoContext *context) +nautilus_undo_context_init (NautilusUndoContext *context) { CORBA_Environment ev; @@ -157,7 +157,7 @@ destroy (GtkObject *object) } static void -nautilus_undo_context_initialize_class (NautilusUndoContextClass *klass) +nautilus_undo_context_class_init (NautilusUndoContextClass *klass) { GTK_OBJECT_CLASS (klass)->destroy = destroy; } diff --git a/libnautilus-private/nautilus-undo-manager.c b/libnautilus-private/nautilus-undo-manager.c index ea92de5e0..d82a6210f 100644 --- a/libnautilus-private/nautilus-undo-manager.c +++ b/libnautilus-private/nautilus-undo-manager.c @@ -68,8 +68,8 @@ typedef struct { } UndoMenuHandlerConnection; /* GtkObject */ -static void nautilus_undo_manager_initialize_class (NautilusUndoManagerClass *class); -static void nautilus_undo_manager_initialize (NautilusUndoManager *item); +static void nautilus_undo_manager_class_init (NautilusUndoManagerClass *class); +static void nautilus_undo_manager_init (NautilusUndoManager *item); static void destroy (GtkObject *object); /* CORBA/Bonobo */ @@ -237,7 +237,7 @@ nautilus_undo_manager_new (void) } static void -nautilus_undo_manager_initialize (NautilusUndoManager *manager) +nautilus_undo_manager_init (NautilusUndoManager *manager) { CORBA_Environment ev; @@ -252,7 +252,7 @@ nautilus_undo_manager_initialize (NautilusUndoManager *manager) } static void -nautilus_undo_manager_initialize_class (NautilusUndoManagerClass *klass) +nautilus_undo_manager_class_init (NautilusUndoManagerClass *klass) { GtkObjectClass *object_class; @@ -262,16 +262,15 @@ nautilus_undo_manager_initialize_class (NautilusUndoManagerClass *klass) object_class->destroy = destroy; - signals[CHANGED] = gtk_signal_new + signals[CHANGED] = g_signal_new ("changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusUndoManagerClass, + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusUndoManagerClass, changed), + NULL, NULL, gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + G_TYPE_NONE, 0); } void diff --git a/libnautilus-private/nautilus-undo-signal-handlers.c b/libnautilus-private/nautilus-undo-signal-handlers.c index 6cd4ab129..2d708b312 100644 --- a/libnautilus-private/nautilus-undo-signal-handlers.c +++ b/libnautilus-private/nautilus-undo-signal-handlers.c @@ -26,7 +26,6 @@ #include <config.h> #include <gtk/gtk.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> #include <libnautilus/nautilus-undo.h> diff --git a/libnautilus-private/nautilus-vfs-directory.c b/libnautilus-private/nautilus-vfs-directory.c index e8446a8d2..d209c040c 100644 --- a/libnautilus-private/nautilus-vfs-directory.c +++ b/libnautilus-private/nautilus-vfs-directory.c @@ -34,16 +34,16 @@ struct NautilusVFSDirectoryDetails { char dummy; /* ANSI C does not allow empty structs */ }; -static void nautilus_vfs_directory_initialize (gpointer object, +static void nautilus_vfs_directory_init (gpointer object, gpointer klass); -static void nautilus_vfs_directory_initialize_class (gpointer klass); +static void nautilus_vfs_directory_class_init (gpointer klass); EEL_DEFINE_CLASS_BOILERPLATE (NautilusVFSDirectory, nautilus_vfs_directory, NAUTILUS_TYPE_DIRECTORY) static void -nautilus_vfs_directory_initialize (gpointer object, gpointer klass) +nautilus_vfs_directory_init (gpointer object, gpointer klass) { NautilusVFSDirectory *directory; @@ -179,7 +179,7 @@ vfs_is_not_empty (NautilusDirectory *directory) } static void -nautilus_vfs_directory_initialize_class (gpointer klass) +nautilus_vfs_directory_class_init (gpointer klass) { GtkObjectClass *object_class; NautilusDirectoryClass *directory_class; diff --git a/libnautilus-private/nautilus-vfs-file.c b/libnautilus-private/nautilus-vfs-file.c index 0a0e42e36..92ec388c7 100644 --- a/libnautilus-private/nautilus-vfs-file.c +++ b/libnautilus-private/nautilus-vfs-file.c @@ -34,9 +34,9 @@ struct NautilusVFSFileDetails { char dummy; /* ANSI C does not allow empty structs */ }; -static void nautilus_vfs_file_initialize (gpointer object, +static void nautilus_vfs_file_init (gpointer object, gpointer klass); -static void nautilus_vfs_file_initialize_class (gpointer klass); +static void nautilus_vfs_file_class_init (gpointer klass); EEL_DEFINE_CLASS_BOILERPLATE (NautilusVFSFile, nautilus_vfs_file, @@ -233,7 +233,7 @@ vfs_file_get_where_string (NautilusFile *file) } static void -nautilus_vfs_file_initialize (gpointer object, gpointer klass) +nautilus_vfs_file_init (gpointer object, gpointer klass) { NautilusVFSFile *file; @@ -255,7 +255,7 @@ vfs_destroy (GtkObject *object) } static void -nautilus_vfs_file_initialize_class (gpointer klass) +nautilus_vfs_file_class_init (gpointer klass) { GtkObjectClass *object_class; NautilusFileClass *file_class; diff --git a/libnautilus-private/nautilus-view-identifier.c b/libnautilus-private/nautilus-view-identifier.c index 69526c3c5..a35833be9 100644 --- a/libnautilus-private/nautilus-view-identifier.c +++ b/libnautilus-private/nautilus-view-identifier.c @@ -25,7 +25,6 @@ #include <config.h> #include "nautilus-view-identifier.h" -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> @@ -133,7 +132,7 @@ get_lang_list (void) } NautilusViewIdentifier * -nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char *name_attribute) +nautilus_view_identifier_new_from_bonobo_activation_server_info (Bonobo_ServerInfo *server, char *name_attribute) { const char *view_as_name; const char *view_as_label; @@ -142,12 +141,12 @@ nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char langs = get_lang_list (); - view_as_name = oaf_server_info_prop_lookup (server, name_attribute, langs); - view_as_label = oaf_server_info_prop_lookup (server, "nautilus:view_as_label", langs); - viewer_label = oaf_server_info_prop_lookup (server, "nautilus:viewer_label", langs); + view_as_name = bonobo_activation_server_info_prop_lookup (server, name_attribute, langs); + view_as_label = bonobo_activation_server_info_prop_lookup (server, "nautilus:view_as_label", langs); + viewer_label = bonobo_activation_server_info_prop_lookup (server, "nautilus:viewer_label", langs); if (view_as_name == NULL) { - view_as_name = oaf_server_info_prop_lookup (server, "name", langs); + view_as_name = bonobo_activation_server_info_prop_lookup (server, "name", langs); } if (view_as_name == NULL) { view_as_name = server->iid; @@ -177,23 +176,23 @@ nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, char } NautilusViewIdentifier * -nautilus_view_identifier_new_from_content_view (OAF_ServerInfo *server) +nautilus_view_identifier_new_from_content_view (Bonobo_ServerInfo *server) { - return nautilus_view_identifier_new_from_oaf_server_info + return nautilus_view_identifier_new_from_bonobo_activation_server_info (server, "nautilus:view_as_name"); } NautilusViewIdentifier * -nautilus_view_identifier_new_from_property_page (OAF_ServerInfo *server) +nautilus_view_identifier_new_from_property_page (Bonobo_ServerInfo *server) { - return nautilus_view_identifier_new_from_oaf_server_info + return nautilus_view_identifier_new_from_bonobo_activation_server_info (server, "nautilus:property_page_name"); } NautilusViewIdentifier * -nautilus_view_identifier_new_from_sidebar_panel (OAF_ServerInfo *server) +nautilus_view_identifier_new_from_sidebar_panel (Bonobo_ServerInfo *server) { - return nautilus_view_identifier_new_from_oaf_server_info + return nautilus_view_identifier_new_from_bonobo_activation_server_info (server, "nautilus:sidebar_panel_name"); } diff --git a/libnautilus-private/nautilus-view-identifier.h b/libnautilus-private/nautilus-view-identifier.h index e2d7d05a9..d4f4d84ca 100644 --- a/libnautilus-private/nautilus-view-identifier.h +++ b/libnautilus-private/nautilus-view-identifier.h @@ -25,7 +25,7 @@ #ifndef NAUTILUS_VIEW_IDENTIFIER_H #define NAUTILUS_VIEW_IDENTIFIER_H -#include <liboaf/liboaf.h> +#include <bonobo-activation/bonobo-activation.h> typedef struct { char *iid; /* Unique ID */ @@ -34,17 +34,17 @@ typedef struct { char *viewer_label; /* "<name> Viewer" */ } NautilusViewIdentifier; -NautilusViewIdentifier *nautilus_view_identifier_new_from_oaf_server_info (OAF_ServerInfo *server, - char *name_attribute); -NautilusViewIdentifier *nautilus_view_identifier_new_from_content_view (OAF_ServerInfo *server); -NautilusViewIdentifier *nautilus_view_identifier_new_from_sidebar_panel (OAF_ServerInfo *server); -NautilusViewIdentifier *nautilus_view_identifier_new_from_property_page (OAF_ServerInfo *server); -NautilusViewIdentifier *nautilus_view_identifier_copy (const NautilusViewIdentifier *identifier); -void nautilus_view_identifier_free (NautilusViewIdentifier *identifier); -int nautilus_view_identifier_compare (const NautilusViewIdentifier *a, - const NautilusViewIdentifier *b); +NautilusViewIdentifier *nautilus_view_identifier_new_from_bonobo_activation_server_info (Bonobo_ServerInfo *server, + char *name_attribute); +NautilusViewIdentifier *nautilus_view_identifier_new_from_content_view (Bonobo_ServerInfo *server); +NautilusViewIdentifier *nautilus_view_identifier_new_from_sidebar_panel (Bonobo_ServerInfo *server); +NautilusViewIdentifier *nautilus_view_identifier_new_from_property_page (Bonobo_ServerInfo *server); +NautilusViewIdentifier *nautilus_view_identifier_copy (const NautilusViewIdentifier *identifier); +void nautilus_view_identifier_free (NautilusViewIdentifier *identifier); +int nautilus_view_identifier_compare (const NautilusViewIdentifier *a, + const NautilusViewIdentifier *b); /* lists of NautilusViewIdentifier */ -GList * nautilus_view_identifier_list_copy (GList *list); -void nautilus_view_identifier_list_free (GList *list); +GList * nautilus_view_identifier_list_copy (GList *list); +void nautilus_view_identifier_list_free (GList *list); #endif /* NAUTILUS_VIEW_IDENTIFIER */ diff --git a/libnautilus-private/nautilus-volume-monitor.c b/libnautilus-private/nautilus-volume-monitor.c index 575ad6c7a..c637ac828 100644 --- a/libnautilus-private/nautilus-volume-monitor.c +++ b/libnautilus-private/nautilus-volume-monitor.c @@ -46,7 +46,6 @@ #include <libxml/tree.h> #include <gtk/gtkmain.h> #include <libgnome/gnome-config.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-exec.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> @@ -194,8 +193,8 @@ enum { static guint signals[LAST_SIGNAL]; -static void nautilus_volume_monitor_initialize (NautilusVolumeMonitor *desktop_mounter); -static void nautilus_volume_monitor_initialize_class (NautilusVolumeMonitorClass *klass); +static void nautilus_volume_monitor_init (NautilusVolumeMonitor *desktop_mounter); +static void nautilus_volume_monitor_class_init (NautilusVolumeMonitorClass *klass); static void nautilus_volume_monitor_destroy (GtkObject *object); static char * get_iso9660_volume_name (NautilusVolume *volume, int volume_fd); @@ -251,7 +250,7 @@ load_file_system_table (void) return table; } - for (node = doc->xmlRootNode->xmlChildrenNode; node != NULL; node = node->next) { + for (node = doc->children->children; node != NULL; node = node->next) { name = xmlGetProp (node, "name"); if (name != NULL) { @@ -280,7 +279,7 @@ load_file_system_table (void) } static void -nautilus_volume_monitor_initialize (NautilusVolumeMonitor *monitor) +nautilus_volume_monitor_init (NautilusVolumeMonitor *monitor) { /* Set up details */ monitor->details = g_new0 (NautilusVolumeMonitorDetails, 1); @@ -291,7 +290,7 @@ nautilus_volume_monitor_initialize (NautilusVolumeMonitor *monitor) } static void -nautilus_volume_monitor_initialize_class (NautilusVolumeMonitorClass *klass) +nautilus_volume_monitor_class_init (NautilusVolumeMonitorClass *klass) { GtkObjectClass *object_class; @@ -300,42 +299,44 @@ nautilus_volume_monitor_initialize_class (NautilusVolumeMonitorClass *klass) object_class->destroy = nautilus_volume_monitor_destroy; signals[VOLUME_MOUNTED] - = gtk_signal_new ("volume_mounted", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusVolumeMonitorClass, + = g_signal_new ("volume_mounted", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusVolumeMonitorClass, volume_mounted), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[VOLUME_UNMOUNT_STARTED] - = gtk_signal_new ("volume_unmount_started", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusVolumeMonitorClass, + = g_signal_new ("volume_unmount_started", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusVolumeMonitorClass, volume_unmount_started), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[VOLUME_UNMOUNT_FAILED] - = gtk_signal_new ("volume_unmount_failed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusVolumeMonitorClass, + = g_signal_new ("volume_unmount_failed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusVolumeMonitorClass, volume_unmount_failed), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[VOLUME_UNMOUNTED] - = gtk_signal_new ("volume_unmounted", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusVolumeMonitorClass, + = g_signal_new ("volume_unmounted", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NautilusVolumeMonitorClass, volume_unmounted), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + NULL, NULL, + gtk_marshal_NONE__POINTER, + G_TYPE_NONE, 1, GTK_TYPE_POINTER); /* Check environment a bit. */ if (g_file_exists ("/vol/dev")) { |