X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fxpdf%2FObject.h;h=8b1807c5ba52326e6d36b07043d635bbc2b00b9b;hb=c26ca847941ca0acfc9f3b4bdc519d904ba09a39;hp=fa4f740b5ef45b85dbfe2d11df4eb57eafd8f6a1;hpb=fc554a43712b76d16b41ec77dd311b4a78b1ef6b;p=swftools.git diff --git a/pdf2swf/xpdf/Object.h b/pdf2swf/xpdf/Object.h index fa4f740..8b1807c 100644 --- a/pdf2swf/xpdf/Object.h +++ b/pdf2swf/xpdf/Object.h @@ -2,14 +2,16 @@ // // Object.h // -// Copyright 1996 Derek B. Noonburg +// Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== #ifndef OBJECT_H #define OBJECT_H -#ifdef __GNUC__ +#include + +#ifdef USE_GCC_PRAGMAS #pragma interface #endif @@ -19,6 +21,7 @@ #include "gmem.h" #include "GString.h" +class XRef; class Array; class Dict; class Stream; @@ -78,27 +81,26 @@ public: type(objNone) {} // Initialize an object. - Object *initBool(GBool booln1) - { initObj(objBool); booln = booln1; return this; } - Object *initInt(int intg1) - { initObj(objInt); intg = intg1; return this; } - Object *initReal(double real1) - { initObj(objReal); real = real1; return this; } - Object *initString(GString *string1) - { initObj(objString); string = string1; return this; } - Object *initName(char *name1) - { initObj(objName); name = copyString(name1); return this; } + Object *initBool(GBool boolnA) + { initObj(objBool); booln = boolnA; return this; } + Object *initInt(int intgA) + { initObj(objInt); intg = intgA; return this; } + Object *initReal(double realA) + { initObj(objReal); real = realA; return this; } + Object *initString(GString *stringA) + { initObj(objString); string = stringA; return this; } + Object *initName(char *nameA) + { initObj(objName); name = copyString(nameA); return this; } Object *initNull() { initObj(objNull); return this; } - Object *initArray(); - Object *initDict(); - Object *initDict(Dict *dict1) - { initObj(objDict); dict = dict1; return this; } - Object *initStream(Stream *stream1); - Object *initRef(int num1, int gen1) - { initObj(objRef); ref.num = num1; ref.gen = gen1; return this; } - Object *initCmd(char *cmd1) - { initObj(objCmd); cmd = copyString(cmd1); return this; } + Object *initArray(XRef *xref); + Object *initDict(XRef *xref); + Object *initDict(Dict *dictA); + Object *initStream(Stream *streamA); + Object *initRef(int numA, int genA) + { initObj(objRef); ref.num = numA; ref.gen = genA; return this; } + Object *initCmd(char *cmdA) + { initObj(objCmd); cmd = copyString(cmdA); return this; } Object *initError() { initObj(objError); return this; } Object *initEOF() @@ -109,7 +111,7 @@ public: // If object is a Ref, fetch and return the referenced object. // Otherwise, return a copy of the object. - Object *fetch(Object *obj); + Object *fetch(XRef *xref, Object *obj); // Free object contents. void free(); @@ -133,12 +135,12 @@ public: GBool isNone() { return type == objNone; } // Special type checking. - GBool isName(char *name1) - { return type == objName && !strcmp(name, name1); } + GBool isName(char *nameA) + { return type == objName && !strcmp(name, nameA); } GBool isDict(char *dictType); GBool isStream(char *dictType); - GBool isCmd(char *cmd1) - { return type == objCmd && !strcmp(cmd, cmd1); } + GBool isCmd(char *cmdA) + { return type == objCmd && !strcmp(cmd, cmdA); } // Accessors. NB: these assume object is of correct type. GBool getBool() { return booln; } @@ -153,6 +155,7 @@ public: Ref getRef() { return ref; } int getRefNum() { return ref.num; } int getRefGen() { return ref.gen; } + char *getCmd() { return cmd; } // Array accessors. int arrayGetLength(); @@ -177,8 +180,8 @@ public: int streamGetChar(); int streamLookChar(); char *streamGetLine(char *buf, int size); - int streamGetPos(); - void streamSetPos(int pos); + Guint streamGetPos(); + void streamSetPos(Guint pos, int dir = 0); Dict *streamGetDict(); // Output. @@ -288,11 +291,11 @@ inline int Object::streamLookChar() inline char *Object::streamGetLine(char *buf, int size) { return stream->getLine(buf, size); } -inline int Object::streamGetPos() +inline Guint Object::streamGetPos() { return stream->getPos(); } -inline void Object::streamSetPos(int pos) - { stream->setPos(pos); } +inline void Object::streamSetPos(Guint pos, int dir) + { stream->setPos(pos, dir); } inline Dict *Object::streamGetDict() { return stream->getDict(); }