]> git.ipfire.org Git - thirdparty/cups.git/blob - pdftops/FormWidget.h
Merge changes from 1.1.x into 1.2 devel.
[thirdparty/cups.git] / pdftops / FormWidget.h
1 //========================================================================
2 //
3 // FormWidget.h
4 //
5 // Copyright 2000 Derek B. Noonburg
6 //
7 //========================================================================
8
9 #ifndef FORMWIDGET_H
10 #define FORMWIDGET_H
11
12 #ifdef __GNUC__
13 #pragma interface
14 #endif
15
16 class XRef;
17 class Gfx;
18
19 //------------------------------------------------------------------------
20 // FormWidget
21 //------------------------------------------------------------------------
22
23 class FormWidget {
24 public:
25
26 FormWidget(XRef *xrefA, Dict *dict);
27 ~FormWidget();
28 GBool isOk() { return ok; }
29
30 void draw(Gfx *gfx);
31
32 // Get appearance object.
33 Object *getAppearance(Object *obj) { return appearance.fetch(xref, obj); }
34
35 private:
36
37 XRef *xref; // the xref table for this PDF file
38 Object appearance; // a reference to the Form XObject stream
39 // for the normal appearance
40 double xMin, yMin, // widget rectangle
41 xMax, yMax;
42 GBool ok;
43 };
44
45 //------------------------------------------------------------------------
46 // FormWidgets
47 //------------------------------------------------------------------------
48
49 class FormWidgets {
50 public:
51
52 // Extract widgets from array of annotations.
53 FormWidgets(XRef *xref, Object *annots);
54
55 ~FormWidgets();
56
57 // Iterate through list of widgets.
58 int getNumWidgets() { return nWidgets; }
59 FormWidget *getWidget(int i) { return widgets[i]; }
60
61 private:
62
63 FormWidget **widgets;
64 int nWidgets;
65 };
66
67 #endif