SGUsedBitmaps Class Reference

#include <ngitem.h>

Inheritance diagram for SGUsedBitmaps:

SGNameGroup SGDisplayGroup SGDisplayGroup SGDisplayNode SGDisplayNode CCObject CCObject SimpleCCObject SimpleCCObject List of all members.

Public Member Functions

 SGUsedBitmaps ()
virtual BOOL IsMember (Node *, const StringBase &) const
virtual BOOL CreateItems (Node *)
 Create 'Used Bitmaps' set items for the node, as appropriate.

Detailed Description

Definition at line 314 of file ngitem.h.


Constructor & Destructor Documentation

SGUsedBitmaps::SGUsedBitmaps  )  [inline]
 

Definition at line 317 of file ngitem.h.

00318       : SGNameGroup(_R(IDS_NAMEGAL_BITMAPS_TYPE), _R(IDS_NAMEGAL_BITMAPS_TITLE))
00319             { /* empty */ }


Member Function Documentation

BOOL SGUsedBitmaps::CreateItems Node pNode  )  [virtual]
 

Create 'Used Bitmaps' set items for the node, as appropriate.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Parameters:
pNode --- the node to test/register for membership [INPUTS]
Returns:
FALSE for an error, eg. out of memory.
See also:
SGNameGroup::RegisterMember; SGUsedBitmaps::IsMember; CreateDisplayScan::CreateItems::Do

Implements SGNameGroup.

Definition at line 1232 of file ngitem.cpp.

01233 {
01234     // Is the object itself a kind of bitmap?
01235     KernelBitmap* pBmp;
01236     if (pNode->IsABitmap())
01237     {
01238         pBmp = ((NodeBitmap*) pNode)->BitmapRef.GetBitmap();
01239         if (pBmp != 0 && RegisterMember(pNode, pBmp->GetName()) == 0)
01240             return FALSE;
01241         else if (pBmp != 0)
01242             return (TRUE);
01243     }
01244 
01245     // Does it have a bitmap transparency fill attribute?
01246     NodeAttribute* pAttr = pNode->FindFirstAttr( &Node::IsABitmapTranspFill );
01247     if (pAttr != 0)
01248     {
01249         pBmp = ((BitmapTranspFillAttribute*) pAttr->GetAttributeValue())
01250                         ->BitmapRef.GetBitmap();
01251         
01252         if (pBmp != 0 && RegisterMember(pNode, pBmp->GetName()) == 0)
01253             return FALSE;
01254         else if (pBmp != 0)
01255             return (TRUE);
01256     }
01257 
01258     // Does a bitmap colour or transparency fill attribute apply to it?
01259     pAttr = pNode->FindFirstAttr( &Node::IsABitmapFill );
01260     if (pAttr != 0 && !pAttr->IsAFractalFill()) // fractals and plasmas don't have a bitmap!!! sjk
01261     {
01262         pBmp = ((BitmapFillAttribute*) pAttr->GetAttributeValue())
01263                         ->BitmapRef.GetBitmap();
01264         if (pBmp != 0 && RegisterMember(pNode, pBmp->GetName()) == 0)
01265             return FALSE;
01266         else if (pBmp != 0)
01267             return (TRUE);
01268     }
01269 
01270     return TRUE;
01271 }

BOOL SGUsedBitmaps::IsMember Node pNode,
const StringBase strName
const [virtual]
 

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Parameters:
pNode --- the node to test for membership [INPUTS] strName --- the set value (name) to test for equality
Returns:
TRUE if the given node is a member of the given set within this group.
See also:
SGNameGroup::RegisterMember; SGNameItem::IsMember; CreateDisplayScan::CreateItems::Do
NB. the value returned as pBmp can sometimes be set to 1 rather than NULL. so for the meantime test for this too

Implements SGNameGroup.

Definition at line 1186 of file ngitem.cpp.

01187 {
01188     // Is it a bitmap with that value?
01189     KernelBitmap* pBmp;
01190     String_256 str;
01191     if (pNode->IsABitmap())
01192     {
01193         pBmp = ((NodeBitmap*) pNode)->BitmapRef.GetBitmap();
01194         if (pBmp != 0 && pBmp != (class KernelBitmap *)1 && pBmp->GetName() == strName) return TRUE;
01195     }
01196 
01197     // Test against bitmap transparency fills.
01198     NodeAttribute* pAttr = pNode->FindFirstAttr( &Node::IsABitmapTranspFill );
01199     if (pAttr != 0)
01200     {
01201         pBmp = ((BitmapTranspFillAttribute*) pAttr->GetAttributeValue())
01202                             ->BitmapRef.GetBitmap();
01203         if (pBmp != 0 && pBmp != (class KernelBitmap *)1 && pBmp->GetName() == strName) return TRUE;
01204     }
01205 
01206     // Test against bitmap colour fills.
01207     pAttr = pNode->FindFirstAttr( &Node::IsABitmapColourFill );
01208     if (pAttr != 0)
01209     {
01210         pBmp = ((BitmapFillAttribute*) pAttr->GetAttributeValue())
01211                             ->BitmapRef.GetBitmap();
01212         if (pBmp != 0 && pBmp != (class KernelBitmap *)1 && pBmp->GetName() == strName) return TRUE;
01213     }
01214 
01215     return FALSE;
01216 }


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