00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #ifndef CMXIBITS_H
00101 #define CMXIBITS_H
00102
00103
00104
00105 #include "colourix.h"
00106
00107
00108 #include "cmxistut.h"
00109
00110
00111 class Node;
00112 class Layer;
00113 class CMXImportFilter;
00114 class CMXImportFilterDataSet;
00115 class DocColour;
00116
00117
00118 class CMXImportLayer : public ListItem
00119 {
00120 CC_DECLARE_DYNAMIC(CMXImportLayer);
00121
00122 public:
00123 CMXImportLayer();
00124 ~CMXImportLayer();
00125
00126
00127 Node *GetSubTree(void) {return pSubTree;};
00128 void UseSubTree(void) {Used = TRUE;};
00129 Node *GetLastAdded(void) {return pLastNodeAdded;};
00130 void SetName(StringBase *pString) {LayerName = *pString;};
00131
00132
00133 BOOL AddNode(Node *pNode);
00134 BOOL StartGroup(void);
00135 BOOL EndGroup(void);
00136
00137
00138 Layer *UseSubTreeAsLayer(void);
00139
00140 private:
00141 Node *pSubTree;
00142 Node *pLastNodeAdded;
00143 String_256 LayerName;
00144 BOOL Used;
00145 Node *pGroup;
00146 INT32 GroupLevel;
00147 };
00148
00149 #define cmxiSTACKTYPE_NOTHING 0
00150 #define cmxiSTACKTYPE_TRANSFORM 1
00151 #define cmxiSTACKTYPE_CLIPPER 2
00152
00153 class CMXImportStack;
00154
00155
00156 class CMXImportStackableItem : public ListItem
00157 {
00158 CC_DECLARE_DYNAMIC(CMXImportStackableItem);
00159
00160 public:
00161 virtual INT32 GetStackType(void) = 0;
00162
00163
00164 virtual BOOL PlacedOnStack(CMXImportStack *pStack) {return TRUE;};
00165
00166 virtual BOOL Activate(CMXImportStack *) = 0;
00167
00168
00169
00170 virtual BOOL Deactivate(CMXImportStack *, BOOL IsLastItemOnStack) = 0;
00171
00172 virtual BOOL RemovedFromStack(CMXImportStack *pStack) {return TRUE;};
00173 };
00174
00175
00176 class CMXImportStack : public List
00177 {
00178 CC_DECLARE_DYNAMIC(CMXImportStack);
00179
00180 public:
00181 CMXImportStack(INT32 St, CMXImportFilter *pFil) {StackType = St; pTheFilter = pFil;};
00182 ~CMXImportStack();
00183
00184 CMXImportFilter *GetFilter(void) {return pTheFilter;};
00185
00186 BOOL Push(CMXImportStackableItem *pItem);
00187 CMXImportStackableItem *Pop(void);
00188
00189 private:
00190 INT32 StackType;
00191 CMXImportFilter *pTheFilter;
00192 };
00193
00194
00195 class CMXImportTransform : public CMXImportStackableItem
00196 {
00197 CC_DECLARE_DYNAMIC(CMXImportTransform);
00198
00199 public:
00200 CMXImportTransform(Matrix *pTheMatrix, BOOL Concat) {TheMatrix = *pTheMatrix; Concatenate = Concat;};
00201
00202 INT32 GetStackType(void) {return cmxiSTACKTYPE_TRANSFORM;};
00203
00204 BOOL PlacedOnStack(CMXImportStack *pStack);
00205 BOOL Activate(CMXImportStack *pStack);
00206 BOOL Deactivate(CMXImportStack *pStack, BOOL IsLastItemOnStack);
00207
00208 private:
00209 Matrix TheMatrix;
00210 Matrix CompoundMatrix;
00211 BOOL Concatenate;
00212 };
00213
00214
00215 class CMXImportClipper : public CMXImportStackableItem
00216 {
00217 CC_DECLARE_DYNAMIC(CMXImportClipper);
00218
00219 public:
00220 CMXImportClipper(Path *ptClipPath, BOOL tIntersect) {pClipPath = ptClipPath; Intersect = tIntersect;};
00221
00222 INT32 GetStackType(void) {return cmxiSTACKTYPE_CLIPPER;};
00223
00224 BOOL PlacedOnStack(CMXImportStack *pStack);
00225 BOOL Activate(CMXImportStack *pStack);
00226 BOOL Deactivate(CMXImportStack *pStack, BOOL IsLastItemOnStack);
00227
00228 private:
00229 Path *pClipPath;
00230 BOOL Intersect;
00231 };
00232
00233
00234 class CMXImportColour : public SimpleCCObject
00235 {
00236 public:
00237 CMXImportColour() {Used = FALSE; pIndexedColour = NULL; pColour = NULL;};
00238 ~CMXImportColour() {delete pColour; if(!Used) delete pIndexedColour;};
00239
00240 DocColour *GetColour(void) {Used = TRUE; return pColour;};
00241 BOOL IsUsed(void) {return Used;};
00242 IndexedColour *GetIndexedColour(void) {return pIndexedColour;};
00243
00244
00245
00246
00247
00248
00249 BOOL Convert( void *pCol);
00250
00251 private:
00252 BOOL Used;
00253 IndexedColour *pIndexedColour;
00254 DocColour *pColour;
00255 };
00256
00257
00258 class CMXImportDotDash : public SimpleCCObject
00259 {
00260 public:
00261 CMXImportDotDash() {pElements = NULL;};
00262 ~CMXImportDotDash() {if(pElements != NULL) delete [] pElements;};
00263
00264
00265 BOOL Convert( void *pDotDash);
00266
00267 INT32 NDots;
00268 DashElement *pElements;
00269 };
00270
00271
00272 class CMXImportArrowShape : public SimpleCCObject
00273 {
00274 public:
00275
00276 BOOL Convert( void *pArrowShape, BOOL Is32Bit);
00277
00278 ArrowRec Arrow;
00279 INT32 LineOffset;
00280 };
00281
00282
00283 class CMXImportArrowheads : public SimpleCCObject
00284 {
00285 public:
00286 CMXImportArrowheads() {pStart = NULL; pEnd = NULL;};
00287
00288
00289 BOOL Convert( void *pArrowheads, CMXImportFilterDataSet *Data);
00290
00291 CMXImportArrowShape *pStart;
00292 CMXImportArrowShape *pEnd;
00293 };
00294
00295
00296 class CMXImportOutline : public SimpleCCObject
00297 {
00298 public:
00299 CMXImportOutline() {pDots = NULL; pArrowheads = NULL;};
00300
00301
00302 BOOL Convert( void *pOut, CMXImportFilterDataSet *Data);
00303
00304 INT32 ColourReference;
00305 INT32 Width;
00306 JointType Join;
00307 LineCapType Cap;
00308 CMXImportDotDash *pDots;
00309 CMXImportArrowheads *pArrowheads;
00310 BOOL NoStroke;
00311 };
00312
00313
00314 class CMXImportPen : public SimpleCCObject
00315 {
00316 public:
00317
00318 BOOL Convert( void *pPen);
00319
00320 INT32 Width;
00321 };
00322
00323 class CMXImportFont : public SimpleCCObject
00324 {
00325 public:
00326 BOOL Convert( void *pFont);
00327 StringBase* mFont;
00328 BOOL mIsItalic;
00329 BOOL mIsBold;
00330 };
00331
00332
00333
00334 class CMXImportLineStyle : public SimpleCCObject
00335 {
00336 public:
00337
00338 BOOL Convert( void *pStyle);
00339
00340 JointType Join;
00341 LineCapType Cap;
00342 BOOL DotDash;
00343 BOOL NoStroke;
00344 };
00345
00346
00347 class CMXImportColourList : public List
00348 {
00349 CC_DECLARE_DYNAMIC(CMXImportColourList);
00350
00351 public:
00352 CMXImportColourList() {};
00353 ~CMXImportColourList() {DeleteAll();};
00354
00355 BOOL AddColour(INT32 Reference, INT32 Position);
00356 INT32 GetColourRefClosestToPosition(INT32 Position);
00357 };
00358
00359
00360 class CMXImportColourListItem : public ListItem
00361 {
00362 CC_DECLARE_DYNAMIC(CMXImportColourListItem);
00363
00364 public:
00365 INT32 Reference;
00366 INT32 Position;
00367 };
00368
00369 class CMXImportProcedure : public SimpleCCObject
00370 {
00371 public:
00372 CMXImportProcedure() {Position = 0;};
00373
00374 BOOL Read( void *pEn);
00375
00376 INT32 Position;
00377 };
00378
00379
00380 #endif // CMXIBITS_H
00381