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 HRESULT
UXTHEME_LoadImage(HTHEME hTheme
, HDC hdc
, int iPartId
, int iStateId
, const RECT
*pRect
, BOOL glyph
,
89 HBITMAP
*hBmp
, RECT
*bmpRect
, BOOL
* hasImageAlpha
);
91 BOOL
MSSTYLES_LookupProperty(LPCWSTR pszPropertyName
, int *dwPrimitive
, int *dwId
);
92 BOOL
MSSTYLES_LookupEnum(LPCWSTR pszValueName
, int dwEnum
, int *dwValue
);
93 BOOL
MSSTYLES_LookupPartState(LPCWSTR pszClass
, LPCWSTR pszPart
, LPCWSTR pszState
, int *iPartId
, int *iStateId
);
95 HRESULT
MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile
, LPCWSTR pszColorName
, LPCWSTR pszSizeName
, PTHEME_FILE
*tf
);
96 HRESULT
MSSTYLES_ReferenceTheme(PTHEME_FILE tf
);
97 void MSSTYLES_CloseThemeFile(PTHEME_FILE tf
);
98 void MSSTYLES_ParseThemeIni(PTHEME_FILE tf
);
99 PTHEME_CLASS
MSSTYLES_OpenThemeClass(PTHEME_FILE tf
, LPCWSTR pszAppName
, LPCWSTR pszClassList
);
100 HRESULT
MSSTYLES_CloseThemeClass(PTHEME_CLASS tc
);
101 PUXINI_FILE
MSSTYLES_GetThemeIni(PTHEME_FILE tf
);
102 PTHEME_PARTSTATE
MSSTYLES_FindPartState(PTHEME_CLASS tc
, int iPartId
, int iStateId
, PTHEME_CLASS
*tcNext
);
103 PTHEME_PROPERTY
MSSTYLES_FindProperty(PTHEME_CLASS tc
, int iPartId
, int iStateId
, int iPropertyPrimitive
, int iPropertyId
);
104 PTHEME_PROPERTY
MSSTYLES_FindMetric(PTHEME_FILE tf
, int iPropertyPrimitive
, int iPropertyId
);
105 HBITMAP
MSSTYLES_LoadBitmap(PTHEME_CLASS tc
, LPCWSTR lpFilename
, BOOL
* hasAlpha
);
107 HRESULT
MSSTYLES_GetPropertyBool(PTHEME_PROPERTY tp
, BOOL
*pfVal
);
108 HRESULT
MSSTYLES_GetPropertyColor(PTHEME_PROPERTY tp
, COLORREF
*pColor
);
109 HRESULT
MSSTYLES_GetPropertyFont(PTHEME_PROPERTY tp
, HDC hdc
, LOGFONTW
*pFont
);
110 HRESULT
MSSTYLES_GetPropertyInt(PTHEME_PROPERTY tp
, int *piVal
);
111 HRESULT
MSSTYLES_GetPropertyIntList(PTHEME_PROPERTY tp
, INTLIST
*pIntList
);
112 HRESULT
MSSTYLES_GetPropertyPosition(PTHEME_PROPERTY tp
, POINT
*pPoint
);
113 HRESULT
MSSTYLES_GetPropertyString(PTHEME_PROPERTY tp
, LPWSTR pszBuff
, int cchMaxBuffChars
);
114 HRESULT
MSSTYLES_GetPropertyRect(PTHEME_PROPERTY tp
, RECT
*pRect
);
115 HRESULT
MSSTYLES_GetPropertyMargins(PTHEME_PROPERTY tp
, RECT
*prc
, MARGINS
*pMargins
);
117 PUXINI_FILE
UXINI_LoadINI(HMODULE hTheme
, LPCWSTR lpName
);
118 void UXINI_CloseINI(PUXINI_FILE uf
);
119 LPCWSTR
UXINI_GetNextSection(PUXINI_FILE uf
, DWORD
*dwLen
);
120 BOOL
UXINI_FindSection(PUXINI_FILE uf
, LPCWSTR lpName
);
121 LPCWSTR
UXINI_GetNextValue(PUXINI_FILE uf
, DWORD
*dwNameLen
, LPCWSTR
*lpValue
, DWORD
*dwValueLen
);
122 BOOL
UXINI_FindValue(PUXINI_FILE uf
, LPCWSTR lpName
, LPCWSTR
*lpValue
, DWORD
*dwValueLen
);
124 /* Scroll-bar hit testing */
127 SCROLL_NOWHERE
, /* Outside the scroll bar */
128 SCROLL_TOP_ARROW
, /* Top or left arrow */
129 SCROLL_TOP_RECT
, /* Rectangle between the top arrow and the thumb */
130 SCROLL_THUMB
, /* Thumb rectangle */
131 SCROLL_BOTTOM_RECT
, /* Rectangle between the thumb and the bottom arrow */
132 SCROLL_BOTTOM_ARROW
/* Bottom or right arrow */
135 /* The window context stores data for the window needed through the life of the window */
136 typedef struct _WND_CONTEXT
139 BOOL HasAppDefinedRgn
;
142 BOOL DirtyThemeRegion
;
143 HBRUSH hTabBackgroundBrush
;
144 HBITMAP hTabBackgroundBmp
;
146 BOOL SCROLL_trackVertical
;
147 enum SCROLL_HITTEST SCROLL_trackHitTest
;
148 BOOL SCROLL_MovingThumb
; /* Is the moving thumb being displayed? */
149 HWND SCROLL_TrackingWin
;
150 INT SCROLL_TrackingBar
;
151 INT SCROLL_TrackingPos
;
152 INT SCROLL_TrackingVal
;
153 } WND_CONTEXT
, *PWND_CONTEXT
;
155 /* The draw context stores data that are needed by the drawing operations in the non client area of the window */
156 typedef struct _DRAW_CONTEXT
164 BOOL Active
; /* wi.dwWindowStatus isn't correct for mdi child windows */
168 /* for double buffering */
171 } DRAW_CONTEXT
, *PDRAW_CONTEXT
;
182 The following values specify all possible button states
183 Note that not all of them are documented but it is easy to
184 find them by opening a theme file
192 } THEME_BUTTON_STATES
;
194 #define HT_ISBUTTON(ht) ((ht) == HTMINBUTTON || (ht) == HTMAXBUTTON || (ht) == HTCLOSE || (ht) == HTHELP)
196 #define HASSIZEGRIP(Style, ExStyle, ParentStyle, WindowRect, ParentClientRect) \
197 ((!(Style & WS_CHILD) && (Style & WS_THICKFRAME) && !(Style & WS_MAXIMIZE)) || \
198 ((Style & WS_CHILD) && (ParentStyle & WS_THICKFRAME) && !(ParentStyle & WS_MAXIMIZE) && \
199 (WindowRect.right - WindowRect.left == ParentClientRect.right) && \
200 (WindowRect.bottom - WindowRect.top == ParentClientRect.bottom)))
202 #define HAS_MENU(hwnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd))
204 #define BUTTON_GAP_SIZE 2
206 #define MENU_BAR_ITEMS_SPACE (12)
208 #define SCROLL_TIMER 0 /* Scroll timer id */
210 /* Overlap between arrows and thumb */
211 #define SCROLL_ARROW_THUMB_OVERLAP 0
213 /* Delay (in ms) before first repetition when holding the button down */
214 #define SCROLL_FIRST_DELAY 200
216 /* Delay (in ms) between scroll repetitions */
217 #define SCROLL_REPEAT_DELAY 50
219 /* Minimum size of the thumb in pixels */
220 #define SCROLL_MIN_THUMB 6
222 /* Minimum size of the rectangle between the arrows */
223 #define SCROLL_MIN_RECT 4
225 LRESULT CALLBACK
ThemeWndProc(HWND hWnd
, UINT Msg
, WPARAM wParam
, LPARAM lParam
, WNDPROC DefWndProc
);
226 void ThemeDrawScrollBar(PDRAW_CONTEXT pcontext
, INT Bar
, POINT
* pt
);
227 VOID
NC_TrackScrollBar(HWND Wnd
, WPARAM wParam
, POINT Pt
);
228 void ThemeInitDrawContext(PDRAW_CONTEXT pcontext
, HWND hWnd
, HRGN hRgn
);
229 void ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext
);
230 PWND_CONTEXT
ThemeGetWndContext(HWND hWnd
);
232 extern HINSTANCE hDllInst
;
233 extern ATOM atWindowTheme
;
234 extern ATOM atWndContext
;
235 extern BOOL gbThemeHooksActive
;
236 extern PTHEME_FILE ActiveThemeFile
;
238 void UXTHEME_InitSystem(HINSTANCE hInst
);
239 void UXTHEME_LoadTheme(BOOL bLoad
);
240 BOOL CALLBACK
UXTHEME_broadcast_msg (HWND hWnd
, LPARAM msg
);
242 /* No alpha blending */
243 #define ALPHABLEND_NONE 0
244 /* "Cheap" binary alpha blending - but possibly faster */
245 #define ALPHABLEND_BINARY 1
246 /* Full alpha blending */
247 #define ALPHABLEND_FULL 2
249 #endif /* _UXTHEME_PCH_ */