LineAttrRecordHandler Class Reference

Handles the reading of all line attribute records in the v2 file format. More...

#include <rechattr.h>

Inheritance diagram for LineAttrRecordHandler:

CamelotRecordHandler CXaraFileRecordHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 LineAttrRecordHandler ()
 ~LineAttrRecordHandler ()
virtual UINT32GetTagList ()
 Provides the record handler system with a list of records handled by this handler.
virtual BOOL HandleRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record.

Private Member Functions

 CC_DECLARE_DYNAMIC (LineAttrRecordHandler)
BOOL HandleLineColourRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be a Line colour record.
BOOL HandleLineWidthRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be a Line width record.
BOOL HandleLineTransparencyRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be a Line transparency record.
BOOL HandleCapRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be a start or end cap record.
BOOL HandleJoinStyleRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be a join style record.
BOOL HandleMitreLimitRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be a mitre limit record.
BOOL HandleWindingRuleRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be a winding rule record.
BOOL HandleDashStyleRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be a dash style record.
BOOL HandleDefineDashRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be a define dash style record.
BOOL HandleArrowHeadRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be an arrow head record.
BOOL HandleArrowTailRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be an arrow tail record.

Detailed Description

Handles the reading of all line attribute records in the v2 file format.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/5/96
See also:
-

Definition at line 118 of file rechattr.h.


Constructor & Destructor Documentation

LineAttrRecordHandler::LineAttrRecordHandler  )  [inline]
 

Definition at line 124 of file rechattr.h.

00124 : CamelotRecordHandler() {}

LineAttrRecordHandler::~LineAttrRecordHandler  )  [inline]
 

Definition at line 125 of file rechattr.h.

00125 {}


Member Function Documentation

LineAttrRecordHandler::CC_DECLARE_DYNAMIC LineAttrRecordHandler   )  [private]
 

UINT32 * LineAttrRecordHandler::GetTagList  )  [virtual]
 

Provides the record handler system with a list of records handled by this handler.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/5/96
Parameters:
- [INPUTS]
Returns:
Ptr to a list of tag values, terminated by CXFRH_TAG_LIST_END
See also:
-

Implements CXaraFileRecordHandler.

Definition at line 3941 of file lineattr.cpp.

03942 {
03943     static UINT32 TagList[] = { TAG_LINECOLOUR,
03944                                 TAG_LINECOLOUR_NONE,
03945                                 TAG_LINECOLOUR_BLACK,
03946                                 TAG_LINECOLOUR_WHITE,
03947                                 TAG_LINEWIDTH,
03948                                 TAG_LINETRANSPARENCY,
03949                                 TAG_STARTCAP,
03950                                 TAG_ENDCAP,
03951                                 TAG_JOINSTYLE,
03952                                 TAG_MITRELIMIT,
03953                                 TAG_WINDINGRULE,
03954                                 TAG_DASHSTYLE,
03955                                 TAG_DEFINEDASH, TAG_DEFINEDASH_SCALED,
03956                                 TAG_ARROWHEAD, TAG_ARROWTAIL,
03957                                 CXFRH_TAG_LIST_END};
03958 
03959     return (UINT32*)&TagList;
03960 }

BOOL LineAttrRecordHandler::HandleArrowHeadRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Handles the given record. The record has to be an arrow head record.

BOOL LineAttrRecordHandler::HandleArrowHeadRecord(CXaraFileRecord* pCXaraFileRecord)

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/7/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Definition at line 4449 of file lineattr.cpp.

