ReactOS 0.4.15-dev-7958-gcd0bb1a
property.c File Reference
#include "uxthemep.h"
Include dependency graph for property.c:

Go to the source code of this file.

Functions

HRESULT WINAPI GetThemeBool (HTHEME hTheme, int iPartId, int iStateId, int iPropId, BOOL *pfVal)
 
HRESULT WINAPI GetThemeColor (HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF *pColor)
 
HRESULT WINAPI GetThemeEnumValue (HTHEME hTheme, int iPartId, int iStateId, int iPropId, int *piVal)
 
HRESULT WINAPI GetThemeFilename (HTHEME hTheme, int iPartId, int iStateId, int iPropId, LPWSTR pszThemeFilename, int cchMaxBuffChars)
 
HRESULT WINAPI GetThemeFont (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LOGFONTW *pFont)
 
HRESULT WINAPI GetThemeInt (HTHEME hTheme, int iPartId, int iStateId, int iPropId, int *piVal)
 
HRESULT WINAPI GetThemeIntList (HTHEME hTheme, int iPartId, int iStateId, int iPropId, INTLIST *pIntList)
 
HRESULT WINAPI GetThemePosition (HTHEME hTheme, int iPartId, int iStateId, int iPropId, POINT *pPoint)
 
HRESULT WINAPI GetThemeRect (HTHEME hTheme, int iPartId, int iStateId, int iPropId, RECT *pRect)
 
HRESULT WINAPI GetThemeString (HTHEME hTheme, int iPartId, int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars)
 
HRESULT WINAPI GetThemeMargins (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, RECT *prc, MARGINS *pMargins)
 
HRESULT WINAPI GetThemeMetric (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int *piVal)
 
HRESULT WINAPI GetThemePropertyOrigin (HTHEME hTheme, int iPartId, int iStateId, int iPropId, PROPERTYORIGIN *pOrigin)
 

Function Documentation

◆ GetThemeBool()

HRESULT WINAPI GetThemeBool ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
BOOL pfVal 
)

Definition at line 26 of file property.c.

28{
30 PTHEME_CLASS pClass = ValidateHandle(hTheme);
31
32 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
33
34 if(!pClass)
35 return E_HANDLE;
36
37 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, TMT_BOOL, iPropId)))
39 return MSSTYLES_GetPropertyBool(tp, pfVal);
40}
LPVOID FASTCALL ValidateHandle(HANDLE hObject, UINT uType)
Definition: utils.c:377
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2996
PTHEME_PROPERTY MSSTYLES_FindProperty(PTHEME_CLASS tc, int iPartId, int iStateId, int iPropertyPrimitive, int iPropertyId)
Definition: msstyles.c:835
HRESULT MSSTYLES_GetPropertyBool(PTHEME_PROPERTY tp, BOOL *pfVal)
Definition: msstyles.c:994
#define TRACE(s)
Definition: solgame.cpp:4
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
#define TMT_BOOL
Definition: vssym32.h:137
#define E_HANDLE
Definition: winerror.h:2850

Referenced by get_image_part_size(), and get_transparency().

◆ GetThemeColor()

HRESULT WINAPI GetThemeColor ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
COLORREF pColor 
)

Definition at line 45 of file property.c.

47{
49 PTHEME_CLASS pClass = ValidateHandle(hTheme);
50
51 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
52 if(!pClass)
53 return E_HANDLE;
54
55 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, TMT_COLOR, iPropId)))
57 return MSSTYLES_GetPropertyColor(tp, pColor);
58}
HRESULT MSSTYLES_GetPropertyColor(PTHEME_PROPERTY tp, COLORREF *pColor)
Definition: msstyles.c:1007
#define TMT_COLOR
Definition: vssym32.h:138

Referenced by DrawThemeText(), get_edge_color(), get_transparency(), IPADDRESS_Draw(), CTrayClockWnd::OnThemeChanged(), TOOLBAR_DrawButton(), TRACKBAR_DrawTics(), UXTHEME_DrawBackgroundFill(), and UXTHEME_DrawBorderRectangle().

◆ GetThemeEnumValue()

HRESULT WINAPI GetThemeEnumValue ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
int piVal 
)

Definition at line 63 of file property.c.

