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