diff options
author | Xan Lopez <xan@src.gnome.org> | 2008-06-30 15:23:52 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2008-06-30 15:23:52 +0800 |
commit | 0238a377973ad82bd73e4e8f12a291b62359e9c1 (patch) | |
tree | aea3bb8edf48835efa7500883c9e957b37ab1c37 | |
parent | faf45b0b6340ea93e9d4e8cfef7862885fc816c5 (diff) | |
download | gsoc2013-epiphany-0238a377973ad82bd73e4e8f12a291b62359e9c1.tar gsoc2013-epiphany-0238a377973ad82bd73e4e8f12a291b62359e9c1.tar.gz gsoc2013-epiphany-0238a377973ad82bd73e4e8f12a291b62359e9c1.tar.bz2 gsoc2013-epiphany-0238a377973ad82bd73e4e8f12a291b62359e9c1.tar.lz gsoc2013-epiphany-0238a377973ad82bd73e4e8f12a291b62359e9c1.tar.xz gsoc2013-epiphany-0238a377973ad82bd73e4e8f12a291b62359e9c1.tar.zst gsoc2013-epiphany-0238a377973ad82bd73e4e8f12a291b62359e9c1.zip |
embed: remove ephy_embed_get_{next,previous}_history_item.
Use WebKit APIs directly.
svn path=/trunk/; revision=8312
-rw-r--r-- | doc/reference/tmpl/ephy-embed.sgml | 2 | ||||
-rw-r--r-- | embed/ephy-embed.c | 30 | ||||
-rw-r--r-- | embed/ephy-embed.h | 4 | ||||
-rw-r--r-- | embed/webkit/webkit-embed.c | 40 | ||||
-rw-r--r-- | src/ephy-window.c | 24 |
5 files changed, 12 insertions, 88 deletions
diff --git a/doc/reference/tmpl/ephy-embed.sgml b/doc/reference/tmpl/ephy-embed.sgml index bea932651..fe2a47c55 100644 --- a/doc/reference/tmpl/ephy-embed.sgml +++ b/doc/reference/tmpl/ephy-embed.sgml @@ -327,8 +327,6 @@ be done by casting). @get_is_blank: @get_loading_title: @get_visibility: -@get_next_history_item: -@get_previous_history_item: @go_to_history_item: <!-- ##### ENUM EphyEmbedChrome ##### --> diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index fd7e223f6..b8f137f30 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -995,36 +995,6 @@ ephy_embed_get_visibility (EphyEmbed *embed) } /** - * ephy_embed_get_previous_history_item: - * @embed: an #EphyEmbed - * - * Returns the preceding #EphyHistoryItem in the history list. - * - * Return value: the preceding #EphyHistoryItem - **/ -EphyHistoryItem* -ephy_embed_get_previous_history_item (EphyEmbed *embed) -{ - EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed); - return iface->get_previous_history_item (embed); -} - -/** - * ephy_embed_get_next_history_item: - * @embed: an #EphyEmbed - * - * Returns the succeeding #EphyHistoryItem in the history list. - * - * Return value: the succeeding #EphyHistoryItem - **/ -EphyHistoryItem* -ephy_embed_get_next_history_item (EphyEmbed *embed) -{ - EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed); - return iface->get_next_history_item (embed); -} - -/** * ephy_embed_go_to_history_item: * @embed: an #EphyEmbed * @history_item: an #EphyHistoryItem diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h index b3da8da14..dfdd9cf77 100644 --- a/embed/ephy-embed.h +++ b/embed/ephy-embed.h @@ -224,8 +224,6 @@ struct _EphyEmbedIface gboolean (* get_is_blank) (EphyEmbed *embed); const char * (* get_loading_title) (EphyEmbed *embed); gboolean (* get_visibility) (EphyEmbed *embed); - EphyHistoryItem * (* get_next_history_item) (EphyEmbed *embed); - EphyHistoryItem * (* get_previous_history_item) (EphyEmbed *embed); void (* go_to_history_item) (EphyEmbed *embed, EphyHistoryItem *history_item); }; @@ -352,8 +350,6 @@ void ephy_embed_close (EphyEmbed *embed); gboolean ephy_embed_has_modified_forms (EphyEmbed *embed); /* History */ -EphyHistoryItem *ephy_embed_get_next_history_item (EphyEmbed *embed); -EphyHistoryItem *ephy_embed_get_previous_history_item (EphyEmbed *embed); void ephy_embed_go_to_history_item (EphyEmbed *embed, EphyHistoryItem *history_item); G_END_DECLS diff --git a/embed/webkit/webkit-embed.c b/embed/webkit/webkit-embed.c index ef6b677d8..caeb3e912 100644 --- a/embed/webkit/webkit-embed.c +++ b/embed/webkit/webkit-embed.c @@ -53,13 +53,6 @@ typedef enum WEBKIT_EMBED_LOAD_STOPPED } WebKitEmbedLoadState; - -typedef enum -{ - WEBKIT_HISTORY_BACKWARD, - WEBKIT_HISTORY_FORWARD -} WebKitHistoryType; - struct WebKitEmbedPrivate { WebKitWebView *web_view; @@ -69,24 +62,6 @@ struct WebKitEmbedPrivate EphyHistory *history; }; -static EphyHistoryItem* -webkit_construct_history_item (WebKitEmbed *embed, WebKitHistoryType hist_type) -{ - WebKitWebBackForwardList *web_back_forward_list; - WebKitWebHistoryItem *history_item; - - g_return_val_if_fail (WEBKIT_IS_EMBED (embed), NULL); - - web_back_forward_list = webkit_web_view_get_back_forward_list (embed->priv->web_view); - - if (hist_type == WEBKIT_HISTORY_FORWARD) - history_item = webkit_web_back_forward_list_get_forward_item (web_back_forward_list); - else - history_item = webkit_web_back_forward_list_get_back_item (web_back_forward_list); - - return webkit_history_item_new (history_item); -} - static void impl_manager_do_command (EphyCommandManager *manager, const char *command) @@ -476,19 +451,6 @@ impl_has_modified_forms (EphyEmbed *embed) return FALSE; } -static EphyHistoryItem* -impl_get_next_history_item (EphyEmbed *embed) -{ - return webkit_construct_history_item (WEBKIT_EMBED (embed), WEBKIT_HISTORY_FORWARD); -} - - -static EphyHistoryItem* -impl_get_previous_history_item (EphyEmbed *embed) -{ - return webkit_construct_history_item (WEBKIT_EMBED (embed), WEBKIT_HISTORY_BACKWARD); -} - static void impl_go_to_history_item (EphyEmbed *embed, EphyHistoryItem *history_item) { @@ -524,7 +486,5 @@ ephy_embed_iface_init (EphyEmbedIface *iface) iface->print_preview_navigate = impl_print_preview_navigate; iface->has_modified_forms = impl_has_modified_forms; iface->get_security_level = impl_get_security_level; - iface->get_next_history_item = impl_get_next_history_item; - iface->get_previous_history_item = impl_get_previous_history_item; iface->go_to_history_item = impl_go_to_history_item; } diff --git a/src/ephy-window.c b/src/ephy-window.c index ab4edcb14..51b9f6895 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -65,6 +65,7 @@ #include <libgnomeui/gnome-stock-icons.h> #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> +#include <webkit/webkit.h> #ifdef HAVE_X11_XF86KEYSYM_H #include <X11/XF86keysym.h> @@ -1615,9 +1616,11 @@ sync_tab_navigation (EphyEmbed *embed, EphyWindow *window) { EphyEmbedNavigationFlags flags; - EphyHistoryItem *item; + WebKitWebHistoryItem *item; + WebKitWebView *web_view; + WebKitWebBackForwardList *web_back_forward_list; gboolean up = FALSE, back = FALSE, forward = FALSE; - char *back_title = NULL, *forward_title = NULL; + const char *back_title = NULL, *forward_title = NULL; if (window->priv->closing) return; @@ -1639,29 +1642,26 @@ sync_tab_navigation (EphyEmbed *embed, ephy_toolbar_set_navigation_actions (window->priv->toolbar, back, forward, up); - item = ephy_embed_get_previous_history_item (embed); + web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed); + web_back_forward_list = webkit_web_view_get_back_forward_list (web_view); + + item = webkit_web_back_forward_list_get_back_item (web_back_forward_list); if (item) { - back_title = ephy_history_item_get_title (item); - g_object_unref (item); + back_title = webkit_web_history_item_get_title (item); } - - item = ephy_embed_get_next_history_item (embed); + item = webkit_web_back_forward_list_get_forward_item (web_back_forward_list); if (item) { - forward_title = ephy_history_item_get_title (item); - g_object_unref (item); + forward_title = webkit_web_history_item_get_title (item); } ephy_toolbar_set_navigation_tooltips (window->priv->toolbar, back_title, forward_title); - - g_free (back_title); - g_free (forward_title); } static void |