Diffstat (limited to 'noncore/unsupported/qpdf/xpdf/TextOutputDev.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/qpdf/xpdf/TextOutputDev.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/noncore/unsupported/qpdf/xpdf/TextOutputDev.h b/noncore/unsupported/qpdf/xpdf/TextOutputDev.h index 4c71e5e..f0f238e 100644 --- a/noncore/unsupported/qpdf/xpdf/TextOutputDev.h +++ b/noncore/unsupported/qpdf/xpdf/TextOutputDev.h | |||
@@ -2,7 +2,7 @@ | |||
2 | // | 2 | // |
3 | // TextOutputDev.h | 3 | // TextOutputDev.h |
4 | // | 4 | // |
5 | // Copyright 1997 Derek B. Noonburg | 5 | // Copyright 1997-2002 Glyph & Cog, LLC |
6 | // | 6 | // |
7 | //======================================================================== | 7 | //======================================================================== |
8 | 8 | ||
@@ -22,6 +22,10 @@ class GfxState; | |||
22 | class GString; | 22 | class GString; |
23 | 23 | ||
24 | //------------------------------------------------------------------------ | 24 | //------------------------------------------------------------------------ |
25 | |||
26 | typedef void (*TextOutputFunc)(void *stream, char *text, int len); | ||
27 | |||
28 | //------------------------------------------------------------------------ | ||
25 | // TextString | 29 | // TextString |
26 | //------------------------------------------------------------------------ | 30 | //------------------------------------------------------------------------ |
27 | 31 | ||
@@ -97,7 +101,7 @@ public: | |||
97 | fouble xMax, fouble yMax); | 101 | fouble xMax, fouble yMax); |
98 | 102 | ||
99 | // Dump contents of page to a file. | 103 | // Dump contents of page to a file. |
100 | void dump(FILE *f); | 104 | void dump(void *outputStream, TextOutputFunc outputFunc); |
101 | 105 | ||
102 | // Clear the page. | 106 | // Clear the page. |
103 | void clear(); | 107 | void clear(); |
@@ -128,6 +132,10 @@ public: | |||
128 | // <rawOrder> is true, the text is kept in content stream order. | 132 | // <rawOrder> is true, the text is kept in content stream order. |
129 | TextOutputDev(char *fileName, GBool rawOrderA, GBool append); | 133 | TextOutputDev(char *fileName, GBool rawOrderA, GBool append); |
130 | 134 | ||
135 | // Create a TextOutputDev which will write to a generic stream. If | ||
136 | // <rawOrder> is true, the text is kept in content stream order. | ||
137 | TextOutputDev(TextOutputFunc func, void *stream, GBool rawOrderA); | ||
138 | |||
131 | // Destructor. | 139 | // Destructor. |
132 | virtual ~TextOutputDev(); | 140 | virtual ~TextOutputDev(); |
133 | 141 | ||
@@ -143,6 +151,10 @@ public: | |||
143 | // Does this device use drawChar() or drawString()? | 151 | // Does this device use drawChar() or drawString()? |
144 | virtual GBool useDrawChar() { return gTrue; } | 152 | virtual GBool useDrawChar() { return gTrue; } |
145 | 153 | ||
154 | // Does this device use beginType3Char/endType3Char? Otherwise, | ||
155 | // text in Type 3 fonts will be drawn with drawChar/drawString. | ||
156 | virtual GBool interpretType3Chars() { return gFalse; } | ||
157 | |||
146 | // Does this device need non-text content? | 158 | // Does this device need non-text content? |
147 | virtual GBool needNonText() { return gFalse; } | 159 | virtual GBool needNonText() { return gFalse; } |
148 | 160 | ||
@@ -179,8 +191,10 @@ public: | |||
179 | 191 | ||
180 | private: | 192 | private: |
181 | 193 | ||
182 | FILE *f; // text file | 194 | TextOutputFunc outputFunc;// output function |
183 | GBool needClose; // need to close the file? | 195 | void *outputStream; // output stream |
196 | GBool needClose; // need to close the output file? | ||
197 | // (only if outputStream is a FILE*) | ||
184 | TextPage *text; // text for the current page | 198 | TextPage *text; // text for the current page |
185 | GBool rawOrder; // keep text in content stream order | 199 | GBool rawOrder; // keep text in content stream order |
186 | GBool ok; // set up ok? | 200 | GBool ok; // set up ok? |