AILayerProcessor Class Reference

Helps with the import of an Adobe Illustrator layer. These are defined by a pair of instructions:. More...

#include <ai_layer.h>

Inheritance diagram for AILayerProcessor:

CCObject SimpleCCObject List of all members.

Public Member Functions

 AILayerProcessor (void)
 Default constructor.
 ~AILayerProcessor (void)
 Default destructor.
BOOL DecodeAI5Lb (AI5EPSFilter &Filter)
 Extracts the layer information from the Lb record. The AI file format allows for more fine-grained control over the layers than the Camelot version, and so much of it is rejected.
BOOL DecodeAI8Lb (AI5EPSFilter &Filter)
 The syntax of the Lb operator has changed in AI8, and this function is intended to handle the newer version.
BOOL DecodeLB (AI5EPSFilter &Filter)
 Processes the LB command, which is the end of layer indicator.
BOOL DecodeLn (AI5EPSFilter &Filter)
 Processes the Ln command, which is used to set the layer's name.

Private Attributes

String_256 mLayerName
BOOL mIsLocked
BOOL mIsPrintable
BOOL mIsVisible

Detailed Description

Helps with the import of an Adobe Illustrator layer. These are defined by a pair of instructions:.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/4/00
<Flags> Lb (Layer Name) Ln

The layer body is terminated by the LB tag.

Definition at line 121 of file ai_layer.h.


Constructor & Destructor Documentation

AILayerProcessor::AILayerProcessor void   ) 
 

Default constructor.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/00
See also:
AILayerProcessor::~AILayerProcessor ()

Definition at line 116 of file ai_layer.cpp.

00117 {
00118     // Initialise all member variables to their default state.
00119     mLayerName.Empty ();            // Clear the layer name string.
00120     mIsLocked       = FALSE;        // Set the layer locked flag to FALSE.
00121     mIsPrintable    = FALSE;        // Set the layer printable flag to FALSE.
00122     mIsVisible      = FALSE;        // Set the layer visible flag to FALSE.
00123 }

AILayerProcessor::~AILayerProcessor void   ) 
 

Default destructor.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/00
See also:
AILayerProcessor::AILayerProcessor ()

Definition at line 136 of file ai_layer.cpp.

00137 {
00138     // Nothing needs to be done.
00139 }


Member Function Documentation

BOOL AILayerProcessor::DecodeAI5Lb AI5EPSFilter Filter  ) 
 

Extracts the layer information from the Lb record. The AI file format allows for more fine-grained control over the layers than the Camelot version, and so much of it is rejected.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/00
Parameters:
pFilter - A pointer to the AI5EPSFilter being used for the export. [INPUTS]
Returns:
TRUE - Success. FALSE - An error has occurred.
See also:
AILayerProcessor::DecodeLB (), AILayerProcessor::DecodeLn (), AI5EPSFilter::ProcessToken()

Definition at line 158 of file ai_layer.cpp.

00159 {
00160     INT32   IsVisible   = 0;
00161     INT32   IsLocked    = 0;
00162     INT32   IsPrintable = 0;
00163     
00164     // Pop the information off the stack.
00165     if ( !Filter.GetStack ().Discard ( 6 )          ||  // Discard the unused data on the stack.
00166          !Filter.GetStack ().Pop ( &IsPrintable )   ||  // Extract whether it's printable.
00167          !Filter.GetStack ().Pop ( &IsLocked )      ||  // Extract whether the layer is locked.
00168          !Filter.GetStack ().Discard ( 1 )          ||  // Discard the unused flag.
00169          !Filter.GetStack ().Pop ( &IsVisible ) )       // Extract the layer visibility data.
00170     {
00171         // There has been a problem extracting the data. Return a FALSE value to inform the
00172         // AIEPS filter.
00173         return FALSE;
00174     }
00175 
00176     // Set up the layer state flags from the information in the Lb operator. The default
00177     // state is false, so only one branch needs to be evaluated.
00178     if ( !IsLocked )
00179     {
00180         mIsLocked       = TRUE;                         // Set the layer locked flag to TRUE.
00181     }
00182 
00183     if ( IsPrintable )
00184     {
00185         mIsPrintable    = TRUE;                         // Set the printable flag to TRUE.
00186     }
00187     
00188     if ( IsVisible )
00189     {
00190         mIsVisible      = TRUE;                         // Set the visible flag to TRUE.
00191     }
00192 
00193     // Success.
00194     return TRUE;
00195 }

BOOL AILayerProcessor::DecodeAI8Lb AI5EPSFilter Filter  ) 
 

The syntax of the Lb operator has changed in AI8, and this function is intended to handle the newer version.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/00
Parameters:
pFilter - A pointer to the AI5EPSFilter being used for the export. [INPUTS]
Returns:
TRUE - Success. FALSE - An error has occurred.
See also:
AILayerProcessor::DecodeAI5Lb (), AILayerProcessor::DecodeLB () AILayerProcessor::DecodeLn (), AI8EPSFilter::ProcessToken ()

Definition at line 213 of file ai_layer.cpp.

00214 {
00215     INT32   IsVisible   = 0;
00216     INT32   IsLocked    = 0;
00217     INT32   IsPrintable = 0;
00218     
00219     // Pop the information off the stack.
00220     if ( !Filter.GetStack ().Discard ( 9 )          ||  // Discard the unused data on the stack.
00221          !Filter.GetStack ().Pop ( &IsPrintable )   ||  // Extract whether it's printable.
00222          !Filter.GetStack ().Pop ( &IsLocked )      ||  // Extract whether the layer is locked.
00223          !Filter.GetStack ().Discard ( 1 )          ||  // Discard the unused flag.
00224          !Filter.GetStack ().Pop ( &IsVisible ) )       // Extract the layer visibility data.
00225     {
00226         // There has been a problem extracting the data. Return a FALSE value to inform the
00227         // AIEPS filter.
00228         return FALSE;
00229     }
00230 
00231     // Set up the layer state flags from the information in the Lb operator. The default
00232     // state is false, so only one branch needs to be evaluated.
00233     if ( !IsLocked )
00234     {
00235         mIsLocked       = TRUE;                         // Set the layer locked flag to TRUE.
00236     }
00237 
00238     if ( IsPrintable )
00239     {
00240         mIsPrintable    = TRUE;                         // Set the printable flag to TRUE.
00241     }
00242     
00243     if ( IsVisible )
00244     {
00245         mIsVisible      = TRUE;                         // Set the visible flag to TRUE.
00246     }
00247 
00248     // Success.
00249     return TRUE;
00250 }

BOOL AILayerProcessor::DecodeLB AI5EPSFilter Filter  ) 
 

Processes the LB command, which is the end of layer indicator.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/00
Parameters:
pFilter - A pointer to the AI5EPSFilter being used for the export. [INPUTS]
Returns:
TRUE - Success. FALSE - An error has occurred.
See also:
AILayerProcessor::DecodeLb (), AI5EPSFilter::ProcessToken()

Definition at line 266 of file ai_layer.cpp.

00267 {
00268     // Push the insert point in the tree up a level, so that any future layers are inserted
00269     // in the correct place. This is done automatically by the EPSFilter class, so this
00270     // method is redundant.
00271     return TRUE;
00272 }

BOOL AILayerProcessor::DecodeLn AI5EPSFilter Filter  ) 
 

Processes the Ln command, which is used to set the layer's name.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/00
Parameters:
pFilter - A pointer to the AI5EPSFilter being used for the export. [INPUTS]
Returns:
TRUE - Success. FALSE - An error has occurred.
See also:
AILayerProcessor::DecodeLb (), AI5EPSFilter::ProcessToken()

Definition at line 288 of file ai_layer.cpp.

00289 {
00290     // Pop the layer's name off the stack, and store it in the mLayerName member variable.
00291     if ( !Filter.GetStack ().Pop ( &mLayerName ) )
00292     {
00293         // There's been a problem, so inform the filter that invoked this command.
00294         return FALSE;
00295     }
00296 
00297     // Create a new layer using the stored information.
00298     return Filter.CreateLayer ( mLayerName, mIsLocked, mIsPrintable, mIsVisible );
00299 }


Member Data Documentation

BOOL AILayerProcessor::mIsLocked [private]
 

Definition at line 137 of file ai_layer.h.

BOOL AILayerProcessor::mIsPrintable [private]
 

Definition at line 138 of file ai_layer.h.

BOOL AILayerProcessor::mIsVisible [private]
 

Definition at line 139 of file ai_layer.h.

String_256 AILayerProcessor::mLayerName [private]
 

Definition at line 136 of file ai_layer.h.


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