diff options
64 files changed, 1190 insertions, 1605 deletions
@@ -1,3 +1,125 @@ +2000-05-24 Darin Adler <darin@eazel.com> + + Eliminated ContentView and ContentViewFrame. + + * components/hardware/nautilus-hardware-view.c: + (nautilus_hardware_view_initialize), + (hardware_view_notify_location_change_callback): + * components/hardware/nautilus-hardware-view.h: + * components/help/hyperbola-nav-index.c: + (hyperbola_navigation_index_select_row): + * components/help/hyperbola-nav-search.c: + (hyperbola_navigation_search_select_row), + (hyperbola_navigation_search_new): + * components/html/ntl-web-browser.c: (browser_url_load_done), + (browser_vfs_callback), (browser_goto_url_real), + (browser_goto_url), (browser_select_url), (browser_title_changed), + (browser_notify_location_change), (make_obj): + * components/loser/content/main.c: (loser_make_object): + * components/loser/content/nautilus-content-loser.c: + (nautilus_content_loser_initialize), + (loser_notify_location_change_callback): + * components/loser/content/nautilus-content-loser.h: + * components/loser/sidebar/main.c: (loser_make_object): + * components/loser/sidebar/nautilus-sidebar-loser.c: + (nautilus_sidebar_loser_initialize), + (loser_notify_location_change_callback): + * components/mozilla/main.c: (mozilla_make_object): + * components/mozilla/nautilus-mozilla-content-view.c: + (nautilus_mozilla_content_view_initialize), + (mozilla_content_view_request_progress_change), + (mozilla_content_view_request_location_change), + (mozilla_notify_location_change_callback), + (mozilla_title_changed_callback), (mozilla_link_message_callback): + * components/mozilla/nautilus-mozilla-content-view.h: + * components/music/main.c: (music_view_make_object): + * components/music/nautilus-music-view.c: + (nautilus_music_view_initialize), (click_column_callback), + (music_view_notify_location_change_callback), + (nautilus_music_view_drag_data_received): + * components/music/nautilus-music-view.h: + * components/rpmview/main.c: (rpm_view_make_object): + * components/rpmview/nautilus-rpm-view.c: + (nautilus_rpm_view_initialize), + (rpm_view_notify_location_change_callback): + * components/rpmview/nautilus-rpm-view.h: + * components/sample/main.c: (sample_make_object): + * components/sample/nautilus-sample-content-view.c: + (nautilus_sample_content_view_initialize), + (sample_notify_location_change_callback): + * components/sample/nautilus-sample-content-view.h: + * components/services/startup/nautilus-view/main.c: + (services_make_object): + * components/services/startup/nautilus-view/nautilus-service-startup-view.c: + (go_to_uri), (nautilus_service_startup_view_initialize), + (service_main_notify_location_change_cb): + * components/services/startup/nautilus-view/nautilus-service-startup-view.h: + * libnautilus/Makefile.am: + * libnautilus/libnautilus.h: + * libnautilus/nautilus-content-view-frame.c: [removed] + * libnautilus/nautilus-content-view-frame.h: [removed] + * libnautilus/nautilus-view-component.idl: + * libnautilus/nautilus-view-frame-private.h: + * libnautilus/nautilus-view-frame.c: + (impl_Nautilus_View_save_state), (impl_Nautilus_View_load_state), + (impl_Nautilus_View_notify_location_change), + (impl_Nautilus_View_show_properties), + (impl_Nautilus_View_notify_selection_change), + (impl_Nautilus_View_stop_location_change), + (impl_Nautilus_View__destroy), (impl_Nautilus_View__create), + (nautilus_view_initialize_class), (nautilus_view_initialize), + (nautilus_view_new), (nautilus_view_new_from_bonobo_control), + (get_view_frame), (nautilus_view_request_location_change), + (nautilus_view_request_selection_change), + (nautilus_view_request_status_change), + (nautilus_view_request_progress_change), + (nautilus_view_request_title_change), + (nautilus_view_get_bonobo_control), + (nautilus_view_get_main_window): + * libnautilus/nautilus-view-frame.h: + * src/Makefile.am: + * src/file-manager/fm-directory-view.c: (get_bonobo_control), + (fm_directory_view_initialize), (display_selection_info), + (fm_directory_view_send_selection_change), + (notify_location_change_callback), (stop_location_change_callback), + (done_loading), (fm_directory_view_activate_file_internal), + (finish_loading_uri): + * src/file-manager/fm-directory-view.h: + * src/ntl-app.c: (impl_Nautilus_Application_create_object): + * src/ntl-content-view.c: [removed] + * src/ntl-content-view.h: [removed] + * src/ntl-uri-map.c: (make_oaf_query_with_known_mime_type), + (make_oaf_query_with_uri_scheme_only): + * src/ntl-view-frame-svr.c: (impl_Nautilus_ViewFrame__destroy), + (impl_Nautilus_ViewFrame__create), + (impl_Nautilus_ViewFrame__get_main_window), + (impl_Nautilus_ViewFrame_request_location_change), + (impl_Nautilus_ViewFrame_request_selection_change), + (impl_Nautilus_ViewFrame_request_status_change), + (impl_Nautilus_ViewFrame_request_progress_change), + (impl_Nautilus_ViewFrame_request_title_change): + * src/ntl-view-private.h: + * src/ntl-view.c: (nautilus_view_frame_class_init), + (nautilus_view_frame_set_arg), (nautilus_view_frame_get_arg), + (nautilus_view_frame_request_location_change), + (nautilus_view_frame_request_selection_change), + (nautilus_view_frame_request_status_change), + (nautilus_view_frame_request_progress_change), + (nautilus_view_frame_request_title_change), + (nautilus_view_frame_set_label), (nautilus_view_frame_activate): + * src/ntl-view.h: + * src/ntl-window-msgs.c: (nautilus_window_request_title_change), + (nautilus_window_load_meta_view), + (nautilus_window_request_location_change), + (nautilus_window_load_content_view): + * src/ntl-window-msgs.h: + * src/ntl-window-private.h: + * src/ntl-window.c: + (nautilus_window_request_title_change_callback), + (nautilus_window_connect_content_view), + (nautilus_window_real_set_content_view): + Got rid of ContentView and ContentViewFrame. + 2000-05-24 John Sullivan <sullivan@eazel.com> * src/ntl-app.c: (display_caveat): Made the startup caveat diff --git a/components/hardware/nautilus-hardware-view.c b/components/hardware/nautilus-hardware-view.c index 262f8b4e9..20a0dbed5 100644 --- a/components/hardware/nautilus-hardware-view.c +++ b/components/hardware/nautilus-hardware-view.c @@ -51,7 +51,7 @@ struct _NautilusHardwareViewDetails { char *uri; - NautilusContentView *nautilus_view; + NautilusView *nautilus_view; GtkWidget *form; }; @@ -69,21 +69,19 @@ static GtkTargetEntry hardware_dnd_target_table[] = { { "special/x-gnome-icon-list", 0, TARGET_GNOME_URI_LIST } }; -static void nautilus_hardware_view_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - int x, - int y, - GtkSelectionData *selection_data, - guint info, - guint time); - -static void nautilus_hardware_view_initialize_class (NautilusHardwareViewClass *klass); -static void nautilus_hardware_view_initialize (NautilusHardwareView *view); -static void nautilus_hardware_view_destroy (GtkObject *object); - -static void hardware_view_notify_location_change_callback (NautilusContentView *view, - Nautilus_NavigationInfo *navinfo, - NautilusHardwareView *hardware_view); +static void nautilus_hardware_view_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + int x, + int y, + GtkSelectionData *selection_data, + guint info, + guint time); +static void nautilus_hardware_view_initialize_class (NautilusHardwareViewClass *klass); +static void nautilus_hardware_view_initialize (NautilusHardwareView *view); +static void nautilus_hardware_view_destroy (GtkObject *object); +static void hardware_view_notify_location_change_callback (NautilusView *view, + Nautilus_NavigationInfo *navinfo, + NautilusHardwareView *hardware_view); NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusHardwareView, nautilus_hardware_view, GTK_TYPE_EVENT_BOX) @@ -110,7 +108,7 @@ nautilus_hardware_view_initialize (NautilusHardwareView *hardware_view) NautilusBackground *background; hardware_view->details = g_new0 (NautilusHardwareViewDetails, 1); - hardware_view->details->nautilus_view = nautilus_content_view_new (GTK_WIDGET (hardware_view)); + hardware_view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (hardware_view)); gtk_signal_connect (GTK_OBJECT (hardware_view->details->nautilus_view), "notify_location_change", @@ -144,7 +142,7 @@ nautilus_hardware_view_destroy (GtkObject *object) } /* Component embedding support */ -NautilusContentView * +NautilusView * nautilus_hardware_view_get_nautilus_view (NautilusHardwareView *hardware_view) { return hardware_view->details->nautilus_view; @@ -446,9 +444,9 @@ nautilus_hardware_view_load_uri (NautilusHardwareView *view, const char *uri) } static void -hardware_view_notify_location_change_callback (NautilusContentView *view, - Nautilus_NavigationInfo *navinfo, - NautilusHardwareView *hardware_view) +hardware_view_notify_location_change_callback (NautilusView *view, + Nautilus_NavigationInfo *navinfo, + NautilusHardwareView *hardware_view) { Nautilus_ProgressRequestInfo progress; @@ -458,7 +456,7 @@ hardware_view_notify_location_change_callback (NautilusContentView *view, progress.type = Nautilus_PROGRESS_UNDERWAY; progress.amount = 0.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (hardware_view->details->nautilus_view), &progress); + nautilus_view_request_progress_change (hardware_view->details->nautilus_view, &progress); /* do the actual work here */ nautilus_hardware_view_load_uri (hardware_view, navinfo->actual_uri); @@ -466,7 +464,7 @@ hardware_view_notify_location_change_callback (NautilusContentView *view, /* send the required PROGRESS_DONE signal */ progress.type = Nautilus_PROGRESS_DONE_OK; progress.amount = 100.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (hardware_view->details->nautilus_view), &progress); + nautilus_view_request_progress_change (hardware_view->details->nautilus_view, &progress); } /* handle drag and drop */ diff --git a/components/hardware/nautilus-hardware-view.h b/components/hardware/nautilus-hardware-view.h index 62e5b8b2d..54c17c706 100644 --- a/components/hardware/nautilus-hardware-view.h +++ b/components/hardware/nautilus-hardware-view.h @@ -25,7 +25,7 @@ #ifndef NAUTILUS_HARDWARE_VIEW_H #define NAUTILUS_HARDWARE_VIEW_H -#include <libnautilus/nautilus-content-view-frame.h> +#include <libnautilus/nautilus-view-frame.h> #include <gtk/gtkeventbox.h> @@ -50,13 +50,13 @@ struct _NautilusHardwareViewClass { }; /* GtkObject support */ -GtkType nautilus_hardware_view_get_type (void); +GtkType nautilus_hardware_view_get_type (void); /* Component embedding support */ -NautilusContentView *nautilus_hardware_view_get_nautilus_view (NautilusHardwareView *view); +NautilusView *nautilus_hardware_view_get_nautilus_view (NautilusHardwareView *view); /* URI handling */ -void nautilus_hardware_view_load_uri (NautilusHardwareView *view, - const char *uri); +void nautilus_hardware_view_load_uri (NautilusHardwareView *view, + const char *uri); #endif /* NAUTILUS_HARDWARE_VIEW_H */ diff --git a/components/help/hyperbola-nav-index.c b/components/help/hyperbola-nav-index.c index 110ea4f36..e735987a8 100644 --- a/components/help/hyperbola-nav-index.c +++ b/components/help/hyperbola-nav-index.c @@ -243,7 +243,7 @@ hyperbola_navigation_index_select_row(GtkWidget *clist, gint row, gint column, G memset(&loc, 0, sizeof(loc)); loc.requested_uri = ii->uri; loc.new_window_requested = FALSE; - nautilus_view_request_location_change(NAUTILUS_VIEW(hni->view_frame), &loc); + nautilus_view_request_location_change(hni->view_frame, &loc); } typedef struct { diff --git a/components/help/hyperbola-nav-search.c b/components/help/hyperbola-nav-search.c index 38ace7132..6ad48064c 100644 --- a/components/help/hyperbola-nav-search.c +++ b/components/help/hyperbola-nav-search.c @@ -10,7 +10,7 @@ #include <ctype.h> typedef struct { - NautilusView *view_frame; + NautilusView *nautilus_view; GtkWidget *clist, *ent; @@ -140,7 +140,7 @@ hyperbola_navigation_search_select_row(GtkWidget *clist, gint row, gint column, memset(&loc, 0, sizeof(loc)); loc.requested_uri = uri; loc.new_window_requested = FALSE; - nautilus_view_request_location_change(NAUTILUS_VIEW(hns->view_frame), &loc); + nautilus_view_request_location_change(hns->nautilus_view, &loc); } BonoboObject *hyperbola_navigation_search_new(void) @@ -174,7 +174,7 @@ BonoboObject *hyperbola_navigation_search_new(void) gtk_clist_thaw(GTK_CLIST(hns->clist)); gtk_widget_show_all(vbox); - hns->view_frame = nautilus_view_new (vbox); + hns->nautilus_view = nautilus_view_new (vbox); - return BONOBO_OBJECT (hns->view_frame); + return BONOBO_OBJECT (hns->nautilus_view); } diff --git a/components/html/ntl-web-browser.c b/components/html/ntl-web-browser.c index a0da704a4..d34939b6f 100644 --- a/components/html/ntl-web-browser.c +++ b/components/html/ntl-web-browser.c @@ -29,7 +29,7 @@ #include <libnautilus-extensions/nautilus-debug.h> typedef struct { - NautilusView *view_frame; + NautilusView *nautilus_view; GtkWidget *htmlw; char *base_url, *base_target_url; @@ -185,7 +185,7 @@ browser_url_load_done(GtkWidget *htmlw, BrowserInfo *bi) pri.type = Nautilus_PROGRESS_DONE_OK; pri.amount = 100.0; - nautilus_view_request_progress_change(bi->view_frame, &pri); + nautilus_view_request_progress_change(bi->nautilus_view, &pri); } struct _HTStream { @@ -362,7 +362,7 @@ browser_vfs_callback(GnomeVFSAsyncHandle *h, GnomeVFSResult res, gpointer data) memset(&pri, 0, sizeof(pri)); pri.type = Nautilus_PROGRESS_DONE_ERROR; - nautilus_view_request_progress_change(vfsh->bi->view_frame, &pri); + nautilus_view_request_progress_change(vfsh->bi->nautilus_view, &pri); gtk_html_end(GTK_HTML(vfsh->bi->htmlw), vfsh->sh, GTK_HTML_STREAM_ERROR); g_free(vfsh); @@ -471,7 +471,7 @@ browser_goto_url_real(GtkWidget *htmlw, const char *url, BrowserInfo *bi) browser_url_requested(bi->htmlw, url, stream, bi); - nautilus_view_request_progress_change(bi->view_frame, &pri); + nautilus_view_request_progress_change(bi->nautilus_view, &pri); } static void @@ -486,7 +486,7 @@ browser_goto_url(GtkWidget *htmlw, const char *url, BrowserInfo *bi) memset(&nri, 0, sizeof(nri)); nri.requested_uri = real_url; - nautilus_view_request_location_change(bi->view_frame, &nri); + nautilus_view_request_location_change(bi->nautilus_view, &nri); browser_goto_url_real(htmlw, real_url, bi); g_free(real_url); } @@ -511,9 +511,9 @@ browser_select_url(GtkWidget *htmlw, const char *url, BrowserInfo *bi) si.selected_uris._length = 0; } - nautilus_view_request_selection_change(bi->view_frame, &si); + nautilus_view_request_selection_change(bi->nautilus_view, &si); if(sri.status_string) - nautilus_view_request_status_change(bi->view_frame, &sri); + nautilus_view_request_status_change(bi->nautilus_view, &sri); g_free(real_url); bi->prevsel = url?1:0; } @@ -521,7 +521,7 @@ browser_select_url(GtkWidget *htmlw, const char *url, BrowserInfo *bi) static void browser_title_changed(GtkWidget *htmlw, const char *new_title, BrowserInfo *bi) { - nautilus_content_view_request_title_change (NAUTILUS_CONTENT_VIEW (bi->view_frame), new_title); + nautilus_view_request_title_change (bi->nautilus_view, new_title); } static void @@ -555,7 +555,7 @@ browser_submit(GtkWidget *htmlw, const char *method, const char *url, const char } static void -browser_notify_location_change(NautilusView *view_frame, +browser_notify_location_change(NautilusView *nautilus_view, Nautilus_NavigationInfo *ni, BrowserInfo *bi) { @@ -603,14 +603,14 @@ make_obj(BonoboGenericFactory *Factory, const char *goad_id, void *closure) gtk_widget_show(bi->htmlw); gtk_widget_show(wtmp); - bi->view_frame = NAUTILUS_VIEW (nautilus_content_view_new (wtmp)); + bi->nautilus_view = nautilus_view_new (wtmp); - gtk_signal_connect(GTK_OBJECT(bi->view_frame), "notify_location_change", browser_notify_location_change, + gtk_signal_connect(GTK_OBJECT(bi->nautilus_view), "notify_location_change", browser_notify_location_change, bi); object_count++; - gtk_signal_connect(GTK_OBJECT(bi->view_frame), "destroy", browser_do_destroy, NULL); + gtk_signal_connect(GTK_OBJECT(bi->nautilus_view), "destroy", browser_do_destroy, NULL); - return BONOBO_OBJECT (bi->view_frame); + return BONOBO_OBJECT (bi->nautilus_view); } int main(int argc, char *argv[]) diff --git a/components/loser/content/main.c b/components/loser/content/main.c index 911489ee0..8c8d7d141 100644 --- a/components/loser/content/main.c +++ b/components/loser/content/main.c @@ -64,7 +64,7 @@ loser_make_object (BonoboGenericFactory *factory, object_count++; - nautilus_view = NAUTILUS_VIEW (nautilus_content_loser_get_nautilus_view (view)); + nautilus_view = nautilus_content_loser_get_nautilus_view (view); gtk_signal_connect (GTK_OBJECT (nautilus_view), "destroy", loser_object_destroyed, NULL); diff --git a/components/loser/content/nautilus-content-loser.c b/components/loser/content/nautilus-content-loser.c index 5cb5e3722..3755bc119 100644 --- a/components/loser/content/nautilus-content-loser.c +++ b/components/loser/content/nautilus-content-loser.c @@ -40,7 +40,7 @@ struct NautilusContentLoserDetails { char *uri; - NautilusContentView *nautilus_view; + NautilusView *nautilus_view; }; static void nautilus_content_loser_initialize_class (NautilusContentLoserClass *klass); @@ -49,7 +49,7 @@ static void nautilus_content_loser_destroy (GtkObject * NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusContentLoser, nautilus_content_loser, GTK_TYPE_LABEL) -static void loser_notify_location_change_callback (NautilusContentView *nautilus_view, +static void loser_notify_location_change_callback (NautilusView *nautilus_view, Nautilus_NavigationInfo *navinfo, NautilusContentLoser *view); static void loser_merge_bonobo_items_callback (BonoboObject *control, @@ -75,7 +75,7 @@ nautilus_content_loser_initialize (NautilusContentLoser *view) gtk_label_set_text (GTK_LABEL (view), g_strdup ("(none)")); - view->details->nautilus_view = nautilus_content_view_new (GTK_WIDGET (view)); + view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view)); gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view), "notify_location_change", @@ -86,7 +86,7 @@ nautilus_content_loser_initialize (NautilusContentLoser *view) * can merge menu & toolbar items into Nautilus's UI. */ gtk_signal_connect (GTK_OBJECT (nautilus_view_get_bonobo_control - (NAUTILUS_VIEW (view->details->nautilus_view))), + (view->details->nautilus_view)), "activate", loser_merge_bonobo_items_callback, view); @@ -117,7 +117,7 @@ nautilus_content_loser_destroy (GtkObject *object) * @view: NautilusContentLoser to get the nautilus_view from.. * **/ -NautilusContentView * +NautilusView * nautilus_content_loser_get_nautilus_view (NautilusContentLoser *view) { return view->details->nautilus_view; @@ -145,9 +145,9 @@ nautilus_content_loser_load_uri (NautilusContentLoser *view, } static void -loser_notify_location_change_callback (NautilusContentView *nautilus_view, - Nautilus_NavigationInfo *navinfo, - NautilusContentLoser *view) +loser_notify_location_change_callback (NautilusView *nautilus_view, + Nautilus_NavigationInfo *navinfo, + NautilusContentLoser *view) { Nautilus_ProgressRequestInfo request; @@ -167,7 +167,7 @@ loser_notify_location_change_callback (NautilusContentView *nautilus_view, request.type = Nautilus_PROGRESS_UNDERWAY; request.amount = 0.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (nautilus_view), &request); + nautilus_view_request_progress_change (nautilus_view, &request); nautilus_content_loser_maybe_fail ("pre-load"); @@ -187,7 +187,7 @@ loser_notify_location_change_callback (NautilusContentView *nautilus_view, request.type = Nautilus_PROGRESS_DONE_OK; request.amount = 100.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (nautilus_view), &request); + nautilus_view_request_progress_change (nautilus_view, &request); nautilus_content_loser_maybe_fail ("post-done"); } diff --git a/components/loser/content/nautilus-content-loser.h b/components/loser/content/nautilus-content-loser.h index 66d667723..75304cf09 100644 --- a/components/loser/content/nautilus-content-loser.h +++ b/components/loser/content/nautilus-content-loser.h @@ -28,7 +28,7 @@ #ifndef NAUTILUS_CONTENT_LOSER_H #define NAUTILUS_CONTENT_LOSER_H -#include <libnautilus/nautilus-content-view-frame.h> +#include <libnautilus/nautilus-view-frame.h> #include <gtk/gtklabel.h> typedef struct NautilusContentLoser NautilusContentLoser; @@ -52,17 +52,17 @@ struct NautilusContentLoserClass { }; /* GtkObject support */ -GtkType nautilus_content_loser_get_type (void); +GtkType nautilus_content_loser_get_type (void); /* Component embedding support */ -NautilusContentView *nautilus_content_loser_get_nautilus_view (NautilusContentLoser *view); +NautilusView *nautilus_content_loser_get_nautilus_view (NautilusContentLoser *view); /* URI handling */ -void nautilus_content_loser_load_uri (NautilusContentLoser *view, - const char *uri); +void nautilus_content_loser_load_uri (NautilusContentLoser *view, + const char *uri); /* Failing on command. */ -void nautilus_content_loser_maybe_fail (const char *location); +void nautilus_content_loser_maybe_fail (const char *location); #endif /* NAUTILUS_CONTENT_LOSER_H */ diff --git a/components/loser/sidebar/main.c b/components/loser/sidebar/main.c index 8ab7272c2..ff266dda8 100644 --- a/components/loser/sidebar/main.c +++ b/components/loser/sidebar/main.c @@ -64,7 +64,7 @@ loser_make_object (BonoboGenericFactory *factory, object_count++; - nautilus_view = NAUTILUS_VIEW (nautilus_sidebar_loser_get_nautilus_view (view)); + nautilus_view = nautilus_sidebar_loser_get_nautilus_view (view); gtk_signal_connect (GTK_OBJECT (nautilus_view), "destroy", loser_object_destroyed, NULL); diff --git a/components/loser/sidebar/nautilus-sidebar-loser.c b/components/loser/sidebar/nautilus-sidebar-loser.c index 4b6fc93f4..1a0c6b1f7 100644 --- a/components/loser/sidebar/nautilus-sidebar-loser.c +++ b/components/loser/sidebar/nautilus-sidebar-loser.c @@ -92,7 +92,7 @@ nautilus_sidebar_loser_initialize (NautilusSidebarLoser *view) * can merge menu & toolbar items into Nautilus's UI. */ gtk_signal_connect (GTK_OBJECT (nautilus_view_get_bonobo_control - (NAUTILUS_VIEW (view->details->nautilus_view))), + (view->details->nautilus_view)), "activate", loser_merge_bonobo_items_callback, view); @@ -174,7 +174,7 @@ loser_notify_location_change_callback (NautilusView *nautilus_view, request.type = Nautilus_PROGRESS_UNDERWAY; request.amount = 0.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (nautilus_view), &request); + nautilus_view_request_progress_change (nautilus_view, &request); nautilus_sidebar_loser_maybe_fail ("pre-load"); @@ -195,7 +195,7 @@ loser_notify_location_change_callback (NautilusView *nautilus_view, request.type = Nautilus_PROGRESS_DONE_OK; request.amount = 100.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (nautilus_view), &request); + nautilus_view_request_progress_change (nautilus_view, &request); nautilus_sidebar_loser_maybe_fail ("post-done"); } diff --git a/components/mozilla/main.c b/components/mozilla/main.c index 4fcc27595..6c766cf5c 100644 --- a/components/mozilla/main.c +++ b/components/mozilla/main.c @@ -62,7 +62,7 @@ mozilla_make_object (BonoboGenericFactory *factory, object_count++; - nautilus_view = NAUTILUS_VIEW (nautilus_mozilla_content_view_get_nautilus_view (view)); + nautilus_view = nautilus_mozilla_content_view_get_nautilus_view (view); gtk_signal_connect (GTK_OBJECT (nautilus_view), "destroy", mozilla_object_destroyed, NULL); diff --git a/components/mozilla/nautilus-mozilla-content-view.c b/components/mozilla/nautilus-mozilla-content-view.c index d5db07bfa..2447b0b6b 100644 --- a/components/mozilla/nautilus-mozilla-content-view.c +++ b/components/mozilla/nautilus-mozilla-content-view.c @@ -40,18 +40,17 @@ #include <libgnome/gnome-i18n.h> #include <libgnomeui/gnome-stock.h> -/* A NautilusContentView's private information. */ struct NautilusMozillaContentViewDetails { char *uri; GtkWidget *mozilla; - NautilusContentView *nautilus_view; + NautilusView *nautilus_view; GdkCursor *busy_cursor; }; static void nautilus_mozilla_content_view_initialize_class (NautilusMozillaContentViewClass *klass); static void nautilus_mozilla_content_view_initialize (NautilusMozillaContentView *view); static void nautilus_mozilla_content_view_destroy (GtkObject *object); -static void mozilla_notify_location_change_callback (NautilusContentView *nautilus_view, +static void mozilla_notify_location_change_callback (NautilusView *nautilus_view, Nautilus_NavigationInfo *navinfo, NautilusMozillaContentView *view); static void mozilla_merge_bonobo_items_callback (BonoboObject *control, @@ -161,7 +160,7 @@ nautilus_mozilla_content_view_initialize (NautilusMozillaContentView *view) gtk_widget_show (view->details->mozilla); - view->details->nautilus_view = nautilus_content_view_new (GTK_WIDGET (view)); + view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view)); gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view), "notify_location_change", @@ -173,7 +172,7 @@ nautilus_mozilla_content_view_initialize (NautilusMozillaContentView *view) * can merge menu & toolbar items into Nautilus's UI. */ gtk_signal_connect (GTK_OBJECT (nautilus_view_get_bonobo_control - (NAUTILUS_VIEW (view->details->nautilus_view))), + (view->details->nautilus_view)), "activate", mozilla_merge_bonobo_items_callback, view); @@ -212,7 +211,7 @@ nautilus_mozilla_content_view_destroy (GtkObject *object) * @view: NautilusMozillaContentView to get the nautilus_view from.. * **/ -NautilusContentView * +NautilusView * nautilus_mozilla_content_view_get_nautilus_view (NautilusMozillaContentView *view) { return view->details->nautilus_view; @@ -278,8 +277,8 @@ mozilla_content_view_request_progress_change (NautilusMozillaContentView *view, progress_request.type = progress_type; progress_request.amount = progress_amount; - nautilus_view_request_progress_change (NAUTILUS_VIEW (view->details->nautilus_view), - &progress_request); + nautilus_view_request_progress_change (view->details->nautilus_view, + &progress_request); } static void @@ -301,8 +300,8 @@ mozilla_content_view_request_location_change (NautilusMozillaContentView *view, navigation_request.requested_uri = hacked_uri; - nautilus_view_request_location_change (NAUTILUS_VIEW (view->details->nautilus_view), - &navigation_request); + nautilus_view_request_location_change (view->details->nautilus_view, + &navigation_request); g_free (hacked_uri); } @@ -351,7 +350,7 @@ mozilla_content_view_clear_busy_cursor (NautilusMozillaContentView *view) } static void -mozilla_notify_location_change_callback (NautilusContentView *nautilus_view, +mozilla_notify_location_change_callback (NautilusView *nautilus_view, Nautilus_NavigationInfo *navinfo, NautilusMozillaContentView *view) { @@ -495,8 +494,8 @@ mozilla_title_changed_callback (GtkMozEmbed *mozilla, gpointer user_data) new_title = gtk_moz_embed_get_title (GTK_MOZ_EMBED (view->details->mozilla)); - nautilus_content_view_request_title_change (NAUTILUS_CONTENT_VIEW (view->details->nautilus_view), - new_title); + nautilus_view_request_title_change (view->details->nautilus_view, + new_title); g_free (new_title); } @@ -650,7 +649,7 @@ mozilla_link_message_callback (GtkMozEmbed *mozilla, gpointer user_data) status_request.status_string = link_message; - nautilus_view_request_status_change (NAUTILUS_VIEW (view->details->nautilus_view), + nautilus_view_request_status_change (view->details->nautilus_view, &status_request); g_free (link_message); } diff --git a/components/mozilla/nautilus-mozilla-content-view.h b/components/mozilla/nautilus-mozilla-content-view.h index ee44f92fc..c1bda4db4 100644 --- a/components/mozilla/nautilus-mozilla-content-view.h +++ b/components/mozilla/nautilus-mozilla-content-view.h @@ -26,7 +26,7 @@ #ifndef NAUTILUS_MOZILLA_CONTENT_VIEW_H #define NAUTILUS_MOZILLA_CONTENT_VIEW_H -#include <libnautilus/nautilus-content-view-frame.h> +#include <libnautilus/nautilus-view-frame.h> #include <gtk/gtkvbox.h> typedef struct NautilusMozillaContentView NautilusMozillaContentView; @@ -50,15 +50,15 @@ struct NautilusMozillaContentViewClass { }; /* GtkObject support */ -GtkType nautilus_mozilla_content_view_get_type (void); +GtkType nautilus_mozilla_content_view_get_type (void); /* Component embedding support */ -NautilusContentView *nautilus_mozilla_content_view_get_nautilus_view (NautilusMozillaContentView *view); +NautilusView *nautilus_mozilla_content_view_get_nautilus_view (NautilusMozillaContentView *view); /* URI handling */ -void nautilus_mozilla_content_view_load_uri (NautilusMozillaContentView *view, - const char *uri); +void nautilus_mozilla_content_view_load_uri (NautilusMozillaContentView *view, + const char *uri); #endif /* NAUTILUS_MOZILLA_CONTENT_VIEW_H */ diff --git a/components/music/main.c b/components/music/main.c index bc126b212..5e12374c6 100644 --- a/components/music/main.c +++ b/components/music/main.c @@ -60,7 +60,7 @@ music_view_make_object (BonoboGenericFactory *factory, gtk_signal_connect (GTK_OBJECT (music_view), "destroy", music_view_object_destroyed, NULL); - nautilus_view = NAUTILUS_VIEW (nautilus_music_view_get_nautilus_view (music_view)); + nautilus_view = nautilus_music_view_get_nautilus_view (music_view); return BONOBO_OBJECT (nautilus_view); } diff --git a/components/music/nautilus-music-view.c b/components/music/nautilus-music-view.c index 40751099f..d166aa6ac 100644 --- a/components/music/nautilus-music-view.c +++ b/components/music/nautilus-music-view.c @@ -55,7 +55,7 @@ struct _NautilusMusicViewDetails { char *uri; - NautilusContentView *nautilus_view; + NautilusView *nautilus_view; int background_connection; int sort_mode; @@ -143,34 +143,35 @@ static GtkTargetEntry music_dnd_target_table[] = { #define DEFAULT_BACKGROUND_COLOR "rgb:DDDD/DDDD/BBBB" -static void nautilus_music_view_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - int x, - int y, - GtkSelectionData *selection_data, - guint info, - guint time); -static void nautilus_music_view_initialize_class (NautilusMusicViewClass *klass); -static void nautilus_music_view_initialize (NautilusMusicView *view); -static void nautilus_music_view_destroy (GtkObject *object); -static void nautilus_music_view_update_from_uri (NautilusMusicView *music_view, - const char *uri); -static void music_view_notify_location_change_callback (NautilusContentView *view, - Nautilus_NavigationInfo *navinfo, - NautilusMusicView *music_view); -static void selection_callback (GtkCList *clist, - int row, - int column, - GdkEventButton *event, - NautilusMusicView *music_view); -static void music_view_set_selected_song_title (NautilusMusicView *music_view, - int row); - - -static void add_play_controls (NautilusMusicView *music_view); -static void click_column_callback(GtkCList * clist, gint column, NautilusMusicView *music_view); -static void go_to_next_track (NautilusMusicView *music_view); -static void play_current_file (NautilusMusicView *music_view, gboolean from_start); +static void nautilus_music_view_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + int x, + int y, + GtkSelectionData *selection_data, + guint info, + guint time); +static void nautilus_music_view_initialize_class (NautilusMusicViewClass *klass); +static void nautilus_music_view_initialize (NautilusMusicView *view); +static void nautilus_music_view_destroy (GtkObject *object); +static void nautilus_music_view_update_from_uri (NautilusMusicView *music_view, + const char *uri); +static void music_view_notify_location_change_callback (NautilusView *view, + Nautilus_NavigationInfo *navinfo, + NautilusMusicView *music_view); +static void selection_callback (GtkCList *clist, + int row, + int column, + GdkEventButton *event, + NautilusMusicView *music_view); +static void music_view_set_selected_song_title (NautilusMusicView *music_view, + int row); +static void add_play_controls (NautilusMusicView *music_view); +static void click_column_callback (GtkCList *clist, + gint column, + NautilusMusicView *music_view); +static void go_to_next_track (NautilusMusicView *music_view); +static void play_current_file (NautilusMusicView *music_view, + gboolean from_start); NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusMusicView, nautilus_music_view, GTK_TYPE_EVENT_BOX) @@ -197,7 +198,7 @@ nautilus_music_view_initialize (NautilusMusicView *music_view) music_view->details = g_new0 (NautilusMusicViewDetails, 1); - music_view->details->nautilus_view = nautilus_content_view_new (GTK_WIDGET (music_view)); + music_view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (music_view)); gtk_signal_connect (GTK_OBJECT (music_view->details->nautilus_view), "notify_location_change", @@ -374,7 +375,8 @@ selection_callback(GtkCList * clist, int row, int column, GdkEventButton * event /* handle clicks in the songlist columns */ -static void click_column_callback (GtkCList * clist, gint column, NautilusMusicView *music_view) +static void +click_column_callback (GtkCList * clist, gint column, NautilusMusicView *music_view) { if (music_view->details->sort_mode == column) return; @@ -383,7 +385,7 @@ static void click_column_callback (GtkCList * clist, gint column, NautilusMusicV } /* Component embedding support */ -NautilusContentView * +NautilusView * nautilus_music_view_get_nautilus_view (NautilusMusicView *music_view) { return music_view->details->nautilus_view; @@ -1419,7 +1421,7 @@ nautilus_music_view_load_uri (NautilusMusicView *music_view, const char *uri) } static void -music_view_notify_location_change_callback (NautilusContentView *view, +music_view_notify_location_change_callback (NautilusView *view, Nautilus_NavigationInfo *navinfo, NautilusMusicView *music_view) { @@ -1431,7 +1433,7 @@ music_view_notify_location_change_callback (NautilusContentView *view, progress.type = Nautilus_PROGRESS_UNDERWAY; progress.amount = 0.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (music_view->details->nautilus_view), &progress); + nautilus_view_request_progress_change (music_view->details->nautilus_view, &progress); /* do the actual work here */ nautilus_music_view_load_uri (music_view, navinfo->actual_uri); @@ -1439,7 +1441,7 @@ music_view_notify_location_change_callback (NautilusContentView *view, /* send the required PROGRESS_DONE signal */ progress.type = Nautilus_PROGRESS_DONE_OK; progress.amount = 100.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (music_view->details->nautilus_view), &progress); + nautilus_view_request_progress_change (music_view->details->nautilus_view, &progress); } /* handle receiving dropped objects */ @@ -1463,16 +1465,17 @@ nautilus_music_view_drag_data_received (GtkWidget *widget, GdkDragContext *conte case TARGET_COLOR: /* Let the background change based on the dropped color. */ - nautilus_background_receive_dropped_color (nautilus_get_widget_background (widget), - widget, x, y, selection_data); + nautilus_background_receive_dropped_color + (nautilus_get_widget_background (widget), + widget, x, y, selection_data); break; case TARGET_BGIMAGE: nautilus_background_set_tile_image_uri (nautilus_get_widget_background (widget), - uris[0]); - + uris[0]); break; + default: g_warning ("unknown drop type"); break; diff --git a/components/music/nautilus-music-view.h b/components/music/nautilus-music-view.h index ce1305b31..3406ceecf 100644 --- a/components/music/nautilus-music-view.h +++ b/components/music/nautilus-music-view.h @@ -25,7 +25,7 @@ #ifndef NAUTILUS_MUSIC_VIEW_H #define NAUTILUS_MUSIC_VIEW_H -#include <libnautilus/nautilus-content-view-frame.h> +#include <libnautilus/nautilus-view-frame.h> #include <gtk/gtkeventbox.h> @@ -52,13 +52,13 @@ struct _NautilusMusicViewClass { /* GtkObject support */ -GtkType nautilus_music_view_get_type (void); +GtkType nautilus_music_view_get_type (void); /* Component embedding support */ -NautilusContentView *nautilus_music_view_get_nautilus_view (NautilusMusicView *view); +NautilusView *nautilus_music_view_get_nautilus_view (NautilusMusicView *view); /* URI handling */ -void nautilus_music_view_load_uri (NautilusMusicView *view, - const char *uri); +void nautilus_music_view_load_uri (NautilusMusicView *view, + const char *uri); #endif /* NAUTILUS_MUSIC_VIEW_H */ diff --git a/components/rpmview/main.c b/components/rpmview/main.c index de6a29293..14b79596a 100644 --- a/components/rpmview/main.c +++ b/components/rpmview/main.c @@ -60,7 +60,7 @@ rpm_view_make_object (BonoboGenericFactory *factory, gtk_signal_connect (GTK_OBJECT (rpm_view), "destroy", rpm_view_object_destroyed, NULL); - nautilus_view = NAUTILUS_VIEW (nautilus_rpm_view_get_nautilus_view (rpm_view)); + nautilus_view = nautilus_rpm_view_get_nautilus_view (rpm_view); return BONOBO_OBJECT (nautilus_view); } diff --git a/components/rpmview/nautilus-rpm-view.c b/components/rpmview/nautilus-rpm-view.c index eeeac4792..544bce275 100644 --- a/components/rpmview/nautilus-rpm-view.c +++ b/components/rpmview/nautilus-rpm-view.c @@ -50,9 +50,9 @@ #include <libgnorba/gnorba.h> #include <limits.h> -struct _NautilusRPMViewDetails { +struct NautilusRPMViewDetails { char *current_uri; - NautilusContentView *nautilus_view; + NautilusView *nautilus_view; GtkWidget *package_image; GtkWidget *package_title; @@ -106,7 +106,7 @@ static void nautilus_rpm_view_drag_data_received (GtkWidget * static void nautilus_rpm_view_initialize_class (NautilusRPMViewClass *klass); static void nautilus_rpm_view_initialize (NautilusRPMView *view); static void nautilus_rpm_view_destroy (GtkObject *object); -static void rpm_view_notify_location_change_callback (NautilusContentView *view, +static void rpm_view_notify_location_change_callback (NautilusView *view, Nautilus_NavigationInfo *navinfo, NautilusRPMView *rpm_view); static gint check_installed (gchar *package_name, gchar *package_version, gchar *package_release); @@ -139,7 +139,7 @@ nautilus_rpm_view_initialize (NautilusRPMView *rpm_view) rpm_view->details = g_new0 (NautilusRPMViewDetails, 1); - rpm_view->details->nautilus_view = nautilus_content_view_new (GTK_WIDGET (rpm_view)); + rpm_view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (rpm_view)); gtk_signal_connect (GTK_OBJECT (rpm_view->details->nautilus_view), "notify_location_change", @@ -357,7 +357,7 @@ nautilus_rpm_view_destroy (GtkObject *object) } /* Component embedding support */ -NautilusContentView * +NautilusView * nautilus_rpm_view_get_nautilus_view (NautilusRPMView *rpm_view) { return rpm_view->details->nautilus_view; @@ -593,7 +593,7 @@ nautilus_rpm_view_load_uri (NautilusRPMView *rpm_view, const char *uri) } static void -rpm_view_notify_location_change_callback (NautilusContentView *view, +rpm_view_notify_location_change_callback (NautilusView *view, Nautilus_NavigationInfo *navinfo, NautilusRPMView *rpm_view) { @@ -605,7 +605,7 @@ rpm_view_notify_location_change_callback (NautilusContentView *view, progress.type = Nautilus_PROGRESS_UNDERWAY; progress.amount = 0.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (rpm_view->details->nautilus_view), &progress); + nautilus_view_request_progress_change (rpm_view->details->nautilus_view, &progress); /* do the actual work here */ nautilus_rpm_view_load_uri (rpm_view, navinfo->actual_uri); @@ -613,7 +613,7 @@ rpm_view_notify_location_change_callback (NautilusContentView *view, /* send the required PROGRESS_DONE signal */ progress.type = Nautilus_PROGRESS_DONE_OK; progress.amount = 100.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (rpm_view->details->nautilus_view), &progress); + nautilus_view_request_progress_change (rpm_view->details->nautilus_view, &progress); } /* handle drag and drop */ diff --git a/components/rpmview/nautilus-rpm-view.h b/components/rpmview/nautilus-rpm-view.h index f09e2bfd7..7281c132c 100644 --- a/components/rpmview/nautilus-rpm-view.h +++ b/components/rpmview/nautilus-rpm-view.h @@ -25,12 +25,12 @@ #ifndef NAUTILUS_RPM_VIEW_H #define NAUTILUS_RPM_VIEW_H -#include <libnautilus/nautilus-content-view-frame.h> +#include <libnautilus/nautilus-view-frame.h> #include <gtk/gtkeventbox.h> -typedef struct _NautilusRPMView NautilusRPMView; -typedef struct _NautilusRPMViewClass NautilusRPMViewClass; +typedef struct NautilusRPMView NautilusRPMView; +typedef struct NautilusRPMViewClass NautilusRPMViewClass; #define NAUTILUS_TYPE_RPM_VIEW (nautilus_rpm_view_get_type ()) #define NAUTILUS_RPM_VIEW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_RPM_VIEW, NautilusRPMView)) @@ -38,26 +38,25 @@ typedef struct _NautilusRPMViewClass NautilusRPMViewClass; #define NAUTILUS_IS_RPM_VIEW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_RPM_VIEW)) #define NAUTILUS_IS_RPM_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), NAUTILUS_TYPE_RPM_VIEW)) -typedef struct _NautilusRPMViewDetails NautilusRPMViewDetails; +typedef struct NautilusRPMViewDetails NautilusRPMViewDetails; -struct _NautilusRPMView { +struct NautilusRPMView { GtkEventBox parent; NautilusRPMViewDetails *details; }; -struct _NautilusRPMViewClass { +struct NautilusRPMViewClass { GtkEventBoxClass parent_class; }; - /* GtkObject support */ -GtkType nautilus_rpm_view_get_type (void); +GtkType nautilus_rpm_view_get_type (void); /* Component embedding support */ -NautilusContentView *nautilus_rpm_view_get_nautilus_view (NautilusRPMView *view); +NautilusView *nautilus_rpm_view_get_nautilus_view (NautilusRPMView *view); /* URI handling */ -void nautilus_rpm_view_load_uri (NautilusRPMView *view, - const char *uri); +void nautilus_rpm_view_load_uri (NautilusRPMView *view, + const char *uri); #endif /* NAUTILUS_RPM_VIEW_H */ diff --git a/components/sample/main.c b/components/sample/main.c index 327b8d795..29eb1ab24 100644 --- a/components/sample/main.c +++ b/components/sample/main.c @@ -62,7 +62,7 @@ sample_make_object (BonoboGenericFactory *factory, object_count++; - nautilus_view = NAUTILUS_VIEW (nautilus_sample_content_view_get_nautilus_view (view)); + nautilus_view = nautilus_sample_content_view_get_nautilus_view (view); gtk_signal_connect (GTK_OBJECT (nautilus_view), "destroy", sample_object_destroyed, NULL); diff --git a/components/sample/nautilus-sample-content-view.c b/components/sample/nautilus-sample-content-view.c index 69c9f57af..714570178 100644 --- a/components/sample/nautilus-sample-content-view.c +++ b/components/sample/nautilus-sample-content-view.c @@ -41,22 +41,21 @@ /* A NautilusContentView's private information. */ struct NautilusSampleContentViewDetails { char *uri; - NautilusContentView *nautilus_view; + NautilusView *nautilus_view; }; static void nautilus_sample_content_view_initialize_class (NautilusSampleContentViewClass *klass); static void nautilus_sample_content_view_initialize (NautilusSampleContentView *view); static void nautilus_sample_content_view_destroy (GtkObject *object); +static void sample_notify_location_change_callback (NautilusView *nautilus_view, + Nautilus_NavigationInfo *navinfo, + NautilusSampleContentView *view); +static void sample_merge_bonobo_items_callback (BonoboObject *control, + gboolean state, + gpointer user_data); NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusSampleContentView, nautilus_sample_content_view, GTK_TYPE_LABEL) -static void sample_notify_location_change_callback (NautilusContentView *nautilus_view, - Nautilus_NavigationInfo *navinfo, - NautilusSampleContentView *view); -static void sample_merge_bonobo_items_callback (BonoboObject *control, - gboolean state, - gpointer user_data); - static void nautilus_sample_content_view_initialize_class (NautilusSampleContentViewClass *klass) { @@ -74,7 +73,7 @@ nautilus_sample_content_view_initialize (NautilusSampleContentView *view) gtk_label_set_text (GTK_LABEL (view), g_strdup ("(none)")); - view->details->nautilus_view = nautilus_content_view_new (GTK_WIDGET (view)); + view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view)); gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view), "notify_location_change", @@ -86,7 +85,7 @@ nautilus_sample_content_view_initialize (NautilusSampleContentView *view) * can merge menu & toolbar items into Nautilus's UI. */ gtk_signal_connect (GTK_OBJECT (nautilus_view_get_bonobo_control - (NAUTILUS_VIEW (view->details->nautilus_view))), + (view->details->nautilus_view)), "activate", sample_merge_bonobo_items_callback, view); @@ -117,7 +116,7 @@ nautilus_sample_content_view_destroy (GtkObject *object) * @view: NautilusSampleContentView to get the nautilus_view from.. * **/ -NautilusContentView * +NautilusView * nautilus_sample_content_view_get_nautilus_view (NautilusSampleContentView *view) { return view->details->nautilus_view; @@ -144,8 +143,8 @@ nautilus_sample_content_view_load_uri (NautilusSampleContentView *view, } static void -sample_notify_location_change_callback (NautilusContentView *nautilus_view, - Nautilus_NavigationInfo *navinfo, +sample_notify_location_change_callback (NautilusView *nautilus_view, + Nautilus_NavigationInfo *navinfo, NautilusSampleContentView *view) { Nautilus_ProgressRequestInfo request; @@ -165,7 +164,7 @@ sample_notify_location_change_callback (NautilusContentView *nautilus_view, request.type = Nautilus_PROGRESS_UNDERWAY; request.amount = 0.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (nautilus_view), &request); + nautilus_view_request_progress_change (nautilus_view, &request); /* Do the actual load. */ nautilus_sample_content_view_load_uri (view, navinfo->actual_uri); @@ -182,7 +181,7 @@ sample_notify_location_change_callback (NautilusContentView *nautilus_view, request.type = Nautilus_PROGRESS_DONE_OK; request.amount = 100.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (nautilus_view), &request); + nautilus_view_request_progress_change (nautilus_view, &request); } static void diff --git a/components/sample/nautilus-sample-content-view.h b/components/sample/nautilus-sample-content-view.h index fdc10afc2..2a8a89150 100644 --- a/components/sample/nautilus-sample-content-view.h +++ b/components/sample/nautilus-sample-content-view.h @@ -29,7 +29,7 @@ #ifndef NAUTILUS_SAMPLE_CONTENT_VIEW_H #define NAUTILUS_SAMPLE_CONTENT_VIEW_H -#include <libnautilus/nautilus-content-view-frame.h> +#include <libnautilus/nautilus-view-frame.h> #include <gtk/gtklabel.h> typedef struct NautilusSampleContentView NautilusSampleContentView; @@ -53,13 +53,13 @@ struct NautilusSampleContentViewClass { }; /* GtkObject support */ -GtkType nautilus_sample_content_view_get_type (void); +GtkType nautilus_sample_content_view_get_type (void); /* Component embedding support */ -NautilusContentView *nautilus_sample_content_view_get_nautilus_view (NautilusSampleContentView *view); +NautilusView *nautilus_sample_content_view_get_nautilus_view (NautilusSampleContentView *view); /* URI handling */ -void nautilus_sample_content_view_load_uri (NautilusSampleContentView *view, - const char *uri); +void nautilus_sample_content_view_load_uri (NautilusSampleContentView *view, + const char *uri); #endif /* NAUTILUS_SAMPLE_CONTENT_VIEW_H */ diff --git a/components/services/startup/nautilus-view/main.c b/components/services/startup/nautilus-view/main.c index c1e8b5c09..bf408711e 100644 --- a/components/services/startup/nautilus-view/main.c +++ b/components/services/startup/nautilus-view/main.c @@ -61,7 +61,7 @@ services_make_object (BonoboGenericFactory* factory, gtk_signal_connect (GTK_OBJECT (view), "destroy", services_object_destroyed, NULL); - nautilus_view = NAUTILUS_VIEW (nautilus_service_startup_view_get_nautilus_view (view)); + nautilus_view = nautilus_service_startup_view_get_nautilus_view (view); printf ("Returning new object %p\n", nautilus_view); diff --git a/components/services/startup/nautilus-view/nautilus-service-startup-view.c b/components/services/startup/nautilus-view/nautilus-service-startup-view.c index 4b7f00432..ffc6aa7a3 100644 --- a/components/services/startup/nautilus-view/nautilus-service-startup-view.c +++ b/components/services/startup/nautilus-view/nautilus-service-startup-view.c @@ -46,7 +46,7 @@ struct _NautilusServicesContentViewDetails { char* uri; char* auth_token; - NautilusContentView* nautilus_view; + NautilusView* nautilus_view; GtkWidget* form; GtkWidget* form_title; GtkWidget* account_name; @@ -67,7 +67,7 @@ static void nautilus_service_startup_view_destroy (GtkObject* object); NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusServicesContentView, nautilus_service_startup_view, GTK_TYPE_EVENT_BOX) -static void service_main_notify_location_change_cb (NautilusContentView* view, +static void service_main_notify_location_change_cb (NautilusView* view, Nautilus_NavigationInfo* navinfo, NautilusServicesContentView* services); static gboolean is_location (char* document_str, const char* place_str); @@ -81,7 +81,7 @@ go_to_uri(NautilusServicesContentView* view, char* uri) Nautilus_NavigationRequestInfo nri; memset (&nri, 0, sizeof(nri)); nri.requested_uri = uri; - nautilus_view_request_location_change (NAUTILUS_VIEW (view->details->nautilus_view), &nri); + nautilus_view_request_location_change (view->details->nautilus_view, &nri); } /* temporary callback to handle the configuration button */ @@ -761,7 +761,7 @@ nautilus_service_startup_view_initialize (NautilusServicesContentView* view) { NautilusBackground* background; view->details = g_new0 (NautilusServicesContentViewDetails, 1); - view->details->nautilus_view = nautilus_content_view_new (GTK_WIDGET (view)); + view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view)); gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view), "notify_location_change", GTK_SIGNAL_FUNC (service_main_notify_location_change_cb), @@ -793,7 +793,7 @@ nautilus_service_startup_view_destroy (GtkObject* object) { } /* Component embedding support */ -NautilusContentView * +NautilusView * nautilus_service_startup_view_get_nautilus_view (NautilusServicesContentView* view) { return view->details->nautilus_view; } @@ -844,7 +844,7 @@ nautilus_service_startup_view_load_uri (NautilusServicesContentView* view, } static void -service_main_notify_location_change_cb (NautilusContentView* view, +service_main_notify_location_change_cb (NautilusView* view, Nautilus_NavigationInfo* navinfo, NautilusServicesContentView* services) { @@ -855,12 +855,12 @@ service_main_notify_location_change_cb (NautilusContentView* view, /* we must send a PROGRESS_UNDERWAY message */ pri.type = Nautilus_PROGRESS_UNDERWAY; pri.amount = 0.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (services->details->nautilus_view), &pri); + nautilus_view_request_progress_change (services->details->nautilus_view, &pri); nautilus_service_startup_view_load_uri (services, navinfo->actual_uri); /* likewise, we must send a PROGRESS_DONE message */ pri.type = Nautilus_PROGRESS_DONE_OK; pri.amount = 100.0; - nautilus_view_request_progress_change (NAUTILUS_VIEW (services->details->nautilus_view), &pri); + nautilus_view_request_progress_change (services->details->nautilus_view, &pri); } diff --git a/components/services/startup/nautilus-view/nautilus-service-startup-view.h b/components/services/startup/nautilus-view/nautilus-service-startup-view.h index 2d6d5f5e5..4d6b088a3 100644 --- a/components/services/startup/nautilus-view/nautilus-service-startup-view.h +++ b/components/services/startup/nautilus-view/nautilus-service-startup-view.h @@ -28,7 +28,7 @@ #ifndef NAUTILUS_SERVICE_STARTUP_VIEW_H #define NAUTILUS_SERVICE_STARTUP_VIEW_H -#include <libnautilus/nautilus-content-view-frame.h> +#include <libnautilus/nautilus-view-frame.h> #include <gtk/gtk.h> typedef struct _NautilusServicesContentView NautilusServicesContentView; @@ -52,13 +52,13 @@ struct _NautilusServicesContentViewClass { }; /* GtkObject support */ -GtkType nautilus_service_startup_view_get_type (void); +GtkType nautilus_service_startup_view_get_type (void); /* Component embedding support */ -NautilusContentView *nautilus_service_startup_view_get_nautilus_view (NautilusServicesContentView *view); +NautilusView *nautilus_service_startup_view_get_nautilus_view (NautilusServicesContentView *view); /* URI handling */ -void nautilus_service_startup_view_load_uri (NautilusServicesContentView *view, - const char *uri); +void nautilus_service_startup_view_load_uri (NautilusServicesContentView *view, + const char *uri); #endif /* NAUTILUS_SERVICE_STARTUP_VIEW_H */ diff --git a/libnautilus/Makefile.am b/libnautilus/Makefile.am index 56dbd9521..6b77bc88f 100644 --- a/libnautilus/Makefile.am +++ b/libnautilus/Makefile.am @@ -43,7 +43,6 @@ libnautilusinclude_HEADERS= \ libnautilus.h \ nautilus-bonobo-ui.h \ nautilus-clipboard.h \ - nautilus-content-view-frame.h \ nautilus-view-component.h \ nautilus-view-frame.h \ nautilus-undo-context.h \ @@ -59,7 +58,6 @@ libnautilus_la_SOURCES= \ $(nautilus_view_component_idl_sources) \ $(nautilus_undo_idl_sources) \ nautilus-clipboard.c \ - nautilus-content-view-frame.c \ nautilus-view-frame.c \ nautilus-undo-context.c \ nautilus-undo-manager.c \ diff --git a/libnautilus/libnautilus.h b/libnautilus/libnautilus.h index 84df61177..1e6bdb9bc 100644 --- a/libnautilus/libnautilus.h +++ b/libnautilus/libnautilus.h @@ -32,6 +32,5 @@ #include <bonobo.h> #include <libnautilus/nautilus-view-component.h> #include <libnautilus/nautilus-view-frame.h> -#include <libnautilus/nautilus-content-view-frame.h> #endif /* LIBNAUTILUS_H */ diff --git a/libnautilus/nautilus-content-view-frame.c b/libnautilus/nautilus-content-view-frame.c deleted file mode 100644 index d2dbf635e..000000000 --- a/libnautilus/nautilus-content-view-frame.c +++ /dev/null @@ -1,131 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * libnautilus: A library for nautilus view implementations. - * - * Copyright (C) 1999, 2000 Red Hat, Inc. - * Copyright (C) 2000 Eazel, Inc. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Author: Elliot Lee <sopwith@redhat.com> - * - */ - -/* nautilus-content-view-frame.c: Implementation for object that - represents the frame a nautilus content view plugs into. */ - -#include <config.h> -#include "nautilus-content-view-frame.h" -#include "nautilus-view-frame-private.h" -#include <libnautilus-extensions/nautilus-gtk-macros.h> -#include <bonobo/bonobo-control.h> - - -typedef struct { - POA_Nautilus_View servant; - gpointer bonobo_object; - - NautilusContentView *view; -} impl_POA_Nautilus_ContentView; - -extern POA_Nautilus_View__epv libnautilus_Nautilus_View_epv; -static POA_Nautilus_ContentView__epv impl_Nautilus_ContentView_epv; -static PortableServer_ServantBase__epv base_epv; - -static POA_Nautilus_ContentView__vepv impl_Nautilus_ContentView_vepv = -{ - &base_epv, - NULL, - &libnautilus_Nautilus_View_epv, - &impl_Nautilus_ContentView_epv -}; - -static void nautilus_content_view_initialize (NautilusContentView *view); -static void nautilus_content_view_destroy (NautilusContentView *view); -static void nautilus_content_view_initialize_class (NautilusContentViewClass *klass); - -NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusContentView, nautilus_content_view, NAUTILUS_TYPE_VIEW) - -static void -nautilus_content_view_initialize (NautilusContentView *view) -{ -} - -NautilusContentView * -nautilus_content_view_new (GtkWidget *widget) -{ - BonoboControl *control; - - control = bonobo_control_new (widget); - - return nautilus_content_view_new_from_bonobo_control (control); -} - -NautilusContentView * -nautilus_content_view_new_from_bonobo_control (BonoboControl *bonobo_control) -{ - NautilusContentView *view; - - view = NAUTILUS_CONTENT_VIEW (gtk_object_new (NAUTILUS_TYPE_CONTENT_VIEW, - "bonobo_control", bonobo_control, - NULL)); - - return view; -} - -static void -nautilus_content_view_destroy (NautilusContentView *view) -{ - NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, GTK_OBJECT (view)); -} - -static void -nautilus_content_view_initialize_class (NautilusContentViewClass *klass) -{ - NautilusViewClass *view_class; - GtkObjectClass *object_class; - - object_class = (GtkObjectClass*) klass; - object_class->destroy = (void (*)(GtkObject *))nautilus_content_view_destroy; - - view_class = (NautilusViewClass *) klass; - view_class->servant_init_func = POA_Nautilus_ContentView__init; - view_class->servant_destroy_func = POA_Nautilus_ContentView__fini; - view_class->vepv = &impl_Nautilus_ContentView_vepv; -} - -void -nautilus_content_view_request_title_change (NautilusContentView *view, - const char *new_title) -{ - CORBA_Environment ev; - - g_return_if_fail (NAUTILUS_IS_CONTENT_VIEW (view)); - g_return_if_fail (new_title != NULL); - - CORBA_exception_init(&ev); - - if (nautilus_view_ensure_view_frame (NAUTILUS_VIEW (view))) { - Nautilus_ContentViewFrame_request_title_change (NAUTILUS_VIEW (view)->details->view_frame, new_title, &ev); - if (ev._major != CORBA_NO_EXCEPTION) - { - CORBA_Object_release(NAUTILUS_VIEW (view)->details->view_frame, &ev); - NAUTILUS_VIEW (view)->details->view_frame = CORBA_OBJECT_NIL; - } - } - - CORBA_exception_free(&ev); -} diff --git a/libnautilus/nautilus-content-view-frame.h b/libnautilus/nautilus-content-view-frame.h deleted file mode 100644 index 39d884416..000000000 --- a/libnautilus/nautilus-content-view-frame.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * libnautilus: A library for nautilus view implementations. - * - * Copyright (C) 1999, 2000 Red Hat, Inc. - * Copyright (C) 2000 Eazel, Inc. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Author: Elliot Lee <sopwith@redhat.com> - * - */ - -/* nautilus-content-view-frame.h: Interface for object that represents a - the frame a nautilus content view plugs into. */ - -#ifndef NAUTILUS_CONTENT_VIEW_H -#define NAUTILUS_CONTENT_VIEW_H - -#include <libnautilus/nautilus-view-frame.h> - -#define NAUTILUS_TYPE_CONTENT_VIEW (nautilus_content_view_get_type ()) -#define NAUTILUS_CONTENT_VIEW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_CONTENT_VIEW, NautilusContentView)) -#define NAUTILUS_CONTENT_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_CONTENT_VIEW, NautilusContentViewClass)) -#define NAUTILUS_IS_CONTENT_VIEW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_CONTENT_VIEW)) -#define NAUTILUS_IS_CONTENT_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), NAUTILUS_TYPE_CONTENT_VIEW)) - -typedef struct NautilusContentView NautilusContentView; -typedef struct NautilusContentViewClass NautilusContentViewClass; - -struct NautilusContentViewClass { - NautilusViewClass parent_spot; -}; - -struct NautilusContentView { - NautilusView parent; -}; - -GtkType nautilus_content_view_get_type (void); -NautilusContentView *nautilus_content_view_new (GtkWidget *widget); -NautilusContentView *nautilus_content_view_new_from_bonobo_control (BonoboControl *bonobo_control); -void nautilus_content_view_request_title_change (NautilusContentView *view, - const char *new_title); - -#endif diff --git a/libnautilus/nautilus-view-component.idl b/libnautilus/nautilus-view-component.idl index e0e77496e..f61111281 100644 --- a/libnautilus/nautilus-view-component.idl +++ b/libnautilus/nautilus-view-component.idl @@ -52,9 +52,6 @@ module Nautilus { oneway void show_properties (); // Requests that the client show its properties }; - interface ContentView : View { - }; - interface ViewWindow; interface ViewFrame : ::Bonobo::Unknown { @@ -63,9 +60,6 @@ module Nautilus { oneway void request_location_change (in NavigationRequestInfo navinfo); oneway void request_selection_change (in SelectionRequestInfo selinfo); oneway void request_progress_change (in ProgressRequestInfo proginfo); - }; - - interface ContentViewFrame : ViewFrame { oneway void request_title_change (in string new_title); }; diff --git a/libnautilus/nautilus-view-frame-private.h b/libnautilus/nautilus-view-frame-private.h deleted file mode 100644 index 584866a37..000000000 --- a/libnautilus/nautilus-view-frame-private.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * libnautilus: A library for nautilus view implementations. - * - * Copyright (C) 2000 Eazel, Inc. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Author: John Sullivan <sullivan@eazel.com> - * - */ - -#ifndef NAUTILUS_VIEW_FRAME_PRIVATE_H -#define NAUTILUS_VIEW_FRAME_PRIVATE_H - -struct NautilusViewDetails { - BonoboControl *control; - Nautilus_ViewFrame view_frame; -}; - -gboolean nautilus_view_ensure_view_frame (NautilusView *view); - -#endif diff --git a/libnautilus/nautilus-view-frame.c b/libnautilus/nautilus-view-frame.c index 5bac638b5..d85534a14 100644 --- a/libnautilus/nautilus-view-frame.c +++ b/libnautilus/nautilus-view-frame.c @@ -29,7 +29,6 @@ #include <config.h> #include "nautilus-view-frame.h" -#include "nautilus-view-frame-private.h" #include <gtk/gtksignal.h> #include <bonobo/bonobo-main.h> @@ -48,13 +47,12 @@ enum { LAST_SIGNAL }; -enum { - ARG_0, - ARG_CONTROL -}; - static guint signals[LAST_SIGNAL]; +struct NautilusViewDetails { + BonoboControl *control; +}; + typedef struct { POA_Nautilus_View servant; gpointer bonobo_object; @@ -62,47 +60,35 @@ typedef struct { NautilusView *view; } impl_POA_Nautilus_View; -void nautilus_view_real_set_bonobo_control (NautilusView *view, - BonoboControl *bonobo_control); - - -static void -impl_Nautilus_View_save_state (impl_POA_Nautilus_View * servant, - CORBA_char * config_path, - CORBA_Environment * ev); - -static void -impl_Nautilus_View_load_state (impl_POA_Nautilus_View * servant, - CORBA_char * config_path, - CORBA_Environment * ev); - -static void -impl_Nautilus_View_notify_location_change (impl_POA_Nautilus_View * servant, - Nautilus_NavigationInfo * navinfo, - CORBA_Environment * ev); - -static void -impl_Nautilus_View_stop_location_change (impl_POA_Nautilus_View * servant, - CORBA_Environment * ev); - -static void -impl_Nautilus_View_notify_selection_change (impl_POA_Nautilus_View * servant, - Nautilus_SelectionInfo * selinfo, - CORBA_Environment * ev); - -static void -impl_Nautilus_View_show_properties (impl_POA_Nautilus_View * servant, - CORBA_Environment * ev); +static void impl_Nautilus_View_save_state (PortableServer_Servant servant, + const CORBA_char *config_path, + CORBA_Environment *ev); +static void impl_Nautilus_View_load_state (PortableServer_Servant servant, + const CORBA_char *config_path, + CORBA_Environment *ev); +static void impl_Nautilus_View_notify_location_change (PortableServer_Servant servant, + const Nautilus_NavigationInfo *navinfo, + CORBA_Environment *ev); +static void impl_Nautilus_View_stop_location_change (PortableServer_Servant servant, + CORBA_Environment *ev); +static void impl_Nautilus_View_notify_selection_change (PortableServer_Servant servant, + const Nautilus_SelectionInfo *selinfo, + CORBA_Environment *ev); +static void impl_Nautilus_View_show_properties (PortableServer_Servant servant, + CORBA_Environment *ev); +static void nautilus_view_initialize (NautilusView *view); +static void nautilus_view_destroy (NautilusView *view); +static void nautilus_view_initialize_class (NautilusViewClass *klass); POA_Nautilus_View__epv libnautilus_Nautilus_View_epv = { NULL, /* _private */ - (gpointer) & impl_Nautilus_View_save_state, - (gpointer) & impl_Nautilus_View_load_state, - (gpointer) & impl_Nautilus_View_notify_location_change, - (gpointer) & impl_Nautilus_View_stop_location_change, - (gpointer) & impl_Nautilus_View_notify_selection_change, - (gpointer) & impl_Nautilus_View_show_properties + &impl_Nautilus_View_save_state, + &impl_Nautilus_View_load_state, + &impl_Nautilus_View_notify_location_change, + &impl_Nautilus_View_stop_location_change, + &impl_Nautilus_View_notify_selection_change, + &impl_Nautilus_View_show_properties }; static PortableServer_ServantBase__epv base_epv; @@ -114,58 +100,63 @@ static POA_Nautilus_View__vepv impl_Nautilus_View_vepv = }; static void -impl_Nautilus_View_save_state(impl_POA_Nautilus_View * servant, - CORBA_char * config_path, - CORBA_Environment * ev) +impl_Nautilus_View_save_state (PortableServer_Servant servant, + const CORBA_char *config_path, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[SAVE_STATE], config_path); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[SAVE_STATE], config_path); } static void -impl_Nautilus_View_load_state(impl_POA_Nautilus_View * servant, - CORBA_char * config_path, - CORBA_Environment * ev) +impl_Nautilus_View_load_state (PortableServer_Servant servant, + const CORBA_char *config_path, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[LOAD_STATE], config_path); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[LOAD_STATE], config_path); } static void -impl_Nautilus_View_notify_location_change(impl_POA_Nautilus_View * servant, - Nautilus_NavigationInfo * navinfo, - CORBA_Environment * ev) +impl_Nautilus_View_notify_location_change (PortableServer_Servant servant, + const Nautilus_NavigationInfo *navinfo, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[NOTIFY_LOCATION_CHANGE], navinfo); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[NOTIFY_LOCATION_CHANGE], navinfo); } static void -impl_Nautilus_View_show_properties(impl_POA_Nautilus_View * servant, - CORBA_Environment * ev) +impl_Nautilus_View_show_properties (PortableServer_Servant servant, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[SHOW_PROPERTIES]); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[SHOW_PROPERTIES]); } static void -impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant, - Nautilus_SelectionInfo * selinfo, - CORBA_Environment * ev) +impl_Nautilus_View_notify_selection_change (PortableServer_Servant servant, + const Nautilus_SelectionInfo *selinfo, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[NOTIFY_SELECTION_CHANGE], selinfo); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[NOTIFY_SELECTION_CHANGE], selinfo); } static void -impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant, - CORBA_Environment * ev) +impl_Nautilus_View_stop_location_change (PortableServer_Servant servant, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[STOP_LOCATION_CHANGE]); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[STOP_LOCATION_CHANGE]); } - static void -impl_Nautilus_View__destroy(BonoboObject *obj, impl_POA_Nautilus_View *servant) +impl_Nautilus_View__destroy (BonoboObject *obj, impl_POA_Nautilus_View *servant) { PortableServer_ObjectId *objid; CORBA_Environment ev; - void (*servant_destroy_func) (PortableServer_Servant servant, CORBA_Environment *ev); + void (* servant_destroy_func) (PortableServer_Servant servant, CORBA_Environment *ev); CORBA_exception_init(&ev); @@ -181,7 +172,7 @@ impl_Nautilus_View__destroy(BonoboObject *obj, impl_POA_Nautilus_View *servant) } static Nautilus_ViewFrame -impl_Nautilus_View__create(NautilusView *view, CORBA_Environment * ev) +impl_Nautilus_View__create (NautilusView *view, CORBA_Environment * ev) { Nautilus_ViewFrame retval; @@ -206,16 +197,6 @@ impl_Nautilus_View__create(NautilusView *view, CORBA_Environment * ev) return retval; } -static void nautilus_view_initialize (NautilusView *view); -static void nautilus_view_destroy (NautilusView *view); -static void nautilus_view_initialize_class (NautilusViewClass *klass); -static void nautilus_view_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void nautilus_view_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); - NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusView, nautilus_view, BONOBO_OBJECT_TYPE) static void @@ -224,9 +205,7 @@ nautilus_view_initialize_class (NautilusViewClass *klass) GtkObjectClass *object_class; object_class = (GtkObjectClass*) klass; - object_class->destroy = (void (*)(GtkObject*))nautilus_view_destroy; - object_class->set_arg = nautilus_view_set_arg; - object_class->get_arg = nautilus_view_get_arg; + object_class->destroy = (void (*)(GtkObject *)) nautilus_view_destroy; klass->parent_class = gtk_type_class (gtk_type_parent (object_class->type)); klass->servant_init_func = POA_Nautilus_View__init; @@ -234,80 +213,48 @@ nautilus_view_initialize_class (NautilusViewClass *klass) klass->vepv = &impl_Nautilus_View_vepv; signals[NOTIFY_LOCATION_CHANGE] = - gtk_signal_new("notify_location_change", + gtk_signal_new ("notify_location_change", GTK_RUN_LAST, object_class->type, GTK_SIGNAL_OFFSET (NautilusViewClass, notify_location_change), gtk_marshal_NONE__BOXED, GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - signals[NOTIFY_SELECTION_CHANGE] = - gtk_signal_new("notify_selection_change", + signals[NOTIFY_SELECTION_CHANGE] = + gtk_signal_new ("notify_selection_change", GTK_RUN_LAST, object_class->type, GTK_SIGNAL_OFFSET (NautilusViewClass, notify_selection_change), gtk_marshal_NONE__BOXED, GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - signals[LOAD_STATE] = - gtk_signal_new("load_state", + signals[LOAD_STATE] = + gtk_signal_new ("load_state", GTK_RUN_LAST, object_class->type, GTK_SIGNAL_OFFSET (NautilusViewClass, load_state), gtk_marshal_NONE__STRING, GTK_TYPE_NONE, 1, GTK_TYPE_STRING); - signals[SAVE_STATE] = - gtk_signal_new("save_state", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewClass, save_state), - gtk_marshal_NONE__STRING, - GTK_TYPE_NONE, 1, GTK_TYPE_STRING); - signals[SHOW_PROPERTIES] = - gtk_signal_new("show_properties", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewClass, show_properties), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - signals[STOP_LOCATION_CHANGE] = - gtk_signal_new("stop_location_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewClass, stop_location_change), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + signals[SAVE_STATE] = + gtk_signal_new ("save_state", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewClass, save_state), + gtk_marshal_NONE__STRING, + GTK_TYPE_NONE, 1, GTK_TYPE_STRING); + signals[SHOW_PROPERTIES] = + gtk_signal_new ("show_properties", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewClass, show_properties), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + signals[STOP_LOCATION_CHANGE] = + gtk_signal_new ("stop_location_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewClass, stop_location_change), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - - gtk_object_add_arg_type ("NautilusView::bonobo_control", - GTK_TYPE_OBJECT, - GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT | GTK_ARG_CONSTRUCT_ONLY, - ARG_CONTROL); -} - -static void -nautilus_view_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - switch(arg_id) { - case ARG_CONTROL: - nautilus_view_real_set_bonobo_control (NAUTILUS_VIEW (object), - BONOBO_CONTROL (GTK_VALUE_OBJECT (*arg))); - } -} - -static void -nautilus_view_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - NautilusView *view; - - view = NAUTILUS_VIEW (object); - - switch(arg_id) { - case ARG_CONTROL: - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (nautilus_view_get_bonobo_control (NAUTILUS_VIEW (object))); - } } static void @@ -319,7 +266,9 @@ nautilus_view_initialize (NautilusView *view) view->details = g_new0 (NautilusViewDetails, 1); - bonobo_object_construct (BONOBO_OBJECT (view), impl_Nautilus_View__create (view, &ev)); + bonobo_object_construct + (BONOBO_OBJECT (view), + impl_Nautilus_View__create (view, &ev)); CORBA_exception_free (&ev); } @@ -327,20 +276,20 @@ nautilus_view_initialize (NautilusView *view) NautilusView * nautilus_view_new (GtkWidget *widget) { - BonoboControl *control; - - control = bonobo_control_new (widget); - return nautilus_view_new_from_bonobo_control (control); + return nautilus_view_new_from_bonobo_control + (bonobo_control_new (widget)); } NautilusView * -nautilus_view_new_from_bonobo_control (BonoboControl *bonobo_control) +nautilus_view_new_from_bonobo_control (BonoboControl *control) { NautilusView *view; - view = NAUTILUS_VIEW (gtk_object_new (NAUTILUS_TYPE_VIEW, - "bonobo_control", bonobo_control, - NULL)); + view = NAUTILUS_VIEW (gtk_type_new (NAUTILUS_TYPE_VIEW)); + view->details->control = control; + bonobo_object_add_interface (BONOBO_OBJECT (view), BONOBO_OBJECT (control)); + nautilus_undo_set_up_bonobo_control (control); + return view; } @@ -356,127 +305,111 @@ nautilus_view_destroy (NautilusView *view) NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, GTK_OBJECT (view)); } -gboolean -nautilus_view_ensure_view_frame (NautilusView *view) +static Nautilus_ViewFrame +get_view_frame (NautilusView *view, CORBA_Environment *ev) +{ + return Bonobo_Unknown_query_interface + (bonobo_control_get_control_frame (nautilus_view_get_bonobo_control (view)), + "IDL:Nautilus/ViewFrame:1.0", ev); +} + +void +nautilus_view_request_location_change (NautilusView *view, + Nautilus_NavigationRequestInfo *request) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; - g_assert (NAUTILUS_IS_VIEW (view)); + g_return_if_fail (NAUTILUS_IS_VIEW (view)); CORBA_exception_init (&ev); - if (CORBA_Object_is_nil (view->details->view_frame, &ev)) { - view->details->view_frame = Bonobo_Unknown_query_interface - (bonobo_control_get_control_frame - (nautilus_view_get_bonobo_control (view)), - "IDL:Nautilus/ViewFrame:1.0", &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - view->details->view_frame = CORBA_OBJECT_NIL; - } - } - - - if (CORBA_Object_is_nil (view->details->view_frame, &ev)) { - CORBA_exception_free (&ev); - return FALSE; - } else { - CORBA_exception_free (&ev); - return TRUE; - } + view_frame = get_view_frame (view, &ev); + Nautilus_ViewFrame_request_location_change (view_frame, request, &ev); + CORBA_Object_release (view_frame, &ev); + + CORBA_exception_free (&ev); } void -nautilus_view_request_location_change (NautilusView *view, - Nautilus_NavigationRequestInfo *loc) +nautilus_view_request_selection_change (NautilusView *view, + Nautilus_SelectionRequestInfo *request) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; - g_return_if_fail (view != NULL); g_return_if_fail (NAUTILUS_IS_VIEW (view)); CORBA_exception_init (&ev); - if (nautilus_view_ensure_view_frame (view)) { - Nautilus_ViewFrame_request_location_change(view->details->view_frame, loc, &ev); - if(ev._major != CORBA_NO_EXCEPTION) { - CORBA_Object_release(view->details->view_frame, &ev); - view->details->view_frame = CORBA_OBJECT_NIL; - } - } + view_frame = get_view_frame (view, &ev); + Nautilus_ViewFrame_request_selection_change (view_frame, request, &ev); + CORBA_Object_release (view_frame, &ev); CORBA_exception_free(&ev); } void -nautilus_view_request_selection_change (NautilusView *view, - Nautilus_SelectionRequestInfo *loc) +nautilus_view_request_status_change (NautilusView *view, + Nautilus_StatusRequestInfo *request) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; - g_return_if_fail (view != NULL); g_return_if_fail (NAUTILUS_IS_VIEW (view)); - CORBA_exception_init(&ev); + CORBA_exception_init (&ev); - if (nautilus_view_ensure_view_frame (view)) { - Nautilus_ViewFrame_request_selection_change(view->details->view_frame, loc, &ev); - if(ev._major != CORBA_NO_EXCEPTION) { - CORBA_Object_release(view->details->view_frame, &ev); - view->details->view_frame = CORBA_OBJECT_NIL; - } - } + view_frame = get_view_frame (view, &ev); + Nautilus_ViewFrame_request_status_change (view_frame, request, &ev); + CORBA_Object_release (view_frame, &ev); - CORBA_exception_free(&ev); + CORBA_exception_free (&ev); } void -nautilus_view_request_status_change (NautilusView *view, - Nautilus_StatusRequestInfo *loc) +nautilus_view_request_progress_change(NautilusView *view, + Nautilus_ProgressRequestInfo *request) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; - g_return_if_fail (view != NULL); g_return_if_fail (NAUTILUS_IS_VIEW (view)); - CORBA_exception_init(&ev); + CORBA_exception_init (&ev); - if (nautilus_view_ensure_view_frame (view)) { - Nautilus_ViewFrame_request_status_change(view->details->view_frame, loc, &ev); - if(ev._major != CORBA_NO_EXCEPTION) { - CORBA_Object_release(view->details->view_frame, &ev); - view->details->view_frame = CORBA_OBJECT_NIL; - } - } + view_frame = get_view_frame (view, &ev); + Nautilus_ViewFrame_request_progress_change (view_frame, request, &ev); + CORBA_Object_release (view_frame, &ev); - CORBA_exception_free(&ev); + CORBA_exception_free (&ev); } + void -nautilus_view_request_progress_change(NautilusView *view, - Nautilus_ProgressRequestInfo *loc) +nautilus_view_request_title_change (NautilusView *view, + const char *new_title) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; - g_return_if_fail (view != NULL); g_return_if_fail (NAUTILUS_IS_VIEW (view)); - CORBA_exception_init(&ev); + CORBA_exception_init (&ev); - if (nautilus_view_ensure_view_frame (view)) { - Nautilus_ViewFrame_request_progress_change(view->details->view_frame, loc, &ev); - if(ev._major != CORBA_NO_EXCEPTION) { - CORBA_Object_release(view->details->view_frame, &ev); - view->details->view_frame = CORBA_OBJECT_NIL; - } - } + view_frame = get_view_frame (view, &ev); + Nautilus_ViewFrame_request_title_change (view_frame, new_title, &ev); + CORBA_Object_release (view_frame, &ev); - CORBA_exception_free(&ev); + CORBA_exception_free (&ev); } - BonoboControl * nautilus_view_get_bonobo_control (NautilusView *view) { + g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL); + + bonobo_object_ref (BONOBO_OBJECT (view->details->control)); return view->details->control; } @@ -484,26 +417,18 @@ CORBA_Object nautilus_view_get_main_window (NautilusView *view) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; Nautilus_ViewWindow window; + g_return_val_if_fail (NAUTILUS_IS_VIEW (view), CORBA_OBJECT_NIL); + CORBA_exception_init (&ev); - if (nautilus_view_ensure_view_frame (view)) { - window = Nautilus_ViewFrame__get_main_window (view->details->view_frame, &ev); - } else { - window = NULL; - } + view_frame = get_view_frame (view, &ev); + window = Nautilus_ViewFrame__get_main_window (view_frame, &ev); + CORBA_Object_release (view_frame, &ev); CORBA_exception_free (&ev); return window; } - -void -nautilus_view_real_set_bonobo_control (NautilusView *view, - BonoboControl *bonobo_control) -{ - view->details->control = bonobo_control; - bonobo_object_add_interface (BONOBO_OBJECT (view), BONOBO_OBJECT (view->details->control)); - nautilus_undo_set_up_bonobo_control (bonobo_control); -} diff --git a/libnautilus/nautilus-view-frame.h b/libnautilus/nautilus-view-frame.h index aaf9d46ec..1913e3b2d 100644 --- a/libnautilus/nautilus-view-frame.h +++ b/libnautilus/nautilus-view-frame.h @@ -83,6 +83,8 @@ void nautilus_view_request_status_change (NautilusView Nautilus_StatusRequestInfo *loc); void nautilus_view_request_progress_change (NautilusView *view, Nautilus_ProgressRequestInfo *loc); +void nautilus_view_request_title_change (NautilusView *view, + const char *title); BonoboControl *nautilus_view_get_bonobo_control (NautilusView *view); CORBA_Object nautilus_view_get_main_window (NautilusView *view); diff --git a/libnautilus/nautilus-view.c b/libnautilus/nautilus-view.c index 5bac638b5..d85534a14 100644 --- a/libnautilus/nautilus-view.c +++ b/libnautilus/nautilus-view.c @@ -29,7 +29,6 @@ #include <config.h> #include "nautilus-view-frame.h" -#include "nautilus-view-frame-private.h" #include <gtk/gtksignal.h> #include <bonobo/bonobo-main.h> @@ -48,13 +47,12 @@ enum { LAST_SIGNAL }; -enum { - ARG_0, - ARG_CONTROL -}; - static guint signals[LAST_SIGNAL]; +struct NautilusViewDetails { + BonoboControl *control; +}; + typedef struct { POA_Nautilus_View servant; gpointer bonobo_object; @@ -62,47 +60,35 @@ typedef struct { NautilusView *view; } impl_POA_Nautilus_View; -void nautilus_view_real_set_bonobo_control (NautilusView *view, - BonoboControl *bonobo_control); - - -static void -impl_Nautilus_View_save_state (impl_POA_Nautilus_View * servant, - CORBA_char * config_path, - CORBA_Environment * ev); - -static void -impl_Nautilus_View_load_state (impl_POA_Nautilus_View * servant, - CORBA_char * config_path, - CORBA_Environment * ev); - -static void -impl_Nautilus_View_notify_location_change (impl_POA_Nautilus_View * servant, - Nautilus_NavigationInfo * navinfo, - CORBA_Environment * ev); - -static void -impl_Nautilus_View_stop_location_change (impl_POA_Nautilus_View * servant, - CORBA_Environment * ev); - -static void -impl_Nautilus_View_notify_selection_change (impl_POA_Nautilus_View * servant, - Nautilus_SelectionInfo * selinfo, - CORBA_Environment * ev); - -static void -impl_Nautilus_View_show_properties (impl_POA_Nautilus_View * servant, - CORBA_Environment * ev); +static void impl_Nautilus_View_save_state (PortableServer_Servant servant, + const CORBA_char *config_path, + CORBA_Environment *ev); +static void impl_Nautilus_View_load_state (PortableServer_Servant servant, + const CORBA_char *config_path, + CORBA_Environment *ev); +static void impl_Nautilus_View_notify_location_change (PortableServer_Servant servant, + const Nautilus_NavigationInfo *navinfo, + CORBA_Environment *ev); +static void impl_Nautilus_View_stop_location_change (PortableServer_Servant servant, + CORBA_Environment *ev); +static void impl_Nautilus_View_notify_selection_change (PortableServer_Servant servant, + const Nautilus_SelectionInfo *selinfo, + CORBA_Environment *ev); +static void impl_Nautilus_View_show_properties (PortableServer_Servant servant, + CORBA_Environment *ev); +static void nautilus_view_initialize (NautilusView *view); +static void nautilus_view_destroy (NautilusView *view); +static void nautilus_view_initialize_class (NautilusViewClass *klass); POA_Nautilus_View__epv libnautilus_Nautilus_View_epv = { NULL, /* _private */ - (gpointer) & impl_Nautilus_View_save_state, - (gpointer) & impl_Nautilus_View_load_state, - (gpointer) & impl_Nautilus_View_notify_location_change, - (gpointer) & impl_Nautilus_View_stop_location_change, - (gpointer) & impl_Nautilus_View_notify_selection_change, - (gpointer) & impl_Nautilus_View_show_properties + &impl_Nautilus_View_save_state, + &impl_Nautilus_View_load_state, + &impl_Nautilus_View_notify_location_change, + &impl_Nautilus_View_stop_location_change, + &impl_Nautilus_View_notify_selection_change, + &impl_Nautilus_View_show_properties }; static PortableServer_ServantBase__epv base_epv; @@ -114,58 +100,63 @@ static POA_Nautilus_View__vepv impl_Nautilus_View_vepv = }; static void -impl_Nautilus_View_save_state(impl_POA_Nautilus_View * servant, - CORBA_char * config_path, - CORBA_Environment * ev) +impl_Nautilus_View_save_state (PortableServer_Servant servant, + const CORBA_char *config_path, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[SAVE_STATE], config_path); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[SAVE_STATE], config_path); } static void -impl_Nautilus_View_load_state(impl_POA_Nautilus_View * servant, - CORBA_char * config_path, - CORBA_Environment * ev) +impl_Nautilus_View_load_state (PortableServer_Servant servant, + const CORBA_char *config_path, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[LOAD_STATE], config_path); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[LOAD_STATE], config_path); } static void -impl_Nautilus_View_notify_location_change(impl_POA_Nautilus_View * servant, - Nautilus_NavigationInfo * navinfo, - CORBA_Environment * ev) +impl_Nautilus_View_notify_location_change (PortableServer_Servant servant, + const Nautilus_NavigationInfo *navinfo, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[NOTIFY_LOCATION_CHANGE], navinfo); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[NOTIFY_LOCATION_CHANGE], navinfo); } static void -impl_Nautilus_View_show_properties(impl_POA_Nautilus_View * servant, - CORBA_Environment * ev) +impl_Nautilus_View_show_properties (PortableServer_Servant servant, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[SHOW_PROPERTIES]); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[SHOW_PROPERTIES]); } static void -impl_Nautilus_View_notify_selection_change(impl_POA_Nautilus_View * servant, - Nautilus_SelectionInfo * selinfo, - CORBA_Environment * ev) +impl_Nautilus_View_notify_selection_change (PortableServer_Servant servant, + const Nautilus_SelectionInfo *selinfo, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[NOTIFY_SELECTION_CHANGE], selinfo); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[NOTIFY_SELECTION_CHANGE], selinfo); } static void -impl_Nautilus_View_stop_location_change(impl_POA_Nautilus_View * servant, - CORBA_Environment * ev) +impl_Nautilus_View_stop_location_change (PortableServer_Servant servant, + CORBA_Environment *ev) { - gtk_signal_emit (GTK_OBJECT (servant->view), signals[STOP_LOCATION_CHANGE]); + gtk_signal_emit (GTK_OBJECT (((impl_POA_Nautilus_View *) servant)->view), + signals[STOP_LOCATION_CHANGE]); } - static void -impl_Nautilus_View__destroy(BonoboObject *obj, impl_POA_Nautilus_View *servant) +impl_Nautilus_View__destroy (BonoboObject *obj, impl_POA_Nautilus_View *servant) { PortableServer_ObjectId *objid; CORBA_Environment ev; - void (*servant_destroy_func) (PortableServer_Servant servant, CORBA_Environment *ev); + void (* servant_destroy_func) (PortableServer_Servant servant, CORBA_Environment *ev); CORBA_exception_init(&ev); @@ -181,7 +172,7 @@ impl_Nautilus_View__destroy(BonoboObject *obj, impl_POA_Nautilus_View *servant) } static Nautilus_ViewFrame -impl_Nautilus_View__create(NautilusView *view, CORBA_Environment * ev) +impl_Nautilus_View__create (NautilusView *view, CORBA_Environment * ev) { Nautilus_ViewFrame retval; @@ -206,16 +197,6 @@ impl_Nautilus_View__create(NautilusView *view, CORBA_Environment * ev) return retval; } -static void nautilus_view_initialize (NautilusView *view); -static void nautilus_view_destroy (NautilusView *view); -static void nautilus_view_initialize_class (NautilusViewClass *klass); -static void nautilus_view_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void nautilus_view_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); - NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusView, nautilus_view, BONOBO_OBJECT_TYPE) static void @@ -224,9 +205,7 @@ nautilus_view_initialize_class (NautilusViewClass *klass) GtkObjectClass *object_class; object_class = (GtkObjectClass*) klass; - object_class->destroy = (void (*)(GtkObject*))nautilus_view_destroy; - object_class->set_arg = nautilus_view_set_arg; - object_class->get_arg = nautilus_view_get_arg; + object_class->destroy = (void (*)(GtkObject *)) nautilus_view_destroy; klass->parent_class = gtk_type_class (gtk_type_parent (object_class->type)); klass->servant_init_func = POA_Nautilus_View__init; @@ -234,80 +213,48 @@ nautilus_view_initialize_class (NautilusViewClass *klass) klass->vepv = &impl_Nautilus_View_vepv; signals[NOTIFY_LOCATION_CHANGE] = - gtk_signal_new("notify_location_change", + gtk_signal_new ("notify_location_change", GTK_RUN_LAST, object_class->type, GTK_SIGNAL_OFFSET (NautilusViewClass, notify_location_change), gtk_marshal_NONE__BOXED, GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - signals[NOTIFY_SELECTION_CHANGE] = - gtk_signal_new("notify_selection_change", + signals[NOTIFY_SELECTION_CHANGE] = + gtk_signal_new ("notify_selection_change", GTK_RUN_LAST, object_class->type, GTK_SIGNAL_OFFSET (NautilusViewClass, notify_selection_change), gtk_marshal_NONE__BOXED, GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - signals[LOAD_STATE] = - gtk_signal_new("load_state", + signals[LOAD_STATE] = + gtk_signal_new ("load_state", GTK_RUN_LAST, object_class->type, GTK_SIGNAL_OFFSET (NautilusViewClass, load_state), gtk_marshal_NONE__STRING, GTK_TYPE_NONE, 1, GTK_TYPE_STRING); - signals[SAVE_STATE] = - gtk_signal_new("save_state", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewClass, save_state), - gtk_marshal_NONE__STRING, - GTK_TYPE_NONE, 1, GTK_TYPE_STRING); - signals[SHOW_PROPERTIES] = - gtk_signal_new("show_properties", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewClass, show_properties), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - signals[STOP_LOCATION_CHANGE] = - gtk_signal_new("stop_location_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewClass, stop_location_change), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + signals[SAVE_STATE] = + gtk_signal_new ("save_state", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewClass, save_state), + gtk_marshal_NONE__STRING, + GTK_TYPE_NONE, 1, GTK_TYPE_STRING); + signals[SHOW_PROPERTIES] = + gtk_signal_new ("show_properties", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewClass, show_properties), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + signals[STOP_LOCATION_CHANGE] = + gtk_signal_new ("stop_location_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewClass, stop_location_change), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - - gtk_object_add_arg_type ("NautilusView::bonobo_control", - GTK_TYPE_OBJECT, - GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT | GTK_ARG_CONSTRUCT_ONLY, - ARG_CONTROL); -} - -static void -nautilus_view_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - switch(arg_id) { - case ARG_CONTROL: - nautilus_view_real_set_bonobo_control (NAUTILUS_VIEW (object), - BONOBO_CONTROL (GTK_VALUE_OBJECT (*arg))); - } -} - -static void -nautilus_view_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - NautilusView *view; - - view = NAUTILUS_VIEW (object); - - switch(arg_id) { - case ARG_CONTROL: - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (nautilus_view_get_bonobo_control (NAUTILUS_VIEW (object))); - } } static void @@ -319,7 +266,9 @@ nautilus_view_initialize (NautilusView *view) view->details = g_new0 (NautilusViewDetails, 1); - bonobo_object_construct (BONOBO_OBJECT (view), impl_Nautilus_View__create (view, &ev)); + bonobo_object_construct + (BONOBO_OBJECT (view), + impl_Nautilus_View__create (view, &ev)); CORBA_exception_free (&ev); } @@ -327,20 +276,20 @@ nautilus_view_initialize (NautilusView *view) NautilusView * nautilus_view_new (GtkWidget *widget) { - BonoboControl *control; - - control = bonobo_control_new (widget); - return nautilus_view_new_from_bonobo_control (control); + return nautilus_view_new_from_bonobo_control + (bonobo_control_new (widget)); } NautilusView * -nautilus_view_new_from_bonobo_control (BonoboControl *bonobo_control) +nautilus_view_new_from_bonobo_control (BonoboControl *control) { NautilusView *view; - view = NAUTILUS_VIEW (gtk_object_new (NAUTILUS_TYPE_VIEW, - "bonobo_control", bonobo_control, - NULL)); + view = NAUTILUS_VIEW (gtk_type_new (NAUTILUS_TYPE_VIEW)); + view->details->control = control; + bonobo_object_add_interface (BONOBO_OBJECT (view), BONOBO_OBJECT (control)); + nautilus_undo_set_up_bonobo_control (control); + return view; } @@ -356,127 +305,111 @@ nautilus_view_destroy (NautilusView *view) NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, GTK_OBJECT (view)); } -gboolean -nautilus_view_ensure_view_frame (NautilusView *view) +static Nautilus_ViewFrame +get_view_frame (NautilusView *view, CORBA_Environment *ev) +{ + return Bonobo_Unknown_query_interface + (bonobo_control_get_control_frame (nautilus_view_get_bonobo_control (view)), + "IDL:Nautilus/ViewFrame:1.0", ev); +} + +void +nautilus_view_request_location_change (NautilusView *view, + Nautilus_NavigationRequestInfo *request) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; - g_assert (NAUTILUS_IS_VIEW (view)); + g_return_if_fail (NAUTILUS_IS_VIEW (view)); CORBA_exception_init (&ev); - if (CORBA_Object_is_nil (view->details->view_frame, &ev)) { - view->details->view_frame = Bonobo_Unknown_query_interface - (bonobo_control_get_control_frame - (nautilus_view_get_bonobo_control (view)), - "IDL:Nautilus/ViewFrame:1.0", &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - view->details->view_frame = CORBA_OBJECT_NIL; - } - } - - - if (CORBA_Object_is_nil (view->details->view_frame, &ev)) { - CORBA_exception_free (&ev); - return FALSE; - } else { - CORBA_exception_free (&ev); - return TRUE; - } + view_frame = get_view_frame (view, &ev); + Nautilus_ViewFrame_request_location_change (view_frame, request, &ev); + CORBA_Object_release (view_frame, &ev); + + CORBA_exception_free (&ev); } void -nautilus_view_request_location_change (NautilusView *view, - Nautilus_NavigationRequestInfo *loc) +nautilus_view_request_selection_change (NautilusView *view, + Nautilus_SelectionRequestInfo *request) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; - g_return_if_fail (view != NULL); g_return_if_fail (NAUTILUS_IS_VIEW (view)); CORBA_exception_init (&ev); - if (nautilus_view_ensure_view_frame (view)) { - Nautilus_ViewFrame_request_location_change(view->details->view_frame, loc, &ev); - if(ev._major != CORBA_NO_EXCEPTION) { - CORBA_Object_release(view->details->view_frame, &ev); - view->details->view_frame = CORBA_OBJECT_NIL; - } - } + view_frame = get_view_frame (view, &ev); + Nautilus_ViewFrame_request_selection_change (view_frame, request, &ev); + CORBA_Object_release (view_frame, &ev); CORBA_exception_free(&ev); } void -nautilus_view_request_selection_change (NautilusView *view, - Nautilus_SelectionRequestInfo *loc) +nautilus_view_request_status_change (NautilusView *view, + Nautilus_StatusRequestInfo *request) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; - g_return_if_fail (view != NULL); g_return_if_fail (NAUTILUS_IS_VIEW (view)); - CORBA_exception_init(&ev); + CORBA_exception_init (&ev); - if (nautilus_view_ensure_view_frame (view)) { - Nautilus_ViewFrame_request_selection_change(view->details->view_frame, loc, &ev); - if(ev._major != CORBA_NO_EXCEPTION) { - CORBA_Object_release(view->details->view_frame, &ev); - view->details->view_frame = CORBA_OBJECT_NIL; - } - } + view_frame = get_view_frame (view, &ev); + Nautilus_ViewFrame_request_status_change (view_frame, request, &ev); + CORBA_Object_release (view_frame, &ev); - CORBA_exception_free(&ev); + CORBA_exception_free (&ev); } void -nautilus_view_request_status_change (NautilusView *view, - Nautilus_StatusRequestInfo *loc) +nautilus_view_request_progress_change(NautilusView *view, + Nautilus_ProgressRequestInfo *request) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; - g_return_if_fail (view != NULL); g_return_if_fail (NAUTILUS_IS_VIEW (view)); - CORBA_exception_init(&ev); + CORBA_exception_init (&ev); - if (nautilus_view_ensure_view_frame (view)) { - Nautilus_ViewFrame_request_status_change(view->details->view_frame, loc, &ev); - if(ev._major != CORBA_NO_EXCEPTION) { - CORBA_Object_release(view->details->view_frame, &ev); - view->details->view_frame = CORBA_OBJECT_NIL; - } - } + view_frame = get_view_frame (view, &ev); + Nautilus_ViewFrame_request_progress_change (view_frame, request, &ev); + CORBA_Object_release (view_frame, &ev); - CORBA_exception_free(&ev); + CORBA_exception_free (&ev); } + void -nautilus_view_request_progress_change(NautilusView *view, - Nautilus_ProgressRequestInfo *loc) +nautilus_view_request_title_change (NautilusView *view, + const char *new_title) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; - g_return_if_fail (view != NULL); g_return_if_fail (NAUTILUS_IS_VIEW (view)); - CORBA_exception_init(&ev); + CORBA_exception_init (&ev); - if (nautilus_view_ensure_view_frame (view)) { - Nautilus_ViewFrame_request_progress_change(view->details->view_frame, loc, &ev); - if(ev._major != CORBA_NO_EXCEPTION) { - CORBA_Object_release(view->details->view_frame, &ev); - view->details->view_frame = CORBA_OBJECT_NIL; - } - } + view_frame = get_view_frame (view, &ev); + Nautilus_ViewFrame_request_title_change (view_frame, new_title, &ev); + CORBA_Object_release (view_frame, &ev); - CORBA_exception_free(&ev); + CORBA_exception_free (&ev); } - BonoboControl * nautilus_view_get_bonobo_control (NautilusView *view) { + g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL); + + bonobo_object_ref (BONOBO_OBJECT (view->details->control)); return view->details->control; } @@ -484,26 +417,18 @@ CORBA_Object nautilus_view_get_main_window (NautilusView *view) { CORBA_Environment ev; + Nautilus_ViewFrame view_frame; Nautilus_ViewWindow window; + g_return_val_if_fail (NAUTILUS_IS_VIEW (view), CORBA_OBJECT_NIL); + CORBA_exception_init (&ev); - if (nautilus_view_ensure_view_frame (view)) { - window = Nautilus_ViewFrame__get_main_window (view->details->view_frame, &ev); - } else { - window = NULL; - } + view_frame = get_view_frame (view, &ev); + window = Nautilus_ViewFrame__get_main_window (view_frame, &ev); + CORBA_Object_release (view_frame, &ev); CORBA_exception_free (&ev); return window; } - -void -nautilus_view_real_set_bonobo_control (NautilusView *view, - BonoboControl *bonobo_control) -{ - view->details->control = bonobo_control; - bonobo_object_add_interface (BONOBO_OBJECT (view), BONOBO_OBJECT (view->details->control)); - nautilus_undo_set_up_bonobo_control (bonobo_control); -} diff --git a/libnautilus/nautilus-view.h b/libnautilus/nautilus-view.h index aaf9d46ec..1913e3b2d 100644 --- a/libnautilus/nautilus-view.h +++ b/libnautilus/nautilus-view.h @@ -83,6 +83,8 @@ void nautilus_view_request_status_change (NautilusView Nautilus_StatusRequestInfo *loc); void nautilus_view_request_progress_change (NautilusView *view, Nautilus_ProgressRequestInfo *loc); +void nautilus_view_request_title_change (NautilusView *view, + const char *title); BonoboControl *nautilus_view_get_bonobo_control (NautilusView *view); CORBA_Object nautilus_view_get_main_window (NautilusView *view); diff --git a/src/Makefile.am b/src/Makefile.am index a23fdb055..5fa334000 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -62,8 +62,6 @@ nautilus_SOURCES =\ nautilus.h \ ntl-app.c \ ntl-app.h \ - ntl-content-view.c \ - ntl-content-view.h \ ntl-index-panel.c \ ntl-index-panel.h \ ntl-main.c \ diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index 408331a9c..094145645 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -81,7 +81,7 @@ static guint signals[LAST_SIGNAL]; struct FMDirectoryViewDetails { - NautilusContentView *nautilus_view; + NautilusView *nautilus_view; NautilusZoomable *zoomable; NautilusDirectory *model; @@ -500,7 +500,7 @@ static BonoboControl * get_bonobo_control (FMDirectoryView *view) { return BONOBO_CONTROL (nautilus_view_get_bonobo_control - (NAUTILUS_VIEW (view->details->nautilus_view))); + (view->details->nautilus_view)); } static void @@ -541,8 +541,7 @@ fm_directory_view_initialize (FMDirectoryView *directory_view) gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (directory_view), NULL); gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (directory_view), NULL); - directory_view->details->nautilus_view = NAUTILUS_CONTENT_VIEW - (nautilus_content_view_new (GTK_WIDGET (directory_view))); + directory_view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (directory_view)); directory_view->details->zoomable = nautilus_zoomable_new_from_bonobo_control (get_bonobo_control (directory_view), .25, 4.0, FALSE); @@ -751,8 +750,8 @@ display_selection_info (FMDirectoryView *view) g_free (folder_item_count_str); g_free (non_folder_str); - nautilus_view_request_status_change - (NAUTILUS_VIEW (view->details->nautilus_view), &request); + nautilus_view_request_status_change (view->details->nautilus_view, + &request); g_free (request.status_string); } @@ -777,8 +776,8 @@ fm_directory_view_send_selection_change (FMDirectoryView *view) nautilus_file_list_free (selection); /* Send the selection change. */ - nautilus_view_request_selection_change - (NAUTILUS_VIEW (view->details->nautilus_view), &request); + nautilus_view_request_selection_change (view->details->nautilus_view, + &request); /* Free the URIs. */ for (i = 0; i < request.selected_uris._length; i++) { @@ -790,8 +789,8 @@ fm_directory_view_send_selection_change (FMDirectoryView *view) static void notify_location_change_callback (NautilusView *nautilus_view, - Nautilus_NavigationInfo *navigation_context, - FMDirectoryView *directory_view) + Nautilus_NavigationInfo *navigation_context, + FMDirectoryView *directory_view) { fm_directory_view_load_uri (directory_view, navigation_context->requested_uri); } @@ -837,7 +836,7 @@ notify_selection_change_callback (NautilusView *nautilus_view, static void stop_location_change_callback (NautilusView *nautilus_view, - FMDirectoryView *directory_view) + FMDirectoryView *directory_view) { fm_directory_view_stop (directory_view); } @@ -856,8 +855,8 @@ done_loading (FMDirectoryView *view) memset (&progress, 0, sizeof (progress)); progress.amount = 100.0; progress.type = Nautilus_PROGRESS_DONE_OK; - nautilus_view_request_progress_change - (NAUTILUS_VIEW (view->details->nautilus_view), &progress); + nautilus_view_request_progress_change (view->details->nautilus_view, + &progress); view->details->loading = FALSE; } @@ -1289,14 +1288,14 @@ fm_directory_view_get_bonobo_ui_handler (FMDirectoryView *view) /** * fm_directory_view_get_nautilus_view: * - * Get the NautilusContentView for this FMDirectoryView. + * Get the NautilusView for this FMDirectoryView. * This is normally called only by the embedding framework. * @view: FMDirectoryView of interest. * - * Return value: NautilusContentView for this view. + * Return value: NautilusView for this view. * **/ -NautilusContentView * +NautilusView * fm_directory_view_get_nautilus_view (FMDirectoryView *view) { g_return_val_if_fail (FM_IS_DIRECTORY_VIEW (view), NULL); @@ -2274,8 +2273,8 @@ fm_directory_view_activate_file_internal (FMDirectoryView *view, request.requested_uri = nautilus_file_get_mapped_uri (file); request.new_window_requested = use_new_window; - nautilus_view_request_location_change - (NAUTILUS_VIEW (view->details->nautilus_view), &request); + nautilus_view_request_location_change (view->details->nautilus_view, + &request); g_free (request.requested_uri); } @@ -2348,8 +2347,8 @@ finish_loading_uri (FMDirectoryView *view) memset (&progress, 0, sizeof (progress)); progress.type = Nautilus_PROGRESS_UNDERWAY; - nautilus_view_request_progress_change - (NAUTILUS_VIEW (view->details->nautilus_view), &progress); + nautilus_view_request_progress_change (view->details->nautilus_view, + &progress); /* Tell interested parties that we've begun loading this directory now. * Subclasses use this to know that the new metadata is now available. diff --git a/src/file-manager/fm-directory-view.h b/src/file-manager/fm-directory-view.h index cab0e948c..89f4b0d21 100644 --- a/src/file-manager/fm-directory-view.h +++ b/src/file-manager/fm-directory-view.h @@ -28,7 +28,7 @@ #include <bonobo/bonobo-ui-handler.h> #include <gtk/gtkmenu.h> #include <gtk/gtkscrolledwindow.h> -#include <libnautilus/nautilus-content-view-frame.h> +#include <libnautilus/nautilus-view-frame.h> #include <libnautilus-extensions/nautilus-directory.h> #include <libnautilus-extensions/nautilus-file.h> #include <libnautilus-extensions/nautilus-icon-container.h> @@ -188,60 +188,60 @@ struct FMDirectoryViewClass { }; /* GtkObject support */ -GtkType fm_directory_view_get_type (void); +GtkType fm_directory_view_get_type (void); /* Component embedding support */ -NautilusContentView *fm_directory_view_get_nautilus_view (FMDirectoryView *view); +NautilusView * fm_directory_view_get_nautilus_view (FMDirectoryView *view); /* URI handling */ -void fm_directory_view_load_uri (FMDirectoryView *view, - const char *uri); +void fm_directory_view_load_uri (FMDirectoryView *view, + const char *uri); /* Functions callable from the user interface and elsewhere. */ -char * fm_directory_view_get_container_uri (NautilusIconContainer *container, - FMDirectoryView *view); -gboolean fm_directory_view_can_accept_item (NautilusIconContainer *container, - NautilusFile *target_item, - const char *item_uri, - FMDirectoryView *view); -GList * fm_directory_view_get_selection (FMDirectoryView *view); -void fm_directory_view_stop (FMDirectoryView *view); -gboolean fm_directory_view_can_zoom_in (FMDirectoryView *view); -gboolean fm_directory_view_can_zoom_out (FMDirectoryView *view); -void fm_directory_view_bump_zoom_level (FMDirectoryView *view, - int zoom_increment); -void fm_directory_view_select_all (FMDirectoryView *view); -void fm_directory_view_set_selection (FMDirectoryView *view, - GList *selection); -void fm_directory_view_move_copy_items (NautilusIconContainer *container, - const GList *item_uris, - const GdkPoint *relative_item_points, - const char *target_uri, - int copy_action, - int x, - int y, - FMDirectoryView *view); -gint fm_directory_view_get_context_menu_index (const char *menu_name); +char * fm_directory_view_get_container_uri (NautilusIconContainer *container, + FMDirectoryView *view); +gboolean fm_directory_view_can_accept_item (NautilusIconContainer *container, + NautilusFile *target_item, + const char *item_uri, + FMDirectoryView *view); +GList * fm_directory_view_get_selection (FMDirectoryView *view); +void fm_directory_view_stop (FMDirectoryView *view); +gboolean fm_directory_view_can_zoom_in (FMDirectoryView *view); +gboolean fm_directory_view_can_zoom_out (FMDirectoryView *view); +void fm_directory_view_bump_zoom_level (FMDirectoryView *view, + int zoom_increment); +void fm_directory_view_select_all (FMDirectoryView *view); +void fm_directory_view_set_selection (FMDirectoryView *view, + GList *selection); +void fm_directory_view_move_copy_items (NautilusIconContainer *container, + const GList *item_uris, + const GdkPoint *relative_item_points, + const char *target_uri, + int copy_action, + int x, + int y, + FMDirectoryView *view); +gint fm_directory_view_get_context_menu_index (const char *menu_name); /* Wrappers for signal emitters. These are normally called * only by FMDirectoryView itself. They have corresponding signals * that observers might want to connect with. */ -void fm_directory_view_clear (FMDirectoryView *view); -void fm_directory_view_begin_loading (FMDirectoryView *view); +void fm_directory_view_clear (FMDirectoryView *view); +void fm_directory_view_begin_loading (FMDirectoryView *view); /* Hooks for subclasses to call. These are normally called only by * FMDirectoryView and its subclasses */ -void fm_directory_view_activate_file (FMDirectoryView *view, - NautilusFile *file, - gboolean request_new_window); -void fm_directory_view_notify_selection_changed (FMDirectoryView *view); -BonoboUIHandler * fm_directory_view_get_bonobo_ui_handler (FMDirectoryView *view); -NautilusDirectory * fm_directory_view_get_model (FMDirectoryView *view); -void fm_directory_view_pop_up_background_context_menu (FMDirectoryView *view); -void fm_directory_view_pop_up_selection_context_menu (FMDirectoryView *view); -void fm_directory_view_update_menus (FMDirectoryView *view); +void fm_directory_view_activate_file (FMDirectoryView *view, + NautilusFile *file, + gboolean request_new_window); +void fm_directory_view_notify_selection_changed (FMDirectoryView *view); +BonoboUIHandler * fm_directory_view_get_bonobo_ui_handler (FMDirectoryView *view); +NautilusDirectory *fm_directory_view_get_model (FMDirectoryView *view); +void fm_directory_view_pop_up_background_context_menu (FMDirectoryView *view); +void fm_directory_view_pop_up_selection_context_menu (FMDirectoryView *view); +void fm_directory_view_update_menus (FMDirectoryView *view); #endif /* FM_DIRECTORY_VIEW_H */ diff --git a/src/nautilus-applicable-views.c b/src/nautilus-applicable-views.c index 5edf61098..85a7c462a 100644 --- a/src/nautilus-applicable-views.c +++ b/src/nautilus-applicable-views.c @@ -288,14 +288,14 @@ make_oaf_query_with_known_mime_type (NautilusNavigationInfo *navinfo) result = g_strdup_printf ( /* Check if the component has the interfaces we need. - * We can work with either a Nautilus ContentView, or + * We can work with either a Nautilus View, or * with a Bonobo Control or Embeddable that supports * one of the three persistence interfaces: * PersistStream, ProgressiveDataSink, or * PersistFile. */ "((repo_ids.has_all(['IDL:Bonobo/Control:1.0'," - "'IDL:Nautilus/ContentView:1.0'])" + "'IDL:Nautilus/View:1.0'])" "OR (repo_ids.has_one(['IDL:Bonobo/Control:1.0'," "'IDL:Bonobo/Embeddable:1.0'])" "AND repo_ids.has_one(['IDL:Bonobo/PersistStream:1.0'," @@ -368,12 +368,12 @@ make_oaf_query_with_uri_scheme_only (NautilusNavigationInfo *navinfo) result = g_strdup_printf ( /* Check if the component has the interfaces we need. - * We can work with either a Nautilus ContentView, or + * We can work with either a Nautilus tView, or * with a Bonobo Control or Embeddable that works on * a file, which is indicated by Bonobo PersistFile. */ "((repo_ids.has_all(['IDL:Bonobo/Control:1.0'," - "'IDL:Nautilus/ContentView:1.0'])" + "'IDL:Nautilus/View:1.0'])" "OR (repo_ids.has_one(['IDL:Bonobo/Control:1.0'," "'IDL:Bonobo/Embeddable:1.0'])" "AND repo_ids.has('IDL:Bonobo/PersistFile:1.0')))" diff --git a/src/nautilus-application.c b/src/nautilus-application.c index 46239950e..0e5ffb61d 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -134,7 +134,7 @@ impl_Nautilus_Application_create_object (impl_POA_Nautilus_Application *servant, CORBA_Environment * ev) { FMDirectoryView *dir_view; - NautilusContentView *view; + NautilusView *view; if (!impl_Nautilus_Application_supports (servant, obj_iid, ev)) { return CORBA_OBJECT_NIL; diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c index a0729e0de..dc95a56b4 100644 --- a/src/nautilus-navigation-window.c +++ b/src/nautilus-navigation-window.c @@ -1088,7 +1088,7 @@ nautilus_window_request_progress_change_cb (NautilusViewFrame *view, } static void -nautilus_window_request_title_change_callback (NautilusContentViewFrame *view, +nautilus_window_request_title_change_callback (NautilusViewFrame *view, const char *new_title, NautilusWindow *window) { @@ -1124,7 +1124,7 @@ nautilus_window_connect_view(NautilusWindow *window, NautilusViewFrame *view) } void -nautilus_window_connect_content_view(NautilusWindow *window, NautilusContentViewFrame *view) +nautilus_window_connect_content_view (NautilusWindow *window, NautilusViewFrame *view) { GtkObject *view_object; @@ -1133,10 +1133,10 @@ nautilus_window_connect_content_view(NautilusWindow *window, NautilusContentView /* Now connect with NautilusContentViewFrame signals. */ view_object = GTK_OBJECT(view); - gtk_signal_connect(view_object, - "request_title_change", - nautilus_window_request_title_change_callback, - window); + gtk_signal_connect (view_object, + "request_title_change", + nautilus_window_request_title_change_callback, + window); } void @@ -1174,9 +1174,9 @@ nautilus_window_real_set_content_view (NautilusWindow *window, NautilusViewFrame gtk_widget_show (GTK_WIDGET (new_view)); - nautilus_content_view_frame_set_active (NAUTILUS_CONTENT_VIEW_FRAME (new_view)); + nautilus_view_frame_activate (new_view); - gtk_paned_pack2(GTK_PANED(window->content_hbox), GTK_WIDGET (new_view), TRUE, FALSE); + gtk_paned_pack2 (GTK_PANED(window->content_hbox), GTK_WIDGET (new_view), TRUE, FALSE); } gtk_widget_queue_resize(window->content_hbox); diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c index a0729e0de..dc95a56b4 100644 --- a/src/nautilus-object-window.c +++ b/src/nautilus-object-window.c @@ -1088,7 +1088,7 @@ nautilus_window_request_progress_change_cb (NautilusViewFrame *view, } static void -nautilus_window_request_title_change_callback (NautilusContentViewFrame *view, +nautilus_window_request_title_change_callback (NautilusViewFrame *view, const char *new_title, NautilusWindow *window) { @@ -1124,7 +1124,7 @@ nautilus_window_connect_view(NautilusWindow *window, NautilusViewFrame *view) } void -nautilus_window_connect_content_view(NautilusWindow *window, NautilusContentViewFrame *view) +nautilus_window_connect_content_view (NautilusWindow *window, NautilusViewFrame *view) { GtkObject *view_object; @@ -1133,10 +1133,10 @@ nautilus_window_connect_content_view(NautilusWindow *window, NautilusContentView /* Now connect with NautilusContentViewFrame signals. */ view_object = GTK_OBJECT(view); - gtk_signal_connect(view_object, - "request_title_change", - nautilus_window_request_title_change_callback, - window); + gtk_signal_connect (view_object, + "request_title_change", + nautilus_window_request_title_change_callback, + window); } void @@ -1174,9 +1174,9 @@ nautilus_window_real_set_content_view (NautilusWindow *window, NautilusViewFrame gtk_widget_show (GTK_WIDGET (new_view)); - nautilus_content_view_frame_set_active (NAUTILUS_CONTENT_VIEW_FRAME (new_view)); + nautilus_view_frame_activate (new_view); - gtk_paned_pack2(GTK_PANED(window->content_hbox), GTK_WIDGET (new_view), TRUE, FALSE); + gtk_paned_pack2 (GTK_PANED(window->content_hbox), GTK_WIDGET (new_view), TRUE, FALSE); } gtk_widget_queue_resize(window->content_hbox); diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c index a0729e0de..dc95a56b4 100644 --- a/src/nautilus-spatial-window.c +++ b/src/nautilus-spatial-window.c @@ -1088,7 +1088,7 @@ nautilus_window_request_progress_change_cb (NautilusViewFrame *view, } static void -nautilus_window_request_title_change_callback (NautilusContentViewFrame *view, +nautilus_window_request_title_change_callback (NautilusViewFrame *view, const char *new_title, NautilusWindow *window) { @@ -1124,7 +1124,7 @@ nautilus_window_connect_view(NautilusWindow *window, NautilusViewFrame *view) } void -nautilus_window_connect_content_view(NautilusWindow *window, NautilusContentViewFrame *view) +nautilus_window_connect_content_view (NautilusWindow *window, NautilusViewFrame *view) { GtkObject *view_object; @@ -1133,10 +1133,10 @@ nautilus_window_connect_content_view(NautilusWindow *window, NautilusContentView /* Now connect with NautilusContentViewFrame signals. */ view_object = GTK_OBJECT(view); - gtk_signal_connect(view_object, - "request_title_change", - nautilus_window_request_title_change_callback, - window); + gtk_signal_connect (view_object, + "request_title_change", + nautilus_window_request_title_change_callback, + window); } void @@ -1174,9 +1174,9 @@ nautilus_window_real_set_content_view (NautilusWindow *window, NautilusViewFrame gtk_widget_show (GTK_WIDGET (new_view)); - nautilus_content_view_frame_set_active (NAUTILUS_CONTENT_VIEW_FRAME (new_view)); + nautilus_view_frame_activate (new_view); - gtk_paned_pack2(GTK_PANED(window->content_hbox), GTK_WIDGET (new_view), TRUE, FALSE); + gtk_paned_pack2 (GTK_PANED(window->content_hbox), GTK_WIDGET (new_view), TRUE, FALSE); } gtk_widget_queue_resize(window->content_hbox); diff --git a/src/nautilus-view-frame-corba.c b/src/nautilus-view-frame-corba.c index 342e83b9b..184ee0091 100644 --- a/src/nautilus-view-frame-corba.c +++ b/src/nautilus-view-frame-corba.c @@ -1,4 +1,4 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Nautilus @@ -31,129 +31,142 @@ #include "ntl-view-private.h" #include "ntl-window.h" -static Nautilus_ViewWindow -impl_Nautilus_ViewFrame__get_main_window(impl_POA_Nautilus_ViewFrame *servant, - CORBA_Environment *ev); -static void -impl_Nautilus_ViewFrame_request_location_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_NavigationRequestInfo * navinfo, - CORBA_Environment * ev); - -static void -impl_Nautilus_ViewFrame_request_selection_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_SelectionRequestInfo * selinfo, - CORBA_Environment * ev); -static void -impl_Nautilus_ViewFrame_request_status_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_StatusRequestInfo * statinfo, - CORBA_Environment * ev); -static void -impl_Nautilus_ViewFrame_request_progress_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_ProgressRequestInfo * proginfo, - CORBA_Environment * ev); +static Nautilus_ViewWindow impl_Nautilus_ViewFrame__get_main_window (PortableServer_Servant servant, + CORBA_Environment *ev); +static void impl_Nautilus_ViewFrame_request_location_change (PortableServer_Servant servant, + const Nautilus_NavigationRequestInfo *navinfo, + CORBA_Environment *ev); +static void impl_Nautilus_ViewFrame_request_selection_change (PortableServer_Servant servant, + const Nautilus_SelectionRequestInfo *selinfo, + CORBA_Environment *ev); +static void impl_Nautilus_ViewFrame_request_status_change (PortableServer_Servant servant, + const Nautilus_StatusRequestInfo *statinfo, + CORBA_Environment *ev); +static void impl_Nautilus_ViewFrame_request_progress_change (PortableServer_Servant servant, + const Nautilus_ProgressRequestInfo *proginfo, + CORBA_Environment *ev); +static void impl_Nautilus_ViewFrame_request_title_change (PortableServer_Servant servant, + const CORBA_char *new_title, + CORBA_Environment *ev); POA_Nautilus_ViewFrame__epv impl_Nautilus_ViewFrame_epv = { - NULL, /* _private */ - (void(*))&impl_Nautilus_ViewFrame__get_main_window, - (void(*))&impl_Nautilus_ViewFrame_request_status_change, - (void(*))&impl_Nautilus_ViewFrame_request_location_change, - (void(*))&impl_Nautilus_ViewFrame_request_selection_change, - (void(*))&impl_Nautilus_ViewFrame_request_progress_change + NULL, + &impl_Nautilus_ViewFrame__get_main_window, + &impl_Nautilus_ViewFrame_request_status_change, + &impl_Nautilus_ViewFrame_request_location_change, + &impl_Nautilus_ViewFrame_request_selection_change, + &impl_Nautilus_ViewFrame_request_progress_change, + &impl_Nautilus_ViewFrame_request_title_change }; -static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL }; - +static PortableServer_ServantBase__epv base_epv; POA_Nautilus_ViewFrame__vepv impl_Nautilus_ViewFrame_vepv = { - &base_epv, - NULL, - &impl_Nautilus_ViewFrame_epv + &base_epv, + NULL, + &impl_Nautilus_ViewFrame_epv }; static void -impl_Nautilus_ViewFrame__destroy(BonoboObject *obj, impl_POA_Nautilus_ViewFrame *servant) +impl_Nautilus_ViewFrame__destroy (BonoboObject *obj, + impl_POA_Nautilus_ViewFrame *servant) { - PortableServer_ObjectId *objid; - CORBA_Environment ev; - NautilusViewFrameClass *klass; - void (*servant_destroy_func)(PortableServer_Servant, CORBA_Environment *); - - klass = NAUTILUS_VIEW_FRAME_CLASS(GTK_OBJECT(servant->view)->klass); - - CORBA_exception_init(&ev); - - objid = PortableServer_POA_servant_to_id(bonobo_poa(), servant, &ev); - PortableServer_POA_deactivate_object(bonobo_poa(), objid, &ev); - CORBA_free(objid); - obj->servant = NULL; - - servant_destroy_func = klass->servant_destroy_func; - servant_destroy_func((PortableServer_Servant) servant, &ev); - g_free(servant); - CORBA_exception_free(&ev); + PortableServer_ObjectId *objid; + CORBA_Environment ev; + NautilusViewFrameClass *klass; + void (*servant_destroy_func) (PortableServer_Servant, CORBA_Environment *); + + klass = NAUTILUS_VIEW_FRAME_CLASS (GTK_OBJECT (servant->view)->klass); + + CORBA_exception_init(&ev); + + objid = PortableServer_POA_servant_to_id (bonobo_poa (), servant, &ev); + PortableServer_POA_deactivate_object (bonobo_poa (), objid, &ev); + CORBA_free (objid); + obj->servant = NULL; + + servant_destroy_func = klass->servant_destroy_func; + servant_destroy_func ((PortableServer_Servant) servant, &ev); + g_free (servant); + CORBA_exception_free (&ev); } BonoboObject * -impl_Nautilus_ViewFrame__create(NautilusViewFrame *view, CORBA_Environment * ev) +impl_Nautilus_ViewFrame__create(NautilusViewFrame *view, CORBA_Environment *ev) { - BonoboObject *retval; - impl_POA_Nautilus_ViewFrame *newservant; - NautilusViewFrameClass *klass; - void (*servant_init_func)(PortableServer_Servant, CORBA_Environment *); - - klass = NAUTILUS_VIEW_FRAME_CLASS(GTK_OBJECT(view)->klass); - newservant = g_new0(impl_POA_Nautilus_ViewFrame, 1); - newservant->servant.vepv = klass->vepv; - if(!newservant->servant.vepv->Bonobo_Unknown_epv) - newservant->servant.vepv->Bonobo_Unknown_epv = bonobo_object_get_epv(); - newservant->view = view; - servant_init_func = klass->servant_init_func; - servant_init_func((PortableServer_Servant) newservant, ev); - - retval = bonobo_object_new_from_servant(newservant); + BonoboObject *bonobo_object; + impl_POA_Nautilus_ViewFrame *servant; + NautilusViewFrameClass *klass; + void (*servant_init_func) (PortableServer_Servant, CORBA_Environment *); + + klass = NAUTILUS_VIEW_FRAME_CLASS (GTK_OBJECT (view)->klass); + servant = g_new0 (impl_POA_Nautilus_ViewFrame, 1); + servant->servant.vepv = klass->vepv; + servant->servant.vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); + servant->view = view; + servant_init_func = klass->servant_init_func; + servant_init_func ((PortableServer_Servant) servant, ev); + + bonobo_object = bonobo_object_new_from_servant (servant); + + gtk_signal_connect (GTK_OBJECT (bonobo_object), "destroy", + GTK_SIGNAL_FUNC (impl_Nautilus_ViewFrame__destroy), servant); + + return bonobo_object; +} - gtk_signal_connect(GTK_OBJECT(retval), "destroy", GTK_SIGNAL_FUNC(impl_Nautilus_ViewFrame__destroy), newservant); +static Nautilus_ViewWindow +impl_Nautilus_ViewFrame__get_main_window (PortableServer_Servant servant, + CORBA_Environment *ev) +{ + NautilusWindow *window; - return retval; + window = NAUTILUS_WINDOW (((impl_POA_Nautilus_ViewFrame *) servant)->view->main_window); + return CORBA_Object_duplicate (bonobo_object_corba_objref (window->ntl_viewwindow), ev); } -static Nautilus_ViewWindow -impl_Nautilus_ViewFrame__get_main_window(impl_POA_Nautilus_ViewFrame *servant, - CORBA_Environment *ev) +static void +impl_Nautilus_ViewFrame_request_location_change (PortableServer_Servant servant, + const Nautilus_NavigationRequestInfo *navinfo, + CORBA_Environment *ev) { - return CORBA_Object_duplicate(bonobo_object_corba_objref(NAUTILUS_WINDOW(servant->view->main_window)->ntl_viewwindow), ev); + nautilus_view_frame_request_location_change + (((impl_POA_Nautilus_ViewFrame *) servant)->view, navinfo); } static void -impl_Nautilus_ViewFrame_request_location_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_NavigationRequestInfo * navinfo, - CORBA_Environment * ev) +impl_Nautilus_ViewFrame_request_selection_change (PortableServer_Servant servant, + const Nautilus_SelectionRequestInfo *selinfo, + CORBA_Environment *ev) { - nautilus_view_frame_request_location_change(servant->view, navinfo); + nautilus_view_frame_request_selection_change + (((impl_POA_Nautilus_ViewFrame *) servant)->view, selinfo); } static void -impl_Nautilus_ViewFrame_request_selection_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_SelectionRequestInfo * selinfo, - CORBA_Environment * ev) +impl_Nautilus_ViewFrame_request_status_change (PortableServer_Servant servant, + const Nautilus_StatusRequestInfo *statinfo, + CORBA_Environment *ev) { - nautilus_view_frame_request_selection_change(servant->view, - selinfo); + nautilus_view_frame_request_status_change + (((impl_POA_Nautilus_ViewFrame *) servant)->view, statinfo); } static void -impl_Nautilus_ViewFrame_request_status_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_StatusRequestInfo * statinfo, - CORBA_Environment * ev) +impl_Nautilus_ViewFrame_request_progress_change (PortableServer_Servant servant, + const Nautilus_ProgressRequestInfo *proginfo, + CORBA_Environment *ev) { - nautilus_view_frame_request_status_change(servant->view, statinfo); + nautilus_view_frame_request_progress_change + (((impl_POA_Nautilus_ViewFrame *) servant)->view, proginfo); } static void -impl_Nautilus_ViewFrame_request_progress_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_ProgressRequestInfo * proginfo, - CORBA_Environment * ev) +impl_Nautilus_ViewFrame_request_title_change (PortableServer_Servant servant, + const CORBA_char *title, + CORBA_Environment *ev) { - nautilus_view_frame_request_progress_change(servant->view, proginfo); + nautilus_view_frame_request_title_change + (((impl_POA_Nautilus_ViewFrame *) servant)->view, title); } diff --git a/src/nautilus-view-frame-private.h b/src/nautilus-view-frame-private.h index 697f59582..14e55144e 100644 --- a/src/nautilus-view-frame-private.h +++ b/src/nautilus-view-frame-private.h @@ -38,24 +38,25 @@ typedef struct { NautilusViewFrame *view; } impl_POA_Nautilus_ViewFrame; - extern POA_Nautilus_ViewFrame__vepv impl_Nautilus_ViewFrame_vepv; extern POA_Nautilus_ZoomableFrame__vepv impl_Nautilus_ZoomableFrame_vepv; -BonoboObject *impl_Nautilus_ViewFrame__create (NautilusViewFrame *view, - CORBA_Environment *ev); -BonoboObject *impl_Nautilus_ZoomableFrame__create (NautilusViewFrame *view, - CORBA_Environment *ev); -void nautilus_view_frame_request_location_change (NautilusViewFrame *view, - Nautilus_NavigationRequestInfo *loc); -void nautilus_view_frame_request_selection_change (NautilusViewFrame *view, - Nautilus_SelectionRequestInfo *loc); -void nautilus_view_frame_request_status_change (NautilusViewFrame *view, - Nautilus_StatusRequestInfo *loc); -void nautilus_view_frame_request_progress_change (NautilusViewFrame *view, - Nautilus_ProgressRequestInfo *loc); -void nautilus_view_frame_notify_zoom_level (NautilusViewFrame *view, - double level); +BonoboObject *impl_Nautilus_ViewFrame__create (NautilusViewFrame *view, + CORBA_Environment *ev); +BonoboObject *impl_Nautilus_ZoomableFrame__create (NautilusViewFrame *view, + CORBA_Environment *ev); +void nautilus_view_frame_request_location_change (NautilusViewFrame *view, + const Nautilus_NavigationRequestInfo *loc); +void nautilus_view_frame_request_selection_change (NautilusViewFrame *view, + const Nautilus_SelectionRequestInfo *loc); +void nautilus_view_frame_request_status_change (NautilusViewFrame *view, + const Nautilus_StatusRequestInfo *loc); +void nautilus_view_frame_request_progress_change (NautilusViewFrame *view, + const Nautilus_ProgressRequestInfo *loc); +void nautilus_view_frame_request_title_change (NautilusViewFrame *view, + const char *title); +void nautilus_view_frame_notify_zoom_level (NautilusViewFrame *view, + double level); struct NautilusViewComponentType { const char *primary_repoid; diff --git a/src/nautilus-view-frame.c b/src/nautilus-view-frame.c index 020006f59..44d18c86e 100644 --- a/src/nautilus-view-frame.c +++ b/src/nautilus-view-frame.c @@ -30,7 +30,6 @@ #include <config.h> #include "ntl-view-private.h" -#include "ntl-content-view.h" #include "ntl-window.h" #include <libnautilus-extensions/nautilus-gtk-extensions.h> #include <gtk/gtksignal.h> @@ -43,6 +42,7 @@ enum { REQUEST_SELECTION_CHANGE, REQUEST_STATUS_CHANGE, REQUEST_PROGRESS_CHANGE, + REQUEST_TITLE_CHANGE, NOTIFY_ZOOM_LEVEL, LAST_SIGNAL }; @@ -92,28 +92,6 @@ nautilus_view_frame_get_type (void) return view_type; } -#if 0 -typedef void (*GtkSignal_NONE__BOXED_OBJECT_BOXED) (GtkObject * object, - gpointer arg1, - GtkObject *arg2, - gpointer arg3, - gpointer user_data); -static void -gtk_marshal_NONE__BOXED_OBJECT_BOXED (GtkObject * object, - GtkSignalFunc func, - gpointer func_data, - GtkArg * args) -{ - GtkSignal_NONE__BOXED_OBJECT_BOXED rfunc; - rfunc = (GtkSignal_NONE__BOXED_OBJECT_BOXED) func; - (*rfunc) (object, - GTK_VALUE_BOXED (args[0]), - GTK_VALUE_OBJECT (args[1]), - GTK_VALUE_BOXED (args[2]), - func_data); -} -#endif - static void nautilus_view_frame_class_init (NautilusViewFrameClass *klass) { @@ -144,57 +122,70 @@ nautilus_view_frame_class_init (NautilusViewFrameClass *klass) /* klass->request_progress_change = NULL; */ klass->view_constructed = nautilus_view_frame_constructed; - signals[REQUEST_LOCATION_CHANGE] = gtk_signal_new("request_location_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewFrameClass, - request_location_change), - gtk_marshal_NONE__BOXED, - GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - signals[REQUEST_SELECTION_CHANGE] = gtk_signal_new("request_selection_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewFrameClass, - request_selection_change), - gtk_marshal_NONE__BOXED, - GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - signals[REQUEST_STATUS_CHANGE] = gtk_signal_new("request_status_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewFrameClass, - request_status_change), - gtk_marshal_NONE__BOXED, - GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - signals[REQUEST_PROGRESS_CHANGE] = gtk_signal_new("request_progress_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewFrameClass, - request_progress_change), - gtk_marshal_NONE__BOXED, - GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - - signals[NOTIFY_ZOOM_LEVEL] = gtk_signal_new("notify_zoom_level", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewFrameClass, - notify_zoom_level), - nautilus_gtk_marshal_NONE__DOUBLE, - GTK_TYPE_NONE, 1, GTK_TYPE_DOUBLE); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + signals[REQUEST_LOCATION_CHANGE] = + gtk_signal_new ("request_location_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + request_location_change), + gtk_marshal_NONE__BOXED, + GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); + signals[REQUEST_SELECTION_CHANGE] = + gtk_signal_new ("request_selection_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + request_selection_change), + gtk_marshal_NONE__BOXED, + GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); + signals[REQUEST_STATUS_CHANGE] = + gtk_signal_new ("request_status_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + request_status_change), + gtk_marshal_NONE__BOXED, + GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); + signals[REQUEST_PROGRESS_CHANGE] = + gtk_signal_new ("request_progress_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + request_progress_change), + gtk_marshal_NONE__STRING, + GTK_TYPE_NONE, 1, GTK_TYPE_STRING); + signals[REQUEST_TITLE_CHANGE] = + gtk_signal_new ("request_title_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + request_title_change), + gtk_marshal_NONE__BOXED, + GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - + signals[NOTIFY_ZOOM_LEVEL] = + gtk_signal_new ("notify_zoom_level", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + notify_zoom_level), + nautilus_gtk_marshal_NONE__DOUBLE, + GTK_TYPE_NONE, 1, GTK_TYPE_DOUBLE); + + gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + gtk_object_add_arg_type ("NautilusViewFrame::main_window", GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_MAIN_WINDOW); + klass->num_construct_args++; } static void nautilus_view_frame_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) + GtkArg *arg, + guint arg_id) { NautilusViewFrame *view; @@ -209,8 +200,8 @@ nautilus_view_frame_set_arg (GtkObject *object, static void nautilus_view_frame_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) + GtkArg *arg, + guint arg_id) { switch(arg_id) { case ARG_MAIN_WINDOW: @@ -758,7 +749,7 @@ nautilus_view_frame_get_objref(NautilusViewFrame *view) void nautilus_view_frame_request_location_change(NautilusViewFrame *view, - Nautilus_NavigationRequestInfo *loc) + const Nautilus_NavigationRequestInfo *loc) { g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view)); gtk_signal_emit(GTK_OBJECT(view), signals[REQUEST_LOCATION_CHANGE], loc); @@ -766,7 +757,7 @@ nautilus_view_frame_request_location_change(NautilusViewFrame *view, void nautilus_view_frame_request_selection_change (NautilusViewFrame *view, - Nautilus_SelectionRequestInfo *loc) + const Nautilus_SelectionRequestInfo *loc) { g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view)); gtk_signal_emit(GTK_OBJECT(view), signals[REQUEST_SELECTION_CHANGE], loc); @@ -774,7 +765,7 @@ nautilus_view_frame_request_selection_change (NautilusViewFrame *vi void nautilus_view_frame_request_status_change (NautilusViewFrame *view, - Nautilus_StatusRequestInfo *loc) + const Nautilus_StatusRequestInfo *loc) { g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view)); gtk_signal_emit(GTK_OBJECT(view), signals[REQUEST_STATUS_CHANGE], loc); @@ -782,13 +773,21 @@ nautilus_view_frame_request_status_change (NautilusViewFrame *vi void nautilus_view_frame_request_progress_change(NautilusViewFrame *view, - Nautilus_ProgressRequestInfo *loc) + const Nautilus_ProgressRequestInfo *loc) { g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view)); gtk_signal_emit(GTK_OBJECT(view), signals[REQUEST_PROGRESS_CHANGE], loc); } void +nautilus_view_frame_request_title_change (NautilusViewFrame *view, + const char *title) +{ + g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view)); + gtk_signal_emit (GTK_OBJECT (view), signals[REQUEST_TITLE_CHANGE], title); +} + +void nautilus_view_frame_notify_zoom_level (NautilusViewFrame *view, gdouble level) { @@ -855,3 +854,15 @@ nautilus_view_frame_set_label (NautilusViewFrame *view, g_free (view->label); view->label = g_strdup (label); } + +/* Calls activate on the underlying control frame. */ +void +nautilus_view_frame_activate (NautilusViewFrame *view) +{ + BonoboControlFrame *control_frame; + + control_frame = BONOBO_CONTROL_FRAME (bonobo_object_query_local_interface + (view->view_frame, "IDL:Bonobo/ControlFrame:1.0")); + bonobo_control_frame_control_activate (control_frame); + bonobo_object_unref (BONOBO_OBJECT (control_frame)); +} diff --git a/src/nautilus-view-frame.h b/src/nautilus-view-frame.h index 57da4a602..b232c993a 100644 --- a/src/nautilus-view-frame.h +++ b/src/nautilus-view-frame.h @@ -62,6 +62,8 @@ struct NautilusViewFrameClass { Nautilus_StatusRequestInfo *loc); void (*request_progress_change) (NautilusViewFrame *view, Nautilus_ProgressRequestInfo *loc); + void (*request_title_change) (NautilusViewFrame *view, + const char *title); /* Part of Nautilus::ZoomableFrame CORBA interface. */ void (*notify_zoom_level) (NautilusViewFrame *view, @@ -138,6 +140,7 @@ void nautilus_view_frame_zoom_to_fit (NautilusViewFrame char * nautilus_view_frame_get_label (NautilusViewFrame *view); void nautilus_view_frame_set_label (NautilusViewFrame *view, const char *label); +void nautilus_view_frame_activate (NautilusViewFrame *view); /* This is a "protected" operation */ void nautilus_view_frame_construct_arg_set (NautilusViewFrame *view); diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c index af3df58cc..53dcea2ff 100644 --- a/src/nautilus-window-manage-views.c +++ b/src/nautilus-window-manage-views.c @@ -210,8 +210,7 @@ compute_default_title (const char *text_uri) return g_strdup(_("Nautilus")); } -/* - * nautilus_window_get_current_location_title: +/* nautilus_window_get_current_location_title: * * Get a newly allocated copy of the user-displayable title for the current * location. Note that the window title is related to this but might not @@ -228,8 +227,7 @@ nautilus_window_get_current_location_title (NautilusWindow *window) : g_strdup (window->default_title); } -/* - * nautilus_window_update_title_internal: +/* nautilus_window_update_title_internal: * * Update the non-NautilusViewFrame objects that use the location's user-displayable * title in some way. Called when the location or title has changed. @@ -257,14 +255,12 @@ nautilus_window_update_title_internal (NautilusWindow *window, const char *title nautilus_send_history_list_changed (); } -/* - * nautilus_window_reset_title_internal: +/* nautilus_window_reset_title_internal: * * Update the non-NautilusViewFrame objects that use the location's user-displayable * title in some way. Called when the location or title has changed. * @window: The NautilusWindow in question. * @title: The new user-displayable title. - * */ static void nautilus_window_reset_title_internal (NautilusWindow *window, const char *uri) @@ -288,11 +284,18 @@ nautilus_window_reset_title_internal (NautilusWindow *window, const char *uri) } void -nautilus_window_request_title_change(NautilusWindow *window, - const char *new_title, - NautilusContentViewFrame *requesting_view) +nautilus_window_request_title_change (NautilusWindow *window, + const char *new_title, + NautilusViewFrame *requesting_view) { + g_return_if_fail (NAUTILUS_IS_WINDOW (widnow)); g_return_if_fail (new_title != NULL); + g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (requesting_view)); + + /* Only the content view can change the window title. */ + if (requesting_view != window->content_view) { + return; + } g_free (window->requested_title); window->requested_title = g_strdup (new_title); @@ -568,9 +571,9 @@ nautilus_window_free_load_info (NautilusWindow *window) /* Meta view handling */ static NautilusViewFrame * -nautilus_window_load_meta_view(NautilusWindow *window, - const char *iid, - NautilusViewFrame *requesting_view) +nautilus_window_load_meta_view (NautilusWindow *window, + const char *iid, + NautilusViewFrame *requesting_view) { NautilusViewFrame *meta_view; GList *p; @@ -638,7 +641,7 @@ nautilus_window_request_location_change (NautilusWindow *window, { NautilusWindow *new_window; - loc->requested_uri = gnome_vfs_unescape_string(loc->requested_uri); + loc->requested_uri = gnome_vfs_unescape_string (loc->requested_uri); if (handle_unreadable_location (window, loc->requested_uri)) { return; @@ -655,10 +658,10 @@ nautilus_window_request_location_change (NautilusWindow *window, } NautilusViewFrame * -nautilus_window_load_content_view(NautilusWindow *window, - const char *iid, - Nautilus_NavigationInfo *navinfo, - NautilusViewFrame **requesting_view) +nautilus_window_load_content_view (NautilusWindow *window, + const char *iid, + Nautilus_NavigationInfo *navinfo, + NautilusViewFrame **requesting_view) { NautilusViewFrame *content_view = window->content_view; NautilusViewFrame *new_view; @@ -678,10 +681,10 @@ nautilus_window_load_content_view(NautilusWindow *window, *requesting_view = NULL; } - new_view = NAUTILUS_VIEW_FRAME (gtk_widget_new (nautilus_content_view_frame_get_type(), - "main_window", window, NULL)); + new_view = NAUTILUS_VIEW_FRAME (gtk_widget_new (nautilus_view_frame_get_type(), + "main_window", window, NULL)); - nautilus_window_connect_content_view (window, NAUTILUS_CONTENT_VIEW_FRAME (new_view)); + nautilus_window_connect_content_view (window, new_view); if (!nautilus_view_frame_load_client (new_view, iid)) { gtk_widget_unref(GTK_WIDGET(new_view)); diff --git a/src/nautilus-window-manage-views.h b/src/nautilus-window-manage-views.h index 99ffe5c5e..2b4308812 100644 --- a/src/nautilus-window-manage-views.h +++ b/src/nautilus-window-manage-views.h @@ -28,7 +28,6 @@ #define NTL_WINDOW_MSGS_H #include "ntl-window.h" -#include "ntl-content-view.h" void nautilus_window_request_location_change (NautilusWindow *window, Nautilus_NavigationRequestInfo *loc, @@ -44,6 +43,6 @@ void nautilus_window_request_progress_change (NautilusWindow *w NautilusViewFrame *requesting_view); void nautilus_window_request_title_change (NautilusWindow *window, const char *new_title, - NautilusContentViewFrame *requesting_view); + NautilusViewFrame *requesting_view); #endif /* NTL_WINDOW_MSGS_H */ diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h index 48ae6f97a..f896d4e67 100644 --- a/src/nautilus-window-private.h +++ b/src/nautilus-window-private.h @@ -2,7 +2,6 @@ #define NTL_WINDOW_PRIVATE_H #include "ntl-window.h" -#include "ntl-content-view.h" #include <libnautilus/libnautilus.h> #include <libnautilus/nautilus-undo-manager.h> #include <gtk/gtk.h> @@ -50,7 +49,7 @@ NautilusViewFrame *nautilus_window_load_content_view(NautilusWindow *window, Nautilus_NavigationInfo *navinfo, NautilusViewFrame **requesting_view); void nautilus_window_connect_content_view (NautilusWindow *window, - NautilusContentViewFrame *view); + NautilusViewFrame *view); void nautilus_window_connect_view (NautilusWindow *window, NautilusViewFrame *view); void nautilus_window_view_destroyed(NautilusViewFrame *view, NautilusWindow *window); diff --git a/src/nautilus-window.c b/src/nautilus-window.c index a0729e0de..dc95a56b4 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -1088,7 +1088,7 @@ nautilus_window_request_progress_change_cb (NautilusViewFrame *view, } static void -nautilus_window_request_title_change_callback (NautilusContentViewFrame *view, +nautilus_window_request_title_change_callback (NautilusViewFrame *view, const char *new_title, NautilusWindow *window) { @@ -1124,7 +1124,7 @@ nautilus_window_connect_view(NautilusWindow *window, NautilusViewFrame *view) } void -nautilus_window_connect_content_view(NautilusWindow *window, NautilusContentViewFrame *view) +nautilus_window_connect_content_view (NautilusWindow *window, NautilusViewFrame *view) { GtkObject *view_object; @@ -1133,10 +1133,10 @@ nautilus_window_connect_content_view(NautilusWindow *window, NautilusContentView /* Now connect with NautilusContentViewFrame signals. */ view_object = GTK_OBJECT(view); - gtk_signal_connect(view_object, - "request_title_change", - nautilus_window_request_title_change_callback, - window); + gtk_signal_connect (view_object, + "request_title_change", + nautilus_window_request_title_change_callback, + window); } void @@ -1174,9 +1174,9 @@ nautilus_window_real_set_content_view (NautilusWindow *window, NautilusViewFrame gtk_widget_show (GTK_WIDGET (new_view)); - nautilus_content_view_frame_set_active (NAUTILUS_CONTENT_VIEW_FRAME (new_view)); + nautilus_view_frame_activate (new_view); - gtk_paned_pack2(GTK_PANED(window->content_hbox), GTK_WIDGET (new_view), TRUE, FALSE); + gtk_paned_pack2 (GTK_PANED(window->content_hbox), GTK_WIDGET (new_view), TRUE, FALSE); } gtk_widget_queue_resize(window->content_hbox); diff --git a/src/ntl-app.c b/src/ntl-app.c index 46239950e..0e5ffb61d 100644 --- a/src/ntl-app.c +++ b/src/ntl-app.c @@ -134,7 +134,7 @@ impl_Nautilus_Application_create_object (impl_POA_Nautilus_Application *servant, CORBA_Environment * ev) { FMDirectoryView *dir_view; - NautilusContentView *view; + NautilusView *view; if (!impl_Nautilus_Application_supports (servant, obj_iid, ev)) { return CORBA_OBJECT_NIL; diff --git a/src/ntl-content-view.c b/src/ntl-content-view.c deleted file mode 100644 index d597bf848..000000000 --- a/src/ntl-content-view.c +++ /dev/null @@ -1,149 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - -/* - * Nautilus - * - * Copyright (C) 1999, 2000 Red Hat, Inc. - * Copyright (C) 2000 Eazel, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Author: Elliot Lee <sopwith@redhat.com> - * - */ - -/* ntl-content-view.c: Implementation of the object representing a content view. */ - -#include <config.h> -#include "ntl-content-view.h" -#include "ntl-view-private.h" -#include <gtk/gtksignal.h> - -static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL }; - -static void -impl_Nautilus_ContentViewFrame_request_title_change (impl_POA_Nautilus_ViewFrame * servant, - const char * new_info, - CORBA_Environment * ev); - -static POA_Nautilus_ContentViewFrame__epv impl_Nautilus_ContentViewFrame_epv = { - NULL, - (void(*))&impl_Nautilus_ContentViewFrame_request_title_change, -}; - -extern POA_Nautilus_ViewFrame__epv impl_Nautilus_ViewFrame_epv; - -static POA_Nautilus_ContentViewFrame__vepv impl_Nautilus_ContentViewFrame_vepv = -{ - &base_epv, - NULL, - &impl_Nautilus_ViewFrame_epv, - &impl_Nautilus_ContentViewFrame_epv -}; - -enum { - REQUEST_TITLE_CHANGE, - LAST_SIGNAL -}; - -static void nautilus_content_view_frame_class_init (NautilusContentViewFrameClass *klass); -static void nautilus_content_view_frame_init (NautilusContentViewFrame *view); -static void nautilus_content_view_frame_request_title_change (NautilusContentViewFrame *view, - const char *new_title); - -static guint signals[LAST_SIGNAL]; - -static void -impl_Nautilus_ContentViewFrame_request_title_change (impl_POA_Nautilus_ViewFrame * servant, - const char * new_info, - CORBA_Environment * ev) -{ - nautilus_content_view_frame_request_title_change (NAUTILUS_CONTENT_VIEW_FRAME (servant->view), new_info); -} - -GtkType -nautilus_content_view_frame_get_type(void) -{ - static guint view_type = 0; - - if (!view_type) - { - GtkTypeInfo view_info = { - "NautilusContentViewFrame", - sizeof(NautilusContentViewFrame), - sizeof(NautilusContentViewFrameClass), - (GtkClassInitFunc) nautilus_content_view_frame_class_init, - (GtkObjectInitFunc) nautilus_content_view_frame_init, - NULL, - NULL, - NULL - }; - - view_type = gtk_type_unique (nautilus_view_frame_get_type(), &view_info); - } - - return view_type; -} - -static void -nautilus_content_view_frame_class_init (NautilusContentViewFrameClass *klass) -{ - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - - object_class = (GtkObjectClass*) klass; - widget_class = (GtkWidgetClass*) klass; - klass->parent_class = gtk_type_class (gtk_type_parent (object_class->type)); - - NAUTILUS_VIEW_FRAME_CLASS(klass)->servant_init_func = POA_Nautilus_ContentViewFrame__init; - NAUTILUS_VIEW_FRAME_CLASS(klass)->servant_destroy_func = POA_Nautilus_ContentViewFrame__fini; - NAUTILUS_VIEW_FRAME_CLASS(klass)->vepv = &impl_Nautilus_ContentViewFrame_vepv; - - signals[REQUEST_TITLE_CHANGE] = - gtk_signal_new ("request_title_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusContentViewFrameClass, - request_title_change), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); -} - -static void -nautilus_content_view_frame_init (NautilusContentViewFrame *view) -{ -} - -void -nautilus_content_view_frame_set_active (NautilusContentViewFrame *view) -{ - BonoboControlFrame *control_frame; - - control_frame = BONOBO_CONTROL_FRAME (bonobo_object_query_local_interface - (NAUTILUS_VIEW_FRAME (view)->view_frame, "IDL:Bonobo/ControlFrame:1.0")); - - bonobo_control_frame_control_activate (control_frame); - - bonobo_object_unref (BONOBO_OBJECT (control_frame)); -} - -static void -nautilus_content_view_frame_request_title_change (NautilusContentViewFrame *view, - const char *new_title) -{ - gtk_signal_emit (GTK_OBJECT(view), signals[REQUEST_TITLE_CHANGE], new_title); -} diff --git a/src/ntl-content-view.h b/src/ntl-content-view.h deleted file mode 100644 index 98dbc9b63..000000000 --- a/src/ntl-content-view.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * Nautilus - * - * Copyright (C) 1999, 2000 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this library; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Author: Elliot Lee <sopwith@redhat.com> - * - */ -/* ntl-content-view.h: Interface of the object representing a content view. */ - -#ifndef NTL_CONTENT_VIEW_H -#define NTL_CONTENT_VIEW_H - -#include "ntl-view.h" - -#define NAUTILUS_TYPE_CONTENT_VIEW_FRAME (nautilus_content_view_frame_get_type()) -#define NAUTILUS_CONTENT_VIEW_FRAME(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_CONTENT_VIEW_FRAME, NautilusContentViewFrame)) -#define NAUTILUS_CONTENT_VIEW_FRAME_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_CONTENT_VIEW_FRAME, NautilusContentViewFrameClass)) -#define NAUTILUS_IS_CONTENT_VIEW_FRAME(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_CONTENT_VIEW_FRAME)) -#define NAUTILUS_IS_CONTENT_VIEW_FRAME_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_CONTENT_VIEW_FRAME)) - -typedef struct NautilusContentViewFrame NautilusContentViewFrame; -typedef struct NautilusContentViewFrameClass NautilusContentViewFrameClass; - -struct NautilusContentViewFrameClass -{ - NautilusViewFrameClass parent_spot; - - /* These signals correspond to the Nautilus:ContentViewFrame CORBA interface. - * They are requests that the underlying view may make of the framework. - */ - void (*request_title_change) (NautilusContentViewFrame *view, - const char *new_title); - - NautilusViewFrameClass *parent_class; -}; - -struct NautilusContentViewFrame { - NautilusViewFrame parent_object; -}; - -GtkType nautilus_content_view_frame_get_type (void); -void nautilus_content_view_frame_set_active (NautilusContentViewFrame *view); - -#endif /* NTL_CONTENT_VIEW_H */ diff --git a/src/ntl-uri-map.c b/src/ntl-uri-map.c index 5edf61098..85a7c462a 100644 --- a/src/ntl-uri-map.c +++ b/src/ntl-uri-map.c @@ -288,14 +288,14 @@ make_oaf_query_with_known_mime_type (NautilusNavigationInfo *navinfo) result = g_strdup_printf ( /* Check if the component has the interfaces we need. - * We can work with either a Nautilus ContentView, or + * We can work with either a Nautilus View, or * with a Bonobo Control or Embeddable that supports * one of the three persistence interfaces: * PersistStream, ProgressiveDataSink, or * PersistFile. */ "((repo_ids.has_all(['IDL:Bonobo/Control:1.0'," - "'IDL:Nautilus/ContentView:1.0'])" + "'IDL:Nautilus/View:1.0'])" "OR (repo_ids.has_one(['IDL:Bonobo/Control:1.0'," "'IDL:Bonobo/Embeddable:1.0'])" "AND repo_ids.has_one(['IDL:Bonobo/PersistStream:1.0'," @@ -368,12 +368,12 @@ make_oaf_query_with_uri_scheme_only (NautilusNavigationInfo *navinfo) result = g_strdup_printf ( /* Check if the component has the interfaces we need. - * We can work with either a Nautilus ContentView, or + * We can work with either a Nautilus tView, or * with a Bonobo Control or Embeddable that works on * a file, which is indicated by Bonobo PersistFile. */ "((repo_ids.has_all(['IDL:Bonobo/Control:1.0'," - "'IDL:Nautilus/ContentView:1.0'])" + "'IDL:Nautilus/View:1.0'])" "OR (repo_ids.has_one(['IDL:Bonobo/Control:1.0'," "'IDL:Bonobo/Embeddable:1.0'])" "AND repo_ids.has('IDL:Bonobo/PersistFile:1.0')))" diff --git a/src/ntl-view-frame-svr.c b/src/ntl-view-frame-svr.c index 342e83b9b..184ee0091 100644 --- a/src/ntl-view-frame-svr.c +++ b/src/ntl-view-frame-svr.c @@ -1,4 +1,4 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Nautilus @@ -31,129 +31,142 @@ #include "ntl-view-private.h" #include "ntl-window.h" -static Nautilus_ViewWindow -impl_Nautilus_ViewFrame__get_main_window(impl_POA_Nautilus_ViewFrame *servant, - CORBA_Environment *ev); -static void -impl_Nautilus_ViewFrame_request_location_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_NavigationRequestInfo * navinfo, - CORBA_Environment * ev); - -static void -impl_Nautilus_ViewFrame_request_selection_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_SelectionRequestInfo * selinfo, - CORBA_Environment * ev); -static void -impl_Nautilus_ViewFrame_request_status_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_StatusRequestInfo * statinfo, - CORBA_Environment * ev); -static void -impl_Nautilus_ViewFrame_request_progress_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_ProgressRequestInfo * proginfo, - CORBA_Environment * ev); +static Nautilus_ViewWindow impl_Nautilus_ViewFrame__get_main_window (PortableServer_Servant servant, + CORBA_Environment *ev); +static void impl_Nautilus_ViewFrame_request_location_change (PortableServer_Servant servant, + const Nautilus_NavigationRequestInfo *navinfo, + CORBA_Environment *ev); +static void impl_Nautilus_ViewFrame_request_selection_change (PortableServer_Servant servant, + const Nautilus_SelectionRequestInfo *selinfo, + CORBA_Environment *ev); +static void impl_Nautilus_ViewFrame_request_status_change (PortableServer_Servant servant, + const Nautilus_StatusRequestInfo *statinfo, + CORBA_Environment *ev); +static void impl_Nautilus_ViewFrame_request_progress_change (PortableServer_Servant servant, + const Nautilus_ProgressRequestInfo *proginfo, + CORBA_Environment *ev); +static void impl_Nautilus_ViewFrame_request_title_change (PortableServer_Servant servant, + const CORBA_char *new_title, + CORBA_Environment *ev); POA_Nautilus_ViewFrame__epv impl_Nautilus_ViewFrame_epv = { - NULL, /* _private */ - (void(*))&impl_Nautilus_ViewFrame__get_main_window, - (void(*))&impl_Nautilus_ViewFrame_request_status_change, - (void(*))&impl_Nautilus_ViewFrame_request_location_change, - (void(*))&impl_Nautilus_ViewFrame_request_selection_change, - (void(*))&impl_Nautilus_ViewFrame_request_progress_change + NULL, + &impl_Nautilus_ViewFrame__get_main_window, + &impl_Nautilus_ViewFrame_request_status_change, + &impl_Nautilus_ViewFrame_request_location_change, + &impl_Nautilus_ViewFrame_request_selection_change, + &impl_Nautilus_ViewFrame_request_progress_change, + &impl_Nautilus_ViewFrame_request_title_change }; -static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL }; - +static PortableServer_ServantBase__epv base_epv; POA_Nautilus_ViewFrame__vepv impl_Nautilus_ViewFrame_vepv = { - &base_epv, - NULL, - &impl_Nautilus_ViewFrame_epv + &base_epv, + NULL, + &impl_Nautilus_ViewFrame_epv }; static void -impl_Nautilus_ViewFrame__destroy(BonoboObject *obj, impl_POA_Nautilus_ViewFrame *servant) +impl_Nautilus_ViewFrame__destroy (BonoboObject *obj, + impl_POA_Nautilus_ViewFrame *servant) { - PortableServer_ObjectId *objid; - CORBA_Environment ev; - NautilusViewFrameClass *klass; - void (*servant_destroy_func)(PortableServer_Servant, CORBA_Environment *); - - klass = NAUTILUS_VIEW_FRAME_CLASS(GTK_OBJECT(servant->view)->klass); - - CORBA_exception_init(&ev); - - objid = PortableServer_POA_servant_to_id(bonobo_poa(), servant, &ev); - PortableServer_POA_deactivate_object(bonobo_poa(), objid, &ev); - CORBA_free(objid); - obj->servant = NULL; - - servant_destroy_func = klass->servant_destroy_func; - servant_destroy_func((PortableServer_Servant) servant, &ev); - g_free(servant); - CORBA_exception_free(&ev); + PortableServer_ObjectId *objid; + CORBA_Environment ev; + NautilusViewFrameClass *klass; + void (*servant_destroy_func) (PortableServer_Servant, CORBA_Environment *); + + klass = NAUTILUS_VIEW_FRAME_CLASS (GTK_OBJECT (servant->view)->klass); + + CORBA_exception_init(&ev); + + objid = PortableServer_POA_servant_to_id (bonobo_poa (), servant, &ev); + PortableServer_POA_deactivate_object (bonobo_poa (), objid, &ev); + CORBA_free (objid); + obj->servant = NULL; + + servant_destroy_func = klass->servant_destroy_func; + servant_destroy_func ((PortableServer_Servant) servant, &ev); + g_free (servant); + CORBA_exception_free (&ev); } BonoboObject * -impl_Nautilus_ViewFrame__create(NautilusViewFrame *view, CORBA_Environment * ev) +impl_Nautilus_ViewFrame__create(NautilusViewFrame *view, CORBA_Environment *ev) { - BonoboObject *retval; - impl_POA_Nautilus_ViewFrame *newservant; - NautilusViewFrameClass *klass; - void (*servant_init_func)(PortableServer_Servant, CORBA_Environment *); - - klass = NAUTILUS_VIEW_FRAME_CLASS(GTK_OBJECT(view)->klass); - newservant = g_new0(impl_POA_Nautilus_ViewFrame, 1); - newservant->servant.vepv = klass->vepv; - if(!newservant->servant.vepv->Bonobo_Unknown_epv) - newservant->servant.vepv->Bonobo_Unknown_epv = bonobo_object_get_epv(); - newservant->view = view; - servant_init_func = klass->servant_init_func; - servant_init_func((PortableServer_Servant) newservant, ev); - - retval = bonobo_object_new_from_servant(newservant); + BonoboObject *bonobo_object; + impl_POA_Nautilus_ViewFrame *servant; + NautilusViewFrameClass *klass; + void (*servant_init_func) (PortableServer_Servant, CORBA_Environment *); + + klass = NAUTILUS_VIEW_FRAME_CLASS (GTK_OBJECT (view)->klass); + servant = g_new0 (impl_POA_Nautilus_ViewFrame, 1); + servant->servant.vepv = klass->vepv; + servant->servant.vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); + servant->view = view; + servant_init_func = klass->servant_init_func; + servant_init_func ((PortableServer_Servant) servant, ev); + + bonobo_object = bonobo_object_new_from_servant (servant); + + gtk_signal_connect (GTK_OBJECT (bonobo_object), "destroy", + GTK_SIGNAL_FUNC (impl_Nautilus_ViewFrame__destroy), servant); + + return bonobo_object; +} - gtk_signal_connect(GTK_OBJECT(retval), "destroy", GTK_SIGNAL_FUNC(impl_Nautilus_ViewFrame__destroy), newservant); +static Nautilus_ViewWindow +impl_Nautilus_ViewFrame__get_main_window (PortableServer_Servant servant, + CORBA_Environment *ev) +{ + NautilusWindow *window; - return retval; + window = NAUTILUS_WINDOW (((impl_POA_Nautilus_ViewFrame *) servant)->view->main_window); + return CORBA_Object_duplicate (bonobo_object_corba_objref (window->ntl_viewwindow), ev); } -static Nautilus_ViewWindow -impl_Nautilus_ViewFrame__get_main_window(impl_POA_Nautilus_ViewFrame *servant, - CORBA_Environment *ev) +static void +impl_Nautilus_ViewFrame_request_location_change (PortableServer_Servant servant, + const Nautilus_NavigationRequestInfo *navinfo, + CORBA_Environment *ev) { - return CORBA_Object_duplicate(bonobo_object_corba_objref(NAUTILUS_WINDOW(servant->view->main_window)->ntl_viewwindow), ev); + nautilus_view_frame_request_location_change + (((impl_POA_Nautilus_ViewFrame *) servant)->view, navinfo); } static void -impl_Nautilus_ViewFrame_request_location_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_NavigationRequestInfo * navinfo, - CORBA_Environment * ev) +impl_Nautilus_ViewFrame_request_selection_change (PortableServer_Servant servant, + const Nautilus_SelectionRequestInfo *selinfo, + CORBA_Environment *ev) { - nautilus_view_frame_request_location_change(servant->view, navinfo); + nautilus_view_frame_request_selection_change + (((impl_POA_Nautilus_ViewFrame *) servant)->view, selinfo); } static void -impl_Nautilus_ViewFrame_request_selection_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_SelectionRequestInfo * selinfo, - CORBA_Environment * ev) +impl_Nautilus_ViewFrame_request_status_change (PortableServer_Servant servant, + const Nautilus_StatusRequestInfo *statinfo, + CORBA_Environment *ev) { - nautilus_view_frame_request_selection_change(servant->view, - selinfo); + nautilus_view_frame_request_status_change + (((impl_POA_Nautilus_ViewFrame *) servant)->view, statinfo); } static void -impl_Nautilus_ViewFrame_request_status_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_StatusRequestInfo * statinfo, - CORBA_Environment * ev) +impl_Nautilus_ViewFrame_request_progress_change (PortableServer_Servant servant, + const Nautilus_ProgressRequestInfo *proginfo, + CORBA_Environment *ev) { - nautilus_view_frame_request_status_change(servant->view, statinfo); + nautilus_view_frame_request_progress_change + (((impl_POA_Nautilus_ViewFrame *) servant)->view, proginfo); } static void -impl_Nautilus_ViewFrame_request_progress_change(impl_POA_Nautilus_ViewFrame * servant, - Nautilus_ProgressRequestInfo * proginfo, - CORBA_Environment * ev) +impl_Nautilus_ViewFrame_request_title_change (PortableServer_Servant servant, + const CORBA_char *title, + CORBA_Environment *ev) { - nautilus_view_frame_request_progress_change(servant->view, proginfo); + nautilus_view_frame_request_title_change + (((impl_POA_Nautilus_ViewFrame *) servant)->view, title); } diff --git a/src/ntl-view-private.h b/src/ntl-view-private.h index 697f59582..14e55144e 100644 --- a/src/ntl-view-private.h +++ b/src/ntl-view-private.h @@ -38,24 +38,25 @@ typedef struct { NautilusViewFrame *view; } impl_POA_Nautilus_ViewFrame; - extern POA_Nautilus_ViewFrame__vepv impl_Nautilus_ViewFrame_vepv; extern POA_Nautilus_ZoomableFrame__vepv impl_Nautilus_ZoomableFrame_vepv; -BonoboObject *impl_Nautilus_ViewFrame__create (NautilusViewFrame *view, - CORBA_Environment *ev); -BonoboObject *impl_Nautilus_ZoomableFrame__create (NautilusViewFrame *view, - CORBA_Environment *ev); -void nautilus_view_frame_request_location_change (NautilusViewFrame *view, - Nautilus_NavigationRequestInfo *loc); -void nautilus_view_frame_request_selection_change (NautilusViewFrame *view, - Nautilus_SelectionRequestInfo *loc); -void nautilus_view_frame_request_status_change (NautilusViewFrame *view, - Nautilus_StatusRequestInfo *loc); -void nautilus_view_frame_request_progress_change (NautilusViewFrame *view, - Nautilus_ProgressRequestInfo *loc); -void nautilus_view_frame_notify_zoom_level (NautilusViewFrame *view, - double level); +BonoboObject *impl_Nautilus_ViewFrame__create (NautilusViewFrame *view, + CORBA_Environment *ev); +BonoboObject *impl_Nautilus_ZoomableFrame__create (NautilusViewFrame *view, + CORBA_Environment *ev); +void nautilus_view_frame_request_location_change (NautilusViewFrame *view, + const Nautilus_NavigationRequestInfo *loc); +void nautilus_view_frame_request_selection_change (NautilusViewFrame *view, + const Nautilus_SelectionRequestInfo *loc); +void nautilus_view_frame_request_status_change (NautilusViewFrame *view, + const Nautilus_StatusRequestInfo *loc); +void nautilus_view_frame_request_progress_change (NautilusViewFrame *view, + const Nautilus_ProgressRequestInfo *loc); +void nautilus_view_frame_request_title_change (NautilusViewFrame *view, + const char *title); +void nautilus_view_frame_notify_zoom_level (NautilusViewFrame *view, + double level); struct NautilusViewComponentType { const char *primary_repoid; diff --git a/src/ntl-view.c b/src/ntl-view.c index 020006f59..44d18c86e 100644 --- a/src/ntl-view.c +++ b/src/ntl-view.c @@ -30,7 +30,6 @@ #include <config.h> #include "ntl-view-private.h" -#include "ntl-content-view.h" #include "ntl-window.h" #include <libnautilus-extensions/nautilus-gtk-extensions.h> #include <gtk/gtksignal.h> @@ -43,6 +42,7 @@ enum { REQUEST_SELECTION_CHANGE, REQUEST_STATUS_CHANGE, REQUEST_PROGRESS_CHANGE, + REQUEST_TITLE_CHANGE, NOTIFY_ZOOM_LEVEL, LAST_SIGNAL }; @@ -92,28 +92,6 @@ nautilus_view_frame_get_type (void) return view_type; } -#if 0 -typedef void (*GtkSignal_NONE__BOXED_OBJECT_BOXED) (GtkObject * object, - gpointer arg1, - GtkObject *arg2, - gpointer arg3, - gpointer user_data); -static void -gtk_marshal_NONE__BOXED_OBJECT_BOXED (GtkObject * object, - GtkSignalFunc func, - gpointer func_data, - GtkArg * args) -{ - GtkSignal_NONE__BOXED_OBJECT_BOXED rfunc; - rfunc = (GtkSignal_NONE__BOXED_OBJECT_BOXED) func; - (*rfunc) (object, - GTK_VALUE_BOXED (args[0]), - GTK_VALUE_OBJECT (args[1]), - GTK_VALUE_BOXED (args[2]), - func_data); -} -#endif - static void nautilus_view_frame_class_init (NautilusViewFrameClass *klass) { @@ -144,57 +122,70 @@ nautilus_view_frame_class_init (NautilusViewFrameClass *klass) /* klass->request_progress_change = NULL; */ klass->view_constructed = nautilus_view_frame_constructed; - signals[REQUEST_LOCATION_CHANGE] = gtk_signal_new("request_location_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewFrameClass, - request_location_change), - gtk_marshal_NONE__BOXED, - GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - signals[REQUEST_SELECTION_CHANGE] = gtk_signal_new("request_selection_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewFrameClass, - request_selection_change), - gtk_marshal_NONE__BOXED, - GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - signals[REQUEST_STATUS_CHANGE] = gtk_signal_new("request_status_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewFrameClass, - request_status_change), - gtk_marshal_NONE__BOXED, - GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - signals[REQUEST_PROGRESS_CHANGE] = gtk_signal_new("request_progress_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewFrameClass, - request_progress_change), - gtk_marshal_NONE__BOXED, - GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - - signals[NOTIFY_ZOOM_LEVEL] = gtk_signal_new("notify_zoom_level", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (NautilusViewFrameClass, - notify_zoom_level), - nautilus_gtk_marshal_NONE__DOUBLE, - GTK_TYPE_NONE, 1, GTK_TYPE_DOUBLE); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + signals[REQUEST_LOCATION_CHANGE] = + gtk_signal_new ("request_location_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + request_location_change), + gtk_marshal_NONE__BOXED, + GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); + signals[REQUEST_SELECTION_CHANGE] = + gtk_signal_new ("request_selection_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + request_selection_change), + gtk_marshal_NONE__BOXED, + GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); + signals[REQUEST_STATUS_CHANGE] = + gtk_signal_new ("request_status_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + request_status_change), + gtk_marshal_NONE__BOXED, + GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); + signals[REQUEST_PROGRESS_CHANGE] = + gtk_signal_new ("request_progress_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + request_progress_change), + gtk_marshal_NONE__STRING, + GTK_TYPE_NONE, 1, GTK_TYPE_STRING); + signals[REQUEST_TITLE_CHANGE] = + gtk_signal_new ("request_title_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + request_title_change), + gtk_marshal_NONE__BOXED, + GTK_TYPE_NONE, 1, GTK_TYPE_BOXED); - + signals[NOTIFY_ZOOM_LEVEL] = + gtk_signal_new ("notify_zoom_level", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (NautilusViewFrameClass, + notify_zoom_level), + nautilus_gtk_marshal_NONE__DOUBLE, + GTK_TYPE_NONE, 1, GTK_TYPE_DOUBLE); + + gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); + gtk_object_add_arg_type ("NautilusViewFrame::main_window", GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_MAIN_WINDOW); + klass->num_construct_args++; } static void nautilus_view_frame_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) + GtkArg *arg, + guint arg_id) { NautilusViewFrame *view; @@ -209,8 +200,8 @@ nautilus_view_frame_set_arg (GtkObject *object, static void nautilus_view_frame_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) + GtkArg *arg, + guint arg_id) { switch(arg_id) { case ARG_MAIN_WINDOW: @@ -758,7 +749,7 @@ nautilus_view_frame_get_objref(NautilusViewFrame *view) void nautilus_view_frame_request_location_change(NautilusViewFrame *view, - Nautilus_NavigationRequestInfo *loc) + const Nautilus_NavigationRequestInfo *loc) { g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view)); gtk_signal_emit(GTK_OBJECT(view), signals[REQUEST_LOCATION_CHANGE], loc); @@ -766,7 +757,7 @@ nautilus_view_frame_request_location_change(NautilusViewFrame *view, void nautilus_view_frame_request_selection_change (NautilusViewFrame *view, - Nautilus_SelectionRequestInfo *loc) + const Nautilus_SelectionRequestInfo *loc) { g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view)); gtk_signal_emit(GTK_OBJECT(view), signals[REQUEST_SELECTION_CHANGE], loc); @@ -774,7 +765,7 @@ nautilus_view_frame_request_selection_change (NautilusViewFrame *vi void nautilus_view_frame_request_status_change (NautilusViewFrame *view, - Nautilus_StatusRequestInfo *loc) + const Nautilus_StatusRequestInfo *loc) { g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view)); gtk_signal_emit(GTK_OBJECT(view), signals[REQUEST_STATUS_CHANGE], loc); @@ -782,13 +773,21 @@ nautilus_view_frame_request_status_change (NautilusViewFrame *vi void nautilus_view_frame_request_progress_change(NautilusViewFrame *view, - Nautilus_ProgressRequestInfo *loc) + const Nautilus_ProgressRequestInfo *loc) { g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view)); gtk_signal_emit(GTK_OBJECT(view), signals[REQUEST_PROGRESS_CHANGE], loc); } void +nautilus_view_frame_request_title_change (NautilusViewFrame *view, + const char *title) +{ + g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view)); + gtk_signal_emit (GTK_OBJECT (view), signals[REQUEST_TITLE_CHANGE], title); +} + +void nautilus_view_frame_notify_zoom_level (NautilusViewFrame *view, gdouble level) { @@ -855,3 +854,15 @@ nautilus_view_frame_set_label (NautilusViewFrame *view, g_free (view->label); view->label = g_strdup (label); } + +/* Calls activate on the underlying control frame. */ +void +nautilus_view_frame_activate (NautilusViewFrame *view) +{ + BonoboControlFrame *control_frame; + + control_frame = BONOBO_CONTROL_FRAME (bonobo_object_query_local_interface + (view->view_frame, "IDL:Bonobo/ControlFrame:1.0")); + bonobo_control_frame_control_activate (control_frame); + bonobo_object_unref (BONOBO_OBJECT (control_frame)); +} diff --git a/src/ntl-view.h b/src/ntl-view.h index 57da4a602..b232c993a 100644 --- a/src/ntl-view.h +++ b/src/ntl-view.h @@ -62,6 +62,8 @@ struct NautilusViewFrameClass { Nautilus_StatusRequestInfo *loc); void (*request_progress_change) (NautilusViewFrame *view, Nautilus_ProgressRequestInfo *loc); + void (*request_title_change) (NautilusViewFrame *view, + const char *title); /* Part of Nautilus::ZoomableFrame CORBA interface. */ void (*notify_zoom_level) (NautilusViewFrame *view, @@ -138,6 +140,7 @@ void nautilus_view_frame_zoom_to_fit (NautilusViewFrame char * nautilus_view_frame_get_label (NautilusViewFrame *view); void nautilus_view_frame_set_label (NautilusViewFrame *view, const char *label); +void nautilus_view_frame_activate (NautilusViewFrame *view); /* This is a "protected" operation */ void nautilus_view_frame_construct_arg_set (NautilusViewFrame *view); diff --git a/src/ntl-window-msgs.c b/src/ntl-window-msgs.c index af3df58cc..53dcea2ff 100644 --- a/src/ntl-window-msgs.c +++ b/src/ntl-window-msgs.c @@ -210,8 +210,7 @@ compute_default_title (const char *text_uri) return g_strdup(_("Nautilus")); } -/* - * nautilus_window_get_current_location_title: +/* nautilus_window_get_current_location_title: * * Get a newly allocated copy of the user-displayable title for the current * location. Note that the window title is related to this but might not @@ -228,8 +227,7 @@ nautilus_window_get_current_location_title (NautilusWindow *window) : g_strdup (window->default_title); } -/* - * nautilus_window_update_title_internal: +/* nautilus_window_update_title_internal: * * Update the non-NautilusViewFrame objects that use the location's user-displayable * title in some way. Called when the location or title has changed. @@ -257,14 +255,12 @@ nautilus_window_update_title_internal (NautilusWindow *window, const char *title nautilus_send_history_list_changed (); } -/* - * nautilus_window_reset_title_internal: +/* nautilus_window_reset_title_internal: * * Update the non-NautilusViewFrame objects that use the location's user-displayable * title in some way. Called when the location or title has changed. * @window: The NautilusWindow in question. * @title: The new user-displayable title. - * */ static void nautilus_window_reset_title_internal (NautilusWindow *window, const char *uri) @@ -288,11 +284,18 @@ nautilus_window_reset_title_internal (NautilusWindow *window, const char *uri) } void -nautilus_window_request_title_change(NautilusWindow *window, - const char *new_title, - NautilusContentViewFrame *requesting_view) +nautilus_window_request_title_change (NautilusWindow *window, + const char *new_title, + NautilusViewFrame *requesting_view) { + g_return_if_fail (NAUTILUS_IS_WINDOW (widnow)); g_return_if_fail (new_title != NULL); + g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (requesting_view)); + + /* Only the content view can change the window title. */ + if (requesting_view != window->content_view) { + return; + } g_free (window->requested_title); window->requested_title = g_strdup (new_title); @@ -568,9 +571,9 @@ nautilus_window_free_load_info (NautilusWindow *window) /* Meta view handling */ static NautilusViewFrame * -nautilus_window_load_meta_view(NautilusWindow *window, - const char *iid, - NautilusViewFrame *requesting_view) +nautilus_window_load_meta_view (NautilusWindow *window, + const char *iid, + NautilusViewFrame *requesting_view) { NautilusViewFrame *meta_view; GList *p; @@ -638,7 +641,7 @@ nautilus_window_request_location_change (NautilusWindow *window, { NautilusWindow *new_window; - loc->requested_uri = gnome_vfs_unescape_string(loc->requested_uri); + loc->requested_uri = gnome_vfs_unescape_string (loc->requested_uri); if (handle_unreadable_location (window, loc->requested_uri)) { return; @@ -655,10 +658,10 @@ nautilus_window_request_location_change (NautilusWindow *window, } NautilusViewFrame * -nautilus_window_load_content_view(NautilusWindow *window, - const char *iid, - Nautilus_NavigationInfo *navinfo, - NautilusViewFrame **requesting_view) +nautilus_window_load_content_view (NautilusWindow *window, + const char *iid, + Nautilus_NavigationInfo *navinfo, + NautilusViewFrame **requesting_view) { NautilusViewFrame *content_view = window->content_view; NautilusViewFrame *new_view; @@ -678,10 +681,10 @@ nautilus_window_load_content_view(NautilusWindow *window, *requesting_view = NULL; } - new_view = NAUTILUS_VIEW_FRAME (gtk_widget_new (nautilus_content_view_frame_get_type(), - "main_window", window, NULL)); + new_view = NAUTILUS_VIEW_FRAME (gtk_widget_new (nautilus_view_frame_get_type(), + "main_window", window, NULL)); - nautilus_window_connect_content_view (window, NAUTILUS_CONTENT_VIEW_FRAME (new_view)); + nautilus_window_connect_content_view (window, new_view); if (!nautilus_view_frame_load_client (new_view, iid)) { gtk_widget_unref(GTK_WIDGET(new_view)); diff --git a/src/ntl-window-msgs.h b/src/ntl-window-msgs.h index 99ffe5c5e..2b4308812 100644 --- a/src/ntl-window-msgs.h +++ b/src/ntl-window-msgs.h @@ -28,7 +28,6 @@ #define NTL_WINDOW_MSGS_H #include "ntl-window.h" -#include "ntl-content-view.h" void nautilus_window_request_location_change (NautilusWindow *window, Nautilus_NavigationRequestInfo *loc, @@ -44,6 +43,6 @@ void nautilus_window_request_progress_change (NautilusWindow *w NautilusViewFrame *requesting_view); void nautilus_window_request_title_change (NautilusWindow *window, const char *new_title, - NautilusContentViewFrame *requesting_view); + NautilusViewFrame *requesting_view); #endif /* NTL_WINDOW_MSGS_H */ diff --git a/src/ntl-window-private.h b/src/ntl-window-private.h index 48ae6f97a..f896d4e67 100644 --- a/src/ntl-window-private.h +++ b/src/ntl-window-private.h @@ -2,7 +2,6 @@ #define NTL_WINDOW_PRIVATE_H #include "ntl-window.h" -#include "ntl-content-view.h" #include <libnautilus/libnautilus.h> #include <libnautilus/nautilus-undo-manager.h> #include <gtk/gtk.h> @@ -50,7 +49,7 @@ NautilusViewFrame *nautilus_window_load_content_view(NautilusWindow *window, Nautilus_NavigationInfo *navinfo, NautilusViewFrame **requesting_view); void nautilus_window_connect_content_view (NautilusWindow *window, - NautilusContentViewFrame *view); + NautilusViewFrame *view); void nautilus_window_connect_view (NautilusWindow *window, NautilusViewFrame *view); void nautilus_window_view_destroyed(NautilusViewFrame *view, NautilusWindow *window); diff --git a/src/ntl-window.c b/src/ntl-window.c index a0729e0de..dc95a56b4 100644 --- a/src/ntl-window.c +++ b/src/ntl-window.c @@ -1088,7 +1088,7 @@ nautilus_window_request_progress_change_cb (NautilusViewFrame *view, } static void -nautilus_window_request_title_change_callback (NautilusContentViewFrame *view, +nautilus_window_request_title_change_callback (NautilusViewFrame *view, const char *new_title, NautilusWindow *window) { @@ -1124,7 +1124,7 @@ nautilus_window_connect_view(NautilusWindow *window, NautilusViewFrame *view) } void -nautilus_window_connect_content_view(NautilusWindow *window, NautilusContentViewFrame *view) +nautilus_window_connect_content_view (NautilusWindow *window, NautilusViewFrame *view) { GtkObject *view_object; @@ -1133,10 +1133,10 @@ nautilus_window_connect_content_view(NautilusWindow *window, NautilusContentView /* Now connect with NautilusContentViewFrame signals. */ view_object = GTK_OBJECT(view); - gtk_signal_connect(view_object, - "request_title_change", - nautilus_window_request_title_change_callback, - window); + gtk_signal_connect (view_object, + "request_title_change", + nautilus_window_request_title_change_callback, + window); } void @@ -1174,9 +1174,9 @@ nautilus_window_real_set_content_view (NautilusWindow *window, NautilusViewFrame gtk_widget_show (GTK_WIDGET (new_view)); - nautilus_content_view_frame_set_active (NAUTILUS_CONTENT_VIEW_FRAME (new_view)); + nautilus_view_frame_activate (new_view); - gtk_paned_pack2(GTK_PANED(window->content_hbox), GTK_WIDGET (new_view), TRUE, FALSE); + gtk_paned_pack2 (GTK_PANED(window->content_hbox), GTK_WIDGET (new_view), TRUE, FALSE); } gtk_widget_queue_resize(window->content_hbox); |