aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-tab.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-12-19 03:40:08 +0800
committerChristian Persch <chpe@src.gnome.org>2004-12-19 03:40:08 +0800
commit0a389e07241775316dfb866341a1a3c9f6b8a441 (patch)
tree9d96af228f87def15b797f2f8ec5151bce6439c9 /src/ephy-tab.c
parent29604a8fa8cf16a2b0e55ff6f8b9d10e57dd9be5 (diff)
downloadgsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar.gz
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar.bz2
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar.lz
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar.xz
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.tar.zst
gsoc2013-epiphany-0a389e07241775316dfb866341a1a3c9f6b8a441.zip
Disable Zoom items for images, and disable zoom, encoding and view source
2004-12-18 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-embed.c: (ephy_embed_chrome_get_type), (ephy_embed_document_type_get_type), (ephy_embed_base_init): * embed/ephy-embed.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/mozilla-embed.cpp: * src/ephy-tab.c: (ephy_tab_set_property), (ephy_tab_get_property), (ephy_tab_class_init), (ephy_tab_get_document_type), (ephy_tab_document_type_cb), (ephy_tab_init): * src/ephy-tab.h: * src/ephy-window.c: (sync_tab_document_type), (sync_tab_zoom), (ephy_window_set_active_tab): * src/toolbar.c: (toolbar_update_zoom): * src/toolbar.h: Disable Zoom items for images, and disable zoom, encoding and view source for images and xml (xul) documents. Fixes bug #132240.
Diffstat (limited to 'src/ephy-tab.c')
-rw-r--r--src/ephy-tab.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index f6e20e6d4..1cce14579 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -85,6 +85,7 @@ struct _EphyTabPrivate
GSList *hidden_popups;
GSList *shown_popups;
TabNavigationFlags nav_flags;
+ EmbedDocumentType document_type;
};
static void ephy_tab_class_init (EphyTabClass *klass);
@@ -95,6 +96,7 @@ enum
{
PROP_0,
PROP_ADDRESS,
+ PROP_DOCUMENT_TYPE,
PROP_ICON,
PROP_LOAD_PROGRESS,
PROP_LOAD_STATUS,
@@ -190,6 +192,7 @@ ephy_tab_set_property (GObject *object,
ephy_tab_set_popups_allowed
(tab, g_value_get_boolean (value));
break;
+ case PROP_DOCUMENT_TYPE:
case PROP_ICON:
case PROP_LOAD_PROGRESS:
case PROP_LOAD_STATUS:
@@ -218,6 +221,9 @@ ephy_tab_get_property (GObject *object,
case PROP_ADDRESS:
g_value_set_string (value, tab->priv->address);
break;
+ case PROP_DOCUMENT_TYPE:
+ g_value_set_enum (value, tab->priv->document_type);
+ break;
case PROP_ICON:
g_value_set_string (value, tab->priv->icon_address);
break;
@@ -352,6 +358,15 @@ ephy_tab_class_init (EphyTabClass *class)
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
+ PROP_DOCUMENT_TYPE,
+ g_param_spec_enum ("document-type",
+ "Document Type",
+ "The tab's documen type",
+ EPHY_TYPE_EMBED_DOCUMENT_TYPE,
+ EMBED_DOCUMENT_HTML,
+ G_PARAM_READABLE));
+
+ g_object_class_install_property (object_class,
PROP_ICON,
g_param_spec_string ("icon",
"Icon address",
@@ -783,6 +798,22 @@ ephy_tab_set_load_status (EphyTab *tab, gboolean status)
}
/**
+ * ephy_tab_get_document_type:
+ * @tab: an #EphyTab
+ *
+ * Returns the type of the document loaded in @tab.
+ *
+ * Return value: the #EmbedDocumentType
+ **/
+EmbedDocumentType
+ephy_tab_get_document_type (EphyTab *tab)
+{
+ g_return_val_if_fail (EPHY_IS_TAB (tab), EMBED_DOCUMENT_OTHER);
+
+ return tab->priv->document_type;
+}
+
+/**
* ephy_tab_get_load_status:
* @tab: an #EphyTab
*
@@ -1050,6 +1081,19 @@ ephy_tab_content_change_cb (EphyEmbed *embed, const char *address, EphyTab *tab)
}
static void
+ephy_tab_document_type_cb (EphyEmbed *embed,
+ EmbedDocumentType type,
+ EphyTab *tab)
+{
+ if (tab->priv->document_type != type)
+ {
+ tab->priv->document_type = type;
+g_print ("new doc type %d\n", type);
+ g_object_notify (G_OBJECT (tab), "document-type");
+ }
+}
+
+static void
ephy_tab_zoom_changed_cb (EphyEmbed *embed, float zoom, EphyTab *tab)
{
char *address;
@@ -1557,6 +1601,7 @@ ephy_tab_init (EphyTab *tab)
tab->priv->load_percent = 0;
tab->priv->load_status = FALSE;
tab->priv->security_level = STATE_IS_UNKNOWN;
+ tab->priv->document_type = EMBED_DOCUMENT_HTML;
tab->priv->zoom = 1.0;
tab->priv->address_expire = TAB_ADDRESS_EXPIRE_NOW;
@@ -1581,6 +1626,9 @@ ephy_tab_init (EphyTab *tab)
g_signal_connect_object (embed, "link_message",
G_CALLBACK (ephy_tab_link_message_cb),
tab, 0);
+ g_signal_connect_object (embed, "ge_document_type",
+ G_CALLBACK (ephy_tab_document_type_cb),
+ tab, 0);
g_signal_connect_object (embed, "ge_location",
G_CALLBACK (ephy_tab_address_cb),
tab, 0);