1#ifndef __SSKINPOOL__H__
2#define __SSKINPOOL__H__
4#include <core/SSingletonMap.h>
5#include <interface/SSkinPool-i.h>
6#include <helper/obj-ref-impl.hpp>
23 SKIN_SYS_CHECKBOX = 0,
25 SKIN_SYS_FOCUSCHECKBOX,
32 SKIN_SYS_TREE_CHECKBOX,
40 SKIN_SYS_VERT_PROG_BKGND,
41 SKIN_SYS_VERT_PROG_BAR,
42 SKIN_SYS_SLIDER_THUMB,
45 SKIN_SYS_BTN_MINIMIZE,
85class CElementTraits<
SkinKey> :
public CElementTraitsBase<SkinKey> {
92 static ULONG
Hash(INARGTYPE skinKey)
94 ULONG nHash = CElementTraits<SStringW>::Hash(skinKey.strName);
96 nHash += skinKey.scale;
108 return element1.strName == element2.strName && element1.scale == element2.scale;
119 int nRet = element1.strName.CompareNoCase(element2.strName);
121 nRet = element1.scale - element2.scale;
135 ,
protected SCmnMap<SSkinPtr, SkinKey> {
155 STDMETHOD_(
ISkinObj *,
GetSkin)(THIS_ LPCWSTR strSkinName,
int nScale) OVERRIDE;
181 STDMETHOD_(
void,
RemoveAll)(THIS) OVERRIDE;
206 SMap<SkinKey, int> m_mapSkinUseCount;
static int CompareElementsOrdered(INARGTYPE element1, INARGTYPE element2)
Compares two SkinKey objects in ordered manner.
static bool CompareElements(INARGTYPE element1, INARGTYPE element2)
Compares two SkinKey objects for equality.
static ULONG Hash(INARGTYPE skinKey)
Computes the hash value for a SkinKey.
SCmnMap(void(*funOnKeyRemoved)(const SSkinPtr &)=NULL)
int _LoadSkins(SXmlNode xmlNode)
Loads skins from an XML node.
BOOL RemoveSkin(ISkinObj *skin) OVERRIDE
Removes a skin object from the pool.
static void OnKeyRemoved(const SSkinPtr &obj)
Callback function called when a skin object is removed from the pool.
ISkinObj * GetSkin(LPCWSTR strSkinName, int nScale) OVERRIDE
Retrieves a skin object by name and scale.
ISkinObj * _LoadSkin(SXmlNode xmlNode, int nScale)
Loads a single skin from an XML node.
void RemoveAll() OVERRIDE
Removes all skin objects from the pool.
BOOL AddSkin(ISkinObj *skin) OVERRIDE
Adds a skin object to the pool.
SSkinPool(BOOL bAutoScale=TRUE)
Constructor.
int LoadSkins(IXmlNode *xmlNode) OVERRIDE
Loads skins from an XML node.
A class representing an ASCII string.
Class representing an XML node.
Key for identifying a skin object in the pool.
Interface for Skin Objects.