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