LoadBrushDirect Class Reference

Class is used to load a document containing the default brushes on startup. Most of the action takes place in the base class. More...

#include <loadbrsh.h>

Inheritance diagram for LoadBrushDirect:

LoadDirect List of all members.

Protected Member Functions

virtual BOOL OnLoadDocument (Document *pKernelDoc)
 We need to replace indexed brush colours by local colours - since the linked indexed colours get deleted (this especially effects fill ramps!).

Private Member Functions

 CC_DECLARE_MEMDUMP (LoadBrushDirect)

Detailed Description

Class is used to load a document containing the default brushes on startup. Most of the action takes place in the base class.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/3/2000

Definition at line 120 of file loadbrsh.h.


Member Function Documentation

LoadBrushDirect::CC_DECLARE_MEMDUMP LoadBrushDirect   )  [private]
 

BOOL LoadBrushDirect::OnLoadDocument Document pDoc  )  [protected, virtual]
 

We need to replace indexed brush colours by local colours - since the linked indexed colours get deleted (this especially effects fill ramps!).

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/2/2000
Parameters:
pKernelDoc = a pointer to the loaded kernel document [INPUTS] Returns TRUE if the document was processed correctly FALSE if not.
NOTE: identical to that in void PrintMarksMan::ConvertAllDocColours(Document* pDoc)

Reimplemented from LoadDirect.

Definition at line 131 of file loadbrsh.cpp.

00132 {
00133     ERROR3IF(pDoc==NULL,"No doc pointer during PrintMarksMan::ConvertAllDocColours!");
00134 
00135     Node *CurNode = Node::DocFindFirstDepthFirst(pDoc);
00136     Node *NextNode;
00137 
00138     while (CurNode !=NULL)
00139     {
00140         // We may be about to chop this node out of the tree, so get the next node now
00141         NextNode = CurNode->DocFindNextDepthFirst();
00142 
00143         // Use to scan the colour fields of the attribute.
00144         UINT32 Context = 0;
00145         DocColour *pColour;
00146 
00147         if (CurNode->IsAnAttribute())
00148         {
00149             NodeAttribute *pNodeAttr = (NodeAttribute *) CurNode;
00150 
00151             // Get the next colour field from the attribute
00152             pColour = pNodeAttr->EnumerateColourFields(Context++);
00153 
00154             while (pColour != NULL)
00155             {
00156                 // For each colour field, make sure the colour is a local DocColour so that
00157                 // the sub-tree is entirely stand-alone
00158                 if (pColour->FindParentIndexedColour() != NULL)
00159                 {
00160                     ColourGeneric ColDef;
00161                     ColourContext *cc = ColourManager::GetColourContext(pColour->GetColourModel());
00162                     ERROR3IF(cc == NULL, "Can't find colour context?!");
00163 
00164                     // Get the IndexedColour definition as a standalone colour definition
00165                     cc->ConvertColour(pColour->FindParentIndexedColour(), &ColDef);
00166 
00167                     // Make the DocColour into a simple standalone "lookalike" of the parent colour
00168                     *pColour = DocColour(pColour->GetColourModel(), &ColDef);
00169                 }
00170 
00171                 pColour = pNodeAttr->EnumerateColourFields(Context++);
00172             }
00173         }
00174         CurNode = NextNode;
00175     }
00176 
00177     // All is well we hope.
00178     return TRUE;
00179 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:56:04 2007 for Camelot by  doxygen 1.4.4