xpfcaps.h

Go to the documentation of this file.
00001 // $Id: xpfcaps.h 1708 2006-08-17 17:13:38Z gerry $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 
00099 #ifndef INC_XPFCAPS
00100 #define INC_XPFCAPS
00101 
00102 #include "nodershp.h"
00103 #include "nodecont.h"
00104 #include "ncntrcnt.h"
00105 #include "nbevcont.h"
00106 #include "nodeblnd.h"
00107 #include "nodemold.h"
00108 #include "nodebmp.h"
00109 #include "nodetxts.h"
00110 #include "ndclpcnt.h"
00111 #include "nodeliveeffect.h"
00112 #include "layer.h"
00113 
00114 class XPFRenderRegion;
00115 
00116 typedef enum XPFConvertType
00117 {
00118     XPFCONVTYPE_ERROR = -1,
00119     XPFCONVTYPE_UNKNOWN = 0,
00120     XPFCONVTYPE_NATIVE,
00121     XPFCONVTYPE_SIMPLE,
00122     XPFCONVTYPE_STROKED,
00123     XPFCONVTYPE_BITMAP,
00124     XPFCONVTYPE_BITMAPFILL,
00125     XPFCONVTYPE_BITMAPTRANS,
00126     XPFCONVTYPE_BITMAPFILLTRANS,
00127     XPFCONVTYPE_BITMAPSPAN,
00128     XPFCONVTYPE_REFORMAT,
00129     XPFCONVTYPE_REMOVE,
00130     XPFCONVTYPE_SIMPLERGB,
00131     XPFCONVTYPE_RGB,
00132     XPFCONVTYPE_CMYK
00133 } XPFConvertType;
00134 
00135 typedef enum XPFBOOL
00136 {
00137     XPFB_UNKNOWN = -1,
00138     XPFB_FALSE = 0,
00139     XPFB_TRUE = 1
00140 } XPFBOOL;
00141 
00142 typedef INT32 XPFProp;
00143 
00144 #define XPFP_CONTENTONLY_TEXT 1
00145 #define XPFP_CONTENTONLY_PLAINTEXT 2
00146 
00147 #define XPFP_UNKNOWN -1
00148 #define XPFP_SHADOWTYPE_WALL 1
00149 #define XPFP_SHADOWTYPE_FLOOR 2
00150 #define XPFP_SHADOWTYPE_GLOW 3
00151 #define XPFP_SHADOWTYPE_FEATHER 4
00152 
00153 #define XPFP_BEVELTYPE_FLAT 0
00154 #define XPFP_BEVELTYPE_ROUND 1
00155 #define XPFP_BEVELTYPE_HALFROUND 2
00156 #define XPFP_BEVELTYPE_FRAME 3
00157 #define XPFP_BEVELTYPE_MESA_1 4
00158 #define XPFP_BEVELTYPE_MESA_2 5
00159 #define XPFP_BEVELTYPE_SMOOTH_1 6
00160 #define XPFP_BEVELTYPE_SMOOTH_2 7
00161 #define XPFP_BEVELTYPE_POINT_1 8
00162 #define XPFP_BEVELTYPE_POINT_2a 9
00163 #define XPFP_BEVELTYPE_POINT_2b 10
00164 #define XPFP_BEVELTYPE_RUFFLE_2a 11
00165 #define XPFP_BEVELTYPE_RUFFLE_2b 12
00166 #define XPFP_BEVELTYPE_RUFFLE_3a 13
00167 #define XPFP_BEVELTYPE_RUFFLE_3b 14
00168 
00169 #define XPFP_BEVELSIDE_INNER 0
00170 #define XPFP_BEVELSIDE_OUTER 1
00171 
00172 #define XPFP_COLOUREFFECT_FADE 0
00173 #define XPFP_COLOUREFFECT_RAINBOW 1
00174 #define XPFP_COLOUREFFECT_ALTRAINBOW 2
00175 
00176 #define XPFP_MOULDTYPE_ENVELOPE 1
00177 #define XPFP_MOULDTYPE_PERSPECTIVE 2
00178 
00179 #define XPFP_LINECAP_BUTT 0
00180 #define XPFP_LINECAP_ROUND 1
00181 #define XPFP_LINECAP_SQUARE 2
00182 
00183 #define XPFP_LINEJOIN_MITRE 0
00184 #define XPFP_LINEJOIN_ROUND 1
00185 #define XPFP_LINEJOIN_BEVEL 2
00186 
00187 #define XPFP_FILLREPEAT_SIMPLE 1
00188 #define XPFP_FILLREPEAT_REPEAT 2
00189 #define XPFP_FILLREPEAT_REPEATINV 3
00190 #define XPFP_FILLREPEAT_REPEATEXTRA 4
00191 
00192 #define XPFP_TRANSTYPE_NONE 0
00193 #define XPFP_TRANSTYPE_MIX 1
00194 
00195 typedef struct PropMapEntry
00196 {
00197     TCHAR* pName;
00198     XPFProp Value;
00199 } PropMapEntry;
00200 
00201 
00202 /********************************************************************************************
00203 
00204 >   class XPFCapability : public CC_CLASS_MEMDUMP
00205 
00206     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00207     Created:    26/01/05
00208     Purpose:    This is the baseclass for the various nodes in the capability tree
00209 
00210 ********************************************************************************************/
00211 
00212 class XPFCapability : public CC_CLASS_MEMDUMP
00213 {
00214     // Give my name in memory dumps
00215     CC_DECLARE_MEMDUMP(XPFCapability);
00216 
00217 public:
00218     XPFCapability(XPFConvertType ConvertType = XPFCONVTYPE_UNKNOWN)
00219     {
00220         m_pNext = NULL;
00221         m_pChild = NULL;
00222         m_ConvertType = ConvertType;
00223     }
00224     virtual ~XPFCapability()
00225     {
00226         XPFCapability* pNext = NULL;
00227         XPFCapability* pCap = m_pChild;
00228         while (pCap)
00229         {
00230             pNext = pCap->GetNext();
00231             delete pCap;
00232             pCap = pNext;
00233         }
00234     }
00235 
00236     XPFCapability* GetNext() const { return(m_pNext); }
00237     XPFCapability* GetChild() const { return(m_pChild); }
00238     XPFConvertType GetConvertType() const { return(m_ConvertType); }
00239 
00240     void SetNext(XPFCapability* pNext) { m_pNext = pNext; }
00241     void SetChild(XPFCapability* pChild) { m_pChild = pChild; }
00242 
00243     XPFConvertType GetConvertTypeForNode(Node* pNode);
00244     XPFConvertType GetConvertTypeForAttrs(RenderRegion* pRegion);
00245 
00246 public:
00247 
00248 protected:
00249     virtual BOOL DoesNodeMatch(Node* pNode) { return(FALSE); }
00250     virtual BOOL DoAttributesMatch(RenderRegion* pRegion) { return(FALSE); }
00251     virtual BOOL DoesColourMatch(DocColour* pColour) { return(FALSE); }
00252 
00253     BOOL AreAllChildrenText(Node* pRootNode, BOOL bPlain);
00254     BOOL IsTextStoryPlain(Node* pNode);
00255 
00256 protected:
00257     XPFCapability* m_pNext;
00258     XPFCapability* m_pChild;
00259     XPFConvertType m_ConvertType;
00260 };
00261 
00262 
00263 
00264 /********************************************************************************************
00265 
00266 >   class XPFCComplexClass : public XPFCapability
00267 
00268     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00269     Created:    26/01/05
00270     Purpose:    This is a general class that just uses the runtime class of the node
00271                 It can be used directly to handle those complex objects that just support
00272                 a simple on/off style of conversion or it can be used as the baseclass 
00273                 for more complex classes
00274 
00275 ********************************************************************************************/
00276 
00277 class XPFCComplexClass : public XPFCapability
00278 {
00279     // Give my name in memory dumps
00280     CC_DECLARE_MEMDUMP(XPFCComplexClass);
00281 
00282 public:
00283     XPFCComplexClass(CCRuntimeClass* pClass = NULL, XPFConvertType m_ConvertType = XPFCONVTYPE_UNKNOWN)
00284         : XPFCapability(m_ConvertType)
00285     {
00286         m_pClass = pClass;
00287     }
00288     virtual ~XPFCComplexClass()
00289     {
00290     }
00291 
00292 protected:
00293     virtual BOOL DoesNodeMatch(Node* pNode);
00294 
00295 protected:
00296     CCRuntimeClass* m_pClass;
00297 };
00298 
00299 
00300 /********************************************************************************************
00301 
00302 >   class XPFCLayer : public XPFCComplexClass
00303 
00304     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00305     Created:    26/01/05
00306     Purpose:    This is the class for layer capabilities
00307 
00308 ********************************************************************************************/
00309 
00310 class XPFCLayer : public XPFCComplexClass
00311 {
00312     // Give my name in memory dumps
00313     CC_DECLARE_MEMDUMP(XPFCLayer);
00314 
00315 public:
00316     XPFCLayer(XPFConvertType ConvertType, 
00317                 XPFBOOL bVisible, 
00318                 XPFBOOL bLocked, 
00319                 XPFBOOL bPrintable, 
00320                 XPFBOOL bActive, 
00321                 XPFBOOL bBackground, 
00322                 XPFBOOL bGuide,
00323                 XPFProp ContentOnly)
00324         : XPFCComplexClass(CC_RUNTIME_CLASS(Layer), ConvertType)
00325     {
00326         m_bVisible = bVisible;
00327         m_bLocked = bLocked;
00328         m_bPrintable = bPrintable;
00329         m_bActive = bActive;
00330         m_bBackground = bBackground;
00331         m_bGuide = bGuide;
00332         m_ContentOnly = ContentOnly;
00333     }
00334     virtual ~XPFCLayer()
00335     {
00336     }
00337 
00338 protected:
00339     virtual BOOL DoesNodeMatch(Node* pNode);
00340 
00341 protected:
00342     XPFBOOL m_bVisible;
00343     XPFBOOL m_bLocked;
00344     XPFBOOL m_bPrintable;
00345     XPFBOOL m_bActive;
00346     XPFBOOL m_bBackground;
00347     XPFBOOL m_bGuide;
00348     XPFProp m_ContentOnly;
00349 };
00350 
00351 
00352 /********************************************************************************************
00353 
00354 >   class XPFCContour : public XPFCComplexClass
00355 
00356     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00357     Created:    26/01/05
00358     Purpose:    This is the class for Contour capabilities
00359 
00360 ********************************************************************************************/
00361 
00362 class XPFCContour : public XPFCComplexClass
00363 {
00364     // Give my name in memory dumps
00365     CC_DECLARE_MEMDUMP(XPFCContour);
00366 
00367 public:
00368     XPFCContour(XPFConvertType ConvertType)
00369         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeContourController), ConvertType)
00370     {
00371     }
00372     virtual ~XPFCContour()
00373     {
00374     }
00375 
00376 protected:
00377 //  virtual BOOL DoesNodeMatch(Node* pNode);    // Just uses the ComplexClass version
00378 
00379 protected:
00380 };
00381 
00382 
00383 /********************************************************************************************
00384 
00385 >   class XPFCShadow : public XPFCComplexClass
00386 
00387     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00388     Created:    26/01/05
00389     Purpose:    This is the class for Shadow capabilities
00390 
00391 ********************************************************************************************/
00392 
00393 class XPFCShadow : public XPFCComplexClass
00394 {
00395     // Give my name in memory dumps
00396     CC_DECLARE_MEMDUMP(XPFCShadow);
00397 
00398 public:
00399     XPFCShadow(XPFConvertType ConvertType, XPFProp Type)
00400         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeShadowController), ConvertType)
00401     {
00402         m_Type = Type;
00403     }
00404     virtual ~XPFCShadow()
00405     {
00406     }
00407 
00408 protected:
00409     virtual BOOL DoesNodeMatch(Node* pNode);
00410 
00411 protected:
00412     XPFProp m_Type;
00413 };
00414 
00415 
00416 /********************************************************************************************
00417 
00418 >   class XPFCBevel : public XPFCComplexClass
00419 
00420     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00421     Created:    26/01/05
00422     Purpose:    This is the class for Bevel capabilities
00423 
00424 ********************************************************************************************/
00425 
00426 class XPFCBevel : public XPFCComplexClass
00427 {
00428     // Give my name in memory dumps
00429     CC_DECLARE_MEMDUMP(XPFCBevel);
00430 
00431 public:
00432     XPFCBevel(XPFConvertType ConvertType, XPFProp Type, XPFProp Side)
00433         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeBevelController), ConvertType)
00434     {
00435         m_Type = Type;
00436         m_Side = Side;
00437     }
00438     virtual ~XPFCBevel()
00439     {
00440     }
00441 
00442 protected:
00443     virtual BOOL DoesNodeMatch(Node* pNode);
00444 
00445 protected:
00446     XPFProp m_Type;
00447     XPFProp m_Side;
00448 };
00449 
00450 
00451 /********************************************************************************************
00452 
00453 >   class XPFCBlend : public XPFCComplexClass
00454 
00455     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00456     Created:    26/01/05
00457     Purpose:    This is the class for Blend capabilities
00458 
00459 ********************************************************************************************/
00460 
00461 class XPFCBlend : public XPFCComplexClass
00462 {
00463     // Give my name in memory dumps
00464     CC_DECLARE_MEMDUMP(XPFCBlend);
00465 
00466 public:
00467     XPFCBlend(XPFConvertType ConvertType, 
00468                 XPFProp Effect,
00469                 XPFBOOL bOnCurve,
00470                 XPFProp bObjProfile,
00471                 XPFProp bAttrProfile)
00472         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeBlend), ConvertType)
00473     {
00474         m_Effect = Effect;
00475         m_bOnCurve = bOnCurve;
00476         m_bObjProfile = bObjProfile;
00477         m_bAttrProfile = bAttrProfile;
00478     }
00479     virtual ~XPFCBlend()
00480     {
00481     }
00482 
00483 protected:
00484     virtual BOOL DoesNodeMatch(Node* pNode);
00485 
00486 protected:
00487     XPFProp m_Effect;
00488     XPFBOOL m_bOnCurve;
00489     XPFProp m_bObjProfile;
00490     XPFProp m_bAttrProfile;
00491 };
00492 
00493 
00494 /********************************************************************************************
00495 
00496 >   class XPFCMould : public XPFCComplexClass
00497 
00498     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00499     Created:    26/01/05
00500     Purpose:    This is the class for Mould capabilities
00501 
00502 ********************************************************************************************/
00503 
00504 class XPFCMould : public XPFCComplexClass
00505 {
00506     // Give my name in memory dumps
00507     CC_DECLARE_MEMDUMP(XPFCMould);
00508 
00509 public:
00510     XPFCMould(XPFConvertType ConvertType, XPFProp Type, XPFBOOL bGradFill)
00511         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeMould), ConvertType)
00512     {
00513         m_Type = Type;
00514         m_bGradFill = bGradFill;
00515     }
00516     virtual ~XPFCMould()
00517     {
00518     }
00519 
00520 protected:
00521     virtual BOOL DoesNodeMatch(Node* pNode);
00522     BOOL HasGraduatedFill(Node* pNode);
00523 
00524 protected:
00525     XPFProp m_Type;
00526     XPFBOOL m_bGradFill;
00527 };
00528 
00529 
00530 /********************************************************************************************
00531 
00532 >   class XPFCRectangle : public XPFCComplexClass
00533 
00534     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00535     Created:    26/01/05
00536     Purpose:    This is the class for Rectangle capabilities
00537 
00538 ********************************************************************************************/
00539 
00540 class XPFCRectangle : public XPFCComplexClass
00541 {
00542     // Give my name in memory dumps
00543     CC_DECLARE_MEMDUMP(XPFCRectangle);
00544 
00545 public:
00546     XPFCRectangle(XPFConvertType ConvertType, XPFBOOL bComplex, XPFBOOL bRounded, XPFBOOL bStellated, XPFBOOL bReformed)
00547         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeRegularShape), ConvertType)
00548     {
00549         m_bComplex = bComplex;
00550         m_bRounded = bRounded;
00551         m_bStellated = bStellated;
00552         m_bReformed = bReformed;
00553     }
00554     virtual ~XPFCRectangle()
00555     {
00556     }
00557 
00558 protected:
00559     virtual BOOL DoesNodeMatch(Node* pNode);
00560 
00561 protected:
00562     XPFBOOL m_bComplex;
00563     XPFBOOL m_bRounded;
00564     XPFBOOL m_bStellated;
00565     XPFBOOL m_bReformed;
00566 };
00567 
00568 
00569 /********************************************************************************************
00570 
00571 >   class XPFCEllipse : public XPFCComplexClass
00572 
00573     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00574     Created:    26/01/05
00575     Purpose:    This is the class for Ellipse capabilities
00576 
00577 ********************************************************************************************/
00578 
00579 class XPFCEllipse : public XPFCComplexClass
00580 {
00581     // Give my name in memory dumps
00582     CC_DECLARE_MEMDUMP(XPFCEllipse);
00583 
00584 public:
00585     XPFCEllipse(XPFConvertType ConvertType, XPFBOOL bComplex)
00586         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeRegularShape), ConvertType)
00587     {
00588         m_bComplex = bComplex;
00589     }
00590     virtual ~XPFCEllipse()
00591     {
00592     }
00593 
00594 protected:
00595     virtual BOOL DoesNodeMatch(Node* pNode);
00596 
00597 protected:
00598     XPFBOOL m_bComplex;
00599 };
00600 
00601 
00602 /********************************************************************************************
00603 
00604 >   class XPFCPolygon : public XPFCComplexClass
00605 
00606     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00607     Created:    26/01/05
00608     Purpose:    This is the class for Polygon capabilities
00609 
00610 ********************************************************************************************/
00611 
00612 class XPFCPolygon : public XPFCComplexClass
00613 {
00614     // Give my name in memory dumps
00615     CC_DECLARE_MEMDUMP(XPFCPolygon);
00616 
00617 public:
00618     XPFCPolygon(XPFConvertType ConvertType, XPFBOOL bRounded, XPFBOOL bStellated, XPFBOOL bReformed)
00619         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeRegularShape), ConvertType)
00620     {
00621         m_bRounded = bRounded;
00622         m_bStellated = bStellated;
00623         m_bReformed = bReformed;
00624     }
00625     virtual ~XPFCPolygon()
00626     {
00627     }
00628 
00629 protected:
00630     virtual BOOL DoesNodeMatch(Node* pNode);
00631 
00632 protected:
00633     XPFBOOL m_bRounded;
00634     XPFBOOL m_bStellated;
00635     XPFBOOL m_bReformed;
00636 };
00637 
00638 
00639 /********************************************************************************************
00640 
00641 >   class XPFCBitmap : public XPFCComplexClass
00642 
00643     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00644     Created:    26/01/05
00645     Purpose:    This is the class for Bitmap capabilities
00646 
00647 ********************************************************************************************/
00648 
00649 class XPFCBitmap : public XPFCComplexClass
00650 {
00651     // Give my name in memory dumps
00652     CC_DECLARE_MEMDUMP(XPFCBitmap);
00653 
00654 public:
00655     XPFCBitmap(XPFConvertType ConvertType, XPFBOOL bComplex, XPFBOOL bContone)
00656         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeBitmap), ConvertType)
00657     {
00658         m_bComplex = bComplex;
00659         m_bContone = bContone;
00660     }
00661     virtual ~XPFCBitmap()
00662     {
00663     }
00664 
00665 protected:
00666     virtual BOOL DoesNodeMatch(Node* pNode);
00667 
00668 protected:
00669     XPFBOOL m_bComplex;
00670     XPFBOOL m_bContone;
00671 };
00672 
00673 
00674 /********************************************************************************************
00675 
00676 >   class XPFCText : public XPFCComplexClass
00677 
00678     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00679     Created:    26/01/05
00680     Purpose:    This is the class for Text capabilities
00681 
00682 ********************************************************************************************/
00683 
00684 class XPFCText : public XPFCComplexClass
00685 {
00686     // Give my name in memory dumps
00687     CC_DECLARE_MEMDUMP(XPFCText);
00688 
00689 public:
00690     XPFCText(XPFConvertType ConvertType, XPFBOOL bOnPath, XPFBOOL bComplex, XPFBOOL bPlain, XPFBOOL bAutoKern, XPFBOOL bJustified)
00691         : XPFCComplexClass(CC_RUNTIME_CLASS(TextStory), ConvertType)
00692     {
00693         m_bOnPath = bOnPath;
00694         m_bComplex = bComplex;
00695         m_bPlain = bPlain;
00696         m_bAutoKern = bAutoKern;
00697         m_bJustified = bJustified;
00698     }
00699     virtual ~XPFCText()
00700     {
00701     }
00702 
00703 protected:
00704     virtual BOOL DoesNodeMatch(Node* pNode);
00705     BOOL IsNodeJustified(Node* pNode);
00706 
00707 protected:
00708     XPFBOOL m_bOnPath;
00709     XPFBOOL m_bComplex;
00710     XPFBOOL m_bPlain;
00711     XPFBOOL m_bAutoKern;
00712     XPFBOOL m_bJustified;
00713 };
00714 
00715 
00716 
00717 /********************************************************************************************
00718 
00719 >   class XPFCClipView : public XPFCComplexClass
00720 
00721     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00722     Created:    26/01/05
00723     Purpose:    This is the class for ClipView capabilities
00724 
00725 ********************************************************************************************/
00726 
00727 class XPFCClipView : public XPFCComplexClass
00728 {
00729     // Give my name in memory dumps
00730     CC_DECLARE_MEMDUMP(XPFCClipView);
00731 
00732 public:
00733     XPFCClipView(XPFConvertType ConvertType)
00734         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeClipViewController), ConvertType)
00735     {
00736     }
00737     virtual ~XPFCClipView()
00738     {
00739     }
00740 
00741 protected:
00742 //  virtual BOOL DoesNodeMatch(Node* pNode);    // Just uses the ComplexClass version
00743 
00744 protected:
00745 };
00746 
00747 
00748 /********************************************************************************************
00749 
00750 >   class XPFCBitmapEffect : public XPFCComplexClass
00751 
00752     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00753     Created:    26/01/05
00754     Purpose:    This is the class for BitmapEffect capabilities
00755 
00756 ********************************************************************************************/
00757 
00758 class XPFCBitmapEffect : public XPFCComplexClass
00759 {
00760     // Give my name in memory dumps
00761     CC_DECLARE_MEMDUMP(XPFCBitmapEffect);
00762 
00763 public:
00764     XPFCBitmapEffect(XPFConvertType ConvertType)
00765         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeBitmapEffect), ConvertType)
00766     {
00767     }
00768     virtual ~XPFCBitmapEffect()
00769     {
00770     }
00771 
00772 protected:
00773 //  virtual BOOL DoesNodeMatch(Node* pNode);    // Just uses the ComplexClass version for now
00774 
00775 protected:
00776 };
00777 
00778 
00779 
00780 /********************************************************************************************
00781 
00782 >   class XPFCFill : public XPFCapability
00783 
00784     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00785     Created:    26/01/05
00786     Purpose:    This is the class for Fill capabilities
00787 
00788 ********************************************************************************************/
00789 
00790 class XPFCFill : public XPFCapability
00791 {
00792     // Give my name in memory dumps
00793     CC_DECLARE_MEMDUMP(XPFCFill);
00794 
00795 public:
00796     XPFCFill(XPFConvertType ConvertType, XPFProp Shape, XPFProp Repeat, XPFBOOL bMultistage, XPFProp Effect, XPFBOOL bProfile, XPFBOOL bContone)
00797         : XPFCapability(ConvertType)
00798     {
00799         m_Shape = Shape;
00800         m_Repeat = Repeat;
00801         m_bMultistage = bMultistage;
00802         m_Effect = Effect;
00803         m_bProfile = bProfile;
00804         m_bContone = bContone;
00805     }
00806     virtual ~XPFCFill()
00807     {
00808     }
00809 
00810 
00811 protected:
00812     virtual BOOL DoAttributesMatch(RenderRegion* pRegion);
00813 
00814 protected:
00815     XPFProp m_Shape;
00816     XPFProp m_Repeat;
00817     XPFBOOL m_bMultistage;
00818     XPFProp m_Effect;
00819     XPFBOOL m_bProfile;
00820     XPFBOOL m_bContone;
00821 };
00822 
00823 
00824 /********************************************************************************************
00825 
00826 >   class XPFCFillTrans : public XPFCapability
00827 
00828     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00829     Created:    26/01/05
00830     Purpose:    This is the class for FillTrans capabilities
00831 
00832 ********************************************************************************************/
00833 
00834 class XPFCFillTrans : public XPFCapability
00835 {
00836     // Give my name in memory dumps
00837     CC_DECLARE_MEMDUMP(XPFCFillTrans);
00838 
00839 public:
00840     XPFCFillTrans(XPFConvertType ConvertType, XPFProp Shape, XPFProp Type, XPFProp Repeat, XPFBOOL bProfile)
00841         : XPFCapability(ConvertType)
00842     {
00843         m_Shape = Shape;
00844         m_Type = Type;
00845         m_Repeat = Repeat;
00846         m_bProfile = bProfile;
00847     }
00848     virtual ~XPFCFillTrans()
00849     {
00850     }
00851 
00852 
00853 protected:
00854     virtual BOOL DoAttributesMatch(RenderRegion* pRegion);
00855 
00856 protected:
00857     XPFProp m_Shape;
00858     XPFProp m_Type;
00859     XPFProp m_Repeat;
00860     XPFBOOL m_bProfile;
00861 };
00862 
00863 
00864 /********************************************************************************************
00865 
00866 >   class XPFCLine : public XPFCapability
00867 
00868     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00869     Created:    26/01/05
00870     Purpose:    This is the class for Line capabilities
00871 
00872 ********************************************************************************************/
00873 
00874 class XPFCLine : public XPFCapability
00875 {
00876     // Give my name in memory dumps
00877     CC_DECLARE_MEMDUMP(XPFCLine);
00878 
00879 public:
00880     XPFCLine(XPFConvertType ConvertType, XPFBOOL bDash, XPFBOOL bArrowhead, XPFProp Cap, XPFProp Join, XPFBOOL bStroke, XPFBOOL bBrush)
00881         : XPFCapability(ConvertType)
00882     {
00883         m_bDash = bDash;
00884         m_bArrowhead = bArrowhead;
00885         m_Cap = Cap;
00886         m_Join = Join;
00887         m_bStroke = bStroke;
00888         m_bBrush = bBrush;
00889     }
00890     virtual ~XPFCLine()
00891     {
00892     }
00893 
00894 
00895 protected:
00896     virtual BOOL DoAttributesMatch(RenderRegion* pRegion);
00897 
00898 protected:
00899     XPFBOOL m_bDash;
00900     XPFBOOL m_bArrowhead;
00901     XPFProp m_Cap;
00902     XPFProp m_Join;
00903     XPFBOOL m_bStroke;
00904     XPFBOOL m_bBrush;
00905 };
00906 
00907 
00908 /********************************************************************************************
00909 
00910 >   class XPFCLineTrans : public XPFCapability
00911 
00912     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00913     Created:    26/01/05
00914     Purpose:    This is the class for LineTrans capabilities
00915 
00916 ********************************************************************************************/
00917 
00918 class XPFCLineTrans : public XPFCapability
00919 {
00920     // Give my name in memory dumps
00921     CC_DECLARE_MEMDUMP(XPFCLineTrans);
00922 
00923 public:
00924     XPFCLineTrans(XPFConvertType ConvertType, XPFProp Type)
00925         : XPFCapability(ConvertType)
00926     {
00927         m_Type = Type;
00928     }
00929     virtual ~XPFCLineTrans()
00930     {
00931     }
00932 
00933 
00934 protected:
00935     virtual BOOL DoAttributesMatch(RenderRegion* pRegion);
00936 
00937 protected:
00938     XPFProp m_Type;
00939 };
00940 
00941 
00942 /********************************************************************************************
00943 
00944 >   class XPFCFeather : public XPFCapability
00945 
00946     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00947     Created:    26/01/05
00948     Purpose:    This is the class for Feather capabilities
00949 
00950 ********************************************************************************************/
00951 
00952 class XPFCFeather : public XPFCapability
00953 {
00954     // Give my name in memory dumps
00955     CC_DECLARE_MEMDUMP(XPFCFeather);
00956 
00957 public:
00958     XPFCFeather(XPFConvertType ConvertType)
00959         : XPFCapability(ConvertType)
00960     {
00961     }
00962     virtual ~XPFCFeather()
00963     {
00964     }
00965 
00966 
00967 protected:
00968     virtual BOOL DoesNodeMatch(Node* pNode);
00969     virtual BOOL DoAttributesMatch(RenderRegion* pRegion);
00970 
00971 protected:
00972 };
00973 
00974 
00975 
00976 /********************************************************************************************
00977 
00978 >   class XPFCColour : public XPFCapability
00979 
00980     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00981     Created:    26/01/05
00982     Purpose:    This is the class for Colour capabilities
00983 
00984 ********************************************************************************************/
00985 
00986 class XPFCColour : public XPFCapability
00987 {
00988     // Give my name in memory dumps
00989     CC_DECLARE_MEMDUMP(XPFCColour);
00990 
00991 public:
00992     XPFCColour(XPFConvertType ConvertType)
00993         : XPFCapability(ConvertType)
00994     {
00995     }
00996     virtual ~XPFCColour()
00997     {
00998     }
00999 
01000 
01001 protected:
01002     virtual BOOL DoesColourMatch(DocColour* pColour) { return(TRUE); }
01003 
01004 protected:
01005 };
01006 
01007 
01008 
01009 
01010 
01011 /********************************************************************************************
01012 
01013 >   class CapabilityTree : public CC_CLASS_MEMDUMP
01014 
01015     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
01016     Created:    26/01/05
01017     Purpose:    This is the class representing the wntire capability tree
01018 
01019 ********************************************************************************************/
01020 
01021 class CapabilityTree : public CC_CLASS_MEMDUMP
01022 {
01023     // Give my name in memory dumps
01024     CC_DECLARE_MEMDUMP(CapabilityTree);
01025 
01026 public:
01027     CapabilityTree()
01028     {
01029         // Set some sensible defaults (these will result in no conversions at all)
01030         m_BoundsLevel = BWL_NONE;
01031         m_bSelection = FALSE;
01032         m_bPreviewBitmap = FALSE;
01033         m_RasteriseDPI = 96.0;
01034         m_bRasteriseAlpha = TRUE;
01035         m_BitmapCompression = 200;
01036         m_bResample = FALSE;
01037         m_SpreadType = XPFCONVTYPE_NATIVE;
01038         m_pObjects = NULL;
01039         m_ObjectsType = XPFCONVTYPE_NATIVE;
01040         m_pAttributes = NULL;
01041         m_AttributesType = XPFCONVTYPE_NATIVE;
01042         m_pColours = NULL;
01043         m_ColoursType = XPFCONVTYPE_NATIVE;
01044     }
01045     virtual ~CapabilityTree()
01046     {
01047         // Clean up the capability trees
01048         XPFCapability* pNext = NULL;
01049         XPFCapability* pCap = m_pObjects;
01050         while (pCap)
01051         {
01052             pNext = pCap->GetNext();
01053             delete pCap;
01054             pCap = pNext;
01055         }
01056 
01057         pCap = m_pAttributes;
01058         while (pCap)
01059         {
01060             pNext = pCap->GetNext();
01061             delete pCap;
01062             pCap = pNext;
01063         }
01064 
01065         pCap = m_pColours;
01066         while (pCap)
01067         {
01068             pNext = pCap->GetNext();
01069             delete pCap;
01070             pCap = pNext;
01071         }
01072     }
01073 
01074     XPFConvertType GetConvertTypePass1(Node* pNode, XPFRenderRegion* pRegion);
01075     XPFConvertType GetConvertTypePass2(Node* pNode, XPFRenderRegion* pRegion);
01076     void GetConvertTypePass3(Node* pNode, XPFRenderRegion* pRegion, BOOL* pbFill, BOOL* pbTrans, BOOL* pbFillTrans);
01077     XPFConvertType GetConvertTypePass4(Node* pNode, XPFRenderRegion* pRegion);
01078     XPFConvertType GetConvertTypePass5(Node* pNode, XPFRenderRegion* pRegion);
01079 
01080     void SetSelection(BOOL bSelection) { m_bSelection = bSelection; }
01081     void SetBoundsLevel(BoundsWriteLevel Level) { m_BoundsLevel = Level; }
01082     void SetPreviewBitmap(BOOL bPreviewBitmap) { m_bPreviewBitmap = bPreviewBitmap; }
01083     
01084     void SetSpreadType(XPFConvertType Type) { m_SpreadType = Type; }
01085 
01086     void SetRasterise(double DPI, BOOL bAlpha, INT32 Compression, const String_256& CommonTrans, BOOL bResample)
01087     {
01088         m_RasteriseDPI = DPI;
01089         m_bRasteriseAlpha = bAlpha;
01090         m_BitmapCompression = Compression;
01091         m_CommonTrans = CommonTrans;
01092         m_bResample = bResample;
01093     }
01094 
01095     void SetObjectsTree(XPFCapability* pObjects, XPFConvertType ObjectsType)
01096     {
01097         ERROR3IF(m_pObjects, "Already have an Objects tree");
01098         m_pObjects = pObjects;
01099         m_ObjectsType = ObjectsType;
01100     }
01101 
01102     void SetAttributesTree(XPFCapability* pAttributes, XPFConvertType AttributesType)
01103     {
01104         ERROR3IF(m_pAttributes, "Already have an Attributes tree");
01105         m_pAttributes = pAttributes;
01106         m_AttributesType = AttributesType;
01107     }
01108 
01109     void SetColoursTree(XPFCapability* pColours, XPFConvertType ColoursType)
01110     {
01111         ERROR3IF(m_pColours, "Already have a Colours tree");
01112         m_pColours = pColours;
01113         m_ColoursType = ColoursType;
01114     }
01115 
01116     BOOL GetSelection() { return(m_bSelection); }
01117     BoundsWriteLevel GetBoundsLevel() { return(m_BoundsLevel); }
01118     BOOL GetPreviewBitmap() { return(m_bPreviewBitmap); }
01119 
01120     double GetRasteriseDPI() { return(m_RasteriseDPI); }
01121     BOOL GetRasteriseAlpha() { return(m_bRasteriseAlpha); }
01122     BOOL GetBitmapCompression() { return(m_BitmapCompression); }
01123     BOOL HasRasteriseCommonTrans() { return(!m_CommonTrans.IsEmpty()); }
01124     // Move this into cpp file when implemented
01125     BOOL IsRasteriseCommonTrans(UINT32 Type);
01126     BOOL GetBitmapResample() { return(m_bResample); }
01127 
01128     XPFCapability* GetObjects(void) const { return(m_pObjects); }
01129     XPFCapability* GetAttributes(void) const { return(m_pAttributes); }
01130     XPFCapability* GetColours(void) const { return(m_pColours); }
01131 
01132     XPFConvertType GetObjectsType(void) const { return(m_ObjectsType); }
01133     XPFConvertType GetAttributesType(void) const { return(m_AttributesType); }
01134     XPFConvertType GetColoursType(void) const { return(m_ColoursType); }
01135 
01136 
01137 protected:
01138     BoundsWriteLevel m_BoundsLevel;
01139     BOOL m_bSelection;
01140     BOOL m_bPreviewBitmap;
01141 
01142     double m_RasteriseDPI;
01143     BOOL m_bRasteriseAlpha;
01144     INT32 m_BitmapCompression;
01145     String_256 m_CommonTrans;
01146     BOOL m_bResample;
01147 
01148     XPFConvertType m_SpreadType;
01149     
01150     XPFCapability* m_pObjects;
01151     XPFConvertType m_ObjectsType;
01152     XPFCapability* m_pAttributes;
01153     XPFConvertType m_AttributesType;
01154     XPFCapability* m_pColours;
01155     XPFConvertType m_ColoursType;
01156 };
01157 
01158 
01159 #endif  // INC_XPFCAPS

Generated on Sat Nov 10 03:47:24 2007 for Camelot by  doxygen 1.4.4