diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2003-11-09 03:59:27 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2003-11-09 03:59:27 +0800 |
commit | bc6c348cb4faebda6c9ed0bcd6f51b0894103f8b (patch) | |
tree | 0ae1c9527c9499e7fb2d59620d2f700bc7a6ab81 /embed | |
parent | efdbfda6497ce49555dfa80a6e0d90d5f2ee6389 (diff) | |
download | gsoc2013-epiphany-bc6c348cb4faebda6c9ed0bcd6f51b0894103f8b.tar gsoc2013-epiphany-bc6c348cb4faebda6c9ed0bcd6f51b0894103f8b.tar.gz gsoc2013-epiphany-bc6c348cb4faebda6c9ed0bcd6f51b0894103f8b.tar.bz2 gsoc2013-epiphany-bc6c348cb4faebda6c9ed0bcd6f51b0894103f8b.tar.lz gsoc2013-epiphany-bc6c348cb4faebda6c9ed0bcd6f51b0894103f8b.tar.xz gsoc2013-epiphany-bc6c348cb4faebda6c9ed0bcd6f51b0894103f8b.tar.zst gsoc2013-epiphany-bc6c348cb4faebda6c9ed0bcd6f51b0894103f8b.zip |
Remove decls from the top
2003-11-08 Marco Pesenti Gritti <marco@gnome.org>
* embed/mozilla/mozilla-embed-persist.cpp:
* embed/mozilla/mozilla-embed-single.cpp:
* embed/mozilla/mozilla-embed.cpp:
Remove decls from the top
Diffstat (limited to 'embed')
-rw-r--r-- | embed/mozilla/mozilla-embed-persist.cpp | 37 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-single.cpp | 165 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 227 |
3 files changed, 163 insertions, 266 deletions
diff --git a/embed/mozilla/mozilla-embed-persist.cpp b/embed/mozilla/mozilla-embed-persist.cpp index f2e586294..adb1699f7 100644 --- a/embed/mozilla/mozilla-embed-persist.cpp +++ b/embed/mozilla/mozilla-embed-persist.cpp @@ -43,11 +43,6 @@ mozilla_embed_persist_init (MozillaEmbedPersist *ges); static void mozilla_embed_persist_finalize (GObject *object); -static gboolean -impl_save (EphyEmbedPersist *persist); -static void -impl_cancel (EphyEmbedPersist *persist); - #define MOZILLA_EMBED_PERSIST_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), MOZILLA_TYPE_EMBED_PERSIST, MozillaEmbedPersistPrivate)) struct MozillaEmbedPersistPrivate @@ -87,22 +82,6 @@ mozilla_embed_persist_get_type (void) } static void -mozilla_embed_persist_class_init (MozillaEmbedPersistClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - EphyEmbedPersistClass *persist_class = EPHY_EMBED_PERSIST_CLASS (klass); - - parent_class = (GObjectClass *) g_type_class_peek_parent (klass); - - object_class->finalize = mozilla_embed_persist_finalize; - - persist_class->save = impl_save; - persist_class->cancel = impl_cancel; - - g_type_class_add_private (object_class, sizeof(MozillaEmbedPersistPrivate)); -} - -static void mozilla_embed_persist_init (MozillaEmbedPersist *persist) { persist->priv = MOZILLA_EMBED_PERSIST_GET_PRIVATE (persist); @@ -285,3 +264,19 @@ impl_save (EphyEmbedPersist *persist) return TRUE; } + +static void +mozilla_embed_persist_class_init (MozillaEmbedPersistClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + EphyEmbedPersistClass *persist_class = EPHY_EMBED_PERSIST_CLASS (klass); + + parent_class = (GObjectClass *) g_type_class_peek_parent (klass); + + object_class->finalize = mozilla_embed_persist_finalize; + + persist_class->save = impl_save; + persist_class->cancel = impl_cancel; + + g_type_class_add_private (object_class, sizeof(MozillaEmbedPersistPrivate)); +} diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 595e291b1..df298d73a 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -72,35 +72,6 @@ mozilla_embed_single_init (MozillaEmbedSingle *ges); static void mozilla_embed_single_finalize (GObject *object); -static void -impl_clear_cache (EphyEmbedSingle *shell); -static void -impl_set_offline_mode (EphyEmbedSingle *shell, - gboolean offline); -static void -impl_load_proxy_autoconf (EphyEmbedSingle *shell, - const char* url); -static GList * -impl_get_font_list (EphyEmbedSingle *shell, - const char *langGroup); -static GList * -impl_list_cookies (EphyEmbedSingle *shell); -static void -impl_remove_cookies (EphyEmbedSingle *shell, - GList *cookies); -static GList * -impl_list_passwords (EphyEmbedSingle *shell, - PasswordType type); -static void -impl_remove_passwords (EphyEmbedSingle *shell, - GList *passwords, - PasswordType type); - -static void mozilla_embed_single_new_window_orphan_cb (GtkMozEmbedSingle *embed, - GtkMozEmbed **retval, - guint chrome_mask, - EphyEmbedSingle *shell); - #define MOZILLA_EMBED_SINGLE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), MOZILLA_TYPE_EMBED_SINGLE, MozillaEmbedSinglePrivate)) struct MozillaEmbedSinglePrivate @@ -141,28 +112,6 @@ mozilla_embed_single_get_type (void) return mozilla_embed_single_type; } -static void -mozilla_embed_single_class_init (MozillaEmbedSingleClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - EphyEmbedSingleClass *shell_class = EPHY_EMBED_SINGLE_CLASS (klass); - - parent_class = (GObjectClass *) g_type_class_peek_parent (klass); - - object_class->finalize = mozilla_embed_single_finalize; - - shell_class->clear_cache = impl_clear_cache; - shell_class->set_offline_mode = impl_set_offline_mode; - shell_class->load_proxy_autoconf = impl_load_proxy_autoconf; - shell_class->get_font_list = impl_get_font_list; - shell_class->list_cookies = impl_list_cookies; - shell_class->remove_cookies = impl_remove_cookies; - shell_class->list_passwords = impl_list_passwords; - shell_class->remove_passwords = impl_remove_passwords; - - g_type_class_add_private (object_class, sizeof(MozillaEmbedSinglePrivate)); -} - EphyEmbedSingle * mozilla_embed_single_new (void) { @@ -276,6 +225,51 @@ mozilla_setup_colors (MozillaEmbedSingle *mes) mes->priv->theme_window = window; } +static void +mozilla_embed_single_new_window_orphan_cb (GtkMozEmbedSingle *embed, + GtkMozEmbed **retval, + guint chrome_mask, + EphyEmbedSingle *shell) +{ + /* FIXME conversion duped in mozilla_embed */ + EphyEmbed *new_embed; + int i; + EmbedChromeMask mask = EMBED_CHROME_OPENASPOPUP; + + struct + { + guint chromemask; + EmbedChromeMask 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_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 }, + { GTK_MOZ_EMBED_FLAG_OPENASDIALOG, EMBED_CHROME_OPENASDIALOG }, + { GTK_MOZ_EMBED_FLAG_OPENASCHROME, EMBED_CHROME_OPENASCHROME }, + { 0, EMBED_CHROME_NONE } + }; + + for (i = 0; conversion_map[i].chromemask != 0; i++) + { + if (chrome_mask & conversion_map[i].chromemask) + { + mask = (EmbedChromeMask) (mask | conversion_map[i].embed_mask); + } + } + + g_signal_emit_by_name (shell, "new_window_orphan", &new_embed, mask); + + g_assert (new_embed != NULL); + + *retval = GTK_MOZ_EMBED(EPHY_EMBED(new_embed)); +} + static void mozilla_init_single (MozillaEmbedSingle *mes) { @@ -290,7 +284,7 @@ mozilla_init_single (MozillaEmbedSingle *mes) /* allow creation of orphan windows */ g_signal_connect (G_OBJECT (single), "new_window_orphan", - GTK_SIGNAL_FUNC (mozilla_embed_single_new_window_orphan_cb), + G_CALLBACK (mozilla_embed_single_new_window_orphan_cb), mes); } @@ -462,51 +456,6 @@ mozilla_embed_single_init_services (MozillaEmbedSingle *single) return TRUE; } -static void -mozilla_embed_single_new_window_orphan_cb (GtkMozEmbedSingle *embed, - GtkMozEmbed **retval, - guint chrome_mask, - EphyEmbedSingle *shell) -{ - /* FIXME conversion duped in mozilla_embed */ - EphyEmbed *new_embed; - int i; - EmbedChromeMask mask = EMBED_CHROME_OPENASPOPUP; - - struct - { - guint chromemask; - EmbedChromeMask 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_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 }, - { GTK_MOZ_EMBED_FLAG_OPENASDIALOG, EMBED_CHROME_OPENASDIALOG }, - { GTK_MOZ_EMBED_FLAG_OPENASCHROME, EMBED_CHROME_OPENASCHROME }, - { 0, EMBED_CHROME_NONE } - }; - - for (i = 0; conversion_map[i].chromemask != 0; i++) - { - if (chrome_mask & conversion_map[i].chromemask) - { - mask = (EmbedChromeMask) (mask | conversion_map[i].embed_mask); - } - } - - g_signal_emit_by_name (shell, "new_window_orphan", &new_embed, mask); - - g_assert (new_embed != NULL); - - *retval = GTK_MOZ_EMBED(EPHY_EMBED(new_embed)); -} - static void mozilla_embed_single_finalize (GObject *object) { @@ -749,3 +698,25 @@ impl_remove_passwords (EphyEmbedSingle *shell, }; }; } + +static void +mozilla_embed_single_class_init (MozillaEmbedSingleClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + EphyEmbedSingleClass *shell_class = EPHY_EMBED_SINGLE_CLASS (klass); + + parent_class = (GObjectClass *) g_type_class_peek_parent (klass); + + object_class->finalize = mozilla_embed_single_finalize; + + shell_class->clear_cache = impl_clear_cache; + shell_class->set_offline_mode = impl_set_offline_mode; + shell_class->load_proxy_autoconf = impl_load_proxy_autoconf; + shell_class->get_font_list = impl_get_font_list; + shell_class->list_cookies = impl_list_cookies; + shell_class->remove_cookies = impl_remove_cookies; + shell_class->list_passwords = impl_list_passwords; + shell_class->remove_passwords = impl_remove_passwords; + + g_type_class_add_private (object_class, sizeof(MozillaEmbedSinglePrivate)); +} diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index 25018af17..97aefca23 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -47,77 +47,8 @@ static void mozilla_embed_init (MozillaEmbed *gs); static void mozilla_embed_destroy (GtkObject *object); static void ephy_embed_init (EphyEmbedClass *embed_class); -static void -impl_load_url (EphyEmbed *embed, - const char *url); -static void -impl_stop_load (EphyEmbed *embed); -static gboolean -impl_can_go_back (EphyEmbed *embed); -static gboolean -impl_can_go_forward (EphyEmbed *embed); -static gboolean -impl_can_go_up (EphyEmbed *embed); -static GSList * -impl_get_go_up_list (EphyEmbed *embed); -static void -impl_go_back (EphyEmbed *embed); -static void -impl_go_forward (EphyEmbed *embed); -static void -impl_go_up (EphyEmbed *embed); -static char * -impl_get_title (EphyEmbed *embed); -static char * -impl_get_location (EphyEmbed *embed, - gboolean toplevel); -static void -impl_reload (EphyEmbed *embed, - EmbedReloadFlags flags); -static void -impl_zoom_set (EphyEmbed *embed, - float zoom, - gboolean reflow); -static float -impl_zoom_get (EphyEmbed *embed); -static int -impl_shistory_n_items (EphyEmbed *embed); -static void -impl_shistory_get_nth (EphyEmbed *embed, - int nth, - gboolean is_relative, - char **url, - char **title); -static int -impl_shistory_get_pos (EphyEmbed *embed); -static void -impl_shistory_go_nth (EphyEmbed *embed, - int nth); -static void -impl_get_security_level (EphyEmbed *embed, - EmbedSecurityLevel *level, - char **description); -static void -impl_set_encoding (EphyEmbed *embed, - const char *encoding); -static EphyEncodingInfo * -impl_get_encoding_info (EphyEmbed *embed); -static void -impl_print (EphyEmbed *embed, - EmbedPrintInfo *info); -static void -impl_print_preview_close (EphyEmbed *embed); -static int -impl_print_preview_n_pages (EphyEmbed *embed); -static void -impl_print_preview_navigate (EphyEmbed *embed, - EmbedPrintPreviewNavType navType, - gint pageNum); - static void mozilla_embed_connect_signals (MozillaEmbed *membed); -static char * -mozilla_embed_get_uri_parent (const char *uri); static void mozilla_embed_location_changed_cb (GtkMozEmbed *embed, MozillaEmbed *membed); static void @@ -310,39 +241,6 @@ impl_find_set_properties (EphyEmbed *embed, } static void -ephy_embed_init (EphyEmbedClass *embed_class) -{ - embed_class->load_url = impl_load_url; - embed_class->stop_load = impl_stop_load; - embed_class->can_go_back = impl_can_go_back; - embed_class->can_go_forward =impl_can_go_forward; - embed_class->can_go_up = impl_can_go_up; - embed_class->get_go_up_list = impl_get_go_up_list; - embed_class->go_back = impl_go_back; - embed_class->go_forward = impl_go_forward; - embed_class->go_up = impl_go_up; - embed_class->get_title = impl_get_title; - embed_class->get_location = impl_get_location; - embed_class->reload = impl_reload; - embed_class->zoom_set = impl_zoom_set; - embed_class->zoom_get = impl_zoom_get; - embed_class->shistory_n_items = impl_shistory_n_items; - embed_class->shistory_get_nth = impl_shistory_get_nth; - embed_class->shistory_get_pos = impl_shistory_get_pos; - embed_class->shistory_go_nth = impl_shistory_go_nth; - embed_class->get_security_level = impl_get_security_level; - embed_class->find_next = impl_find_next; - embed_class->activate = impl_activate; - embed_class->find_set_properties = impl_find_set_properties; - embed_class->set_encoding = impl_set_encoding; - embed_class->get_encoding_info = impl_get_encoding_info; - embed_class->print = impl_print; - embed_class->print_preview_close = impl_print_preview_close; - embed_class->print_preview_n_pages = impl_print_preview_n_pages; - embed_class->print_preview_navigate = impl_print_preview_navigate; -} - -static void mozilla_embed_realize (GtkWidget *widget) { MozillaEmbedPrivate *mpriv = MOZILLA_EMBED (widget)->priv; @@ -460,6 +358,52 @@ impl_can_go_forward (EphyEmbed *embed) return gtk_moz_embed_can_go_forward (GTK_MOZ_EMBED(embed)); } +static char * +mozilla_embed_get_uri_parent (const char *aUri) +{ + nsresult rv; + + nsCOMPtr<nsIURI> uri; + rv = NS_NewURI (getter_AddRefs(uri), aUri); + if (NS_FAILED(rv) || !uri) return NULL; + + nsCOMPtr<nsIURL> url = do_QueryInterface(uri, &rv); + if (NS_FAILED(rv) || !url) return NULL; + + nsCAutoString dirPath; + rv = url->GetDirectory (dirPath); + if (NS_FAILED(rv) || !dirPath.Length()) return NULL; + + nsCAutoString filePath; + rv = url->GetFilePath (filePath); + if (NS_FAILED(rv) || !filePath.Length()) return NULL; + + PRInt32 pathLength = filePath.Length(); + PRInt32 trailingSlash = filePath.RFind("/"); + + if(pathLength < 2 || trailingSlash == -1) + { + return NULL; + } + + if(trailingSlash != (pathLength-1)) + { + uri->SetPath(dirPath); + } + else + { + PRInt32 nextSlash = filePath.RFind("/",PR_FALSE,trailingSlash-1); + nsCAutoString parentPath; + filePath.Left(parentPath, nextSlash); + uri->SetPath(parentPath); + } + + nsCAutoString spec; + uri->GetSpec(spec); + + return !spec.IsEmpty() ? g_strdup(spec.get()) : NULL; +} + static gboolean impl_can_go_up (EphyEmbed *embed) { @@ -541,52 +485,6 @@ impl_go_up (EphyEmbed *embed) } static char * -mozilla_embed_get_uri_parent (const char *aUri) -{ - nsresult rv; - - nsCOMPtr<nsIURI> uri; - rv = NS_NewURI (getter_AddRefs(uri), aUri); - if (NS_FAILED(rv) || !uri) return NULL; - - nsCOMPtr<nsIURL> url = do_QueryInterface(uri, &rv); - if (NS_FAILED(rv) || !url) return NULL; - - nsCAutoString dirPath; - rv = url->GetDirectory (dirPath); - if (NS_FAILED(rv) || !dirPath.Length()) return NULL; - - nsCAutoString filePath; - rv = url->GetFilePath (filePath); - if (NS_FAILED(rv) || !filePath.Length()) return NULL; - - PRInt32 pathLength = filePath.Length(); - PRInt32 trailingSlash = filePath.RFind("/"); - - if(pathLength < 2 || trailingSlash == -1) - { - return NULL; - } - - if(trailingSlash != (pathLength-1)) - { - uri->SetPath(dirPath); - } - else - { - PRInt32 nextSlash = filePath.RFind("/",PR_FALSE,trailingSlash-1); - nsCAutoString parentPath; - filePath.Left(parentPath, nextSlash); - uri->SetPath(parentPath); - } - - nsCAutoString spec; - uri->GetSpec(spec); - - return !spec.IsEmpty() ? g_strdup(spec.get()) : NULL; -} - -static char * impl_get_title (EphyEmbed *embed) { nsXPIDLString uTitle; @@ -1229,3 +1127,36 @@ mozilla_embed_security_level (MozillaEmbed *membed) } return level; } + +static void +ephy_embed_init (EphyEmbedClass *embed_class) +{ + embed_class->load_url = impl_load_url; + embed_class->stop_load = impl_stop_load; + embed_class->can_go_back = impl_can_go_back; + embed_class->can_go_forward =impl_can_go_forward; + embed_class->can_go_up = impl_can_go_up; + embed_class->get_go_up_list = impl_get_go_up_list; + embed_class->go_back = impl_go_back; + embed_class->go_forward = impl_go_forward; + embed_class->go_up = impl_go_up; + embed_class->get_title = impl_get_title; + embed_class->get_location = impl_get_location; + embed_class->reload = impl_reload; + embed_class->zoom_set = impl_zoom_set; + embed_class->zoom_get = impl_zoom_get; + embed_class->shistory_n_items = impl_shistory_n_items; + embed_class->shistory_get_nth = impl_shistory_get_nth; + embed_class->shistory_get_pos = impl_shistory_get_pos; + embed_class->shistory_go_nth = impl_shistory_go_nth; + embed_class->get_security_level = impl_get_security_level; + embed_class->find_next = impl_find_next; + embed_class->activate = impl_activate; + embed_class->find_set_properties = impl_find_set_properties; + embed_class->set_encoding = impl_set_encoding; + embed_class->get_encoding_info = impl_get_encoding_info; + embed_class->print = impl_print; + embed_class->print_preview_close = impl_print_preview_close; + embed_class->print_preview_n_pages = impl_print_preview_n_pages; + embed_class->print_preview_navigate = impl_print_preview_navigate; +} |