vlc_windows_interfaces.h 7.3 KB
Newer Older
1
/*****************************************************************************
2
 * vlc_windows_interfaces.h : Replacement for incomplete MinGW headers
3
 ****************************************************************************
4 5
 *
 * Copyright (C) 2009-2010 VideoLAN
6 7 8
 *
 * Authors: Geoffroy Couprie <geal@videolan.org>
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
9 10 11
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
12 13 14 15
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
16 17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
18
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
19 20 21
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 23
 *****************************************************************************/

24 25
#ifndef MINGW_WORKAROUNDS_H
#define MINGW_WORKAROUNDS_H
26

27 28
#ifdef __MINGW32__
# include <_mingw.h>
29 30
#endif

31 32
#ifdef __MINGW64_VERSION_MAJOR /* mingw.org lacks this header */
# include <shobjidl.h>
33
#endif
34

35 36 37
#include <commctrl.h>
#include <basetyps.h>
#include <objbase.h>
38

Rafaël Carré's avatar
Rafaël Carré committed
39 40 41
/* rpcndr.h defines small not only for idl */
#undef small

42 43 44 45
/* mingw.org fails to define this */
#ifndef __ITaskbarList3_INTERFACE_DEFINED__
#define __ITaskbarList3_INTERFACE_DEFINED__
const GUID CLSID_TaskbarList ={ 0x56FDF344,0xFD6D,0x11d0,{0x95,0x8A,0x00,0x60,0x97,0xC9,0xA0,0x90}};
46 47 48 49
const GUID IID_ITaskbarList3 = { 0xea1afb91,0x9e28,0x4b86,{0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}};


typedef enum TBPFLAG
50 51 52 53 54 55 56
{
    TBPF_NOPROGRESS    = 0,
    TBPF_INDETERMINATE = 0x1,
    TBPF_NORMAL        = 0x2,
    TBPF_ERROR         = 0x4,
    TBPF_PAUSED        = 0x8
} TBPFLAG;
57 58

typedef struct tagTHUMBBUTTON
59
{
60 61 62 63
    DWORD dwMask;
    UINT iId;
    UINT iBitmap;
    HICON hIcon;
64
    //    WCHAR pszTip[ 260 ];
65 66
    wchar_t pszTip[ 260 ];
    DWORD dwFlags;
67
} THUMBBUTTON;
68 69 70

typedef struct tagTHUMBBUTTON *LPTHUMBBUTTON;

71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
typedef enum THUMBBUTTONMASK {
    THB_BITMAP  = 0x1,
    THB_ICON    = 0x2,
    THB_TOOLTIP = 0x4,
    THB_FLAGS   = 0x8
} THUMBBUTTONMASK;

typedef enum THUMBBUTTONFLAGS {
    THBF_ENABLED        = 0x0,
    THBF_DISABLED       = 0x1,
    THBF_DISMISSONCLICK = 0x2,
    THBF_NOBACKGROUND   = 0x4,
    THBF_HIDDEN         = 0x8,
    THBF_NONINTERACTIVE = 0x10
} THUMBBUTTONFLAGS;

#ifdef __cplusplus
interface ITaskbarList : public IUnknown {
public:
    virtual HRESULT WINAPI HrInit(void) = 0;
    virtual HRESULT WINAPI AddTab(HWND hwnd) = 0;
    virtual HRESULT WINAPI DeleteTab(HWND hwnd) = 0;
    virtual HRESULT WINAPI ActivateTab(HWND hwnd) = 0;
    virtual HRESULT WINAPI SetActiveAlt(HWND hwnd) = 0;
};

interface ITaskbarList2 : public ITaskbarList {
public:
    virtual HRESULT WINAPI MarkFullscreenWindow(HWND hwnd,WINBOOL fFullscreen) = 0;
};

interface ITaskbarList3 : public ITaskbarList2
{
    virtual HRESULT STDMETHODCALLTYPE SetProgressValue(
        HWND hwnd,
        ULONGLONG ullCompleted,
        ULONGLONG ullTotal) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetProgressState(
        HWND hwnd,
        TBPFLAG tbpFlags) = 0;

    virtual HRESULT STDMETHODCALLTYPE RegisterTab(
        HWND hwndTab,
        HWND hwndMDI) = 0;

    virtual HRESULT STDMETHODCALLTYPE UnregisterTab(
        HWND hwndTab) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetTabOrder(
        HWND hwndTab,
        HWND hwndInsertBefore) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetTabActive(
        HWND hwndTab,
        HWND hwndMDI,
        DWORD dwReserved) = 0;

    virtual HRESULT STDMETHODCALLTYPE ThumbBarAddButtons(
        HWND hwnd,
        UINT cButtons,
        LPTHUMBBUTTON pButton) = 0;

