soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SSkinObjBase Class Referenceabstract

Base class for skin objects. More...

#include <SSkinObjBase.h>

Inheritance diagram for SSkinObjBase:
TObjRefImpl< SObjectImpl< ISkinObj > > SObjectImpl< ISkinObj > ISkinObj SSKinGroup SSkinButton SSkinColorRect SSkinGradation SSkinGradation2 SSkinImgList SSkinImgCenter SSkinImgFrame SSkinScrollbar SSkinImgFrame2

Public Member Functions

 SSkinObjBase ()
 Constructor.
 
LPCWSTR GetName () SCONST OVERRIDE
 Gets the name of the skin object.
 
void DrawByState2 (IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState, BYTE byAlpha) SCONST OVERRIDE
 Draws the skin by state with alpha blending.
 
void DrawByState (IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState) SCONST OVERRIDE
 Draws the skin by state without alpha blending.
 
void DrawByIndex2 (IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) SCONST OVERRIDE
 Draws the skin by index with alpha blending.
 
void DrawByIndex (IRenderTarget *pRT, LPCRECT rcDraw, int iState) SCONST OVERRIDE
 Draws the skin by index without alpha blending.
 
SIZE GetSkinSize () SCONST OVERRIDE
 Gets the size of the skin.
 
int GetStates () SCONST OVERRIDE
 Gets the number of states supported by the skin.
 
BYTE GetAlpha () SCONST OVERRIDE
 Gets the alpha value of the skin.
 
void SetAlpha (BYTE byAlpha) OVERRIDE
 Sets the alpha value of the skin.
 
int GetScale () SCONST OVERRIDE
 Gets the scale factor of the skin.
 
void SetScale (int scale) OVERRIDE
 Sets the scale factor of the skin.
 
ISkinObjScale (int nScale) OVERRIDE
 Scales the skin.
 
void OnColorize (COLORREF cr) OVERRIDE
 Applies colorization to the skin.
 
int State2Index (DWORD dwState) const
 Converts a state to its corresponding index.
 
virtual HRESULT SetAttribute (const SNS::SStringW &amp;amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;amp;strValue, BOOL bLoading=FALSE)
 
- Public Member Functions inherited from TObjRefImpl< SObjectImpl< ISkinObj > >
 TObjRefImpl ()
 Constructor that initializes the reference count to 1.
 
virtual ~TObjRefImpl ()
 Virtual destructor.
 
long AddRef () override
 Increments the reference count.
 
long Release () override
 Decrements the reference count and deletes the object if the count reaches zero.
 
void OnFinalRelease () override
 Deletes the object.
 
- Public Member Functions inherited from SObjectImpl< ISkinObj >
 SObjectImpl ()
 Constructor.
 
BOOL InitFromXml (IXmlNode *pXmlNode) OVERRIDE
 Initializes the object from an XML node.
 
LPCWSTR GetName () SCONST OVERRIDE
 Retrieves the object's name.
 
LPCSTR GetNameA () SCONST OVERRIDE
 Retrieves the object's name in ANSI format.
 
void SetName (LPCWSTR pszName) OVERRIDE
 Sets the object's name.
 
int GetID () SCONST OVERRIDE
 Retrieves the object's ID.
 
void SetID (int nID) OVERRIDE
 Sets the object's ID.
 
HRESULT AfterAttribute (LPCWSTR strAttribName, LPCWSTR strValue, BOOL bLoading, HRESULT hr) OVERRIDE
 Handles attribute processing after setting an attribute.
 
HRESULT SetAttributeA (LPCSTR pszAttr, LPCSTR pszValue, BOOL bLoading) OVERRIDE
 Sets an attribute using ANSI strings.
 
HRESULT SetAttribute (LPCWSTR pszAttr, LPCWSTR pszValue, BOOL bLoading) OVERRIDE
 Sets an attribute using wide strings.
 
virtual HRESULT SetAttribute (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading)
 Sets an attribute using wide strings.
 
HRESULT ISetAttribute (const IStringW *strAttr, const IStringW *strValue, BOOL bLoading) OVERRIDE
 Sets an attribute using IStringW objects.
 
LPCWSTR GetObjectClass () SCONST OVERRIDE
 Retrieves the object's class name.
 
int GetObjectType () SCONST OVERRIDE
 Retrieves the object's type.
 
