Interface for Skin Objects. More...
#include <SSkinobj-i.h>
Public Member Functions | |
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. | |
ISkinObj * | Scale (int nScale) PURE |
Scales the skin object by a specified factor. | |
Interface for Skin Objects.
This interface defines the methods for skin objects, which are used for rendering graphical elements with various states and properties such as transparency and scaling.
Definition at line 28 of file SSkinobj-i.h.
long ISkinObj::AddRef | ( | ) |
Add reference.
Increments the reference count of the object.
HRESULT ISkinObj::AfterAttribute | ( | LPCWSTR | pszAttr, |
LPCWSTR | pszValue, | ||
BOOL | bLoading, | ||
HRESULT | hr ) |
Handles the completion of attribute processing.
pszAttr | Name of the attribute. |
pszValue | Value of the attribute. |
bLoading | Flag indicating if the object is being created by the system. |
hr | Result of the attribute processing. |
void ISkinObj::DrawByIndex | ( | IRenderTarget * | pRT, |
LPCRECT | rcDraw, | ||
int | iState ) |
Draws the skin object to the specified render target with a given index.
pRT | Pointer to the render target where the skin will be drawn. |
rcDraw | Rectangle defining the drawing area. |
iState | Index of the skin state to draw. |
Uses the alpha value obtained from the skin object's GetAlpha method.
void ISkinObj::DrawByIndex2 | ( | IRenderTarget * | pRT, |
LPCRECT | rcDraw, | ||
int | iState, | ||
BYTE | byAlpha ) |
Draws the skin object to the specified render target with a given index and transparency.
pRT | Pointer to the render target where the skin will be drawn. |
rcDraw | Rectangle defining the drawing area. |
iState | Index of the skin state to draw. |
byAlpha | Transparency level (0-255). |
void ISkinObj::DrawByState | ( | IRenderTarget * | pRT, |
LPCRECT | rcDraw, | ||
DWORD | dwState ) |
Draws the skin object to the specified render target with a given state.
pRT | Pointer to the render target where the skin will be drawn. |
rcDraw | Rectangle defining the drawing area. |
dwState | State of the skin to draw. |
Uses the alpha value obtained from the skin object's GetAlpha method.
void ISkinObj::DrawByState2 | ( | IRenderTarget * | pRT, |
LPCRECT | rcDraw, | ||
DWORD | dwState, | ||
BYTE | byAlpha ) |
Draws the skin object to the specified render target with a given state and transparency.
pRT | Pointer to the render target where the skin will be drawn. |
rcDraw | Rectangle defining the drawing area. |
dwState | State of the skin to draw. |
byAlpha | Transparency level (0-255). |
BYTE ISkinObj::GetAlpha | ( | ) |
Retrieves the transparency of the skin object.
BOOL ISkinObj::GetAttribute | ( | LPCWSTR | strAttr, |
IStringW * | pValue ) |
Retrieves the value of an attribute by its name.
strAttr | Name of the attribute. |
pValue | Pointer to receive the attribute value. |
int ISkinObj::GetID | ( | ) |
Retrieves the ID of the object.
LPCWSTR ISkinObj::GetName | ( | ) |
Retrieves the name of the object.
LPCSTR ISkinObj::GetNameA | ( | ) |
Retrieves the name of the object as an ANSI string.
LPCWSTR ISkinObj::GetObjectClass | ( | ) |
Retrieves the class name of the object.
This is a virtual function. Note the difference between this and GetClassName.
int ISkinObj::GetObjectType | ( | ) |
Retrieves the type of the object.
This is a virtual function. Note the difference between this and GetClassType.
int ISkinObj::GetScale | ( | ) |
Retrieves the scaling factor of the skin object.
SIZE ISkinObj::GetSkinSize | ( | ) |
Retrieves the default size of the skin object.
Derived classes should implement this method based on the characteristics of the skin.
int ISkinObj::GetStates | ( | ) |
Retrieves the number of states contained in the skin object.
Default is 1.
BOOL ISkinObj::InitFromXml | ( | IXmlNode * | xmlNode | ) |
Initializes the object from an XML node.
xmlNode | XML node containing the initialization data. |
BOOL ISkinObj::IsClass | ( | LPCWSTR | lpszName | ) |
Checks if the object is of a specified class type.
lpszName | Name of the class type to test. |
HRESULT ISkinObj::ISetAttribute | ( | const IStringW * | strAttribName, |
const IStringW * | strValue, | ||
BOOL | bLoading ) |
Sets an attribute of the object.
strAttribName | Name of the attribute. |
strValue | Value of the attribute. |
bLoading | Flag indicating if the object is being created by the system. |
void ISkinObj::OnColorize | ( | COLORREF | cr | ) |
Adjusts the hue of the skin object based on a reference color.
cr | The reference color. |
Default implementation does nothing.
void ISkinObj::OnFinalRelease | ( | ) |
Final release of the object.
Final release of the object, performing cleanup if necessary.
void ISkinObj::OnInitFinished | ( | IXmlNode * | xmlNode | ) |
Handles the completion of attribute initialization.
xmlNode | XML node containing the attribute data. |
long ISkinObj::Release | ( | ) |
Release reference.
Decrements the reference count of the object.
ISkinObj * ISkinObj::Scale | ( | int | nScale | ) |
Scales the skin object by a specified factor.
nScale | The scaling factor. |
void ISkinObj::SetAlpha | ( | BYTE | byAlpha | ) |
Sets the transparency of the skin object.
byAlpha | The transparency level (0-255). |
void ISkinObj::SetAttrHandler | ( | FunAttrHandler | attrHandler | ) |
Sets the attribute handler callback function.
attrHandler | Callback function for attribute handling. |
HRESULT ISkinObj::SetAttribute | ( | LPCWSTR | pszAttr, |
LPCWSTR | pszValue, | ||
BOOL | bLoading = FALSE ) |
Sets an attribute of the object using wide strings.
pszAttr | Name of the attribute. |
pszValue | Value of the attribute. |
bLoading | Flag indicating if the object is being created by the system. |
HRESULT ISkinObj::SetAttributeA | ( | LPCSTR | pszAttr, |
LPCSTR | pszValue, | ||
BOOL | bLoading = FALSE ) |
Sets an attribute of the object using ANSI strings.
pszAttr | Name of the attribute. |
pszValue | Value of the attribute. |
bLoading | Flag indicating if the object is being created by the system. |
void ISkinObj::SetID | ( | int | nID | ) |
Sets the ID of the object.
nID | ID to set for the object. |
void ISkinObj::SetName | ( | LPCWSTR | pszName | ) |
Sets the name of the object.
pszName | Name to set for the object. |
void ISkinObj::SetScale | ( | int | scale | ) |
Sets the scaling factor of the skin object.
scale | The scaling factor. |
This is an internal interface and should not be called in the business layer.