1#ifndef __SSKINOBJBASE__H__
2#define __SSKINOBJBASE__H__
5#include <interface/sxml-i.h>
6#include <helper/obj-ref-impl.hpp>
7#include <sobject/Sobject.hpp>
40 int GetIndex(DWORD dwState,
bool checkAsPushdown)
const;
55 static int GetDefIndex(DWORD dwState,
bool checkAsPushdown =
false);
62 static DWORD String2State(
const SStringW &strState);
65 SMap<DWORD, int> m_mapOfStates;
89 STDMETHOD_(LPCWSTR,
GetName)(THIS) SCONST OVERRIDE;
99 (THIS_
IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState, BYTE byAlpha) SCONST OVERRIDE;
108 (THIS_
IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState) SCONST OVERRIDE;
118 (THIS_
IRenderTarget *pRT, LPCRECT rcDraw,
int iState, BYTE byAlpha) SCONST OVERRIDE;
127 (THIS_
IRenderTarget *pRT, LPCRECT rcDraw,
int iState) SCONST OVERRIDE;
133 STDMETHOD_(SIZE,
GetSkinSize)(THIS) SCONST OVERRIDE;
139 STDMETHOD_(
int,
GetStates)(THIS) SCONST OVERRIDE;
145 STDMETHOD_(BYTE,
GetAlpha)(THIS) SCONST OVERRIDE;
151 STDMETHOD_(
void,
SetAlpha)(THIS_ BYTE byAlpha) OVERRIDE;
157 STDMETHOD_(
int,
GetScale)(THIS) SCONST OVERRIDE;
163 STDMETHOD_(
void,
SetScale)(THIS_
int scale) OVERRIDE;
176 STDMETHOD_(
void,
OnColorize)(THIS_ COLORREF cr) OVERRIDE;
187 ATTR_INT(L
"alpha", m_byAlpha, TRUE)
188 ATTR_BOOL(L
"enableColorize", m_bEnableColorize, TRUE)
189 ATTR_BOOL(L
"checkAsPushdown", m_checkAsPushdown, TRUE)
190 ATTR_INT(L
"scale", m_nScale, FALSE)
191 ATTR_BOOL(L
"enableScale", m_bEnableScale, TRUE)
228 COLORREF m_crColorize;
229 bool m_bEnableColorize;
232 bool m_checkAsPushdown;
Interface for Skin Objects.
int State2Index(DWORD dwState) const
Converts a state to its corresponding index.
LPCWSTR GetName() SCONST OVERRIDE
Gets the name of the skin object.
virtual void _DrawByState(IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState, BYTE byAlpha) const
Draws the skin by state with alpha blending.
void DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState) SCONST OVERRIDE
Draws the skin by index without alpha blending.
int GetStates() SCONST OVERRIDE
Gets the number of states supported by the skin.
virtual void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const =0
Draws the skin by index with alpha blending.
int GetScale() SCONST OVERRIDE
Gets the scale factor of the skin.
BYTE GetAlpha() SCONST OVERRIDE
Gets the alpha value of the skin.
SIZE GetSkinSize() SCONST OVERRIDE
Gets the size of the skin.
void OnColorize(COLORREF cr) OVERRIDE
Applies colorization to the skin.
void OnInitFinished(IXmlNode *pNode) OVERRIDE
Called when initialization is finished.
void DrawByState2(IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState, BYTE byAlpha) SCONST OVERRIDE
Draws the skin by state with alpha blending.
void SetAlpha(BYTE byAlpha) OVERRIDE
Sets the alpha value of the skin.
virtual void _Scale(ISkinObj *pObj, int nScale)
Scales the skin object.
void SetScale(int scale) OVERRIDE
Sets the scale factor of the skin.
void DrawByIndex2(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) SCONST OVERRIDE
Draws the skin by index with alpha blending.
ISkinObj * Scale(int nScale) OVERRIDE
Scales the skin.
SSkinObjBase()
Constructor.
void DrawByState(IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState) SCONST OVERRIDE
Draws the skin by state without alpha blending.
Maps skin states to indices.
SState2Index()
Default constructor.
A class representing an ASCII string.
Interface for rendering target objects.
Interface for Skin Objects.