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