aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2009-02-27 01:46:41 +0800
committerXan Lopez <xan@src.gnome.org>2009-02-27 01:46:41 +0800
commit026b90333c7c21998f1832c0e741937c6108d196 (patch)
tree73f1aef212e60cd678de4735147bf901f265ea63 /src
parent887bf0716e88a3dea7b6c6a60c37d59d24f652a8 (diff)
downloadgsoc2013-epiphany-026b90333c7c21998f1832c0e741937c6108d196.tar
gsoc2013-epiphany-026b90333c7c21998f1832c0e741937c6108d196.tar.gz
gsoc2013-epiphany-026b90333c7c21998f1832c0e741937c6108d196.tar.bz2
gsoc2013-epiphany-026b90333c7c21998f1832c0e741937c6108d196.tar.lz
gsoc2013-epiphany-026b90333c7c21998f1832c0e741937c6108d196.tar.xz
gsoc2013-epiphany-026b90333c7c21998f1832c0e741937c6108d196.tar.zst
gsoc2013-epiphany-026b90333c7c21998f1832c0e741937c6108d196.zip
Remove embedding APIs for set/get encoding.
Use WebKit API directly. svn path=/trunk/; revision=8817
Diffstat (limited to 'src')
-rw-r--r--src/ephy-encoding-dialog.c13
-rw-r--r--src/ephy-encoding-menu.c16
2 files changed, 22 insertions, 7 deletions
diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c
index 64a343868..fcbd1ad4d 100644
--- a/src/ephy-encoding-dialog.c
+++ b/src/ephy-encoding-dialog.c
@@ -26,6 +26,7 @@
#include "ephy-embed.h"
#include "ephy-embed-container.h"
#include "ephy-embed-shell.h"
+#include "ephy-embed-utils.h"
#include "ephy-file-helpers.h"
#include "ephy-shell.h"
#include "ephy-node.h"
@@ -36,6 +37,7 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <string.h>
+#include <webkit/webkit.h>
enum
{
@@ -85,13 +87,15 @@ sync_encoding_against_embed (EphyEncodingDialog *dialog)
GtkWidget *button;
const char *encoding;
gboolean is_automatic;
+ WebKitWebView *view;
dialog->priv->update_tag = TRUE;
embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG (dialog));
g_return_if_fail (EPHY_IS_EMBED (embed));
- encoding = ephy_embed_get_encoding (embed);
+ view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
+ encoding = webkit_web_view_get_custom_encoding (view);
if (encoding == NULL) return;
node = ephy_encodings_get_node (dialog->priv->encodings, encoding, TRUE);
@@ -194,6 +198,7 @@ activate_choice (EphyEncodingDialog *dialog)
EphyEmbed *embed;
GtkWidget *button;
gboolean is_automatic;
+ WebKitWebView *view;
embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG (dialog));
g_return_if_fail (EPHY_IS_EMBED (embed));
@@ -201,9 +206,11 @@ activate_choice (EphyEncodingDialog *dialog)
button = ephy_dialog_get_control (EPHY_DIALOG (dialog), properties[AUTOMATIC_PROP].id);
is_automatic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+ view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
+
if (is_automatic)
{
- ephy_embed_set_encoding (embed, "");
+ webkit_web_view_set_custom_encoding (view, NULL);
}
else if (dialog->priv->selected_node != NULL)
{
@@ -212,7 +219,7 @@ activate_choice (EphyEncodingDialog *dialog)
code = ephy_node_get_property_string (dialog->priv->selected_node,
EPHY_NODE_ENCODING_PROP_ENCODING);
- ephy_embed_set_encoding (embed, code);
+ webkit_web_view_set_custom_encoding (view, code);
ephy_encodings_add_recent (dialog->priv->encodings, code);
}
diff --git a/src/ephy-encoding-menu.c b/src/ephy-encoding-menu.c
index 682a22747..ea977bc46 100644
--- a/src/ephy-encoding-menu.c
+++ b/src/ephy-encoding-menu.c
@@ -28,12 +28,14 @@
#include "ephy-embed.h"
#include "ephy-embed-container.h"
#include "ephy-embed-shell.h"
+#include "ephy-embed-utils.h"
#include "ephy-shell.h"
#include "ephy-debug.h"
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <string.h>
+#include <webkit/webkit.h>
#define EPHY_ENCODING_MENU_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_ENCODING_MENU, EphyEncodingMenuPrivate))
@@ -117,6 +119,7 @@ update_encoding_menu_cb (GtkAction *dummy, EphyEncodingMenu *menu)
GList *recent, *related = NULL, *l;
EphyLanguageGroup groups;
gboolean is_automatic;
+ WebKitWebView *view;
START_PROFILER ("Rebuilding encoding menu")
@@ -130,7 +133,8 @@ update_encoding_menu_cb (GtkAction *dummy, EphyEncodingMenu *menu)
recent = ephy_encodings_get_recent (p->encodings);
embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (p->window));
- encoding = ephy_embed_get_encoding (embed);
+ view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
+ encoding = webkit_web_view_get_custom_encoding (view);
if (encoding == NULL) goto build_menu;
enc_node = ephy_encodings_get_node (p->encodings, encoding, TRUE);
@@ -228,6 +232,7 @@ static void
encoding_activate_cb (GtkAction *action, EphyEncodingMenu *menu)
{
EphyEmbed *embed;
+ WebKitWebView *view;
const char *name, *encoding;
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) == FALSE
@@ -241,7 +246,8 @@ encoding_activate_cb (GtkAction *action, EphyEncodingMenu *menu)
embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (menu->priv->window));
- ephy_embed_set_encoding (embed, encoding);
+ view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
+ webkit_web_view_set_custom_encoding (view, encoding);
ephy_encodings_add_recent (menu->priv->encodings, encoding);
}
@@ -301,6 +307,7 @@ static void
ephy_encoding_menu_automatic_cb (GtkAction *action, EphyEncodingMenu *menu)
{
EphyEmbed *embed;
+ WebKitWebView *view;
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) == FALSE
|| menu->priv->update_tag)
@@ -311,8 +318,9 @@ ephy_encoding_menu_automatic_cb (GtkAction *action, EphyEncodingMenu *menu)
embed = ephy_embed_container_get_active_child
(EPHY_EMBED_CONTAINER (menu->priv->window));
- /* setting "" will clear the forced encoding */
- ephy_embed_set_encoding (embed, "");
+ /* setting NULL will clear the forced encoding */
+ view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
+ webkit_web_view_set_custom_encoding (view, NULL);
}
static const GtkActionEntry menu_entries [] =