diff options
Diffstat (limited to 'embed')
-rw-r--r-- | embed/downloader-view.c | 8 | ||||
-rw-r--r-- | embed/ephy-embed-favicon.c | 12 | ||||
-rw-r--r-- | embed/ephy-embed-shell.c | 27 | ||||
-rw-r--r-- | embed/ephy-embed-shell.h | 13 | ||||
-rw-r--r-- | embed/ephy-embed-utils.c | 1 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-persist.cpp | 3 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 20 |
7 files changed, 35 insertions, 49 deletions
diff --git a/embed/downloader-view.c b/embed/downloader-view.c index 97e05a613..c7cdc2ef6 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -23,6 +23,7 @@ #include "ephy-ellipsizing-label.h" #include "ephy-embed-utils.h" #include "ephy-file-helpers.h" +#include "ephy-embed-shell.h" #include <gtk/gtktreeview.h> #include <gtk/gtkliststore.h> @@ -85,7 +86,7 @@ typedef struct gchar *source; gchar *dest; DownloadStatus status; - + GtkTreeRowReference *ref; } DownloadDetails; @@ -277,8 +278,9 @@ downloader_view_init (DownloaderView *dv) g_direct_equal, NULL, (GDestroyNotify)destroy_details_cb); - downloader_view_build_ui (dv); + + g_object_ref (embed_shell); } static void @@ -295,6 +297,8 @@ downloader_view_finalize (GObject *object) g_hash_table_destroy (dv->priv->details_hash); + g_object_unref (embed_shell); + g_free (dv->priv); G_OBJECT_CLASS (parent_class)->finalize (object); diff --git a/embed/ephy-embed-favicon.c b/embed/ephy-embed-favicon.c index f7fa43e3b..7afbbd831 100644 --- a/embed/ephy-embed-favicon.c +++ b/embed/ephy-embed-favicon.c @@ -134,13 +134,6 @@ update_url (EphyEmbedFavicon *favicon) } static void -location_changed_cb (EphyEmbed *embed, - EphyEmbedFavicon *favicon) -{ - update_url (favicon); -} - -static void favicon_cb (EphyEmbed *embed, const char *favicon_url, EphyEmbedFavicon *favicon) @@ -186,11 +179,6 @@ ephy_embed_favicon_set_property (GObject *object, G_CALLBACK (favicon_cb), favicon, 0); - g_signal_connect_object (G_OBJECT (favicon->priv->embed), - "ge_location", - G_CALLBACK (location_changed_cb), - favicon, - 0); update_url (favicon); } break; diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index 9bb72942a..69d1c98dd 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -46,8 +46,6 @@ static void ephy_embed_shell_init (EphyEmbedShell *ges); static void ephy_embed_shell_finalize (GObject *object); -static void -ephy_embed_shell_finalize (GObject *object); static EphyHistory * impl_get_global_history (EphyEmbedShell *shell); @@ -60,6 +58,12 @@ static guint ephy_embed_shell_signals[LAST_SIGNAL] = { 0 }; EphyEmbedShell *embed_shell; GType +ephy_embed_shell_get_impl (void) +{ + return MOZILLA_EMBED_SHELL_TYPE; +} + +GType ephy_embed_shell_get_type (void) { static GType ephy_embed_shell_type = 0; @@ -80,8 +84,8 @@ ephy_embed_shell_get_type (void) }; ephy_embed_shell_type = g_type_register_static (G_TYPE_OBJECT, - "EphyEmbedShell", - &our_info, 0); + "EphyEmbedShell", + &our_info, 0); } return ephy_embed_shell_type; @@ -175,21 +179,6 @@ ephy_embed_shell_new (const char *type) return NULL; } -const char *supported_embeds [] = { -#ifdef ENABLE_MOZILLA_EMBED - "mozilla", -#endif -#ifdef ENABLE_GTKHTML_EMBED - "gtkhtml", -#endif - NULL }; - -const char ** -ephy_embed_shell_get_supported (void) -{ - return supported_embeds; -} - /** * ephy_embed_shell_get_favicon_cache: * @gs: a #EphyShell diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h index 75d630f23..105db27f2 100644 --- a/embed/ephy-embed-shell.h +++ b/embed/ephy-embed-shell.h @@ -32,10 +32,11 @@ G_BEGIN_DECLS typedef struct EphyEmbedShellClass EphyEmbedShellClass; #define EPHY_EMBED_SHELL_TYPE (ephy_embed_shell_get_type ()) -#define EPHY_EMBED_SHELL(obj) (GTK_CHECK_CAST ((obj), EPHY_EMBED_SHELL_TYPE, EphyEmbedShell)) -#define EPHY_EMBED_SHELL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EPHY_EMBED_SHELL_TYPE, EphyEmbedShellClass)) -#define IS_EPHY_EMBED_SHELL(obj) (GTK_CHECK_TYPE ((obj), EPHY_EMBED_SHELL_TYPE)) -#define IS_EPHY_EMBED_SHELL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EPHY_EMBED_SHELL)) +#define EPHY_EMBED_SHELL_IMPL (ephy_embed_shell_get_impl ()) +#define EPHY_EMBED_SHELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_EMBED_SHELL_TYPE, EphyEmbedShell)) +#define EPHY_EMBED_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EPHY_EMBED_SHELL_TYPE, EphyEmbedShellClass)) +#define IS_EPHY_EMBED_SHELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPHY_EMBED_SHELL_TYPE)) +#define IS_EPHY_EMBED_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EPHY_EMBED_SHELL_TYPE)) #define EPHY_EMBED_SHELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EPHY_EMBED_SHELL_TYPE, EphyEmbedShellClass)) typedef struct EphyEmbedShell EphyEmbedShell; @@ -186,6 +187,8 @@ struct EphyEmbedShellClass GType ephy_embed_shell_get_type (void); +GType ephy_embed_shell_get_impl (void); + EphyEmbedShell *ephy_embed_shell_new (const char *type); EphyFaviconCache *ephy_embed_shell_get_favicon_cache (EphyEmbedShell *ges); @@ -200,8 +203,6 @@ EphyEmbed *ephy_embed_shell_get_active_embed (EphyEmbedShell *ges); GList *ephy_embed_shell_get_embeds (EphyEmbedShell *ges); -const char **ephy_embed_shell_get_supported (void); - void ephy_embed_shell_get_capabilities (EphyEmbedShell *shell, EmbedShellCapabilities *caps); diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c index f76a2b7e5..69089daa4 100644 --- a/embed/ephy-embed-utils.c +++ b/embed/ephy-embed-utils.c @@ -240,6 +240,7 @@ ephy_embed_utils_build_charsets_submenu (BonoboUIComponent *ui_component, g_timer_start(timer); #endif + g_return_if_fail (IS_EPHY_EMBED_SHELL (embed_shell)); g_return_if_fail (ephy_embed_shell_get_charset_groups (embed_shell, &groups) == G_OK); xml_string = g_string_new (NULL); diff --git a/embed/mozilla/mozilla-embed-persist.cpp b/embed/mozilla/mozilla-embed-persist.cpp index c0c8cb06e..9f9ac185c 100644 --- a/embed/mozilla/mozilla-embed-persist.cpp +++ b/embed/mozilla/mozilla-embed-persist.cpp @@ -167,7 +167,8 @@ impl_save (EphyEmbedPersist *persist) if (embed) { - wrapper = (EphyWrapper *) mozilla_embed_get_galeon_wrapper (MOZILLA_EMBED(embed)); + wrapper = (EphyWrapper *) mozilla_embed_get_galeon_wrapper (MOZILLA_EMBED(embed)); + g_return_val_if_fail (wrapper != NULL, G_FAILED); wrapper->GetDOMWindow (getter_AddRefs (parent)); } diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index 66330db4a..8c39dd460 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -274,7 +274,7 @@ mozilla_embed_get_type (void) static const GInterfaceInfo embed_info = { - (GInterfaceInitFunc) ephy_embed_init, /* interface_init */ + (GInterfaceInitFunc) ephy_embed_init, /* interface_init */ NULL, /* interface_finalize */ NULL /* interface_data */ }; @@ -357,8 +357,6 @@ mozilla_embed_init (MozillaEmbed *embed) gpointer mozilla_embed_get_galeon_wrapper (MozillaEmbed *embed) { - g_return_val_if_fail (embed->priv->wrapper != NULL, NULL); - return embed->priv->wrapper; } @@ -719,6 +717,8 @@ impl_get_location (EphyEmbed *embed, } *location = l; + + if (l == NULL) return G_FAILED; return G_OK; } @@ -1309,14 +1309,16 @@ mozilla_embed_visibility_cb (GtkMozEmbed *embed, gboolean visibility, (do_GetService(WINDOWWATCHER_CONTRACTID, &rv)); if (NS_FAILED(rv) || !wwatch) return; - EphyWrapper *wrapper = (EphyWrapper *)mozilla_embed_get_galeon_wrapper(membed); - if(!wrapper) return; + EphyWrapper *wrapper = membed->priv->wrapper; - nsCOMPtr<nsIDOMWindow> domWindow; - rv = wrapper->GetDOMWindow(getter_AddRefs(domWindow)); - if(NS_FAILED(rv) || !domWindow) return; + if (wrapper) + { + nsCOMPtr<nsIDOMWindow> domWindow; + rv = wrapper->GetDOMWindow(getter_AddRefs(domWindow)); + if(NS_FAILED(rv) || !domWindow) return; - rv = wwatch->SetActiveWindow(domWindow); + rv = wwatch->SetActiveWindow(domWindow); + } } static void |