summaryrefslogtreecommitdiff
path: root/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-20-pdftex
blob: dccc4f6bb04d830de8e850a993ddfb96942c09ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
	Patches for pdfTeX / luaTeX / XeTeX

	from:
		Han The Thanh <thanh@pdftex.org>
		Martin Schroeder <martin@pdftex.org>

diff -ur -N xpdf-3.02.orig/goo/GString.cc xpdf-3.02/goo/GString.cc
--- xpdf-3.02.orig/goo/GString.cc	2007-02-27 23:05:51.000000000 +0100
+++ xpdf-3.02/goo/GString.cc	2008-05-08 15:40:41.000000000 +0200
@@ -7,6 +7,9 @@
 // Copyright 1996-2003 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #include <aconf.h>
 
@@ -528,7 +531,7 @@
   if ((neg = x < 0)) {
     x = -x;
   }
-  x = floor(x * pow(10, prec) + 0.5);
+  x = floor(x * pow(10.0, prec) + 0.5);
   i = bufSize;
   started = !trim;
   for (j = 0; j < prec && i > 1; ++j) {
diff -ur -N xpdf-3.02.orig/goo/gfile.cc xpdf-3.02/goo/gfile.cc
--- xpdf-3.02.orig/goo/gfile.cc	2009-03-05 23:36:46.000000000 +0100
+++ xpdf-3.02/goo/gfile.cc	2009-04-30 21:29:39.000000000 +0200
@@ -443,6 +443,7 @@
 #endif
 }
 
+#ifndef PDF_PARSER_ONLY
 GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
 #if defined(WIN32)
   //---------- Win32 ----------
@@ -551,6 +552,7 @@
   return gTrue;
 #endif
 }
+#endif
 
 GBool executeCommand(char *cmd) {
 #ifdef VMS
diff -ur -N xpdf-3.02.orig/xpdf/Decrypt.h xpdf-3.02/xpdf/Decrypt.h
--- xpdf-3.02.orig/xpdf/Decrypt.h	2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/Decrypt.h	2008-05-08 15:40:41.000000000 +0200
@@ -5,6 +5,9 @@
 // Copyright 1996-2003 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #ifndef DECRYPT_H
 #define DECRYPT_H
@@ -73,7 +76,7 @@
 		CryptAlgorithm algoA, int keyLength,
 		int objNum, int objGen);
   virtual ~DecryptStream();
-  virtual StreamKind getKind() { return strWeird; }
+  virtual StreamKind getKind() { return strCrypt; }
   virtual void reset();
   virtual int getChar();
   virtual int lookChar();
diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.cc xpdf-3.02/xpdf/GlobalParams.cc
--- xpdf-3.02.orig/xpdf/GlobalParams.cc	2009-04-02 10:22:18.000000000 +0200
+++ xpdf-3.02/xpdf/GlobalParams.cc	2009-04-30 21:35:00.000000000 +0200
@@ -429,6 +429,7 @@
   }
 }
 
+#ifndef PDF_PARSER_ONLY
 //------------------------------------------------------------------------
 // KeyBinding
 //------------------------------------------------------------------------
@@ -461,6 +462,7 @@
 KeyBinding::~KeyBinding() {
   deleteGList(cmds, GString);
 }
+#endif
 
 #ifdef ENABLE_PLUGINS
 //------------------------------------------------------------------------
@@ -608,6 +610,138 @@
 // parsing
 //------------------------------------------------------------------------
 
