diff options
author | Kristian Høgsberg <krh@redhat.com> | 2005-03-01 22:24:10 (GMT) |
---|---|---|
committer | Kristian Høgsberg <krh@src.gnome.org> | 2005-03-01 22:24:10 (GMT) |
commit | 02eb16fef45712a91e24f6471b9e2f31249c888e (patch) | |
tree | d5579258f1d7fbd5a280fb2f1b97b74004b1dea9 /pdf/xpdf/Annot.cc | |
parent | 332afee84ff4eb7df326d96f07efd6f82a87c0a2 (diff) |
Use poppler instead of including xpdf source code. Poppler is a fork of
2005-03-01 Kristian Høgsberg <krh@redhat.com>
Use poppler instead of including xpdf source code. Poppler is a
fork of xpdf to build it as a shared library. See
http://freedesktop.org/wiki/Software/poppler.
* pdf/xpdf/*, pdf/goo/*, pdf/splash/*, pdf/fofi/*: Remove included
xpdf fork.
* pdf/Makefile.am: Build libpdfdocument.a here.
* pdf/GDKSplashOutputDev.cc:
* pdf/GDKSplashOutputDev.h:
* pdf/GnomeVFSStream.cc:
* pdf/GnomeVFSStream.h:
* pdf-document.cc:
* pdf-document.h:
* test-gdk-output-dev.cc
* Thumb.cc:
* Thumb.h: Pull these files out of pdf/xpdf and adjust to compile
against poppler.
Diffstat (limited to 'pdf/xpdf/Annot.cc')
-rw-r--r-- | pdf/xpdf/Annot.cc | 137 |
1 files changed, 0 insertions, 137 deletions
diff --git a/pdf/xpdf/Annot.cc b/pdf/xpdf/Annot.cc deleted file mode 100644 index 42bf849..0000000 --- a/pdf/xpdf/Annot.cc +++ /dev/null @@ -1,137 +0,0 @@ -//======================================================================== -// -// Annot.cc -// -// Copyright 2000-2003 Glyph & Cog, LLC -// -//======================================================================== - -#include <aconf.h> - -#ifdef USE_GCC_PRAGMAS -#pragma implementation -#endif - -#include "gmem.h" -#include "Object.h" -#include "Gfx.h" -#include "Annot.h" - -//------------------------------------------------------------------------ -// Annot -//------------------------------------------------------------------------ - -Annot::Annot(XRef *xrefA, Dict *dictA) { - Object apObj, asObj, obj1, obj2; - double t; - - ok = gFalse; - xref = xrefA; - dict = dictA; - dict->incRef(); - - dictA->lookup("Subtype", &subtype); - if (dictA->lookup("AP", &apObj)->isDict()) { - if (dictA->lookup("AS", &asObj)->isName()) { - if (apObj.dictLookup("N", &obj1)->isDict()) { - if (obj1.dictLookupNF(asObj.getName(), &obj2)->isRef()) { - obj2.copy(&appearance); - ok = gTrue; - } - obj2.free(); - } - obj1.free(); - } else { - if (apObj.dictLookupNF("N", &obj1)->isRef()) { - obj1.copy(&appearance); - ok = gTrue; - } - obj1.free(); - } - asObj.free(); - } - apObj.free(); - - if (dictA->lookup("Rect", &obj1)->isArray() && - obj1.arrayGetLength() == 4) { - //~ should check object types here - obj1.arrayGet(0, &obj2); - xMin = obj2.getNum(); - obj2.free(); - obj1.arrayGet(1, &obj2); - yMin = obj2.getNum(); - obj2.free(); - obj1.arrayGet(2, &obj2); - xMax = obj2.getNum(); - obj2.free(); - obj1.arrayGet(3, &obj2); - yMax = obj2.getNum(); - obj2.free(); - if (xMin > xMax) { - t = xMin; xMin = xMax; xMax = t; - } - if (yMin > yMax) { - t = yMin; yMin = yMax; yMax = t; - } - } else { - //~ this should return an error - xMin = yMin = 0; - xMax = yMax = 1; - } - obj1.free(); -} - -Annot::~Annot() { - appearance.free(); -} - -void Annot::draw(Gfx *gfx) { - Object obj; - - if (appearance.fetch(xref, &obj)->isStream()) { - gfx->doAnnot(&obj, xMin, yMin, xMax, yMax); - } - obj.free(); -} - -//------------------------------------------------------------------------ -// Annots -//------------------------------------------------------------------------ - -Annots::Annots(XRef *xref, Object *annotsObj) { - Annot *annot; - Object obj1; - int size; - int i; - - annots = NULL; - size = 0; - nAnnots = 0; - - if (annotsObj->isArray()) { - for (i = 0; i < annotsObj->arrayGetLength(); ++i) { - if (annotsObj->arrayGet(i, &obj1)->isDict()) { - annot = new Annot(xref, obj1.getDict()); - if (annot->isOk()) { - if (nAnnots >= size) { - size += 16; - annots = (Annot **)grealloc(annots, size * sizeof(Annot *)); - } - annots[nAnnots++] = annot; - } else { - delete annot; - } - } - obj1.free(); - } - } -} - -Annots::~Annots() { - int i; - - for (i = 0; i < nAnnots; ++i) { - delete annots[i]; - } - gfree(annots); -} |