diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | embed/ephy-embed-single.c | 11 | ||||
-rw-r--r-- | embed/ephy-embed-single.h | 48 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-single.cpp | 14 | ||||
-rw-r--r-- | src/ephy-tab.c | 2 |
5 files changed, 53 insertions, 32 deletions
@@ -1,3 +1,13 @@ +2004-08-08 Christian Persch <chpe@cvs.gnome.org> + + * embed/ephy-embed-single.c: (ephy_embed_single_open_window): + * embed/ephy-embed-single.h: + * embed/mozilla/mozilla-embed-single.cpp: (impl_open_window): + * src/ephy-tab.c: (popups_manager_show): + + Make ephy_embed_single_open_window() return the newly opened + embed widget. + 2004-08-06 Christian Persch <chpe@cvs.gnome.org> * data/default-prefs.js: diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c index 64f72d3a3..80788dada 100644 --- a/embed/ephy-embed-single.c +++ b/embed/ephy-embed-single.c @@ -190,21 +190,26 @@ ephy_embed_single_get_font_list (EphyEmbedSingle *single, * @single: the #EphyEmbedSingle * @parent: the requested window's parent #EphyEmbed * @address: the URL to load + * @name: a name for the window * @features: a Javascript features string * * Opens a new window, as if it were opened in @parent using the Javascript * method and arguments: <code>window.open("@address", * "_blank", "@features");</code>. * - * Use ephy_shell_new_tab() unless this handling of the @features string is + * Returns: the new embed. This is either a #EphyEmbed, or, when @features specified + * "chrome", a #GtkMozEmbed. + * + * NOTE: Use ephy_shell_new_tab() unless this handling of the @features string is * required. */ -void +GtkWidget * ephy_embed_single_open_window (EphyEmbedSingle *single, EphyEmbed *parent, const char *address, + const char *name, const char *features) { EphyEmbedSingleIface *iface = EPHY_EMBED_SINGLE_GET_IFACE (single); - return iface->open_window (single, parent, address, features); + return iface->open_window (single, parent, address, name, features); } diff --git a/embed/ephy-embed-single.h b/embed/ephy-embed-single.h index e0cbee8c1..1b8894592 100644 --- a/embed/ephy-embed-single.h +++ b/embed/ephy-embed-single.h @@ -50,37 +50,39 @@ struct _EphyEmbedSingleIface /* Methods */ - void (* open_window) (EphyEmbedSingle *single, - EphyEmbed *parent, - const char *address, - const char *features); - void (* clear_cache) (EphyEmbedSingle *shell); - void (* clear_auth_cache) (EphyEmbedSingle *shell); - void (* set_offline_mode) (EphyEmbedSingle *shell, - gboolean offline); - gboolean (* get_offline_mode) (EphyEmbedSingle *single); - GList * (* get_font_list) (EphyEmbedSingle *shell, - const char *langGroup); -}; - -GType ephy_embed_single_get_type (void); - -void ephy_embed_single_open_window (EphyEmbedSingle *single, + GtkWidget * (* open_window) (EphyEmbedSingle *single, EphyEmbed *parent, const char *address, + const char *name, const char *features); + void (* clear_cache) (EphyEmbedSingle *shell); + void (* clear_auth_cache) (EphyEmbedSingle *shell); + void (* set_offline_mode) (EphyEmbedSingle *shell, + gboolean offline); + gboolean (* get_offline_mode) (EphyEmbedSingle *single); + GList * (* get_font_list) (EphyEmbedSingle *shell, + const char *langGroup); +}; -void ephy_embed_single_clear_cache (EphyEmbedSingle *single); +GType ephy_embed_single_get_type (void); -void ephy_embed_single_clear_auth_cache (EphyEmbedSingle *single); +GtkWidget *ephy_embed_single_open_window (EphyEmbedSingle *single, + EphyEmbed *parent, + const char *address, + const char *name, + const char *features); -void ephy_embed_single_set_offline_mode (EphyEmbedSingle *single, - gboolean offline); +void ephy_embed_single_clear_cache (EphyEmbedSingle *single); + +void ephy_embed_single_clear_auth_cache (EphyEmbedSingle *single); + +void ephy_embed_single_set_offline_mode (EphyEmbedSingle *single, + gboolean offline); -gboolean ephy_embed_single_get_offline_mode (EphyEmbedSingle *single); +gboolean ephy_embed_single_get_offline_mode (EphyEmbedSingle *single); -GList *ephy_embed_single_get_font_list (EphyEmbedSingle *single, - const char *lang_group); +GList *ephy_embed_single_get_font_list (EphyEmbedSingle *single, + const char *lang_group); G_END_DECLS diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 8da7ce61e..ba379377e 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -45,6 +45,7 @@ #include "EphySingle.h" #include "EphyBrowser.h" #include "EphyUtils.h" +#include "MozillaPrivate.h" #include <glib/gi18n.h> #include <libgnomevfs/gnome-vfs-utils.h> @@ -898,28 +899,31 @@ impl_permission_manager_list (EphyPermissionManager *manager, return list; } -static void +static GtkWidget * impl_open_window (EphyEmbedSingle *single, EphyEmbed *parent, const char *address, + const char *name, const char *features) { nsCOMPtr<nsIDOMWindow> domWindow; - nsCOMPtr<nsIDOMWindow> dummy; if (parent) { EphyBrowser *browser; browser = (EphyBrowser *) _mozilla_embed_get_ephy_browser (MOZILLA_EMBED(parent)); - g_return_if_fail (browser != NULL); + g_return_val_if_fail (browser != NULL, NULL); browser->GetDOMWindow (getter_AddRefs (domWindow)); } nsCOMPtr<nsIWindowWatcher> wWatch(do_GetService ("@mozilla.org/embedcomp/window-watcher;1")); - wWatch->OpenWindow (domWindow, address, "", features, nsnull, - getter_AddRefs (dummy)); + nsCOMPtr<nsIDOMWindow> newWindow; + wWatch->OpenWindow (domWindow, address, name, features, nsnull, + getter_AddRefs (newWindow)); + + return MozillaFindEmbed (newWindow); } static void diff --git a/src/ephy-tab.c b/src/ephy-tab.c index 82b80eab8..ac498ed7f 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -551,7 +551,7 @@ popups_manager_show (PopupInfo *popup, single = EPHY_EMBED_SINGLE (ephy_embed_shell_get_embed_single (embed_shell)); - ephy_embed_single_open_window (single, embed, popup->url, + ephy_embed_single_open_window (single, embed, popup->url, "", popup->features); popups_manager_free_info (popup); |