aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/mozilla-embed-event.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-01-23 23:38:02 +0800
committerChristian Persch <chpe@src.gnome.org>2005-01-23 23:38:02 +0800
commit361ed3d1c475f7b1ab2226abf7605405411ab185 (patch)
tree331891b90297d0d93026d2ca15b86570b634fc1e /embed/mozilla/mozilla-embed-event.cpp
parent8f10d345ad4bebf6a99c8a62e2448f49338eeb33 (diff)
downloadgsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar.gz
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar.bz2
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar.lz
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar.xz
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar.zst
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.zip
Check for broken context event button.
2005-01-23 Christian Persch <chpe@cvs.gnome.org> * configure.ac: Check for broken context event button. * embed/ephy-embed-event.c: (ephy_embed_event_get_context), (ephy_embed_event_get_button): * embed/ephy-embed-event.h: * embed/mozilla/mozilla-embed-event.cpp: * embed/mozilla/mozilla-embed-event.h: Change get_type to get_button, and don't store a nsCOMPtr in .priv. * src/ephy-tab.c: (ephy_tab_dom_mouse_click_cb): * src/ephy-window.c: (show_embed_popup), (tab_context_menu_cb), (ephy_window_set_active_tab): Adapted for above change. * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: Attach listener to oncontextmenu event. * embed/mozilla/EventContext.cpp: * embed/mozilla/EventContext.h: Get event target coordinates also for 'mouse' context events. * embed/mozilla/mozilla-embed.cpp: Remove key-down handler, and context code from mouse-down handler.
Diffstat (limited to 'embed/mozilla/mozilla-embed-event.cpp')
-rw-r--r--embed/mozilla/mozilla-embed-event.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/embed/mozilla/mozilla-embed-event.cpp b/embed/mozilla/mozilla-embed-event.cpp
index 6e37313d4..685fa6f6a 100644
--- a/embed/mozilla/mozilla-embed-event.cpp
+++ b/embed/mozilla/mozilla-embed-event.cpp
@@ -35,9 +35,9 @@
#define MOZILLA_EMBED_EVENT_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), MOZILLA_TYPE_EMBED_EVENT, MozillaEmbedEventPrivate))
-struct MozillaEmbedEventPrivate
+struct _MozillaEmbedEventPrivate
{
- nsCOMPtr<nsIDOMEvent> dom_event;
+ nsIDOMEvent* dom_event;
GHashTable *props;
};
@@ -94,6 +94,7 @@ mozilla_embed_event_new (gpointer dom_event)
event = MOZILLA_EMBED_EVENT (g_object_new (MOZILLA_TYPE_EMBED_EVENT, NULL));
event->priv->dom_event = static_cast<nsIDOMEvent*>(dom_event);
+ NS_IF_ADDREF (event->priv->dom_event);
return event;
}
@@ -112,12 +113,6 @@ mozilla_embed_event_set_property (MozillaEmbedEvent *event,
value);
}
-static EphyEmbedEventType
-impl_get_type (EphyEmbedEvent *event)
-{
- return ((MozillaEmbedEvent *) event)->type;
-}
-
static EphyEmbedEventContext
impl_get_context (EphyEmbedEvent *event)
{
@@ -125,6 +120,12 @@ impl_get_context (EphyEmbedEvent *event)
}
static guint
+impl_get_button (EphyEmbedEvent *event)
+{
+ return ((MozillaEmbedEvent *) event)->button;
+}
+
+static guint
impl_get_modifier (EphyEmbedEvent *event)
{
return ((MozillaEmbedEvent *) event)->modifier;
@@ -190,6 +191,7 @@ mozilla_embed_event_finalize (GObject *object)
g_hash_table_destroy (event->priv->props);
+ NS_IF_RELEASE (event->priv->dom_event);
event->priv->dom_event = nsnull;
LOG ("MozillaEmbedEvent %p finalised", object)
@@ -200,8 +202,8 @@ mozilla_embed_event_finalize (GObject *object)
static void
ephy_embed_event_iface_init (EphyEmbedEventIface *iface)
{
- iface->get_type = impl_get_type;
iface->get_context = impl_get_context;
+ iface->get_button = impl_get_button;
iface->get_modifier = impl_get_modifier;
iface->get_coordinates = impl_get_coordinates;
iface->get_property = impl_get_property;