Release 9.12.
[wine.git] / include / uxtheme.h
blob5bcfd2b0117a6d89f6bdfa48c9ab62b30d2fc9ce
1 /*
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
24 #include <commctrl.h>
26 #ifndef THEMEAPI
27 #ifdef _UXTHEME_
28 #define THEMEAPI STDAPI
29 #define THEMEAPI_(type) STDAPI_(type)
30 #else
31 #define THEMEAPI DECLSPEC_IMPORT STDAPI
32 #define THEMEAPI_(type) DECLSPEC_IMPORT STDAPI_(type)
33 #endif
34 #endif
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 {
49 DWORD dwSize;
50 DWORD dwFlags;
51 RECT rcClip;
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 {
82 DWORD dwSize;
83 DWORD dwFlags;
84 COLORREF crText;
85 COLORREF crBorder;
86 COLORREF crShadow;
87 int iTextShadowType;
88 POINT ptShadowOffset;
89 int iBorderSize;
90 int iFontPropId;
91 int iColorPropId;
92 int iStateId;
93 BOOL fApplyOverlay;
94 int iGlowSize;
95 DTT_CALLBACK_PROC pfnDrawTextCallback;
96 LPARAM lParam;
97 } DTTOPTS, *PDTTOPTS;
99 THEMEAPI DrawThemeTextEx(HTHEME,HDC,int,int,LPCWSTR,int,DWORD,RECT*,
100 const DTTOPTS*);
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"
130 #else
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 };
135 #endif
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 {
146 int iValueCount;
147 int iValues[MAX_INTLIST_COUNT];
148 } INTLIST, *PINTLIST;
150 THEMEAPI GetThemeIntList(HTHEME,int,int,int,INTLIST*);
152 typedef struct _MARGINS {
153 int cxLeftWidth;
154 int cxRightWidth;
155 int cyTopHeight;
156 int cyBottomHeight;
157 } MARGINS, *PMARGINS;
159 THEMEAPI GetThemeMargins(HTHEME,HDC,int,int,int,RECT*,MARGINS*);
160 THEMEAPI GetThemeMetric(HTHEME,HDC,int,int,int,int*);
162 typedef enum {
163 TS_MIN,
164 TS_TRUE,
165 TS_DRAW
166 } THEMESIZE;
168 THEMEAPI GetThemePartSize(HTHEME,HDC,int,int,RECT*,THEMESIZE,SIZE*);
169 THEMEAPI GetThemePosition(HTHEME,int,int,int,POINT*);
171 typedef enum {
172 PO_STATE,
173 PO_PART,
174 PO_CLASS,
175 PO_GLOBAL,
176 PO_NOTFOUND
177 } PROPERTYORIGIN;
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,
237 BPBF_DIB,
238 BPBF_TOPDOWNDIB,
239 BPBF_TOPDOWNMONODIB
240 } BP_BUFFERFORMAT;
242 typedef struct _BP_PAINTPARAMS
244 DWORD cbSize;
245 DWORD dwFlags;
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
265 BPAS_NONE,
266 BPAS_LINEAR,
267 BPAS_CUBIC,
268 BPAS_SINE
269 } BP_ANIMATIONSTYLE;
271 typedef struct _BP_ANIMATIONPARAMS
273 DWORD cbSize;
274 DWORD dwFlags;
275 BP_ANIMATIONSTYLE style;
276 DWORD dwDuration;
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);
286 #endif