summaryrefslogtreecommitdiff
path: root/libview
diff options
context:
space:
mode:
authorrootavish <[email protected]>2014-07-01 20:29:05 +0530
committerrootavish <[email protected]>2014-07-01 20:29:05 +0530
commite10bf9631652b8533b18a14285db89bd14b4c42e (patch)
treea0a9c36c3712a3e0d3b0a548a2b2a1bb08e6060d /libview
parent5028995e3725c264b2487a1101c22e941b04c8fd (diff)
downloadatril-e10bf9631652b8533b18a14285db89bd14b4c42e.tar.bz2
atril-e10bf9631652b8533b18a14285db89bd14b4c42e.tar.xz
More changes to accomodate webview
- Modified configure.ac to use both webkit2 and webkit1 based on gtk version - Modified Automake file in help/reference/shell/Makefile.am to compile with gtk-doc - Modified ev-document-model to support epub-documents. - Modified ev-window for epub documents. - Modified jobs so epub pages are not rendered. - Modified ev-document, although I'm not sure if this is necessary. Still need to figure out where the web view load uri has to be called to actually load pages, from there the puzzle would be much simpler. Hope to get this done in the week, and pick up the pace now that only six weeks of coding remain before final evaluation.
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-document-model.c27
-rw-r--r--libview/ev-document-model.h4
-rw-r--r--libview/ev-jobs.c18
3 files changed, 45 insertions, 4 deletions
diff --git a/libview/ev-document-model.c b/libview/ev-document-model.c
index 403df466..00ce782b 100644
--- a/libview/ev-document-model.c
+++ b/libview/ev-document-model.c
@@ -106,10 +106,22 @@ ev_document_model_set_property (GObject *object,
ev_document_model_set_page (model, g_value_get_int (value));
break;
case PROP_ROTATION:
- ev_document_model_set_rotation (model, g_value_get_int (value));
- break;
+ {
+ if ( model->document->iswebdocument == TRUE ) {
+ model->rotation=0;
+ }
+ else {
+ ev_document_model_set_rotation (model, g_value_get_int (value));
+ }
+ break;
+ }
case PROP_INVERTED_COLORS:
- ev_document_model_set_inverted_colors (model, g_value_get_boolean (value));
+ if ( model->document->iswebdocument == TRUE ) {
+ atril_web_document_set_inverted_colors(model,g_value_get_boolean(value));
+ }
+ else {
+ ev_document_model_set_inverted_colors (model, g_value_get_boolean (value));
+ }
break;
case PROP_SCALE:
ev_document_model_set_scale (model, g_value_get_double (value));
@@ -490,6 +502,15 @@ ev_document_model_set_inverted_colors (EvDocumentModel *model,
g_object_notify (G_OBJECT (model), "inverted-colors");
}
+void
+atril_web_document_set_inverted_colors (EvDocumentModel *model,
+ gboolean inverted_colors)
+{
+ //TODO
+ model->inverted_colors = FALSE;
+ g_object_notify (G_OBJECT (model), "inverted-colors");
+}
+
gboolean
ev_document_model_get_inverted_colors (EvDocumentModel *model)
{
diff --git a/libview/ev-document-model.h b/libview/ev-document-model.h
index b8bea62c..f9d175c0 100644
--- a/libview/ev-document-model.h
+++ b/libview/ev-document-model.h
@@ -69,7 +69,9 @@ EvSizingMode ev_document_model_get_sizing_mode (EvDocumentModel *model);
void ev_document_model_set_rotation (EvDocumentModel *model,
gint rotation);
gint ev_document_model_get_rotation (EvDocumentModel *model);
-void ev_document_model_set_inverted_colors (EvDocumentModel *model,
+void ev_document_model_set_inverted_colors (EvDocumentModel *model,
+ gboolean inverted_colors);
+void atril_web_document_set_inverted_colors(EvDocumentModel *model,
gboolean inverted_colors);
gboolean ev_document_model_get_inverted_colors (EvDocumentModel *model);
void ev_document_model_set_continuous (EvDocumentModel *model,
diff --git a/libview/ev-jobs.c b/libview/ev-jobs.c
index d8d3043d..76e183a1 100644
--- a/libview/ev-jobs.c
+++ b/libview/ev-jobs.c
@@ -568,6 +568,24 @@ ev_job_render_run (EvJob *job)
ev_document_fc_mutex_lock ();
ev_page = ev_document_get_page (job->document, job_render->page);
+
+ if ( job->document->iswebdocument == TRUE )
+ {
+ return TRUE;
+
+ if (g_cancellable_is_cancelled (job->cancellable)) {
+ ev_document_fc_mutex_unlock ();
+ ev_document_doc_mutex_unlock ();
+ g_object_unref (rc);
+
+ return FALSE;
+ }
+
+ ev_document_fc_mutex_unlock ();
+ ev_document_doc_mutex_unlock ();
+ ev_job_succeeded (job);
+ return FALSE;
+ }
rc = ev_render_context_new (ev_page, job_render->rotation, job_render->scale);
g_object_unref (ev_page);