04450 {
04451     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"HandleArrowHeadRecord pCXaraFileRecord is NULL");
04452     ERROR2IF(pCXaraFileRecord->GetTag() != TAG_ARROWHEAD,FALSE,"HandleArrowHeadRecord I don't handle this tag type");
04453 
04454     BOOL ok = TRUE;
04455 
04456     AttrStartArrow* pAttr   = NULL;
04457     INT32       ArrowId     = 0;
04458     FIXED16     ScaleWidth;
04459     FIXED16     ScaleHeight;
04460     ArrowRec    Arrow;
04461     StockArrow  ArrowType = SA_NULLARROW;
04462 
04463     if (ok) ok = pCXaraFileRecord->ReadINT32(&ArrowId);                 // Read the type of arrow head
04464     if (ok) ok = pCXaraFileRecord->ReadFIXED16(&ScaleWidth);            // Read the width scaling
04465     if (ok) ok = pCXaraFileRecord->ReadFIXED16(&ScaleHeight);           // Read the height scaling
04466 
04467     // Convert the arrow id into the internal style
04468     if (ok)
04469     {
04470         switch (ArrowId)
04471         {
04472             case REF_ARROW_NULL:            ArrowType = SA_NULLARROW;       break;
04473             case REF_ARROW_STRAIGHT:        ArrowType = SA_STRAIGHTARROW;   break;
04474             case REF_ARROW_ANGLED:          ArrowType = SA_ANGLEDARROW;     break;
04475             case REF_ARROW_ROUNDED:         ArrowType = SA_ROUNDEDARROW;    break;
04476             case REF_ARROW_SPOT:            ArrowType = SA_SPOT;            break;
04477             case REF_ARROW_DIAMOND:         ArrowType = SA_DIAMOND;         break;
04478             case REF_ARROW_FEATHER:         ArrowType = SA_ARROWFEATHER;    break;
04479             case REF_ARROW_FEATHER2:        ArrowType = SA_ARROWFEATHER2;   break;
04480             case REF_ARROW_HOLLOWDIAMOND:   ArrowType = SA_HOLLOWDIAMOND;   break;
04481             default:
04482                 ERROR3("Unkown arrow head type in LineAttrRecordHandler::HandleArrowTailRecord");
04483                 break;
04484         }
04485     }
04486 
04487     if (ok) ok = Arrow.CreateStockArrow(ArrowType);
04488     if (ok)      Arrow.SetArrowSize(ScaleWidth, ScaleHeight);
04489 
04490     if (ok)      pAttr = new AttrStartArrow;                            // Create a new attr
04491     if (ok) ok = (pAttr != NULL);                                       // Check it's not NULL
04492     if (ok)      pAttr->Value.StartArrow = Arrow;                       // Set the arrow
04493     if (ok) ok = InsertNode(pAttr);                                     // Insert the node into the tree
04494 
04495     return ok;
04496 }

BOOL LineAttrRecordHandler::HandleArrowTailRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Handles the given record. The record has to be an arrow tail record.

BOOL LineAttrRecordHandler::HandleArrowTailRecord(CXaraFileRecord* pCXaraFileRecord)

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/7/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Definition at line 4513 of file lineattr.cpp.

