aboutsummaryrefslogtreecommitdiff
path: root/print/scribus-devel/files/patch-scribus_plugins_import_pdf_slaoutput.h
blob: fce11994c7e59b1f4c48fa1f391fa7bbafccf6a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
--- scribus/plugins/import/pdf/slaoutput.h.orig	2018-12-11 13:04:07 UTC
+++ scribus/plugins/import/pdf/slaoutput.h
@@ -61,9 +61,9 @@ class LinkSubmitForm: public LinkAction (public)
 	// Destructor.
 	virtual ~LinkSubmitForm();
 	// Was the LinkImportData created successfully?
-	virtual GBool isOk() { return fileName != NULL; }
+	virtual bool isOk() const { return fileName != NULL; }
 	// Accessors.
-	virtual LinkActionKind getKind() { return actionUnknown; }
+	virtual LinkActionKind getKind() const { return actionUnknown; }
 	GooString *getFileName() { return fileName; }
 	int getFlags() { return m_flags; }
 private:
@@ -83,9 +83,9 @@ class LinkImportData: public LinkAction (public)
 	// Destructor.
 	virtual ~LinkImportData();
 	// Was the LinkImportData created successfully?
-	virtual GBool isOk() { return fileName != NULL; }
+	virtual bool isOk() const { return fileName != NULL; }
 	// Accessors.
-	virtual LinkActionKind getKind() { return actionUnknown; }
+	virtual LinkActionKind getKind() const { return actionUnknown; }
 	GooString *getFileName() { return fileName; }
 private:
 	GooString *fileName;		// file name
@@ -98,9 +98,9 @@ class SplashOutFontFileID: public SplashFontFileID
 {
 public:
 
-	SplashOutFontFileID(Ref *rA) { r = *rA; }
+	SplashOutFontFileID(const Ref *rA) { r = *rA; }
 	~SplashOutFontFileID() {}
-	GBool matches(SplashFontFileID *id)
+	bool matches(SplashFontFileID *id)
 	{
 		return ((SplashOutFontFileID *)id)->r.num == r.num && ((SplashOutFontFileID *)id)->r.gen == r.gen;
 	}
@@ -115,18 +115,18 @@ class AnoOutputDev : public OutputDev
 public:
 	AnoOutputDev(ScribusDoc* doc, QStringList *importedColors);
 	virtual ~AnoOutputDev();
-	GBool isOk() { return gTrue; }
-	virtual GBool upsideDown() { return gTrue; }
-	virtual GBool useDrawChar() { return gFalse; }
-	virtual GBool interpretType3Chars() { return gFalse; }
-	virtual GBool useTilingPatternFill() { return gFalse; }
-	virtual GBool useShadedFills(int type) { return gFalse; }
-	virtual GBool useFillColorStop() { return gFalse; }
-	virtual GBool useDrawForm() { return gFalse; }
+	bool isOk() { return true; }
+	virtual bool upsideDown() { return true; }
+	virtual bool useDrawChar() { return false; }
+	virtual bool interpretType3Chars() { return false; }
+	virtual bool useTilingPatternFill() { return false; }
+	virtual bool useShadedFills(int type) { return false; }
+	virtual bool useFillColorStop() { return false; }
+	virtual bool useDrawForm() { return false; }
 	virtual void stroke(GfxState *state);
 	virtual void eoFill(GfxState *state);
 	virtual void fill(GfxState *state);
-	virtual void drawString(GfxState *state, GooString *s);
+	virtual void drawString(GfxState *state, const GooString *s);
 
 	QString CurrColorText;
 	QString CurrColorFill;
@@ -135,7 +135,7 @@ class AnoOutputDev : public OutputDev
 	GooString *m_fontName;
 	GooString *m_itemText;
 private:
-	QString getColor(GfxColorSpace *color_space, GfxColor *color, int *shade);
+	QString getColor(GfxColorSpace *color_space, const GfxColor *color, int *shade);
 	ScribusDoc* m_doc;
 	QStringList *m_importedColors;
 };
@@ -148,7 +148,7 @@ class SlaOutputDev : public OutputDev (public)
 	virtual ~SlaOutputDev();
 	LinkAction* SC_getAction(AnnotWidget *ano);
 	LinkAction* SC_getAdditionalAction(const char *key, AnnotWidget *ano);
-	static GBool annotations_callback(Annot *annota, void *user_data);
+	static bool annotations_callback(Annot *annota, void *user_data);
 	bool handleTextAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
 	bool handleLinkAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
 	bool handleWidgetAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
