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
00101
00102
00103
00104 #ifndef INC_CDRFILTER
00105 #define INC_CDRFILTER
00106
00107
00108 #include "colcomp.h"
00109 #include "impcol.h"
00110 #include "rifffile.h"
00111
00112 #include "cdrform.h"
00113
00114 #include "cdrbitm.h"
00115
00116
00117 class TextStory;
00118
00119 typedef enum {
00120 CDRVERSION_NULL = 0,
00121 CDRVERSION_3 = 3,
00122 CDRVERSION_4 = 4,
00123 CDRVERSION_5 = 5,
00124 CDRVERSION_6 = 6
00125 } CDRVersion;
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137 class CDRAttributeStore : public List
00138 {
00139 CC_DECLARE_MEMDUMP(CDRAttributeStore);
00140
00141 public:
00142 virtual BOOL AddChunkToStore(RIFFFile *RIFF);
00143
00144
00145 ADDR Find(DWORD reference, INT32 *Size);
00146 ADDR Find(WORD reference, INT32 *Size);
00147
00148 private:
00149 };
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 class CDRAttributeStoredItem : public ListItem
00163 {
00164 friend class CDRAttributeStore;
00165 friend class CDRArrowheadStore;
00166 friend class CDRArrowheadStoredItem;
00167 friend class CDRFontnameStore;
00168
00169 CC_DECLARE_MEMDUMP(CDRAttributeStoredItem);
00170
00171 public:
00172 CDRAttributeStoredItem(void);
00173 ~CDRAttributeStoredItem();
00174
00175 BOOL Aquire(RIFFFile *RIFF);
00176
00177 protected:
00178 INT32 Size;
00179 ADDR Block;
00180 };
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193 class CDRFontnameStore : public CDRAttributeStore
00194 {
00195 CC_DECLARE_MEMDUMP(CDRFontnameStore);
00196
00197 public:
00198 virtual BOOL AddChunkToStore(RIFFFile *RIFF, CDRVersion Version);
00199 virtual BOOL AddFontToStore(DWORD Reference, TCHAR *Fontname);
00200 virtual WORD GetHandleForReference(DWORD Reference);
00201
00202 private:
00203 };
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216 class CDRFontnameStoredItem : public CDRAttributeStoredItem
00217 {
00218 friend class CDRAttributeStore;
00219 friend class CDRFontnameStore;
00220
00221 CC_DECLARE_MEMDUMP(CDRFontnameStoredItem);
00222
00223 BOOL GetTypefaceForUse(DWORD Reference, TCHAR *FontName);
00224
00225 public:
00226 DWORD Reference;
00227 WORD hTypeface;
00228
00229 private:
00230 };
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243 class CDRArrowheadStore : public CDRAttributeStore
00244 {
00245 CC_DECLARE_MEMDUMP(CDRArrowheadStore);
00246
00247 public:
00248 BOOL AddChunkToStore(RIFFFile *RIFF);
00249
00250 NodeRenderableBounded *GetConvertedNode(DWORD Reference, INT32 *Distance, BOOL *NotPresent);
00251
00252 private:
00253 };
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266 class CDRArrowheadStoredItem : public CDRAttributeStoredItem
00267 {
00268 friend class CDRAttributeStore;
00269 friend class CDRArrowheadStore;
00270
00271 CC_DECLARE_MEMDUMP(CDRArrowheadStoredItem);
00272
00273 public:
00274 CDRArrowheadStoredItem(void);
00275 ~CDRArrowheadStoredItem();
00276
00277 private:
00278 NodeRenderableBounded *pNode;
00279 };
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292 class CDRVectorStoredItem : public ListItem
00293 {
00294 friend class CDRFilter;
00295 friend class CDRVectorStore;
00296 CC_DECLARE_MEMDUMP(CDRVectorStoredItem);
00297
00298 public:
00299 CDRVectorStoredItem();
00300 ~CDRVectorStoredItem();
00301 KernelBitmap *GetBitmap(Document *pDocument);
00302
00303 private:
00304 Node *Objects;
00305 DWORD Reference;
00306 DocRect BBox;
00307 KernelBitmap *pBitmap;
00308 };
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321 class CDRVectorStore : public List
00322 {
00323 friend class CDRFilter;
00324 CC_DECLARE_MEMDUMP(CDRVectorStore);
00325
00326 public:
00327 Node *Find(DWORD Reference, DocRect *BBox);
00328 CDRVectorStoredItem *Find(DWORD Reference);
00329 };
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342 class CDRBitmapStore : public CDRAttributeStore
00343 {
00344 CC_DECLARE_MEMDUMP(CDRBitmapStore);
00345
00346 public:
00347 BOOL AddChunkToStore(RIFFFile *RIFF, BOOL Pattern, CDRFilter *C);
00348
00349 KernelBitmap *FindBitmap(DWORD Reference);
00350 private:
00351 };
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364 class CDRBitmapStoredItem : public CDRAttributeStoredItem
00365 {
00366 friend class CDRAttributeStore;
00367 friend class CDRBitmapStore;
00368
00369 CC_DECLARE_MEMDUMP(CDRBitmapStoredItem);
00370
00371 public:
00372 CDRBitmapStoredItem();
00373 ~CDRBitmapStoredItem();
00374
00375 private:
00376 KernelBitmap *pBitmap;
00377 FOURCC Reference;
00378 BOOL Used;
00379 };
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392 class CDRLayerList : public List
00393 {
00394 CC_DECLARE_MEMDUMP(CDRLayerList);
00395
00396 public:
00397 CDRLayerList();
00398 ~CDRLayerList();
00399
00400 private:
00401 };
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414 class CDRLayerListItem : public ListItem
00415 {
00416 friend CDRLayerList;
00417 friend class CDRFilter;
00418
00419 CC_DECLARE_MEMDUMP(CDRLayerListItem);
00420
00421 public:
00422 CDRLayerListItem();
00423 ~CDRLayerListItem();
00424
00425 private:
00426 String_256 Name;
00427
00428 Node *Objects;
00429
00430 BOOL LayerInDocument;
00431
00432
00433
00434 BOOL IsVisible;
00435 BOOL IsLocked;
00436 };
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449 class CDRPageList : public List
00450 {
00451 CC_DECLARE_MEMDUMP(CDRPageList);
00452
00453 public:
00454 CDRPageList();
00455 ~CDRPageList();
00456
00457 private:
00458 };
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471 class CDRPageListItem : public ListItem
00472 {
00473 friend CDRPageList;
00474
00475 CC_DECLARE_MEMDUMP(CDRPageListItem);
00476
00477 public:
00478 CDRPageListItem();
00479 ~CDRPageListItem();
00480
00481 CDRLayerList Layers;
00482
00483 private:
00484 };
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498 class CDRActionList : public List
00499 {
00500 CC_DECLARE_MEMDUMP(CDRActionList);
00501
00502 public:
00503
00504 private:
00505 };
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519 class CDRActionListItem : public ListItem
00520 {
00521 friend CDRActionList;
00522
00523 CC_DECLARE_DYNAMIC(CDRActionListItem);
00524
00525 public:
00526 CDRActionListItem() {Level = 0;};
00527
00528 UINT32 GetLevel() {return Level;}
00529 void SetLevel(UINT32 Lev) {Level = Lev;}
00530
00531
00532 virtual BOOL DoAction(CDRFilter *C) = 0;
00533
00534 virtual void ImportFailure(CDRFilter *C) = 0;
00535
00536 private:
00537 UINT32 Level;
00538 };
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551 class CDRActionTransform : public CDRActionListItem
00552 {
00553 friend CDRActionList;
00554 friend CDRFilter;
00555
00556 CC_DECLARE_DYNAMIC(CDRActionTransform);
00557
00558 public:
00559 CDRActionTransform() {Chunk = 0; LinkTrans = FALSE; IsAGroupTransform = FALSE;};
00560 ~CDRActionTransform();
00561
00562 BOOL Init(RIFFFile *RIFF, CDRVersion Version);
00563
00564 BOOL DoAction(CDRFilter *C);
00565 void ImportFailure(CDRFilter *C);
00566
00567 void SetIsAGroupTransform(BOOL IsOne) {IsAGroupTransform = IsOne;};
00568
00569 public:
00570 ADDR Chunk;
00571 INT32 ChunkSize;
00572 BOOL LinkTrans;
00573 private:
00574 BOOL IsAGroupTransform;
00575 };
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588 class CDRActionGroupEnd : public CDRActionListItem
00589 {
00590 friend CDRActionList;
00591 friend CDRFilter;
00592
00593 CC_DECLARE_DYNAMIC(CDRActionGroupEnd);
00594
00595 public:
00596 CDRActionGroupEnd() {pOldLevelNodeList = 0;};
00597
00598 BOOL DoAction(CDRFilter *C);
00599 void ImportFailure(CDRFilter *C);
00600
00601 private:
00602 NodeRenderable *pOldLevelNodeList;
00603 };
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615 class CDRBBoxList : public List
00616 {
00617 public:
00618 CDRBBoxList();
00619 ~CDRBBoxList();
00620
00621 BOOL Add(Node *N, DocRect *BBox, Justification Just);
00622 BOOL Find(Node *N, DocRect *BBox);
00623 DocRect *Find(Node *N);
00624 };
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637 class CDRBBoxListItem : public ListItem
00638 {
00639 friend CDRBBoxList;
00640
00641 public:
00642 CDRBBoxListItem();
00643 ~CDRBBoxListItem();
00644
00645 private:
00646 Node *pNode;
00647 DocRect BBox;
00648 };
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661 class CDRTextOnPathLink : public ListItem
00662 {
00663 CC_DECLARE_MEMDUMP(CDRTextOnPathLink);
00664
00665 public:
00666 CDRTextOnPathLink();
00667 ~CDRTextOnPathLink();
00668
00669 public:
00670 INT32 PathSerialNumber;
00671 NodePath *pPath;
00672 INT32 TextSerialNumber;
00673 TextStory *pTextStory;
00674 Justification Justi;
00675 INT32 Position;
00676 };
00677
00678
00679
00680
00681
00682
00683
00684 typedef struct {
00685 INT32 Angle;
00686 INT32 Pad;
00687 INT32 HorizontalCentreOffset;
00688 INT32 VerticalCentreOffset;
00689 } CDRFillInfo;
00690
00691 typedef struct
00692 {
00693 INT32 SizeX;
00694 INT32 SizeY;
00695 INT32 OffsetX;
00696 INT32 OffsetY;
00697 DWORD Reference;
00698 } CDRTiledFillInfo;
00699
00700 #define CDRSCRIPT_NONE 0
00701 #define CDRSCRIPT_SUB 1
00702 #define CDRSCRIPT_SUPER 2
00703
00704 typedef struct
00705 {
00706
00707 DWORD FontReference;
00708 MILLIPOINT FontSize;
00709 BOOL Bold;
00710 BOOL Italic;
00711 BOOL Underline;
00712 UINT32 Script;
00713 MILLIPOINT LineSpace;
00714 INT32 ParaLineSpacePercent;
00715 Justification Just;
00716 } CDRTextStyle;
00717
00718 typedef struct {
00719 DocRect OriginalBBox;
00720 DocCoord NewCorners[4];
00721 } cdrPerspective;
00722
00723 typedef struct {
00724 FLOAT8 a, b, c, d, e, f;
00725 } cdrMatrix;
00726
00727
00728
00729
00730 typedef struct {
00731 FLOAT8 cf11;
00732 FLOAT8 cf21;
00733 FLOAT8 cf31;
00734 FLOAT8 cf41;
00735 FLOAT8 cf12;
00736 FLOAT8 cf22;
00737 FLOAT8 cf32;
00738 FLOAT8 cf42;
00739 FLOAT8 cf13;
00740 FLOAT8 cf23;
00741 FLOAT8 cf33;
00742 FLOAT8 cf43;
00743 } cdr3DMatrix;
00744
00745 typedef struct {
00746 FLOAT8 x,y,z;
00747 } cdr3DCoord;
00748
00749 typedef struct {
00750 cdr3DMatrix Trans;
00751 cdr3DCoord Camera;
00752 } cdrExtrudeInfo;
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764 class CDRFilter : public VectorFilter
00765 {
00766 friend CDRActionTransform;
00767 friend CDRActionGroupEnd;
00768 friend CDRBitmapStore;
00769 friend CDRBitmap;
00770
00771 CC_DECLARE_DYNAMIC(CDRFilter);
00772
00773 public:
00774 CDRFilter();
00775 BOOL Init();
00776
00777 INT32 HowCompatible(PathName& Filename,
00778 ADDR HeaderStart,
00779 UINT32 HeaderSize,
00780 UINT32 FileSize);
00781
00782 BOOL DoImport(SelOperation*, CCLexFile*, Document*,
00783 BOOL AutoChosen = FALSE, ImportPosition *Pos = NULL,
00784 KernelBitmap** ppImportedBitmap = NULL,
00785 DocCoord* pPosTranslate = NULL, String_256* = NULL);
00786
00787 BOOL DoExport(Operation*, CCLexFile*, PathName*, Document*, BOOL);
00788
00789 public:
00790 static INT32 BitmapNumber;
00791 static INT32 PatternNumber;
00792 static void DeleteNodeList(Node *);
00793 static BOOL GetCorelBBox(NodeRenderableBounded *pNode, DocRect *BBox);
00794 static ADDR FindDataInObject(cdrfOffsetHeader *Header, WORD Type);
00795 static BOOL AddElementsToPath(Path *pPath, INT32 NCoords, cdrfCoord *Coords, BYTE *Types, BOOL *IsClosed);
00796
00797 private:
00798 class Document *pDocument;
00799 class Spread *pSpread;
00800 class Page *pPage;
00801
00802 CDRVersion Version;
00803 BOOL Success;
00804
00805 RIFFFile *RIFF;
00806 UndoableOperation *ThisOp;
00807
00808 BOOL SlowJobStarted;
00809 UINT32 ProgressCount;
00810
00811 BOOL InMasterPage;
00812 BOOL DoneMasterPage;
00813
00814 BOOL DoneDoc;
00815
00816 BOOL UseLayers;
00817
00818 CDRAttributeStore Fills;
00819 CDRAttributeStore Outlines;
00820 CDRAttributeStore Styles;
00821 CDRFontnameStore Fonts;
00822 CDRArrowheadStore Arrowheads;
00823
00824 CDRBitmapStore Patterns;
00825 CDRBitmapStore Bitmaps;
00826 CDRVectorStore Vectors;
00827
00828 CDRVectorStore TextV4;
00829
00830 CDRPageList Pages;
00831 CDRPageListItem *ThisPage;
00832 CDRLayerListItem *ThisLayer;
00833
00834 CDRActionList Actions;
00835
00836 CDRBBoxList TextBBoxes;
00837
00838 INT32 PageX;
00839 INT32 PageY;
00840 BOOL Landscape;
00841
00842 DocCoord Origin;
00843
00844 INT32 TranslateByX;
00845 INT32 TranslateByY;
00846
00847 INT32 ObjectsConverted;
00848 INT32 ObjectsFormatWrong;
00849 INT32 ObjectsUnknown;
00850 INT32 EnvelopesApproximated;
00851
00852 BOOL FormatError;
00853
00854 NodeRenderable *pLevelNodeList;
00855 NodeRenderable *pMadeNode;
00856
00857 INT32 SerialNumber;
00858
00859 BOOL ObjFilled;
00860 BOOL ObjStroked;
00861
00862 BOOL IsText;
00863 BOOL IsTextStory;
00864
00865 BOOL AttrsAlreadyApplied;
00866
00867 ADDR ObjDataBlock;
00868 INT32 ObjDataBlockSize;
00869
00870 ColourList *ColList;
00871
00872 ADDR TransformChunk;
00873 INT32 TransformChunkSize;
00874
00875 ADDR FontTableV3;
00876 INT32 FontTableEntriesV3;
00877 ADDR FontStylesV3;
00878
00879 ADDR LinkTable;
00880
00881 BOOL LinkTransformsExist;
00882
00883 List TextOnPathLinks;
00884 BOOL IsTextOnAPath;
00885
00886 private:
00887 BOOL ClearUp(void);
00888 BOOL UpdateProgress(BOOL Now = FALSE);
00889
00890
00891 BOOL ProcessDoc(void);
00892 BOOL ProcessPage(void);
00893 BOOL ProcessLayer(void);
00894 BOOL ProcessObjectTree(UINT32 Level);
00895 BOOL ProcessObject(void);
00896 BOOL ProcessGroup(UINT32 Level, BOOL FromLink = FALSE);
00897 BOOL ProcessLink(void);
00898 BOOL ProcessVectorList(ADDR Block, INT32 Size);
00899 BOOL ProcessVectorListEntry();
00900 BOOL ProcessTextList4();
00901 BOOL ProcessTextListItem4();
00902
00903
00904 BOOL ConvertRectangle(cdrfOffsetHeader *);
00905 BOOL ConvertEllipse(cdrfOffsetHeader *);
00906 BOOL ConvertPath(cdrfOffsetHeader *);
00907 BOOL ConvertText(cdrfOffsetHeader *);
00908 BOOL ConvertText4Art(cdrfOffsetHeader *);
00909 BOOL ConvertText4Para(cdrfOffsetHeader *);
00910 BOOL ConvertText3(cdrfOffsetHeader *);
00911 BOOL ConvertBitmap(cdrfOffsetHeader *);
00912
00913
00914 BOOL SetLineAttr(cdrfOffsetHeader *Object);
00915 BOOL SetFillAttr(cdrfOffsetHeader *Object);
00916 BOOL SetLineAttr3(cdrfOffsetHeader *Object);
00917 BOOL SetFillAttr3(cdrfOffsetHeader *Object);
00918 BOOL SetFillAttrFlat(cdrfFillHeader *Fill, INT32 Size);
00919 BOOL SetFillAttrGrad(cdrfFillHeader *Fill, INT32 Size);
00920 BOOL SetUKFill(void);
00921 BOOL SetLinearGrad(CDRFillInfo *GFill, DocRect &BBox, DocColour *StartColour, DocColour *EndColour);
00922 BOOL SetRadialGrad(CDRFillInfo *GFill, DocRect &BBox, DocColour *StartColour, DocColour *EndColour);
00923 BOOL SetConicalGrad(CDRFillInfo *GFill, DocRect &BBox, DocColour *StartColour, DocColour *EndColour);
00924 BOOL SetFillAttrPattern(CDRTiledFillInfo *Info, DocColour *Colour1, DocColour *Colour2);
00925 BOOL SetFillAttrTexture(cdrfFillHeader *Fill, INT32 Size);
00926 BOOL SetFillAttrVector(CDRTiledFillInfo *Info);
00927 BOOL NoFill(void);
00928
00929
00930 BOOL AddAttributesToArrowheadNode(NodeRenderableBounded *N, DocColour *Col, INT32 LineWidth,
00931 LineCapType Cap, JointType Join);
00932 BOOL AddAttributesToArrowheadPath(NodePath *P, DocColour *Col, INT32 LineWidth,
00933 LineCapType Cap, JointType Join);
00934 BOOL DoesPathNeedArrowheads(NodePath *P);
00935 BOOL TransformArrowhead(NodeRenderableBounded *N, DocCoord *Point, DocCoord *Other, BOOL Start,
00936 INT32 LineWidth, INT32 Distance);
00937 BOOL AddArrowheadsToPath(DWORD StartArrow, DWORD EndArrow, DocColour *Col, INT32 LineWidth,
00938 LineCapType Cap, JointType Join);
00939
00940
00941 BOOL ConvertColour(cdrfColour *Col, DocColour *Out);
00942 BOOL IsTransformJustMatrices(ADDR Trans, INT32 Size);
00943 BOOL TransformConvertedObject(NodeRenderable **N, ADDR Trans, INT32 Size, BOOL TranslateForPage = TRUE, BOOL IsAGroupTransform = FALSE, BOOL WorkAtOrigin = FALSE);
00944 BOOL TransformConvertedObjectDoMatrix(NodeRenderable **N, cdrMatrix *Ma, BOOL TranslateForPage);
00945 BOOL TransformConvertedObjectDoPerspective(NodeRenderable **N, cdrPerspective *P, BOOL TranslateShapeForPage = FALSE);
00946 BOOL TransformConvertedObjectDoEnvelope(NodeRenderable **N, Path *P, DocRect *OriginalBBox, INT32 *Corners, BOOL TranslateShapeForPage = FALSE);
00947 BOOL TransformConvertedObjectDoExtrude(NodeRenderable **N, cdrExtrudeInfo *Info, BOOL TranslateShapeForPage = FALSE);
00948 BOOL TransformConvertedObjectDoExtrudeTransPath(NodePath *pPath, cdrExtrudeInfo *Info);
00949 BOOL GetMatrixFromTransform(Matrix *M, ADDR Trans, INT32 Size, BOOL TranslateForPage = TRUE);
00950 BOOL GetObjCorelBBox(NodeRenderableBounded *pNode, DocRect *BBox);
00951 KernelBitmap *BitmapFromNodeList(Node *List);
00952 BOOL MakeTextOnPathLinkList();
00953 BOOL AttachTextToPaths();
00954 BOOL CheckTextForLinks(TextStory *pTextStory, cdrfOffsetHeader *Header);
00955
00956
00957 BOOL GetTextStyleFromCDRStyle(CDRTextStyle *TS, WORD StyleRef, BOOL SearchForParent = TRUE);
00958 BOOL GetTextStyleFromDefn(CDRTextStyle *TS, cdrfTextInfoFontDefn *FontDefn, const CDRTextStyle *BasedOn);
00959 BOOL ApplyTextAttr(Node *ContextNode, const CDRTextStyle *TS, const CDRTextStyle *BasedOn);
00960 BOOL ApplyTextAttrDoApply(Node *ContextNode, TxtBaseClassAttribute *Attr, BOOL CheckExisting);
00961 TCHAR *GetFontName(WORD FontRef);
00962 BOOL GetTextStyle3(CDRTextStyle *TS, WORD Style, CDRTextStyle *BasedOn = 0);
00963 BOOL GetTextStyleFromChar4(CDRTextStyle *TS, cdrfTextCharStyledV4 *Char, CDRTextStyle *BasedOn);
00964
00965 public:
00966
00967 static BOOL AddStandardColourSet(Document *pDocument);
00968
00969
00970 static BOOL HasCDRFileGotCMXFile(PathName *FileName, CCLexFile *pFile = NULL);
00971 };
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984 typedef enum {
00985 CDRTRANSFORMTYPE_UNKNOWN,
00986 CDRTRANSFORMTYPE_MATRIX,
00987 CDRTRANSFORMTYPE_PERSPECTIVE,
00988 CDRTRANSFORMTYPE_ENVELOPE,
00989 CDRTRANSFORMTYPE_EXTRUDE
00990 } CDRTransformType;
00991
00992 class CDRTransformConvertor : public CC_CLASS_MEMDUMP
00993 {
00994 CC_DECLARE_MEMDUMP(CDRTransformConvertor);
00995
00996 public:
00997 virtual BOOL Init(ADDR Data, INT32 Size) = 0;
00998 virtual UINT32 GetNTransforms() = 0;
00999 virtual CDRTransformType GetTransformType(UINT32 n) = 0;
01000 virtual BOOL GetMatrix(cdrMatrix *M, UINT32 n) = 0;
01001 virtual BOOL GetPerspective(cdrPerspective *P, UINT32 n) = 0;
01002 virtual BOOL GetEnvelope(Path **P, DocRect *OriginalBBox, INT32 *Corners, UINT32 n) = 0;
01003 virtual BOOL GetExtrude(cdrExtrudeInfo *Info, UINT32 n) = 0;
01004 protected:
01005 BOOL ConvertPerspective(cdrPerspective *P, cdrfPerspectiveTransform *Trans);
01006 BOOL ConvertEnvelopeBBox(ADDR Entry, DocRect *BBox, INT32 *Corners);
01007 BOOL ConvertEnvelopePath(ADDR List, INT32 ListSize, INT32 Entry, Path **ppPath);
01008 BOOL ConvertExtrudeInfo(cdrfTransformExtrude *pTransform, cdrExtrudeInfo *pInfo);
01009 };
01010
01011
01012 class CDRTransformConvertor5 : public CDRTransformConvertor
01013 {
01014 CC_DECLARE_MEMDUMP(CDRTransformConvertor5);
01015
01016 public:
01017 BOOL Init(ADDR Data, INT32 Size);
01018 UINT32 GetNTransforms() {return CDRDATA_WORD(Trans->NTransforms);};
01019 CDRTransformType GetTransformType(UINT32 n);
01020 BOOL GetMatrix(cdrMatrix *M, UINT32 n);
01021 BOOL GetPerspective(cdrPerspective *P, UINT32 n);
01022 BOOL GetEnvelope(Path **P, DocRect *OriginalBBox, INT32 *Corners, UINT32 n);
01023 BOOL GetExtrude(cdrExtrudeInfo *Info, UINT32 n);
01024 private:
01025 cdrfTransform *Trans;
01026 ADDR List;
01027 INT32 ListSize;
01028 };
01029
01030 class CDRTransformConvertor4 : public CDRTransformConvertor
01031 {
01032 CC_DECLARE_MEMDUMP(CDRTransformConvertor4);
01033
01034 public:
01035 BOOL Init(ADDR Data, INT32 Size);
01036 UINT32 GetNTransforms() {return CDRDATA_WORD(Trans->NTransforms);};
01037 CDRTransformType GetTransformType(UINT32 n);
01038 BOOL GetMatrix(cdrMatrix *M, UINT32 n);
01039 BOOL GetPerspective(cdrPerspective *P, UINT32 n);
01040 BOOL GetEnvelope(Path **P, DocRect *OriginalBBox, INT32 *Corners, UINT32 n);
01041 BOOL GetExtrude(cdrExtrudeInfo *Info, UINT32 n);
01042 private:
01043 cdrfTransformV4 *Trans;
01044 ADDR List;
01045 INT32 ListSize;
01046 };
01047
01048 class CDRTransformConvertor3 : public CDRTransformConvertor
01049 {
01050 CC_DECLARE_MEMDUMP(CDRTransformConvertor3);
01051
01052 public:
01053 BOOL Init(ADDR Data, INT32 Size) {Trans = (cdrfTransformV3 *)Data; return TRUE;};
01054 UINT32 GetNTransforms() {return CDRDATA_WORD(Trans->NTransforms);};
01055 CDRTransformType GetTransformType(UINT32 n);
01056 BOOL GetMatrix(cdrMatrix *M, UINT32 n);
01057 BOOL GetPerspective(cdrPerspective *P, UINT32 n);
01058 BOOL GetEnvelope(Path **P, DocRect *OriginalBBox, INT32 *Corners, UINT32 n);
01059 BOOL GetExtrude(cdrExtrudeInfo *Info, UINT32 n);
01060 private:
01061 cdrfTransformV3 *Trans;
01062 };
01063
01064 #endif // INC_CDRFILTR
01065