11 #include <QTextStream>
22 #include "fpointarray.h"
24 #include "scribusdoc.h"
25 #include "scribusview.h"
26 #include "selection.h"
27 #include "vgradient.h"
29 #include <poppler/goo/gtypes.h>
30 #include <poppler/Object.h>
31 #include <poppler/OutputDev.h>
32 #include <poppler/Gfx.h>
33 #include <poppler/GfxState.h>
34 #include <poppler/Stream.h>
35 #include <poppler/GfxFont.h>
36 #include <poppler/Link.h>
37 #include <poppler/PDFDoc.h>
38 #include <poppler/Error.h>
39 #include <poppler/Form.h>
40 #include <poppler/Page.h>
41 #include <poppler/Catalog.h>
42 #include <poppler/CharCodeToUnicode.h>
43 #include <poppler/FontEncodingTables.h>
44 #include <poppler/splash/SplashFontFileID.h>
45 #include <poppler/splash/SplashFontFile.h>
46 #include <poppler/splash/SplashFontEngine.h>
47 #include <poppler/splash/SplashFont.h>
48 #include <poppler/splash/SplashMath.h>
49 #include <poppler/splash/SplashPath.h>
50 #include <poppler/splash/SplashGlyphBitmap.h>
64 virtual GBool isOk() {
return fileName != NULL; }
66 virtual LinkActionKind getKind() {
return actionUnknown; }
67 GooString *getFileName() {
return fileName; }
68 int getFlags() {
return m_flags; }
86 virtual GBool isOk() {
return fileName != NULL; }
88 virtual LinkActionKind getKind() {
return actionUnknown; }
89 GooString *getFileName() {
return fileName; }
103 GBool matches(SplashFontFileID *
id)
118 GBool isOk() {
return gTrue; }
119 virtual GBool upsideDown() {
return gTrue; }
120 virtual GBool useDrawChar() {
return gFalse; }
121 virtual GBool interpretType3Chars() {
return gFalse; }
122 virtual GBool useTilingPatternFill() {
return gFalse; }
123 virtual GBool useShadedFills(
int type) {
return gFalse; }
124 virtual GBool useFillColorStop() {
return gFalse; }
125 virtual GBool useDrawForm() {
return gFalse; }
126 virtual void stroke(GfxState *state);
127 virtual void eoFill(GfxState *state);
128 virtual void fill(GfxState *state);
129 virtual void drawString(GfxState *state, GooString *s);
131 QString CurrColorText;
132 QString CurrColorFill;
133 QString CurrColorStroke;
135 GooString *m_fontName;
136 GooString *m_itemText;
138 QString getColor(GfxColorSpace *color_space, GfxColor *color,
int *shade);
140 QStringList *m_importedColors;
149 LinkAction* SC_getAction(AnnotWidget *ano);
150 LinkAction* SC_getAdditionalAction(
const char *key, AnnotWidget *ano);
151 static GBool annotations_callback(Annot *annota,
void *user_data);
152 bool handleTextAnnot(Annot* annota,
double xCoor,
double yCoor,
double width,
double height);
153 bool handleLinkAnnot(Annot* annota,
double xCoor,
double yCoor,
double width,
double height);
154 bool handleWidgetAnnot(Annot* annota,
double xCoor,
double yCoor,
double width,
double height);
155 void applyTextStyle(
PageItem* ite, QString fontName, QString textColor,
double fontSize);
156 void handleActions(
PageItem* ite, AnnotWidget *ano);
157 void startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA);
159 GBool isOk() {
return gTrue; }
160 virtual GBool upsideDown() {
return gTrue; }
161 virtual GBool useDrawChar() {
return gTrue; }
162 virtual GBool interpretType3Chars() {
return gTrue; }
163 virtual GBool useTilingPatternFill() {
return gTrue; }
164 virtual GBool useShadedFills(
int type) {
return type <= 7; }
165 virtual GBool useFillColorStop() {
return gTrue; }
166 virtual GBool useDrawForm() {
return gFalse; }
168 virtual void startPage(
int pageNum, GfxState *, XRef *);
169 virtual void endPage();
171 virtual void saveState(GfxState *state);
172 virtual void restoreState(GfxState *state);
175 virtual void stroke(GfxState *state);
176 virtual void fill(GfxState *state);
177 virtual void eoFill(GfxState *state);
178 GBool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str,
double *pmat,
int paintType,
int tilingType, Dict *resDict,
double *mat,
double *bbox,
int x0,
int y0,
int x1,
int y1,
double xStep,
double yStep);
179 virtual GBool functionShadedFill(GfxState * , GfxFunctionShading * ) { qDebug() <<
"Function Shaded Fill";
return gFalse; }
180 virtual GBool axialShadedFill(GfxState *state, GfxAxialShading *shading,
double tMin,
double tMax);
181 virtual GBool axialShadedSupportExtend(GfxState *state, GfxAxialShading *shading) {
return (shading->getExtend0() == shading->getExtend1()); }
182 virtual GBool radialShadedFill(GfxState *state, GfxRadialShading *shading,
double sMin,
double sMax);
183 virtual GBool radialShadedSupportExtend(GfxState *state, GfxRadialShading *shading) {
return (shading->getExtend0() == shading->getExtend1()); }
184 virtual GBool gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading);
185 virtual GBool patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading);
187 virtual void clip(GfxState *state);
188 virtual void eoClip(GfxState *state);
189 virtual void clipToStrokePath(GfxState * ) { qDebug() <<
"Clip to StrokePath"; }
190 virtual GBool deviceHasTextClip(GfxState *state) {
return gFalse; }
194 virtual GBool supportTextCSPattern(GfxState *state)
196 return state->getFillColorSpace()->getMode() == csPattern;
201 virtual GBool fillMaskCSPattern(GfxState * state)
203 return state->getFillColorSpace()->getMode() == csPattern;
206 virtual void endMaskClip(GfxState *state) { qDebug() <<
"End Mask Clip"; }
209 virtual void beginMarkedContent(
char *name, Dict *properties);
210 virtual void beginMarkedContent(
char *name, Object *dictRef);
211 virtual void endMarkedContent(GfxState *state);
212 virtual void markPoint(
char *name);
213 virtual void markPoint(
char *name, Dict *properties);
215 virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
int width,
int height, GBool invert, GBool interpolate, GBool inlineImg);
216 virtual void drawImage(GfxState *state, Object *ref, Stream *str,
int width,
int height, GfxImageColorMap *colorMap, GBool interpolate,
int *maskColors, GBool inlineImg);
217 virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
218 int width,
int height,
219 GfxImageColorMap *colorMap,
222 int maskWidth,
int maskHeight,
223 GfxImageColorMap *maskColorMap,
224 GBool maskInterpolate);
226 virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
227 int width,
int height,
228 GfxImageColorMap *colorMap,
231 int maskWidth,
int maskHeight,
232 GBool maskInvert, GBool maskInterpolate);
235 virtual void beginTransparencyGroup(GfxState *state,
double *bbox, GfxColorSpace * , GBool , GBool , GBool );
236 virtual void paintTransparencyGroup(GfxState *state,
double *bbox);
237 virtual void endTransparencyGroup(GfxState *state);
238 virtual void setSoftMask(GfxState * ,
double * , GBool , Function * , GfxColor * );
239 virtual void clearSoftMask(GfxState * );
241 virtual void updateFillColor(GfxState *state);
242 virtual void updateStrokeColor(GfxState *state);
243 virtual void updateFont(GfxState *state);
245 virtual void beginTextObject(GfxState *state);
246 virtual void endTextObject(GfxState *state);
247 virtual void drawChar(GfxState *state,
double ,
double ,
double ,
double ,
double ,
double , CharCode ,
int , Unicode * ,
int );
248 virtual GBool beginType3Char(GfxState * ,
double ,
double ,
double ,
double , CharCode , Unicode * ,
int );
249 virtual void endType3Char(GfxState * );
250 virtual void type3D0(GfxState * ,
double ,
double );
251 virtual void type3D1(GfxState * ,
double ,
double ,
double ,
double ,
double ,
double );
253 virtual void drawForm(Ref ) { qDebug() <<
"Draw Form"; }
255 virtual void processLink(AnnotLink * ) { qDebug() <<
"Draw Link"; }
262 void getPenState(GfxState *state);
263 QString getColor(GfxColorSpace *color_space, GfxColor *color,
int *shade);
264 QString getAnnotationColor(AnnotColor *color);
265 QString convertPath(GfxPath *path);
266 int getBlendMode(GfxState *state);
268 void pushGroup(QString maskName =
"", GBool forSoftMask = gFalse, GBool alpha = gFalse,
bool inverted =
false);
269 QString UnicodeParsedString(GooString *s1);
272 QString CurrColorFill;
274 QString CurrColorStroke;
276 Qt::PenCapStyle PLineEnd;
277 Qt::PenJoinStyle PLineJoin;
278 QVector<double> DashValues;
282 QStack<FPointArray> m_clipPaths;
285 QList<PageItem*> Items;
292 QStack<groupEntry> m_groupStack;
293 QString m_currentMask;
296 QList<PageItem*> *m_Elements;
297 QStringList *m_importedColors;
303 QStack<F3Entry> m_F3Stack;
309 QStack<mContent> m_mcStack;
314 int updateGUICounter;
318 SplashFontEngine *m_fontEngine;
320 FormPageWidgets *m_formWidgets;
321 QHash<QString, QList<int> > m_radioMap;
322 QHash<int, PageItem*> m_radioButtons;
Definition: slaoutput.h:113
the Document Class
Definition: scribusdoc.h:90
Definition: slaoutput.h:144
Definition: pageitem.h:92
Definition: fpointarray.h:42
Definition: slaoutput.h:78
Definition: slaoutput.h:97
Definition: selection.h:34