ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

dialogs/win32/mingw-compat.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  */
00021 
00022 // TODO: Remove header when the latest changes to the Windows SDK have been integrated into MingW
00023 //       For reference, the interface definitions here are imported from the SDK headers and MingW-w64
00024 
00025 #ifndef BACKEND_WIN32_DIALOGS_MINGW_H
00026 #define BACKEND_WIN32_DIALOGS_MINGW_H
00027 
00028 #if defined(WIN32)
00029 #if defined(__GNUC__)
00030 #ifdef __MINGW32__
00031 
00032 #ifdef _WIN32_WINNT
00033     #undef _WIN32_WINNT
00034 #endif
00035 #define _WIN32_WINNT 0x0501
00036 #include <windows.h>
00037 #include <commctrl.h>
00038 #include <initguid.h>
00039 #include <shlwapi.h>
00040 #include <shlguid.h>
00041 
00042 // MinGW does not understand COM interfaces
00043 #pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
00044 
00045 // Dialog GUID definitions
00046 DEFINE_GUID(CLSID_FileOpenDialog, 0xdc1c5a9c, 0xe88a, 0x4dde, 0xa5,0xa1, 0x60,0xf8,0x2a,0x20,0xae,0xf7);
00047 DEFINE_GUID(IID_IFileOpenDialog, 0xd57c7288, 0xd4ad, 0x4768, 0xbe,0x02, 0x9d,0x96,0x95,0x32,0xd9,0x60);
00048 DEFINE_GUID(IID_IShellItem, 0x43826d1e, 0xe718, 0x42ee, 0xbc,0x55, 0xa1,0xe2,0x61,0xc3,0x7b,0xfe);
00049 
00050 typedef enum _SIGDN {
00051     SIGDN_NORMALDISPLAY = 0,
00052     SIGDN_PARENTRELATIVEPARSING = 0x80018001,
00053     SIGDN_DESKTOPABSOLUTEPARSING    = 0x80028000,
00054     SIGDN_PARENTRELATIVEEDITING = 0x80031001,
00055     SIGDN_DESKTOPABSOLUTEEDITING    = 0x8004c000,
00056     SIGDN_FILESYSPATH   = 0x80058000,
00057     SIGDN_URL   = 0x80068000,
00058     SIGDN_PARENTRELATIVEFORADDRESSBAR   = 0x8007c001,
00059     SIGDN_PARENTRELATIVE    = 0x80080001,
00060     SIGDN_PARENTRELATIVEFORUI   = 0x80094001
00061 }   SIGDN;
00062 
00063 enum _SICHINTF {
00064     SICHINT_DISPLAY = 0,
00065     SICHINT_ALLFIELDS   = 0x80000000,
00066     SICHINT_CANONICAL   = 0x10000000,
00067     SICHINT_TEST_FILESYSPATH_IF_NOT_EQUAL   = 0x20000000
00068 } ;
00069 typedef DWORD SICHINTF;
00070 
00071 // Shell item
00072 #define INTERFACE IShellItem
00073 DECLARE_INTERFACE_(IShellItem, IUnknown) {  
00074     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
00075     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
00076     STDMETHOD_(ULONG,Release) (THIS) PURE;
00077     STDMETHOD (BindToHandler) (IBindCtx *pbc, REFGUID bhid, REFIID riid, void **ppv) PURE;
00078     STDMETHOD (GetParent) (IShellItem **ppsi) PURE;
00079     STDMETHOD (GetDisplayName) (SIGDN sigdnName, LPWSTR *ppszName) PURE;
00080     STDMETHOD (GetAttributes) (SFGAOF sfgaoMask, SFGAOF *psfgaoAttribs) PURE;
00081     STDMETHOD (Compare) (IShellItem *psi, SICHINTF hint, int *piOrder) PURE;
00082 };
00083 #undef INTERFACE
00084 
00085 // Mingw-specific defines for dialog integration
00086 typedef struct _COMDLG_FILTERSPEC {
00087     LPCWSTR pszName;
00088     LPCWSTR pszSpec;
00089 } COMDLG_FILTERSPEC;
00090 
00091 typedef enum FDAP {
00092     FDAP_BOTTOM = 0,
00093     FDAP_TOP    = 1
00094 }   FDAP;
00095 
00096 enum _FILEOPENDIALOGOPTIONS {
00097     FOS_OVERWRITEPROMPT = 0x2,
00098     FOS_STRICTFILETYPES = 0x4,
00099     FOS_NOCHANGEDIR = 0x8,
00100     FOS_PICKFOLDERS = 0x20,
00101     FOS_FORCEFILESYSTEM = 0x40,
00102     FOS_ALLNONSTORAGEITEMS  = 0x80,
00103     FOS_NOVALIDATE  = 0x100,
00104     FOS_ALLOWMULTISELECT    = 0x200,
00105     FOS_PATHMUSTEXIST   = 0x800,
00106     FOS_FILEMUSTEXIST   = 0x1000,
00107     FOS_CREATEPROMPT    = 0x2000,
00108     FOS_SHAREAWARE  = 0x4000,
00109     FOS_NOREADONLYRETURN    = 0x8000,
00110     FOS_NOTESTFILECREATE    = 0x10000,
00111     FOS_HIDEMRUPLACES   = 0x20000,
00112     FOS_HIDEPINNEDPLACES    = 0x40000,
00113     FOS_NODEREFERENCELINKS  = 0x100000,
00114     FOS_DONTADDTORECENT = 0x2000000,
00115     FOS_FORCESHOWHIDDEN = 0x10000000,
00116     FOS_DEFAULTNOMINIMODE   = 0x20000000,
00117     FOS_FORCEPREVIEWPANEON  = 0x40000000,
00118     FOS_SUPPORTSTREAMABLEITEMS  = 0x80000000
00119 };
00120 typedef DWORD FILEOPENDIALOGOPTIONS;
00121 
00122 // TODO: Need to implement these if they ever get used
00123 typedef interface IFileDialogEvents IFileDialogEvents;
00124 typedef interface IShellItemFilter IShellItemFilter;
00125 typedef interface IShellItemArray IShellItemArray;
00126 
00127 // Open dialog interface
00128 #define INTERFACE IFileOpenDialog
00129 DECLARE_INTERFACE_(IFileOpenDialog, IUnknown) {
00130     // IUnknown
00131     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
00132     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
00133     STDMETHOD_(ULONG,Release) (THIS) PURE;
00134     // IModalWindow
00135     STDMETHOD (Show) (THIS_ HWND hwndOwner) PURE;
00136     // IFileDialog
00137     STDMETHOD (SetFileTypes) (THIS_ UINT cFileTypes, const COMDLG_FILTERSPEC *rgFilterSpec) PURE;
00138     STDMETHOD (SetFileTypeIndex) (THIS_ UINT iFileType) PURE;
00139     STDMETHOD (GetFileTypeIndex) (THIS_ UINT *piFileType) PURE;
00140     STDMETHOD (Advise) (THIS_ IFileDialogEvents *pfde, DWORD *pdwCookie) PURE;
00141     STDMETHOD (Unadvise) (THIS_ DWORD dwCookie) PURE;
00142     STDMETHOD (SetOptions) (THIS_ FILEOPENDIALOGOPTIONS fos) PURE;
00143     STDMETHOD (GetOptions) (THIS_ FILEOPENDIALOGOPTIONS *pfos) PURE;
00144     STDMETHOD (SetDefaultFolder) (THIS_ IShellItem *psi) PURE;
00145     STDMETHOD (SetFolder) (THIS_ IShellItem *psi) PURE;
00146     STDMETHOD (GetFolder) (THIS_ IShellItem **ppsi) PURE;
00147     STDMETHOD (GetCurrentSelection) (THIS_ IShellItem **ppsi) PURE;
00148     STDMETHOD (SetFileName) (THIS_ LPCWSTR pszName) PURE;
00149     STDMETHOD (GetFileName) (THIS_ LPWSTR *pszName) PURE;
00150     STDMETHOD (SetTitle) (THIS_ LPCWSTR pszTitle) PURE;
00151     STDMETHOD (SetOkButtonLabel) (THIS_ LPCWSTR pszText) PURE;
00152     STDMETHOD (SetFileNameLabel) (THIS_ LPCWSTR pszLabel) PURE;
00153     STDMETHOD (GetResult) (THIS_ IShellItem **ppsi) PURE;
00154     STDMETHOD (AddPlace) (THIS_ IShellItem *psi, FDAP fdap) PURE;
00155     STDMETHOD (SetDefaultExtension) (THIS_ LPCWSTR pszDefaultExtension) PURE;
00156     STDMETHOD (Close) (THIS_ HRESULT hr) PURE;
00157     STDMETHOD (SetClientGuid) (THIS_ REFGUID guid) PURE;
00158     STDMETHOD (ClearClientData) (THIS) PURE;
00159     STDMETHOD (SetFilter) (THIS_ IShellItemFilter *pFilter) PURE;
00160     // IFileOpenDialog
00161     STDMETHOD (GetResults) (THIS_ IShellItemArray **ppenum) PURE;
00162     STDMETHOD (GetSelectedItems) (THIS_ IShellItemArray **ppsai) PURE;
00163 };
00164 #undef INTERFACE
00165 
00166 #endif // __MINGW32__
00167 #endif // __GNUC__
00168 #endif // WIN32
00169 
00170 #endif // BACKEND_WIN32_DIALOGS_MINGW_H


Generated on Sat Mar 16 2019 05:01:46 for ResidualVM by doxygen 1.7.1
curved edge   curved edge