diff options
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | embed/ephy-embed.c | 34 | ||||
-rw-r--r-- | embed/ephy-embed.h | 10 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 43 | ||||
-rw-r--r-- | src/ephy-nautilus-view.c | 11 | ||||
-rw-r--r-- | src/ephy-tab.c | 11 |
6 files changed, 62 insertions, 63 deletions
@@ -1,3 +1,19 @@ +2003-11-19 Christian Persch <chpe@cvs.gnome.org> + + * embed/ephy-embed.c: (ephy_embed_base_init), + (ephy_embed_get_location), (ephy_embed_get_link_message), + (ephy_embed_get_js_status): + * embed/ephy-embed.h: + * embed/mozilla/mozilla-embed.cpp: + * src/ephy-nautilus-view.c: (ephy_nautilus_view_instance_init), + (gnv_embed_link_message_cb): + * src/ephy-nautilus-view.h: + * src/ephy-tab.c: (ephy_tab_set_link_message), + (ephy_tab_link_message_cb), (ephy_tab_init): + + Re-use some more signals from GtkMozEmbed; fix getter_Copies usage in + mozilla-embed.cpp. Fixes bug #127335. + 2003-11-18 Marco Pesenti Gritti <marco@gnome.org> * Makefile.am: diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index 5d124c653..b95be8c7d 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -95,16 +95,6 @@ ephy_embed_base_init (gpointer g_class) 2, G_TYPE_POINTER, G_TYPE_INT); - ephy_embed_signals[LINK_MESSAGE] = - g_signal_new ("ge_link_message", - EPHY_TYPE_EMBED, - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EphyEmbedClass, link_message), - NULL, NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, - 1, - G_TYPE_STRING); ephy_embed_signals[CONTEXT_MENU] = g_signal_new ("ge_context_menu", EPHY_TYPE_EMBED, @@ -125,16 +115,6 @@ ephy_embed_base_init (gpointer g_class) G_TYPE_NONE, 1, G_TYPE_STRING); - ephy_embed_signals[JS_STATUS] = - g_signal_new ("ge_js_status", - EPHY_TYPE_EMBED, - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EphyEmbedClass, js_status), - NULL, NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, - 1, - G_TYPE_STRING); ephy_embed_signals[LOCATION] = g_signal_new ("ge_location", EPHY_TYPE_EMBED, @@ -298,6 +278,20 @@ ephy_embed_get_location (EphyEmbed *embed, return klass->get_location (embed, toplevel); } +char * +ephy_embed_get_link_message (EphyEmbed *embed) +{ + EphyEmbedClass *klass = EPHY_EMBED_GET_CLASS (embed); + return klass->get_link_message (embed); +} + +char * +ephy_embed_get_js_status (EphyEmbed *embed) +{ + EphyEmbedClass *klass = EPHY_EMBED_GET_CLASS (embed); + return klass->get_js_status (embed); +} + void ephy_embed_reload (EphyEmbed *embed, EmbedReloadFlags flags) diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h index 2ebb51d0a..e3e577c95 100644 --- a/embed/ephy-embed.h +++ b/embed/ephy-embed.h @@ -168,10 +168,6 @@ struct EphyEmbedClass EphyEmbedEvent *event); void (* favicon) (EphyEmbed *embed, const char *location); - void (* link_message) (EphyEmbed *embed, - const char *link); - void (* js_status) (EphyEmbed *embed, - const char *status); void (* location) (EphyEmbed *embed, const char *location); void (* net_state) (EphyEmbed *embed, @@ -208,6 +204,8 @@ struct EphyEmbedClass char * (* get_title) (EphyEmbed *embed); char * (* get_location) (EphyEmbed *embed, gboolean toplevel); + char * (* get_link_message) (EphyEmbed *embed); + char * (* get_js_status) (EphyEmbed *embed); int (* shistory_n_items) (EphyEmbed *embed); void (* shistory_get_nth) (EphyEmbed *embed, int nth, @@ -261,6 +259,10 @@ char *ephy_embed_get_title (EphyEmbed *embed); char *ephy_embed_get_location (EphyEmbed *embed, gboolean toplevel); +char *ephy_embed_get_link_message (EphyEmbed *embed); + +char *ephy_embed_get_js_status (EphyEmbed *embed); + /* Navigation */ gboolean ephy_embed_can_go_back (EphyEmbed *embed); diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index d9cdd2b40..d94ffd686 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -96,8 +96,6 @@ signal_connections[] = { { "location", (void *) mozilla_embed_location_changed_cb }, { "net_state_all", (void *) mozilla_embed_net_state_all_cb }, - { "link_message", (void *) mozilla_embed_link_message_cb }, - { "js_status", (void *) mozilla_embed_js_status_cb }, { "dom_mouse_click", (void *) mozilla_embed_dom_mouse_click_cb }, { "dom_mouse_down", (void *) mozilla_embed_dom_mouse_down_cb }, { "new_window", (void *) mozilla_embed_new_window_cb }, @@ -480,12 +478,19 @@ impl_go_up (EphyEmbed *embed) static char * impl_get_title (EphyEmbed *embed) { - nsXPIDLString uTitle; + return gtk_moz_embed_get_title (GTK_MOZ_EMBED (embed)); +} - *getter_Copies(uTitle) = - gtk_moz_embed_get_title_unichar (GTK_MOZ_EMBED(embed)); +static char * +impl_get_link_message (EphyEmbed *embed) +{ + return gtk_moz_embed_get_link_message (GTK_MOZ_EMBED (embed)); +} - return g_strdup (NS_ConvertUCS2toUTF8(uTitle).get()); +static char * +impl_get_js_status (EphyEmbed *embed) +{ + return gtk_moz_embed_get_js_status (GTK_MOZ_EMBED (embed)); } static char * @@ -808,30 +813,6 @@ mozilla_embed_net_state_all_cb (GtkMozEmbed *embed, const char *aURI, g_signal_emit_by_name (membed, "ge_net_state", aURI, estate); } -static void -mozilla_embed_link_message_cb (GtkMozEmbed *embed, - MozillaEmbed *membed) -{ - nsXPIDLString message; - - *getter_Copies(message) = gtk_moz_embed_get_link_message_unichar (embed); - - g_signal_emit_by_name (membed, "ge_link_message", - NS_ConvertUCS2toUTF8(message).get()); -} - -static void -mozilla_embed_js_status_cb (GtkMozEmbed *embed, - MozillaEmbed *membed) -{ - nsXPIDLString status; - - *getter_Copies(status) = gtk_moz_embed_get_js_status_unichar (embed); - - g_signal_emit_by_name (membed, "ge_js_status", - NS_ConvertUCS2toUTF8(status).get()); -} - static gint mozilla_embed_dom_key_down_cb (GtkMozEmbed *embed, gpointer dom_event, MozillaEmbed *membed) @@ -1100,6 +1081,8 @@ ephy_embed_init (EphyEmbedClass *embed_class) embed_class->go_up = impl_go_up; embed_class->get_title = impl_get_title; embed_class->get_location = impl_get_location; + embed_class->get_link_message = impl_get_link_message; + embed_class->get_js_status = impl_get_js_status; embed_class->reload = impl_reload; embed_class->zoom_set = impl_zoom_set; embed_class->zoom_get = impl_zoom_get; diff --git a/src/ephy-nautilus-view.c b/src/ephy-nautilus-view.c index 2d2de8300..ad0cee8ca 100644 --- a/src/ephy-nautilus-view.c +++ b/src/ephy-nautilus-view.c @@ -170,7 +170,7 @@ ephy_nautilus_view_instance_init (EphyNautilusView *view) view->priv = p; view->priv->embed = ephy_embed_new (G_OBJECT (single)); - g_signal_connect (view->priv->embed, "ge_link_message", + g_signal_connect (view->priv->embed, "link_message", G_CALLBACK (gnv_embed_link_message_cb), view); g_signal_connect (view->priv->embed, "ge_location", @@ -347,12 +347,17 @@ gnv_embed_context_menu_cb (EphyEmbed *embed, } static void -gnv_embed_link_message_cb (EphyEmbed *embed, const char *message, EphyNautilusView *view) +gnv_embed_link_message_cb (EphyEmbed *embed, EphyNautilusView *view) { + char *message; + g_return_if_fail (EPHY_IS_NAUTILUS_VIEW (view)); - g_return_if_fail (message != NULL); + + message = ephy_embed_get_link_message (embed); nautilus_view_report_status (NAUTILUS_VIEW (view), message); + + g_free (message); } static void diff --git a/src/ephy-tab.c b/src/ephy-tab.c index a2c4f1c65..ac8859f69 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -107,7 +107,7 @@ static void ephy_tab_set_icon_address (EphyTab *tab, static void ephy_tab_set_load_status (EphyTab *tab, gboolean status); static void ephy_tab_set_link_message (EphyTab *tab, - const char *message); + char *message); static void ephy_tab_set_load_percent (EphyTab *tab, int percent); static void ephy_tab_update_navigation_flags(EphyTab *tab); @@ -445,12 +445,12 @@ ephy_tab_get_load_status (EphyTab *tab) } static void -ephy_tab_set_link_message (EphyTab *tab, const char *message) +ephy_tab_set_link_message (EphyTab *tab, char *message) { g_return_if_fail (EPHY_IS_TAB (tab)); g_free (tab->priv->link_message); - tab->priv->link_message = g_strdup (message); + tab->priv->link_message = message; g_object_notify (G_OBJECT (tab), "message"); } @@ -583,10 +583,9 @@ ephy_tab_favicon_cb (EphyEmbed *embed, static void ephy_tab_link_message_cb (EphyEmbed *embed, - const char *message, EphyTab *tab) { - ephy_tab_set_link_message (tab, message); + ephy_tab_set_link_message (tab, ephy_embed_get_link_message (embed)); } static void @@ -1093,7 +1092,7 @@ ephy_tab_init (EphyTab *tab) g_signal_connect (embed_widget, "destroy", G_CALLBACK (ephy_tab_embed_destroy_cb), tab); - g_signal_connect (embed, "ge_link_message", + g_signal_connect (embed, "link_message", G_CALLBACK (ephy_tab_link_message_cb), tab); g_signal_connect (embed, "ge_location", |