Diffstat (limited to 'noncore/unsupported/qpdf/xpdf/FormWidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/qpdf/xpdf/FormWidget.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/noncore/unsupported/qpdf/xpdf/FormWidget.h b/noncore/unsupported/qpdf/xpdf/FormWidget.h new file mode 100644 index 0000000..7f07889 --- a/dev/null +++ b/noncore/unsupported/qpdf/xpdf/FormWidget.h | |||
@@ -0,0 +1,67 @@ | |||
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 | fouble 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 | ||