    virtual HRESULT STDMETHODCALLTYPE ThumbBarUpdateButtons(
        HWND hwnd,
        UINT cButtons,
        LPTHUMBBUTTON pButton) = 0;

    virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList(
        HWND hwnd,
        HIMAGELIST himl) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetOverlayIcon(
        HWND hwnd,
        HICON hIcon,
        LPCWSTR pszDescription) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetThumbnailTooltip(
        HWND hwnd,
        LPCWSTR pszTip) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetThumbnailClip(
        HWND hwnd,
        RECT *prcClip) = 0;

};

#else /* !__cplusplus */

struct ITaskbarList3Vtbl;
struct ITaskbarList3 { struct ITaskbarList3Vtbl* lpVtbl; };
typedef struct ITaskbarList3 ITaskbarList3;

struct ITaskbarList3Vtbl
165
{
166

167
    long ( WINAPI *QueryInterface )(ITaskbarList3 * This, REFIID riid, void **ppvObject);
168

169
    long ( WINAPI *AddRef )(ITaskbarList3 *This);
170

171
    long ( WINAPI *Release )(ITaskbarList3 *This);
172

173
    long ( WINAPI *HrInit )(ITaskbarList3 *This);
174

175
    long ( WINAPI *AddTab )(ITaskbarList3 *This, HWND hwnd);
176

177
    long ( WINAPI *DeleteTab )(ITaskbarList3 *This, HWND hwnd);
178

179
    long ( WINAPI *ActivateTab )(ITaskbarList3 *This, HWND hwnd);
180

181
    long ( WINAPI *SetActiveAlt )(ITaskbarList3 *This, HWND hwnd);
182

183
    long ( WINAPI *MarkFullscreenWindow )(ITaskbarList3 *This, HWND hwnd,
184
        BOOL fFullscreen);
185

186
    long ( WINAPI *SetProgressValue )(ITaskbarList3 *This, HWND hwnd,
187
        ULONGLONG ullCompleted, ULONGLONG ullTotal);
188

189
    long ( WINAPI *SetProgressState )(ITaskbarList3 *This, HWND hwnd,
190
        TBPFLAG tbpFlags);
191

192
    long ( WINAPI *RegisterTab )( ITaskbarList3 *This, HWND hwndTab, HWND hwndMDI);
193

194
    long ( WINAPI *UnregisterTab )(ITaskbarList3 *This, HWND hwndTab);
195

196
    long ( WINAPI *SetTabOrder )(ITaskbarList3 *This, HWND hwndTab,
197
        HWND hwndInsertBefore);
198

199 200
    long ( WINAPI *SetTabActive )(ITaskbarList3 *This, HWND hwndTab,
        HWND hwndMDI, DWORD dwReserved);
201

202
    long ( WINAPI *ThumbBarAddButtons )(ITaskbarList3 *This, HWND hwnd,
203
        UINT cButtons, LPTHUMBBUTTON pButton);
204

205
    long ( WINAPI *ThumbBarUpdateButtons )(ITaskbarList3 *This, HWND hwnd,
206
        UINT cButtons, LPTHUMBBUTTON pButton);
207

208
    long ( WINAPI *ThumbBarSetImageList )(ITaskbarList3 *This, HWND hwnd,
209
        HIMAGELIST himl);
210

211
    long ( WINAPI *SetOverlayIcon )(ITaskbarList3 *This, HWND hwnd,
212
        HICON hIcon, LPCWSTR pszDescription);
213

214
    long ( WINAPI *SetThumbnailTooltip )(ITaskbarList3 *This, HWND hwnd,
215
        LPCWSTR pszTip);
216

217
    long ( WINAPI *SetThumbnailClip )(ITaskbarList3 *This, HWND hwnd,
218 219
        RECT *prcClip);

220
};
221

222 223
#endif /* __cplusplus */
#endif /* __ITaskbarList3_INTERFACE_DEFINED__ */
224

225 226 227 228 229 230
/* mingw-w64 also fails to define these as of 2.0.1 */

#ifndef THBN_CLICKED
# define THBN_CLICKED        0x1800
#endif

231 232 233 234
#ifndef __IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__
#define __IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__
const GUID IID_IApplicationAssociationRegistrationUI = {0x1f76a169,0xf994,0x40ac, {0x8f,0xc8,0x09,0x59,0xe8,0x87,0x47,0x10}};
const GUID CLSID_ApplicationAssociationRegistrationUI = { 0x1968106d,0xf3b5,0x44cf,{0x89,0x0e,0x11,0x6f,0xcb,0x9e,0xce,0xf1}};
235
#ifdef __cplusplus
236 237 238 239 240

interface IApplicationAssociationRegistrationUI : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE LaunchAdvancedAssociationUI(
        LPCWSTR pszAppRegName) = 0;
241
};
242 243
#endif /* __cplusplus */
#endif /* __IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__ */
244

245
#endif //MINGW_WORKAROUNDS_H