BOOL IsClass (LPCWSTR lpszName) SCONST OVERRIDE
 Checks if the object is of a specific class.
 
BOOL GetAttribute (LPCWSTR strAttr, IStringW *pValue) SCONST OVERRIDE
 Retrieves an attribute value.
 
void OnInitFinished (IXmlNode *xmlNode) OVERRIDE
 Handles initialization completion.
 
void SetAttrHandler (FunAttrHandler attrHandler) OVERRIDE
 Sets the attribute handler.
 
virtual HRESULT DefAttributeProc (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading)
 Default attribute processing.
 
- Public Member Functions inherited from ISkinObj
long AddRef () PURE
 Add reference.
 
long Release () PURE
 Release reference.
 
void OnFinalRelease () PURE
 Final release of the object.
 
BOOL IsClass (LPCWSTR lpszName) SCONST PURE
 Checks if the object is of a specified class type.
 
LPCWSTR GetObjectClass () SCONST PURE
 Retrieves the class name of the object.
 
int GetObjectType () SCONST PURE
 Retrieves the type of the object.
 
int GetID () SCONST PURE
 Retrieves the ID of the object.
 
void SetID (int nID) PURE
 Sets the ID of the object.
 
LPCWSTR GetName () SCONST PURE
 Retrieves the name of the object.
 
LPCSTR GetNameA () SCONST PURE
 Retrieves the name of the object as an ANSI string.
 
void SetName (LPCWSTR pszName) PURE
 Sets the name of the object.
 
BOOL InitFromXml (IXmlNode *xmlNode) PURE
 Initializes the object from an XML node.
 
void OnInitFinished (IXmlNode *xmlNode) PURE
 Handles the completion of attribute initialization.
 
HRESULT ISetAttribute (const IStringW *strAttribName, const IStringW *strValue, BOOL bLoading) PURE
 Sets an attribute of the object.
 
HRESULT SetAttributeA (LPCSTR pszAttr, LPCSTR pszValue, BOOL bLoading=FALSE) PURE
 Sets an attribute of the object using ANSI strings.
 
HRESULT SetAttribute (LPCWSTR pszAttr, LPCWSTR pszValue, BOOL bLoading=FALSE) PURE
 Sets an attribute of the object using wide strings.
 
BOOL GetAttribute (LPCWSTR strAttr, IStringW *pValue) SCONST PURE
 Retrieves the value of an attribute by its name.
 
HRESULT AfterAttribute (LPCWSTR pszAttr, LPCWSTR pszValue, BOOL bLoading, HRESULT hr) PURE
 Handles the completion of attribute processing.
 
void SetAttrHandler (FunAttrHandler attrHandler) PURE
 Sets the attribute handler callback function.
 
void DrawByState2 (IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState, BYTE byAlpha) SCONST PURE
 Draws the skin object to the specified render target with a given state and transparency.
 
void DrawByState (IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState) SCONST PURE
 Draws the skin object to the specified render target with a given state.
 
void DrawByIndex2 (IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) SCONST PURE
 Draws the skin object to the specified render target with a given index and transparency.
 
void DrawByIndex (IRenderTarget *pRT, LPCRECT rcDraw, int iState) SCONST PURE
 Draws the skin object to the specified render target with a given index.
 
SIZE GetSkinSize () SCONST PURE
 Retrieves the default size of the skin object.
 
int GetStates () SCONST PURE
 Retrieves the number of states contained in the skin object.
 
BYTE GetAlpha () SCONST PURE
 Retrieves the transparency of the skin object.
 
void SetAlpha (BYTE byAlpha) PURE
 Sets the transparency of the skin object.
 
void OnColorize (COLORREF cr) PURE
 Adjusts the hue of the skin object based on a reference color.
 
int GetScale () SCONST PURE
 Retrieves the scaling factor of the skin object.
 
void SetScale (int scale) PURE
 Sets the scaling factor of the skin object.
 
ISkinObjScale (int nScale) PURE
 Scales the skin object by a specified factor.
 

Protected Member Functions

void OnInitFinished (IXmlNode *pNode) OVERRIDE
 Called when initialization is finished.
 
virtual void _Scale (ISkinObj *pObj, int nScale)
 Scales the skin object.
 
virtual void _DrawByState (IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState, BYTE byAlpha) const
 Draws the skin by state with alpha blending.
 