04514 {
04515     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"HandleArrowTailRecord pCXaraFileRecord is NULL");
04516     ERROR2IF(pCXaraFileRecord->GetTag() != TAG_ARROWTAIL,FALSE,"HandleArrowTailRecord I don't handle this tag type");
04517 
04518     BOOL ok = TRUE;
04519 
04520     AttrEndArrow* pAttr = NULL;
04521     INT32       ArrowId     = 0;
04522     FIXED16     ScaleWidth;
04523     FIXED16     ScaleHeight;
04524     ArrowRec    Arrow;
04525     StockArrow  ArrowType = SA_NULLARROW;
04526 
04527     if (ok) ok = pCXaraFileRecord->ReadINT32(&ArrowId);                 // Read the type of arrow head
04528     if (ok) ok = pCXaraFileRecord->ReadFIXED16(&ScaleWidth);            // Read the width scaling
04529     if (ok) ok = pCXaraFileRecord->ReadFIXED16(&ScaleHeight);           // Read the height scaling
04530 
04531     // Convert the arrow id into the internal style
04532     if (ok)
04533     {
04534         switch (ArrowId)
04535         {
04536             case REF_ARROW_NULL:            ArrowType = SA_NULLARROW;       break;
04537             case REF_ARROW_STRAIGHT:        ArrowType = SA_STRAIGHTARROW;   break;
04538             case REF_ARROW_ANGLED:          ArrowType = SA_ANGLEDARROW;     break;
04539             case REF_ARROW_ROUNDED:         ArrowType = SA_ROUNDEDARROW;    break;
04540             case REF_ARROW_SPOT:            ArrowType = SA_SPOT;            break;
04541             case REF_ARROW_DIAMOND:         ArrowType = SA_DIAMOND;         break;
04542             case REF_ARROW_FEATHER:         ArrowType = SA_ARROWFEATHER;    break;
04543             case REF_ARROW_FEATHER2:        ArrowType = SA_ARROWFEATHER2;   break;
04544             case REF_ARROW_HOLLOWDIAMOND:   ArrowType = SA_HOLLOWDIAMOND;   break;
04545             default:
04546                 ERROR3("Unkown arrow head type in LineAttrRecordHandler::HandleArrowTailRecord");
04547                 break;
04548         }
04549     }
04550 
04551     if (ok) ok = Arrow.CreateStockArrow(ArrowType);
04552     if (ok)      Arrow.SetArrowSize(ScaleWidth, ScaleHeight);
04553 
04554     if (ok)      pAttr = new AttrEndArrow;                              // Create a new attr
04555     if (ok) ok = (pAttr != NULL);                                       // Check it's not NULL
04556     if (ok)      pAttr->Value.EndArrow = Arrow;                         // Set the arrow
04557     if (ok) ok = InsertNode(pAttr);                                     // Insert the node into the tree
04558 
04559     return ok;
04560 }

BOOL LineAttrRecordHandler::HandleCapRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Handles the given record. The record has to be a start or end cap record.

BOOL LineAttrRecordHandler::HandleCapRecord(CXaraFileRecord* pCXaraFileRecord)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Definition at line 4154 of file lineattr.cpp.

04155 {
04156     UINT32 Tag = pCXaraFileRecord->GetTag();
04157 
04158     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
04159     ERROR2IF(Tag != TAG_STARTCAP && Tag != TAG_ENDCAP,FALSE,"I don't handle this tag type");
04160 
04161     // We don't have a separate end cap attribute, so just ignore it.
04162     // The cap def will come in with the start cap record
04163     if (Tag == TAG_ENDCAP)
04164         return TRUE;
04165 
04166     BOOL ok = TRUE;
04167 
04168     BYTE StartCap;
04169     AttrStartCap* pAttr = NULL;
04170 
04171     if (ok) ok = pCXaraFileRecord->ReadBYTE(&StartCap);         // Read cap type
04172     if (ok)      pAttr = new AttrStartCap;                      // Create a new attr
04173     if (ok) ok = (pAttr != NULL);                               // Check it's not NULL
04174     if (ok)      pAttr->Value.StartCap = LineCapType(StartCap); // Set the cap type
04175     if (ok) ok = InsertNode(pAttr);                             // Insert the node into the tree
04176 
04177     return ok;
04178 }

BOOL LineAttrRecordHandler::HandleDashStyleRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Handles the given record. The record has to be a dash style record.

BOOL LineAttrRecordHandler::HandleDashStyleRecord(CXaraFileRecord* pCXaraFileRecord)

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/7/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Definition at line 4297 of file lineattr.cpp.

