prnmks.h

Go to the documentation of this file.
00001 // $Id: prnmks.h 1346 2006-06-20 20:35:06Z alex $
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 // Header file for Camelots Print Marks Manager.
00099 
00100 /*
00101 */
00102 
00103 #ifndef INC_PRINTMARKS
00104 #define INC_PRINTMARKS
00105 
00106 //#include "list.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00107 //#include "listitem.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00108 #include "lddirect.h"
00109 //#include "doccoord.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00110 //#include "docrect.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00111 
00112 class String_256;
00113 class NodeGroup;
00114 class PrintMarksMan;
00115 class PrintMarksComponent;
00116 class TextStory;
00117 
00118 // Representative of a pseduo mark
00119 
00120 #define MAXPAGEREGIONS      16
00121 #define MAXREGIONMARKS      8
00122 #define INCH                72000
00123 #define CROPMARK_THICKNESS  425         // (0.15mm*72000/25.4)
00124 #define CROPMARK_LENGTH     27360       // (38*72000/100) 0.38 inch in length
00125 #define CROPAREA_SIZE       27360       // size reserved for crop marks
00126 #define OUTSIDEBLEEDWIDTH   0           // space to position marks beyond the bleed
00127 
00128 /*****************************************************************************************
00129 
00130 >   class LoadPrintMarks : public LoadDirect
00131 
00132     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00133     Created:    06/08/96
00134     Purpose:    A derived class to load the print marks. Uses the winoil class LoadDirect
00135 
00136 *****************************************************************************************/
00137 
00138 class LoadPrintMarks : public LoadDirect
00139 {
00140     CC_DECLARE_MEMDUMP(LoadPrintMarks);
00141 
00142     public:
00143         virtual ~LoadPrintMarks() {}
00144 
00145     protected:
00146         virtual BOOL OnLoadDocument(Document* pKernelDoc);
00147 };
00148 
00149 
00150 /*****************************************************************************************
00151 > enum MarkType - specify all the types of print mark we know about
00152 *****************************************************************************************/
00153 
00154 enum MarkType                   // These values are used in the file format - do not change
00155 {
00156     MarkType_Unknown = 0,               // A user mark with an unknown ID, (ie no fabby icon)
00157     MarkType_Star,
00158     MarkType_Registration,
00159     MarkType_ColourBar,
00160     MarkType_GreyBar,
00161     MarkType_Information,
00162     MarkType_Crop
00163 };
00164 
00165 
00166 /*****************************************************************************************
00167 >   enum MarkRegion, the 20 named regions around the page
00168 *****************************************************************************************/
00169 
00170 enum MarkRegion
00171 {
00172     MarkRegion_TopLeft = 0,     // These values are used in the file format - do not change
00173     MarkRegion_Top1,
00174     MarkRegion_Top2,       
00175     MarkRegion_Top3,       
00176     MarkRegion_TopRight,
00177     MarkRegion_Right1,     
00178     MarkRegion_Right2,     
00179     MarkRegion_Right3,     
00180     MarkRegion_BottomRight,
00181     MarkRegion_Bottom3,    
00182     MarkRegion_Bottom2,    
00183     MarkRegion_Bottom1,    
00184     MarkRegion_BottomLeft,
00185     MarkRegion_Left1,      
00186     MarkRegion_Left2,      
00187     MarkRegion_Left3,
00188 
00189     MarkRegion_FileFormatTerminator = 0xff
00190 };
00191 
00192 
00193 /*****************************************************************************************
00194 > Class MarkFormat - specify all the formatting types we can cope with
00195 *****************************************************************************************/
00196 
00197 class MarkFormat
00198 {
00199     public:
00200         MarkFormat();
00201         
00202         BOOL IsValid() const;
00203         void MakeValid();
00204 
00205         friend INT32 operator==(const MarkFormat& x, const MarkFormat& y);
00206 
00207     public:     // Support functions for load/save in native files
00208         BYTE GetAsFlagByte(void);
00209         void SetFromFlagByte(BYTE Flags);
00210 
00211     public:
00212         BYTE    Left    : 1;
00213         BYTE    Centre  : 1;
00214         BYTE    Right   : 1;
00215         BYTE    Top     : 1;
00216         BYTE    Middle  : 1;
00217         BYTE    Bottom  : 1;
00218         BYTE    unused  : 1;
00219         BYTE    unused1 : 1;
00220 };
00221 
00222 /*****************************************************************************************
00223 >   enum MarkOrient, describes the orientation of this mark
00224 *****************************************************************************************/
00225 
00226 enum MarkOrient
00227 {
00228     MO_None = 0,            // These values are used in the file format - do not change
00229     MO_Vertical = 1,
00230     MO_Horizontal = 2
00231 };
00232 
00233 
00234 
00235 
00236 /*****************************************************************************************
00237 
00238 >   class MarkPosition : public ListItem
00239 
00240     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00241     Created:    23/07/96
00242     Purpose:    An instance of a mark lives in a particular region and not only this, 
00243                 contains a format and a transform
00244 
00245 *****************************************************************************************/
00246 
00247 class MarkPosition : public ListItem
00248 {
00249     CC_DECLARE_DYNCREATE(MarkPosition);
00250 
00251     public:
00252         MarkPosition();
00253 
00254         void Initialise();
00255 
00256         void SetRegion(MarkRegion region) { Region = region; }
00257         void SetFormat(MarkFormat format) { Format = format; }
00258 
00259         inline MarkFormat       GetFormat() const { return Format; }
00260         inline MarkRegion       GetRegion() const { return Region; }
00261 
00262         BOOL        IsEqualTo(const MarkPosition* pOther) const;
00263 
00264     private:
00265         MarkRegion  Region;
00266         MarkFormat  Format;
00267 };
00268 
00269 
00270 // Default Print Mark ID's - These must NOT be changed, as they are used as unique IDs
00271 // in the native file format. The marks loaded from the mark template file use unique
00272 // IDs from 2 to 7 (the last time I looked).
00273 const BYTE PRINTMARK_CROPMARKID = 0;
00274 const BYTE PRINTMARK_INFOMARKID = 1;
00275 
00276 
00277 /*****************************************************************************************
00278 
00279 >   class PrintMark : public CC_CLASS_MEMDUMP
00280 
00281     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00282     Created:    23/07/96
00283     Purpose:    This class contains all the information pertaining to a mark. ie the
00284                 type of mark it is, its menu text, icon id and a list of all the regions
00285                 and formatting rules it uses.
00286 
00287 *****************************************************************************************/
00288 
00289 class PrintMark : public CC_CLASS_MEMDUMP
00290 {
00291     CC_DECLARE_MEMDUMP(PrintMark);
00292 
00293     public:
00294          PrintMark();
00295         ~PrintMark();
00296 
00297         void        SetCustomOrDefault(BOOL IsCustom)   { MarkIsCustom = IsCustom; }
00298         void        SetIDByte(BYTE NewID)               { IDByte = NewID; }
00299         void        SetType(MarkType type)              { Type = type; }
00300         void        SetMarkMenuText(const String_256* pMenuText);
00301         void        SetOrientation(MarkOrient orient)   { Orientation = orient; }
00302         void        SetDefaultState(BOOL enabled)       { OnAsDefault = enabled; }
00303 
00304         void        AddNewPosition(MarkPosition* pMarkPos);
00305         BOOL        DefaultsToOn() const                { return OnAsDefault; }
00306         
00307         BOOL        IsCustom(void) const                { return(MarkIsCustom); }
00308         BYTE        GetIDByte(void) const               { return(IDByte); }
00309         MarkType    GetType() const                     { return Type; }
00310         String_256  GetMarkMenuText() const;
00311         BOOL        FindMarkPosition(const MarkPosition* pSearchMark, MarkPosition** pFoundMark=NULL) const;
00312         BOOL        IsSimilarTo(const PrintMark* pOther) const;
00313         
00314         inline MarkOrient GetOrientation() const        { return Orientation; }
00315 
00316         inline MarkPosition* GetFirstPosition() const   { return (MarkPosition*)MarkPositions.GetHead(); }
00317         
00318         inline MarkPosition* GetNextPosition(MarkPosition* pMP) const
00319                                                         { return (MarkPosition*)MarkPositions.GetNext(pMP); }
00320 
00321     private:
00322         BOOL            MarkIsCustom;
00323         BYTE            IDByte;
00324         MarkType        Type;
00325         MarkOrient      Orientation;
00326         BOOL            OnAsDefault;
00327         String_256      MenuText;
00328         List            MarkPositions;
00329 };
00330 
00331 
00332 /*****************************************************************************************
00333 
00334 >   class PrintMarkItem : public ListItem
00335             
00336     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00337     Created:    23/07/96
00338     Purpose:    The PrintMarkItem contains details about this print mark. It holds the
00339                 mark type, formatting information and a pointer to a subtree of objects
00340                 which represent the mark. It also contains various bits of information
00341                 used by Camelots UI to present the mark to the user.
00342 
00343 *****************************************************************************************/
00344 
00345 class PrintMarkItem : public ListItem
00346 {
00347     CC_DECLARE_DYNCREATE(PrintMarkItem);
00348 
00349     friend class PrintMarksCache;
00350 
00351     public:
00352          PrintMarkItem();
00353         ~PrintMarkItem();
00354 
00355         inline NodeGroup*  GetMarkGlyph() const { return pMarkGlyph; }
00356         inline UINT32      GetHandle() const    { return Handle; }
00357         inline PrintMark*  GetPrintMark()       { return &Mark; }
00358         
00359         INT32       GetWidth() const;
00360         INT32       GetHeight() const;
00361         DocCoord    GetOrigin() const;
00362         MarkOrient  GetOrient() const;
00363         BOOL        DefaultsToOn() const;
00364         BOOL        NeedsSaving() const;
00365         BOOL        NeedsToRender() const;
00366 
00367     private:
00368         void        RemoveMark();
00369         void        SetType(MarkType type)  { Mark.SetType(type); }
00370         void        SetHandle(UINT32 hndle) { Handle=hndle; }
00371         BOOL        SetMarkGlyph(NodeGroup* pMark, BOOL MakeCopy=FALSE);
00372         void        SetSaveable(BOOL state);
00373         void        SetRenderable(BOOL state);
00374 
00375     private:
00376         UINT32      Handle;
00377         PrintMark   Mark;
00378         NodeGroup*  pMarkGlyph;
00379         BOOL        Saveable;
00380         BOOL        Renderable;
00381 };
00382 
00383 
00384 
00385 
00386 
00387 
00388 
00389 /*****************************************************************************************
00390 
00391 >   class PageMarkRegion
00392             
00393     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00394     Created:    10/08/96
00395     Purpose:    Holds the position and orientation of a page mark region. ie the region
00396                 a page mark will be formatted in. There are current 16 regions around
00397                 a typical page each having a vertical or horizontal orientation.
00398     SeeAlso:
00399 
00400 *****************************************************************************************/
00401 
00402 class PageMarkRegion
00403 {
00404     public:
00405         PageMarkRegion();
00406     
00407     public:
00408         BOOL        OrientX;
00409         BOOL        Valid;
00410         DocRect     Pos;
00411 };
00412 
00413 
00414 /*****************************************************************************************
00415 
00416 >   class PageMarkRegions
00417             
00418     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00419     Created:    10/08/96
00420     Purpose:    A simple structure holding the positions of all 16 page mark regions
00421                 around a typical page. The constructor of this class creates the regions
00422                 given the bounding rect of a page.
00423     SeeAlso:    PageMarkRegion
00424 
00425 *****************************************************************************************/
00426 
00427 class PageMarkRegions
00428 {
00429     public:
00430         PageMarkRegions();
00431         
00432         void Initialise(const DocRect& ParentPage, MILLIPOINT Bleed);
00433         
00434         void HideLeft();
00435         void HideRight();
00436         void HideTop();
00437         void HideBottom();
00438 
00439         void ShowLeft();
00440         void ShowRight();
00441         void ShowTop();
00442         void ShowBottom();
00443 
00444     public: 
00445         PageMarkRegion  Region[MAXPAGEREGIONS];
00446 };
00447 
00448 
00449 
00450 
00451 
00452 
00453 /*****************************************************************************************
00454 
00455 >   class MarkPosType
00456             
00457     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00458     Created:    10/08/96
00459     Purpose:
00460     SeeAlso:
00461 
00462 *****************************************************************************************/
00463 
00464 class MarkPosType
00465 {
00466     public:
00467         MarkPosType();
00468 
00469         PrintMarkItem *pMarkItem;
00470         DocCoord pos;
00471         DocCoord dim;
00472         BOOL rotate;
00473 };
00474 
00475 
00476 /*****************************************************************************************
00477 
00478 >   class MarkList
00479             
00480     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00481     Created:    10/08/96
00482     Purpose:    Holds an array of up to 8 marks formatted into a particular position eg
00483                 middle centre in a particular region (of which there can be 16 around a
00484                 page).
00485     SeeAlso:
00486 
00487 *****************************************************************************************/
00488 
00489 class MarkList
00490 {
00491     public:
00492         MarkList();
00493 
00494     public: 
00495         INT32       count;
00496         DocCoord    curpos;
00497         DocCoord    size;
00498         MarkPosType MarkPos[MAXREGIONMARKS];
00499 };
00500 
00501 /*****************************************************************************************
00502 
00503 >   class MarkFormatRegion
00504             
00505     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00506     Created:    10/08/96
00507     Purpose:    The mark formatting region. Given a doc rect ie the position of the
00508                 region around the page, this class can be used to work out the position
00509                 of the marks which need to be formatted in this region ie those marks
00510                 which have been specified by the user to fall into this position. As
00511                 one adds marks, the formatting region updates itself and keeps track
00512                 of all mark positions. You can then call the formatting regions render
00513                 function which will use the positions so generated to render each mark
00514                 within it. On rendering, each mark will be asked to render itself at
00515                 a given position.
00516     SeeAlso:
00517 
00518 *****************************************************************************************/
00519 
00520 class MarkFormatRegion : public CC_CLASS_MEMDUMP
00521 {
00522     CC_DECLARE_MEMDUMP(MarkFormatRegion);
00523 
00524     public:
00525          MarkFormatRegion();
00526          MarkFormatRegion(const DocRect &Position);
00527          virtual ~MarkFormatRegion();
00528 
00529          void Empty();
00530          void SetPosition(const DocRect& Position);
00531          void SetOrientation(BOOL orientX=TRUE);
00532          void SetFlipRender(BOOL flip);
00533          
00534          virtual BOOL AddMark(PrintMarkItem* pMark, MarkFormat *pForm);
00535          virtual void Render(RenderRegion *pRRegion, const Matrix& Transform);
00536          
00537     protected:
00538          virtual BOOL MakeMark(PrintMarkItem *pMark, 
00539                                DocCoord Anchor,
00540                                BOOL cx,
00541                                BOOL cy,
00542                                BOOL posx,
00543                                BOOL posy,
00544                                INT32 shiftx,
00545                                INT32 shifty,
00546                                BOOL rotate,
00547                                MarkList **pMarkList);
00548 
00549     private:
00550         void  Render(RenderRegion *pRRegion, MarkList *pItem, const Matrix& Transform);
00551         void  RenderMark(RenderRegion* pRRegion, PrintMarkItem *pMark);
00552         Node* FindMarkChildToRender(Node* pParent, RenderRegion *const pRender);
00553         Node* FindMarkNextForClippedInkRender(Node* pRoot, Node* pNode, RenderRegion *pRender);
00554 
00555     private:
00556          void Init();
00557 
00558     private:                        
00559         DocRect   TheBounds;        // The position of this region
00560         INT32     MkCx;             // the centre of this region
00561         INT32     MkCy;
00562         BOOL      OrientX;          // Orientation of this mark region
00563         BOOL      OnRenderFlipX;    // Flip all marks in this region about X before rendering
00564 
00565         MarkList* BLeft;
00566         MarkList* BCentre;
00567         MarkList* BRight;
00568         MarkList* MLeft;
00569         MarkList* MCentre;
00570         MarkList* MRight;
00571         MarkList* TLeft;
00572         MarkList* TCentre;
00573         MarkList* TRight;
00574 };
00575 
00576 
00577 
00578 /*****************************************************************************************
00579 
00580 >   class PageRect : public ListItem
00581             
00582     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00583     Created:    23/07/96
00584     Purpose:    Stores a rectangle and thats it. When printing, the print manager adds
00585                 rectangles to this list
00586     SeeAlso:    
00587 
00588 *****************************************************************************************/
00589 
00590 class PageRect : public ListItem
00591 {
00592     CC_DECLARE_DYNCREATE(PageRect);
00593 
00594     public:
00595         PageRect() {};
00596         PageRect(const DocRect &rect);
00597 
00598     public:
00599         DocRect Rect;
00600 };
00601     
00602 
00603 
00604 /********************************************************************************************
00605 
00606 >   class PageRectList : public List
00607 
00608     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00609     Created:    31/07/96
00610     Purpose:    Keeps a list of page rectanges in order to service the crop mark renderer
00611 
00612 ********************************************************************************************/
00613 
00614 class PageRectList : public List
00615 {
00616     CC_DECLARE_DYNAMIC(PageRectList)
00617     
00618     public:
00619         PageRectList() {};
00620         virtual ~PageRectList();
00621 
00622         BOOL AddPageRect(const DocRect &rect);
00623         void DeleteAll();
00624 
00625         inline PageRect* GetFirstPageRect() const;
00626         inline PageRect* GetNextPageRect(PageRect* pItem) const;
00627 
00628         PageRect* FindPageRect(const DocRect &rect) const;
00629 };
00630 
00631 
00632 
00633 /*****************************************************************************************
00634 
00635 >   class PrintMarksCache : public CC_CLASS_MEMDUMP
00636             
00637     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00638     Created:    23/07/96
00639     Purpose:    The print marks cache. This class contains a list of cached printmarks
00640                 kept by the print marks manager. It is split into its own class here to
00641                 avoid complications will the mark managers handling of cache marks and
00642                 document component marks.
00643     SeeAlso:    
00644 
00645 *****************************************************************************************/
00646 
00647 class PrintMarksCache : public CC_CLASS_MEMDUMP
00648 {
00649     CC_DECLARE_MEMDUMP(PrintMarksCache);
00650 
00651     friend class PrintMarksMan;
00652     friend class LoadPrintMarks;
00653     friend class PrintMarksComponent;
00654 
00655     public:
00656          PrintMarksCache();
00657         ~PrintMarksCache();
00658 
00659         PrintMarkItem* GetFirstMark() const;
00660         PrintMarkItem* GetNextMark(PrintMarkItem* pCurrItem) const;
00661         PrintMarkItem* FindMark(UINT32 SearchHandle);
00662 
00663     private:
00664         BOOL    DecodeCachedLayers(Document* pDocument);
00665         BOOL    DecodeCachedLayer(Layer* pLayer);
00666         BOOL    DecodeMarkFormat(const String_256* pFormatString, PrintMark* pMark);
00667         UINT32  DecodeToMarkType(const String_256* Name) const;
00668         BOOL    DoesMarkExist(PrintMark* pCheckMark) const;
00669         UINT32  AddNewMark(PrintMarkItem* pCheckMark, NodeGroup* pGroup);
00670         void    UpdateMarkGlyph(PrintMarkItem *pMarkItem, NodeGroup *pGroup);
00671         BOOL    CreateTextInfoMark();
00672         BOOL    CreateCropMark();
00673         BOOL    UpdateTextInfoMark(Document* pDocument, RenderRegion* pRRegion);
00674         void    DestroyTextInfoMark();
00675         void    BuildTextInfoString(Document *pDocument, RenderRegion *pRegion, String_256 *pString);
00676         BOOL    SetInfoMarkAttributes(TextStory *pStory, String_64 *pFontName, MILLIPOINT FontSize);
00677         BOOL    DeleteChildAttribute(NodeRenderableInk* pParent, CCRuntimeClass* pReqdAttrib);
00678 
00679         UINT32  GetUniqueHandle();
00680         void    Invalidate();
00681 
00682     private:
00683         UINT32  NextHandle;
00684         UINT32  TextInfoHandle;
00685         UINT32  CropMarkHandle;
00686         List    PrintMarkCache;
00687         
00688         String_256  CachedTime;
00689 };
00690 
00691 
00692 /*****************************************************************************************
00693 
00694 >   class PrintMarksMan : public CC_CLASS_MEMDUMP
00695             
00696     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00697     Created:    23/07/96
00698     Purpose:    The 'Print Marks Manager'. This manager handles the installation, formatting
00699                 and rendering of printer marks. It liaises with the print box to provide
00700                 a UI to enable and disable print marks.
00701     SeeAlso:    Specification of print marks inside 'ImageSetting Phase 3' documentation
00702 
00703 *****************************************************************************************/
00704 
00705 class PrintMarksMan : public CC_CLASS_MEMDUMP
00706 {
00707     CC_DECLARE_MEMDUMP(PrintMarksMan);
00708     
00709     public:
00710         PrintMarksCache PMMCache;
00711 
00712          PrintMarksMan();
00713         ~PrintMarksMan();
00714 
00715         BOOL IsTemplateCached() const;
00716         BOOL ConstructCache();
00717         void InvalidateCache();
00718 
00719         BOOL AddMarkToDoc(UINT32 MarkHandle, Document* pDocument);
00720         BOOL RemoveMarkFromDoc(UINT32 MarkHandle, Document* pDocument);
00721         void ConvertAllDocColours(Document* pDoc);
00722         BOOL AddDefaultMarksToDoc(Document* pDocument);
00723 
00724         BOOL ShowPrintMarks(Document *ScopeDoc) const;
00725         void RenderPrintMarks(Document *ScopeDoc, BOOL DisplayEm=TRUE, BOOL LoadTemplateMarks=TRUE);
00726         void RenderPrintMarks(PrintMarksComponent *pComp, 
00727                               RenderRegion *pRRegion,
00728                               const Matrix &Transform,
00729                               const DocRect &ClipRect,
00730                               Spread *pSpread);
00731 
00732         void StartPrinting();
00733         BOOL AddPageRect(const DocRect &Rect);
00734         void ResetPageRects();
00735         void SetBleed(MILLIPOINT bleed);
00736         void SetEmulsionDown(BOOL state);
00737         void SetImagesettingRect();
00738         void EndPrinting();
00739         
00740         MILLIPOINT GetCropMarkWidth(Document *ScopeDoc) const;
00741         void ClipToBleed(RenderRegion *pRRegion, Spread *pSpread);
00742 
00743     private:
00744         void CompileMarkRegion(PrintMarksComponent *pComp, MarkRegion CurrRegion);
00745         void RenderPrintMarksAroundRect(PrintMarksComponent *pComp, 
00746                                         RenderRegion *pRRegion,
00747                                         const Matrix *pTrans,
00748                                         const DocRect &Rect,
00749                                         MILLIPOINT bleed);
00750         void RenderCropMarksAroundRect( RenderRegion *pRRegion,
00751                                         const Matrix *pTrans,
00752                                         const DocRect &Rect,
00753                                         MILLIPOINT bleed);
00754         MILLIPOINT AdjustedBleed() const;
00755 
00756     private:
00757         BOOL TemplateCached;
00758 
00759     private:
00760         MarkFormatRegion MFRegion;
00761         DocRect          ImagesettingRect;
00762         PageRectList     PageRects;
00763         MILLIPOINT       Bleed;
00764         BOOL             EmulsionDown;
00765 };
00766 
00767 
00768 #endif

Generated on Sat Nov 10 03:46:37 2007 for Camelot by  doxygen 1.4.4