3 #define WIN32_NO_STATUS
5 #define COM_NO_WINDOWS_H
13 #include <undocuser.h>
19 #include <wine/debug.h>
20 WINE_DEFAULT_DEBUG_CHANNEL(uxtheme
);
24 #define MAX_THEME_APP_NAME 60
25 #define MAX_THEME_CLASS_NAME 60
26 #define MAX_THEME_VALUE_NAME 60
28 typedef struct _THEME_PROPERTY
{
31 PROPERTYORIGIN origin
;
36 struct _THEME_PROPERTY
*next
;
37 } THEME_PROPERTY
, *PTHEME_PROPERTY
;
39 typedef struct _THEME_PARTSTATE
{
42 PTHEME_PROPERTY properties
;
44 struct _THEME_PARTSTATE
*next
;
45 } THEME_PARTSTATE
, *PTHEME_PARTSTATE
;
49 typedef struct _THEME_CLASS
{
51 struct _THEME_FILE
* tf
;
52 WCHAR szAppName
[MAX_THEME_APP_NAME
];
53 WCHAR szClassName
[MAX_THEME_CLASS_NAME
];
54 PTHEME_PARTSTATE partstate
;
55 struct _THEME_CLASS
*overrides
;
57 struct _THEME_CLASS
*next
;
58 } THEME_CLASS
, *PTHEME_CLASS
;
60 typedef struct _THEME_IMAGE
{
65 struct _THEME_IMAGE
*next
;
66 } THEME_IMAGE
, *PTHEME_IMAGE
;
68 typedef struct _THEME_FILE
{
71 WCHAR szThemeFile
[MAX_PATH
];
72 LPWSTR pszAvailColors
;
75 LPWSTR pszSelectedColor
;
76 LPWSTR pszSelectedSize
;
79 PTHEME_PROPERTY metrics
;
81 } THEME_FILE
, *PTHEME_FILE
;
83 typedef struct _UXINI_FILE
*PUXINI_FILE
;
85 BOOL
MSSTYLES_LookupProperty(LPCWSTR pszPropertyName
, int *dwPrimitive
, int *dwId
);
86 BOOL
MSSTYLES_LookupEnum(LPCWSTR pszValueName
, int dwEnum
, int *dwValue
);
87 BOOL
MSSTYLES_LookupPartState(LPCWSTR pszClass
, LPCWSTR pszPart
, LPCWSTR pszState
, int *iPartId
, int *iStateId
);
89 HRESULT
MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile
, LPCWSTR pszColorName
, LPCWSTR pszSizeName
, PTHEME_FILE
*tf
);
90 HRESULT
MSSTYLES_ReferenceTheme(PTHEME_FILE tf
);
91 void MSSTYLES_CloseThemeFile(PTHEME_FILE tf
);
92 void MSSTYLES_ParseThemeIni(PTHEME_FILE tf
);
93 PTHEME_CLASS
MSSTYLES_OpenThemeClass(PTHEME_FILE tf
, LPCWSTR pszAppName
, LPCWSTR pszClassList
);
94 HRESULT
MSSTYLES_CloseThemeClass(PTHEME_CLASS tc
);
95 PUXINI_FILE
MSSTYLES_GetThemeIni(PTHEME_FILE tf
);
96 PTHEME_PARTSTATE
MSSTYLES_FindPartState(PTHEME_CLASS tc
, int iPartId
, int iStateId
, PTHEME_CLASS
*tcNext
);
97 PTHEME_PROPERTY
MSSTYLES_FindProperty(PTHEME_CLASS tc
, int iPartId
, int iStateId
, int iPropertyPrimitive
, int iPropertyId
);
98 PTHEME_PROPERTY
MSSTYLES_FindMetric(PTHEME_FILE tf
, int iPropertyPrimitive
, int iPropertyId
);
99 HBITMAP
MSSTYLES_LoadBitmap(PTHEME_CLASS tc
, LPCWSTR lpFilename
, BOOL
* hasAlpha
);
101 HRESULT
MSSTYLES_GetPropertyBool(PTHEME_PROPERTY tp
, BOOL
*pfVal
);
102 HRESULT
MSSTYLES_GetPropertyColor(PTHEME_PROPERTY tp
, COLORREF
*pColor
);
103 HRESULT
MSSTYLES_GetPropertyFont(PTHEME_PROPERTY tp
, HDC hdc
, LOGFONTW
*pFont
);
104 HRESULT
MSSTYLES_GetPropertyInt(PTHEME_PROPERTY tp
, int *piVal
);
105 HRESULT
MSSTYLES_GetPropertyIntList(PTHEME_PROPERTY tp
, INTLIST
*pIntList
);
106 HRESULT
MSSTYLES_GetPropertyPosition(PTHEME_PROPERTY tp
, POINT
*pPoint
);
107 HRESULT
MSSTYLES_GetPropertyString(PTHEME_PROPERTY tp
, LPWSTR pszBuff
, int cchMaxBuffChars
);
108 HRESULT
MSSTYLES_GetPropertyRect(PTHEME_PROPERTY tp
, RECT
*pRect
);
109 HRESULT
MSSTYLES_GetPropertyMargins(PTHEME_PROPERTY tp
, RECT
*prc
, MARGINS
*pMargins
);
111 PUXINI_FILE
UXINI_LoadINI(HMODULE hTheme
, LPCWSTR lpName
);
112 void UXINI_CloseINI(PUXINI_FILE uf
);
113 LPCWSTR
UXINI_GetNextSection(PUXINI_FILE uf
, DWORD
*dwLen
);
114 BOOL
UXINI_FindSection(PUXINI_FILE uf
, LPCWSTR lpName
);
115 LPCWSTR
UXINI_GetNextValue(PUXINI_FILE uf
, DWORD
*dwNameLen
, LPCWSTR
*lpValue
, DWORD
*dwValueLen
);
116 BOOL
UXINI_FindValue(PUXINI_FILE uf
, LPCWSTR lpName
, LPCWSTR
*lpValue
, DWORD
*dwValueLen
);
119 /* The window context stores data for the window needed through the life of the window */
120 typedef struct _WND_CONTEXT
123 BOOL HasAppDefinedRgn
;
126 BOOL DirtyThemeRegion
;
127 } WND_CONTEXT
, *PWND_CONTEXT
;
129 /* The draw context stores data that are needed by the drawing operations in the non client area of the window */
130 typedef struct _DRAW_CONTEXT
138 BOOL Active
; /* wi.dwWindowStatus isn't correct for mdi child windows */
142 /* for double buffering */
145 } DRAW_CONTEXT
, *PDRAW_CONTEXT
;
156 The following values specify all possible vutton states
157 Note that not all of them are documented but it is easy to
158 find them by opening a theme file
166 } THEME_BUTTON_STATES
;
168 /* Scroll-bar hit testing */
171 SCROLL_NOWHERE
, /* Outside the scroll bar */
172 SCROLL_TOP_ARROW
, /* Top or left arrow */
173 SCROLL_TOP_RECT
, /* Rectangle between the top arrow and the thumb */
174 SCROLL_THUMB
, /* Thumb rectangle */
175 SCROLL_BOTTOM_RECT
, /* Rectangle between the thumb and the bottom arrow */
176 SCROLL_BOTTOM_ARROW
/* Bottom or right arrow */
179 #define HT_ISBUTTON(ht) ((ht) == HTMINBUTTON || (ht) == HTMAXBUTTON || (ht) == HTCLOSE || (ht) == HTHELP)
181 #define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect) \
182 ((!(Style & WS_CHILD) && (Style & WS_THICKFRAME) && !(Style & WS_MAXIMIZE)) || \
183 ((Style & WS_CHILD) && (ParentStyle & WS_THICKFRAME) && !(ParentStyle & WS_MAXIMIZE) && \
184 (WindowRect.right - WindowRect.left == ParentClientRect.right) && \
185 (WindowRect.bottom - WindowRect.top == ParentClientRect.bottom)))
187 #define HAS_MENU(hwnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd))
189 #define BUTTON_GAP_SIZE 2
191 #define MENU_BAR_ITEMS_SPACE (12)
193 #define SCROLL_TIMER 0 /* Scroll timer id */
195 /* Overlap between arrows and thumb */
196 #define SCROLL_ARROW_THUMB_OVERLAP 0
198 /* Delay (in ms) before first repetition when holding the button down */
199 #define SCROLL_FIRST_DELAY 200
201 /* Delay (in ms) between scroll repetitions */
202 #define SCROLL_REPEAT_DELAY 50
204 /* Minimum size of the thumb in pixels */
205 #define SCROLL_MIN_THUMB 6
207 /* Minimum size of the rectangle between the arrows */
208 #define SCROLL_MIN_RECT 4
210 LRESULT CALLBACK
ThemeWndProc(HWND hWnd
, UINT Msg
, WPARAM wParam
, LPARAM lParam
, WNDPROC DefWndProc
);
211 void ThemeDrawScrollBar(PDRAW_CONTEXT pcontext
, INT Bar
, POINT
* pt
);
212 VOID
NC_TrackScrollBar(HWND Wnd
, WPARAM wParam
, POINT Pt
);
213 void ThemeInitDrawContext(PDRAW_CONTEXT pcontext
, HWND hWnd
, HRGN hRgn
);
214 void ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext
);
215 PWND_CONTEXT
ThemeGetWndContext(HWND hWnd
);
217 extern HINSTANCE hDllInst
;
218 extern ATOM atWindowTheme
;
219 extern ATOM atWndContrext
;
220 extern BOOL gbThemeHooksActive
;
221 extern PTHEME_FILE ActiveThemeFile
;
223 void UXTHEME_InitSystem(HINSTANCE hInst
);
224 void UXTHEME_LoadTheme(BOOL bLoad
);
225 BOOL CALLBACK
UXTHEME_broadcast_msg (HWND hWnd
, LPARAM msg
);
227 /* No alpha blending */
228 #define ALPHABLEND_NONE 0
229 /* "Cheap" binary alpha blending - but possibly faster */
230 #define ALPHABLEND_BINARY 1
231 /* Full alpha blending */
232 #define ALPHABLEND_FULL 2