From d566827eb6b90f5de50e5bea4d30c5e59b59253d Mon Sep 17 00:00:00 2001 From: Darin Adler Date: Tue, 27 Feb 2001 22:25:42 +0000 Subject: reviewed by: John Sullivan Did most of the work for bug 5779, separating out the Eazel logos so they won't be used by non-Eazel folks making changes to Nautilus if they choose to do "non-approved" changes (allowed by GPL of course). * nautilus.spec.in: Add new logos. * configure.in: Add eazel-logos and eazel-logos/throbber. * Makefile.am: Add the eazel-logos subdirectory. * eazel-logos/Makefile.am: Created. * eazel-logos/throbber/Makefile.am: Created. * components/services/nautilus-dependent-shared/icons/eazel-logo-right-side-logo.png: * icons/About_Image.png: * icons/about_background.png: * icons/default.xml: * icons/druid_header.png: * icons/throbber/001.png: * icons/throbber/002.png: * icons/throbber/003.png: * icons/throbber/004.png: * icons/throbber/005.png: * icons/throbber/006.png: * icons/throbber/007.png: * icons/throbber/008.png: * icons/throbber/009.png: * icons/throbber/010.png: * icons/throbber/011.png: * icons/throbber/012.png: * icons/throbber/013.png: * icons/throbber/014.png: * icons/throbber/015.png: * icons/throbber/016.png: * icons/throbber/017.png: * icons/throbber/018.png: * icons/throbber/019.png: * icons/throbber/020.png: * icons/throbber/021.png: * icons/throbber/022.png: * icons/throbber/023.png: * icons/throbber/024.png: * icons/throbber/025.png: * icons/throbber/026.png: * icons/throbber/027.png: * icons/throbber/028.png: * icons/throbber/029.png: * icons/throbber/030.png: * icons/throbber/Makefile.am: * icons/throbber/rest.png: Updated with non-logo versions. Did 90% of the work for bug 6950 (need new report_redirect call in addition to report_location_change). While working on that, I also moved the deferral of outgoing calls that is done in the Mozilla component so that it is done by the NautilusView class instead. * libnautilus/nautilus-view-component.idl: Added report_redirect. * libnautilus/nautilus-view.h: Added report_redirect. * libnautilus/nautilus-view.c: (queue_outgoing_call): Added queing for the outgoing side. (nautilus_view_initialize): Allocate queue. (nautilus_view_destroy): Deallocate queue. (str_list_copy): Utility needed here because we can't use libnautilus-extensions. (list_free_deep_callback): New. Used in queuing code. (free_location_plus_callback): New. Used in queueing code. (call_open_location_in_this_window), (call_open_location_prefer_existing_window), (call_open_location_force_new_window), (call_report_location_change), (call_report_redirect), (call_report_selection_change), (call_report_status), (call_report_load_underway), (call_report_load_progress), (call_report_load_complete), (call_report_load_failed), (call_set_title), (call_go_back): Functions that get queued. These have the bulk of the code to do work. (nautilus_view_open_location_in_this_window), (nautilus_view_open_location_prefer_existing_window), (nautilus_view_open_location_force_new_window), (nautilus_view_report_location_change), (nautilus_view_report_redirect), (nautilus_view_report_selection_change), (nautilus_view_report_status), (nautilus_view_report_load_underway), (nautilus_view_report_load_progress), (nautilus_view_report_load_complete), (nautilus_view_report_load_failed), (nautilus_view_set_title), (nautilus_view_go_back): These functions now simply queue the work that needs to be done. * src/nautilus-view-frame-corba.c: (free_location_plus_callback): Add a new field for the "from_location" needed for redirect. (report_redirect): The actual function to do the work. (impl_Nautilus_ViewFrame_report_redirect): Queue function. * src/nautilus-view-frame.h: * src/nautilus-view-frame-private.h: * src/nautilus-view-frame.c: (nautilus_view_frame_initialize_class): Create report_redirect signal. (nautilus_view_frame_report_redirect): Emit the signal. * src/nautilus-window-manage-views.c: (report_redirect_callback): Code to implement the redirect. For now this does the exact same thing as report_location_change. This is where all the remaining work to fix the bug goes. * components/mozilla/nautilus-mozilla-content-view.c: (view_load_location_callback), (mozilla_title_changed_callback), (mozilla_net_start_callback), (mozilla_net_stop_callback), (mozilla_link_message_callback), (mozilla_progress_callback), (mozilla_dom_mouse_click_callback), (navigate_mozilla_to_nautilus_uri), (update_nautilus_uri), (eazel_services_scheme_from_http): Remove the "async" calls that defer calls until timeout time now that NautilusView itself does that for all components. * libnautilus-extensions/nautilus-gtk-extensions.h: * libnautilus-extensions/nautilus-gtk-extensions.c: (nautilus_gtk_marshal_NONE__POINTER_POINTER_POINTER_POINTER): Added new marshal function needed for report_redirect. Other changes. * THANKS: Add some more contributors, after running the script to detect new ChangeLog entries. --- libnautilus/nautilus-view-component.idl | 8 +- libnautilus/nautilus-view.c | 348 +++++++++++++++++++++++++++----- libnautilus/nautilus-view.h | 5 + 3 files changed, 306 insertions(+), 55 deletions(-) (limited to 'libnautilus') diff --git a/libnautilus/nautilus-view-component.idl b/libnautilus/nautilus-view-component.idl index ba8e515df..89173ab20 100644 --- a/libnautilus/nautilus-view-component.idl +++ b/libnautilus/nautilus-view-component.idl @@ -103,11 +103,17 @@ module Nautilus { * also it treats the load as "already underway" and * does not send a "load_location", * "selection_changed", or "title_changed" to the view - * that initiates this. + * that initiates this. The redirect version should be + * used when the location change does not deserve its + * own element in history. */ oneway void report_location_change (in URI location, in URIList selection, in string title); + oneway void report_redirect (in URI from_location, + in URI to_location, + in URIList selection, + in string title); /* Called by a view component to announce a change in the * selection. This selection change will be reported back diff --git a/libnautilus/nautilus-view.c b/libnautilus/nautilus-view.c index 7f661a6c9..55c9089ff 100644 --- a/libnautilus/nautilus-view.c +++ b/libnautilus/nautilus-view.c @@ -56,7 +56,8 @@ static guint signals[LAST_SIGNAL]; struct NautilusViewDetails { BonoboControl *control; - NautilusIdleQueue *idle_queue; + NautilusIdleQueue *incoming_queue; + NautilusIdleQueue *outgoing_queue; }; typedef struct { @@ -68,10 +69,11 @@ typedef void (* ViewFunction) (NautilusView *view, gpointer callback_data); typedef struct { - ViewFunction call; - gpointer callback_data; - GDestroyNotify destroy_callback_data; -} IncomingCall; + char *from_location; + char *location; + GList *selection; + char *title; +} LocationPlus; static void impl_Nautilus_View_load_location (PortableServer_Servant servant, CORBA_char *location, @@ -121,7 +123,20 @@ queue_incoming_call (PortableServer_Servant servant, view = ((impl_POA_Nautilus_View *) servant)->bonobo_object; - nautilus_idle_queue_add (view->details->idle_queue, + nautilus_idle_queue_add (view->details->incoming_queue, + (GFunc) call, + view, + callback_data, + destroy_callback_data); +} + +static void +queue_outgoing_call (NautilusView *view, + ViewFunction call, + gpointer callback_data, + GDestroyNotify destroy_callback_data) +{ + nautilus_idle_queue_add (view->details->outgoing_queue, (GFunc) call, view, callback_data, @@ -389,7 +404,8 @@ nautilus_view_initialize (NautilusView *view) view->details = g_new0 (NautilusViewDetails, 1); - view->details->idle_queue = nautilus_idle_queue_new (); + view->details->incoming_queue = nautilus_idle_queue_new (); + view->details->outgoing_queue = nautilus_idle_queue_new (); CORBA_exception_init (&ev); bonobo_object_construct @@ -442,7 +458,8 @@ nautilus_view_destroy (GtkObject *object) view = NAUTILUS_VIEW (object); - nautilus_idle_queue_destroy (view->details->idle_queue); + nautilus_idle_queue_destroy (view->details->incoming_queue); + nautilus_idle_queue_destroy (view->details->outgoing_queue); g_free (view->details); @@ -473,15 +490,47 @@ static void view_frame_call_end (Nautilus_ViewFrame frame, CORBA_Environment *ev) { if (frame != CORBA_OBJECT_NIL) { - bonobo_object_release_unref (frame, ev); + bonobo_object_release_unref (frame, NULL); } CORBA_exception_free (ev); } -void -nautilus_view_open_location_in_this_window (NautilusView *view, - const char *location) +/* Can't use the one in libnautilus-extensions. */ +static GList * +str_list_copy (GList *original) +{ + GList *copy, *node; + + copy = NULL; + for (node = original; node != NULL; node = node->next) { + copy = g_list_prepend (copy, g_strdup (node->data)); + } + return g_list_reverse (copy); +} + +static void +list_free_deep_callback (gpointer callback_data) +{ + gnome_vfs_list_deep_free (callback_data); +} + +static void +free_location_plus_callback (gpointer callback_data) +{ + LocationPlus *location_plus; + + location_plus = callback_data; + g_free (location_plus->from_location); + g_free (location_plus->location); + gnome_vfs_list_deep_free (location_plus->selection); + g_free (location_plus->title); + g_free (location_plus); +} + +static void +call_open_location_in_this_window (NautilusView *view, + gpointer callback_data) { CORBA_Environment ev; Nautilus_ViewFrame view_frame; @@ -489,14 +538,14 @@ nautilus_view_open_location_in_this_window (NautilusView *view, view_frame = view_frame_call_begin (view, &ev); if (view_frame != CORBA_OBJECT_NIL) { Nautilus_ViewFrame_open_location_in_this_window - (view_frame, (CORBA_char *) location, &ev); + (view_frame, callback_data, &ev); } view_frame_call_end (view_frame, &ev); } -void -nautilus_view_open_location_prefer_existing_window (NautilusView *view, - const char *location) +static void +call_open_location_prefer_existing_window (NautilusView *view, + gpointer callback_data) { CORBA_Environment ev; Nautilus_ViewFrame view_frame; @@ -504,53 +553,86 @@ nautilus_view_open_location_prefer_existing_window (NautilusView *view, view_frame = view_frame_call_begin (view, &ev); if (view_frame != CORBA_OBJECT_NIL) { Nautilus_ViewFrame_open_location_prefer_existing_window - (view_frame, (CORBA_char *) location, &ev); + (view_frame, callback_data, &ev); } view_frame_call_end (view_frame, &ev); } -void -nautilus_view_open_location_force_new_window (NautilusView *view, - const char *location, - GList *selection) +static void +call_open_location_force_new_window (NautilusView *view, + gpointer callback_data) { + LocationPlus *location_plus; CORBA_Environment ev; Nautilus_ViewFrame view_frame; Nautilus_URIList *uri_list; + + location_plus = callback_data; view_frame = view_frame_call_begin (view, &ev); if (view_frame != CORBA_OBJECT_NIL) { - uri_list = nautilus_uri_list_from_g_list (selection); + uri_list = nautilus_uri_list_from_g_list (location_plus->selection); Nautilus_ViewFrame_open_location_force_new_window - (view_frame, (CORBA_char *) location, uri_list, &ev); + (view_frame, location_plus->location, uri_list, &ev); CORBA_free (uri_list); } view_frame_call_end (view_frame, &ev); } -void -nautilus_view_report_location_change (NautilusView *view, - const char *location, - GList *selection, - const char *title) +static void +call_report_location_change (NautilusView *view, + gpointer callback_data) { + LocationPlus *location_plus; CORBA_Environment ev; Nautilus_ViewFrame view_frame; Nautilus_URIList *uri_list; + + location_plus = callback_data; view_frame = view_frame_call_begin (view, &ev); if (view_frame != CORBA_OBJECT_NIL) { - uri_list = nautilus_uri_list_from_g_list (selection); + uri_list = nautilus_uri_list_from_g_list (location_plus->selection); Nautilus_ViewFrame_report_location_change - (view_frame, (CORBA_char *) location, uri_list, (CORBA_char *) title, &ev); + (view_frame, + location_plus->location, + uri_list, + location_plus->title, + &ev); CORBA_free (uri_list); } view_frame_call_end (view_frame, &ev); } -void -nautilus_view_report_selection_change (NautilusView *view, - GList *selection) +static void +call_report_redirect (NautilusView *view, + gpointer callback_data) +{ + LocationPlus *location_plus; + CORBA_Environment ev; + Nautilus_ViewFrame view_frame; + Nautilus_URIList *uri_list; + + location_plus = callback_data; + + view_frame = view_frame_call_begin (view, &ev); + if (view_frame != CORBA_OBJECT_NIL) { + uri_list = nautilus_uri_list_from_g_list (location_plus->selection); + Nautilus_ViewFrame_report_redirect + (view_frame, + location_plus->from_location, + location_plus->location, + uri_list, + location_plus->title, + &ev); + CORBA_free (uri_list); + } + view_frame_call_end (view_frame, &ev); +} + +static void +call_report_selection_change (NautilusView *view, + gpointer callback_data) { CORBA_Environment ev; Nautilus_ViewFrame view_frame; @@ -558,29 +640,30 @@ nautilus_view_report_selection_change (NautilusView *view, view_frame = view_frame_call_begin (view, &ev); if (view_frame != CORBA_OBJECT_NIL) { - uri_list = nautilus_uri_list_from_g_list (selection); + uri_list = nautilus_uri_list_from_g_list (callback_data); Nautilus_ViewFrame_report_selection_change (view_frame, uri_list, &ev); CORBA_free (uri_list); } view_frame_call_end (view_frame, &ev); } -void -nautilus_view_report_status (NautilusView *view, - const char *status) +static void +call_report_status (NautilusView *view, + gpointer callback_data) { CORBA_Environment ev; Nautilus_ViewFrame view_frame; view_frame = view_frame_call_begin (view, &ev); if (view_frame != CORBA_OBJECT_NIL) { - Nautilus_ViewFrame_report_status (view_frame, status, &ev); + Nautilus_ViewFrame_report_status (view_frame, callback_data, &ev); } view_frame_call_end (view_frame, &ev); } -void -nautilus_view_report_load_underway (NautilusView *view) +static void +call_report_load_underway (NautilusView *view, + gpointer callback_data) { CORBA_Environment ev; Nautilus_ViewFrame view_frame; @@ -592,22 +675,24 @@ nautilus_view_report_load_underway (NautilusView *view) view_frame_call_end (view_frame, &ev); } -void -nautilus_view_report_load_progress (NautilusView *view, - double fraction_done) +static void +call_report_load_progress (NautilusView *view, + gpointer callback_data) { CORBA_Environment ev; Nautilus_ViewFrame view_frame; view_frame = view_frame_call_begin (view, &ev); if (view_frame != CORBA_OBJECT_NIL) { - Nautilus_ViewFrame_report_load_progress (view_frame, fraction_done, &ev); + Nautilus_ViewFrame_report_load_progress + (view_frame, * (double *) callback_data, &ev); } view_frame_call_end (view_frame, &ev); } -void -nautilus_view_report_load_complete (NautilusView *view) +static void +call_report_load_complete (NautilusView *view, + gpointer callback_data) { CORBA_Environment ev; Nautilus_ViewFrame view_frame; @@ -619,8 +704,9 @@ nautilus_view_report_load_complete (NautilusView *view) view_frame_call_end (view_frame, &ev); } -void -nautilus_view_report_load_failed (NautilusView *view) +static void +call_report_load_failed (NautilusView *view, + gpointer callback_data) { CORBA_Environment ev; Nautilus_ViewFrame view_frame; @@ -632,22 +718,23 @@ nautilus_view_report_load_failed (NautilusView *view) view_frame_call_end (view_frame, &ev); } -void -nautilus_view_set_title (NautilusView *view, - const char *title) +static void +call_set_title (NautilusView *view, + gpointer callback_data) { CORBA_Environment ev; Nautilus_ViewFrame view_frame; view_frame = view_frame_call_begin (view, &ev); if (view_frame != CORBA_OBJECT_NIL) { - Nautilus_ViewFrame_set_title (view_frame, title, &ev); + Nautilus_ViewFrame_set_title (view_frame, callback_data, &ev); } view_frame_call_end (view_frame, &ev); } -void -nautilus_view_go_back (NautilusView *view) +static void +call_go_back (NautilusView *view, + gpointer callback_data) { CORBA_Environment ev; Nautilus_ViewFrame view_frame; @@ -659,6 +746,159 @@ nautilus_view_go_back (NautilusView *view) view_frame_call_end (view_frame, &ev); } +void +nautilus_view_open_location_in_this_window (NautilusView *view, + const char *location) +{ + queue_outgoing_call (view, + call_open_location_in_this_window, + g_strdup (location), + g_free); +} + +void +nautilus_view_open_location_prefer_existing_window (NautilusView *view, + const char *location) +{ + queue_outgoing_call (view, + call_open_location_prefer_existing_window, + g_strdup (location), + g_free); +} + +void +nautilus_view_open_location_force_new_window (NautilusView *view, + const char *location, + GList *selection) +{ + LocationPlus *location_plus; + + location_plus = g_new0 (LocationPlus, 1); + location_plus->location = g_strdup (location); + location_plus->selection = str_list_copy (selection); + + queue_outgoing_call (view, + call_open_location_force_new_window, + location_plus, + free_location_plus_callback); +} + +void +nautilus_view_report_location_change (NautilusView *view, + const char *location, + GList *selection, + const char *title) +{ + LocationPlus *location_plus; + + location_plus = g_new0 (LocationPlus, 1); + location_plus->location = g_strdup (location); + location_plus->selection = str_list_copy (selection); + location_plus->title = g_strdup (title); + + queue_outgoing_call (view, + call_report_location_change, + location_plus, + free_location_plus_callback); +} + +void +nautilus_view_report_redirect (NautilusView *view, + const char *from_location, + const char *to_location, + GList *selection, + const char *title) +{ + LocationPlus *location_plus; + + location_plus = g_new0 (LocationPlus, 1); + location_plus->from_location = g_strdup (from_location); + location_plus->location = g_strdup (to_location); + location_plus->selection = str_list_copy (selection); + location_plus->title = g_strdup (title); + + queue_outgoing_call (view, + call_report_redirect, + location_plus, + free_location_plus_callback); +} + +void +nautilus_view_report_selection_change (NautilusView *view, + GList *selection) +{ + queue_outgoing_call (view, + call_report_selection_change, + str_list_copy (selection), + list_free_deep_callback); +} + +void +nautilus_view_report_status (NautilusView *view, + const char *status) +{ + queue_outgoing_call (view, + call_report_status, + g_strdup (status), + g_free); +} + +void +nautilus_view_report_load_underway (NautilusView *view) +{ + queue_outgoing_call (view, + call_report_load_underway, + NULL, + NULL); +} + +void +nautilus_view_report_load_progress (NautilusView *view, + double fraction_done) +{ + queue_outgoing_call (view, + call_report_load_progress, + g_memdup (&fraction_done, sizeof (double)), + g_free); +} + +void +nautilus_view_report_load_complete (NautilusView *view) +{ + queue_outgoing_call (view, + call_report_load_complete, + NULL, + NULL); +} + +void +nautilus_view_report_load_failed (NautilusView *view) +{ + queue_outgoing_call (view, + call_report_load_failed, + NULL, + NULL); +} + +void +nautilus_view_set_title (NautilusView *view, + const char *title) +{ + queue_outgoing_call (view, + call_set_title, + g_strdup (title), + g_free); +} + +void +nautilus_view_go_back (NautilusView *view) +{ + queue_outgoing_call (view, + call_go_back, + NULL, + NULL); +} + BonoboControl * nautilus_view_get_bonobo_control (NautilusView *view) { diff --git a/libnautilus/nautilus-view.h b/libnautilus/nautilus-view.h index adf0c0b81..05ce52fc5 100644 --- a/libnautilus/nautilus-view.h +++ b/libnautilus/nautilus-view.h @@ -78,6 +78,11 @@ void nautilus_view_report_location_change (NautilusV const char *location_uri, GList *selection, /* list of URI char *s */ const char *title); +void nautilus_view_report_redirect (NautilusView *view, + const char *from_location_uri, + const char *to_location_uri, + GList *selection, /* list of URI char *s */ + const char *title); void nautilus_view_report_selection_change (NautilusView *view, GList *selection); /* list of URI char *s */ void nautilus_view_report_status (NautilusView *view, -- cgit v1.2.1