soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SSkin.h
Go to the documentation of this file.
1/**
2 * Copyright (C) 2014-2050
3 * All rights reserved.
4 *
5 * @file SSkin.h
6 * @brief Skin Classes for SOUI
7 * @version v1.0
8 * @author SOUI group
9 * @date 2014/08/02
10 *
11 * Description: Provides various skin classes for rendering different UI elements in SOUI.
12 */
13
14#ifndef __SSKIN__H__
15#define __SSKIN__H__
16
17#include <core/SSkinObjBase.h>
18#include <layout/SLayoutSize.h>
19#include <helper/SplitString.h>
20#include <matrix/SPoint.h>
21#include <sobject/Sobject.hpp>
22
23SNSBEGIN
24
25/**
26 * @class SSkinImgList
27 * @brief Image List Skin
28 *
29 * Description: Represents a skin that uses an image list to display different states.
30 */
31class SOUI_EXP SSkinImgList : public SSkinObjBase {
32 DEF_SOBJECT(SSkinObjBase, L"imglist")
33
34 public:
35 /**
36 * @brief Constructor for SSkinImgList.
37 */
39
40 /**
41 * @brief Destructor for SSkinImgList.
42 */
43 virtual ~SSkinImgList();
44
45 /**
46 * @brief Gets the size of the skin.
47 * @return Size of the skin.
48 */
49 STDMETHOD_(SIZE, GetSkinSize)(THIS) SCONST OVERRIDE;
50
51 /**
52 * @brief Gets the number of states in the skin.
53 * @return Number of states.
54 */
55 STDMETHOD_(int, GetStates)(THIS) SCONST OVERRIDE;
56
57 /**
58 * @brief Handles colorization of the skin.
59 * @param cr Color reference for colorization.
60 */
61 STDMETHOD_(void, OnColorize)(THIS_ COLORREF cr) OVERRIDE;
62
63 /**
64 * @brief Sets the number of states in the skin.
65 * @param nStates Number of states.
66 */
67 virtual void SetStates(int nStates)
68 {
69 m_nStates = nStates;
70 }
71
72 /**
73 * @brief Sets the image for the skin.
74 * @param pImg Pointer to the bitmap source.
75 * @return TRUE if successful, FALSE otherwise.
76 */
77 virtual bool SetImage(IBitmapS *pImg);
78
79 /**
80 * @brief Gets the image used by the skin.
81 * @return Pointer to the bitmap source.
82 */
83 virtual IBitmapS *GetImage() const;
84
85 /**
86 * @brief Sets whether the image should be tiled.
87 * @param bTile TRUE to tile the image, FALSE otherwise.
88 */
89 virtual void SetTile(BOOL bTile)
90 {
91 m_bTile = bTile;
92 }
93
94 /**
95 * @brief Checks if the image is tiled.
96 * @return TRUE if tiled, FALSE otherwise.
97 */
98 virtual BOOL IsTile() const
99 {
100 return m_bTile;
101 }
102
103 /**
104 * @brief Sets whether the images are arranged vertically.
105 * @param bVertical TRUE for vertical arrangement, FALSE for horizontal.
106 */
107 virtual void SetVertical(BOOL bVertical)
108 {
109 m_bVertical = bVertical;
110 }
111
112 /**
113 * @brief Checks if the images are arranged vertically.
114 * @return TRUE if vertical, FALSE otherwise.
115 */
116 virtual BOOL IsVertical() const
117 {
118 return m_bVertical;
119 }
120
121 protected:
122 /**
123 * @brief Gets the expand mode for the skin.
124 * @return Expand mode.
125 */
126 virtual UINT GetExpandMode() const;
127
128 protected:
129 /**
130 * @brief Called when initialization is finished.
131 * @param pNode Pointer to the XML node.
132 */
133 STDMETHOD_(void, OnInitFinished)(THIS_ IXmlNode *pNode) OVERRIDE;
134
135 /**
136 * @brief Draws the skin by index.
137 * @param pRT Pointer to the render target.
138 * @param rcDraw Rectangle to draw in.
139 * @param iState State index.
140 * @param byAlpha Alpha value for transparency.
141 */
142 void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const override;
143
144 /**
145 * @brief Scales the skin.
146 * @param skinObj Pointer to the skin object.
147 * @param nScale Scale factor.
148 */
149 void _Scale(ISkinObj *skinObj, int nScale) override;
150
151 protected:
152 int m_nStates; // Number of skin states
153 BOOL m_bTile; // Flag to indicate if the image is tiled
154 BOOL m_bAutoFit; // Flag to indicate if the image should auto-fit
155 BOOL m_bVertical; // Flag to indicate if images are arranged vertically
156 SAutoRefPtr<IBitmapS> m_imgBackup; // Backup of the image before colorization
157 FilterLevel m_filterLevel; // Filter level for image scaling
158
159 protected:
160 mutable SAutoRefPtr<IBitmapS> m_pImg; // Pointer to the bitmap source
161 mutable SStringW m_strSrc; // Source string for the image
162 BOOL m_bLazyLoad; // Flag to indicate lazy loading
163
164 protected:
165 /**
166 * @brief Handles the 'src' attribute.
167 * @param value Source string.
168 * @param bLoading TRUE if loading, FALSE otherwise.
169 * @return Result of the attribute handling.
170 */
171 HRESULT OnAttrSrc(const SStringW &value, BOOL bLoading);
172
173 SOUI_ATTRS_BEGIN()
174 ATTR_CUSTOM(L"src", OnAttrSrc)
175 ATTR_BOOL(L"tile", m_bTile, FALSE) // Draw whether to tile, 0--stretch (default), other--tile
176 ATTR_BOOL(L"autoFit", m_bAutoFit, FALSE) // autoFit is 0, do not automatically fit to drawing area
177 ATTR_BOOL(L"vertical", m_bVertical, FALSE) // Sub-images are vertically arranged, 0--horizontal (default), other--vertical
178 ATTR_INT(L"states", m_nStates, FALSE) // Number of sub-images, default is 1
179 ATTR_BOOL(L"lazyLoad", m_bLazyLoad, FALSE)
180 ATTR_ENUM_BEGIN(L"filterLevel", FilterLevel, FALSE)
181 ATTR_ENUM_VALUE(L"none", kNone_FilterLevel)
182 ATTR_ENUM_VALUE(L"low", kLow_FilterLevel)
183 ATTR_ENUM_VALUE(L"medium", kMedium_FilterLevel)
184 ATTR_ENUM_VALUE(L"high", kHigh_FilterLevel)
185 ATTR_ENUM_END(m_filterLevel)
186 SOUI_ATTRS_END()
187};
188
189/**
190 * @class SSkinImgCenter
191 * @brief Centered Image Skin
192 *
193 * Description: Represents a skin that centers an image within the drawing area.
194 */
195class SOUI_EXP SSkinImgCenter : public SSkinImgList {
196 DEF_SOBJECT(SSkinImgList, L"imgCenter")
197
198 public:
199 /**
200 * @brief Constructor for SSkinImgCenter.
201 */
203 {
204 }
205
206 protected:
207 /**
208 * @brief Draws the skin by index.
209 * @param pRT Pointer to the render target.
210 * @param rcDraw Rectangle to draw in.
211 * @param iState State index.
212 * @param byAlpha Alpha value for transparency.
213 */
214 void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const override;
215};
216
217/**
218 * @class SSkinImgFrame
219 * @brief Image Frame Skin
220 *
221 * Description: Represents a skin that uses an image frame with margins.
222 */
223class SOUI_EXP SSkinImgFrame : public SSkinImgList {
224 DEF_SOBJECT(SSkinImgList, L"imgframe")
225
226 public:
227 /**
228 * @brief Constructor for SSkinImgFrame.
229 */
231
232 /**
233 * @brief Sets the margins for the image frame.
234 * @param rcMargin Margin rectangle.
235 */
236 void SetMargin(const CRect rcMargin)
237 {
238 m_rcMargin = rcMargin;
239 }
240
241 /**
242 * @brief Gets the margins for the image frame.
243 * @return Margin rectangle.
244 */
245 CRect GetMargin()
246 {
247 return m_rcMargin;
248 }
249
250 protected:
251 /**
252 * @brief Gets the expand mode for the skin.
253 * @return Expand mode.
254 */
255 UINT GetExpandMode() const override;
256
257 /**
258 * @brief Scales the skin.
259 * @param skinObj Pointer to the skin object.
260 * @param nScale Scale factor.
261 */
262 void _Scale(ISkinObj *skinObj, int nScale) override;
263
264 /**
265 * @brief Draws the skin by index.
266 * @param pRT Pointer to the render target.
267 * @param rcDraw Rectangle to draw in.
268 * @param iState State index.
269 * @param byAlpha Alpha value for transparency.
270 */
271 void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const override;
272
273 protected:
274 CRect m_rcMargin; // Margin rectangle for the image frame
275
276 SOUI_ATTRS_BEGIN()
277 ATTR_RECT(L"margin", m_rcMargin, FALSE) // Nine-grid margins
278 ATTR_INT(L"left", m_rcMargin.left, FALSE) // Left margin of the nine-grid
279 ATTR_INT(L"top", m_rcMargin.top, FALSE) // Top margin of the nine-grid
280 ATTR_INT(L"right", m_rcMargin.right, FALSE) // Right margin of the nine-grid
281 ATTR_INT(L"bottom", m_rcMargin.bottom, FALSE) // Bottom margin of the nine-grid
282 ATTR_INT(L"margin-x", m_rcMargin.left = m_rcMargin.right, FALSE) // Left and right margins of the nine-grid
283 ATTR_INT(L"margin-y", m_rcMargin.top = m_rcMargin.bottom, FALSE) // Top and bottom margins of the nine-grid
284 ATTR_MARGIN(L"margin2", m_rcMargin, FALSE)
285 SOUI_ATTRS_END()
286};
287
288/**
289 * @class SSkinImgFrame2
290 * @brief Enhanced Image Frame Skin
291 *
292 * Description: Represents an enhanced image frame skin that supports loading Android .9 patches.
293 */
294class SOUI_EXP SSkinImgFrame2 : public SSkinImgFrame {
295 DEF_SOBJECT(SSkinImgFrame, L"imgframe2")
296
297 public:
298 SOUI_ATTRS_BEGIN()
299 ATTR_CUSTOM(L"src", OnAttrSrc)
300 SOUI_ATTRS_END()
301
302 protected:
303 /**
304 * @brief Handles the 'src' attribute.
305 * @param strValue Source string.
306 * @param bLoading TRUE if loading, FALSE otherwise.
307 * @return Result of the attribute handling.
308 */
309 HRESULT OnAttrSrc(const SStringW &strValue, BOOL bLoading);
310};
311
312/**
313 * @class SSkinButton
314 * @brief Button Skin
315 *
316 * Description: Represents a skin for buttons with different states and colors.
317 */
318class SOUI_EXP SSkinButton : public SSkinObjBase {
319 DEF_SOBJECT(SSkinObjBase, L"button")
320
321 enum
322 {
323 ST_NORMAL = 0,
324 ST_HOVER,
325 ST_PUSHDOWN,
326 ST_DISABLE,
327 };
328
329 struct BTNCOLORS
330 {
331 COLORREF m_crBorder[4];
332 COLORREF m_crUp[4];
333 COLORREF m_crDown[4];
334 };
335
336 public:
337 /**
338 * @brief Constructor for SSkinButton.
339 */
340 SSkinButton();
341
342 /**
343 * @brief Gets the number of states in the skin.
344 * @return Number of states.
345 */
346 STDMETHOD_(int, GetStates)(THIS) SCONST OVERRIDE;
347
348 /**
349 * @brief Scales the skin.
350 * @param nScale Scale factor.
351 * @return Pointer to the scaled skin object.
352 */
353 STDMETHOD_(ISkinObj *, Scale)(THIS_ int nScale) OVERRIDE;
354
355 /**
356 * @brief Handles colorization of the skin.
357 * @param cr Color reference for colorization.
358 */
359 STDMETHOD_(void, OnColorize)(THIS_ COLORREF cr) OVERRIDE;
360
361 /**
362 * @brief Sets the colors for different button states.
363 * @param crUp Colors for the up state.
364 * @param crDown Colors for the down state.
365 * @param crBorder Colors for the border.
366 */
367 void SetColors(COLORREF crUp[4], COLORREF crDown[4], COLORREF crBorder[4]);
368
369 protected:
370 /**
371 * @brief Draws the skin by index.
372 * @param pRT Pointer to the render target.
373 * @param rcDraw Rectangle to draw in.
374 * @param iState State index.
375 * @param byAlpha Alpha value for transparency.
376 */
377 void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const override;
378
379 protected:
380 BTNCOLORS m_colors; // Colors for different states
381 BTNCOLORS m_colorsBackup; // Backup of colors before colorization
382
383 int m_nCornerRadius; // Corner radius
384 float m_fCornerPercent; // Corner percentage (0.5 for semi-circle)
385
386 SOUI_ATTRS_BEGIN()
387 ATTR_COLOR(L"colorBorder", m_colors.m_crBorder[0], TRUE) // Normal border color
388 ATTR_COLOR(L"colorBorderHover", m_colors.m_crBorder[1], TRUE) // Hover border color
389 ATTR_COLOR(L"colorBorderPush", m_colors.m_crBorder[2], TRUE) // Pushed border color
390 ATTR_COLOR(L"colorBorderDisable", m_colors.m_crBorder[3], TRUE) // Disabled border color
391 ATTR_COLOR(L"colorUp", m_colors.m_crUp[ST_NORMAL], TRUE) // Normal up color
392 ATTR_COLOR(L"colorDown", m_colors.m_crDown[ST_NORMAL], TRUE) // Normal down color
393 ATTR_COLOR(L"colorUpHover", m_colors.m_crUp[ST_HOVER], TRUE) // Hover up color
394 ATTR_COLOR(L"colorDownHover", m_colors.m_crDown[ST_HOVER], TRUE) // Hover down color
395 ATTR_COLOR(L"colorUpPush", m_colors.m_crUp[ST_PUSHDOWN], TRUE) // Pushed up color
396 ATTR_COLOR(L"colorDownPush", m_colors.m_crDown[ST_PUSHDOWN], TRUE) // Pushed down color
397 ATTR_COLOR(L"colorUpDisable", m_colors.m_crUp[ST_DISABLE], TRUE) // Disabled up color
398 ATTR_COLOR(L"colorDownDisable", m_colors.m_crDown[ST_DISABLE], TRUE) // Disabled down color
399 ATTR_INT(L"cornerRadius", m_nCornerRadius, TRUE) // Corner radius
400 ATTR_FLOAT(L"cornerPercent", m_fCornerPercent, TRUE) // Corner percentage (0.5 for semi-circle)
401 SOUI_ATTRS_END()
402};
403
404/**
405 * @class SSkinGradation
406 * @brief Gradient Skin
407 *
408 * Description: Represents a skin with a gradient fill.
409 */
410class SOUI_EXP SSkinGradation : public SSkinObjBase {
411 DEF_SOBJECT(SSkinObjBase, L"gradation")
412
413 public:
414 /**
415 * @brief Constructor for SSkinGradation.
416 */
418
419 /**
420 * @brief Sets the starting color of the gradient.
421 * @param crFrom Starting color.
422 */
423 void SetColorFrom(COLORREF crFrom)
424 {
425 m_crFrom = crFrom;
426 }
427
428 /**
429 * @brief Sets the ending color of the gradient.
430 * @param crTo Ending color.
431 */
432 void SetColorTo(COLORREF crTo)
433 {
434 m_crTo = crTo;
435 }
436
437 /**
438 * @brief Sets whether the gradient is vertical.
439 * @param bVertical TRUE for vertical, FALSE for horizontal.
440 */
441 void SetVertical(BOOL bVertical)
442 {
443 m_bVert = bVertical;
444 }
445
446 public:
447 /**
448 * @brief Scales the skin.
449 * @param nScale Scale factor.
450 * @return Pointer to the scaled skin object.
451 */
452 STDMETHOD_(ISkinObj *, Scale)(THIS_ int nScale) OVERRIDE;
453
454 protected:
455 /**
456 * @brief Draws the skin by index.
457 * @param pRT Pointer to the render target.
458 * @param prcDraw Rectangle to draw in.
459 * @param iState State index.
460 * @param byAlpha Alpha value for transparency.
461 */
462 void _DrawByIndex(IRenderTarget *pRT, LPCRECT prcDraw, int iState, BYTE byAlpha) const override;
463
464 protected:
465 COLORREF m_crFrom; // Starting color of the gradient
466 COLORREF m_crTo; // Ending color of the gradient
467 BOOL m_bVert; // Flag to indicate if the gradient is vertical
468
469 SOUI_ATTRS_BEGIN()
470 ATTR_COLOR(L"colorFrom", m_crFrom, TRUE) // Starting color of the gradient
471 ATTR_COLOR(L"colorTo", m_crTo, TRUE) // Ending color of the gradient
472 ATTR_BOOL(L"vertical", m_bVert, TRUE) // Gradient direction, 0--horizontal, 1--vertical (default)
473 SOUI_ATTRS_END()
474};
475
476/**
477 * @class SGradientDesc
478 * @brief Gradient Descriptor
479 *
480 * Description: Describes a gradient for use in skins.
481 */
482class SOUI_EXP SGradientDesc {
483 public:
484 /**
485 * @brief Constructor for SGradientDesc.
486 */
488
489 protected:
490 SAutoRefPtr<IGradient> m_gradient; // Pointer to the gradient object
491 SLayoutSize m_radius; // Radius for radial gradients
492 float m_ratio_radius; // Ratio radius for radial gradients
493 GradientType m_type; // Type of gradient (linear, radial, sweep)
494 float m_angle; // Angle for linear gradients
495 float m_centerX; // Center X for radial and sweep gradients
496 float m_centerY; // Center Y for radial and sweep gradients
497 BOOL m_bFullArc; // Flag to indicate full arc for sweep gradients
498
499 public:
500 /**
501 * @brief Gets the gradient information.
502 * @param nScale Scale factor.
503 * @param wid Width of the drawing area.
504 * @param hei Height of the drawing area.
505 * @return Gradient information.
506 */
507 GradientInfo GetGradientInfo(int nScale, int wid, int hei) const;
508
509 /**
510 * @brief Gets the gradient object.
511 * @return Pointer to the gradient object.
512 */
513 IGradient *GetGradient()
514 {
515 return m_gradient;
516 }
517
518 protected:
519 SOUI_ATTRS_BEGIN()
520 ATTR_ENUM_BEGIN(L"type", GradientType, TRUE)
521 ATTR_ENUM_VALUE(L"linear", linear)
522 ATTR_ENUM_VALUE(L"radial", radial)
523 ATTR_ENUM_VALUE(L"sweep", sweep)
524 ATTR_ENUM_END(m_type)
525 ATTR_LAYOUTSIZE(L"radius", m_radius, TRUE)
526 ATTR_FLOAT(L"ratio_radius", m_ratio_radius, TRUE)
527 ATTR_FLOAT(L"angle", m_angle, TRUE)
528 ATTR_FLOAT(L"centerX", m_centerX, TRUE)
529 ATTR_FLOAT(L"centerY", m_centerY, TRUE)
530 ATTR_BOOL(L"fullArc", m_bFullArc, TRUE)
531 ATTR_GRADIENT(L"gradient", m_gradient, TRUE)
532 ATTR_CHAIN_PTR(m_gradient, 0)
533 SOUI_ATTRS_BREAK()
534};
535
536/**
537 * @class SSkinGradation2
538 * @brief Enhanced Gradient Skin
539 *
540 * Description: Represents an enhanced gradient skin that includes additional corner attributes.
541 */
542class SOUI_EXP SSkinGradation2
543 : public SSkinObjBase
544 , public SGradientDesc {
545 DEF_SOBJECT(SSkinObjBase, L"gradation2")
546
547 public:
548 /**
549 * @brief Constructor for SSkinGradation2.
550 */
552
553 public:
554 /**
555 * @brief Scales the skin.
556 * @param nScale Scale factor.
557 * @return Pointer to the scaled skin object.
558 */
559 STDMETHOD_(ISkinObj *, Scale)(THIS_ int nScale) OVERRIDE;
560
561 /**
562 * @brief Called when initialization is finished.
563 * @param xmlNode Pointer to the XML node.
564 */
565 STDMETHOD_(void, OnInitFinished)(THIS_ IXmlNode *xmlNode) OVERRIDE;
566
567 protected:
568 /**
569 * @brief Draws the skin by index.
570 * @param pRT Pointer to the render target.
571 * @param prcDraw Rectangle to draw in.
572 * @param iState State index.
573 * @param byAlpha Alpha value for transparency.
574 */
575 void _DrawByIndex(IRenderTarget *pRT, LPCRECT prcDraw, int iState, BYTE byAlpha) const override;
576
577 protected:
578 SPoint m_ptCorner; // Corner point for gradient
579 SLayoutSize m_szCorner[2]; // Corner sizes
580
581 public:
582 SOUI_ATTRS_BEGIN()
583 ATTR_SPOINT(L"ratio_corners", m_ptCorner, TRUE)
584 ATTR_LAYOUTSIZE2(L"corners", m_szCorner, TRUE)
585 ATTR_CHAIN_CLASS(SGradientDesc)
586 SOUI_ATTRS_END()
587};
588
589/**
590 * @enum SBSTATE
591 * @brief Scrollbar State Enum
592 *
593 * Description: Defines the states for a scrollbar.
594 */
596{
597 SBST_NORMAL = 0, // Normal state
598 SBST_HOVER, // Hover state
599 SBST_PUSHDOWN, // Pushed down state
600 SBST_DISABLE, // Disabled state
601 SBST_INACTIVE, // Inactive state, mainly for arrow heads
602};
603
604/**
605 * @def MAKESBSTATE(sbCode, nState1, bVertical)
606 * @brief Macro to create a scrollbar state code.
607 * @param sbCode Scrollbar code.
608 * @param nState1 State identifier.
609 * @param bVertical TRUE for vertical, FALSE for horizontal.
610 */
611#define MAKESBSTATE(sbCode, nState1, bVertical) MAKELONG((sbCode), MAKEWORD((nState1), (bVertical)))
612
613/**
614 * @def SB_CORNOR
615 * @brief Constant for scrollbar corner.
616 */
617#define SB_CORNOR 10
618
619/**
620 * @def SB_THUMBGRIPPER
621 * @brief Constant for scrollbar thumb gripper.
622 */
623#define SB_THUMBGRIPPER 11 // Scrollbar thumb gripper
624
625/**
626 * @def THUMB_MINSIZE
627 * @brief Minimum size for the scrollbar thumb.
628 */
629#define THUMB_MINSIZE 18
630
631/**
632 * @class SSkinScrollbar
633 * @brief Scrollbar Skin
634 *
635 * Description: Represents a skin for scrollbars.
636 */
637class SOUI_EXP SSkinScrollbar : public SSkinImgList {
638 DEF_SOBJECT(SSkinImgList, L"scrollbar")
639
640 public:
641 /**
642 * @brief Constructor for SSkinScrollbar.
643 */
645
646 /**
647 * @brief Checks if the scrollbar supports displaying arrow heads.
648 * @return TRUE if supported, FALSE otherwise.
649 */
650 virtual BOOL HasArrow() const
651 {
652 return TRUE;
653 }
654
655 /**
656 * @brief Gets the ideal size of the scrollbar.
657 * @return Ideal size of the scrollbar.
658 */
659 virtual int GetIdealSize() const;
660
661 protected:
662 /**
663 * @brief Gets the rectangle of a specified part in the original bitmap.
664 * @param nSbCode Scrollbar code.
665 * @param nState State identifier.
666 * @param bVertical TRUE for vertical, FALSE for horizontal.
667 * @return Rectangle of the part.
668 */
669 virtual CRect GetPartRect(int nSbCode, int nState, BOOL bVertical) const;
670
671 protected:
672 /**
673 * @brief Draws the skin by index.
674 * @param pRT Pointer to the render target.
675 * @param prcDraw Rectangle to draw in.
676 * @param iState State index.
677 * @param byAlpha Alpha value for transparency.
678 */
679 void _DrawByIndex(IRenderTarget *pRT, LPCRECT prcDraw, int iState, BYTE byAlpha) const override
680 {
681 }
682
683 /**
684 * @brief Draws the skin by state.
685 * @param pRT Pointer to the render target.
686 * @param prcDraw Rectangle to draw in.
687 * @param dwState State identifier.
688 * @param byAlpha Alpha value for transparency.
689 */
690 void _DrawByState(IRenderTarget *pRT, LPCRECT prcDraw, DWORD dwState, BYTE byAlpha) const override;
691
692 /**
693 * @brief Scales the skin.
694 * @param skinObj Pointer to the skin object.
695 * @param nScale Scale factor.
696 */
697 void _Scale(ISkinObj *skinObj, int nScale) override;
698
699 protected:
700 int m_nMargin; // Margin size
701 BOOL m_bHasGripper; // Flag to indicate if the thumb has a gripper
702 BOOL m_bHasInactive; // Flag to indicate if there is an inactive state for arrow heads
703
704 SOUI_ATTRS_BEGIN()
705 ATTR_INT(L"margin", m_nMargin, FALSE) // Edge stretch size
706 ATTR_INT(L"hasGripper", m_bHasGripper, FALSE) // Thumb has gripper
707 ATTR_INT(L"hasInactive", m_bHasInactive, FALSE) // Has inactive state
708 SOUI_ATTRS_END()
709};
710
711//////////////////////////////////////////////////////////////////////////
712/**
713 * @class SSkinColorRect
714 * @brief Color Rectangle Skin
715 *
716 * Description: Represents a skin for a colored rectangle with optional borders.
717 */
718class SOUI_EXP SSkinColorRect : public SSkinObjBase {
719 DEF_SOBJECT(SSkinObjBase, L"colorrect")
720
721 public:
722 /**
723 * @brief Constructor for SSkinColorRect.
724 */
726
727 /**
728 * @brief Destructor for SSkinColorRect.
729 */
730 virtual ~SSkinColorRect();
731
732 /**
733 * @brief Gets the number of states in the skin.
734 * @return Number of states.
735 */
736 STDMETHOD_(int, GetStates)(THIS) SCONST OVERRIDE;
737
738 /**
739 * @brief Scales the skin.
740 * @param nScale Scale factor.
741 * @return Pointer to the scaled skin object.
742 */
743 STDMETHOD_(ISkinObj *, Scale)(THIS_ int nScale) OVERRIDE;
744
745 protected:
746 /**
747 * @brief Draws the skin by index.
748 * @param pRT Pointer to the render target.
749 * @param prcDraw Rectangle to draw in.
750 * @param iState State index.
751 * @param byAlpha Alpha value for transparency.
752 */
753 void _DrawByIndex(IRenderTarget *pRT, LPCRECT prcDraw, int iState, BYTE byAlpha) const override;
754
755 protected:
756 int m_nRadius; // Corner radius
757 float m_fCornerPercent; // Corner percentage (0.5 for semi-circle)
758
759 COLORREF m_crStates[4]; // Colors for different states
760 COLORREF m_crBorders[4]; // Border colors for different states
761 int m_nBorderWidth; // Border width
762
763 SOUI_ATTRS_BEGIN()
764 ATTR_COLOR(L"normal", m_crStates[0], FALSE) // Normal state color
765 ATTR_COLOR(L"hover", m_crStates[1], FALSE) // Hover state color
766 ATTR_COLOR(L"pushdown", m_crStates[2], FALSE) // Pushed down state color
767 ATTR_COLOR(L"disable", m_crStates[3], FALSE) // Disabled state color
768 ATTR_COLOR(L"normalBorder", m_crBorders[0], FALSE) // Normal state border color
769 ATTR_COLOR(L"hoverBorder", m_crBorders[1], FALSE) // Hover state border color
770 ATTR_COLOR(L"pushdownBorder", m_crBorders[2], FALSE) // Pushed down state border color
771 ATTR_COLOR(L"disableBorder", m_crBorders[3], FALSE) // Disabled state border color
772 ATTR_INT(L"borderWidth", m_nBorderWidth, FALSE) // Border width
773 ATTR_INT(L"cornerRadius", m_nRadius, FALSE) // Corner radius
774 ATTR_FLOAT(L"cornerPercent", m_fCornerPercent, FALSE) // Corner percentage (0.5 for semi-circle)
775 SOUI_ATTRS_END()
776};
777//////////////////////////////////////////////////////////////////////////
778
779class SOUI_EXP SSkinShape : public SSkinObjBase {
780 DEF_SOBJECT(SSkinObjBase, L"shape")
781 enum Shape
782 {
783 rectangle,
784 oval,
785 ring
786 };
787
788 /**
789 * @class SShapeSolid
790 * @brief Solid Shape
791 *
792 * Description: Represents a solid-colored shape.
793 */
794 class SShapeSolid : public TObjRefImpl<SObject> {
795 DEF_SOBJECT(TObjRefImpl<SObject>, L"solid")
796
797 public:
798 /**
799 * @brief Constructor for SShapeSolid.
800 */
801 SShapeSolid()
802 : m_crSolid(CR_INVALID)
803 {
804 }
805
806 SOUI_ATTRS_BEGIN()
807 ATTR_COLOR(L"color", m_crSolid, TRUE) // Solid color
808 SOUI_ATTRS_END()
809
810 /**
811 * @brief Creates a brush for rendering.
812 * @param pRT Pointer to the render target.
813 * @param byAlpha Alpha value for transparency.
814 * @return Pointer to the brush.
815 */
816 IBrushS *CreateBrush(IRenderTarget *pRT, BYTE byAlpha);
817
818 protected:
819 COLORREF m_crSolid; // Solid color
820 };
821
822 /**
823 * @class SShapeBitmap
824 * @brief Bitmap Shape
825 *
826 * Description: Represents a shape filled with a bitmap.
827 */
828 class SShapeBitmap : public TObjRefImpl<SObject> {
829 DEF_SOBJECT(TObjRefImpl<SObject>, L"bitmap")
830
831 public:
832 /**
833 * @brief Constructor for SShapeBitmap.
834 */
835 SShapeBitmap()
836 : m_tileX(kRepeat_TileMode)
837 , m_tileY(kRepeat_TileMode)
838 {
839 }
840
841 SOUI_ATTRS_BEGIN()
842 ATTR_IMAGEAUTOREF(L"src", m_pImg, TRUE) // Bitmap source
843 ATTR_ENUM_BEGIN(L"tileX", TileMode, TRUE)
844 ATTR_ENUM_VALUE(L"clamp", kClamp_TileMode)
845 ATTR_ENUM_VALUE(L"repeat", kRepeat_TileMode)
846 ATTR_ENUM_VALUE(L"mirror", kMirror_TileMode)
847 ATTR_ENUM_END(m_tileX)
848 ATTR_ENUM_BEGIN(L"tileY", TileMode, TRUE)
849 ATTR_ENUM_VALUE(L"clamp", kClamp_TileMode)
850 ATTR_ENUM_VALUE(L"repeat", kRepeat_TileMode)
851 ATTR_ENUM_VALUE(L"mirror", kMirror_TileMode)
852 ATTR_ENUM_END(m_tileY)
853 SOUI_ATTRS_END()
854
855 /**
856 * @brief Creates a brush for rendering.
857 * @param pRT Pointer to the render target.
858 * @param byAlpha Alpha value for transparency.
859 * @return Pointer to the brush.
860 */
861 IBrushS *CreateBrush(IRenderTarget *pRT, BYTE byAlpha);
862
863 protected:
864 SAutoRefPtr<IBitmapS> m_pImg; // Bitmap source
865 TileMode m_tileX, m_tileY; // Tiling modes for X and Y
866 };
867
868 /**
869 * @class SGradientBrush
870 * @brief Gradient Brush
871 *
872 * Description: Represents a brush with a gradient fill.
873 */
874 class SGradientBrush
875 : public TObjRefImpl<SObject>
876 , public SGradientDesc {
877 DEF_SOBJECT(TObjRefImpl<SObject>, L"gradient")
878
879 public:
880 /**
881 * @brief Constructor for SGradientBrush.
882 */
883 SGradientBrush()
884 {
885 }
886
887 /**
888 * @brief Creates a brush for rendering.
889 * @param pRT Pointer to the render target.
890 * @param nScale Scale factor.
891 * @param byAlpha Alpha value for transparency.
892 * @param wid Width of the drawing area.
893 * @param hei Height of the drawing area.
894 * @return Pointer to the brush.
895 */
896 IBrushS *CreateBrush(IRenderTarget *pRT, int nScale, BYTE byAlpha, int wid, int hei) const;
897
898 /**
899 * @brief Called when initialization is finished.
900 * @param xmlNode Pointer to the XML node.
901 */
902 STDMETHOD_(void, OnInitFinished)(THIS_ IXmlNode *xmlNode) override;
903
904 public:
905 SOUI_ATTRS_BEGIN()
906 ATTR_CHAIN_CLASS(SGradientDesc)
907 SOUI_ATTRS_END()
908 };
909
910 /**
911 * @class SStroke
912 * @brief Stroke Shape
913 *
914 * Description: Represents a stroke (outline) for shapes.
915 */
916 class SStroke : public TObjRefImpl<SObject> {
917 DEF_SOBJECT(TObjRefImpl<SObject>, L"stroke")
918
919 public:
920 /**
921 * @brief Constructor for SStroke.
922 */
923 SStroke();
924
925 SOUI_ATTRS_BEGIN()
926 ATTR_LAYOUTSIZE(L"width", m_width, TRUE) // Stroke width
927 ATTR_COLOR(L"color", m_color, TRUE) // Stroke color
928 ATTR_ENUM_BEGIN(L"style", int, TRUE)
929 ATTR_ENUM_VALUE(L"solid", PS_SOLID)
930 ATTR_ENUM_VALUE(L"dash", PS_DASH)
931 ATTR_ENUM_VALUE(L"dashDot", PS_DASHDOT)
932 ATTR_ENUM_VALUE(L"dashDotDot", PS_DASHDOTDOT)
933 ATTR_ENUM_END(m_style)
934 ATTR_ENUM_BEGIN(L"endStyle", int, TRUE)
935 ATTR_ENUM_VALUE(L"flat", PS_ENDCAP_FLAT)
936 ATTR_ENUM_VALUE(L"round", PS_ENDCAP_ROUND)
937 ATTR_ENUM_VALUE(L"square", PS_ENDCAP_SQUARE)
938 ATTR_ENUM_END(m_endStyle)
939 ATTR_ENUM_BEGIN(L"joinStyle", int, TRUE)
940 ATTR_ENUM_VALUE(L"round", PS_JOIN_ROUND)
941 ATTR_ENUM_VALUE(L"bevel", PS_JOIN_BEVEL)
942 ATTR_ENUM_VALUE(L"miter", PS_JOIN_MITER)
943 ATTR_ENUM_END(m_joinStyle)
944 SOUI_ATTRS_END()
945
946 public:
947 SLayoutSize m_width; // Stroke width
948 COLORREF m_color; // Stroke color
949
950 /**
951 * @brief Gets the style of the stroke.
952 * @return Stroke style.
953 */
954 int GetStyle() const;
955
956 private:
957 int m_style; // Line style
958 int m_endStyle; // End cap style
959 int m_joinStyle; // Join style
960 };
961
962 /**
963 * @class SCornerSize
964 * @brief Represents the corner size for shapes.
965 *
966 * This class defines the corner radius for shapes, allowing customization of
967 * the X and Y dimensions independently. It supports scaling based on layout size.
968 */
969 class SCornerSize : public TObjRefImpl<SObject> {
970 DEF_SOBJECT(TObjRefImpl<SObject>, L"corners")
971
972 public:
973 /**
974 * @brief Handles the 'radius' attribute.
975 * @param strValue The value of the 'radius' attribute.
976 * @param bLoading TRUE if loading, FALSE otherwise.
977 * @return HRESULT indicating success or failure.
978 */
979 HRESULT OnAttrRadius(const SStringW strValue, BOOL bLoading);
980
981 SOUI_ATTRS_BEGIN()
982 ATTR_CUSTOM(L"radius", OnAttrRadius) // Custom handling for 'radius' attribute.
983 ATTR_LAYOUTSIZE(L"radiusX", m_radiusX, TRUE) // X-axis radius.
984 ATTR_LAYOUTSIZE(L"radiusY", m_radiusY, TRUE) // Y-axis radius.
985 SOUI_ATTRS_END()
986
987 /**
988 * @brief Gets the corner point in pixel coordinates.
989 * @param nScale Scale factor for layout size conversion.
990 * @return POINT representing the corner size in pixels.
991 */
992 POINT GetConner(int nScale) const
993 {
994 return CPoint(m_radiusX.toPixelSize(nScale), m_radiusY.toPixelSize(nScale));
995 }
996
997 protected:
998 SLayoutSize m_radiusX, m_radiusY; // Layout sizes for X and Y radii.
999 };
1000
1001 /**
1002 * @class SRatioCornerSize
1003 * @brief Represents the ratio-based corner size for shapes.
1004 *
1005 * This class defines the corner radius as a ratio of the shape's dimensions,
1006 * allowing dynamic sizing based on the shape's width and height.
1007 */
1008 class SRatioCornerSize : public TObjRefImpl<SObject> {
1009 DEF_SOBJECT(TObjRefImpl<SObject>, L"ratio_corners")
1010
1011 public:
1012 /**
1013 * @brief Constructor initializes the ratio values to 0.
1014 */
1015 SRatioCornerSize()
1016 {
1017 m_radius.fX = m_radius.fY = 0.0f;
1018 }
1019
1020 /**
1021 * @brief Handles the 'radius' attribute.
1022 * @param strValue The value of the 'radius' attribute.
1023 * @param bLoading TRUE if loading, FALSE otherwise.
1024 * @return HRESULT indicating success or failure.
1025 */
1026 HRESULT OnAttrRadius(const SStringW strValue, BOOL bLoading);
1027
1028 SOUI_ATTRS_BEGIN()
1029 ATTR_CUSTOM(L"radius", OnAttrRadius) // Custom handling for 'radius' attribute.
1030 ATTR_FLOAT(L"radiusX", m_radius.fX, TRUE) // Ratio for X-axis radius.
1031 ATTR_FLOAT(L"radiusY", m_radius.fY, TRUE) // Ratio for Y-axis radius.
1032 SOUI_ATTRS_END()
1033
1034 /**
1035 * @brief Gets the corner point based on the shape's dimensions.
1036 * @param rc The rectangle defining the shape's dimensions.
1037 * @return POINT representing the corner size based on ratios.
1038 */
1039 POINT GetConner(const CRect &rc) const
1040 {
1041 return CPoint((int)(rc.Width() / 2 * m_radius.fX), (int)(rc.Height() / 2 * m_radius.fY));
1042 }
1043
1044 protected:
1045 SPoint m_radius; // Ratios for X and Y radii, ranging from [0,1].
1046 };
1047 /**
1048 * @class SShapeSize
1049 * @brief Represents the size of a shape.
1050 *
1051 * This class defines the width and height of a shape, supporting layout-based sizing.
1052 */
1053 class SShapeSize : public TObjRefImpl<SObject> {
1054 DEF_SOBJECT(TObjRefImpl<SObject>, L"size")
1055 friend class SSkinShape;
1056
1057 public:
1058 SOUI_ATTRS_BEGIN()
1059 ATTR_LAYOUTSIZE(L"width", m_width, TRUE) // Width of the shape.
1060 ATTR_LAYOUTSIZE(L"height", m_height, TRUE) // Height of the shape.
1061 SOUI_ATTRS_END()
1062 protected:
1063 SLayoutSize m_width, m_height; // Layout sizes for width and height.
1064 };
1065
1066 /**
1067 * @class SShapeRing
1068 * @brief Represents a ring shape.
1069 *
1070 * This class defines a ring shape with start and sweep angles for drawing arcs.
1071 */
1072 class SShapeRing : public TObjRefImpl<SObject> {
1073 DEF_SOBJECT(TObjRefImpl<SObject>, L"ring")
1074 friend class SSkinShape;
1075
1076 public:
1077 /**
1078 * @brief Constructor initializes the start and sweep angles.
1079 */
1080 SShapeRing()
1081 : m_startAngle(0.0f)
1082 , m_sweepAngle(360.0f)
1083 {
1084 }
1085
1086 SOUI_ATTRS_BEGIN()
1087 ATTR_FLOAT(L"startAngle", m_startAngle, TRUE) // Start angle of the ring.
1088 ATTR_FLOAT(L"sweepAngle", m_sweepAngle, TRUE) // Sweep angle of the ring.
1089 SOUI_ATTRS_END()
1090
1091 protected:
1092 float m_startAngle; // Start angle for the ring.
1093 float m_sweepAngle; // Sweep angle for the ring.
1094 };
1095
1096 public:
1097 SSkinShape();
1098
1099 STDMETHOD_(SIZE, GetSkinSize)(THIS) SCONST OVERRIDE;
1100 STDMETHOD_(int, GetStates)(THIS) SCONST OVERRIDE;
1101
1102 SOUI_ATTRS_BEGIN()
1103 ATTR_ENUM_BEGIN(L"shape", Shape, TRUE)
1104 ATTR_ENUM_VALUE(L"rectangle", rectangle)
1105 ATTR_ENUM_VALUE(L"oval", oval)
1106 ATTR_ENUM_VALUE(L"ring", ring)
1107 ATTR_ENUM_END(m_shape)
1108 SOUI_ATTRS_END()
1109 protected:
1110 STDMETHOD_(void, OnInitFinished)(THIS_ IXmlNode *pNode) OVERRIDE;
1111
1112 void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const override;
1113
1114 void _Scale(ISkinObj *pObj, int nScale) override;
1115 POINT GetCornerSize(const CRect &rc) const;
1116
1117 Shape m_shape;
1118
1119 SAutoRefPtr<SShapeSolid> m_solid;
1120 SAutoRefPtr<SShapeBitmap> m_bitmap;
1121 SAutoRefPtr<SGradientBrush> m_gradient;
1122 SAutoRefPtr<SShapeSize> m_shapeSize;
1123 SAutoRefPtr<SCornerSize> m_cornerSize;
1124 SAutoRefPtr<SRatioCornerSize> m_ratioCornerSize;
1125 SAutoRefPtr<SStroke> m_stroke;
1126 SAutoRefPtr<SShapeRing> m_ringParam;
1127};
1128
1129/**
1130 * @class SSKinGroup
1131 * @brief Represents a group of skins for different states.
1132 *
1133 * This class allows grouping multiple skins for normal, hover, pushdown, and disabled states.
1134 */
1135class SOUI_EXP SSKinGroup : public SSkinObjBase {
1136 DEF_SOBJECT(SSkinObjBase, L"group")
1137
1138 public:
1139 /**
1140 * @brief Gets the size of the skin group.
1141 * @return SIZE representing the skin group size.
1142 */
1143 STDMETHOD_(SIZE, GetSkinSize)(CTHIS) SCONST OVERRIDE;
1144
1145 /**
1146 * @brief Gets the number of states supported by the skin group.
1147 * @return int representing the number of states.
1148 */
1149 STDMETHOD_(int, GetStates)(CTHIS) SCONST OVERRIDE;
1150
1151 SOUI_ATTRS_BEGIN()
1152 ATTR_SKIN(L"normal", m_skins[0], FALSE) // Normal state skin.
1153 ATTR_SKIN(L"hover", m_skins[1], FALSE) // Hover state skin.
1154 ATTR_SKIN(L"pushDown", m_skins[2], FALSE) // Pushdown state skin.
1155 ATTR_SKIN(L"disable", m_skins[3], FALSE) // Disabled state skin.
1156 SOUI_ATTRS_END()
1157
1158 protected:
1159 /**
1160 * @brief Draws the skin group by index.
1161 * @param pRT Pointer to the render target.
1162 * @param rcDraw Rectangle to draw in.
1163 * @param iState State index.
1164 * @param byAlpha Alpha value for transparency.
1165 */
1166 void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const override;
1167
1168 /**
1169 * @brief Scales the skin group.
1170 * @param skinObj Pointer to the skin object.
1171 * @param nScale Scale factor.
1172 */
1173 void _Scale(ISkinObj *skinObj, int nScale) override;
1174
1175 protected:
1176 SAutoRefPtr<ISkinObj> m_skins[4]; // Array of skins for different states.
1177};
1178
1179SNSEND
1180#endif // __SSKIN__H__
SBSTATE
Scrollbar State Enum.
Definition SSkin.h:596
Smart pointer class for managing COM-style reference-counted objects.
SGradientDesc()
Constructor for SGradientDesc.
Definition SSkin.cpp:358
GradientInfo GetGradientInfo(int nScale, int wid, int hei) const
Gets the gradient information.
Definition SSkin.cpp:370
IGradient * GetGradient()
Gets the gradient object.
Definition SSkin.h:513
布局大小类
Definition SLayoutSize.h:10
Represents a group of skins for different states.
Definition SSkin.h:1135
void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const override
Draws the skin group by index.
Definition SSkin.cpp:893
int GetStates() SCONST OVERRIDE
Gets the number of states supported by the skin group.
Definition SSkin.cpp:888
SIZE GetSkinSize() SCONST OVERRIDE
Gets the size of the skin group.
Definition SSkin.cpp:903
void _Scale(ISkinObj *skinObj, int nScale) override
Scales the skin group.
Definition SSkin.cpp:913
void OnColorize(COLORREF cr) OVERRIDE
Handles colorization of the skin.
Definition SSkin.cpp:299
ISkinObj * Scale(int nScale) OVERRIDE
Scales the skin.
Definition SSkin.cpp:332
int GetStates() SCONST OVERRIDE
Gets the number of states in the skin.
Definition SSkin.cpp:287
SSkinButton()
Constructor for SSkinButton.
Definition SSkin.cpp:230
void SetColors(COLORREF crUp[4], COLORREF crDown[4], COLORREF crBorder[4])
Sets the colors for different button states.
Definition SSkin.cpp:292
SSkinColorRect()
Constructor for SSkinColorRect.
Definition SSkin.cpp:535
ISkinObj * Scale(int nScale) OVERRIDE
Scales the skin.
Definition SSkin.cpp:604
int GetStates() SCONST OVERRIDE
Gets the number of states in the skin.
Definition SSkin.cpp:591
ISkinObj * Scale(int nScale) OVERRIDE
Scales the skin.
Definition SSkin.cpp:424
SSkinGradation2()
Constructor for SSkinGradation2.
Definition SSkin.cpp:397
void OnInitFinished(IXmlNode *xmlNode) OVERRIDE
Called when initialization is finished.
Definition SSkin.cpp:429
void SetColorFrom(COLORREF crFrom)
Sets the starting color of the gradient.
Definition SSkin.h:423
void SetColorTo(COLORREF crTo)
Sets the ending color of the gradient.
Definition SSkin.h:432
SSkinGradation()
Constructor for SSkinGradation.
Definition SSkin.cpp:339
void SetVertical(BOOL bVertical)
Sets whether the gradient is vertical.
Definition SSkin.h:441
SSkinImgCenter()
Constructor for SSkinImgCenter.
Definition SSkin.h:202
Enhanced Image Frame Skin.
Definition SSkin.h:294
HRESULT OnAttrSrc(const SStringW &strValue, BOOL bLoading)
Handles the 'src' attribute.
Definition SSkin.cpp:928
SSkinImgFrame()
Constructor for SSkinImgFrame.
Definition SSkin.cpp:194
void SetMargin(const CRect rcMargin)
Sets the margins for the image frame.
Definition SSkin.h:236
CRect GetMargin()
Gets the margins for the image frame.
Definition SSkin.h:245
virtual void SetVertical(BOOL bVertical)
Sets whether the images are arranged vertically.
Definition SSkin.h:107
virtual void SetStates(int nStates)
Sets the number of states in the skin.
Definition SSkin.h:67
SIZE GetSkinSize() SCONST OVERRIDE
Gets the size of the skin.
Definition SSkin.cpp:26
virtual BOOL IsVertical() const
Checks if the images are arranged vertically.
Definition SSkin.h:116
virtual void SetTile(BOOL bTile)
Sets whether the image should be tiled.
Definition SSkin.h:89
virtual BOOL IsTile() const
Checks if the image is tiled.
Definition SSkin.h:98
SSkinImgList()
Constructor for SSkinImgList.
Definition SSkin.cpp:12
void OnColorize(COLORREF cr) OVERRIDE
Handles colorization of the skin.
Definition SSkin.cpp:106
int GetStates() SCONST OVERRIDE
Gets the number of states in the skin.
Definition SSkin.cpp:38
Base class for skin objects.
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.
virtual void _Scale(ISkinObj *pObj, int nScale)
Scales the skin object.
SSkinObjBase()
Constructor.
virtual BOOL HasArrow() const
Checks if the scrollbar supports displaying arrow heads.
Definition SSkin.h:650
SSkinScrollbar()
Constructor for SSkinScrollbar.
Definition SSkin.cpp:436
void _DrawByIndex(IRenderTarget *pRT, LPCRECT prcDraw, int iState, BYTE byAlpha) const override
Draws the skin by index.
Definition SSkin.h:679
A class representing an ASCII string.
Definition sstringw.h:96
Bitmap object interface.
Definition SRender-i.h:420
Interface for rendering target objects.
Definition SRender-i.h:1440
Interface for Skin Objects.
Definition SSkinobj-i.h:29
Interface for XML nodes.
Definition sxml-i.h:128