virtual void _DrawByIndex (IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const =0
 Draws the skin by index with alpha blending.
 

Protected Attributes

BYTE m_byAlpha
 
COLORREF m_crColorize
 
bool m_bEnableColorize
 
int m_nScale
 
bool m_bEnableScale
 
bool m_checkAsPushdown
 
SState2Index m_state2Index
 
- Protected Attributes inherited from TObjRefImpl< SObjectImpl< ISkinObj > >
LONG m_cRef
 Reference count.
 
- Protected Attributes inherited from SObjectImpl< ISkinObj >
SStringW m_strName
 
int m_nID
 
FunAttrHandler m_attrHandler
 

Additional Inherited Members

- Static Public Member Functions inherited from SObjectImpl< ISkinObj >
static int GetClassType ()
 Retrieves the class type.
 
static LPCWSTR GetClassName ()
 Retrieves the class name.
 
static LPCWSTR GetClassAlias ()
 Retrieves the class alias.
 
static void MarkAttributeHandled (SXmlAttr xmlAttr, bool bHandled)
 Marks an attribute as handled.
 
static bool IsAttributeHandled (SXmlAttr xmlAttr)
 Checks if an attribute is handled.
 

Detailed Description

Base class for skin objects.

This class provides a base implementation for skin objects, which are used to define the visual appearance of UI elements. It includes methods for drawing, scaling, and colorizing skins, as well as managing state-to-index mappings.

Definition at line 76 of file SSkinObjBase.h.

Constructor & Destructor Documentation

◆ SSkinObjBase()

SSkinObjBase::SSkinObjBase ( )

Constructor.

Definition at line 117 of file SSkinObjBase.cpp.

Member Function Documentation

◆ _DrawByIndex()

virtual void SSkinObjBase::_DrawByIndex ( IRenderTarget * pRT,
LPCRECT rcDraw,
int iState,
BYTE byAlpha ) const
protectedpure virtual

Draws the skin by index with alpha blending.

Parameters
pRTPointer to the render target.
rcDrawRectangle to draw in.
iStateIndex of the state to draw.
byAlphaAlpha value for transparency.

Implemented in SSkinButton, SSkinColorRect, SSkinGradation2, SSkinGradation, SSKinGroup, SSkinImgCenter, SSkinImgFrame, SSkinImgList, and SSkinScrollbar.

◆ _DrawByState()

void SSkinObjBase::_DrawByState ( IRenderTarget * pRT,
LPCRECT rcDraw,
DWORD dwState,
BYTE byAlpha ) const
protectedvirtual

Draws the skin by state with alpha blending.

Parameters
pRTPointer to the render target.
rcDrawRectangle to draw in.
dwStateState to draw.
byAlphaAlpha value for transparency.

Reimplemented in SSkinScrollbar.

Definition at line 209 of file SSkinObjBase.cpp.

◆ _Scale()

void SSkinObjBase::_Scale ( ISkinObj * pObj,
int nScale )
protectedvirtual

Scales the skin object.

Parameters
pObjPointer to the skin object.
nScaleScale factor.

Reimplemented in SSKinGroup, SSkinImgFrame, SSkinImgList, and SSkinScrollbar.

Definition at line 142 of file SSkinObjBase.cpp.

◆ DrawByIndex()

void SSkinObjBase::DrawByIndex ( IRenderTarget * pRT,
LPCRECT rcDraw,
int iState )

Draws the skin by index without alpha blending.

Parameters
pRTPointer to the render target.
rcDrawRectangle to draw in.
iStateIndex of the state to draw.

Definition at line 189 of file SSkinObjBase.cpp.

◆ DrawByIndex2()

void SSkinObjBase::DrawByIndex2 ( IRenderTarget * pRT,
LPCRECT rcDraw,
int iState,
BYTE byAlpha )

Draws the skin by index with alpha blending.

Parameters
pRTPointer to the render target.
rcDrawRectangle to draw in.
iStateIndex of the state to draw.
byAlphaAlpha value for transparency.

Definition at line 194 of file SSkinObjBase.cpp.

◆ DrawByState()

void SSkinObjBase::DrawByState ( IRenderTarget * pRT,
LPCRECT rcDraw,
DWORD dwState )

Draws the skin by state without alpha blending.

Parameters
pRTPointer to the render target.
rcDrawRectangle to draw in.
dwStateState to draw.

Definition at line 199 of file SSkinObjBase.cpp.

◆ DrawByState2()

void SSkinObjBase::DrawByState2 ( IRenderTarget * pRT,
LPCRECT rcDraw,
DWORD dwState,
BYTE byAlpha )

Draws the skin by state with alpha blending.

Parameters
pRTPointer to the render target.
rcDrawRectangle to draw in.
dwStateState to draw.
byAlphaAlpha value for transparency.

Definition at line 204 of file SSkinObjBase.cpp.

◆ GetAlpha()

BYTE SSkinObjBase::GetAlpha ( )

Gets the alpha value of the skin.

Returns
Alpha value.

Definition at line 137 of file SSkinObjBase.cpp.

◆ GetName()

LPCWSTR SSkinObjBase::GetName ( )

Gets the name of the skin object.

Returns
Name of the skin object.

Definition at line 220 of file SSkinObjBase.cpp.

◆ GetScale()

int SSkinObjBase::GetScale ( )

Gets the scale factor of the skin.

Returns
Scale factor.

Definition at line 167 of file SSkinObjBase.cpp.

◆ GetSkinSize()

SIZE SSkinObjBase::GetSkinSize ( )

Gets the size of the skin.

Returns
Size of the skin.

Definition at line 182 of file SSkinObjBase.cpp.

◆ GetStates()

int SSkinObjBase::GetStates ( )

Gets the number of states supported by the skin.

Returns
Number of states.

Definition at line 177 of file SSkinObjBase.cpp.

◆ OnColorize()

void SSkinObjBase::OnColorize ( COLORREF cr)

Applies colorization to the skin.

Parameters
crColor to apply for colorization.

Definition at line 225 of file SSkinObjBase.cpp.

◆ OnInitFinished()

void SSkinObjBase::OnInitFinished ( IXmlNode * pNode)
protected

Called when initialization is finished.

Parameters
pNodePointer to the XML node.

Definition at line 127 of file SSkinObjBase.cpp.

◆ Scale()

ISkinObj * SSkinObjBase::Scale ( int nScale)

Scales the skin.

Parameters
nScaleScale factor.
Returns
Pointer to the scaled skin object.

Definition at line 153 of file SSkinObjBase.cpp.

◆ SetAlpha()

void SSkinObjBase::SetAlpha ( BYTE byAlpha)

Sets the alpha value of the skin.

Parameters
byAlphaAlpha value to set.

Definition at line 215 of file SSkinObjBase.cpp.

◆ SetAttribute()

virtual HRESULT SSkinObjBase::SetAttribute ( const SNS::SStringW &amp;amp;amp;amp; strAttribName,
const SNS::SStringW &amp;amp;amp;amp; strValue,
BOOL bLoading = FALSE )
inlinevirtual

Definition at line 186 of file SSkinObjBase.h.

◆ SetScale()

void SSkinObjBase::SetScale ( int scale)

Sets the scale factor of the skin.

Parameters
scaleScale factor to set.

Definition at line 172 of file SSkinObjBase.cpp.

◆ State2Index()

int SSkinObjBase::State2Index ( DWORD dwState) const

Converts a state to its corresponding index.

Parameters
dwStateState to convert.
Returns
Index corresponding to the state.

Definition at line 132 of file SSkinObjBase.cpp.

Member Data Documentation

◆ m_bEnableColorize

bool SSkinObjBase::m_bEnableColorize
protected

Definition at line 229 of file SSkinObjBase.h.

◆ m_bEnableScale

bool SSkinObjBase::m_bEnableScale
protected

Definition at line 231 of file SSkinObjBase.h.

◆ m_byAlpha

BYTE SSkinObjBase::m_byAlpha
protected

Definition at line 227 of file SSkinObjBase.h.

◆ m_checkAsPushdown

bool SSkinObjBase::m_checkAsPushdown
protected

Definition at line 232 of file SSkinObjBase.h.

◆ m_crColorize

COLORREF SSkinObjBase::m_crColorize
protected

Definition at line 228 of file SSkinObjBase.h.

◆ m_nScale

int SSkinObjBase::m_nScale
protected

Definition at line 230 of file SSkinObjBase.h.

◆ m_state2Index

SState2Index SSkinObjBase::m_state2Index
protected

Definition at line 233 of file SSkinObjBase.h.


The documentation for this class was generated from the following files: