Enlightenment CVS committal

Author  : doursse
Project : e17
Module  : proto

Dir     : e17/proto/epdf/src/lib


Modified Files:
        Makefile.am etk_pdf.c poppler_document.cpp poppler_index.cpp 
        poppler_page.cpp poppler_page_transition.cpp 
        poppler_postscript.cpp 


Log Message:
update to new etk and ewl api, use newest source of poppler, move ewl plugin to 
its own dir, add epsilon plugin to remove circular dependancy between epdf, 
epsilon and ewl, various fixes

===================================================================
RCS file: /cvs/e/e17/proto/epdf/src/lib/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- Makefile.am 23 Apr 2006 23:07:18 -0000      1.4
+++ Makefile.am 7 Jul 2007 16:12:09 -0000       1.5
@@ -13,7 +13,7 @@
 
 INCLUDES =                     \
 -I. -I$(top_srcdir)/src/lib    \
[EMAIL PROTECTED]@ @ECORE_CFLAGS@ @EWL_CFLAGS@ @ETK_CFLAGS@ @POPPLER_CFLAGS@
[EMAIL PROTECTED]@ @ETK_CFLAGS@ @EPDF_CFLAGS@
 
 lib_LTLIBRARIES = libepdf.la
 
@@ -41,12 +41,12 @@
 poppler_page_transition.cpp \
 poppler_postscript.cpp \
 esmart_pdf.c \
-$(EPDF_EWL_WIDGET) \
-$(EPDF_ETK_WIDGET) \
 $(EPDFHEADERS) \
-poppler_private.h
+poppler_private.h \
+$(EPDF_EWL_WIDGET) \
+$(EPDF_ETK_WIDGET)
 
 installed_headersdir = $(prefix)/include/epdf
 installed_headers_DATA = $(EPDFHEADERS)
 
-libepdf_la_LIBADD = @POPPLER_LIBS@ @ETK_LIBS@ @EWL_LIBS@ @ECORE_LIBS@ 
@EVAS_LIBS@
+libepdf_la_LIBADD = @ETK_LIBS@ @EWL_LIBS@ @EPDF_LIBS@
===================================================================
RCS file: /cvs/e/e17/proto/epdf/src/lib/etk_pdf.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- etk_pdf.c   3 Jun 2006 10:11:38 -0000       1.6
+++ etk_pdf.c   7 Jul 2007 16:12:09 -0000       1.7
@@ -486,8 +486,8 @@
    widget->size_request = _etk_pdf_size_request;
    widget->size_allocate = _etk_pdf_size_allocate;
 
-   etk_signal_connect("realize", ETK_OBJECT(pdf), 
ETK_CALLBACK(_etk_pdf_realize_cb), NULL);
-   etk_signal_connect("unrealize", ETK_OBJECT(pdf), 
ETK_CALLBACK(_etk_pdf_unrealize_cb), NULL);
+   etk_signal_connect("realized", ETK_OBJECT(pdf), 
ETK_CALLBACK(_etk_pdf_realize_cb), NULL);
+   etk_signal_connect("unrealized", ETK_OBJECT(pdf), 
ETK_CALLBACK(_etk_pdf_unrealize_cb), NULL);
 }
 
 /* Destroys the pdf */
===================================================================
RCS file: /cvs/e/e17/proto/epdf/src/lib/poppler_document.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- poppler_document.cpp        24 Apr 2006 21:26:43 -0000      1.4
+++ poppler_document.cpp        7 Jul 2007 16:12:09 -0000       1.5
@@ -9,7 +9,6 @@
 #include <ErrorCodes.h>
 #include <PDFDocEncoding.h>
 #include <UnicodeMap.h>
-#include <UGooString.h>
 
 #include "poppler_enum.h"
 #include "poppler_private.h"
@@ -30,7 +29,7 @@
     return NULL;
 
   if (!globalParams)
