joy.cpl: Fix pulsing buttons in joystick button state display.
[wine/zf.git] / include / uxtheme.h
blob449dc6f6d407d810772ad284196163208b184680
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 typedef HANDLE HTHEME;
28 HRESULT WINAPI CloseThemeData(HTHEME hTheme);
29 HRESULT WINAPI DrawThemeBackground(HTHEME,HDC,int,int,const RECT*,const RECT*);
31 #define DTBG_CLIPRECT 0x00000001
32 #define DTBG_DRAWSOLID 0x00000002
33 #define DTBG_OMITBORDER 0x00000004
34 #define DTBG_OMITCONTENT 0x00000008
35 #define DTBG_COMPUTINGREGION 0x00000010
36 #define DTBG_MIRRORDC 0x00000020
38 typedef struct _DTBGOPTS {
39 DWORD dwSize;
40 DWORD dwFlags;
41 RECT rcClip;
42 } DTBGOPTS, *PDTBGOPTS;
44 HRESULT WINAPI DrawThemeBackgroundEx(HTHEME,HDC,int,int,const RECT*,
45 const DTBGOPTS*);
46 HRESULT WINAPI DrawThemeEdge(HTHEME,HDC,int,int,const RECT*,UINT,UINT,
47 RECT*);
48 HRESULT WINAPI DrawThemeIcon(HTHEME,HDC,int,int,const RECT*,HIMAGELIST,int);
49 HRESULT WINAPI DrawThemeParentBackground(HWND,HDC,RECT*);
51 #define DTT_GRAYED 0x1
53 HRESULT WINAPI DrawThemeText(HTHEME,HDC,int,int,LPCWSTR,int,DWORD,DWORD,
54 const RECT*);
56 /* DTTOPTS.dwFlags bits */
57 #define DTT_TEXTCOLOR 0x00000001
58 #define DTT_BORDERCOLOR 0x00000002
59 #define DTT_SHADOWCOLOR 0x00000004
60 #define DTT_SHADOWTYPE 0x00000008
61 #define DTT_SHADOWOFFSET 0x00000010
62 #define DTT_BORDERSIZE 0x00000020
63 #define DTT_FONTPROP 0x00000040
64 #define DTT_COLORPROP 0x00000080
65 #define DTT_STATEID 0x00000100
66 #define DTT_CALCRECT 0x00000200
67 #define DTT_APPLYOVERLAY 0x00000400
68 #define DTT_GLOWSIZE 0x00000800
69 #define DTT_CALLBACK 0x00001000
70 #define DTT_COMPOSITED 0x00002000
71 #define DTT_VALIDBITS 0x00003fff
73 typedef int (WINAPI *DTT_CALLBACK_PROC)(HDC,LPWSTR,int,RECT*,UINT,LPARAM);
75 typedef struct _DTTOPTS {
76 DWORD dwSize;
77 DWORD dwFlags;
78 COLORREF crText;
79 COLORREF crBorder;
80 COLORREF crShadow;
81 int iTextShadowType;
82 POINT ptShadowOffset;
83 int iBorderSize;
84 int iFontPropId;
85 int iColorPropId;
86 int iStateId;
87 BOOL fApplyOverlay;
88 int iGlowSize;
89 DTT_CALLBACK_PROC pfnDrawTextCallback;
90 LPARAM lParam;
91 } DTTOPTS, *PDTTOPTS;
93 HRESULT WINAPI DrawThemeTextEx(HTHEME,HDC,int,int,LPCWSTR,int,DWORD,RECT*,
94 const DTTOPTS*);
96 #define ETDT_DISABLE 0x00000001
97 #define ETDT_ENABLE 0x00000002
98 #define ETDT_USETABTEXTURE 0x00000004
99 #define ETDT_ENABLETAB (ETDT_ENABLE|ETDT_USETABTEXTURE)
101 HRESULT WINAPI EnableThemeDialogTexture(HWND,DWORD);
102 HRESULT WINAPI EnableTheming(BOOL);
103 HRESULT WINAPI GetCurrentThemeName(LPWSTR,int,LPWSTR,int,LPWSTR,int);
105 #define STAP_ALLOW_NONCLIENT (1<<0)
106 #define STAP_ALLOW_CONTROLS (1<<1)
107 #define STAP_ALLOW_WEBCONTENT (1<<2)
109 DWORD WINAPI GetThemeAppProperties(void);
110 HRESULT WINAPI GetThemeBackgroundContentRect(HTHEME,HDC,int,int,
111 const RECT*,RECT*);
112 HRESULT WINAPI GetThemeBackgroundExtent(HTHEME,HDC,int,int,const RECT*,RECT*);
113 HRESULT WINAPI GetThemeBackgroundRegion(HTHEME,HDC,int,int,const RECT*,HRGN*);
114 HRESULT WINAPI GetThemeBool(HTHEME,int,int,int,BOOL*);
115 HRESULT WINAPI GetThemeColor(HTHEME,int,int,int,COLORREF*);
117 #if defined(_MSC_VER) || defined(__MINGW32__)
118 # define SZ_THDOCPROP_DISPLAYNAME L"DisplayName"
119 # define SZ_THDOCPROP_CANONICALNAME L"ThemeName"
120 # define SZ_THDOCPROP_TOOLTIP L"ToolTip"
121 # define SZ_THDOCPROP_AUTHOR L"author"
122 #else
123 static const WCHAR SZ_THDOCPROP_DISPLAYNAME[] = { 'D','i','s','p','l','a','y','N','a','m','e',0 };
124 static const WCHAR SZ_THDOCPROP_CANONICALNAME[] = { 'T','h','e','m','e','N','a','m','e',0 };
125 static const WCHAR SZ_THDOCPROP_TOOLTIP[] = { 'T','o','o','l','T','i','p',0 };
126 static const WCHAR SZ_THDOCPROP_AUTHOR[] = { 'a','u','t','h','o','r',0 };
127 #endif
129 HRESULT WINAPI GetThemeDocumentationProperty(LPCWSTR,LPCWSTR,LPWSTR,int);
130 HRESULT WINAPI GetThemeEnumValue(HTHEME,int,int,int,int*);
131 HRESULT WINAPI GetThemeFilename(HTHEME,int,int,int,LPWSTR,int);
132 HRESULT WINAPI GetThemeFont(HTHEME,HDC,int,int,int,LOGFONTW*);
133 HRESULT WINAPI GetThemeInt(HTHEME,int,int,int,int*);
135 /* MAX_INTLIST_COUNT was 10 before Vista */
136 #define MAX_INTLIST_COUNT 402
137 typedef struct _INTLIST {
138 int iValueCount;
139 int iValues[MAX_INTLIST_COUNT];
140 } INTLIST, *PINTLIST;
142 HRESULT WINAPI GetThemeIntList(HTHEME,int,int,int,INTLIST*);
144 typedef struct _MARGINS {
145 int cxLeftWidth;
146 int cxRightWidth;
147 int cyTopHeight;
148 int cyBottomHeight;
149 } MARGINS, *PMARGINS;
151 HRESULT WINAPI GetThemeMargins(HTHEME,HDC,int,int,int,RECT*,MARGINS*);
152 HRESULT WINAPI GetThemeMetric(HTHEME,HDC,int,int,int,int*);
154 typedef enum {
155 TS_MIN,
156 TS_TRUE,
157 TS_DRAW
158 } THEMESIZE;
160 HRESULT WINAPI GetThemePartSize(HTHEME,HDC,int,int,RECT*,THEMESIZE,SIZE*);
161 HRESULT WINAPI GetThemePosition(HTHEME,int,int,int,POINT*);
163 typedef enum {
164 PO_STATE,
165 PO_PART,
166 PO_CLASS,
167 PO_GLOBAL,
168 PO_NOTFOUND
169 } PROPERTYORIGIN;
171 HRESULT WINAPI GetThemePropertyOrigin(HTHEME,int,int,int,PROPERTYORIGIN*);
172 HRESULT WINAPI GetThemeRect(HTHEME,int,int,int,RECT*);
173 HRESULT WINAPI GetThemeString(HTHEME,int,int,int,LPWSTR,int);
174 BOOL WINAPI GetThemeSysBool(HTHEME,int);
175 COLORREF WINAPI GetThemeSysColor(HTHEME,int);
176 HBRUSH WINAPI GetThemeSysColorBrush(HTHEME,int);
177 HRESULT WINAPI GetThemeSysFont(HTHEME,int,LOGFONTW*);
178 HRESULT WINAPI GetThemeSysInt(HTHEME,int,int*);
179 int WINAPI GetThemeSysSize(HTHEME,int);
180 HRESULT WINAPI GetThemeSysString(HTHEME,int,LPWSTR,int);
181 HRESULT WINAPI GetThemeTextExtent(HTHEME,HDC,int,int,LPCWSTR,int,DWORD,
182 const RECT*,RECT*);
183 HRESULT WINAPI GetThemeTextMetrics(HTHEME,HDC,int,int,TEXTMETRICW*);
184 HRESULT WINAPI GetThemeTransitionDuration(HTHEME,int,int,int,int,DWORD*);
185 HTHEME WINAPI GetWindowTheme(HWND);
187 #define HTTB_BACKGROUNDSEG 0x0000
188 #define HTTB_FIXEDBORDER 0x0002
189 #define HTTB_CAPTION 0x0004
190 #define HTTB_RESIZINGBORDER_LEFT 0x0010
191 #define HTTB_RESIZINGBORDER_TOP 0x0020
192 #define HTTB_RESIZINGBORDER_RIGHT 0x0040
193 #define HTTB_RESIZINGBORDER_BOTTOM 0x0080
194 #define HTTB_RESIZINGBORDER \
195 (HTTB_RESIZINGBORDER_LEFT|HTTB_RESIZINGBORDER_TOP|\
196 HTTB_RESIZINGBORDER_RIGHT|HTTB_RESIZINGBORDER_BOTTOM)
197 #define HTTB_SIZINGTEMPLATE 0x0100
198 #define HTTB_SYSTEMSIZINGMARGINS 0x0200
200 #define OTD_FORCE_RECT_SIZING 0x0001
201 #define OTD_NONCLIENT 0x0002
202 #define OTD_VALIDBITS (OTD_FORCE_RECT_SIZING | OTD_NONCLIENT)
204 enum WINDOWTHEMEATTRIBUTETYPE { WTA_NONCLIENT = 1 };
206 HRESULT WINAPI HitTestThemeBackground(HTHEME,HDC,int,int,DWORD,const RECT*,
207 HRGN,POINT,WORD*);
208 BOOL WINAPI IsAppThemed(void);
209 BOOL WINAPI IsCompositionActive(void);
210 BOOL WINAPI IsThemeActive(void);
211 BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME,int,int);
212 BOOL WINAPI IsThemeDialogTextureEnabled(HWND);
213 BOOL WINAPI IsThemePartDefined(HTHEME,int,int);
214 HTHEME WINAPI OpenThemeData(HWND,LPCWSTR);
215 HTHEME WINAPI OpenThemeDataEx(HWND,LPCWSTR,DWORD);
216 void WINAPI SetThemeAppProperties(DWORD);
217 HRESULT WINAPI SetWindowTheme(HWND,LPCWSTR,LPCWSTR);
218 HRESULT WINAPI SetWindowThemeAttribute(HWND,enum WINDOWTHEMEATTRIBUTETYPE,PVOID,DWORD);
220 /* Double-buffered Drawing API */
222 typedef HANDLE HPAINTBUFFER;
224 HRESULT WINAPI BufferedPaintInit(VOID);
225 HRESULT WINAPI BufferedPaintUnInit(VOID);
227 typedef enum _BP_BUFFERFORMAT
229 BPBF_COMPATIBLEBITMAP,
230 BPBF_DIB,
231 BPBF_TOPDOWNDIB,
232 BPBF_TOPDOWNMONODIB
233 } BP_BUFFERFORMAT;
235 typedef struct _BP_PAINTPARAMS
237 DWORD cbSize;
238 DWORD dwFlags;
239 const RECT *prcExclude;
240 const BLENDFUNCTION *pBlendFunction;
241 } BP_PAINTPARAMS, *PBP_PAINTPARAMS;
243 HPAINTBUFFER WINAPI BeginBufferedPaint(HDC, const RECT *, BP_BUFFERFORMAT,
244 BP_PAINTPARAMS *,HDC *);
246 HRESULT WINAPI EndBufferedPaint(HPAINTBUFFER, BOOL);
248 HRESULT WINAPI BufferedPaintClear(HPAINTBUFFER, const RECT *);
249 HRESULT WINAPI BufferedPaintSetAlpha(HPAINTBUFFER, const RECT *, BYTE);
250 HRESULT WINAPI GetBufferedPaintBits(HPAINTBUFFER, RGBQUAD **, int *);
251 HDC WINAPI GetBufferedPaintDC(HPAINTBUFFER);
252 HDC WINAPI GetBufferedPaintTargetDC(HPAINTBUFFER);
253 HRESULT WINAPI GetBufferedPaintTargetRect(HPAINTBUFFER, RECT *prc);
255 /* double-buffered animation functions */
257 typedef HANDLE HANIMATIONBUFFER;
259 typedef enum _BP_ANIMATIONSTYLE
261 BPAS_NONE,
262 BPAS_LINEAR,
263 BPAS_CUBIC,
264 BPAS_SINE
265 } BP_ANIMATIONSTYLE;
267 typedef struct _BP_ANIMATIONPARAMS
269 DWORD cbSize;
270 DWORD dwFlags;
271 BP_ANIMATIONSTYLE style;
272 DWORD dwDuration;
273 } BP_ANIMATIONPARAMS, *PBP_ANIMATIONPARAMS;
275 HANIMATIONBUFFER WINAPI BeginBufferedAnimation(HWND, HDC, const RECT *,
276 BP_BUFFERFORMAT, BP_PAINTPARAMS *,
277 BP_ANIMATIONPARAMS *, HDC *, HDC *);
279 BOOL WINAPI BufferedPaintRenderAnimation(HWND, HDC);
280 HRESULT WINAPI BufferedPaintStopAllAnimations(HWND);
281 HRESULT WINAPI EndBufferedAnimation(HANIMATIONBUFFER, BOOL);
283 #endif