65{
66 HRESULT hr;
67 WCHAR val[60];
69 PTHEME_CLASS pClass = ValidateHandle(hTheme);
70
71 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
72 if(!pClass)
73 return E_HANDLE;
74
75 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, TMT_ENUM, iPropId)))
77
78 hr = MSSTYLES_GetPropertyString(tp, val, sizeof(val)/sizeof(val[0]));
79 if(FAILED(hr))
80 return hr;
81 if(!MSSTYLES_LookupEnum(val, iPropId, piVal))
83 return S_OK;
84}
GLuint GLfloat * val
Definition: glext.h:7180
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT MSSTYLES_GetPropertyString(PTHEME_PROPERTY tp, LPWSTR pszBuff, int cchMaxBuffChars)
Definition: msstyles.c:1151
HRESULT hr
Definition: shlfolder.c:183
BOOL MSSTYLES_LookupEnum(LPCWSTR pszValueName, int dwEnum, int *dwValue)
Definition: stylemap.c:1126
#define TMT_ENUM
Definition: uxthemep.h:32
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DrawThemeBackgroundEx(), DrawThemeText(), get_image_part_size(), GetThemeBackgroundContentRect(), GetThemeBackgroundExtent(), GetThemeBackgroundRegion(), GetThemePartSize(), IsThemeBackgroundPartiallyTransparent(), ThemeDrawCaptionText(), UXTHEME_DrawBackgroundFill(), UXTHEME_DrawGlyph(), UXTHEME_DrawImageBackground(), UXTHEME_DrawImageGlyph(), UXTHEME_LoadImage(), and UXTHEME_SelectImage().

◆ GetThemeFilename()

HRESULT WINAPI GetThemeFilename ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
LPWSTR  pszThemeFilename,
int  cchMaxBuffChars 
)

Definition at line 89 of file property.c.

92{
94 PTHEME_CLASS pClass = ValidateHandle(hTheme);
95
96 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
97 if(!pClass)
98 return E_HANDLE;
99
100 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, TMT_FILENAME, iPropId)))
102 return MSSTYLES_GetPropertyString(tp, pszThemeFilename, cchMaxBuffChars);
103}
#define TMT_FILENAME
Definition: vssym32.h:140

◆ GetThemeFont()

HRESULT WINAPI GetThemeFont ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
int  iPropId,
LOGFONTW pFont 
)

Definition at line 108 of file property.c.

110{
112 PTHEME_CLASS pClass = ValidateHandle(hTheme);
113
114 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
115 if(!pClass)
116 return E_HANDLE;
117
118 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, TMT_FONT, iPropId)))
120 return MSSTYLES_GetPropertyFont(tp, hdc, pFont);
121}
HDC hdc
Definition: main.c:9
HRESULT MSSTYLES_GetPropertyFont(PTHEME_PROPERTY tp, HDC hdc, LOGFONTW *pFont)
Definition: msstyles.c:1077
#define TMT_FONT
Definition: vssym32.h:144

Referenced by CB_ThemedPaint(), DrawNCPreview(), DrawThemeText(), GB_ThemedPaint(), CTipbarThread::GetTextSize(), GetThemeTextExtent(), GetThemeTextMetrics(), and CTrayClockWnd::OnThemeChanged().

◆ GetThemeInt()

HRESULT WINAPI GetThemeInt ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
int piVal 
)

Definition at line 126 of file property.c.

128{
130 PTHEME_CLASS pClass = ValidateHandle(hTheme);
131
132 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
133 if(!pClass)
134 return E_HANDLE;
135
136 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, TMT_INT, iPropId)))
138 return MSSTYLES_GetPropertyInt(tp, piVal);
139}
HRESULT MSSTYLES_GetPropertyInt(PTHEME_PROPERTY tp, int *piVal)
Definition: msstyles.c:1094
#define TMT_INT
Definition: vssym32.h:136

Referenced by get_border_background_size(), get_image_part_size(), get_led_gap(), get_led_size(), GetThemeBackgroundContentRect(), GetThemeBackgroundExtent(), UXTHEME_DrawBorderRectangle(), UXTHEME_LoadImage(), and UXTHEME_SelectImage().

◆ GetThemeIntList()

HRESULT WINAPI GetThemeIntList ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
INTLIST *  pIntList 
)

Definition at line 144 of file property.c.

146{
148 PTHEME_CLASS pClass = ValidateHandle(hTheme);
149
150 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
151 if(!pClass)
152 return E_HANDLE;
153
154 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, TMT_INTLIST, iPropId)))
156 return MSSTYLES_GetPropertyIntList(tp, pIntList);
157}
HRESULT MSSTYLES_GetPropertyIntList(PTHEME_PROPERTY tp, INTLIST *pIntList)
Definition: msstyles.c:1108
#define TMT_INTLIST
Definition: vssym32.h:145

◆ GetThemeMargins()

HRESULT WINAPI GetThemeMargins ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
int  iPropId,
RECT prc,
MARGINS pMargins 
)

Definition at line 216 of file property.c.

219{
221 PTHEME_CLASS pClass = ValidateHandle(hTheme);
222
223 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
224 memset (pMargins, 0, sizeof (MARGINS));
225 if(!pClass)
226 return E_HANDLE;
227
228 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, TMT_MARGINS, iPropId)))
230 return MSSTYLES_GetPropertyMargins(tp, prc, pMargins);
231}
HRESULT MSSTYLES_GetPropertyMargins(PTHEME_PROPERTY tp, RECT *prc, MARGINS *pMargins)
Definition: msstyles.c:1182
_Out_ LPRECT prc
Definition: ntgdi.h:1658
#define memset(x, y, z)
Definition: compat.h:39
Definition: misc.c:279
#define TMT_MARGINS
Definition: vssym32.h:139

