23
//------------------------------------------------------------------------
25
//------------------------------------------------------------------------
27
enum AnnotBorderType {
35
class AnnotBorderStyle {
38
AnnotBorderStyle(AnnotBorderType typeA, double widthA,
39
double *dashA, int dashLengthA,
40
double rA, double gA, double bA);
43
AnnotBorderType getType() { return type; }
44
double getWidth() { return width; }
45
void getDash(double **dashA, int *dashLengthA)
46
{ *dashA = dash; *dashLengthA = dashLength; }
47
void getColor(double *rA, double *gA, double *bA)
48
{ *rA = r; *gA = g; *bA = b; }
22
59
//------------------------------------------------------------------------
29
Annot(XRef *xrefA, Dict *acroForm, Dict *dict);
66
Annot(XRef *xrefA, Dict *acroForm, Dict *dict, Ref *refA);
31
68
GBool isOk() { return ok; }
70
void draw(Gfx *gfx, GBool printing);
35
72
// Get appearance object.
36
73
Object *getAppearance(Object *obj) { return appearance.fetch(xref, obj); }
75
AnnotBorderStyle *getBorderStyle() { return borderStyle; }
77
GBool match(Ref *refA)
78
{ return ref.num == refA->num && ref.gen == refA->gen; }
80
void generateFieldAppearance(Dict *field, Dict *annot, Dict *acroForm);
40
void generateAppearance(Dict *acroForm, Dict *dict);
84
void setColor(Array *a, GBool fill, int adjust);
85
void drawText(GString *text, GString *da, GfxFontDict *fontDict,
86
GBool multiline, int comb, int quadding,
87
GBool txField, GBool forceZapfDingbats);
88
void drawListBox(GString **text, GBool *selection,
89
int nOptions, int topIdx,
90
GString *da, GfxFontDict *fontDict, GBool quadding);
91
void getNextLine(GString *text, int start,
92
GfxFont *font, double fontSize, double wMax,
93
int *end, double *width, int *next);
94
void drawCircle(double cx, double cy, double r, GBool fill);
95
void drawCircleTopLeft(double cx, double cy, double r);
96
void drawCircleBottomRight(double cx, double cy, double r);
97
Object *fieldLookup(Dict *field, char *key, Object *obj);
42
99
XRef *xref; // the xref table for this PDF file
100
Ref ref; // object ref identifying this annotation
101
GString *type; // annotation type
43
102
Object appearance; // a reference to the Form XObject stream
44
103
// for the normal appearance
45
104
GString *appearBuf;
46
105
double xMin, yMin, // annotation rectangle
108
AnnotBorderStyle *borderStyle;
64
125
int getNumAnnots() { return nAnnots; }
65
126
Annot *getAnnot(int i) { return annots[i]; }
128
// (Re)generate the appearance streams for all annotations belonging
130
void generateAppearances(Dict *acroForm);
134
void scanFieldAppearances(Dict *node, Ref *ref, Dict *parent,
136
Annot *findAnnot(Ref *ref);