04298 {
04299     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"HandleDashStyleRecord pCXaraFileRecord is NULL");
04300     ERROR2IF(pCXaraFileRecord->GetTag() != TAG_DASHSTYLE,FALSE,"HandleDashStyleRecord I don't handle this tag type");
04301 
04302     BOOL ok = TRUE;
04303 
04304     INT32 DashType;
04305     AttrDashPattern* pAttr = NULL;
04306 
04307     // Read dash pattern type
04308     ok = pCXaraFileRecord->ReadINT32(&DashType);                    
04309 
04310     if (ok)
04311     {
04312         // Convert this into the correct dash style
04313         StockDash Pattern = SD_SOLID;
04314         switch (DashType)
04315         {
04316             case REF_DASH_SOLID : Pattern = SD_SOLID; break;
04317             case REF_DASH_1 : Pattern = SD_DASH1; break;
04318             case REF_DASH_2 : Pattern = SD_DASH2; break;
04319             case REF_DASH_3 : Pattern = SD_DASH3; break;
04320             case REF_DASH_4 : Pattern = SD_DASH4; break;
04321             case REF_DASH_5 : Pattern = SD_DASH5; break;
04322             case REF_DASH_6 : Pattern = SD_DASH6; break;
04323             case REF_DASH_7 : Pattern = SD_DASH7; break;
04324             case REF_DASH_8 : Pattern = SD_DASH8; break;
04325             case REF_DASH_9 : Pattern = SD_DASH9; break;
04326             case REF_DASH_10 : Pattern = SD_DASH10; break;
04327             case REF_DASH_11 : Pattern = SD_DASH11; break;
04328             case REF_DASH_12 : Pattern = SD_DASH12; break;
04329             case REF_DASH_13 : Pattern = SD_DASH13; break;
04330             case REF_DASH_14 : Pattern = SD_DASH14; break;
04331             case REF_DASH_15 : Pattern = SD_DASH15; break;
04332             case REF_DASH_16 : Pattern = SD_DASH16; break;
04333             case REF_DASH_17 : Pattern = SD_DASH17; break;
04334             case REF_DASH_18 : Pattern = SD_DASH18; break;
04335             case REF_DASH_19 : Pattern = SD_DASH19; break;
04336             case REF_DASH_20 : Pattern = SD_DASH20; break;
04337             case REF_DASH_GUIDELAYER : Pattern = SD_DASH_GUIDELAYER; break;
04338             default:
04339                 ERROR3("Unkown dash type in LineAttrRecordHandler::HandleDashStyleRecord");
04340         }
04341 
04342         pAttr = new AttrDashPattern;                            // Create a new attr
04343         ok = (pAttr != NULL);                                   // Check it's not NULL
04344         if (ok)      pAttr->Value.SetStockDashPattern(Pattern); // Set the dash pattern type
04345         if (ok) ok = InsertNode(pAttr);                         // Insert the node into the tree
04346     }
04347 
04348     return ok;
04349 }

BOOL LineAttrRecordHandler::HandleDefineDashRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Handles the given record. The record has to be a define dash style record.

BOOL LineAttrRecordHandler::HandleDefineDashRecord(CXaraFileRecord* pCXaraFileRecord)

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/7/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Definition at line 4366 of file lineattr.cpp.

