Ignore:
Timestamp:
Oct 19, 2008, 4:08:46 PM (13 years ago)
Author:
Eugene Romanenko
Message:

PDF plugin: Poppler library updated to version 0.10.0

Location:
trunk/poppler/mypoppler/poppler
Files:
6 added
88 edited

Legend:

Unmodified
Added
Removed
  • trunk/poppler/mypoppler/poppler/ABWOutputDev.cc

    r253 r257  
    33// ABWOutputDev.cc
    44//
    5 // Jauco Noordzij
     5// Copyright 2006-2007 Jauco Noordzij <jauco@jauco.nl>
     6// Copyright 2007 Dominic Lachowicz <cinamod@hotmail.com>
    67//
    78// Based somewhat on HtmlOutputDev.cc
     
    734735    xmlSetProp(N_parent, BAD_CAST "alignment", xmlGetProp(N_parent->children,BAD_CAST "alignment"));
    735736
    736    delete styles;
     737   delete[] styles;
    737738}
    738739
  • trunk/poppler/mypoppler/poppler/ABWOutputDev.h

    r250 r257  
    33// ABWOutputDev.h
    44//
    5 // Copyright 2006 Jauco Noordzij
     5// Copyright 2006-2007 Jauco Noordzij <jauco@jauco.nl>
    66//
    77//========================================================================
  • trunk/poppler/mypoppler/poppler/Annot.cc

    r256 r257  
    44//
    55// Copyright 2000-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006 Scott Turner <scotty1024@mac.com>
     17// Copyright (C) 2007, 2008 Julien Rebetez <julienr@svn.gnome.org>
     18// Copyright (C) 2007, 2008 Albert Astals Cid <aacid@kde.org>
     19// Copyright (C) 2007, 2008 Carlos Garcia Campos <carlosgc@gnome.org>
     20// Copyright (C) 2007, 2008 Iñigo Martínez <inigomartinez@gmail.com>
     21// Copyright (C) 2007 Jeff Muizelaar <jeff@infidigm.net>
     22// Copyright (C) 2008 Pino Toscano <pino@kde.org>
     23// Copyright (C) 2008 Michael Vrable <mvrable@cs.ucsd.edu>
     24// Copyright (C) 2008 Hugo Mercier <hmercier31@gmail.com>
     25//
     26// To see a description of the changes please see the Changelog file that
     27// came with your tarball or type make ChangeLog if you are building from git
    628//
    729//========================================================================
     
    3153#include "XRef.h"
    3254#include "Movie.h"
     55#include "OptionalContent.h"
     56#include "Sound.h"
     57#include "FileSpec.h"
    3358#include <string.h>
    3459
     
    93118}
    94119
    95 AnnotExternalDataType parseAnnotExternalData(Dict* dict) {
     120static AnnotExternalDataType parseAnnotExternalData(Dict* dict) {
    96121  Object obj1;
    97122  AnnotExternalDataType type;
     
    112137
    113138  return type;
     139}
     140
     141PDFRectangle *parseDiffRectangle(Array *array, PDFRectangle *rect) {
     142  PDFRectangle *newRect = NULL;
     143  if (array->getLength() == 4) {
     144    // deltas
     145    Object obj1;
     146    double dx1 = (array->get(0, &obj1)->isNum() ? obj1.getNum() : 0);
     147    obj1.free();
     148    double dy1 = (array->get(1, &obj1)->isNum() ? obj1.getNum() : 0);
     149    obj1.free();
     150    double dx2 = (array->get(2, &obj1)->isNum() ? obj1.getNum() : 0);
     151    obj1.free();
     152    double dy2 = (array->get(3, &obj1)->isNum() ? obj1.getNum() : 0);
     153    obj1.free();
     154
     155    // checking that the numbers are valid (i.e. >= 0),
     156    // and that applying the differences still give us a valid rect
     157    if (dx1 >= 0 && dy1 >= 0 && dx2 >= 0 && dy2
     158        && (rect->x2 - rect->x1 - dx1 - dx2) >= 0
     159        && (rect->y2 - rect->y1 - dy1 - dy2) >= 0) {
     160      newRect = new PDFRectangle();
     161      newRect->x1 = rect->x1 + dx1;
     162      newRect->y1 = rect->y1 + dy1;
     163      newRect->x2 = rect->x2 - dx2;
     164      newRect->y2 = rect->y2 - dy2;
     165    }
     166  }
     167  return newRect;
    114168}
    115169
     
    143197
    144198//------------------------------------------------------------------------
     199// AnnotPath
     200//------------------------------------------------------------------------
     201
     202AnnotPath::AnnotPath() {
     203  coords = NULL;
     204  coordsLength = 0;
     205}
     206
     207AnnotPath::AnnotPath(Array *array) {
     208  coords = NULL;
     209  coordsLength = 0;
     210  parsePathArray(array);
     211}
     212
     213AnnotPath::AnnotPath(AnnotCoord **coords, int coordsLength) {
     214  this->coords = coords;
     215  this->coordsLength = coordsLength;
     216}
     217
     218AnnotPath::~AnnotPath() {
     219  if (coords) {
     220    for (int i = 0; i < coordsLength; ++i)
     221      delete coords[i];
     222    gfree(coords);
     223  }
     224}
     225
     226double AnnotPath::getX(int coord) const {
     227  if (coord >= 0 && coord < coordsLength)
     228    return coords[coord]->getX();
     229  return 0;
     230}
     231
     232double AnnotPath::getY(int coord) const {
     233  if (coord >= 0 && coord < coordsLength)
     234    return coords[coord]->getY();
     235  return 0;
     236}
     237
     238AnnotCoord *AnnotPath::getCoord(int coord) const {
     239  if (coord >= 0 && coord < coordsLength)
     240    return coords[coord];
     241  return NULL;
     242}
     243
     244void AnnotPath::parsePathArray(Array *array) {
     245  int tempLength;
     246  AnnotCoord **tempCoords;
     247  GBool correct = gTrue;
     248
     249  if (array->getLength() % 2) {
     250    error(-1, "Bad Annot Path");
     251    return;
     252  }
     253
     254  tempLength = array->getLength() / 2;
     255  tempCoords = (AnnotCoord **) gmallocn (tempLength, sizeof(AnnotCoord *));
     256  memset(tempCoords, 0, tempLength * sizeof(AnnotCoord *));
     257  for (int i = 0; i < tempLength && correct; i++) {
     258    Object obj1;
     259    double x = 0, y = 0;
     260
     261    if (array->get(i * 2, &obj1)->isNum()) {
     262      x = obj1.getNum();
     263    } else {
     264      correct = gFalse;
     265    }
     266    obj1.free();
     267
     268    if (array->get((i * 2) + 1, &obj1)->isNum()) {
     269      y = obj1.getNum();
     270    } else {
     271      correct = gFalse;
     272    }
     273    obj1.free();
     274
     275    if (!correct) {
     276      for (int j = i - 1; j >= 0; j--)
     277        delete tempCoords[j];
     278      gfree (tempCoords);
     279      return;
     280    }
     281
     282    tempCoords[i] = new AnnotCoord(x, y);
     283  }
     284
     285  coords = tempCoords;
     286  coordsLength = tempLength;
     287}
     288
     289//------------------------------------------------------------------------
    145290// AnnotCalloutLine
    146291//------------------------------------------------------------------------
    147292
    148 AnnotCalloutLine::AnnotCalloutLine(double x1, double y1, double x2, double y2) {
    149   this->x1 = x1;
    150   this->y1 = y1;
    151   this->x2 = x2;
    152   this->y2 = y2;
     293AnnotCalloutLine::AnnotCalloutLine(double x1, double y1, double x2, double y2)
     294    :  coord1(x1, y1), coord2(x2, y2) {
    153295}
    154296
     
    158300
    159301AnnotCalloutMultiLine::AnnotCalloutMultiLine(double x1, double y1, double x2,
    160     double y2, double x3, double y3) : AnnotCalloutLine(x1, y1, x2, y2) {
    161   this->x3 = x3;
    162   this->y3 = y3;
     302                                             double y2, double x3, double y3)
     303    : AnnotCalloutLine(x1, y1, x2, y2), coord3(x3, y3) {
    163304}
    164305
     
    234375double AnnotQuadrilaterals::getX1(int quadrilateral) {
    235376  if (quadrilateral >= 0  && quadrilateral < quadrilateralsLength)
    236     return quadrilaterals[quadrilateral]->x1;
     377    return quadrilaterals[quadrilateral]->coord1.getX();
    237378  return 0;
    238379}
     
    240381double AnnotQuadrilaterals::getY1(int quadrilateral) {
    241382  if (quadrilateral >= 0  && quadrilateral < quadrilateralsLength)
    242     return quadrilaterals[quadrilateral]->y1;
     383    return quadrilaterals[quadrilateral]->coord1.getY();
    243384  return 0;
    244385}
     
    246387double AnnotQuadrilaterals::getX2(int quadrilateral) {
    247388  if (quadrilateral >= 0  && quadrilateral < quadrilateralsLength)
    248     return quadrilaterals[quadrilateral]->x2;
     389    return quadrilaterals[quadrilateral]->coord2.getX();
    249390  return 0;
    250391}
     
    252393double AnnotQuadrilaterals::getY2(int quadrilateral) {
    253394  if (quadrilateral >= 0  && quadrilateral < quadrilateralsLength)
    254     return quadrilaterals[quadrilateral]->y2;
     395    return quadrilaterals[quadrilateral]->coord2.getY();
    255396  return 0;
    256397}
     
    258399double AnnotQuadrilaterals::getX3(int quadrilateral) {
    259400  if (quadrilateral >= 0  && quadrilateral < quadrilateralsLength)
    260     return quadrilaterals[quadrilateral]->x3;
     401    return quadrilaterals[quadrilateral]->coord3.getX();
    261402  return 0;
    262403}
     
    264405double AnnotQuadrilaterals::getY3(int quadrilateral) {
    265406  if (quadrilateral >= 0  && quadrilateral < quadrilateralsLength)
    266     return quadrilaterals[quadrilateral]->y3;
     407    return quadrilaterals[quadrilateral]->coord3.getY();
    267408  return 0;
    268409}
     
    270411double AnnotQuadrilaterals::getX4(int quadrilateral) {
    271412  if (quadrilateral >= 0  && quadrilateral < quadrilateralsLength)
    272     return quadrilaterals[quadrilateral]->x4;
     413    return quadrilaterals[quadrilateral]->coord4.getX();
    273414  return 0;
    274415}
     
    276417double AnnotQuadrilaterals::getY4(int quadrilateral) {
    277418  if (quadrilateral >= 0  && quadrilateral < quadrilateralsLength)
    278     return quadrilaterals[quadrilateral]->y4;
     419    return quadrilaterals[quadrilateral]->coord4.getY();
    279420  return 0;
    280421}
    281422
    282423AnnotQuadrilaterals::AnnotQuadrilateral::AnnotQuadrilateral(double x1, double y1,
    283         double x2, double y2, double x3, double y3, double x4, double y4) {
    284   this->x1 = x1;
    285   this->y1 = y1;
    286   this->x2 = x2;
    287   this->y2 = y2;
    288   this->x3 = x3;
    289   this->y3 = y3;
    290   this->x4 = x4;
    291   this->y4 = y4;
    292 }
    293 
    294 //------------------------------------------------------------------------
    295 // AnnotQuadPoints
    296 //------------------------------------------------------------------------
    297 
    298 AnnotQuadPoints::AnnotQuadPoints(double x1, double y1, double x2, double y2,
    299     double x3, double y3, double x4, double y4) {
    300   this->x1 = x1;
    301   this->y1 = y1;
    302   this->x2 = x2;
    303   this->y2 = y2;
    304   this->x3 = x3;
    305   this->y3 = y3;
    306   this->x4 = x4;
    307   this->y4 = y4;
     424    double x2, double y2, double x3, double y3, double x4, double y4)
     425    : coord1(x1, y1), coord2(x2, y2), coord3(x3, y3), coord4(x4, y4) {
    308426}
    309427
     
    697815
    698816void Annot::initialize(XRef *xrefA, Dict *dict, Catalog *catalog) {
    699   Object apObj, asObj, obj1, obj2, obj3;
     817  Object asObj, obj1, obj2, obj3;
    700818
    701819  appRef.num = 0;
     
    840958  }
    841959  obj1.free();
    842 
    843   /* TODO: optional content should be parsed */
    844   optionalContent = NULL;
    845960 
    846   /*if (dict->lookup("OC", &obj1)->isDict()) {
     961  if (dict->lookup("OC", &obj1)->isDict()) {
     962    optionalContent = new OCGs(&obj1, xrefA);
     963  } else {
    847964    optionalContent = NULL;
    848   } else {
    849     optionalContent = NULL;
    850   }
    851   obj1.free();
    852   */
     965  }
     966  obj1.free();
    853967}
    854968
     
    10971211    delete date;
    10981212
    1099   if (inReplyTo)
    1100     delete inReplyTo;
    1101 
    11021213  if (subject)
    11031214    delete subject;
     
    11351246  obj1.free();
    11361247
    1137   if (dict->lookup("IRT", &obj1)->isDict()) {
    1138     inReplyTo = new Dict(obj1.getDict());
    1139   } else {
    1140     inReplyTo = NULL;
     1248  if (dict->lookupNF("IRT", &obj1)->isRef()) {
     1249    inReplyTo = obj1.getRef();
     1250  } else {
     1251    inReplyTo.num = 0;
     1252    inReplyTo.gen = 0;
    11411253  }
    11421254  obj1.free();
     
    11851297}
    11861298
     1299AnnotText::~AnnotText() {
     1300  delete icon;
     1301}
     1302
    11871303void AnnotText::setModified(GooString *date) {
    11881304  if (date) {
     
    12021318
    12031319  if (dict->lookup("Name", &obj1)->isName()) {
    1204     GooString *iconName = new GooString(obj1.getName());
    1205 
    1206     if (!iconName->cmp("Comment")) {
    1207       icon = iconComment;
    1208     } else if (!iconName->cmp("Key")) {
    1209       icon = iconKey;
    1210     } else if (!iconName->cmp("Help")) {
    1211       icon = iconHelp;
    1212     } else if (!iconName->cmp("NewParagraph")) {
    1213       icon = iconNewParagraph;
    1214     } else if (!iconName->cmp("Paragraph")) {
    1215       icon = iconParagraph;
    1216     } else if (!iconName->cmp("Insert")) {
    1217       icon = iconInsert;
    1218     } else {
    1219       icon = iconNote;
    1220     }
    1221     delete iconName;
    1222   } else {
    1223     icon = iconNote;
     1320    icon = new GooString(obj1.getName());
     1321  } else {
     1322    icon = new GooString("Note");
    12241323  }
    12251324  obj1.free();
     
    12491348        state = stateUnknown;
    12501349      }
    1251 
    12521350    } else {
    12531351      state = stateUnknown;
     
    12851383      state = stateUnknown;
    12861384    }
    1287 
    12881385  } else {
    12891386    state = stateUnknown;
     
    13071404  if (actionDict)
    13081405    delete actionDict;
    1309 
     1406  */
     1407  dest.free();
     1408  /*
    13101409  if (uriAction)
    13111410    delete uriAction;
     
    13251424  obj1.free();
    13261425  */
     1426  dict->lookup("Dest", &dest);
    13271427  if (dict->lookup("H", &obj1)->isName()) {
    13281428    GooString *effect = new GooString(obj1.getName());
     
    14821582  obj1.free();
    14831583
    1484   if (dict->lookup("RD", &obj1)->isArray() && obj1.arrayGetLength() == 4) {
    1485     Object obj2;
    1486     rectangle = new PDFRectangle();
    1487 
    1488     (obj1.arrayGet(0, &obj2)->isNum() ? rectangle->x1 = obj2.getNum() :
    1489       rectangle->x1 = 0);
    1490     obj2.free();
    1491     (obj1.arrayGet(1, &obj2)->isNum() ? rectangle->y1 = obj2.getNum() :
    1492       rectangle->y1 = 0);
    1493     obj2.free();
    1494     (obj1.arrayGet(2, &obj2)->isNum() ? rectangle->x2 = obj2.getNum() :
    1495       rectangle->x2 = 1);
    1496     obj2.free();
    1497     (obj1.arrayGet(3, &obj2)->isNum() ? rectangle->y2 = obj2.getNum() :
    1498       rectangle->y2 = 1);
    1499     obj2.free();
    1500 
    1501     if (rectangle->x1 > rectangle->x2) {
    1502       double t = rectangle->x1;
    1503       rectangle->x1 = rectangle->x2;
    1504       rectangle->x2 = t;
    1505     }
    1506     if (rectangle->y1 > rectangle->y2) {
    1507       double t = rectangle->y1;
    1508       rectangle->y1 = rectangle->y2;
    1509       rectangle->y2 = t;
    1510     }
    1511 
    1512     if ((rectangle->x1 + rectangle->x2) > (rect->x2 - rect->x1))
    1513       rectangle->x1 = rectangle->x2 = 0;
    1514 
    1515     if ((rectangle->y1 + rectangle->y2) > (rect->y2 - rect->y1))
    1516       rectangle->y1 = rectangle->y2 = 0;
     1584  if (dict->lookup("RD", &obj1)->isArray()) {
     1585    rectangle = parseDiffRectangle(obj1.getArray(), rect);
    15171586  } else {
    15181587    rectangle = NULL;
     
    15411610
    15421611AnnotLine::~AnnotLine() {
     1612  delete coord1;
     1613  delete coord2;
     1614
    15431615  if (interiorColor)
    15441616    delete interiorColor;
     
    15531625  if (dict->lookup("L", &obj1)->isArray() && obj1.arrayGetLength() == 4) {
    15541626    Object obj2;
     1627    double x1, y1, x2, y2;
    15551628
    15561629    (obj1.arrayGet(0, &obj2)->isNum() ? x1 = obj2.getNum() : x1 = 0);
     
    15631636    obj2.free();
    15641637
    1565   } else {
    1566     x1 = y1 = x2 = y2 = 0;
     1638    coord1 = new AnnotCoord(x1, y1);
     1639    coord2 = new AnnotCoord(x2, y2);
     1640  } else {
     1641    coord1 = new AnnotCoord();
     1642    coord2 = new AnnotCoord();
    15671643  }
    15681644  obj1.free();
     
    16871763//------------------------------------------------------------------------
    16881764
     1765AnnotTextMarkup::AnnotTextMarkup(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj) :
     1766  AnnotMarkup(xrefA, dict, catalog, obj) {
     1767  // the real type will be read in initialize()
     1768  type = typeHighlight;
     1769  initialize(xrefA, catalog, dict);
     1770}
     1771
    16891772void AnnotTextMarkup::initialize(XRef *xrefA, Catalog *catalog, Dict *dict) {
    16901773  Object obj1;
     1774
     1775  if (dict->lookup("Subtype", &obj1)->isName()) {
     1776    GooString typeName(obj1.getName());
     1777    if (!typeName.cmp("Highlight")) {
     1778      type = typeHighlight;
     1779    } else if (!typeName.cmp("Underline")) {
     1780      type = typeUnderline;
     1781    } else if (!typeName.cmp("Squiggly")) {
     1782      type = typeSquiggly;
     1783    } else if (!typeName.cmp("StrikeOut")) {
     1784      type = typeStrikeOut;
     1785    }
     1786  }
     1787  obj1.free();
    16911788
    16921789  if(dict->lookup("QuadPoints", &obj1)->isArray()) {
     
    17321829  Object obj1;
    17331830
    1734   form = catalog->getForm ();
    1735   widget = form->findWidgetByRef (ref);
    1736 
    1737   // check if field apperances need to be regenerated
    1738   // Only text or choice fields needs to have appearance regenerated
    1739   // see section 8.6.2 "Variable Text" of PDFReference
    1740   regen = gFalse;
    1741   if (widget != NULL && (widget->getType () == formText || widget->getType () == formChoice)) {
    1742     regen = form->getNeedAppearances ();
     1831  if ((form = catalog->getForm ())) {
     1832    widget = form->findWidgetByRef (ref);
     1833
     1834    // check if field apperances need to be regenerated
     1835    // Only text or choice fields needs to have appearance regenerated
     1836    // see section 8.6.2 "Variable Text" of PDFReference
     1837    regen = gFalse;
     1838    if (widget != NULL && (widget->getType () == formText || widget->getType () == formChoice)) {
     1839      regen = form->getNeedAppearances ();
     1840    }
    17431841  }
    17441842
     
    30643162
    30653163  if (dict->lookup("Movie", &movieDict)->isDict()) {
    3066     if (movieDict.dictLookup("F", &obj1)->isString()) {
    3067       fileName = obj1.getString()->copy();
    3068     }
     3164    Object obj2;
     3165    getFileSpecNameForPlatform(movieDict.dictLookup("F", &obj1), &obj2);
     3166    fileName = obj2.getString()->copy();
     3167    obj2.free();
    30693168    obj1.free();
    30703169
     
    33073406  obj1.free();
    33083407
     3408}
     3409
     3410//------------------------------------------------------------------------
     3411// AnnotStamp
     3412//------------------------------------------------------------------------
     3413 
     3414AnnotStamp::AnnotStamp(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj) :
     3415  AnnotMarkup(xrefA, dict, catalog, obj) {
     3416  type = typeStamp;
     3417  initialize(xrefA, catalog, dict);
     3418}
     3419
     3420AnnotStamp::~AnnotStamp() {
     3421  delete icon;
     3422}
     3423
     3424void AnnotStamp::initialize(XRef *xrefA, Catalog *catalog, Dict* dict) {
     3425  Object obj1;
     3426
     3427  if (dict->lookup("Name", &obj1)->isName()) {
     3428    icon = new GooString(obj1.getName());
     3429  } else {
     3430    icon = new GooString("Draft");
     3431  }
     3432  obj1.free();
     3433
     3434}
     3435
     3436//------------------------------------------------------------------------
     3437// AnnotGeometry
     3438//------------------------------------------------------------------------
     3439
     3440AnnotGeometry::AnnotGeometry(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj) :
     3441  AnnotMarkup(xrefA, dict, catalog, obj) {
     3442  // the real type will be read in initialize()
     3443  type = typeSquare;
     3444  initialize(xrefA, catalog, dict);
     3445}
     3446
     3447AnnotGeometry::~AnnotGeometry() {
     3448  delete interiorColor;
     3449  delete borderEffect;
     3450  delete geometryRect;
     3451}
     3452
     3453void AnnotGeometry::initialize(XRef *xrefA, Catalog *catalog, Dict* dict) {
     3454  Object obj1;
     3455
     3456  if (dict->lookup("Subtype", &obj1)->isName()) {
     3457    GooString typeName(obj1.getName());
     3458    if (!typeName.cmp("Square")) {
     3459      type = typeSquare;
     3460    } else if (!typeName.cmp("Circle")) {
     3461      type = typeCircle;
     3462    }
     3463  }
     3464  obj1.free();
     3465
     3466  if (dict->lookup("IC", &obj1)->isArray()) {
     3467    interiorColor = new AnnotColor(obj1.getArray());
     3468  } else {
     3469    interiorColor = NULL;
     3470  }
     3471  obj1.free();
     3472
     3473  if (dict->lookup("BE", &obj1)->isDict()) {
     3474    borderEffect = new AnnotBorderEffect(obj1.getDict());
     3475  } else {
     3476    borderEffect = NULL;
     3477  }
     3478  obj1.free();
     3479
     3480  geometryRect = NULL;
     3481  if (dict->lookup("RD", &obj1)->isArray()) {
     3482    geometryRect = parseDiffRectangle(obj1.getArray(), rect);
     3483  }
     3484  obj1.free();
     3485
     3486}
     3487
     3488//------------------------------------------------------------------------
     3489// AnnotPolygon
     3490//------------------------------------------------------------------------
     3491
     3492AnnotPolygon::AnnotPolygon(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj) :
     3493  AnnotMarkup(xrefA, dict, catalog, obj) {
     3494  // the real type will be read in initialize()
     3495  type = typePolygon;
     3496  initialize(xrefA, catalog, dict);
     3497}
     3498
     3499AnnotPolygon::~AnnotPolygon() {
     3500  delete vertices;
     3501
     3502  if (interiorColor)
     3503    delete interiorColor;
     3504
     3505  if (borderEffect)
     3506    delete borderEffect;
     3507}
     3508
     3509void AnnotPolygon::initialize(XRef *xrefA, Catalog *catalog, Dict* dict) {
     3510  Object obj1;
     3511
     3512  if (dict->lookup("Subtype", &obj1)->isName()) {
     3513    GooString typeName(obj1.getName());
     3514    if (!typeName.cmp("Polygon")) {
     3515      type = typePolygon;
     3516    } else if (!typeName.cmp("PolyLine")) {
     3517      type = typePolyLine;
     3518    }
     3519  }
     3520  obj1.free();
     3521
     3522  if (dict->lookup("Vertices", &obj1)->isArray()) {
     3523    vertices = new AnnotPath(obj1.getArray());
     3524  } else {
     3525    vertices = new AnnotPath();
     3526    error(-1, "Bad Annot Polygon Vertices");
     3527    ok = gFalse;
     3528  }
     3529  obj1.free();
     3530
     3531  if (dict->lookup("LE", &obj1)->isArray() && obj1.arrayGetLength() == 2) {
     3532    Object obj2;
     3533
     3534    if(obj1.arrayGet(0, &obj2)->isString())
     3535      startStyle = parseAnnotLineEndingStyle(obj2.getString());
     3536    else
     3537      startStyle = annotLineEndingNone;
     3538    obj2.free();
     3539
     3540    if(obj1.arrayGet(1, &obj2)->isString())
     3541      endStyle = parseAnnotLineEndingStyle(obj2.getString());
     3542    else
     3543      endStyle = annotLineEndingNone;
     3544    obj2.free();
     3545
     3546  } else {
     3547    startStyle = endStyle = annotLineEndingNone;
     3548  }
     3549  obj1.free();
     3550
     3551  if (dict->lookup("IC", &obj1)->isArray()) {
     3552    interiorColor = new AnnotColor(obj1.getArray());
     3553  } else {
     3554    interiorColor = NULL;
     3555  }
     3556  obj1.free();
     3557
     3558  if (dict->lookup("BE", &obj1)->isDict()) {
     3559    borderEffect = new AnnotBorderEffect(obj1.getDict());
     3560  } else {
     3561    borderEffect = NULL;
     3562  }
     3563  obj1.free();
     3564
     3565  if (dict->lookup("IT", &obj1)->isName()) {
     3566    GooString *intentName = new GooString(obj1.getName());
     3567
     3568    if(!intentName->cmp("PolygonCloud")) {
     3569      intent = polygonCloud;
     3570    } else if(!intentName->cmp("PolyLineDimension")) {
     3571      intent = polylineDimension;
     3572    } else {
     3573      intent = polygonDimension;
     3574    }
     3575    delete intentName;
     3576  } else {
     3577    intent = polygonCloud;
     3578  }
     3579  obj1.free();
     3580}
     3581
     3582//------------------------------------------------------------------------
     3583// AnnotCaret
     3584//------------------------------------------------------------------------
     3585
     3586AnnotCaret::AnnotCaret(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj) :
     3587  AnnotMarkup(xrefA, dict, catalog, obj) {
     3588  type = typeCaret;
     3589  initialize(xrefA, catalog, dict);
     3590}
     3591
     3592AnnotCaret::~AnnotCaret() {
     3593  delete caretRect;
     3594}
     3595
     3596void AnnotCaret::initialize(XRef *xrefA, Catalog *catalog, Dict* dict) {
     3597  Object obj1;
     3598
     3599  symbol = symbolNone;
     3600  if (dict->lookup("Sy", &obj1)->isName()) {
     3601    GooString typeName(obj1.getName());
     3602    if (!typeName.cmp("P")) {
     3603      symbol = symbolP;
     3604    } else if (!typeName.cmp("None")) {
     3605      symbol = symbolNone;
     3606    }
     3607  }
     3608  obj1.free();
     3609
     3610  if (dict->lookup("RD", &obj1)->isArray()) {
     3611    caretRect = parseDiffRectangle(obj1.getArray(), rect);
     3612  } else {
     3613    caretRect = NULL;
     3614  }
     3615  obj1.free();
     3616
     3617}
     3618
     3619//------------------------------------------------------------------------
     3620// AnnotInk
     3621//------------------------------------------------------------------------
     3622
     3623AnnotInk::AnnotInk(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj) :
     3624  AnnotMarkup(xrefA, dict, catalog, obj) {
     3625  type = typeInk;
     3626  initialize(xrefA, catalog, dict);
     3627}
     3628
     3629AnnotInk::~AnnotInk() {
     3630  if (inkList) {
     3631    for (int i = 0; i < inkListLength; ++i)
     3632      delete inkList[i];
     3633    gfree(inkList);
     3634  }
     3635}
     3636
     3637void AnnotInk::initialize(XRef *xrefA, Catalog *catalog, Dict* dict) {
     3638  Object obj1;
     3639
     3640  if (dict->lookup("InkList", &obj1)->isArray()) {
     3641    Array *array = obj1.getArray();
     3642    inkListLength = array->getLength();
     3643    inkList = (AnnotPath **) gmallocn ((inkListLength), sizeof(AnnotPath *));
     3644    memset(inkList, 0, inkListLength * sizeof(AnnotPath *));
     3645    for (int i = 0; i < inkListLength; i++) {
     3646      Object obj2;
     3647      if (array->get(i, &obj2)->isArray())
     3648        inkList[i] = new AnnotPath(obj2.getArray());
     3649      obj2.free();
     3650    }
     3651  } else {
     3652    inkListLength = 0;
     3653    inkList = NULL;
     3654    error(-1, "Bad Annot Ink List");
     3655    ok = gFalse;
     3656  }
     3657  obj1.free();
     3658}
     3659
     3660//------------------------------------------------------------------------
     3661// AnnotFileAttachment
     3662//------------------------------------------------------------------------
     3663
     3664AnnotFileAttachment::AnnotFileAttachment(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj) :
     3665  AnnotMarkup(xrefA, dict, catalog, obj) {
     3666  type = typeFileAttachment;
     3667  initialize(xrefA, catalog, dict);
     3668}
     3669
     3670AnnotFileAttachment::~AnnotFileAttachment() {
     3671  file.free();
     3672
     3673  if (name)
     3674    delete name;
     3675}
     3676
     3677void AnnotFileAttachment::initialize(XRef *xrefA, Catalog *catalog, Dict* dict) {
     3678  Object obj1;
     3679
     3680  if (dict->lookup("FS", &obj1)->isDict()) {
     3681    obj1.copy(&file);
     3682  } else {
     3683    error(-1, "Bad Annot File Attachment");
     3684    ok = gFalse;
     3685  }
     3686  obj1.free();
     3687
     3688  if (dict->lookup("Name", &obj1)->isName()) {
     3689    name = new GooString(obj1.getName());
     3690  } else {
     3691    name = new GooString("PushPin");
     3692  }
     3693  obj1.free();
     3694}
     3695
     3696//------------------------------------------------------------------------
     3697// AnnotSound
     3698//------------------------------------------------------------------------
     3699
     3700AnnotSound::AnnotSound(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj) :
     3701  AnnotMarkup(xrefA, dict, catalog, obj) {
     3702  type = typeSound;
     3703  initialize(xrefA, catalog, dict);
     3704}
     3705
     3706AnnotSound::~AnnotSound() {
     3707  delete sound;
     3708
     3709  delete name;
     3710}
     3711
     3712void AnnotSound::initialize(XRef *xrefA, Catalog *catalog, Dict* dict) {
     3713  Object obj1;
     3714
     3715  sound = Sound::parseSound(dict->lookup("Sound", &obj1));
     3716  if (!sound) {
     3717    error(-1, "Bad Annot Sound");
     3718    ok = gFalse;
     3719  }
     3720  obj1.free();
     3721
     3722  if (dict->lookup("Name", &obj1)->isName()) {
     3723    name = new GooString(obj1.getName());
     3724  } else {
     3725    name = new GooString("Speaker");
     3726  }
     3727  obj1.free();
     3728}
     3729
     3730//------------------------------------------------------------------------
     3731// Annot3D
     3732//------------------------------------------------------------------------
     3733
     3734Annot3D::Annot3D(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj) :
     3735  Annot(xrefA, dict, catalog, obj) {
     3736  type = type3D;
     3737  initialize(xrefA, catalog, dict);
     3738}
     3739
     3740Annot3D::~Annot3D() {
     3741  if (activation)
     3742    delete activation;
     3743}
     3744
     3745void Annot3D::initialize(XRef *xrefA, Catalog *catalog, Dict* dict) {
     3746  Object obj1;
     3747
     3748  if (dict->lookup("3DA", &obj1)->isDict()) {
     3749    activation = new Activation(obj1.getDict());
     3750  } else {
     3751    activation = NULL;
     3752  }
     3753  obj1.free();
     3754}
     3755
     3756Annot3D::Activation::Activation(Dict *dict) {
     3757  Object obj1;
     3758
     3759  if (dict->lookup("A", &obj1)->isName()) {
     3760    GooString *name = new GooString(obj1.getName());
     3761
     3762    if(!name->cmp("PO")) {
     3763      aTrigger = aTriggerPageOpened;
     3764    } else if(!name->cmp("PV")) {
     3765      aTrigger = aTriggerPageVisible;
     3766    } else if(!name->cmp("XA")) {
     3767      aTrigger = aTriggerUserAction;
     3768    } else {
     3769      aTrigger = aTriggerUnknown;
     3770    }
     3771    delete name;
     3772  } else {
     3773    aTrigger = aTriggerUnknown;
     3774  }
     3775  obj1.free();
     3776
     3777  if(dict->lookup("AIS", &obj1)->isName()) {
     3778    GooString *name = new GooString(obj1.getName());
     3779
     3780    if(!name->cmp("I")) {
     3781      aState = aStateEnabled;
     3782    } else if(!name->cmp("L")) {
     3783      aState = aStateDisabled;
     3784    } else {
     3785      aState = aStateUnknown;
     3786    }
     3787    delete name;
     3788  } else {
     3789    aState = aStateUnknown;
     3790  }
     3791  obj1.free();
     3792
     3793  if(dict->lookup("D", &obj1)->isName()) {
     3794    GooString *name = new GooString(obj1.getName());
     3795
     3796    if(!name->cmp("PC")) {
     3797      dTrigger = dTriggerPageClosed;
     3798    } else if(!name->cmp("PI")) {
     3799      dTrigger = dTriggerPageInvisible;
     3800    } else if(!name->cmp("XD")) {
     3801      dTrigger = dTriggerUserAction;
     3802    } else {
     3803      dTrigger = dTriggerUnknown;
     3804    }
     3805    delete name;
     3806  } else {
     3807    dTrigger = dTriggerUnknown;
     3808  }
     3809  obj1.free();
     3810
     3811  if(dict->lookup("DIS", &obj1)->isName()) {
     3812    GooString *name = new GooString(obj1.getName());
     3813
     3814    if(!name->cmp("U")) {
     3815      dState = dStateUninstantiaded;
     3816    } else if(!name->cmp("I")) {
     3817      dState = dStateInstantiated;
     3818    } else if(!name->cmp("L")) {
     3819      dState = dStateLive;
     3820    } else {
     3821      dState = dStateUnknown;
     3822    }
     3823    delete name;
     3824  } else {
     3825    dState = dStateUnknown;
     3826  }
     3827  obj1.free();
     3828
     3829  if (dict->lookup("TB", &obj1)->isBool()) {
     3830    displayToolbar = obj1.getBool();
     3831  } else {
     3832    displayToolbar = gTrue;
     3833  }
     3834  obj1.free();
     3835
     3836  if (dict->lookup("NP", &obj1)->isBool()) {
     3837    displayNavigation = obj1.getBool();
     3838  } else {
     3839    displayNavigation = gFalse;
     3840  }
     3841  obj1.free();
    33093842}
    33103843
     
    33643897      annot = new AnnotLine(xref, dict, catalog, obj);
    33653898    } else if (!typeName->cmp("Square")) {
    3366       annot = new Annot(xref, dict, catalog, obj);
     3899      annot = new AnnotGeometry(xref, dict, catalog, obj);
    33673900    } else if (!typeName->cmp("Circle")) {
    3368       annot = new Annot(xref, dict, catalog, obj);
     3901      annot = new AnnotGeometry(xref, dict, catalog, obj);
    33693902    } else if (!typeName->cmp("Polygon")) {
    3370       annot = new Annot(xref, dict, catalog, obj);
     3903      annot = new AnnotPolygon(xref, dict, catalog, obj);
    33713904    } else if (!typeName->cmp("PolyLine")) {
    3372       annot = new Annot(xref, dict, catalog, obj);
     3905      annot = new AnnotPolygon(xref, dict, catalog, obj);
    33733906    } else if (!typeName->cmp("Highlight")) {
    3374       annot = new Annot(xref, dict, catalog, obj);
     3907      annot = new AnnotTextMarkup(xref, dict, catalog, obj);
    33753908    } else if (!typeName->cmp("Underline")) {
    3376       annot = new Annot(xref, dict, catalog, obj);
     3909      annot = new AnnotTextMarkup(xref, dict, catalog, obj);
    33773910    } else if (!typeName->cmp("Squiggly")) {
    3378       annot = new Annot(xref, dict, catalog, obj);
     3911      annot = new AnnotTextMarkup(xref, dict, catalog, obj);
    33793912    } else if (!typeName->cmp("StrikeOut")) {
    3380       annot = new Annot(xref, dict, catalog, obj);
     3913      annot = new AnnotTextMarkup(xref, dict, catalog, obj);
    33813914    } else if (!typeName->cmp("Stamp")) {
    3382       annot = new Annot(xref, dict, catalog, obj);
     3915      annot = new AnnotStamp(xref, dict, catalog, obj);
    33833916    } else if (!typeName->cmp("Caret")) {
    3384       annot = new Annot(xref, dict, catalog, obj);
     3917      annot = new AnnotCaret(xref, dict, catalog, obj);
    33853918    } else if (!typeName->cmp("Ink")) {
    3386       annot = new Annot(xref, dict, catalog, obj);
     3919      annot = new AnnotInk(xref, dict, catalog, obj);
    33873920    } else if (!typeName->cmp("FileAttachment")) {
    3388       annot = new Annot(xref, dict, catalog, obj);
     3921      annot = new AnnotFileAttachment(xref, dict, catalog, obj);
    33893922    } else if (!typeName->cmp("Sound")) {
    3390       annot = new Annot(xref, dict, catalog, obj);
     3923      annot = new AnnotSound(xref, dict, catalog, obj);
    33913924    } else if(!typeName->cmp("Movie")) {
    33923925      annot = new AnnotMovie(xref, dict, catalog, obj);
     
    34023935      annot = new Annot(xref, dict, catalog, obj);
    34033936    } else if (!typeName->cmp("3D")) {
    3404       annot = new Annot(xref, dict, catalog, obj);
     3937      annot = new Annot3D(xref, dict, catalog, obj);
    34053938    } else {
    34063939      annot = new Annot(xref, dict, catalog, obj);
  • trunk/poppler/mypoppler/poppler/Annot.h

    r250 r257  
    44//
    55// Copyright 2000-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006 Scott Turner <scotty1024@mac.com>
     17// Copyright (C) 2007, 2008 Julien Rebetez <julienr@svn.gnome.org>
     18// Copyright (C) 2007, 2008 Carlos Garcia Campos <carlosgc@gnome.org>
     19// Copyright (C) 2007, 2008 Iñigo Martínez <inigomartinez@gmail.com>
     20// Copyright (C) 2008 Michael Vrable <mvrable@cs.ucsd.edu>
     21// Copyright (C) 2008 Hugo Mercier <hmercier31@gmail.com>
     22// Copyright (C) 2008 Pino Toscano <pino@kde.org>
     23// Copyright (C) 2008 Tomas Are Haavet <tomasare@gmail.com>
     24//
     25// To see a description of the changes please see the Changelog file that
     26// came with your tarball or type make ChangeLog if you are building from git
    627//
    728//========================================================================
     
    2445class PDFRectangle;
    2546class Movie;
     47class OCGs;
     48class Sound;
    2649
    2750enum AnnotLineEndingStyle {
     
    4467
    4568//------------------------------------------------------------------------
     69// AnnotCoord
     70//------------------------------------------------------------------------
     71
     72class AnnotCoord {
     73public:
     74
     75  AnnotCoord() : x(0), y(0) { }
     76  AnnotCoord(double _x, double _y) : x(_x), y(_y) { }
     77
     78  double getX() const { return x; }
     79  double getY() const { return y; }
     80 
     81protected:
     82
     83  double x, y;
     84};
     85
     86//------------------------------------------------------------------------
     87// AnnotPath
     88//------------------------------------------------------------------------
     89
     90class AnnotPath {
     91public:
     92  AnnotPath();
     93  AnnotPath(Array *array);
     94  AnnotPath(AnnotCoord **coords, int coordLength);
     95  ~AnnotPath();
     96
     97  double getX(int coord) const;
     98  double getY(int coord) const;
     99  AnnotCoord *getCoord(int coord) const;
     100  int getCoordsLength() const { return coordsLength; }
     101protected:
     102  AnnotCoord **coords;
     103  int coordsLength;
     104
     105  void parsePathArray(Array *array);
     106};
     107 
     108//------------------------------------------------------------------------
    46109// AnnotCalloutLine
    47110//------------------------------------------------------------------------
     
    53116  virtual ~AnnotCalloutLine() { }
    54117
    55   double getX1() const { return x1; }
    56   double getY1() const { return y1; }
    57   double getX2() const { return x2; }
    58   double getY2() const { return y2; }
     118  double getX1() const { return coord1.getX(); }
     119  double getY1() const { return coord1.getY(); }
     120  double getX2() const { return coord2.getX(); }
     121  double getY2() const { return coord2.getY(); }
    59122 
    60123protected:
    61124
    62   double x1, y1, x2, y2;
     125  AnnotCoord coord1, coord2;
    63126};
    64127
     
    73136    double x3, double y3);
    74137
    75   double getX3() const { return x3; }
    76   double getY3() const { return y3; }
    77 
    78 protected:
    79 
    80   double x3, y3;
     138  double getX3() const { return coord3.getX(); }
     139  double getY3() const { return coord3.getY(); }
     140
     141protected:
     142
     143  AnnotCoord coord3;
    81144};
    82145
     
    114177      double y3, double x4, double y4);
    115178
    116     double x1, y1, x2, y2, x3, y3, x4, y4;
     179    AnnotCoord coord1, coord2, coord3, coord4;
    117180  };
    118181
     
    120183
    121184  AnnotQuadrilaterals(Array *array, PDFRectangle *rect);
    122   virtual ~AnnotQuadrilaterals();
     185  ~AnnotQuadrilaterals();
    123186
    124187  double getX1(int quadrilateral);
     
    138201
    139202//------------------------------------------------------------------------
    140 // AnnotQuadPoints
    141 //------------------------------------------------------------------------
    142 
    143 class AnnotQuadPoints {
    144 public:
    145  
    146   AnnotQuadPoints(double x1, double y1, double x2, double y2, double x3,
    147       double y3, double x4, double y4);
    148 
    149   double getX1() const { return x1; }
    150   double getY1() const { return y1; }
    151   double getX2() const { return x2; }
    152   double getY2() const { return y2; }
    153   double getX3() const { return x3; }
    154   double getY3() const { return y3; }
    155   double getX4() const { return x4; }
    156   double getY4() const { return y4; }
    157 
    158 protected:
    159   double x1, y1, x2, y2, x3, y3, x4, y4;
    160 };
    161 
    162 //------------------------------------------------------------------------
    163203// AnnotBorder
    164204//------------------------------------------------------------------------
     
    169209    typeUnknown,
    170210    typeArray,
    171     typeBS,
     211    typeBS
    172212  };
    173213
     
    177217    borderBeveled,    // Beveled
    178218    borderInset,      // Inset
    179     borderUnderlined, // Underlined
     219    borderUnderlined  // Underlined
    180220  };
    181221
     
    206246  AnnotBorderArray(Array *array);
    207247
    208   virtual double getHorizontalCorner() const { return horizontalCorner; }
    209   virtual double getVerticalCorner() const { return verticalCorner; }
     248  double getHorizontalCorner() const { return horizontalCorner; }
     249  double getVerticalCorner() const { return verticalCorner; }
    210250
    211251protected:
     
    470510  AnnotColor *getColor() const { return color; }
    471511  int getTreeKey() const { return treeKey; }
    472   Dict *getOptionalContent() const { return optionalContent; }
     512  OCGs *getOptionalContent() const { return optionalContent; }
    473513
    474514  int getId() { return ref.num; }
     
    503543  GooString *appearState;           // AS
    504544  int treeKey;                      // Struct Parent;
    505   Dict *optionalContent;            // OC
     545  OCGs *optionalContent;            // OC
    506546
    507547  XRef *xref;                   // the xref table for this PDF file
     
    523563public:
    524564  AnnotPopup(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
    525   virtual ~AnnotPopup();
     565  ~AnnotPopup();
    526566
    527567  Dict *getParent() const { return parent; }
     
    555595  // getRC
    556596  GooString *getDate() const { return date; }
    557   Dict *getInReplyTo() const { return inReplyTo; }
     597  int getInReplyToID() const { return inReplyTo.num; }
    558598  GooString *getSubject() const { return subject; }
    559599  AnnotMarkupReplyType getReplyTo() const { return replyTo; }
     
    566606  // RC
    567607  GooString *date;              // CreationDate
    568   Dict *inReplyTo;              // IRT
     608  Ref inReplyTo;                // IRT
    569609  GooString *subject;           // Subj
    570610  AnnotMarkupReplyType replyTo; // RT           (Default R)
     
    584624class AnnotText: public AnnotMarkup {
    585625public:
    586   enum AnnotTextIcon {
    587     iconComment,      // Comment
    588     iconKey,          // Key
    589     iconNote,         // Note
    590     iconHelp,         // Help
    591     iconNewParagraph, // NewParagraph
    592     iconParagraph,    // Paragraph
    593     iconInsert        // Insert
    594   };
    595 
    596626  enum AnnotTextState {
    597627    stateUnknown,
     
    608638
    609639  AnnotText(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
     640  ~AnnotText();
    610641
    611642  // getters
    612643  GBool getOpen() const { return open; }
    613   AnnotTextIcon getIcon() const { return icon; }
     644  GooString *getIcon() const { return icon; }
    614645  AnnotTextState getState() const { return state; }
    615646
     
    622653
    623654  GBool open;                       // Open       (Default false)
    624   AnnotTextIcon icon;               // Name       (Default Note)
     655  GooString *icon;                  // Name       (Default Note)
    625656  AnnotTextState state;             // State      (Default Umarked if
    626657                                    //             StateModel Marked
     
    770801  // getters
    771802  Dict *getActionDict() const { return actionDict; }
    772   // getDest
     803  Object *getDest() { return &dest; }
    773804  AnnotLinkEffect getLinkEffect() const { return linkEffect; }
    774805  Dict *getUriAction() const { return uriAction; }
     
    780811
    781812  Dict *actionDict;                    // A
    782   //Dest
     813  Object dest;                         // Dest
    783814  AnnotLinkEffect linkEffect;          // H          (Default I)
    784815  Dict *uriAction;                     // PA
     
    807838
    808839  AnnotFreeText(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
    809   virtual ~AnnotFreeText();
     840  ~AnnotFreeText();
    810841
    811842  // getters
     
    858889
    859890  AnnotLine(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
    860   virtual ~AnnotLine();
     891  ~AnnotLine();
    861892
    862893  // getters
     
    873904  double getCaptionTextHorizontal() const { return captionTextHorizontal; }
    874905  double getCaptionTextVertical() const { return captionTextVertical; }
     906  double getX1() const { return coord1->getX(); }
     907  double getY1() const { return coord1->getY(); }
     908  double getX2() const { return coord2->getX(); }
     909  double getY2() const { return coord2->getY(); }
    875910
    876911protected:
     
    879914
    880915  // required
    881   double x1, y1, x2, y2;            // L
     916  AnnotCoord *coord1, *coord2;
    882917 
    883918  // optional
     
    905940public:
    906941
    907   AnnotTextMarkup(XRef *xrefA, Catalog *catalog, Dict *dict);
     942  AnnotTextMarkup(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
    908943  virtual ~AnnotTextMarkup();
    909944
     
    915950 
    916951  AnnotQuadrilaterals *quadrilaterals; // QuadPoints
     952};
     953
     954//------------------------------------------------------------------------
     955// AnnotStamp
     956//------------------------------------------------------------------------
     957
     958class AnnotStamp: public AnnotMarkup {
     959public:
     960
     961  AnnotStamp(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
     962  ~AnnotStamp();
     963
     964  // getters
     965  GooString *getIcon() const { return icon; }
     966
     967private:
     968
     969  void initialize(XRef *xrefA, Catalog *catalog, Dict *dict);
     970
     971  GooString *icon;                  // Name       (Default Draft)
     972};
     973
     974//------------------------------------------------------------------------
     975// AnnotGeometry
     976//------------------------------------------------------------------------
     977
     978class AnnotGeometry: public AnnotMarkup {
     979public:
     980
     981  AnnotGeometry(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
     982  ~AnnotGeometry();
     983
     984  // getters
     985  AnnotColor *getInteriorColor() const { return interiorColor; }
     986  AnnotBorderEffect *getBorderEffect() const { return borderEffect; }
     987  PDFRectangle *getGeometryRect() const { return geometryRect; }
     988
     989private:
     990
     991  void initialize(XRef *xrefA, Catalog *catalog, Dict *dict);
     992
     993  AnnotColor *interiorColor;        // IC
     994  AnnotBorderEffect *borderEffect;  // BE
     995  PDFRectangle *geometryRect;       // RD (combined with Rect)
     996};
     997
     998//------------------------------------------------------------------------
     999// AnnotPolygon
     1000//------------------------------------------------------------------------
     1001
     1002class AnnotPolygon: public AnnotMarkup {
     1003public:
     1004
     1005  enum AnnotPolygonIntent {
     1006    polygonCloud,      // PolygonCloud
     1007    polylineDimension, // PolyLineDimension
     1008    polygonDimension   // PolygonDimension
     1009  };
     1010
     1011  AnnotPolygon(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
     1012  ~AnnotPolygon();
     1013
     1014  // getters
     1015  AnnotPath *getVertices() const { return vertices; }
     1016  AnnotLineEndingStyle getStartStyle() const { return startStyle; }
     1017  AnnotLineEndingStyle getEndStyle() const { return endStyle; }
     1018  AnnotColor *getInteriorColor() const { return interiorColor; }
     1019  AnnotBorderEffect *getBorderEffect() const { return borderEffect; }
     1020  AnnotPolygonIntent getIntent() const { return intent; }
     1021
     1022private:
     1023
     1024  void initialize(XRef *xrefA, Catalog *catalog, Dict *dict);
     1025
     1026  // required
     1027  AnnotPath *vertices;              // Vertices
     1028
     1029  // optional
     1030  AnnotLineEndingStyle startStyle;  // LE       (Default [/None /None])
     1031  AnnotLineEndingStyle endStyle;    //
     1032  // inherited  from Annot
     1033  // AnnotBorderBS border;          // BS
     1034  AnnotColor *interiorColor;        // IC
     1035  AnnotBorderEffect *borderEffect;  // BE
     1036  AnnotPolygonIntent intent;        // IT
     1037  // Measure
     1038};
     1039
     1040//------------------------------------------------------------------------
     1041// AnnotCaret
     1042//------------------------------------------------------------------------
     1043
     1044class AnnotCaret: public AnnotMarkup {
     1045public:
     1046
     1047  enum AnnotCaretSymbol {
     1048    symbolNone,     // None
     1049    symbolP         // P
     1050  };
     1051
     1052  AnnotCaret(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
     1053  ~AnnotCaret();
     1054
     1055  // getters
     1056  AnnotCaretSymbol getSymbol() const { return symbol; }
     1057  PDFRectangle *getCaretRect() const { return caretRect; }
     1058
     1059private:
     1060
     1061  void initialize(XRef *xrefA, Catalog *catalog, Dict *dict);
     1062
     1063  AnnotCaretSymbol symbol;       // Sy         (Default None)
     1064  PDFRectangle *caretRect;       // RD (combined with Rect)
     1065};
     1066
     1067//------------------------------------------------------------------------
     1068// AnnotInk
     1069//------------------------------------------------------------------------
     1070
     1071class AnnotInk: public AnnotMarkup {
     1072public:
     1073
     1074  AnnotInk(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
     1075  ~AnnotInk();
     1076
     1077  // getters
     1078  AnnotPath **getInkList() const { return inkList; }
     1079  int getInkListLength() const { return inkListLength; }
     1080
     1081private:
     1082
     1083  void initialize(XRef *xrefA, Catalog *catalog, Dict *dict);
     1084
     1085  // required
     1086  AnnotPath **inkList;       // InkList
     1087  int inkListLength;
     1088
     1089  // optional
     1090  // inherited from Annot
     1091  // AnnotBorderBS border;  // BS
     1092};
     1093
     1094//------------------------------------------------------------------------
     1095// AnnotFileAttachment
     1096//------------------------------------------------------------------------
     1097
     1098class AnnotFileAttachment: public AnnotMarkup {
     1099public:
     1100
     1101  AnnotFileAttachment(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
     1102  ~AnnotFileAttachment();
     1103
     1104  // getters
     1105  Object *getFile() { return &file; }
     1106  GooString *getName() const { return name; }
     1107
     1108private:
     1109
     1110  void initialize(XRef *xrefA, Catalog *catalog, Dict *dict);
     1111
     1112  // required
     1113  Object file;      // FS
     1114
     1115  // optional
     1116  GooString *name;  // Name
     1117};
     1118
     1119//------------------------------------------------------------------------
     1120// AnnotSound
     1121//------------------------------------------------------------------------
     1122
     1123class AnnotSound: public AnnotMarkup {
     1124public:
     1125
     1126  AnnotSound(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
     1127  ~AnnotSound();
     1128
     1129  // getters
     1130  Sound *getSound() { return sound; }
     1131  GooString *getName() const { return name; }
     1132
     1133private:
     1134
     1135  void initialize(XRef *xrefA, Catalog *catalog, Dict *dict);
     1136
     1137  // required
     1138  Sound *sound;                  // Sound
     1139
     1140  // optional
     1141  GooString *name;               // Name
    9171142};
    9181143
     
    9731198
    9741199//------------------------------------------------------------------------
     1200// Annot3D
     1201//------------------------------------------------------------------------
     1202
     1203class Annot3D: public Annot {
     1204  class Activation {
     1205  public:
     1206    enum ActivationATrigger {
     1207      aTriggerUnknown,
     1208      aTriggerPageOpened,  // PO
     1209      aTriggerPageVisible, // PV
     1210      aTriggerUserAction   // XA
     1211    };
     1212
     1213    enum ActivationAState {
     1214      aStateUnknown,
     1215      aStateEnabled, // I
     1216      aStateDisabled // L
     1217    };
     1218
     1219    enum ActivationDTrigger {
     1220      dTriggerUnknown,
     1221      dTriggerPageClosed,    // PC
     1222      dTriggerPageInvisible, // PI
     1223      dTriggerUserAction     // XD
     1224    };
     1225
     1226    enum ActivationDState {
     1227      dStateUnknown,
     1228      dStateUninstantiaded, // U
     1229      dStateInstantiated,   // I
     1230      dStateLive            // L
     1231    };
     1232
     1233    Activation(Dict *dict);
     1234  private:
     1235   
     1236    ActivationATrigger aTrigger;  // A   (Default XA)
     1237    ActivationAState aState;      // AIS (Default L)
     1238    ActivationDTrigger dTrigger;  // D   (Default PI)
     1239    ActivationDState dState;      // DIS (Default U)
     1240    GBool displayToolbar;         // TB  (Default true)
     1241    GBool displayNavigation;      // NP  (Default false);
     1242  };
     1243public:
     1244
     1245  Annot3D(XRef *xrefA, Dict *dict, Catalog *catalog, Object *obj);
     1246  ~Annot3D();
     1247
     1248  // getters
     1249
     1250private:
     1251
     1252  void initialize(XRef *xrefA, Catalog *catalog, Dict *dict);
     1253
     1254  Activation *activation;  // 3DA
     1255};
     1256
     1257//------------------------------------------------------------------------
    9751258// Annots
    9761259//------------------------------------------------------------------------
  • trunk/poppler/mypoppler/poppler/Array.cc

    r2 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/Array.h

    r2 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/ArthurOutputDev.cc

    r250 r257  
    44//
    55// Copyright 2003 Glyph & Cog, LLC
    6 // Copyright 2004 Red Hat, Inc
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
     17// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2008 Pino Toscano <pino@kde.org>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
    722//
    823//========================================================================
     
    91106  globalParams->getEnableFreeType(),
    92107#endif
    93   globalParams->getAntialias());
     108  m_painter->testRenderHint(QPainter::TextAntialiasing));
    94109}
    95110
     
    127142void ArthurOutputDev::updateAll(GfxState *state)
    128143{
    129   updateLineDash(state);
    130   updateLineJoin(state);
    131   updateLineCap(state);
    132   updateLineWidth(state);
    133   updateFlatness(state);
    134   updateMiterLimit(state);
    135   updateFillColor(state);
    136   updateStrokeColor(state);
    137   updateFillOpacity(state);
    138   updateStrokeOpacity(state);
     144  OutputDev::updateAll(state);
    139145  m_needFontUpdate = gTrue;
    140146}
     
    241247void ArthurOutputDev::updateFont(GfxState *state)
    242248{
    243 #ifdef __GNUC__
    244 #warning fix this, probably update with updated code from SplashOutputdev
    245 #endif
    246 /*
    247249  GfxFont *gfxFont;
    248250  GfxFontType fontType;
     
    253255  Ref embRef;
    254256  Object refObj, strObj;
    255   GooString *fileName, *substName;
     257  GooString *fileName;
    256258  char *tmpBuf;
    257259  int tmpBufLen;
    258260  Gushort *codeToGID;
    259261  DisplayFontParam *dfp;
    260   double m11, m12, m21, m22, w1, w2;
     262  double *textMat;
     263  double m11, m12, m21, m22, fontSize;
    261264  SplashCoord mat[4];
    262   char *name;
    263   int c, substIdx, n, code;
     265  int substIdx, n;
     266  int faceIndex = 0;
    264267
    265268  m_needFontUpdate = false;
     
    311314        fileName = dfp->tt.fileName;
    312315        fontType = gfxFont->isCIDFont() ? fontCIDType2 : fontTrueType;
     316        faceIndex = dfp->tt.faceIndex;
    313317        break;
    314318      }
     
    345349      }
    346350      break;
     351    case fontType1COT:
     352      if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
     353                           id,
     354                           fontsrc,
     355                           ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
     356        error(-1, "Couldn't create a font for '%s'",
     357              gfxFont->getName() ? gfxFont->getName()->getCString()
     358                                 : "(unnamed)");
     359        goto err2;
     360      }
     361      break;
    347362    case fontTrueType:
    348       if (!(ff = FoFiTrueType::load(fileName->getCString()))) {
    349         goto err2;
    350       }
    351       codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
    352       delete ff;
     363    case fontTrueTypeOT:
     364        if (fileName)
     365         ff = FoFiTrueType::load(fileName->getCString());
     366        else
     367        ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
     368      if (ff) {
     369        codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
     370        n = 256;
     371        delete ff;
     372      } else {
     373        codeToGID = NULL;
     374        n = 0;
     375      }
    353376      if (!(fontFile = m_fontEngine->loadTrueTypeFont(
    354377                           id,
    355378                           fontsrc,
    356                            codeToGID, 256))) {
     379                           codeToGID, n))) {
    357380        error(-1, "Couldn't create a font for '%s'",
    358381              gfxFont->getName() ? gfxFont->getName()->getCString()
     
    372395      }
    373396      break;
     397    case fontCIDType0COT:
     398      if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
     399                           id,
     400                           fontsrc))) {
     401        error(-1, "Couldn't create a font for '%s'",
     402              gfxFont->getName() ? gfxFont->getName()->getCString()
     403                                 : "(unnamed)");
     404        goto err2;
     405      }
     406      break;
    374407    case fontCIDType2:
    375       n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
    376       codeToGID = (Gushort *)gmallocn(n, sizeof(Gushort));
    377       memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
    378              n * sizeof(Gushort));
     408    case fontCIDType2OT:
     409      codeToGID = NULL;
     410      n = 0;
     411      if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
     412        n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
     413        if (n) {
     414          codeToGID = (Gushort *)gmallocn(n, sizeof(Gushort));
     415          memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
     416                  n * sizeof(Gushort));
     417        }
     418      } else {
     419        if (fileName)
     420          ff = FoFiTrueType::load(fileName->getCString());
     421        else
     422          ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
     423        if (! ff)
     424          goto err2;
     425        codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
     426        delete ff;
     427      }
    379428      if (!(fontFile = m_fontEngine->loadTrueTypeFont(
    380429                           id,
    381430                           fontsrc,
    382                            codeToGID, n))) {
     431                           codeToGID, n, faceIndex))) {
    383432        error(-1, "Couldn't create a font for '%s'",
    384433              gfxFont->getName() ? gfxFont->getName()->getCString()
     
    394443
    395444  // get the font matrix
    396   state->getFontTransMat(&m11, &m12, &m21, &m22);
    397   m11 *= state->getHorizScaling();
    398   m12 *= state->getHorizScaling();
     445  textMat = state->getTextMat();
     446  fontSize = state->getFontSize();
     447  m11 = textMat[0] * fontSize * state->getHorizScaling();
     448  m12 = textMat[1] * fontSize * state->getHorizScaling();
     449  m21 = textMat[2] * fontSize;
     450  m22 = textMat[3] * fontSize;
     451
     452  SplashCoord matrix[6];
     453  {
     454  QMatrix painterMatrix = m_painter->worldMatrix();
     455  matrix[0] = painterMatrix.m11();
     456  matrix[1] = painterMatrix.m12();
     457  matrix[2] = painterMatrix.m21();
     458  matrix[3] = painterMatrix.m22();
     459  matrix[4] = painterMatrix.dx();
     460  matrix[5] = painterMatrix.dy();
     461  }
    399462
    400463  // create the scaled font
    401464  mat[0] = m11;  mat[1] = -m12;
    402465  mat[2] = m21;  mat[3] = -m22;
    403   m_font = m_fontEngine->getFont(fontFile, mat);
     466  m_font = m_fontEngine->getFont(fontFile, mat, matrix);
    404467
    405468  return;
     
    407470 err2:
    408471  delete id;
    409  err1:*/
     472 err1:
    410473  return;
    411474}
  • trunk/poppler/mypoppler/poppler/ArthurOutputDev.h

    r250 r257  
    44//
    55// Copyright 2003 Glyph & Cog, LLC
    6 // Copyright 2004 Red Hat, INC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
     17// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
     18//
     19// To see a description of the changes please see the Changelog file that
     20// came with your tarball or type make ChangeLog if you are building from git
    721//
    822//========================================================================
  • trunk/poppler/mypoppler/poppler/CMap.cc

    r250 r257  
    44//
    55// Copyright 2001-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2008 Koji Otani <sho@bbr.jp>
     17// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     18//
     19// To see a description of the changes please see the Changelog file that
     20// came with your tarball or type make ChangeLog if you are building from git
    621//
    722//========================================================================
     
    368383
    369384      if (cid < rmapSize) {
    370         int cand;
     385        Guint cand;
    371386
    372387        for (cand = 0;cand < ncand;cand++) {
  • trunk/poppler/mypoppler/poppler/CMap.h

    r250 r257  
    44//
    55// Copyright 2001-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2008 Koji Otani <sho@bbr.jp>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/CairoFontEngine.cc

    r250 r257  
    55// Copyright 2003 Glyph & Cog, LLC
    66// Copyright 2004 Red Hat, Inc
     7//
     8//========================================================================
     9
     10//========================================================================
     11//
     12// Modified under the Poppler project - http://poppler.freedesktop.org
     13//
     14// All changes made under the Poppler project to this file are licensed
     15// under GPL version 2 or later
     16//
     17// Copyright (C) 2005-2007 Jeff Muizelaar <jeff@infidigm.net>
     18// Copyright (C) 2005, 2006 Kristian HÞgsberg <krh@redhat.com>
     19// Copyright (C) 2005 Martin Kretzschmar <martink@gnome.org>
     20// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
     21// Copyright (C) 2006, 2007 Carlos Garcia Campos <carlosgc@gnome.org>
     22// Copyright (C) 2007 Koji Otani <sho@bbr.jp>
     23// Copyright (C) 2008 Chris Wilson <chris@chris-wilson.co.uk>
     24//
     25// To see a description of the changes please see the Changelog file that
     26// came with your tarball or type make ChangeLog if you are building from git
    727//
    828//========================================================================
     
    2040#include "Error.h"
    2141
     42#if HAVE_FCNTL_H && HAVE_SYS_MMAN_H && HAVE_SYS_STAT_H
     43#include <fcntl.h>
     44#include <sys/stat.h>
     45#include <sys/mman.h>
     46#define CAN_CHECK_OPEN_FACES 1
     47#endif
     48
    2249#ifdef USE_GCC_PRAGMAS
    2350#pragma implementation
     
    3259//------------------------------------------------------------------------
    3360
    34 static void _ft_done_face (void *data)
    35 {
    36   FT_Face face = (FT_Face) data;
    37   FT_Done_Face (face);
    38 }
     61static cairo_user_data_key_t _ft_cairo_key;
     62
     63static void
     64_ft_done_face_uncached (void *closure)
     65{
     66    FT_Face face = (FT_Face) closure;
     67    FT_Done_Face (face);
     68}
     69
     70static GBool
     71_ft_new_face_uncached (FT_Library lib,
     72                       const char *filename,
     73                       FT_Face *face_out,
     74                       cairo_font_face_t **font_face_out)
     75{
     76  FT_Face face;
     77  cairo_font_face_t *font_face;
     78
     79  if (FT_New_Face (lib, filename, 0, &face))
     80    return gFalse;
     81
     82  font_face = cairo_ft_font_face_create_for_ft_face (face,
     83                                                          FT_LOAD_NO_HINTING |
     84                                                          FT_LOAD_NO_BITMAP);
     85  if (cairo_font_face_set_user_data (font_face,
     86                                     &_ft_cairo_key,
     87                                     face,
     88                                     _ft_done_face_uncached))
     89  {
     90    _ft_done_face_uncached (face);
     91    cairo_font_face_destroy (font_face);
     92    return gFalse;
     93  }
     94
     95  *face_out = face;
     96  *font_face_out = font_face;
     97  return gTrue;
     98}
     99
     100#if CAN_CHECK_OPEN_FACES
     101static struct _ft_face_data {
     102  struct _ft_face_data *prev, *next, **head;
     103
     104  int fd;
     105  unsigned long hash;
     106  size_t size;
     107  unsigned char *bytes;
     108
     109  FT_Library lib;
     110  FT_Face face;
     111  cairo_font_face_t *font_face;
     112} *_ft_open_faces;
     113
     114static unsigned long
     115_djb_hash (const unsigned char *bytes, size_t len)
     116{
     117  unsigned long hash = 5381;
     118  while (len--) {
     119    unsigned char c = *bytes++;
     120    hash *= 33;
     121    hash ^= c;
     122  }
     123  return hash;
     124}
     125
     126static GBool
     127_ft_face_data_equal (struct _ft_face_data *a, struct _ft_face_data *b)
     128{
     129  if (a->lib != b->lib)
     130    return gFalse;
     131  if (a->size != b->size)
     132    return gFalse;
     133  if (a->hash != b->hash)
     134    return gFalse;
     135
     136  return memcmp (a->bytes, b->bytes, a->size) == 0;
     137}
     138
     139static void
     140_ft_done_face (void *closure)
     141{
     142  struct _ft_face_data *data = (struct _ft_face_data *) closure;
     143
     144  if (data->next)
     145    data->next->prev = data->prev;
     146  if (data->prev)
     147    data->prev->next = data->next;
     148  else
     149    _ft_open_faces = data->next;
     150
     151  munmap (data->bytes, data->size);
     152  close (data->fd);
     153
     154  FT_Done_Face (data->face);
     155  gfree (data);
     156}
     157
     158static GBool
     159_ft_new_face (FT_Library lib,
     160              const char *filename,
     161              FT_Face *face_out,
     162              cairo_font_face_t **font_face_out)
     163{
     164  struct _ft_face_data *l;
     165  struct stat st;
     166  struct _ft_face_data tmpl;
     167
     168  /* if we fail to mmap the file, just pass it to FreeType instead */
     169  tmpl.fd = open (filename, O_RDONLY);
     170  if (tmpl.fd == -1)
     171    return _ft_new_face_uncached (lib, filename, face_out, font_face_out);
     172
     173  if (fstat (tmpl.fd, &st) == -1) {
     174    close (tmpl.fd);
     175    return _ft_new_face_uncached (lib, filename, face_out, font_face_out);
     176  }
     177
     178  tmpl.bytes = (unsigned char *) mmap (NULL, st.st_size,
     179                                       PROT_READ, MAP_PRIVATE,
     180                                       tmpl.fd, 0);
     181  if (tmpl.bytes == MAP_FAILED) {
     182    close (tmpl.fd);
     183    return _ft_new_face_uncached (lib, filename, face_out, font_face_out);
     184  }
     185
     186  /* check to see if this is a duplicate of any of the currently open fonts */
     187  tmpl.lib = lib;
     188  tmpl.size = st.st_size;
     189  tmpl.hash = _djb_hash (tmpl.bytes, tmpl.size);
     190
     191  for (l = _ft_open_faces; l; l = l->next) {
     192    if (_ft_face_data_equal (l, &tmpl)) {
     193      munmap (tmpl.bytes, tmpl.size);
     194      close (tmpl.fd);
     195      *face_out = l->face;
     196      *font_face_out = cairo_font_face_reference (l->font_face);
     197      return gTrue;
     198    }
     199  }
     200
     201  /* not a dup, open and insert into list */
     202  if (FT_New_Face (lib, filename, 0, &tmpl.face)) {
     203    munmap (tmpl.bytes, tmpl.size);
     204    close (tmpl.fd);
     205    return gFalse;
     206  }
     207
     208  l = (struct _ft_face_data *) gmallocn (1, sizeof (struct _ft_face_data));
     209  *l = tmpl;
     210  l->prev = NULL;
     211  l->next = _ft_open_faces;
     212  if (_ft_open_faces)
     213    _ft_open_faces->prev = l;
     214  _ft_open_faces = l;
     215
     216  l->font_face = cairo_ft_font_face_create_for_ft_face (tmpl.face,
     217                                                          FT_LOAD_NO_HINTING |
     218                                                          FT_LOAD_NO_BITMAP);
     219  if (cairo_font_face_set_user_data (l->font_face,
     220                                     &_ft_cairo_key,
     221                                     l,
     222                                     _ft_done_face))
     223  {
     224    cairo_font_face_destroy (l->font_face);
     225    _ft_done_face (l);
     226    return NULL;
     227  }
     228
     229  *face_out = l->face;
     230  *font_face_out = l->font_face;
     231  return gTrue;
     232}
     233#else
     234#define _ft_new_face _ft_new_face_uncached
     235#endif
    39236
    40237CairoFont *CairoFont::create(GfxFont *gfxFont, XRef *xref, FT_Library lib, GBool useCIDs) {
     
    51248  FoFiType1C *ff1c;
    52249  Ref ref;
    53   static cairo_user_data_key_t cairo_font_face_key;
    54   cairo_font_face_t *cairo_font_face;
    55250  FT_Face face;
     251  cairo_font_face_t *font_face;
    56252
    57253  Gushort *codeToGID;
     
    61257  codeToGID = NULL;
    62258  codeToGIDLen = 0;
    63   cairo_font_face = NULL;
    64259
    65260  GBool substitute = gFalse;
     
    122317  case fontType1:
    123318  case fontType1C:
    124     if (FT_New_Face(lib, fileName->getCString(), 0, &face)) {
     319    if (! _ft_new_face (lib, fileName->getCString(), &face, &font_face)) {
    125320      error(-1, "could not create type1 face");
    126321      goto err2;
     
    177372    delete ff;
    178373
    179     if (FT_New_Face(lib, tmpFileName2->getCString(), 0, &face)) {
     374    if (! _ft_new_face (lib, tmpFileName2->getCString(), &face, &font_face)) {
    180375      error(-1, "could not create truetype face\n");
    181376      goto err2;
     
    199394    }
    200395
    201     if (FT_New_Face(lib, fileName->getCString(), 0, &face)) {
     396    if (! _ft_new_face (lib, fileName->getCString(), &face, &font_face)) {
    202397      gfree(codeToGID);
    203398      codeToGID = NULL;
     
    221416  }
    222417
    223   cairo_font_face = cairo_ft_font_face_create_for_ft_face (face,
    224                                                            FT_LOAD_NO_HINTING |
    225                                                            FT_LOAD_NO_BITMAP);
    226   if (cairo_font_face_status (cairo_font_face)) {
    227     error(-1, "could not create cairo font: %s\n", cairo_status_to_string (cairo_font_face_status (cairo_font_face)));
    228     goto err2; /* this doesn't do anything, but it looks like we're
    229                 * handling the error */
    230   } {
    231   CairoFont *ret = new CairoFont(ref, cairo_font_face, face, codeToGID, codeToGIDLen, substitute);
    232   cairo_font_face_set_user_data (cairo_font_face,
    233                                  &cairo_font_face_key,
    234                                  face,
    235                                  _ft_done_face);
    236 
    237   return ret;
    238   }
     418  return new CairoFont(ref,
     419                       font_face, face,
     420                       codeToGID, codeToGIDLen,
     421                       substitute);
     422
    239423 err2:
    240424  /* hmm? */
  • trunk/poppler/mypoppler/poppler/CairoFontEngine.h

    r250 r257  
    22//
    33// CairoFontEngine.h
     4//
     5// Copyright 2003 Glyph & Cog, LLC
     6// Copyright 2004 Red Hat, Inc
     7//
     8//========================================================================
     9
     10//========================================================================
     11//
     12// Modified under the Poppler project - http://poppler.freedesktop.org
     13//
     14// All changes made under the Poppler project to this file are licensed
     15// under GPL version 2 or later
     16//
     17// Copyright (C) 2005, 2006 Kristian HÞgsberg <krh@redhat.com>
     18// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
     19// Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net>
     20// Copyright (C) 2006 Carlos Garcia Campos <carlosgc@gnome.org>
     21//
     22// To see a description of the changes please see the Changelog file that
     23// came with your tarball or type make ChangeLog if you are building from git
    424//
    525//========================================================================
  • trunk/poppler/mypoppler/poppler/CairoOutputDev.cc

    r255 r257  
    55// Copyright 2003 Glyph & Cog, LLC
    66// Copyright 2004 Red Hat, Inc
     7//
     8//========================================================================
     9
     10//========================================================================
     11//
     12// Modified under the Poppler project - http://poppler.freedesktop.org
     13//
     14// All changes made under the Poppler project to this file are licensed
     15// under GPL version 2 or later
     16//
     17// Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net>
     18// Copyright (C) 2005, 2006 Kristian HÞgsberg <krh@redhat.com>
     19// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
     20// Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
     21// Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org>
     22// Copyright (C) 2008 Carl Worth <cworth@cworth.org>
     23// Copyright (C) 2008 Adrian Johnson <ajohnson@redneon.com>
     24// Copyright (C) 2008 Michael Vrable <mvrable@cs.ucsd.edu>
     25// Copyright (C) 2008 Chris Wilson <chris@chris-wilson.co.uk>
     26//
     27// To see a description of the changes please see the Changelog file that
     28// came with your tarball or type make ChangeLog if you are building from git
    729//
    830//========================================================================
     
    631653    cairo_transform(cairo_shape, &matrix);
    632654  }
     655  cairo_pattern_destroy(stroke_pattern);
     656  cairo_pattern_reference(fill_pattern);
     657  stroke_pattern = fill_pattern;
    633658  return gFalse;
    634659}
  • trunk/poppler/mypoppler/poppler/CairoOutputDev.h

    r253 r257  
    55// Copyright 2003 Glyph & Cog, LLC
    66// Copyright 2004 Red Hat, INC
     7//
     8//========================================================================
     9
     10//========================================================================
     11//
     12// Modified under the Poppler project - http://poppler.freedesktop.org
     13//
     14// All changes made under the Poppler project to this file are licensed
     15// under GPL version 2 or later
     16//
     17// Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net>
     18// Copyright (C) 2005, 2006 Kristian HÞgsberg <krh@redhat.com>
     19// Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
     20// Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org>
     21// Copyright (C) 2008 Adrian Johnson <ajohnson@redneon.com>
     22// Copyright (C) 2008 Michael Vrable <mvrable@cs.ucsd.edu>
     23//
     24// To see a description of the changes please see the Changelog file that
     25// came with your tarball or type make ChangeLog if you are building from git
    726//
    827//========================================================================
  • trunk/poppler/mypoppler/poppler/Catalog.cc

    r250 r257  
    44//
    55// Copyright 1996-2007 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     17// Copyright (C) 2005-2007 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2005 Jeff Muizelaar <jrmuizel@nit.ca>
     19// Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
     20// Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com>
     21// Copyright (C) 2005, 2006, 2008 Brad Hards <bradh@frogmouth.net>
     22// Copyright (C) 2006, 2008 Carlos Garcia Campos <carlosgc@gnome.org>
     23// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
     24// Copyright (C) 2008 Pino Toscano <pino@kde.org>
     25//
     26// To see a description of the changes please see the Changelog file that
     27// came with your tarball or type make ChangeLog if you are building from git
    628//
    729//========================================================================
     
    114136    obj.dictLookup("EmbeddedFiles", &obj2);
    115137    embeddedFileNameTree.init(xref, &obj2);
     138    obj2.free();
     139    obj.dictLookup("JavaScript", &obj2);
     140    jsNameTree.init(xref, &obj2);
    116141    obj2.free();
    117142  }
     
    176201
    177202  // get the Optional Content dictionary
    178   catDict.dictLookup("OCProperties", &optContentProps);
    179   optContent = new OCGs(&optContentProps, xref);
     203  if (catDict.dictLookup("OCProperties", &optContentProps)->isDict()) {
     204    optContent = new OCGs(&optContentProps, xref);
     205  }
    180206  optContentProps.free();
    181207
     
    212238  destNameTree.free();
    213239  embeddedFileNameTree.free();
     240  jsNameTree.free();
    214241  if (baseURI) {
    215242    delete baseURI;
     
    385412{
    386413    Object efDict;
    387     Object fileSpec;
    388     Object fileDesc;
    389     Object paramDict;
    390     Object paramObj;
    391     Object strObj;
    392     Object obj, obj2;
     414    Object obj;
    393415    obj = embeddedFileNameTree.getValue(i);
    394     GooString *fileName = new GooString();
    395     GooString *desc = new GooString(embeddedFileNameTree.getName(i));
    396     GooString *createDate = new GooString();
    397     GooString *modDate = new GooString();
    398     GooString *checksum = new GooString();
    399     GooString *mimetype = new GooString();
    400     Stream *efStream = NULL;
    401     int size = -1;
     416    EmbFile *embeddedFile = 0;
    402417    if (obj.isRef()) {
    403         if (obj.fetch(xref, &efDict)->isDict()) {
    404             // efDict matches Table 3.40 in the PDF1.6 spec
    405             efDict.dictLookup("F", &fileSpec);
    406             if (fileSpec.isString()) {
    407                 delete fileName;
    408                 fileName = new GooString(fileSpec.getString());
    409             }
    410             fileSpec.free();
    411 
    412             // the logic here is that the description from the name
    413             // dictionary is used if we don't have a more specific
    414             // description - see the Note: on page 157 of the PDF1.6 spec
    415             efDict.dictLookup("Desc", &fileDesc);
    416             if (fileDesc.isString()) {
    417                 delete desc;
    418                 desc = new GooString(fileDesc.getString());
    419             } else {
    420                 efDict.dictLookup("Description", &fileDesc);
    421                 if (fileDesc.isString()) {
    422                     delete desc;
    423                     desc = new GooString(fileDesc.getString());
    424                 }
    425             }
    426             fileDesc.free();
    427            
    428             efDict.dictLookup("EF", &obj2);
    429             if (obj2.isDict()) {
    430                 // This gives us the raw data stream bytes
    431 
    432                 obj2.dictLookup("F", &strObj);
    433                 if (strObj.isStream()) {
    434                     efStream = strObj.getStream();
    435                 }
    436 
    437                 // dataDict corresponds to Table 3.41 in the PDF1.6 spec.
    438                 Dict *dataDict = efStream->getDict();
    439 
    440                 // subtype is normally the mimetype
    441                 Object subtypeName;
    442                 if (dataDict->lookup("Subtype", &subtypeName)->isName()) {
    443                     delete mimetype;
    444                     mimetype = new GooString(subtypeName.getName());
    445                 }
    446                 subtypeName.free();
    447 
    448                 // paramDict corresponds to Table 3.42 in the PDF1.6 spec
    449                 Object paramDict;
    450                 dataDict->lookup( "Params", &paramDict );
    451                 if (paramDict.isDict()) {
    452                     paramDict.dictLookup("ModDate", &paramObj);
    453                     if (paramObj.isString()) {
    454                         delete modDate;
    455                         modDate = new GooString(paramObj.getString());
    456                     }
    457                     paramObj.free();
    458                     paramDict.dictLookup("CreationDate", &paramObj);
    459                     if (paramObj.isString()) {
    460                         delete createDate;
    461                         createDate = new GooString(paramObj.getString());
    462                     }
    463                     paramObj.free();
    464                     paramDict.dictLookup("Size", &paramObj);
    465                     if (paramObj.isInt()) {
    466                         size = paramObj.getInt();
    467                     }
    468                     paramObj.free();
    469                     paramDict.dictLookup("CheckSum", &paramObj);
    470                     if (paramObj.isString()) {
    471                         delete checksum;
    472                         checksum = new GooString(paramObj.getString());
    473                     }
    474                     paramObj.free();
    475                 }
    476                 paramDict.free();
    477             }
    478             efDict.free();
    479             obj2.free();
    480         }
    481     }
    482     EmbFile *embeddedFile = new EmbFile(fileName, desc, size, createDate, modDate, checksum, mimetype, strObj);
    483     strObj.free();
     418        GooString desc(embeddedFileNameTree.getName(i));
     419        embeddedFile = new EmbFile(obj.fetch(xref, &efDict), &desc);
     420        efDict.free();
     421    } else {
     422        Object null;
     423        embeddedFile = new EmbFile(&null);
     424    }
    484425    return embeddedFile;
     426}
     427
     428GooString *Catalog::getJS(int i)
     429{
     430  Object obj = jsNameTree.getValue(i);
     431  if (obj.isRef()) {
     432    Ref r = obj.getRef();
     433    obj.free();
     434    xref->fetch(r.num, r.gen, &obj);
     435  }
     436
     437  if (!obj.isDict()) {
     438    obj.free();
     439    return 0;
     440  }
     441  Object obj2;
     442  if (!obj.dictLookup("S", &obj2)->isName()) {
     443    obj2.free();
     444    obj.free();
     445    return 0;
     446  }
     447  if (strcmp(obj2.getName(), "JavaScript")) {
     448    obj2.free();
     449    obj.free();
     450    return 0;
     451  }
     452  obj.dictLookup("JS", &obj2);
     453  GooString *js = 0;
     454  if (obj2.isString()) {
     455    js = new GooString(obj2.getString());
     456  }
     457  else if (obj2.isStream()) {
     458    Stream *stream = obj2.getStream();
     459    js = new GooString();
     460    stream->reset();
     461    int i;
     462    while ((i = stream->getChar()) != EOF) {
     463      js->append((char)i);
     464    }
     465  }
     466  obj2.free();
     467  obj.free();
     468  return js;
    485469}
    486470
     
    645629  }
    646630}
     631
     632EmbFile::EmbFile(Object *efDict, GooString *description)
     633{
     634  m_name = 0;
     635  m_description = 0;
     636  if (description)
     637    m_description = description->copy();
     638  m_size = -1;
     639  m_createDate = 0;
     640  m_modDate = 0;
     641  m_checksum = 0;
     642  m_mimetype = 0;
     643  if (efDict->isDict()) {
     644    Object fileSpec;
     645    Object fileDesc;
     646    Object paramDict;
     647    Object paramObj;
     648    Object obj2;
     649    Stream *efStream = NULL;
     650    // efDict matches Table 3.40 in the PDF1.6 spec
     651    efDict->dictLookup("F", &fileSpec);
     652    if (fileSpec.isString()) {
     653      m_name = new GooString(fileSpec.getString());
     654    }
     655    fileSpec.free();
     656
     657    // the logic here is that the description from the name
     658    // dictionary is used if we don't have a more specific
     659    // description - see the Note: on page 157 of the PDF1.6 spec
     660    efDict->dictLookup("Desc", &fileDesc);
     661    if (fileDesc.isString()) {
     662      delete m_description;
     663      m_description = new GooString(fileDesc.getString());
     664    } else {
     665      efDict->dictLookup("Description", &fileDesc);
     666      if (fileDesc.isString()) {
     667        delete m_description;
     668        m_description = new GooString(fileDesc.getString());
     669      }
     670    }
     671    fileDesc.free();
     672
     673    efDict->dictLookup("EF", &obj2);
     674    if (obj2.isDict()) {
     675      // This gives us the raw data stream bytes
     676
     677      obj2.dictLookup("F", &m_objStr);
     678      if (m_objStr.isStream()) {
     679        efStream = m_objStr.getStream();
     680
     681        // dataDict corresponds to Table 3.41 in the PDF1.6 spec.
     682        Dict *dataDict = efStream->getDict();
     683
     684        // subtype is normally the mimetype
     685        Object subtypeName;
     686        if (dataDict->lookup("Subtype", &subtypeName)->isName()) {
     687          m_mimetype = new GooString(subtypeName.getName());
     688        }
     689        subtypeName.free();
     690
     691        // paramDict corresponds to Table 3.42 in the PDF1.6 spec
     692        Object paramDict;
     693        dataDict->lookup( "Params", &paramDict );
     694        if (paramDict.isDict()) {
     695          paramDict.dictLookup("ModDate", &paramObj);
     696          if (paramObj.isString()) {
     697            m_modDate = new GooString(paramObj.getString());
     698          }
     699          paramObj.free();
     700          paramDict.dictLookup("CreationDate", &paramObj);
     701          if (paramObj.isString()) {
     702            m_createDate = new GooString(paramObj.getString());
     703          }
     704          paramObj.free();
     705          paramDict.dictLookup("Size", &paramObj);
     706          if (paramObj.isInt()) {
     707            m_size = paramObj.getInt();
     708          }
     709          paramObj.free();
     710          paramDict.dictLookup("CheckSum", &paramObj);
     711          if (paramObj.isString()) {
     712            m_checksum = new GooString(paramObj.getString());
     713          }
     714          paramObj.free();
     715        }
     716        paramDict.free();
     717      }
     718    }
     719    obj2.free();
     720  }
     721  if (!m_name)
     722    m_name = new GooString();
     723  if (!m_description)
     724    m_description = new GooString();
     725  if (!m_createDate)
     726    m_createDate = new GooString();
     727  if (!m_modDate)
     728    m_modDate = new GooString();
     729  if (!m_checksum)
     730    m_checksum = new GooString();
     731  if (!m_mimetype)
     732    m_mimetype = new GooString();
     733}
  • trunk/poppler/mypoppler/poppler/Catalog.h

    r250 r257  
    44//
    55// Copyright 1996-2007 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     17// Copyright (C) 2005, 2007 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
     19// Copyright (C) 2005, 2006, 2008 Brad Hards <bradh@frogmouth.net>
     20// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
     21// Copyright (C) 2008 Pino Toscano <pino@kde.org>
     22//
     23// To see a description of the changes please see the Changelog file that
     24// came with your tarball or type make ChangeLog if you are building from git
    625//
    726//========================================================================
     
    7897    objStr.copy(&m_objStr);
    7998  }
     99  EmbFile(Object *efDict, GooString *description = 0);
    80100
    81101  ~EmbFile()
     
    160180  // Get the i'th file embedded (at the Document level) in the document
    161181  EmbFile *embeddedFile(int i);
     182
     183  // Get the number of javascript scripts
     184  int numJS() { return jsNameTree.numEntries(); }
     185
     186  // Get the i'th JavaScript script (at the Document level) in the document
     187  GooString *getJS(int i);
    162188
    163189  // Convert between page indices and page labels.
     
    206232  NameTree destNameTree;        // named destination name-tree
    207233  NameTree embeddedFileNameTree;  // embedded file name-tree
     234  NameTree jsNameTree;          // Java Script name-tree
    208235  GooString *baseURI;           // base URI for URI-type links
    209236  Object metadata;              // metadata stream
  • trunk/poppler/mypoppler/poppler/CharCodeToUnicode.cc

    r250 r257  
    44//
    55// Copyright 2001-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006, 2008 Albert Astals Cid <aacid@kde.org>
     17// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
     18// Copyright (C) 2007 Koji Otani <sho@bbr.jp>
     19// Copyright (C) 2008 Michael Vrable <mvrable@cs.ucsd.edu>
     20// Copyright (C) 2008 Vasile Gaburici <gaburici@cs.umd.edu>
     21//
     22// To see a description of the changes please see the Changelog file that
     23// came with your tarball or type make ChangeLog if you are building from git
    624//
    725//========================================================================
     
    494512    return 1;
    495513  }
    496   for (i = 0; i < sMapLen; ++i) {
     514  for (i = sMapLen - 1; i >= 0; --i) { // in reverse so CMap takes precedence
    497515    if (sMap[i].c == c) {
    498516      *u = sMap[i].u;
  • trunk/poppler/mypoppler/poppler/CharCodeToUnicode.h

    r250 r257  
    66//
    77// Copyright 2001-2003 Glyph & Cog, LLC
     8//
     9//========================================================================
     10
     11//========================================================================
     12//
     13// Modified under the Poppler project - http://poppler.freedesktop.org
     14//
     15// All changes made under the Poppler project to this file are licensed
     16// under GPL version 2 or later
     17//
     18// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
     19// Copyright (C) 2007 Koji Otani <sho@bbr.jp>
     20// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     21//
     22// To see a description of the changes please see the Changelog file that
     23// came with your tarball or type make ChangeLog if you are building from git
    824//
    925//========================================================================
  • trunk/poppler/mypoppler/poppler/CompactFontTables.h

    r2 r257  
    430430};
    431431
    432 static Gushort type1CExpertCharset[166] = {
     432static const Gushort type1CExpertCharset[166] = {
    433433    0,   1, 229, 230, 231, 232, 233, 234, 235, 236,
    434434  237, 238,  13,  14,  15,  99, 239, 240, 241, 242,
  • trunk/poppler/mypoppler/poppler/DCTStream.cc

    r250 r257  
    33// DCTStream.cc
    44//
    5 // Copyright 1996-2003 Glyph & Cog, LLC
     5// This file is licensed under the GPLv2 or later
     6//
     7// Copyright 2005 Jeff Muizelaar <jeff@infidigm.net>
     8// Copyright 2005-2008 Albert Astals Cid <aacid@kde.org>
    69//
    710//========================================================================
     
    1720  int c;
    1821  struct str_src_mgr * src = (struct str_src_mgr *)cinfo->src;
     22  if (src->abort) return FALSE;
    1923  if (src->index == 0) {
    2024    c = 0xFF;
     
    6367}
    6468
    65 void exitErrorHandler(jpeg_common_struct *error) {
     69static void exitErrorHandler(jpeg_common_struct *error) {
    6670  j_decompress_ptr cinfo = (j_decompress_ptr)error;
    6771  str_src_mgr * src = (struct str_src_mgr *)cinfo->src;
  • trunk/poppler/mypoppler/poppler/DCTStream.h

    r250 r257  
    33// DCTStream.h
    44//
    5 // Copyright 1996-2003 Glyph & Cog, LLC
     5// This file is licensed under the GPLv2 or later
     6//
     7// Copyright 2005 Jeff Muizelaar <jeff@infidigm.net>
     8// Copyright 2005 Martin Kretzschmar <martink@gnome.org>
     9// Copyright 2005-2007 Albert Astals Cid <aacid@kde.org>
    610//
    711//========================================================================
  • trunk/poppler/mypoppler/poppler/Decrypt.cc

    r250 r257  
    77//========================================================================
    88
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2008 Julien Rebetez <julien@fhtagn.net>
     17// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     18//
     19// To see a description of the changes please see the Changelog file that
     20// came with your tarball or type make ChangeLog if you are building from git
     21//
     22//========================================================================
     23
    924#include <config.h>
    1025
     
    1631#include "goo/gmem.h"
    1732#include "Decrypt.h"
     33#include "Error.h"
    1834
    1935static void rc4InitKey(Guchar *key, int keyLen, Guchar *state);
     
    2339static void aesDecryptBlock(DecryptAESState *s, Guchar *in, GBool last);
    2440
    25 static Guchar passwordPad[32] = {
     41static const Guchar passwordPad[32] = {
    2642  0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,
    2743  0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08,
     
    352368//------------------------------------------------------------------------
    353369
    354 static Guchar sbox[256] = {
     370static const Guchar sbox[256] = {
    355371  0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
    356372  0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
     
    371387};
    372388
    373 static Guchar invSbox[256] = {
     389static const Guchar invSbox[256] = {
    374390  0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
    375391  0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
     
    390406};
    391407
    392 static Guint rcon[11] = {
     408static const Guint rcon[11] = {
    393409  0x00000000, // unused
    394410  0x01000000,
     
    600616    }
    601617    s->bufIdx = n;
     618    if (n > 16)
     619    {
     620      error(-1, "Reducing bufIdx from %d to 16 to not crash", n);
     621      s->bufIdx = 16;
     622    }
    602623  }
    603624}
  • trunk/poppler/mypoppler/poppler/Decrypt.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2008 Julien Rebetez <julien@fhtagn.net>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/Dict.cc

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     17// Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
     18// Copyright (C) 2007-2008 Julien Rebetez <julienr@svn.gnome.org>
     19// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     20//
     21// To see a description of the changes please see the Changelog file that
     22// came with your tarball or type make ChangeLog if you are building from git
    623//
    724//========================================================================
     
    7087  int i;
    7188
    72   for (i = 0; i < length; ++i) {
     89  for (i = length - 1; i >=0; --i) {
    7390    if (!strcmp(key, entries[i].key))
    7491      return &entries[i];
  • trunk/poppler/mypoppler/poppler/Dict.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     17// Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
     18// Copyright (C) 2007-2008 Julien Rebetez <julienr@svn.gnome.org>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
    622//
    723//========================================================================
  • trunk/poppler/mypoppler/poppler/Error.cc

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005, 2007 Jeff Muizelaar <jeff@infidigm.net>
     17// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
    622//
    723//========================================================================
  • trunk/poppler/mypoppler/poppler/Error.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005, 2007 Jeff Muizelaar <jeff@infidigm.net>
     17// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
    622//
    723//========================================================================
  • trunk/poppler/mypoppler/poppler/FlateStream.cc

    r134 r257  
    33// FlateStream.cc
    44//
    5 // Copyright (C) 2005, Jeff Muizelaar
     5// Copyright (C) 2005, Jeff Muizelaar <jeff@infidigm.net>
     6//
     7// This file is under the GPLv2 or later license
    68//
    79//========================================================================
  • trunk/poppler/mypoppler/poppler/FlateStream.h

    r250 r257  
    33// FlateStream.h
    44//
    5 // Copyright (C) 2005, Jeff Muizelaar
     5// Copyright (C) 2005, Jeff Muizelaar <jeff@infidigm.net>
     6//
     7// This file is under the GPLv2 or later license
    68//
    79//========================================================================
  • trunk/poppler/mypoppler/poppler/FontInfo.cc

    r254 r257  
     1//========================================================================
     2//
     3// FontInfo.cc
     4//
     5// Copyright (C) 2005, 2006 Kristian HÞgsberg <krh@redhat.com>
     6// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org>
     7// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
     8// Copyright (C) 2006 Kouhei Sutou <kou@cozmixng.org>
     9//
     10// To see a description of the changes please see the Changelog file that
     11// came with your tarball or type make ChangeLog if you are building from git
     12//
     13//========================================================================
     14
     15//========================================================================
     16//
     17// Based on code from pdffonts.cc
     18//
     19// Copyright 2001-2007 Glyph & Cog, LLC
     20//
     21//========================================================================
     22
    123#include "config.h"
    224#include <stdio.h>
     
    167189FontInfo::FontInfo(GfxFont *font, PDFDoc *doc) {
    168190  GooString *origName;
    169   Ref embRef;
    170191  Object fontObj, toUnicodeObj;
    171192  int i;
     
    232253  hasToUnicode = f.hasToUnicode;
    233254  fontRef = f.fontRef;
     255  embRef = f.embRef;
    234256}
    235257
  • trunk/poppler/mypoppler/poppler/FontInfo.h

    r254 r257  
     1//========================================================================
     2//
     3// FontInfo.h
     4//
     5// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     6// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org>
     7// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
     8//
     9// To see a description of the changes please see the Changelog file that
     10// came with your tarball or type make ChangeLog if you are building from git
     11//
     12//========================================================================
     13
     14//========================================================================
     15//
     16// Based on code from pdffonts.cc
     17//
     18// Copyright 2001-2007 Glyph & Cog, LLC
     19//
     20//========================================================================
     21
    122#ifndef FONT_INFO_H
    223#define FONT_INFO_H
     
    3556  GBool      getSubset()    { return subset; };
    3657  GBool      getToUnicode() { return hasToUnicode; };
     58  Ref        getRef()       { return fontRef; };
     59  Ref        getEmbRef()    { return embRef; };
    3760
    3861private:
     
    4467  GBool hasToUnicode;
    4568  Ref fontRef;
     69  Ref embRef;
    4670};
    4771
  • trunk/poppler/mypoppler/poppler/Form.cc

    r250 r257  
    33// Form.cc
    44//
    5 // Copyright 2006 Julien Rebetez
     5// This file is licensed under the GPLv2 or later
     6//
     7// Copyright 2006-2008 Julien Rebetez <julienr@svn.gnome.org>
     8// Copyright 2007 Albert Astals Cid <aacid@kde.org>
     9// Copyright 2007-2008 Carlos Garcia Campos <carlosgc@gnome.org>
     10// Copyright 2007 Adrian Johnson <ajohnson@redneon.com>
     11// Copyright 2007 Iñigo Martínez <inigomartinez@gmail.com>
     12// Copyright 2008 Pino Toscano <pino@kde.org>
     13// Copyright 2008 Michael Vrable <mvrable@cs.ucsd.edu>
    614//
    715//========================================================================
     
    160168  obj2.free ();
    161169
    162   obj1->getDict ()->set ("V", value);
     170  obj1->getDict ()->set (const_cast<char*>(key), value);
    163171  //notify the xref about the update
    164172  xref->setModifiedObject(obj1, ref1);
     
    271279
    272280  if (Form::fieldLookup(dict, "V", &obj1)->isName()) {
    273     if (strcmp (obj1.getName(), "Off") != 0) {
    274       setState(gTrue);
    275     }
     281    Object obj2;
     282    if (dict->lookup("AS", &obj2)->isName(obj1.getName())) {
     283      if (strcmp (obj1.getName(), "Off") != 0) {
     284        setState(gTrue);
     285      }
     286    }
     287    obj2.free();
    276288  } else if (obj1.isArray()) { //handle the case where we have multiple choices
    277289    error(-1, "FormWidgetButton:: multiple choice isn't supported yet\n");
     
    754766  if (Form::fieldLookup(dict, "Ff", &obj1)->isInt()) {
    755767    int flags = obj1.getInt();
     768    if (flags & 0x1) { // 1 -> ReadOnly
     769      readOnly = true;
     770    }
    756771    if (flags & 0x2) { // 2 -> Required
    757772      //TODO
     
    11531168      rootFields[numFields++] = createFieldFromDict (&obj2, xrefA, oref.getRef());
    11541169
    1155       //Mark readonly field
    1156       Object obj3;
    1157       if (Form::fieldLookup(obj2.getDict (), "Ff", &obj3)->isInt()) {
    1158         int flags = obj3.getInt();
    1159         if (flags & 0x1)
    1160           rootFields[numFields-1]->setReadOnly(true);
    1161       }
    1162       obj3.free();
    1163 
    11641170      obj2.free();
    11651171      oref.free();
  • trunk/poppler/mypoppler/poppler/Form.h

    r250 r257  
    33// Form.h
    44//
    5 // Copyright 2006 Julien Rebetez
     5// This file is licensed under the GPLv2 or later
     6//
     7// Copyright 2006 Julien Rebetez <julienr@svn.gnome.org>
     8// Copyright 2007, 2008 Carlos Garcia Campos <carlosgc@gnome.org>
     9// Copyright 2007, 2008 Albert Astals Cid <aacid@kde.org>
    610//
    711//========================================================================
     
    2832  formChoice,
    2933  formSignature,
    30   formUndef,
     34  formUndef
    3135};
    3236
  • trunk/poppler/mypoppler/poppler/Function.cc

    r250 r257  
    44//
    55// Copyright 2001-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006, 2008 Albert Astals Cid <aacid@kde.org>
     17// Copyright (C) 2006 Jeff Muizelaar <jeff@infidigm.net>
     18//
     19// To see a description of the changes please see the Changelog file that
     20// came with your tarball or type make ChangeLog if you are building from git
    621//
    722//========================================================================
     
    650665StitchingFunction::StitchingFunction(StitchingFunction *func) {
    651666  int i;
     667
     668  memcpy(this, func, sizeof(StitchingFunction));
    652669
    653670  k = func->k;
     
    754771// The rest are listed here in alphabetical order.
    755772// The index in this table is equivalent to the entry in PSOp.
    756 char *psOpNames[] = {
     773static const char *psOpNames[] = {
    757774  "abs",
    758775  "add",
  • trunk/poppler/mypoppler/poppler/Gfx.cc

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
     17// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2006 Thorkild Stray <thorkild@ifi.uio.no>
     19// Copyright (C) 2006 Kristian HÞgsberg <krh@redhat.com>
     20// Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org>
     21// Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net>
     22// Copyright (C) 2007, 2008 Brad Hards <bradh@kde.org>
     23// Copyright (C) 2007 Adrian Johnson <ajohnson@redneon.com>
     24// Copyright (C) 2007, 2008 Iñigo Martínez <inigomartinez@gmail.com>
     25// Copyright (C) 2007 Koji Otani <sho@bbr.jp>
     26// Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
     27// Copyright (C) 2008 Pino Toscano <pino@kde.org>
     28// Copyright (C) 2008 Michael Vrable <mvrable@cs.ucsd.edu>
     29//
     30// To see a description of the changes please see the Changelog file that
     31// came with your tarball or type make ChangeLog if you are building from git
    632//
    733//========================================================================
     
    41304156void Gfx::opBeginMarkedContent(Object args[], int numArgs) {
    41314157  // TODO: we really need to be adding this to the markedContentStack
     4158  OCGs *contentConfig = catalog->getOptContentConfig();
     4159       
    41324160  char* name0 = args[0].getName();
    4133   if ( strncmp( name0, "OC", 2) == 0 ) {
     4161  if ( strncmp( name0, "OC", 2) == 0 && contentConfig) {
    41344162    if ( numArgs >= 2 ) {
    41354163      if (!args[1].isName()) {
     
    41404168      if ( res->lookupMarkedContentNF( name1, &markedContent ) ) {
    41414169        if ( markedContent.isRef() ) {
    4142           bool visible = catalog->getOptContentConfig()->optContentIsVisible( &markedContent );
     4170          bool visible = contentConfig->optContentIsVisible( &markedContent );
    41434171          ocSuppressed = !(visible);
    41444172       }
  • trunk/poppler/mypoppler/poppler/Gfx.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
     17// Copyright (C) 2007 Iñigo Martínez <inigomartinez@gmail.com>
     18// Copyright (C) 2008 Brad Hards <bradh@kde.org>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
    622//
    723//========================================================================
  • trunk/poppler/mypoppler/poppler/GfxFont.cc

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// Copyright (C) 2005, 2006, 2008 Albert Astals Cid <aacid@kde.org>
     14// Copyright (C) 2005, 2006 Kristian HÞgsberg <krh@redhat.com>
     15// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
     16// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
     17// Copyright (C) 2007 Jeff Muizelaar <jeff@infidigm.net>
     18// Copyright (C) 2007 Koji Otani <sho@bbr.jp>
     19// Copyright (C) 2007 Ed Catmur <ed@catmur.co.uk>
     20// Copyright (C) 2008 Jonathan Kew <jonathan_kew@sil.org>
     21// Copyright (C) 2008 Ed Avis <eda@waniasset.com>
     22//
     23// To see a description of the changes please see the Changelog file that
     24// came with your tarball or type make ChangeLog if you are building from git
    625//
    726//========================================================================
     
    4362// in the PDF 1.4 spec, with some additions based on empirical
    4463// evidence.
    45 static StdFontMapEntry stdFontMap[] = {
     64static const StdFontMapEntry stdFontMap[] = {
    4665  { "Arial",                        "Helvetica" },
    4766  { "Arial,Bold",                   "Helvetica-Bold" },
     
    482501  FoFiType1 *ffT1;
    483502  FoFiType1C *ffT1C;
    484   int code, code2;
     503  int code;
    485504  char *charName;
    486505  GBool missing, hex;
     
    13741393        };
    13751394        for (size_t i = 0; i < sizeof(knownCollections)/sizeof(knownCollections[0]); i++) {
    1376           if (collection->cmp(knownCollections[i])) {
     1395          if (collection->cmp(knownCollections[i]) == 0) {
    13771396            error(-1, "Missing language pack for '%s' mapping", collection->getCString());
    13781397            delete collection;
     
    17291748#define N_UCS_CANDIDATES 2
    17301749  /* space characters */
    1731   static unsigned long spaces[] = {
     1750  static const unsigned long spaces[] = {
    17321751    0x2000,0x2001,0x2002,0x2003,0x2004,0x2005,0x2006,0x2007,
    17331752    0x2008,0x2009,0x200A,0x00A0,0x200B,0x2060,0x3000,0xFEFF,
     
    19511970    if (gid == 0) {
    19521971      /* special handling space characters */
    1953       unsigned long *p;
     1972      const unsigned long *p;
    19541973
    19551974      if (humap != 0) unicode = humap[code];
  • trunk/poppler/mypoppler/poppler/GfxFont.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005, 2008 Albert Astals Cid <aacid@kde.org>
     17// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
     18// Copyright (C) 2006 Kristian HÞgsberg <krh@redhat.com>
     19// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
     20// Copyright (C) 2007 Jeff Muizelaar <jeff@infidigm.net>
     21// Copyright (C) 2007 Koji Otani <sho@bbr.jp>
     22//
     23// To see a description of the changes please see the Changelog file that
     24// came with your tarball or type make ChangeLog if you are building from git
    625//
    726//========================================================================
  • trunk/poppler/mypoppler/poppler/GfxState.cc

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     17// Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net>
     18// Copyright (C) 2006 Carlos Garcia Campos <carlosgc@gnome.org>
     19// Copyright (C) 2006-2008 Albert Astals Cid <aacid@kde.org>
     20//
     21// To see a description of the changes please see the Changelog file that
     22// came with your tarball or type make ChangeLog if you are building from git
    623//
    724//========================================================================
     
    6784};
    6885
    69 static GfxBlendModeInfo gfxBlendModeNames[] = {
     86static const GfxBlendModeInfo gfxBlendModeNames[] = {
    7087  { "Normal",     gfxBlendNormal },
    7188  { "Compatible", gfxBlendNormal },
     
    700717// This is the inverse of MatrixLMN in Example 4.10 from the PostScript
    701718// Language Reference, Third Edition.
    702 static double xyzrgb[3][3] = {
     719static const double xyzrgb[3][3] = {
    703720  {  3.240449, -1.537136, -0.498531 },
    704721  { -0.969265,  1.876011,  0.041556 },
     
    20942111  y1 = shading->y1;
    20952112  t0 = shading->t0;
    2096   y1 = shading->t1;
     2113  t1 = shading->t1;
    20972114  nFuncs = shading->nFuncs;
    20982115  for (i = 0; i < nFuncs; ++i) {
  • trunk/poppler/mypoppler/poppler/GfxState.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     17// Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net>
     18// Copyright (C) 2006 Carlos Garcia Campos <carlosgc@gnome.org>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
    622//
    723//========================================================================
  • trunk/poppler/mypoppler/poppler/GlobalParams.cc

    r250 r257  
    44//
    55// Copyright 2001-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// Copyright (C) 2005 Martin Kretzschmar <martink@gnome.org>
     14// Copyright (C) 2005, 2006 Kristian HÞgsberg <krh@redhat.com>
     15// Copyright (C) 2005, 2007, 2008 Albert Astals Cid <aacid@kde.org>
     16// Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
     17// Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net>
     18// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
     19// Copyright (C) 2006 Ed Catmur <ed@catmur.co.uk>
     20// Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
     21// Copyright (C) 2007 Jonathan Kew <jonathan_kew@sil.org>
     22//
     23// To see a description of the changes please see the Changelog file that
     24// came with your tarball or type make ChangeLog if you are building from git
    625//
    726//========================================================================
     
    908927}
    909928
    910 GBool findModifier(const char *name, const char *modifier, const char **start)
     929static GBool findModifier(const char *name, const char *modifier, const char **start)
    911930{
    912931  const char *match;
     
    10641083  if (width != -1) FcPatternAddInteger(p, FC_WIDTH, width);
    10651084  if (spacing != -1) FcPatternAddInteger(p, FC_SPACING, spacing);*/
    1066  
     1085
    10671086  p = FcPatternBuild(NULL,
    1068                     FC_FAMILY, FcTypeString, family,
    1069                     FC_SLANT, FcTypeInteger, slant,
    1070                     FC_WEIGHT, FcTypeInteger, weight,
    1071                     FC_WIDTH, FcTypeInteger, width,
    1072                     FC_SPACING, FcTypeInteger, spacing,
    1073                     FC_LANG, FcTypeString, lang,
    1074                     NULL);
     1087                     FC_FAMILY, FcTypeString, family,
     1088                     FC_SLANT, FcTypeInteger, slant,
     1089                     FC_WEIGHT, FcTypeInteger, weight,
     1090                     FC_WIDTH, FcTypeInteger, width,
     1091                     FC_SPACING, FcTypeInteger, spacing,
     1092                     FC_LANG, FcTypeString, lang,
     1093                     NULL);
    10751094 
    10761095  if (deleteFamily)
     
    15451564}
    15461565
     1566GooList *GlobalParams::getEncodingNames()
     1567{
     1568  GooList *result = new GooList;
     1569  GooHashIter *iter;
     1570  GooString *key;
     1571  void *val;
     1572  residentUnicodeMaps->startIter(&iter);
     1573  while (residentUnicodeMaps->getNext(&iter, &key, &val)) {
     1574    result->append(key);
     1575  }
     1576  residentUnicodeMaps->killIter(&iter);
     1577  unicodeMaps->startIter(&iter);
     1578  while (unicodeMaps->getNext(&iter, &key, &val)) {
     1579    result->append(key);
     1580  }
     1581  unicodeMaps->killIter(&iter);
     1582  return result;
     1583}
     1584
    15471585//------------------------------------------------------------------------
    15481586// functions to set parameters
  • trunk/poppler/mypoppler/poppler/GlobalParams.h

    r250 r257  
    44//
    55// Copyright 2001-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005, 2007, 2008 Albert Astals Cid <aacid@kde.org>
     17// Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
     18// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
     19// Copyright (C) 2006 Kristian HÞgsberg <krh@redhat.com>
     20// Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
     21//
     22// To see a description of the changes please see the Changelog file that
     23// came with your tarball or type make ChangeLog if you are building from git
    624//
    725//========================================================================
     
    206224#endif
    207225
     226  GooList *getEncodingNames();
     227
    208228  //----- functions to set parameters
    209229  void setPSExpandSmaller(GBool expand);
  • trunk/poppler/mypoppler/poppler/JBIG2Stream.cc

    r250 r257  
    77//========================================================================
    88
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006 Raj Kumar <rkumar@archive.org>
     17// Copyright (C) 2006 Paul Walmsley <paul@booyaka.com>
     18// Copyright (C) 2006-2008 Albert Astals Cid <aacid@kde.org>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
     22//
     23//========================================================================
     24
    925#include <config.h>
    1026
     
    2541//------------------------------------------------------------------------
    2642
    27 static int contextSize[4] = { 16, 13, 10, 10 };
    28 static int refContextSize[2] = { 13, 10 };
     43static const int contextSize[4] = { 16, 13, 10, 10 };
     44static const int refContextSize[2] = { 13, 10 };
    2945
    3046//------------------------------------------------------------------------
     
    4359};
    4460
    45 JBIG2HuffmanTable huffTableA[] = {
     61static JBIG2HuffmanTable huffTableA[] = {
    4662  {     0, 1,  4,              0x000 },
    4763  {    16, 2,  8,              0x002 },
     
    5167};
    5268
    53 JBIG2HuffmanTable huffTableB[] = {
     69static JBIG2HuffmanTable huffTableB[] = {
    5470  {     0, 1,  0,              0x000 },
    5571  {     1, 2,  0,              0x002 },
     
    6278};
    6379
    64 JBIG2HuffmanTable huffTableC[] = {
     80static JBIG2HuffmanTable huffTableC[] = {
    6581  {     0, 1,  0,              0x000 },
    6682  {     1, 2,  0,              0x002 },
     
    7591};
    7692
    77 JBIG2HuffmanTable huffTableD[] = {
     93static JBIG2HuffmanTable huffTableD[] = {
    7894  {     1, 1,  0,              0x000 },
    7995  {     2, 2,  0,              0x002 },
     
    85101};
    86102
    87 JBIG2HuffmanTable huffTableE[] = {
     103static JBIG2HuffmanTable huffTableE[] = {
    88104  {     1, 1,  0,              0x000 },
    89105  {     2, 2,  0,              0x002 },
     
    97113};
    98114
    99 JBIG2HuffmanTable huffTableF[] = {
     115static JBIG2HuffmanTable huffTableF[] = {
    100116  {     0, 2,  7,              0x000 },
    101117  {   128, 3,  7,              0x002 },
     
    115131};
    116132
    117 JBIG2HuffmanTable huffTableG[] = {
     133static JBIG2HuffmanTable huffTableG[] = {
    118134  {  -512, 3,  8,              0x000 },
    119135  {   256, 3,  8,              0x001 },
     
    134150};
    135151
    136 JBIG2HuffmanTable huffTableH[] = {
     152static JBIG2HuffmanTable huffTableH[] = {
    137153  {     0, 2,  1,              0x000 },
    138154  {     0, 2, jbig2HuffmanOOB, 0x001 },
     
    159175};
    160176
    161 JBIG2HuffmanTable huffTableI[] = {
     177static JBIG2HuffmanTable huffTableI[] = {
    162178  {     0, 2, jbig2HuffmanOOB, 0x000 },
    163179  {    -1, 3,  1,              0x002 },
     
    185201};
    186202
    187 JBIG2HuffmanTable huffTableJ[] = {
     203static JBIG2HuffmanTable huffTableJ[] = {
    188204  {    -2, 2,  2,              0x000 },
    189205  {     6, 2,  6,              0x001 },
     
    210226};
    211227
    212 JBIG2HuffmanTable huffTableK[] = {
     228static JBIG2HuffmanTable huffTableK[] = {
    213229  {     1, 1,  0,              0x000 },
    214230  {     2, 2,  1,              0x002 },
     
    227243};
    228244
    229 JBIG2HuffmanTable huffTableL[] = {
     245static JBIG2HuffmanTable huffTableL[] = {
    230246  {     1, 1,  0,              0x000 },
    231247  {     2, 2,  0,              0x002 },
     
    244260};
    245261
    246 JBIG2HuffmanTable huffTableM[] = {
     262static JBIG2HuffmanTable huffTableM[] = {
    247263  {     1, 1,  0,              0x000 },
    248264  {     2, 3,  0,              0x004 },
     
    261277};
    262278
    263 JBIG2HuffmanTable huffTableN[] = {
     279static JBIG2HuffmanTable huffTableN[] = {
    264280  {     0, 1,  0,              0x000 },
    265281  {    -2, 3,  0,              0x004 },
     
    270286};
    271287
    272 JBIG2HuffmanTable huffTableO[] = {
     288static JBIG2HuffmanTable huffTableO[] = {
    273289  {     0, 1,  0,              0x000 },
    274290  {    -1, 3,  0,              0x004 },
     
    472488
    473489int JBIG2MMRDecoder::get2DCode() {
    474   CCITTCode *p;
     490  const CCITTCode *p;
    475491
    476492  if (bufLen == 0) {
     
    499515
    500516int JBIG2MMRDecoder::getWhiteCode() {
    501   CCITTCode *p;
     517  const CCITTCode *p;
    502518  Guint code;
    503519
     
    542558
    543559int JBIG2MMRDecoder::getBlackCode() {
    544   CCITTCode *p;
     560  const CCITTCode *p;
    545561  Guint code;
    546562
     
    15511567  for (i = 0; i < nRefSegs; ++i) {
    15521568    seg = findSegment(refSegs[i]);
    1553     if (seg->getType() == jbig2SegSymbolDict) {
     1569    if (seg != NULL && seg->getType() == jbig2SegSymbolDict) {
    15541570      inputSymbolDict = (JBIG2SymbolDict *)seg;
    15551571      for (j = 0; j < inputSymbolDict->getSize(); ++j) {
     
    23842400  }
    23852401  seg = findSegment(refSegs[0]);
    2386   if (seg->getType() != jbig2SegPatternDict) {
     2402  if (seg == NULL || seg->getType() != jbig2SegPatternDict) {
    23872403    error(getPos(), "Bad symbol dictionary reference in JBIG2 halftone segment");
    23882404    return;
     
    29702986  if (nRefSegs == 1) {
    29712987    seg = findSegment(refSegs[0]);
    2972     if (seg->getType() != jbig2SegBitmap) {
     2988    if (seg == NULL || seg->getType() != jbig2SegBitmap) {
    29732989      error(getPos(), "Bad bitmap reference in JBIG2 generic refinement segment");
    29742990      return;
  • trunk/poppler/mypoppler/poppler/JPXStream.cc

    r250 r257  
    44//
    55// Copyright 2002-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
     
    6680//               = 1 for LH and LL
    6781//               = 2 for HH
    68 static Guint sigPropContext[3][3][5][3] = {
     82static const Guint sigPropContext[3][3][5][3] = {
    6983  {{{ 0, 0, 0 },   // horiz=0, vert=0, diag=0
    7084    { 1, 1, 3 },   // horiz=0, vert=0, diag=1
     
    120134// and k = 0 for the context
    121135//       = 1 for the xor bit
    122 static Guint signContext[5][5][2] = {
     136static const Guint signContext[5][5][2] = {
    123137  {{ 13, 1 },  // horiz=-2, vert=-2
    124138   { 13, 1 },  // horiz=-2, vert=-1
  • trunk/poppler/mypoppler/poppler/Lexer.cc

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006-2008 Albert Astals Cid <aacid@kde.org>
     17// Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
     18//
     19// To see a description of the changes please see the Changelog file that
     20// came with your tarball or type make ChangeLog if you are building from git
    621//
    722//========================================================================
     
    2540// A '1' in this array means the character is white space.  A '1' or
    2641// '2' means the character ends a name or command.
    27 static char specialChars[256] = {
     42static const char specialChars[256] = {
    2843  1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0,   // 0x
    2944  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   // 1x
  • trunk/poppler/mypoppler/poppler/Lexer.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006, 2007 Albert Astals Cid <aacid@kde.org>
     17// Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
     18//
     19// To see a description of the changes please see the Changelog file that
     20// came with your tarball or type make ChangeLog if you are building from git
    621//
    722//========================================================================
  • trunk/poppler/mypoppler/poppler/Link.cc

    r254 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006, 2008 Pino Toscano <pino@kde.org>
     17// Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
     18// Copyright (C) 2008 Hugo Mercier <hmercier31@gmail.com>
     19// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     20//
     21// To see a description of the changes please see the Changelog file that
     22// came with your tarball or type make ChangeLog if you are building from git
    623//
    724//========================================================================
     
    2441#include "Sound.h"
    2542#include "Movie.h"
     43#include "FileSpec.h"
    2644
    2745//------------------------------------------------------------------------
     
    94112    action = new LinkSound(obj);
    95113
     114  // JavaScript action
     115  } else if (obj2.isName("JavaScript")) {
     116    obj->dictLookup("JS", &obj3);
     117    action = new LinkJavaScript(&obj3);
     118    obj3.free();
     119
    96120  // unknown action
    97121  } else if (obj2.isName()) {
     
    112136  }
    113137  return action;
    114 }
    115 
    116 GooString *LinkAction::getFileSpecName(Object *fileSpecObj) {
    117   GooString *name;
    118   Object obj1;
    119 
    120   name = NULL;
    121 
    122   // string
    123   if (fileSpecObj->isString()) {
    124     name = fileSpecObj->getString()->copy();
    125 
    126   // dictionary
    127   } else if (fileSpecObj->isDict()) {
    128 #ifdef WIN32
    129     if (!fileSpecObj->dictLookup("DOS", &obj1)->isString()) {
    130 #else
    131     if (!fileSpecObj->dictLookup("Unix", &obj1)->isString()) {
    132 #endif
    133       obj1.free();
    134       fileSpecObj->dictLookup("F", &obj1);
    135     }
    136     if (obj1.isString()) {
    137       name = obj1.getString()->copy();
    138     } else {
    139       error(-1, "Illegal file spec in link");
    140     }
    141     obj1.free();
    142 
    143   // error
    144   } else {
    145     error(-1, "Illegal file spec in link");
    146   }
    147 
    148   // system-dependent path manipulation
    149   if (name) {
    150 #ifdef WIN32
    151     int i, j;
    152 
    153     // "//...."             --> "\...."
    154     // "/x/...."            --> "x:\...."
    155     // "/server/share/...." --> "\\server\share\...."
    156     // convert escaped slashes to slashes and unescaped slashes to backslashes
    157     i = 0;
    158     if (name->getChar(0) == '/') {
    159       if (name->getLength() >= 2 && name->getChar(1) == '/') {
    160         name->del(0);
    161         i = 0;
    162       } else if (name->getLength() >= 2 &&
    163                  ((name->getChar(1) >= 'a' && name->getChar(1) <= 'z') ||
    164                   (name->getChar(1) >= 'A' && name->getChar(1) <= 'Z')) &&
    165                  (name->getLength() == 2 || name->getChar(2) == '/')) {
    166         name->setChar(0, name->getChar(1));
    167         name->setChar(1, ':');
    168         i = 2;
    169       } else {
    170         for (j = 2; j < name->getLength(); ++j) {
    171           if (name->getChar(j-1) != '\\' &&
    172               name->getChar(j) == '/') {
    173             break;
    174           }
    175         }
    176         if (j < name->getLength()) {
    177           name->setChar(0, '\\');
    178           name->insert(0, '\\');
    179           i = 2;
    180         }
    181       }
    182     }
    183     for (; i < name->getLength(); ++i) {
    184       if (name->getChar(i) == '/') {
    185         name->setChar(i, '\\');
    186       } else if (name->getChar(i) == '\\' &&
    187                  i+1 < name->getLength() &&
    188                  name->getChar(i+1) == '/') {
    189         name->del(i);
    190       }
    191     }
    192 #else
    193     // no manipulation needed for Unix
    194 #endif
    195   }
    196 
    197   return name;
    198138}
    199139
     
    483423
    484424  // get file name
    485   fileName = getFileSpecName(fileSpecObj);
     425  Object obj1;
     426  getFileSpecNameForPlatform (fileSpecObj, &obj1);
     427  fileName = obj1.getString()->copy();
     428  obj1.free();
    486429
    487430  // named destination
     
    520463
    521464LinkLaunch::LinkLaunch(Object *actionObj) {
    522   Object obj1, obj2;
     465  Object obj1, obj2, obj3;
    523466
    524467  fileName = NULL;
     
    527470  if (actionObj->isDict()) {
    528471    if (!actionObj->dictLookup("F", &obj1)->isNull()) {
    529       fileName = getFileSpecName(&obj1);
     472      getFileSpecNameForPlatform (&obj1, &obj3);
     473      fileName = obj3.getString()->copy();
     474      obj3.free();
    530475    } else {
    531476      obj1.free();
     
    533478      if (actionObj->dictLookup("Win", &obj1)->isDict()) {
    534479        obj1.dictLookup("F", &obj2);
    535         fileName = getFileSpecName(&obj2);
     480        getFileSpecNameForPlatform (&obj2, &obj3);
     481        fileName = obj3.getString()->copy();
     482        obj3.free();
    536483        obj2.free();
    537484        if (obj1.dictLookup("P", &obj2)->isString()) {
     
    547494      if (actionObj->dictLookup("Unix", &obj1)->isDict()) {
    548495        obj1.dictLookup("F", &obj2);
    549         fileName = getFileSpecName(&obj2);
     496        getFileSpecNameForPlatform (&obj2, &obj3);
     497        fileName = obj3.getString()->copy();
     498        obj3.free();
    550499        obj2.free();
    551500        if (obj1.dictLookup("P", &obj2)->isString()) {
     
    780729
    781730//------------------------------------------------------------------------
     731// LinkJavaScript
     732//------------------------------------------------------------------------
     733
     734LinkJavaScript::LinkJavaScript(Object *jsObj) {
     735  js = NULL;
     736
     737  if (jsObj->isString()) {
     738    js = new GooString(jsObj->getString());
     739  }
     740  else if (jsObj->isStream()) {
     741    Stream *stream = jsObj->getStream();
     742    js = new GooString();
     743    stream->reset();
     744    int i;
     745    while ((i = stream->getChar()) != EOF) {
     746      js->append((char)i);
     747    }
     748  }
     749}
     750
     751LinkJavaScript::~LinkJavaScript() {
     752  if (js) {
     753    delete js;
     754  }
     755}
     756
     757//------------------------------------------------------------------------
    782758// LinkUnknown
    783759//------------------------------------------------------------------------
  • trunk/poppler/mypoppler/poppler/Link.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006, 2008 Pino Toscano <pino@kde.org>
     17// Copyright (C) 2008 Hugo Mercier <hmercier31@gmail.com>
     18//
     19// To see a description of the changes please see the Changelog file that
     20// came with your tarball or type make ChangeLog if you are building from git
    621//
    722//========================================================================
     
    3550  actionRendition,
    3651  actionSound,                  // sound action
     52  actionJavaScript,             // JavaScript action
    3753  actionUnknown                 // anything else
    3854};
     
    5571  // Parse an action dictionary.
    5672  static LinkAction *parseAction(Object *obj, GooString *baseURI = NULL);
    57 
    58   // Extract a file name from a file specification (string or
    59   // dictionary).
    60   static GooString *getFileSpecName(Object *fileSpecObj);
    6173};
    6274
     
    360372
    361373//------------------------------------------------------------------------
     374// LinkJavaScript
     375//------------------------------------------------------------------------
     376
     377class LinkJavaScript: public LinkAction {
     378public:
     379
     380  // Build a LinkJavaScript given the action name.
     381  LinkJavaScript(Object *jsObj);
     382
     383  virtual ~LinkJavaScript();
     384
     385  virtual GBool isOk() { return js != NULL; }
     386
     387  virtual LinkActionKind getKind() { return actionJavaScript; }
     388  GooString *getScript() { return js; }
     389
     390private:
     391
     392  GooString *js;
     393};
     394
     395//------------------------------------------------------------------------
    362396// LinkUnknown
    363397//------------------------------------------------------------------------
  • trunk/poppler/mypoppler/poppler/Makefile

    r250 r257  
    1919        XpdfPluginAPI.obj Form.obj Movie.obj OptionalContent.obj \
    2020        PageTransition.obj PreScanOutputDev.obj Sound.obj DCTStream.obj
     21OBJS5 = FileSpec.obj       
    2122       
    2223# DCTStream.obj
     
    2425all: $(LIBS)
    2526
    26 $(LIBS): $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4)
     27$(LIBS): $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5)
    2728        rm -f $(LIBS)
    2829        wlib -b -q $@ + $(OBJS1)
     
    3031        wlib -b -q $@ + $(OBJS3)
    3132        wlib -b -q $@ + $(OBJS4)
     33        wlib -b -q $@ + $(OBJS5)
    3234
    3335.c.obj:
  • trunk/poppler/mypoppler/poppler/Movie.cc

    r250 r257  
    22//                               Movie.cc
    33//---------------------------------------------------------------------------------
     4//
     5//---------------------------------------------------------------------------------
    46// Hugo Mercier <hmercier31[at]gmail.com> (c) 2008
     7// Pino Toscano <pino@kde.org> (c) 2008
    58//
    6 // GNU GENERAL PUBLIC LICENSE - See COPYING.
     9// This program is free software; you can redistribute it and/or modify
     10// it under the terms of the GNU General Public License as published by
     11// the Free Software Foundation; either version 2 of the License, or
     12// (at your option) any later version.
     13//
     14// This program is distributed in the hope that it will be useful,
     15// but WITHOUT ANY WARRANTY; without even the implied warranty of
     16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17// GNU General Public License for more details.
     18//
     19// You should have received a copy of the GNU General Public License
     20// along with this program; if not, write to the Free Software
     21// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    722//*********************************************************************************
    823
     
    432447  Movie* new_movie = new Movie(*this);
    433448
    434   new_movie->contentType = contentType->copy();
    435   new_movie->fileName = fileName->copy();
    436 
    437   new_movie->embeddedStream = embeddedStream;
    438   new_movie->embeddedStream->incRef();
     449  if (contentType)
     450    new_movie->contentType = contentType->copy();
     451  if (fileName)
     452    new_movie->fileName = fileName->copy();
     453
     454  if (new_movie->embeddedStream)
     455    new_movie->embeddedStream->incRef();
    439456 
    440   new_movie->posterStream = posterStream;
    441   new_movie->posterStream->incRef();
     457  if (new_movie->posterStream)
     458    new_movie->posterStream->incRef();
    442459
    443460  return new_movie;
  • trunk/poppler/mypoppler/poppler/Object.cc

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
     
    2539//------------------------------------------------------------------------
    2640
    27 char *objTypeNames[numObjTypes] = {
     41static char *objTypeNames[numObjTypes] = {
    2842  "boolean",
    2943  "integer",
  • trunk/poppler/mypoppler/poppler/Object.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
     17// Copyright (C) 2008 Kees Cook <kees@outflux.net>
     18// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
    622//
    723//========================================================================
     
    3349        error(0, "Call to Object where the object was type %d, " \
    3450                 "not the expected type %d", type, wanted_type); \
     51        abort(); \
     52    }
     53
     54#define OBJECT_2TYPES_CHECK(wanted_type1, wanted_type2) \
     55    if (unlikely(type != wanted_type1) && unlikely(type != wanted_type2)) { \
     56        error(0, "Call to Object where the object was type %d, " \
     57                 "not the expected type %d or %d", type, wanted_type1, wanted_type2); \
    3558        abort(); \
    3659    }
     
    163186    { return type == objCmd && !strcmp(cmd, cmdA); }
    164187
    165   // Accessors.  NB: these assume object is of correct type.
    166   GBool getBool() { return booln; }
    167   int getInt() { return intg; }
    168   double getReal() { return real; }
    169   double getNum() { return type == objInt ? (double)intg : real; }
    170   GooString *getString() { return string; }
    171   char *getName() { return name; }
    172   Array *getArray() { return array; }
    173   Dict *getDict() { return dict; }
    174   Stream *getStream() { return stream; }
    175   Ref getRef() { return ref; }
    176   int getRefNum() { return ref.num; }
    177   int getRefGen() { return ref.gen; }
    178   char *getCmd() { return cmd; }
     188  // Accessors.
     189  GBool getBool() { OBJECT_TYPE_CHECK(objBool); return booln; }
     190  int getInt() { OBJECT_TYPE_CHECK(objInt); return intg; }
     191  double getReal() { OBJECT_TYPE_CHECK(objReal); return real; }
     192  double getNum() { OBJECT_2TYPES_CHECK(objInt, objReal); return type == objInt ? (double)intg : real; }
     193  GooString *getString() { OBJECT_TYPE_CHECK(objString); return string; }
     194  char *getName() { OBJECT_TYPE_CHECK(objName); return name; }
     195  Array *getArray() { OBJECT_TYPE_CHECK(objArray); return array; }
     196  Dict *getDict() { OBJECT_TYPE_CHECK(objDict); return dict; }
     197  Stream *getStream() { OBJECT_TYPE_CHECK(objStream); return stream; }
     198  Ref getRef() { OBJECT_TYPE_CHECK(objRef); return ref; }
     199  int getRefNum() { OBJECT_TYPE_CHECK(objRef); return ref.num; }
     200  int getRefGen() { OBJECT_TYPE_CHECK(objRef); return ref.gen; }
     201  char *getCmd() { OBJECT_TYPE_CHECK(objCmd); return cmd; }
    179202
    180203  // Array accessors.
  • trunk/poppler/mypoppler/poppler/OptionalContent.cc

    r250 r257  
    11//========================================================================
    22//
    3 // OptionalContent.h
     3// OptionalContent.cc
    44//
    55// Copyright 2007 Brad Hards <bradh@kde.org>
     6// Copyright 2008 Pino Toscano <pino@kde.org>
     7// Copyright 2008 Carlos Garcia Campos <carlosgc@gnome.org>
     8// Copyright 2008 Albert Astals Cid <aacid@kde.org>
     9// Copyright 2008 Mark Kaplan <mkaplan@finjan.com>
    610//
    711// Released under the GPL (version 2, or later, at your option)
     
    2731  m_orderArray(0), m_rBGroupsArray(), m_xref(xref)
    2832{
    29   optionalContentGroups = NULL;
    30 
    31   if (!ocgObject->isDict()) {
    32     // This isn't an error - OCProperties is optional.
    33     return;
    34   }
    35 
    3633  // we need to parse the dictionary here, and build optionalContentGroups
    3734  optionalContentGroups = new GooList();
     
    145142OCGs::~OCGs()
    146143{
    147   if (optionalContentGroups) {
    148     deleteGooList(optionalContentGroups, OptionalContentGroup);
    149   }
     144  deleteGooList(optionalContentGroups, OptionalContentGroup);
    150145}
    151146
     
    153148bool OCGs::hasOCGs()
    154149{
    155   if (!optionalContentGroups) {
    156     return false;
    157   }
    158150  return ( optionalContentGroups->getLength() > 0 );
    159151}
     
    163155  //TODO: make this more efficient
    164156  OptionalContentGroup *ocg = NULL;
    165   if (optionalContentGroups != NULL)
    166   {
    167     for (int i=0; i < optionalContentGroups->getLength(); ++i) {
    168       ocg = (OptionalContentGroup*)optionalContentGroups->get(i);
    169       if ( (ocg->ref().num == ref.num) && (ocg->ref().gen == ref.gen) ) {
    170         return ocg;
    171       }
     157  for (int i=0; i < optionalContentGroups->getLength(); ++i) {
     158    ocg = (OptionalContentGroup*)optionalContentGroups->get(i);
     159    if ( (ocg->ref().num == ref.num) && (ocg->ref().gen == ref.gen) ) {
     160      return ocg;
    172161    }
    173162  }
     
    297286//------------------------------------------------------------------------
    298287
    299 OptionalContentGroup::OptionalContentGroup(Dict *ocgDict, XRef *xrefA)
     288OptionalContentGroup::OptionalContentGroup(Dict *ocgDict, XRef *xrefA) : m_name(NULL)
    300289{
    301290  Object ocgName;
  • trunk/poppler/mypoppler/poppler/Outline.cc

    r250 r257  
    44//
    55// Copyright 2002-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/Outline.h

    r2 r257  
    44//
    55// Copyright 2002-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/OutputDev.cc

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
     17// Copyright (C) 2006 Thorkild Stray <thorkild@ifi.uio.no>
     18// Copyright (C) 2007 Adrian Johnson <ajohnson@redneon.com>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
    622//
    723//========================================================================
  • trunk/poppler/mypoppler/poppler/OutputDev.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
     17// Copyright (C) 2006 Thorkild Stray <thorkild@ifi.uio.no>
     18// Copyright (C) 2007 Jeff Muizelaar <jeff@infidigm.net>
     19// Copyright (C) 2007 Adrian Johnson <ajohnson@redneon.com>
     20//
     21// To see a description of the changes please see the Changelog file that
     22// came with your tarball or type make ChangeLog if you are building from git
    623//
    724//========================================================================
  • trunk/poppler/mypoppler/poppler/PDFDoc.cc

    r254 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005, 2006, 2008 Brad Hards <bradh@frogmouth.net>
     17// Copyright (C) 2005, 2007, 2008 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2008 Julien Rebetez <julienr@svn.gnome.org>
     19// Copyright (C) 2008 Pino Toscano <pino@kde.org>
     20// Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
     21//
     22// To see a description of the changes please see the Changelog file that
     23// came with your tarball or type make ChangeLog if you are building from git
    624//
    725//========================================================================
     
    462480
    463481GBool PDFDoc::saveAs(OutStream *outStr, PDFWriteMode mode) {
     482
     483  // we don't support files with Encrypt at the moment
     484  Object obj;
     485  xref->getTrailerDict()->getDict()->lookupNF("Encrypt", &obj);
     486  if (!obj.isNull())
     487  {
     488    obj.free();
     489    return gFalse;
     490  }
     491  obj.free();
     492
    464493  if (mode == writeForceRewrite) {
    465494    saveCompleteRewrite(outStr);
  • trunk/poppler/mypoppler/poppler/PDFDoc.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005, 2006, 2008 Brad Hards <bradh@frogmouth.net>
     17// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2008 Julien Rebetez <julienr@svn.gnome.org>
     19// Copyright (C) 2008 Pino Toscano <pino@kde.org>
     20// Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
     21//
     22// To see a description of the changes please see the Changelog file that
     23// came with your tarball or type make ChangeLog if you are building from git
    624//
    725//========================================================================
  • trunk/poppler/mypoppler/poppler/PDFDocEncoding.cc

    r250 r257  
    11//========================================================================
    22//
    3 // PDFDocEncoding.h
     3// PDFDocEncoding.cc
    44//
    55// Copyright 2002-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2008 Michael Vrable <mvrable@cs.ucsd.edu>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/PDFDocEncoding.h

    r250 r257  
    44//
    55// Copyright 2002-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2007 Adrian Johnson <ajohnson@redneon.com>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/PSOutputDev.cc

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Martin Kretzschmar <martink@gnome.org>
     17// Copyright (C) 2005, 2006 Kristian HÞgsberg <krh@redhat.com>
     18// Copyright (C) 2006-2008 Albert Astals Cid <aacid@kde.org>
     19// Copyright (C) 2006 Jeff Muizelaar <jeff@infidigm.net>
     20// Copyright (C) 2007, 2008 Brad Hards <bradh@kde.org>
     21//
     22// To see a description of the changes please see the Changelog file that
     23// came with your tarball or type make ChangeLog if you are building from git
    624//
    725//========================================================================
     
    3755#include "XRef.h"
    3856#include "PreScanOutputDev.h"
     57#include "FileSpec.h"
    3958#if HAVE_SPLASH
    4059#  include "splash/Splash.h"
     
    754773};
    755774
    756 static char *psFonts[] = {
     775static const char *psFonts[] = {
    757776  "Courier",
    758777  "Courier-Bold",
     
    772791};
    773792
    774 static PSSubstFont psSubstFonts[] = {
     793static const PSSubstFont psSubstFonts[] = {
    775794  {"Helvetica",             0.833},
    776795  {"Helvetica-Oblique",     0.833},
     
    13311350  char *q;
    13321351
    1333   writePSFmt("%%BeginResource: procset xpdf {0:s} 0\n", xpdfVersion);
     1352  writePSFmt("%%BeginResource: procset xpdf {0:s} 0\n", "3.00");
    13341353  writePSFmt("%%Copyright: {0:s}\n", xpdfCopyright);
    13351354  lev1 = lev2 = lev3 = sep = nonSep = gTrue;
     
    18521871
    18531872void PSOutputDev::setupEmbeddedType1Font(Ref *id, GooString *psName) {
    1854   static char hexChar[17] = "0123456789abcdef";
     1873  static const char hexChar[17] = "0123456789abcdef";
    18551874  Object refObj, strObj, obj1, obj2, obj3;
    18561875  Dict *dict;
     
    43614380      delete str;
    43624381    } else {
     4382      // make sure the image is setup, it sometimes is not like on bug #17645
     4383      setupImage(ref->getRef(), str);
    43634384      // set up to use the array already created by setupImages()
    43644385      writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
     
    48224843      delete str2;
    48234844    } else {
     4845      // make sure the image is setup, it sometimes is not like on bug #17645
     4846      setupImage(ref->getRef(), str);
    48244847      // set up to use the array already created by setupImages()
    48254848      writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
     
    50905113      delete str2;
    50915114    } else {
     5115      // make sure the image is setup, it sometimes is not like on bug #17645
     5116      setupImage(ref->getRef(), str);
    50925117      // set up to use the array already created by setupImages()
    50935118      writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
     
    56305655
    56315656  dict->lookup("F", &obj1);
    5632   if (getFileSpec(&obj1, &obj2)) {
     5657  if (getFileSpecName(&obj1, &obj2)) {
    56335658    writePSFmt("%%ImageFileName: {0:t}\n", obj2.getString());
    56345659    obj2.free();
     
    57465771
    57475772  dict->lookup("F", &obj1);
    5748   if (getFileSpec(&obj1, &obj2)) {
     5773  if (getFileSpecName(&obj1, &obj2)) {
    57495774    writePSFmt("%ALDImageFileName: {0:t}\n", obj2.getString());
    57505775    obj2.free();
     
    59976022  }
    59986023}
    5999 
    6000 GBool PSOutputDev::getFileSpec(Object *fileSpec, Object *fileName) {
    6001   if (fileSpec->isString()) {
    6002     fileSpec->copy(fileName);
    6003     return gTrue;
    6004   }
    6005   if (fileSpec->isDict()) {
    6006     fileSpec->dictLookup("DOS", fileName);
    6007     if (fileName->isString()) {
    6008       return gTrue;
    6009     }
    6010     fileName->free();
    6011     fileSpec->dictLookup("Mac", fileName);
    6012     if (fileName->isString()) {
    6013       return gTrue;
    6014     }
    6015     fileName->free();
    6016     fileSpec->dictLookup("Unix", fileName);
    6017     if (fileName->isString()) {
    6018       return gTrue;
    6019     }
    6020     fileName->free();
    6021     fileSpec->dictLookup("F", fileName);
    6022     if (fileName->isString()) {
    6023       return gTrue;
    6024     }
    6025     fileName->free();
    6026   }
    6027   return gFalse;
    6028 }
    60296024#endif // OPI_SUPPORT
    60306025
  • trunk/poppler/mypoppler/poppler/PSOutputDev.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Martin Kretzschmar <martink@gnome.org>
     17// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     18// Copyright (C) 2006, 2007 Albert Astals Cid <aacid@kde.org>
     19// Copyright (C) 2007 Brad Hards <bradh@kde.org>
     20//
     21// To see a description of the changes please see the Changelog file that
     22// came with your tarball or type make ChangeLog if you are building from git
    623//
    724//========================================================================
     
    303320  void opiTransform(GfxState *state, double x0, double y0,
    304321                    double *x1, double *y1);
    305   GBool getFileSpec(Object *fileSpec, Object *fileName);
    306322#endif
    307323  void cvtFunction(Function *func);
  • trunk/poppler/mypoppler/poppler/PSTokenizer.cc

    r250 r257  
    44//
    55// Copyright 2002-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006 Scott Turner <scotty1024@mac.com>
     17// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     18//
     19// To see a description of the changes please see the Changelog file that
     20// came with your tarball or type make ChangeLog if you are building from git
    621//
    722//========================================================================
     
    2136// A '1' in this array means the character is white space.  A '1' or
    2237// '2' means the character ends a name or command.
    23 static char specialChars[256] = {
     38static const char specialChars[256] = {
    2439  1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0,   // 0x
    2540  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   // 1x
  • trunk/poppler/mypoppler/poppler/PSTokenizer.h

    r250 r257  
    44//
    55// Copyright 2002-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006 Scott Turner <scotty1024@mac.com>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/Page.cc

    r254 r257  
    44//
    55// Copyright 1996-2007 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     17// Copyright (C) 2005 Jeff Muizelaar <jeff@infidigm.net>
     18// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org>
     19// Copyright (C) 2006-2008 Pino Toscano <pino@kde.org>
     20// Copyright (C) 2006 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
     21// Copyright (C) 2006 Scott Turner <scotty1024@mac.com>
     22// Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org>
     23// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
     24// Copyright (C) 2008 Iñigo Martínez <inigomartinez@gmail.com>
     25// Copyright (C) 2008 Brad Hards <bradh@kde.org>
     26//
     27// To see a description of the changes please see the Changelog file that
     28// came with your tarball or type make ChangeLog if you are building from git
    629//
    730//========================================================================
  • trunk/poppler/mypoppler/poppler/Page.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     17// Copyright (C) 2005 Jeff Muizelaar <jeff@infidigm.net>
     18// Copyright (C) 2006 Pino Toscano <pino@kde.org>
     19// Copyright (C) 2006 Carlos Garcia Campos <carlosgc@gnome.org>
     20// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
     21// Copyright (C) 2008 Iñigo Martínez <inigomartinez@gmail.com>
     22//
     23// To see a description of the changes please see the Changelog file that
     24// came with your tarball or type make ChangeLog if you are building from git
    625//
    726//========================================================================
  • trunk/poppler/mypoppler/poppler/PageLabelInfo.cc

    r250 r257  
     1//========================================================================
     2//
     3// This file is under the GPLv2 or later license
     4//
     5// Copyright (C) 2005-2006 Kristian HÞgsberg <krh@redhat.com>
     6// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
     7//
     8// To see a description of the changes please see the Changelog file that
     9// came with your tarball or type make ChangeLog if you are building from git
     10//
     11//========================================================================
     12
    113#include <config.h>
    214#include <limits.h>
  • trunk/poppler/mypoppler/poppler/PageLabelInfo.h

    r250 r257  
     1//========================================================================
     2//
     3// This file is under the GPLv2 or later license
     4//
     5// Copyright (C) 2005-2006 Kristian HÞgsberg <krh@redhat.com>
     6// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
     7//
     8// To see a description of the changes please see the Changelog file that
     9// came with your tarball or type make ChangeLog if you are building from git
     10//
     11//========================================================================
     12
    113#include <limits.h>
    214#include <stdlib.h>
  • trunk/poppler/mypoppler/poppler/PageTransition.h

    r250 r257  
     1/* PageTransition.cc
     2 * Copyright (C) 2005, Net Integration Technologies, Inc.
     3 *
     4 * This program is free software; you can redistribute it and/or modify
     5 * it under the terms of the GNU General Public License as published by
     6 * the Free Software Foundation; either version 2, or (at your option)
     7 * any later version.
     8 *
     9 * This program is distributed in the hope that it will be useful,
     10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     12 * GNU General Public License for more details.
     13 *
     14 * You should have received a copy of the GNU General Public License
     15 * along with this program; if not, write to the Free Software
     16 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
     17 */
     18
    119#ifndef PAGE_TRANSITION_H
    220#define PAGE_TRANSITION_H
  • trunk/poppler/mypoppler/poppler/Parser.cc

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006 Albert Astals Cid <aacid@kde.org>
     17// Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
     18//
     19// To see a description of the changes please see the Changelog file that
     20// came with your tarball or type make ChangeLog if you are building from git
    621//
    722//========================================================================
  • trunk/poppler/mypoppler/poppler/Parser.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2006 Albert Astals Cid <aacid@kde.org>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/PreScanOutputDev.h

    r250 r257  
    1414#endif
    1515
    16 #include "gtypes.h"
     16#include "goo/gtypes.h"
    1717#include "GfxState.h"
    1818#include "OutputDev.h"
  • trunk/poppler/mypoppler/poppler/SecurityHandler.h

    r250 r257  
    1616#endif
    1717
    18 #include "gtypes.h"
     18#include "goo/gtypes.h"
    1919#include "Object.h"
    2020
  • trunk/poppler/mypoppler/poppler/Sound.cc

    r250 r257  
    2121#include "Sound.h"
    2222#include "Stream.h"
    23 #include "Link.h"
     23#include "FileSpec.h"
    2424
    2525Sound *Sound::parseSound(Object *obj)
     
    6666    dict->lookup("F", &tmp);
    6767    if (!tmp.isNull()) {
     68      Object obj1;
    6869      // valid 'F' key -> external file
    6970      kind = soundExternal;
    70       fileName = LinkAction::getFileSpecName(&tmp);
     71      getFileSpecNameForPlatform (&tmp, &obj1);
     72      fileName = obj1.getString()->copy();
     73      obj1.free();
    7174    } else {
    7275      // no file specification, then the sound data have to be
  • trunk/poppler/mypoppler/poppler/SplashOutputDev.cc

    r254 r257  
    44//
    55// Copyright 2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Takashi Iwai <tiwai@suse.de>
     17// Copyright (C) 2006 Stefan Schweizer <genstef@gentoo.org>
     18// Copyright (C) 2006-2008 Albert Astals Cid <aacid@kde.org>
     19// Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
     20// Copyright (C) 2006 Scott Turner <scotty1024@mac.com>
     21// Copyright (C) 2007 Koji Otani <sho@bbr.jp>
     22//
     23// To see a description of the changes please see the Changelog file that
     24// came with your tarball or type make ChangeLog if you are building from git
    625//
    726//========================================================================
     
    396415
    397416// NB: This must match the GfxBlendMode enum defined in GfxState.h.
    398 SplashBlendFunc splashOutBlendFuncs[] = {
     417static const SplashBlendFunc splashOutBlendFuncs[] = {
    399418  NULL,
    400419  &splashOutBlendMultiply,
     
    498517  } else if (glyphSize <= 1024) {
    499518    cacheSets = 2;
     519  } else if (glyphSize <= 2048) {
     520    cacheSets = 1;
     521    cacheAssoc = 4;
     522  } else if (glyphSize <= 4096) {
     523    cacheSets = 1;
     524    cacheAssoc = 2;
    500525  } else {
    501526    cacheSets = 1;
    502   }
    503   cacheData = (Guchar *)gmallocn_checkoverflow(cacheSets * cacheAssoc, glyphSize);
     527    cacheAssoc = 1;
     528  }
     529  if (glyphSize < 10485760 / cacheAssoc / cacheSets) {
     530    cacheData = (Guchar *)gmallocn_checkoverflow(cacheSets * cacheAssoc, glyphSize);
     531  } else {
     532    error(-1, "Not creating cacheData for T3FontCache, it asked for too much memory.\n"
     533              "       This could teoretically result in wrong rendering,\n"
     534              "       but most probably the document is bogus.\n"
     535              "       Please report a bug if you think the rendering may be wrong because of this.");
     536    cacheData = NULL;
     537  }
    504538  if (cacheData != NULL)
    505539  {
     
    9671001  int faceIndex = 0;
    9681002  GBool recreateFont = gFalse;
     1003  GBool doAdjustFontMatrix = gFalse;
    9691004
    9701005  needFontUpdate = gFalse;
     
    10211056        break;
    10221057      }
     1058      doAdjustFontMatrix = gTrue;
    10231059    }
    10241060
     
    11491185      goto err2;
    11501186    }
    1151     fontFile->doAdjustMatrix = gTrue;
     1187    fontFile->doAdjustMatrix = doAdjustFontMatrix;
    11521188  }
    11531189
     
    15741610  }
    15751611
     1612  if (t3Font->cacheTags == NULL)
     1613    return;
     1614
    15761615  // allocate a cache entry
    15771616  i = (t3GlyphStack->code & (t3Font->cacheSets - 1)) * t3Font->cacheAssoc;
  • trunk/poppler/mypoppler/poppler/SplashOutputDev.h

    r250 r257  
    44//
    55// Copyright 2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Takashi Iwai <tiwai@suse.de>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/Stream-CCITT.h

    r2 r257  
    66//
    77// Copyright 1996-2003 Glyph & Cog, LLC
     8//
     9//========================================================================
     10
     11//========================================================================
     12//
     13// Modified under the Poppler project - http://poppler.freedesktop.org
     14//
     15// All changes made under the Poppler project to this file are licensed
     16// under GPL version 2 or later
     17//
     18// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
    822//
    923//========================================================================
     
    3145
    3246// 1-7 bit codes
    33 static CCITTCode twoDimTab1[128] = {
     47static const CCITTCode twoDimTab1[128] = {
    3448  {-1, -1}, {-1, -1},                   // 000000x
    3549  {7, twoDimVertL3},                    // 0000010
     
    104118
    105119// 11-12 bit codes (upper 7 bits are 0)
    106 static CCITTCode whiteTab1[32] = {
     120static const CCITTCode whiteTab1[32] = {
    107121  {-1, -1},                                     // 00000
    108122  {12, ccittEOL},                               // 00001
     
    127141
    128142// 1-9 bit codes
    129 static CCITTCode whiteTab2[512] = {
     143static const CCITTCode whiteTab2[512] = {
    130144  {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},       // 0000000xx
    131145  {8, 29}, {8, 29},                             // 00000010x
     
    296310
    297311// 10-13 bit codes (upper 6 bits are 0)
    298 static CCITTCode blackTab1[128] = {
     312static const CCITTCode blackTab1[128] = {
    299313  {-1, -1}, {-1, -1},                                   // 000000000000x
    300314  {12, ccittEOL}, {12, ccittEOL},                       // 000000000001x
     
    358372
    359373// 7-12 bit codes (upper 4 bits are 0)
    360 static CCITTCode blackTab2[192] = {
     374static const CCITTCode blackTab2[192] = {
    361375  {8, 13}, {8, 13}, {8, 13}, {8, 13},                   // 00000100xxxx
    362376    {8, 13}, {8, 13}, {8, 13}, {8, 13},
     
    438452
    439453// 2-6 bit codes
    440 static CCITTCode blackTab3[64] = {
     454static const CCITTCode blackTab3[64] = {
    441455  {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},               // 0000xx
    442456  {6, 9},                                               // 000100
  • trunk/poppler/mypoppler/poppler/Stream.cc

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Jeff Muizelaar <jeff@infidigm.net>
     17// Copyright (C) 2006-2008 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
     19// Copyright (C) 2008 Julien Rebetez <julien@fhtagn.net>
     20//
     21// To see a description of the changes please see the Changelog file that
     22// came with your tarball or type make ChangeLog if you are building from git
    623//
    724//========================================================================
     
    3148#include "Stream.h"
    3249#include "JBIG2Stream.h"
    33 #include "JPXStream.h"
    3450#include "Stream-CCITT.h"
    3551
     
    4056#ifdef ENABLE_ZLIB
    4157#include "FlateStream.h"
     58#endif
     59
     60#ifdef ENABLE_LIBOPENJPEG
     61#include "JPEG2000Stream.h"
     62#else
     63#include "JPXStream.h"
    4264#endif
    4365
     
    17361758short CCITTFaxStream::getTwoDimCode() {
    17371759  short code;
    1738   CCITTCode *p;
     1760  const CCITTCode *p;
    17391761  int n;
    17401762
     
    17661788short CCITTFaxStream::getWhiteCode() {
    17671789  short code;
    1768   CCITTCode *p;
     1790  const CCITTCode *p;
    17691791  int n;
    17701792
     
    18231845short CCITTFaxStream::getBlackCode() {
    18241846  short code;
    1825   CCITTCode *p;
     1847  const CCITTCode *p;
    18261848  int n;
    18271849
     
    19852007
    19862008// zig zag decode map
    1987 static int dctZigZag[64] = {
     2009static const int dctZigZag[64] = {
    19882010   0,
    19892011   1,  8,
     
    20462068  numDCHuffTables = 0;
    20472069  numACHuffTables = 0;
    2048   colorXform = 0;
    20492070  gotJFIFMarker = gFalse;
    20502071  gotAdobeMarker = gFalse;
     
    45594580
    45604581GBool ASCIIHexEncoder::fillBuf() {
    4561   static char *hex = "0123456789abcdef";
     4582  static const char *hex = "0123456789abcdef";
    45624583  int c;
    45634584
  • trunk/poppler/mypoppler/poppler/Stream.h

    r250 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Jeff Muizelaar <jeff@infidigm.net>
     17// Copyright (C) 2008 Julien Rebetez <julien@fhtagn.net>
     18// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
    622//
    723//========================================================================
  • trunk/poppler/mypoppler/poppler/TextOutputDev.cc

    r250 r257  
    44//
    55// Copyright 1997-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// Copyright (C) 2005-2007 Kristian HÞgsberg <krh@redhat.com>
     14// Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
     15// Copyright (C) 2006, 2007 Carlos Garcia Campos <carlosgc@gnome.org>
     16// Copyright (C) 2006, 2007 Ed Catmur <ed@catmur.co.uk>
     17// Copyright (C) 2006 Jeff Muizelaar <jeff@infidigm.net>
     18// Copyright (C) 2007, 2008 Adrian Johnson <ajohnson@redneon.com>
     19// Copyright (C) 2008 Koji Otani <sho@bbr.jp>
     20// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     21//
     22// To see a description of the changes please see the Changelog file that
     23// came with your tarball or type make ChangeLog if you are building from git
    624//
    725//========================================================================
     
    46324650      }
    46334651
    4634       if (length < 2)
     4652      if (length < 3)
    46354653        length = 0;
    46364654      else
  • trunk/poppler/mypoppler/poppler/TextOutputDev.h

    r250 r257  
    44//
    55// Copyright 1997-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// Copyright (C) 2005-2007 Kristian HÞgsberg <krh@redhat.com>
     14// Copyright (C) 2006 Ed Catmur <ed@catmur.co.uk>
     15// Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
     16// Copyright (C) 2007 Adrian Johnson <ajohnson@redneon.com>
     17// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     18//
     19// To see a description of the changes please see the Changelog file that
     20// came with your tarball or type make ChangeLog if you are building from git
    621//
    722//========================================================================
     
    340355  TextBlock *getNext() { return next; }
    341356
     357  void getBBox(double *xMinA, double *yMinA, double *xMaxA, double *yMaxA)
     358    { *xMinA = xMin; *yMinA = yMin; *xMaxA = xMax; *yMaxA = yMax; }
     359
     360  int getLineCount() { return nLines; }
     361
    342362private:
    343363
  • trunk/poppler/mypoppler/poppler/UTF8.h

    r250 r257  
    44//
    55// Copyright 2001-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2008 Koji Otani <sho@bbr.jp>
     17//
     18// To see a description of the changes please see the Changelog file that
     19// came with your tarball or type make ChangeLog if you are building from git
    620//
    721//========================================================================
  • trunk/poppler/mypoppler/poppler/UnicodeTypeTable.cc

    r250 r257  
    77//========================================================================
    88
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// Copyright (C) 2006, 2007 Ed Catmur <ed@catmur.co.uk>
     14// Copyright (C) 2007 Jeff Muizelaar <jeff@infidigm.net>
     15// Copyright (C) 2008 Albert Astals Cid <aacid@kde.org>
     16//
     17// To see a description of the changes please see the Changelog file that
     18// came with your tarball or type make ChangeLog if you are building from git
     19//
     20//========================================================================
     21
    922#include <stdlib.h>
    1023#include "CharTypes.h"
     
    2134};
    2235
    23 static UnicodeMapTableEntry typeTable[256] = {
     36static const UnicodeMapTableEntry typeTable[256] = {
    2437  { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNLNNNNLNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL", 'X' },
    2538  { NULL, 'L' },
  • trunk/poppler/mypoppler/poppler/UnicodeTypeTable.h

    r27 r257  
    44//
    55// Copyright 2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// Copyright (C) 2006 Ed Catmur <ed@catmur.co.uk>
     14//
     15// To see a description of the changes please see the Changelog file that
     16// came with your tarball or type make ChangeLog if you are building from git
    617//
    718//========================================================================
  • trunk/poppler/mypoppler/poppler/XRef.cc

    r254 r257  
    1  //========================================================================
     1//========================================================================
    22//
    33// XRef.cc
     
    77//========================================================================
    88
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Dan Sheridan <dan.sheridan@postman.org.uk>
     17// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
     18// Copyright (C) 2006, 2008 Albert Astals Cid <aacid@kde.org>
     19// Copyright (C) 2007-2008 Julien Rebetez <julienr@svn.gnome.org>
     20// Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
     21//
     22// To see a description of the changes please see the Changelog file that
     23// came with your tarball or type make ChangeLog if you are building from git
     24//
     25//========================================================================
     26
    927#include <config.h>
    1028
     
    1735#include <string.h>
    1836#include <ctype.h>
     37#include <limits.h>
    1938#include "goo/gmem.h"
    2039#include "Object.h"
     
    905924        !obj2.isInt() || obj2.getInt() != gen ||
    906925        !obj3.isCmd("obj")) {
     926      // some buggy pdf have obj1234 for ints that represent 1234
     927      // try to recover here
     928      if (obj1.isInt() && obj1.getInt() == num &&
     929          obj2.isInt() && obj2.getInt() == gen &&
     930          obj3.isCmd()) {
     931        char *cmd = obj3.getCmd();
     932        if (strlen(cmd) > 3 &&
     933            cmd[0] == 'o' &&
     934            cmd[1] == 'b' &&
     935            cmd[2] == 'j') {
     936          char *end_ptr;
     937          long longNumber = strtol(cmd + 3, &end_ptr, 0);
     938          if (longNumber <= INT_MAX && longNumber >= INT_MIN && *end_ptr == '\0') {
     939            int number = longNumber;
     940            error(-1, "Cmd was not obj but %s, assuming the creator meant obj %d", cmd, number);
     941            obj->initInt(number);
     942            obj1.free();
     943            obj2.free();
     944            obj3.free();
     945            delete parser;
     946            break;
     947          }
     948        }
     949      }
    907950      obj1.free();
    908951      obj2.free();
  • trunk/poppler/mypoppler/poppler/XRef.h

    r254 r257  
    44//
    55// Copyright 1996-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
     17// Copyright (C) 2006, 2008 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2007-2008 Julien Rebetez <julienr@svn.gnome.org>
     19// Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
     20//
     21// To see a description of the changes please see the Changelog file that
     22// came with your tarball or type make ChangeLog if you are building from git
    623//
    724//========================================================================
  • trunk/poppler/mypoppler/poppler/poppler-config.h

    r250 r257  
    3131#endif
    3232
    33 /* Full path for the system-wide xpdfrc file. */
    34 #ifndef SYSTEM_XPDFRC
    35 /* #undef SYSTEM_XPDFRC */
    36 #endif
    37 
    3833/* Include support for OPI comments. */
    3934#ifndef OPI_SUPPORT
     
    5348//------------------------------------------------------------------------
    5449
    55 // xpdf version
    56 #define xpdfVersion         "3.00"
    57 #define xpdfVersionNum      3.00
    58 #define xpdfMajorVersion    3
    59 #define xpdfMinorVersion    0
    60 #define xpdfMajorVersionStr "3"
    61 #define xpdfMinorVersionStr "0"
    62 
    63 // supported PDF version
    64 #define supportedPDFVersionStr "1.5"
    65 #define supportedPDFVersionNum 1.5
    66 
    6750// copyright notice
     51#define popplerCopyright "Copyright 2005-2008 The Poppler Developers - http://poppler.freedesktop.org"
    6852#define xpdfCopyright "Copyright 1996-2004 Glyph & Cog, LLC"
    69 
    70 // Windows resource file stuff
    71 #define winxpdfVersion "WinXpdf 3.00"
    72 #define xpdfCopyrightAmp "Copyright 1996-2004 Glyph && Cog, LLC"
    73 
    74 //------------------------------------------------------------------------
    75 // paper size
    76 //------------------------------------------------------------------------
    77 
    78 // default paper size (in points) for PostScript output
    79 #ifdef A4_PAPER
    80 #define defPaperWidth  595    // ISO A4 (210x297 mm)
    81 #define defPaperHeight 842
    82 #else
    83 #define defPaperWidth  612    // American letter (8.5x11")
    84 #define defPaperHeight 792
    85 #endif
    86 
    87 //------------------------------------------------------------------------
    88 // config file (xpdfrc) path
    89 //------------------------------------------------------------------------
    90 
    91 // user config file name, relative to the user's home directory
    92 #if defined(VMS) || (defined(WIN32) && !defined(__CYGWIN32__))
    93 #define xpdfUserConfigFile "xpdfrc"
    94 #else
    95 #define xpdfUserConfigFile ".xpdfrc"
    96 #endif
    97 
    98 // system config file name (set via the configure script)
    99 #ifdef SYSTEM_XPDFRC
    100 #define xpdfSysConfigFile SYSTEM_XPDFRC
    101 #else
    102 // under Windows, we get the directory with the executable and then
    103 // append this file name
    104 #define xpdfSysConfigFile "xpdfrc"
    105 #endif
    106 
    107 //------------------------------------------------------------------------
    108 // X-related constants
    109 //------------------------------------------------------------------------
    110 
    111 // default maximum size of color cube to allocate
    112 #define defaultRGBCube 5
    113 
    114 // number of fonts (combined t1lib, FreeType, X server) to cache
    115 #define xOutFontCacheSize 64
    116 
    117 // number of Type 3 fonts to cache
    118 #define xOutT3FontCacheSize 8
    11953
    12054//------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.