summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/Makefile.am4
-rw-r--r--shell/ev-window.c30
2 files changed, 29 insertions, 5 deletions
diff --git a/shell/Makefile.am b/shell/Makefile.am
index cd123aad..aff9fde0 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -20,6 +20,7 @@ AM_CPPFLAGS= \
-DATRIL_COMPILATION \
$(SHELL_CFLAGS) \
$(WARN_CFLAGS) \
+ $(WEBKIT_CFLAGS) \
$(DISABLE_DEPRECATED)
bin_PROGRAMS=atril
@@ -109,7 +110,8 @@ atril_LDADD= \
$(top_builddir)/libdocument/libatrildocument.la \
$(top_builddir)/libview/libatrilview.la \
$(top_builddir)/libmisc/libevmisc.la \
- $(SHELL_LIBS)
+ $(SHELL_LIBS) \
+ $(WEBKIT_LIBS)
if PLATFORM_WIN32
atril_LDADD += atril-icon.o
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 5b046ae7..9219a7cb 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -99,6 +99,9 @@
#include "ev-media-player-keys.h"
#endif /* ENABLE_DBUS */
+#ifdef ENABLE_EPUB
+#include <webkit/webkit.h>
+#endif
typedef enum {
PAGE_MODE_DOCUMENT,
PAGE_MODE_PASSWORD
@@ -141,7 +144,9 @@ struct _EvWindowPrivate {
GtkWidget *sidebar_attachments;
GtkWidget *sidebar_layers;
GtkWidget *sidebar_annots;
-
+#ifdef ENABLE_EPUB
+ GtkWidget *web_view ;
+#endif
/* Settings */
GSettings *settings;
GSettings *default_settings;
@@ -5294,6 +5299,12 @@ ev_window_dispose (GObject *object)
priv->view = NULL;
}
+#ifdef ENABLE_EPUB
+ if ( priv->web_view ) {
+ g_object_unref (priv->web_view);
+ priv->web_view = NULL ;
+ }
+#endif
if (priv->password_view) {
g_object_unref (priv->password_view);
priv->password_view = NULL;
@@ -7019,6 +7030,9 @@ ev_window_init (EvWindow *ev_window)
gtk_widget_show (ev_window->priv->view_box);
ev_window->priv->view = ev_view_new ();
+#ifdef ENABLE_EPUB
+ ev_window->priv->web_view = webkit_web_view_new () ;
+#endif
ev_view_set_page_cache_size (EV_VIEW (ev_window->priv->view), PAGE_CACHE_SIZE);
ev_view_set_model (EV_VIEW (ev_window->priv->view), ev_window->priv->model);
@@ -7065,10 +7079,18 @@ ev_window_init (EvWindow *ev_window)
/* We own a ref on these widgets, as we can swap them in and out */
g_object_ref (ev_window->priv->view);
g_object_ref (ev_window->priv->password_view);
-
- gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window),
+#ifdef ENABLE_EPUB
+ if (0)
+ {
+ gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window),
+ ev_window->priv->web_view);
+ }
+ else
+#endif
+ {
+ gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window),
ev_window->priv->view);
-
+ }
/* Connect to model signals */
g_signal_connect_swapped (ev_window->priv->model,
"page-changed",