+GlobalParams::GlobalParams() {
+  UnicodeMap *map;
+  int i;
+
+#if MULTITHREADED
+  gInitMutex(&mutex);
+  gInitMutex(&unicodeMapCacheMutex);
+  gInitMutex(&cMapCacheMutex);
+#endif
+
+  initBuiltinFontTables();
+
+  // scan the encoding in reverse because we want the lowest-numbered
+  // index for each char name ('space' is encoded twice)
+  macRomanReverseMap = new NameToCharCode();
+  for (i = 255; i >= 0; --i) {
+    if (macRomanEncoding[i]) {
+      macRomanReverseMap->add(macRomanEncoding[i], (CharCode)i);
+    }
+  }
+
+#ifdef WIN32
+  // baseDir will be set by a call to setBaseDir
+  baseDir = new GString();
+#else
+  baseDir = appendToPath(getHomeDir(), ".xpdf");
+#endif
+  nameToUnicode = new NameToCharCode();
+  cidToUnicodes = new GHash(gTrue);
+  unicodeToUnicodes = new GHash(gTrue);
+  residentUnicodeMaps = new GHash();
+  unicodeMaps = new GHash(gTrue);
+  cMapDirs = new GHash(gTrue);
+  toUnicodeDirs = new GList();
+  displayFonts = new GHash();
+  displayCIDFonts = new GHash();
+  displayNamedCIDFonts = new GHash();
+#if HAVE_PAPER_H
+  char *paperName;
+  const struct paper *paperType;
+  paperinit();
+  if ((paperName = systempapername())) {
+    paperType = paperinfo(paperName);
+    psPaperWidth = (int)paperpswidth(paperType);
+    psPaperHeight = (int)paperpsheight(paperType);
+  } else {
+    error(-1, "No paper information available - using defaults");
+    psPaperWidth = defPaperWidth;
+    psPaperHeight = defPaperHeight;
+  }
+  paperdone();
+#else
+  psPaperWidth = defPaperWidth;
+  psPaperHeight = defPaperHeight;
+#endif
+  psImageableLLX = psImageableLLY = 0;
+  psImageableURX = psPaperWidth;
+  psImageableURY = psPaperHeight;
+  psCrop = gTrue;
+  psExpandSmaller = gFalse;
+  psShrinkLarger = gTrue;
+  psCenter = gTrue;
+  psDuplex = gFalse;
+  psLevel = psLevel2;
+  psFile = NULL;
+  psFonts = new GHash();
+  psNamedFonts16 = new GList();
+  psFonts16 = new GList();
+  psEmbedType1 = gTrue;
+  psEmbedTrueType = gTrue;
+  psEmbedCIDPostScript = gTrue;
+  psEmbedCIDTrueType = gTrue;
+  psOPI = gFalse;
+  psASCIIHex = gFalse;
+  textEncoding = new GString("Latin1");
+#if defined(WIN32)
+  textEOL = eolDOS;
+#elif defined(MACOS)
+  textEOL = eolMac;
+#else
+  textEOL = eolUnix;
+#endif
+  textPageBreaks = gTrue;
+  textKeepTinyChars = gFalse;
+  fontDirs = new GList();
+  initialZoom = new GString("125");
+  continuousView = gFalse;
+  enableT1lib = gTrue;
+  enableFreeType = gTrue;
+  antialias = gTrue;
+  urlCommand = NULL;
+  movieCommand = NULL;
+  mapNumericCharNames = gTrue;
+  printCommands = gFalse;
+  errQuiet = gFalse;
+
+  cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize);
+  unicodeToUnicodeCache =
+      new CharCodeToUnicodeCache(unicodeToUnicodeCacheSize);
+  unicodeMapCache = new UnicodeMapCache();
+  cMapCache = new CMapCache();
+
+#ifdef ENABLE_PLUGINS
+  plugins = new GList();
+  securityHandlers = new GList();
+#endif
+
+  // set up the initial nameToUnicode table
+  for (i = 0; nameToUnicodeTab[i].name; ++i) {
+    nameToUnicode->add(nameToUnicodeTab[i].name, nameToUnicodeTab[i].u);
+  }
+
+  // set up the residentUnicodeMaps table
+  map = new UnicodeMap("Latin1", gFalse,
+		       latin1UnicodeMapRanges, latin1UnicodeMapLen);
+  residentUnicodeMaps->add(map->getEncodingName(), map);
+  map = new UnicodeMap("ASCII7", gFalse,
+		       ascii7UnicodeMapRanges, ascii7UnicodeMapLen);
+  residentUnicodeMaps->add(map->getEncodingName(), map);
+  map = new UnicodeMap("Symbol", gFalse,
+		       symbolUnicodeMapRanges, symbolUnicodeMapLen);
+  residentUnicodeMaps->add(map->getEncodingName(), map);
+  map = new UnicodeMap("ZapfDingbats", gFalse, zapfDingbatsUnicodeMapRanges,
+		       zapfDingbatsUnicodeMapLen);
+  residentUnicodeMaps->add(map->getEncodingName(), map);
+  map = new UnicodeMap("UTF-8", gTrue, &mapUTF8);
+  residentUnicodeMaps->add(map->getEncodingName(), map);
+  map = new UnicodeMap("UCS-2", gTrue, &mapUCS2);
+  residentUnicodeMaps->add(map->getEncodingName(), map);
+
+}
+
 GlobalParams::GlobalParams(char *cfgFileName) {
   UnicodeMap *map;
   GString *fileName;
@@ -713,7 +847,9 @@
   movieCommand = NULL;
   mapNumericCharNames = gTrue;
   mapUnknownCharNames = gFalse;
+#ifndef PDF_PARSER_ONLY
   createDefaultKeyBindings();
+#endif
   printCommands = gFalse;
   errQuiet = gFalse;
 
@@ -788,12 +924,15 @@
     }
   }
   if (f) {
+#ifndef PDF_PARSER_ONLY
     parseFile(fileName, f);
+#endif
     delete fileName;
     fclose(f);
   }
 }
 
