BfxPlugIn Class Reference

Provides storage for details on a BFX plug-in. More...

#include <bfxitem.h>

Inheritance diagram for BfxPlugIn:

PlugInItem ListItem CCObject SimpleCCObject BfxBrightnessContrast BfxColourDepth BfxFlipAndRotate BfxResize BfxSpecialEffects List of all members.

Public Member Functions

 BfxPlugIn ()
 Constructor for BfxPlugIn.
 ~BfxPlugIn ()
 Destructor for BfxPlugIn.
virtual String_32 GetUniqueID () const
 A string which defines the unique identifier for the plug-ins that this handler is interested in. In this case being Bfx it is 'BFX:'.
virtual TypeOfPlugIn GetTypeOfPlugIn () const
 A unique type for the plug-ins that this handler is interested in. In this case being Bfx it is PLUGIN_BFX.
virtual OpDescriptorGetOpDescriptor ()=0
virtual BOOL Apply (KernelBitmap *pInputBitmap, Document *pDocument, KernelBitmap **ppOutputBitmap=NULL)
 Applies a plug-in's bitmap effect to the specified bitmap.
virtual BOOL IsBitmapModeOk (INT32 ColourDepth, BOOL GreyScale)
 Checks to see if a plug-in can cope with the specified colour depth.

Protected Member Functions

virtual BOOL ApplyBitmapEffect (KernelBitmap *pInputBitmap, Document *pDocument, KernelBitmap **ppOutputBitmap=NULL)
 Applies a plug-in's bitmap effect to the specified bitmap.

Private Member Functions

 CC_DECLARE_DYNAMIC (BfxPlugIn)

Detailed Description

Provides storage for details on a BFX plug-in.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97

Definition at line 122 of file bfxitem.h.


Constructor & Destructor Documentation

BfxPlugIn::BfxPlugIn  ) 
 

Constructor for BfxPlugIn.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97

Definition at line 137 of file bfxitem.cpp.

00138 {
00139 }

BfxPlugIn::~BfxPlugIn  ) 
 

Destructor for BfxPlugIn.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97

Definition at line 151 of file bfxitem.cpp.

00152 {
00153 }


Member Function Documentation

BOOL BfxPlugIn::Apply KernelBitmap pInputBitmap,
Document pDocument,
KernelBitmap **  ppOutputBitmap = NULL
[virtual]
 

Applies a plug-in's bitmap effect to the specified bitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97
Parameters:
pInputBitmap the bitmap to apply the effect to [INPUTS] pDocument the document this bitmap is in
ppOutputBitmap if specified, a pointer to the output bitmap generated [OUTPUTS]
Returns:
True if works ok, False otherwise.

Reimplemented from PlugInItem.

Definition at line 205 of file bfxitem.cpp.

00207 {
00208     ERROR2IF(pInputBitmap == NULL, FALSE, "BfxPlugIn::Apply null bitmap specified!");
00209     ERROR2IF(pDocument == NULL, FALSE, "BfxPlugIn::Apply null document specified!");
00210 
00211     KernelBitmap * pBmp = NULL;
00212     BOOL ok = ApplyBitmapEffect(pInputBitmap, pDocument, &pBmp);
00213 
00214     if (ppOutputBitmap)
00215         *ppOutputBitmap = pBmp;
00216     
00217     return ok;
00218 }

BOOL BfxPlugIn::ApplyBitmapEffect KernelBitmap pInputBitmap,
Document pDocument,
KernelBitmap **  ppOutputBitmap = NULL
[protected, virtual]
 

Applies a plug-in's bitmap effect to the specified bitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97
Parameters:
pInputBitmap the bitmap to apply the effect to [INPUTS] pDocument the document this bitmap is in
ppOutputBitmap if specified, a pointer to the output bitmap generated [OUTPUTS]
Returns:
True if works ok, False otherwise.

Definition at line 255 of file bfxitem.cpp.

00257 {
00258     ERROR2IF(pInputBitmap == NULL, FALSE, "BfxPlugIn::Apply null bitmap specified!");
00259 
00260     if (!pInputBitmap->DestroyXPEInfo())
00261         return FALSE;
00262 
00263     OpParam Param;
00264     Param.Param1 = (INT32)pInputBitmap;
00265     Param.Param2 = (INT32)pDocument;
00266     // give it a variable to return the result i.e. ok/cancel in
00267     BOOL ok = FALSE;
00268     Param.Output = &ok;
00269     // Obtain a pointer to the op descriptor for the create operation 
00270     OpDescriptor* pOpDesc = GetOpDescriptor();
00271     ERROR2IF(pOpDesc==NULL,FALSE,"Failed to find the BfxPlugInDlg OpDescriptor");
00272 
00273     // Only one live instance of the operation is allowed. It's probably a dialog 
00274     if (!MessageHandler::MessageHandlerExists(CC_RUNTIME_CLASS(BfxPlugInDlg)))
00275     {
00276         pOpDesc->Invoke(&Param);         
00277 
00278         // **** Warning ****
00279         // This assumes that the dialog box is modal and so the OpParam is still around
00280         // rather than having been deleted 
00281         // return the output bitmap to the caller
00282         if (ppOutputBitmap)
00283             *ppOutputBitmap = (KernelBitmap*)Param.Param1;
00284         // return the result i.e. ok/cancel to the caller
00285         return ok;
00286     }
00287 /*  else
00288     {
00289         BROADCAST_TO_CLASS(BfxMsg(pBitmap),DialogOp);   
00290     }   */
00291 
00292     // Everything seemed to work ok
00293     return TRUE;
00294 }

BfxPlugIn::CC_DECLARE_DYNAMIC BfxPlugIn   )  [private]
 

virtual OpDescriptor* BfxPlugIn::GetOpDescriptor  )  [pure virtual]
 

Implemented in BfxBrightnessContrast, BfxSpecialEffects, BfxResize, BfxFlipAndRotate, and BfxColourDepth.

TypeOfPlugIn BfxPlugIn::GetTypeOfPlugIn  )  const [virtual]
 

A unique type for the plug-ins that this handler is interested in. In this case being Bfx it is PLUGIN_BFX.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97
Returns:
Type of the plug-in.

Implements PlugInItem.

Definition at line 185 of file bfxitem.cpp.

00186 {
00187     return PLUGIN_BFX;
00188 }

String_32 BfxPlugIn::GetUniqueID  )  const [virtual]
 

A string which defines the unique identifier for the plug-ins that this handler is interested in. In this case being Bfx it is 'BFX:'.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97
Returns:
A string containing a filetype.

Implements PlugInItem.

Definition at line 168 of file bfxitem.cpp.

00169 {
00170     return TEXT("BFX:");
00171 }

BOOL BfxPlugIn::IsBitmapModeOk INT32  ColourDepth,
BOOL  GreyScale
[virtual]
 

Checks to see if a plug-in can cope with the specified colour depth.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97
Parameters:
ColourDepth the colour depth or bits per pixel of the bitmap [INPUTS] GreyScale only relevent if bitmap is 8bpp, True if greyscale
Returns:
True if the bitmap is compatible and False otherwise.

Reimplemented from PlugInItem.

Definition at line 233 of file bfxitem.cpp.

00234 {
00235     // Passed the checks ok so return TRUE
00236     return TRUE;
00237 }


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