@@ -156,15 +156,15 @@ class SlaOutputDev : public OutputDev (public)
 	void handleActions(PageItem* ite, AnnotWidget *ano);
 	void startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA);
 
-	GBool isOk() { return gTrue; }
-	virtual GBool upsideDown() { return gTrue; }
-	virtual GBool useDrawChar() { return gTrue; }
-	virtual GBool interpretType3Chars() { return gTrue; }
-	virtual GBool useTilingPatternFill() { return gTrue; }
-	virtual GBool useShadedFills(int type) { return type <= 7; }
-	virtual GBool useFillColorStop() { return gTrue; }
-	virtual GBool useDrawForm() { return gFalse; }
-//	virtual GBool needClipToCropBox() { return gTrue; }
+	bool isOk() { return true; }
+	virtual bool upsideDown() { return true; }
+	virtual bool useDrawChar() { return true; }
+	virtual bool interpretType3Chars() { return true; }
+	virtual bool useTilingPatternFill() { return true; }
+	virtual bool useShadedFills(int type) { return type <= 7; }
+	virtual bool useFillColorStop() { return true; }
+	virtual bool useDrawForm() { return false; }
+//	virtual bool needClipToCropBox() { return true; }
 	virtual void startPage(int pageNum, GfxState *, XRef *);
 	virtual void endPage();
 	// graphics state
@@ -175,30 +175,30 @@ class SlaOutputDev : public OutputDev (public)
 	virtual void stroke(GfxState *state);
 	virtual void fill(GfxState *state);
 	virtual void eoFill(GfxState *state);
-	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);
-	virtual GBool functionShadedFill(GfxState * /*state*/, GfxFunctionShading * /*shading*/) { qDebug() << "Function Shaded Fill";  return gFalse; }
-	virtual GBool axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax);
-	virtual GBool axialShadedSupportExtend(GfxState *state, GfxAxialShading *shading) { return (shading->getExtend0() == shading->getExtend1()); }
-	virtual GBool radialShadedFill(GfxState *state, GfxRadialShading *shading, double sMin, double sMax);
-	virtual GBool radialShadedSupportExtend(GfxState *state, GfxRadialShading *shading) { return (shading->getExtend0() == shading->getExtend1()); }
-	virtual GBool gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading);
-	virtual GBool patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading);
+	bool 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);
+	virtual bool functionShadedFill(GfxState * /*state*/, GfxFunctionShading * /*shading*/) { qDebug() << "Function Shaded Fill";  return false; }
+	virtual bool axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax);
+	virtual bool axialShadedSupportExtend(GfxState *state, GfxAxialShading *shading) { return (shading->getExtend0() == shading->getExtend1()); }
+	virtual bool radialShadedFill(GfxState *state, GfxRadialShading *shading, double sMin, double sMax);
+	virtual bool radialShadedSupportExtend(GfxState *state, GfxRadialShading *shading) { return (shading->getExtend0() == shading->getExtend1()); }
+	virtual bool gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading);
+	virtual bool patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading);
 	//----- path clipping
 	virtual void clip(GfxState *state);
 	virtual void eoClip(GfxState *state);
 	virtual void clipToStrokePath(GfxState * /*state*/) { qDebug() << "Clip to StrokePath"; }
-	virtual GBool deviceHasTextClip(GfxState *state) { return gFalse; }
+	virtual bool deviceHasTextClip(GfxState *state) { return false; }
 
   // If current colorspace is pattern,
   // does this device support text in pattern colorspace?
-	virtual GBool supportTextCSPattern(GfxState *state)
+	virtual bool supportTextCSPattern(GfxState *state)
 	{
 		return state->getFillColorSpace()->getMode() == csPattern;
 	}
 
   // If current colorspace is pattern,
   // need this device special handling for masks in pattern colorspace?
-	virtual GBool fillMaskCSPattern(GfxState * state)
+	virtual bool fillMaskCSPattern(GfxState * state)
 	{
 		return state->getFillColorSpace()->getMode() == csPattern;
 	}
@@ -206,36 +206,36 @@ class SlaOutputDev : public OutputDev (public)
 	virtual void endMaskClip(GfxState *state) { qDebug() << "End Mask Clip"; }
 
   //----- grouping operators
-	virtual void beginMarkedContent(char *name, Dict *properties);
-	virtual void beginMarkedContent(char *name, Object *dictRef);
+	virtual void beginMarkedContent(const char *name, Dict *properties);
+	virtual void beginMarkedContent(const char *name, Object *dictRef);
 	virtual void endMarkedContent(GfxState *state);
