]> www.fi.muni.cz Git - evince.git/blobdiff - pdf/xpdf/XRef.h
New file with some random thoughts.
[evince.git] / pdf / xpdf / XRef.h
index 3f5a598e9bc058d57d888adb161747793ff879e7..bec487a114756674f828afd31ff071b2b7f0fc16 100644 (file)
 
 class Dict;
 class Stream;
 
 class Dict;
 class Stream;
+class Parser;
+class ObjectStream;
 
 //------------------------------------------------------------------------
 // XRef
 //------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------
 // XRef
 //------------------------------------------------------------------------
 
+enum XRefEntryType {
+  xrefEntryFree,
+  xrefEntryUncompressed,
+  xrefEntryCompressed
+};
+
 struct XRefEntry {
   Guint offset;
   int gen;
 struct XRefEntry {
   Guint offset;
   int gen;
-  GBool used;
+  XRefEntryType type;
 };
 
 class XRef {
 };
 
 class XRef {
@@ -103,6 +111,7 @@ private:
   Guint *streamEnds;           // 'endstream' positions - only used in
                                //   damaged files
   int streamEndsLen;           // number of valid entries in streamEnds
   Guint *streamEnds;           // 'endstream' positions - only used in
                                //   damaged files
   int streamEndsLen;           // number of valid entries in streamEnds
+  ObjectStream *objStr;                // cached object stream
 #ifndef NO_DECRYPTION
   GBool encrypted;             // true if file is encrypted
   int encVersion;              // encryption algorithm
 #ifndef NO_DECRYPTION
   GBool encrypted;             // true if file is encrypted
   int encVersion;              // encryption algorithm
@@ -113,8 +122,11 @@ private:
   GBool ownerPasswordOk;       // true if owner password is correct
 #endif
 
   GBool ownerPasswordOk;       // true if owner password is correct
 #endif
 
-  Guint readTrailer();
+  Guint getStartXref();
   GBool readXRef(Guint *pos);
   GBool readXRef(Guint *pos);
+  GBool readXRefTable(Parser *parser, Guint *pos);
+  GBool readXRefStreamSection(Stream *xrefStr, int *w, int first, int n);
+  GBool readXRefStream(Stream *xrefStr, Guint *pos);
   GBool constructXRef();
   GBool checkEncrypted(GString *ownerPassword, GString *userPassword);
   Guint strToUnsigned(char *s);
   GBool constructXRef();
   GBool checkEncrypted(GString *ownerPassword, GString *userPassword);
   Guint strToUnsigned(char *s);