ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mingw-compat.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 // TODO: Remove header when the latest changes to the Windows SDK have been integrated into MingW
23 // For reference, the interface definitions here are imported the SDK headers and from the
24 // EcWin7 project (https://github.com/colomboe/EcWin7)
25 
26 #ifndef BACKEND_WIN32_TASKBAR_MINGW_H
27 #define BACKEND_WIN32_TASKBAR_MINGW_H
28 
29 #if defined(WIN32)
30 #if defined(__GNUC__)
31 #ifdef __MINGW32__
32 
33 #ifdef _WIN32_WINNT
34  #undef _WIN32_WINNT
35 #endif
36 #define _WIN32_WINNT 0x0501
37 #include <windows.h>
38 #include <commctrl.h>
39 #include <initguid.h>
40 #include <shlwapi.h>
41 #include <shlguid.h>
42 #define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK
43 
44 extern const GUID CLSID_ShellLink;
45 
46 // Shard enumeration value
47 #define SHARD_LINK 0x00000006
48 
49 // Taskbar GUID definitions
50 DEFINE_GUID(CLSID_TaskbarList,0x56fdf344,0xfd6d,0x11d0,0x95,0x8a,0x0,0x60,0x97,0xc9,0xa0,0x90);
51 DEFINE_GUID(IID_ITaskbarList3,0xea1afb91,0x9e28,0x4b86,0x90,0xE9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf);
52 DEFINE_GUID(IID_IPropertyStore,0x886d8eeb,0x8cf2,0x4446,0x8d,0x02,0xcd,0xba,0x1d,0xbd,0xcf,0x99);
53 
54 // Property key
55 typedef struct _tagpropertykey {
56  GUID fmtid;
57  DWORD pid;
58 } PROPERTYKEY;
59 
60 #define REFPROPERTYKEY const PROPERTYKEY &
61 
62 typedef struct tagPROPVARIANT PROPVARIANT;
63 #define REFPROPVARIANT const PROPVARIANT &
64 
65 // Property store
66 DECLARE_INTERFACE_(IPropertyStore, IUnknown) {
67  STDMETHOD (GetCount) (DWORD *cProps) PURE;
68  STDMETHOD (GetAt) (DWORD iProp, PROPERTYKEY *pkey) PURE;
69  STDMETHOD (GetValue) (REFPROPERTYKEY key, PROPVARIANT *pv) PURE;
70  STDMETHOD (SetValue) (REFPROPERTYKEY key, REFPROPVARIANT propvar) PURE;
71  STDMETHOD (Commit) (void) PURE;
72 
73 private:
74  ~IPropertyStore();
75 };
76 typedef IPropertyStore *LPIPropertyStore;
77 
78 // Mingw-specific defines for taskbar integration
79 typedef enum THUMBBUTTONMASK {
80  THB_BITMAP = 0x1,
81  THB_ICON = 0x2,
82  THB_TOOLTIP = 0x4,
83  THB_FLAGS = 0x8
84 } THUMBBUTTONMASK;
85 
86 typedef enum THUMBBUTTONFLAGS {
87  THBF_ENABLED = 0,
88  THBF_DISABLED = 0x1,
89  THBF_DISMISSONCLICK = 0x2,
90  THBF_NOBACKGROUND = 0x4,
91  THBF_HIDDEN = 0x8,
92  THBF_NONINTERACTIVE = 0x10
93 } THUMBBUTTONFLAGS;
94 
95 typedef struct THUMBBUTTON {
96  THUMBBUTTONMASK dwMask;
97  UINT iId;
98  UINT iBitmap;
99  HICON hIcon;
100  WCHAR szTip[260];
101  THUMBBUTTONFLAGS dwFlags;
102 } THUMBBUTTON;
103 typedef struct THUMBBUTTON *LPTHUMBBUTTON;
104 
105 typedef enum TBPFLAG {
106  TBPF_NOPROGRESS = 0,
107  TBPF_INDETERMINATE = 0x1,
108  TBPF_NORMAL = 0x2,
109  TBPF_ERROR = 0x4,
110  TBPF_PAUSED = 0x8
111 } TBPFLAG;
112 
113 // Taskbar interface
114 DECLARE_INTERFACE_(ITaskbarList3, IUnknown) {
115  // IUnknown
116  STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
117  STDMETHOD_(ULONG,AddRef) (THIS) PURE;
118  STDMETHOD_(ULONG,Release) (THIS) PURE;
119  // ITaskbarList
120  STDMETHOD(HrInit) (THIS) PURE;
121  STDMETHOD(AddTab) (THIS_ HWND hwnd) PURE;
122  STDMETHOD(DeleteTab) (THIS_ HWND hwnd) PURE;
123  STDMETHOD(ActivateTab) (THIS_ HWND hwnd) PURE;
124  STDMETHOD(SetActiveAlt) (THIS_ HWND hwnd) PURE;
125  STDMETHOD (MarkFullscreenWindow) (THIS_ HWND hwnd, int fFullscreen) PURE;
126  // ITaskbarList3
127  STDMETHOD (SetProgressValue) (THIS_ HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE;
128  STDMETHOD (SetProgressState) (THIS_ HWND hwnd, TBPFLAG tbpFlags) PURE;
129  STDMETHOD (RegisterTab) (THIS_ HWND hwndTab, HWND hwndMDI) PURE;
130  STDMETHOD (UnregisterTab) (THIS_ HWND hwndTab) PURE;
131  STDMETHOD (SetTabOrder) (THIS_ HWND hwndTab, HWND hwndInsertBefore) PURE;
132  STDMETHOD (SetTabActive) (THIS_ HWND hwndTab, HWND hwndMDI, DWORD dwReserved) PURE;
133  STDMETHOD (ThumbBarAddButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE;
134  STDMETHOD (ThumbBarUpdateButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE;
135  STDMETHOD (ThumbBarSetImageList) (THIS_ HWND hwnd, HIMAGELIST himl) PURE;
136  STDMETHOD (SetOverlayIcon) (THIS_ HWND hwnd, HICON hIcon, LPCWSTR pszDescription) PURE;
137  STDMETHOD (SetThumbnailTooltip) (THIS_ HWND hwnd, LPCWSTR pszTip) PURE;
138  STDMETHOD (SetThumbnailClip) (THIS_ HWND hwnd, RECT *prcClip) PURE;
139 
140 private:
141  ~ITaskbarList3();
142 };
143 
144 typedef ITaskbarList3 *LPITaskbarList3;
145 
146 #endif // __MINGW32__
147 #endif // __GNUC__
148 #endif // WIN32
149 
150 #endif // BACKEND_WIN32_TASKBAR_MINGW_H