3 #define WIN32_NO_STATUS
14 #include <wine/debug.h>
15 WINE_DEFAULT_DEBUG_CHANNEL(uxtheme
);
19 #define MAX_THEME_APP_NAME 60
20 #define MAX_THEME_CLASS_NAME 60
21 #define MAX_THEME_VALUE_NAME 60
23 typedef struct _THEME_PROPERTY
{
26 PROPERTYORIGIN origin
;
31 struct _THEME_PROPERTY
*next
;
32 } THEME_PROPERTY
, *PTHEME_PROPERTY
;
34 typedef struct _THEME_PARTSTATE
{
37 PTHEME_PROPERTY properties
;
39 struct _THEME_PARTSTATE
*next
;
40 } THEME_PARTSTATE
, *PTHEME_PARTSTATE
;
44 typedef struct _THEME_CLASS
{
46 struct _THEME_FILE
* tf
;
47 WCHAR szAppName
[MAX_THEME_APP_NAME
];
48 WCHAR szClassName
[MAX_THEME_CLASS_NAME
];
49 PTHEME_PARTSTATE partstate
;
50 struct _THEME_CLASS
*overrides
;
52 struct _THEME_CLASS
*next
;
53 } THEME_CLASS
, *PTHEME_CLASS
;
55 typedef struct _THEME_IMAGE
{
60 struct _THEME_IMAGE
*next
;
61 } THEME_IMAGE
, *PTHEME_IMAGE
;
63 typedef struct _THEME_FILE
{
66 WCHAR szThemeFile
[MAX_PATH
];
67 LPWSTR pszAvailColors
;
70 LPWSTR pszSelectedColor
;
71 LPWSTR pszSelectedSize
;
74 PTHEME_PROPERTY metrics
;
76 } THEME_FILE
, *PTHEME_FILE
;
78 typedef struct _UXINI_FILE
*PUXINI_FILE
;
80 BOOL
MSSTYLES_LookupProperty(LPCWSTR pszPropertyName
, int *dwPrimitive
, int *dwId
);
81 BOOL
MSSTYLES_LookupEnum(LPCWSTR pszValueName
, int dwEnum
, int *dwValue
);
82 BOOL
MSSTYLES_LookupPartState(LPCWSTR pszClass
, LPCWSTR pszPart
, LPCWSTR pszState
, int *iPartId
, int *iStateId
);
84 HRESULT
MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile
, LPCWSTR pszColorName
, LPCWSTR pszSizeName
, PTHEME_FILE
*tf
);
85 HRESULT
MSSTYLES_ReferenceTheme(PTHEME_FILE tf
);
86 void MSSTYLES_CloseThemeFile(PTHEME_FILE tf
);
87 void MSSTYLES_ParseThemeIni(PTHEME_FILE tf
);
88 PTHEME_CLASS
MSSTYLES_OpenThemeClass(PTHEME_FILE tf
, LPCWSTR pszAppName
, LPCWSTR pszClassList
);
89 HRESULT
MSSTYLES_CloseThemeClass(PTHEME_CLASS tc
);
90 PUXINI_FILE
MSSTYLES_GetThemeIni(PTHEME_FILE tf
);
91 PTHEME_PARTSTATE
MSSTYLES_FindPartState(PTHEME_CLASS tc
, int iPartId
, int iStateId
, PTHEME_CLASS
*tcNext
);
92 PTHEME_PROPERTY
MSSTYLES_FindProperty(PTHEME_CLASS tc
, int iPartId
, int iStateId
, int iPropertyPrimitive
, int iPropertyId
);
93 PTHEME_PROPERTY
MSSTYLES_FindMetric(PTHEME_FILE tf
, int iPropertyPrimitive
, int iPropertyId
);
94 HBITMAP
MSSTYLES_LoadBitmap(PTHEME_CLASS tc
, LPCWSTR lpFilename
, BOOL
* hasAlpha
);
96 HRESULT
MSSTYLES_GetPropertyBool(PTHEME_PROPERTY tp
, BOOL
*pfVal
);
97 HRESULT
MSSTYLES_GetPropertyColor(PTHEME_PROPERTY tp
, COLORREF
*pColor
);
98 HRESULT
MSSTYLES_GetPropertyFont(PTHEME_PROPERTY tp
, HDC hdc
, LOGFONTW
*pFont
);
99 HRESULT
MSSTYLES_GetPropertyInt(PTHEME_PROPERTY tp
, int *piVal
);
100 HRESULT
MSSTYLES_GetPropertyIntList(PTHEME_PROPERTY tp
, INTLIST
*pIntList
);
101 HRESULT
MSSTYLES_GetPropertyPosition(PTHEME_PROPERTY tp
, POINT
*pPoint
);
102 HRESULT
MSSTYLES_GetPropertyString(PTHEME_PROPERTY tp
, LPWSTR pszBuff
, int cchMaxBuffChars
);
103 HRESULT
MSSTYLES_GetPropertyRect(PTHEME_PROPERTY tp
, RECT
*pRect
);
104 HRESULT
MSSTYLES_GetPropertyMargins(PTHEME_PROPERTY tp
, RECT
*prc
, MARGINS
*pMargins
);
106 PUXINI_FILE
UXINI_LoadINI(HMODULE hTheme
, LPCWSTR lpName
);
107 void UXINI_CloseINI(PUXINI_FILE uf
);
108 LPCWSTR
UXINI_GetNextSection(PUXINI_FILE uf
, DWORD
*dwLen
);
109 BOOL
UXINI_FindSection(PUXINI_FILE uf
, LPCWSTR lpName
);
110 LPCWSTR
UXINI_GetNextValue(PUXINI_FILE uf
, DWORD
*dwNameLen
, LPCWSTR
*lpValue
, DWORD
*dwValueLen
);
111 BOOL
UXINI_FindValue(PUXINI_FILE uf
, LPCWSTR lpName
, LPCWSTR
*lpValue
, DWORD
*dwValueLen
);
115 typedef struct _WND_CONTEXT
117 BOOL HasAppDefinedRgn
;
120 } WND_CONTEXT
, *PWND_CONTEXT
;
122 typedef struct _DRAW_CONTEXT
130 BOOL Active
; /* wi.dwWindowStatus isn't correct for mdi child windows */
134 /* for double buffering */
137 } DRAW_CONTEXT
, *PDRAW_CONTEXT
;
148 The following values specify all possible vutton states
149 Note that not all of them are documented but it is easy to
150 find them by opening a theme file
158 } THEME_BUTTON_STATES
;
160 /* Scroll-bar hit testing */
163 SCROLL_NOWHERE
, /* Outside the scroll bar */
164 SCROLL_TOP_ARROW
, /* Top or left arrow */
165 SCROLL_TOP_RECT
, /* Rectangle between the top arrow and the thumb */
166 SCROLL_THUMB
, /* Thumb rectangle */
167 SCROLL_BOTTOM_RECT
, /* Rectangle between the thumb and the bottom arrow */
168 SCROLL_BOTTOM_ARROW
/* Bottom or right arrow */
171 #define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect) \
172 ((!(Style & WS_CHILD) && (Style & WS_THICKFRAME) && !(Style & WS_MAXIMIZE)) || \
173 ((Style & WS_CHILD) && (ParentStyle & WS_THICKFRAME) && !(ParentStyle & WS_MAXIMIZE) && \
174 (WindowRect.right - WindowRect.left == ParentClientRect.right) && \
175 (WindowRect.bottom - WindowRect.top == ParentClientRect.bottom)))
177 #define HAS_MENU(hwnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd))
179 #define BUTTON_GAP_SIZE 2
181 #define MENU_BAR_ITEMS_SPACE (12)
183 #define SCROLL_TIMER 0 /* Scroll timer id */
185 /* Overlap between arrows and thumb */
186 #define SCROLL_ARROW_THUMB_OVERLAP 0
188 /* Delay (in ms) before first repetition when holding the button down */
189 #define SCROLL_FIRST_DELAY 200
191 /* Delay (in ms) between scroll repetitions */
192 #define SCROLL_REPEAT_DELAY 50
194 /* Minimum size of the thumb in pixels */
195 #define SCROLL_MIN_THUMB 6
197 /* Minimum size of the rectangle between the arrows */
198 #define SCROLL_MIN_RECT 4
200 LRESULT CALLBACK
ThemeWndProc(HWND hWnd
, UINT Msg
, WPARAM wParam
, LPARAM lParam
, WNDPROC DefWndProc
);
201 void ThemeDrawScrollBar(PDRAW_CONTEXT pcontext
, INT Bar
, POINT
* pt
);
202 VOID
NC_TrackScrollBar(HWND Wnd
, WPARAM wParam
, POINT Pt
);
203 void ThemeInitDrawContext(PDRAW_CONTEXT pcontext
, HWND hWnd
, HRGN hRgn
);
204 void ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext
);
205 PWND_CONTEXT
ThemeGetWndContext(HWND hWnd
);
207 extern HINSTANCE hDllInst
;
208 extern ATOM atWindowTheme
;
209 extern ATOM atWndContrext
;
210 extern BOOL gbThemeHooksActive
;
212 void UXTHEME_InitSystem(HINSTANCE hInst
);
213 void UXTHEME_LoadTheme(BOOL bLoad
);
214 BOOL CALLBACK
UXTHEME_broadcast_msg (HWND hWnd
, LPARAM msg
);
216 /* No alpha blending */
217 #define ALPHABLEND_NONE 0
218 /* "Cheap" binary alpha blending - but possibly faster */
219 #define ALPHABLEND_BINARY 1
220 /* Full alpha blending */
221 #define ALPHABLEND_FULL 2