ReactOS 0.4.15-dev-8207-gd73a838
uxthemep.h
Go to the documentation of this file.
1#ifndef _UXTHEME_PCH_
2#define _UXTHEME_PCH_
3
4#include <stdarg.h>
5
6#include "resource.h"
7
8#define WIN32_NO_STATUS
9#define _INC_WINDOWS
10#define COM_NO_WINDOWS_H
11
12#include <windef.h>
13#include <winbase.h>
14#include <wingdi.h>
15#include <winuser.h>
16#include <winnls.h>
17#include <windowsx.h>
18#include <undocuser.h>
19#include <undocgdi.h>
20#include <uxtheme.h>
21#include <uxundoc.h>
22#include <vfwmsgs.h>
23#include <tmschema.h>
24
25#define NTOS_MODE_USER
26#include <ndk/ntndk.h>
27#include <ndk/rtltypes.h>
28
29#include <wine/debug.h>
31
32#define TMT_ENUM 200
33
34#define MAX_THEME_APP_NAME 60
35#define MAX_THEME_CLASS_NAME 60
36#define MAX_THEME_VALUE_NAME 60
37
38typedef struct _THEME_PROPERTY {
41 PROPERTYORIGIN origin;
42
45
48
49typedef struct _THEME_PARTSTATE {
53
56
57struct _THEME_FILE;
58
59typedef struct _THEME_CLASS {
61 struct _THEME_FILE* tf;
66
69
70typedef struct _THEME_IMAGE {
74
77
78typedef struct _THEME_FILE {
84
87
92
93typedef struct _UXINI_FILE *PUXINI_FILE;
94
95typedef struct _UXTHEME_HANDLE
96{
100
102
103HRESULT UXTHEME_LoadImage(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, BOOL glyph,
104 HBITMAP *hBmp, RECT *bmpRect, BOOL* hasImageAlpha);
105
106BOOL MSSTYLES_LookupProperty(LPCWSTR pszPropertyName, int *dwPrimitive, int *dwId);
107BOOL MSSTYLES_LookupEnum(LPCWSTR pszValueName, int dwEnum, int *dwValue);
108BOOL MSSTYLES_LookupPartState(LPCWSTR pszClass, LPCWSTR pszPart, LPCWSTR pszState, int *iPartId, int *iStateId);
109
110HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWSTR pszSizeName, PTHEME_FILE *tf);
117PTHEME_PARTSTATE MSSTYLES_FindPartState(PTHEME_CLASS tc, int iPartId, int iStateId, PTHEME_CLASS *tcNext);
118PTHEME_PROPERTY MSSTYLES_FindProperty(PTHEME_CLASS tc, int iPartId, int iStateId, int iPropertyPrimitive, int iPropertyId);
119PTHEME_PROPERTY MSSTYLES_FindMetric(PTHEME_FILE tf, int iPropertyPrimitive, int iPropertyId);
120#ifdef ENABLE_PNG_SUPPORT
122BOOL
124 _In_ HINSTANCE hTheme,
125 _In_ LPCWSTR szFile,
127 _Out_ HBITMAP *phBitmap);
129BOOL
131 _In_ HBITMAP png,
132 _Out_ BOOL* hasAlpha);
133#endif /* ENABLE_PNG_SUPPORT */
134HBITMAP MSSTYLES_LoadBitmap(PTHEME_CLASS tc, LPCWSTR lpFilename, BOOL* hasAlpha);
135
142HRESULT MSSTYLES_GetPropertyString(PTHEME_PROPERTY tp, LPWSTR pszBuff, int cchMaxBuffChars);
145
150LPCWSTR UXINI_GetNextValue(PUXINI_FILE uf, DWORD *dwNameLen, LPCWSTR *lpValue, DWORD *dwValueLen);
151BOOL UXINI_FindValue(PUXINI_FILE uf, LPCWSTR lpName, LPCWSTR *lpValue, DWORD *dwValueLen);
152
153 /* Scroll-bar hit testing */
155{
156 SCROLL_NOWHERE, /* Outside the scroll bar */
157 SCROLL_TOP_ARROW, /* Top or left arrow */
158 SCROLL_TOP_RECT, /* Rectangle between the top arrow and the thumb */
159 SCROLL_THUMB, /* Thumb rectangle */
160 SCROLL_BOTTOM_RECT, /* Rectangle between the thumb and the bottom arrow */
161 SCROLL_BOTTOM_ARROW /* Bottom or right arrow */
163
164/* The window context stores data for the window needed through the life of the window */
165typedef struct _WND_DATA
166{
169
178
181 BOOL SCROLL_MovingThumb; /* Is the moving thumb being displayed? */
187
188/* The draw context stores data that are needed by the drawing operations in the non client area of the window */
189typedef struct _DRAW_CONTEXT
190{
197 BOOL Active; /* wi.dwWindowStatus isn't correct for mdi child windows */
198 HRGN hRgn;
200
201 /* for double buffering */
205
206typedef enum
207{
213
214/*
215The following values specify all possible button states
216Note that not all of them are documented but it is easy to
217find them by opening a theme file
218*/
219typedef enum {
229
230#define HT_ISBUTTON(ht) ((ht) == HTMINBUTTON || (ht) == HTMAXBUTTON || (ht) == HTCLOSE || (ht) == HTHELP)
231
232#define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect) \
233 ((!(Style & WS_CHILD) && (Style & WS_THICKFRAME) && !(Style & WS_MAXIMIZE)) || \
234 ((Style & WS_CHILD) && (ParentStyle & WS_THICKFRAME) && !(ParentStyle & WS_MAXIMIZE) && \
235 (WindowRect.right - WindowRect.left == ParentClientRect.right) && \
236 (WindowRect.bottom - WindowRect.top == ParentClientRect.bottom)))
237
238#define HAS_MENU(hwnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd))
239
240#define BUTTON_GAP_SIZE 2
241
242#define MENU_BAR_ITEMS_SPACE (12)
243
244#define SCROLL_TIMER 0 /* Scroll timer id */
245
246 /* Overlap between arrows and thumb */
247#define SCROLL_ARROW_THUMB_OVERLAP 0
248
249 /* Delay (in ms) before first repetition when holding the button down */
250#define SCROLL_FIRST_DELAY 200
251
252 /* Delay (in ms) between scroll repetitions */
253#define SCROLL_REPEAT_DELAY 50
254
255/* Minimum size of the thumb in pixels */
256#define SCROLL_MIN_THUMB 6
257
258/* Minimum size of the rectangle between the arrows */
259#define SCROLL_MIN_RECT 4
260
264void ThemeDrawScrollBarEx(PDRAW_CONTEXT pcontext, INT nBar, PSCROLLBARINFO psbi, POINT* pt);
267void ThemeInitDrawContext(PDRAW_CONTEXT pcontext, HWND hWnd, HRGN hRgn);
272
273extern HINSTANCE hDllInst;
274extern ATOM atWindowTheme;
275extern ATOM atWndContext;
277
279void UXTHEME_LoadTheme(BOOL bLoad);
281
282/* No alpha blending */
283#define ALPHABLEND_NONE 0
284/* "Cheap" binary alpha blending - but possibly faster */
285#define ALPHABLEND_BINARY 1
286/* Full alpha blending */
287#define ALPHABLEND_FULL 2
288
289#endif /* _UXTHEME_PCH_ */
Arabic default style
Definition: afstyles.h:94
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define EXTERN_C
Definition: basetyps.h:12
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
struct @1643 Msg[]
WORD ATOM
Definition: dimm.idl:113
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define pt(x, y)
Definition: drawing.c:79
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2996
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
const GLfloat * tc
Definition: glext.h:8925
GLboolean enable
Definition: glext.h:11120
HFONT tf
Definition: icontest.c:17
void Bar(void)
Definition: terminate.cpp:70
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static HRGN hRgn
Definition: mapping.c:33
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
unsigned int UINT
Definition: ndis.h:50
_Out_ LPRECT prc
Definition: ntgdi.h:1658
long LONG
Definition: pedump.c:60
BOOL MSSTYLES_TryLoadPng(_In_ HINSTANCE hTheme, _In_ LPCWSTR szFile, _In_ LPCWSTR type, _Out_ HBITMAP *phBitmap)
Definition: pngsup.cpp:18
BOOL prepare_png_alpha(_In_ HBITMAP png, _Out_ BOOL *hasAlpha)
Definition: pngsup.cpp:60
WINDOWINFO wi
Definition: uxthemep.h:196
HTHEME hPrevTheme
Definition: uxthemep.h:195
HTHEME theme
Definition: uxthemep.h:193
HTHEME scrolltheme
Definition: uxthemep.h:194
HBITMAP hbmpOld
Definition: uxthemep.h:203
int CaptionHeight
Definition: uxthemep.h:199
Definition: misc.c:279
Definition: rtltypes.h:1247
HMODULE hTheme
Definition: uxthemep.h:60
struct _THEME_FILE * tf
Definition: uxthemep.h:61
struct _THEME_CLASS * overrides
Definition: uxthemep.h:65
WCHAR szAppName[MAX_THEME_APP_NAME]
Definition: uxthemep.h:62
PTHEME_PARTSTATE partstate
Definition: uxthemep.h:64
struct _THEME_CLASS * next
Definition: uxthemep.h:67
WCHAR szClassName[MAX_THEME_CLASS_NAME]
Definition: uxthemep.h:63
WCHAR szThemeFile[MAX_PATH]
Definition: uxthemep.h:81
PTHEME_PROPERTY metrics
Definition: uxthemep.h:89
LPWSTR pszAvailColors
Definition: uxthemep.h:82
HMODULE hTheme
Definition: uxthemep.h:80
DWORD dwRefCount
Definition: uxthemep.h:79
LPWSTR pszSelectedSize
Definition: uxthemep.h:86
PTHEME_CLASS classes
Definition: uxthemep.h:88
LPWSTR pszAvailSizes
Definition: uxthemep.h:83
LPWSTR pszSelectedColor
Definition: uxthemep.h:85
PTHEME_IMAGE images
Definition: uxthemep.h:90
struct _THEME_IMAGE * next
Definition: uxthemep.h:75
BOOL hasAlpha
Definition: uxthemep.h:73
HBITMAP image
Definition: uxthemep.h:72
struct _THEME_PARTSTATE * next
Definition: uxthemep.h:54
PTHEME_PROPERTY properties
Definition: uxthemep.h:52
PROPERTYORIGIN origin
Definition: uxthemep.h:41
int iPrimitiveType
Definition: uxthemep.h:39
DWORD dwValueLen
Definition: uxthemep.h:44
struct _THEME_PROPERTY * next
Definition: uxthemep.h:46
LPCWSTR lpValue
Definition: uxthemep.h:43
RTL_HANDLE_TABLE_ENTRY Handle
Definition: uxthemep.h:97
PTHEME_CLASS pClass
Definition: uxthemep.h:98
INT SCROLL_TrackingBar
Definition: uxthemep.h:183
BOOL DirtyThemeRegion
Definition: uxthemep.h:175
HTHEME hthemeWindow
Definition: uxthemep.h:167
BOOL UpdatingRgn
Definition: uxthemep.h:174
RECT rcCaptionButtons[4]
Definition: uxthemep.h:170
INT SCROLL_TrackingPos
Definition: uxthemep.h:184
enum SCROLL_HITTEST SCROLL_trackHitTest
Definition: uxthemep.h:180
HBRUSH hTabBackgroundBrush
Definition: uxthemep.h:176
INT SCROLL_TrackingVal
Definition: uxthemep.h:185
BOOL HasThemeRgn
Definition: uxthemep.h:173
BOOL SCROLL_trackVertical
Definition: uxthemep.h:179
UINT lastHitTest
Definition: uxthemep.h:171
HBITMAP hTabBackgroundBmp
Definition: uxthemep.h:177
HTHEME hthemeScrollbar
Definition: uxthemep.h:168
HWND SCROLL_TrackingWin
Definition: uxthemep.h:182
BOOL SCROLL_MovingThumb
Definition: uxthemep.h:181
BOOL HasAppDefinedRgn
Definition: uxthemep.h:172
Definition: name.c:39
SCROLL_HITTEST
int32_t INT
Definition: typedefs.h:58
PTHEME_PARTSTATE MSSTYLES_FindPartState(PTHEME_CLASS tc, int iPartId, int iStateId, PTHEME_CLASS *tcNext)
Definition: msstyles.c:452
struct _UXINI_FILE * PUXINI_FILE
Definition: uxthemep.h:93
HTHEME GetNCScrollbarTheme(HWND hWnd, DWORD style)
Definition: themehooks.c:118
void UXTHEME_LoadTheme(BOOL bLoad)
Definition: system.c:183
struct _THEME_PARTSTATE THEME_PARTSTATE
BOOL MSSTYLES_LookupEnum(LPCWSTR pszValueName, int dwEnum, int *dwValue)
Definition: stylemap.c:1126
PTHEME_PROPERTY MSSTYLES_FindProperty(PTHEME_CLASS tc, int iPartId, int iStateId, int iPropertyPrimitive, int iPropertyId)
Definition: msstyles.c:835
HINSTANCE hDllInst
Definition: system.c:45
struct _UXTHEME_HANDLE * PUXTHEME_HANDLE
void ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext)
Definition: nonclient.c:182
HRESULT MSSTYLES_GetPropertyFont(PTHEME_PROPERTY tp, HDC hdc, LOGFONTW *pFont)
Definition: msstyles.c:1077
PUXINI_FILE MSSTYLES_GetThemeIni(PTHEME_FILE tf)
Definition: msstyles.c:236
BOOL CALLBACK UXTHEME_broadcast_theme_changed(HWND hWnd, LPARAM enable)
Definition: system.c:68
HRESULT MSSTYLES_ReferenceTheme(PTHEME_FILE tf)
Definition: msstyles.c:224
struct _THEME_IMAGE THEME_IMAGE
HRESULT MSSTYLES_GetPropertyBool(PTHEME_PROPERTY tp, BOOL *pfVal)
Definition: msstyles.c:994
ATOM atWndContext
Definition: system.c:52
HRESULT MSSTYLES_GetPropertyString(PTHEME_PROPERTY tp, LPWSTR pszBuff, int cchMaxBuffChars)
Definition: msstyles.c:1151
LPCWSTR UXINI_GetNextSection(PUXINI_FILE uf, DWORD *dwLen)
Definition: uxini.c:173
HRESULT MSSTYLES_GetPropertyMargins(PTHEME_PROPERTY tp, RECT *prc, MARGINS *pMargins)
Definition: msstyles.c:1182
struct _THEME_CLASS * PTHEME_CLASS
HRESULT MSSTYLES_GetPropertyColor(PTHEME_PROPERTY tp, COLORREF *pColor)
Definition: msstyles.c:1007
PUXINI_FILE UXINI_LoadINI(HMODULE hTheme, LPCWSTR lpName)
Definition: uxini.c:52
struct _THEME_PROPERTY THEME_PROPERTY
PTHEME_CLASS MSSTYLES_OpenThemeClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR pszClassList)
Definition: msstyles.c:756
LONG SCROLL_getObjectId(INT nBar)
Definition: ncscrollbar.c:38
void ThemeDrawScrollBar(PDRAW_CONTEXT pcontext, INT Bar, POINT *pt)
Definition: ncscrollbar.c:318
void MSSTYLES_CloseThemeFile(PTHEME_FILE tf)
Definition: msstyles.c:179
struct _THEME_IMAGE * PTHEME_IMAGE
#define MAX_THEME_CLASS_NAME
Definition: uxthemep.h:35
HRESULT MSSTYLES_GetPropertyIntList(PTHEME_PROPERTY tp, INTLIST *pIntList)
Definition: msstyles.c:1108
struct _DRAW_CONTEXT DRAW_CONTEXT
HRESULT MSSTYLES_GetPropertyRect(PTHEME_PROPERTY tp, RECT *pRect)
Definition: msstyles.c:1162
struct _THEME_CLASS THEME_CLASS
HBITMAP MSSTYLES_LoadBitmap(PTHEME_CLASS tc, LPCWSTR lpFilename, BOOL *hasAlpha)
Definition: msstyles.c:896
struct _THEME_FILE THEME_FILE
void UXTHEME_InitSystem(HINSTANCE hInst)
Definition: system.c:566
BOOL UXINI_FindSection(PUXINI_FILE uf, LPCWSTR lpName)
Definition: uxini.c:200
struct _UXTHEME_HANDLE UXTHEME_HANDLE
HRESULT MSSTYLES_GetPropertyPosition(PTHEME_PROPERTY tp, POINT *pPoint)
Definition: msstyles.c:1127
HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWSTR pszSizeName, PTHEME_FILE *tf)
Definition: msstyles.c:54
HRESULT MSSTYLES_CloseThemeClass(PTHEME_CLASS tc)
Definition: msstyles.c:822
void ThemeInitDrawContext(PDRAW_CONTEXT pcontext, HWND hWnd, HRGN hRgn)
Definition: nonclient.c:158
struct _WND_DATA WND_DATA
ATOM atWindowTheme
Definition: system.c:49
LRESULT CALLBACK ThemeWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, WNDPROC DefWndProc)
Definition: nonclient.c:1015
struct _THEME_PROPERTY * PTHEME_PROPERTY
THEME_BUTTON_STATES
Definition: uxthemep.h:219
@ BUTTON_NORMAL
Definition: uxthemep.h:220
@ BUTTON_DISABLED
Definition: uxthemep.h:223
@ BUTTON_HOT
Definition: uxthemep.h:221
@ BUTTON_INACTIVE_DISABLED
Definition: uxthemep.h:227
@ BUTTON_PRESSED
Definition: uxthemep.h:222
@ BUTTON_INACTIVE
Definition: uxthemep.h:224
@ BUTTON_INACTIVE_HOT
Definition: uxthemep.h:225
@ BUTTON_INACTIVE_PRESSED
Definition: uxthemep.h:226
LPCWSTR UXINI_GetNextValue(PUXINI_FILE uf, DWORD *dwNameLen, LPCWSTR *lpValue, DWORD *dwValueLen)
Definition: uxini.c:226
SCROLL_HITTEST
Definition: uxthemep.h:155
@ SCROLL_NOWHERE
Definition: uxthemep.h:156
@ SCROLL_THUMB
Definition: uxthemep.h:159
@ SCROLL_BOTTOM_RECT
Definition: uxthemep.h:160
@ SCROLL_TOP_RECT
Definition: uxthemep.h:158
@ SCROLL_TOP_ARROW
Definition: uxthemep.h:157
@ SCROLL_BOTTOM_ARROW
Definition: uxthemep.h:161
PTHEME_PROPERTY MSSTYLES_FindMetric(PTHEME_FILE tf, int iPropertyPrimitive, int iPropertyId)
Definition: msstyles.c:556
void ThemeCalculateCaptionButtonsPos(HWND hWnd, HTHEME htheme)
Definition: nonclient.c:270
struct _DRAW_CONTEXT * PDRAW_CONTEXT
void MSSTYLES_ParseThemeIni(PTHEME_FILE tf)
Definition: msstyles.c:644
PTHEME_CLASS ValidateHandle(HTHEME hTheme)
Definition: system.c:717
HRESULT MSSTYLES_GetPropertyInt(PTHEME_PROPERTY tp, int *piVal)
Definition: msstyles.c:1094
HRESULT UXTHEME_LoadImage(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, BOOL glyph, HBITMAP *hBmp, RECT *bmpRect, BOOL *hasImageAlpha)
Definition: draw.c:230
BOOL g_bThemeHooksActive
Definition: themehooks.c:15
BOOL UXINI_FindValue(PUXINI_FILE uf, LPCWSTR lpName, LPCWSTR *lpValue, DWORD *dwValueLen)
Definition: uxini.c:280
void UXINI_CloseINI(PUXINI_FILE uf)
Definition: uxini.c:83
HTHEME GetNCCaptionTheme(HWND hWnd, DWORD style)
Definition: themehooks.c:88
VOID NC_TrackScrollBar(HWND Wnd, WPARAM wParam, POINT Pt)
Definition: ncscrollbar.c:674
CAPTIONBUTTON
Definition: uxthemep.h:207
@ CLOSEBUTTON
Definition: uxthemep.h:208
@ MAXBUTTON
Definition: uxthemep.h:209
@ HELPBUTTON
Definition: uxthemep.h:211
@ MINBUTTON
Definition: uxthemep.h:210
void ThemeDrawScrollBarEx(PDRAW_CONTEXT pcontext, INT nBar, PSCROLLBARINFO psbi, POINT *pt)
Definition: ncscrollbar.c:276
#define MAX_THEME_APP_NAME
Definition: uxthemep.h:34
PWND_DATA ThemeGetWndData(HWND hWnd)
Definition: themehooks.c:17
struct _THEME_PARTSTATE * PTHEME_PARTSTATE
struct _THEME_FILE * PTHEME_FILE
BOOL MSSTYLES_LookupProperty(LPCWSTR pszPropertyName, int *dwPrimitive, int *dwId)
Definition: stylemap.c:1100
BOOL MSSTYLES_LookupPartState(LPCWSTR pszClass, LPCWSTR pszPart, LPCWSTR pszState, int *iPartId, int *iStateId)
Definition: stylemap.c:1038
struct _WND_DATA * PWND_DATA
_In_ LPCSTR lpName
Definition: winbase.h:2789
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
DWORD COLORREF
Definition: windef.h:300
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185