~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/xpdflib/catalog.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2005-02-24 22:09:16 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050224220916-9vxiiqjz066r5489
Tags: 6.0pre23-2
debian/control: Ipe should depend on exact version of libipe.
Closes: #296771.

Show diffs side-by-side

added added

removed removed

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