diff options
author | Littleboy | 2011-04-04 12:35:19 -0400 |
---|---|---|
committer | Julien | 2011-06-16 14:22:51 -0400 |
commit | 6c14d8a95052b68c9f076d32e520c6befac3d959 (patch) | |
tree | 065d18cf4d35158c62ba6a39ec0029dc564d46c4 /backends/taskbar/win32 | |
parent | cd09b7e74fd9552901505082166b679c39f85ccc (diff) | |
download | scummvm-rg350-6c14d8a95052b68c9f076d32e520c6befac3d959.tar.gz scummvm-rg350-6c14d8a95052b68c9f076d32e520c6befac3d959.tar.bz2 scummvm-rg350-6c14d8a95052b68c9f076d32e520c6befac3d959.zip |
BACKENDS: Integrate glib main event loop
- Unity needs a glib event loop to dispatch events.
- Cleanup whitespace and indentation
Diffstat (limited to 'backends/taskbar/win32')
-rw-r--r-- | backends/taskbar/win32/mingw-compat.h | 105 | ||||
-rw-r--r-- | backends/taskbar/win32/win32-taskbar.cpp | 38 |
2 files changed, 71 insertions, 72 deletions
diff --git a/backends/taskbar/win32/mingw-compat.h b/backends/taskbar/win32/mingw-compat.h index 6324de3b34..3ee4b9aa5d 100644 --- a/backends/taskbar/win32/mingw-compat.h +++ b/backends/taskbar/win32/mingw-compat.h @@ -48,8 +48,8 @@ DEFINE_GUID(IID_IPropertyStore,0x886d8eeb,0x8cf2,0x4446,0x8d,0x02,0xcd,0xba,0x1d // Property key typedef struct _tagpropertykey { - GUID fmtid; - DWORD pid; + GUID fmtid; + DWORD pid; } PROPERTYKEY; #define REFPROPERTYKEY const PROPERTYKEY & @@ -59,78 +59,77 @@ typedef struct tagPROPVARIANT PROPVARIANT; // Property store DECLARE_INTERFACE_(IPropertyStore, IUnknown) { - STDMETHOD (GetCount) (DWORD *cProps) PURE; - STDMETHOD (GetAt) (DWORD iProp, PROPERTYKEY *pkey) PURE; - STDMETHOD (GetValue) (REFPROPERTYKEY key, PROPVARIANT *pv) PURE; - STDMETHOD (SetValue) (REFPROPERTYKEY key, REFPROPVARIANT propvar) PURE; - STDMETHOD (Commit) (void) PURE; + STDMETHOD (GetCount) (DWORD *cProps) PURE; + STDMETHOD (GetAt) (DWORD iProp, PROPERTYKEY *pkey) PURE; + STDMETHOD (GetValue) (REFPROPERTYKEY key, PROPVARIANT *pv) PURE; + STDMETHOD (SetValue) (REFPROPERTYKEY key, REFPROPVARIANT propvar) PURE; + STDMETHOD (Commit) (void) PURE; }; typedef IPropertyStore *LPIPropertyStore; // Mingw-specific defines for taskbar integration typedef enum THUMBBUTTONMASK { - THB_BITMAP = 0x1, - THB_ICON = 0x2, - THB_TOOLTIP = 0x4, - THB_FLAGS = 0x8 + THB_BITMAP = 0x1, + THB_ICON = 0x2, + THB_TOOLTIP = 0x4, + THB_FLAGS = 0x8 } THUMBBUTTONMASK; typedef enum THUMBBUTTONFLAGS { - THBF_ENABLED = 0, - THBF_DISABLED = 0x1, - THBF_DISMISSONCLICK = 0x2, - THBF_NOBACKGROUND = 0x4, - THBF_HIDDEN = 0x8, - THBF_NONINTERACTIVE = 0x10 + THBF_ENABLED = 0, + THBF_DISABLED = 0x1, + THBF_DISMISSONCLICK = 0x2, + THBF_NOBACKGROUND = 0x4, + THBF_HIDDEN = 0x8, + THBF_NONINTERACTIVE = 0x10 } THUMBBUTTONFLAGS; typedef struct THUMBBUTTON { - THUMBBUTTONMASK dwMask; - UINT iId; - UINT iBitmap; - HICON hIcon; - WCHAR szTip[260]; - THUMBBUTTONFLAGS dwFlags; + THUMBBUTTONMASK dwMask; + UINT iId; + UINT iBitmap; + HICON hIcon; + WCHAR szTip[260]; + THUMBBUTTONFLAGS dwFlags; } THUMBBUTTON; typedef struct THUMBBUTTON *LPTHUMBBUTTON; typedef enum TBPFLAG { - TBPF_NOPROGRESS = 0, - TBPF_INDETERMINATE = 0x1, - TBPF_NORMAL = 0x2, - TBPF_ERROR = 0x4, - TBPF_PAUSED = 0x8 + TBPF_NOPROGRESS = 0, + TBPF_INDETERMINATE = 0x1, + TBPF_NORMAL = 0x2, + TBPF_ERROR = 0x4, + TBPF_PAUSED = 0x8 } TBPFLAG; // Taskbar interface DECLARE_INTERFACE_(ITaskbarList3, IUnknown) { - // IUnknown - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - // ITaskbarList - STDMETHOD(HrInit) (THIS) PURE; - STDMETHOD(AddTab) (THIS_ HWND hwnd) PURE; - STDMETHOD(DeleteTab) (THIS_ HWND hwnd) PURE; - STDMETHOD(ActivateTab) (THIS_ HWND hwnd) PURE; - STDMETHOD(SetActiveAlt) (THIS_ HWND hwnd) PURE; - STDMETHOD (MarkFullscreenWindow) (THIS_ HWND hwnd, int fFullscreen) PURE; - // ITaskbarList3 - STDMETHOD (SetProgressValue) (THIS_ HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE; - STDMETHOD (SetProgressState) (THIS_ HWND hwnd, TBPFLAG tbpFlags) PURE; - STDMETHOD (RegisterTab) (THIS_ HWND hwndTab, HWND hwndMDI) PURE; - STDMETHOD (UnregisterTab) (THIS_ HWND hwndTab) PURE; - STDMETHOD (SetTabOrder) (THIS_ HWND hwndTab, HWND hwndInsertBefore) PURE; - STDMETHOD (SetTabActive) (THIS_ HWND hwndTab, HWND hwndMDI, DWORD dwReserved) PURE; - STDMETHOD (ThumbBarAddButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE; - STDMETHOD (ThumbBarUpdateButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE; - STDMETHOD (ThumbBarSetImageList) (THIS_ HWND hwnd, HIMAGELIST himl) PURE; - STDMETHOD (SetOverlayIcon) (THIS_ HWND hwnd, HICON hIcon, LPCWSTR pszDescription) PURE; - STDMETHOD (SetThumbnailTooltip) (THIS_ HWND hwnd, LPCWSTR pszTip) PURE; - STDMETHOD (SetThumbnailClip) (THIS_ HWND hwnd, RECT *prcClip) PURE; + // IUnknown + STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + // ITaskbarList + STDMETHOD(HrInit) (THIS) PURE; + STDMETHOD(AddTab) (THIS_ HWND hwnd) PURE; + STDMETHOD(DeleteTab) (THIS_ HWND hwnd) PURE; + STDMETHOD(ActivateTab) (THIS_ HWND hwnd) PURE; + STDMETHOD(SetActiveAlt) (THIS_ HWND hwnd) PURE; + STDMETHOD (MarkFullscreenWindow) (THIS_ HWND hwnd, int fFullscreen) PURE; + // ITaskbarList3 + STDMETHOD (SetProgressValue) (THIS_ HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE; + STDMETHOD (SetProgressState) (THIS_ HWND hwnd, TBPFLAG tbpFlags) PURE; + STDMETHOD (RegisterTab) (THIS_ HWND hwndTab, HWND hwndMDI) PURE; + STDMETHOD (UnregisterTab) (THIS_ HWND hwndTab) PURE; + STDMETHOD (SetTabOrder) (THIS_ HWND hwndTab, HWND hwndInsertBefore) PURE; + STDMETHOD (SetTabActive) (THIS_ HWND hwndTab, HWND hwndMDI, DWORD dwReserved) PURE; + STDMETHOD (ThumbBarAddButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE; + STDMETHOD (ThumbBarUpdateButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE; + STDMETHOD (ThumbBarSetImageList) (THIS_ HWND hwnd, HIMAGELIST himl) PURE; + STDMETHOD (SetOverlayIcon) (THIS_ HWND hwnd, HICON hIcon, LPCWSTR pszDescription) PURE; + STDMETHOD (SetThumbnailTooltip) (THIS_ HWND hwnd, LPCWSTR pszTip) PURE; + STDMETHOD (SetThumbnailClip) (THIS_ HWND hwnd, RECT *prcClip) PURE; }; - typedef ITaskbarList3 *LPITaskbarList3; #endif // __MINGW32__ diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 91c4e2399c..c630129ea9 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -28,13 +28,13 @@ // Needed for taskbar functions #if defined(__GNUC__) #ifdef __MINGW32__ - #include "backends/taskbar/win32/mingw-compat.h" + #include "backends/taskbar/win32/mingw-compat.h" #else - #error Only compilation with MingW is supported + #error Only compilation with MingW is supported #endif #else - // Default MSVC headers for ITaskbarList3 and IShellLink - #include <SDKDDKVer.h> + // Default MSVC headers for ITaskbarList3 and IShellLink + #include <SDKDDKVer.h> #endif #include <shlobj.h> @@ -71,10 +71,10 @@ void Win32TaskbarManager::init() { // Try creating instance (on fail, _taskbar will contain NULL) HRESULT hr = CoCreateInstance(CLSID_TaskbarList, - 0, - CLSCTX_INPROC_SERVER, - IID_ITaskbarList3, - reinterpret_cast<void**> (&(_taskbar))); + 0, + CLSCTX_INPROC_SERVER, + IID_ITaskbarList3, + reinterpret_cast<void**> (&(_taskbar))); if (SUCCEEDED(hr)) { // Initialize taskbar object @@ -105,8 +105,8 @@ void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Commo HICON pIcon = (HICON)::LoadImage(NULL, path.c_str(), IMAGE_ICON, 16, 16, LR_LOADFROMFILE); if (!pIcon) { - warning("[Win32TaskbarManager::setOverlayIcon] Cannot load icon!"); - return; + warning("[Win32TaskbarManager::setOverlayIcon] Cannot load icon!"); + return; } // Sets the overlay icon @@ -206,18 +206,18 @@ Common::String Win32TaskbarManager::getIconPath(Common::String target) { } bool Win32TaskbarManager::isWin7OrLater() { - OSVERSIONINFOEX versionInfo; - DWORDLONG conditionMask = 0; + OSVERSIONINFOEX versionInfo; + DWORDLONG conditionMask = 0; - ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOEX)); - versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - versionInfo.dwMajorVersion = 6; - versionInfo.dwMinorVersion = 1; + ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOEX)); + versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + versionInfo.dwMajorVersion = 6; + versionInfo.dwMinorVersion = 1; - VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); - VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); + VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); + VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); - return VerifyVersionInfo(&versionInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask); + return VerifyVersionInfo(&versionInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask); } LPWSTR Win32TaskbarManager::ansiToUnicode(const char *s) { |