04367 {
04368     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"HandleDefineDashRecord pCXaraFileRecord is NULL");
04369     
04370     INT32 Tag = pCXaraFileRecord->GetTag();
04371     
04372     ERROR2IF(Tag != TAG_DEFINEDASH && Tag != TAG_DEFINEDASH_SCALED,FALSE,"HandleDefineDashRecord I don't handle this tag type");
04373 
04374     BOOL ok = TRUE;
04375 
04376     AttrDashPattern* pAttr = NULL;
04377     BOOL Scale      = FALSE;
04378     if (Tag == TAG_DEFINEDASH_SCALED)
04379         Scale = TRUE;
04380 //  INT32 DashType  = 0;
04381     INT32 DashStart = 0;
04382     INT32 LineWidth = 0;
04383     INT32 Elements  = 0;
04384     INT32* DashArray = NULL;     
04385 
04386     // Read the information from the record
04387     ok = pCXaraFileRecord->ReadINT32(&DashStart);                   
04388     ok = pCXaraFileRecord->ReadINT32(&LineWidth);                   
04389     ok = pCXaraFileRecord->ReadINT32(&Elements);                    
04390     
04391     // Don't bother with zero width lines
04392     //if (LineWidth == 0)
04393     //  Elements = 0;
04394 
04395     if (ok && Elements > 0)
04396     {
04397         // Sanity check on the number of elements
04398         ERROR3IF(Elements > 30,"Number of elements > 30, Are you sure this is correct?");
04399 
04400         // Create ourselves an array of the correct number of elements
04401         DashArray = new INT32[Elements];
04402         if (DashArray)
04403         {
04404             for (INT32 el = 0; el < Elements; el++)
04405             {
04406                 if (ok) ok = pCXaraFileRecord->ReadINT32(&DashArray[el]);
04407             }
04408         }
04409         else
04410         {
04411             Elements = 0;
04412             ERROR3("Couldn't create the elements array");
04413         }
04414     }
04415 
04416     if (ok)
04417     {
04418         DashRec Dash;
04419         Dash.DashStart          = DashStart; 
04420         Dash.LineWidth          = LineWidth; 
04421         Dash.Elements           = Elements;
04422         Dash.ElementData        = DashArray; 
04423         Dash.ScaleWithLineWidth = Scale;
04424 
04425         pAttr      = new AttrDashPattern;                       // Create a new attr
04426                 ok = (pAttr != NULL);                           // Check it's not NULL
04427         if (ok)      pAttr->Value.SetDashPattern(Dash);         // Set the dash pattern
04428         if (ok) ok = InsertNode(pAttr);                         // Insert the node into the tree
04429     }
04430 
04431     return ok;
04432 }

BOOL LineAttrRecordHandler::HandleJoinStyleRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Handles the given record. The record has to be a join style record.

BOOL LineAttrRecordHandler::HandleJoinStyleRecord(CXaraFileRecord* pCXaraFileRecord)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Definition at line 4195 of file lineattr.cpp.

04196 {
04197     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
04198     ERROR2IF(pCXaraFileRecord->GetTag() != TAG_JOINSTYLE,FALSE,"I don't handle this tag type");
04199 
04200     BOOL ok = TRUE;
04201 
04202     BYTE JoinType;
04203     AttrJoinType* pAttr = NULL;
04204 
04205     if (ok) ok = pCXaraFileRecord->ReadBYTE(&JoinType);         // Read join type
04206     if (ok)      pAttr = new AttrJoinType;                      // Create a new attr
04207     if (ok) ok = (pAttr != NULL);                               // Check it's not NULL
04208     if (ok)      pAttr->Value.JoinType = JointType(JoinType);   // Set the join type
04209     if (ok) ok = InsertNode(pAttr);                             // Insert the node into the tree
04210 
04211     return ok;
04212 }

BOOL LineAttrRecordHandler::HandleLineColourRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Handles the given record. The record has to be a Line colour record.

BOOL LineAttrRecordHandler::HandleLineColourRecord(CXaraFileRecord* pCXaraFileRecord)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/5/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Definition at line 4028 of file lineattr.cpp.

04029 {
04030     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
04031     //ERROR2IF(pCXaraFileRecord->GetTag() != TAG_LINECOLOUR,FALSE,"I don't handle this tag type");
04032 
04033     INT32 ColourRef;
04034     INT32 Tag = pCXaraFileRecord->GetTag();
04035     BOOL ok = TRUE;
04036     // If it is the plain line colour record then read the colour
04037     // If it is one of the line colour default colour records then this is not required
04038     switch (Tag)
04039     {
04040         case TAG_LINECOLOUR:
04041             ok = pCXaraFileRecord->ReadINT32(&ColourRef);
04042             break;
04043         case TAG_LINECOLOUR_NONE:
04044             ColourRef = REF_DEFAULTCOLOUR_TRANSPARENT;
04045             break;
04046         case TAG_LINECOLOUR_BLACK:
04047             ColourRef = REF_DEFAULTCOLOUR_BLACK;
04048             break;
04049         case TAG_LINECOLOUR_WHITE:
04050             ColourRef = REF_DEFAULTCOLOUR_WHITE;
04051             break;
04052         default:
04053             ERROR2(FALSE,"I don't handle this tag type");
04054     }
04055     
04056     if (ok)
04057     {
04058         AttrStrokeColour* pAttr = new AttrStrokeColour;
04059         if (pAttr != NULL)
04060         {
04061             if (ok) ok = GetDocColour(ColourRef,&(pAttr->Value.Colour));
04062             if (ok) ok = InsertNode(pAttr);
04063         }
04064         else
04065             ok = FALSE;
04066     }
04067 
04068     return ok;
04069 }

