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 #ifndef INC_FILTERS
00100 #define INC_FILTERS
00101
00102 #include "list.h"
00103 #include "pathname.h"
00104 #include "docrect.h"
00105 #include "attr.h"
00106 #include "attrmgr.h"
00107 #include "txtattr.h"
00108 #include "fontclass.h"
00109 #include <limits.h>
00110 #include "oilfltrs.h"
00111
00112 class DocColour;
00113 class CCLexFile;
00114 class CCDiskFile;
00115 class ArrowRec;
00116 class Pathname;
00117
00118
00119
00120 #define FILTERID_INVALID (-1)
00121
00122 #define FILTERID_USERCHOICE (UINT_MAX)
00123 #define FILTERID_NONE (0)
00124
00125 #define FILTERID_GENERIC (1)
00126 #define FILTERID_VECTOR (2)
00127 #define FILTERID_BITMAP (3)
00128 #define FILTERID_METAFILE (4)
00129 #define FILTERID_AIEPS (5)
00130 #define FILTERID_AI5EPS (6)
00131 #define FILTERID_ARTWORKS_EPS (7)
00132 #define FILTERID_CAMELOT_EPS (8)
00133 #define FILTERID_COREL3_EPS (9)
00134 #define FILTERID_COREL4_EPS (10)
00135 #define FILTERID_ACORN_DRAW (11)
00136 #define FILTERID_BMP (12)
00137 #define FILTERID_EPS (13)
00138 #define FILTERID_NATIVE (14)
00139 #define FILTERID_CORELPALETTEFILE (15)
00140 #define FILTERID_CDR (16)
00141 #define FILTERID_FREEHAND_EPS (17)
00142 #define FILTERID_ENHMETAFILE (18)
00143
00144 #define BUILD_NATIVE_FILTERS FALSE
00145 #define FILTERID_NATIVE_EPS (19) // The old version 1.1 native filter
00146 #define FILTERID_WEB (20)
00147 #define FILTERID_CMX16 (21)
00148 #define FILTERID_CMX32 (22)
00149 #define FILTERID_CMXIMPORT (23)
00150 #define FILTERID_AI8EPS (24)
00151
00152
00153 #define FILTERID_FLASH (25) // JCF: added as otherwise returned ID_NONE
00154
00155
00156 #define FILTERID_PHOTOSHOPEPS (26) // (ChrisG 9/11/00) for the PhotoShop EPS Stub filter
00157
00158
00159 #define FILTERID_PALETTE (30)
00160 #define FILTERID_MSPALETTE (31)
00161 #define FILTERID_ADOBECOLOURTABLE (32)
00162 #define FILTERID_ADOBECOLOURSWATCH (33)
00163 #define FILTERID_PSPPALETTE (34)
00164 #define FILTERID_JCWPALETTE (35)
00165
00166
00167 #define FILTERID_IMAGEMAP (40)
00168
00169
00170
00171 #define FILTERID_ACCUSOFT (100)
00172 #define FILTERID_ACCUSOFTBMP (101)
00173 #define FILTERID_BROOKTROUT (102)
00174 #define FILTERID_CALS (103)
00175 #define FILTERID_DCX (104)
00176 #define FILTERID_GIF (105)
00177 #define FILTERID_GX2 (106)
00178 #define FILTERID_HALOCUT (107)
00179 #define FILTERID_IFF (108)
00180 #define FILTERID_IMG (109)
00181 #define FILTERID_IOCA (110)
00182 #define FILTERID_JPEG (111)
00183 #define FILTERID_KOFAX (112)
00184 #define FILTERID_LASERDATA (113)
00185 #define FILTERID_MACPAINT (114)
00186 #define FILTERID_MSICONS (115)
00187 #define FILTERID_MSPAINT (116)
00188 #define FILTERID_PCX (117)
00189 #define FILTERID_PHOTOCD (118)
00190 #define FILTERID_PHOTOSHOP (119)
00191 #define FILTERID_PICT (120)
00192 #define FILTERID_SUN (121)
00193 #define FILTERID_TARGA (122)
00194 #define FILTERID_TIFF (123)
00195 #define FILTERID_WPG (124)
00196 #define FILTERID_XWINDOWS (125)
00197 #define FILTERID_PREVIEW (126) //WEBSTER-obsolete
00198
00199 #define FILTERID_TI_GIF (127)
00200 #define FILTERID_SPRITE (128)
00201
00202 #define FILTERID_PPM (129)
00203 #define FILTERID_PGM (130)
00204 #define FILTERID_PBM (131)
00205
00206 #define FILTERID_DXF (132)
00207
00208 #define FILTERID_PNG (133)
00209
00210 #define FILTERID_PREVIEW_BMP (134)
00211 #define FILTERID_PREVIEW_GIF (135)
00212 #define FILTERID_PREVIEW_JPEG (136)
00213 #define FILTERID_PREVIEW_PNG (137)
00214 #define FILTERID_PREVIEW_TIFF (138) //WEBSTER new number, no longer FILTERID_PREVIEW
00215
00216 #define FILTERID_IMPORT_JPEG (140)
00217 #define FILTERID_EXPORT_JPEG (141)
00218
00219
00220 #define BUILD_TEXT_FILTERS TRUE // Olivier 26/03/97 HTML filter
00221 #define BUILD_OTHER_TEXT_FILTERS FALSE
00222 #define FILTERID_TEXT (200)
00223 #define FILTERID_TEXT_ASCII (201)
00224 #define FILTERID_TEXT_UNICODE (202)
00225 #define FILTERID_TEXT_RTF (203)
00226
00227
00228 #define FILTERID_HTML (204)
00229
00230
00231 #define FILTERID_FLARETEMPLATE (205)
00232
00233
00234 #define FILTERID_ALDUS_START 1000
00235 #define FILTERID_ALDUS_END 1099
00236
00237
00238 #define FILTERID_IMAGEMAGICK_START 1100
00239 #define FILTERID_IMAGEMAGICK_END 1999
00240
00241
00242
00243 enum SelectionType { SELECTION, DRAWING, SPREAD, ABITMAP, SOMEBITMAPS, PAGE };
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257 class FilterFlags
00258 {
00259 public:
00260 UINT32 CanImport : 1;
00261 UINT32 CanExport : 1;
00262 UINT32 CanExportMultipleImages : 1;
00263 UINT32 ShowFilter : 1;
00264
00265 BOOL operator==(const FilterFlags Flags);
00266 };
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280 class Spread;
00281
00282 class ImportPosition
00283 {
00284 public:
00285 Spread *pSpread;
00286 DocCoord Position;
00287 };
00288
00289
00290
00291
00292
00293 class GenericFilter;
00294 class SelOperation;
00295 class Operation;
00296 class Document;
00297 class GenericFilter;
00298 class Layer;
00299 class Spread;
00300 class ExportDC;
00301 class RenderRegion;
00302 class AttributeEntry;
00303 class KernelBitmap;
00304
00305
00306
00307 enum BitmapFilterSupport
00308 {
00309 NoBitmapSupport,
00310 SimpleBitmapSupport,
00311 IndirectedBitmapSupport
00312 };
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325 class SnapShotItem : public ListItem
00326 {
00327 CC_DECLARE_MEMDUMP(SnapShotItem);
00328
00329 friend class SnapShotList;
00330
00331 public:
00332 SnapShotItem();
00333 ~SnapShotItem();
00334
00335 INT32 Initialise( AttributeEntry* CurrAttrs );
00336
00337 private:
00338
00339 NodeAttribute **SnapShotAttrs;
00340 AttributeEntry *SnapShotAttrsStack;
00341 };
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354 class SnapShotList : public CC_CLASS_MEMDUMP
00355 {
00356 CC_DECLARE_MEMDUMP(SnapShotList);
00357
00358 public:
00359 SnapShotList();
00360 ~SnapShotList();
00361
00362 BOOL CreateSnapShot(AttributeEntry* CurrAttrs);
00363 void DestroySnapShot();
00364
00365 SnapShotItem* GetCurrentSnapShot();
00366 BOOL ApplyChangedAttrs(Node* pNode, AttributeEntry* CurrAttrs);
00367 void PushAttrsBasedOnSnapShot(AttributeEntry* CurrAttrs);
00368 void PopAttrsBasedOnSnapShot(AttributeEntry* CurrAttrs);
00369
00370 private:
00371 List SnapShot;
00372 };
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384 class AttrRecordItem : public ListItem
00385 {
00386 CC_DECLARE_MEMDUMP(AttrRecordItem);
00387 friend class AttrRecordList;
00388
00389 public:
00390 AttrRecordItem();
00391 ~AttrRecordItem();
00392
00393 BOOL Initialise(AttributeEntry* CurrAttrs);
00394 BOOL Restore(AttributeEntry* CurrAttrs);
00395
00396 protected:
00397 AttributeEntry *RecordedAttrs;
00398 };
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409 class AttrRecordList : public CC_CLASS_MEMDUMP
00410 {
00411 CC_DECLARE_MEMDUMP(AttrRecordList);
00412
00413 public:
00414 AttrRecordList();
00415 ~AttrRecordList();
00416
00417 BOOL SaveContext(AttributeEntry* CurrAttrs);
00418 BOOL RestoreContext(AttributeEntry* CurrAttrs);
00419 List* GetList() {return &AttrRecord;}
00420
00421 protected:
00422 List AttrRecord;
00423 };
00424
00425
00426 enum DESTRUCTION_METHOD
00427 {
00428 DM_INVALID = 0,
00429 DM_DELETE_WHEN_DONE = 1,
00430 DM_KEEP_WHEN_DONE
00431 };
00432
00433 typedef UINT32 ID;
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447 class Filter : public ListItem
00448 {
00449 friend class FilterRenderCallback;
00450
00451 CC_DECLARE_DYNAMIC(Filter)
00452
00453 public:
00454 Filter();
00455 virtual ~Filter();
00456
00457 virtual BOOL Init() = 0;
00458 virtual void Deinit()
00459 {
00460 if (pOILFilter)
00461 {
00462 delete pOILFilter;
00463 pOILFilter = NULL;
00464 }
00465 };
00466
00467 FilterFlags GetFlags();
00468
00469
00470
00471
00472 static void ForceStatusExportMessage(UINT32 nMessageID);
00473 static void UnforceStatusExportMessage();
00474
00475
00476
00477 ADDR LoadInitialSegment(PathName& Path, UINT32 *Size, size_t *FileSize);
00478
00479
00480 ADDR LoadInitialSegment(CCLexFile* pFile, UINT32* pSize, size_t *pFileSize);
00481
00482
00483
00484
00485
00486 virtual BOOL IsDefaultDocRequired(const TCHAR* pcszPathName);
00487
00488
00489
00490
00491 virtual BOOL PreHowCompatible();
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502 virtual INT32 HowCompatible( PathName& Filename,
00503 ADDR HeaderStart,
00504 UINT32 HeaderSize,
00505 UINT32 FileSize )
00506 {
00507 return 0;
00508 }
00509
00510 virtual BOOL DoImport(SelOperation*, CCLexFile*, Document*,
00511 BOOL AutoChosen = FALSE, ImportPosition *Pos = NULL,
00512 KernelBitmap** ppImportedBitmap = NULL,
00513 DocCoord* pPosTranslate = NULL, String_256* URL = NULL
00514 )
00515 {
00516 return FALSE;
00517 }
00518
00519
00520 virtual BOOL DoExport(Operation*, CCLexFile*, PathName*, Document*, BOOL = TRUE)
00521 {
00522 return FALSE;
00523 }
00524
00525 virtual BOOL JoinFamily(CCRuntimeClass*);
00526
00527 virtual BOOL ImportBitmap(CCLexFile*, KernelBitmap**);
00528 virtual BOOL ExportBitmap(KernelBitmap&);
00529
00530 static GenericFilter* GetGenericFilter() { return pGenericFilter; }
00531
00532 Document* GetDocument() { return TheDocument; }
00533 AttributeEntry* GetCurrentAttrs() { return CurrentAttrs; }
00534
00535 virtual INT32 ImportBinary(ADDR pData, INT32 Length);
00536
00537 virtual BitmapFilterSupport GetBitmapSupportLevel();
00538
00539
00540 virtual BOOL CanIncludePreviewBmp();
00541 void IncludePreviewBmp(BOOL WantBmp);
00542
00543
00544 virtual BOOL ExportVisibleLayersOnly();
00545
00546
00547 virtual BOOL ExportSelectionOnly(BOOL MaskedRender = FALSE);
00548
00549 String_256 FilterName;
00550 String_256 FilterInfo;
00551 UINT32 FilterID;
00552 OILFilter *pOILFilter;
00553
00554
00555 virtual BOOL WillAcceptExistingFile(PathName pthToReplace);
00556
00557
00558
00559 virtual void SetSaveAttributes (BOOL DoSave);
00560
00561 void SetSoleLayer(Layer* pLayer) {m_pSoleLayer = pLayer;}
00562 Layer* GetSoleLayer() {return m_pSoleLayer;}
00563
00564 protected:
00565
00566 static BOOL DeclareFilterPreferenceSection();
00567
00568
00569
00570 static UINT32 m_nForcedStatusExportMessage;
00571
00572
00573 BOOL WantPreviewBmp;
00574
00575
00576 FilterFlags Flags;
00577
00578
00579 Document* TheDocument;
00580
00581
00582 Layer *GetActiveLayer(Document*);
00583 BOOL MakeSureLayerExists(Document* pDoc);
00584
00585
00586 static Spread* GetFirstSpread(Document*);
00587
00588
00589 UINT32 ExportMsgID;
00590
00591
00592
00593 UINT32 StopExportMsgID;
00594
00595
00596 UINT32 ImportMsgID;
00597
00598
00599 BOOL SaveAttributes;
00600
00601 Layer* m_pSoleLayer;
00602
00603 public:
00604 virtual BOOL OpenExportFile(CCDiskFile* pDiskFile, PathName* pPath);
00605 virtual BOOL DeleteExportFile(CCDiskFile* pDiskFile);
00606
00607
00608
00609 virtual BOOL ExportRender( RenderRegion *pRegion, BOOL MaskedRender = FALSE);
00610 virtual BOOL ExportRenderNodes ( RenderRegion* pRegion,
00611 ExportDC* pDC,
00612 BOOL VisibleLayersOnly = FALSE,
00613 BOOL CheckSelected = FALSE,
00614 BOOL ShowProgress = TRUE );
00615
00616
00617 virtual String_64 GetImportProgressString(CCLexFile* File, UINT32 ImportingMsgID);
00618 virtual String_64 GetExportProgressString(CCLexFile* File, UINT32 ExportingMsgID);
00619
00620
00621
00622
00623 virtual UINT32 GetExportMsgID();
00624 virtual UINT32 GetImportMsgID();
00625
00626
00627
00628 virtual BOOL AddStringToProgressString(String_64* Str);
00629
00630
00631
00632 virtual BOOL ShouldExportHTMLTag()
00633 {
00634 return FALSE;
00635 }
00636
00637
00638 virtual void ExportHTMLTag()
00639 {
00640 }
00641
00642
00643 static Filter* FindFilterFromID(const UINT32 FilterID);
00644
00645 protected:
00646
00647 virtual BOOL WriteNodes ( RenderRegion* pRegion,
00648 ExportDC* pDC,
00649 BOOL VisibleLayersOnly,
00650 BOOL CheckSelected,
00651 BOOL ShowProgress);
00652 virtual BOOL EndExportRender ( RenderRegion *pRegion,
00653 BOOL ShowProgress );
00654
00655
00656
00657 String_64 m_StrToAddToProgress;
00658
00659
00660
00661 BOOL SetUpCurrentAttrs();
00662 void DeleteCurrentAttrs();
00663 BOOL SetLineColour(DocColour&);
00664 BOOL SetLineWidth(MILLIPOINT);
00665 BOOL SetLineCap(LineCapType);
00666 BOOL SetJoinType(JointType);
00667 BOOL SetLineTransp(UINT32 TranspType, UINT32 Transp);
00668 BOOL SetDashPattern(DashRec&);
00669 BOOL SetStartArrow(ArrowRec&);
00670 BOOL SetEndArrow(ArrowRec&);
00671 BOOL SetMitreLimit(MILLIPOINT);
00672
00673 BOOL SetTextFont(String_64 *EncodedName, INT32 Millipoint);
00674 BOOL SetTextFontStyle(String_64* FName, INT32 MillFSize, BOOL Bold, BOOL Italic);
00675 BOOL SetTextSize(INT32 Size);
00676 BOOL SetTextTypeFace(String_64* Name, FontClass Class = FC_UNDEFINED);
00677 BOOL SetTextBold(BOOL Bold);
00678 BOOL SetTextItalic(BOOL Italic);
00679 BOOL SetTextUnderline(BOOL Underline);
00680 BOOL SetTextAspectRatio(FIXED16 AspectR);
00681 BOOL SetTextTracking(INT32 Tracking);
00682 BOOL SetTextJustification(Justification Justify);
00683 virtual BOOL SetTextLineSpacing(INT32 Type, INT32 EMLSpace, MILLIPOINT MLSpace, double DLSpace);
00684 BOOL SetTextBaseLine(MILLIPOINT BaseLine);
00685 BOOL SetTextScript(INT32 rise, INT32 pointsize);
00686 BOOL SetTextBoldFont(BOOL Bold);
00687 BOOL SetTextItalicFont(BOOL Italic);
00688 BOOL RemoveTextScript();
00689
00690
00691 BOOL SetPathFilled(BOOL Filled);
00692
00693
00694 BOOL SetFillColour(DocColour&);
00695
00696 BOOL SetLinearFill(DocColour &StartColour, DocColour &EndColour,
00697 DocCoord StartPoint, DocCoord EndPoint,
00698 DocCoord *EndPoint3 = NULL);
00699
00700 BOOL SetRadialFill(DocColour &StartColour, DocColour &EndColour,
00701 DocCoord StartPoint, DocCoord EndPoint);
00702
00703 BOOL SetRadialFill(DocColour &StartColour, DocColour &EndColour,
00704 DocCoord StartPoint,
00705 DocCoord EndPoint1, DocCoord EndPoint2);
00706
00707 BOOL SetSquareFill(DocColour &StartColour, DocColour &EndColour,
00708 DocCoord StartPoint,
00709 DocCoord EndPoint1, DocCoord EndPoint2);
00710
00711 BOOL SetConicalFill(DocColour &StartColour, DocColour &EndColour,
00712 DocCoord StartPoint, DocCoord EndPoint);
00713
00714 BOOL SetBitmapFill(KernelBitmap *pBitmap,
00715 DocCoord StartPoint, DocCoord EndPoint, DocCoord EndPoint2,
00716 DocColour *StartColour = 0, DocColour *EndColour = 0);
00717
00718 BOOL SetFractalFill(DocColour &StartColour, DocColour &EndColour,
00719 DocCoord StartPoint, DocCoord EndPoint1, DocCoord EndPoint2,
00720 INT32 Seed, double Graininess, double Gravity, double Squash,
00721 UINT32 DPI, BOOL Tileable);
00722
00723
00724 BOOL SetNoTranspFill();
00725
00726 BOOL SetFlatTranspFill(UINT32 TranspType, UINT32 Transp);
00727
00728 BOOL SetLinearTranspFill(UINT32 TranspType, UINT32 StartTransp, UINT32 EndTransp,
00729 DocCoord StartPoint, DocCoord EndPoint,
00730 DocCoord *EndPoint3 = NULL);
00731
00732 BOOL SetRadialTranspFill(UINT32 TranspType, UINT32 StartTransp, UINT32 EndTransp,
00733 DocCoord StartPoint, DocCoord EndPoint);
00734
00735 BOOL SetRadialTranspFill(UINT32 TranspType, UINT32 StartTransp, UINT32 EndTransp,
00736 DocCoord StartPoint,
00737 DocCoord EndPoint1, DocCoord EndPoint2);
00738
00739 BOOL SetConicalTranspFill(UINT32 TranspType, UINT32 StartTransp, UINT32 EndTransp,
00740 DocCoord StartPoint, DocCoord EndPoint);
00741
00742 BOOL SetBitmapTranspFill(UINT32 TranspType, KernelBitmap *pBitmap,
00743 DocCoord StartPoint, DocCoord EndPoint, DocCoord EndPoint2,
00744 UINT32 StartTransp = 0, UINT32 EndTransp = 255);
00745
00746 BOOL SetFractalTranspFill(UINT32 TranspType,
00747 DocCoord StartPoint, DocCoord EndPoint1, DocCoord EndPoint2,
00748 INT32 Seed, double Graininess, double Gravity, double Squash,
00749 UINT32 DPI, BOOL Tileable,
00750 UINT32 StartTransp = 0, UINT32 EndTransp = 255);
00751
00752
00753 BOOL SetFadeFillEffect();
00754 BOOL SetRainbowFillEffect();
00755 BOOL SetAltRainbowFillEffect();
00756
00757
00758 BOOL SetLinearFillMapping(INT32 Repeat);
00759 BOOL SetLinearTranspFillMapping(INT32 Repeat);
00760
00761
00762 BOOL SetWindingRule(WindingType);
00763
00764 virtual BOOL GetDragAndDropTranslation(ImportPosition* pPos, DocRect BoundsRect, Coord* Offset);
00765
00766
00767 BOOL SnapShotCurrentAttrs();
00768 void PushCurrentAttrsBasedOnSnapShot();
00769 void PopCurrentAttrsBasedOnSnapShot();
00770 void DeleteSnapShot();
00771 void DeleteAttributeList(AttributeEntry* pAttrList);
00772 BOOL ApplyChangedAttrs(Node* pNode);
00773
00774
00775 virtual void UpdateFilterProgress(UINT32 increment);
00776
00777
00778 AttributeEntry *CurrentAttrs;
00779
00780
00781 SnapShotList FilterSnapShot;
00782
00783
00784 AttributeEntry FillAttr;
00785 BOOL PathFilled;
00786
00787 private:
00788
00789 static GenericFilter* pGenericFilter;
00790
00791
00792 static List FilterList;
00793
00794
00795 static ID m_NextFilterID;
00796
00797 protected:
00798
00799 static INT32 MinLineWidth;
00800
00801 public:
00802 static BOOL InitFilters();
00803 static BOOL DeinitFilters();
00804 static Filter* GetFirst();
00805 static Filter* GetNext(Filter*);
00806
00807
00808 static List& GetFilters() { return FilterList; }
00809 static ID GetNewFilterID();
00810 static ID RegisterFilter( Filter* const pFilter);
00811
00812
00813
00814
00815
00816 static BOOL AddUnnamedColours;
00817
00818
00819 static INT32 ImportWithLayers;
00820
00821
00822 static BOOL OpenWithLayers;
00823
00824
00825
00826 static BOOL ImportBitmapsOntoLayers;
00827
00828 static BOOL bDontWarnBitmapNonMixTransp;
00829
00830 public:
00831 virtual BOOL IncProgressBarCount(UINT32 n) { return TRUE; }
00832
00833
00834 BOOL UpdateExportedNodeCount(UINT32 NumNodes = 1);
00835
00836
00837 UINT32 GetNumNodes();
00838 UINT32 SetNumNodes(UINT32 NewNumNodes);
00839
00840
00841
00842 protected:
00843
00844 static UINT32 NumNodes;
00845 static UINT32 UpdateEvery;
00846 static UINT32 LastExportProgressUpdate;
00847 static UINT32 CurrentProgressLimit;
00848 protected:
00849 static UINT32 ProgressOffset;
00850 static UINT32 m__StripStart;
00851 };
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867 class FilterRenderCallback : public RenderCallback
00868 {
00869 public:
00870 FilterRenderCallback(Filter* pFilter, BOOL bCount, BOOL bVisibleLayersOnly, BOOL bSelectedOnly)
00871 {
00872 m_pFilter = pFilter;
00873 m_bCount = bCount;
00874 m_bVisibleLayersOnly = bVisibleLayersOnly;
00875 m_bSelectedOnly = bSelectedOnly;
00876 }
00877
00878 virtual BOOL BeforeNode(RenderRegion* pRegion, Node* pNode);
00879 virtual BOOL BeforeSubtree(RenderRegion* pRegion,
00880 Node* pNode,
00881 Node** ppNextNode,
00882 BOOL bClip,
00883 SubtreeRenderState* pState);
00884
00885 private:
00886 Filter* m_pFilter;
00887 BOOL m_bCount;
00888 BOOL m_bVisibleLayersOnly;
00889 BOOL m_bSelectedOnly;
00890 };
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907 class VectorFilter : public Filter
00908 {
00909 CC_DECLARE_DYNAMIC(VectorFilter)
00910 };
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927 class BitmapFilter : public Filter
00928 {
00929 CC_DECLARE_DYNAMIC(BitmapFilter)
00930 };
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951 class CompatibleFilter : public ListItem
00952 {
00953 CC_DECLARE_MEMDUMP(CompatibleFilter)
00954
00955 public:
00956 CompatibleFilter(Filter *NewFilter, INT32 NewCompatibility);
00957
00958
00959 Filter *pFilter;
00960
00961
00962 INT32 Compatibility;
00963 };
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976 class CompatibleFilterList : public List
00977 {
00978 CC_DECLARE_MEMDUMP(CompatibleFilterList)
00979 public:
00980 BOOL AddFilter(Filter*, INT32 Compatibility);
00981 };
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010 class FilterFamily : public Filter
01011 {
01012 CC_DECLARE_DYNAMIC(FilterFamily)
01013
01014 public:
01015 FilterFamily();
01016 ~FilterFamily();
01017
01018
01019
01020 virtual BOOL IsDefaultDocRequired(const TCHAR* pcszPathName);
01021
01022 Filter* GetBestFilter(CCLexFile* pFile, BOOL ShowWarnings = FALSE);
01023
01024 INT32 HowCompatible(PathName& Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize);
01025 virtual BOOL DoImport(SelOperation*, CCLexFile*, Document*,
01026 BOOL Auto = FALSE, ImportPosition* Pos = NULL,
01027 KernelBitmap** ppImportedBitmap = NULL,
01028 DocCoord* pPosTranslate = NULL, String_256* = NULL);
01029 virtual BOOL DoExport(Operation*, CCLexFile*, PathName*, Document*, BOOL);
01030
01031 virtual BOOL ImportBitmap(CCLexFile*, KernelBitmap**);
01032 virtual BOOL JoinFamily(CCRuntimeClass*);
01033
01034 Filter* pCachedBestFilter;
01035 CCRuntimeClass* pFilterType;
01036 };
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051 class GenericFilter : public FilterFamily
01052 {
01053 CC_DECLARE_DYNAMIC(GenericFilter);
01054
01055 public:
01056 GenericFilter();
01057 BOOL Init();
01058 };
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070
01071 class VectorFilterFamily : public FilterFamily
01072 {
01073 CC_DECLARE_DYNAMIC(VectorFilterFamily);
01074
01075 public:
01076 VectorFilterFamily();
01077 BOOL Init();
01078 };
01079
01080 #if BUILD_TEXT_FILTERS
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090 class TextFilter : public Filter
01091 {
01092 CC_DECLARE_DYNAMIC(TextFilter)
01093 };
01094 #endif
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108 class BitmapFilterFamily : public FilterFamily
01109 {
01110 CC_DECLARE_DYNAMIC(BitmapFilterFamily);
01111
01112 public:
01113 BitmapFilterFamily();
01114 BOOL Init();
01115 };
01116
01117
01118 #if BUILD_TEXT_FILTERS
01119
01120
01121
01122
01123
01124
01125
01126
01127 class TextFilterFamily : public FilterFamily
01128 {
01129 CC_DECLARE_DYNAMIC(TextFilterFamily);
01130
01131 public:
01132 TextFilterFamily();
01133 BOOL Init();
01134 };
01135 #endif
01136
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148
01149 class GenericEPSFilter : public FilterFamily
01150 {
01151 CC_DECLARE_DYNAMIC(GenericEPSFilter);
01152
01153 public:
01154 GenericEPSFilter();
01155 BOOL Init();
01156 };
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169 class PaletteFilterFamily : public FilterFamily
01170 {
01171 CC_DECLARE_DYNAMIC(PaletteFilterFamily);
01172
01173 public:
01174 PaletteFilterFamily();
01175 BOOL Init();
01176 };
01177
01178 #endif // INC_FILTERS