From 3a3ff91d5572e068b000caa2a10d9c4f3d918f2c Mon Sep 17 00:00:00 2001 From: rootavish Date: Thu, 14 Aug 2014 23:06:17 +0530 Subject: Tweaked the inverted colors,shell Makefile Tweaked the way we handle inverted colors so that documents with no "day" class tag fr their primary stylesheets can revert back to these stylesheets when prompted, the inverted colors run into problems on document reload, this needs to be fixed. Other than that I removed the webkit flags and libs from shell/Makefile.am , they were there because at a very early stage of the project I had decided to use a webkit_web_view directly, then I ended up extending and using it in libview. --- backend/epub/epub-document.c | 23 +++++++++++++++++++---- shell/Makefile.am | 4 +--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/backend/epub/epub-document.c b/backend/epub/epub-document.c index 9caa8432..da1a844e 100644 --- a/backend/epub/epub-document.c +++ b/backend/epub/epub-document.c @@ -1274,13 +1274,16 @@ change_to_night_sheet(contentListNode *nodedata,gpointer user_data) open_xml_document(filename); set_xml_root_node(NULL); xmlNodePtr head =xml_get_pointer_to_node((xmlChar*)"head",NULL,NULL); - + gchar *class = NULL; xmlretval = NULL; xml_parse_children_of_node(head,(xmlChar*)"link",(xmlChar*)"rel",(xmlChar*)"stylesheet"); xmlNodePtr day = xmlretval; + if ( (class = (gchar*)xml_get_data_from_node(day,XML_ATTRIBUTE,(xmlChar*)"class")) == NULL) { + xmlSetProp(day,(xmlChar*)"class",(xmlChar*)"day"); + } + g_free(class); xmlSetProp(day,(xmlChar*)"rel",(xmlChar*)"alternate stylesheet"); - xmlretval = NULL; xml_parse_children_of_node(head,(xmlChar*)"link",(xmlChar*)"class",(xmlChar*)"night"); xmlSetProp(xmlretval,(xmlChar*)"rel",(xmlChar*)"stylesheet"); @@ -1367,8 +1370,20 @@ epub_document_check_add_night_sheet(EvDocument *document) gchar* stylesheetfilename = epub_document_get_alternate_stylesheet((gchar*)node->value) ; if (stylesheetfilename == NULL) { - gchar *style = "body {color:rgb(255,255,255);background-color:rgb(0,0,0);text-align:justify;line-spacing:1.8; margin-top:0px;margin-bottom:4px;margin-right:50px;\ - margin-left:50px;text-indent:3em;"; + gchar *style = "body {color:rgb(255,255,255);\ + background-color:rgb(0,0,0);\ + text-align:justify;\ + line-spacing:1.8;\ + margin-top:0px;\ + margin-bottom:4px;\ + margin-right:50px;\ + margin-left:50px;\ + text-indent:3em;}\ + h1, h2, h3, h4, h5, h6\ + {color:white;\ + text-align:center;\ + font-style:italic;\ + font-weight:bold;}"; gchar *csspath = g_strdup_printf("%s/atrilnightstyle.css",epub_document->documentdir); diff --git a/shell/Makefile.am b/shell/Makefile.am index aff9fde0..cd123aad 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -20,7 +20,6 @@ AM_CPPFLAGS= \ -DATRIL_COMPILATION \ $(SHELL_CFLAGS) \ $(WARN_CFLAGS) \ - $(WEBKIT_CFLAGS) \ $(DISABLE_DEPRECATED) bin_PROGRAMS=atril @@ -110,8 +109,7 @@ atril_LDADD= \ $(top_builddir)/libdocument/libatrildocument.la \ $(top_builddir)/libview/libatrilview.la \ $(top_builddir)/libmisc/libevmisc.la \ - $(SHELL_LIBS) \ - $(WEBKIT_LIBS) + $(SHELL_LIBS) if PLATFORM_WIN32 atril_LDADD += atril-icon.o -- cgit v1.2.1