BOOL LineAttrRecordHandler::HandleLineTransparencyRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Handles the given record. The record has to be a Line transparency record.

BOOL LineAttrRecordHandler::HandleLineTransparencyRecord(CXaraFileRecord* pCXaraFileRecord)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Definition at line 4118 of file lineattr.cpp.

04119 {
04120     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
04121     ERROR2IF(pCXaraFileRecord->GetTag() != TAG_LINETRANSPARENCY,FALSE,"I don't handle this tag type");
04122 
04123     BOOL ok = TRUE;
04124 
04125     BYTE Transp, TranspType;
04126     AttrStrokeTransp* pAttr = NULL;
04127 
04128     if (ok) ok = pCXaraFileRecord->ReadBYTE(&Transp);       // Read transparency level
04129     if (ok) ok = pCXaraFileRecord->ReadBYTE(&TranspType);   // Read transparency type
04130     if (ok)      pAttr = new AttrStrokeTransp;              // Create a new attr
04131     if (ok) ok = (pAttr != NULL);                           // Check it's not NULL
04132     if (ok)      pAttr->Value.Transp     = UINT32(Transp);  // Set the transparency level
04133     if (ok)      pAttr->Value.TranspType = UINT32(TranspType);// Set the transparency type
04134     if (ok) ok = InsertNode(pAttr);                         // Insert the node into the tree
04135 
04136     return ok;
04137 }

BOOL LineAttrRecordHandler::HandleLineWidthRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Handles the given record. The record has to be a Line width record.

BOOL LineAttrRecordHandler::HandleLineWidthRecord(CXaraFileRecord* pCXaraFileRecord)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/6/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Definition at line 4086 of file lineattr.cpp.

04087 {
04088     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
04089     ERROR2IF(pCXaraFileRecord->GetTag() != TAG_LINEWIDTH,FALSE,"I don't handle this tag type");
04090 
04091     INT32 Width = 0;
04092     AttrLineWidth* pAttr = NULL;
04093 
04094     BOOL    ok = pCXaraFileRecord->ReadINT32(&Width);// Read the width from the record
04095     if (ok)      pAttr = new AttrLineWidth;         // Create a new line width attr
04096     if (ok) ok = (pAttr != NULL);                   // Check it's not NULL
04097     if (ok)      pAttr->Value.LineWidth = Width;    // Set the width to the read-in value
04098     if (ok) ok = InsertNode(pAttr);                 // Insert the node into the tree
04099 
04100     return ok;
04101 }

BOOL LineAttrRecordHandler::HandleMitreLimitRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Handles the given record. The record has to be a mitre limit record.

BOOL LineAttrRecordHandler::HandleMitreLimitRecord(CXaraFileRecord* pCXaraFileRecord)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Definition at line 4229 of file lineattr.cpp.

04230 {
04231     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
04232     ERROR2IF(pCXaraFileRecord->GetTag() != TAG_MITRELIMIT,FALSE,"I don't handle this tag type");
04233 
04234     BOOL ok = TRUE;
04235 
04236     INT32 MitreLimit;
04237     AttrMitreLimit* pAttr = NULL;
04238 
04239     if (ok) ok = pCXaraFileRecord->ReadINT32(&MitreLimit);  // Read mitre limit
04240     if (ok)      pAttr = new AttrMitreLimit;                // Create a new attr
04241     if (ok) ok = (pAttr != NULL);                           // Check it's not NULL
04242     if (ok)      pAttr->Value.MitreLimit = MitreLimit;      // Set the mitre limit
04243     if (ok) ok = InsertNode(pAttr);                         // Insert the node into the tree
04244 
04245     return ok;
04246 }