-	virtual void markPoint(char *name);
-	virtual void markPoint(char *name, Dict *properties);
+	virtual void markPoint(const char *name);
+	virtual void markPoint(const char *name, Dict *properties);
 	//----- image drawing
-	virtual void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool interpolate, GBool inlineImg);
-	virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg);
+	virtual void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, bool invert, bool interpolate, bool inlineImg);
+	virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, int *maskColors, bool inlineImg);
 	virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
 				   int width, int height,
 				   GfxImageColorMap *colorMap,
-				   GBool interpolate,
+				   bool interpolate,
 				   Stream *maskStr,
 				   int maskWidth, int maskHeight,
 				   GfxImageColorMap *maskColorMap,
-				   GBool maskInterpolate);
+				   bool maskInterpolate);
 
 	virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
 				   int width, int height,
 				   GfxImageColorMap *colorMap,
-				   GBool interpolate,
+				   bool interpolate,
 				   Stream *maskStr,
 				   int maskWidth, int maskHeight,
-				   GBool maskInvert, GBool maskInterpolate); // { qDebug() << "Draw Masked Image"; }
+				   bool maskInvert, bool maskInterpolate); // { qDebug() << "Draw Masked Image"; }
 
 	//----- transparency groups and soft masks
-	virtual void beginTransparencyGroup(GfxState *state, double *bbox, GfxColorSpace * /*blendingColorSpace*/, GBool /*isolated*/, GBool /*knockout*/, GBool /*forSoftMask*/);
+	virtual void beginTransparencyGroup(GfxState *state, double *bbox, GfxColorSpace * /*blendingColorSpace*/, bool /*isolated*/, bool /*knockout*/, bool /*forSoftMask*/);
 	virtual void paintTransparencyGroup(GfxState *state, double *bbox);
 	virtual void endTransparencyGroup(GfxState *state);
-	virtual void setSoftMask(GfxState * /*state*/, double * /*bbox*/, GBool /*alpha*/, Function * /*transferFunc*/, GfxColor * /*backdropColor*/);
+	virtual void setSoftMask(GfxState * /*state*/, const double * /*bbox*/, bool /*alpha*/, Function * /*transferFunc*/, GfxColor * /*backdropColor*/);
 	virtual void clearSoftMask(GfxState * /*state*/);
 
 	virtual void updateFillColor(GfxState *state);
@@ -245,7 +245,7 @@ class SlaOutputDev : public OutputDev (public)
 	virtual void beginTextObject(GfxState *state);
 	virtual void endTextObject(GfxState *state);
 	virtual void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, Unicode * /*u*/, int /*uLen*/);
-	virtual GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, Unicode * /*u*/, int /*uLen*/);
+	virtual bool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, Unicode * /*u*/, int /*uLen*/);
 	virtual void endType3Char(GfxState * /*state*/);
 	virtual void type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/);
 	virtual void type3D1(GfxState * /*state*/, double /*wx*/, double /*wy*/, double /*llx*/, double /*lly*/, double /*urx*/, double /*ury*/);
@@ -260,13 +260,13 @@ class SlaOutputDev : public OutputDev (public)
 
 private:
 	void getPenState(GfxState *state);
-	QString getColor(GfxColorSpace *color_space, GfxColor *color, int *shade);
-	QString getAnnotationColor(AnnotColor *color);
+	QString getColor(GfxColorSpace *color_space, const GfxColor *color, int *shade);
+	QString getAnnotationColor(const AnnotColor *color);
 	QString convertPath(GfxPath *path);
 	int getBlendMode(GfxState *state);
 	void applyMask(PageItem *ite);
-	void pushGroup(QString maskName = "", GBool forSoftMask = gFalse, GBool alpha = gFalse, bool inverted = false);
-	QString UnicodeParsedString(GooString *s1);
+	void pushGroup(QString maskName = "", bool forSoftMask = false, bool alpha = false, bool inverted = false);
+	QString UnicodeParsedString(const GooString *s1);
 	bool checkClip();
 	bool pathIsClosed;
 	QString CurrColorFill;
@@ -283,9 +283,9 @@ class SlaOutputDev : public OutputDev (public)
 	struct groupEntry
 	{
 		QList<PageItem*> Items;
-		GBool forSoftMask;
-		GBool isolated;
-		GBool alpha;
+		bool forSoftMask;
+		bool isolated;
+		bool alpha;
 		QString maskName;
 		bool inverted;
 	};