+#ifndef PDF_PARSER_ONLY
 void GlobalParams::createDefaultKeyBindings() {
   keyBindings = new GList();
 
@@ -1120,6 +1259,7 @@
 
   deleteGList(tokens, GString);
 }
+#endif
 
 void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
 					 int line) {
@@ -1464,6 +1604,7 @@
   }
 }
 
+#ifndef PDF_PARSER_ONLY
 void GlobalParams::parseBind(GList *tokens, GString *fileName, int line) {
   KeyBinding *binding;
   GList *cmds;
@@ -1649,6 +1790,7 @@
 
   return gTrue;
 }
+#endif
 
 void GlobalParams::parseCommand(char *cmdName, GString **val,
 				GList *tokens, GString *fileName, int line) {
@@ -1792,7 +1934,9 @@
   if (movieCommand) {
     delete movieCommand;
   }
+#ifndef PDF_PARSER_ONLY
   deleteGList(keyBindings, KeyBinding);
+#endif
 
   cMapDirs->startIter(&iter);
   while (cMapDirs->getNext(&iter, &key, (void **)&list)) {
@@ -2443,6 +2587,7 @@
   return map;
 }
 
+#ifndef PDF_PARSER_ONLY
 GList *GlobalParams::getKeyBinding(int code, int mods, int context) {
   KeyBinding *binding;
   GList *cmds;
@@ -2468,6 +2613,7 @@
   unlockGlobalParams;
   return cmds;
 }
+#endif
 
 GBool GlobalParams::getPrintCommands() {
   GBool p;
diff -ur -N xpdf-3.02.orig/xpdf/GlobalParams.h xpdf-3.02/xpdf/GlobalParams.h
--- xpdf-3.02.orig/xpdf/GlobalParams.h	2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/GlobalParams.h	2008-05-08 15:40:41.000000000 +0200
@@ -5,6 +5,9 @@
 // Copyright 2001-2003 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #ifndef GLOBALPARAMS_H
 #define GLOBALPARAMS_H
@@ -123,6 +126,7 @@
 
 //------------------------------------------------------------------------
 
+#ifndef PDF_PARSER_ONLY
 class KeyBinding {
 public:
 
@@ -186,6 +190,7 @@
 #define xpdfKeyContextMainWin     (2 << 6)
 #define xpdfKeyContextScrLockOn   (1 << 8)
 #define xpdfKeyContextScrLockOff  (2 << 8)
+#endif
 
 //------------------------------------------------------------------------
 
@@ -196,12 +201,17 @@
   // file.
   GlobalParams(char *cfgFileName);
 
+  // Initialize it without reading the config
+  GlobalParams();
+
   ~GlobalParams();
 
   void setBaseDir(char *dir);
   void setupBaseFonts(char *dir);
 
+#ifndef PDF_PARSER_ONLY
   void parseLine(char *buf, GString *fileName, int line);
+#endif
 
   //----- accessors
 
@@ -256,7 +266,9 @@
   GString *getMovieCommand() { return movieCommand; }
   GBool getMapNumericCharNames();
   GBool getMapUnknownCharNames();
+#ifndef PDF_PARSER_ONLY
   GList *getKeyBinding(int code, int mods, int context);
+#endif
   GBool getPrintCommands();
   GBool getErrQuiet();
 
@@ -315,7 +327,9 @@
 
 private:
 
+#ifndef PDF_PARSER_ONLY
   void createDefaultKeyBindings();
+#endif
   void parseFile(GString *fileName, FILE *f);
   void parseNameToUnicode(GList *tokens, GString *fileName, int line);
   void parseCIDToUnicode(GList *tokens, GString *fileName, int line);
@@ -338,12 +352,14 @@
   void parseFontDir(GList *tokens, GString *fileName, int line);
   void parseInitialZoom(GList *tokens, GString *fileName, int line);
   void parseScreenType(GList *tokens, GString *fileName, int line);
+#ifndef PDF_PARSER_ONLY
   void parseBind(GList *tokens, GString *fileName, int line);
   void parseUnbind(GList *tokens, GString *fileName, int line);
   GBool parseKey(GString *modKeyStr, GString *contextStr,
 		 int *code, int *mods, int *context,
 		 char *cmdName,
 		 GList *tokens, GString *fileName, int line);
+#endif
   void parseCommand(char *cmdName, GString **val,
 		    GList *tokens, GString *fileName, int line);
   void parseYesNo(char *cmdName, GBool *flag,
@@ -438,7 +454,9 @@
   GString *movieCommand;	// command executed for movie annotations
   GBool mapNumericCharNames;	// map numeric char names (from font subsets)?
   GBool mapUnknownCharNames;	// map unknown char names?
+#ifndef PDF_PARSER_ONLY
   GList *keyBindings;		// key & mouse button bindings [KeyBinding]
+#endif
   GBool printCommands;		// print the drawing commands
   GBool errQuiet;		// suppress error messages?
 
diff -ur -N xpdf-3.02.orig/xpdf/PDFDoc.h xpdf-3.02/xpdf/PDFDoc.h
--- xpdf-3.02.orig/xpdf/PDFDoc.h	2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/PDFDoc.h	2008-07-17 02:29:04.000000000 +0200
@@ -5,6 +5,9 @@
 // Copyright 1996-2003 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #ifndef PDFDOC_H
 #define PDFDOC_H
@@ -171,13 +174,15 @@
   double pdfVersion;
   XRef *xref;
   Catalog *catalog;
+  GBool ok;
+  int errCode;
+/* Keep the size of the structure the same whether DISABLE_OUTLINE or
+   not, and put it last to try to find errors more quickly.  */
 #ifndef DISABLE_OUTLINE
   Outline *outline;
+#else
+  void *dummy;
 #endif
-
-
-  GBool ok;
-  int errCode;
 };
 
 #endif
diff -ur -N xpdf-3.02.orig/xpdf/Page.h xpdf-3.02/xpdf/Page.h
--- xpdf-3.02.orig/xpdf/Page.h	2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/Page.h	2008-05-08 15:40:41.000000000 +0200
@@ -5,6 +5,9 @@
 // Copyright 1996-2003 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #ifndef PAGE_H
 #define PAGE_H
@@ -170,9 +173,11 @@
 
   void processLinks(OutputDev *out, Catalog *catalog);
 
+#ifndef PDF_PARSER_ONLY
   // Get the page's default CTM.
   void getDefaultCTM(double *ctm, double hDPI, double vDPI,
 		     int rotate, GBool useMediaBox, GBool upsideDown);
+#endif
 
 private:
 
diff -ur -N xpdf-3.02.orig/xpdf/Stream.h xpdf-3.02/xpdf/Stream.h
--- xpdf-3.02.orig/xpdf/Stream.h	2007-11-12 13:27:21.000000000 +0100
+++ xpdf-3.02/xpdf/Stream.h	2008-05-08 15:40:41.000000000 +0200
@@ -5,6 +5,9 @@
 // Copyright 1996-2003 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #ifndef STREAM_H
 #define STREAM_H
@@ -34,6 +37,7 @@
   strFlate,
   strJBIG2,
   strJPX,
+  strCrypt,
   strWeird			// internal-use stream types
 };
 
diff -ur -N xpdf-3.02.orig/xpdf/XRef.cc xpdf-3.02/xpdf/XRef.cc
--- xpdf-3.02.orig/xpdf/XRef.cc	2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/XRef.cc	2008-05-08 15:40:41.000000000 +0200
@@ -5,6 +5,9 @@
 // Copyright 1996-2003 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #include <aconf.h>
 
@@ -45,34 +48,9 @@
 // ObjectStream
 //------------------------------------------------------------------------
 
-class ObjectStream {
-public:
-
-  // Create an object stream, using object number <objStrNum>,
-  // generation 0.
-  ObjectStream(XRef *xref, int objStrNumA);
-
-  ~ObjectStream();
-
-  // Return the object number of this object stream.
-  int getObjStrNum() { return objStrNum; }
-
-  // Get the <objIdx>th object from this stream, which should be
-  // object number <objNum>, generation 0.
-  Object *getObject(int objIdx, int objNum, Object *obj);
-
-private:
-
-  int objStrNum;		// object number of the object stream
-  int nObjects;			// number of objects in the stream
-  Object *objs;			// the objects (length = nObjects)
-  int *objNums;			// the object numbers (length = nObjects)
-};
-
 ObjectStream::ObjectStream(XRef *xref, int objStrNumA) {
   Stream *str;
   Parser *parser;
-  int *offsets;
   Object objStr, obj1, obj2;
   int first, i;
 
@@ -80,6 +58,7 @@
   nObjects = 0;
   objs = NULL;
   objNums = NULL;
+  offsets = NULL;
 
   if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) {
     goto err1;
@@ -100,6 +79,7 @@
     goto err1;
   }
   first = obj1.getInt();
+  firstOffset = objStr.getStream()->getBaseStream()->getStart() + first;
   obj1.free();
   if (first < 0) {
     goto err1;
@@ -121,7 +101,7 @@
       obj1.free();
       obj2.free();
       delete parser;
-      gfree(offsets);
+//       gfree(offsets);
       goto err1;
     }
     objNums[i] = obj1.getInt();
@@ -131,7 +111,7 @@
     if (objNums[i] < 0 || offsets[i] < 0 ||
 	(i > 0 && offsets[i] < offsets[i-1])) {
       delete parser;
-      gfree(offsets);
+//       gfree(offsets);
       goto err1;
     }
   }
@@ -160,7 +140,7 @@
     delete parser;
   }
 
