aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-08-02 03:42:21 +0800
committerChristian Persch <chpe@src.gnome.org>2003-08-02 03:42:21 +0800
commitd0251310f8d4236076dd03affe2dad19f404a390 (patch)
tree61635c902d1ff9e524a17f4558f0495a2a0b20b6 /embed
parentdd1eeaa291d5cf7fe390615a281825f722cdea8a (diff)
downloadgsoc2013-epiphany-d0251310f8d4236076dd03affe2dad19f404a390.tar
gsoc2013-epiphany-d0251310f8d4236076dd03affe2dad19f404a390.tar.gz
gsoc2013-epiphany-d0251310f8d4236076dd03affe2dad19f404a390.tar.bz2
gsoc2013-epiphany-d0251310f8d4236076dd03affe2dad19f404a390.tar.lz
gsoc2013-epiphany-d0251310f8d4236076dd03affe2dad19f404a390.tar.xz
gsoc2013-epiphany-d0251310f8d4236076dd03affe2dad19f404a390.tar.zst
gsoc2013-epiphany-d0251310f8d4236076dd03affe2dad19f404a390.zip
Restore the "ge_dom_mouse_down" signal.
2003-08-01 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/mozilla-embed.cpp: (mozilla_embed_dom_mouse_down_cb): * embed/ephy-embed.h: * embed/ephy-embed.c: (ephy_embed_base_init): Restore the "ge_dom_mouse_down" signal.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed.c11
-rw-r--r--embed/ephy-embed.h2
-rw-r--r--embed/mozilla/mozilla-embed.cpp26
3 files changed, 29 insertions, 10 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index f20300bc5..f9bf0dc7b 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -42,6 +42,7 @@ enum
OPEN_URI,
SIZE_TO,
DOM_MOUSE_CLICK,
+ DOM_MOUSE_DOWN,
SECURITY_CHANGE,
ZOOM_CHANGE,
LAST_SIGNAL
@@ -230,6 +231,16 @@ ephy_embed_base_init (gpointer g_class)
G_TYPE_INT,
1,
G_TYPE_POINTER);
+ ephy_embed_signals[DOM_MOUSE_DOWN] =
+ g_signal_new ("ge_dom_mouse_down",
+ EPHY_EMBED_TYPE,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EphyEmbedClass, dom_mouse_down),
+ NULL, NULL,
+ ephy_marshal_INT__OBJECT,
+ G_TYPE_INT,
+ 1,
+ G_TYPE_POINTER);
ephy_embed_signals[SECURITY_CHANGE] =
g_signal_new ("ge_security_change",
EPHY_EMBED_TYPE,
diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h
index aec3d87a9..27fe2e504 100644
--- a/embed/ephy-embed.h
+++ b/embed/ephy-embed.h
@@ -184,6 +184,8 @@ struct EphyEmbedClass
gint height);
gint (* dom_mouse_click) (EphyEmbed *embed,
EphyEmbedEvent *event);
+ gint (* dom_mouse_down) (EphyEmbed *embed,
+ EphyEmbedEvent *event);
void (* security_change) (EphyEmbed *embed,
EmbedSecurityLevel level);
void (* zoom_change) (EphyEmbed *embed,
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index fa78a245b..f0d85ba59 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -1456,7 +1456,7 @@ mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event,
{
EphyEmbedEvent *info;
EventContext event_context;
- gint return_value = 0;
+ gint return_value = FALSE;
EphyWrapper *wrapper;
nsresult result;
EphyEmbedEventType type;
@@ -1474,24 +1474,30 @@ mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event,
event_context.Init (wrapper);
result = event_context.GetMouseEventInfo (static_cast<nsIDOMMouseEvent*>(dom_event), info);
+ if (NS_FAILED (result)) return FALSE;
ephy_embed_event_get_event_type (info, &type);
-
- if (NS_SUCCEEDED(result) && (type == EPHY_EMBED_EVENT_MOUSE_BUTTON3))
+
+ nsCOMPtr<nsIDOMDocument> domDoc;
+ result = event_context.GetTargetDocument (getter_AddRefs(domDoc));
+ if (NS_SUCCEEDED(result))
{
- nsCOMPtr<nsIDOMDocument> domDoc;
- result = event_context.GetTargetDocument (getter_AddRefs(domDoc));
+ result = wrapper->PushTargetDocument (domDoc);
+
if (NS_SUCCEEDED(result))
{
- result = wrapper->PushTargetDocument (domDoc);
- if (NS_SUCCEEDED(result))
+ g_signal_emit_by_name (membed, "ge_dom_mouse_down",
+ info, &return_value);
+
+ if (return_value == FALSE &&
+ type == EPHY_EMBED_EVENT_MOUSE_BUTTON3)
{
g_signal_emit_by_name (membed, "ge_context_menu",
- info, &return_value);
- wrapper->PopTargetDocument ();
+ info, &return_value);
}
- }
+ wrapper->PopTargetDocument ();
+ }
}
g_object_unref (info);