BOOL LineAttrRecordHandler::HandleRecord CXaraFileRecord pCXaraFileRecord  )  [virtual]
 

Handles the given record.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/5/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Implements CXaraFileRecordHandler.

Definition at line 3976 of file lineattr.cpp.

03977 {
03978     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
03979 
03980     BOOL ok = TRUE;
03981 
03982     switch (pCXaraFileRecord->GetTag())
03983     {
03984         case TAG_LINECOLOUR:
03985         case TAG_LINECOLOUR_NONE:
03986         case TAG_LINECOLOUR_BLACK:
03987         case TAG_LINECOLOUR_WHITE:
03988             ok = HandleLineColourRecord(pCXaraFileRecord);
03989             break;
03990         case TAG_LINEWIDTH :        ok = HandleLineWidthRecord(pCXaraFileRecord);       break;
03991         case TAG_LINETRANSPARENCY:  ok = HandleLineTransparencyRecord(pCXaraFileRecord);break;
03992         case TAG_STARTCAP:
03993         case TAG_ENDCAP:            ok = HandleCapRecord(pCXaraFileRecord);             break;
03994         case TAG_JOINSTYLE:         ok = HandleJoinStyleRecord(pCXaraFileRecord);       break;
03995         case TAG_MITRELIMIT:        ok = HandleMitreLimitRecord(pCXaraFileRecord);      break;
03996         case TAG_WINDINGRULE:       ok = HandleWindingRuleRecord(pCXaraFileRecord);     break;
03997         case TAG_DASHSTYLE:         ok = HandleDashStyleRecord(pCXaraFileRecord);       break;
03998         case TAG_DEFINEDASH:        ok = HandleDefineDashRecord(pCXaraFileRecord);      break;
03999         case TAG_DEFINEDASH_SCALED: ok = HandleDefineDashRecord(pCXaraFileRecord);      break;
04000         case TAG_ARROWHEAD:         ok = HandleArrowHeadRecord(pCXaraFileRecord);       break;
04001         case TAG_ARROWTAIL:         ok = HandleArrowTailRecord(pCXaraFileRecord);       break;
04002 
04003         default:
04004             ok = FALSE;
04005             ERROR3_PF(("I don't handle records with the tag (%d)\n",pCXaraFileRecord->GetTag()));
04006             break;
04007     }
04008 
04009     return ok;
04010 }

BOOL LineAttrRecordHandler::HandleWindingRuleRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Handles the given record. The record has to be a winding rule record.

BOOL LineAttrRecordHandler::HandleWindingRuleRecord(CXaraFileRecord* pCXaraFileRecord)

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Definition at line 4263 of file lineattr.cpp.

04264 {
04265     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
04266     ERROR2IF(pCXaraFileRecord->GetTag() != TAG_WINDINGRULE,FALSE,"I don't handle this tag type");
04267 
04268     BOOL ok = TRUE;
04269 
04270     BYTE WindingRule;
04271     AttrWindingRule* pAttr = NULL;
04272 
04273     if (ok) ok = pCXaraFileRecord->ReadBYTE(&WindingRule);              // Read mitre limit
04274     if (ok)      pAttr = new AttrWindingRule;                           // Create a new attr
04275     if (ok) ok = (pAttr != NULL);                                       // Check it's not NULL
04276     if (ok)      pAttr->Value.WindingRule = WindingType(WindingRule);   // Set the mitre limit
04277     if (ok) ok = InsertNode(pAttr);                                     // Insert the node into the tree
04278 
04279     return ok;
04280 }


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