diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2003-11-11 18:19:04 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2003-11-11 18:19:04 +0800 |
commit | 7beb933c60288ce8e5756e591a089a82ab1c6b6c (patch) | |
tree | 06e3ab839f705249f1ee3e17d2a920133a97916a /embed/mozilla/mozilla-embed.cpp | |
parent | 760bb6dfe800fb1edd33d158ee19bd898f09fb2e (diff) | |
download | gsoc2013-epiphany-7beb933c60288ce8e5756e591a089a82ab1c6b6c.tar gsoc2013-epiphany-7beb933c60288ce8e5756e591a089a82ab1c6b6c.tar.gz gsoc2013-epiphany-7beb933c60288ce8e5756e591a089a82ab1c6b6c.tar.bz2 gsoc2013-epiphany-7beb933c60288ce8e5756e591a089a82ab1c6b6c.tar.lz gsoc2013-epiphany-7beb933c60288ce8e5756e591a089a82ab1c6b6c.tar.xz gsoc2013-epiphany-7beb933c60288ce8e5756e591a089a82ab1c6b6c.tar.zst gsoc2013-epiphany-7beb933c60288ce8e5756e591a089a82ab1c6b6c.zip |
Build xul dialogs using GtkWindow+GtkMozEmbed. Make src code simpler and
2003-11-11 Marco Pesenti Gritti <marco@gnome.org>
* embed/ephy-embed-single.c: (ephy_embed_single_class_init):
* embed/ephy-embed-single.h:
* embed/mozilla/mozilla-embed-persist.cpp:
* embed/mozilla/mozilla-embed-single.cpp:
* embed/mozilla/mozilla-embed.cpp:
* embed/mozilla/mozilla-embed.h:
* src/ephy-nautilus-view.c: (gnv_embed_new_window_cb):
* src/ephy-session.c: (write_ephy_window):
* src/ephy-shell.c: (ephy_shell_init):
* src/ephy-tab.c: (ephy_tab_size_to_cb):
* src/ephy-window.c: (translate_default_chrome):
Build xul dialogs using GtkWindow+GtkMozEmbed.
Make src code simpler and fix a pair of bugs.
Diffstat (limited to 'embed/mozilla/mozilla-embed.cpp')
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index c41ecbf3a..0b8e3fea7 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -277,7 +277,7 @@ mozilla_embed_init (MozillaEmbed *embed) } gpointer -mozilla_embed_get_ephy_browser (MozillaEmbed *embed) +_mozilla_embed_get_ephy_browser (MozillaEmbed *embed) { g_return_val_if_fail (embed->priv->browser != NULL, NULL); @@ -1015,11 +1015,15 @@ mozilla_embed_new_window_cb (GtkMozEmbed *embed, { GTK_MOZ_EMBED_FLAG_WINDOWRAISED, EMBED_CHROME_WINDOWRAISED }, { GTK_MOZ_EMBED_FLAG_WINDOWLOWERED, EMBED_CHROME_WINDOWLOWERED }, { GTK_MOZ_EMBED_FLAG_CENTERSCREEN, EMBED_CHROME_CENTERSCREEN }, - { GTK_MOZ_EMBED_FLAG_OPENASDIALOG, EMBED_CHROME_OPENASDIALOG }, - { GTK_MOZ_EMBED_FLAG_OPENASCHROME, EMBED_CHROME_OPENASCHROME }, { 0, EMBED_CHROME_NONE } }; + if (chromemask && GTK_MOZ_EMBED_FLAG_OPENASCHROME) + { + *newEmbed = _mozilla_embed_new_xul_dialog (); + return; + } + for (i = 0; conversion_map[i].chromemask != 0; i++) { if (chromemask & conversion_map[i].chromemask) @@ -1114,3 +1118,42 @@ ephy_embed_init (EphyEmbedClass *embed_class) embed_class->print_preview_n_pages = impl_print_preview_n_pages; embed_class->print_preview_navigate = impl_print_preview_navigate; } + +void +xul_visibility_cb (GtkWidget *embed, gboolean visibility, GtkWidget *window) +{ + if (visibility) + { + gtk_widget_show (window); + } + else + { + gtk_widget_hide (window); + } +} + +void +xul_size_to_cb (GtkWidget *embed, gint width, gint height) +{ + gtk_widget_set_size_request (embed, width, height); +} + +GtkMozEmbed * +_mozilla_embed_new_xul_dialog (void) +{ + GtkWidget *window, *embed; + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + embed = gtk_moz_embed_new (); + gtk_widget_show (embed); + gtk_container_add (GTK_CONTAINER (window), embed); + + g_signal_connect_swapped (embed, "destroy_browser", + G_CALLBACK (gtk_widget_destroy), window); + g_signal_connect (embed, "visibility", + G_CALLBACK (xul_visibility_cb), window); + g_signal_connect (embed, "size_to", + G_CALLBACK (xul_size_to_cb), NULL); + + return GTK_MOZ_EMBED (embed); +} |