~ubuntu-branches/ubuntu/maverick/scribus-ng/maverick-backports

« back to all changes in this revision

Viewing changes to scribus/scribusstructs.h

  • Committer: Bazaar Package Importer
  • Author(s): Oleksandr Moskalenko
  • Date: 2007-08-11 17:41:51 UTC
  • mfrom: (0.1.1 upstream) (4.1.2 feisty)
  • Revision ID: james.westby@ubuntu.com-20070811174151-tmkgjvjuc0mtk8ul
Tags: 1.3.4.dfsg+svn20071115-1
* Upstream svn update (Closes: #447480, #448949).
* debian/NEWS: Added a note for users wanting stable Scribus to switch to
  the "scribus" package (Closes: #427638).
* debian/watch: Updated the watch regex to properly track sourceforge
  releases for this branch (Closes: #449700).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <qkeysequence.h>
20
20
#include <vector>
21
21
 
 
22
#include "scribusapi.h"
22
23
#include "sctextstruct.h"
23
24
#include "scfonts.h"
24
25
#include "fpointarray.h"
26
27
#include "annotation.h"
27
28
#include "pageitem.h"
28
29
 
 
30
extern bool SCRIBUS_API compareDouble(double, double);
 
31
 
 
32
typedef struct
 
33
{
 
34
        int r;
 
35
        int g;
 
36
        int b;
 
37
        void getValues(int& vr, int& vg, int& vb) {vr = r; vg = g; vb = b;}
 
38
} RGBColor;
 
39
 
 
40
typedef struct
 
41
{
 
42
        int c;
 
43
        int m;
 
44
        int y;
 
45
        int k;
 
46
        void getValues(int& vc, int& vm, int& vy, int& vk) {vc = c; vm = m; vy = y; vk = k;}
 
47
} CMYKColor;
 
48
 
29
49
struct CopyPasteBuffer
30
50
{
31
51
        PageItem::ItemType PType;
48
68
        int GrShade2;
49
69
        VGradient fill_gradient;
50
70
        int GrType;
 
71
        QString pattern;
 
72
        double patternScaleX;
 
73
        double patternScaleY;
 
74
        double patternOffsetX;
 
75
        double patternOffsetY;
 
76
        double patternRotation;
51
77
        double GrStartX;
52
78
        double GrStartY;
53
79
        double GrEndX;
103
129
        FPointArray ContourLine;
104
130
        bool PoShow;
105
131
        double BaseOffs;
106
 
        bool Textflow;
107
 
        bool Textflow2;
108
 
        bool UseContour;
 
132
        int textPathType;
 
133
        bool textPathFlipped;
 
134
        int TextflowMode;
109
135
        int textAlignment;
110
136
        QString IFont;
111
137
        int ISize;
117
143
        bool LockRes;
118
144
        double Transparency;
119
145
        double TranspStroke;
 
146
        int TransBlend;
 
147
        int TransBlendS;
120
148
        bool Reverse;
121
149
        QString NamedLStyle;
122
150
        QString Language;
123
151
        QString guiLanguage;
124
152
        int Cols;
125
153
        double ColGap;
126
 
        QValueList<PageItem::TabRecord> TabValues;
 
154
        QValueList<ParagraphStyle::TabRecord> TabValues;
127
155
        QValueList<double> DashValues;
128
156
        double DashOffset;
129
157
        bool isTableItem;
155
183
        int renderingIntent;
156
184
};
157
185
 
158
 
/** Pagemargins */
159
 
struct MarginStruct
160
 
{
161
 
        MarginStruct() : Top(0), Left(0), Bottom(0), Right(0) {}
162
 
        MarginStruct(double top, double left, double bottom, double right) :
163
 
                Top(top), Left(left), Bottom(bottom), Right(right) {}
164
 
        double Top;
165
 
        double Left;
166
 
        double Bottom;
167
 
        double Right;
 
186
/** \brief Pagemargins and bleeds*/
 
187
class MarginStruct
 
188
{
 
189
        public:
 
190
                MarginStruct() : Top(0), Left(0), Bottom(0), Right(0) {}
 
191
                MarginStruct(double top, double left, double bottom, double right) :
 
192
                        Top(top), Left(left), Bottom(bottom), Right(right) {}
 
193
                MarginStruct(const MarginStruct& rhs) {Top=rhs.Top;Bottom=rhs.Bottom;Left=rhs.Left;Right=rhs.Right;}
 
194
                double Top;
 
195
                double Left;
 
196
                double Bottom;
 
197
                double Right;
 
198
};
 
199
 
 
200
struct DocPagesSetup
 
201
{
 
202
        DocPagesSetup() : pageArrangement(0), firstPageLocation(0), firstPageNumber(0), orientation(0), autoTextFrames(false), columnDistance(0), columnCount(1) {}
 
203
        DocPagesSetup(int pa, int fpl, int fpn, int o, bool atf, double cd, double cc) :
 
204
                pageArrangement(pa), firstPageLocation(fpl), firstPageNumber(fpn), orientation(o), autoTextFrames(atf),
 
205
                columnDistance(cd), columnCount(cc) {}
 
206
        int pageArrangement;
 
207
        int firstPageLocation;
 
208
        int firstPageNumber;
 
209
        int orientation;
 
210
        bool autoTextFrames;
 
211
        double columnDistance;
 
212
        double columnCount;
168
213
};
169
214
 
170
215
struct PageSet
179
224
        QStringList pageNames;
180
225
};
181
226
 
182
 
struct ParagraphStyle
183
 
{
184
 
        QString Vname;
185
 
        int LineSpaMode;      // 0 = fixed; 1 = Automatic; 2 = Adjust to Baseline Grid
186
 
        double LineSpa;
187
 
        int textAlignment;
188
 
        double Indent;
189
 
        double First;
190
 
        double gapBefore;
191
 
        double gapAfter;
192
 
        QString Font;
193
 
        int FontSize;
194
 
        QValueList<PageItem::TabRecord> TabValues;
195
 
        bool Drop;
196
 
        int DropLin;
197
 
        double DropDist;
198
 
        int FontEffect;
199
 
        QString FColor;
200
 
        int FShade;
201
 
        QString SColor;
202
 
        int SShade;
203
 
        bool BaseAdj;
204
 
        int txtShadowX;
205
 
        int txtShadowY;
206
 
        int txtOutline;
207
 
        int txtUnderPos;
208
 
        int txtUnderWidth;
209
 
        int txtStrikePos;
210
 
        int txtStrikeWidth;
211
 
        int scaleH;
212
 
        int scaleV;
213
 
        int baseOff;
214
 
        int kernVal;
215
 
};
216
 
 
217
227
struct CMSData
218
228
{
219
229
        QString DefaultMonitorProfile;
220
230
        QString DefaultPrinterProfile;
221
231
        QString DefaultImageRGBProfile;
222
232
        QString DefaultImageCMYKProfile;
223
 
        QString DefaultSolidColorProfile;
 
233
        QString DefaultSolidColorRGBProfile;
 
234
        QString DefaultSolidColorCMYKProfile;
224
235
        int ComponentsInput2;
 
236
        int ComponentsInput3;
225
237
        int ComponentsPrinter;
226
 
        int DefaultIntentMonitor;
227
238
        int DefaultIntentImages;
228
 
        int DefaultIntentPrinter;
 
239
        int DefaultIntentColors;
229
240
        bool CMSinUse;
230
241
        bool SoftProofOn;
 
242
        bool SoftProofFullOn;
231
243
        bool GamutCheck;
232
244
        bool BlackPoint;
233
245
} ;
240
252
        int LineJoin;
241
253
        QString Color;
242
254
        int Shade;
 
255
        // setter necessary for use with serializer/digester
 
256
        void setLineWidth(double value) { Width = value; }
 
257
        void setDash(int value)         { Dash = value; }
 
258
        void setLineEnd(int value)      { LineEnd = value; }
 
259
        void setLineJoin(int value)     { LineJoin = value; }
 
260
        void setColor(const QString& name) { Color = name; }
 
261
        void setShade(int value)        { Shade = value; }
 
262
        bool operator==(const SingleLine& other) const
 
263
        {
 
264
                if (!compareDouble(Width, other.Width) )
 
265
                        return false;
 
266
                if ((Dash != other.Dash)  || (LineEnd != other.LineEnd) || (LineJoin != other.LineJoin) ||
 
267
                        (Color != other.Color)|| (Shade != other.Shade))
 
268
                        return false;
 
269
                return true;
 
270
        }
 
271
        bool operator!=(const SingleLine& other) const
 
272
        {
 
273
                return !(*this == other);
 
274
        }
243
275
};
244
276
 
245
277
struct ArrowDesc
253
285
{
254
286
        int LNr;
255
287
        int Level;
256
 
        QString Name;
 
288
        int blendMode;
257
289
        bool isPrintable;
258
290
        bool isViewable;
259
291
        bool isEditable;
 
292
        bool flowControl;
 
293
        bool outlineMode;
 
294
        double transparency;
 
295
        QColor markerColor;
 
296
        QString Name;
260
297
};
261
298
 
262
299
struct PDFPresentationData
282
319
        QString cleanMenuText;
283
320
        QKeySequence keySequence;
284
321
        int tableRow;
 
322
        QString menuName;
 
323
        int menuPos;
285
324
};
286
325
 
287
326
struct PrintOptions
288
327
{
289
 
        QString printer;
290
 
        QString filename;
 
328
        bool firstUse;
291
329
        bool toFile;
292
330
        bool useAltPrintCommand;
293
 
        QString printerCommand;
294
 
        int PSLevel;
295
331
        bool outputSeparations;
296
 
        QString separationName;
297
 
        QStringList allSeparations;
298
332
        bool useSpotColors;
299
333
        bool useColor;
300
334
        bool mirrorH;
303
337
        bool doGCR;
304
338
        bool doClip;
305
339
        bool setDevParam;
 
340
        bool doOverprint;
 
341
        bool cropMarks;
 
342
        bool bleedMarks;
 
343
        bool registrationMarks;
 
344
        bool colorMarks;
306
345
        int copies;
 
346
        int PSLevel;
 
347
        double markOffset;
 
348
        MarginStruct bleeds;
307
349
        std::vector<int> pageNumbers;
308
350
        QString printerOptions;
 
351
        QString printer;
 
352
        QString filename;
 
353
        QString separationName;
 
354
        QStringList allSeparations;
 
355
        QString printerCommand;
309
356
};
310
357
 
311
358
typedef QMap<QString,QString> ProfilesL;
312
 
typedef QValueVector<SingleLine> multiLine;
 
359
// typedef QValueVector<SingleLine> multiLine;
313
360
 
 
361
class multiLine : public QValueVector<SingleLine> {
 
362
public:
 
363
        QString shortcut;
 
364
        bool operator!=(const multiLine& other) const
 
365
        {
 
366
                return !(this->operator ==(other));
 
367
        }
 
368
};
314
369
 
315
370
typedef enum {
316
371
        MissingGlyph=1,
320
375
        ImageDPITooLow=5,
321
376
        Transparency=6,
322
377
        PDFAnnotField=7,
323
 
        PlacedPDF=8
 
378
        PlacedPDF=8,
 
379
        ImageDPITooHigh=9,
 
380
        ImageIsGIF=10,
 
381
        BlendMode=11,
 
382
        WrongFontInAnnotation=12
324
383
} PreflightError;
325
384
 
326
385
typedef QMap<PreflightError, int> errorCodes;
369
428
        QPtrList<PageItem> Objects;
370
429
};
371
430
 
372
 
/*! Human readable orientations */
 
431
/*! \brief Human readable orientations */
373
432
enum PageOrientation
374
433
{
375
434
        portraitPage = 0,
377
436
        customPage = 30
378
437
};
379
438
 
 
439
//! \brief Common type for guides list
 
440
typedef QValueList<double> Guides;
 
441
 
 
442
//! \brief from ols scribusXml
 
443
struct Linked 
 
444
 
445
        int Start;
 
446
        int StPag;
 
447
};
 
448
 
 
449
// this is a quick hack to combine runs until I've thought of something better -- AV
 
450
class LastStyles {
 
451
public:
 
452
        CharStyle Style;
 
453
        int StyleStart;
 
454
        QString ParaStyle;
 
455
        LastStyles() {
 
456
                StyleStart = 0;
 
457
                ParaStyle = "";
 
458
        }
 
459
};
 
460
 
380
461
#endif