2 * Win32 5.1 theme definitions
4 * Copyright (C) 2003 Kevin Koltzau
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_UXTHEME_H
22 #define __WINE_UXTHEME_H
28 #define THEMEAPI STDAPI
29 #define THEMEAPI_(type) STDAPI_(type)
31 #define THEMEAPI DECLSPEC_IMPORT STDAPI
32 #define THEMEAPI_(type) DECLSPEC_IMPORT STDAPI_(type)
36 typedef HANDLE HTHEME
;
38 THEMEAPI
CloseThemeData(HTHEME hTheme
);
39 THEMEAPI
DrawThemeBackground(HTHEME
,HDC
,int,int,const RECT
*,const RECT
*);
41 #define DTBG_CLIPRECT 0x00000001
42 #define DTBG_DRAWSOLID 0x00000002
43 #define DTBG_OMITBORDER 0x00000004
44 #define DTBG_OMITCONTENT 0x00000008
45 #define DTBG_COMPUTINGREGION 0x00000010
46 #define DTBG_MIRRORDC 0x00000020
48 typedef struct _DTBGOPTS
{
52 } DTBGOPTS
, *PDTBGOPTS
;
54 THEMEAPI
DrawThemeBackgroundEx(HTHEME
,HDC
,int,int,const RECT
*, const DTBGOPTS
*);
55 THEMEAPI
DrawThemeEdge(HTHEME
,HDC
,int,int,const RECT
*,UINT
,UINT
, RECT
*);
56 THEMEAPI
DrawThemeIcon(HTHEME
,HDC
,int,int,const RECT
*,HIMAGELIST
,int);
57 THEMEAPI
DrawThemeParentBackground(HWND
,HDC
,RECT
*);
58 THEMEAPI
DrawThemeText(HTHEME
,HDC
,int,int,LPCWSTR
,int,DWORD
,DWORD
, const RECT
*);
60 #define DTT_GRAYED 0x1
62 /* DTTOPTS.dwFlags bits */
63 #define DTT_TEXTCOLOR 0x00000001
64 #define DTT_BORDERCOLOR 0x00000002
65 #define DTT_SHADOWCOLOR 0x00000004
66 #define DTT_SHADOWTYPE 0x00000008
67 #define DTT_SHADOWOFFSET 0x00000010
68 #define DTT_BORDERSIZE 0x00000020
69 #define DTT_FONTPROP 0x00000040
70 #define DTT_COLORPROP 0x00000080
71 #define DTT_STATEID 0x00000100
72 #define DTT_CALCRECT 0x00000200
73 #define DTT_APPLYOVERLAY 0x00000400
74 #define DTT_GLOWSIZE 0x00000800
75 #define DTT_CALLBACK 0x00001000
76 #define DTT_COMPOSITED 0x00002000
77 #define DTT_VALIDBITS 0x00003fff
79 typedef int (WINAPI
*DTT_CALLBACK_PROC
)(HDC
,LPWSTR
,int,RECT
*,UINT
,LPARAM
);
81 typedef struct _DTTOPTS
{
95 DTT_CALLBACK_PROC pfnDrawTextCallback
;
99 THEMEAPI
DrawThemeTextEx(HTHEME
,HDC
,int,int,LPCWSTR
,int,DWORD
,RECT
*,
102 #define ETDT_DISABLE 0x00000001
103 #define ETDT_ENABLE 0x00000002
104 #define ETDT_USETABTEXTURE 0x00000004
105 #define ETDT_USEAEROWIZARDTABTEXTURE 0x00000008
106 #define ETDT_ENABLETAB (ETDT_ENABLE|ETDT_USETABTEXTURE)
107 #define ETDT_ENABLEAEROWIZARDTAB (ETDT_ENABLE|ETDT_USEAEROWIZARDTABTEXTURE)
108 #define ETDT_VALIDBITS (ETDT_DISABLE|ETDT_ENABLE|ETDT_USETABTEXTURE|ETDT_USEAEROWIZARDTABTEXTURE)
110 THEMEAPI
EnableThemeDialogTexture(HWND
,DWORD
);
111 THEMEAPI
EnableTheming(BOOL
);
112 THEMEAPI
GetCurrentThemeName(LPWSTR
,int,LPWSTR
,int,LPWSTR
,int);
114 #define STAP_ALLOW_NONCLIENT (1<<0)
115 #define STAP_ALLOW_CONTROLS (1<<1)
116 #define STAP_ALLOW_WEBCONTENT (1<<2)
118 THEMEAPI_(DWORD
) GetThemeAppProperties(void);
119 THEMEAPI
GetThemeBackgroundContentRect(HTHEME
,HDC
,int,int, const RECT
*,RECT
*);
120 THEMEAPI
GetThemeBackgroundExtent(HTHEME
,HDC
,int,int,const RECT
*,RECT
*);
121 THEMEAPI
GetThemeBackgroundRegion(HTHEME
,HDC
,int,int,const RECT
*,HRGN
*);
122 THEMEAPI
GetThemeBool(HTHEME
,int,int,int,BOOL
*);
123 THEMEAPI
GetThemeColor(HTHEME
,int,int,int,COLORREF
*);
125 #if defined(_MSC_VER) || defined(__MINGW32__)
126 # define SZ_THDOCPROP_DISPLAYNAME L"DisplayName"
127 # define SZ_THDOCPROP_CANONICALNAME L"ThemeName"
128 # define SZ_THDOCPROP_TOOLTIP L"ToolTip"
129 # define SZ_THDOCPROP_AUTHOR L"author"
131 static const WCHAR SZ_THDOCPROP_DISPLAYNAME
[] = { 'D','i','s','p','l','a','y','N','a','m','e',0 };
132 static const WCHAR SZ_THDOCPROP_CANONICALNAME
[] = { 'T','h','e','m','e','N','a','m','e',0 };
133 static const WCHAR SZ_THDOCPROP_TOOLTIP
[] = { 'T','o','o','l','T','i','p',0 };
134 static const WCHAR SZ_THDOCPROP_AUTHOR
[] = { 'a','u','t','h','o','r',0 };
137 THEMEAPI
GetThemeDocumentationProperty(LPCWSTR
,LPCWSTR
,LPWSTR
,int);
138 THEMEAPI
GetThemeEnumValue(HTHEME
,int,int,int,int*);
139 THEMEAPI
GetThemeFilename(HTHEME
,int,int,int,LPWSTR
,int);
140 THEMEAPI
GetThemeFont(HTHEME
,HDC
,int,int,int,LOGFONTW
*);
141 THEMEAPI
GetThemeInt(HTHEME
,int,int,int,int*);
143 /* MAX_INTLIST_COUNT was 10 before Vista */
144 #define MAX_INTLIST_COUNT 402
145 typedef struct _INTLIST
{
147 int iValues
[MAX_INTLIST_COUNT
];
148 } INTLIST
, *PINTLIST
;
150 THEMEAPI
GetThemeIntList(HTHEME
,int,int,int,INTLIST
*);
152 typedef struct _MARGINS
{
157 } MARGINS
, *PMARGINS
;
159 THEMEAPI
GetThemeMargins(HTHEME
,HDC
,int,int,int,RECT
*,MARGINS
*);
160 THEMEAPI
GetThemeMetric(HTHEME
,HDC
,int,int,int,int*);
168 THEMEAPI
GetThemePartSize(HTHEME
,HDC
,int,int,RECT
*,THEMESIZE
,SIZE
*);
169 THEMEAPI
GetThemePosition(HTHEME
,int,int,int,POINT
*);
179 THEMEAPI
GetThemePropertyOrigin(HTHEME
,int,int,int,PROPERTYORIGIN
*);
180 THEMEAPI
GetThemeRect(HTHEME
,int,int,int,RECT
*);
181 THEMEAPI
GetThemeString(HTHEME
,int,int,int,LPWSTR
,int);
182 THEMEAPI_(BOOL
) GetThemeSysBool(HTHEME
,int);
183 THEMEAPI_(COLORREF
) GetThemeSysColor(HTHEME
,int);
184 THEMEAPI_(HBRUSH
) GetThemeSysColorBrush(HTHEME
,int);
185 THEMEAPI
GetThemeSysFont(HTHEME
,int,LOGFONTW
*);
186 THEMEAPI
GetThemeSysInt(HTHEME
,int,int*);
187 THEMEAPI_(int) GetThemeSysSize(HTHEME
,int);
188 THEMEAPI
GetThemeSysString(HTHEME
,int,LPWSTR
,int);
189 THEMEAPI
GetThemeTextExtent(HTHEME
,HDC
,int,int,LPCWSTR
,int,DWORD
, const RECT
*,RECT
*);
190 THEMEAPI
GetThemeTextMetrics(HTHEME
,HDC
,int,int,TEXTMETRICW
*);
191 THEMEAPI
GetThemeTransitionDuration(HTHEME
,int,int,int,int,DWORD
*);
192 THEMEAPI_(HTHEME
) GetWindowTheme(HWND
);
194 #define HTTB_BACKGROUNDSEG 0x0000
195 #define HTTB_FIXEDBORDER 0x0002
196 #define HTTB_CAPTION 0x0004
197 #define HTTB_RESIZINGBORDER_LEFT 0x0010
198 #define HTTB_RESIZINGBORDER_TOP 0x0020
199 #define HTTB_RESIZINGBORDER_RIGHT 0x0040
200 #define HTTB_RESIZINGBORDER_BOTTOM 0x0080
201 #define HTTB_RESIZINGBORDER \
202 (HTTB_RESIZINGBORDER_LEFT|HTTB_RESIZINGBORDER_TOP|\
203 HTTB_RESIZINGBORDER_RIGHT|HTTB_RESIZINGBORDER_BOTTOM)
204 #define HTTB_SIZINGTEMPLATE 0x0100
205 #define HTTB_SYSTEMSIZINGMARGINS 0x0200
207 #define OTD_FORCE_RECT_SIZING 0x0001
208 #define OTD_NONCLIENT 0x0002
209 #define OTD_VALIDBITS (OTD_FORCE_RECT_SIZING | OTD_NONCLIENT)
211 enum WINDOWTHEMEATTRIBUTETYPE
{ WTA_NONCLIENT
= 1 };
213 THEMEAPI
HitTestThemeBackground(HTHEME
,HDC
,int,int,DWORD
,const RECT
*, HRGN
,POINT
,WORD
*);
214 THEMEAPI_(BOOL
) IsAppThemed(void);
215 THEMEAPI_(BOOL
) IsCompositionActive(void);
216 THEMEAPI_(BOOL
) IsThemeActive(void);
217 THEMEAPI_(BOOL
) IsThemeBackgroundPartiallyTransparent(HTHEME
,int,int);
218 THEMEAPI_(BOOL
) IsThemeDialogTextureEnabled(HWND
);
219 THEMEAPI_(BOOL
) IsThemePartDefined(HTHEME
,int,int);
220 THEMEAPI_(HTHEME
) OpenThemeData(HWND
,LPCWSTR
);
221 THEMEAPI_(HTHEME
) OpenThemeDataEx(HWND
,LPCWSTR
,DWORD
);
222 THEMEAPI_(HTHEME
) OpenThemeDataForDpi(HWND
,LPCWSTR
,UINT
);
223 THEMEAPI_(void) SetThemeAppProperties(DWORD
);
224 THEMEAPI
SetWindowTheme(HWND
,LPCWSTR
,LPCWSTR
);
225 THEMEAPI
SetWindowThemeAttribute(HWND
,enum WINDOWTHEMEATTRIBUTETYPE
,PVOID
,DWORD
);
227 /* Double-buffered Drawing API */
229 typedef HANDLE HPAINTBUFFER
;
231 THEMEAPI
BufferedPaintInit(VOID
);
232 THEMEAPI
BufferedPaintUnInit(VOID
);
234 typedef enum _BP_BUFFERFORMAT
236 BPBF_COMPATIBLEBITMAP
,
242 typedef struct _BP_PAINTPARAMS
246 const RECT
*prcExclude
;
247 const BLENDFUNCTION
*pBlendFunction
;
248 } BP_PAINTPARAMS
, *PBP_PAINTPARAMS
;
250 THEMEAPI_(HPAINTBUFFER
) BeginBufferedPaint(HDC
, const RECT
*, BP_BUFFERFORMAT
, BP_PAINTPARAMS
*,HDC
*);
251 THEMEAPI
EndBufferedPaint(HPAINTBUFFER
, BOOL
);
252 THEMEAPI
BufferedPaintClear(HPAINTBUFFER
, const RECT
*);
253 THEMEAPI
BufferedPaintSetAlpha(HPAINTBUFFER
, const RECT
*, BYTE
);
254 THEMEAPI
GetBufferedPaintBits(HPAINTBUFFER
, RGBQUAD
**, int *);
255 THEMEAPI_(HDC
) GetBufferedPaintDC(HPAINTBUFFER
);
256 THEMEAPI_(HDC
) GetBufferedPaintTargetDC(HPAINTBUFFER
);
257 THEMEAPI
GetBufferedPaintTargetRect(HPAINTBUFFER
, RECT
*prc
);
259 /* double-buffered animation functions */
261 typedef HANDLE HANIMATIONBUFFER
;
263 typedef enum _BP_ANIMATIONSTYLE
271 typedef struct _BP_ANIMATIONPARAMS
275 BP_ANIMATIONSTYLE style
;
277 } BP_ANIMATIONPARAMS
, *PBP_ANIMATIONPARAMS
;
279 THEMEAPI_(HANIMATIONBUFFER
) BeginBufferedAnimation(HWND
, HDC
, const RECT
*,
280 BP_BUFFERFORMAT
, BP_PAINTPARAMS
*,
281 BP_ANIMATIONPARAMS
*, HDC
*, HDC
*);
282 THEMEAPI_(BOOL
) BufferedPaintRenderAnimation(HWND
, HDC
);
283 THEMEAPI
BufferedPaintStopAllAnimations(HWND
);
284 THEMEAPI
EndBufferedAnimation(HANIMATIONBUFFER
, BOOL
);