aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-11-19 07:41:01 +0800
committerChristian Persch <chpe@src.gnome.org>2003-11-19 07:41:01 +0800
commit15cbf0f2d0ad71ed66edb1ca3d44d3beb96d49a0 (patch)
treee1e4668b9a725cd483f87ef3b82861724430b2d6 /embed
parent87dbe3ba52b623a2fc97caef8b5d26527426057b (diff)
downloadgsoc2013-epiphany-15cbf0f2d0ad71ed66edb1ca3d44d3beb96d49a0.tar.gz
gsoc2013-epiphany-15cbf0f2d0ad71ed66edb1ca3d44d3beb96d49a0.tar.zst
gsoc2013-epiphany-15cbf0f2d0ad71ed66edb1ca3d44d3beb96d49a0.zip
Re-use some more signals from GtkMozEmbed; fix getter_Copies usage in
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.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed.c34
-rw-r--r--embed/ephy-embed.h10
-rw-r--r--embed/mozilla/mozilla-embed.cpp43
3 files changed, 33 insertions, 54 deletions
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;