diff options
author | Arturo Espinosa <unammx@src.gnome.org> | 1999-04-17 02:59:58 (GMT) |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1999-04-17 02:59:58 (GMT) |
commit | d9f9a6449f377b4c933b75d57541b19c6d088994 (patch) | |
tree | 04f7f0c54447ef792fbf83bc5039174f4681b3bb /pdf/xpdf/Catalog.h |
Initial revision
Diffstat (limited to 'pdf/xpdf/Catalog.h')
-rw-r--r-- | pdf/xpdf/Catalog.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/pdf/xpdf/Catalog.h b/pdf/xpdf/Catalog.h new file mode 100644 index 0000000..72ff0a3 --- /dev/null +++ b/pdf/xpdf/Catalog.h @@ -0,0 +1,65 @@ +//======================================================================== +// +// Catalog.h +// +// Copyright 1996 Derek B. Noonburg +// +//======================================================================== + +#ifndef CATALOG_H +#define CATALOG_H + +#ifdef __GNUC__ +#pragma interface +#endif + +class Object; +class Page; +class PageAttrs; +struct Ref; +class LinkDest; + +//------------------------------------------------------------------------ +// Catalog +//------------------------------------------------------------------------ + +class Catalog { +public: + + // Constructor. + Catalog(Object *catDict); + + // Destructor. + ~Catalog(); + + // Is catalog valid? + GBool isOk() { return ok; } + + // Get number of pages. + int getNumPages() { return numPages; } + + // Get a page. + Page *getPage(int i) { return pages[i-1]; } + + // Find a page, given its object ID. Returns page number, or 0 if + // not found. + int findPage(int num, int gen); + + // Find a named destination. Returns the link destination, or + // NULL if <name> is not a destination. + LinkDest *findDest(GString *name); + +private: + + Page **pages; // array of pages + Ref *pageRefs; // object ID for each page + int numPages; // number of pages + Object dests; // named destination dictionary + Object nameTree; // name tree + GBool ok; // true if catalog is valid + + int readPageTree(Dict *pages, PageAttrs *attrs, int start); + Object *findDestInTree(Object *tree, GString *name, Object *obj); +}; + +#endif |