aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed.c22
-rw-r--r--embed/ephy-embed.h28
-rw-r--r--embed/mozilla/Makefile.am1
-rw-r--r--embed/mozilla/mozilla-embed.cpp34
4 files changed, 49 insertions, 36 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index f371cfc15..852090e44 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -31,6 +31,28 @@
static void ephy_embed_base_init (gpointer g_class);
GType
+ephy_embed_chrome_get_type (void)
+{
+ static GType etype = 0;
+
+ if (etype == 0)
+ {
+ static const GFlagsValue values[] =
+ {
+ { EPHY_EMBED_CHROME_DEFAULT, "EPHY_EMBED_CHROME_DEFAULT", "default" },
+ { EPHY_EMBED_CHROME_MENUBAR, "EPHY_EMBED_CHROME_MENUBARON", "menubar" },
+ { EPHY_EMBED_CHROME_TOOLBAR, "EPHY_EMBED_CHROME_TOOLBARON", "toolbar" },
+ { EPHY_EMBED_CHROME_STATUSBAR, "EPHY_EMBED_CHROME_STATUSBARON", "statusbar" },
+ { 0, NULL, NULL }
+ };
+
+ etype = g_flags_register_static ("EphyEmbedChrome", values);
+ }
+
+ return etype;
+}
+
+GType
ephy_embed_get_type (void)
{
static GType ephy_embed_type = 0;
diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h
index f7e3bcfd4..afeee8d9f 100644
--- a/embed/ephy-embed.h
+++ b/embed/ephy-embed.h
@@ -37,6 +37,8 @@ G_BEGIN_DECLS
#define EPHY_IS_EMBED_IFACE(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_EMBED))
#define EPHY_EMBED_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EPHY_TYPE_EMBED, EphyEmbedIface))
+#define EPHY_TYPE_EMBED_CHROME_MASK (ephy_embed_chrome_get_type ())
+
typedef struct EphyEmbed EphyEmbed;
typedef struct EphyEmbedIface EphyEmbedIface;
@@ -57,21 +59,11 @@ typedef enum
typedef enum
{
- EMBED_CHROME_NONE = 0,
- EMBED_CHROME_DEFAULT = 1 << 0,
- EMBED_CHROME_MENUBARON = 1 << 1,
- EMBED_CHROME_TOOLBARON = 1 << 2,
- EMBED_CHROME_BOOKMARKSBARON = 1 << 3,
- EMBED_CHROME_BOOKMARKSBAR_DEFAULT = 1 << 4,
- EMBED_CHROME_STATUSBARON = 1 << 5,
- EMBED_CHROME_WINDOWRAISED = 1 << 6,
- EMBED_CHROME_WINDOWLOWERED = 1 << 7,
- EMBED_CHROME_CENTERSCREEN = 1 << 8,
- EMBED_CHROME_OPENASDIALOG = 1 << 9,
- EMBED_CHROME_OPENASCHROME = 1 << 10,
- EMBED_CHROME_OPENASPOPUP = 1 << 11,
- EMBED_CHROME_PPVIEWTOOLBARON = 1 << 12
-} EmbedChromeMask;
+ EPHY_EMBED_CHROME_DEFAULT = 1 << 0,
+ EPHY_EMBED_CHROME_MENUBAR = 1 << 1,
+ EPHY_EMBED_CHROME_TOOLBAR = 1 << 2,
+ EPHY_EMBED_CHROME_STATUSBAR = 1 << 3
+} EphyEmbedChrome;
typedef enum
{
@@ -164,7 +156,7 @@ struct EphyEmbedIface
EmbedState state);
void (* new_window) (EphyEmbed *embed,
EphyEmbed **new_embed,
- EmbedChromeMask chromemask);
+ EphyEmbedChrome chromemask);
gboolean (* dom_mouse_click) (EphyEmbed *embed,
EphyEmbedEvent *event);
gboolean (* dom_mouse_down) (EphyEmbed *embed,
@@ -230,6 +222,8 @@ struct EphyEmbedIface
gboolean (* has_modified_forms) (EphyEmbed *embed);
};
+GType ephy_embed_chrome_get_type (void);
+
GType ephy_embed_get_type (void);
/* Base */
@@ -280,7 +274,7 @@ void ephy_embed_shistory_go_nth (EphyEmbed *embed,
void ephy_embed_get_security_level (EphyEmbed *embed,
EmbedSecurityLevel *level,
- char **description);
+ char **description);
/* Zoom */
void ephy_embed_zoom_set (EphyEmbed *embed,
diff --git a/embed/mozilla/Makefile.am b/embed/mozilla/Makefile.am
index f538c8ae6..33e1baed3 100644
--- a/embed/mozilla/Makefile.am
+++ b/embed/mozilla/Makefile.am
@@ -24,6 +24,7 @@ INCLUDES = \
-I$(MOZILLA_INCLUDE_ROOT)/pref \
-I$(MOZILLA_INCLUDE_ROOT)/progressDlg \
-I$(MOZILLA_INCLUDE_ROOT)/shistory \
+ -I$(MOZILLA_INCLUDE_ROOT)/string \
-I$(MOZILLA_INCLUDE_ROOT)/unicharutil \
-I$(MOZILLA_INCLUDE_ROOT)/uriloader \
-I$(MOZILLA_INCLUDE_ROOT)/wallet \
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index b37e56cd2..70a17bbb6 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -983,45 +983,41 @@ mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event,
static void
mozilla_embed_new_window_cb (GtkMozEmbed *embed,
GtkMozEmbed **newEmbed,
- guint chromemask,
+ guint chrome_mask,
MozillaEmbed *membed)
{
- int i;
- EmbedChromeMask mask = EMBED_CHROME_OPENASPOPUP;
+ guint i;
+ guint mask = 0;
EphyEmbed *new_embed = NULL;
struct
{
- guint chromemask;
- EmbedChromeMask embed_mask;
+ guint mozilla_mask;
+ guint embed_mask;
}
conversion_map [] =
{
- { GTK_MOZ_EMBED_FLAG_DEFAULTCHROME, EMBED_CHROME_DEFAULT },
- { GTK_MOZ_EMBED_FLAG_MENUBARON, EMBED_CHROME_MENUBARON },
- { GTK_MOZ_EMBED_FLAG_TOOLBARON, EMBED_CHROME_TOOLBARON },
- { GTK_MOZ_EMBED_FLAG_PERSONALTOOLBARON, EMBED_CHROME_BOOKMARKSBAR_DEFAULT },
- { GTK_MOZ_EMBED_FLAG_STATUSBARON, EMBED_CHROME_STATUSBARON },
- { GTK_MOZ_EMBED_FLAG_WINDOWRAISED, EMBED_CHROME_WINDOWRAISED },
- { GTK_MOZ_EMBED_FLAG_WINDOWLOWERED, EMBED_CHROME_WINDOWLOWERED },
- { GTK_MOZ_EMBED_FLAG_CENTERSCREEN, EMBED_CHROME_CENTERSCREEN },
- { 0, EMBED_CHROME_NONE }
+ { GTK_MOZ_EMBED_FLAG_DEFAULTCHROME, EPHY_EMBED_CHROME_DEFAULT },
+ { GTK_MOZ_EMBED_FLAG_MENUBARON, EPHY_EMBED_CHROME_MENUBAR },
+ { GTK_MOZ_EMBED_FLAG_TOOLBARON, EPHY_EMBED_CHROME_TOOLBAR },
+ { GTK_MOZ_EMBED_FLAG_STATUSBARON, EPHY_EMBED_CHROME_STATUSBAR },
+ { 0, 0 }
};
- if (chromemask & GTK_MOZ_EMBED_FLAG_OPENASCHROME)
+ if (chrome_mask & GTK_MOZ_EMBED_FLAG_OPENASCHROME)
{
*newEmbed = _mozilla_embed_new_xul_dialog ();
return;
}
- for (i = 0; conversion_map[i].chromemask != 0; i++)
+ for (i = 0; conversion_map[i].mozilla_mask != 0; i++)
{
- if (chromemask & conversion_map[i].chromemask)
+ if (chrome_mask & conversion_map[i].mozilla_mask)
{
- mask = (EmbedChromeMask) (mask | conversion_map[i].embed_mask);
+ mask |= conversion_map[i].embed_mask;
}
}
-
+
g_signal_emit_by_name (membed, "ge_new_window", &new_embed, mask);
g_assert (new_embed != NULL);