~ubuntu-branches/ubuntu/raring/luatex/raring

« back to all changes in this revision

Viewing changes to source/libs/xpdf/xpdf-3.02/xpdf/Catalog.h

  • Committer: Package Import Robot
  • Author(s): Norbert Preining
  • Date: 2011-05-20 09:40:39 UTC
  • mfrom: (0.8.1) (1.8.1) (19.2.3 oneiric)
  • Revision ID: package-import@ubuntu.com-20110520094039-7sezr4kqonjqxqz6
Tags: 0.70.1-1
* new upstream release (probably) matching TeX Live 2011
* deactivate fix-luatex-build-with-old-libpng patch, included upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//========================================================================
2
 
//
3
 
// Catalog.h
4
 
//
5
 
// Copyright 1996-2007 Glyph & Cog, LLC
6
 
//
7
 
//========================================================================
8
 
 
9
 
#ifndef CATALOG_H
10
 
#define CATALOG_H
11
 
 
12
 
#include <aconf.h>
13
 
 
14
 
#ifdef USE_GCC_PRAGMAS
15
 
#pragma interface
16
 
#endif
17
 
 
18
 
class XRef;
19
 
class Object;
20
 
class Page;
21
 
class PageAttrs;
22
 
struct Ref;
23
 
class LinkDest;
24
 
 
25
 
//------------------------------------------------------------------------
26
 
// Catalog
27
 
//------------------------------------------------------------------------
28
 
 
29
 
class Catalog {
30
 
public:
31
 
 
32
 
  // Constructor.
33
 
  Catalog(XRef *xrefA);
34
 
 
35
 
  // Destructor.
36
 
  ~Catalog();
37
 
 
38
 
  // Is catalog valid?
39
 
  GBool isOk() { return ok; }
40
 
 
41
 
  // Get number of pages.
42
 
  int getNumPages() { return numPages; }
43
 
 
44
 
  // Get a page.
45
 
  Page *getPage(int i) { return pages[i-1]; }
46
 
 
47
 
  // Get the reference for a page object.
48
 
  Ref *getPageRef(int i) { return &pageRefs[i-1]; }
49
 
 
50
 
  // Return base URI, or NULL if none.
51
 
  GString *getBaseURI() { return baseURI; }
52
 
 
53
 
  // Return the contents of the metadata stream, or NULL if there is
54
 
  // no metadata.
55
 
  GString *readMetadata();
56
 
 
57
 
  // Return the structure tree root object.
58
 
  Object *getStructTreeRoot() { return &structTreeRoot; }
59
 
 
60
 
  // Find a page, given its object ID.  Returns page number, or 0 if
61
 
  // not found.
62
 
  int findPage(int num, int gen);
63
 
 
64
 
  // Find a named destination.  Returns the link destination, or
65
 
  // NULL if <name> is not a destination.
66
 
  LinkDest *findDest(GString *name);
67
 
 
68
 
  Object *getDests() { return &dests; }
69
 
 
70
 
  Object *getNameTree() { return &nameTree; }
71
 
 
72
 
  Object *getOutline() { return &outline; }
73
 
 
74
 
  Object *getAcroForm() { return &acroForm; }
75
 
 
76
 
private:
77
 
 
78
 
  XRef *xref;                   // the xref table for this PDF file
79
 
  Page **pages;                 // array of pages
80
 
  Ref *pageRefs;                // object ID for each page
81
 
  int numPages;                 // number of pages
82
 
  int pagesSize;                // size of pages array
83
 
  Object dests;                 // named destination dictionary
84
 
  Object nameTree;              // name tree
85
 
  GString *baseURI;             // base URI for URI-type links
86
 
  Object metadata;              // metadata stream
87
 
  Object structTreeRoot;        // structure tree root dictionary
88
 
  Object outline;               // outline dictionary
89
 
  Object acroForm;              // AcroForm dictionary
90
 
  GBool ok;                     // true if catalog is valid
91
 
 
92
 
  int readPageTree(Dict *pages, PageAttrs *attrs, int start,
93
 
                   char *alreadyRead);
94
 
  Object *findDestInTree(Object *tree, GString *name, Object *obj);
95
 
};
96
 
 
97
 
#endif