-  gfree(offsets);
+//   gfree(offsets);
 
  err1:
   objStr.free();
@@ -177,6 +157,7 @@
     delete[] objs;
   }
   gfree(objNums);
+  gfree(offsets);
 }
 
 Object *ObjectStream::getObject(int objIdx, int objNum, Object *obj) {
diff -ur -N xpdf-3.02.orig/xpdf/XRef.h xpdf-3.02/xpdf/XRef.h
--- xpdf-3.02.orig/xpdf/XRef.h	2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/XRef.h	2008-05-08 15:40:41.000000000 +0200
@@ -5,6 +5,9 @@
 // Copyright 1996-2003 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #ifndef XREF_H
 #define XREF_H
@@ -21,7 +24,36 @@
 class Dict;
 class Stream;
 class Parser;
-class ObjectStream;
+
+class ObjectStream {
+public:
+
+  // Create an object stream, using object number <objStrNum>,
+  // generation 0.
+  ObjectStream(XRef *xref, int objStrNumA);
+
+  ~ObjectStream();
+
+  // Return the object number of this object stream.
+  int getObjStrNum() { return objStrNum; }
+
+  // Get the <objIdx>th object from this stream, which should be
+  // object number <objNum>, generation 0.
+  Object *getObject(int objIdx, int objNum, Object *obj);
+
+  int *getOffsets() { return offsets; }
+  Guint getFirstOffset() { return firstOffset; }
+
+private:
+
+  int objStrNum;		// object number of the object stream
+  int nObjects;			// number of objects in the stream
+  Object *objs;			// the objects (length = nObjects)
+  int *objNums;			// the object numbers (length = nObjects)
+  int *offsets;			// the object offsets (length = nObjects)
+  Guint firstOffset;
+};
+
 
 //------------------------------------------------------------------------
 // XRef
@@ -96,6 +128,7 @@
   int getSize() { return size; }
   XRefEntry *getEntry(int i) { return &entries[i]; }
   Object *getTrailerDict() { return &trailerDict; }
+  ObjectStream *getObjStr() { return objStr; }
 
 private: