Filter Class Reference

Pure base class for import and export filters. Provides static functions to initialise and deinitialise all the available filters. More...

#include <filters.h>

Inheritance diagram for Filter:

ListItem CCObject SimpleCCObject BitmapFilter FilterFamily HTMLExportFilter PaletteFilter PreviewFilter VectorFilter BaseBitmapFilter BitmapFilterFamily GenericEPSFilter GenericFilter PaletteFilterFamily VectorFilterFamily ImagemapFilter AdobeColourSwatchFilter AdobeColourTableFilter CorelPaletteFilter JCWColourFilter MSPaletteFilter PaintShopProPaletteFilter AcornDrawFilter BaseCamelotFilter CDRFilter CMXFilter CMXImportFilter EPSFilter FlashFilter MetaFileFilter List of all members.

Public Member Functions

 Filter ()
 Set the Filter object up to be in a clean state.
virtual ~Filter ()
 Destroys the OILFilter object and the current attribute array/values associated with this Filter.
virtual BOOL Init ()=0
 Declares a preference that allows you to clear memory in delete().
virtual void Deinit ()
FilterFlags GetFlags ()
 Get the flags for a specified filter.
ADDR LoadInitialSegment (PathName &Path, UINT32 *Size, size_t *FileSize)
ADDR LoadInitialSegment (CCLexFile *pFile, UINT32 *pSize, size_t *pFileSize)
 Determine if this filter can load the specified file. The filter is provided with the first n bytes of the file, where n is HeaderSize. It should look at this data and/or the pathname to determine if it can load this file. NB. Base class function is pure virtual - override it!Loads in the first n bytes of a file, in order to investigate whether a filter (or number of filters in the case of the FilterFamily class), is compatible with the file - i.e. how well this file recognises the file header. The last byte in the block is set to 0, to prevent ASCII lexers from going trundling off the end.
virtual BOOL IsDefaultDocRequired (const TCHAR *pcszPathName)
 Works out if opening a file of this type requires a default document to be loaded. If the file format supplies the document then return FALSE otherwise return TRUE. An example would be opening a bitmap file. This has no document defined in the file format and so we need to laod the default document before importing the bitmap into this file. In this baseclass version return FALSE and hence assume that the filters that need to will override this function to return TRUE.
virtual BOOL PreHowCompatible ()
 Allows a filter or set of filters to take some action or set up variables before being called by HowCompatible. A group of filters which share common code may require some variable set up before being asked to check the type. Base class does nothing and so works for all filters which do not require it.
virtual INT32 HowCompatible (PathName &Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize)
virtual BOOL DoImport (SelOperation *, CCLexFile *, Document *, BOOL AutoChosen=FALSE, ImportPosition *Pos=NULL, KernelBitmap **ppImportedBitmap=NULL, DocCoord *pPosTranslate=NULL, String_256 *URL=NULL)
virtual BOOL DoExport (Operation *, CCLexFile *, PathName *, Document *, BOOL=TRUE)
virtual BOOL JoinFamily (CCRuntimeClass *)
 Allow a filter to choose whether or not it wants to become part of a filter 'family', e.g. a filter family such as "EPS files", or "Bitmap files". The default implementation checks to see if the filter is of the same kind of filter, using IsKindOf(), and if so, it consents to be in the filter family. Filters should only over-ride this if they need different behaviour for some bizarre reason.
virtual BOOL ImportBitmap (CCLexFile *, KernelBitmap **)
 

virtual BOOL ExportBitmap (KernelBitmap &)
 Virtual function to export a bitmap to a file. This base class version always does nothing and returns TRUE, so formats which do not support bitmaps need do nothing. Formats that support bitmaps should over-ride this function to do the necessary work required to embed the bitmap into the file.
DocumentGetDocument ()
AttributeEntryGetCurrentAttrs ()
virtual INT32 ImportBinary (ADDR pData, INT32 Length)
 Read in binary data from the file and place it in the buffer supplied by the caller. This is over-ridden by filters to do whatever translation is necessary, e.g. EPS filters convert ASCII Hexadecimal data to binary.
virtual BitmapFilterSupport GetBitmapSupportLevel ()
 Determine how well this filter supports bitmaps when exporting.
virtual BOOL CanIncludePreviewBmp ()
 Allows you to find out if a particular filter can produce a Preview Bitmap in it.
void IncludePreviewBmp (BOOL WantBmp)
 Asks the filter to include a Preview bitmap or not. NOTE: This only has any effect if the Filter answered TRUE to a call to CanIncludePreviewBmp. NOTE2: All the filters hang around even if they are not doing any filtering, so if you set this flag one way it will stay like that for all future uses of the filter until it is set again. The best method will be to swtich it on if required, do the import and then switch it off again immediatly afterwards.
virtual BOOL ExportVisibleLayersOnly ()
 Determines if the filter wants to export only visible layers. NB. This base class version does the default action of making the filter export everything including hidden layers.
virtual BOOL ExportSelectionOnly (BOOL MaskedRender=FALSE)
 Determines if the filter wants to export only selected items. In the filters baseclass version the default action will be to export all objects by default Only used by bitmap export and in particular masked gif rendering at present.
virtual BOOL WillAcceptExistingFile (PathName pthToReplace)
 Checks to see if this filter will accept an existing file to export to.
virtual void SetSaveAttributes (BOOL DoSave)
 Informs the filter whether or not it should record the attribute settings along with the file data. This allows templates to have default colours other than the standard Camelot values, whilst not encumbering save files with this extra information.
void SetSoleLayer (Layer *pLayer)
LayerGetSoleLayer ()
virtual BOOL OpenExportFile (CCDiskFile *pDiskFile, PathName *pPath)
 Opens up the file ready for exporting into. Assumes the file has already been constructed with the correct buffers etc..
virtual BOOL DeleteExportFile (CCDiskFile *pDiskFile)
 Used for when either an export has been aborted by the user half way through or when an error has occured. It closes up the export file, if open, and then deletes it.
virtual BOOL ExportRender (RenderRegion *pRegion, BOOL MaskedRender=FALSE)
 Export a file to a given render region. It is the responsibility of the derived filter to create a render region of the correct type, and then pass it to this function.
virtual BOOL ExportRenderNodes (RenderRegion *pRegion, ExportDC *pDC, BOOL VisibleLayersOnly=FALSE, BOOL CheckSelected=FALSE, BOOL ShowProgress=TRUE)
 Sets up the file to do an export of the nodes in the tree, by initialising the file, and any slow-job code. It then calls the WriteNodes method to do the actual work, and EndExportRender to complete the task.
virtual String_64 GetImportProgressString (CCLexFile *File, UINT32 ImportingMsgID)
 Works out what progress bar string to use during importing of the file. This consists of a basic message plus, if it will fit, a truncated form of the filename being imported.
virtual String_64 GetExportProgressString (CCLexFile *File, UINT32 ExportingMsgID)
 Works out what progress bar string to use during exporting of the file. This consists of a basic message plus, if it will fit, a truncated form of the filename being exported.
virtual UINT32 GetExportMsgID ()
 Used to get the message id to be used during export. Virtual, so that two stage exporters can change the message.
virtual UINT32 GetImportMsgID ()
 Used to get the message id to be used during export. Virtual, so that multi-stage importers can change the message.
virtual BOOL AddStringToProgressString (String_64 *Str)
virtual BOOL ShouldExportHTMLTag ()
virtual void ExportHTMLTag ()
virtual BOOL IncProgressBarCount (UINT32 n)
BOOL UpdateExportedNodeCount (UINT32 NumNodes=1)
 Update the progress display according to the number passed in. The NumNodes parameter indicates how many nodes have just been saved. Most nodes won't call this when exporting as they are only '1' node. Nodes such as blenders or bitmaps may call this to update the progress more smoothly. E.g. a bitmap might say that it is 20 nodes if it has 20 scanlines. It could then call this function after each scanline is saved with the value 1. It should not call it with more than the number of nodes it claims to be, e.g. the example bitmap above should only ever call with NumNodes in the range 1 to 20. And the cumulative total of NumNodesSaved passed in by one node should never be more than the number of nodes it claims to be either.
UINT32 GetNumNodes ()
 Allows access to the stored numbers of nodes which is currently set up to be used for a progress bar.
UINT32 SetNumNodes (UINT32 NewNumNodes)
 Allows setting of the stored numbers of nodes which is currently set up to be used for a progress bar.

Static Public Member Functions

static void ForceStatusExportMessage (UINT32 nMessageID)
 Overrides the status-line message shown when a file is exported. This is used by the clipboard code to change "Saving document..." to "Copying to clipboard...".
static void UnforceStatusExportMessage ()
 Resets the message override on export back to "no override".
static GenericFilterGetGenericFilter ()
static FilterFindFilterFromID (const UINT32 FilterID)
 Provides the Filter given its ID.
static BOOL InitFilters ()
 Scans all filters to find out which filters are available for use, and instantiates one of each, and holds them in a list.
static BOOL DeinitFilters ()
 Destroy all the Filter objects.
static FilterGetFirst ()
 Iterating through the list of filters known to Camelot. This function returns the first filter.
static FilterGetNext (Filter *)
 Iterating through the list of filters known to Camelot. This function returns the next filter.
static ListGetFilters ()
static ID GetNewFilterID ()
 Support function providing an unique ID for each newly registered Filter.
static ID RegisterFilter (Filter *const pFilter)
 Permits the filter to be used by the FilterManager. For an import filter to be present on the Import dialog the filter should associate itself with the requisite FileFormats via AssociateFilterWithFormat().

Public Attributes

String_256 FilterName
String_256 FilterInfo
UINT32 FilterID
OILFilterpOILFilter

Static Public Attributes

static BOOL AddUnnamedColours = FALSE
 If it is TRUE then any colours used in the imported file but not explicitly named by whatever colour table structure the file uses will be created as named colours (usu. of the form Unnamed 1, Unnamed 2 and so on). If FALSE, immediate colours will be used, and will not appear on the document's colour bar. Defaults to FALSE.
static INT32 ImportWithLayers = 2
 Controls how files are imported: TRUE => Layers are imported/created as necessary when importing. FALSE => Layers are ignore when importing, and the whole imported file is placed in the document as a group.
static BOOL OpenWithLayers = TRUE
 Controls how files are opened: TRUE => Layers are imported/created as necessary when opening a file. FALSE => Layers are ignore when importing, and the whole opened file is placed in the document as a group. Note: Does not affect v2 Native file formats such as xar and web.
static BOOL ImportBitmapsOntoLayers = TRUE
 Controls how bitmap files are opened/imported: TRUE => each bitmap is placed on a new layer. FALSE => each bitmaps is placed on the current layer. Applies to multiple format bitmaps such as animated GIFs.
static BOOL bDontWarnBitmapNonMixTransp = FALSE
 Controls how bitmap files are opened/imported: TRUE => each bitmap is placed on a new layer. FALSE => each bitmaps is placed on the current layer. Applies to multiple format bitmaps such as animated GIFs.

Protected Member Functions

LayerGetActiveLayer (Document *)
 Find the active layer of the first spread of the specified document.
BOOL MakeSureLayerExists (Document *pDoc)
 This functions checks that there is a layer to put nodes onto during an import, and will create a new layer if there are none. This means that filters can call this function just before they try and insert a new node into the tree and be sure that there will be a layer for it to go onto. The function will return TRUE if there is a layer in the document (even if this function had to create the layer). It will return FALSE only if there are no layers and it was unable to create any new ones.
virtual BOOL WriteNodes (RenderRegion *pRegion, ExportDC *pDC, BOOL VisibleLayersOnly, BOOL CheckSelected, BOOL ShowProgress)
 Actually export the nodes to the given render region showing a progress bar as we go. Assumes everything has been set up by ExportRender. Assumes that either a progress bar has been started and will be ended by the caller or that it should start and end the progress bar itself.
virtual BOOL EndExportRender (RenderRegion *pRegion, BOOL ShowProgress)
 Shuts down the export render process.
BOOL SetUpCurrentAttrs ()
 Obtains an attribute array from the attribute manager. This array is the set of default attributes - the filter should use them to maintain its set of current attributes while importing. It then asks the attribute manager to add the correct attributes to each node based on this array. This should be called when importing, not when intialising, otherwise all filters will have this array hanging around all the time, which is bad.
void DeleteCurrentAttrs ()
 Deallocates any objects used to hold the current attributes for the filter. Should be called after import has finished, so the attribute table isn't hanging around all the time.
BOOL SetLineColour (DocColour &)
 Updates the current attribute for line colour to reflect the value passed in.
BOOL SetLineWidth (MILLIPOINT)
 Updates the current attribute for line width to reflect the value passed in.
BOOL SetLineCap (LineCapType)
 Updates the current attribute for line cap style to reflect the value passed in.
BOOL SetJoinType (JointType)
 Updates the current attribute for line join style to reflect the value passed in.
BOOL SetLineTransp (UINT32 TranspType, UINT32 Transp)
 Updates the current attribute for line transparency to reflect the value passed in.
BOOL SetDashPattern (DashRec &)
 Updates the current attribute for dash pattern to reflect the value passed in.
BOOL SetStartArrow (ArrowRec &)
 Updates the current attribute for Start Arrow to reflect the value passed in.
BOOL SetEndArrow (ArrowRec &)
 Updates the current attribute for End Arrow to reflect the value passed in.
BOOL SetMitreLimit (MILLIPOINT)
 Updates the current attribute for the Mitre Limit to reflect the value passed in.
BOOL SetTextFont (String_64 *EncodedName, INT32 Millipoint)
 Set the font specified in the encoded font name. The font which actually gets set in the attribute stack is one found by GetCompatibleFont(), a super new fontmanager call.
BOOL SetTextFontStyle (String_64 *FName, INT32 MillFSize, BOOL Bold, BOOL Italic)
 This function creates attributes for the typeface, the pointsize, bold and italic all at once.
BOOL SetTextSize (INT32 Size)
 Updates the current attribute for TextSize to reflect the value passed in.
BOOL SetTextTypeFace (String_64 *Name, FontClass Class=FC_UNDEFINED)
 Updates the current attribute for TextSize to reflect the value passed in.
BOOL SetTextBold (BOOL Bold)
 Updates the current attribute for Bold to reflect the value passed in.
BOOL SetTextItalic (BOOL Italic)
 Updates the current attribute for Italic to reflect the value passed in.
BOOL SetTextUnderline (BOOL Underline)
 Updates the current attribute for Underline to reflect the value passed in.
BOOL SetTextAspectRatio (FIXED16 AspectR)
 Updates the current attribute for AspectRatio to reflect the value passed in.
BOOL SetTextTracking (INT32 Tracking)
 Updates the current attribute for TextSize to reflect the value passed in.
BOOL SetTextJustification (Justification Justify)
 Updates the current attribute for TextSize to reflect the value passed in.
virtual BOOL SetTextLineSpacing (INT32 Type, INT32 EMLSpace, MILLIPOINT MLSpace, double DLSpace)
 Updates the current attribute for line spacing to reflect the value passed in. One of three values will be used depending on the type (as above).
BOOL SetTextBaseLine (MILLIPOINT BaseLine)
 Updates the current attribute for BaseLine shift to reflect the value passed in.
BOOL SetTextScript (INT32 rise, INT32 pointsize)
 Updates the current attribute for subscript or superscript.
BOOL SetTextBoldFont (BOOL Bold)
 This function simply sets the bold style flag in the current font typeface attribute (to be applied to the next created character).
BOOL SetTextItalicFont (BOOL Italic)
 This function simply sets the italic style flag in the current font typeface attribute (to be applied to the next created character).
BOOL RemoveTextScript ()
 Removes any script attribute which is currently active.
BOOL SetPathFilled (BOOL Filled)
 Indicate whether paths should be filled or not. This is independent of the current fill attribute, so, for example, if this function is called to set the paths to be unfilled, and then called again to set them to be filled, then afterwards all paths filled will be filled with whatever fill attribute was last set.
BOOL SetFillColour (DocColour &)
 Updates the current attribute for fill colour to reflect the value passed in.
BOOL SetLinearFill (DocColour &StartColour, DocColour &EndColour, DocCoord StartPoint, DocCoord EndPoint, DocCoord *EndPoint3=NULL)
 Updates the current attribute for gradfill colour to reflect the value passed in.
BOOL SetRadialFill (DocColour &StartColour, DocColour &EndColour, DocCoord StartPoint, DocCoord EndPoint)
 Updates the current attribute for gradfill colour to reflect the value passed in.
BOOL SetRadialFill (DocColour &StartColour, DocColour &EndColour, DocCoord StartPoint, DocCoord EndPoint1, DocCoord EndPoint2)
 Updates the current attribute for gradfill colour to reflect the value passed in.
BOOL SetSquareFill (DocColour &StartColour, DocColour &EndColour, DocCoord StartPoint, DocCoord EndPoint1, DocCoord EndPoint2)
 Updates the current attribute for gradfill colour to reflect the value passed in.
BOOL SetConicalFill (DocColour &StartColour, DocColour &EndColour, DocCoord StartPoint, DocCoord EndPoint)
 Updates the current attribute for gradfill colour to reflect the value passed in.
BOOL SetBitmapFill (KernelBitmap *pBitmap, DocCoord StartPoint, DocCoord EndPoint, DocCoord EndPoint2, DocColour *StartColour=0, DocColour *EndColour=0)
 Updates the current attribute for fill colour to reflect the value passed in.
BOOL SetFractalFill (DocColour &StartColour, DocColour &EndColour, DocCoord StartPoint, DocCoord EndPoint1, DocCoord EndPoint2, INT32 Seed, double Graininess, double Gravity, double Squash, UINT32 DPI, BOOL Tileable)
 Updates the current attribute for colour fill geometry to be a fractal fill using the values passed in.
BOOL SetNoTranspFill ()
 Set the current transparency fill for this import operation to be none, i.e. there is no transparency.
BOOL SetFlatTranspFill (UINT32 TranspType, UINT32 Transp)
 Set the current transparency fill for this import operation to be a flat transparency value.
BOOL SetLinearTranspFill (UINT32 TranspType, UINT32 StartTransp, UINT32 EndTransp, DocCoord StartPoint, DocCoord EndPoint, DocCoord *EndPoint3=NULL)
 Updates the current attribute for transparency fill to be a linear transparent fill as specified by the values passed in.
BOOL SetRadialTranspFill (UINT32 TranspType, UINT32 StartTransp, UINT32 EndTransp, DocCoord StartPoint, DocCoord EndPoint)
 Updates the current attribute for transparency fill to be a circular transparent fill as specified by the values passed in.
BOOL SetRadialTranspFill (UINT32 TranspType, UINT32 StartTransp, UINT32 EndTransp, DocCoord StartPoint, DocCoord EndPoint1, DocCoord EndPoint2)
 Updates the current attribute for transparency fill to be an elliptical transparent fill as specified by the values passed in.
BOOL SetConicalTranspFill (UINT32 TranspType, UINT32 StartTransp, UINT32 EndTransp, DocCoord StartPoint, DocCoord EndPoint)
 Updates the current attribute for gradfill colour to reflect the value passed in.
BOOL SetBitmapTranspFill (UINT32 TranspType, KernelBitmap *pBitmap, DocCoord StartPoint, DocCoord EndPoint, DocCoord EndPoint2, UINT32 StartTransp=0, UINT32 EndTransp=255)
 Updates the current attribute for fill colour to reflect the value passed in.
BOOL SetFractalTranspFill (UINT32 TranspType, DocCoord StartPoint, DocCoord EndPoint1, DocCoord EndPoint2, INT32 Seed, double Graininess, double Gravity, double Squash, UINT32 DPI, BOOL Tileable, UINT32 StartTransp=0, UINT32 EndTransp=255)
 Updates the current attribute for colour fill geometry to be a fractal fill using the values passed in.
BOOL SetFadeFillEffect ()
BOOL SetRainbowFillEffect ()
BOOL SetAltRainbowFillEffect ()
BOOL SetLinearFillMapping (INT32 Repeat)
BOOL SetLinearTranspFillMapping (INT32 Repeat)
BOOL SetWindingRule (WindingType)
 Updates the current attribute for winding rule to reflect the value passed in.
virtual BOOL GetDragAndDropTranslation (ImportPosition *pPos, DocRect BoundsRect, Coord *Offset)
 Given an drag'n'drop point (in pPos), calculate the translation necessary to position the imported objects at this position on the spread. It ensures that bounding rectangles smaller than the spread are wholly contained within the spread. i.e. if you drag a file right to the edge of a spread, the translation will move it closer to the centre of the spread so that it is wholly contained within the spread.
BOOL SnapShotCurrentAttrs ()
 This function grabs a snap shot of the filter managers current attributes. It simply makes a new List identical to that of CurrentAttrs.
void PushCurrentAttrsBasedOnSnapShot ()
 This function uses the snap shot facility. It checks the snap shot list against the current attribute list to find attributes which differ. Those that do are obviously new attributes. ie attributes which have been parsed by the filter after the snap shot was taken. This function takes the current attrubute list and removes all those attributes which have changed in this way. It resets them to their default none temp attribute types.
void PopCurrentAttrsBasedOnSnapShot ()
 This function uses the snap shot facility. It checks the snap shot list against the current attribute list to find attributes which differ. Those that do are obviously new attributes. ie attributes which have been parsed by the filter after the snap shot was taken. This function takes the current attrubute list and removes all those attributes which have changed in this way. It resets them to their default none temp attribute types.
void DeleteSnapShot ()
 This function removes the snap shot list allocated during SnapShotCurrentAttrs(). It should be called to match any successfull return of its sister function. ie SnapShotCurrentAttrs() and DeleteSnapShot() should be paired. Note, the calls are not recursive. ie a SnapShot SnapShot Delete Delete is not currently supported.
void DeleteAttributeList (AttributeEntry *pAttrList)
 This function removes all temp attributes from the attribute list provided All temp attributes will have their list entries updated with NULL pointers.
BOOL ApplyChangedAttrs (Node *pNode)
 This function uses the snapshot facility to work out which of the current attributes have changed. Obviously it expects a snap shot to have been taken some time earlier. Only those attributes that have changes will be applied to the node described on entry. Note, any changed attributes which now match defaults will not be applied as the function calls ApplyBasedOnDefaults() with the changes list.
virtual void UpdateFilterProgress (UINT32 increment)
 Shuts down the export render process.

Static Protected Member Functions

static BOOL DeclareFilterPreferenceSection ()
 Ensures all filter related preferences go to the same section.
static SpreadGetFirstSpread (Document *)
 Find the first spread of the specified document.

Protected Attributes

BOOL WantPreviewBmp
FilterFlags Flags
DocumentTheDocument
UINT32 ExportMsgID
UINT32 StopExportMsgID
UINT32 ImportMsgID
BOOL SaveAttributes
Layerm_pSoleLayer
String_64 m_StrToAddToProgress
AttributeEntryCurrentAttrs
SnapShotList FilterSnapShot
AttributeEntry FillAttr
BOOL PathFilled

Static Protected Attributes

static UINT32 m_nForcedStatusExportMessage = 0
static INT32 MinLineWidth = 250
 Controls how line widths are handled - if a line width thinner than the value of this preference is found, then the line width is forced to be this width. E.g. set it to 500 to make all imported lines be at least 0.5 points wide. (It defaults to 0.25pt).
static UINT32 NumNodes = 0
static UINT32 UpdateEvery = 1
static UINT32 LastExportProgressUpdate = 0
static UINT32 CurrentProgressLimit = 0
static UINT32 ProgressOffset = 0
static UINT32 m__StripStart = 0

Static Private Attributes

static GenericFilterpGenericFilter = NULL
static List FilterList
static ID m_NextFilterID = 1099 + 1

Friends

class FilterRenderCallback

Detailed Description

Pure base class for import and export filters. Provides static functions to initialise and deinitialise all the available filters.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
08/03/94
See also:
OILFilter

Definition at line 447 of file filters.h.


Constructor & Destructor Documentation

Filter::Filter  ) 
 

Set the Filter object up to be in a clean state.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/02/94
See also:
Filter; Filter::~Filter; OILFilter

Definition at line 372 of file filters.cpp.

00373 {
00374     // Ensure destructor will not corrupt heap
00375     pOILFilter = NULL;
00376     CurrentAttrs = NULL;
00377     FillAttr.pAttr = NULL;
00378     FillAttr.Temp = FALSE;
00379     FillAttr.Ignore = FALSE;
00380 
00381     // Set default of no export message
00382     ExportMsgID = 0;
00383     
00384     // Set default message of none (use default message)
00385     StopExportMsgID = 0;
00386 
00387     // Set default of no import message
00388     ImportMsgID = 0;
00389 
00390     // No document yet...
00391     TheDocument = NULL;
00392 
00393     // No Preview Bitmap Please
00394     WantPreviewBmp = FALSE;
00395 
00396     // Ensure these are at known states, set them to do nothing so people have to change them
00397     Flags.CanImport = FALSE;
00398     Flags.CanExport = FALSE;
00399     Flags.CanExportMultipleImages = FALSE;
00400 
00401     // Want to show filters by default, unless the user specificaly requests otherwise
00402     Flags.ShowFilter = TRUE;
00403 
00404     // set the path filled flag to a sensible state
00405     PathFilled = TRUE;
00406 
00407     // Don't save attributes as default.
00408     SaveAttributes = FALSE;
00409 
00410     m_pSoleLayer = NULL;
00411 }

Filter::~Filter  )  [virtual]
 

Destroys the OILFilter object and the current attribute array/values associated with this Filter.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/02/94
See also:
Filter; OILFilter

Definition at line 425 of file filters.cpp.

00426 {
00427     // Destroy the associated OILFilter object
00428     delete pOILFilter;
00429 
00430     // Destory any temporary saved fill attribute
00431     if (FillAttr.Temp)
00432         delete FillAttr.pAttr;
00433 }


Member Function Documentation

BOOL Filter::AddStringToProgressString String_64 Str  )  [virtual]
 

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/04/97
Parameters:
Str - This is the string to add in the ProgressString [INPUTS]
- [OUTPUTS]
Returns:
TRUE
See also:

Definition at line 1696 of file filters.cpp.

01697 {
01698     m_StrToAddToProgress = *Str;
01699 
01700     return TRUE;
01701 }

BOOL Filter::ApplyChangedAttrs Node pNode  )  [protected]
 

This function uses the snapshot facility to work out which of the current attributes have changed. Obviously it expects a snap shot to have been taken some time earlier. Only those attributes that have changes will be applied to the node described on entry. Note, any changed attributes which now match defaults will not be applied as the function calls ApplyBasedOnDefaults() with the changes list.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/95
Parameters:
- [INPUTS]
Returns:
TRUE if the changed attributes have been applied to pNode FALSE if nothing has been applied

Definition at line 657 of file filters.cpp.

00658 {
00659     return FilterSnapShot.ApplyChangedAttrs(pNode,CurrentAttrs);
00660 }

BOOL Filter::CanIncludePreviewBmp  )  [virtual]
 

Allows you to find out if a particular filter can produce a Preview Bitmap in it.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/2/95
Returns:
TRUE if the filter is capable of having a preview bitmap put in it somehow. FALSE if it can't. Most filters can not do this.

Reimplemented in CamelotEPSFilter.

Definition at line 466 of file filters.cpp.

00467 {
00468     // Say no. Filters that can will have to say yes
00469     return FALSE;
00470 }

BOOL Filter::DeclareFilterPreferenceSection  )  [static, protected]
 

Ensures all filter related preferences go to the same section.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/10/96
Returns:
TRUE if the preference section was declared correctly FALSE otherwise

Definition at line 447 of file filters.cpp.

00448 {
00449     return( Camelot.DeclareSection( _T("Filters"), 10 ) );
00450 }

virtual void Filter::Deinit void   )  [inline, virtual]
 

Reimplemented in BaseCamelotFilter.

Definition at line 458 of file filters.h.

00459     {
00460         if (pOILFilter)
00461         {
00462             delete pOILFilter;
00463             pOILFilter = NULL;
00464         }
00465     };

BOOL Filter::DeinitFilters  )  [static]
 

Destroy all the Filter objects.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/02/94
See also:
Filter

Definition at line 1028 of file filters.cpp.

01029 {
01030     ListItem* pListItem = FilterList.GetHead();
01031     while (pListItem != NULL)
01032     {
01033         ((Filter*)pListItem)->Deinit();
01034 
01035         pListItem = FilterList.GetNext(pListItem);
01036     }
01037 
01038     // Get rid of our filters
01039     FilterList.DeleteAll();
01040 
01041     // All ok
01042     return TRUE;
01043 }

void Filter::DeleteAttributeList AttributeEntry pAttrList  )  [protected]
 

This function removes all temp attributes from the attribute list provided All temp attributes will have their list entries updated with NULL pointers.

void Filter::DeleteAttributeList(AttributeEntry* pAttrList)

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/95
Parameters:
pAttrList = A pointer to the first item in the attribute list [INPUTS]
Returns:
-

Definition at line 575 of file filters.cpp.

00576 {
00577     // Delete any attribute values we created
00578     INT32 NumAttrs = AttributeManager::GetNumAttributes();
00579     for (INT32 i=0; i<NumAttrs; i++)
00580     {
00581         // Delete the object if it is temporary.
00582         if (pAttrList[i].Temp)
00583         {
00584             delete pAttrList[i].pAttr;
00585             pAttrList[i].pAttr = NULL;
00586             pAttrList[i].Temp = FALSE;
00587         }
00588     }
00589 }

void Filter::DeleteCurrentAttrs  )  [protected]
 

Deallocates any objects used to hold the current attributes for the filter. Should be called after import has finished, so the attribute table isn't hanging around all the time.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
See also:
Filter::SetUpCurrentAttrs

Definition at line 550 of file filters.cpp.

00551 {
00552     // Delete any attribute values we created
00553     if (CurrentAttrs != NULL)
00554     {
00555         DeleteAttributeList(CurrentAttrs);
00556         // Lose the attribute value array
00557         CCFree(CurrentAttrs);
00558         CurrentAttrs = NULL;
00559     }
00560 }

BOOL Filter::DeleteExportFile CCDiskFile pDiskFile  )  [virtual]
 

Used for when either an export has been aborted by the user half way through or when an error has occured. It closes up the export file, if open, and then deletes it.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/12/95
Parameters:
pDiskFile The constructed disk file to use [INPUTS]
Returns:
True if the file has been closed and deleted correctly, False otherwise.
See also:
OpMenuExport::DoWithParam; Filters::DoExport;

ClipboardMapping::ExportToTempFile; OpMenuSave::SaveSpecificFile;

Definition at line 1864 of file filters.cpp.

01865 {
01866 #ifdef DO_EXPORT
01867     ERROR2IF(pDiskFile == NULL, FALSE,"Filter::CloseExportFile null file supplied");
01868 
01869     // Remove the zero length file that we created as part of the process.
01870     
01871     // First, ensure file is closed
01872     if (pDiskFile->isOpen())
01873         pDiskFile->close();
01874     
01875     // Get its pathname 
01876     PathName Path = pDiskFile->GetPathName();
01877 
01878     // And try and remove it, only if it exists
01879     if (Path.IsValid())
01880     {
01881         BOOL Exists = TRUE;
01882         BOOL status = TRUE;
01883         Exists = SGLibOil::FileExists(&Path);
01884         if (Exists)
01885             status = SGLibOil::FileDelete(&Path);
01886         TRACEUSER( "Neville", _T("Filter::DeleteExportFile removed exists status =%d, file status =%d/n"),Exists,status);
01887     }
01888 #endif
01889     return TRUE;
01890 }

void Filter::DeleteSnapShot  )  [protected]
 

This function removes the snap shot list allocated during SnapShotCurrentAttrs(). It should be called to match any successfull return of its sister function. ie SnapShotCurrentAttrs() and DeleteSnapShot() should be paired. Note, the calls are not recursive. ie a SnapShot SnapShot Delete Delete is not currently supported.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/95
Parameters:
- [INPUTS]
Returns:
-
See also:
SnapShotCurrentAttrs()

Definition at line 633 of file filters.cpp.

00634 {
00635     FilterSnapShot.DestroySnapShot();
00636 }

virtual BOOL Filter::DoExport Operation ,
CCLexFile ,
PathName ,
Document ,
BOOL  = TRUE
[inline, virtual]
 

Reimplemented in BaseBitmapFilter, BaseCamelotFilter, CDRFilter, CMXFilter, CMXImportFilter, PaletteFilter, AcornDrawFilter, EPSFilter, FilterFamily, ImagemapFilter, PreviewFilter, PreviewFilterBMP, PreviewFilterGIF, PreviewFilterJPEG, PreviewFilterPNG, ThumbnailFilterPNG, FlashFilter, PluginNativeFilter, and MetaFileFilter.

Definition at line 520 of file filters.h.

00521     {
00522         return FALSE;
00523     }

virtual BOOL Filter::DoImport SelOperation ,
CCLexFile ,
Document ,
BOOL  AutoChosen = FALSE,
ImportPosition Pos = NULL,
KernelBitmap **  ppImportedBitmap = NULL,
DocCoord pPosTranslate = NULL,
String_256 URL = NULL
[inline, virtual]
 

Reimplemented in BaseBitmapFilter, BaseCamelotFilter, CDRFilter, CMXFilter, CMXImportFilter, PaletteFilter, AcornDrawFilter, EPSFilter, FilterFamily, PreviewFilter, FlashFilter, PluginNativeFilter, and MetaFileFilter.

Definition at line 510 of file filters.h.

00515     {
00516         return FALSE;
00517     }

BOOL Filter::EndExportRender RenderRegion pRegion,
BOOL  ShowProgress
[protected, virtual]
 

Shuts down the export render process.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com> (from Neville's original code)
Date:
12/4/00
Parameters:
pRegion - the render region to export to. [INPUTS] ShowProgress - TRUE then start up a progress bar or FALSE assume the caller has done it.
Returns:
TRUE if the export process completed successfully, FALSE if an error occured.
See also:
Filter::ExportRender, Filter::ExportRenderNodes

Definition at line 2369 of file filters.cpp.

02371 {
02372 #ifdef DO_EXPORT
02373 
02374     //TRY
02375     {
02376         // Finished rendering - deinit render region.
02377         pRegion->StopRender ();
02378 
02379         // Shut down the render region.
02380         pRegion->CloseDown ();
02381     }
02382 #if 0
02383     CATCH ( CFileException, e )
02384     {
02385         // Didn't work - report failure to caller.
02386         if ( ShowProgress )
02387             EndSlowJob ();
02388         return FALSE;
02389     }
02390     END_CATCH
02391 #endif
02392     // Close down progress display, if present
02393     if ( ShowProgress )
02394         EndSlowJob ();
02395 
02396     // All OK
02397     return TRUE;
02398 #else
02399     return FALSE;
02400 #endif
02401 }

BOOL Filter::ExportBitmap KernelBitmap  )  [virtual]
 

Virtual function to export a bitmap to a file. This base class version always does nothing and returns TRUE, so formats which do not support bitmaps need do nothing. Formats that support bitmaps should over-ride this function to do the necessary work required to embed the bitmap into the file.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/09/94
Parameters:
TheBitmap - the bitmap to export [INPUTS]
Returns:
TRUE if the bitmap was exported ok (or if it wasn't exported because the file format does not support it; FALSE if an error occured.

Errors: Usual disk/file errors.

See also:
CamelotEPSFilter::ExportBitmap

Reimplemented in CamelotEPSFilter, and CamelotNativeEPSFilter.

Definition at line 2579 of file filters.cpp.

02580 {
02581     // Base class - ignore bitmaps
02582     return TRUE;
02583 }

virtual void Filter::ExportHTMLTag  )  [inline, virtual]
 

Reimplemented in CamelotNULLWebFilter.

Definition at line 638 of file filters.h.

00639     {
00640     }

BOOL Filter::ExportRender RenderRegion pRegion,
BOOL  MaskedRender = FALSE
[virtual]
 

Export a file to a given render region. It is the responsibility of the derived filter to create a render region of the correct type, and then pass it to this function.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/03/94
Parameters:
pRegion - the render region to export to. [INPUTS]
Returns:
TRUE if the export process completed successfully, FALSE if an error occured.

Errors: Render region is not connected to a spread.

See also:
EPSRenderRegion::ExportRender, FlashRenderRegion::ExportRender

Definition at line 1908 of file filters.cpp.

01909 {
01910 #ifdef DO_EXPORT
01911     // Disable bitmap caching but remember the old state so we can set it back
01912     ScopedFlagSetter fsBitmapCacheing(NodeRenderableBounded::bEnableCacheing, FALSE);
01913 
01914     ERROR2IF(pRegion==NULL,FALSE,"Filter::ExportRender null render region supplied");
01915 
01916     // We need special handling for Camelot EPS 
01917     // (NB. but not native files - do not change this to IS_KIND_OF!)
01918     BOOL IsCamelotEPS = IS_A(pRegion, CamelotEPSRenderRegion);
01919 
01920     // Get the DC for this export operation
01921     // This can be NULL, in the case of bitmap export, or a CMetaFileDC in the case
01922     // of MetaFile export. In the later case we MUST NOT set up the ExportDC pointer
01923     // pDC otherwise the CATCH handlers will fail as there is no ExportFile. Also the
01924     // progress bar message will fail.
01925     // The CDC can be Null if we are talking about bitmap export
01926     CNativeDC* pCDC = pRegion->GetRenderDC();
01927     ExportDC* pDC = NULL;
01928     NumNodes = 0;
01929 
01930     // At present, it appears that only EPS derived filters have a file attached and so
01931     // are the only ones which use an ExportDC. All bitmap filters use NULL.
01932     if( pCDC != NULL && this->IS_KIND_OF(EPSFilter))
01933         pDC = (ExportDC*)CCDC::ConvertFromNativeDC(pCDC);
01934     
01935     // Find out how big the document and document components are...
01936     // (We only do this for EPS files)
01937     if(
01938         this->IS_KIND_OF(EPSFilter) &&
01939         !IsCamelotEPS)
01940     {
01941         // First, we ask the document itself
01942         Document *pDocument = GetDocument();
01943         NumNodes += pDocument->GetSizeOfExport(this);
01944 
01945         // Next, the document components...
01946         DocComponent *pComponent = pDocument->EnumerateDocComponents(NULL);
01947 
01948         while (pComponent != NULL)
01949         {
01950             // Ask this document component how much data it will export.
01951             NumNodes += pComponent->GetSizeOfExport(this);
01952 
01953             // Look for next doc component
01954             pComponent = pDocument->EnumerateDocComponents(pComponent);
01955         }
01956     }
01957 
01958     // Remember how big this initial header is, so we don't overflow when writing
01959     // out and screw up the progress indication (which could happen if, e.g. the
01960     // bitmap export code was incorrect).
01961     CurrentProgressLimit = NumNodes;
01962 
01963     // Find the first node that we should export from this spread
01964     Node *pNode = pRegion->GetRenderSpread();
01965 
01966     ENSURE(pNode != NULL, "Render Region has no spread in Filter::ExportRender!");
01967     ERRORIF(pNode == NULL, _R(IDT_EXPORT_INTERNAL_ERR), FALSE);
01968 
01969     // Go and find the bounding rect for this spread and set the render regions
01970     // clipping rect to it
01971     if (pNode->IsSpread())
01972     {
01973         // find out the old clip rect
01974         DocRect OldClipRect = pRegion->GetClipRect();
01975 
01976         // only do something if it is empty
01977         if (OldClipRect.IsEmpty())
01978         {
01979             // Get a pointer to the spread and find out its bounding rect
01980             Spread* pSpread = (Spread*) pNode;
01981             DocRect SpreadRect = pSpread->GetBoundingRect();
01982             pSpread->DocCoordToSpreadCoord(&SpreadRect);
01983 
01984             // and set the render regions clipping rect to this
01985             pRegion->SetClipRect(SpreadRect);
01986         }
01987     }
01988 
01989     // Work out if this filter wants to include all layers or just the visible ones
01990     // Default action will be to include all so that say an eps or native filters save
01991     // everything. 
01992     BOOL bVisibleLayersOnly = ExportVisibleLayersOnly();
01993     BOOL bSelectedOnly = ExportSelectionOnly(MaskedRender);
01994 
01995     if (IsCamelotEPS)
01996     {
01997         try
01998         {
01999             // Special 3-stage rendering needed for Camelot EPS to be renderable.
02000             View *pView = DocView::GetSelected();
02001             Matrix RenderMatrix = pRegion->GetMatrix();
02002             RenderViewResult Result = pView->RenderSimpleView(pRegion, RenderMatrix,
02003                                                               pRegion->GetRenderSpread(), 
02004                                                               FALSE);
02005             if (Result == RENDERVIEW_USERABORT)
02006                 // Export is over - user has aborted it (but this is not an error)
02007                 return TRUE;
02008 
02009             if (Result == RENDERVIEW_FAILURE)
02010                 // Export was not successful
02011                 return FALSE;
02012 
02013             // This should never happen, as Camelot EPS cannot do 'eveything'
02014             ERROR3IF(Result == RENDERVIEW_NOTNEEDED, 
02015                      "RenderSimpleView did not render anything into EPS!");
02016 
02017             // Finished render region - close down region (i.e. output trailer).
02018             ((EPSRenderRegion *) pRegion)->CloseDown();
02019         }
02020 
02021         catch(CFileException)
02022         {
02023             // Didn't work - report failure to caller.
02024             if (pDC)
02025                 pDC->ExportFile->SetThrowExceptions(FALSE);
02026             return FALSE;
02027         }
02028         // All ok
02029         return TRUE;
02030     }
02031     else
02032     {
02033         FilterRenderCallback MyCallback(this, TRUE, bVisibleLayersOnly, bSelectedOnly);
02034         pRegion->RenderTree(pNode, FALSE, FALSE, &MyCallback);
02035         pRegion->ResetRender();
02036 
02037         // Now actually export the nodes themselves
02038         // Use a virtual function so that filters can overide this and say render in strips as
02039         // the bitmap filters are required to do
02040         ProgressOffset = 0;
02041         BOOL Result = ExportRenderNodes(pRegion, pDC, bVisibleLayersOnly, bSelectedOnly, FALSE/*TRUE*/);
02042 
02043         // return the result to the caller
02044         return Result;
02045     }
02046 #else
02047     return FALSE;
02048 #endif
02049 }

BOOL Filter::ExportRenderNodes RenderRegion pRegion,
ExportDC pDC,
BOOL  VisibleLayersOnly = FALSE,
BOOL  CheckSelected = FALSE,
BOOL  ShowProgress = TRUE
[virtual]
 

Sets up the file to do an export of the nodes in the tree, by initialising the file, and any slow-job code. It then calls the WriteNodes method to do the actual work, and EndExportRender to complete the task.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com> (from Neville's original code)
Date:
12/4/00
Parameters:
pRegion - the render region to export to. [INPUTS] pDc - device context to use, can be NULL. VisibleLayersOnly - use visible layers or not ShowProgress - TRUE then start up a progress bar or FALSE assume the caller has done it.
Returns:
TRUE if the export process completed successfully, FALSE if an error occured.
See also:
Filter::ExportRender, Filter::WriteNodes, Filter::EndExportRender

Reimplemented in BaseBitmapFilter.

Definition at line 2189 of file filters.cpp.

02194 {
02195 #ifdef DO_EXPORT
02196     ERROR2IF ( pRegion == NULL, FALSE, "Filter::ExportRender null render region supplied" );
02197 
02198     // Start a progress update going
02199     if ( ShowProgress )
02200     {
02201         String_64   ExportMessage ( GetExportMsgID () );
02202         if ( pDC && pDC->ExportFile )
02203         {
02204             ExportMessage = GetExportProgressString ( pDC->ExportFile, GetExportMsgID () );
02205         }
02206         BeginSlowJob ( NumNodes, FALSE, &ExportMessage );
02207     }
02208 
02209     // Work out how often we want to update the progress bar.
02210     UpdateEvery = ( NumNodes / 100 ) + 1;
02211     
02212     LastExportProgressUpdate = 0;
02213     NumNodes = 0;
02214 
02215     // Guard against disk/file errors, and get ready to render.
02216     //TRY
02217     {
02218         // Get the region ready to render.
02219         if ( !pRegion->StartRender() )
02220         {
02221             // An error occured.
02222             if ( ShowProgress )
02223                 EndSlowJob ();
02224             return FALSE;
02225         }
02226     }
02227 #if 0
02228     CATCH ( CFileException, e )
02229     {
02230         // Didn't work - report failure to caller.
02231         if ( pDC )
02232             pDC->ExportFile->SetThrowExceptions ( FALSE );
02233         if ( ShowProgress )
02234             EndSlowJob ();
02235         return FALSE;
02236     }
02237     END_CATCH
02238 #endif
02239     // Write the nodes out to the file, and end the export
02240     if ( WriteNodes ( pRegion, pDC, VisibleLayersOnly, CheckSelected, ShowProgress ) &&
02241          EndExportRender ( pRegion, ShowProgress ) )
02242     {
02243         // It worked.
02244         return TRUE;
02245     }
02246     else
02247     {
02248         // Houston, we have a problem.
02249         return FALSE;
02250     }
02251 
02252 #else
02253     return FALSE;
02254 #endif
02255 }

BOOL Filter::ExportSelectionOnly BOOL  MaskedRender = FALSE  )  [virtual]
 

Determines if the filter wants to export only selected items. In the filters baseclass version the default action will be to export all objects by default Only used by bitmap export and in particular masked gif rendering at present.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/09/95
Returns:
True if this filter wants check if an object is selected or not and so export only the selected items Or False if want to export everything.
See also:
Filter::ExportRender;

Reimplemented in ImagemapFilter, GrabFrameFilter, FlashFilter, and MaskedFilter.

Definition at line 1801 of file filters.cpp.

01802 {
01803     // base class version says export everything regardless of whether selected or not.
01804     return FALSE;
01805 }

BOOL Filter::ExportVisibleLayersOnly  )  [virtual]
 

Determines if the filter wants to export only visible layers. NB. This base class version does the default action of making the filter export everything including hidden layers.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/02/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
True if this filter wants to exclude invisible layers and so export only visible items Or False if want to export everything.
See also:
Filter::ExportRender;

Reimplemented in BaseBitmapFilter, GrabFrameFilter, and FlashFilter.

Definition at line 1779 of file filters.cpp.

01780 {
01781     // base class version includes all layers and so everything will get exported
01782     return FALSE;
01783 }   

Filter * Filter::FindFilterFromID const UINT32  FilterID  )  [static]
 

Provides the Filter given its ID.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (moved into this class by Graham 7/7/97)
Date:
10/12/96
(This function is also in Filter Manager. Unfortunately, having it there means that every time you use it you have to get a pointer to the application, then use that to get a pointer to the filter manager, then use that pointer to call this function. So I've copied it here for convenience)

Definition at line 6648 of file filters.cpp.

06649 {
06650     Filter             *pFilter;
06651     for( pFilter = Filter::GetFirst();
06652          pFilter != 0;
06653          pFilter = Filter::GetNext(pFilter))
06654             if (pFilter->FilterID == FilterID)
06655             {
06656                 ERROR3IF(FilterID == FILTERID_NONE,
06657                             "Filter::FindFilterFromID: filter has _R(ID_NONE)?");
06658                 break;
06659             }
06660 
06661     return pFilter;
06662 }

void Filter::ForceStatusExportMessage UINT32  nMessage  )  [static]
 

Overrides the status-line message shown when a file is exported. This is used by the clipboard code to change "Saving document..." to "Copying to clipboard...".

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/9/96
Parameters:
nMessage ---- the message to use instead of the usual when [INPUTS] exporting a file.
See also:
Filter::UnforceStatusExportMessage; ExternalClipboard::GetDataSource

Definition at line 1565 of file filters.cpp.

01566 {
01567     // Use this message please (if derived classes allow it).
01568     m_nForcedStatusExportMessage = nMessage;
01569 }

Layer * Filter::GetActiveLayer Document pDoc  )  [protected]
 

Find the active layer of the first spread of the specified document.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/03/94
Parameters:
pDoc - the document to search. [INPUTS]
Returns:
Pointer to the layer found, or NULL if none,
See also:
Filter::GetFirstSpread

Definition at line 1384 of file filters.cpp.

01385 {
01386 PORTNOTE("spread", "Multi-spread warning!")
01387     Spread *pSpread = GetFirstSpread(pDoc);
01388     if (pSpread != NULL)
01389         return pSpread->FindActiveLayer();
01390 
01391     return NULL;
01392 }

BitmapFilterSupport Filter::GetBitmapSupportLevel  )  [virtual]
 

Determine how well this filter supports bitmaps when exporting.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/01/95
Returns:
NoBitmapSupport - This filter does not support bitmap images. SimpleBitmapSupport - This filter has simple support for bitmap images; they must be saved into the file whenever they are used. IndirectedBitmapSupport - This filter supports bitmap indirection; i.e. a bitmap pool of some type is saved and then this can be referenced in the file.

Reimplemented in ArtWorksEPSFilter, and CamelotNativeEPSFilter.

Definition at line 2531 of file filters.cpp.

02532 {
02533     // Defaults to no bitmap support
02534     return NoBitmapSupport;
02535 }

AttributeEntry* Filter::GetCurrentAttrs  )  [inline]
 

Definition at line 533 of file filters.h.

00533 { return CurrentAttrs; }

Document* Filter::GetDocument  )  [inline]
 

Reimplemented in BaseCamelotFilter.

Definition at line 532 of file filters.h.

00532 { return TheDocument; }

BOOL Filter::GetDragAndDropTranslation ImportPosition pPos,
DocRect  BoundsRect,
Coord Offset
[protected, virtual]
 

Given an drag'n'drop point (in pPos), calculate the translation necessary to position the imported objects at this position on the spread. It ensures that bounding rectangles smaller than the spread are wholly contained within the spread. i.e. if you drag a file right to the edge of a spread, the translation will move it closer to the centre of the spread so that it is wholly contained within the spread.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/10/94
Parameters:
pSpread - the spread to check against. [INPUTS] BoundsRect - the bounding rectangle to check (in spread coordinates).
Offset - [OUTPUTS]
Returns:
TRUE if the bounding rectangle is smaller than the spread => Offset now contains the translation necessary to position the objects correctly. FALSE if bounding rectangle is bigger than the spread, or pPos was NULL. In either case, a FALSE return results in Offset containing (0,0).
Used by the import filters for drag'n'drop to ensure that after the imported objects are translated to the drop point, they are all still on the spread. Made virtual 20/5/97.
See also:
Filter::DoImport

Reimplemented in TI_GIFFilter.

Definition at line 4404 of file filters.cpp.

04406 {
04407 #if !defined(EXCLUDE_FROM_RALPH)
04408     // First check to se if we actually have a drag and drop point.
04409     if (pPos == NULL)
04410     {
04411         // No - set offset to 0 and return FALSE to indicate we can't cope with this.
04412         Offset->x = 0;
04413         Offset->y = 0;
04414         return FALSE;
04415     }
04416 
04417     // Get the spread's bounding rectangle and convert it to spread coords.
04418     DocRect SpreadRect = pPos->pSpread->GetPasteboardRect();
04419     pPos->pSpread->DocCoordToSpreadCoord(&SpreadRect);
04420 
04421 #if defined( DODGY_BITMAP_POS_CODE )
04422     // Now check that the bounding rectangle is small enough to fit on the spread...
04423     if ((BoundsRect.Width() > SpreadRect.Width()) ||
04424         (BoundsRect.Height() > SpreadRect.Height()))
04425     {
04426         // No - set offset to 0 and return FALSE to indicate we can't cope with this.
04427         Offset->x = 0;
04428         Offset->y = 0;
04429         return FALSE;
04430     }
04431 #endif
04432 
04433     // Bounding box should be centred on drop point
04434     DocCoord Centre;
04435     Centre.x = (BoundsRect.lo.x + BoundsRect.hi.x) / 2;
04436     Centre.y = (BoundsRect.lo.y + BoundsRect.hi.y) / 2;
04437 
04438     Offset->x = pPos->Position.x - Centre.x;
04439     Offset->y = pPos->Position.y - Centre.y;
04440 
04441     // Transform the bounding rect to see if it's off the spread.
04442     BoundsRect.Translate(Offset->x, Offset->y);
04443 
04444     // If it's off the spread - limit it to the edge of the spread:
04445 
04446     // (a) Horizontal adjustment
04447     if (BoundsRect.lo.x < SpreadRect.lo.x)
04448         Offset->x += (SpreadRect.lo.x - BoundsRect.lo.x);
04449     else if (BoundsRect.hi.x > SpreadRect.hi.x)
04450         Offset->x -= (BoundsRect.hi.x - SpreadRect.hi.x);
04451 
04452     // (b) Vertical adjustment (most useful to clip hi co-ords)
04453     if (BoundsRect.hi.y > SpreadRect.hi.y)
04454         Offset->y -= (BoundsRect.hi.y - SpreadRect.hi.y);
04455     else if (BoundsRect.lo.y < SpreadRect.lo.y)
04456         Offset->y += (SpreadRect.lo.y - BoundsRect.lo.y);
04457 
04458     // Whatever happened, we can fit it on the spread.
04459     return TRUE;
04460 #else
04461     Offset->x = 0;
04462     Offset->y = 0;
04463     return FALSE;
04464 #endif
04465 }

UINT32 Filter::GetExportMsgID  )  [virtual]
 

Used to get the message id to be used during export. Virtual, so that two stage exporters can change the message.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/09/95
Returns:
The id of the message to put on the progress display whilst exporting.
See also:
DoExport;

Reimplemented in BaseBitmapFilter, GrabFrameFilter, MakeBitmapFilter, TI_GIFFilter, ImageMagickFilter, and PNGFilter.

Definition at line 1545 of file filters.cpp.

String_64 Filter::GetExportProgressString CCLexFile pExportFile,
UINT32  ExportingMsgID
[virtual]
 

Works out what progress bar string to use during exporting of the file. This consists of a basic message plus, if it will fit, a truncated form of the filename being exported.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/7/95
Parameters:
ExportFile file being used for importing [INPUTS] ImportingMsgID id of message to use as basis on progress string
- [OUTPUTS]
Returns:
String to use on the progress bar during import.
See also:
Filter::GetImportProgressString;

Definition at line 1748 of file filters.cpp.

01749 {
01750 #ifdef DO_EXPORT
01751     String_64 ProgressString(ExportingMsgID);
01752 
01753     // Ammend the string with the filename, if we can. 
01754     GetProgressString(pExportFile, &ProgressString);
01755 
01756     return ProgressString;
01757 #else
01758     return String_64( _T("") );
01759 #endif
01760 }

static List& Filter::GetFilters  )  [inline, static]
 

Definition at line 808 of file filters.h.

00808 {   return FilterList;  }

Filter * Filter::GetFirst  )  [static]
 

Iterating through the list of filters known to Camelot. This function returns the first filter.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/02/94
Returns:
Pointer to the first filter, or NULL if none.
See also:
Filter::GetNext() Scope: Static

Definition at line 1084 of file filters.cpp.

01085 {
01086     return (Filter *) FilterList.GetHead();
01087 }

Spread * Filter::GetFirstSpread Document pDoc  )  [static, protected]
 

Find the first spread of the specified document.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/03/94
Parameters:
pDoc - the document to search. [INPUTS]
Returns:
Pointer to the spread found, or NULL if no spread was found.
See also:
Filter::GetActiveLayer

Definition at line 1461 of file filters.cpp.

01462 {
01463     // Search for the first chapter node
01464     Node *pNode = pDoc->GetFirstNode()->FindNext()->FindFirstChild();
01465     while ((pNode != NULL) && (!pNode->IsKindOf(CC_RUNTIME_CLASS(Chapter))))
01466         pNode = pNode->FindNext();
01467         
01468     ENSURE(pNode->IsKindOf(CC_RUNTIME_CLASS(Chapter)), 
01469            "Filter::GetFirstSpread(): Could not find Chapter");
01470     Chapter *pChapter = (Chapter *) pNode;
01471     
01472     // pSpread is a child of pChapter
01473 PORTNOTE("spread", "Multi-spread warning!")
01474     Spread *pSpread = (Spread *) pChapter->FindFirstChild();
01475     ENSURE(pSpread->IsKindOf(CC_RUNTIME_CLASS(Spread)),
01476            "Filter::GetFirstSpread(): Could not find Spread");
01477 
01478     if (pSpread->IsKindOf(CC_RUNTIME_CLASS(Spread)))
01479         return pSpread;
01480     else
01481         return NULL;
01482 }

FilterFlags Filter::GetFlags  ) 
 

Get the flags for a specified filter.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/02/94
Returns:
The FilterFlags structure
See also:
FilterFlags

Definition at line 1120 of file filters.cpp.

01121 {
01122     return Flags;
01123 }

static GenericFilter* Filter::GetGenericFilter  )  [inline, static]
 

Definition at line 530 of file filters.h.

00530 { return pGenericFilter; }

UINT32 Filter::GetImportMsgID  )  [virtual]
 

Used to get the message id to be used during export. Virtual, so that multi-stage importers can change the message.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/12/95
Returns:
The id of the message to put on the progress display whilst importing.
See also:
DoImport;

Reimplemented in BaseBitmapFilter.

Definition at line 1527 of file filters.cpp.

01528 {
01529     return ImportMsgID;
01530 }

String_64 Filter::GetImportProgressString CCLexFile pImportFile,
UINT32  ImportingMsgID
[virtual]
 

Works out what progress bar string to use during importing of the file. This consists of a basic message plus, if it will fit, a truncated form of the filename being imported.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/7/95
Parameters:
ImportFile file being used for importing [INPUTS] ImportingMsgID id of message to use as basis on progress string
- [OUTPUTS]
Returns:
String to use on the progress bar during import.
See also:
Filter::GetExportProgressString;

Definition at line 1721 of file filters.cpp.

01722 {
01723     String_64 ProgressString(ImportingMsgID);
01724 
01725     // Ammend the string with the filename, if we can. 
01726     GetProgressString(pImportFile, &ProgressString, &m_StrToAddToProgress);
01727 
01728     return ProgressString;
01729 }

ID Filter::GetNewFilterID  )  [static]
 

Support function providing an unique ID for each newly registered Filter.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/12/96
Returns:
A FilterID unique to this FilterManager for each call to the function

Definition at line 979 of file filters.cpp.

00980 {
00981     ERROR3IF(!m_NextFilterID, "Creating duff FilterID");
00982 
00983     return m_NextFilterID++;
00984 }

Filter * Filter::GetNext Filter pFilter  )  [static]
 

Iterating through the list of filters known to Camelot. This function returns the next filter.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/02/94
Parameters:
pFilter - pointer to the filter to be used to get the following filter. [INPUTS]
Returns:
Pointer to the next filter, or NULL if none.
See also:
Filter::GetFirst

Definition at line 1103 of file filters.cpp.

01104 {
01105     return (Filter *) FilterList.GetNext(pFilter);
01106 }

UINT32 Filter::GetNumNodes  ) 
 

Allows access to the stored numbers of nodes which is currently set up to be used for a progress bar.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/5/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The numbers of nodes which are currently set up to be used for a progress bar.

Definition at line 2417 of file filters.cpp.

02418 {
02419     return NumNodes;
02420 }

Layer* Filter::GetSoleLayer  )  [inline]
 

Definition at line 562 of file filters.h.

00562 {return m_pSoleLayer;}

virtual INT32 Filter::HowCompatible PathName Filename,
ADDR  HeaderStart,
UINT32  HeaderSize,
UINT32  FileSize
[inline, virtual]
 

Reimplemented in BaseCamelotFilter, CDRFilter, CMXFilter, CMXImportFilter, MSPaletteFilter, PaintShopProPaletteFilter, AdobeColourTableFilter, AdobeColourSwatchFilter, CorelPaletteFilter, JCWColourFilter, AcornDrawFilter, EPSFilter, JPEGExportFilter, FilterFamily, FlareTemplateFilter, JPEGImportFilter, PreviewFilter, PluginNativeFilter, BMPFilter, TI_GIFFilter, ImageMagickFilter, MetaFileFilter, PNGFilter, and BasePMFilter.

Definition at line 502 of file filters.h.

00506     {
00507         return 0;
00508     }

INT32 Filter::ImportBinary ADDR  pData,
INT32  Length
[virtual]
 

Read in binary data from the file and place it in the buffer supplied by the caller. This is over-ridden by filters to do whatever translation is necessary, e.g. EPS filters convert ASCII Hexadecimal data to binary.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/08/94
Parameters:
Length - the number of bytes to read. [INPUTS]
pData - the buffer to place the bytes in. [OUTPUTS]
Returns:
The number of bytes read, or -1 for an error. (NB. Base class version always returns -1)
NB. This base class version has no functionality - it always returns FALSE without setting the error ID and ENSUREs in debug builds. Don't use it!

Returns:
Errors: End of file; Disk error

Reimplemented in EPSFilter, and CamelotNativeEPSFilter.

Definition at line 1507 of file filters.cpp.

01508 {
01509     ENSURE(FALSE, "Base class ImportBinary() function called!");
01510     return -1;
01511 }

BOOL Filter::ImportBitmap CCLexFile ,
KernelBitmap ** 
[virtual]
 

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/4/94
Parameters:
- [INPUTS]
Returns:
TRUE if the bitmap was imported ok (or if it wasn't imported because the file format does not support it; FALSE if an error occured.

Errors: Usual disk/file errors.

See also:
CamelotEPSFilter::ExportBitmap

Reimplemented in BaseBitmapFilter, and FilterFamily.

Definition at line 2553 of file filters.cpp.

02554 {
02555     // Base class - ignore bitmaps
02556     return TRUE;
02557 }

void Filter::IncludePreviewBmp BOOL  WantBmp  ) 
 

Asks the filter to include a Preview bitmap or not. NOTE: This only has any effect if the Filter answered TRUE to a call to CanIncludePreviewBmp. NOTE2: All the filters hang around even if they are not doing any filtering, so if you set this flag one way it will stay like that for all future uses of the filter until it is set again. The best method will be to swtich it on if required, do the import and then switch it off again immediatly afterwards.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/2/95
Parameters:
WantBmp - TRUE if you want the filter to Include a Preview Bitmap. [INPUTS] FALSE if not.
See also:
Filter::CanIncludePreviewBmp

Definition at line 491 of file filters.cpp.

00492 {
00493     // Set the internal Flag
00494     WantPreviewBmp = WantBmp;
00495 }

virtual BOOL Filter::IncProgressBarCount UINT32  n  )  [inline, virtual]
 

Reimplemented in BaseBitmapFilter, and BaseCamelotFilter.

Definition at line 831 of file filters.h.

00831 { return TRUE; }    // do nothing

virtual BOOL Filter::Init void   )  [pure virtual]
 

Declares a preference that allows you to clear memory in delete().

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/94
Returns:
TRUE if it worked OK, FALSE if not

Reimplemented from SimpleCCObject.

Implemented in AI5EPSFilter, AI8EPSFilter, AIEPSFilter, PhotoShopEPSFilter, ArtWorksEPSFilter, BaseBitmapFilter, CamelotEPSFilter, BaseCamelotFilter, CDRFilter, CMXFilter16, CMXFilter32, CMXImportFilter, MSPaletteFilter, PaintShopProPaletteFilter, AdobeColourTableFilter, AdobeColourSwatchFilter, CorelPaletteFilter, JCWColourFilter, CorelEPSFilter, Corel3EPSFilter, Corel4EPSFilter, AcornDrawFilter, EPSFilter, JPEGExportFilter, GenericFilter, VectorFilterFamily, BitmapFilterFamily, GenericEPSFilter, PaletteFilterFamily, ImagemapFilter, FreeHandEPSFilter, FlareTemplateFilter, JPEGImportFilter, CamelotNativeFilter, CamelotNativeEPSFilter, PreviewFilter, PreviewFilterBMP, PreviewFilterGIF, PreviewFilterJPEG, PreviewFilterPNG, FlashFilter, CamelotWebFilter, BMPFilter, TI_GIFFilter, ImageMagickFilter, MaskedFilter, MetaFileFilter, PNGFilter, BasePMFilter, PPMFilter, PGMFilter, and PBMFilter.

BOOL Filter::InitFilters  )  [static]
 

Scans all filters to find out which filters are available for use, and instantiates one of each, and holds them in a list.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/02/94
Returns:
TRUE if initialised ok, FALSE if not.

Errors: Out of memory (if a filter fails to initialise for other reasons then an error is reported, but Camelot will still start up ok, i.e. TRUE is returned).

See also:
Filter

Definition at line 744 of file filters.cpp.

00745 {
00746     // Find the filters - the kernel ones are hard-wired.
00747     Filter*     pFilter;
00748 
00749     // Create, initialise and install the Generic import filter
00750     ADD_FILTER(GenericFilter)
00751 
00752     // Keep a pointer to this one, for handling drag'n'drop
00753     pGenericFilter = (GenericFilter *) pFilter;
00754 
00755     // Create, initialise and install the generic vector and bitmap filters
00756     ADD_FILTER(VectorFilterFamily)
00757     ADD_FILTER(BitmapFilterFamily)
00758 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
00759 #if BUILD_TEXT_FILTERS
00760     ADD_FILTER(TextFilterFamily)
00761 #endif
00762 #endif
00763     // Create, initialise and install the Generic EPS import filter
00764 #ifndef STANDALONE
00765     ADD_FILTER(GenericEPSFilter)
00766 #endif
00767 
00768 #ifndef EXCLUDE_FROM_XARALX
00769 // Remove this next line to add the CDR / CMX filters...
00770 #ifndef NOCDRCMX
00771     ADD_FILTER(PaletteFilterFamily)
00772 #endif
00773 #endif
00774 
00775     // Create, initialise and install the other supported filters:
00776     // This must be the first filter that uses .xar or "Save as" wont work
00777     ADD_FILTER(CamelotNativeFilter)     // The new designed native filter, used for v2
00778 PORTNOTETRACE("filter","Removed CamelotWebFilter usage");
00779 #ifndef EXCLUDE_FROM_XARALX
00780     ADD_FILTER(CamelotWebFilter)        // The minimalistic form of the v2 native filter
00781 #endif
00782     ADD_FILTER(CamelotEPSFilter)
00783     ADD_FILTER(CamelotNativeEPSFilter)  // The old style EPS native filter, used in v1.1
00784     // Winoil filters are initialised here to prevent the drop-down list from being
00785     // mis-ordered.
00786 
00787     // Graeme (25-9-00) - Primary filters, in the order that Mark requested.
00788     ADD_FILTER(JPEGExportFilter)
00789     ADD_FILTER(JPEGImportFilter)
00790 
00791     ADD_FILTER(PNGFilter)
00792 
00793     if (ImageMagickFilter::CheckPath())
00794     {
00795         // Most of these commented out whilst we have no useful interface for
00796         // filter selection
00797         ADD_FILTER(ImageMagickFilterBMP)
00798         //ADD_FILTER(ImageMagickFilterCUR)
00799         //ADD_FILTER(ImageMagickFilterCUT)
00800         //ADD_FILTER(ImageMagickFilterDCM)
00801         //ADD_FILTER(ImageMagickFilterDCX)
00802         //ADD_FILTER(ImageMagickFilterDIB)
00803         //ADD_FILTER(ImageMagickFilterDNG)
00804         //ADD_FILTER(ImageMagickFilterEPDF)
00805         //ADD_FILTER(ImageMagickFilterEPI)
00806         //ADD_FILTER(ImageMagickFilterEPS)
00807         //ADD_FILTER(ImageMagickFilterEPS2)
00808         //ADD_FILTER(ImageMagickFilterEPS3)
00809         //ADD_FILTER(ImageMagickFilterEPSF)
00810         //ADD_FILTER(ImageMagickFilterEPSI)
00811         //ADD_FILTER(ImageMagickFilterEPT)
00812         //ADD_FILTER(ImageMagickFilterFAX)
00813         //ADD_FILTER(ImageMagickFilterFITS)
00814         ADD_FILTER(ImageMagickFilterICO)
00815         //ADD_FILTER(ImageMagickFilterJNG)
00816         //ADD_FILTER(ImageMagickFilterMIFF)
00817         //ADD_FILTER(ImageMagickFilterMPC)
00818         //ADD_FILTER(ImageMagickFilterOTB)
00819         //ADD_FILTER(ImageMagickFilterP7)
00820         //ADD_FILTER(ImageMagickFilterPALM)
00821         //ADD_FILTER(ImageMagickFilterPAM)
00822         //ADD_FILTER(ImageMagickFilterPBM)
00823         ADD_FILTER(ImageMagickFilterPCD)
00824         //ADD_FILTER(ImageMagickFilterPCDS)
00825         //ADD_FILTER(ImageMagickFilterPCL)
00826         //ADD_FILTER(ImageMagickFilterPCX)
00827         //ADD_FILTER(ImageMagickFilterPDB)
00828         ADD_FILTER(ImageMagickFilterPDF)
00829         //ADD_FILTER(ImageMagickFilterPGM)
00830         ADD_FILTER(ImageMagickFilterPICT)
00831         //ADD_FILTER(ImageMagickFilterPIX)
00832         ADD_FILTER(ImageMagickFilterPNM)
00833         ADD_FILTER(ImageMagickFilterPPM)
00834         //ADD_FILTER(ImageMagickFilterPS)
00835         //ADD_FILTER(ImageMagickFilterPS2)
00836         //ADD_FILTER(ImageMagickFilterPS3)
00837         ADD_FILTER(ImageMagickFilterPSD)
00838         //ADD_FILTER(ImageMagickFilterPTIF)
00839         //ADD_FILTER(ImageMagickFilterPWP)
00840         //ADD_FILTER(ImageMagickFilterRLA)
00841         //ADD_FILTER(ImageMagickFilterRLE)
00842         //ADD_FILTER(ImageMagickFilterSCT)
00843         //ADD_FILTER(ImageMagickFilterSFW)
00844         //ADD_FILTER(ImageMagickFilterSUN)
00845         // // ADD_FILTER(ImageMagickFilterSVG) - removed per NeilH 19/07/2006 so it doesn't clash with vector SVG import
00846         //ADD_FILTER(ImageMagickFilterTGA)
00847         ADD_FILTER(ImageMagickFilterTIFF)
00848         //ADD_FILTER(ImageMagickFilterTIM)
00849         //ADD_FILTER(ImageMagickFilterTTF)
00850         //ADD_FILTER(ImageMagickFilterVICAR)
00851         //ADD_FILTER(ImageMagickFilterVIFF)
00852         //ADD_FILTER(ImageMagickFilterWBMP)
00853         //ADD_FILTER(ImageMagickFilterWPG)
00854         //ADD_FILTER(ImageMagickFilterXBM)
00855         //ADD_FILTER(ImageMagickFilterXCF)
00856         ADD_FILTER(ImageMagickFilterXPM)
00857         //ADD_FILTER(ImageMagickFilterXWD)
00858     }
00859 
00860     ADD_FILTER(TI_GIFFilter)
00861 PORTNOTETRACE("filter","Removed TIFFFilter");
00862 #ifndef EXCLUDE_FROM_XARALX
00863     ADD_FILTER(TIFFFilter)                  
00864 #endif
00865 
00866 #if !defined(EXCLUDE_FROM_XARALX) && !defined(PROD_XS)
00867     // disabled for XS builds
00868     OILFilter::InitPluginFilters(FilterList);
00869 #endif
00870 
00871 PORTNOTE("filter","Removed Flash filter for 0.7")
00872 #if defined(_DEBUG)
00873     ADD_FILTER(FlashFilter)
00874 #endif
00875 
00876 #ifndef STANDALONE
00877     // Other filters in alphabetical order.
00878 PORTNOTE("filter","Removed filters usage")
00879 #ifndef EXCLUDE_FROM_XARALX
00880     ADD_FILTER(AcornDrawFilter)
00881 #endif
00882     // Adobe AI / EPS filters.
00883     ADD_FILTER(AIEPSFilter)
00884     ADD_FILTER(AI5EPSFilter)
00885     ADD_FILTER(AI8EPSFilter)
00886 
00887     ADD_FILTER(PhotoShopEPSFilter)
00888 
00889     ADD_FILTER(ArtWorksEPSFilter)
00890 PORTNOTE("filter","Removed filters usage")
00891 #ifndef EXCLUDE_FROM_XARALX
00892 
00893 //  ADD_FILTER(BMPFilter)
00894 
00895     // These filters are not shown in the drop-down menu.
00896 //  ADD_FILTER(AdobeColourSwatchFilter)
00897 //  ADD_FILTER(AdobeColourTableFilter)
00898 //  ADD_FILTER(JCWColourFilter)
00899 
00900 // Remove this next line to add the CDR / CMX filters...
00901 #ifndef NOCDRCMX
00902 
00903     // Corel native filters. (CMX and CDR.)
00904     ADD_FILTER(CDRFilter)
00905     ADD_FILTER(CMXImportFilter)
00906 PORTNOTE("filter","Removed CMXFilterX usage")
00907     ADD_FILTER(CMXFilter16)
00908     ADD_FILTER(CMXFilter32) 
00909 
00910 #endif //NOCDRCMX
00911 
00912 
00913     // Corel EPS filters.
00914 PORTNOTE("filter","Removed Corel EPS filters usage")
00915     ADD_FILTER(Corel3EPSFilter)
00916     ADD_FILTER(Corel4EPSFilter)
00917 
00918     ADD_FILTER(CorelPaletteFilter)
00919 #endif
00920     ADD_FILTER(FreeHandEPSFilter)
00921 
00922 PORTNOTE("filter","Removed filters usage")
00923 #ifndef EXCLUDE_FROM_XARALX
00924     // HTML based filters.
00925 PORTNOTE("filter","Removed HTMLFilter usage")
00926     ADD_FILTER(HTMLFilter)  // the HTML filter
00927     ADD_FILTER(ImagemapFilter)
00928 #endif //EXCLUDE_FROM_XARALX
00929 
00930 
00931 #if BUILD_OTHER_TEXT_FILTERS
00932 
00933     // The text filters don't appear in the drop-down menu.
00934     ADD_FILTER(ANSITextFilter)
00935     ADD_FILTER(UnicodeTextFilter)
00936     ADD_FILTER(RTFTextFilter)
00937 
00938 #endif
00939 
00940 #endif
00941 
00942 #ifdef _DEBUG
00943     ADD_FILTER(FlareTemplateFilter)     // The text version
00944 #endif
00945 
00946     // Initialise the OIL filters (but they are still objects of class "Filter")
00947     // This can include filters specific to one platform.
00948     OILFilter::InitFilters(FilterList);
00949 
00950 #if !defined(EXCLUDE_FROM_RALPH)
00951     // Register our preference for minimum line widths, and whether or not we import
00952     // unnamed colours into the document colour list.
00953     Camelot.DeclareSection(_T("Filters"), 10); 
00954     Camelot.DeclarePref(_T("Filters"), _T("MinLineWidth"),      &MinLineWidth, 0, 10000); 
00955     Camelot.DeclarePref(_T("Filters"), _T("ImportWithLayers"),  &ImportWithLayers); 
00956     Camelot.DeclarePref(_T("Filters"), _T("OpenWithLayers"),    &OpenWithLayers); 
00957     Camelot.DeclarePref(_T("Filters"), _T("ImportBitmapsOntoLayers"),   &ImportBitmapsOntoLayers); 
00958     Camelot.DeclarePref(_T("Filters"), _T("DontWarnBitmapNonMixTransp"),    &bDontWarnBitmapNonMixTransp); 
00959     Camelot.DeclarePref(_T("Filters"), _T("AddUnnamedColours"), &AddUnnamedColours); 
00960 
00961 #endif
00962     XSEPSExportOptions::Init();
00963     BaseBitmapFilter::InitBaseClass();
00964     // All ok
00965     return TRUE;
00966 }

BOOL Filter::IsDefaultDocRequired const TCHAR pcszPathName  )  [virtual]
 

Works out if opening a file of this type requires a default document to be loaded. If the file format supplies the document then return FALSE otherwise return TRUE. An example would be opening a bitmap file. This has no document defined in the file format and so we need to laod the default document before importing the bitmap into this file. In this baseclass version return FALSE and hence assume that the filters that need to will override this function to return TRUE.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/10/95
Parameters:
pcszPathName pointer to the pathname to check [INPUTS]
Returns:
TRUE if the filter requires a default document, FALSE if not.
See also:
Filter; Filter::IsDefaultDocRequired; CCamDoc::OnOpenDocument;

FilterFamily::DoImport; Filter::DoImport;

Reimplemented in BaseBitmapFilter, CamelotEPSFilter, BaseCamelotFilter, CMXImportFilter, PaletteFilter, AcornDrawFilter, EPSFilter, FilterFamily, CamelotWebFilter, TI_GIFFilter, and MetaFileFilter.

Definition at line 1145 of file filters.cpp.

01146 {
01147     // No need to check the pathname, just return FALSE as most filters will not require the
01148     // default document.
01149     return FALSE;
01150 }   

BOOL Filter::JoinFamily CCRuntimeClass pRuntimeClass  )  [virtual]
 

Allow a filter to choose whether or not it wants to become part of a filter 'family', e.g. a filter family such as "EPS files", or "Bitmap files". The default implementation checks to see if the filter is of the same kind of filter, using IsKindOf(), and if so, it consents to be in the filter family. Filters should only over-ride this if they need different behaviour for some bizarre reason.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/07/94
Parameters:
pRuntimeClass - the type of filters in this family. [INPUTS]
Returns:
TRUE if the filter can be added to the family; FALSE if not.

Reimplemented in FilterFamily.

Definition at line 1065 of file filters.cpp.

01066 {
01067     return IsKindOf(pRuntimeClass);
01068 }

ADDR Filter::LoadInitialSegment CCLexFile pFile,
UINT32 pSize,
size_t *  pFileSize
 

Determine if this filter can load the specified file. The filter is provided with the first n bytes of the file, where n is HeaderSize. It should look at this data and/or the pathname to determine if it can load this file. NB. Base class function is pure virtual - override it!Loads in the first n bytes of a file, in order to investigate whether a filter (or number of filters in the case of the FilterFamily class), is compatible with the file - i.e. how well this file recognises the file header. The last byte in the block is set to 0, to prevent ASCII lexers from going trundling off the end.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/03/94
Parameters:
pFile - the file to load from. [INPUTS] Size - the number of bytes to load from the file.
Size - the number of bytes actually loaded (not actually implemented yet; [OUTPUTS] waiting for the CCFile class to be updated).
Returns:
Address the the loaded block

Errors: Unable to open file; Out of memory

See also:
Filter::HowCompatible; Filter::PreHowCompatible

Definition at line 1217 of file filters.cpp.

01218 {
01219     ERROR3IF(pFile == NULL, "Null CCLexFile* in Filter::LoadInitialSegment");
01220 
01221     BOOL ThrowState = pFile->SetThrowExceptions(TRUE);
01222     BOOL ErrorState = pFile->SetReportErrors(FALSE);
01223     
01224     // Tell caller how big the file is in bytes
01225     *pFileSize = pFile->Size();
01226 
01227     // Now that we know the file size, check to see if it has a chance of being loaded.
01228     // 4 is a nice small size that would fail the tests below.
01229     if (*pFileSize < 4)
01230     {
01231         // Could set a new special 'I don't think this file has any useful info in'. 
01232         TRACEUSER( "Neville", _T("LoadInitialSegment(): Very small file found\n"));
01233         ERROR1(NULL, _R(IDE_FILETOOSMALL));
01234     }
01235 
01236     // Check if the file size is less than the required initial segement size.
01237     // If so set the size to be the file size.
01238     // Casting UINT32 to INT32 should be ok as we know we are between 4 and the specified size.
01239     if ((UINT32) *pFileSize < *pSize)
01240         *pSize = (UINT32) *pFileSize;
01241 
01242     ADDR FilterBuf = (ADDR) CCMalloc(*pSize);
01243     if (FilterBuf == NULL)
01244         return NULL;
01245 
01246     // Save the current read pointer.
01247     FilePos nOldPos = pFile->tellIn();
01248 
01249     try
01250     {
01251         // A flag see if things are working
01252         BOOL IsResultOK = TRUE;
01253 
01254         
01255         // First we will check to see if it starts with the fabby binary EPS marker
01256         char Buf[4];
01257         pFile->SetDontFail(TRUE);
01258         pFile->read(Buf, 4);
01259         pFile->SetDontFail(FALSE);
01260 
01261         if( Progress::IsRalphAbort() )
01262             return NULL; 
01263     
01264         if ((Buf[0]=='\xC5') && (Buf[1]=='\xD0') && (Buf[2]=='\xD3') && (Buf[3]=='\xC6'))
01265         {
01266             // Yes, this is a binary EPS file that has a TIFF attached, so find the EPS
01267             FilePos StartOfEPS = 0;
01268 
01269             pFile->SetDontFail(TRUE);
01270             pFile->read(&StartOfEPS, 4);
01271             StartOfEPS = LEtoNative(StartOfEPS);
01272             pFile->SetDontFail(FALSE);
01273             if(Progress::IsRalphAbort())
01274                 return NULL; 
01275 
01276             TRACEUSER( "Rik", _T("EPS Starts at %ld\n"), StartOfEPS);
01277 
01278             // see if the result makes sense
01279             if (StartOfEPS==0)
01280             {
01281                 // Must be rubbish
01282                 TRACEUSER( "Rik", _T("This file claims to start at 0 - Its rubbish\n"));
01283                 IsResultOK = FALSE;
01284             }
01285         
01286             // Seek to the start of the EPS ready for the importer to read it.
01287             pFile->seekIn(StartOfEPS, ios::beg);
01288 
01289             // If the end of the file comes before the 1k we require then we must only read
01290             // the remaining file size otherwise the read below will error.
01291             if ((UINT32)(*pFileSize - StartOfEPS) < *pSize)
01292             {
01293                 *pSize = (UINT32) (*pFileSize - StartOfEPS);
01294                 TRACEUSER( "Neville", _T("Reduced initial segement size to %d\n"), *pSize);
01295             }
01296         }
01297         else
01298         {
01299             // This was not a binary EPS file, so go back to the start of the file
01300             pFile->seekIn(nOldPos, ios::beg);
01301         }
01302 
01303         // BODGE: Size should be updated to the number of bytes actually read.
01304         pFile->SetDontFail(TRUE);
01305         if (IsResultOK) pFile->read(FilterBuf, *pSize);
01306         pFile->SetDontFail(FALSE);
01307 
01308         if( Progress::IsRalphAbort() )
01309             return NULL; 
01310 
01311         // Don't need this file anymore - restote its original read pointer.
01312         pFile->seekIn(nOldPos, ios::beg);
01313 
01314         // Set back the old error informing and throwing states
01315         pFile->SetThrowExceptions(ThrowState);
01316         pFile->SetReportErrors(ErrorState);
01317 
01318         // If it worked
01319         if (IsResultOK)
01320         {
01321             // Zero the last byte of the buffer to make it simple for ASCII analysis.
01322             FilterBuf[(*pSize) - 1] = 0;
01323 
01324             // Return address of file data
01325             return FilterBuf;
01326         }
01327 
01328         // If we get here, there was a problem, so return null
01329         if (FilterBuf != NULL) CCFree(FilterBuf);
01330 
01331         // return
01332         ERROR1(NULL, _R(IDS_FILECORRUPT));
01333     }
01334     catch( CFileException )
01335     {
01336         // Restore the original read pointer.
01337         pFile->seekIn(nOldPos, ios::beg);
01338 
01339         // Set back the old error informing and throwing states
01340         pFile->SetThrowExceptions(ThrowState);
01341         pFile->SetReportErrors(ErrorState);
01342         
01343         // We had an error so the buffer is no good any more so remove it and
01344         // return NULL to the caller.
01345         if (FilterBuf != NULL) CCFree(FilterBuf);
01346         
01347         // We had a problem so return null
01348         return NULL;
01349     }
01350 
01351     // Should not get here
01352     return NULL;
01353 }

ADDR Filter::LoadInitialSegment PathName Path,
UINT32 Size,
size_t *  FileSize
 

Definition at line 1356 of file filters.cpp.

01357 {
01358     CCDiskFile FilterFile;
01359     if (!FilterFile.open(Path, ios::in | ios::binary))
01360     {
01361         TRACEUSER( "Tim", _T("LoadInitialSegment(): Could not open file\n"));
01362         ERROR1(NULL, _R(IDT_IMPORT_NOTFOUND));
01363     }
01364 
01365     return LoadInitialSegment(&FilterFile, Size, FileSize);
01366 }

BOOL Filter::MakeSureLayerExists Document pDoc  )  [protected]
 

This functions checks that there is a layer to put nodes onto during an import, and will create a new layer if there are none. This means that filters can call this function just before they try and insert a new node into the tree and be sure that there will be a layer for it to go onto. The function will return TRUE if there is a layer in the document (even if this function had to create the layer). It will return FALSE only if there are no layers and it was unable to create any new ones.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/4/95
Parameters:
pDoc - the document that the inserting is happening in [INPUTS]
Returns:
TRUE if there is a layer

Definition at line 1414 of file filters.cpp.

01415 {
01416     // Find the spread that all the action is happening on
01417 PORTNOTE("spread", "Multi-spread warning!")
01418     Spread* pSpread = GetFirstSpread(pDoc);
01419     if (pSpread==NULL)
01420         return FALSE;
01421 
01422     // Try and find a layer in this spread
01423     Layer* pLayer = pSpread->FindFirstLayer();
01424     
01425     // If there were no layers, then we should try and make one
01426     if (pLayer==NULL)
01427     {
01428         // Time to build a new layer...
01429         Layer *pNewLayer = new Layer(pSpread, LASTCHILD, String_256(_R(IDS_K_FILTERS_LAYERNAME)));
01430         
01431         // If we failed, return FALSE to the caller
01432         if (pNewLayer==NULL)
01433             return FALSE;
01434 
01435         // Make Layer1 (top layer) the active layer
01436         pNewLayer->SetActive(TRUE);
01437 
01438         // Move the Insertion position onto the new layer
01439         pDoc->ResetInsertionPosition();
01440     }
01441 
01442     // all worked
01443     return TRUE;
01444 }

BOOL Filter::OpenExportFile CCDiskFile pDiskFile,
PathName pPath
[virtual]
 

Opens up the file ready for exporting into. Assumes the file has already been constructed with the correct buffers etc..

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/12/95
Parameters:
pDiskFile The constructed disk file to use [INPUTS] pPath The pathname of the file to be opened
Returns:
True if the file has been opened correctly, False otherwise.
See also:
OpMenuExport::DoWithParam; Filters::DoExport;
Returns:
Errors: The relevent error is set if the file did not open properly

Definition at line 1824 of file filters.cpp.

01825 {
01826 #ifdef DO_EXPORT
01827     ERROR2IF(pDiskFile == NULL, FALSE,"Filter::OpenExportFile null file supplied");
01828     ERROR2IF(pPath == NULL, FALSE,"Filter::OpenExportFile null pathname supplied");
01829 
01830     // Open up the file. This will create a zero length file just to make sure that it
01831     // is possible, i.e. we have write access. This should have actually already been
01832     // checked by the file export dialog code and trapped before this.
01833     // Added 27/9/95 ios::trunc as exporting a bitmap or eps file to the same file twice
01834     // appended the data to the end of the file on Windows 95.
01835     BOOL ok = pDiskFile->open(*pPath, ios::in | ios::out | ios::binary | ios::trunc);
01836     
01837     if (!ok)
01838     {
01839         // Failed to open the file so set the error that we want to report
01840         Error::SetError(_R(IDT_EXPORT_NOTFOUND), 0);
01841     }
01842     return ok;
01843 #else
01844     return FALSE;
01845 #endif
01846 }

void Filter::PopCurrentAttrsBasedOnSnapShot  )  [protected]
 

This function uses the snap shot facility. It checks the snap shot list against the current attribute list to find attributes which differ. Those that do are obviously new attributes. ie attributes which have been parsed by the filter after the snap shot was taken. This function takes the current attrubute list and removes all those attributes which have changed in this way. It resets them to their default none temp attribute types.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/95
Parameters:
- [INPUTS]
Returns:
-

Definition at line 704 of file filters.cpp.

BOOL Filter::PreHowCompatible  )  [virtual]
 

Allows a filter or set of filters to take some action or set up variables before being called by HowCompatible. A group of filters which share common code may require some variable set up before being asked to check the type. Base class does nothing and so works for all filters which do not require it.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/94
Returns:
True if it it worked ok.
See also:
HowCompatible

Definition at line 1167 of file filters.cpp.

01168 {
01169     return TRUE;
01170 }

void Filter::PushCurrentAttrsBasedOnSnapShot  )  [protected]
 

This function uses the snap shot facility. It checks the snap shot list against the current attribute list to find attributes which differ. Those that do are obviously new attributes. ie attributes which have been parsed by the filter after the snap shot was taken. This function takes the current attrubute list and removes all those attributes which have changed in this way. It resets them to their default none temp attribute types.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/95
Parameters:
- [INPUTS]
Returns:
-

Definition at line 681 of file filters.cpp.

ID Filter::RegisterFilter Filter *const   pFilter  )  [static]
 

Permits the filter to be used by the FilterManager. For an import filter to be present on the Import dialog the filter should associate itself with the requisite FileFormats via AssociateFilterWithFormat().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/12/94
Parameters:
pFilter,: pointer to the filter to register [INPUTS] DestructMethod : whether or not the given filter should be destructed when the collection of registered filters is destructed.
Returns:
FilterID that uniquely identifies the given filter within the scope of this FilterManager and allows for fast retrieval of the filter.

Definition at line 1005 of file filters.cpp.

01006 {
01007     ERROR2IF(pFilter == NULL, 0, "NULL Args");
01008 
01009     ID newID = GetNewFilterID();
01010     GetFilters().AddTail(pFilter);
01011 
01012     return newID;
01013 }

BOOL Filter::RemoveTextScript  )  [protected]
 

Removes any script attribute which is currently active.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/04/94
Parameters:
- [INPUTS] Returns TRUE if the attribute was removed FALSE otherwise.
Returns:
Errors: Out of memory.
See also:

Definition at line 6561 of file filters.cpp.

06562 {
06563     // Sanity check
06564     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06565 
06566     // if a script attribute exists, delete it.
06567     if (CurrentAttrs[ATTR_TXTSCRIPT].Temp)
06568         CurrentAttrs[ATTR_TXTSCRIPT].Ignore = TRUE;
06569     return TRUE;
06570 }

BOOL Filter::SetAltRainbowFillEffect  )  [protected]
 

Definition at line 4195 of file filters.cpp.

04196 {
04197     // Sanity check
04198     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
04199 
04200     // If we haven't changed this attribute yet, then make a new attribute object for
04201     // our own personal use...
04202     if (!CurrentAttrs[ATTR_FILLEFFECT].Temp)
04203     {
04204         // Make the correct attribute value and install it as the current one.
04205         CurrentAttrs[ATTR_FILLEFFECT].pAttr = new FillEffectAltRainbowAttribute;
04206         if (CurrentAttrs[ATTR_FILLEFFECT].pAttr == NULL)
04207             return FALSE;
04208         CurrentAttrs[ATTR_FILLEFFECT].Temp = TRUE;
04209     }
04210     else
04211     {
04212         // Ensure we have the correct attribute
04213         if (!IS_A(CurrentAttrs[ATTR_FILLEFFECT].pAttr, FillEffectAltRainbowAttribute))
04214         {
04215             // Wrong type - delete it and get the right type of attribute value.
04216             delete CurrentAttrs[ATTR_FILLEFFECT].pAttr;
04217             CurrentAttrs[ATTR_FILLEFFECT].pAttr = new FillEffectAltRainbowAttribute;
04218             if (CurrentAttrs[ATTR_FILLEFFECT].pAttr == NULL)
04219                 return FALSE;
04220         }
04221     }
04222 
04223     // All worked ok.
04224     return TRUE;
04225 }

BOOL Filter::SetBitmapFill KernelBitmap pBitmap,
DocCoord  StartPoint,
DocCoord  EndPoint,
DocCoord  EndPoint2,
DocColour StartColour = 0,
DocColour EndColour = 0
[protected]
 

Updates the current attribute for fill colour to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/08/94
Parameters:
pBitmap - pointer to the bitmap object to fill with. [INPUTS] StartPoint, EndPoint, EndPoint2 - see BitmapFillAttribute.
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init; BitmapFillAttribute

Definition at line 3483 of file filters.cpp.

03486 {
03487     // Sanity check
03488     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03489     ERROR3IF((StartColour != 0 && EndColour == 0) || (StartColour == 0 && EndColour != 0),
03490             "SetBitmapFill, StartColour and EndColour have a different status");
03491 
03492     // Find out which fill attribute to change
03493     AttributeEntry *pEntry;
03494     if (FillAttr.pAttr == NULL)
03495         // No 'saved' fill attribute, so just update the normal one.
03496         pEntry = &CurrentAttrs[ATTR_FILLGEOMETRY];
03497     else
03498         // Update the saved fill attribute.
03499         pEntry = &FillAttr;
03500 
03501     // If we haven't changed this attribute yet, then make a new attribute object for
03502     // our own personal use...
03503     if (!pEntry->Temp)
03504     {
03505         // Make the correct attribute value and install it as the current one.
03506         pEntry->pAttr = new BitmapFillAttribute;
03507         if (pEntry->pAttr == NULL)
03508             return FALSE;
03509         pEntry->Temp = TRUE;
03510     }
03511     else
03512     {
03513         // Ensure we have the correct attribute
03514         if (!IS_A(pEntry->pAttr, BitmapFillAttribute))
03515         {
03516             // Wrong type - delete it and get the right type of attribute value.
03517             delete pEntry->pAttr;
03518             pEntry->pAttr = new BitmapFillAttribute;
03519             if (pEntry->pAttr == NULL)
03520                 return FALSE;
03521         }
03522     }
03523 
03524     // We've got an attribute - change it.
03525     BitmapFillAttribute *pAttr = (BitmapFillAttribute *) pEntry->pAttr;
03526 
03527     // Copy field values.
03528     pAttr->SetStartColour(StartColour);
03529     pAttr->SetEndColour(EndColour);
03530 
03531     pAttr->SetStartPoint(&StartPoint);
03532     pAttr->SetEndPoint(&EndPoint);
03533     pAttr->SetEndPoint2(&EndPoint2);
03534 
03535     GetDocument()->SetCurrent();
03536 //  pAttr->AttachBitmap(pBitmap);
03537     pAttr->GetBitmapRef()->Attach(pBitmap, GetDocument());
03538 
03539     if (pAttr->GetBitmap() != pBitmap)
03540     {
03541         // It didn't use the bitmap we gave it, so we can delete it
03542         delete pBitmap;
03543     }
03544 
03545     // All worked ok.
03546     return TRUE;
03547 }

BOOL Filter::SetBitmapTranspFill UINT32  TranspType,
KernelBitmap pBitmap,
DocCoord  StartPoint,
DocCoord  EndPoint,
DocCoord  EndPoint2,
UINT32  StartTransp = 0,
UINT32  EndTransp = 255
[protected]
 

Updates the current attribute for fill colour to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/08/94
Parameters:
TranspType - the type of transparency (1-3) [INPUTS] pBitmap - pointer to the bitmap object to fill with. StartPoint, EndPoint, EndPoint2 - see BitmapTranspFillAttribute.
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init; BitmapFillAttribute

Definition at line 3987 of file filters.cpp.

03990 {
03991     // Sanity check
03992     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03993 
03994     // If we haven't changed this attribute yet, then make a new attribute object for
03995     // our own personal use...
03996     if (!CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp)
03997     {
03998         // Make the correct attribute value and install it as the current one.
03999         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new BitmapTranspFillAttribute;
04000         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
04001             return FALSE;
04002         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp = TRUE;
04003     }
04004     else
04005     {
04006         // Ensure we have the correct attribute
04007         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr->GetRuntimeClass() != 
04008             CC_RUNTIME_CLASS(BitmapTranspFillAttribute))
04009         {
04010             // Wrong type - delete it and get the right type of attribute value.
04011             delete CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
04012             CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new BitmapTranspFillAttribute;
04013             if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
04014                 return FALSE;
04015         }
04016     }
04017 
04018     // We've got an attribute - change it.
04019     BitmapTranspFillAttribute *pAttr = 
04020         (BitmapTranspFillAttribute *) CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
04021 
04022     // Copy field values.
04023     pAttr->SetTranspType(TranspType);           // waz 3606
04024     pAttr->SetStartTransp(&StartTransp);
04025     pAttr->SetEndTransp(&EndTransp);
04026 
04027     pAttr->SetStartPoint(&StartPoint);
04028     pAttr->SetEndPoint(&EndPoint);
04029     pAttr->SetEndPoint2(&EndPoint2);
04030 
04031     GetDocument()->SetCurrent();
04032 //  pAttr->AttachBitmap(pBitmap);
04033     pAttr->GetBitmapRef()->Attach(pBitmap, GetDocument());
04034 
04035     if (pAttr->GetBitmap() != pBitmap)
04036     {
04037         // It didn't use the bitmap we gave it, so we can delete it
04038         delete pBitmap;
04039     }
04040 
04041     // All worked ok.
04042     return TRUE;
04043 }

BOOL Filter::SetConicalFill DocColour StartColour,
DocColour EndColour,
DocCoord  StartPoint,
DocCoord  EndPoint
[protected]
 

Updates the current attribute for gradfill colour to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
StartColour,EndColour,StartPoint,EndPoint - see GradFillAttribute. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init; GradFillAttribute

Definition at line 3413 of file filters.cpp.

03415 {
03416     // Sanity check
03417     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03418 
03419     // Find out which fill attribute to change
03420     AttributeEntry *pEntry;
03421     if (FillAttr.pAttr == NULL)
03422         // No 'saved' fill attribute, so just update the normal one.
03423         pEntry = &CurrentAttrs[ATTR_FILLGEOMETRY];
03424     else
03425         // Update the saved fill attribute.
03426         pEntry = &FillAttr;
03427 
03428     // If we haven't changed this attribute yet, then make a new attribute object for
03429     // our own personal use...
03430     if (!pEntry->Temp)
03431     {
03432         // Make the correct attribute value and install it as the current one.
03433         pEntry->pAttr = new ConicalFillAttribute;
03434         if (pEntry->pAttr == NULL)
03435             return FALSE;
03436         pEntry->Temp = TRUE;
03437     }
03438     else
03439     {
03440         // Ensure we have the correct attribute
03441         if (!IS_A(pEntry->pAttr, ConicalFillAttribute))
03442         {
03443             // Wrong type - delete it and get the right type of attribute value.
03444             delete pEntry->pAttr;
03445             pEntry->pAttr = new ConicalFillAttribute;
03446             if (pEntry->pAttr == NULL)
03447                 return FALSE;
03448         }
03449     }
03450 
03451     // We've got an attribute - change it.
03452     ConicalFillAttribute *pAttr = (ConicalFillAttribute *) pEntry->pAttr;
03453 
03454     // Copy field values.
03455     pAttr->SetStartColour(&StartColour);
03456     pAttr->SetEndColour(&EndColour);
03457     pAttr->SetStartPoint(&StartPoint);
03458     pAttr->SetEndPoint(&EndPoint);
03459 
03460     // All worked ok.
03461     return TRUE;
03462 }

BOOL Filter::SetConicalTranspFill UINT32  TranspType,
UINT32  StartTransp,
UINT32  EndTransp,
DocCoord  StartPoint,
DocCoord  EndPoint
[protected]
 

Updates the current attribute for gradfill colour to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
TranspType - the type of transparency (1-3) [INPUTS] StartTransp - the 8 bit start transparency value (0-255) EndTransp - the 8 bit end transparency value (0-255) StartPoint, EndPoint - the points defining the conical fill.
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init; GradFillAttribute

Definition at line 3921 of file filters.cpp.

03923 {
03924     // Sanity check
03925     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03926 
03927     // If we haven't changed this attribute yet, then make a new attribute object for
03928     // our own personal use...
03929     if (!CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp)
03930     {
03931         // Make the correct attribute value and install it as the current one.
03932         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new ConicalTranspFillAttribute;
03933         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
03934             return FALSE;
03935         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp = TRUE;
03936     }
03937     else
03938     {
03939         // Ensure we have the correct attribute
03940         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr->GetRuntimeClass() != 
03941             CC_RUNTIME_CLASS(ConicalTranspFillAttribute))
03942         {
03943             // Wrong type - delete it and get the right type of attribute value.
03944             delete CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
03945             CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new ConicalTranspFillAttribute;
03946             if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
03947                 return FALSE;
03948         }
03949     }
03950 
03951     // We've got an attribute - change it.
03952     ConicalTranspFillAttribute *pAttr = 
03953         (ConicalTranspFillAttribute *) CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
03954 
03955     // Copy field values.
03956     pAttr->SetTranspType(TranspType);           // waz 3538
03957     pAttr->SetStartTransp(&StartTransp);
03958     pAttr->SetEndTransp(&EndTransp);
03959     pAttr->SetStartPoint(&StartPoint);
03960     pAttr->SetEndPoint(&EndPoint);
03961 
03962     // All worked ok.
03963     return TRUE;
03964 }

BOOL Filter::SetDashPattern DashRec Dash  )  [protected]
 

Updates the current attribute for dash pattern to reflect the value passed in.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/04/95
Parameters:
Dash - the Dash Pattern to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 2818 of file filters.cpp.

02819 {
02820     // Sanity check
02821     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
02822 
02823     // If we haven't changed this attribute yet, then make a new attribute object for
02824     // our own personal use...
02825     if (!CurrentAttrs[ATTR_DASHPATTERN].Temp)
02826     {
02827         // Make the correct attribute value and install it as the current one.
02828         CurrentAttrs[ATTR_DASHPATTERN].pAttr = new DashPatternAttribute;
02829         if (CurrentAttrs[ATTR_DASHPATTERN].pAttr == NULL)
02830             return FALSE;
02831         CurrentAttrs[ATTR_DASHPATTERN].Temp = TRUE;
02832     }
02833 
02834     // We have an attribute - just change it.
02835     DashPatternAttribute *pAttr = 
02836         (DashPatternAttribute *) CurrentAttrs[ATTR_DASHPATTERN].pAttr;
02837 
02838     // Bodge 
02839     // When we save Native files we at present save out a dash pattern ID and then
02840     // save out the full dash pattern definition! This is ok apart from wasting space.
02841     // The problem happens when we load the information back in, we load the id and apply
02842     // the relevent dash pattern and then load the definition and apply it, zapping the
02843     // id.
02844     // If we are a native filter then assume that the id has already been set up
02845     // Now done in CheckIfDefaultPattern below.
02846     // But have to disable both checks as if we set the id then we would have an id on 
02847     // a scaled version of the pattern. This would also only fix files which have been
02848     // save once, as saving again will have completely lost all trace of the id! 
02849     /* if (this->IS_KIND_OF(CamelotNativeEPSFilter))
02850     {
02851         // Note the current id already put there by the native filter
02852         INT32 DashId = pAttr->DashPattern.GetDashID();
02853         // Copy the new dash pattern over
02854         pAttr->DashPattern = Dash;
02855         // Copy the original ID across but only if it has been set
02856         // As it will default to zero then we copy it across if we have changed it!
02857         if (DashId != 0)
02858             pAttr->DashPattern.DashID = DashId; 
02859     }
02860     else */
02861 
02862     pAttr->DashPattern = Dash;
02863     
02864     // make sure the dash pattern is OK
02865     pAttr->DashPattern.CheckAndFix();
02866 
02867     // Reset the ID if it is one of our default patterns
02868     // Cannot do this check as when a line is first saved the definition is scaled
02869     // for some strange and bizarre reason, possible to do with the fact that a general
02870     // EPS saving routine is being used.
02871     //pAttr->DashPattern.CheckIfDefaultPattern();
02872 
02873     // All worked ok.
02874     return TRUE;
02875 }

BOOL Filter::SetEndArrow ArrowRec Arrow  )  [protected]
 

Updates the current attribute for End Arrow to reflect the value passed in.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/04/95
Parameters:
Arrow - the Arrow to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 2935 of file filters.cpp.

02936 {
02937     // Sanity check
02938     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
02939 
02940     // If we haven't changed this attribute yet, then make a new attribute object for
02941     // our own personal use...
02942     if (!CurrentAttrs[ATTR_ENDARROW].Temp)
02943     {
02944         // Make the correct attribute value and install it as the current one.
02945         CurrentAttrs[ATTR_ENDARROW].pAttr = new EndArrowAttribute;
02946         if (CurrentAttrs[ATTR_ENDARROW].pAttr == NULL)
02947             return FALSE;
02948         CurrentAttrs[ATTR_ENDARROW].Temp = TRUE;
02949     }
02950 
02951     // We have an attribute - just change it.
02952     EndArrowAttribute *pAttr = 
02953         (EndArrowAttribute *) CurrentAttrs[ATTR_ENDARROW].pAttr;
02954 
02955     pAttr->EndArrow = Arrow;
02956 
02957     // All worked ok.
02958     return TRUE;
02959 }

BOOL Filter::SetFadeFillEffect  )  [protected]
 

Definition at line 4131 of file filters.cpp.

04132 {
04133     // Sanity check
04134     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
04135 
04136     // If we haven't changed this attribute yet, then make a new attribute object for
04137     // our own personal use...
04138     if (!CurrentAttrs[ATTR_FILLEFFECT].Temp)
04139     {
04140         // Make the correct attribute value and install it as the current one.
04141         CurrentAttrs[ATTR_FILLEFFECT].pAttr = new FillEffectFadeAttribute;
04142         if (CurrentAttrs[ATTR_FILLEFFECT].pAttr == NULL)
04143             return FALSE;
04144         CurrentAttrs[ATTR_FILLEFFECT].Temp = TRUE;
04145     }
04146     else
04147     {
04148         // Ensure we have the correct attribute
04149         if (!IS_A(CurrentAttrs[ATTR_FILLEFFECT].pAttr, FillEffectFadeAttribute))
04150         {
04151             // Wrong type - delete it and get the right type of attribute value.
04152             delete CurrentAttrs[ATTR_FILLEFFECT].pAttr;
04153             CurrentAttrs[ATTR_FILLEFFECT].pAttr = new FillEffectFadeAttribute;
04154             if (CurrentAttrs[ATTR_FILLEFFECT].pAttr == NULL)
04155                 return FALSE;
04156         }
04157     }
04158 
04159     // All worked ok.
04160     return TRUE;
04161 }

BOOL Filter::SetFillColour DocColour Col  )  [protected]
 

Updates the current attribute for fill colour to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
Col - the new fill colour to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 3093 of file filters.cpp.

03094 {
03095     // Sanity check
03096     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03097 
03098     // Find out which fill attribute to change
03099     AttributeEntry *pEntry;
03100     if (FillAttr.pAttr == NULL)
03101         // No 'saved' fill attribute, so just update the normal one.
03102         pEntry = &CurrentAttrs[ATTR_FILLGEOMETRY];
03103     else
03104         // Update the saved fill attribute.
03105         pEntry = &FillAttr;
03106 
03107     // If we haven't changed this attribute yet, then make a new attribute object for
03108     // our own personal use...
03109     if (!pEntry->Temp)
03110     {
03111         // Make the correct attribute value and install it as the current one.
03112         pEntry->pAttr = new FlatFillAttribute(Col);
03113         if (pEntry->pAttr == NULL)
03114             return FALSE;
03115         pEntry->Temp = TRUE;
03116     }
03117     else
03118     {
03119         // Ensure we have the correct attribute
03120         if (!IS_A(pEntry->pAttr, FlatFillAttribute))
03121         {
03122             // Wrong type - delete it and get the right type of attribute value.
03123             delete pEntry->pAttr;
03124             pEntry->pAttr = new FlatFillAttribute;
03125             if (pEntry->pAttr == NULL)
03126                 return FALSE;
03127         }
03128     }
03129 
03130     // We've got an attribute - change it.
03131     FlatFillAttribute *pAttr = (FlatFillAttribute *) pEntry->pAttr;
03132 
03133     pAttr->SetStartColour(&Col);
03134 
03135     // All worked ok.
03136     return TRUE;
03137 }

BOOL Filter::SetFlatTranspFill UINT32  TranspType,
UINT32  Transp
[protected]
 

Set the current transparency fill for this import operation to be a flat transparency value.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/10/94
Parameters:
TranspType - the type of transparency (1-3) [INPUTS] Transp - the 8 bit transparency value (0-255)
Returns:
TRUE if the fill attribute is set ok; FALSE if not (e.g. out of memory)

Errors: Out of memory

See also:
Filter; Filter::Init; TranspFillAttribute

Definition at line 3682 of file filters.cpp.

03683 {
03684     // Sanity check
03685     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03686 
03687     // If we haven't changed this attribute yet, then make a new attribute object for
03688     // our own personal use...
03689     if (!CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp)
03690     {
03691         // Make the correct attribute value and install it as the current one.
03692         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new FlatTranspFillAttribute;
03693         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
03694             return FALSE;
03695         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp = TRUE;
03696     }
03697     else
03698     {
03699         // Ensure we have the correct attribute
03700         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr->GetRuntimeClass() != 
03701             CC_RUNTIME_CLASS(FlatTranspFillAttribute))
03702         {
03703             // Wrong type - delete it and get the right type of attribute value.
03704             delete CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
03705             CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new FlatTranspFillAttribute;
03706             if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
03707                 return FALSE;
03708         }
03709     }
03710 
03711     // We've got an attribute - change it.
03712     FlatTranspFillAttribute *pAttr = 
03713         (FlatTranspFillAttribute *) CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
03714 
03715     // Copy field values.
03716     pAttr->SetTranspType(TranspType);
03717     pAttr->SetStartTransp(&Transp);
03718 
03719     // All worked ok.
03720     return TRUE;
03721 }

BOOL Filter::SetFractalFill DocColour StartColour,
DocColour EndColour,
DocCoord  StartPoint,
DocCoord  EndPoint1,
DocCoord  EndPoint2,
INT32  Seed,
double  Graininess,
double  Gravity,
double  Squash,
UINT32  DPI,
BOOL  Tileable
[protected]
 

Updates the current attribute for colour fill geometry to be a fractal fill using the values passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
08/11/94
Parameters:
StartColour,EndColour - the colours of the fill [INPUTS] StartPoint, EndPoint1, EndPoint2 - co-ordinates of the fill mesh Seed, Graininess, Gravity, Squash - strange fractal parameters DPI - the resolution of the fractal bitmap (dots per inch). Tileable - whether the fractal bitmap is tileable or not (ask Alex).
Returns:
TRUE if the attribute was changed ok; FALSE otherwise => ERROR1

Errors: Out of memory => ERROR1

See also:
Filter; Filter::Init; FractalFillAttribute

Definition at line 3573 of file filters.cpp.

03577 {
03578     // Sanity check
03579     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03580 
03581     // Find out which fill attribute to change
03582     AttributeEntry *pEntry;
03583     if (FillAttr.pAttr == NULL)
03584         // No 'saved' fill attribute, so just update the normal one.
03585         pEntry = &CurrentAttrs[ATTR_FILLGEOMETRY];
03586     else
03587         // Update the saved fill attribute.
03588         pEntry = &FillAttr;
03589 
03590     // If we haven't changed this attribute yet, then make a new attribute object for
03591     // our own personal use...
03592     if (!pEntry->Temp)
03593     {
03594         // Make the correct attribute value and install it as the current one.
03595         pEntry->pAttr = new FractalFillAttribute;
03596         if (pEntry->pAttr == NULL)
03597             return FALSE;
03598         pEntry->Temp = TRUE;
03599     }
03600     else
03601     {
03602         // Ensure we have the correct attribute
03603         if (!IS_A(pEntry->pAttr, FractalFillAttribute))
03604         {
03605             // Wrong type - delete it and get the right type of attribute value.
03606             delete pEntry->pAttr;
03607             pEntry->pAttr = new FractalFillAttribute;
03608             if (pEntry->pAttr == NULL)
03609                 return FALSE;
03610         }
03611     }
03612 
03613     // We've got an attribute - change it.
03614     FractalFillAttribute *pAttr = (FractalFillAttribute *) pEntry->pAttr;
03615 
03616     // Copy field values.
03617     pAttr->SetStartColour(&StartColour);
03618     pAttr->SetEndColour(&EndColour);
03619     pAttr->SetStartPoint(&StartPoint);
03620     pAttr->SetEndPoint(&EndPoint1);
03621     pAttr->SetEndPoint2(&EndPoint2);
03622     pAttr->SetSeed(Seed);
03623     pAttr->SetGraininess(Graininess);
03624     pAttr->SetGravity(Gravity);
03625     pAttr->SetSquash(Squash);
03626     pAttr->SetTileable(Tileable);
03627 
03628     // Actually create the fractal bitmap
03629     pAttr->SetFractalDPI(DPI);
03630     pAttr->RecalcFractal();
03631 
03632     // All worked ok.
03633     return TRUE;
03634 }

BOOL Filter::SetFractalTranspFill UINT32  TranspType,
DocCoord  StartPoint,
DocCoord  EndPoint1,
DocCoord  EndPoint2,
INT32  Seed,
double  Graininess,
double  Gravity,
double  Squash,
UINT32  DPI,
BOOL  Tileable,
UINT32  StartTransp = 0,
UINT32  EndTransp = 255
[protected]
 

Updates the current attribute for colour fill geometry to be a fractal fill using the values passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
08/11/94
Parameters:
TranspType - the type of transparency (1-3) [INPUTS] StartPoint, EndPoint1, EndPoint2 - co-ordinates of the fill mesh Seed, Graininess, Gravity, Squash - strange fractal parameters DPI - the resolution of the fractal bitmap (dots per inch). Tileable - whether the fractal bitmap is tileable or not (ask Alex).
Returns:
TRUE if the attribute was changed ok; FALSE otherwise => ERROR1

Errors: Out of memory => ERROR1

See also:
Filter; Filter::Init; FractalFillAttribute

Definition at line 4069 of file filters.cpp.

04074 {
04075     // Sanity check
04076     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
04077 
04078     // If we haven't changed this attribute yet, then make a new attribute object for
04079     // our own personal use...
04080     if (!CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp)
04081     {
04082         // Make the correct attribute value and install it as the current one.
04083         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new FractalTranspFillAttribute;
04084         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
04085             return FALSE;
04086         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp = TRUE;
04087     }
04088     else
04089     {
04090         // Ensure we have the correct attribute
04091         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr->GetRuntimeClass() != 
04092             CC_RUNTIME_CLASS(FractalTranspFillAttribute))
04093         {
04094             // Wrong type - delete it and get the right type of attribute value.
04095             delete CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
04096             CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new FractalTranspFillAttribute;
04097             if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
04098                 return FALSE;
04099         }
04100     }
04101 
04102     // We've got an attribute - change it.
04103     FractalTranspFillAttribute *pAttr = 
04104         (FractalTranspFillAttribute *) CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
04105 
04106     // Copy field values.
04107     pAttr->SetTranspType(TranspType);           // waz 3690
04108     pAttr->SetStartTransp(&StartTransp);
04109     pAttr->SetEndTransp(&EndTransp);
04110 
04111     pAttr->SetStartPoint(&StartPoint);
04112     pAttr->SetEndPoint(&EndPoint1);
04113     pAttr->SetEndPoint2(&EndPoint2);
04114 
04115     pAttr->SetSeed(Seed);
04116     pAttr->SetGraininess(Graininess);
04117     pAttr->SetGravity(Gravity);
04118     pAttr->SetSquash(Squash);
04119     pAttr->SetTileable(Tileable);
04120 
04121     // Actually create the fractal bitmap
04122     pAttr->SetFractalDPI(DPI);
04123     pAttr->RecalcFractal();
04124 
04125     // All worked ok.
04126     return TRUE;
04127 }

BOOL Filter::SetJoinType JointType  JoinType  )  [protected]
 

Updates the current attribute for line join style to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
JoinType - the new line join style to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 2733 of file filters.cpp.

02734 {
02735     // Sanity check
02736     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
02737 
02738     // If we haven't changed this attribute yet, then make a new attribute object for
02739     // our own personal use...
02740     if (!CurrentAttrs[ATTR_JOINTYPE].Temp)
02741     {
02742         // Make the correct attribute value and install it as the current one.
02743         CurrentAttrs[ATTR_JOINTYPE].pAttr = new JoinTypeAttribute;
02744         if (CurrentAttrs[ATTR_JOINTYPE].pAttr == NULL)
02745             return FALSE;
02746         CurrentAttrs[ATTR_JOINTYPE].Temp = TRUE;
02747     }
02748 
02749     // We have an attribute - just change it.
02750     JoinTypeAttribute *pAttr = 
02751         (JoinTypeAttribute *) CurrentAttrs[ATTR_JOINTYPE].pAttr;
02752     pAttr->JoinType = JoinType;
02753 
02754     // All worked ok.
02755     return TRUE;
02756 }

BOOL Filter::SetLinearFill DocColour StartColour,
DocColour EndColour,
DocCoord  StartPoint,
DocCoord  EndPoint,
DocCoord EndPoint2 = NULL
[protected]
 

Updates the current attribute for gradfill colour to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
StartColour,EndColour,StartPoint,EndPoint - see GradFillAttribute. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init; GradFillAttribute

Definition at line 3157 of file filters.cpp.

03160 {
03161     // Sanity check
03162     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03163 
03164     // Find out which fill attribute to change
03165     AttributeEntry *pEntry;
03166     if (FillAttr.pAttr == NULL)
03167         // No 'saved' fill attribute, so just update the normal one.
03168         pEntry = &CurrentAttrs[ATTR_FILLGEOMETRY];
03169     else
03170         // Update the saved fill attribute.
03171         pEntry = &FillAttr;
03172 
03173     // If we haven't changed this attribute yet, then make a new attribute object for
03174     // our own personal use...
03175     if (!pEntry->Temp)
03176     {
03177         // Make the correct attribute value and install it as the current one.
03178         pEntry->pAttr = new LinearFillAttribute;
03179         if (pEntry->pAttr == NULL)
03180             return FALSE;
03181         pEntry->Temp = TRUE;
03182     }
03183     else
03184     {
03185         // Ensure we have the correct attribute
03186         if (!IS_A(pEntry->pAttr, LinearFillAttribute))
03187         {
03188             // Wrong type - delete it and get the right type of attribute value.
03189             delete pEntry->pAttr;
03190             pEntry->pAttr = new LinearFillAttribute;
03191             if (pEntry->pAttr == NULL)
03192                 return FALSE;
03193         }
03194     }
03195 
03196     // We've got an attribute - change it.
03197     LinearFillAttribute *pAttr = (LinearFillAttribute *) pEntry->pAttr;
03198 
03199     // Copy field values.
03200     pAttr->SetStartColour(&StartColour);
03201     pAttr->SetEndColour(&EndColour);
03202     pAttr->SetStartPoint(&StartPoint);
03203     pAttr->SetEndPoint(&EndPoint);
03204     pAttr->SetEndPoint2(EndPoint2);
03205 
03206     // All worked ok.
03207     return TRUE;
03208 }

BOOL Filter::SetLinearFillMapping INT32  Repeat  )  [protected]
 

Definition at line 4228 of file filters.cpp.

04229 {
04230     // Sanity check
04231     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
04232     ERROR3IF((Repeat < 0) || (Repeat > 3),"Bad mapping repeat in SetLinearFillMapping()");
04233 
04234     // If we haven't changed this attribute yet, then make a new attribute object for
04235     // our own personal use...
04236     if (!CurrentAttrs[ATTR_FILLMAPPING].Temp)
04237     {
04238         // Make the correct attribute value and install it as the current one.
04239         CurrentAttrs[ATTR_FILLMAPPING].pAttr = new FillMappingLinearAttribute;
04240         if (CurrentAttrs[ATTR_FILLMAPPING].pAttr == NULL)
04241             return FALSE;
04242         CurrentAttrs[ATTR_FILLMAPPING].Temp = TRUE;
04243     }
04244     else
04245     {
04246         // Ensure we have the correct attribute
04247         if (!IS_A(CurrentAttrs[ATTR_FILLMAPPING].pAttr, FillMappingLinearAttribute))
04248         {
04249             // Wrong type - delete it and get the right type of attribute value.
04250             delete CurrentAttrs[ATTR_FILLMAPPING].pAttr;
04251             CurrentAttrs[ATTR_FILLMAPPING].pAttr = new FillMappingLinearAttribute;
04252             if (CurrentAttrs[ATTR_FILLMAPPING].pAttr == NULL)
04253                 return FALSE;
04254         }
04255     }
04256 
04257     // Set the repeat state
04258     FillMappingLinearAttribute *pAttr = 
04259             (FillMappingLinearAttribute *) CurrentAttrs[ATTR_FILLMAPPING].pAttr;
04260     pAttr->Repeat = Repeat;
04261 
04262 // *******************************************************************
04263 // Added by Will 12/2/95
04264 // Bitmap and Fractal tesselation does not appear to be being saved.
04265 // This code ensures that the repeat and tesselation values matach up.
04266     
04267     FillGeometryAttribute* pCurrentFill =
04268             (FillGeometryAttribute *) CurrentAttrs[ATTR_FILLGEOMETRY].pAttr;
04269 
04270     if (pCurrentFill != NULL)
04271         pCurrentFill->SetTesselation(Repeat);
04272 
04273 // *******************************************************************
04274 
04275     // All worked ok.
04276     return TRUE;
04277 }

BOOL Filter::SetLinearTranspFill UINT32  TranspType,
UINT32  StartTransp,
UINT32  EndTransp,
DocCoord  StartPoint,
DocCoord  EndPoint,
DocCoord EndPoint2 = NULL
[protected]
 

Updates the current attribute for transparency fill to be a linear transparent fill as specified by the values passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
TranspType - the type of transparency (1-3) [INPUTS] StartTransp - the 8 bit start transparency value (0-255) EndTransp - the 8 bit end transparency value (0-255) StartPoint, EndPoint - the start and end-points of the linear fill.
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init; TranspFillAttribute

Definition at line 3744 of file filters.cpp.

03747 {
03748     // Sanity check
03749     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03750 
03751     // If we haven't changed this attribute yet, then make a new attribute object for
03752     // our own personal use...
03753     if (!CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp)
03754     {
03755         // Make the correct attribute value and install it as the current one.
03756         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new LinearTranspFillAttribute;
03757         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
03758             return FALSE;
03759         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp = TRUE;
03760     }
03761     else
03762     {
03763         // Ensure we have the correct attribute
03764         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr->GetRuntimeClass() != 
03765             CC_RUNTIME_CLASS(LinearTranspFillAttribute))
03766         {
03767             // Wrong type - delete it and get the right type of attribute value.
03768             delete CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
03769             CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new LinearTranspFillAttribute;
03770             if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
03771                 return FALSE;
03772         }
03773     }
03774 
03775     // We've got an attribute - change it.
03776     LinearTranspFillAttribute *pAttr = 
03777         (LinearTranspFillAttribute *) CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
03778 
03779     // Copy field values.
03780     pAttr->SetTranspType(TranspType);           // waz 3362
03781     pAttr->SetStartTransp(&StartTransp);
03782     pAttr->SetEndTransp(&EndTransp);
03783     pAttr->SetStartPoint(&StartPoint);
03784     pAttr->SetEndPoint(&EndPoint);
03785     pAttr->SetEndPoint2(EndPoint2);
03786 
03787     // All worked ok.
03788     return TRUE;
03789 }

BOOL Filter::SetLinearTranspFillMapping INT32  Repeat  )  [protected]
 

Definition at line 4280 of file filters.cpp.

04281 {
04282     // Sanity check
04283     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
04284     ERROR3IF((Repeat < 0) || (Repeat > 3),"Bad mapping repeat in SetLinearTranspFillMapping()");
04285 
04286     // If we haven't changed this attribute yet, then make a new attribute object for
04287     // our own personal use...
04288     if (!CurrentAttrs[ATTR_TRANSPFILLMAPPING].Temp)
04289     {
04290         // Make the correct attribute value and install it as the current one.
04291         CurrentAttrs[ATTR_TRANSPFILLMAPPING].pAttr = new TranspFillMappingLinearAttribute;
04292         if (CurrentAttrs[ATTR_TRANSPFILLMAPPING].pAttr == NULL)
04293             return FALSE;
04294         CurrentAttrs[ATTR_TRANSPFILLMAPPING].Temp = TRUE;
04295     }
04296     else
04297     {
04298         // Ensure we have the correct attribute
04299         if (!IS_A(CurrentAttrs[ATTR_TRANSPFILLMAPPING].pAttr, TranspFillMappingLinearAttribute))
04300         {
04301             // Wrong type - delete it and get the right type of attribute value.
04302             delete CurrentAttrs[ATTR_TRANSPFILLMAPPING].pAttr;
04303             CurrentAttrs[ATTR_TRANSPFILLMAPPING].pAttr = new TranspFillMappingLinearAttribute;
04304             if (CurrentAttrs[ATTR_TRANSPFILLMAPPING].pAttr == NULL)
04305                 return FALSE;
04306         }
04307     }
04308 
04309     // Set the repeat state
04310     TranspFillMappingLinearAttribute *pAttr = 
04311             (TranspFillMappingLinearAttribute *) CurrentAttrs[ATTR_TRANSPFILLMAPPING].pAttr;
04312     pAttr->Repeat = Repeat;
04313 
04314 // *******************************************************************
04315 // Added by Will 12/2/95
04316 // Bitmap and Fractal tesselation does not appear to be being saved.
04317 // This code ensures that the repeat and tesselation values matach up.
04318     
04319     TranspFillAttribute* pCurrentFill =
04320             (TranspFillAttribute *) CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
04321 
04322     if (pCurrentFill != NULL)
04323         pCurrentFill->SetTesselation(Repeat);
04324 
04325 // *******************************************************************
04326 
04327     // All worked ok.
04328     return TRUE;
04329 }

BOOL Filter::SetLineCap LineCapType  LineCap  )  [protected]
 

Updates the current attribute for line cap style to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
LineCap - the new line cap style to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 2692 of file filters.cpp.

02693 {
02694     // Sanity check
02695     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
02696 
02697     // If we haven't changed this attribute yet, then make a new attribute object for
02698     // our own personal use...
02699     if (!CurrentAttrs[ATTR_STARTCAP].Temp)
02700     {
02701         // Make the correct attribute value and install it as the current one.
02702         CurrentAttrs[ATTR_STARTCAP].pAttr = new StartCapAttribute;
02703         if (CurrentAttrs[ATTR_STARTCAP].pAttr == NULL)
02704             return FALSE;
02705         CurrentAttrs[ATTR_STARTCAP].Temp = TRUE;
02706     }
02707 
02708     // We have an attribute - just change it.
02709     StartCapAttribute *pAttr = 
02710         (StartCapAttribute *) CurrentAttrs[ATTR_STARTCAP].pAttr;
02711     pAttr->StartCap = LineCap;
02712 
02713     // All worked ok.
02714     return TRUE;
02715 }

BOOL Filter::SetLineColour DocColour Col  )  [protected]
 

Updates the current attribute for line colour to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
Col - the new line colour to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 2602 of file filters.cpp.

02603 {
02604     // Sanity check
02605     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
02606 
02607     // If we haven't changed this attribute yet, then make a new attribute object for
02608     // our own personal use...
02609     if (!CurrentAttrs[ATTR_STROKECOLOUR].Temp)
02610     {
02611         // Make the correct attribute value and install it as the current one.
02612         CurrentAttrs[ATTR_STROKECOLOUR].pAttr = new StrokeColourAttribute(Col);
02613         if (CurrentAttrs[ATTR_STROKECOLOUR].pAttr == NULL)
02614             return FALSE;
02615         CurrentAttrs[ATTR_STROKECOLOUR].Temp = TRUE;
02616     }
02617     else
02618     {
02619         // We already have an attribute - just change it.
02620         StrokeColourAttribute *pAttr = 
02621             (StrokeColourAttribute *) CurrentAttrs[ATTR_STROKECOLOUR].pAttr;
02622         pAttr->Colour = Col;
02623     }
02624 
02625     // All worked ok.
02626     return TRUE;
02627 }

BOOL Filter::SetLineTransp UINT32  TranspType,
UINT32  Transp
[protected]
 

Updates the current attribute for line transparency to reflect the value passed in.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/04/95
Parameters:
TranspType - the transparency type to use. [INPUTS] Transp - the transparency (0 to 255) of the line.
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 2775 of file filters.cpp.

02776 {
02777     // Sanity check
02778     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
02779 
02780     // If we haven't changed this attribute yet, then make a new attribute object for
02781     // our own personal use...
02782     if (!CurrentAttrs[ATTR_STROKETRANSP].Temp)
02783     {
02784         // Make the correct attribute value and install it as the current one.
02785         CurrentAttrs[ATTR_STROKETRANSP].pAttr = new StrokeTranspAttribute;
02786         if (CurrentAttrs[ATTR_STROKETRANSP].pAttr == NULL)
02787             return FALSE;
02788         CurrentAttrs[ATTR_STROKETRANSP].Temp = TRUE;
02789     }
02790 
02791     // We have an attribute - just change it.
02792     StrokeTranspAttribute *pAttr = 
02793         (StrokeTranspAttribute *) CurrentAttrs[ATTR_STROKETRANSP].pAttr;
02794 
02795     pAttr->TranspType = TranspType;
02796     pAttr->Transp = Transp;
02797 
02798     // All worked ok.
02799     return TRUE;
02800 }

BOOL Filter::SetLineWidth MILLIPOINT  Width  )  [protected]
 

Updates the current attribute for line width to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
Width - the new line width to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 2645 of file filters.cpp.

02646 {
02647     // Sanity check
02648     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
02649 
02650     // Avoid zero width lines - change them to the value specified in the user preference.
02651     if (Width == 0)
02652         Width = MinLineWidth;
02653 
02654     // If we haven't changed this attribute yet, then make a new attribute object for
02655     // our own personal use...
02656     if (!CurrentAttrs[ATTR_LINEWIDTH].Temp)
02657     {
02658         // Make the correct attribute value and install it as the current one.
02659         CurrentAttrs[ATTR_LINEWIDTH].pAttr = new LineWidthAttribute(Width);
02660         if (CurrentAttrs[ATTR_LINEWIDTH].pAttr == NULL)
02661             return FALSE;
02662         CurrentAttrs[ATTR_LINEWIDTH].Temp = TRUE;
02663     }
02664     else
02665     {
02666         // We already have an attribute - just change it.
02667         LineWidthAttribute *pAttr = 
02668             (LineWidthAttribute *) CurrentAttrs[ATTR_LINEWIDTH].pAttr;
02669         pAttr->LineWidth = Width;
02670     }
02671 
02672     // All worked ok.
02673     return TRUE;
02674 }

BOOL Filter::SetMitreLimit MILLIPOINT  MitreLimit  )  [protected]
 

Updates the current attribute for the Mitre Limit to reflect the value passed in.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/04/95
Parameters:
Arrow - the Arrow to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 2977 of file filters.cpp.

02978 {
02979     // Sanity check
02980     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
02981 
02982     // If we haven't changed this attribute yet, then make a new attribute object for
02983     // our own personal use...
02984     if (!CurrentAttrs[ATTR_MITRELIMIT].Temp)
02985     {
02986         // Make the correct attribute value and install it as the current one.
02987         CurrentAttrs[ATTR_MITRELIMIT].pAttr = new MitreLimitAttribute;
02988         if (CurrentAttrs[ATTR_MITRELIMIT].pAttr == NULL)
02989             return FALSE;
02990         CurrentAttrs[ATTR_MITRELIMIT].Temp = TRUE;
02991     }
02992 
02993     // We have an attribute - just change it.
02994     MitreLimitAttribute *pAttr = 
02995         (MitreLimitAttribute *) CurrentAttrs[ATTR_MITRELIMIT].pAttr;
02996 
02997     pAttr->MitreLimit = MitreLimit;
02998 
02999     // All worked ok.
03000     return TRUE;
03001 }

BOOL Filter::SetNoTranspFill  )  [protected]
 

Set the current transparency fill for this import operation to be none, i.e. there is no transparency.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/10/94
Returns:
TRUE if the fill attribute is set ok; FALSE if not (e.g. out of memory)

Errors: Out of memory

See also:
Filter; Filter::Init; Filter::SetFlatTranspFill; TranspFillAttribute Note: This also (via SetFlatTranspFill) set the new painting mode attribute as well

Definition at line 3658 of file filters.cpp.

03659 {
03660     // At present, we use a flat transparent fill with 0% transparency and T type 1 for
03661     // 'no transparency'.
03662     return SetFlatTranspFill(1, 0);
03663 }

UINT32 Filter::SetNumNodes UINT32  NewNumNodes  ) 
 

Allows setting of the stored numbers of nodes which is currently set up to be used for a progress bar.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/5/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The old number of nodes value

Definition at line 2436 of file filters.cpp.

02437 {
02438     UINT32 OldNumNodes = NumNodes;
02439     
02440     NumNodes = NewNumNodes;
02441     
02442     return OldNumNodes;
02443 }

BOOL Filter::SetPathFilled BOOL  Filled  )  [protected]
 

Indicate whether paths should be filled or not. This is independent of the current fill attribute, so, for example, if this function is called to set the paths to be unfilled, and then called again to set them to be filled, then afterwards all paths filled will be filled with whatever fill attribute was last set.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/01/95
Parameters:
Filled - whether or not paths should be filled. [INPUTS]
Returns:
TRUE if ok; FALSE otherwise (e.g. out of memory)

Errors: Out of memory => ERROR1

See also:
Filter::SetFillColour

Definition at line 3024 of file filters.cpp.

03025 {
03026     if(Filled == PathFilled)
03027         return TRUE;
03028     
03029     if (Filled)
03030     {
03031         // See if we need to reinstate the fill attribute
03032         if (FillAttr.pAttr != NULL)
03033         {
03034             // Yes we do...
03035             if (CurrentAttrs[ATTR_FILLGEOMETRY].Temp)
03036             {
03037                 // Get rid of the current one (if it is a temporary attribute)
03038                 delete CurrentAttrs[ATTR_FILLGEOMETRY].pAttr;
03039             }
03040 
03041             // Install the new one, and vape the pointer so we don't do this again.
03042             CurrentAttrs[ATTR_FILLGEOMETRY] = FillAttr;
03043             FillAttr.pAttr = NULL;
03044         }
03045     }
03046     else
03047     {
03048         // Lose the current saved FillAttr if we need to.
03049         if ((FillAttr.pAttr != NULL) && (FillAttr.Temp))
03050         {
03051             delete FillAttr.pAttr;
03052         }
03053 
03054         // Disabling the fill attribute - remember the current one.
03055         FillAttr = CurrentAttrs[ATTR_FILLGEOMETRY];
03056 
03057         // Install a new flat colour fill...
03058         CurrentAttrs[ATTR_FILLGEOMETRY].pAttr = new FlatFillAttribute;
03059         if (CurrentAttrs[ATTR_FILLGEOMETRY].pAttr == NULL)
03060             return FALSE;
03061         CurrentAttrs[ATTR_FILLGEOMETRY].Temp = TRUE;
03062 
03063         // .. and make it a transparent fill
03064         DocColour TransCol(COLOUR_TRANS);
03065         FillGeometryAttribute *pAttr = (FillGeometryAttribute *) 
03066                                                     CurrentAttrs[ATTR_FILLGEOMETRY].pAttr;
03067         pAttr->SetStartColour(&TransCol);
03068     }
03069 
03070     PathFilled = Filled;
03071 
03072     // Must be ok if we got here
03073     return TRUE;
03074 }

BOOL Filter::SetRadialFill DocColour StartColour,
DocColour EndColour,
DocCoord  StartPoint,
DocCoord  EndPoint1,
DocCoord  EndPoint2
[protected]
 

Updates the current attribute for gradfill colour to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
StartColour,EndColour - colours to fade between. [INPUTS] StartPoint, EndPoint1, EndPoint2 - the points defining the elliptical radial fill.
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init; GradFillAttribute

Definition at line 3265 of file filters.cpp.

03268 {
03269     // Sanity check
03270     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03271 
03272     // Find out which fill attribute to change
03273     AttributeEntry *pEntry;
03274     if (FillAttr.pAttr == NULL)
03275         // No 'saved' fill attribute, so just update the normal one.
03276         pEntry = &CurrentAttrs[ATTR_FILLGEOMETRY];
03277     else
03278         // Update the saved fill attribute.
03279         pEntry = &FillAttr;
03280 
03281     // If we haven't changed this attribute yet, then make a new attribute object for
03282     // our own personal use...
03283     if (!pEntry->Temp)
03284     {
03285         // Make the correct attribute value and install it as the current one.
03286         pEntry->pAttr = new RadialFillAttribute;
03287         if (pEntry->pAttr == NULL)
03288             return FALSE;
03289         pEntry->Temp = TRUE;
03290     }
03291     else
03292     {
03293         // Ensure we have the correct attribute
03294         if (!IS_A(pEntry->pAttr, RadialFillAttribute))
03295         {
03296             // Wrong type - delete it and get the right type of attribute value.
03297             delete pEntry->pAttr;
03298             pEntry->pAttr = new RadialFillAttribute;
03299             if (pEntry->pAttr == NULL)
03300                 return FALSE;
03301         }
03302     }
03303 
03304     // We've got an attribute - change it.
03305     RadialFillAttribute *pAttr = (RadialFillAttribute *) pEntry->pAttr;
03306 
03307     // Copy field values.
03308     pAttr->SetStartColour(&StartColour);
03309     pAttr->SetEndColour(&EndColour);
03310     pAttr->SetStartPoint(&StartPoint);
03311     pAttr->SetEndPoint(&EndPoint1);
03312     pAttr->SetEndPoint2(&EndPoint2);
03313 
03314     // Make sure it's elliptical
03315     pAttr->MakeElliptical();
03316 
03317     // All worked ok.
03318     return TRUE;
03319 }

BOOL Filter::SetRadialFill DocColour StartColour,
DocColour EndColour,
DocCoord  StartPoint,
DocCoord  EndPoint
[protected]
 

Updates the current attribute for gradfill colour to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
StartColour,EndColour - colours to fade between. [INPUTS] StartPoint, EndPoint1 - the points defining the radial fill.
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init; GradFillAttribute

Definition at line 3228 of file filters.cpp.

03230 {
03231     // Call the more general function...
03232     BOOL Success = SetRadialFill(StartColour, EndColour, StartPoint, EndPoint, EndPoint);
03233 
03234     // Set the new attribute to be a circular one, if it worked
03235     if (Success)
03236     {
03237         RadialFillAttribute *pAttr = 
03238             (RadialFillAttribute *) CurrentAttrs[ATTR_FILLGEOMETRY].pAttr;
03239         pAttr->MakeCircular();
03240     }
03241 
03242     return Success;
03243 }

BOOL Filter::SetRadialTranspFill UINT32  TranspType,
UINT32  StartTransp,
UINT32  EndTransp,
DocCoord  StartPoint,
DocCoord  EndPoint1,
DocCoord  EndPoint2
[protected]
 

Updates the current attribute for transparency fill to be an elliptical transparent fill as specified by the values passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
TranspType - the type of transparency (1-3) [INPUTS] StartTransp - the 8 bit start transparency value (0-255) EndTransp - the 8 bit end transparency value (0-255) StartPoint, EndPoint, EndPoint2 - the points defining the elliptical fill.
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init; GradFillAttribute

Definition at line 3851 of file filters.cpp.

03854 {
03855     // Sanity check
03856     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03857 
03858     // If we haven't changed this attribute yet, then make a new attribute object for
03859     // our own personal use...
03860     if (!CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp)
03861     {
03862         // Make the correct attribute value and install it as the current one.
03863         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new RadialTranspFillAttribute;
03864         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
03865             return FALSE;
03866         CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].Temp = TRUE;
03867     }
03868     else
03869     {
03870         // Ensure we have the correct attribute
03871         if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr->GetRuntimeClass() != 
03872             CC_RUNTIME_CLASS(RadialTranspFillAttribute))
03873         {
03874             // Wrong type - delete it and get the right type of attribute value.
03875             delete CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
03876             CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr = new RadialTranspFillAttribute;
03877             if (CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr == NULL)
03878                 return FALSE;
03879         }
03880     }
03881 
03882     // We've got an attribute - change it.
03883     RadialTranspFillAttribute *pAttr = 
03884         (RadialTranspFillAttribute *) CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
03885 
03886     // Copy field values.
03887     pAttr->SetTranspType(TranspType);           // waz 3469
03888     pAttr->SetStartTransp(&StartTransp);
03889     pAttr->SetEndTransp(&EndTransp);
03890     pAttr->SetStartPoint(&StartPoint);
03891     pAttr->SetEndPoint(&EndPoint1);
03892     pAttr->SetEndPoint2(&EndPoint2);
03893 
03894     // Make sure it's elliptical
03895     pAttr->MakeElliptical();
03896 
03897     // All worked ok.
03898     return TRUE;
03899 }

BOOL Filter::SetRadialTranspFill UINT32  TranspType,
UINT32  StartTransp,
UINT32  EndTransp,
DocCoord  StartPoint,
DocCoord  EndPoint
[protected]
 

Updates the current attribute for transparency fill to be a circular transparent fill as specified by the values passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
TranspType - the type of transparency (1-3) [INPUTS] StartTransp - the 8 bit start transparency value (0-255) EndTransp - the 8 bit end transparency value (0-255) StartPoint - the centre of the radial fill. EndPoint - a point on the edge of the circle defining the radial fill.
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init; GradFillAttribute

Definition at line 3812 of file filters.cpp.

03814 {
03815     // Call the more general function...
03816     BOOL Success = SetRadialTranspFill(TranspType, StartTransp, EndTransp, 
03817                                        StartPoint, EndPoint, EndPoint);
03818 
03819     // Set the new attribute to be a circular one, if it worked
03820     if (Success)
03821     {
03822         RadialTranspFillAttribute *pAttr = 
03823             (RadialTranspFillAttribute *) CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr;
03824         pAttr->MakeCircular();
03825     }
03826 
03827     return Success;
03828 }

BOOL Filter::SetRainbowFillEffect  )  [protected]
 

Definition at line 4163 of file filters.cpp.

04164 {
04165     // Sanity check
04166     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
04167 
04168     // If we haven't changed this attribute yet, then make a new attribute object for
04169     // our own personal use...
04170     if (!CurrentAttrs[ATTR_FILLEFFECT].Temp)
04171     {
04172         // Make the correct attribute value and install it as the current one.
04173         CurrentAttrs[ATTR_FILLEFFECT].pAttr = new FillEffectRainbowAttribute;
04174         if (CurrentAttrs[ATTR_FILLEFFECT].pAttr == NULL)
04175             return FALSE;
04176         CurrentAttrs[ATTR_FILLEFFECT].Temp = TRUE;
04177     }
04178     else
04179     {
04180         // Ensure we have the correct attribute
04181         if (!IS_A(CurrentAttrs[ATTR_FILLEFFECT].pAttr, FillEffectRainbowAttribute))
04182         {
04183             // Wrong type - delete it and get the right type of attribute value.
04184             delete CurrentAttrs[ATTR_FILLEFFECT].pAttr;
04185             CurrentAttrs[ATTR_FILLEFFECT].pAttr = new FillEffectRainbowAttribute;
04186             if (CurrentAttrs[ATTR_FILLEFFECT].pAttr == NULL)
04187                 return FALSE;
04188         }
04189     }
04190 
04191     // All worked ok.
04192     return TRUE;
04193 }

void Filter::SetSaveAttributes BOOL  DoSave  )  [virtual]
 

Informs the filter whether or not it should record the attribute settings along with the file data. This allows templates to have default colours other than the standard Camelot values, whilst not encumbering save files with this extra information.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/3/00
Parameters:
DoSave - Should the attributes be saved along with the file data? [INPUTS]
Returns:
-

Definition at line 4544 of file filters.cpp.

04545 {
04546     SaveAttributes = DoSave;
04547 }

void Filter::SetSoleLayer Layer pLayer  )  [inline]
 

Definition at line 561 of file filters.h.

00561 {m_pSoleLayer = pLayer;}

BOOL Filter::SetSquareFill DocColour StartColour,
DocColour EndColour,
DocCoord  StartPoint,
DocCoord  EndPoint1,
DocCoord  EndPoint2
[protected]
 

Updates the current attribute for gradfill colour to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/08/94
Parameters:
StartColour,EndColour - colours to fade between. [INPUTS] StartPoint, EndPoint1, EndPoint2 - the points defining the elliptical radial fill.
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.
FN copied and modified by Ben.
Returns:
Errors: Out of memory.
See also:
Filter; Filter::Init; GradFillAttribute

Definition at line 3343 of file filters.cpp.

03346 {
03347     // Sanity check
03348     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
03349 
03350     // Find out which fill attribute to change
03351     AttributeEntry *pEntry;
03352     if (FillAttr.pAttr == NULL)
03353         // No 'saved' fill attribute, so just update the normal one.
03354         pEntry = &CurrentAttrs[ATTR_FILLGEOMETRY];
03355     else
03356         // Update the saved fill attribute.
03357         pEntry = &FillAttr;
03358 
03359     // If we haven't changed this attribute yet, then make a new attribute object for
03360     // our own personal use...
03361     if (!pEntry->Temp)
03362     {
03363         // Make the correct attribute value and install it as the current one.
03364         pEntry->pAttr = new SquareFillAttribute;
03365         if (pEntry->pAttr == NULL)
03366             return FALSE;
03367         pEntry->Temp = TRUE;
03368     }
03369     else
03370     {
03371         // Ensure we have the correct attribute
03372         if (!IS_A(pEntry->pAttr, SquareFillAttribute))
03373         {
03374             // Wrong type - delete it and get the right type of attribute value.
03375             delete pEntry->pAttr;
03376             pEntry->pAttr = new SquareFillAttribute;
03377             if (pEntry->pAttr == NULL)
03378                 return FALSE;
03379         }
03380     }
03381 
03382     // We've got an attribute - change it.
03383     SquareFillAttribute *pAttr = (SquareFillAttribute *) pEntry->pAttr;
03384 
03385     // Copy field values.
03386     pAttr->SetStartColour(&StartColour);
03387     pAttr->SetEndColour(&EndColour);
03388     pAttr->SetStartPoint(&StartPoint);
03389     pAttr->SetEndPoint(&EndPoint1);
03390     pAttr->SetEndPoint2(&EndPoint2);
03391 
03392     // All worked ok.
03393     return TRUE;
03394 }

BOOL Filter::SetStartArrow ArrowRec Arrow  )  [protected]
 

Updates the current attribute for Start Arrow to reflect the value passed in.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/04/95
Parameters:
Arrow - the Arrow to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 2893 of file filters.cpp.

02894 {
02895     // Sanity check
02896     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
02897 
02898     // If we haven't changed this attribute yet, then make a new attribute object for
02899     // our own personal use...
02900     if (!CurrentAttrs[ATTR_STARTARROW].Temp)
02901     {
02902         // Make the correct attribute value and install it as the current one.
02903         CurrentAttrs[ATTR_STARTARROW].pAttr = new StartArrowAttribute;
02904         if (CurrentAttrs[ATTR_STARTARROW].pAttr == NULL)
02905             return FALSE;
02906         CurrentAttrs[ATTR_STARTARROW].Temp = TRUE;
02907     }
02908 
02909     // We have an attribute - just change it.
02910     StartArrowAttribute *pAttr = 
02911         (StartArrowAttribute *) CurrentAttrs[ATTR_STARTARROW].pAttr;
02912 
02913     pAttr->StartArrow = Arrow;
02914 
02915     // All worked ok.
02916     return TRUE;
02917 }

BOOL Filter::SetTextAspectRatio FIXED16  AspectRatio  )  [protected]
 

Updates the current attribute for AspectRatio to reflect the value passed in.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
AspectRatio - the new Aspect Ratio to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 6232 of file filters.cpp.

06233 {
06234     // Sanity check
06235     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06236 
06237     // If we haven't changed this attribute yet, then make a new attribute object for
06238     // our own personal use...
06239     if (!CurrentAttrs[ATTR_TXTASPECTRATIO].Temp)
06240     {
06241         // Make the correct attribute value and install it as the current one.
06242         CurrentAttrs[ATTR_TXTASPECTRATIO].pAttr = new TxtAspectRatioAttribute(AspectRatio);
06243         if (CurrentAttrs[ATTR_TXTASPECTRATIO].pAttr == NULL)
06244             return FALSE;
06245         CurrentAttrs[ATTR_TXTASPECTRATIO].Temp = TRUE;
06246     }
06247     else
06248     {
06249         // We already have an attribute - just change it.
06250         TxtAspectRatioAttribute *pAttr = (TxtAspectRatioAttribute*) CurrentAttrs[ATTR_TXTASPECTRATIO].pAttr;
06251         pAttr->AspectRatio = AspectRatio;
06252     }
06253 
06254     // All worked ok.
06255     return TRUE;
06256 }

BOOL Filter::SetTextBaseLine MILLIPOINT  BaseShift  )  [protected]
 

Updates the current attribute for BaseLine shift to reflect the value passed in.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/04/94
Parameters:
BaseShift - the new baseline shift to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 6457 of file filters.cpp.

06458 {
06459     // Sanity check
06460     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06461 
06462     // If we haven't changed this attribute yet, then make a new attribute object for
06463     // our own personal use...
06464     if (!CurrentAttrs[ATTR_TXTBASELINE].Temp)
06465     {
06466         // Make the correct attribute value and install it as the current one.
06467         CurrentAttrs[ATTR_TXTBASELINE].pAttr = new TxtBaseLineAttribute(BaseShift);
06468         if (CurrentAttrs[ATTR_TXTBASELINE].pAttr == NULL)
06469             return FALSE;
06470         CurrentAttrs[ATTR_TXTBASELINE].Temp = TRUE;
06471     }
06472     else
06473     {
06474         // We already have an attribute - just change it.
06475         TxtBaseLineAttribute *pAttr = (TxtBaseLineAttribute*) CurrentAttrs[ATTR_TXTBASELINE].pAttr;
06476         pAttr->Value = BaseShift;
06477     }
06478 
06479     // All worked ok.
06480     return TRUE;
06481 }

BOOL Filter::SetTextBold BOOL  Bold  )  [protected]
 

Updates the current attribute for Bold to reflect the value passed in.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
Bold - the new Bold state to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 6103 of file filters.cpp.

06104 {
06105     // Sanity check
06106     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06107 
06108     // If we haven't changed this attribute yet, then make a new attribute object for
06109     // our own personal use...
06110     if (!CurrentAttrs[ATTR_TXTBOLD].Temp)
06111     {
06112         // Make the correct attribute value and install it as the current one.
06113         CurrentAttrs[ATTR_TXTBOLD].pAttr = new TxtBoldAttribute(Bold);
06114         if (CurrentAttrs[ATTR_TXTBOLD].pAttr == NULL)
06115             return FALSE;
06116         CurrentAttrs[ATTR_TXTBOLD].Temp = TRUE;
06117     }
06118     else
06119     {
06120         // We already have an attribute - just change it.
06121         TxtBoldAttribute *pAttr = (TxtBoldAttribute*) CurrentAttrs[ATTR_TXTBOLD].pAttr;
06122         pAttr->BoldOn = Bold;
06123     }
06124 
06125     // All worked ok.
06126     return TRUE;
06127 }

BOOL Filter::SetTextBoldFont BOOL  Bold  )  [protected]
 

This function simply sets the bold style flag in the current font typeface attribute (to be applied to the next created character).

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/06/95
Returns:
TRUE if the font and style has been set FALSE if an error occured (out current typeface)

Definition at line 6586 of file filters.cpp.

06587 {
06588     // Sanity check
06589     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06590 
06591     // If there is no current typeface then we cannot set its style
06592     if (!CurrentAttrs[ATTR_TXTFONTTYPEFACE].Temp)
06593         return FALSE;
06594 
06595     // There is an attribute - just change it.
06596     TxtFontTypefaceAttribute *pAttr = (TxtFontTypefaceAttribute*) CurrentAttrs[ATTR_TXTFONTTYPEFACE].pAttr;
06597     pAttr->IsBold = Bold;
06598 
06599     return TRUE;
06600 }

BOOL Filter::SetTextFont String_64 EncodedName,
INT32  MillFSize
[protected]
 

Set the font specified in the encoded font name. The font which actually gets set in the attribute stack is one found by GetCompatibleFont(), a super new fontmanager call.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/05/95
Returns:
TRUE if the font has been set correctly FALSE if an error occured specifying the font

Definition at line 5885 of file filters.cpp.

05886 {
05887     String_64 CompFont;
05888     INT32 Style;
05889     BOOL Bold,Italic;
05890 
05891     // Find a nice compatible font we can use
05892     FONTMANAGER->GetCompatibleFont(*EncodedName, CompFont, Style);
05893     // get the style bits
05894     Bold=((Style & 1) != 0);
05895     Italic=((Style & 2) != 0);
05896 
05897     return SetTextFontStyle(&CompFont, MillFSize, Bold, Italic);
05898 }

BOOL Filter::SetTextFontStyle String_64 FName,
INT32  MillFSize,
BOOL  Bold,
BOOL  Italic
[protected]
 

This function creates attributes for the typeface, the pointsize, bold and italic all at once.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/05/95
Returns:
TRUE if the font and styles have been set FALSE if an error occured (out of memory)

Definition at line 5970 of file filters.cpp.

05971 {
05972     if ((FONTMANAGER->CacheNamedFont(FName) == ILLEGALFHANDLE))
05973         return FALSE;
05974 
05975     if (!SetTextTypeFace(FName))
05976         return FALSE;
05977 
05978     if (!SetTextSize(MillFSize))
05979         return FALSE;
05980 
05981     // Build any style definitions we need
05982     if (!SetTextBold(Bold))
05983         return FALSE;
05984 
05985     if (!SetTextItalic(Italic))
05986         return FALSE;
05987 
05988     return TRUE;
05989 }

BOOL Filter::SetTextItalic BOOL  Italic  )  [protected]
 

Updates the current attribute for Italic to reflect the value passed in.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
Italic- the new Italic state to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 6146 of file filters.cpp.

06147 {
06148     // Sanity check
06149     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06150 
06151     // If we haven't changed this attribute yet, then make a new attribute object for
06152     // our own personal use...
06153     if (!CurrentAttrs[ATTR_TXTITALIC].Temp)
06154     {
06155         // Make the correct attribute value and install it as the current one.
06156         CurrentAttrs[ATTR_TXTITALIC].pAttr = new TxtItalicAttribute(Italic);
06157         if (CurrentAttrs[ATTR_TXTITALIC].pAttr == NULL)
06158             return FALSE;
06159         CurrentAttrs[ATTR_TXTITALIC].Temp = TRUE;
06160     }
06161     else
06162     {
06163         // We already have an attribute - just change it.
06164         TxtItalicAttribute *pAttr = (TxtItalicAttribute*) CurrentAttrs[ATTR_TXTITALIC].pAttr;
06165         pAttr->ItalicOn = Italic;
06166     }
06167 
06168     // All worked ok.
06169     return TRUE;
06170 }

BOOL Filter::SetTextItalicFont BOOL  Italic  )  [protected]
 

This function simply sets the italic style flag in the current font typeface attribute (to be applied to the next created character).

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/06/95
Returns:
TRUE if the font and style has been set FALSE if an error occured (no current typeface)

Definition at line 6616 of file filters.cpp.

06617 {
06618     // Sanity check
06619     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06620 
06621     // If there is no current typeface then we cannot set its style
06622     if (!CurrentAttrs[ATTR_TXTFONTTYPEFACE].Temp)
06623         return FALSE;
06624 
06625     // There is an attribute - just change it.
06626     TxtFontTypefaceAttribute *pAttr = (TxtFontTypefaceAttribute*) CurrentAttrs[ATTR_TXTFONTTYPEFACE].pAttr;
06627     pAttr->IsItalic = Italic;
06628 
06629     return TRUE;
06630 }

BOOL Filter::SetTextJustification Justification  Justify  )  [protected]
 

Updates the current attribute for TextSize to reflect the value passed in.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
Size - the new FontSize to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 6318 of file filters.cpp.

06319 {
06320     // Sanity check
06321     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06322 
06323     // If we haven't changed this attribute yet, then make a new attribute object for
06324     // our own personal use...
06325     if (!CurrentAttrs[ATTR_TXTJUSTIFICATION].Temp)
06326     {
06327         // Make the correct attribute value and install it as the current one.
06328         CurrentAttrs[ATTR_TXTJUSTIFICATION].pAttr = new TxtJustificationAttribute(Justify);
06329         if (CurrentAttrs[ATTR_TXTJUSTIFICATION].pAttr == NULL)
06330             return FALSE;
06331         CurrentAttrs[ATTR_TXTJUSTIFICATION].Temp = TRUE;
06332     }
06333     else
06334     {
06335         // We already have an attribute - just change it.
06336         TxtJustificationAttribute *pAttr = (TxtJustificationAttribute*) CurrentAttrs[ATTR_TXTJUSTIFICATION].pAttr;
06337         pAttr->justification = Justify;
06338     }
06339 
06340     // All worked ok.
06341     return TRUE;
06342 }

BOOL Filter::SetTextLineSpacing INT32  Type,
INT32  EMLSpace,
MILLIPOINT  MLSpace,
double  DLSpace
[protected, virtual]
 

Updates the current attribute for line spacing to reflect the value passed in. One of three values will be used depending on the type (as above).

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/04/94
Parameters:
Type = the type of linespacing to create (0,1 or 2) [INPUTS] 0 EMLSpace = linespacing in em's (units related to the current pointsize) 1 MLSpace = absolute millipoint line spacing 2 DLSpace = propoptional linespacing
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Reimplemented in AIEPSFilter.

Definition at line 6367 of file filters.cpp.

06371 {
06372     // Sanity check
06373     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06374 
06375     INT32 LLSpace=0;
06376     double RLSpace=0;
06377 
06378     switch (Type)
06379     {
06380         case 0:
06381         {
06382             // Use the default size.
06383             INT32 FSize = 19200;
06384             // Need to convert the linespacing to a sensible millipoint value
06385             if (CurrentAttrs[ATTR_TXTFONTSIZE].Temp)
06386             {
06387                 // We already have an attribute - just change it.
06388                 TxtFontSizeAttribute *pAttr = (TxtFontSizeAttribute*) CurrentAttrs[ATTR_TXTFONTSIZE].pAttr;
06389                 FSize = pAttr->FontSize;
06390             }
06391             // Convert line space to millipoints.
06392             double LS = (double)EMLSpace;
06393             LLSpace = (INT32)((LS*FSize/1000)+0.5);
06394             break;
06395          }
06396 
06397         case 1:
06398             LLSpace = MLSpace;
06399             break;
06400         
06401         case 2:
06402             RLSpace = DLSpace;
06403             break;
06404     }
06405 
06406     // If we haven't changed this attribute yet, then make a new attribute object for
06407     // our own personal use...
06408     if (!CurrentAttrs[ATTR_TXTLINESPACE].Temp)
06409     {
06410         // Make the correct attribute value and install it as the current one.
06411         CurrentAttrs[ATTR_TXTLINESPACE].pAttr = new TxtLineSpaceAttribute();
06412         if (CurrentAttrs[ATTR_TXTLINESPACE].pAttr == NULL)
06413             return FALSE;
06414         CurrentAttrs[ATTR_TXTLINESPACE].Temp = TRUE;
06415     }
06416 
06417     // Get a pointer to the attribute and set its new values
06418     TxtLineSpaceAttribute *pAttr = (TxtLineSpaceAttribute*) CurrentAttrs[ATTR_TXTLINESPACE].pAttr;
06419 
06420     switch (Type)
06421     {
06422         case 0:
06423         case 1:
06424             pAttr->IsRatio = FALSE;
06425             pAttr->Value = LLSpace;
06426             pAttr->Ratio = FIXED16(0);
06427             break;
06428         
06429         case 2:
06430             pAttr->IsRatio = TRUE;
06431             pAttr->Value = 0;
06432             pAttr->Ratio = RLSpace;
06433             break;
06434     }   
06435 
06436     // All worked ok.
06437     return TRUE;
06438 }

BOOL Filter::SetTextScript INT32  rise,
INT32  pointsize
[protected]
 

Updates the current attribute for subscript or superscript.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/04/94
Parameters:
rise = signed rise in millipoints away from the baseline [INPUTS] pointsize = size of font to use in millipoints Returns TRUE if the attribute was changed ok FALSE otherwise.
Returns:
Errors: Out of memory.
See also:
Filter; Filter::Init

Definition at line 6500 of file filters.cpp.

06501 {
06502     // Sanity check
06503     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06504 
06505     // ignore any crazy values
06506     if (pointsize<=0)
06507         return TRUE;
06508 
06509     // Use the default size.
06510     INT32 fsize = 19200;
06511     if (CurrentAttrs[ATTR_TXTFONTSIZE].Temp)
06512     {
06513         TxtFontSizeAttribute *pAttr = (TxtFontSizeAttribute*) CurrentAttrs[ATTR_TXTFONTSIZE].pAttr;
06514         fsize = pAttr->FontSize;
06515     }
06516 
06517     double tr = (double)rise/(double)fsize;
06518     double tp = (double)pointsize/(double)fsize;
06519     FIXED16 offset(tr);
06520     FIXED16 size(tp);
06521 
06522     // If we haven't changed this attribute yet, then make a new attribute object for
06523     // our own personal use...
06524     if (!CurrentAttrs[ATTR_TXTSCRIPT].Temp)
06525     {
06526         // Make the correct attribute value and install it as the current one.
06527         CurrentAttrs[ATTR_TXTSCRIPT].pAttr = new TxtScriptAttribute(offset,size);
06528         if (CurrentAttrs[ATTR_TXTSCRIPT].pAttr == NULL)
06529             return FALSE;
06530         CurrentAttrs[ATTR_TXTSCRIPT].Temp = TRUE;
06531     }
06532     else
06533     {
06534         // We already have an attribute - just change it.
06535         CurrentAttrs[ATTR_TXTSCRIPT].Ignore = FALSE;
06536         TxtScriptAttribute *pAttr = (TxtScriptAttribute*) CurrentAttrs[ATTR_TXTSCRIPT].pAttr;
06537         pAttr->Offset = offset;
06538         pAttr->Size = size;
06539     }
06540 
06541     // All worked ok.
06542     return TRUE;
06543 }

BOOL Filter::SetTextSize INT32  Size  )  [protected]
 

Updates the current attribute for TextSize to reflect the value passed in.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
Size - the new FontSize to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 6008 of file filters.cpp.

06009 {
06010     // Sanity check
06011     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06012 
06013     // If we haven't changed this attribute yet, then make a new attribute object for
06014     // our own personal use...
06015     if (!CurrentAttrs[ATTR_TXTFONTSIZE].Temp)
06016     {
06017         // Make the correct attribute value and install it as the current one.
06018         CurrentAttrs[ATTR_TXTFONTSIZE].pAttr = new TxtFontSizeAttribute(Size);
06019         if (CurrentAttrs[ATTR_TXTFONTSIZE].pAttr == NULL)
06020             return FALSE;
06021         CurrentAttrs[ATTR_TXTFONTSIZE].Temp = TRUE;
06022     }
06023     else
06024     {
06025         // We already have an attribute - just change it.
06026         TxtFontSizeAttribute *pAttr = 
06027         (TxtFontSizeAttribute *) CurrentAttrs[ATTR_TXTFONTSIZE].pAttr;
06028         pAttr->FontSize = Size;
06029     }
06030 
06031     // All worked ok.
06032     return TRUE;
06033 }

BOOL Filter::SetTextTracking INT32  Tracking  )  [protected]
 

Updates the current attribute for TextSize to reflect the value passed in.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
Size - the new FontSize to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 6275 of file filters.cpp.

06276 {
06277     // Sanity check
06278     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06279 
06280     // If we haven't changed this attribute yet, then make a new attribute object for
06281     // our own personal use...
06282     if (!CurrentAttrs[ATTR_TXTTRACKING].Temp)
06283     {
06284         // Make the correct attribute value and install it as the current one.
06285         CurrentAttrs[ATTR_TXTTRACKING].pAttr = new TxtTrackingAttribute(Tracking);
06286         if (CurrentAttrs[ATTR_TXTTRACKING].pAttr == NULL)
06287             return FALSE;
06288         CurrentAttrs[ATTR_TXTTRACKING].Temp = TRUE;
06289     }
06290     else
06291     {
06292         // We already have an attribute - just change it.
06293         TxtTrackingAttribute *pAttr = (TxtTrackingAttribute*) CurrentAttrs[ATTR_TXTTRACKING].pAttr;
06294         pAttr->Tracking = Tracking;
06295     }
06296 
06297     // All worked ok.
06298     return TRUE;
06299 }

BOOL Filter::SetTextTypeFace String_64 Name,
FontClass  Class = FC_UNDEFINED
[protected]
 

Updates the current attribute for TextSize to reflect the value passed in.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
Name - the font name to use when creating a new typeface attribute [INPUTS] Class - the class of font this name is supposed to be eg FC_TRUETYPE. the class defaults to FC_UDEFINED which means the first font cached which matches the font name will be used whatever type of font it is.
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 6056 of file filters.cpp.

06057 {
06058     // Sanity check
06059     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06060 
06061     WORD hTypeface = FONTMANAGER->GetFontHandle(Name, Class);
06062 
06063     // If we haven't changed this attribute yet, then make a new attribute object for
06064     // our own personal use...
06065     if (!CurrentAttrs[ATTR_TXTFONTTYPEFACE].Temp)
06066     {
06067         // Make the correct attribute value and install it as the current one.
06068         CurrentAttrs[ATTR_TXTFONTTYPEFACE].pAttr = new TxtFontTypefaceAttribute(hTypeface);
06069         if (CurrentAttrs[ATTR_TXTFONTTYPEFACE].pAttr == NULL)
06070             return FALSE;
06071         CurrentAttrs[ATTR_TXTFONTTYPEFACE].Temp = TRUE;
06072     }
06073     else
06074     {
06075         // We already have an attribute - just change it.
06076         TxtFontTypefaceAttribute *pAttr = (TxtFontTypefaceAttribute*) CurrentAttrs[ATTR_TXTFONTTYPEFACE].pAttr;
06077         pAttr->HTypeface = hTypeface;
06078         pAttr->IsBold = FALSE;
06079         pAttr->IsItalic = FALSE;
06080     }
06081 
06082     // All worked ok.
06083     return TRUE;
06084 }

BOOL Filter::SetTextUnderline BOOL  Underline  )  [protected]
 

Updates the current attribute for Underline to reflect the value passed in.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
Underline - the new Underline state to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init

Definition at line 6189 of file filters.cpp.

06190 {
06191     // Sanity check
06192     ERROR2IF(CurrentAttrs == NULL, FALSE, "No current attributes in filter!");
06193 
06194     // If we haven't changed this attribute yet, then make a new attribute object for
06195     // our own personal use...
06196     if (!CurrentAttrs[ATTR_TXTUNDERLINE].Temp)
06197     {
06198         // Make the correct attribute value and install it as the current one.
06199         CurrentAttrs[ATTR_TXTUNDERLINE].pAttr = new TxtUnderlineAttribute(Underline);
06200         if (CurrentAttrs[ATTR_TXTUNDERLINE].pAttr == NULL)
06201             return FALSE;
06202         CurrentAttrs[ATTR_TXTUNDERLINE].Temp = TRUE;
06203     }
06204     else
06205     {
06206         // We already have an attribute - just change it.
06207         TxtUnderlineAttribute *pAttr = (TxtUnderlineAttribute*) CurrentAttrs[ATTR_TXTUNDERLINE].pAttr;
06208         pAttr->Underlined = Underline;
06209     }
06210 
06211     // All worked ok.
06212     return TRUE;
06213 }

BOOL Filter::SetUpCurrentAttrs  )  [protected]
 

Obtains an attribute array from the attribute manager. This array is the set of default attributes - the filter should use them to maintain its set of current attributes while importing. It then asks the attribute manager to add the correct attributes to each node based on this array. This should be called when importing, not when intialising, otherwise all filters will have this array hanging around all the time, which is bad.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Returns:
TRUE if attributes set up ok; FALSE otherwise.

Errors: Out of memory.

See also:
AttributeManager; AttributeManager::ApplyBasedOnDefaults

Definition at line 518 of file filters.cpp.

00519 {
00520     // Sanity check
00521     ENSURE(CurrentAttrs == NULL, "Filter::SetUpCurrentAttrs called unnecessarily!");
00522 
00523     // Get the array of default attributes to use as our current attributes.
00524     CurrentAttrs = AttributeManager::GetDefaultAttributes();
00525     if (CurrentAttrs == NULL)
00526         return FALSE;
00527 
00528     // Clear the 'ignore' flag on all attributes.
00529     INT32 NumAttrs = AttributeManager::GetNumAttributes();
00530     for (INT32 i = 0; i < NumAttrs; i++)
00531         CurrentAttrs[i].Ignore = FALSE;
00532 
00533     // All done
00534     return TRUE;
00535 }

BOOL Filter::SetWindingRule WindingType  WindingRule  )  [protected]
 

Updates the current attribute for winding rule to reflect the value passed in.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/04/94
Parameters:
WindingRule - the new winding rule to use. [INPUTS]
Returns:
TRUE if the attribute was changed ok; FALSE otherwise.

Errors: Out of memory.

See also:
Filter; Filter::Init; WindingType

Definition at line 4348 of file filters.cpp.

04349 {
04350     // Sanity check
04351     ENSURE(CurrentAttrs != NULL, "No current attributes in filter!");
04352 
04353     // If we haven't changed this attribute yet, then make a new attribute object for
04354     // our own personal use...
04355     if (!CurrentAttrs[ATTR_WINDINGRULE].Temp)
04356     {
04357         // Make the correct attribute value and install it as the current one.
04358         CurrentAttrs[ATTR_WINDINGRULE].pAttr = new WindingRuleAttribute(WindingRule);
04359         if (CurrentAttrs[ATTR_WINDINGRULE].pAttr == NULL)
04360             return FALSE;
04361         CurrentAttrs[ATTR_WINDINGRULE].Temp = TRUE;
04362     }
04363     else
04364     {
04365         // We already have an attribute - just change it.
04366         WindingRuleAttribute *pAttr = 
04367             (WindingRuleAttribute *) CurrentAttrs[ATTR_WINDINGRULE].pAttr;
04368         pAttr->WindingRule = WindingRule;
04369     }
04370 
04371     // All worked ok.
04372     return TRUE;
04373 }

virtual BOOL Filter::ShouldExportHTMLTag  )  [inline, virtual]
 

Reimplemented in BaseCamelotFilter, FlareTemplateFilter, CamelotWebFilter, and CamelotNULLWebFilter.

Definition at line 632 of file filters.h.

00633     {
00634         return FALSE;
00635     }

BOOL Filter::SnapShotCurrentAttrs  )  [protected]
 

This function grabs a snap shot of the filter managers current attributes. It simply makes a new List identical to that of CurrentAttrs.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/95
Parameters:
- [INPUTS]
Returns:
TRUE if the currentattrs list has been copied FALSE if nothing has been copied

Definition at line 607 of file filters.cpp.

00608 {
00609     return FilterSnapShot.CreateSnapShot(CurrentAttrs);
00610 }

void Filter::UnforceStatusExportMessage  )  [static]
 

Resets the message override on export back to "no override".

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/9/96
See also:
Filter::ForceStatusExportMessage; ExternalClipboard::GetDataSource

Definition at line 1582 of file filters.cpp.

01583 {
01584     // Set this back to "no override".
01585     m_nForcedStatusExportMessage = 0;
01586 }

BOOL Filter::UpdateExportedNodeCount UINT32  NumNodesSaved = 1  ) 
 

Update the progress display according to the number passed in. The NumNodes parameter indicates how many nodes have just been saved. Most nodes won't call this when exporting as they are only '1' node. Nodes such as blenders or bitmaps may call this to update the progress more smoothly. E.g. a bitmap might say that it is 20 nodes if it has 20 scanlines. It could then call this function after each scanline is saved with the value 1. It should not call it with more than the number of nodes it claims to be, e.g. the example bitmap above should only ever call with NumNodes in the range 1 to 20. And the cumulative total of NumNodesSaved passed in by one node should never be more than the number of nodes it claims to be either.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/01/95
Parameters:
NumNodes - number of nodes just saved. [INPUTS]
Returns:
TRUE if the progress display was updated ok; FALSE if not (i.e. the user pressed Esc to cancel the operation).
See also:
Node::GetSizeOfExport

Definition at line 2472 of file filters.cpp.

02473 {
02474 #ifdef DO_EXPORT
02475     // Work out how many nodes have been saved in total.
02476     NumNodes += NumNodesSaved;
02477 
02478     // Make sure we remain within the legal range of values
02479     if (NumNodes > CurrentProgressLimit)
02480     {
02481         #if _DEBUG
02482         // Only report an error once for each sub-section otherwise it's too annoying.
02483         static UINT32 LastError = 0;
02484         if (LastError != CurrentProgressLimit)
02485         {
02486             if (Error::IsUserName("Tim"))
02487             {
02488                 ERROR3("Filter::UpdateExportedNodeCount() called with an out of range value!");
02489             }
02490             LastError = CurrentProgressLimit;
02491         }
02492         #endif
02493 
02494         // Ignore the error in retail builds - it's not serious (but limit the value)
02495         NumNodes = CurrentProgressLimit;
02496     }
02497 
02498     // Check to see if it's worth updating yet.
02499     if (NumNodes > (LastExportProgressUpdate + UpdateEvery))
02500     {
02501         LastExportProgressUpdate = NumNodes;
02502 
02503         if (!ContinueSlowJob(NumNodes))
02504         {
02505             return FALSE;
02506         }
02507     }
02508 
02509 #endif
02510     // Everything is ok if we get here
02511     return TRUE;
02512 }

void Filter::UpdateFilterProgress UINT32  increment  )  [protected, virtual]
 

Shuts down the export render process.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com> (from Neville's original code)
Date:
12/4/00
Parameters:
pRegion - the render region to export to. [INPUTS] ShowProgress - TRUE then start up a progress bar or FALSE assume the caller has done it.
Returns:
TRUE if the export process completed successfully, FALSE if an error occured.
See also:
Filter::ExportRender, Filter::ExportRenderNodes

Definition at line 2340 of file filters.cpp.

02341 {
02342     // Limit the progress display to legal values
02343     if (increment>0)
02344         CurrentProgressLimit = NumNodes + increment;
02345 
02346     // Update node count accordingly
02347     NumNodes = CurrentProgressLimit;
02348 
02349     if (NumNodes > (LastExportProgressUpdate + UpdateEvery))
02350         LastExportProgressUpdate = NumNodes;
02351 }

BOOL Filter::WillAcceptExistingFile PathName  pthToReplace  )  [virtual]
 

Checks to see if this filter will accept an existing file to export to.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/5/97
Returns:
TRUE if this filter is willing to accept this existing file FALSE otherwise
This base version will simply ask the user if she wants to overwrite the file.

But ImagemapFilter::WillAcceptExistingFile will override this so the user can insert an imagemap into an existing HTML file.

Reimplemented in ImagemapFilter.

Definition at line 4486 of file filters.cpp.

04487 {
04488 PORTNOTETRACE("filter","Filter::WillAcceptExistingFile - do nothing");
04489 #ifndef EXCLUDE_FROM_XARALX
04490     //We're going to put up a message box to ask the user if she wants to
04491     //replace the existing file.
04492 
04493     //So first get the truncated path name
04494     String_256 strToReplace =  pthToReplace.GetTruncatedPath(50);
04495 
04496     //Now create a string to put our error message in
04497     String_256 strError;
04498 
04499     //And make the error message up using the file name
04500     strError.MakeMsg(_R(IDM_EXPORT_OVERWRITE), &strToReplace);
04501                                                 
04502     //Now, set that error message as the next one to display
04503     Error::SetError( 0, strError, 0 );
04504 
04505     //And set up the message help context
04506     SetNextMsgHelpContext(_R(IDM_EXPORT_OVERWRITE));
04507 
04508     //Now set up the buttons
04509     ErrorInfo Info;
04510     Info.Button[0] = _R(IDB_OVERWRITE);
04511     Info.Button[1] = _R(IDS_CANCEL);
04512     
04513     //Make "cancel" the default
04514     Info.OK = Info.Cancel = 2;
04515 
04516     //And put the error box up
04517     switch (AskQuestion( &Info ))
04518     {
04519         case _R(IDS_CANCEL):
04520             return FALSE;
04521 
04522         case _R(IDB_OVERWRITE):
04523         default:
04524             return TRUE;
04525     }
04526 #endif
04527     return false;
04528 }

BOOL Filter::WriteNodes RenderRegion pRegion,
ExportDC pDC,
BOOL  VisibleLayersOnly,
BOOL  SelectedOnly,
BOOL  ShowProgress
[protected, virtual]
 

Actually export the nodes to the given render region showing a progress bar as we go. Assumes everything has been set up by ExportRender. Assumes that either a progress bar has been started and will be ended by the caller or that it should start and end the progress bar itself.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com> (from Neville's original code)
Date:
12/4/00
Parameters:
pRegion - the render region to export to. [INPUTS] pDc - device context to use, can be NULL. VisibleLayersOnly - use visible layers or not ShowProgress - TRUE then start up a progress bar or FALSE assume the caller has done it.
Returns:
TRUE if the export process completed successfully, FALSE if an error occured.
See also:
Filter::ExportRender, Filter::ExportRenderNodes

Reimplemented in AIEPSFilter, and FlashFilter.

Definition at line 2282 of file filters.cpp.

02287 {
02288 #ifdef DO_EXPORT
02289 
02290     // Find the first node that we should export from this spread
02291     Node *pNode = pRegion->GetRenderSpread ();
02292 
02293     // Cycle through all exportable nodes, and render (export) them.
02294     // Export the file, but catch any file errors.
02295     //TRY
02296     {
02297 //      BOOL IsPageBackGroundAnd32BitAlpha = FALSE;
02298 //      BOOL LookForPageBackgrounds = TRUE;
02299 
02300         FilterRenderCallback MyCallback(this, FALSE, VisibleLayersOnly, SelectedOnly);  // Not counting this time!
02301         pRegion->RenderTree(pNode, FALSE, FALSE, &MyCallback);
02302         pRegion->ResetRender();
02303     }
02304 #if 0
02305     CATCH ( CFileException, e )
02306     {
02307         // Didn't work - report failure to caller.
02308         if ( pDC )
02309             pDC->ExportFile->SetThrowExceptions ( FALSE );
02310         pRegion->StopRender ();
02311         if ( ShowProgress )
02312             EndSlowJob ();
02313         return FALSE;
02314     }
02315     END_CATCH
02316 #endif
02317     // All OK
02318     return TRUE;
02319 #else
02320     return FALSE;
02321 #endif
02322 }


Friends And Related Function Documentation

friend class FilterRenderCallback [friend]
 

Definition at line 449 of file filters.h.


Member Data Documentation

BOOL Filter::AddUnnamedColours = FALSE [static]
 

If it is TRUE then any colours used in the imported file but not explicitly named by whatever colour table structure the file uses will be created as named colours (usu. of the form Unnamed 1, Unnamed 2 and so on). If FALSE, immediate colours will be used, and will not appear on the document's colour bar. Defaults to FALSE.

Preference: AddUnnamedColours Section: Filters Range: TRUE or FALSE

See also:
MinLineWidth

Definition at line 816 of file filters.h.

BOOL Filter::bDontWarnBitmapNonMixTransp = FALSE [static]
 

Controls how bitmap files are opened/imported: TRUE => each bitmap is placed on a new layer. FALSE => each bitmaps is placed on the current layer. Applies to multiple format bitmaps such as animated GIFs.

Preference: bDontWarnBitmapNonMixTransp Section: Filters Range: TRUE or FALSE.

Definition at line 828 of file filters.h.

AttributeEntry* Filter::CurrentAttrs [protected]
 

Definition at line 778 of file filters.h.

UINT32 Filter::CurrentProgressLimit = 0 [static, protected]
 

Definition at line 847 of file filters.h.

UINT32 Filter::ExportMsgID [protected]
 

Definition at line 589 of file filters.h.

AttributeEntry Filter::FillAttr [protected]
 

Definition at line 784 of file filters.h.

UINT32 Filter::FilterID
 

Definition at line 551 of file filters.h.

String_256 Filter::FilterInfo
 

Definition at line 550 of file filters.h.

List Filter::FilterList [static, private]
 

Definition at line 792 of file filters.h.

String_256 Filter::FilterName
 

Definition at line 549 of file filters.h.

SnapShotList Filter::FilterSnapShot [protected]
 

Definition at line 781 of file filters.h.

FilterFlags Filter::Flags [protected]
 

Definition at line 576 of file filters.h.

BOOL Filter::ImportBitmapsOntoLayers = TRUE [static]
 

Controls how bitmap files are opened/imported: TRUE => each bitmap is placed on a new layer. FALSE => each bitmaps is placed on the current layer. Applies to multiple format bitmaps such as animated GIFs.

Preference: ImportBitmapsOntoLayers Section: Filters Range: TRUE or FALSE.

Definition at line 826 of file filters.h.

UINT32 Filter::ImportMsgID [protected]
 

Definition at line 596 of file filters.h.

INT32 Filter::ImportWithLayers = 2 [static]
 

Controls how files are imported: TRUE => Layers are imported/created as necessary when importing. FALSE => Layers are ignore when importing, and the whole imported file is placed in the document as a group.

Preference: ImportWithLayers Section: Filters Range: TRUE or FALSE.

See also:
Filter

Definition at line 819 of file filters.h.

UINT32 Filter::LastExportProgressUpdate = 0 [static, protected]
 

Definition at line 846 of file filters.h.

UINT32 Filter::m__StripStart = 0 [static, protected]
 

Definition at line 850 of file filters.h.

ID Filter::m_NextFilterID = 1099 + 1 [static, private]
 

Definition at line 795 of file filters.h.

UINT32 Filter::m_nForcedStatusExportMessage = 0 [static, protected]
 

Definition at line 570 of file filters.h.

Layer* Filter::m_pSoleLayer [protected]
 

Definition at line 601 of file filters.h.

String_64 Filter::m_StrToAddToProgress [protected]
 

Definition at line 657 of file filters.h.

INT32 Filter::MinLineWidth = 250 [static, protected]
 

Controls how line widths are handled - if a line width thinner than the value of this preference is found, then the line width is forced to be this width. E.g. set it to 500 to make all imported lines be at least 0.5 points wide. (It defaults to 0.25pt).

Preference: MinLineWidth Section: Filters Range: Between 0 and 10,000.

See also:
AddUnnamedColours

Definition at line 799 of file filters.h.

UINT32 Filter::NumNodes = 0 [static, protected]
 

Definition at line 844 of file filters.h.

BOOL Filter::OpenWithLayers = TRUE [static]
 

Controls how files are opened: TRUE => Layers are imported/created as necessary when opening a file. FALSE => Layers are ignore when importing, and the whole opened file is placed in the document as a group. Note: Does not affect v2 Native file formats such as xar and web.

Preference: OpenWithLayers Section: Filters Range: TRUE or FALSE.

Definition at line 822 of file filters.h.

BOOL Filter::PathFilled [protected]
 

Definition at line 785 of file filters.h.

GenericFilter * Filter::pGenericFilter = NULL [static, private]
 

Definition at line 789 of file filters.h.

OILFilter* Filter::pOILFilter
 

Definition at line 552 of file filters.h.

UINT32 Filter::ProgressOffset = 0 [static, protected]
 

Definition at line 849 of file filters.h.

BOOL Filter::SaveAttributes [protected]
 

Definition at line 599 of file filters.h.

UINT32 Filter::StopExportMsgID [protected]
 

Definition at line 593 of file filters.h.

Document* Filter::TheDocument [protected]
 

Definition at line 579 of file filters.h.

UINT32 Filter::UpdateEvery = 1 [static, protected]
 

Definition at line 845 of file filters.h.

BOOL Filter::WantPreviewBmp [protected]
 

Definition at line 573 of file filters.h.


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