summaryrefslogtreecommitdiff
path: root/Build/source/libs/poppler/poppler-0.20.0/goo
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/poppler/poppler-0.20.0/goo')
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/FixedPoint.cc135
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/FixedPoint.h166
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/GooHash.cc384
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/GooHash.h76
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/GooLikely.h22
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/GooList.cc122
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/GooList.h104
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/GooMutex.h63
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/GooString.cc894
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/GooString.h194
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/GooTimer.cc95
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/GooTimer.h57
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/ImgWriter.cc15
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/ImgWriter.h33
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/JpegWriter.cc147
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/JpegWriter.h56
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/Makefile.am62
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/Makefile.in712
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/PNGWriter.cc176
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/PNGWriter.h63
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/TiffWriter.cc202
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/TiffWriter.h54
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/gfile.cc827
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/gfile.h172
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/gmem.cc346
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/gmem.h92
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/gmempp.cc32
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/gstrtod.cc147
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/gstrtod.h43
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/gtypes.h48
-rw-r--r--Build/source/libs/poppler/poppler-0.20.0/goo/gtypes_p.h30
31 files changed, 5569 insertions, 0 deletions
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/FixedPoint.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/FixedPoint.cc
new file mode 100644
index 00000000000..26b2f0fe890
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/FixedPoint.cc
@@ -0,0 +1,135 @@
+//========================================================================
+//
+// FixedPoint.cc
+//
+// Fixed point type, with C++ operators.
+//
+// Copyright 2004 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <config.h>
+
+#if USE_FIXEDPOINT
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include "FixedPoint.h"
+
+#define ln2 ((FixedPoint)0.69314718)
+
+#define ln2 ((FixedPoint)0.69314718)
+
+FixedPoint FixedPoint::sqrt(FixedPoint x) {
+ FixedPoint y0, y1, z;
+
+ if (x.val <= 0) {
+ y1.val = 0;
+ } else {
+ y1.val = x.val == 1 ? 2 : x.val >> 1;
+ do {
+ y0.val = y1.val;
+ z = x / y0;
+ y1.val = (y0.val + z.val) >> 1;
+ } while (::abs(y0.val - y1.val) > 1);
+ }
+ return y1;
+}
+
+FixedPoint FixedPoint::pow(FixedPoint x, FixedPoint y) {
+ FixedPoint t, t2, lnx0, lnx, z0, z;
+ int d, n, i;
+
+ if (y.val <= 0) {
+ z.val = 0;
+ } else {
+ // y * ln(x)
+ t = (x - 1) / (x + 1);
+ t2 = t * t;
+ d = 1;
+ lnx = 0;
+ do {
+ lnx0 = lnx;
+ lnx += t / d;
+ t *= t2;
+ d += 2;
+ } while (::abs(lnx.val - lnx0.val) > 2);
+ lnx.val <<= 1;
+ t = y * lnx;
+ // exp(y * ln(x))
+ n = floor(t / ln2);
+ t -= ln2 * n;
+ t2 = t;
+ d = 1;
+ i = 1;
+ z = 1;
+ do {
+ z0 = z;
+ z += t2 / d;
+ t2 *= t;
+ ++i;
+ d *= i;
+ } while (::abs(z.val - z0.val) > 2 && d < (1 << fixptShift));
+ if (n >= 0) {
+ z.val <<= n;
+ } else if (n < 0) {
+ z.val >>= -n;
+ }
+ }
+ return z;
+}
+
+int FixedPoint::mul(int x, int y) {
+ FixPtInt64 z;
+
+ z = ((FixPtInt64)x * y) >> fixptShift;
+ if (z > 0x7fffffffLL) {
+ return 0x7fffffff;
+ } else if (z < -0x80000000LL) {
+ return 0x80000000;
+ } else {
+ return (int)z;
+ }
+}
+
+int FixedPoint::div(int x, int y) {
+ FixPtInt64 z;
+
+ z = ((FixPtInt64)x << fixptShift) / y;
+ if (z > 0x7fffffffLL) {
+ return 0x7fffffff;
+ } else if (z < -0x80000000LL) {
+ return 0x80000000;
+ } else {
+ return (int)z;
+ }
+}
+
+GBool FixedPoint::divCheck(FixedPoint x, FixedPoint y, FixedPoint *result) {
+ FixPtInt64 z;
+
+ z = ((FixPtInt64)x.val << fixptShift) / y.val;
+ if ((z == 0 && x != 0) ||
+ z >= ((FixPtInt64)1 << 31) || z < -((FixPtInt64)1 << 31)) {
+ return gFalse;
+ }
+ result->val = z;
+ return gTrue;
+}
+
+GBool FixedPoint::checkDet(FixedPoint m11, FixedPoint m12,
+ FixedPoint m21, FixedPoint m22,
+ FixedPoint epsilon) {
+ FixPtInt64 det, e;
+
+ det = (FixPtInt64)m11.val * (FixPtInt64)m22.val
+ - (FixPtInt64)m12.val * (FixPtInt64)m21.val;
+ e = (FixPtInt64)epsilon.val << fixptShift;
+ // NB: this comparison has to be >= not > because epsilon can be
+ // truncated to zero as a fixed point value.
+ return det >= e || det <= -e;
+}
+
+#endif // USE_FIXEDPOINT
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/FixedPoint.h b/Build/source/libs/poppler/poppler-0.20.0/goo/FixedPoint.h
new file mode 100644
index 00000000000..afe21d96670
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/FixedPoint.h
@@ -0,0 +1,166 @@
+//========================================================================
+//
+// FixedPoint.h
+//
+// Fixed point type, with C++ operators.
+//
+// Copyright 2004 Glyph & Cog, LLC
+//
+//========================================================================
+
+#ifndef FIXEDPOINT_H
+#define FIXEDPOINT_H
+
+#include "poppler/poppler-config.h"
+
+#if USE_FIXEDPOINT
+
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "gtypes.h"
+
+#define fixptShift 16
+#define fixptMaskL ((1 << fixptShift) - 1)
+#define fixptMaskH (~fixptMaskL)
+
+typedef long long FixPtInt64;
+
+class FixedPoint {
+public:
+
+ FixedPoint() { val = 0; }
+ FixedPoint(const FixedPoint &x) { val = x.val; }
+ FixedPoint(double x) { val = (int)(x * (1 << fixptShift) + 0.5); }
+ FixedPoint(int x) { val = x << fixptShift; }
+ FixedPoint(long x) { val = x << fixptShift; }
+
+ operator float()
+ { return (float) val * ((float)1 / (float)(1 << fixptShift)); }
+ operator double()
+ { return (double) val * (1.0 / (double)(1 << fixptShift)); }
+ operator int()
+ { return val >> fixptShift; }
+
+ int get16Dot16() { return val; }
+
+ FixedPoint operator =(FixedPoint x) { val = x.val; return *this; }
+
+ int operator ==(FixedPoint x) { return val == x.val; }
+ int operator ==(double x) { return *this == (FixedPoint)x; }
+ int operator ==(int x) { return *this == (FixedPoint)x; }
+ int operator ==(long x) { return *this == (FixedPoint)x; }
+
+ int operator !=(FixedPoint x) { return val != x.val; }
+ int operator !=(double x) { return *this != (FixedPoint)x; }
+ int operator !=(int x) { return *this != (FixedPoint)x; }
+ int operator !=(long x) { return *this != (FixedPoint)x; }
+
+ int operator <(FixedPoint x) { return val < x.val; }
+ int operator <(double x) { return *this < (FixedPoint)x; }
+ int operator <(int x) { return *this < (FixedPoint)x; }
+ int operator <(long x) { return *this < (FixedPoint)x; }
+
+ int operator <=(FixedPoint x) { return val <= x.val; }
+ int operator <=(double x) { return *this <= (FixedPoint)x; }
+ int operator <=(int x) { return *this <= (FixedPoint)x; }
+ int operator <=(long x) { return *this <= (FixedPoint)x; }
+
+ int operator >(FixedPoint x) { return val > x.val; }
+ int operator >(double x) { return *this > (FixedPoint)x; }
+ int operator >(int x) { return *this > (FixedPoint)x; }
+ int operator >(long x) { return *this > (FixedPoint)x; }
+
+ int operator >=(FixedPoint x) { return val >= x.val; }
+ int operator >=(double x) { return *this >= (FixedPoint)x; }
+ int operator >=(int x) { return *this >= (FixedPoint)x; }
+ int operator >=(long x) { return *this >= (FixedPoint)x; }
+
+ FixedPoint operator -() { return make(-val); }
+
+ FixedPoint operator +(FixedPoint x) { return make(val + x.val); }
+ FixedPoint operator +(double x) { return *this + (FixedPoint)x; }
+ FixedPoint operator +(int x) { return *this + (FixedPoint)x; }
+ FixedPoint operator +(long x) { return *this + (FixedPoint)x; }
+
+ FixedPoint operator +=(FixedPoint x) { val = val + x.val; return *this; }
+ FixedPoint operator +=(double x) { return *this += (FixedPoint)x; }
+ FixedPoint operator +=(int x) { return *this += (FixedPoint)x; }
+ FixedPoint operator +=(long x) { return *this += (FixedPoint)x; }
+
+ FixedPoint operator -(FixedPoint x) { return make(val - x.val); }
+ FixedPoint operator -(double x) { return *this - (FixedPoint)x; }
+ FixedPoint operator -(int x) { return *this - (FixedPoint)x; }
+ FixedPoint operator -(long x) { return *this - (FixedPoint)x; }
+
+ FixedPoint operator -=(FixedPoint x) { val = val - x.val; return *this; }
+ FixedPoint operator -=(double x) { return *this -= (FixedPoint)x; }
+ FixedPoint operator -=(int x) { return *this -= (FixedPoint)x; }
+ FixedPoint operator -=(long x) { return *this -= (FixedPoint)x; }
+
+ FixedPoint operator *(FixedPoint x) { return make(mul(val, x.val)); }
+ FixedPoint operator *(double x) { return *this * (FixedPoint)x; }
+ FixedPoint operator *(int x) { return *this * (FixedPoint)x; }
+ FixedPoint operator *(long x) { return *this * (FixedPoint)x; }
+
+ FixedPoint operator *=(FixedPoint x) { val = mul(val, x.val); return *this; }
+ FixedPoint operator *=(double x) { return *this *= (FixedPoint)x; }
+ FixedPoint operator *=(int x) { return *this *= (FixedPoint)x; }
+ FixedPoint operator *=(long x) { return *this *= (FixedPoint)x; }
+
+ FixedPoint operator /(FixedPoint x) { return make(div(val, x.val)); }
+ FixedPoint operator /(double x) { return *this / (FixedPoint)x; }
+ FixedPoint operator /(int x) { return *this / (FixedPoint)x; }
+ FixedPoint operator /(long x) { return *this / (FixedPoint)x; }
+
+ FixedPoint operator /=(FixedPoint x) { val = div(val, x.val); return *this; }
+ FixedPoint operator /=(double x) { return *this /= (FixedPoint)x; }
+ FixedPoint operator /=(int x) { return *this /= (FixedPoint)x; }
+ FixedPoint operator /=(long x) { return *this /= (FixedPoint)x; }
+
+ static FixedPoint abs(FixedPoint x) { return make(::abs(x.val)); }
+
+ static int floor(FixedPoint x) { return x.val >> fixptShift; }
+
+ static int ceil(FixedPoint x)
+ { return (x.val & fixptMaskL) ? ((x.val >> fixptShift) + 1)
+ : (x.val >> fixptShift); }
+
+ static int round(FixedPoint x)
+ { return (x.val + (1 << (fixptShift - 1))) >> fixptShift; }
+
+ // Computes (x+y)/2 avoiding overflow and LSbit accuracy issues.
+ static FixedPoint avg(FixedPoint x, FixedPoint y)
+ { return make((x.val >> 1) + (y.val >> 1) + ((x.val | y.val) & 1)); }
+
+
+ static FixedPoint sqrt(FixedPoint x);
+
+ static FixedPoint pow(FixedPoint x, FixedPoint y);
+
+ // Compute *result = x/y; return false if there is an underflow or
+ // overflow.
+ static GBool divCheck(FixedPoint x, FixedPoint y, FixedPoint *result);
+
+ // Compute abs(m11*m22 - m12*m21) >= epsilon, handling the case
+ // where the multiplications overflow.
+ static GBool checkDet(FixedPoint m11, FixedPoint m12,
+ FixedPoint m21, FixedPoint m22,
+ FixedPoint epsilon);
+
+private:
+
+ static FixedPoint make(int valA) { FixedPoint x; x.val = valA; return x; }
+
+ static int mul(int x, int y);
+ static int div(int x, int y);
+
+ int val; // fixed point: (n-fixptShift).(fixptShift)
+};
+
+#endif // USE_FIXEDPOINT
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/GooHash.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/GooHash.cc
new file mode 100644
index 00000000000..f4a92f17506
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/GooHash.cc
@@ -0,0 +1,384 @@
+//========================================================================
+//
+// GooHash.cc
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <config.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include "gmem.h"
+#include "GooString.h"
+#include "GooHash.h"
+
+//------------------------------------------------------------------------
+
+struct GooHashBucket {
+ GooString *key;
+ union {
+ void *p;
+ int i;
+ } val;
+ GooHashBucket *next;
+};
+
+struct GooHashIter {
+ int h;
+ GooHashBucket *p;
+};
+
+//------------------------------------------------------------------------
+
+GooHash::GooHash(GBool deleteKeysA) {
+ int h;
+
+ deleteKeys = deleteKeysA;
+ size = 7;
+ tab = (GooHashBucket **)gmallocn(size, sizeof(GooHashBucket *));
+ for (h = 0; h < size; ++h) {
+ tab[h] = NULL;
+ }
+ len = 0;
+}
+
+GooHash::~GooHash() {
+ GooHashBucket *p;
+ int h;
+
+ for (h = 0; h < size; ++h) {
+ while (tab[h]) {
+ p = tab[h];
+ tab[h] = p->next;
+ if (deleteKeys) {
+ delete p->key;
+ }
+ delete p;
+ }
+ }
+ gfree(tab);
+}
+
+void GooHash::add(GooString *key, void *val) {
+ GooHashBucket *p;
+ int h;
+
+ // expand the table if necessary
+ if (len >= size) {
+ expand();
+ }
+
+ // add the new symbol
+ p = new GooHashBucket;
+ p->key = key;
+ p->val.p = val;
+ h = hash(key);
+ p->next = tab[h];
+ tab[h] = p;
+ ++len;
+}
+
+void GooHash::add(GooString *key, int val) {
+ GooHashBucket *p;
+ int h;
+
+ // expand the table if necessary
+ if (len >= size) {
+ expand();
+ }
+
+ // add the new symbol
+ p = new GooHashBucket;
+ p->key = key;
+ p->val.i = val;
+ h = hash(key);
+ p->next = tab[h];
+ tab[h] = p;
+ ++len;
+}
+
+void GooHash::replace(GooString *key, void *val) {
+ GooHashBucket *p;
+ int h;
+
+ if ((p = find(key, &h))) {
+ p->val.p = val;
+ if (deleteKeys) {
+ delete key;
+ }
+ } else {
+ add(key, val);
+ }
+}
+
+void GooHash::replace(GooString *key, int val) {
+ GooHashBucket *p;
+ int h;
+
+ if ((p = find(key, &h))) {
+ p->val.i = val;
+ if (deleteKeys) {
+ delete key;
+ }
+ } else {
+ add(key, val);
+ }
+}
+
+void *GooHash::lookup(GooString *key) {
+ GooHashBucket *p;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return NULL;
+ }
+ return p->val.p;
+}
+
+int GooHash::lookupInt(GooString *key) {
+ GooHashBucket *p;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return 0;
+ }
+ return p->val.i;
+}
+
+void *GooHash::lookup(const char *key) {
+ GooHashBucket *p;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return NULL;
+ }
+ return p->val.p;
+}
+
+int GooHash::lookupInt(const char *key) {
+ GooHashBucket *p;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return 0;
+ }
+ return p->val.i;
+}
+
+void *GooHash::remove(GooString *key) {
+ GooHashBucket *p;
+ GooHashBucket **q;
+ void *val;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return NULL;
+ }
+ q = &tab[h];
+ while (*q != p) {
+ q = &((*q)->next);
+ }
+ *q = p->next;
+ if (deleteKeys) {
+ delete p->key;
+ }
+ val = p->val.p;
+ delete p;
+ --len;
+ return val;
+}
+
+int GooHash::removeInt(GooString *key) {
+ GooHashBucket *p;
+ GooHashBucket **q;
+ int val;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return 0;
+ }
+ q = &tab[h];
+ while (*q != p) {
+ q = &((*q)->next);
+ }
+ *q = p->next;
+ if (deleteKeys) {
+ delete p->key;
+ }
+ val = p->val.i;
+ delete p;
+ --len;
+ return val;
+}
+
+void *GooHash::remove(const char *key) {
+ GooHashBucket *p;
+ GooHashBucket **q;
+ void *val;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return NULL;
+ }
+ q = &tab[h];
+ while (*q != p) {
+ q = &((*q)->next);
+ }
+ *q = p->next;
+ if (deleteKeys) {
+ delete p->key;
+ }
+ val = p->val.p;
+ delete p;
+ --len;
+ return val;
+}
+
+int GooHash::removeInt(const char *key) {
+ GooHashBucket *p;
+ GooHashBucket **q;
+ int val;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return 0;
+ }
+ q = &tab[h];
+ while (*q != p) {
+ q = &((*q)->next);
+ }
+ *q = p->next;
+ if (deleteKeys) {
+ delete p->key;
+ }
+ val = p->val.i;
+ delete p;
+ --len;
+ return val;
+}
+
+void GooHash::startIter(GooHashIter **iter) {
+ *iter = new GooHashIter;
+ (*iter)->h = -1;
+ (*iter)->p = NULL;
+}
+
+GBool GooHash::getNext(GooHashIter **iter, GooString **key, void **val) {
+ if (!*iter) {
+ return gFalse;
+ }
+ if ((*iter)->p) {
+ (*iter)->p = (*iter)->p->next;
+ }
+ while (!(*iter)->p) {
+ if (++(*iter)->h == size) {
+ delete *iter;
+ *iter = NULL;
+ return gFalse;
+ }
+ (*iter)->p = tab[(*iter)->h];
+ }
+ *key = (*iter)->p->key;
+ *val = (*iter)->p->val.p;
+ return gTrue;
+}
+
+GBool GooHash::getNext(GooHashIter **iter, GooString **key, int *val) {
+ if (!*iter) {
+ return gFalse;
+ }
+ if ((*iter)->p) {
+ (*iter)->p = (*iter)->p->next;
+ }
+ while (!(*iter)->p) {
+ if (++(*iter)->h == size) {
+ delete *iter;
+ *iter = NULL;
+ return gFalse;
+ }
+ (*iter)->p = tab[(*iter)->h];
+ }
+ *key = (*iter)->p->key;
+ *val = (*iter)->p->val.i;
+ return gTrue;
+}
+
+void GooHash::killIter(GooHashIter **iter) {
+ delete *iter;
+ *iter = NULL;
+}
+
+void GooHash::expand() {
+ GooHashBucket **oldTab;
+ GooHashBucket *p;
+ int oldSize, h, i;
+
+ oldSize = size;
+ oldTab = tab;
+ size = 2*size + 1;
+ tab = (GooHashBucket **)gmallocn(size, sizeof(GooHashBucket *));
+ for (h = 0; h < size; ++h) {
+ tab[h] = NULL;
+ }
+ for (i = 0; i < oldSize; ++i) {
+ while (oldTab[i]) {
+ p = oldTab[i];
+ oldTab[i] = oldTab[i]->next;
+ h = hash(p->key);
+ p->next = tab[h];
+ tab[h] = p;
+ }
+ }
+ gfree(oldTab);
+}
+
+GooHashBucket *GooHash::find(GooString *key, int *h) {
+ GooHashBucket *p;
+
+ *h = hash(key);
+ for (p = tab[*h]; p; p = p->next) {
+ if (!p->key->cmp(key)) {
+ return p;
+ }
+ }
+ return NULL;
+}
+
+GooHashBucket *GooHash::find(const char *key, int *h) {
+ GooHashBucket *p;
+
+ *h = hash(key);
+ for (p = tab[*h]; p; p = p->next) {
+ if (!p->key->cmp(key)) {
+ return p;
+ }
+ }
+ return NULL;
+}
+
+int GooHash::hash(GooString *key) {
+ const char *p;
+ unsigned int h;
+ int i;
+
+ h = 0;
+ for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
+ h = 17 * h + (int)(*p & 0xff);
+ }
+ return (int)(h % size);
+}
+
+int GooHash::hash(const char *key) {
+ const char *p;
+ unsigned int h;
+
+ h = 0;
+ for (p = key; *p; ++p) {
+ h = 17 * h + (int)(*p & 0xff);
+ }
+ return (int)(h % size);
+}
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/GooHash.h b/Build/source/libs/poppler/poppler-0.20.0/goo/GooHash.h
new file mode 100644
index 00000000000..b973a93a48d
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/GooHash.h
@@ -0,0 +1,76 @@
+//========================================================================
+//
+// GooHash.h
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#ifndef GHASH_H
+#define GHASH_H
+
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
+#include "gtypes.h"
+
+class GooString;
+struct GooHashBucket;
+struct GooHashIter;
+
+//------------------------------------------------------------------------
+
+class GooHash {
+public:
+
+ GooHash(GBool deleteKeysA = gFalse);
+ ~GooHash();
+ void add(GooString *key, void *val);
+ void add(GooString *key, int val);
+ void replace(GooString *key, void *val);
+ void replace(GooString *key, int val);
+ void *lookup(GooString *key);
+ int lookupInt(GooString *key);
+ void *lookup(const char *key);
+ int lookupInt(const char *key);
+ void *remove(GooString *key);
+ int removeInt(GooString *key);
+ void *remove(const char *key);
+ int removeInt(const char *key);
+ int getLength() { return len; }
+ void startIter(GooHashIter **iter);
+ GBool getNext(GooHashIter **iter, GooString **key, void **val);
+ GBool getNext(GooHashIter **iter, GooString **key, int *val);
+ void killIter(GooHashIter **iter);
+
+private:
+
+ void expand();
+ GooHashBucket *find(GooString *key, int *h);
+ GooHashBucket *find(const char *key, int *h);
+ int hash(GooString *key);
+ int hash(const char *key);
+
+ GBool deleteKeys; // set if key strings should be deleted
+ int size; // number of buckets
+ int len; // number of entries
+ GooHashBucket **tab;
+};
+
+#define deleteGooHash(hash, T) \
+ do { \
+ GooHash *_hash = (hash); \
+ { \
+ GooHashIter *_iter; \
+ GooString *_key; \
+ void *_p; \
+ _hash->startIter(&_iter); \
+ while (_hash->getNext(&_iter, &_key, &_p)) { \
+ delete (T*)_p; \
+ } \
+ delete _hash; \
+ } \
+ } while(0)
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/GooLikely.h b/Build/source/libs/poppler/poppler-0.20.0/goo/GooLikely.h
new file mode 100644
index 00000000000..724ccf00870
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/GooLikely.h
@@ -0,0 +1,22 @@
+//========================================================================
+//
+// GooLikely.h
+//
+// This file is licensed under the GPLv2 or later
+//
+// Copyright (C) 2008 Kees Cook <kees@outflux.net>
+//
+//========================================================================
+
+#ifndef GOOLIKELY_H
+#define GOOLIKELY_H
+
+#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
+# define likely(x) __builtin_expect((x), 1)
+# define unlikely(x) __builtin_expect((x), 0)
+#else
+# define likely(x) (x)
+# define unlikely(x) (x)
+#endif
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/GooList.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/GooList.cc
new file mode 100644
index 00000000000..6ce4952dc6a
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/GooList.cc
@@ -0,0 +1,122 @@
+//========================================================================
+//
+// GooList.cc
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <config.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include "gmem.h"
+#include "GooList.h"
+
+//------------------------------------------------------------------------
+// GooList
+//------------------------------------------------------------------------
+
+GooList::GooList() {
+ size = 8;
+ data = (void **)gmallocn(size, sizeof(void*));
+ length = 0;
+ inc = 0;
+}
+
+GooList::GooList(int sizeA) {
+ size = sizeA ? sizeA : 8;
+ data = (void **)gmallocn(size, sizeof(void*));
+ length = 0;
+ inc = 0;
+}
+
+GooList::~GooList() {
+ gfree(data);
+}
+
+GooList *GooList::copy() {
+ GooList *ret;
+
+ ret = new GooList(length);
+ ret->length = length;
+ memcpy(ret->data, data, length * sizeof(void *));
+ ret->inc = inc;
+ return ret;
+}
+
+void GooList::append(void *p) {
+ if (length >= size) {
+ expand();
+ }
+ data[length++] = p;
+}
+
+void GooList::append(GooList *list) {
+ int i;
+
+ while (length + list->length > size) {
+ expand();
+ }
+ for (i = 0; i < list->length; ++i) {
+ data[length++] = list->data[i];
+ }
+}
+
+void GooList::insert(int i, void *p) {
+ if (length >= size) {
+ expand();
+ }
+ if (i < 0) {
+ i = 0;
+ }
+ if (i < length) {
+ memmove(data+i+1, data+i, (length - i) * sizeof(void *));
+ }
+ data[i] = p;
+ ++length;
+}
+
+void *GooList::del(int i) {
+ void *p;
+
+ p = data[i];
+ if (i < length - 1) {
+ memmove(data+i, data+i+1, (length - i - 1) * sizeof(void *));
+ }
+ --length;
+ if (size - length >= ((inc > 0) ? inc : size/2)) {
+ shrink();
+ }
+ return p;
+}
+
+void GooList::sort(int (*cmp)(const void *obj1, const void *obj2)) {
+ qsort(data, length, sizeof(void *), cmp);
+}
+
+void GooList::reverse() {
+ void *t;
+ int n, i;
+
+ n = length / 2;
+ for (i = 0; i < n; ++i) {
+ t = data[i];
+ data[i] = data[length - 1 - i];
+ data[length - 1 - i] = t;
+ }
+}
+
+void GooList::expand() {
+ size += (inc > 0) ? inc : size;
+ data = (void **)greallocn(data, size, sizeof(void*));
+}
+
+void GooList::shrink() {
+ size -= (inc > 0) ? inc : size/2;
+ data = (void **)greallocn(data, size, sizeof(void*));
+}
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/GooList.h b/Build/source/libs/poppler/poppler-0.20.0/goo/GooList.h
new file mode 100644
index 00000000000..964568a4ef8
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/GooList.h
@@ -0,0 +1,104 @@
+//========================================================================
+//
+// GooList.h
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#ifndef GLIST_H
+#define GLIST_H
+
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
+#include "gtypes.h"
+
+//------------------------------------------------------------------------
+// GooList
+//------------------------------------------------------------------------
+
+class GooList {
+public:
+
+ // Create an empty list.
+ GooList();
+
+ // Create an empty list with space for <size1> elements.
+ GooList(int sizeA);
+
+ // Destructor - does not free pointed-to objects.
+ ~GooList();
+
+ //----- general
+
+ // Get the number of elements.
+ int getLength() { return length; }
+
+ // Returns a (shallow) copy of this list.
+ GooList *copy();
+
+ //----- ordered list support
+
+ // Return the <i>th element.
+ // Assumes 0 <= i < length.
+ void *get(int i) { return data[i]; }
+
+ // Replace the <i>th element.
+ // Assumes 0 <= i < length.
+ void put(int i, void *p) { data[i] = p; }
+
+ // Append an element to the end of the list.
+ void append(void *p);
+
+ // Append another list to the end of this one.
+ void append(GooList *list);
+
+ // Insert an element at index <i>.
+ // Assumes 0 <= i <= length.
+ void insert(int i, void *p);
+
+ // Deletes and returns the element at index <i>.
+ // Assumes 0 <= i < length.
+ void *del(int i);
+
+ // Sort the list accoring to the given comparison function.
+ // NB: this sorts an array of pointers, so the pointer args need to
+ // be double-dereferenced.
+ void sort(int (*cmp)(const void *ptr1, const void *ptr2));
+
+ // Reverse the list.
+ void reverse();
+
+ //----- control
+
+ // Set allocation increment to <inc>. If inc > 0, that many
+ // elements will be allocated every time the list is expanded.
+ // If inc <= 0, the list will be doubled in size.
+ void setAllocIncr(int incA) { inc = incA; }
+
+private:
+
+ void expand();
+ void shrink();
+
+ void **data; // the list elements
+ int size; // size of data array
+ int length; // number of elements on list
+ int inc; // allocation increment
+};
+
+#define deleteGooList(list, T) \
+ do { \
+ GooList *_list = (list); \
+ { \
+ int _i; \
+ for (_i = 0; _i < _list->getLength(); ++_i) { \
+ delete (T*)_list->get(_i); \
+ } \
+ delete _list; \
+ } \
+ } while (0)
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/GooMutex.h b/Build/source/libs/poppler/poppler-0.20.0/goo/GooMutex.h
new file mode 100644
index 00000000000..3f53a626a67
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/GooMutex.h
@@ -0,0 +1,63 @@
+//========================================================================
+//
+// GooMutex.h
+//
+// Portable mutex macros.
+//
+// Copyright 2002-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
+#ifndef GMUTEX_H
+#define GMUTEX_H
+
+// Usage:
+//
+// GooMutex m;
+// gInitMutex(&m);
+// ...
+// gLockMutex(&m);
+// ... critical section ...
+// gUnlockMutex(&m);
+// ...
+// gDestroyMutex(&m);
+
+#ifdef _WIN32
+
+#include <windows.h>
+
+typedef CRITICAL_SECTION GooMutex;
+
+#define gInitMutex(m) InitializeCriticalSection(m)
+#define gDestroyMutex(m) DeleteCriticalSection(m)
+#define gLockMutex(m) EnterCriticalSection(m)
+#define gUnlockMutex(m) LeaveCriticalSection(m)
+
+#else // assume pthreads
+
+#include <pthread.h>
+
+typedef pthread_mutex_t GooMutex;
+
+#define gInitMutex(m) pthread_mutex_init(m, NULL)
+#define gDestroyMutex(m) pthread_mutex_destroy(m)
+#define gLockMutex(m) pthread_mutex_lock(m)
+#define gUnlockMutex(m) pthread_mutex_unlock(m)
+
+#endif
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/GooString.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/GooString.cc
new file mode 100644
index 00000000000..fc78d907978
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/GooString.cc
@@ -0,0 +1,894 @@
+//========================================================================
+//
+// GooString.cc
+//
+// Simple variable-length string type.
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
+// Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
+// Copyright (C) 2007 Jeff Muizelaar <jeff@infidigm.net>
+// Copyright (C) 2008-2011 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2011 Kenji Uno <ku@digitaldolphins.jp>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
+#include <config.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include <assert.h>
+#include <math.h>
+#include "gmem.h"
+#include "GooString.h"
+
+static const int MAXIMUM_DOUBLE_PREC = 16;
+
+//------------------------------------------------------------------------
+
+union GooStringFormatArg {
+ int i;
+ Guint ui;
+ long l;
+ Gulong ul;
+#ifdef LLONG_MAX
+ long long ll;
+#endif
+#ifdef ULLONG_MAX
+ unsigned long long ull;
+#endif
+ double f;
+ char c;
+ char *s;
+ GooString *gs;
+};
+
+enum GooStringFormatType {
+ fmtIntDecimal,
+ fmtIntHex,
+ fmtIntOctal,
+ fmtIntBinary,
+ fmtUIntDecimal,
+ fmtUIntHex,
+ fmtUIntOctal,
+ fmtUIntBinary,
+ fmtLongDecimal,
+ fmtLongHex,
+ fmtLongOctal,
+ fmtLongBinary,
+ fmtULongDecimal,
+ fmtULongHex,
+ fmtULongOctal,
+ fmtULongBinary,
+#ifdef LLONG_MAX
+ fmtLongLongDecimal,
+ fmtLongLongHex,
+ fmtLongLongOctal,
+ fmtLongLongBinary,
+#endif
+#ifdef ULLONG_MAX
+ fmtULongLongDecimal,
+ fmtULongLongHex,
+ fmtULongLongOctal,
+ fmtULongLongBinary,
+#endif
+ fmtDouble,
+ fmtDoubleTrimSmallAware,
+ fmtDoubleTrim,
+ fmtChar,
+ fmtString,
+ fmtGooString,
+ fmtSpace
+};
+
+static const char *formatStrings[] = {
+ "d", "x", "o", "b", "ud", "ux", "uo", "ub",
+ "ld", "lx", "lo", "lb", "uld", "ulx", "ulo", "ulb",
+#ifdef LLONG_MAX
+ "lld", "llx", "llo", "llb",
+#endif
+#ifdef ULLONG_MAX
+ "ulld", "ullx", "ullo", "ullb",
+#endif
+ "f", "gs", "g",
+ "c",
+ "s",
+ "t",
+ "w",
+ NULL
+};
+
+//------------------------------------------------------------------------
+
+int inline GooString::roundedSize(int len) {
+ int delta;
+ if (len <= STR_STATIC_SIZE-1)
+ return STR_STATIC_SIZE;
+ delta = len < 256 ? 7 : 255;
+ return ((len + 1) + delta) & ~delta;
+}
+
+// Make sure that the buffer is big enough to contain <newLength> characters
+// plus terminating 0.
+// We assume that if this is being called from the constructor, <s> was set
+// to NULL and <length> was set to 0 to indicate unused string before calling us.
+void inline GooString::resize(int newLength) {
+ char *s1 = s;
+
+ if (!s || (roundedSize(length) != roundedSize(newLength))) {
+ // requires re-allocating data for string
+ if (newLength < STR_STATIC_SIZE) {
+ s1 = sStatic;
+ } else {
+ // allocate a rounded amount
+ if (s == sStatic)
+ s1 = (char*)gmalloc(roundedSize(newLength));
+ else
+ s1 = (char*)grealloc(s, roundedSize(newLength));
+ }
+ if (s == sStatic || s1 == sStatic) {
+ // copy the minimum, we only need to if are moving to or
+ // from sStatic.
+ // assert(s != s1) the roundedSize condition ensures this
+ if (newLength < length) {
+ memcpy(s1, s, newLength);
+ } else {
+ memcpy(s1, s, length);
+ }
+ if (s != sStatic)
+ gfree(s);
+ }
+
+ }
+
+ s = s1;
+ length = newLength;
+ s[length] = '\0';
+}
+
+GooString* GooString::Set(const char *s1, int s1Len, const char *s2, int s2Len)
+{
+ int newLen = 0;
+ char *p;
+
+ if (s1) {
+ if (CALC_STRING_LEN == s1Len) {
+ s1Len = strlen(s1);
+ } else
+ assert(s1Len >= 0);
+ newLen += s1Len;
+ }
+
+ if (s2) {
+ if (CALC_STRING_LEN == s2Len) {
+ s2Len = strlen(s2);
+ } else
+ assert(s2Len >= 0);
+ newLen += s2Len;
+ }
+
+ resize(newLen);
+ p = s;
+ if (s1) {
+ memcpy(p, s1, s1Len);
+ p += s1Len;
+ }
+ if (s2) {
+ memcpy(p, s2, s2Len);
+ p += s2Len;
+ }
+ return this;
+}
+
+GooString::GooString() {
+ s = NULL;
+ length = 0;
+ Set(NULL);
+}
+
+GooString::GooString(const char *sA) {
+ s = NULL;
+ length = 0;
+ Set(sA, CALC_STRING_LEN);
+}
+
+GooString::GooString(const char *sA, int lengthA) {
+ s = NULL;
+ length = 0;
+ Set(sA, lengthA);
+}
+
+GooString::GooString(GooString *str, int idx, int lengthA) {
+ s = NULL;
+ length = 0;
+ assert(idx + lengthA <= str->length);
+ Set(str->getCString() + idx, lengthA);
+}
+
+GooString::GooString(const GooString *str) {
+ s = NULL;
+ length = 0;
+ Set(str->getCString(), str->length);
+}
+
+GooString::GooString(GooString *str1, GooString *str2) {
+ s = NULL;
+ length = 0;
+ Set(str1->getCString(), str1->length, str2->getCString(), str2->length);
+}
+
+GooString *GooString::fromInt(int x) {
+ char buf[24]; // enough space for 64-bit ints plus a little extra
+ char *p;
+ int len;
+ formatInt(x, buf, sizeof(buf), gFalse, 0, 10, &p, &len);
+ return new GooString(p, len);
+}
+
+GooString *GooString::format(const char *fmt, ...) {
+ va_list argList;
+ GooString *s;
+
+ s = new GooString();
+ va_start(argList, fmt);
+ s->appendfv(fmt, argList);
+ va_end(argList);
+ return s;
+}
+
+GooString *GooString::formatv(const char *fmt, va_list argList) {
+ GooString *s;
+
+ s = new GooString();
+ s->appendfv(fmt, argList);
+ return s;
+}
+
+GooString::~GooString() {
+ if (s != sStatic)
+ gfree(s);
+}
+
+GooString *GooString::clear() {
+ resize(0);
+ return this;
+}
+
+GooString *GooString::append(char c) {
+ return append((const char*)&c, 1);
+}
+
+GooString *GooString::append(GooString *str) {
+ return append(str->getCString(), str->getLength());
+}
+
+GooString *GooString::append(const char *str, int lengthA) {
+ int prevLen = length;
+ if (CALC_STRING_LEN == lengthA)
+ lengthA = strlen(str);
+ resize(length + lengthA);
+ memcpy(s + prevLen, str, lengthA);
+ return this;
+}
+
+GooString *GooString::appendf(const char *fmt, ...) {
+ va_list argList;
+
+ va_start(argList, fmt);
+ appendfv(fmt, argList);
+ va_end(argList);
+ return this;
+}
+
+GooString *GooString::appendfv(const char *fmt, va_list argList) {
+ GooStringFormatArg *args;
+ int argsLen, argsSize;
+ GooStringFormatArg arg;
+ int idx, width, prec;
+ GBool reverseAlign, zeroFill;
+ GooStringFormatType ft;
+ char buf[65];
+ int len, i;
+ const char *p0, *p1;
+ char *str;
+
+ argsLen = 0;
+ argsSize = 8;
+ args = (GooStringFormatArg *)gmallocn(argsSize, sizeof(GooStringFormatArg));
+
+ p0 = fmt;
+ while (*p0) {
+ if (*p0 == '{') {
+ ++p0;
+ if (*p0 == '{') {
+ ++p0;
+ append('{');
+ } else {
+
+ // parse the format string
+ if (!(*p0 >= '0' && *p0 <= '9')) {
+ break;
+ }
+ idx = *p0 - '0';
+ for (++p0; *p0 >= '0' && *p0 <= '9'; ++p0) {
+ idx = 10 * idx + (*p0 - '0');
+ }
+ if (*p0 != ':') {
+ break;
+ }
+ ++p0;
+ if (*p0 == '-') {
+ reverseAlign = gTrue;
+ ++p0;
+ } else {
+ reverseAlign = gFalse;
+ }
+ width = 0;
+ zeroFill = *p0 == '0';
+ for (; *p0 >= '0' && *p0 <= '9'; ++p0) {
+ width = 10 * width + (*p0 - '0');
+ }
+ if (width < 0) {
+ width = 0;
+ }
+ if (*p0 == '.') {
+ ++p0;
+ prec = 0;
+ for (; *p0 >= '0' && *p0 <= '9'; ++p0) {
+ prec = 10 * prec + (*p0 - '0');
+ }
+ } else {
+ prec = 0;
+ }
+ for (ft = (GooStringFormatType)0;
+ formatStrings[ft];
+ ft = (GooStringFormatType)(ft + 1)) {
+ if (!strncmp(p0, formatStrings[ft], strlen(formatStrings[ft]))) {
+ break;
+ }
+ }
+ if (!formatStrings[ft]) {
+ break;
+ }
+ p0 += strlen(formatStrings[ft]);
+ if (*p0 != '}') {
+ break;
+ }
+ ++p0;
+
+ // fetch the argument
+ if (idx > argsLen) {
+ break;
+ }
+ if (idx == argsLen) {
+ if (argsLen == argsSize) {
+ argsSize *= 2;
+ args = (GooStringFormatArg *)greallocn(args, argsSize,
+ sizeof(GooStringFormatArg));
+ }
+ switch (ft) {
+ case fmtIntDecimal:
+ case fmtIntHex:
+ case fmtIntOctal:
+ case fmtIntBinary:
+ case fmtSpace:
+ args[argsLen].i = va_arg(argList, int);
+ break;
+ case fmtUIntDecimal:
+ case fmtUIntHex:
+ case fmtUIntOctal:
+ case fmtUIntBinary:
+ args[argsLen].ui = va_arg(argList, Guint);
+ break;
+ case fmtLongDecimal:
+ case fmtLongHex:
+ case fmtLongOctal:
+ case fmtLongBinary:
+ args[argsLen].l = va_arg(argList, long);
+ break;
+ case fmtULongDecimal:
+ case fmtULongHex:
+ case fmtULongOctal:
+ case fmtULongBinary:
+ args[argsLen].ul = va_arg(argList, Gulong);
+ break;
+#ifdef LLONG_MAX
+ case fmtLongLongDecimal:
+ case fmtLongLongHex:
+ case fmtLongLongOctal:
+ case fmtLongLongBinary:
+ args[argsLen].ll = va_arg(argList, long long);
+ break;
+#endif
+#ifdef ULLONG_MAX
+ case fmtULongLongDecimal:
+ case fmtULongLongHex:
+ case fmtULongLongOctal:
+ case fmtULongLongBinary:
+ args[argsLen].ull = va_arg(argList, unsigned long long);
+ break;
+#endif
+ case fmtDouble:
+ case fmtDoubleTrim:
+ case fmtDoubleTrimSmallAware:
+ args[argsLen].f = va_arg(argList, double);
+ break;
+ case fmtChar:
+ args[argsLen].c = (char)va_arg(argList, int);
+ break;
+ case fmtString:
+ args[argsLen].s = va_arg(argList, char *);
+ break;
+ case fmtGooString:
+ args[argsLen].gs = va_arg(argList, GooString *);
+ break;
+ }
+ ++argsLen;
+ }
+
+ // format the argument
+ arg = args[idx];
+ switch (ft) {
+ case fmtIntDecimal:
+ formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 10, &str, &len);
+ break;
+ case fmtIntHex:
+ formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 16, &str, &len);
+ break;
+ case fmtIntOctal:
+ formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
+ break;
+ case fmtIntBinary:
+ formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
+ break;
+ case fmtUIntDecimal:
+ formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 10,
+ &str, &len);
+ break;
+ case fmtUIntHex:
+ formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 16,
+ &str, &len);
+ break;
+ case fmtUIntOctal:
+ formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
+ break;
+ case fmtUIntBinary:
+ formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
+ break;
+ case fmtLongDecimal:
+ formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 10, &str, &len);
+ break;
+ case fmtLongHex:
+ formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 16, &str, &len);
+ break;
+ case fmtLongOctal:
+ formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
+ break;
+ case fmtLongBinary:
+ formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
+ break;
+ case fmtULongDecimal:
+ formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 10,
+ &str, &len);
+ break;
+ case fmtULongHex:
+ formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 16,
+ &str, &len);
+ break;
+ case fmtULongOctal:
+ formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
+ break;
+ case fmtULongBinary:
+ formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
+ break;
+#ifdef LLONG_MAX
+ case fmtLongLongDecimal:
+ formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 10, &str, &len);
+ break;
+ case fmtLongLongHex:
+ formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 16, &str, &len);
+ break;
+ case fmtLongLongOctal:
+ formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
+ break;
+ case fmtLongLongBinary:
+ formatInt(arg.ll, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
+ break;
+#endif
+#ifdef ULLONG_MAX
+ case fmtULongLongDecimal:
+ formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 10,
+ &str, &len);
+ break;
+ case fmtULongLongHex:
+ formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 16,
+ &str, &len);
+ break;
+ case fmtULongLongOctal:
+ formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 8,
+ &str, &len);
+ break;
+ case fmtULongLongBinary:
+ formatUInt(arg.ull, buf, sizeof(buf), zeroFill, width, 2,
+ &str, &len);
+ break;
+#endif
+ case fmtDouble:
+ formatDouble(arg.f, buf, sizeof(buf), prec, gFalse, &str, &len);
+ break;
+ case fmtDoubleTrim:
+ formatDouble(arg.f, buf, sizeof(buf), prec, gTrue, &str, &len);
+ break;
+ case fmtDoubleTrimSmallAware:
+ formatDoubleSmallAware(arg.f, buf, sizeof(buf), prec, gTrue, &str, &len);
+ break;
+ case fmtChar:
+ buf[0] = arg.c;
+ str = buf;
+ len = 1;
+ reverseAlign = !reverseAlign;
+ break;
+ case fmtString:
+ str = arg.s;
+ len = strlen(str);
+ reverseAlign = !reverseAlign;
+ break;
+ case fmtGooString:
+ str = arg.gs->getCString();
+ len = arg.gs->getLength();
+ reverseAlign = !reverseAlign;
+ break;
+ case fmtSpace:
+ str = buf;
+ len = 0;
+ width = arg.i;
+ break;
+ }
+
+ // append the formatted arg, handling width and alignment
+ if (!reverseAlign && len < width) {
+ for (i = len; i < width; ++i) {
+ append(' ');
+ }
+ }
+ append(str, len);
+ if (reverseAlign && len < width) {
+ for (i = len; i < width; ++i) {
+ append(' ');
+ }
+ }
+ }
+
+ } else if (*p0 == '}') {
+ ++p0;
+ if (*p0 == '}') {
+ ++p0;
+ }
+ append('}');
+
+ } else {
+ for (p1 = p0 + 1; *p1 && *p1 != '{' && *p1 != '}'; ++p1) ;
+ append(p0, p1 - p0);
+ p0 = p1;
+ }
+ }
+
+ gfree(args);
+ return this;
+}
+#ifdef LLONG_MAX
+void GooString::formatInt(long long x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+ char **p, int *len) {
+#else
+void GooString::formatInt(long x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+ char **p, int *len) {
+#endif
+ static char vals[17] = "0123456789abcdef";
+ GBool neg;
+ int start, i, j;
+
+ i = bufSize;
+ if ((neg = x < 0)) {
+ x = -x;
+ }
+ start = neg ? 1 : 0;
+ if (x == 0) {
+ buf[--i] = '0';
+ } else {
+ while (i > start && x) {
+ buf[--i] = vals[x % base];
+ x /= base;
+ }
+ }
+ if (zeroFill) {
+ for (j = bufSize - i; i > start && j < width - start; ++j) {
+ buf[--i] = '0';
+ }
+ }
+ if (neg) {
+ buf[--i] = '-';
+ }
+ *p = buf + i;
+ *len = bufSize - i;
+}
+
+#ifdef ULLONG_MAX
+void GooString::formatUInt(unsigned long long x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+ char **p, int *len) {
+#else
+void GooString::formatUInt(Gulong x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+ char **p, int *len) {
+#endif
+ static char vals[17] = "0123456789abcdef";
+ int i, j;
+
+ i = bufSize;
+ if (x == 0) {
+ buf[--i] = '0';
+ } else {
+ while (i > 0 && x) {
+ buf[--i] = vals[x % base];
+ x /= base;
+ }
+ }
+ if (zeroFill) {
+ for (j = bufSize - i; i > 0 && j < width; ++j) {
+ buf[--i] = '0';
+ }
+ }
+ *p = buf + i;
+ *len = bufSize - i;
+}
+
+void GooString::formatDouble(double x, char *buf, int bufSize, int prec,
+ GBool trim, char **p, int *len) {
+ GBool neg, started;
+ double x2;
+ int d, i, j;
+
+ if ((neg = x < 0)) {
+ x = -x;
+ }
+ x = floor(x * pow(10.0, prec) + 0.5);
+ i = bufSize;
+ started = !trim;
+ for (j = 0; j < prec && i > 1; ++j) {
+ x2 = floor(0.1 * (x + 0.5));
+ d = (int)floor(x - 10 * x2 + 0.5);
+ if (started || d != 0) {
+ buf[--i] = '0' + d;
+ started = gTrue;
+ }
+ x = x2;
+ }
+ if (i > 1 && started) {
+ buf[--i] = '.';
+ }
+ if (i > 1) {
+ do {
+ x2 = floor(0.1 * (x + 0.5));
+ d = (int)floor(x - 10 * x2 + 0.5);
+ buf[--i] = '0' + d;
+ x = x2;
+ } while (i > 1 && x);
+ }
+ if (neg) {
+ buf[--i] = '-';
+ }
+ *p = buf + i;
+ *len = bufSize - i;
+}
+
+void GooString::formatDoubleSmallAware(double x, char *buf, int bufSize, int prec,
+ GBool trim, char **p, int *len)
+{
+ double absX = fabs(x);
+ if (absX >= 0.1) {
+ formatDouble(x, buf, bufSize, prec, trim, p, len);
+ } else {
+ while (absX < 0.1 && prec < MAXIMUM_DOUBLE_PREC)
+ {
+ absX = absX * 10;
+ prec++;
+ }
+ formatDouble(x, buf, bufSize, prec, trim, p, len);
+ }
+}
+
+GooString *GooString::insert(int i, char c) {
+ return insert(i, (const char*)&c, 1);
+}
+
+GooString *GooString::insert(int i, GooString *str) {
+ return insert(i, str->getCString(), str->getLength());
+}
+
+GooString *GooString::insert(int i, const char *str, int lengthA) {
+ int j;
+ int prevLen = length;
+ if (CALC_STRING_LEN == lengthA)
+ lengthA = strlen(str);
+
+ resize(length + lengthA);
+ for (j = prevLen; j >= i; --j)
+ s[j+lengthA] = s[j];
+ memcpy(s+i, str, lengthA);
+ return this;
+}
+
+GooString *GooString::del(int i, int n) {
+ int j;
+
+ if (i >= 0 && n > 0 && i + n > 0) {
+ if (i + n > length) {
+ n = length - i;
+ }
+ for (j = i; j <= length - n; ++j) {
+ s[j] = s[j + n];
+ }
+ resize(length - n);
+ }
+ return this;
+}
+
+GooString *GooString::upperCase() {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ if (islower(s[i]))
+ s[i] = toupper(s[i]);
+ }
+ return this;
+}
+
+GooString *GooString::lowerCase() {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ if (isupper(s[i]))
+ s[i] = tolower(s[i]);
+ }
+ return this;
+}
+
+int GooString::cmp(GooString *str) const {
+ int n1, n2, i, x;
+ char *p1, *p2;
+
+ n1 = length;
+ n2 = str->length;
+ for (i = 0, p1 = s, p2 = str->s; i < n1 && i < n2; ++i, ++p1, ++p2) {
+ x = *p1 - *p2;
+ if (x != 0) {
+ return x;
+ }
+ }
+ return n1 - n2;
+}
+
+int GooString::cmpN(GooString *str, int n) const {
+ int n1, n2, i, x;
+ char *p1, *p2;
+
+ n1 = length;
+ n2 = str->length;
+ for (i = 0, p1 = s, p2 = str->s;
+ i < n1 && i < n2 && i < n;
+ ++i, ++p1, ++p2) {
+ x = *p1 - *p2;
+ if (x != 0) {
+ return x;
+ }
+ }
+ if (i == n) {
+ return 0;
+ }
+ return n1 - n2;
+}
+
+int GooString::cmp(const char *sA) const {
+ int n1, i, x;
+ const char *p1, *p2;
+
+ n1 = length;
+ for (i = 0, p1 = s, p2 = sA; i < n1 && *p2; ++i, ++p1, ++p2) {
+ x = *p1 - *p2;
+ if (x != 0) {
+ return x;
+ }
+ }
+ if (i < n1) {
+ return 1;
+ }
+ if (*p2) {
+ return -1;
+ }
+ return 0;
+}
+
+int GooString::cmpN(const char *sA, int n) const {
+ int n1, i, x;
+ const char *p1, *p2;
+
+ n1 = length;
+ for (i = 0, p1 = s, p2 = sA; i < n1 && *p2 && i < n; ++i, ++p1, ++p2) {
+ x = *p1 - *p2;
+ if (x != 0) {
+ return x;
+ }
+ }
+ if (i == n) {
+ return 0;
+ }
+ if (i < n1) {
+ return 1;
+ }
+ if (*p2) {
+ return -1;
+ }
+ return 0;
+}
+
+GBool GooString::hasUnicodeMarker(void)
+{
+ return (s[0] & 0xff) == 0xfe && (s[1] & 0xff) == 0xff;
+}
+
+GooString *GooString::sanitizedName(GBool psmode)
+{
+ GooString *name;
+ char buf[8];
+ int i;
+ char c;
+
+ name = new GooString();
+
+ if (psmode)
+ {
+ // ghostscript chokes on names that begin with out-of-limits
+ // numbers, e.g., 1e4foo is handled correctly (as a name), but
+ // 1e999foo generates a limitcheck error
+ c = getChar(0);
+ if (c >= '0' && c <= '9') {
+ name->append('f');
+ }
+ }
+
+ for (i = 0; i < getLength(); ++i) {
+ c = getChar(i);
+ if (c <= (char)0x20 || c >= (char)0x7f ||
+ c == ' ' ||
+ c == '(' || c == ')' || c == '<' || c == '>' ||
+ c == '[' || c == ']' || c == '{' || c == '}' ||
+ c == '/' || c == '%' || c == '#') {
+ sprintf(buf, "#%02x", c & 0xff);
+ name->append(buf);
+ } else {
+ name->append(c);
+ }
+ }
+ return name;
+}
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/GooString.h b/Build/source/libs/poppler/poppler-0.20.0/goo/GooString.h
new file mode 100644
index 00000000000..23558b0c528
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/GooString.h
@@ -0,0 +1,194 @@
+//========================================================================
+//
+// GooString.h
+//
+// Simple variable-length string type.
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
+// Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
+// Copyright (C) 2008-2010, 2012 Albert Astals Cid <aacid@kde.org>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
+#ifndef GooString_H
+#define GooString_H
+
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
+#include <limits.h> // for LLONG_MAX and ULLONG_MAX
+#include <stdarg.h>
+#include <stdlib.h> // for NULL
+#include "gtypes.h"
+
+class GooString {
+public:
+
+ // Create an empty string.
+ GooString();
+
+ // Create a string from a C string.
+ explicit GooString(const char *sA);
+
+ // Create a string from <lengthA> chars at <sA>. This string
+ // can contain null characters.
+ GooString(const char *sA, int lengthA);
+
+ // Create a string from <lengthA> chars at <idx> in <str>.
+ GooString(GooString *str, int idx, int lengthA);
+
+ // Set content of a string to concatination of <s1> and <s2>. They can both
+ // be NULL. if <s1Len> or <s2Len> is CALC_STRING_LEN, then length of the string
+ // will be calculated with strlen(). Otherwise we assume they are a valid
+ // length of string (or its substring)
+ GooString* Set(const char *s1, int s1Len=CALC_STRING_LEN, const char *s2=NULL, int s2Len=CALC_STRING_LEN);
+
+ // Copy a string.
+ explicit GooString(const GooString *str);
+ GooString *copy() const { return new GooString(this); }
+
+ // Concatenate two strings.
+ GooString(GooString *str1, GooString *str2);
+
+ // Convert an integer to a string.
+ static GooString *fromInt(int x);
+
+ // Create a formatted string. Similar to printf, but without the
+ // string overflow issues. Formatting elements consist of:
+ // {<arg>:[<width>][.<precision>]<type>}
+ // where:
+ // - <arg> is the argument number (arg 0 is the first argument
+ // following the format string) -- NB: args must be first used in
+ // order; they can be reused in any order
+ // - <width> is the field width -- negative to reverse the alignment;
+ // starting with a leading zero to zero-fill (for integers)
+ // - <precision> is the number of digits to the right of the decimal
+ // point (for floating point numbers)
+ // - <type> is one of:
+ // d, x, o, b -- int in decimal, hex, octal, binary
+ // ud, ux, uo, ub -- unsigned int
+ // ld, lx, lo, lb, uld, ulx, ulo, ulb -- long, unsigned long
+ // lld, llx, llo, llb, ulld, ullx, ullo, ullb
+ // -- long long, unsigned long long
+ // f, g -- double
+ // c -- char
+ // s -- string (char *)
+ // t -- GooString *
+ // w -- blank space; arg determines width
+ // To get literal curly braces, use {{ or }}.
+ static GooString *format(const char *fmt, ...);
+ static GooString *formatv(const char *fmt, va_list argList);
+
+ // Destructor.
+ ~GooString();
+
+ // Get length.
+ int getLength() { return length; }
+
+ // Get C string.
+ char *getCString() const { return s; }
+
+ // Get <i>th character.
+ char getChar(int i) { return s[i]; }
+
+ // Change <i>th character.
+ void setChar(int i, char c) { s[i] = c; }
+
+ // Clear string to zero length.
+ GooString *clear();
+
+ // Append a character or string.
+ GooString *append(char c);
+ GooString *append(GooString *str);
+ GooString *append(const char *str, int lengthA=CALC_STRING_LEN);
+
+ // Append a formatted string.
+ GooString *appendf(const char *fmt, ...);
+ GooString *appendfv(const char *fmt, va_list argList);
+
+ // Insert a character or string.
+ GooString *insert(int i, char c);
+ GooString *insert(int i, GooString *str);
+ GooString *insert(int i, const char *str, int lengthA=CALC_STRING_LEN);
+
+ // Delete a character or range of characters.
+ GooString *del(int i, int n = 1);
+
+ // Convert string to all-upper/all-lower case.
+ GooString *upperCase();
+ GooString *lowerCase();
+
+ // Compare two strings: -1:< 0:= +1:>
+ int cmp(GooString *str) const;
+ int cmpN(GooString *str, int n) const;
+ int cmp(const char *sA) const;
+ int cmpN(const char *sA, int n) const;
+
+ GBool hasUnicodeMarker(void);
+
+ // Sanitizes the string so that it does
+ // not contain any ( ) < > [ ] { } / %
+ // The postscript mode also has some more strict checks
+ // The caller owns the return value
+ GooString *sanitizedName(GBool psmode);
+
+private:
+ GooString(const GooString &other);
+ GooString& operator=(const GooString &other);
+
+ // you can tweak this number for a different speed/memory usage tradeoffs.
+ // In libc malloc() rounding is 16 so it's best to choose a value that
+ // results in sizeof(GooString) be a multiple of 16.
+ // 24 makes sizeof(GooString) to be 32.
+ static const int STR_STATIC_SIZE = 24;
+ // a special value telling that the length of the string is not given
+ // so it must be calculated from the strings
+ static const int CALC_STRING_LEN = -1;
+
+ int roundedSize(int len);
+
+ char sStatic[STR_STATIC_SIZE];
+ int length;
+ char *s;
+
+ void resize(int newLength);
+#ifdef LLONG_MAX
+ static void formatInt(long long x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+ char **p, int *len);
+#else
+ static void formatInt(long x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+ char **p, int *len);
+#endif
+#ifdef ULLONG_MAX
+ static void formatUInt(unsigned long long x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+ char **p, int *len);
+#else
+ static void formatUInt(Gulong x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+ char **p, int *len);
+#endif
+ static void formatDouble(double x, char *buf, int bufSize, int prec,
+ GBool trim, char **p, int *len);
+ static void formatDoubleSmallAware(double x, char *buf, int bufSize, int prec,
+ GBool trim, char **p, int *len);
+};
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/GooTimer.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/GooTimer.cc
new file mode 100644
index 00000000000..c766c6bf2e4
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/GooTimer.cc
@@ -0,0 +1,95 @@
+//========================================================================
+//
+// GooTimer.cc
+//
+// This file is licensed under GPLv2 or later
+//
+// Copyright 2005 Jonathan Blandford <jrb@redhat.com>
+// Copyright 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
+// Copyright 2010 Hib Eris <hib@hiberis.nl>
+// Inspired by gtimer.c in glib, which is Copyright 2000 by the GLib Team
+//
+//========================================================================
+
+#include <config.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include "GooTimer.h"
+#include <string.h>
+
+#define USEC_PER_SEC 1000000
+
+//------------------------------------------------------------------------
+// GooTimer
+//------------------------------------------------------------------------
+
+GooTimer::GooTimer() {
+ start();
+}
+
+void GooTimer::start() {
+#ifdef HAVE_GETTIMEOFDAY
+ gettimeofday(&start_time, NULL);
+#elif defined(_WIN32)
+ QueryPerformanceCounter(&start_time);
+#endif
+ active = true;
+}
+
+void GooTimer::stop() {
+#ifdef HAVE_GETTIMEOFDAY
+ gettimeofday(&end_time, NULL);
+#elif defined(_WIN32)
+ QueryPerformanceCounter(&end_time);
+#endif
+ active = false;
+}
+
+#ifdef HAVE_GETTIMEOFDAY
+double GooTimer::getElapsed()
+{
+ double total;
+ struct timeval elapsed;
+
+ if (active)
+ gettimeofday(&end_time, NULL);
+
+ if (start_time.tv_usec > end_time.tv_usec) {
+ end_time.tv_usec += USEC_PER_SEC;
+ end_time.tv_sec--;
+ }
+
+ elapsed.tv_usec = end_time.tv_usec - start_time.tv_usec;
+ elapsed.tv_sec = end_time.tv_sec - start_time.tv_sec;
+
+ total = elapsed.tv_sec + ((double) elapsed.tv_usec / 1e6);
+ if (total < 0)
+ total = 0;
+
+ return total;
+}
+#elif defined(_WIN32)
+double GooTimer::getElapsed()
+{
+ LARGE_INTEGER freq;
+ double time_in_secs;
+ QueryPerformanceFrequency(&freq);
+
+ if (active)
+ QueryPerformanceCounter(&end_time);
+
+ time_in_secs = (double)(end_time.QuadPart-start_time.QuadPart)/(double)freq.QuadPart;
+ return time_in_secs * 1000.0;
+
+}
+#else
+double GooTimer::getElapsed()
+{
+#warning "no support for GooTimer"
+ return 0;
+}
+#endif
+
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/GooTimer.h b/Build/source/libs/poppler/poppler-0.20.0/goo/GooTimer.h
new file mode 100644
index 00000000000..d700e501c07
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/GooTimer.h
@@ -0,0 +1,57 @@
+//========================================================================
+//
+// GooTimer.cc
+//
+// This file is licensed under GPLv2 or later
+//
+// Copyright 2005 Jonathan Blandford <jrb@redhat.com>
+// Copyright 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
+// Copyright 2010 Hib Eris <hib@hiberis.nl>
+// Copyright 2011 Albert Astals cid <aacid@kde.org>
+// Inspired by gtimer.c in glib, which is Copyright 2000 by the GLib Team
+//
+//========================================================================
+
+#ifndef GOOTIMER_H
+#define GOOTIMER_H
+
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
+#include "poppler/poppler-config.h"
+#include "gtypes.h"
+#ifdef HAVE_GETTIMEOFDAY
+#include <sys/time.h>
+#endif
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+//------------------------------------------------------------------------
+// GooTimer
+//------------------------------------------------------------------------
+
+class GooTimer {
+public:
+
+ // Create a new timer.
+ GooTimer();
+
+ void start();
+ void stop();
+ double getElapsed();
+
+private:
+#ifdef HAVE_GETTIMEOFDAY
+ struct timeval start_time;
+ struct timeval end_time;
+#elif defined(_WIN32)
+ LARGE_INTEGER start_time;
+ LARGE_INTEGER end_time;
+#endif
+ GBool active;
+};
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/ImgWriter.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/ImgWriter.cc
new file mode 100644
index 00000000000..a30d26d89ad
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/ImgWriter.cc
@@ -0,0 +1,15 @@
+//========================================================================
+//
+// ImgWriter.cpp
+//
+// This file is licensed under the GPLv2 or later
+//
+// Copyright (C) 2009 Albert Astals Cid <aacid@kde.org>
+//
+//========================================================================
+
+#include "ImgWriter.h"
+
+ImgWriter::~ImgWriter()
+{
+}
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/ImgWriter.h b/Build/source/libs/poppler/poppler-0.20.0/goo/ImgWriter.h
new file mode 100644
index 00000000000..185c230ef48
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/ImgWriter.h
@@ -0,0 +1,33 @@
+//========================================================================
+//
+// ImgWriter.h
+//
+// This file is licensed under the GPLv2 or later
+//
+// Copyright (C) 2009 Stefan Thomas <thomas@eload24.com>
+// Copyright (C) 2009, 2011 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2010 Adrian Johnson <ajohnson@redneon.com>
+// Copyright (C) 2010 Brian Cameron <brian.cameron@oracle.com>
+// Copyright (C) 2011 Thomas Freitag <Thomas.Freitag@alfa.de>
+//
+//========================================================================
+
+#ifndef IMGWRITER_H
+#define IMGWRITER_H
+
+#include <stdio.h>
+
+class ImgWriter
+{
+ public:
+ virtual ~ImgWriter();
+ virtual bool init(FILE *f, int width, int height, int hDPI, int vDPI) = 0;
+
+ virtual bool writePointers(unsigned char **rowPointers, int rowCount) = 0;
+ virtual bool writeRow(unsigned char **row) = 0;
+
+ virtual bool close() = 0;
+ virtual bool supportCMYK() { return false; }
+};
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/JpegWriter.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/JpegWriter.cc
new file mode 100644
index 00000000000..2fe3d3276cf
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/JpegWriter.cc
@@ -0,0 +1,147 @@
+//========================================================================
+//
+// JpegWriter.cc
+//
+// This file is licensed under the GPLv2 or later
+//
+// Copyright (C) 2009 Stefan Thomas <thomas@eload24.com>
+// Copyright (C) 2010, 2012 Adrian Johnson <ajohnson@redneon.com>
+// Copyright (C) 2010 Harry Roberts <harry.roberts@midnight-labs.org>
+// Copyright (C) 2011 Thomas Freitag <Thomas.Freitag@alfa.de>
+//
+//========================================================================
+
+#include "JpegWriter.h"
+
+#ifdef ENABLE_LIBJPEG
+
+#include "poppler/Error.h"
+
+void outputMessage(j_common_ptr cinfo)
+{
+ char buffer[JMSG_LENGTH_MAX];
+
+ // Create the message
+ (*cinfo->err->format_message) (cinfo, buffer);
+
+ // Send it to poppler's error handler
+ error(errInternal, -1, "{0:s}", buffer);
+}
+
+JpegWriter::JpegWriter(int q, bool p, J_COLOR_SPACE cm)
+: progressive(p), quality(q), colorMode(cm)
+{
+}
+
+JpegWriter::JpegWriter(J_COLOR_SPACE cm)
+: progressive(false), quality(-1), colorMode(cm)
+{
+}
+
+JpegWriter::~JpegWriter()
+{
+ // cleanup
+ jpeg_destroy_compress(&cinfo);
+}
+
+bool JpegWriter::init(FILE *f, int width, int height, int hDPI, int vDPI)
+{
+ // Setup error handler
+ cinfo.err = jpeg_std_error(&jerr);
+ jerr.output_message = &outputMessage;
+
+ // Initialize libjpeg
+ jpeg_create_compress(&cinfo);
+
+ // Set colorspace and initialise defaults
+ cinfo.in_color_space = colorMode; /* colorspace of input image */
+ jpeg_set_defaults(&cinfo);
+
+ // Set destination file
+ jpeg_stdio_dest(&cinfo, f);
+
+ // Set libjpeg configuration
+ cinfo.image_width = width;
+ cinfo.image_height = height;
+ cinfo.density_unit = 1; // dots per inch
+ cinfo.X_density = hDPI;
+ cinfo.Y_density = vDPI;
+ /* # of color components per pixel */
+ switch (colorMode) {
+ case JCS_GRAYSCALE:
+ cinfo.input_components = 1;
+ break;
+ case JCS_RGB:
+ cinfo.input_components = 3;
+ break;
+ case JCS_CMYK:
+ cinfo.input_components = 4;
+ break;
+ default:
+ return false;
+ }
+ if (cinfo.in_color_space == JCS_CMYK) {
+ jpeg_set_colorspace(&cinfo, JCS_YCCK);
+ cinfo.write_JFIF_header = TRUE;
+ }
+
+ // Set quality
+ if( quality >= 0 && quality <= 100 ) {
+ jpeg_set_quality(&cinfo, quality, true);
+ }
+
+ // Use progressive mode
+ if( progressive) {
+ jpeg_simple_progression(&cinfo);
+ }
+
+ // Get ready for data
+ jpeg_start_compress(&cinfo, TRUE);
+
+ return true;
+}
+
+bool JpegWriter::writePointers(unsigned char **rowPointers, int rowCount)
+{
+ if (colorMode == JCS_CMYK) {
+ for (int y = 0; y < rowCount; y++) {
+ unsigned char *row = rowPointers[y];
+ for (unsigned int x = 0; x < cinfo.image_width; x++) {
+ for (int n = 0; n < 4; n++) {
+ *row = 0xff - *row;
+ row++;
+ }
+ }
+ }
+ }
+ // Write all rows to the file
+ jpeg_write_scanlines(&cinfo, rowPointers, rowCount);
+
+ return true;
+}
+
+bool JpegWriter::writeRow(unsigned char **rowPointer)
+{
+ if (colorMode == JCS_CMYK) {
+ unsigned char *row = rowPointer[0];
+ for (unsigned int x = 0; x < cinfo.image_width; x++) {
+ for (int n = 0; n < 4; n++) {
+ *row = 0xff - *row;
+ row++;
+ }
+ }
+ }
+ // Write the row to the file
+ jpeg_write_scanlines(&cinfo, rowPointer, 1);
+
+ return true;
+}
+
+bool JpegWriter::close()
+{
+ jpeg_finish_compress(&cinfo);
+
+ return true;
+}
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/JpegWriter.h b/Build/source/libs/poppler/poppler-0.20.0/goo/JpegWriter.h
new file mode 100644
index 00000000000..7af6870f6b8
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/JpegWriter.h
@@ -0,0 +1,56 @@
+//========================================================================
+//
+// JpegWriter.h
+//
+// This file is licensed under the GPLv2 or later
+//
+// Copyright (C) 2009 Stefan Thomas <thomas@eload24.com>
+// Copyright (C) 2010 Adrian Johnson <ajohnson@redneon.com>
+// Copyright (C) 2010 Jürg Billeter <j@bitron.ch>
+// Copyright (C) 2010 Harry Roberts <harry.roberts@midnight-labs.org>
+// Copyright (C) 2010 Brian Cameron <brian.cameron@oracle.com>
+// Copyright (C) 2011 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2011 Thomas Freitag <Thomas.Freitag@alfa.de>
+//
+//========================================================================
+
+#ifndef JPEGWRITER_H
+#define JPEGWRITER_H
+
+#include "poppler/poppler-config.h"
+
+#ifdef ENABLE_LIBJPEG
+
+#include <sys/types.h>
+#include "ImgWriter.h"
+
+extern "C" {
+#include <jpeglib.h>
+}
+
+class JpegWriter : public ImgWriter
+{
+ public:
+ JpegWriter(int quality, bool progressive, J_COLOR_SPACE colorMode = JCS_RGB);
+ JpegWriter(J_COLOR_SPACE colorMode = JCS_RGB);
+ ~JpegWriter();
+
+ bool init(FILE *f, int width, int height, int hDPI, int vDPI);
+
+ bool writePointers(unsigned char **rowPointers, int rowCount);
+ bool writeRow(unsigned char **row);
+
+ bool close();
+ bool supportCMYK() { return colorMode == JCS_CMYK; }
+
+ private:
+ bool progressive;
+ int quality;
+ J_COLOR_SPACE colorMode;
+ struct jpeg_compress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+};
+
+#endif
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/Makefile.am b/Build/source/libs/poppler/poppler-0.20.0/goo/Makefile.am
new file mode 100644
index 00000000000..f4f97304f39
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/Makefile.am
@@ -0,0 +1,62 @@
+noinst_LTLIBRARIES = libgoo.la
+
+if ENABLE_XPDF_HEADERS
+
+poppler_goo_includedir = $(includedir)/poppler/goo
+poppler_goo_include_HEADERS = \
+ GooHash.h \
+ GooList.h \
+ GooTimer.h \
+ GooMutex.h \
+ GooString.h \
+ gtypes.h \
+ gmem.h \
+ gfile.h \
+ FixedPoint.h \
+ PNGWriter.h \
+ JpegWriter.h \
+ TiffWriter.h \
+ ImgWriter.h \
+ GooLikely.h \
+ gstrtod.h
+
+endif
+
+if BUILD_LIBJPEG
+libjpeg_includes = $(LIBJPEG_CFLAGS)
+endif
+
+if BUILD_LIBTIFF
+libtiff_includes = $(LIBTIFF_CFLAGS)
+endif
+
+if BUILD_LIBOPENJPEG
+libjpeg2000_includes = $(LIBOPENJPEG_CFLAGS)
+endif
+
+if BUILD_LIBPNG
+libpng_includes = $(LIBPNG_CFLAGS)
+endif
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ $(libjpeg_includes) \
+ $(libtiff_includes) \
+ $(libjpeg2000_includes) \
+ $(libpng_includes)
+
+libgoo_la_SOURCES = \
+ gfile.cc \
+ gmempp.cc \
+ GooHash.cc \
+ GooList.cc \
+ GooTimer.cc \
+ GooString.cc \
+ gmem.cc \
+ FixedPoint.cc \
+ PNGWriter.cc \
+ JpegWriter.cc \
+ TiffWriter.cc \
+ ImgWriter.cc \
+ gtypes_p.h \
+ gstrtod.cc
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/Makefile.in b/Build/source/libs/poppler/poppler-0.20.0/goo/Makefile.in
new file mode 100644
index 00000000000..b0ed3ac5f36
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/Makefile.in
@@ -0,0 +1,712 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = goo
+DIST_COMMON = $(am__poppler_goo_include_HEADERS_DIST) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
+ $(top_srcdir)/m4/define-dir.m4 $(top_srcdir)/m4/gtk-doc.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/introspection.m4 \
+ $(top_srcdir)/m4/libjpeg.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/poppler/poppler-config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libgoo_la_LIBADD =
+am_libgoo_la_OBJECTS = gfile.lo gmempp.lo GooHash.lo GooList.lo \
+ GooTimer.lo GooString.lo gmem.lo FixedPoint.lo PNGWriter.lo \
+ JpegWriter.lo TiffWriter.lo ImgWriter.lo gstrtod.lo
+libgoo_la_OBJECTS = $(am_libgoo_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/poppler
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(libgoo_la_SOURCES)
+DIST_SOURCES = $(libgoo_la_SOURCES)
+am__poppler_goo_include_HEADERS_DIST = GooHash.h GooList.h GooTimer.h \
+ GooMutex.h GooString.h gtypes.h gmem.h gfile.h FixedPoint.h \
+ PNGWriter.h JpegWriter.h TiffWriter.h ImgWriter.h GooLikely.h \
+ gstrtod.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(poppler_goo_includedir)"
+HEADERS = $(poppler_goo_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CAIRO_CFLAGS = @CAIRO_CFLAGS@
+CAIRO_FEATURE = @CAIRO_FEATURE@
+CAIRO_LIBS = @CAIRO_LIBS@
+CAIRO_REQ = @CAIRO_REQ@
+CAIRO_VERSION = @CAIRO_VERSION@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
+FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_CONFIG = @FREETYPE_CONFIG@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLIB_REQ = @GLIB_REQ@
+GLIB_REQUIRED = @GLIB_REQUIRED@
+GREP = @GREP@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+GTK_TEST_CFLAGS = @GTK_TEST_CFLAGS@
+GTK_TEST_LIBS = @GTK_TEST_LIBS@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+LCMS_CFLAGS = @LCMS_CFLAGS@
+LCMS_LIBS = @LCMS_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBICONV = @LIBICONV@
+LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
+LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBOPENJPEG_CFLAGS = @LIBOPENJPEG_CFLAGS@
+LIBOPENJPEG_LIBS = @LIBOPENJPEG_LIBS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBTIFF_CFLAGS = @LIBTIFF_CFLAGS@
+LIBTIFF_CFLAGSS = @LIBTIFF_CFLAGSS@
+LIBTIFF_LIBS = @LIBTIFF_LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MOCQT4 = @MOCQT4@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PC_REQUIRES = @PC_REQUIRES@
+PC_REQUIRES_PRIVATE = @PC_REQUIRES_PRIVATE@
+PDFTOCAIRO_CFLAGS = @PDFTOCAIRO_CFLAGS@
+PDFTOCAIRO_LIBS = @PDFTOCAIRO_LIBS@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POPPLER_DATADIR = @POPPLER_DATADIR@
+POPPLER_GLIB_CFLAGS = @POPPLER_GLIB_CFLAGS@
+POPPLER_GLIB_DISABLE_DEPRECATED = @POPPLER_GLIB_DISABLE_DEPRECATED@
+POPPLER_GLIB_DISABLE_SINGLE_INCLUDES = @POPPLER_GLIB_DISABLE_SINGLE_INCLUDES@
+POPPLER_GLIB_LIBS = @POPPLER_GLIB_LIBS@
+POPPLER_MAJOR_VERSION = @POPPLER_MAJOR_VERSION@
+POPPLER_MICRO_VERSION = @POPPLER_MICRO_VERSION@
+POPPLER_MINOR_VERSION = @POPPLER_MINOR_VERSION@
+POPPLER_QT4_CFLAGS = @POPPLER_QT4_CFLAGS@
+POPPLER_QT4_CXXFLAGS = @POPPLER_QT4_CXXFLAGS@
+POPPLER_QT4_LIBS = @POPPLER_QT4_LIBS@
+POPPLER_QT4_TEST_CFLAGS = @POPPLER_QT4_TEST_CFLAGS@
+POPPLER_QT4_TEST_LIBS = @POPPLER_QT4_TEST_LIBS@
+POPPLER_VERSION = @POPPLER_VERSION@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TESTDATADIR = @TESTDATADIR@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+acx_pthread_config = @acx_pthread_config@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+auto_import_flags = @auto_import_flags@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+create_shared_lib = @create_shared_lib@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+win32_libs = @win32_libs@
+noinst_LTLIBRARIES = libgoo.la
+@ENABLE_XPDF_HEADERS_TRUE@poppler_goo_includedir = $(includedir)/poppler/goo
+@ENABLE_XPDF_HEADERS_TRUE@poppler_goo_include_HEADERS = \
+@ENABLE_XPDF_HEADERS_TRUE@ GooHash.h \
+@ENABLE_XPDF_HEADERS_TRUE@ GooList.h \
+@ENABLE_XPDF_HEADERS_TRUE@ GooTimer.h \
+@ENABLE_XPDF_HEADERS_TRUE@ GooMutex.h \
+@ENABLE_XPDF_HEADERS_TRUE@ GooString.h \
+@ENABLE_XPDF_HEADERS_TRUE@ gtypes.h \
+@ENABLE_XPDF_HEADERS_TRUE@ gmem.h \
+@ENABLE_XPDF_HEADERS_TRUE@ gfile.h \
+@ENABLE_XPDF_HEADERS_TRUE@ FixedPoint.h \
+@ENABLE_XPDF_HEADERS_TRUE@ PNGWriter.h \
+@ENABLE_XPDF_HEADERS_TRUE@ JpegWriter.h \
+@ENABLE_XPDF_HEADERS_TRUE@ TiffWriter.h \
+@ENABLE_XPDF_HEADERS_TRUE@ ImgWriter.h \
+@ENABLE_XPDF_HEADERS_TRUE@ GooLikely.h \
+@ENABLE_XPDF_HEADERS_TRUE@ gstrtod.h
+
+@BUILD_LIBJPEG_TRUE@libjpeg_includes = $(LIBJPEG_CFLAGS)
+@BUILD_LIBTIFF_TRUE@libtiff_includes = $(LIBTIFF_CFLAGS)
+@BUILD_LIBOPENJPEG_TRUE@libjpeg2000_includes = $(LIBOPENJPEG_CFLAGS)
+@BUILD_LIBPNG_TRUE@libpng_includes = $(LIBPNG_CFLAGS)
+INCLUDES = \
+ -I$(top_srcdir) \
+ $(libjpeg_includes) \
+ $(libtiff_includes) \
+ $(libjpeg2000_includes) \
+ $(libpng_includes)
+
+libgoo_la_SOURCES = \
+ gfile.cc \
+ gmempp.cc \
+ GooHash.cc \
+ GooList.cc \
+ GooTimer.cc \
+ GooString.cc \
+ gmem.cc \
+ FixedPoint.cc \
+ PNGWriter.cc \
+ JpegWriter.cc \
+ TiffWriter.cc \
+ ImgWriter.cc \
+ gtypes_p.h \
+ gstrtod.cc
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cc .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign goo/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign goo/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libgoo.la: $(libgoo_la_OBJECTS) $(libgoo_la_DEPENDENCIES) $(EXTRA_libgoo_la_DEPENDENCIES)
+ $(AM_V_CXXLD)$(CXXLINK) $(libgoo_la_OBJECTS) $(libgoo_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FixedPoint.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GooHash.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GooList.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GooString.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GooTimer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ImgWriter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/JpegWriter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PNGWriter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TiffWriter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmem.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmempp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gstrtod.Plo@am__quote@
+
+.cc.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cc.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-poppler_goo_includeHEADERS: $(poppler_goo_include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(poppler_goo_includedir)" || $(MKDIR_P) "$(DESTDIR)$(poppler_goo_includedir)"
+ @list='$(poppler_goo_include_HEADERS)'; test -n "$(poppler_goo_includedir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(poppler_goo_includedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(poppler_goo_includedir)" || exit $$?; \
+ done
+
+uninstall-poppler_goo_includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(poppler_goo_include_HEADERS)'; test -n "$(poppler_goo_includedir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(poppler_goo_includedir)'; $(am__uninstall_files_from_dir)
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(poppler_goo_includedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-poppler_goo_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-poppler_goo_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-poppler_goo_includeHEADERS \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am \
+ uninstall-poppler_goo_includeHEADERS
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/PNGWriter.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/PNGWriter.cc
new file mode 100644
index 00000000000..fe8b79ed0d5
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/PNGWriter.cc
@@ -0,0 +1,176 @@
+//========================================================================
+//
+// PNGWriter.cc
+//
+// This file is licensed under the GPLv2 or later
+//
+// Copyright (C) 2009 Warren Toomey <wkt@tuhs.org>
+// Copyright (C) 2009 Shen Liang <shenzhuxi@gmail.com>
+// Copyright (C) 2009, 2011 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2009 Stefan Thomas <thomas@eload24.com>
+// Copyright (C) 2010, 2011 Adrian Johnson <ajohnson@redneon.com>
+// Copyright (C) 2011 Thomas Klausner <wiz@danbala.tuwien.ac.at>
+//
+//========================================================================
+
+#include "PNGWriter.h"
+
+#ifdef ENABLE_LIBPNG
+
+#include <zlib.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "poppler/Error.h"
+#include "goo/gmem.h"
+
+PNGWriter::PNGWriter(Format formatA) : format(formatA)
+{
+ icc_data = NULL;
+ icc_data_size = 0;
+ icc_name = NULL;
+ sRGB_profile = false;
+}
+
+PNGWriter::~PNGWriter()
+{
+ /* cleanup heap allocation */
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+ if (icc_data) {
+ gfree(icc_data);
+ free(icc_name);
+ }
+}
+
+void PNGWriter::setICCProfile(const char *name, unsigned char *data, int size)
+{
+ icc_data = (unsigned char *)gmalloc(size);
+ memcpy(icc_data, data, size);
+ icc_data_size = size;
+ icc_name = strdup(name);
+}
+
+void PNGWriter::setSRGBProfile()
+{
+ sRGB_profile = true;
+}
+
+bool PNGWriter::init(FILE *f, int width, int height, int hDPI, int vDPI)
+{
+ /* libpng changed the png_set_iCCP() prototype in 1.5.0 */
+#if PNG_LIBPNG_VER < 10500
+ png_charp icc_data_ptr = (png_charp)icc_data;
+#else
+ png_const_bytep icc_data_ptr = (png_const_bytep)icc_data;
+#endif
+
+ /* initialize stuff */
+ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+ if (!png_ptr) {
+ error(errInternal, -1, "png_create_write_struct failed");
+ return false;
+ }
+
+ info_ptr = png_create_info_struct(png_ptr);
+ if (!info_ptr) {
+ error(errInternal, -1, "png_create_info_struct failed");
+ return false;
+ }
+
+ if (setjmp(png_jmpbuf(png_ptr))) {
+ error(errInternal, -1, "png_jmpbuf failed");
+ return false;
+ }
+
+ /* write header */
+ png_init_io(png_ptr, f);
+ if (setjmp(png_jmpbuf(png_ptr))) {
+ error(errInternal, -1, "Error during writing header");
+ return false;
+ }
+
+ // Set up the type of PNG image and the compression level
+ png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);
+
+ // Silence silly gcc
+ png_byte bit_depth = -1;
+ png_byte color_type = -1;
+ switch (format) {
+ case RGB:
+ bit_depth = 8;
+ color_type = PNG_COLOR_TYPE_RGB;
+ break;
+ case RGBA:
+ bit_depth = 8;
+ color_type = PNG_COLOR_TYPE_RGB_ALPHA;
+ break;
+ case GRAY:
+ bit_depth = 8;
+ color_type = PNG_COLOR_TYPE_GRAY;
+ break;
+ case MONOCHROME:
+ bit_depth = 1;
+ color_type = PNG_COLOR_TYPE_GRAY;
+ break;
+ }
+ png_byte interlace_type = PNG_INTERLACE_NONE;
+
+ png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, color_type, interlace_type, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+
+ png_set_pHYs(png_ptr, info_ptr, hDPI/0.0254, vDPI/0.0254, PNG_RESOLUTION_METER);
+
+ if (icc_data)
+ png_set_iCCP(png_ptr, info_ptr, icc_name, PNG_COMPRESSION_TYPE_BASE, icc_data_ptr, icc_data_size);
+ else if (sRGB_profile)
+ png_set_sRGB(png_ptr, info_ptr, PNG_sRGB_INTENT_RELATIVE);
+
+ png_write_info(png_ptr, info_ptr);
+ if (setjmp(png_jmpbuf(png_ptr))) {
+ error(errInternal, -1, "error during writing png info bytes");
+ return false;
+ }
+
+ // pack 1 pixel/byte rows into 8 pixels/byte
+ if (format == MONOCHROME)
+ png_set_packing(png_ptr);
+
+ return true;
+}
+
+bool PNGWriter::writePointers(unsigned char **rowPointers, int rowCount)
+{
+ png_write_image(png_ptr, rowPointers);
+ /* write bytes */
+ if (setjmp(png_jmpbuf(png_ptr))) {
+ error(errInternal, -1, "Error during writing bytes");
+ return false;
+ }
+
+ return true;
+}
+
+bool PNGWriter::writeRow(unsigned char **row)
+{
+ // Write the row to the file
+ png_write_rows(png_ptr, row, 1);
+ if (setjmp(png_jmpbuf(png_ptr))) {
+ error(errInternal, -1, "error during png row write");
+ return false;
+ }
+
+ return true;
+}
+
+bool PNGWriter::close()
+{
+ /* end write */
+ png_write_end(png_ptr, info_ptr);
+ if (setjmp(png_jmpbuf(png_ptr))) {
+ error(errInternal, -1, "Error during end of write");
+ return false;
+ }
+
+ return true;
+}
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/PNGWriter.h b/Build/source/libs/poppler/poppler-0.20.0/goo/PNGWriter.h
new file mode 100644
index 00000000000..f22495d0d00
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/PNGWriter.h
@@ -0,0 +1,63 @@
+//========================================================================
+//
+// PNGWriter.h
+//
+// This file is licensed under the GPLv2 or later
+//
+// Copyright (C) 2009 Warren Toomey <wkt@tuhs.org>
+// Copyright (C) 2009 Shen Liang <shenzhuxi@gmail.com>
+// Copyright (C) 2009, 2011 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2009 Stefan Thomas <thomas@eload24.com>
+// Copyright (C) 2010, 2011 Adrian Johnson <ajohnson@redneon.com>
+//
+//========================================================================
+
+#ifndef PNGWRITER_H
+#define PNGWRITER_H
+
+#include "poppler/poppler-config.h"
+
+#ifdef ENABLE_LIBPNG
+
+#include <cstdio>
+#include <png.h>
+#include "ImgWriter.h"
+
+class PNGWriter : public ImgWriter
+{
+ public:
+
+ /* RGB - 3 bytes/pixel
+ * RGBA - 4 bytes/pixel
+ * GRAY - 1 byte/pixel
+ * MONOCHROME - 1 byte/pixel. PNGWriter will bitpack to 8 pixels/byte
+ */
+ enum Format { RGB, RGBA, GRAY, MONOCHROME };
+
+ PNGWriter(Format format = RGB);
+ ~PNGWriter();
+
+ void setICCProfile(const char *name, unsigned char *data, int size);
+ void setSRGBProfile();
+
+
+ bool init(FILE *f, int width, int height, int hDPI, int vDPI);
+
+ bool writePointers(unsigned char **rowPointers, int rowCount);
+ bool writeRow(unsigned char **row);
+
+ bool close();
+
+ private:
+ Format format;
+ png_structp png_ptr;
+ png_infop info_ptr;
+ unsigned char *icc_data;
+ int icc_data_size;
+ char *icc_name;
+ bool sRGB_profile;
+};
+
+#endif
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/TiffWriter.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/TiffWriter.cc
new file mode 100644
index 00000000000..f63b2450029
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/TiffWriter.cc
@@ -0,0 +1,202 @@
+//========================================================================
+//
+// TiffWriter.cc
+//
+// This file is licensed under the GPLv2 or later
+//
+// Copyright (C) 2010 William Bader <williambader@hotmail.com>
+//
+//========================================================================
+
+#include "TiffWriter.h"
+
+#if ENABLE_LIBTIFF
+
+#include <string.h>
+
+TiffWriter::~TiffWriter()
+{
+ // no cleanup needed
+}
+
+TiffWriter::TiffWriter()
+{
+ f = NULL;
+ numRows = 0;
+ curRow = 0;
+ compressionString = NULL;
+ splashMode = splashModeRGB8;
+}
+
+// Set the compression type
+
+void TiffWriter::setCompressionString(const char *compressionStringArg)
+{
+ compressionString = compressionStringArg;
+}
+
+// Set the bitmap mode
+
+void TiffWriter::setSplashMode(SplashColorMode splashModeArg)
+{
+ splashMode = splashModeArg;
+}
+
+// Write a TIFF file.
+
+bool TiffWriter::init(FILE *openedFile, int width, int height, int hDPI, int vDPI)
+{
+ unsigned int compression;
+ uint16 photometric;
+ uint32 rowsperstrip = (uint32) -1;
+ int bitspersample;
+ uint16 samplesperpixel;
+ const struct compression_name_tag {
+ const char *compressionName; // name of the compression option from the command line
+ unsigned int compressionCode; // internal libtiff code
+ const char *compressionDescription; // descriptive name
+ } compressionList[] = {
+ { "none", COMPRESSION_NONE, "no compression" },
+ { "ccittrle", COMPRESSION_CCITTRLE, "CCITT modified Huffman RLE" },
+ { "ccittfax3", COMPRESSION_CCITTFAX3,"CCITT Group 3 fax encoding" },
+ { "ccittt4", COMPRESSION_CCITT_T4, "CCITT T.4 (TIFF 6 name)" },
+ { "ccittfax4", COMPRESSION_CCITTFAX4, "CCITT Group 4 fax encoding" },
+ { "ccittt6", COMPRESSION_CCITT_T6, "CCITT T.6 (TIFF 6 name)" },
+ { "lzw", COMPRESSION_LZW, "Lempel-Ziv & Welch" },
+ { "ojpeg", COMPRESSION_OJPEG, "!6.0 JPEG" },
+ { "jpeg", COMPRESSION_JPEG, "%JPEG DCT compression" },
+ { "next", COMPRESSION_NEXT, "NeXT 2-bit RLE" },
+ { "packbits", COMPRESSION_PACKBITS, "Macintosh RLE" },
+ { "ccittrlew", COMPRESSION_CCITTRLEW, "CCITT modified Huffman RLE w/ word alignment" },
+ { "deflate", COMPRESSION_DEFLATE, "Deflate compression" },
+ { "adeflate", COMPRESSION_ADOBE_DEFLATE, "Deflate compression, as recognized by Adobe" },
+ { "dcs", COMPRESSION_DCS, "Kodak DCS encoding" },
+ { "jbig", COMPRESSION_JBIG, "ISO JBIG" },
+ { "jp2000", COMPRESSION_JP2000, "Leadtools JPEG2000" },
+ { NULL, 0, NULL }
+ };
+
+ // Initialize
+
+ f = NULL;
+ curRow = 0;
+
+ // Store the number of rows
+
+ numRows = height;
+
+ // Set the compression
+
+ compression = COMPRESSION_NONE;
+
+ if (compressionString == NULL || strcmp(compressionString, "") == 0) {
+ compression = COMPRESSION_NONE;
+ } else {
+ int i;
+ for (i = 0; compressionList[i].compressionName != NULL; i++) {
+ if (strcmp(compressionString, compressionList[i].compressionName) == 0) {
+ compression = compressionList[i].compressionCode;
+ break;
+ }
+ }
+ if (compressionList[i].compressionName == NULL) {
+ fprintf(stderr, "TiffWriter: Unknown compression type '%.10s', using 'none'.\n", compressionString);
+ fprintf(stderr, "Known compression types (the tiff library might not support every type)\n");
+ for (i = 0; compressionList[i].compressionName != NULL; i++) {
+ fprintf(stderr, "%10s %s\n", compressionList[i].compressionName, compressionList[i].compressionDescription);
+ }
+ }
+ }
+
+ // Set bits per sample, samples per pixel, and photometric type from the splash mode
+
+ bitspersample = (splashMode == splashModeMono1? 1: 8);
+
+ switch (splashMode) {
+
+ case splashModeMono1:
+ case splashModeMono8:
+ samplesperpixel = 1;
+ photometric = PHOTOMETRIC_MINISBLACK;
+ break;
+
+ case splashModeRGB8:
+ case splashModeBGR8:
+ samplesperpixel = 3;
+ photometric = PHOTOMETRIC_RGB;
+ break;
+
+ default:
+ fprintf(stderr, "TiffWriter: Mode %d not supported\n", splashMode);
+ return false;
+ }
+
+ // Open the file
+
+ if (openedFile == NULL) {
+ fprintf(stderr, "TiffWriter: No output file given.\n");
+ return false;
+ }
+
+ f = TIFFFdOpen(fileno(openedFile), "-", "w");
+
+ if (!f) {
+ return false;
+ }
+
+ // Set TIFF tags
+
+ TIFFSetField(f, TIFFTAG_IMAGEWIDTH, width);
+ TIFFSetField(f, TIFFTAG_IMAGELENGTH, height);
+ TIFFSetField(f, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
+ TIFFSetField(f, TIFFTAG_SAMPLESPERPIXEL, samplesperpixel);
+ TIFFSetField(f, TIFFTAG_BITSPERSAMPLE, bitspersample);
+ TIFFSetField(f, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+ TIFFSetField(f, TIFFTAG_PHOTOMETRIC, photometric);
+ TIFFSetField(f, TIFFTAG_COMPRESSION, (uint16) compression);
+ TIFFSetField(f, TIFFTAG_ROWSPERSTRIP, TIFFDefaultStripSize(f, rowsperstrip));
+ TIFFSetField(f, TIFFTAG_XRESOLUTION, (double) hDPI);
+ TIFFSetField(f, TIFFTAG_YRESOLUTION, (double) vDPI);
+ TIFFSetField(f, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
+
+ return true;
+}
+
+bool TiffWriter::writePointers(unsigned char **rowPointers, int rowCount)
+{
+ // Write all rows to the file
+
+ for (int row = 0; row < rowCount; row++) {
+ if (TIFFWriteScanline(f, rowPointers[row], row, 0) < 0) {
+ fprintf(stderr, "TiffWriter: Error writing tiff row %d\n", row);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool TiffWriter::writeRow(unsigned char **rowData)
+{
+ // Add a single row
+
+ if (TIFFWriteScanline(f, *rowData, curRow, 0) < 0) {
+ fprintf(stderr, "TiffWriter: Error writing tiff row %d\n", curRow);
+ return false;
+ }
+
+ curRow++;
+
+ return true;
+}
+
+bool TiffWriter::close()
+{
+ // Close the file
+
+ TIFFClose(f);
+
+ return true;
+}
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/TiffWriter.h b/Build/source/libs/poppler/poppler-0.20.0/goo/TiffWriter.h
new file mode 100644
index 00000000000..b2b0ea99cf9
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/TiffWriter.h
@@ -0,0 +1,54 @@
+//========================================================================
+//
+// TiffWriter.h
+//
+// This file is licensed under the GPLv2 or later
+//
+// Copyright (C) 2010 William Bader <williambader@hotmail.com>
+// Copyright (C) 2011 Albert Astals Cid <aacid@kde.org>
+//
+//========================================================================
+
+#ifndef TIFFWRITER_H
+#define TIFFWRITER_H
+
+#include "poppler/poppler-config.h"
+
+#ifdef ENABLE_LIBTIFF
+
+#include <sys/types.h>
+#include "ImgWriter.h"
+#include "splash/SplashTypes.h"
+
+extern "C" {
+#include "tiffio.h"
+}
+
+class TiffWriter : public ImgWriter
+{
+ public:
+ TiffWriter();
+ ~TiffWriter();
+
+ void setCompressionString(const char *compressionStringArg);
+ void setSplashMode(SplashColorMode splashModeArg);
+
+ bool init(FILE *openedFile, int width, int height, int hDPI, int vDPI);
+
+ bool writePointers(unsigned char **rowPointers, int rowCount);
+ bool writeRow(unsigned char **rowData);
+
+ bool close();
+
+ private:
+ TIFF *f; // LibTiff file context
+ int numRows; // number of rows in the image
+ int curRow; // number of rows written
+ const char *compressionString; // compression type
+ SplashColorMode splashMode; // format of image data
+
+};
+
+#endif
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/gfile.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/gfile.cc
new file mode 100644
index 00000000000..752242476b6
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/gfile.cc
@@ -0,0 +1,827 @@
+//========================================================================
+//
+// gfile.cc
+//
+// Miscellaneous file and directory name manipulation.
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
+// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
+// Copyright (C) 2008 Adam Batkin <adam@batkin.net>
+// Copyright (C) 2008, 2010 Hib Eris <hib@hiberis.nl>
+// Copyright (C) 2009 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
+#include <config.h>
+
+#ifdef _WIN32
+# include <time.h>
+#else
+# if defined(MACOS)
+# include <sys/stat.h>
+# elif !defined(ACORN)
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <fcntl.h>
+# endif
+# include <time.h>
+# include <limits.h>
+# include <string.h>
+# if !defined(VMS) && !defined(ACORN) && !defined(MACOS)
+# include <pwd.h>
+# endif
+# if defined(VMS) && (__DECCXX_VER < 50200000)
+# include <unixlib.h>
+# endif
+#endif // _WIN32
+#include "GooString.h"
+#include "gfile.h"
+
+// Some systems don't define this, so just make it something reasonably
+// large.
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+//------------------------------------------------------------------------
+
+GooString *getHomeDir() {
+#ifdef VMS
+ //---------- VMS ----------
+ return new GooString("SYS$LOGIN:");
+
+#elif defined(__EMX__) || defined(_WIN32)
+ //---------- OS/2+EMX and Win32 ----------
+ char *s;
+ GooString *ret;
+
+ if ((s = getenv("HOME")))
+ ret = new GooString(s);
+ else
+ ret = new GooString(".");
+ return ret;
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ return new GooString("@");
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ return new GooString(":");
+
+#else
+ //---------- Unix ----------
+ char *s;
+ struct passwd *pw;
+ GooString *ret;
+
+ if ((s = getenv("HOME"))) {
+ ret = new GooString(s);
+ } else {
+ if ((s = getenv("USER")))
+ pw = getpwnam(s);
+ else
+ pw = getpwuid(getuid());
+ if (pw)
+ ret = new GooString(pw->pw_dir);
+ else
+ ret = new GooString(".");
+ }
+ return ret;
+#endif
+}
+
+GooString *getCurrentDir() {
+ char buf[PATH_MAX+1];
+
+#if defined(__EMX__)
+ if (_getcwd2(buf, sizeof(buf)))
+#elif defined(_WIN32)
+ if (GetCurrentDirectory(sizeof(buf), buf))
+#elif defined(ACORN)
+ if (strcpy(buf, "@"))
+#elif defined(MACOS)
+ if (strcpy(buf, ":"))
+#else
+ if (getcwd(buf, sizeof(buf)))
+#endif
+ return new GooString(buf);
+ return new GooString();
+}
+
+GooString *appendToPath(GooString *path, const char *fileName) {
+#if defined(VMS)
+ //---------- VMS ----------
+ //~ this should handle everything necessary for file
+ //~ requesters, but it's certainly not complete
+ char *p0, *p1, *p2;
+ char *q1;
+
+ p0 = path->getCString();
+ p1 = p0 + path->getLength() - 1;
+ if (!strcmp(fileName, "-")) {
+ if (*p1 == ']') {
+ for (p2 = p1; p2 > p0 && *p2 != '.' && *p2 != '['; --p2) ;
+ if (*p2 == '[')
+ ++p2;
+ path->del(p2 - p0, p1 - p2);
+ } else if (*p1 == ':') {
+ path->append("[-]");
+ } else {
+ path->clear();
+ path->append("[-]");
+ }
+ } else if ((q1 = strrchr(fileName, '.')) && !strncmp(q1, ".DIR;", 5)) {
+ if (*p1 == ']') {
+ path->insert(p1 - p0, '.');
+ path->insert(p1 - p0 + 1, fileName, q1 - fileName);
+ } else if (*p1 == ':') {
+ path->append('[');
+ path->append(']');
+ path->append(fileName, q1 - fileName);
+ } else {
+ path->clear();
+ path->append(fileName, q1 - fileName);
+ }
+ } else {
+ if (*p1 != ']' && *p1 != ':')
+ path->clear();
+ path->append(fileName);
+ }
+ return path;
+
+#elif defined(_WIN32)
+ //---------- Win32 ----------
+ GooString *tmp;
+ char buf[256];
+ char *fp;
+
+ tmp = new GooString(path);
+ tmp->append('/');
+ tmp->append(fileName);
+ GetFullPathName(tmp->getCString(), sizeof(buf), buf, &fp);
+ delete tmp;
+ path->clear();
+ path->append(buf);
+ return path;
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ char *p;
+ int i;
+
+ path->append(".");
+ i = path->getLength();
+ path->append(fileName);
+ for (p = path->getCString() + i; *p; ++p) {
+ if (*p == '/') {
+ *p = '.';
+ } else if (*p == '.') {
+ *p = '/';
+ }
+ }
+ return path;
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ char *p;
+ int i;
+
+ path->append(":");
+ i = path->getLength();
+ path->append(fileName);
+ for (p = path->getCString() + i; *p; ++p) {
+ if (*p == '/') {
+ *p = ':';
+ } else if (*p == '.') {
+ *p = ':';
+ }
+ }
+ return path;
+
+#elif defined(__EMX__)
+ //---------- OS/2+EMX ----------
+ int i;
+
+ // appending "." does nothing
+ if (!strcmp(fileName, "."))
+ return path;
+
+ // appending ".." goes up one directory
+ if (!strcmp(fileName, "..")) {
+ for (i = path->getLength() - 2; i >= 0; --i) {
+ if (path->getChar(i) == '/' || path->getChar(i) == '\\' ||
+ path->getChar(i) == ':')
+ break;
+ }
+ if (i <= 0) {
+ if (path->getChar(0) == '/' || path->getChar(0) == '\\') {
+ path->del(1, path->getLength() - 1);
+ } else if (path->getLength() >= 2 && path->getChar(1) == ':') {
+ path->del(2, path->getLength() - 2);
+ } else {
+ path->clear();
+ path->append("..");
+ }
+ } else {
+ if (path->getChar(i-1) == ':')
+ ++i;
+ path->del(i, path->getLength() - i);
+ }
+ return path;
+ }
+
+ // otherwise, append "/" and new path component
+ if (path->getLength() > 0 &&
+ path->getChar(path->getLength() - 1) != '/' &&
+ path->getChar(path->getLength() - 1) != '\\')
+ path->append('/');
+ path->append(fileName);
+ return path;
+
+#else
+ //---------- Unix ----------
+ int i;
+
+ // appending "." does nothing
+ if (!strcmp(fileName, "."))
+ return path;
+
+ // appending ".." goes up one directory
+ if (!strcmp(fileName, "..")) {
+ for (i = path->getLength() - 2; i >= 0; --i) {
+ if (path->getChar(i) == '/')
+ break;
+ }
+ if (i <= 0) {
+ if (path->getChar(0) == '/') {
+ path->del(1, path->getLength() - 1);
+ } else {
+ path->clear();
+ path->append("..");
+ }
+ } else {
+ path->del(i, path->getLength() - i);
+ }
+ return path;
+ }
+
+ // otherwise, append "/" and new path component
+ if (path->getLength() > 0 &&
+ path->getChar(path->getLength() - 1) != '/')
+ path->append('/');
+ path->append(fileName);
+ return path;
+#endif
+}
+
+GooString *grabPath(char *fileName) {
+#ifdef VMS
+ //---------- VMS ----------
+ char *p;
+
+ if ((p = strrchr(fileName, ']')))
+ return new GooString(fileName, p + 1 - fileName);
+ if ((p = strrchr(fileName, ':')))
+ return new GooString(fileName, p + 1 - fileName);
+ return new GooString();
+
+#elif defined(__EMX__) || defined(_WIN32)
+ //---------- OS/2+EMX and Win32 ----------
+ char *p;
+
+ if ((p = strrchr(fileName, '/')))
+ return new GooString(fileName, p - fileName);
+ if ((p = strrchr(fileName, '\\')))
+ return new GooString(fileName, p - fileName);
+ if ((p = strrchr(fileName, ':')))
+ return new GooString(fileName, p + 1 - fileName);
+ return new GooString();
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ char *p;
+
+ if ((p = strrchr(fileName, '.')))
+ return new GooString(fileName, p - fileName);
+ return new GooString();
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ char *p;
+
+ if ((p = strrchr(fileName, ':')))
+ return new GooString(fileName, p - fileName);
+ return new GooString();
+
+#else
+ //---------- Unix ----------
+ char *p;
+
+ if ((p = strrchr(fileName, '/')))
+ return new GooString(fileName, p - fileName);
+ return new GooString();
+#endif
+}
+
+GBool isAbsolutePath(char *path) {
+#ifdef VMS
+ //---------- VMS ----------
+ return strchr(path, ':') ||
+ (path[0] == '[' && path[1] != '.' && path[1] != '-');
+
+#elif defined(__EMX__) || defined(_WIN32)
+ //---------- OS/2+EMX and Win32 ----------
+ return path[0] == '/' || path[0] == '\\' || path[1] == ':';
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ return path[0] == '$';
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ return path[0] != ':';
+
+#else
+ //---------- Unix ----------
+ return path[0] == '/';
+#endif
+}
+
+GooString *makePathAbsolute(GooString *path) {
+#ifdef VMS
+ //---------- VMS ----------
+ char buf[PATH_MAX+1];
+
+ if (!isAbsolutePath(path->getCString())) {
+ if (getcwd(buf, sizeof(buf))) {
+ path->insert(0, buf);
+ }
+ }
+ return path;
+
+#elif defined(_WIN32)
+ //---------- Win32 ----------
+ char buf[MAX_PATH];
+ char *fp;
+
+ buf[0] = '\0';
+ if (!GetFullPathName(path->getCString(), MAX_PATH, buf, &fp)) {
+ path->clear();
+ return path;
+ }
+ path->clear();
+ path->append(buf);
+ return path;
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ path->insert(0, '@');
+ return path;
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ path->del(0, 1);
+ return path;
+
+#else
+ //---------- Unix and OS/2+EMX ----------
+ struct passwd *pw;
+ char buf[PATH_MAX+1];
+ GooString *s;
+ char *p1, *p2;
+ int n;
+
+ if (path->getChar(0) == '~') {
+ if (path->getChar(1) == '/' ||
+#ifdef __EMX__
+ path->getChar(1) == '\\' ||
+#endif
+ path->getLength() == 1) {
+ path->del(0, 1);
+ s = getHomeDir();
+ path->insert(0, s);
+ delete s;
+ } else {
+ p1 = path->getCString() + 1;
+#ifdef __EMX__
+ for (p2 = p1; *p2 && *p2 != '/' && *p2 != '\\'; ++p2) ;
+#else
+ for (p2 = p1; *p2 && *p2 != '/'; ++p2) ;
+#endif
+ if ((n = p2 - p1) > PATH_MAX)
+ n = PATH_MAX;
+ strncpy(buf, p1, n);
+ buf[n] = '\0';
+ if ((pw = getpwnam(buf))) {
+ path->del(0, p2 - p1 + 1);
+ path->insert(0, pw->pw_dir);
+ }
+ }
+ } else if (!isAbsolutePath(path->getCString())) {
+ if (getcwd(buf, sizeof(buf))) {
+#ifndef __EMX__
+ path->insert(0, '/');
+#endif
+ path->insert(0, buf);
+ }
+ }
+ return path;
+#endif
+}
+
+time_t getModTime(char *fileName) {
+#ifdef _WIN32
+ //~ should implement this, but it's (currently) only used in xpdf
+ return 0;
+#else
+ struct stat statBuf;
+
+ if (stat(fileName, &statBuf)) {
+ return 0;
+ }
+ return statBuf.st_mtime;
+#endif
+}
+
+GBool openTempFile(GooString **name, FILE **f, const char *mode) {
+#if defined(_WIN32)
+ //---------- Win32 ----------
+ char *tempDir;
+ GooString *s, *s2;
+ char buf[32];
+ FILE *f2;
+ int t, i;
+
+ // this has the standard race condition problem, but I haven't found
+ // a better way to generate temp file names with extensions on
+ // Windows
+ if ((tempDir = getenv("TEMP"))) {
+ s = new GooString(tempDir);
+ s->append('\\');
+ } else {
+ s = new GooString();
+ }
+ s->appendf("x_{0:d}_{1:d}_",
+ (int)GetCurrentProcessId(), (int)GetCurrentThreadId());
+ t = (int)time(NULL);
+ for (i = 0; i < 1000; ++i) {
+ s2 = s->copy()->appendf("{0:d}", t + i);
+ if (!(f2 = fopen(s2->getCString(), "r"))) {
+ if (!(f2 = fopen(s2->getCString(), mode))) {
+ delete s2;
+ delete s;
+ return gFalse;
+ }
+ *name = s2;
+ *f = f2;
+ delete s;
+ return gTrue;
+ }
+ fclose(f2);
+ delete s2;
+ }
+ delete s;
+ return gFalse;
+#elif defined(VMS) || defined(__EMX__) || defined(ACORN) || defined(MACOS)
+ //---------- non-Unix ----------
+ char *s;
+
+ // There is a security hole here: an attacker can create a symlink
+ // with this file name after the tmpnam call and before the fopen
+ // call. I will happily accept fixes to this function for non-Unix
+ // OSs.
+ if (!(s = tmpnam(NULL))) {
+ return gFalse;
+ }
+ *name = new GooString(s);
+ if (!(*f = fopen((*name)->getCString(), mode))) {
+ delete (*name);
+ *name = NULL;
+ return gFalse;
+ }
+ return gTrue;
+#else
+ //---------- Unix ----------
+ char *s;
+ int fd;
+
+#if HAVE_MKSTEMP
+ if ((s = getenv("TMPDIR"))) {
+ *name = new GooString(s);
+ } else {
+ *name = new GooString("/tmp");
+ }
+ (*name)->append("/XXXXXX");
+ fd = mkstemp((*name)->getCString());
+#else // HAVE_MKSTEMP
+ if (!(s = tmpnam(NULL))) {
+ return gFalse;
+ }
+ *name = new GooString(s);
+ fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
+#endif // HAVE_MKSTEMP
+ if (fd < 0 || !(*f = fdopen(fd, mode))) {
+ delete *name;
+ *name = NULL;
+ return gFalse;
+ }
+ return gTrue;
+#endif
+}
+
+GBool executeCommand(char *cmd) {
+#ifdef VMS
+ return system(cmd) ? gTrue : gFalse;
+#else
+ return system(cmd) ? gFalse : gTrue;
+#endif
+}
+
+#ifdef WIN32
+GooString *fileNameToUTF8(char *path) {
+ GooString *s;
+ char *p;
+
+ s = new GooString();
+ for (p = path; *p; ++p) {
+ if (*p & 0x80) {
+ s->append((char)(0xc0 | ((*p >> 6) & 0x03)));
+ s->append((char)(0x80 | (*p & 0x3f)));
+ } else {
+ s->append(*p);
+ }
+ }
+ return s;
+}
+
+GooString *fileNameToUTF8(wchar_t *path) {
+ GooString *s;
+ wchar_t *p;
+
+ s = new GooString();
+ for (p = path; *p; ++p) {
+ if (*p < 0x80) {
+ s->append((char)*p);
+ } else if (*p < 0x800) {
+ s->append((char)(0xc0 | ((*p >> 6) & 0x1f)));
+ s->append((char)(0x80 | (*p & 0x3f)));
+ } else {
+ s->append((char)(0xe0 | ((*p >> 12) & 0x0f)));
+ s->append((char)(0x80 | ((*p >> 6) & 0x3f)));
+ s->append((char)(0x80 | (*p & 0x3f)));
+ }
+ }
+ return s;
+}
+#endif
+
+FILE *openFile(const char *path, const char *mode) {
+#ifdef WIN32
+ OSVERSIONINFO version;
+ wchar_t wPath[_MAX_PATH + 1];
+ char nPath[_MAX_PATH + 1];
+ wchar_t wMode[8];
+ const char *p;
+ int i;
+
+ // NB: _wfopen is only available in NT
+ version.dwOSVersionInfoSize = sizeof(version);
+ GetVersionEx(&version);
+ if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
+ for (p = path, i = 0; *p && i < _MAX_PATH; ++i) {
+ if ((p[0] & 0xe0) == 0xc0 &&
+ p[1] && (p[1] & 0xc0) == 0x80) {
+ wPath[i] = (wchar_t)(((p[0] & 0x1f) << 6) |
+ (p[1] & 0x3f));
+ p += 2;
+ } else if ((p[0] & 0xf0) == 0xe0 &&
+ p[1] && (p[1] & 0xc0) == 0x80 &&
+ p[2] && (p[2] & 0xc0) == 0x80) {
+ wPath[i] = (wchar_t)(((p[0] & 0x0f) << 12) |
+ ((p[1] & 0x3f) << 6) |
+ (p[2] & 0x3f));
+ p += 3;
+ } else {
+ wPath[i] = (wchar_t)(p[0] & 0xff);
+ p += 1;
+ }
+ }
+ wPath[i] = (wchar_t)0;
+ for (i = 0; mode[i] && i < sizeof(mode) - 1; ++i) {
+ wMode[i] = (wchar_t)(mode[i] & 0xff);
+ }
+ wMode[i] = (wchar_t)0;
+ return _wfopen(wPath, wMode);
+ } else {
+ for (p = path, i = 0; *p && i < _MAX_PATH; ++i) {
+ if ((p[0] & 0xe0) == 0xc0 &&
+ p[1] && (p[1] & 0xc0) == 0x80) {
+ nPath[i] = (char)(((p[0] & 0x1f) << 6) |
+ (p[1] & 0x3f));
+ p += 2;
+ } else if ((p[0] & 0xf0) == 0xe0 &&
+ p[1] && (p[1] & 0xc0) == 0x80 &&
+ p[2] && (p[2] & 0xc0) == 0x80) {
+ nPath[i] = (char)(((p[1] & 0x3f) << 6) |
+ (p[2] & 0x3f));
+ p += 3;
+ } else {
+ nPath[i] = p[0];
+ p += 1;
+ }
+ }
+ nPath[i] = '\0';
+ return fopen(nPath, mode);
+ }
+#else
+ return fopen(path, mode);
+#endif
+}
+
+char *getLine(char *buf, int size, FILE *f) {
+ int c, i;
+
+ i = 0;
+ while (i < size - 1) {
+ if ((c = fgetc(f)) == EOF) {
+ break;
+ }
+ buf[i++] = (char)c;
+ if (c == '\x0a') {
+ break;
+ }
+ if (c == '\x0d') {
+ c = fgetc(f);
+ if (c == '\x0a' && i < size - 1) {
+ buf[i++] = (char)c;
+ } else if (c != EOF) {
+ ungetc(c, f);
+ }
+ break;
+ }
+ }
+ buf[i] = '\0';
+ if (i == 0) {
+ return NULL;
+ }
+ return buf;
+}
+
+//------------------------------------------------------------------------
+// GDir and GDirEntry
+//------------------------------------------------------------------------
+
+GDirEntry::GDirEntry(char *dirPath, char *nameA, GBool doStat) {
+#ifdef VMS
+ char *p;
+#elif defined(_WIN32)
+ DWORD fa;
+#elif defined(ACORN)
+#else
+ struct stat st;
+#endif
+
+ name = new GooString(nameA);
+ dir = gFalse;
+ fullPath = new GooString(dirPath);
+ appendToPath(fullPath, nameA);
+ if (doStat) {
+#ifdef VMS
+ if (!strcmp(nameA, "-") ||
+ ((p = strrchr(nameA, '.')) && !strncmp(p, ".DIR;", 5)))
+ dir = gTrue;
+#elif defined(ACORN)
+#else
+#ifdef _WIN32
+ fa = GetFileAttributes(fullPath->getCString());
+ dir = (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
+#else
+ if (stat(fullPath->getCString(), &st) == 0)
+ dir = S_ISDIR(st.st_mode);
+#endif
+#endif
+ }
+}
+
+GDirEntry::~GDirEntry() {
+ delete fullPath;
+ delete name;
+}
+
+GDir::GDir(char *name, GBool doStatA) {
+ path = new GooString(name);
+ doStat = doStatA;
+#if defined(_WIN32)
+ GooString *tmp;
+
+ tmp = path->copy();
+ tmp->append("/*.*");
+ hnd = FindFirstFile(tmp->getCString(), &ffd);
+ delete tmp;
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ dir = opendir(name);
+#ifdef VMS
+ needParent = strchr(name, '[') != NULL;
+#endif
+#endif
+}
+
+GDir::~GDir() {
+ delete path;
+#if defined(_WIN32)
+ if (hnd != INVALID_HANDLE_VALUE) {
+ FindClose(hnd);
+ hnd = INVALID_HANDLE_VALUE;
+ }
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ if (dir)
+ closedir(dir);
+#endif
+}
+
+GDirEntry *GDir::getNextEntry() {
+ GDirEntry *e;
+
+#if defined(_WIN32)
+ if (hnd != INVALID_HANDLE_VALUE) {
+ e = new GDirEntry(path->getCString(), ffd.cFileName, doStat);
+ if (!FindNextFile(hnd, &ffd)) {
+ FindClose(hnd);
+ hnd = INVALID_HANDLE_VALUE;
+ }
+ } else {
+ e = NULL;
+ }
+#elif defined(ACORN)
+#elif defined(MACOS)
+#elif defined(VMS)
+ struct dirent *ent;
+ e = NULL;
+ if (dir) {
+ if (needParent) {
+ e = new GDirEntry(path->getCString(), "-", doStat);
+ needParent = gFalse;
+ return e;
+ }
+ ent = readdir(dir);
+ if (ent) {
+ e = new GDirEntry(path->getCString(), ent->d_name, doStat);
+ }
+ }
+#else
+ struct dirent *ent;
+ e = NULL;
+ if (dir) {
+ do {
+ ent = readdir(dir);
+ }
+ while (ent && (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")));
+ if (ent) {
+ e = new GDirEntry(path->getCString(), ent->d_name, doStat);
+ }
+ }
+#endif
+
+ return e;
+}
+
+void GDir::rewind() {
+#ifdef _WIN32
+ GooString *tmp;
+
+ if (hnd != INVALID_HANDLE_VALUE)
+ FindClose(hnd);
+ tmp = path->copy();
+ tmp->append("/*.*");
+ hnd = FindFirstFile(tmp->getCString(), &ffd);
+ delete tmp;
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ if (dir)
+ rewinddir(dir);
+#ifdef VMS
+ needParent = strchr(path->getCString(), '[') != NULL;
+#endif
+#endif
+}
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/gfile.h b/Build/source/libs/poppler/poppler-0.20.0/goo/gfile.h
new file mode 100644
index 00000000000..d4b908209aa
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/gfile.h
@@ -0,0 +1,172 @@
+//========================================================================
+//
+// gfile.h
+//
+// Miscellaneous file and directory name manipulation.
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
+// Copyright (C) 2009, 2011 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
+#ifndef GFILE_H
+#define GFILE_H
+
+#include "poppler/poppler-config.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+extern "C" {
+#if defined(_WIN32)
+# include <sys/stat.h>
+# ifdef FPTEX
+# include <win32lib.h>
+# else
+# include <windows.h>
+# endif
+#elif defined(ACORN)
+#elif defined(MACOS)
+# include <ctime.h>
+#else
+# include <unistd.h>
+# include <sys/types.h>
+# ifdef VMS
+# include "vms_dirent.h"
+# elif HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(d) strlen((d)->d_name)
+# else
+# define dirent direct
+# define NAMLEN(d) (d)->d_namlen
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+# endif
+#endif
+}
+#include "gtypes.h"
+
+class GooString;
+
+//------------------------------------------------------------------------
+
+// Get home directory path.
+extern GooString *getHomeDir();
+
+// Get current directory.
+extern GooString *getCurrentDir();
+
+// Append a file name to a path string. <path> may be an empty
+// string, denoting the current directory). Returns <path>.
+extern GooString *appendToPath(GooString *path, const char *fileName);
+
+// Grab the path from the front of the file name. If there is no
+// directory component in <fileName>, returns an empty string.
+extern GooString *grabPath(char *fileName);
+
+// Is this an absolute path or file name?
+extern GBool isAbsolutePath(char *path);
+
+// Make this path absolute by prepending current directory (if path is
+// relative) or prepending user's directory (if path starts with '~').
+extern GooString *makePathAbsolute(GooString *path);
+
+// Get the modification time for <fileName>. Returns 0 if there is an
+// error.
+extern time_t getModTime(char *fileName);
+
+// Create a temporary file and open it for writing. If <ext> is not
+// NULL, it will be used as the file name extension. Returns both the
+// name and the file pointer. For security reasons, all writing
+// should be done to the returned file pointer; the file may be
+// reopened later for reading, but not for writing. The <mode> string
+// should be "w" or "wb". Returns true on success.
+extern GBool openTempFile(GooString **name, FILE **f, const char *mode);
+
+// Execute <command>. Returns true on success.
+extern GBool executeCommand(char *cmd);
+
+#ifdef WIN32
+// Convert a file name from Latin-1 to UTF-8.
+extern GooString *fileNameToUTF8(char *path);
+
+// Convert a file name from UCS-2 to UTF-8.
+extern GooString *fileNameToUTF8(wchar_t *path);
+#endif
+
+// Open a file. On Windows, this converts the path from UTF-8 to
+// UCS-2 and calls _wfopen (if available). On other OSes, this simply
+// calls fopen.
+extern FILE *openFile(const char *path, const char *mode);
+
+// Just like fgets, but handles Unix, Mac, and/or DOS end-of-line
+// conventions.
+extern char *getLine(char *buf, int size, FILE *f);
+
+//------------------------------------------------------------------------
+// GDir and GDirEntry
+//------------------------------------------------------------------------
+
+class GDirEntry {
+public:
+
+ GDirEntry(char *dirPath, char *nameA, GBool doStat);
+ ~GDirEntry();
+ GooString *getName() { return name; }
+ GooString *getFullPath() { return fullPath; }
+ GBool isDir() { return dir; }
+
+private:
+
+ GooString *name; // dir/file name
+ GooString *fullPath;
+ GBool dir; // is it a directory?
+};
+
+class GDir {
+public:
+
+ GDir(char *name, GBool doStatA = gTrue);
+ ~GDir();
+ GDirEntry *getNextEntry();
+ void rewind();
+
+private:
+
+ GooString *path; // directory path
+ GBool doStat; // call stat() for each entry?
+#if defined(_WIN32)
+ WIN32_FIND_DATA ffd;
+ HANDLE hnd;
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ DIR *dir; // the DIR structure from opendir()
+#ifdef VMS
+ GBool needParent; // need to return an entry for [-]
+#endif
+#endif
+};
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/gmem.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/gmem.cc
new file mode 100644
index 00000000000..768b283a18e
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/gmem.cc
@@ -0,0 +1,346 @@
+/*
+ * gmem.c
+ *
+ * Memory routines with out-of-memory checking.
+ *
+ * Copyright 1996-2003 Glyph & Cog, LLC
+ */
+
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2005 Takashi Iwai <tiwai@suse.de>
+// Copyright (C) 2007-2010 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2008 Jonathan Kew <jonathan_kew@sil.org>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <limits.h>
+#include "gmem.h"
+
+#ifdef DEBUG_MEM
+
+typedef struct _GMemHdr {
+ unsigned int magic;
+ int size;
+ int index;
+ struct _GMemHdr *next, *prev;
+} GMemHdr;
+
+#define gMemHdrSize ((sizeof(GMemHdr) + 7) & ~7)
+#define gMemTrlSize (sizeof(long))
+
+#define gMemMagic 0xabcd9999
+
+#if gmemTrlSize==8
+#define gMemDeadVal 0xdeadbeefdeadbeefUL
+#else
+#define gMemDeadVal 0xdeadbeefUL
+#endif
+
+/* round data size so trailer will be aligned */
+#define gMemDataSize(size) \
+ ((((size) + gMemTrlSize - 1) / gMemTrlSize) * gMemTrlSize)
+
+static GMemHdr *gMemHead = NULL;
+static GMemHdr *gMemTail = NULL;
+
+static int gMemIndex = 0;
+static int gMemAlloc = 0;
+static int gMemInUse = 0;
+
+#endif /* DEBUG_MEM */
+
+inline static void *gmalloc(size_t size, bool checkoverflow) {
+#ifdef DEBUG_MEM
+ int size1;
+ char *mem;
+ GMemHdr *hdr;
+ void *data;
+ unsigned long *trl, *p;
+
+ if (size < 0) {
+ fprintf(stderr, "Invalid memory allocation size\n");
+ if (checkoverflow) return NULL;
+ else exit(1);
+ }
+ if (size == 0) {
+ return NULL;
+ }
+ size1 = gMemDataSize(size);
+ if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) {
+ fprintf(stderr, "Out of memory\n");
+ if (checkoverflow) return NULL;
+ else exit(1);
+ }
+ hdr = (GMemHdr *)mem;
+ data = (void *)(mem + gMemHdrSize);
+ trl = (unsigned long *)(mem + gMemHdrSize + size1);
+ hdr->magic = gMemMagic;
+ hdr->size = size;
+ hdr->index = gMemIndex++;
+ if (gMemTail) {
+ gMemTail->next = hdr;
+ hdr->prev = gMemTail;
+ gMemTail = hdr;
+ } else {
+ hdr->prev = NULL;
+ gMemHead = gMemTail = hdr;
+ }
+ hdr->next = NULL;
+ ++gMemAlloc;
+ gMemInUse += size;
+ for (p = (unsigned long *)data; p <= trl; ++p) {
+ *p = gMemDeadVal;
+ }
+ return data;
+#else
+ void *p;
+
+ if (size < 0) {
+ fprintf(stderr, "Invalid memory allocation size\n");
+ if (checkoverflow) return NULL;
+ else exit(1);
+ }
+ if (size == 0) {
+ return NULL;
+ }
+ if (!(p = malloc(size))) {
+ fprintf(stderr, "Out of memory\n");
+ if (checkoverflow) return NULL;
+ else exit(1);
+ }
+ return p;
+#endif
+}
+
+void *gmalloc(size_t size) {
+ return gmalloc(size, false);
+}
+
+void *gmalloc_checkoverflow(size_t size) {
+ return gmalloc(size, true);
+}
+
+inline static void *grealloc(void *p, size_t size, bool checkoverflow) {
+#ifdef DEBUG_MEM
+ GMemHdr *hdr;
+ void *q;
+ int oldSize;
+
+ if (size < 0) {
+ fprintf(stderr, "Invalid memory allocation size\n");
+ if (checkoverflow) return NULL;
+ else exit(1);
+ }
+ if (size == 0) {
+ if (p) {
+ gfree(p);
+ }
+ return NULL;
+ }
+ if (p) {
+ hdr = (GMemHdr *)((char *)p - gMemHdrSize);
+ oldSize = hdr->size;
+ q = gmalloc(size, checkoverflow);
+ memcpy(q, p, size < oldSize ? size : oldSize);
+ gfree(p);
+ } else {
+ q = gmalloc(size, checkoverflow);
+ }
+ return q;
+#else
+ void *q;
+
+ if (size < 0) {
+ fprintf(stderr, "Invalid memory allocation size\n");
+ if (checkoverflow) return NULL;
+ else exit(1);
+ }
+ if (size == 0) {
+ if (p) {
+ free(p);
+ }
+ return NULL;
+ }
+ if (p) {
+ q = realloc(p, size);
+ } else {
+ q = malloc(size);
+ }
+ if (!q) {
+ fprintf(stderr, "Out of memory\n");
+ if (checkoverflow) return NULL;
+ else exit(1);
+ }
+ return q;
+#endif
+}
+
+void *grealloc(void *p, size_t size) {
+ return grealloc(p, size, false);
+}
+
+void *grealloc_checkoverflow(void *p, size_t size) {
+ return grealloc(p, size, true);
+}
+
+inline static void *gmallocn(int nObjs, int objSize, bool checkoverflow) {
+ int n;
+
+ if (nObjs == 0) {
+ return NULL;
+ }
+ n = nObjs * objSize;
+ if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
+ fprintf(stderr, "Bogus memory allocation size\n");
+ if (checkoverflow) return NULL;
+ else exit(1);
+ }
+ return gmalloc(n, checkoverflow);
+}
+
+void *gmallocn(int nObjs, int objSize) {
+ return gmallocn(nObjs, objSize, false);
+}
+
+void *gmallocn_checkoverflow(int nObjs, int objSize) {
+ return gmallocn(nObjs, objSize, true);
+}
+
+inline static void *gmallocn3(int a, int b, int c, bool checkoverflow) {
+ int n = a * b;
+ if (b <= 0 || a < 0 || a >= INT_MAX / b) {
+ fprintf(stderr, "Bogus memory allocation size\n");
+ if (checkoverflow) return NULL;
+ else exit(1);
+ }
+ return gmallocn(n, c, checkoverflow);
+}
+
+void *gmallocn3(int a, int b, int c) {
+ return gmallocn3(a, b, c, false);
+}
+
+void *gmallocn3_checkoverflow(int a, int b, int c) {
+ return gmallocn3(a, b, c, true);
+}
+
+inline static void *greallocn(void *p, int nObjs, int objSize, bool checkoverflow) {
+ int n;
+
+ if (nObjs == 0) {
+ if (p) {
+ gfree(p);
+ }
+ return NULL;
+ }
+ n = nObjs * objSize;
+ if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
+ fprintf(stderr, "Bogus memory allocation size\n");
+ if (checkoverflow) {
+ gfree(p);
+ return NULL;
+ } else {
+ exit(1);
+ }
+ }
+ return grealloc(p, n, checkoverflow);
+}
+
+void *greallocn(void *p, int nObjs, int objSize) {
+ return greallocn(p, nObjs, objSize, false);
+}
+
+void *greallocn_checkoverflow(void *p, int nObjs, int objSize) {
+ return greallocn(p, nObjs, objSize, true);
+}
+
+void gfree(void *p) {
+#ifdef DEBUG_MEM
+ int size;
+ GMemHdr *hdr;
+ unsigned long *trl, *clr;
+
+ if (p) {
+ hdr = (GMemHdr *)((char *)p - gMemHdrSize);
+ if (hdr->magic == gMemMagic &&
+ ((hdr->prev == NULL) == (hdr == gMemHead)) &&
+ ((hdr->next == NULL) == (hdr == gMemTail))) {
+ if (hdr->prev) {
+ hdr->prev->next = hdr->next;
+ } else {
+ gMemHead = hdr->next;
+ }
+ if (hdr->next) {
+ hdr->next->prev = hdr->prev;
+ } else {
+ gMemTail = hdr->prev;
+ }
+ --gMemAlloc;
+ gMemInUse -= hdr->size;
+ size = gMemDataSize(hdr->size);
+ trl = (unsigned long *)((char *)hdr + gMemHdrSize + size);
+ if (*trl != gMemDeadVal) {
+ fprintf(stderr, "Overwrite past end of block %d at address %p\n",
+ hdr->index, p);
+ }
+ for (clr = (unsigned long *)hdr; clr <= trl; ++clr) {
+ *clr = gMemDeadVal;
+ }
+ free(hdr);
+ } else {
+ fprintf(stderr, "Attempted to free bad address %p\n", p);
+ }
+ }
+#else
+ if (p) {
+ free(p);
+ }
+#endif
+}
+
+#ifdef DEBUG_MEM
+void gMemReport(FILE *f) {
+ GMemHdr *p;
+
+ fprintf(f, "%d memory allocations in all\n", gMemIndex);
+ if (gMemAlloc > 0) {
+ fprintf(f, "%d memory blocks left allocated:\n", gMemAlloc);
+ fprintf(f, " index size\n");
+ fprintf(f, "-------- --------\n");
+ for (p = gMemHead; p; p = p->next) {
+ fprintf(f, "%8d %8d\n", p->index, p->size);
+ }
+ } else {
+ fprintf(f, "No memory blocks left allocated\n");
+ }
+}
+#endif
+
+char *copyString(const char *s) {
+ char *s1;
+
+ s1 = (char *)gmalloc(strlen(s) + 1);
+ strcpy(s1, s);
+ return s1;
+}
+
+char *gstrndup(const char *s, size_t n) {
+ char *s1 = (char*)gmalloc(n + 1); /* cannot return NULL for size > 0 */
+ s1[n] = '\0';
+ memcpy(s1, s, n);
+ return s1;
+}
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/gmem.h b/Build/source/libs/poppler/poppler-0.20.0/goo/gmem.h
new file mode 100644
index 00000000000..d5bb2ae5d07
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/gmem.h
@@ -0,0 +1,92 @@
+/*
+ * gmem.h
+ *
+ * Memory routines with out-of-memory checking.
+ *
+ * Copyright 1996-2003 Glyph & Cog, LLC
+ */
+
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2005 Takashi Iwai <tiwai@suse.de>
+// Copyright (C) 2007-2010 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2008 Jonathan Kew <jonathan_kew@sil.org>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
+#ifndef GMEM_H
+#define GMEM_H
+
+#include <stdio.h>
+#include "poppler/poppler-config.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Same as malloc, but prints error message and exits if malloc()
+ * returns NULL.
+ */
+extern void *gmalloc(size_t size);
+extern void *gmalloc_checkoverflow(size_t size);
+
+/*
+ * Same as realloc, but prints error message and exits if realloc()
+ * returns NULL. If <p> is NULL, calls malloc instead of realloc().
+ */
+extern void *grealloc(void *p, size_t size);
+extern void *grealloc_checkoverflow(size_t size);
+
+/*
+ * These are similar to gmalloc and grealloc, but take an object count
+ * and size. The result is similar to allocating nObjs * objSize
+ * bytes, but there is an additional error check that the total size
+ * doesn't overflow an int.
+ * The gmallocn_checkoverflow variant returns NULL instead of exiting
+ * the application if a overflow is detected
+ */
+extern void *gmallocn(int nObjs, int objSize);
+extern void *gmallocn_checkoverflow(int nObjs, int objSize);
+extern void *gmallocn3(int a, int b, int c);
+extern void *gmallocn3_checkoverflow(int a, int b, int c);
+extern void *greallocn(void *p, int nObjs, int objSize);
+extern void *greallocn_checkoverflow(void *p, int nObjs, int objSize);
+
+/*
+ * Same as free, but checks for and ignores NULL pointers.
+ */
+extern void gfree(void *p);
+
+#ifdef DEBUG_MEM
+/*
+ * Report on unfreed memory.
+ */
+extern void gMemReport(FILE *f);
+#else
+#define gMemReport(f)
+#endif
+
+/*
+ * Allocate memory and copy a string into it.
+ */
+extern char *copyString(const char *s);
+
+/*
+ * Allocate memory and copy a limited-length string to it.
+ */
+extern char *gstrndup(const char *s, size_t n);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/gmempp.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/gmempp.cc
new file mode 100644
index 00000000000..a70338ca3ce
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/gmempp.cc
@@ -0,0 +1,32 @@
+//========================================================================
+//
+// gmempp.cc
+//
+// Use gmalloc/gfree for C++ new/delete operators.
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <config.h>
+#include "gmem.h"
+
+#ifdef DEBUG_MEM
+
+void *operator new(size_t size) {
+ return gmalloc((int)size);
+}
+
+void *operator new[](size_t size) {
+ return gmalloc((int)size);
+}
+
+void operator delete(void *p) {
+ gfree(p);
+}
+
+void operator delete[](void *p) {
+ gfree(p);
+}
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/gstrtod.cc b/Build/source/libs/poppler/poppler-0.20.0/goo/gstrtod.cc
new file mode 100644
index 00000000000..e6c3a00741f
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/gstrtod.cc
@@ -0,0 +1,147 @@
+/* This file is part of Libspectre.
+ *
+ * Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
+ * Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
+ *
+ * Libspectre is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * Libspectre is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/* This function comes from spectre-utils from libspectre */
+
+#include "gstrtod.h"
+
+#include <clocale>
+#include <cerrno>
+#include <cstdlib>
+#include <cstring>
+
+#define ascii_isspace(c) \
+ (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
+#define ascii_isdigit(c) \
+ (c >= '0' && c <= '9')
+
+double gatof(const char *nptr)
+{
+ return gstrtod(nptr, NULL);
+}
+
+double gstrtod(const char *nptr, char **endptr)
+{
+ char *fail_pos;
+ double val;
+ struct lconv *locale_data;
+ const char *decimal_point;
+ int decimal_point_len;
+ const char *p, *decimal_point_pos;
+ const char *end = NULL; /* Silence gcc */
+ int strtod_errno;
+
+ fail_pos = NULL;
+
+ locale_data = localeconv ();
+ decimal_point = locale_data->decimal_point;
+ decimal_point_len = strlen (decimal_point);
+
+ decimal_point_pos = NULL;
+ end = NULL;
+
+ if (decimal_point[0] != '.' || decimal_point[1] != 0) {
+ p = nptr;
+ /* Skip leading space */
+ while (ascii_isspace (*p))
+ p++;
+
+ /* Skip leading optional sign */
+ if (*p == '+' || *p == '-')
+ p++;
+
+ if (ascii_isdigit (*p) || *p == '.') {
+ while (ascii_isdigit (*p))
+ p++;
+
+ if (*p == '.')
+ decimal_point_pos = p++;
+
+ while (ascii_isdigit (*p))
+ p++;
+
+ if (*p == 'e' || *p == 'E')
+ p++;
+ if (*p == '+' || *p == '-')
+ p++;
+ while (ascii_isdigit (*p))
+ p++;
+
+ end = p;
+ }
+ /* For the other cases, we need not convert the decimal point */
+ }
+
+ if (decimal_point_pos) {
+ char *copy, *c;
+
+ /* We need to convert the '.' to the locale specific decimal point */
+ copy = (char *) malloc (end - nptr + 1 + decimal_point_len);
+
+ c = copy;
+ memcpy (c, nptr, decimal_point_pos - nptr);
+ c += decimal_point_pos - nptr;
+ memcpy (c, decimal_point, decimal_point_len);
+ c += decimal_point_len;
+ memcpy (c, decimal_point_pos + 1, end - (decimal_point_pos + 1));
+ c += end - (decimal_point_pos + 1);
+ *c = 0;
+
+ errno = 0;
+ val = strtod (copy, &fail_pos);
+ strtod_errno = errno;
+
+ if (fail_pos) {
+ if (fail_pos - copy > decimal_point_pos - nptr)
+ fail_pos = (char *)nptr + (fail_pos - copy) - (decimal_point_len - 1);
+ else
+ fail_pos = (char *)nptr + (fail_pos - copy);
+ }
+
+ free (copy);
+ } else if (end) {
+ char *copy;
+
+ copy = (char *) malloc (end - (char *)nptr + 1);
+ memcpy (copy, nptr, end - nptr);
+ *(copy + (end - (char *)nptr)) = 0;
+
+ errno = 0;
+ val = strtod (copy, &fail_pos);
+ strtod_errno = errno;
+
+ if (fail_pos) {
+ fail_pos = (char *)nptr + (fail_pos - copy);
+ }
+
+ free (copy);
+ } else {
+ errno = 0;
+ val = strtod (nptr, &fail_pos);
+ strtod_errno = errno;
+ }
+
+ if (endptr)
+ *endptr = fail_pos;
+
+ errno = strtod_errno;
+
+ return val;
+}
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/gstrtod.h b/Build/source/libs/poppler/poppler-0.20.0/goo/gstrtod.h
new file mode 100644
index 00000000000..e8abdadf53e
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/gstrtod.h
@@ -0,0 +1,43 @@
+/* This file is part of Libspectre.
+ *
+ * Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
+ * Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
+ *
+ * Libspectre is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * Libspectre is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/* This function comes from spectre-utils from libspectre */
+
+#ifndef GSTRTOD_H
+#define GSTRTOD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This function behaves like the standard atof()/(strtod() function
+ * does in the C locale. It does this without actually changing
+ * the current locale, since that would not be thread-safe.
+ * A limitation of the implementation is that this function
+ * will still accept localized versions of infinities and NANs.
+ */
+double gatof(const char *nptr);
+double gstrtod(const char *nptr, char **endptr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/gtypes.h b/Build/source/libs/poppler/poppler-0.20.0/goo/gtypes.h
new file mode 100644
index 00000000000..b7a2dd2d268
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/gtypes.h
@@ -0,0 +1,48 @@
+/*
+ * gtypes.h
+ *
+ * Some useful simple types.
+ *
+ * Copyright 1996-2003 Glyph & Cog, LLC
+ */
+
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2010 Patrick Spendrin <ps_ml@gmx.de>
+// Copyright (C) 2010 Albert Astals Cid <aacid@kde.org>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
+#ifndef GTYPES_H
+#define GTYPES_H
+
+/*
+ * These have stupid names to avoid conflicts with some (but not all)
+ * C++ compilers which define them.
+ */
+typedef bool GBool;
+#define gTrue true
+#define gFalse false
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */
+#endif
+
+/*
+ * These have stupid names to avoid conflicts with <sys/types.h>,
+ * which on various systems defines some random subset of these.
+ */
+typedef unsigned char Guchar;
+typedef unsigned short Gushort;
+typedef unsigned int Guint;
+typedef unsigned long Gulong;
+
+#endif
diff --git a/Build/source/libs/poppler/poppler-0.20.0/goo/gtypes_p.h b/Build/source/libs/poppler/poppler-0.20.0/goo/gtypes_p.h
new file mode 100644
index 00000000000..cc4866e1389
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.20.0/goo/gtypes_p.h
@@ -0,0 +1,30 @@
+/*
+ * gtypes_p.h
+ *
+ * Some useful simple types.
+ *
+ * Copyright (C) 2011 Adrian Johnson <ajohnson@redneon.com>
+ */
+
+#ifndef GTYPES_P_H
+#define GTYPES_P_H
+
+#include "config.h"
+
+/*
+ * Define precise integer types.
+ */
+#if HAVE_STDINT_H
+#include <stdint.h>
+#elif _MSC_VER
+typedef signed __int8 int8_t;
+typedef unsigned __int8 uint8_t;
+typedef signed __int16 int16_t;
+typedef unsigned __int16 uint16_t;
+typedef signed __int32 int32_t;
+typedef unsigned __int32 uint32_t;
+typedef signed __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#endif
+
+#endif