]> git.sesse.net Git - vlc/blob - include/vlc_windows_interfaces.h
Update workarounds for incomplete mingw headers
[vlc] / include / vlc_windows_interfaces.h
1 /*****************************************************************************
2  * vlc_windows_interfaces.h : Replacement for incomplete MinGW headers
3  ****************************************************************************
4  *
5  * Copyright (C) 2009-2010 VideoLAN
6  *
7  * Authors: Geoffroy Couprie <geal@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef MINGW_WORKAROUNDS_H
25 #define MINGW_WORKAROUNDS_H
26
27 #ifdef __MINGW32__
28 # include <_mingw.h>
29 #endif
30
31 #ifdef __MINGW64_VERSION_MAJOR /* mingw.org lacks this header */
32 # include <shobjidl.h>
33 #endif
34
35 #include <commctrl.h>
36 #include <basetyps.h>
37 #include <objbase.h>
38
39 /* mingw.org fails to define this */
40 #ifndef __ITaskbarList3_INTERFACE_DEFINED__
41 #define __ITaskbarList3_INTERFACE_DEFINED__
42 const GUID CLSID_TaskbarList ={ 0x56FDF344,0xFD6D,0x11d0,{0x95,0x8A,0x00,0x60,0x97,0xC9,0xA0,0x90}};
43 const GUID IID_ITaskbarList3 = { 0xea1afb91,0x9e28,0x4b86,{0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}};
44
45
46 typedef enum TBPFLAG
47 {
48     TBPF_NOPROGRESS    = 0,
49     TBPF_INDETERMINATE = 0x1,
50     TBPF_NORMAL        = 0x2,
51     TBPF_ERROR         = 0x4,
52     TBPF_PAUSED        = 0x8
53 } TBPFLAG;
54
55 typedef struct tagTHUMBBUTTON
56 {
57     DWORD dwMask;
58     UINT iId;
59     UINT iBitmap;
60     HICON hIcon;
61     //    WCHAR pszTip[ 260 ];
62     wchar_t pszTip[ 260 ];
63     DWORD dwFlags;
64 } THUMBBUTTON;
65
66 typedef struct tagTHUMBBUTTON *LPTHUMBBUTTON;
67
68 typedef enum THUMBBUTTONMASK {
69     THB_BITMAP  = 0x1,
70     THB_ICON    = 0x2,
71     THB_TOOLTIP = 0x4,
72     THB_FLAGS   = 0x8
73 } THUMBBUTTONMASK;
74
75 typedef enum THUMBBUTTONFLAGS {
76     THBF_ENABLED        = 0x0,
77     THBF_DISABLED       = 0x1,
78     THBF_DISMISSONCLICK = 0x2,
79     THBF_NOBACKGROUND   = 0x4,
80     THBF_HIDDEN         = 0x8,
81     THBF_NONINTERACTIVE = 0x10
82 } THUMBBUTTONFLAGS;
83
84 #ifndef THBN_CLICKED
85 # define THBN_CLICKED        0x1800
86 #endif
87
88 #ifdef __cplusplus
89 interface ITaskbarList : public IUnknown {
90 public:
91     virtual HRESULT WINAPI HrInit(void) = 0;
92     virtual HRESULT WINAPI AddTab(HWND hwnd) = 0;
93     virtual HRESULT WINAPI DeleteTab(HWND hwnd) = 0;
94     virtual HRESULT WINAPI ActivateTab(HWND hwnd) = 0;
95     virtual HRESULT WINAPI SetActiveAlt(HWND hwnd) = 0;
96 };
97
98 interface ITaskbarList2 : public ITaskbarList {
99 public:
100     virtual HRESULT WINAPI MarkFullscreenWindow(HWND hwnd,WINBOOL fFullscreen) = 0;
101 };
102
103 interface ITaskbarList3 : public ITaskbarList2
104 {
105     virtual HRESULT STDMETHODCALLTYPE SetProgressValue(
106         HWND hwnd,
107         ULONGLONG ullCompleted,
108         ULONGLONG ullTotal) = 0;
109
110     virtual HRESULT STDMETHODCALLTYPE SetProgressState(
111         HWND hwnd,
112         TBPFLAG tbpFlags) = 0;
113
114     virtual HRESULT STDMETHODCALLTYPE RegisterTab(
115         HWND hwndTab,
116         HWND hwndMDI) = 0;
117
118     virtual HRESULT STDMETHODCALLTYPE UnregisterTab(
119         HWND hwndTab) = 0;
120
121     virtual HRESULT STDMETHODCALLTYPE SetTabOrder(
122         HWND hwndTab,
123         HWND hwndInsertBefore) = 0;
124
125     virtual HRESULT STDMETHODCALLTYPE SetTabActive(
126         HWND hwndTab,
127         HWND hwndMDI,
128         DWORD dwReserved) = 0;
129
130     virtual HRESULT STDMETHODCALLTYPE ThumbBarAddButtons(
131         HWND hwnd,
132         UINT cButtons,
133         LPTHUMBBUTTON pButton) = 0;
134
135     virtual HRESULT STDMETHODCALLTYPE ThumbBarUpdateButtons(
136         HWND hwnd,
137         UINT cButtons,
138         LPTHUMBBUTTON pButton) = 0;
139
140     virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList(
141         HWND hwnd,
142         HIMAGELIST himl) = 0;
143
144     virtual HRESULT STDMETHODCALLTYPE SetOverlayIcon(
145         HWND hwnd,
146         HICON hIcon,
147         LPCWSTR pszDescription) = 0;
148
149     virtual HRESULT STDMETHODCALLTYPE SetThumbnailTooltip(
150         HWND hwnd,
151         LPCWSTR pszTip) = 0;
152
153     virtual HRESULT STDMETHODCALLTYPE SetThumbnailClip(
154         HWND hwnd,
155         RECT *prcClip) = 0;
156
157 };
158
159 #else /* !__cplusplus */
160
161 struct ITaskbarList3Vtbl;
162 struct ITaskbarList3 { struct ITaskbarList3Vtbl* lpVtbl; };
163 typedef struct ITaskbarList3 ITaskbarList3;
164
165 struct ITaskbarList3Vtbl
166 {
167
168     long ( WINAPI *QueryInterface )(ITaskbarList3 * This, REFIID riid, void **ppvObject);
169
170     long ( WINAPI *AddRef )(ITaskbarList3 *This);
171
172     long ( WINAPI *Release )(ITaskbarList3 *This);
173
174     long ( WINAPI *HrInit )(ITaskbarList3 *This);
175
176     long ( WINAPI *AddTab )(ITaskbarList3 *This, HWND hwnd);
177
178     long ( WINAPI *DeleteTab )(ITaskbarList3 *This, HWND hwnd);
179
180     long ( WINAPI *ActivateTab )(ITaskbarList3 *This, HWND hwnd);
181
182     long ( WINAPI *SetActiveAlt )(ITaskbarList3 *This, HWND hwnd);
183
184     long ( WINAPI *MarkFullscreenWindow )(ITaskbarList3 *This, HWND hwnd,
185         BOOL fFullscreen);
186
187     long ( WINAPI *SetProgressValue )(ITaskbarList3 *This, HWND hwnd,
188         ULONGLONG ullCompleted, ULONGLONG ullTotal);
189
190     long ( WINAPI *SetProgressState )(ITaskbarList3 *This, HWND hwnd,
191         TBPFLAG tbpFlags);
192
193     long ( WINAPI *RegisterTab )( ITaskbarList3 *This, HWND hwndTab, HWND hwndMDI);
194
195     long ( WINAPI *UnregisterTab )(ITaskbarList3 *This, HWND hwndTab);
196
197     long ( WINAPI *SetTabOrder )(ITaskbarList3 *This, HWND hwndTab,
198         HWND hwndInsertBefore);
199
200     long ( WINAPI *SetTabActive )(ITaskbarList3 *This, HWND hwndTab,
201         HWND hwndMDI, DWORD dwReserved);
202
203     long ( WINAPI *ThumbBarAddButtons )(ITaskbarList3 *This, HWND hwnd,
204         UINT cButtons, LPTHUMBBUTTON pButton);
205
206     long ( WINAPI *ThumbBarUpdateButtons )(ITaskbarList3 *This, HWND hwnd,
207         UINT cButtons, LPTHUMBBUTTON pButton);
208
209     long ( WINAPI *ThumbBarSetImageList )(ITaskbarList3 *This, HWND hwnd,
210         HIMAGELIST himl);
211
212     long ( WINAPI *SetOverlayIcon )(ITaskbarList3 *This, HWND hwnd,
213         HICON hIcon, LPCWSTR pszDescription);
214
215     long ( WINAPI *SetThumbnailTooltip )(ITaskbarList3 *This, HWND hwnd,
216         LPCWSTR pszTip);
217
218     long ( WINAPI *SetThumbnailClip )(ITaskbarList3 *This, HWND hwnd,
219         RECT *prcClip);
220
221 };
222
223 #endif /* __cplusplus */
224 #endif /* __ITaskbarList3_INTERFACE_DEFINED__ */
225
226 /* mingw-w64 also fails to define this as of 2.0.1 */
227 #ifndef __IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__
228 #define __IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__
229 const GUID IID_IApplicationAssociationRegistrationUI = {0x1f76a169,0xf994,0x40ac, {0x8f,0xc8,0x09,0x59,0xe8,0x87,0x47,0x10}};
230 const GUID CLSID_ApplicationAssociationRegistrationUI = { 0x1968106d,0xf3b5,0x44cf,{0x89,0x0e,0x11,0x6f,0xcb,0x9e,0xce,0xf1}};
231 #ifdef __cplusplus
232
233 interface IApplicationAssociationRegistrationUI : public IUnknown
234 {
235     virtual HRESULT STDMETHODCALLTYPE LaunchAdvancedAssociationUI(
236         LPCWSTR pszAppRegName) = 0;
237 };
238 #endif /* __cplusplus */
239 #endif /* __IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__ */
240
241 #endif //MINGW_WORKAROUNDS_H