diff options
author | rootavish <[email protected]> | 2014-06-21 15:01:33 +0530 |
---|---|---|
committer | rootavish <[email protected]> | 2014-06-21 15:01:33 +0530 |
commit | e817bd447789cd670fb00b6507debfe84f8cf64f (patch) | |
tree | a5becf3393a1fbfbff864ba1fa03c53edcc65598 /shell/ev-window.c | |
parent | d57fa16e9e8c9091ebf826af94a0c3ad1a593596 (diff) | |
download | atril-e817bd447789cd670fb00b6507debfe84f8cf64f.tar.bz2 atril-e817bd447789cd670fb00b6507debfe84f8cf64f.tar.xz |
Changed dependecy to webkit-1.0,added web view to window properties
Currently the backend/epub/epub-document.c file has some dummy code, such as that for thumbnails, solely to get it to build. Now that we are done with all functions
that we would possibly need to handle the backend, I am now working now on displaying the document via a webview, starting with this commit where i add a webview to the EvWindow properties. Similar to this I need to put in custom functions for epub, as rendering is done by the layout engine. I will also need to add some epub specific callback functions to the widgets.
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r-- | shell/ev-window.c | 30 |
1 files changed, 26 insertions, 4 deletions
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", |