From 0a4d3f34a8aee74019759ace24f84672a98122b4 Mon Sep 17 00:00:00 2001 From: rootavish Date: Sat, 24 May 2014 05:38:31 +0530 Subject: XML parsing for ePub using libxml some functions were written which will be used to get keywords,attributes from files such as the ePub container.tried to keep the code generalised so as to facilitate reusability of code. --- backend/epub/epub-document.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 backend/epub/epub-document.h (limited to 'backend/epub/epub-document.h') diff --git a/backend/epub/epub-document.h b/backend/epub/epub-document.h new file mode 100644 index 00000000..157ced04 --- /dev/null +++ b/backend/epub/epub-document.h @@ -0,0 +1,25 @@ +#include +#include +#include +#include + +typedef enum +{ + xmlattribute, + xmlkeyword +}XMLparsereturntype; + +gboolean openXmlDocument ( const gchar* filename ); + +gboolean checkRoot (xmlChar* rootname); + +void parseChildren (xmlNodePtr parent, + xmlChar* parserfor, + XMLparsereturntype rettype, + xmlChar* attributename ); + +xmlChar* parseXMLchildren (xmlChar* parserfor, + XMLparsereturntype rettype, + xmlChar* attributename ); + +void xmlFreeAll(); \ No newline at end of file -- cgit v1.2.1 From 070a26ed403e9a0c330ee7901c5b85394317ef77 Mon Sep 17 00:00:00 2001 From: rootavish Date: Fri, 30 May 2014 00:11:14 +0530 Subject: Added functions to extract epub archive,fixed header In this commit i added functionality to extract an epub archive to a temporary location.Again i tried to keep the design modular. This will be changed as changes come along. I also fixed the header to the standard atril backend header. Performed some code cleaning, naming functions as in the atril style of coding. --- backend/epub/epub-document.h | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'backend/epub/epub-document.h') diff --git a/backend/epub/epub-document.h b/backend/epub/epub-document.h index 157ced04..4b57e178 100644 --- a/backend/epub/epub-document.h +++ b/backend/epub/epub-document.h @@ -1,25 +1,20 @@ -#include -#include -#include -#include +#ifndef __EPUB_DOCUMENT_H__ +#define __EPUB_DOCUMENT_H__ -typedef enum -{ - xmlattribute, - xmlkeyword -}XMLparsereturntype; +#include "ev-document.h" -gboolean openXmlDocument ( const gchar* filename ); +G_BEGIN_DECLS -gboolean checkRoot (xmlChar* rootname); +#define EPUB_TYPE_DOCUMENT (EPUB_document_get_type ()) +#define EPUB_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPUB_TYPE_DOCUMENT, ePubDocument)) +#define EPUB_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPUB_TYPE_DOCUMENT)) -void parseChildren (xmlNodePtr parent, - xmlChar* parserfor, - XMLparsereturntype rettype, - xmlChar* attributename ); +typedef struct _ePubDocument ePubDocument; -xmlChar* parseXMLchildren (xmlChar* parserfor, - XMLparsereturntype rettype, - xmlChar* attributename ); +GType ePub_document_get_type (void) G_GNUC_CONST; -void xmlFreeAll(); \ No newline at end of file +G_MODULE_EXPORT GType register_atril_backend (GTypeModule *module); + +G_END_DECLS + +#endif /* __EPUB_DOCUMENT_H__ */ -- cgit v1.2.1 From 7f33c3425aae32d1dd5d2d7b912f8d4eac1cf85d Mon Sep 17 00:00:00 2001 From: rootavish Date: Fri, 30 May 2014 16:31:46 +0530 Subject: created a separate directory for minizip content, fixed indentation in configure.ac Moved ioapi.c unzip.c unzip.h and ioapi.h into a separate directory backend/epub/minizip Fixed an indentation problem in configure.ac, which was affecting the displayed result. Also fixed a typo in epub-document.h where i had wrongly named the function. --- backend/epub/epub-document.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend/epub/epub-document.h') diff --git a/backend/epub/epub-document.h b/backend/epub/epub-document.h index 4b57e178..5fff2514 100644 --- a/backend/epub/epub-document.h +++ b/backend/epub/epub-document.h @@ -5,7 +5,7 @@ G_BEGIN_DECLS -#define EPUB_TYPE_DOCUMENT (EPUB_document_get_type ()) +#define EPUB_TYPE_DOCUMENT (epub_document_get_type ()) #define EPUB_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPUB_TYPE_DOCUMENT, ePubDocument)) #define EPUB_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPUB_TYPE_DOCUMENT)) -- cgit v1.2.1 From 3fd3e5708b0566b1392fa5e7f37a18de137a43e0 Mon Sep 17 00:00:00 2001 From: rootavish Date: Sat, 7 Jun 2014 05:38:54 +0530 Subject: Redefined most XML parsing functions,more helpers This commit as compared to previous ones has much more changes as: > The xml parsing functions were not generic enough to my needs and needed to be redefined as well as renamed . > I also set up the document tree for the document using these parsers.All that is now left is to serve these to a webview. > Fixed a typo in epub-document.h TODO: integrate with Atril frontend. --- backend/epub/epub-document.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend/epub/epub-document.h') diff --git a/backend/epub/epub-document.h b/backend/epub/epub-document.h index 5fff2514..db9c99e5 100644 --- a/backend/epub/epub-document.h +++ b/backend/epub/epub-document.h @@ -11,7 +11,7 @@ G_BEGIN_DECLS typedef struct _ePubDocument ePubDocument; -GType ePub_document_get_type (void) G_GNUC_CONST; +GType epub_document_get_type (void) G_GNUC_CONST; G_MODULE_EXPORT GType register_atril_backend (GTypeModule *module); -- cgit v1.2.1 From d57fa16e9e8c9091ebf826af94a0c3ad1a593596 Mon Sep 17 00:00:00 2001 From: rootavish Date: Thu, 19 Jun 2014 14:19:48 +0530 Subject: Epub backend builds as a part of Atril compilation Fixed a tabbing error in backend/Makefile.am due to which the epub backend was not a target when building recursilvely, i am not commiting the changes to epub-document.c as currently it will break the build, hope to fix it and get webkit and mathjax done by the weekend. Also fixed an error in configure.ac wherin the appearance of AM_LIBTOOL_PROG before AC_CXX_PROG caused a "link:unsupported hardcode properties error" on Linux Mint. --- backend/epub/epub-document.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backend/epub/epub-document.h') diff --git a/backend/epub/epub-document.h b/backend/epub/epub-document.h index db9c99e5..c9fd760d 100644 --- a/backend/epub/epub-document.h +++ b/backend/epub/epub-document.h @@ -6,10 +6,10 @@ G_BEGIN_DECLS #define EPUB_TYPE_DOCUMENT (epub_document_get_type ()) -#define EPUB_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPUB_TYPE_DOCUMENT, ePubDocument)) +#define EPUB_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPUB_TYPE_DOCUMENT, EpubDocument)) #define EPUB_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPUB_TYPE_DOCUMENT)) -typedef struct _ePubDocument ePubDocument; +typedef struct _EpubDocument EpubDocument; GType epub_document_get_type (void) G_GNUC_CONST; -- 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). --- backend/epub/epub-document.h | 1 + 1 file changed, 1 insertion(+) (limited to 'backend/epub/epub-document.h') diff --git a/backend/epub/epub-document.h b/backend/epub/epub-document.h index c9fd760d..b1120ec7 100644 --- a/backend/epub/epub-document.h +++ b/backend/epub/epub-document.h @@ -1,6 +1,7 @@ #ifndef __EPUB_DOCUMENT_H__ #define __EPUB_DOCUMENT_H__ +#define _GNU_SOURCE #include "ev-document.h" G_BEGIN_DECLS -- cgit v1.2.1