aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/mozilla-embed.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-01-30 23:20:36 +0800
committerChristian Persch <chpe@src.gnome.org>2005-01-30 23:20:36 +0800
commit8f01817138c1852b319898a5de3f4b9f244cdea5 (patch)
tree3473088e9fc4b6200a85e6714183e6f8482b2963 /embed/mozilla/mozilla-embed.cpp
parent58dba74abaf6313221c50629e546dc4492672486 (diff)
downloadgsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar.gz
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar.bz2
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar.lz
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar.xz
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar.zst
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.zip
Move new-window signal to the embed single, and new window creation from
2005-01-30 Christian Persch <chpe@cvs.gnome.org> * doc/reference/tmpl/ephy-embed.sgml: * embed/ephy-embed-single.c: (ephy_embed_single_iface_init): * embed/ephy-embed-single.h: * embed/ephy-embed.c: (ephy_embed_base_init): * embed/ephy-embed.h: * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-embed.cpp: * embed/mozilla/mozilla-embed.h: * lib/ephy-marshal.list: * lib/ephy-prefs.h: * src/ephy-shell.c: (ephy_shell_new_window_cb), (impl_get_embed_single): * src/ephy-tab.c: (ephy_tab_new_window_cb): Move new-window signal to the embed single, and new window creation from EphyTab to EphyShell.
Diffstat (limited to 'embed/mozilla/mozilla-embed.cpp')
-rw-r--r--embed/mozilla/mozilla-embed.cpp63
1 files changed, 39 insertions, 24 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index 54db6067c..fc77d32ae 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -25,6 +25,7 @@
#include "mozilla-embed.h"
#include "mozilla-embed-event.h"
+#include "ephy-embed-single.h"
#include "ephy-embed-shell.h"
#include "ephy-command-manager.h"
#include "ephy-string.h"
@@ -65,7 +66,7 @@ static gboolean mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed,
MozillaEmbed *membed);
static void mozilla_embed_new_window_cb (GtkMozEmbed *embed,
GtkMozEmbed **newEmbed,
- guint chromemask,
+ guint chrome_mask,
MozillaEmbed *membed);
static void mozilla_embed_security_change_cb (GtkMozEmbed *embed,
gpointer request,
@@ -932,20 +933,13 @@ mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event,
"ge_dom_mouse_down");
}
-static void
-mozilla_embed_new_window_cb (GtkMozEmbed *embed,
- GtkMozEmbed **newEmbed,
- guint chrome_mask,
- MozillaEmbed *membed)
+EphyEmbedChrome
+_mozilla_embed_translate_chrome (GtkMozEmbedChromeFlags flags)
{
- guint i;
- guint mask = 0;
- EphyEmbed *new_embed = NULL;
-
- struct
+ static const struct
{
- guint mozilla_mask;
- guint embed_mask;
+ guint mozilla_flag;
+ guint ephy_flag;
}
conversion_map [] =
{
@@ -953,28 +947,49 @@ mozilla_embed_new_window_cb (GtkMozEmbed *embed,
{ GTK_MOZ_EMBED_FLAG_TOOLBARON, EPHY_EMBED_CHROME_TOOLBAR },
{ GTK_MOZ_EMBED_FLAG_STATUSBARON, EPHY_EMBED_CHROME_STATUSBAR },
{ GTK_MOZ_EMBED_FLAG_PERSONALTOOLBARON, EPHY_EMBED_CHROME_BOOKMARKSBAR },
- { 0, 0 }
};
- if (chrome_mask & GTK_MOZ_EMBED_FLAG_OPENASCHROME)
- {
- *newEmbed = _mozilla_embed_new_xul_dialog ();
- return;
- }
+ guint mask = 0, i;
- for (i = 0; conversion_map[i].mozilla_mask != 0; i++)
+ for (i = 0; i < G_N_ELEMENTS (conversion_map); i++)
{
- if (chrome_mask & conversion_map[i].mozilla_mask)
+ if (flags & conversion_map[i].mozilla_flag)
{
- mask |= conversion_map[i].embed_mask;
+ mask |= conversion_map[i].ephy_flag;
}
}
- g_signal_emit_by_name (membed, "ge_new_window", mask, &new_embed);
+ return (EphyEmbedChrome) mask;
+}
+
+static void
+mozilla_embed_new_window_cb (GtkMozEmbed *embed,
+ GtkMozEmbed **newEmbed,
+ guint chrome_mask,
+ MozillaEmbed *membed)
+{
+ GtkMozEmbedChromeFlags chrome = (GtkMozEmbedChromeFlags) chrome_mask;
+ EphyEmbed *new_embed = NULL;
+ GObject *single;
+ EphyEmbedChrome mask;
+
+ if (chrome & GTK_MOZ_EMBED_FLAG_OPENASCHROME)
+ {
+ *newEmbed = _mozilla_embed_new_xul_dialog ();
+ return;
+ }
+
+ mask = _mozilla_embed_translate_chrome (chrome);
+
+ single = ephy_embed_shell_get_embed_single (embed_shell);
+ g_signal_emit_by_name (single, "new-window", embed, mask,
+ &new_embed);
g_assert (new_embed != NULL);
- gtk_moz_embed_set_chrome_mask (GTK_MOZ_EMBED (new_embed), chrome_mask);
+ gtk_moz_embed_set_chrome_mask (GTK_MOZ_EMBED (new_embed), chrome);
+
+ g_signal_emit_by_name (membed, "ge-new-window", new_embed);
*newEmbed = GTK_MOZ_EMBED (new_embed);
}