soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SSkinobj-i.h
Go to the documentation of this file.
1/**
2 * @file SSkinobj-i.h
3 * @brief Interface for Skin Objects
4 * @version v1.0
5 * @author SOUI group
6 * @date 2014/08/01
7 *
8 * @details This file defines the interface for skin objects used in rendering.
9 */
10
11#ifndef __SSKINOBJ_I__H__
12#define __SSKINOBJ_I__H__
13
14#include <interface/obj-ref-i.h>
15#include <interface/SRender-i.h>
17SNSBEGIN
18
19/**
20 * @struct ISkinObj
21 * @brief Interface for Skin Objects
22 *
23 * @details This interface defines the methods for skin objects, which are used for rendering
24 * graphical elements with various states and properties such as transparency and scaling.
25 */
26#undef INTERFACE
27#define INTERFACE ISkinObj
28DECLARE_INTERFACE_(ISkinObj, IObject)
29{
30 DEF_OBJ_BASE(ISkinObj, Skin)
31#include <interface/SobjectApi.h>
32
33 /**
34 * @brief Draws the skin object to the specified render target with a given state and transparency.
35 *
36 * @param pRT Pointer to the render target where the skin will be drawn.
37 * @param rcDraw Rectangle defining the drawing area.
38 * @param dwState State of the skin to draw.
39 * @param byAlpha Transparency level (0-255).
40 */
41 STDMETHOD_(void, DrawByState2)
42 (CTHIS_ IRenderTarget * pRT, LPCRECT rcDraw, DWORD dwState, BYTE byAlpha) SCONST PURE;
43
44 /**
45 * @brief Draws the skin object to the specified render target with a given state.
46 *
47 * @param pRT Pointer to the render target where the skin will be drawn.
48 * @param rcDraw Rectangle defining the drawing area.
49 * @param dwState State of the skin to draw.
50 *
51 * @details Uses the alpha value obtained from the skin object's GetAlpha method.
52 */
53 STDMETHOD_(void, DrawByState)
54 (CTHIS_ IRenderTarget * pRT, LPCRECT rcDraw, DWORD dwState) SCONST PURE;
56 /**
57 * @brief Draws the skin object to the specified render target with a given index and transparency.
58 *
59 * @param pRT Pointer to the render target where the skin will be drawn.
60 * @param rcDraw Rectangle defining the drawing area.
61 * @param iState Index of the skin state to draw.
62 * @param byAlpha Transparency level (0-255).
63 */
64 STDMETHOD_(void, DrawByIndex2)
65 (CTHIS_ IRenderTarget * pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) SCONST PURE;
66
67 /**
68 * @brief Draws the skin object to the specified render target with a given index.
69 *
70 * @param pRT Pointer to the render target where the skin will be drawn.
71 * @param rcDraw Rectangle defining the drawing area.
72 * @param iState Index of the skin state to draw.
73 *
74 * @details Uses the alpha value obtained from the skin object's GetAlpha method.
75 */
76 STDMETHOD_(void, DrawByIndex)
77 (CTHIS_ IRenderTarget * pRT, LPCRECT rcDraw, int iState) SCONST PURE;
78
79 /**
80 * @brief Retrieves the default size of the skin object.
81 *
82 * @return SIZE The default size of the skin object.
83 *
84 * @details Derived classes should implement this method based on the characteristics of the skin.
85 */
86 STDMETHOD_(SIZE, GetSkinSize)(CTHIS) SCONST PURE;
87
88 /**
89 * @brief Retrieves the number of states contained in the skin object.
90 *
91 * @return int The number of states.
92 *
93 * @details Default is 1.
94 */
95 STDMETHOD_(int, GetStates)(CTHIS) SCONST PURE;
96
97 /**
98 * @brief Retrieves the transparency of the skin object.
99 *
100 * @return BYTE The transparency level (0-255).
101 */
102 STDMETHOD_(BYTE, GetAlpha)(CTHIS) SCONST PURE;
103
104 /**
105 * @brief Sets the transparency of the skin object.
106 *
107 * @param byAlpha The transparency level (0-255).
108 */
109 STDMETHOD_(void, SetAlpha)(THIS_ BYTE byAlpha) PURE;
110
111 /**
112 * @brief Adjusts the hue of the skin object based on a reference color.
113 *
114 * @param cr The reference color.
115 *
116 * @details Default implementation does nothing.
117 */
118 STDMETHOD_(void, OnColorize)(THIS_ COLORREF cr) PURE;
120 /**
121 * @brief Retrieves the scaling factor of the skin object.
122 *
123 * @return int The scaling factor.
124 */
125 STDMETHOD_(int, GetScale)(CTHIS) SCONST PURE;
126
127 /**
128 * @brief Sets the scaling factor of the skin object.
130 * @param scale The scaling factor.
131 *
132 * @details This is an internal interface and should not be called in the business layer.
133 */
134 STDMETHOD_(void, SetScale)(THIS_ int scale) PURE;
135
136 /**
137 * @brief Scales the skin object by a specified factor.
139 * @param nScale The scaling factor.
140 * @return ISkinObj* Pointer to the scaled skin object.
141 */
142 STDMETHOD_(ISkinObj *, Scale)(THIS_ int nScale) PURE;
143};
144
145SNSEND
146#endif // __SSKINOBJ_I__H__
Interface for rendering target objects.
Definition SRender-i.h:1440
Interface for Skin Objects.
Definition SSkinobj-i.h:29
int GetScale() SCONST PURE
Retrieves the scaling factor 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 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 OnColorize(COLORREF cr) PURE
Adjusts the hue of the skin object based on a reference color.
void DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState) SCONST PURE
Draws the skin object to the specified render target with a given index.
void DrawByState(IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState) SCONST PURE
Draws the skin object to the specified render target with a given state.
SIZE GetSkinSize() SCONST PURE
Retrieves the default size of the skin object.
void SetAlpha(BYTE byAlpha) PURE
Sets the transparency of the skin object.
void SetScale(int scale) PURE
Sets the scaling factor of the skin object.
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.
ISkinObj * Scale(int nScale) PURE
Scales the skin object by a specified factor.