diff options
author | Xan Lopez <xan@src.gnome.org> | 2007-10-26 04:01:20 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2007-10-26 04:01:20 +0800 |
commit | cc62537ebba1ba9ab31cc3da32ddf51556045caa (patch) | |
tree | 0a052838c4cb61bd8290a4f2a40ed0903eb1e9fc | |
parent | be872c7f830e2789c9dd5968b2a66d7ddf06f60b (diff) | |
download | gsoc2013-epiphany-cc62537ebba1ba9ab31cc3da32ddf51556045caa.tar gsoc2013-epiphany-cc62537ebba1ba9ab31cc3da32ddf51556045caa.tar.gz gsoc2013-epiphany-cc62537ebba1ba9ab31cc3da32ddf51556045caa.tar.bz2 gsoc2013-epiphany-cc62537ebba1ba9ab31cc3da32ddf51556045caa.tar.lz gsoc2013-epiphany-cc62537ebba1ba9ab31cc3da32ddf51556045caa.tar.xz gsoc2013-epiphany-cc62537ebba1ba9ab31cc3da32ddf51556045caa.tar.zst gsoc2013-epiphany-cc62537ebba1ba9ab31cc3da32ddf51556045caa.zip |
Port src/ to the new properties in EphyEmbed.
svn path=/trunk/; revision=7564
-rw-r--r-- | src/ephy-location-action.c | 2 | ||||
-rw-r--r-- | src/ephy-notebook.c | 4 | ||||
-rw-r--r-- | src/ephy-session.c | 2 | ||||
-rw-r--r-- | src/ephy-tab.h | 19 | ||||
-rw-r--r-- | src/ephy-tabs-menu.c | 3 | ||||
-rw-r--r-- | src/ephy-window.c | 73 | ||||
-rw-r--r-- | src/epiphany.defs | 63 | ||||
-rw-r--r-- | src/prefs-dialog.c | 2 | ||||
-rw-r--r-- | src/window-commands.c | 10 |
9 files changed, 50 insertions, 128 deletions
diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c index 9791f61a8..589bbeeaf 100644 --- a/src/ephy-location-action.c +++ b/src/ephy-location-action.c @@ -288,7 +288,7 @@ get_location_cb (EphyLocationEntry *entry, tab = ephy_window_get_active_tab (priv->window); g_return_val_if_fail (tab != NULL, NULL); - return g_strdup (ephy_tab_get_address (tab)); + return g_strdup (ephy_embed_get_address (ephy_tab_get_embed (tab))); } static char * diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index 5cdbebc42..5eaeaf43a 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -555,7 +555,7 @@ sync_icon (EphyTab *tab, GParamSpec *pspec, GtkImage *icon) { - gtk_image_set_from_pixbuf (icon, ephy_tab_get_icon (tab)); + gtk_image_set_from_pixbuf (icon, ephy_embed_get_icon (ephy_tab_get_embed (tab))); } static void @@ -563,7 +563,7 @@ sync_label (EphyTab *tab, GParamSpec *pspec, GtkWidget *label) { const char *title; - title = ephy_tab_get_title (ephy_tab_get_embed (tab)); + title = ephy_embed_get_title (ephy_tab_get_embed (tab)); gtk_label_set_text (GTK_LABEL (label), title); diff --git a/src/ephy-session.c b/src/ephy-session.c index 0c84eccbf..7f5c1ea7d 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -1068,7 +1068,7 @@ write_tab (xmlTextWriterPtr writer, ret = xmlTextWriterStartElement (writer, (xmlChar *) "embed"); if (ret < 0) return ret; - address = ephy_tab_get_address (tab); + address = ephy_embed_get_address (ephy_tab_get_embed (tab)); ret = xmlTextWriterWriteAttribute (writer, (xmlChar *) "url", (const xmlChar *) address); if (ret < 0) return ret; diff --git a/src/ephy-tab.h b/src/ephy-tab.h index d8317167c..46ed4c6e6 100644 --- a/src/ephy-tab.h +++ b/src/ephy-tab.h @@ -24,7 +24,6 @@ #include "ephy-embed.h" -#include <gdk-pixbuf/gdk-pixbuf.h> #include <gtk/gtkbin.h> G_BEGIN_DECLS @@ -61,20 +60,6 @@ EphyEmbed *ephy_tab_get_embed (EphyTab *tab); EphyTab *ephy_tab_for_embed (EphyEmbed *embed); -GdkPixbuf *ephy_tab_get_icon (EphyTab *tab); - -const char *ephy_tab_get_icon_address (EphyTab *tab); - -void ephy_tab_set_icon_address (EphyTab *tab, - const char *address); - -gboolean ephy_tab_get_load_status (EphyTab *tab); - -const char *ephy_tab_get_link_message (EphyTab *tab); - - -const char *ephy_tab_get_address (EphyTab *tab); - void ephy_tab_get_size (EphyTab *tab, int *width, int *height); @@ -83,10 +68,6 @@ void ephy_tab_set_size (EphyTab *tab, int width, int height); -const char *ephy_tab_get_status_message (EphyTab *tab); - -const char *ephy_tab_get_title_composite (EphyTab *tab); - /* private */ guint _ephy_tab_get_id (EphyTab *tab); diff --git a/src/ephy-tabs-menu.c b/src/ephy-tabs-menu.c index d580c4e32..5645c111b 100644 --- a/src/ephy-tabs-menu.c +++ b/src/ephy-tabs-menu.c @@ -26,6 +26,7 @@ #include "ephy-marshal.h" #include "ephy-shell.h" #include "ephy-debug.h" +#include "ephy-embed-utils.h" #include <glib/gi18n.h> #include <gtk/gtklabel.h> @@ -123,7 +124,7 @@ sync_tab_title (EphyTab *tab, { const char *title; - title = ephy_embed_get_title_composite (ephy_tab_get_embed (tab)); + title = ephy_embed_utils_get_title_composite (ephy_tab_get_embed (tab)); g_object_set (action, "label", title, NULL); } diff --git a/src/ephy-window.c b/src/ephy-window.c index 2be477879..c042f5f3d 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -31,6 +31,7 @@ #include "window-commands.h" #include "ephy-embed-shell.h" #include "ephy-embed-single.h" +#include "ephy-embed-utils.h" #include "ephy-shell.h" #include "eel-gconf-extensions.h" #include "ephy-prefs.h" @@ -1373,7 +1374,7 @@ setup_ui_manager (EphyWindow *window) } static void -sync_tab_address (EphyTab *tab, +sync_tab_address (EphyEmbed *embed, GParamSpec *pspec, EphyWindow *window) { @@ -1382,8 +1383,8 @@ sync_tab_address (EphyTab *tab, if (priv->closing) return; ephy_toolbar_set_location (priv->toolbar, - ephy_tab_get_address (tab), - ephy_tab_get_typed_address (tab)); + ephy_embed_get_address (embed), + ephy_embed_get_typed_address (embed)); ephy_find_toolbar_request_close (priv->find_toolbar); } @@ -1426,7 +1427,7 @@ sync_tab_document_type (EphyEmbed *embed, } static void -sync_tab_icon (EphyTab *tab, +sync_tab_icon (EphyEmbed *embed, GParamSpec *pspec, EphyWindow *window) { @@ -1435,7 +1436,7 @@ sync_tab_icon (EphyTab *tab, if (priv->closing) return; - icon = ephy_tab_get_icon (tab); + icon = ephy_embed_get_icon (embed); ephy_toolbar_set_favicon (priv->toolbar, icon); } @@ -1450,14 +1451,14 @@ sync_tab_load_progress (EphyEmbed *embed, GParamSpec *pspec, EphyWindow *window) } static void -sync_tab_message (EphyTab *tab, GParamSpec *pspec, EphyWindow *window) +sync_tab_message (EphyEmbed *embed, GParamSpec *pspec, EphyWindow *window) { GtkStatusbar *s = GTK_STATUSBAR (window->priv->statusbar); const char *message; if (window->priv->closing) return; - message = ephy_tab_get_status_message (tab); + message = ephy_embed_get_status_message (embed); gtk_statusbar_pop (s, window->priv->tab_message_cid); @@ -1701,7 +1702,7 @@ sync_tab_load_status (EphyEmbed *embed, } static void -sync_tab_title (EphyTab *tab, +sync_tab_title (EphyEmbed *embed, GParamSpec *pspec, EphyWindow *window) { @@ -1710,7 +1711,7 @@ sync_tab_title (EphyTab *tab, if (priv->closing) return; gtk_window_set_title (GTK_WINDOW(window), - ephy_embed_get_title_composite (ephy_tab_get_embed (tab))); + ephy_embed_utils_get_title_composite (embed)); } static void @@ -2142,23 +2143,11 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab) if (old_tab != NULL) { g_signal_handlers_disconnect_by_func (old_tab, - G_CALLBACK (sync_tab_address), - window); - g_signal_handlers_disconnect_by_func (old_tab, - G_CALLBACK (sync_tab_icon), - window); - g_signal_handlers_disconnect_by_func (old_tab, - G_CALLBACK (sync_tab_message), - window); - g_signal_handlers_disconnect_by_func (old_tab, G_CALLBACK (sync_tab_popup_windows), window); g_signal_handlers_disconnect_by_func (old_tab, G_CALLBACK (sync_tab_popups_allowed), window); - g_signal_handlers_disconnect_by_func (old_tab, - G_CALLBACK (sync_tab_title), - window); embed = ephy_tab_get_embed (old_tab); @@ -2180,6 +2169,18 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab) g_signal_handlers_disconnect_by_func (embed, G_CALLBACK (sync_tab_navigation), window); + g_signal_handlers_disconnect_by_func (embed, + G_CALLBACK (sync_tab_title), + window); + g_signal_handlers_disconnect_by_func (embed, + G_CALLBACK (sync_tab_address), + window); + g_signal_handlers_disconnect_by_func (embed, + G_CALLBACK (sync_tab_icon), + window); + g_signal_handlers_disconnect_by_func (embed, + G_CALLBACK (sync_tab_message), + window); g_signal_handlers_disconnect_by_func (embed, G_CALLBACK (tab_context_menu_cb), window); @@ -2200,33 +2201,33 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab) sync_tab_load_progress (embed, NULL, window); sync_tab_load_status (embed, NULL, window); sync_tab_navigation (embed, NULL, window); + sync_tab_title (embed, NULL, window); + sync_tab_address (embed, NULL, window); + sync_tab_icon (embed, NULL, window); + sync_tab_message (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_popup_windows (new_tab, NULL, window); sync_tab_popups_allowed (new_tab, NULL, window); - sync_tab_title (new_tab, NULL, window); - g_signal_connect_object (new_tab, "notify::address", - G_CALLBACK (sync_tab_address), - window, 0); - g_signal_connect_object (new_tab, "notify::icon", - G_CALLBACK (sync_tab_icon), - window, 0); - g_signal_connect_object (new_tab, "notify::message", - G_CALLBACK (sync_tab_message), - window, 0); g_signal_connect_object (new_tab, "notify::hidden-popup-count", G_CALLBACK (sync_tab_popup_windows), window, 0); g_signal_connect_object (new_tab, "notify::popups-allowed", G_CALLBACK (sync_tab_popups_allowed), window, 0); + g_signal_connect_object (new_tab, "notify::title", G_CALLBACK (sync_tab_title), window, 0); - + g_signal_connect_object (embed, "notify::address", + G_CALLBACK (sync_tab_address), + window, 0); + g_signal_connect_object (embed, "notify::icon", + G_CALLBACK (sync_tab_icon), + window, 0); + g_signal_connect_object (embed, "notify::message", + G_CALLBACK (sync_tab_message), + window, 0); g_signal_connect_object (embed, "notify::security-level", G_CALLBACK (sync_tab_security), window, 0); @@ -2306,7 +2307,7 @@ embed_modal_alert_cb (EphyEmbed *embed, gtk_window_present (GTK_WINDOW (window)); /* make sure the location entry shows the real URL of the tab's page */ - address = ephy_tab_get_address (tab); + address = ephy_embed_get_address (embed); ephy_toolbar_set_location (priv->toolbar, address, NULL); /* don't suppress alert */ diff --git a/src/epiphany.defs b/src/epiphany.defs index c622c8f96..1e76301b3 100644 --- a/src/epiphany.defs +++ b/src/epiphany.defs @@ -1024,7 +1024,7 @@ (define-method get_link_message (of-object "EphyEmbed") (c-name "ephy_embed_get_link_message") - (return-type "char*") + (return-type "const char*") ) (define-method get_js_status @@ -3333,55 +3333,6 @@ ) ) -(define-method get_icon - (of-object "EphyTab") - (c-name "ephy_tab_get_icon") - (return-type "GdkPixbuf*") -) - -(define-method get_icon_address - (of-object "EphyTab") - (c-name "ephy_tab_get_icon_address") - (return-type "const-char*") -) - -(define-method set_icon_address - (of-object "EphyTab") - (c-name "ephy_tab_set_icon_address") - (return-type "none") - (parameters - '("const-char*" "address") - ) -) - -(define-method get_link_message - (of-object "EphyTab") - (c-name "ephy_tab_get_link_message") - (return-type "const-char*") -) - -(define-method get_address - (of-object "EphyTab") - (c-name "ephy_tab_get_address") - (return-type "const-char*") -) - -(define-method get_typed_address - (of-object "EphyTab") - (c-name "ephy_tab_get_typed_address") - (return-type "const-char*") -) - -(define-method set_typed_address - (of-object "EphyEmbed") - (c-name "ephy_embed_set_typed_address") - (return-type "none") - (parameters - '("const-char*" "address") - '("EphyEmbedAddressExpire" "expire") - ) -) - (define-method get_size (of-object "EphyTab") (c-name "ephy_tab_get_size") @@ -3402,18 +3353,6 @@ ) ) -(define-method get_status_message - (of-object "EphyTab") - (c-name "ephy_tab_get_status_message") - (return-type "const-char*") -) - -(define-method get_title_composite - (of-object "EphyTab") - (c-name "ephy_tab_get_title_composite") - (return-type "const-char*") -) - ;; From ../../src/ephy-toolbar.h (define-function ephy_toolbar_get_type diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index 3f8d5d491..19e66fd74 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -1510,7 +1510,7 @@ prefs_homepage_current_button_clicked_cb (GtkWidget *button, tab = ephy_window_get_active_tab (window); g_return_if_fail (tab != NULL); - set_homepage_entry (dialog, ephy_tab_get_address (tab)); + set_homepage_entry (dialog, ephy_embed_get_address (ephy_tab_get_embed (tab))); } static void diff --git a/src/window-commands.c b/src/window-commands.c index d8cf7a73e..9240d286e 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -127,7 +127,7 @@ window_cmd_file_send_to (GtkAction *action, embed = ephy_window_get_active_embed (window); g_return_if_fail (embed != NULL); - location = gnome_vfs_escape_string (ephy_tab_get_address (tab)); + location = gnome_vfs_escape_string (ephy_embed_get_address (embed)); title = gnome_vfs_escape_string (ephy_embed_get_title (embed)); url = g_strconcat ("mailto:", @@ -229,8 +229,8 @@ window_cmd_file_bookmark_page (GtkAction *action, g_return_if_fail (embed != NULL); ephy_bookmarks_ui_add_bookmark (GTK_WINDOW (window), - ephy_tab_get_address (tab), - ephy_tab_get_title (tab)); + ephy_embed_get_address (embed), + ephy_embed_get_title (embed)); } static void @@ -617,7 +617,7 @@ window_cmd_view_page_source (GtkAction *action, embed = ephy_window_get_active_embed (window); g_return_if_fail (embed != NULL); - address = ephy_tab_get_address (tab); + address = ephy_embed_get_address (embed); user_time = gtk_get_current_event_time (); if (g_str_has_prefix (address, "file://")) @@ -666,7 +666,7 @@ window_cmd_edit_personal_data (GtkAction *action, tab = ephy_window_get_active_tab (window); if (tab == NULL) return; - uri = gnome_vfs_uri_new (ephy_tab_get_address (tab)); + uri = gnome_vfs_uri_new (ephy_embed_get_address (ephy_tab_get_embed (tab))); host = uri != NULL ? gnome_vfs_uri_get_host_name (uri) : NULL; |