diff options
author | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-12-05 21:24:48 +0000 |
---|---|---|
committer | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-12-05 21:24:48 +0000 |
commit | 9bd1328c49aafae67a6a6d9fd17063c75d8547a2 (patch) | |
tree | 7095a16dfea3dcff6b11049374b1f8befff25dd3 /hw/xwin | |
parent | bf0a760331e2fe4dbc00e78f87022c7464d9ca4f (diff) |
redone ddraw.h to be able to mix it with w32api style COM header files.
obj_base.h is not needed anymore. Using <objbase.h> instead.
Use Xwindows.h instead of windows.h
do not include win_ms.h
remove extra definition of sleep()
Set HOME to Documents and Settings/username if not set
Use Xming basedir instead of ProjectRoot for system.XWinrc
Fix callback functions to use wBOOL instead of BOOL
Fix compiler warnings. Added debug output.
Fix warning about undefined macro max
Diffstat (limited to 'hw/xwin')
-rw-r--r-- | hw/xwin/ChangeLog | 42 | ||||
-rw-r--r-- | hw/xwin/InitOutput.c | 11 | ||||
-rw-r--r-- | hw/xwin/ddraw.h | 1550 | ||||
-rw-r--r-- | hw/xwin/win.h | 4 | ||||
-rwxr-xr-x | hw/xwin/windialogs.c | 12 | ||||
-rw-r--r-- | hw/xwin/winerror.c | 1 | ||||
-rw-r--r-- | hw/xwin/winms.h | 18 | ||||
-rw-r--r-- | hw/xwin/winmultiwindowwindow.c | 22 | ||||
-rw-r--r-- | hw/xwin/winmultiwindowwm.c | 2 | ||||
-rw-r--r-- | hw/xwin/winprefs.c | 20 | ||||
-rw-r--r-- | hw/xwin/winresource.h | 2 | ||||
-rw-r--r-- | hw/xwin/winshadgdi.c | 8 | ||||
-rwxr-xr-x | hw/xwin/winwin32rootless.c | 31 | ||||
-rwxr-xr-x | hw/xwin/winwin32rootlesswindow.c | 43 |
14 files changed, 932 insertions, 834 deletions
diff --git a/hw/xwin/ChangeLog b/hw/xwin/ChangeLog index bd2a5d6f1..b6fc206d8 100644 --- a/hw/xwin/ChangeLog +++ b/hw/xwin/ChangeLog @@ -1,3 +1,43 @@ +2004-12-05 Alexander Gottwald <ago at freedesktop dot org> + + * ddraw.h: + redone ddraw.h to be able to mix it with w32api style COM header + files. + + * winmultiwindowwm.c: + * obj_base.h: + * ddraw.h: + obj_base.h is not needed anymore. Using <objbase.h> instead. + + * winms.h: + Use Xwindows.h instead of windows.h + + * winresource.h: + do not include win_ms.h + + * win.h: + remove extra definition of sleep() + + * InitOutput.c: + Set HOME to Documents and Settings/username if not set + + * winprefs.c: + Use Xming basedir instead of ProjectRoot for system.XWinrc + + * windialogs.c: + * winshadgdi.c: + * winprefs.c: + Fix callback functions to use wBOOL instead of BOOL + + * winmultiwindowwindow.c: + * winwin32rootless.c: + * winwin32rootlesswindow.c: + * winerror.c: + Fix compiler warnings. Added debug output. + + * winconfig.c: + Fix warning about undefined macro max + 2004-12-03 Alexander Gottwald <ago at freedesktop dot org> * windialogs.c: @@ -314,4 +354,4 @@ to prevent our window appearing twice in the clipboard chain. Also detect loops when they occur and try to behave in a reasonable way. -# vim:ts=8:noexpandtab +# vim:ts=8:noexpandtab:encoding=utf8 diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index d0b022bd8..6f1207bfb 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -41,6 +41,9 @@ from The Open Group. #if defined(XKB) && defined(WIN32) #include "XKBsrv.h" #endif +#ifdef RELOCATE_PROJECTROOT +#include <shlobj.h> +#endif /* @@ -622,6 +625,14 @@ winFixupPaths (void) buffer[sizeof(buffer)-1] = 0; putenv(buffer); } + if (getenv("HOME") == NULL) + { + char buffer[MAX_PATH + 5]; + strncpy(buffer, "HOME=", 5); + if(SHGetFolderPath(NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE, NULL, 0, + buffer + 5) == 0) + putenv(buffer); + } if (!g_fLogFileChanged) { static char buffer[MAX_PATH]; DWORD size = GetTempPath(sizeof(buffer), buffer); diff --git a/hw/xwin/ddraw.h b/hw/xwin/ddraw.h index f72ce1f09..0bb7aef4f 100644 --- a/hw/xwin/ddraw.h +++ b/hw/xwin/ddraw.h @@ -1,17 +1,17 @@ /* $Id$ */ -#ifndef __WINE_DDRAW_H -#define __WINE_DDRAW_H +#ifndef __XWIN_DDRAW_H +#define __XWIN_DDRAW_H #include <winnt.h> #include <wingdi.h> -#include "obj_base.h" +#include <objbase.h> -#ifdef NONAMELESSUNION -#ifndef DUMMYUNIONNAME1 +#if defined(NONAMELESSUNION) && !defined(DUMMYUNIONNAME1) #define DUMMYUNIONNAME1 u1 #endif -#endif + +#define ICOM_CALL_( xfn, p, args) (p)->lpVtbl->xfn args # ifdef UNICODE # define WINELIB_NAME_AW(func) func##W @@ -48,19 +48,19 @@ DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x2 DEFINE_GUID( IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 ); DEFINE_GUID( IID_IDirectDrawGammaControl,0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E ); -typedef struct IDirectDraw IDirectDraw,*LPDIRECTDRAW; -typedef struct IDirectDraw2 IDirectDraw2,*LPDIRECTDRAW2; -typedef struct IDirectDraw4 IDirectDraw4,*LPDIRECTDRAW4; -typedef struct IDirectDraw7 IDirectDraw7,*LPDIRECTDRAW7; -typedef struct IDirectDrawClipper IDirectDrawClipper,*LPDIRECTDRAWCLIPPER; -typedef struct IDirectDrawPalette IDirectDrawPalette,*LPDIRECTDRAWPALETTE; -typedef struct IDirectDrawSurface IDirectDrawSurface,*LPDIRECTDRAWSURFACE; -typedef struct IDirectDrawSurface2 IDirectDrawSurface2,*LPDIRECTDRAWSURFACE2; -typedef struct IDirectDrawSurface3 IDirectDrawSurface3,*LPDIRECTDRAWSURFACE3; -typedef struct IDirectDrawSurface4 IDirectDrawSurface4,*LPDIRECTDRAWSURFACE4; -typedef struct IDirectDrawSurface7 IDirectDrawSurface7,*LPDIRECTDRAWSURFACE7; -typedef struct IDirectDrawColorControl IDirectDrawColorControl,*LPDIRECTDRAWCOLORCONTROL; -typedef struct IDirectDrawGammaControl IDirectDrawGammaControl,*LPDIRECTDRAWGAMMACONTROL; +typedef struct IDirectDraw *LPDIRECTDRAW; +typedef struct IDirectDraw2 *LPDIRECTDRAW2; +typedef struct IDirectDraw4 *LPDIRECTDRAW4; +typedef struct IDirectDraw7 *LPDIRECTDRAW7; +typedef struct IDirectDrawClipper *LPDIRECTDRAWCLIPPER; +typedef struct IDirectDrawPalette *LPDIRECTDRAWPALETTE; +typedef struct IDirectDrawSurface *LPDIRECTDRAWSURFACE; +typedef struct IDirectDrawSurface2 *LPDIRECTDRAWSURFACE2; +typedef struct IDirectDrawSurface3 *LPDIRECTDRAWSURFACE3; +typedef struct IDirectDrawSurface4 *LPDIRECTDRAWSURFACE4; +typedef struct IDirectDrawSurface7 *LPDIRECTDRAWSURFACE7; +typedef struct IDirectDrawColorControl *LPDIRECTDRAWCOLORCONTROL; +typedef struct IDirectDrawGammaControl *LPDIRECTDRAWGAMMACONTROL; #define DDENUMRET_CANCEL 0 @@ -1194,115 +1194,118 @@ typedef struct tagDDDEVICEIDENTIFIER2 { /***************************************************************************** * IDirectDrawPalette interface */ -#define ICOM_INTERFACE IDirectDrawPalette -#define IDirectDrawPalette_METHODS \ - ICOM_METHOD1(HRESULT,GetCaps, LPDWORD,lpdwCaps) \ - ICOM_METHOD4(HRESULT,GetEntries, DWORD,dwFlags, DWORD,dwBase, DWORD,dwNumEntries, LPPALETTEENTRY,lpEntries) \ - ICOM_METHOD3(HRESULT,Initialize, LPDIRECTDRAW,lpDD, DWORD,dwFlags, LPPALETTEENTRY,lpDDColorTable) \ - ICOM_METHOD4(HRESULT,SetEntries, DWORD,dwFlags, DWORD,dwStartingEntry, DWORD,dwCount, LPPALETTEENTRY,lpEntries) -#define IDirectDrawPalette_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDrawPalette_METHODS -ICOM_DEFINE(IDirectDrawPalette,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDrawPalette +DECLARE_INTERFACE_(IDirectDrawPalette,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(GetCaps)(THIS_ LPDWORD lpdwCaps) PURE; + STDMETHOD(GetEntries)(THIS_ DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, DWORD dwFlags, LPPALETTEENTRY lpDDColorTable) PURE; + STDMETHOD(SetEntries)(THIS_ DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDrawPalette_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDrawPalette_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDrawPalette_Release(p) ICOM_CALL (Release,p) +#define IDirectDrawPalette_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDrawPalette_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDrawPalette_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDrawPalette methods ***/ -#define IDirectDrawPalette_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a) -#define IDirectDrawPalette_GetEntries(p,a,b,c,d) ICOM_CALL4(GetEntries,p,a,b,c,d) -#define IDirectDrawPalette_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c) -#define IDirectDrawPalette_SetEntries(p,a,b,c,d) ICOM_CALL4(SetEntries,p,a,b,c,d) +#define IDirectDrawPalette_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) +#define IDirectDrawPalette_GetEntries(p,a,b,c,d) ICOM_CALL_(GetEntries,p,(p,a,b,c,d)) +#define IDirectDrawPalette_Initialize(p,a,b,c) ICOM_CALL_(Initialize,p,(p,a,b,c)) +#define IDirectDrawPalette_SetEntries(p,a,b,c,d) ICOM_CALL_(SetEntries,p,(p,a,b,c,d)) /***************************************************************************** * IDirectDrawClipper interface */ -#define ICOM_INTERFACE IDirectDrawClipper -#define IDirectDrawClipper_METHODS \ - ICOM_METHOD3(HRESULT,GetClipList, LPRECT,lpRect, LPRGNDATA,lpClipList, LPDWORD,lpdwSize) \ - ICOM_METHOD1(HRESULT,GetHWnd, HWND*,lphWnd) \ - ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, DWORD,dwFlags) \ - ICOM_METHOD1(HRESULT,IsClipListChanged, BOOL*,lpbChanged) \ - ICOM_METHOD2(HRESULT,SetClipList, LPRGNDATA,lpClipList, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,SetHWnd, DWORD,dwFlags, HWND,hWnd) -#define IDirectDrawClipper_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDrawClipper_METHODS -ICOM_DEFINE(IDirectDrawClipper,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDrawClipper +DECLARE_INTERFACE_(IDirectDrawClipper,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(GetClipList)(THIS_ LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize) PURE; + STDMETHOD(GetHWnd)(THIS_ HWND* lphWnd) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, DWORD dwFlags) PURE; + STDMETHOD(IsClipListChanged)(THIS_ BOOL* lpbChanged) PURE; + STDMETHOD(SetClipList)(THIS_ LPRGNDATA lpClipList, DWORD dwFlags) PURE; + STDMETHOD(SetHWnd)(THIS_ DWORD dwFlags, HWND hWnd) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDrawClipper_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDrawClipper_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDrawClipper_Release(p) ICOM_CALL (Release,p) +#define IDirectDrawClipper_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDrawClipper_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDrawClipper_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDrawClipper methods ***/ -#define IDirectDrawClipper_GetClipList(p,a,b,c) ICOM_CALL3(GetClipList,p,a,b,c) -#define IDirectDrawClipper_GetHWnd(p,a) ICOM_CALL1(GetHWnd,p,a) -#define IDirectDrawClipper_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b) -#define IDirectDrawClipper_IsClipListChanged(p,a) ICOM_CALL1(IsClipListChanged,p,a) -#define IDirectDrawClipper_SetClipList(p,a,b) ICOM_CALL2(SetClipList,p,a,b) -#define IDirectDrawClipper_SetHWnd(p,a,b) ICOM_CALL2(SetHWnd,p,a,b) +#define IDirectDrawClipper_GetClipList(p,a,b,c) ICOM_CALL_(GetClipList,p,(p,a,b,c)) +#define IDirectDrawClipper_GetHWnd(p,a) ICOM_CALL_(GetHWnd,p,(p,a)) +#define IDirectDrawClipper_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) +#define IDirectDrawClipper_IsClipListChanged(p,a) ICOM_CALL_(IsClipListChanged,p,(p,a)) +#define IDirectDrawClipper_SetClipList(p,a,b) ICOM_CALL_(SetClipList,p,(p,a,b)) +#define IDirectDrawClipper_SetHWnd(p,a,b) ICOM_CALL_(SetHWnd,p,(p,a,b)) /***************************************************************************** * IDirectDraw interface */ -#define ICOM_INTERFACE IDirectDraw -#define IDirectDraw_METHODS \ - ICOM_METHOD (HRESULT,Compact) \ - ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \ - ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \ - ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE*,lplpDDSurface, IUnknown*,pUnkOuter) \ - ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE,lpDDSurface, LPDIRECTDRAWSURFACE*,lplpDupDDSurface) \ - ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK,lpEnumModesCallback) \ - ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \ - ICOM_METHOD (HRESULT,FlipToGDISurface) \ - ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \ - ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC,lpDDSurfaceDesc) \ - ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \ - ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE*,lplpGDIDDSurface) \ - ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \ - ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \ - ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \ - ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \ - ICOM_METHOD (HRESULT,RestoreDisplayMode) \ - ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \ - ICOM_METHOD3(HRESULT,SetDisplayMode, DWORD,, DWORD,, DWORD,) \ - ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent) -#define IDirectDraw_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDraw_METHODS -ICOM_DEFINE(IDirectDraw,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDraw +DECLARE_INTERFACE_(IDirectDraw,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(Compact)(THIS) PURE; + STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE; + STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE; + STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE* lplpDDSurface, IUnknown* pUnkOuter) PURE; + STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE* lplpDupDDSurface) PURE; + STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE; + STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; + STDMETHOD(FlipToGDISurface)(THIS) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; + STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE; + STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE* lplpGDIDDSurface) PURE; + STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; + STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE; + STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE; + STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE; + STDMETHOD(RestoreDisplayMode)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE; + STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD, DWORD) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDraw_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDraw_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDraw_Release(p) ICOM_CALL (Release,p) +#define IDirectDraw_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDraw_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDraw_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDraw methods ***/ -#define IDirectDraw_Compact(p) ICOM_CALL (Compact,p) -#define IDirectDraw_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c) -#define IDirectDraw_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d) -#define IDirectDraw_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c) -#define IDirectDraw_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b) -#define IDirectDraw_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d) -#define IDirectDraw_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d) -#define IDirectDraw_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p) -#define IDirectDraw_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b) -#define IDirectDraw_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a) -#define IDirectDraw_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b) -#define IDirectDraw_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a) -#define IDirectDraw_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a) -#define IDirectDraw_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a) -#define IDirectDraw_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a) -#define IDirectDraw_Initialize(p,a) ICOM_CALL1(Initialize,p,a) -#define IDirectDraw_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p) -#define IDirectDraw_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b) -#define IDirectDraw_SetDisplayMode(p,a,b,c) ICOM_CALL3(SetDisplayMode,p,a,b,c) -#define IDirectDraw_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b) +#define IDirectDraw_Compact(p) ICOM_CALL_(Compact,p,(p)) +#define IDirectDraw_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c)) +#define IDirectDraw_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d)) +#define IDirectDraw_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c)) +#define IDirectDraw_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b)) +#define IDirectDraw_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d)) +#define IDirectDraw_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d)) +#define IDirectDraw_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p)) +#define IDirectDraw_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b)) +#define IDirectDraw_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a)) +#define IDirectDraw_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b)) +#define IDirectDraw_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a)) +#define IDirectDraw_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a)) +#define IDirectDraw_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a)) +#define IDirectDraw_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a)) +#define IDirectDraw_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a)) +#define IDirectDraw_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p)) +#define IDirectDraw_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b)) +#define IDirectDraw_SetDisplayMode(p,a,b,c) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c)) +#define IDirectDraw_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b)) /* flags for Lock() */ @@ -1320,135 +1323,137 @@ ICOM_DEFINE(IDirectDraw,IUnknown) /* Note: IDirectDraw2 cannot derive from IDirectDraw because the number of * arguments of SetDisplayMode has changed ! */ -#define ICOM_INTERFACE IDirectDraw2 -#define IDirectDraw2_METHODS \ -/*0c*/ ICOM_METHOD (HRESULT,Compact) \ -/*10*/ ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \ -/*14*/ ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \ -/*18*/ ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE2*,lplpDDSurface, IUnknown*,pUnkOuter) \ -/*1c*/ ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE2,lpDDSurface, LPDIRECTDRAWSURFACE2*,lplpDupDDSurface) \ -/*20*/ ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK,lpEnumModesCallback) \ -/*24*/ ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \ -/*28*/ ICOM_METHOD (HRESULT,FlipToGDISurface) \ -/*2c*/ ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \ -/*30*/ ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC,lpDDSurfaceDesc) \ -/*34*/ ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \ -/*38*/ ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE2*,lplpGDIDDSurface) \ -/*3c*/ ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \ -/*40*/ ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \ -/*44*/ ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \ -/*48*/ ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \ -/*4c*/ ICOM_METHOD (HRESULT,RestoreDisplayMode) \ -/*50*/ ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \ -/*54*/ ICOM_METHOD5(HRESULT,SetDisplayMode, DWORD,dwWidth, DWORD,dwHeight, DWORD,dwBPP, DWORD,dwRefreshRate, DWORD,dwFlags) \ -/*58*/ ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent) \ - /* added in v2 */ \ -/*5c*/ ICOM_METHOD3(HRESULT,GetAvailableVidMem, LPDDSCAPS,lpDDCaps, LPDWORD,lpdwTotal, LPDWORD,lpdwFree) -#define IDirectDraw2_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDraw2_METHODS -ICOM_DEFINE(IDirectDraw2,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDraw2 +DECLARE_INTERFACE_(IDirectDraw2,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(Compact)(THIS) PURE; + STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE; + STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE; + STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE2* lplpDDSurface, IUnknown* pUnkOuter) PURE; + STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE2 lpDDSurface, LPDIRECTDRAWSURFACE2* lplpDupDDSurface) PURE; + STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE; + STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; + STDMETHOD(FlipToGDISurface)(THIS) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; + STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE; + STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE2* lplpGDIDDSurface) PURE; + STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; + STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE; + STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE; + STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE; + STDMETHOD(RestoreDisplayMode)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE; + STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE; + + STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDraw2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDraw2_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDraw2_Release(p) ICOM_CALL (Release,p) +#define IDirectDraw2_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDraw2_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDraw2_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDraw methods ***/ -#define IDirectDraw2_Compact(p) ICOM_CALL (Compact,p) -#define IDirectDraw2_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c) -#define IDirectDraw2_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d) -#define IDirectDraw2_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c) -#define IDirectDraw2_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b) -#define IDirectDraw2_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d) -#define IDirectDraw2_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d) -#define IDirectDraw2_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p) -#define IDirectDraw2_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b) -#define IDirectDraw2_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a) -#define IDirectDraw2_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b) -#define IDirectDraw2_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a) -#define IDirectDraw2_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a) -#define IDirectDraw2_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a) -#define IDirectDraw2_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a) -#define IDirectDraw2_Initialize(p,a) ICOM_CALL1(Initialize,p,a) -#define IDirectDraw2_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p) -#define IDirectDraw2_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b) -#define IDirectDraw2_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL5(SetDisplayMode,p,a,b,c,d,e) -#define IDirectDraw2_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b) +#define IDirectDraw2_Compact(p) ICOM_CALL_(Compact,p,(p)) +#define IDirectDraw2_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c)) +#define IDirectDraw2_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d)) +#define IDirectDraw2_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c)) +#define IDirectDraw2_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b)) +#define IDirectDraw2_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d)) +#define IDirectDraw2_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d)) +#define IDirectDraw2_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p)) +#define IDirectDraw2_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b)) +#define IDirectDraw2_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a)) +#define IDirectDraw2_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b)) +#define IDirectDraw2_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a)) +#define IDirectDraw2_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a)) +#define IDirectDraw2_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a)) +#define IDirectDraw2_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a)) +#define IDirectDraw2_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a)) +#define IDirectDraw2_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p)) +#define IDirectDraw2_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b)) +#define IDirectDraw2_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c,d,e)) +#define IDirectDraw2_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b)) /*** IDirectDraw2 methods ***/ -#define IDirectDraw2_GetAvailableVidMem(p,a,b,c) ICOM_CALL3(GetAvailableVidMem,p,a,b,c) +#define IDirectDraw2_GetAvailableVidMem(p,a,b,c) ICOM_CALL_(GetAvailableVidMem,p,(p,a,b,c)) /***************************************************************************** * IDirectDraw4 interface */ -#define ICOM_INTERFACE IDirectDraw4 -#define IDirectDraw4_METHODS \ -/*0c*/ ICOM_METHOD (HRESULT,Compact) \ -/*10*/ ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \ -/*14*/ ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \ -/*18*/ ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE4*,lplpDDSurface, IUnknown*,pUnkOuter) \ -/*1c*/ ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE4,lpDDSurface, LPDIRECTDRAWSURFACE4*,lplpDupDDSurface) \ -/*20*/ ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK2,lpEnumModesCallback) \ -/*24*/ ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK2,lpEnumSurfacesCallback) \ -/*28*/ ICOM_METHOD (HRESULT,FlipToGDISurface) \ -/*2c*/ ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \ -/*30*/ ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC2,lpDDSurfaceDesc) \ -/*34*/ ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \ -/*38*/ ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE4*,lplpGDIDDSurface) \ -/*3c*/ ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \ -/*40*/ ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \ -/*44*/ ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \ -/*48*/ ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \ -/*4c*/ ICOM_METHOD (HRESULT,RestoreDisplayMode) \ -/*50*/ ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \ -/*54*/ ICOM_METHOD5(HRESULT,SetDisplayMode, DWORD,dwWidth, DWORD,dwHeight, DWORD,dwBPP, DWORD,dwRefreshRate, DWORD,dwFlags) \ -/*58*/ ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent) \ - /* added in v2 */ \ -/*5c*/ ICOM_METHOD3(HRESULT,GetAvailableVidMem, LPDDSCAPS2,lpDDCaps, LPDWORD,lpdwTotal, LPDWORD,lpdwFree) \ - /* added in v4 */ \ - ICOM_METHOD2(HRESULT,GetSurfaceFromDC, HDC,, LPDIRECTDRAWSURFACE4*,) \ - ICOM_METHOD (HRESULT,RestoreAllSurfaces) \ - ICOM_METHOD (HRESULT,TestCooperativeLevel) \ - ICOM_METHOD2(HRESULT,GetDeviceIdentifier, LPDDDEVICEIDENTIFIER,, DWORD,) -#define IDirectDraw4_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDraw4_METHODS -ICOM_DEFINE(IDirectDraw4,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDraw4 +DECLARE_INTERFACE_(IDirectDraw4,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(Compact)(THIS) PURE; + STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE; + STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE; + STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE4* lplpDDSurface, IUnknown* pUnkOuter) PURE; + STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSurface, LPDIRECTDRAWSURFACE4* lplpDupDDSurface) PURE; + STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback) PURE; + STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback) PURE; + STDMETHOD(FlipToGDISurface)(THIS) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE; + STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE; + STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE4* lplpGDIDDSurface) PURE; + STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; + STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE; + STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE; + STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE; + STDMETHOD(RestoreDisplayMode)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE; + STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE; + + STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2 lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE; + + STDMETHOD(GetSurfaceFromDC)(THIS_ HDC , LPDIRECTDRAWSURFACE4* ) PURE; + STDMETHOD(RestoreAllSurfaces)(THIS) PURE; + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER , DWORD ) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDraw4_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDraw4_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDraw4_Release(p) ICOM_CALL (Release,p) +#define IDirectDraw4_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDraw4_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDraw4_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDraw methods ***/ -#define IDirectDraw4_Compact(p) ICOM_CALL (Compact,p) -#define IDirectDraw4_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c) -#define IDirectDraw4_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d) -#define IDirectDraw4_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c) -#define IDirectDraw4_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b) -#define IDirectDraw4_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d) -#define IDirectDraw4_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d) -#define IDirectDraw4_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p) -#define IDirectDraw4_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b) -#define IDirectDraw4_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a) -#define IDirectDraw4_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b) -#define IDirectDraw4_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a) -#define IDirectDraw4_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a) -#define IDirectDraw4_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a) -#define IDirectDraw4_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a) -#define IDirectDraw4_Initialize(p,a) ICOM_CALL1(Initialize,p,a) -#define IDirectDraw4_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p) -#define IDirectDraw4_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b) -#define IDirectDraw4_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL5(SetDisplayMode,p,a,b,c,d,e) -#define IDirectDraw4_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b) +#define IDirectDraw4_Compact(p) ICOM_CALL_(Compact,p,(p)) +#define IDirectDraw4_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c)) +#define IDirectDraw4_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d)) +#define IDirectDraw4_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c)) +#define IDirectDraw4_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b)) +#define IDirectDraw4_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d)) +#define IDirectDraw4_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d)) +#define IDirectDraw4_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p)) +#define IDirectDraw4_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b)) +#define IDirectDraw4_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a)) +#define IDirectDraw4_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b)) +#define IDirectDraw4_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a)) +#define IDirectDraw4_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a)) +#define IDirectDraw4_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a)) +#define IDirectDraw4_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a)) +#define IDirectDraw4_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a)) +#define IDirectDraw4_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p)) +#define IDirectDraw4_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b)) +#define IDirectDraw4_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c,d,e)) +#define IDirectDraw4_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b)) /*** IDirectDraw2 methods ***/ -#define IDirectDraw4_GetAvailableVidMem(p,a,b,c) ICOM_CALL3(GetAvailableVidMem,p,a,b,c) +#define IDirectDraw4_GetAvailableVidMem(p,a,b,c) ICOM_CALL_(GetAvailableVidMem,p,(p,a,b,c)) /*** IDirectDraw4 methods ***/ -#define IDirectDraw4_GetSurfaceFromDC(p,a,b) ICOM_CALL2(GetSurfaceFromDC,p,a,b) -#define IDirectDraw4_RestoreAllSurfaces(pc) ICOM_CALL (RestoreAllSurfaces,p) -#define IDirectDraw4_TestCooperativeLevel(p) ICOM_CALL (TestCooperativeLevel,p) -#define IDirectDraw4_GetDeviceIdentifier(p,a,b) ICOM_CALL2(GetDeviceIdentifier,p,a,b) +#define IDirectDraw4_GetSurfaceFromDC(p,a,b) ICOM_CALL_(GetSurfaceFromDC,p,(p,a,b)) +#define IDirectDraw4_RestoreAllSurfaces(pc) ICOM_CALL_(RestoreAllSurfaces,p,(p)) +#define IDirectDraw4_TestCooperativeLevel(p) ICOM_CALL_(TestCooperativeLevel,p,(p)) +#define IDirectDraw4_GetDeviceIdentifier(p,a,b) ICOM_CALL_(GetDeviceIdentifier,p,(p,a,b)) /***************************************************************************** @@ -1457,163 +1462,165 @@ ICOM_DEFINE(IDirectDraw4,IUnknown) /* Note: IDirectDraw7 cannot derive from IDirectDraw4; it is even documented * as not interchangeable with earlier DirectDraw interfaces. */ -#define ICOM_INTERFACE IDirectDraw7 -#define IDirectDraw7_METHODS \ -/*0c*/ ICOM_METHOD (HRESULT,Compact) \ -/*10*/ ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \ -/*14*/ ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \ -/*18*/ ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE7*,lplpDDSurface, IUnknown*,pUnkOuter) \ -/*1c*/ ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE7,lpDDSurface, LPDIRECTDRAWSURFACE7*,lplpDupDDSurface) \ -/*20*/ ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK2,lpEnumModesCallback) \ -/*24*/ ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK7,lpEnumSurfacesCallback) \ -/*28*/ ICOM_METHOD (HRESULT,FlipToGDISurface) \ -/*2c*/ ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \ -/*30*/ ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC2,lpDDSurfaceDesc) \ -/*34*/ ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \ -/*38*/ ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE7*,lplpGDIDDSurface) \ -/*3c*/ ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \ -/*40*/ ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \ -/*44*/ ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \ -/*48*/ ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \ -/*4c*/ ICOM_METHOD (HRESULT,RestoreDisplayMode) \ -/*50*/ ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \ -/*54*/ ICOM_METHOD5(HRESULT,SetDisplayMode, DWORD,dwWidth, DWORD,dwHeight, DWORD,dwBPP, DWORD,dwRefreshRate, DWORD,dwFlags) \ -/*58*/ ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent) \ - /* added in v2 */ \ -/*5c*/ ICOM_METHOD3(HRESULT,GetAvailableVidMem, LPDDSCAPS2,lpDDCaps, LPDWORD,lpdwTotal, LPDWORD,lpdwFree) \ - /* added in v4 */ \ -/*60*/ ICOM_METHOD2(HRESULT,GetSurfaceFromDC, HDC,, LPDIRECTDRAWSURFACE7*,) \ -/*64*/ ICOM_METHOD (HRESULT,RestoreAllSurfaces) \ -/*68*/ ICOM_METHOD (HRESULT,TestCooperativeLevel) \ -/*6c*/ ICOM_METHOD2(HRESULT,GetDeviceIdentifier, LPDDDEVICEIDENTIFIER2,, DWORD,) \ - /* added in v7 */ \ -/*70*/ ICOM_METHOD3(HRESULT,StartModeTest, LPSIZE,, DWORD,, DWORD,) \ -/*74*/ ICOM_METHOD2(HRESULT,EvaluateMode, DWORD,, DWORD *,) -#define IDirectDraw7_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDraw7_METHODS -ICOM_DEFINE(IDirectDraw7,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDraw7 +DECLARE_INTERFACE_(IDirectDraw7,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(Compact)(THIS) PURE; + STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE; + STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE; + STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE7* lplpDDSurface, IUnknown* pUnkOuter) PURE; + STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSurface, LPDIRECTDRAWSURFACE7* lplpDupDDSurface) PURE; + STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback) PURE; + STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback) PURE; + STDMETHOD(FlipToGDISurface)(THIS) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE; + STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE; + STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE7* lplpGDIDDSurface) PURE; + STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; + STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE; + STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE; + STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE; + STDMETHOD(RestoreDisplayMode)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE; + STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE; + + STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2 lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE; + + STDMETHOD(GetSurfaceFromDC)(THIS_ HDC , LPDIRECTDRAWSURFACE7* ) PURE; + STDMETHOD(RestoreAllSurfaces)(THIS) PURE; + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER2 , DWORD ) PURE; + + STDMETHOD(StartModeTest)(THIS_ LPSIZE , DWORD , DWORD ) PURE; + STDMETHOD(EvaluateMode)(THIS_ DWORD , DWORD * ) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDraw7_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDraw7_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDraw7_Release(p) ICOM_CALL (Release,p) +#define IDirectDraw7_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDraw7_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDraw7_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDraw methods ***/ -#define IDirectDraw7_Compact(p) ICOM_CALL (Compact,p) -#define IDirectDraw7_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c) -#define IDirectDraw7_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d) -#define IDirectDraw7_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c) -#define IDirectDraw7_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b) -#define IDirectDraw7_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d) -#define IDirectDraw7_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d) -#define IDirectDraw7_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p) -#define IDirectDraw7_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b) -#define IDirectDraw7_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a) -#define IDirectDraw7_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b) -#define IDirectDraw7_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a) -#define IDirectDraw7_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a) -#define IDirectDraw7_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a) -#define IDirectDraw7_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a) -#define IDirectDraw7_Initialize(p,a) ICOM_CALL1(Initialize,p,a) -#define IDirectDraw7_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p) -#define IDirectDraw7_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b) -#define IDirectDraw7_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL5(SetDisplayMode,p,a,b,c,d,e) -#define IDirectDraw7_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b) +#define IDirectDraw7_Compact(p) ICOM_CALL_(Compact,p,(p)) +#define IDirectDraw7_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c)) +#define IDirectDraw7_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d)) +#define IDirectDraw7_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c)) +#define IDirectDraw7_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b)) +#define IDirectDraw7_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d)) +#define IDirectDraw7_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d)) +#define IDirectDraw7_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p)) +#define IDirectDraw7_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b)) +#define IDirectDraw7_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a)) +#define IDirectDraw7_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b)) +#define IDirectDraw7_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a)) +#define IDirectDraw7_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a)) +#define IDirectDraw7_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a)) +#define IDirectDraw7_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a)) +#define IDirectDraw7_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a)) +#define IDirectDraw7_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p)) +#define IDirectDraw7_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b)) +#define IDirectDraw7_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c,d,e)) +#define IDirectDraw7_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b)) /*** added in IDirectDraw2 ***/ -#define IDirectDraw7_GetAvailableVidMem(p,a,b,c) ICOM_CALL3(GetAvailableVidMem,p,a,b,c) +#define IDirectDraw7_GetAvailableVidMem(p,a,b,c) ICOM_CALL_(GetAvailableVidMem,p,(p,a,b,c)) /*** added in IDirectDraw4 ***/ -#define IDirectDraw7_GetSurfaceFromDC(p,a,b) ICOM_CALL2(GetSurfaceFromDC,p,a,b) -#define IDirectDraw7_RestoreAllSurfaces(p) ICOM_CALL (RestoreAllSurfaces,p) -#define IDirectDraw7_TestCooperativeLevel(p) ICOM_CALL (TestCooperativeLevel,p) -#define IDirectDraw7_GetDeviceIdentifier(p,a,b) ICOM_CALL2(GetDeviceIdentifier,p,a,b) +#define IDirectDraw7_GetSurfaceFromDC(p,a,b) ICOM_CALL_(GetSurfaceFromDC,p,(p,a,b)) +#define IDirectDraw7_RestoreAllSurfaces(p) ICOM_CALL_(RestoreAllSurfaces,p,(p)) +#define IDirectDraw7_TestCooperativeLevel(p) ICOM_CALL_(TestCooperativeLevel,p,(p)) +#define IDirectDraw7_GetDeviceIdentifier(p,a,b) ICOM_CALL_(GetDeviceIdentifier,p,(p,a,b)) /*** added in IDirectDraw 7 ***/ -#define IDirectDraw7_StartModeTest(p,a,b,c) ICOM_CALL3(StartModeTest,p,a,b,c) -#define IDirectDraw7_EvaluateMode(p,a,b) ICOM_CALL2(EvaluateMode,p,a,b) +#define IDirectDraw7_StartModeTest(p,a,b,c) ICOM_CALL_(StartModeTest,p,(p,a,b,c)) +#define IDirectDraw7_EvaluateMode(p,a,b) ICOM_CALL_(EvaluateMode,p,(p,a,b)) /***************************************************************************** * IDirectDrawSurface interface */ -#define ICOM_INTERFACE IDirectDrawSurface -#define IDirectDrawSurface_METHODS \ -/*0c*/ ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE,lpDDSAttachedSurface) \ -/*10*/ ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \ -/*14*/ ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \ -/*18*/ ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \ -/*1c*/ ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \ -/*20*/ ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE,lpDDSAttachedSurface) \ -/*24*/ ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \ -/*28*/ ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \ -/*2c*/ ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE,lpDDSurfaceTargetOverride, DWORD,dwFlags) \ -/*30*/ ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS,lpDDSCaps, LPDIRECTDRAWSURFACE*,lplpDDAttachedSurface) \ -/*34*/ ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \ -/*38*/ ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS,lpDDSCaps) \ -/*3c*/ ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \ -/*40*/ ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \ -/*44*/ ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \ -/*48*/ ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \ -/*4c*/ ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \ -/*50*/ ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \ -/*54*/ ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \ -/*58*/ ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \ -/*5c*/ ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \ -/*60*/ ICOM_METHOD (HRESULT,IsLost) \ -/*64*/ ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \ -/*68*/ ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \ -/*6c*/ ICOM_METHOD (HRESULT,Restore) \ -/*70*/ ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \ -/*74*/ ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \ -/*78*/ ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \ -/*7c*/ ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \ -/*80*/ ICOM_METHOD1(HRESULT,Unlock, LPVOID,lpSurfaceData) \ -/*84*/ ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \ -/*88*/ ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \ -/*8c*/ ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE,lpDDSReference) -#define IDirectDrawSurface_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDrawSurface_METHODS -ICOM_DEFINE(IDirectDrawSurface,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDrawSurface +DECLARE_INTERFACE_(IDirectDrawSurface,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSAttachedSurface) PURE; + STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE; + STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE; + STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE; + STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE; + STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSAttachedSurface) PURE; + STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; + STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE; + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE lpDDSurfaceTargetOverride, DWORD dwFlags) PURE; + STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE* lplpDDAttachedSurface) PURE; + STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE; + STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE; + STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; + STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE; + STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE; + STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE; + STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE; + STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE; + STDMETHOD(IsLost)(THIS) PURE; + STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE; + STDMETHOD(Restore)(THIS) PURE; + STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; + STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE; + STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE; + STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE; + STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE; + STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSReference) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDrawSurface_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDrawSurface_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDrawSurface_Release(p) ICOM_CALL (Release,p) +#define IDirectDrawSurface_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDrawSurface_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDrawSurface_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDrawSurface methods ***/ -#define IDirectDrawSurface_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a) -#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a) -#define IDirectDrawSurface_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e) -#define IDirectDrawSurface_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c) -#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e) -#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b) -#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b) -#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c) -#define IDirectDrawSurface_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b) -#define IDirectDrawSurface_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b) -#define IDirectDrawSurface_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a) -#define IDirectDrawSurface_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a) -#define IDirectDrawSurface_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a) -#define IDirectDrawSurface_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b) -#define IDirectDrawSurface_GetDC(p,a) ICOM_CALL1(GetDC,p,a) -#define IDirectDrawSurface_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a) -#define IDirectDrawSurface_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b) -#define IDirectDrawSurface_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a) -#define IDirectDrawSurface_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a) -#define IDirectDrawSurface_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a) -#define IDirectDrawSurface_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b) -#define IDirectDrawSurface_IsLost(p) ICOM_CALL (IsLost,p) -#define IDirectDrawSurface_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d) -#define IDirectDrawSurface_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a) -#define IDirectDrawSurface_Restore(p) ICOM_CALL (Restore,p) -#define IDirectDrawSurface_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a) -#define IDirectDrawSurface_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b) -#define IDirectDrawSurface_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b) -#define IDirectDrawSurface_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a) -#define IDirectDrawSurface_Unlock(p,a) ICOM_CALL1(Unlock,p,a) -#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e) -#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a) -#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b) +#define IDirectDrawSurface_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a)) +#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a)) +#define IDirectDrawSurface_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c)) +#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b)) +#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b)) +#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c)) +#define IDirectDrawSurface_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b)) +#define IDirectDrawSurface_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b)) +#define IDirectDrawSurface_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a)) +#define IDirectDrawSurface_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) +#define IDirectDrawSurface_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a)) +#define IDirectDrawSurface_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b)) +#define IDirectDrawSurface_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a)) +#define IDirectDrawSurface_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a)) +#define IDirectDrawSurface_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b)) +#define IDirectDrawSurface_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a)) +#define IDirectDrawSurface_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a)) +#define IDirectDrawSurface_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a)) +#define IDirectDrawSurface_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) +#define IDirectDrawSurface_IsLost(p) ICOM_CALL_(IsLost,p,(p)) +#define IDirectDrawSurface_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d)) +#define IDirectDrawSurface_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a)) +#define IDirectDrawSurface_Restore(p) ICOM_CALL_(Restore,p,(p)) +#define IDirectDrawSurface_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a)) +#define IDirectDrawSurface_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b)) +#define IDirectDrawSurface_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b)) +#define IDirectDrawSurface_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a)) +#define IDirectDrawSurface_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a)) +#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a)) +#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b)) /***************************************************************************** @@ -1622,93 +1629,94 @@ ICOM_DEFINE(IDirectDrawSurface,IUnknown) /* Cannot inherit from IDirectDrawSurface because the LPDIRECTDRAWSURFACE parameters * have been converted to LPDIRECTDRAWSURFACE2. */ -#define ICOM_INTERFACE IDirectDrawSurface2 -#define IDirectDrawSurface2_METHODS \ - ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE2,lpDDSAttachedSurface) \ - ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \ - ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE2,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \ - ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \ - ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE2,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \ - ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE2,lpDDSAttachedSurface) \ - ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \ - ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \ - ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE2,lpDDSurfaceTargetOverride, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS,lpDDSCaps, LPDIRECTDRAWSURFACE2*,lplpDDAttachedSurface) \ - ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \ - ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS,lpDDSCaps) \ - ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \ - ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \ - ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \ - ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \ - ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \ - ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \ - ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \ - ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \ - ICOM_METHOD (HRESULT,IsLost) \ - ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \ - ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \ - ICOM_METHOD (HRESULT,Restore) \ - ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \ - ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \ - ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \ - ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \ - ICOM_METHOD1(HRESULT,Unlock, LPVOID,lpSurfaceData) \ - ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE2,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \ - ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE2,lpDDSReference) \ - /* added in v2 */ \ - ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \ - ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \ - ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags) -#define IDirectDrawSurface2_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDrawSurface2_METHODS -ICOM_DEFINE(IDirectDrawSurface2,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDrawSurface2 +DECLARE_INTERFACE_(IDirectDrawSurface2,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface) PURE; + STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE; + STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE; + STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE; + STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE; + STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface) PURE; + STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; + STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE; + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE; + STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE2* lplpDDAttachedSurface) PURE; + STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE; + STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE; + STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; + STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE; + STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE; + STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE; + STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE; + STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE; + STDMETHOD(IsLost)(THIS) PURE; + STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE; + STDMETHOD(Restore)(THIS) PURE; + STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; + STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE; + STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE; + STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE; + STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE2 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE; + STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSReference) PURE; + /* added in v2 */ + STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE; + STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDrawSurface2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDrawSurface2_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDrawSurface2_Release(p) ICOM_CALL (Release,p) +#define IDirectDrawSurface2_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDrawSurface2_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDrawSurface2_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDrawSurface methods (almost) ***/ -#define IDirectDrawSurface2_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a) -#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a) -#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e) -#define IDirectDrawSurface2_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c) -#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e) -#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b) -#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b) -#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c) -#define IDirectDrawSurface2_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b) -#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b) -#define IDirectDrawSurface2_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a) -#define IDirectDrawSurface2_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a) -#define IDirectDrawSurface2_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a) -#define IDirectDrawSurface2_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b) -#define IDirectDrawSurface2_GetDC(p,a) ICOM_CALL1(GetDC,p,a) -#define IDirectDrawSurface2_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a) -#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b) -#define IDirectDrawSurface2_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a) -#define IDirectDrawSurface2_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a) -#define IDirectDrawSurface2_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a) -#define IDirectDrawSurface2_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b) -#define IDirectDrawSurface2_IsLost(p) ICOM_CALL (IsLost,p) -#define IDirectDrawSurface2_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d) -#define IDirectDrawSurface2_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a) -#define IDirectDrawSurface2_Restore(p) ICOM_CALL (Restore,p) -#define IDirectDrawSurface2_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a) -#define IDirectDrawSurface2_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b) -#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b) -#define IDirectDrawSurface2_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a) -#define IDirectDrawSurface2_Unlock(p,a) ICOM_CALL1(Unlock,p,a) -#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e) -#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a) -#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b) +#define IDirectDrawSurface2_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a)) +#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a)) +#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface2_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c)) +#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b)) +#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b)) +#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c)) +#define IDirectDrawSurface2_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b)) +#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b)) +#define IDirectDrawSurface2_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a)) +#define IDirectDrawSurface2_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) +#define IDirectDrawSurface2_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a)) +#define IDirectDrawSurface2_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b)) +#define IDirectDrawSurface2_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a)) +#define IDirectDrawSurface2_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a)) +#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b)) +#define IDirectDrawSurface2_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a)) +#define IDirectDrawSurface2_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a)) +#define IDirectDrawSurface2_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a)) +#define IDirectDrawSurface2_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) +#define IDirectDrawSurface2_IsLost(p) ICOM_CALL_(IsLost,p,(p)) +#define IDirectDrawSurface2_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d)) +#define IDirectDrawSurface2_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a)) +#define IDirectDrawSurface2_Restore(p) ICOM_CALL_(Restore,p,(p)) +#define IDirectDrawSurface2_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a)) +#define IDirectDrawSurface2_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b)) +#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b)) +#define IDirectDrawSurface2_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a)) +#define IDirectDrawSurface2_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a)) +#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a)) +#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b)) /*** IDirectDrawSurface2 methods ***/ -#define IDirectDrawSurface2_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a) -#define IDirectDrawSurface2_PageLock(p,a) ICOM_CALL1(PageLock,p,a) -#define IDirectDrawSurface2_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a) +#define IDirectDrawSurface2_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a)) +#define IDirectDrawSurface2_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a)) +#define IDirectDrawSurface2_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a)) /***************************************************************************** @@ -1717,97 +1725,98 @@ ICOM_DEFINE(IDirectDrawSurface2,IUnknown) /* Cannot inherit from IDirectDrawSurface2 because the LPDIRECTDRAWSURFACE2 parameters * have been converted to LPDIRECTDRAWSURFACE3. */ -#define ICOM_INTERFACE IDirectDrawSurface3 -#define IDirectDrawSurface3_METHODS \ - ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE3,lpDDSAttachedSurface) \ - ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \ - ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE3,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \ - ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \ - ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE3,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \ - ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE3,lpDDSAttachedSurface) \ - ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \ - ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \ - ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE3,lpDDSurfaceTargetOverride, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS,lpDDSCaps, LPDIRECTDRAWSURFACE3*,lplpDDAttachedSurface) \ - ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \ - ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS,lpDDSCaps) \ - ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \ - ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \ - ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \ - ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \ - ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \ - ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \ - ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \ - ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \ - ICOM_METHOD (HRESULT,IsLost) \ - ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \ - ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \ - ICOM_METHOD (HRESULT,Restore) \ - ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \ - ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \ - ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \ - ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \ - ICOM_METHOD1(HRESULT,Unlock, LPVOID,lpSurfaceData) \ - ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE3,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \ - ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE3,lpDDSReference) \ - /* added in v2 */ \ - ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \ - ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \ - ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags) \ - /* added in v3 */ \ - ICOM_METHOD2(HRESULT,SetSurfaceDesc, LPDDSURFACEDESC,lpDDSD, DWORD,dwFlags) -#define IDirectDrawSurface3_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDrawSurface3_METHODS -ICOM_DEFINE(IDirectDrawSurface3,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDrawSurface3 +DECLARE_INTERFACE_(IDirectDrawSurface3,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface) PURE; + STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE; + STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE; + STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE; + STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE; + STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface) PURE; + STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; + STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE; + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE; + STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE3* lplpDDAttachedSurface) PURE; + STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE; + STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE; + STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; + STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE; + STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE; + STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE; + STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE; + STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE; + STDMETHOD(IsLost)(THIS) PURE; + STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE; + STDMETHOD(Restore)(THIS) PURE; + STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; + STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE; + STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE; + STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE; + STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE3 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE; + STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSReference) PURE; + /* added in v2 */ + STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE; + STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE; + /* added in v3 */ + STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSD, DWORD dwFlags) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDrawSurface3_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDrawSurface3_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDrawSurface3_Release(p) ICOM_CALL (Release,p) +#define IDirectDrawSurface3_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDrawSurface3_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDrawSurface3_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDrawSurface methods (almost) ***/ -#define IDirectDrawSurface3_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a) -#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a) -#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e) -#define IDirectDrawSurface3_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c) -#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e) -#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b) -#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b) -#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c) -#define IDirectDrawSurface3_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b) -#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b) -#define IDirectDrawSurface3_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a) -#define IDirectDrawSurface3_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a) -#define IDirectDrawSurface3_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a) -#define IDirectDrawSurface3_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b) -#define IDirectDrawSurface3_GetDC(p,a) ICOM_CALL1(GetDC,p,a) -#define IDirectDrawSurface3_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a) -#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b) -#define IDirectDrawSurface3_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a) -#define IDirectDrawSurface3_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a) -#define IDirectDrawSurface3_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a) -#define IDirectDrawSurface3_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b) -#define IDirectDrawSurface3_IsLost(p) ICOM_CALL (IsLost,p) -#define IDirectDrawSurface3_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d) -#define IDirectDrawSurface3_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a) -#define IDirectDrawSurface3_Restore(p) ICOM_CALL (Restore,p) -#define IDirectDrawSurface3_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a) -#define IDirectDrawSurface3_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b) -#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b) -#define IDirectDrawSurface3_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a) -#define IDirectDrawSurface3_Unlock(p,a) ICOM_CALL1(Unlock,p,a) -#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e) -#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a) -#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b) +#define IDirectDrawSurface3_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a)) +#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a)) +#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface3_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c)) +#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b)) +#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b)) +#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c)) +#define IDirectDrawSurface3_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b)) +#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b)) +#define IDirectDrawSurface3_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a)) +#define IDirectDrawSurface3_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) +#define IDirectDrawSurface3_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a)) +#define IDirectDrawSurface3_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b)) +#define IDirectDrawSurface3_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a)) +#define IDirectDrawSurface3_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a)) +#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b)) +#define IDirectDrawSurface3_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a)) +#define IDirectDrawSurface3_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a)) +#define IDirectDrawSurface3_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a)) +#define IDirectDrawSurface3_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) +#define IDirectDrawSurface3_IsLost(p) ICOM_CALL_(IsLost,p,(p)) +#define IDirectDrawSurface3_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d)) +#define IDirectDrawSurface3_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a)) +#define IDirectDrawSurface3_Restore(p) ICOM_CALL_(Restore,p,(p)) +#define IDirectDrawSurface3_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a)) +#define IDirectDrawSurface3_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b)) +#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b)) +#define IDirectDrawSurface3_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a)) +#define IDirectDrawSurface3_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a)) +#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a)) +#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b)) /*** IDirectDrawSurface2 methods ***/ -#define IDirectDrawSurface3_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a) -#define IDirectDrawSurface3_PageLock(p,a) ICOM_CALL1(PageLock,p,a) -#define IDirectDrawSurface3_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a) +#define IDirectDrawSurface3_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a)) +#define IDirectDrawSurface3_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a)) +#define IDirectDrawSurface3_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a)) /*** IDirectDrawSurface3 methods ***/ -#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) ICOM_CALL2(SetSurfaceDesc,p,a,b) +#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) ICOM_CALL_(SetSurfaceDesc,p,(p,a,b)) /***************************************************************************** @@ -1815,269 +1824,273 @@ ICOM_DEFINE(IDirectDrawSurface3,IUnknown) */ /* Cannot inherit from IDirectDrawSurface2 because DDSCAPS changed to DDSCAPS2. */ -#define ICOM_INTERFACE IDirectDrawSurface4 -#define IDirectDrawSurface4_METHODS \ - ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE4,lpDDSAttachedSurface) \ - ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \ - ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE4,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \ - ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \ - ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE4,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \ - ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE4,lpDDSAttachedSurface) \ - ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \ - ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \ - ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE4,lpDDSurfaceTargetOverride, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS2,lpDDSCaps, LPDIRECTDRAWSURFACE4*,lplpDDAttachedSurface) \ - ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \ - ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS2,lpDDSCaps) \ - ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \ - ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \ - ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \ - ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \ - ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \ - ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \ - ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \ - ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \ - ICOM_METHOD (HRESULT,IsLost) \ - ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \ - ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \ - ICOM_METHOD (HRESULT,Restore) \ - ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \ - ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \ - ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \ - ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \ - ICOM_METHOD1(HRESULT,Unlock, LPRECT,lpSurfaceData) \ - ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE4,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \ - ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE4,lpDDSReference) \ - /* added in v2 */ \ - ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \ - ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \ - ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags) \ - /* added in v3 */ \ - ICOM_METHOD2(HRESULT,SetSurfaceDesc, LPDDSURFACEDESC,lpDDSD, DWORD,dwFlags) \ - /* added in v4 */ \ - ICOM_METHOD4(HRESULT,SetPrivateData, REFGUID,, LPVOID,, DWORD,, DWORD,) \ - ICOM_METHOD3(HRESULT,GetPrivateData, REFGUID,, LPVOID,, LPDWORD,) \ - ICOM_METHOD1(HRESULT,FreePrivateData, REFGUID,) \ - ICOM_METHOD1(HRESULT,GetUniquenessValue, LPDWORD,) \ - ICOM_METHOD (HRESULT,ChangeUniquenessValue) -#define IDirectDrawSurface4_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDrawSurface4_METHODS -ICOM_DEFINE(IDirectDrawSurface4,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDrawSurface4 +DECLARE_INTERFACE_(IDirectDrawSurface4,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface) PURE; + STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE; + STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE; + STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE; + STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE; + STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface) PURE; + STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; + STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE; + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE; + STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE4* lplpDDAttachedSurface) PURE; + STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2 lpDDSCaps) PURE; + STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE; + STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; + STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE; + STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE; + STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE; + STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE; + STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE; + STDMETHOD(IsLost)(THIS) PURE; + STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE; + STDMETHOD(Restore)(THIS) PURE; + STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; + STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE; + STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE; + STDMETHOD(Unlock)(THIS_ LPRECT lpSurfaceData) PURE; + STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE4 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE; + STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSReference) PURE; + /* added in v2 */ + STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE; + STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE; + /* added in v3 */ + STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSD, DWORD dwFlags) PURE; + /* added in v4 */ + STDMETHOD(SetPrivateData)(THIS_ REFGUID , LPVOID , DWORD , DWORD ) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID , LPVOID , LPDWORD ) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID ) PURE; + STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD ) PURE; + STDMETHOD(ChangeUniquenessValue)(THIS) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDrawSurface4_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDrawSurface4_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDrawSurface4_Release(p) ICOM_CALL (Release,p) +#define IDirectDrawSurface4_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDrawSurface4_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDrawSurface4_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDrawSurface (almost) methods ***/ -#define IDirectDrawSurface4_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a) -#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a) -#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e) -#define IDirectDrawSurface4_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c) -#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e) -#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b) -#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b) -#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c) -#define IDirectDrawSurface4_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b) -#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b) -#define IDirectDrawSurface4_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a) -#define IDirectDrawSurface4_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a) -#define IDirectDrawSurface4_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a) -#define IDirectDrawSurface4_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b) -#define IDirectDrawSurface4_GetDC(p,a) ICOM_CALL1(GetDC,p,a) -#define IDirectDrawSurface4_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a) -#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b) -#define IDirectDrawSurface4_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a) -#define IDirectDrawSurface4_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a) -#define IDirectDrawSurface4_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a) -#define IDirectDrawSurface4_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b) -#define IDirectDrawSurface4_IsLost(p) ICOM_CALL (IsLost,p) -#define IDirectDrawSurface4_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d) -#define IDirectDrawSurface4_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a) -#define IDirectDrawSurface4_Restore(p) ICOM_CALL (Restore,p) -#define IDirectDrawSurface4_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a) -#define IDirectDrawSurface4_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b) -#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b) -#define IDirectDrawSurface4_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a) -#define IDirectDrawSurface4_Unlock(p,a) ICOM_CALL1(Unlock,p,a) -#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e) -#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a) -#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b) +#define IDirectDrawSurface4_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a)) +#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a)) +#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface4_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c)) +#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b)) +#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b)) +#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c)) +#define IDirectDrawSurface4_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b)) +#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b)) +#define IDirectDrawSurface4_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a)) +#define IDirectDrawSurface4_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) +#define IDirectDrawSurface4_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a)) +#define IDirectDrawSurface4_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b)) +#define IDirectDrawSurface4_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a)) +#define IDirectDrawSurface4_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a)) +#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b)) +#define IDirectDrawSurface4_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a)) +#define IDirectDrawSurface4_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a)) +#define IDirectDrawSurface4_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a)) +#define IDirectDrawSurface4_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) +#define IDirectDrawSurface4_IsLost(p) ICOM_CALL_(IsLost,p,(p)) +#define IDirectDrawSurface4_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d)) +#define IDirectDrawSurface4_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a)) +#define IDirectDrawSurface4_Restore(p) ICOM_CALL_(Restore,p,(p)) +#define IDirectDrawSurface4_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a)) +#define IDirectDrawSurface4_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b)) +#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b)) +#define IDirectDrawSurface4_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a)) +#define IDirectDrawSurface4_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a)) +#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a)) +#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b)) /*** IDirectDrawSurface2 methods ***/ -#define IDirectDrawSurface4_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a) -#define IDirectDrawSurface4_PageLock(p,a) ICOM_CALL1(PageLock,p,a) -#define IDirectDrawSurface4_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a) +#define IDirectDrawSurface4_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a)) +#define IDirectDrawSurface4_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a)) +#define IDirectDrawSurface4_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a)) /*** IDirectDrawSurface3 methods ***/ -#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) ICOM_CALL2(SetSurfaceDesc,p,a,b) +#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) ICOM_CALL_(SetSurfaceDesc,p,(p,a,b)) /*** IDirectDrawSurface4 methods ***/ -#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) ICOM_CALL4(SetPrivateData,p,a,b,c,d) -#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) ICOM_CALL3(GetPrivateData,p,a,b,c) -#define IDirectDrawSurface4_FreePrivateData(p,a) ICOM_CALL1(FreePrivateData,p,a) -#define IDirectDrawSurface4_GetUniquenessValue(p,a) ICOM_CALL1(GetUniquenessValue,p,a) -#define IDirectDrawSurface4_ChangeUniquenessValue(p) ICOM_CALL (ChangeUniquenessValue,p) +#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) ICOM_CALL_(SetPrivateData,p,(p,a,b,c,d)) +#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) ICOM_CALL_(GetPrivateData,p,(p,a,b,c)) +#define IDirectDrawSurface4_FreePrivateData(p,a) ICOM_CALL_(FreePrivateData,p,(p,a)) +#define IDirectDrawSurface4_GetUniquenessValue(p,a) ICOM_CALL_(GetUniquenessValue,p,(p,a)) +#define IDirectDrawSurface4_ChangeUniquenessValue(p) ICOM_CALL_(ChangeUniquenessValue,p,(p)) /***************************************************************************** * IDirectDrawSurface7 interface */ -#define ICOM_INTERFACE IDirectDrawSurface7 -#define IDirectDrawSurface7_METHODS \ - ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE7,lpDDSAttachedSurface) \ - ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \ - ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE7,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \ - ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \ - ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE7,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \ - ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE7,lpDDSAttachedSurface) \ - ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK7,lpEnumSurfacesCallback) \ - ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK7,lpfnCallback) \ - ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE7,lpDDSurfaceTargetOverride, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS2,lpDDSCaps, LPDIRECTDRAWSURFACE7*,lplpDDAttachedSurface) \ - ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \ - ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS2,lpDDSCaps) \ - ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \ - ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \ - ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \ - ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \ - ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \ - ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \ - ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC2,lpDDSurfaceDesc) \ - ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC2,lpDDSurfaceDesc) \ - ICOM_METHOD (HRESULT,IsLost) \ - ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC2,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \ - ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \ - ICOM_METHOD (HRESULT,Restore) \ - ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \ - ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \ - ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \ - ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \ - ICOM_METHOD1(HRESULT,Unlock, LPRECT,lpSurfaceData) \ - ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE7,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \ - ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \ - ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE7,lpDDSReference) \ - /* added in v2 */ \ - ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \ - ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \ - ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags) \ - /* added in v3 */ \ - ICOM_METHOD2(HRESULT,SetSurfaceDesc, LPDDSURFACEDESC2,lpDDSD, DWORD,dwFlags) \ - /* added in v4 */ \ - ICOM_METHOD4(HRESULT,SetPrivateData, REFGUID,, LPVOID,, DWORD,, DWORD,) \ - ICOM_METHOD3(HRESULT,GetPrivateData, REFGUID,, LPVOID,, LPDWORD,) \ - ICOM_METHOD1(HRESULT,FreePrivateData, REFGUID,) \ - ICOM_METHOD1(HRESULT,GetUniquenessValue, LPDWORD,) \ - ICOM_METHOD (HRESULT,ChangeUniquenessValue) \ - /* added in v7 */ \ - ICOM_METHOD1(HRESULT,SetPriority, DWORD,prio) \ - ICOM_METHOD1(HRESULT,GetPriority, LPDWORD,prio) \ - ICOM_METHOD1(HRESULT,SetLOD, DWORD,lod) \ - ICOM_METHOD1(HRESULT,GetLOD, LPDWORD,lod) -#define IDirectDrawSurface7_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDrawSurface7_METHODS -ICOM_DEFINE(IDirectDrawSurface7,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDrawSurface7 +DECLARE_INTERFACE_(IDirectDrawSurface7,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface) PURE; + STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE; + STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE; + STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE; + STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE; + STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface) PURE; + STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback) PURE; + STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpfnCallback) PURE; + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE; + STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE7* lplpDDAttachedSurface) PURE; + STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2 lpDDSCaps) PURE; + STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE; + STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; + STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE; + STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE; + STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE; + STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE; + STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE; + STDMETHOD(IsLost)(THIS) PURE; + STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE; + STDMETHOD(Restore)(THIS) PURE; + STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE; + STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE; + STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE; + STDMETHOD(Unlock)(THIS_ LPRECT lpSurfaceData) PURE; + STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE7 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE; + STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSReference) PURE; + /* added in v2 */ + STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE; + STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE; + /* added in v3 */ + STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSD, DWORD dwFlags) PURE; + /* added in v4 */ + STDMETHOD(SetPrivateData)(THIS_ REFGUID , LPVOID , DWORD , DWORD ) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID , LPVOID , LPDWORD ) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID ) PURE; + STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD ) PURE; + STDMETHOD(ChangeUniquenessValue)(THIS) PURE; + /* added in v7 */ + STDMETHOD(SetPriority)(THIS_ DWORD prio) PURE; + STDMETHOD(GetPriority)(THIS_ LPDWORD prio) PURE; + STDMETHOD(SetLOD)(THIS_ DWORD lod) PURE; + STDMETHOD(GetLOD)(THIS_ LPDWORD lod) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDrawSurface7_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDrawSurface7_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDrawSurface7_Release(p) ICOM_CALL (Release,p) +#define IDirectDrawSurface7_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDrawSurface7_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDrawSurface7_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDrawSurface (almost) methods ***/ -#define IDirectDrawSurface7_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a) -#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a) -#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e) -#define IDirectDrawSurface7_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c) -#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e) -#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b) -#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b) -#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c) -#define IDirectDrawSurface7_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b) -#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b) -#define IDirectDrawSurface7_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a) -#define IDirectDrawSurface7_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a) -#define IDirectDrawSurface7_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a) -#define IDirectDrawSurface7_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b) -#define IDirectDrawSurface7_GetDC(p,a) ICOM_CALL1(GetDC,p,a) -#define IDirectDrawSurface7_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a) -#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b) -#define IDirectDrawSurface7_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a) -#define IDirectDrawSurface7_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a) -#define IDirectDrawSurface7_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a) -#define IDirectDrawSurface7_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b) -#define IDirectDrawSurface7_IsLost(p) ICOM_CALL (IsLost,p) -#define IDirectDrawSurface7_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d) -#define IDirectDrawSurface7_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a) -#define IDirectDrawSurface7_Restore(p) ICOM_CALL (Restore,p) -#define IDirectDrawSurface7_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a) -#define IDirectDrawSurface7_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b) -#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b) -#define IDirectDrawSurface7_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a) -#define IDirectDrawSurface7_Unlock(p,a) ICOM_CALL1(Unlock,p,a) -#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e) -#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a) -#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b) +#define IDirectDrawSurface7_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a)) +#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a)) +#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface7_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c)) +#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b)) +#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b)) +#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c)) +#define IDirectDrawSurface7_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b)) +#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b)) +#define IDirectDrawSurface7_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a)) +#define IDirectDrawSurface7_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a)) +#define IDirectDrawSurface7_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a)) +#define IDirectDrawSurface7_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b)) +#define IDirectDrawSurface7_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a)) +#define IDirectDrawSurface7_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a)) +#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b)) +#define IDirectDrawSurface7_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a)) +#define IDirectDrawSurface7_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a)) +#define IDirectDrawSurface7_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a)) +#define IDirectDrawSurface7_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b)) +#define IDirectDrawSurface7_IsLost(p) ICOM_CALL_(IsLost,p,(p)) +#define IDirectDrawSurface7_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d)) +#define IDirectDrawSurface7_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a)) +#define IDirectDrawSurface7_Restore(p) ICOM_CALL_(Restore,p,(p)) +#define IDirectDrawSurface7_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a)) +#define IDirectDrawSurface7_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b)) +#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b)) +#define IDirectDrawSurface7_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a)) +#define IDirectDrawSurface7_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a)) +#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e)) +#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a)) +#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b)) /*** IDirectDrawSurface2 methods ***/ -#define IDirectDrawSurface7_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a) -#define IDirectDrawSurface7_PageLock(p,a) ICOM_CALL1(PageLock,p,a) -#define IDirectDrawSurface7_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a) +#define IDirectDrawSurface7_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a)) +#define IDirectDrawSurface7_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a)) +#define IDirectDrawSurface7_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a)) /*** IDirectDrawSurface3 methods ***/ -#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) ICOM_CALL2(SetSurfaceDesc,p,a,b) +#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) ICOM_CALL_(SetSurfaceDesc,p,(p,a,b)) /*** IDirectDrawSurface4 methods ***/ -#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) ICOM_CALL4(SetPrivateData,p,a,b,c,d) -#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) ICOM_CALL3(GetPrivateData,p,a,b,c) -#define IDirectDrawSurface7_FreePrivateData(p,a) ICOM_CALL1(FreePrivateData,p,a) -#define IDirectDrawSurface7_GetUniquenessValue(p,a) ICOM_CALL1(GetUniquenessValue,p,a) -#define IDirectDrawSurface7_ChangeUniquenessValue(p) ICOM_CALL (ChangeUniquenessValue,p) +#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) ICOM_CALL_(SetPrivateData,p,(p,a,b,c,d)) +#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) ICOM_CALL_(GetPrivateData,p,(p,a,b,c)) +#define IDirectDrawSurface7_FreePrivateData(p,a) ICOM_CALL_(FreePrivateData,p,(p,a)) +#define IDirectDrawSurface7_GetUniquenessValue(p,a) ICOM_CALL_(GetUniquenessValue,p,(p,a)) +#define IDirectDrawSurface7_ChangeUniquenessValue(p) ICOM_CALL_(ChangeUniquenessValue,p,(p)) /*** IDirectDrawSurface7 methods ***/ -#define IDirectDrawSurface7_SetPriority(p,a) ICOM_CALL1(SetPriority,p,a) -#define IDirectDrawSurface7_GetPriority(p,a) ICOM_CALL1(GetPriority,p,a) -#define IDirectDrawSurface7_SetLOD(p,a) ICOM_CALL1(SetLOD,p,a) -#define IDirectDrawSurface7_GetLOD(p,a) ICOM_CALL1(GetLOD,p,a) +#define IDirectDrawSurface7_SetPriority(p,a) ICOM_CALL_(SetPriority,p,(p,a)) +#define IDirectDrawSurface7_GetPriority(p,a) ICOM_CALL_(GetPriority,p,(p,a)) +#define IDirectDrawSurface7_SetLOD(p,a) ICOM_CALL_(SetLOD,p,(p,a)) +#define IDirectDrawSurface7_GetLOD(p,a) ICOM_CALL_(GetLOD,p,(p,a)) /***************************************************************************** * IDirectDrawColorControl interface */ -#define ICOM_INTERFACE IDirectDrawColorControl -#define IDirectDrawColorControl_METHODS \ - ICOM_METHOD1(HRESULT,GetColorControls, LPDDCOLORCONTROL,lpColorControl) \ - ICOM_METHOD1(HRESULT,SetColorControls, LPDDCOLORCONTROL,lpColorControl) -#define IDirectDrawColorControl_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDrawColorControl_METHODS -ICOM_DEFINE(IDirectDrawColorControl,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDrawColorControl +DECLARE_INTERFACE_(IDirectDrawColorControl,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL lpColorControl) PURE; + STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL lpColorControl) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDrawColorControl_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDrawColorControl_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDrawColorControl_Release(p) ICOM_CALL (Release,p) +#define IDirectDrawColorControl_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDrawColorControl_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDrawColorControl_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDrawColorControl methods ***/ -#define IDirectDrawColorControl_GetColorControls(p,a) ICOM_CALL(GetColorControls,p,a) -#define IDirectDrawColorControl_SetColorControls(p,a) ICOM_CALL(SetColorControls,p,a) +#define IDirectDrawColorControl_GetColorControls(p,a) ICOM_CALL_(GetColorControls,p,(p,a)) +#define IDirectDrawColorControl_SetColorControls(p,a) ICOM_CALL_(SetColorControls,p,(p,a)) /***************************************************************************** * IDirectDrawGammaControl interface */ -#define ICOM_INTERFACE IDirectDrawGammaControl -#define IDirectDrawGammaControl_METHODS \ - ICOM_METHOD2(HRESULT,GetGammaRamp, DWORD,dwFlags, LPDDGAMMARAMP,lpGammaRamp) \ - ICOM_METHOD2(HRESULT,SetGammaRamp, DWORD,dwFlags, LPDDGAMMARAMP,lpGammaRamp) -#define IDirectDrawGammaControl_IMETHODS \ - IUnknown_IMETHODS \ - IDirectDrawGammaControl_METHODS -ICOM_DEFINE(IDirectDrawGammaControl,IUnknown) -#undef ICOM_INTERFACE +#undef INTERFACE +#define INTERFACE IDirectDrawGammaControl +DECLARE_INTERFACE_(IDirectDrawGammaControl,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(GetGammaRamp)(THIS_ DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) PURE; + STDMETHOD(SetGammaRamp)(THIS_ DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) PURE; +}; /*** IUnknown methods ***/ -#define IDirectDrawGammaControl_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectDrawGammaControl_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectDrawGammaControl_Release(p) ICOM_CALL (Release,p) +#define IDirectDrawGammaControl_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b)) +#define IDirectDrawGammaControl_AddRef(p) ICOM_CALL_(AddRef,p,(p)) +#define IDirectDrawGammaControl_Release(p) ICOM_CALL_(Release,p,(p)) /*** IDirectDrawGammaControl methods ***/ -#define IDirectDrawGammaControl_GetGammaRamp(p,a,b) ICOM_CALL(GetGammaRamp,p,a,b) -#define IDirectDrawGammaControl_SetGammaRamp(p,a,b) ICOM_CALL(SetGammaRamp,p,a,b) +#define IDirectDrawGammaControl_GetGammaRamp(p,a,b) ICOM_CALL_(GetGammaRamp,p,(p,a,b)) +#define IDirectDrawGammaControl_SetGammaRamp(p,a,b) ICOM_CALL_(SetGammaRamp,p,(p,a,b)) HRESULT WINAPI DirectDrawCreate(LPGUID,LPDIRECTDRAW*,LPUNKNOWN); @@ -2087,8 +2100,9 @@ HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW,LPVOID); #define DirectDrawEnumerate WINELIB_NAME_AW(DirectDrawEnumerate) HRESULT WINAPI DirectDrawCreateClipper(DWORD,LPDIRECTDRAWCLIPPER*,LPUNKNOWN); + #ifdef __cplusplus } /* extern "C" */ #endif /* defined(__cplusplus) */ -#endif /* __WINE_DDRAW_H */ +#endif /* __XWIN_DDRAW_H */ diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 401206d53..74d3e89e0 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -140,10 +140,6 @@ #include <sys/stat.h> #include <stdio.h> -#ifndef __CYGWIN__ -#define sleep(x) Sleep(1000 * (x)) -#endif - #include <errno.h> #if defined(XWIN_MULTIWINDOWEXTWM) || defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) #include <pthread.h> diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c index ebea141d6..676b2dfd7 100755 --- a/hw/xwin/windialogs.c +++ b/hw/xwin/windialogs.c @@ -56,15 +56,15 @@ extern Bool g_fSoftwareCursor; * Local function prototypes */ -static BOOL CALLBACK +static wBOOL CALLBACK winExitDlgProc (HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam); -static BOOL CALLBACK +static wBOOL CALLBACK winChangeDepthDlgProc (HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam); -static BOOL CALLBACK +static wBOOL CALLBACK winAboutDlgProc (HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam); @@ -295,7 +295,7 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv) * Exit dialog window procedure */ -static BOOL CALLBACK +static wBOOL CALLBACK winExitDlgProc (HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam) { @@ -439,7 +439,7 @@ winDisplayDepthChangeDialog (winPrivScreenPtr pScreenPriv) * disruptive screen depth changes. */ -static BOOL CALLBACK +static wBOOL CALLBACK winChangeDepthDlgProc (HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam) { @@ -594,7 +594,7 @@ winDisplayAboutDialog (winPrivScreenPtr pScreenPriv) * Process messages for the about dialog. */ -static BOOL CALLBACK +static wBOOL CALLBACK winAboutDlgProc (HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam) { diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c index fa6212ff2..dee7574ad 100644 --- a/hw/xwin/winerror.c +++ b/hw/xwin/winerror.c @@ -93,7 +93,6 @@ OsVendorFatalError (void) void winMessageBoxF (const char *pszError, UINT uType, ...) { - int i; char * pszErrorF = NULL; char * pszMsgBox = NULL; va_list args; diff --git a/hw/xwin/winms.h b/hw/xwin/winms.h index cbd3dfbea..f3efecd5d 100644 --- a/hw/xwin/winms.h +++ b/hw/xwin/winms.h @@ -30,33 +30,17 @@ * Authors: Harold L Hunt II */ -#undef MINSHORT -#undef MAXSHORT -#undef CARD8 -#undef INT32 -#undef ATOM - #define NONAMELESSUNION #define DIRECTDRAW_VERSION 0x0300 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif -#ifndef XFree86Server -#define XFree86Server -#endif -#include <windows.h> +#include <Xwindows.h> #include <windowsx.h> -#include "obj_base.h" #include "ddraw.h" -/* - * Undefine unneeded Windows symbols that conflict - * with X symbols - */ - #undef CreateWindow -#undef FreeResource #endif /* _WINMS_H_ */ diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index fcea36c96..4a0b1e0cf 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -91,7 +91,7 @@ winCreateWindowMultiWindow (WindowPtr pWin) winWindowPriv(pWin); #if CYGMULTIWINDOW_DEBUG - ErrorF ("winCreateWindowMultiWindow - pWin: %08x\n", pWin); + ErrorF ("winCreateWindowMultiWindow - pWin: %p\n", pWin); #endif /* Call any wrapped CreateWindow function */ @@ -119,7 +119,7 @@ winDestroyWindowMultiWindow (WindowPtr pWin) winWindowPriv(pWin); #if CYGMULTIWINDOW_DEBUG - ErrorF ("winDestroyWindowMultiWindow - pWin: %08x\n", pWin); + ErrorF ("winDestroyWindowMultiWindow - pWin: %p\n", pWin); #endif /* Call any wrapped DestroyWindow function */ @@ -161,7 +161,7 @@ winPositionWindowMultiWindow (WindowPtr pWin, int x, int y) DWORD dwStyle; #if CYGMULTIWINDOW_DEBUG - ErrorF ("winPositionWindowMultiWindow - pWin: %08x\n", pWin); + ErrorF ("winPositionWindowMultiWindow - pWin: %p\n", pWin); #endif /* Call any wrapped PositionWindow function */ @@ -952,12 +952,28 @@ winAdjustXWindow (WindowPtr pWin, HWND hwnd) x = pDraw->x + GetSystemMetrics (SM_XVIRTUALSCREEN); y = pDraw->y + GetSystemMetrics (SM_YVIRTUALSCREEN); SetRect (&rcDraw, x, y, x + pDraw->width, y + pDraw->height); +#ifdef CYGMULTIWINDOW_DEBUG + winDebug("\tDrawable extend {%d, %d, %d, %d}, {%d, %d}\n", + rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom, + rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top); +#endif dwExStyle = GetWindowLongPtr (hwnd, GWL_EXSTYLE); dwStyle = GetWindowLongPtr (hwnd, GWL_STYLE); +#ifdef CYGMULTIWINDOW_DEBUG + winDebug("\tWindowStyle: %08x %08x\n", dwStyle, dwExStyle); +#endif AdjustWindowRectEx (&rcDraw, dwStyle, FALSE, dwExStyle); /* The source of adjust */ GetWindowRect (hwnd, &rcWin); +#ifdef CYGMULTIWINDOW_DEBUG + winDebug("\tWindow extend {%d, %d, %d, %d}, {%d, %d}\n", + rcWin.left, rcWin.top, rcWin.right, rcWin.bottom, + rcWin.right - rcWin.left, rcWin.bottom - rcWin.top); + winDebug("\tDraw extend {%d, %d, %d, %d}, {%d, %d}\n", + rcDraw.left, rcDraw.top, rcDraw.right, rcDraw.bottom, + rcDraw.right - rcDraw.left, rcDraw.bottom - rcDraw.top); +#endif if (EqualRect (&rcDraw, &rcWin)) { /* Bail if no adjust is needed */ diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index ccd1c8099..6a58ed298 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -58,7 +58,7 @@ #endif /* Local headers */ -#include "obj_base.h" +#include "objbase.h" #include "ddraw.h" #include "winwindow.h" #include "windowswmstr.h" diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c index e59de037f..35a1a9fa5 100644 --- a/hw/xwin/winprefs.c +++ b/hw/xwin/winprefs.c @@ -36,9 +36,7 @@ #endif #include "win.h" -/* Fixups to prevent collisions between Windows and X headers */ -#define ATOM DWORD -#include <windows.h> +#include <Xwindows.h> #include <shellapi.h> #include "winprefs.h" @@ -52,6 +50,8 @@ extern DWORD g_dwCurrentThreadID; #endif +extern const char *winGetBaseDir(void); + /* From winmultiwindowflex.l, the real parser */ extern void parse_file (FILE *fp); @@ -171,7 +171,7 @@ MakeMenu (char *name, * Callback routine that is executed once per window class. * Removes or creates custom window settings depending on LPARAM */ -static BOOL CALLBACK +static wBOOL CALLBACK ReloadEnumWindowsProc (HWND hwnd, LPARAM lParam) { HICON hicon; @@ -734,10 +734,16 @@ LoadPreferences () /* No home file found, check system default */ if (!prefFile) { - prefFile = fopen (PROJECTROOT"/lib/X11/system.XWinrc", "r"); + char buffer[MAX_PATH]; +#ifdef RELOCATE_PROJECTROOT + snprintf(buffer, sizeof(buffer), "%s\\system.XWinrc", winGetBaseDir()); +#else + strncpy(buffer, PROJECTROOT"/lib/X11/system.XWinrc", sizeof(buffer)); +#endif + buffer[sizeof(buffer)-1] = 0; + prefFile = fopen (buffer, "r"); if (prefFile) - ErrorF ("winPrefsLoadPreferences: %s\n", - PROJECTROOT"/lib/X11/system.XWinrc"); + ErrorF ("winPrefsLoadPreferences: %s\n", buffer); } /* If we could open it, then read the settings and close it */ diff --git a/hw/xwin/winresource.h b/hw/xwin/winresource.h index ca69521a1..c9b23ffc3 100644 --- a/hw/xwin/winresource.h +++ b/hw/xwin/winresource.h @@ -30,8 +30,6 @@ * Authors: Harold L Hunt II */ -#include "winms.h" - /* * Local defines diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c index 71a993acf..54faebeec 100644 --- a/hw/xwin/winshadgdi.c +++ b/hw/xwin/winshadgdi.c @@ -46,10 +46,10 @@ extern HWND g_hDlgExit; */ #ifdef XWIN_MULTIWINDOW -static BOOL CALLBACK +static wBOOL CALLBACK winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam); -static BOOL CALLBACK +static wBOOL CALLBACK winRedrawDamagedWindowShadowGDI (HWND hwnd, LPARAM lParam); #endif @@ -293,7 +293,7 @@ winQueryRGBBitsAndMasks (ScreenPtr pScreen) * Redraw all ---? */ -static BOOL CALLBACK +static wBOOL CALLBACK winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam) { if (hwnd == (HWND)lParam) @@ -303,7 +303,7 @@ winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam) return TRUE; } -static BOOL CALLBACK +static wBOOL CALLBACK winRedrawDamagedWindowShadowGDI (HWND hwnd, LPARAM lParam) { BoxPtr pDamage = (BoxPtr)lParam; diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c index e654b5c24..4a065f4f9 100755 --- a/hw/xwin/winwin32rootless.c +++ b/hw/xwin/winwin32rootless.c @@ -53,7 +53,6 @@ #define ULW_OPAQUE 0x00000004 #define AC_SRC_ALPHA 0x01 - /* * Local function */ @@ -455,16 +454,29 @@ winMWExtWMMoveFrame (RootlessFrameID wid, ScreenPtr pScreen, int iNewX, int iNew /* Store the origin, height, and width in a rectangle structure */ SetRect (&rcNew, iX, iY, iX + iWidth, iY + iHeight); +#ifdef CYGMULTIWINDOW_DEBUG + winDebug("\tWindow {%d, %d, %d, %d}, {%d, %d}\n", + rcNew.left, rcNew.top, rcNew.right, rcNew.bottom, + rcNew.right - rcNew.left, rcNew.bottom - rcNew.top); +#endif /* * Calculate the required size of the Windows window rectangle, * given the size of the Windows window client area. */ AdjustWindowRectEx (&rcNew, dwStyle, FALSE, dwExStyle); +#ifdef CYGMULTIWINDOW_DEBUG + winDebug("\tAdjusted {%d, %d, %d, %d}, {%d, %d}\n", + rcNew.left, rcNew.top, rcNew.right, rcNew.bottom, + rcNew.right - rcNew.left, rcNew.bottom - rcNew.top); +#endif g_fNoConfigureWindow = TRUE; SetWindowPos (pRLWinPriv->hWnd, NULL, rcNew.left, rcNew.top, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER); g_fNoConfigureWindow = FALSE; +#if CYGMULTIWINDOW_DEBUG + winDebug ("winMWExtWMMoveFrame (%08x) done\n", (int) pRLWinPriv); +#endif } void @@ -646,7 +658,7 @@ winMWExtWMReshapeFrame (RootlessFrameID wid, RegionPtr pShape) #endif hRgn = winMWExtWMCreateRgnFromRegion (pShape); - + /* Create region for non-client area */ GetWindowRect (pRLWinPriv->hWnd, &rcWindow); GetClientRect (pRLWinPriv->hWnd, &rcClient); @@ -708,7 +720,7 @@ winMWExtWMStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesPerRow) winDebug ("\tpScreenPriv %08X\n", (int) pScreenPriv); winDebug ("\tpScreenInfo %08X\n", (int) pScreenInfo); winDebug ("\t(%d, %d)\n", (int)pRLWinPriv->pFrame->width, - (int) -pRLWinPriv->pFrame->height); + (int) pRLWinPriv->pFrame->height); #endif if (pRLWinPriv->hdcScreen == NULL) { @@ -796,10 +808,11 @@ winMWExtWMStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesPerRow) if (dibsection.dsBmih.biHeight < 0) { /* FIXME: Figure out why biHeight is sometimes negative */ - ErrorF ("winMWExtWMStartDrawing - WEIRDNESS - biHeight " - "still negative: %d\n" - "winAllocateFBShadowGDI - WEIRDNESS - Flipping biHeight sign\n", - (int) dibsection.dsBmih.biHeight); + ErrorF ("winMWExtWMStartDrawing - WEIRDNESS - " + "biHeight still negative: %d\n", + (int) dibsection.dsBmih.biHeight); + ErrorF ("winMWExtWMStartDrawing - WEIRDNESS - " + "Flipping biHeight sign\n"); dibsection.dsBmih.biHeight = -dibsection.dsBmih.biHeight; } @@ -829,8 +842,8 @@ winMWExtWMStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesPerRow) { ErrorF ("winMWExtWMStartDrawing - Already window was destroyed \n"); } -#if CYGMULTIWINDOW_DEBUG && FALSE - winDebug ("winMWExtWMStartDrawing - done (0x08%x) 0x%08x %d\n", +#if CYGMULTIWINDOW_DEBUG + winDebug ("winMWExtWMStartDrawing - done (0x%08x) 0x%08x %d\n", (int) pRLWinPriv, (unsigned int)pRLWinPriv->pfb, (unsigned int)pRLWinPriv->dwWidthBytes); #endif diff --git a/hw/xwin/winwin32rootlesswindow.c b/hw/xwin/winwin32rootlesswindow.c index f3605a216..a08cb6820 100755 --- a/hw/xwin/winwin32rootlesswindow.c +++ b/hw/xwin/winwin32rootlesswindow.c @@ -106,10 +106,10 @@ winMWExtWMReorderWindows (ScreenPtr pScreen) void winMWExtWMMoveXWindow (WindowPtr pWin, int x, int y) { - XID *vlist = malloc(sizeof(long)*2); + CARD32 *vlist = malloc(sizeof(CARD32)*2); - (CARD32*)vlist[0] = x; - (CARD32*)vlist[1] = y; + vlist[0] = x; + vlist[1] = y; ConfigureWindow (pWin, CWX | CWY, vlist, wClient(pWin)); free(vlist); } @@ -122,10 +122,10 @@ winMWExtWMMoveXWindow (WindowPtr pWin, int x, int y) void winMWExtWMResizeXWindow (WindowPtr pWin, int w, int h) { - XID *vlist = malloc(sizeof(long)*2); + CARD32 *vlist = malloc(sizeof(CARD32)*2); - (CARD32*)vlist[0] = w; - (CARD32*)vlist[1] = h; + vlist[0] = w; + vlist[1] = h; ConfigureWindow (pWin, CWWidth | CWHeight, vlist, wClient(pWin)); free(vlist); } @@ -138,12 +138,12 @@ winMWExtWMResizeXWindow (WindowPtr pWin, int w, int h) void winMWExtWMMoveResizeXWindow (WindowPtr pWin, int x, int y, int w, int h) { - XID *vlist = malloc(sizeof(long)*4); + CARD32 *vlist = malloc(sizeof(long)*4); - (CARD32*)vlist[0] = x; - (CARD32*)vlist[1] = y; - (CARD32*)vlist[2] = w; - (CARD32*)vlist[3] = h; + vlist[0] = x; + vlist[1] = y; + vlist[2] = w; + vlist[3] = h; ConfigureWindow (pWin, CWX | CWY | CWWidth | CWHeight, vlist, wClient(pWin)); free(vlist); @@ -272,12 +272,22 @@ winMWExtWMUpdateWindowDecoration (win32RootlessWindowPtr pRLWinPriv, pRLWinPriv->pFrame->x + pRLWinPriv->pFrame->width, pRLWinPriv->pFrame->y + pRLWinPriv->pFrame->height); +#ifdef CYGMULTIWINDOW_DEBUG + winDebug("\tWindow extend {%d, %d, %d, %d}, {%d, %d}\n", + rcNew.left, rcNew.top, rcNew.right, rcNew.bottom, + rcNew.right - rcNew.left, rcNew.bottom - rcNew.top); +#endif /* */ AdjustWindowRectEx (&rcNew, WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW, FALSE, WS_EX_APPWINDOW); +#ifdef CYGMULTIWINDOW_DEBUG + winDebug("\tAdjusted {%d, %d, %d, %d}, {%d, %d}\n", + rcNew.left, rcNew.top, rcNew.right, rcNew.bottom, + rcNew.right - rcNew.left, rcNew.bottom - rcNew.top); +#endif /* Calculate position deltas */ iDx = pRLWinPriv->pFrame->x - rcNew.left; iDy = pRLWinPriv->pFrame->y - rcNew.top; @@ -295,11 +305,22 @@ winMWExtWMUpdateWindowDecoration (win32RootlessWindowPtr pRLWinPriv, SetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE, WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW); +#ifdef CYGMULTIWINDOW_DEBUG + winDebug("\tWindowStyle: %08x %08x\n", + WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW, + WS_EX_APPWINDOW); +#endif /* Position the Windows window */ +#ifdef CYGMULTIWINDOW_DEBUG + winDebug("\tMoved {%d, %d, %d, %d}, {%d, %d}\n", + rcNew.left, rcNew.top, rcNew.right, rcNew.bottom, + rcNew.right - rcNew.left, rcNew.bottom - rcNew.top); +#endif SetWindowPos (pRLWinPriv->hWnd, NULL, rcNew.left, rcNew.top, rcNew.right - rcNew.left, rcNew.bottom - rcNew.top, showCmd); + wmMsg.hwndWindow = pRLWinPriv->hWnd; wmMsg.iWindow = (Window)pRLWinPriv->pFrame->win->drawable.id; |