aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-05-10 15:40:32 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-05-10 15:40:32 +0800
commitd5b2112c4a55235afdd91d15146a1a623eb5bec6 (patch)
treeaff3ab7970c04e540d314f3997ddc2f6835d0719 /embed
parenta6fa796d9e009463eaca187f41d3ee38f514d18d (diff)
downloadgsoc2013-epiphany-d5b2112c4a55235afdd91d15146a1a623eb5bec6.tar
gsoc2013-epiphany-d5b2112c4a55235afdd91d15146a1a623eb5bec6.tar.gz
gsoc2013-epiphany-d5b2112c4a55235afdd91d15146a1a623eb5bec6.tar.bz2
gsoc2013-epiphany-d5b2112c4a55235afdd91d15146a1a623eb5bec6.tar.lz
gsoc2013-epiphany-d5b2112c4a55235afdd91d15146a1a623eb5bec6.tar.xz
gsoc2013-epiphany-d5b2112c4a55235afdd91d15146a1a623eb5bec6.tar.zst
gsoc2013-epiphany-d5b2112c4a55235afdd91d15146a1a623eb5bec6.zip
Share signal emission for all dom mouse events, so they dont go out of
2003-05-10 Marco Pesenti Gritti <marco@it.gnome.org> * embed/mozilla/mozilla-embed.cpp: Share signal emission for all dom mouse events, so they dont go out of sync. * src/ephy-tab.c: (ephy_tab_dom_mouse_click_cb), (ephy_tab_dom_mouse_down_cb), (ephy_tab_security_change_cb), (ephy_tab_init): Take middle click actions on click instead of on mouse down. Cleanups.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/mozilla-embed.cpp59
1 files changed, 21 insertions, 38 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index c65f50a34..aaca63203 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -1318,8 +1318,9 @@ mozilla_embed_destroy_brsr_cb (GtkMozEmbed *embed,
}
static gint
-mozilla_embed_dom_mouse_click_cb (GtkMozEmbed *embed, gpointer dom_event,
- MozillaEmbed *membed)
+mozilla_embed_emit_mouse_signal (MozillaEmbed *membed,
+ gpointer dom_event,
+ const char *signal_name)
{
EphyEmbedEvent *info;
EventContext event_context;
@@ -1334,40 +1335,6 @@ mozilla_embed_dom_mouse_click_cb (GtkMozEmbed *embed, gpointer dom_event,
event_context.Init ((nsIDOMEvent*)dom_event, wrapper);
result = event_context.GetMouseEventInfo (info);
-
- nsCOMPtr<nsIDOMDocument> domDoc;
- result = event_context.GetTargetDocument (getter_AddRefs(domDoc));
- if (NS_SUCCEEDED(result))
- {
- result = wrapper->PushTargetDocument (domDoc);
- }
-
- g_signal_emit_by_name (membed, "ge_dom_mouse_click", info, &return_value);
-
- wrapper->PopTargetDocument ();
-
- g_object_unref (info);
-
- return return_value;
-}
-
-static gint
-mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event,
- MozillaEmbed *membed)
-{
- EphyEmbedEvent *info;
- EventContext event_context;
- gint return_value = 0;
- EphyWrapper *wrapper;
- nsresult result;
-
- info = ephy_embed_event_new ();
-
- wrapper = MOZILLA_EMBED(membed)->priv->wrapper;
- g_return_val_if_fail (wrapper != NULL, G_FAILED);
-
- event_context.Init ((nsIDOMEvent*)dom_event, wrapper);
- result = event_context.GetMouseEventInfo (info);
if (NS_SUCCEEDED(result))
{
nsCOMPtr<nsIDOMDocument> domDoc;
@@ -1377,19 +1344,35 @@ mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event,
result = wrapper->PushTargetDocument (domDoc);
if (NS_SUCCEEDED(result))
{
- g_signal_emit_by_name (membed, "ge_dom_mouse_down",
+ g_signal_emit_by_name (membed, signal_name,
info, &return_value);
wrapper->PopTargetDocument ();
}
}
}
-
+
g_object_unref (info);
return return_value;
}
+static gint
+mozilla_embed_dom_mouse_click_cb (GtkMozEmbed *embed, gpointer dom_event,
+ MozillaEmbed *membed)
+{
+ return mozilla_embed_emit_mouse_signal
+ (membed, dom_event, "ge_dom_mouse_click");
+}
+
+static gint
+mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event,
+ MozillaEmbed *membed)
+{
+ return mozilla_embed_emit_mouse_signal
+ (membed, dom_event, "ge_dom_mouse_down");
+}
+
static void
mozilla_embed_size_to_cb (GtkMozEmbed *embed, gint width, gint height,
MozillaEmbed *membed)