-    globalParams = new GlobalParams("/etc/xpdfrc");
+    globalParams = new GlobalParams();
 
   doc->pdfdoc = new PDFDoc (new GooString (filename), NULL);
   if (doc->pdfdoc->isOk() || doc->pdfdoc->getErrorCode() == errEncrypted) {
@@ -335,14 +334,13 @@
 epdf_document_property_get (Epdf_Document *document, const char *property)
 {
   Object     obj;
-  UGooString prop_str(property);
   GooString *goo_string;
   char      *title = NULL;
 
   if (!document)
     return NULL;
 
-  if (!document->dict->lookup (prop_str, &obj)->isString ()) {
+  if (!document->dict->lookup ((char *)property, &obj)->isString ()) {
     obj.free ();
 
     return NULL;
===================================================================
RCS file: /cvs/e/e17/proto/epdf/src/lib/poppler_index.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- poppler_index.cpp   17 Apr 2006 22:44:54 -0000      1.3
+++ poppler_index.cpp   7 Jul 2007 16:12:09 -0000       1.4
@@ -99,7 +99,7 @@
   if (item->action->getKind () != actionGoTo)
     return -1;
 
-  UGooString *named_dest = ((LinkGoTo *)item->action)->getNamedDest ();
+  GooString *named_dest = ((LinkGoTo *)item->action)->getNamedDest ();
   LinkDest *dest = ((LinkGoTo *)item->action)->getDest ();
 
   if (!dest && named_dest)
===================================================================
RCS file: /cvs/e/e17/proto/epdf/src/lib/poppler_page.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- poppler_page.cpp    13 Sep 2006 19:06:45 -0000      1.9
+++ poppler_page.cpp    7 Jul 2007 16:12:09 -0000       1.10
@@ -7,8 +7,8 @@
 #include <PDFDoc.h>
 #include <Page.h>
 #include <Gfx.h>
+#include <PDFDocEncoding.h>
 #include <TextOutputDev.h>
-#include <UGooString.h>
 #include <SplashOutputDev.h>
 #include <splash/SplashBitmap.h>
 
@@ -88,10 +88,11 @@
   white[0] = 255;
   white[1] = 255;
   white[2] = 255;
+  white[3] = 255;
 
   doc = page->doc;
 
-  output_dev = new SplashOutputDev(splashModeARGB8, 4, gFalse, white);
+  output_dev = new SplashOutputDev(splashModeXBGR8, 4, gFalse, white);
   output_dev->startDoc(doc->pdfdoc->getXRef ());
   switch (orientation) {
   case EPDF_PAGE_ORIENTATION_LANDSCAPE:
@@ -112,14 +113,14 @@
                             rotate,
                             false, false,
                             x, y, w, h,
-                            NULL,
+                           false,
                             doc->pdfdoc->getCatalog ());
   color_ptr = output_dev->getBitmap ()->getDataPtr ();
 
   width = output_dev->getBitmap()->getWidth();
   height = output_dev->getBitmap()->getHeight();
 
-//   printf ("%d %d\n", width, height);
+  //   printf ("%d %d\n", width, height);
   t1 = get_time ();
 
   evas_object_image_size_set(o, width, height);
@@ -132,7 +133,7 @@
   memcpy (m, color_ptr, height * width * 4);
   evas_object_image_data_update_add(o, 0, 0, width, height);
   evas_object_resize(o, width, height);
-//   evas_object_image_alpha_set (o, 0);
+  //  evas_object_image_alpha_set (o, 0);
 
   t2 = get_time ();
   printf ("temps : %.5f\n", t2 - t1);
@@ -161,10 +162,10 @@
 
     page->gfx = page->page->createGfx (page->text_dev,
                                        72.0, 72.0, 0,
-                                       0, /* useMediaBox */
-                                       1, /* Crop */
+                                       false, /* useMediaBox */
+                                       true, /* Crop */
                                        -1, -1, -1, -1,
-                                       NULL, /* links */
+                                       false, /* printing */
                                        page->doc->pdfdoc->getCatalog (),
                                        NULL, NULL, NULL, NULL);
 
@@ -216,24 +217,42 @@
   double          xMin, yMin, xMax, yMax;
   int             length;
   int             height;
-  UGooString      utext(text);
 
   if (!page || !text)
     return NULL;
 
+  GooString tmp (text);
+  Unicode *s;
+
+  {
+    length = tmp.getLength();
+    s = (Unicode *)gmallocn(length, sizeof(Unicode));
+    bool anyNonEncoded = false;
+    for (int j = 0; j < length && !anyNonEncoded; ++j) {
+      s[j] = pdfDocEncoding[tmp.getChar(j) & 0xff];
+      if (!s[j]) anyNonEncoded = true;
+    }
+    if ( anyNonEncoded )
+      {
+       for (int j = 0; j < length; ++j) {
+         s[j] = tmp.getChar(j);
+       }
+      }
+  }
+
   length = strlen (text);
 
   output_dev = new TextOutputDev (NULL, 1, 0, 0);
 
   height = epdf_page_height_get (page);
-  page->page->display (output_dev, 72, 72, 0, 0,
-                      1, NULL,
+  page->page->display (output_dev, 72, 72, 0, false,
+                      true, false,
                       page->doc->pdfdoc->getCatalog());
 
   xMin = 0;
   yMin = 0;
 #warning you probably want to add backwards as parameters
-  while (output_dev->findText (utext.unicode (), utext.getLength (),
+  while (output_dev->findText (s, tmp.getLength (),
                               0, 1, // startAtTop, stopAtBottom
                               1, 0, // startAtLast, stopAtLast
                               is_case_sensitive, 0, // caseSensitive, backwards
===================================================================
RCS file: /cvs/e/e17/proto/epdf/src/lib/poppler_page_transition.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- poppler_page_transition.cpp 17 Apr 2006 18:06:10 -0000      1.2
+++ poppler_page_transition.cpp 7 Jul 2007 16:12:09 -0000       1.3
@@ -3,7 +3,6 @@
 
 #include <Object.h>
 #include <Dict.h>
-#include <UGooString.h>
 
 #include "poppler_enum.h"
 #include "poppler_private.h"
@@ -34,8 +33,7 @@
 
   trans_dict = data->getDict ();
 
-  UGooString trans_str("S");
-  if (trans_dict->lookup (trans_str, &obj)->isName ()) {
+  if (trans_dict->lookup ("S", &obj)->isName ()) {
     const char *s;
 
     s = obj.getName();
===================================================================
RCS file: /cvs/e/e17/proto/epdf/src/lib/poppler_postscript.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- poppler_postscript.cpp      25 Apr 2006 07:08:27 -0000      1.2
+++ poppler_postscript.cpp      7 Jul 2007 16:12:09 -0000       1.3
@@ -28,9 +28,9 @@
   ps->pdfdoc = document->pdfdoc;
   ps->filename = strdup (filename);
   ps->first_page = (first_page < 1) ? 1 : first_page;
-  ps->last_page = (last_page > epdf_document_page_count_get (document)) ?
-    epdf_document_page_count_get (document) :
-    last_page;
+  ps->last_page = (last_page > epdf_document_page_count_get (document))
+    ? epdf_document_page_count_get (document)
+    : last_page;
 
   ps->width = -1.0;
   ps->height = -1.0;
@@ -80,9 +80,11 @@
   if (!postscript)
     return;
 
+  // FIXME: fix postscript title
   ps_dev = new PSOutputDev (postscript->filename,
                             postscript->pdfdoc->getXRef(),
                             postscript->pdfdoc->getCatalog(),
+                           "PS title",
                             postscript->first_page,
                             postscript->last_page,
                             psModePS,



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to