From 5028995e3725c264b2487a1101c22e941b04c8fd Mon Sep 17 00:00:00 2001 From: rootavish Date: Mon, 23 Jun 2014 23:42:11 +0530 Subject: Functions for document info and EvPage,other changes Summary: I added functions in the backend to get document info. Added a member to evdocument to deal with web documents(ePub) on the frontend. Added a webview to the window, that shall replace the Atril view. Due to removing the view from the main Atril window, I have given rise to various GTK-critical errors in response to signals, will be sure to suppress these in the next commit. Worked towards overall blending in of ePub documents. --- libdocument/ev-document.c | 28 ++++++++++++++++++++++++++-- libdocument/ev-document.h | 5 +++++ 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'libdocument') diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c index 19d51d9b..588d0d89 100644 --- a/libdocument/ev-document.c +++ b/libdocument/ev-document.c @@ -26,6 +26,7 @@ #include "ev-document.h" #include "synctex_parser.h" +#include "ev-file-helpers.h" #define EV_DOCUMENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EV_TYPE_DOCUMENT, EvDocumentPrivate)) @@ -141,6 +142,8 @@ ev_document_init (EvDocument *document) /* Assume all pages are the same size until proven otherwise */ document->priv->uniform = TRUE; + /* Assume that the document is not a web document*/ + document->iswebdocument = FALSE ; } static void @@ -237,6 +240,14 @@ ev_document_load (EvDocument *document, gboolean retval; GError *err = NULL; + /* + * Hardcoding a check for ePub documents, cause it needs a web document DOM + * and webkit, support for any other web document types can be added similarly. + */ + + if ( !g_strcmp0 (ev_file_get_mime_type(uri,TRUE,&err),"application/epub+zip") ) + document->iswebdocument=TRUE ; + retval = klass->load (document, uri, &err); if (!retval) { if (err) { @@ -258,16 +269,28 @@ ev_document_load (EvDocument *document, /* Cache some info about the document to avoid * going to the backends since it requires locks */ + priv->uri = g_strdup (uri); - priv->n_pages = _ev_document_get_n_pages (document); + priv->n_pages = _ev_document_get_n_pages (document); + for (i = 0; i < priv->n_pages; i++) { + + /* + * Since there is no sense of paging in an ePub,it makes no sense to have pages sizes. + * We are however geeneralising the scenario by considering epub as a type of web document. + * FIXME: Labels, or bookmarks though, can be done. + */ + if ( document->iswebdocument == TRUE ) + break; + EvPage *page = ev_document_get_page (document, i); gdouble page_width = 0; gdouble page_height = 0; EvPageSize *page_size; gchar *page_label; - + + _ev_document_get_page_size (document, page, &page_width, &page_height); if (i == 0) { @@ -277,6 +300,7 @@ ev_document_load (EvDocument *document, priv->max_height = priv->uniform_height; priv->min_width = priv->uniform_width; priv->min_height = priv->uniform_height; + } else if (priv->uniform && (priv->uniform_width != page_width || priv->uniform_height != page_height)) { diff --git a/libdocument/ev-document.h b/libdocument/ev-document.h index d10d261a..940c7c80 100644 --- a/libdocument/ev-document.h +++ b/libdocument/ev-document.h @@ -85,6 +85,11 @@ struct _EvDocument GObject base; EvDocumentPrivate *priv; + /* + * Since we can only access the members of this structure from the window frontend, + * we need a flag to detemine whether to replace the atril-view with a web-view. + */ + gboolean iswebdocument; }; struct _EvDocumentClass -- cgit v1.2.1 From e10bf9631652b8533b18a14285db89bd14b4c42e Mon Sep 17 00:00:00 2001 From: rootavish Date: Tue, 1 Jul 2014 20:29:05 +0530 Subject: 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. --- libdocument/ev-document.c | 7 +++++++ libdocument/ev-document.h | 1 + 2 files changed, 8 insertions(+) (limited to 'libdocument') diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c index 588d0d89..9353417e 100644 --- a/libdocument/ev-document.c +++ b/libdocument/ev-document.c @@ -605,6 +605,13 @@ ev_document_render (EvDocument *document, return klass->render (document, rc); } +/*gchar* +ev_web_document_render(EvDocument *document) +{ + Layout engine takes care of the rendering, so what we are essentially doing is serving pages to the webview + EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document); + klass->webkit_render(document); +}*/ const gchar * ev_document_get_uri (EvDocument *document) { diff --git a/libdocument/ev-document.h b/libdocument/ev-document.h index 940c7c80..578b0937 100644 --- a/libdocument/ev-document.h +++ b/libdocument/ev-document.h @@ -114,6 +114,7 @@ struct _EvDocumentClass EvPage *page); cairo_surface_t * (* render) (EvDocument *document, EvRenderContext *rc); +/* void * (*webkit_render) (EvDocument *document);*/ EvDocumentInfo * (* get_info) (EvDocument *document); gboolean (* get_backend_info)(EvDocument *document, EvDocumentBackendInfo *info); -- cgit v1.2.1 From 6f41c201422edd6b4dbf9f9f41b5dc29530d21c6 Mon Sep 17 00:00:00 2001 From: rootavish Date: Thu, 3 Jul 2014 20:36:55 +0530 Subject: Thumbnails for Epub Documents This commit is mainly so that any further changes can be reverted to this state. The thumbnails are of very large sizes so I need to fix that, and in general implement thumbnails. Also I am facing an X-windows error, which I can't seem to fix. I feel it may be a problem with webkit-1.0, so will try the build with gtk3 and webkit2. If so is the case, I'll have to work something out for that. Should be able to push a commit soon where the document can actually be read, soon as I figure out the perfect place for the call to load uri. Other than that more function were modified in accordance with webkit. The error I get when opening the file from the filechooser still persists, I need to fix that too. --- libdocument/ev-document.c | 48 +++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) (limited to 'libdocument') diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c index 9353417e..fee64ed1 100644 --- a/libdocument/ev-document.c +++ b/libdocument/ev-document.c @@ -281,8 +281,6 @@ ev_document_load (EvDocument *document, * We are however geeneralising the scenario by considering epub as a type of web document. * FIXME: Labels, or bookmarks though, can be done. */ - if ( document->iswebdocument == TRUE ) - break; EvPage *page = ev_document_get_page (document, i); gdouble page_width = 0; @@ -290,9 +288,15 @@ ev_document_load (EvDocument *document, EvPageSize *page_size; gchar *page_label; + if ( document->iswebdocument == FALSE ) { + _ev_document_get_page_size (document, page, &page_width, &page_height); + } + else { + //Fixed page sized to resolve the X-windowing system error. + page_width = 800; + page_height= 600; + } - _ev_document_get_page_size (document, page, &page_width, &page_height); - if (i == 0) { priv->uniform_width = page_width; priv->uniform_height = page_height; @@ -300,15 +304,21 @@ ev_document_load (EvDocument *document, priv->max_height = priv->uniform_height; priv->min_width = priv->uniform_width; priv->min_height = priv->uniform_height; - + if (document->iswebdocument == TRUE ) { + priv->page_sizes = g_new0 (EvPageSize, 1); + priv->page_sizes->width = priv->uniform_width; + priv->page_sizes->height = priv->uniform_height; + priv->uniform = TRUE ; + break; + } } else if (priv->uniform && (priv->uniform_width != page_width || priv->uniform_height != page_height)) { /* It's a different page size. Backfill the array. */ int j; - + priv->page_sizes = g_new0 (EvPageSize, priv->n_pages); - + for (j = 0; j < i; j++) { page_size = &(priv->page_sizes[j]); page_size->width = priv->uniform_width; @@ -535,15 +545,21 @@ ev_document_get_page_size (EvDocument *document, { g_return_if_fail (EV_IS_DOCUMENT (document)); g_return_if_fail (page_index >= 0 || page_index < document->priv->n_pages); - - if (width) - *width = document->priv->uniform ? - document->priv->uniform_width : - document->priv->page_sizes[page_index].width; - if (height) - *height = document->priv->uniform ? - document->priv->uniform_height : - document->priv->page_sizes[page_index].height; + if (document->iswebdocument == TRUE ) { + if (width) + *width = document->priv->uniform_width; + if (height) + *height = document->priv->uniform_height; + } else { + if (width) + *width = document->priv->uniform ? + document->priv->uniform_width : + document->priv->page_sizes[page_index].width; + if (height) + *height = document->priv->uniform ? + document->priv->uniform_height : + document->priv->page_sizes[page_index].height; + } } static gchar * -- cgit v1.2.1 From df43418e209ae9c98844185f789c63769ae9b3a2 Mon Sep 17 00:00:00 2001 From: rootavish Date: Mon, 7 Jul 2014 18:36:55 +0530 Subject: Refactored code, created a new EvWebView type Earlier my approach was to replace the atril view directly with a webview. However as it turned out it was extremely difficult to accomplish much tasks without the document-model. So I created an Extension of the WebKitWebView class, EvWebView so that now we can manipulate the webview as desired. Also having a separate file really helps in terms of clarity. Please note that there are many empty functions and TODO tags right now, I shall aim to fill these up once the display part is done, probably in this week. I also added some code on the backend to draw thumbnails when with GTK+-3.0, although I have never tested a GTK+-3.0 build.With GTK+-2.0 you won't get any build errors, however epub backend won't work right now. That being said, this commit is mostly because there was a lot of code that was lying in the local repository, and it was best to back it up as a failsafe. I modified ev-window to accomodate this new data structure, and having an equivalent ev_web_view function for every ev_view function, I can achieve most functionality by filling those functions with Webkit modules. Other than that on the backend Other than that there were some minor changes to the code. Although I did the above, currently I am not able to instantiate the EvWebView because of some class and object type definition errors, due to which I can't display the document. --- libdocument/ev-document.c | 7 ------- libdocument/ev-document.h | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'libdocument') diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c index fee64ed1..a242bdf6 100644 --- a/libdocument/ev-document.c +++ b/libdocument/ev-document.c @@ -621,13 +621,6 @@ ev_document_render (EvDocument *document, return klass->render (document, rc); } -/*gchar* -ev_web_document_render(EvDocument *document) -{ - Layout engine takes care of the rendering, so what we are essentially doing is serving pages to the webview - EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS (document); - klass->webkit_render(document); -}*/ const gchar * ev_document_get_uri (EvDocument *document) { diff --git a/libdocument/ev-document.h b/libdocument/ev-document.h index 578b0937..fe2fd628 100644 --- a/libdocument/ev-document.h +++ b/libdocument/ev-document.h @@ -85,7 +85,7 @@ struct _EvDocument GObject base; EvDocumentPrivate *priv; - /* + /* * Since we can only access the members of this structure from the window frontend, * we need a flag to detemine whether to replace the atril-view with a web-view. */ -- cgit v1.2.1 From 46fce038996fa84784df775d0b2e941228388b66 Mon Sep 17 00:00:00 2001 From: rootavish Date: Sat, 19 Jul 2014 10:47:43 +0530 Subject: Thumbnails for all documents Now other problems with webkit. After much fidgeting I was able to resolve the previous problems of threads. However, now there is a different webkit error. --- libdocument/ev-document-thumbnails.c | 10 ++++++++++ libdocument/ev-document-thumbnails.h | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'libdocument') diff --git a/libdocument/ev-document-thumbnails.c b/libdocument/ev-document-thumbnails.c index 9482e09e..61eb2fe8 100644 --- a/libdocument/ev-document-thumbnails.c +++ b/libdocument/ev-document-thumbnails.c @@ -61,3 +61,13 @@ ev_document_thumbnails_get_dimensions (EvDocumentThumbnails *document, iface->get_dimensions (document, rc, width, height); } +GtkWidget* +ev_document_thumbnails_get_webview_with_rendered_document(EvDocumentThumbnails *document, + gchar *webpageuri) +{ + EvDocumentThumbnailsInterface *iface; + g_return_val_if_fail (EV_IS_DOCUMENT_THUMBNAILS (document),NULL); + + iface = EV_DOCUMENT_THUMBNAILS_GET_IFACE(document); + return iface->render_in_webview(webpageuri); +} \ No newline at end of file diff --git a/libdocument/ev-document-thumbnails.h b/libdocument/ev-document-thumbnails.h index 1a7cb9fd..a94a810d 100644 --- a/libdocument/ev-document-thumbnails.h +++ b/libdocument/ev-document-thumbnails.h @@ -26,7 +26,7 @@ #define EV_DOCUMENT_THUMBNAILS_H #include - +#include #include "ev-render-context.h" G_BEGIN_DECLS @@ -52,6 +52,8 @@ struct _EvDocumentThumbnailsInterface { EvRenderContext *rc, gint *width, gint *height); + + GtkWidget *(*render_in_webview) (gchar* webpage); }; GType ev_document_thumbnails_get_type (void) G_GNUC_CONST; @@ -63,7 +65,8 @@ void ev_document_thumbnails_get_dimensions (EvDocumentThumbnails *document EvRenderContext *rc, gint *width, gint *height); - +GtkWidget* ev_document_thumbnails_get_webview_with_rendered_document (EvDocumentThumbnails *document, + gchar* webpageuri); G_END_DECLS #endif /* EV_DOCUMENT_THUMBNAILS_H */ -- cgit v1.2.1 From e0535b0e61cc56ec62d32518c03a42836f5256e6 Mon Sep 17 00:00:00 2001 From: rootavish Date: Sat, 19 Jul 2014 22:18:40 +0530 Subject: Moving all webkit tasks to main loop jobs --- libdocument/ev-document-thumbnails.c | 11 ----------- libdocument/ev-document-thumbnails.h | 3 --- 2 files changed, 14 deletions(-) (limited to 'libdocument') diff --git a/libdocument/ev-document-thumbnails.c b/libdocument/ev-document-thumbnails.c index 61eb2fe8..65248683 100644 --- a/libdocument/ev-document-thumbnails.c +++ b/libdocument/ev-document-thumbnails.c @@ -59,15 +59,4 @@ ev_document_thumbnails_get_dimensions (EvDocumentThumbnails *document, iface = EV_DOCUMENT_THUMBNAILS_GET_IFACE (document); iface->get_dimensions (document, rc, width, height); -} - -GtkWidget* -ev_document_thumbnails_get_webview_with_rendered_document(EvDocumentThumbnails *document, - gchar *webpageuri) -{ - EvDocumentThumbnailsInterface *iface; - g_return_val_if_fail (EV_IS_DOCUMENT_THUMBNAILS (document),NULL); - - iface = EV_DOCUMENT_THUMBNAILS_GET_IFACE(document); - return iface->render_in_webview(webpageuri); } \ No newline at end of file diff --git a/libdocument/ev-document-thumbnails.h b/libdocument/ev-document-thumbnails.h index a94a810d..5f425ef0 100644 --- a/libdocument/ev-document-thumbnails.h +++ b/libdocument/ev-document-thumbnails.h @@ -53,7 +53,6 @@ struct _EvDocumentThumbnailsInterface { gint *width, gint *height); - GtkWidget *(*render_in_webview) (gchar* webpage); }; GType ev_document_thumbnails_get_type (void) G_GNUC_CONST; @@ -65,8 +64,6 @@ void ev_document_thumbnails_get_dimensions (EvDocumentThumbnails *document EvRenderContext *rc, gint *width, gint *height); -GtkWidget* ev_document_thumbnails_get_webview_with_rendered_document (EvDocumentThumbnails *document, - gchar* webpageuri); G_END_DECLS #endif /* EV_DOCUMENT_THUMBNAILS_H */ -- cgit v1.2.1 From 60b002aab6c2ee610377d46208ee16dda1e94fc3 Mon Sep 17 00:00:00 2001 From: rootavish Date: Tue, 29 Jul 2014 19:57:02 +0530 Subject: Searching single pages in epub ..and other fixing other bugs that were present once the webview was added, like the escape key command etc. Will look to refactor the thumbnails into ev-web-view.c. In the next commit I'll extend this search over the entire document.Also will incorporate document index(table of contents). --- libdocument/ev-document-find.c | 9 +++++++++ libdocument/ev-document-find.h | 9 +++++++++ 2 files changed, 18 insertions(+) (limited to 'libdocument') diff --git a/libdocument/ev-document-find.c b/libdocument/ev-document-find.c index 0b5fac01..c22b913d 100644 --- a/libdocument/ev-document-find.c +++ b/libdocument/ev-document-find.c @@ -40,3 +40,12 @@ ev_document_find_find_text (EvDocumentFind *document_find, return iface->find_text (document_find, page, text, case_sensitive); } +gboolean +ev_document_find_check_for_hits(EvDocumentFind *document_find, + EvPage *page, + const gchar *text, + gboolean case_sensitive) +{ + EvDocumentFindInterface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find); + return iface->check_for_hits (document_find, page, text, case_sensitive); +} \ No newline at end of file diff --git a/libdocument/ev-document-find.h b/libdocument/ev-document-find.h index 7fcf49c7..7fb5d22c 100644 --- a/libdocument/ev-document-find.h +++ b/libdocument/ev-document-find.h @@ -52,6 +52,11 @@ struct _EvDocumentFindInterface EvPage *page, const gchar *text, gboolean case_sensitive); + + gboolean (* check_for_hits)(EvDocumentFind *document_find, + EvPage *page, + const gchar *text, + gboolean case_sensitive); }; GType ev_document_find_get_type (void) G_GNUC_CONST; @@ -60,6 +65,10 @@ GList *ev_document_find_find_text (EvDocumentFind *document_find, const gchar *text, gboolean case_sensitive); +gboolean ev_document_find_check_for_hits(EvDocumentFind *document_find, + EvPage *page, + const gchar *text, + gboolean case_sensitive); G_END_DECLS #endif /* EV_DOCUMENT_FIND_H */ -- cgit v1.2.1 From 5f3f572777cfcb64a92a4671fb2aff5faa5cefa4 Mon Sep 17 00:00:00 2001 From: rootavish Date: Sun, 3 Aug 2014 12:23:21 +0530 Subject: Table of contents(index) for epub The documents can finally be read alongside a TOC, I tested it with a variety of documents before this commit, so I presume it should work with all. Also fixed the part where I had screwed up PDF annotations owing to a wrong call. In the next commit, fully functional searching would be up, using HTML parser of libxml in combination with webkit. Also some other minor changes. --- libdocument/ev-document.h | 1 - libdocument/ev-link-dest.c | 10 ++++++++++ libdocument/ev-link-dest.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'libdocument') diff --git a/libdocument/ev-document.h b/libdocument/ev-document.h index fe2fd628..24e31912 100644 --- a/libdocument/ev-document.h +++ b/libdocument/ev-document.h @@ -114,7 +114,6 @@ struct _EvDocumentClass EvPage *page); cairo_surface_t * (* render) (EvDocument *document, EvRenderContext *rc); -/* void * (*webkit_render) (EvDocument *document);*/ EvDocumentInfo * (* get_info) (EvDocument *document); gboolean (* get_backend_info)(EvDocument *document, EvDocumentBackendInfo *info); diff --git a/libdocument/ev-link-dest.c b/libdocument/ev-link-dest.c index 62f2cd47..b9ea0dfd 100644 --- a/libdocument/ev-link-dest.c +++ b/libdocument/ev-link-dest.c @@ -509,3 +509,13 @@ ev_link_dest_new_page_label (const gchar *page_label) "type", EV_LINK_DEST_TYPE_PAGE_LABEL, NULL)); } + +EvLinkDest * +ev_link_dest_new_hlink(const gchar* hlink,gint page) +{ + return EV_LINK_DEST(g_object_new(EV_TYPE_LINK_DEST, + "named",hlink, + "page",page, + "type", EV_LINK_DEST_TYPE_HLINK, + NULL)); +} \ No newline at end of file diff --git a/libdocument/ev-link-dest.h b/libdocument/ev-link-dest.h index a0e2539f..dd1f10a1 100644 --- a/libdocument/ev-link-dest.h +++ b/libdocument/ev-link-dest.h @@ -49,6 +49,7 @@ typedef enum { EV_LINK_DEST_TYPE_FITR, EV_LINK_DEST_TYPE_NAMED, EV_LINK_DEST_TYPE_PAGE_LABEL, + EV_LINK_DEST_TYPE_HLINK, EV_LINK_DEST_TYPE_UNKNOWN } EvLinkDestType; @@ -89,6 +90,7 @@ EvLinkDest *ev_link_dest_new_fitr (gint page, gdouble top); EvLinkDest *ev_link_dest_new_named (const gchar *named_dest); EvLinkDest *ev_link_dest_new_page_label (const gchar *page_label); +EvLinkDest *ev_link_dest_new_hlink (const gchar* hlink,gint page); G_END_DECLS -- cgit v1.2.1 From 56880392a6678ccec12bbec016939597acd49b07 Mon Sep 17 00:00:00 2001 From: rootavish Date: Wed, 6 Aug 2014 15:34:02 +0530 Subject: Searching in epub documents I added the capability to search through documents. The search is quite buggy, and we'll be taking care of each bug one at a time. --- libdocument/ev-document-find.c | 2 +- libdocument/ev-document-find.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'libdocument') diff --git a/libdocument/ev-document-find.c b/libdocument/ev-document-find.c index c22b913d..92dfffe5 100644 --- a/libdocument/ev-document-find.c +++ b/libdocument/ev-document-find.c @@ -40,7 +40,7 @@ ev_document_find_find_text (EvDocumentFind *document_find, return iface->find_text (document_find, page, text, case_sensitive); } -gboolean +guint ev_document_find_check_for_hits(EvDocumentFind *document_find, EvPage *page, const gchar *text, diff --git a/libdocument/ev-document-find.h b/libdocument/ev-document-find.h index 7fb5d22c..2b6ba68b 100644 --- a/libdocument/ev-document-find.h +++ b/libdocument/ev-document-find.h @@ -53,7 +53,7 @@ struct _EvDocumentFindInterface const gchar *text, gboolean case_sensitive); - gboolean (* check_for_hits)(EvDocumentFind *document_find, + guint (* check_for_hits) (EvDocumentFind *document_find, EvPage *page, const gchar *text, gboolean case_sensitive); @@ -65,7 +65,7 @@ GList *ev_document_find_find_text (EvDocumentFind *document_find, const gchar *text, gboolean case_sensitive); -gboolean ev_document_find_check_for_hits(EvDocumentFind *document_find, +guint ev_document_find_check_for_hits (EvDocumentFind *document_find, EvPage *page, const gchar *text, gboolean case_sensitive); -- cgit v1.2.1 From 700637ca1dd675ce18f2e9e56387dab86020a623 Mon Sep 17 00:00:00 2001 From: rootavish Date: Thu, 14 Aug 2014 07:41:35 +0530 Subject: Inverted colors(night) viewing mode for ePub Added the capability to view and epub document with inverted colors, yet to test for documents where we write the stylesheet, although the code is there. --- libdocument/ev-document.c | 14 ++++++++++++++ libdocument/ev-document.h | 5 +++++ 2 files changed, 19 insertions(+) (limited to 'libdocument') diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c index a242bdf6..667f89f1 100644 --- a/libdocument/ev-document.c +++ b/libdocument/ev-document.c @@ -910,3 +910,17 @@ ev_rect_cmp (EvRectangle *a, (ABS (a->x2 - b->x2) < EPSILON) && (ABS (a->y2 - b->y2) < EPSILON)); } + +void +ev_document_toggle_night_mode(EvDocument *document,gboolean night) +{ + EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS(document); + return klass->toggle_night_mode(document,night) ; +} + +void +ev_document_check_add_night_sheet(EvDocument *document) +{ + EvDocumentClass *klass = EV_DOCUMENT_GET_CLASS(document); + return klass->check_add_night_sheet(document) ; +} \ No newline at end of file diff --git a/libdocument/ev-document.h b/libdocument/ev-document.h index 24e31912..46a0971c 100644 --- a/libdocument/ev-document.h +++ b/libdocument/ev-document.h @@ -118,6 +118,9 @@ struct _EvDocumentClass gboolean (* get_backend_info)(EvDocument *document, EvDocumentBackendInfo *info); gboolean (* support_synctex) (EvDocument *document); + + void (* toggle_night_mode) (EvDocument *document,gboolean night); + void (*check_add_night_sheet)(EvDocument *document); }; GType ev_document_get_type (void) G_GNUC_CONST; @@ -184,6 +187,8 @@ EvMapping *ev_document_synctex_forward_search gint ev_rect_cmp (EvRectangle *a, EvRectangle *b); +void ev_document_toggle_night_mode (EvDocument *document,gboolean night); +void ev_document_check_add_night_sheet (EvDocument *document); #define EV_TYPE_RECTANGLE (ev_rectangle_get_type ()) struct _EvRectangle -- cgit v1.2.1 From 17377df48abdf10b6a064d6afdc1a4c95441ae20 Mon Sep 17 00:00:00 2001 From: rootavish Date: Tue, 19 Aug 2014 00:16:41 +0530 Subject: Mathjax Support The Mathjax files will be installed to $(backenddir)/epub/MathJax This was as small as the install got. --- libdocument/ev-backends-manager.c | 13 +++++++++++++ libdocument/ev-backends-manager.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'libdocument') diff --git a/libdocument/ev-backends-manager.c b/libdocument/ev-backends-manager.c index dd62642d..74fc09a0 100644 --- a/libdocument/ev-backends-manager.c +++ b/libdocument/ev-backends-manager.c @@ -63,6 +63,19 @@ backends_dir (void) return backendsdir; } +gchar* +ev_backends_manager_get_backends_dir(void) +{ + gchar *retval; + if (!backendsdir) { + retval = backends_dir(); + } + else { + retval = backendsdir; + } + return retval; +} + static void ev_backend_info_free (EvBackendInfo *info) { diff --git a/libdocument/ev-backends-manager.h b/libdocument/ev-backends-manager.h index 42f597ee..1d660eac 100644 --- a/libdocument/ev-backends-manager.h +++ b/libdocument/ev-backends-manager.h @@ -42,7 +42,7 @@ EvDocument *ev_backends_manager_get_document (const gchar *mime_typ const gchar *ev_backends_manager_get_document_module_name (EvDocument *document); EvTypeInfo *ev_backends_manager_get_document_type_info (EvDocument *document); GList *ev_backends_manager_get_all_types_info (void); - +gchar *ev_backends_manager_get_backends_dir (void); G_END_DECLS #endif /* EV_BACKENDS_MANAGER */ -- cgit v1.2.1