aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2007-10-22 06:23:35 +0800
committerXan Lopez <xan@src.gnome.org>2007-10-22 06:23:35 +0800
commit21970860f6d87a62764bdafadae76f4d2f9a1691 (patch)
treebefb7c5925ba0cfa93c2a45a061f801caf949a0b /src
parent20abb0405c42012e470173fc82dba03d7d4fe268 (diff)
downloadgsoc2013-epiphany-21970860f6d87a62764bdafadae76f4d2f9a1691.tar
gsoc2013-epiphany-21970860f6d87a62764bdafadae76f4d2f9a1691.tar.gz
gsoc2013-epiphany-21970860f6d87a62764bdafadae76f4d2f9a1691.tar.bz2
gsoc2013-epiphany-21970860f6d87a62764bdafadae76f4d2f9a1691.tar.lz
gsoc2013-epiphany-21970860f6d87a62764bdafadae76f4d2f9a1691.tar.xz
gsoc2013-epiphany-21970860f6d87a62764bdafadae76f4d2f9a1691.tar.zst
gsoc2013-epiphany-21970860f6d87a62764bdafadae76f4d2f9a1691.zip
Move navigation property from EphyTab to EphyEmbed.
svn path=/trunk/; revision=7549
Diffstat (limited to 'src')
-rw-r--r--src/ephy-tab.c67
-rw-r--r--src/ephy-tab.h9
-rw-r--r--src/ephy-window.c30
-rw-r--r--src/epiphany.defs38
4 files changed, 32 insertions, 112 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 73c1e1c2f..87d4a01df 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -95,7 +95,6 @@ struct _EphyTabPrivate
int height;
GSList *hidden_popups;
GSList *shown_popups;
- EphyTabNavigationFlags nav_flags;
guint idle_resize_handler;
/* Flags */
@@ -121,7 +120,6 @@ enum
PROP_ICON,
PROP_ICON_ADDRESS,
PROP_MESSAGE,
- PROP_NAVIGATION,
PROP_HIDDEN_POPUP_COUNT,
PROP_POPUPS_ALLOWED,
PROP_TITLE,
@@ -148,8 +146,6 @@ static guint n_tabs = 0;
/* internal functions, accessible only from this file */
static void ephy_tab_set_link_message (EphyTab *tab,
char *message);
-static void ephy_tab_update_navigation_flags(EphyTab *tab,
- EphyEmbed *embed);
static void ephy_tab_set_title (EphyTab *tab,
EphyEmbed *embed,
char *new_title);
@@ -224,7 +220,6 @@ ephy_tab_set_property (GObject *object,
case PROP_ADDRESS:
case PROP_ICON:
case PROP_MESSAGE:
- case PROP_NAVIGATION:
case PROP_HIDDEN_POPUP_COUNT:
case PROP_TITLE:
/* read only */
@@ -255,9 +250,6 @@ ephy_tab_get_property (GObject *object,
case PROP_MESSAGE:
g_value_set_string (value, ephy_tab_get_status_message (tab));
break;
- case PROP_NAVIGATION:
- g_value_set_flags (value, priv->nav_flags);
- break;
case PROP_HIDDEN_POPUP_COUNT:
g_value_set_int (value, popup_blocker_n_hidden (tab));
break;
@@ -396,15 +388,6 @@ ephy_tab_class_init (EphyTabClass *class)
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_class_install_property (object_class,
- PROP_NAVIGATION,
- g_param_spec_flags ("navigation",
- "Navigation flags",
- "The tab's navigation flags",
- EPHY_TYPE_TAB_NAVIGATION_FLAGS,
- 0,
- G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
-
- g_object_class_install_property (object_class,
PROP_HIDDEN_POPUP_COUNT,
g_param_spec_int ("hidden-popup-count",
"Number of Blocked Popups",
@@ -1443,7 +1426,7 @@ ephy_tab_address_cb (EphyEmbed *embed,
ephy_tab_set_link_message (tab, NULL);
ephy_tab_set_icon_address (tab, NULL);
- ephy_tab_update_navigation_flags (tab, embed);
+ ephy_embed_update_navigation_flags (embed);
g_object_notify (object, "title");
@@ -1623,7 +1606,7 @@ ephy_tab_net_state_cb (EphyEmbed *embed,
ephy_embed_set_load_percent (embed, 0);
ephy_embed_set_load_status (embed, TRUE);
- ephy_tab_update_navigation_flags (tab, embed);
+ ephy_embed_update_navigation_flags (embed);
ensure_page_info (tab, embed, uri);
@@ -1639,7 +1622,7 @@ ephy_tab_net_state_cb (EphyEmbed *embed,
ephy_embed_set_load_percent (ephy_tab_get_embed (tab), 100);
ephy_embed_set_load_status (embed, FALSE);
- ephy_tab_update_navigation_flags (tab, embed);
+ ephy_embed_update_navigation_flags (embed);
g_free (priv->loading_title);
priv->loading_title = NULL;
@@ -1950,50 +1933,6 @@ ephy_tab_init (EphyTab *tab)
tab, 0);
}
-static void
-ephy_tab_update_navigation_flags (EphyTab *tab, EphyEmbed *embed)
-{
- EphyTabNavigationFlags flags = 0;
-
- if (ephy_embed_can_go_up (embed))
- {
- flags |= EPHY_TAB_NAV_UP;
- }
-
- if (ephy_embed_can_go_back (embed))
- {
- flags |= EPHY_TAB_NAV_BACK;
- }
-
- if (ephy_embed_can_go_forward (embed))
- {
- flags |= EPHY_TAB_NAV_FORWARD;
- }
-
- if (flags != tab->priv->nav_flags)
- {
- tab->priv->nav_flags = flags;
-
- g_object_notify (G_OBJECT (tab), "navigation");
- }
-}
-
-/**
- * ephy_tab_get_navigation_flags:
- * @tab: an #EphyTab
- *
- * Returns @tab's navigation flags.
- *
- * Return value: @tab's navigation flags
- **/
-EphyTabNavigationFlags
-ephy_tab_get_navigation_flags (EphyTab *tab)
-{
- g_return_val_if_fail (EPHY_IS_TAB (tab), 0);
-
- return tab->priv->nav_flags;
-}
-
/**
* ephy_tab_get_status_message:
* @tab: an #EphyTab
diff --git a/src/ephy-tab.h b/src/ephy-tab.h
index cb40338a7..4eac9757b 100644
--- a/src/ephy-tab.h
+++ b/src/ephy-tab.h
@@ -42,13 +42,6 @@ typedef struct _EphyTabPrivate EphyTabPrivate;
typedef enum
{
- EPHY_TAB_NAV_UP = 1 << 0,
- EPHY_TAB_NAV_BACK = 1 << 1,
- EPHY_TAB_NAV_FORWARD = 1 << 2
-} EphyTabNavigationFlags;
-
-typedef enum
-{
EPHY_TAB_ADDRESS_EXPIRE_NOW,
EPHY_TAB_ADDRESS_EXPIRE_NEXT,
EPHY_TAB_ADDRESS_EXPIRE_CURRENT
@@ -97,8 +90,6 @@ void ephy_tab_set_typed_address (EphyTab *tab,
const char *address,
EphyTabAddressExpire expire);
-EphyTabNavigationFlags ephy_tab_get_navigation_flags (EphyTab *tab);
-
EphyEmbedSecurityLevel ephy_tab_get_security_level (EphyTab *tab);
void ephy_tab_get_size (EphyTab *tab,
diff --git a/src/ephy-window.c b/src/ephy-window.c
index e7c13c8b7..1f4b47555 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1468,30 +1468,29 @@ sync_tab_message (EphyTab *tab, GParamSpec *pspec, EphyWindow *window)
}
static void
-sync_tab_navigation (EphyTab *tab,
+sync_tab_navigation (EphyEmbed *embed,
GParamSpec *pspec,
EphyWindow *window)
{
- EphyTabNavigationFlags flags;
+ EphyEmbedNavigationFlags flags;
gboolean up = FALSE, back = FALSE, forward = FALSE;
- EphyEmbed *embed;
char *back_url = NULL, *forward_url = NULL;
char *back_title = NULL, *forward_title = NULL;
gint position;
if (window->priv->closing) return;
- flags = ephy_tab_get_navigation_flags (tab);
+ flags = ephy_embed_get_navigation_flags (embed);
- if (flags & EPHY_TAB_NAV_UP)
+ if (flags & EPHY_EMBED_NAV_UP)
{
up = TRUE;
}
- if (flags & EPHY_TAB_NAV_BACK)
+ if (flags & EPHY_EMBED_NAV_BACK)
{
back = TRUE;
}
- if (flags & EPHY_TAB_NAV_FORWARD)
+ if (flags & EPHY_EMBED_NAV_FORWARD)
{
forward = TRUE;
}
@@ -1499,9 +1498,6 @@ sync_tab_navigation (EphyTab *tab,
ephy_toolbar_set_navigation_actions (window->priv->toolbar,
back, forward, up);
- embed = ephy_tab_get_embed (tab);
- if (embed == NULL) return;
-
position = ephy_embed_shistory_get_pos (embed);
if (position > 0)
@@ -2155,9 +2151,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
G_CALLBACK (sync_tab_message),
window);
g_signal_handlers_disconnect_by_func (old_tab,
- G_CALLBACK (sync_tab_navigation),
- window);
- g_signal_handlers_disconnect_by_func (old_tab,
G_CALLBACK (sync_tab_popup_windows),
window);
g_signal_handlers_disconnect_by_func (old_tab,
@@ -2184,6 +2177,9 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
g_signal_handlers_disconnect_by_func (embed,
G_CALLBACK (sync_tab_load_status),
window);
+ g_signal_handlers_disconnect_by_func (embed,
+ G_CALLBACK (sync_tab_navigation),
+ window);
g_signal_handlers_disconnect_by_func
(embed, G_CALLBACK (tab_context_menu_cb), window);
@@ -2203,11 +2199,11 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
sync_tab_zoom (embed, NULL, window);
sync_tab_load_progress (embed, NULL, window);
sync_tab_load_status (embed, NULL, window);
+ sync_tab_navigation (embed, NULL, window);
sync_tab_address (new_tab, NULL, window);
sync_tab_icon (new_tab, NULL, window);
sync_tab_message (new_tab, NULL, window);
- sync_tab_navigation (new_tab, NULL, window);
sync_tab_popup_windows (new_tab, NULL, window);
sync_tab_popups_allowed (new_tab, NULL, window);
sync_tab_title (new_tab, NULL, window);
@@ -2221,9 +2217,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
g_signal_connect_object (new_tab, "notify::message",
G_CALLBACK (sync_tab_message),
window, 0);
- g_signal_connect_object (new_tab, "notify::navigation",
- G_CALLBACK (sync_tab_navigation),
- window, 0);
g_signal_connect_object (new_tab, "notify::hidden-popup-count",
G_CALLBACK (sync_tab_popup_windows),
window, 0);
@@ -2246,6 +2239,9 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
g_signal_connect_object (embed, "notify::load-status",
G_CALLBACK (sync_tab_load_status),
window, 0);
+ g_signal_connect_object (embed, "notify::navigation",
+ G_CALLBACK (sync_tab_navigation),
+ window, 0);
g_signal_connect_object (embed, "ge-context-menu",
G_CALLBACK (tab_context_menu_cb),
window, G_CONNECT_AFTER);
diff --git a/src/epiphany.defs b/src/epiphany.defs
index 394ef4dd0..02c5bfabd 100644
--- a/src/epiphany.defs
+++ b/src/epiphany.defs
@@ -217,6 +217,17 @@
;; Enumerations and flags ...
+(define-flags EmbedNavigationFlags
+ (in-module "Ephy")
+ (c-name "EphyEmbedNavigationFlags")
+ (gtype-id "EPHY_TYPE_EMBED_NAVIGATION_FLAGS")
+ (values
+ '("up" "EPHY_EMBED_NAV_UP")
+ '("back" "EPHY_EMBED_NAV_BACK")
+ '("forward" "EPHY_EMBED_NAV_FORWARD")
+ )
+)
+
(define-flags EmbedEventContext
(in-module "Ephy")
(c-name "EphyEmbedEventContext")
@@ -426,17 +437,6 @@
)
)
-(define-flags TabNavigationFlags
- (in-module "Ephy")
- (c-name "EphyTabNavigationFlags")
- (gtype-id "EPHY_TYPE_TAB_NAVIGATION_FLAGS")
- (values
- '("up" "EPHY_TAB_NAV_UP")
- '("back" "EPHY_TAB_NAV_BACK")
- '("forward" "EPHY_TAB_NAV_FORWARD")
- )
-)
-
(define-enum TabAddressExpire
(in-module "Ephy")
(c-name "EphyTabAddressExpire")
@@ -942,6 +942,11 @@
;; From ../embed/ephy-embed.h
+(define-function ephy_embed_navigation_flags_get_type
+ (c-name "ephy_embed_navigation_flags_get_type")
+ (return-type "GType")
+)
+
(define-function ephy_embed_net_state_get_type
(c-name "ephy_embed_net_state_get_type")
(return-type "GType")
@@ -3372,12 +3377,6 @@
)
)
-(define-method get_navigation_flags
- (of-object "EphyTab")
- (c-name "ephy_tab_get_navigation_flags")
- (return-type "EphyTabNavigationFlags")
-)
-
(define-method get_size
(of-object "EphyTab")
(c-name "ephy_tab_get_size")
@@ -3533,11 +3532,6 @@
(return-type "GType")
)
-(define-function ephy_tab_navigation_flags_get_type
- (c-name "ephy_tab_navigation_flags_get_type")
- (return-type "GType")
-)
-
(define-function ephy_tab_address_expire_get_type
(c-name "ephy_tab_address_expire_get_type")
(return-type "GType")