Referenced by DrawNCPreview(), DrawThemeBackgroundEx(), GetThemeBackgroundContentRect(), GetThemeBackgroundExtent(), CTrayNotifyWnd::OnThemeChanged(), paint_scrollbar(), PB_ThemedPaint(), TOOLBAR_Create(), and UXTHEME_DrawImageBackground().

◆ GetThemeMetric()

HRESULT WINAPI GetThemeMetric ( HTHEME  hTheme,
HDC  hdc,
int  iPartId,
int  iStateId,
int  iPropId,
int piVal 
)

Definition at line 236 of file property.c.

238{
240 WCHAR val[60];
241 HRESULT hr;
242 PTHEME_CLASS pClass = ValidateHandle(hTheme);
243
244 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
245 if(!pClass)
246 return E_HANDLE;
247
248 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, 0, iPropId)))
250
251 switch(tp->iPrimitiveType) {
252 case TMT_POSITION: /* Only the X coord is retrieved */
253 case TMT_MARGINS: /* Only the cxLeftWidth member is retrieved */
254 case TMT_INTLIST: /* Only the first int is retrieved */
255 case TMT_SIZE:
256 case TMT_INT:
257 return MSSTYLES_GetPropertyInt(tp, piVal);
258 case TMT_BOOL:
259 return MSSTYLES_GetPropertyBool(tp, piVal);
260 case TMT_COLOR:
261 return MSSTYLES_GetPropertyColor(tp, (COLORREF*)piVal);
262 case TMT_ENUM:
263 hr = MSSTYLES_GetPropertyString(tp, val, sizeof(val)/sizeof(val[0]));
264 if(FAILED(hr))
265 return hr;
266 if(!MSSTYLES_LookupEnum(val, iPropId, piVal))
268 return S_OK;
269 case TMT_FILENAME:
270 /* Windows does return a value for this, but its value doesn't make sense */
271 FIXME("Filename\n");
272 break;
273 }
275}
#define FIXME(fmt,...)
Definition: debug.h:111
#define TMT_POSITION
Definition: vssym32.h:142
#define TMT_SIZE
Definition: vssym32.h:141
DWORD COLORREF
Definition: windef.h:300

◆ GetThemePosition()

HRESULT WINAPI GetThemePosition ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
POINT pPoint 
)

Definition at line 162 of file property.c.

164{
166 PTHEME_CLASS pClass = ValidateHandle(hTheme);
167
168 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
169 if(!pClass)
170 return E_HANDLE;
171
172 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, TMT_POSITION, iPropId)))
174 return MSSTYLES_GetPropertyPosition(tp, pPoint);
175}
HRESULT MSSTYLES_GetPropertyPosition(PTHEME_PROPERTY tp, POINT *pPoint)
Definition: msstyles.c:1127

Referenced by DrawThemeText(), and UXTHEME_SelectImage().

◆ GetThemePropertyOrigin()

HRESULT WINAPI GetThemePropertyOrigin ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
PROPERTYORIGIN *  pOrigin 
)

Definition at line 280 of file property.c.

282{
284 PTHEME_CLASS pClass = ValidateHandle(hTheme);
285
286 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
287 if(!pClass)
288 return E_HANDLE;
289
290 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, 0, iPropId))) {
291 *pOrigin = PO_NOTFOUND;
292 return S_OK;
293 }
294 *pOrigin = tp->origin;
295 return S_OK;
296}

◆ GetThemeRect()

HRESULT WINAPI GetThemeRect ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
RECT pRect 
)

Definition at line 180 of file property.c.

182{
184 PTHEME_CLASS pClass = ValidateHandle(hTheme);
185
186 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
187 if(!pClass)
188 return E_HANDLE;
189
190 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, TMT_RECT, iPropId)))
192 return MSSTYLES_GetPropertyRect(tp, pRect);
193}
HRESULT MSSTYLES_GetPropertyRect(PTHEME_PROPERTY tp, RECT *pRect)
Definition: msstyles.c:1162
#define TMT_RECT
Definition: vssym32.h:143

◆ GetThemeString()

HRESULT WINAPI GetThemeString ( HTHEME  hTheme,
int  iPartId,
int  iStateId,
int  iPropId,
LPWSTR  pszBuff,
int  cchMaxBuffChars 
)

Definition at line 198 of file property.c.

200{
202 PTHEME_CLASS pClass = ValidateHandle(hTheme);
203
204 TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
205 if(!pClass)
206 return E_HANDLE;
207
208 if(!(tp = MSSTYLES_FindProperty(pClass, iPartId, iStateId, TMT_STRING, iPropId)))
210 return MSSTYLES_GetPropertyString(tp, pszBuff, cchMaxBuffChars);
211}
#define TMT_STRING
Definition: vssym32.h:135