1999-01-17 17:32:32 +01:00
|
|
|
/*
|
2002-06-01 01:06:46 +02:00
|
|
|
* This file defines the macros and types necessary to define COM interfaces,
|
2002-11-08 19:54:44 +01:00
|
|
|
* and the three most basic COM interfaces: IUnknown and IClassFactory.
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* Copyright (C) 1999 Francois Gouget
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1999-01-17 17:32:32 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_WINE_OBJ_BASE_H
|
|
|
|
#define __WINE_WINE_OBJ_BASE_H
|
|
|
|
|
1999-05-22 13:41:38 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* define ICOM_MSVTABLE_COMPAT
|
|
|
|
* to implement the microsoft com vtable compatibility workaround for g++.
|
|
|
|
*
|
|
|
|
* NOTE: Turning this option on will produce a winelib that is incompatible
|
|
|
|
* with the binary emulator.
|
|
|
|
*
|
|
|
|
* If the compiler supports the com_interface attribute, leave this off, and
|
1999-11-07 20:25:25 +01:00
|
|
|
* define the ICOM_USE_COM_INTERFACE_ATTRIBUTE macro below. This may also
|
|
|
|
* require the addition of the -vtable-thunks option for g++.
|
1999-05-22 13:41:38 +02:00
|
|
|
*
|
2000-12-02 21:17:13 +01:00
|
|
|
* If you aren't interested in Winelib C++ compatibility at all, leave both
|
1999-05-22 13:41:38 +02:00
|
|
|
* options off.
|
1999-11-07 20:25:25 +01:00
|
|
|
*
|
|
|
|
* The preferable method for using ICOM_USE_COM_INTERFACE_ATTRIBUTE macro
|
2000-12-02 21:17:13 +01:00
|
|
|
* would be to define it only for your Winelib application. This allows you
|
2002-06-01 01:06:46 +02:00
|
|
|
* to have both binary and Winelib compatibility for C and C++ at the same
|
1999-11-07 20:25:25 +01:00
|
|
|
* time :)
|
1999-05-22 13:41:38 +02:00
|
|
|
*/
|
|
|
|
/* #define ICOM_MSVTABLE_COMPAT 1 */
|
|
|
|
/* #define ICOM_USE_COM_INTERFACE_ATTRIBUTE 1 */
|
1999-01-17 17:32:32 +01:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* Defines the basic types
|
|
|
|
*/
|
|
|
|
#include "wtypes.h"
|
2000-08-03 06:19:24 +02:00
|
|
|
#include "guiddef.h"
|
1999-01-17 17:32:32 +01:00
|
|
|
|
2000-10-19 22:32:18 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-10-12 22:44:41 +02:00
|
|
|
#ifndef NONAMELESSSTRUCT
|
1999-05-22 13:41:38 +02:00
|
|
|
#define LISet32(li, v) ((li).HighPart = (v) < 0 ? -1 : 0, (li).LowPart = (v))
|
|
|
|
#define ULISet32(li, v) ((li).HighPart = 0, (li).LowPart = (v))
|
2000-10-12 22:44:41 +02:00
|
|
|
#else
|
|
|
|
#define LISet32(li, v) ((li).s.HighPart = (v) < 0 ? -1 : 0, (li).s.LowPart = (v))
|
|
|
|
#define ULISet32(li, v) ((li).s.HighPart = 0, (li).s.LowPart = (v))
|
|
|
|
#endif
|
1999-05-22 13:41:38 +02:00
|
|
|
|
1999-01-17 17:32:32 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* GUID API
|
|
|
|
*/
|
1999-02-10 07:42:03 +01:00
|
|
|
HRESULT WINAPI StringFromCLSID16(REFCLSID id, LPOLESTR16*);
|
1999-02-26 12:11:13 +01:00
|
|
|
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR*);
|
1999-02-10 07:42:03 +01:00
|
|
|
|
1999-01-17 17:32:32 +01:00
|
|
|
HRESULT WINAPI CLSIDFromString16(LPCOLESTR16, CLSID *);
|
1999-02-26 12:11:13 +01:00
|
|
|
HRESULT WINAPI CLSIDFromString(LPCOLESTR, CLSID *);
|
1999-02-10 07:42:03 +01:00
|
|
|
|
1999-01-17 17:32:32 +01:00
|
|
|
HRESULT WINAPI CLSIDFromProgID16(LPCOLESTR16 progid, LPCLSID riid);
|
1999-02-26 12:11:13 +01:00
|
|
|
HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid);
|
1999-01-17 17:32:32 +01:00
|
|
|
|
2000-02-25 21:58:25 +01:00
|
|
|
HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID);
|
|
|
|
|
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax);
|
1999-01-17 17:32:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* Macros to define a COM interface
|
|
|
|
*/
|
|
|
|
/*
|
2002-06-01 01:06:46 +02:00
|
|
|
* The goal of the following set of definitions is to provide a way to use the same
|
|
|
|
* header file definitions to provide both a C interface and a C++ object oriented
|
|
|
|
* interface to COM interfaces. The type of interface is selected automatically
|
|
|
|
* depending on the language but it is always possible to get the C interface in C++
|
1999-01-17 17:32:32 +01:00
|
|
|
* by defining CINTERFACE.
|
|
|
|
*
|
|
|
|
* It is based on the following assumptions:
|
|
|
|
* - all COM interfaces derive from IUnknown, this should not be a problem.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - the header file only defines the interface, the actual fields are defined
|
1999-01-17 17:32:32 +01:00
|
|
|
* separately in the C file implementing the interface.
|
|
|
|
*
|
2002-06-01 01:06:46 +02:00
|
|
|
* The natural approach to this problem would be to make sure we get a C++ class and
|
1999-01-17 17:32:32 +01:00
|
|
|
* virtual methods in C++ and a structure with a table of pointer to functions in C.
|
2002-06-01 01:06:46 +02:00
|
|
|
* Unfortunately the layout of the virtual table is compiler specific, the layout of
|
|
|
|
* g++ virtual tables is not the same as that of an egcs virtual table which is not the
|
|
|
|
* same as that generated by Visual C+. There are workarounds to make the virtual tables
|
1999-01-17 17:32:32 +01:00
|
|
|
* compatible via padding but unfortunately the one which is imposed to the WINE emulator
|
|
|
|
* by the Windows binaries, i.e. the Visual C++ one, is the most compact of all.
|
|
|
|
*
|
2002-06-01 01:06:46 +02:00
|
|
|
* So the solution I finally adopted does not use virtual tables. Instead I use inline
|
1999-01-17 17:32:32 +01:00
|
|
|
* non virtual methods that dereference the method pointer themselves and perform the call.
|
|
|
|
*
|
|
|
|
* Let's take Direct3D as an example:
|
|
|
|
*
|
|
|
|
* #define ICOM_INTERFACE IDirect3D
|
1999-02-10 07:42:03 +01:00
|
|
|
* #define IDirect3D_METHODS \
|
1999-04-25 21:01:52 +02:00
|
|
|
* ICOM_METHOD1(HRESULT,Initialize, REFIID,) \
|
|
|
|
* ICOM_METHOD2(HRESULT,EnumDevices, LPD3DENUMDEVICESCALLBACK,, LPVOID,) \
|
|
|
|
* ICOM_METHOD2(HRESULT,CreateLight, LPDIRECT3DLIGHT*,, IUnknown*,) \
|
|
|
|
* ICOM_METHOD2(HRESULT,CreateMaterial,LPDIRECT3DMATERIAL*,, IUnknown*,) \
|
|
|
|
* ICOM_METHOD2(HRESULT,CreateViewport,LPDIRECT3DVIEWPORT*,, IUnknown*,) \
|
|
|
|
* ICOM_METHOD2(HRESULT,FindDevice, LPD3DFINDDEVICESEARCH,, LPD3DFINDDEVICERESULT,)
|
1999-02-10 07:42:03 +01:00
|
|
|
* #define IDirect3D_IMETHODS \
|
1999-02-18 17:02:41 +01:00
|
|
|
* IUnknown_IMETHODS \
|
|
|
|
* IDirect3D_METHODS
|
1999-02-10 07:42:03 +01:00
|
|
|
* ICOM_DEFINE(IDirect3D,IUnknown)
|
1999-01-17 17:32:32 +01:00
|
|
|
* #undef ICOM_INTERFACE
|
|
|
|
*
|
1999-02-10 07:42:03 +01:00
|
|
|
* #ifdef ICOM_CINTERFACE
|
1999-01-17 17:32:32 +01:00
|
|
|
* // *** IUnknown methods *** //
|
1999-02-10 07:42:03 +01:00
|
|
|
* #define IDirect3D_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
|
|
|
|
* #define IDirect3D_AddRef(p) ICOM_CALL (AddRef,p)
|
|
|
|
* #define IDirect3D_Release(p) ICOM_CALL (Release,p)
|
1999-01-17 17:32:32 +01:00
|
|
|
* // *** IDirect3D methods *** //
|
|
|
|
* #define IDirect3D_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
|
|
|
|
* #define IDirect3D_EnumDevices(p,a,b) ICOM_CALL2(EnumDevice,p,a,b)
|
|
|
|
* #define IDirect3D_CreateLight(p,a,b) ICOM_CALL2(CreateLight,p,a,b)
|
|
|
|
* #define IDirect3D_CreateMaterial(p,a,b) ICOM_CALL2(CreateMaterial,p,a,b)
|
|
|
|
* #define IDirect3D_CreateViewport(p,a,b) ICOM_CALL2(CreateViewport,p,a,b)
|
|
|
|
* #define IDirect3D_FindDevice(p,a,b) ICOM_CALL2(FindDevice,p,a,b)
|
|
|
|
* #endif
|
|
|
|
*
|
|
|
|
* Comments:
|
2002-06-01 01:06:46 +02:00
|
|
|
* - The ICOM_INTERFACE macro is used in the ICOM_METHOD macros to define the type of the 'this'
|
|
|
|
* pointer. Defining this macro here saves us the trouble of having to repeat the interface
|
|
|
|
* name everywhere. Note however that because of the way macros work, a macro like ICOM_METHOD1
|
|
|
|
* cannot use 'ICOM_INTERFACE##_VTABLE' because this would give 'ICOM_INTERFACE_VTABLE' and not
|
1999-01-17 17:32:32 +01:00
|
|
|
* 'IDirect3D_VTABLE'.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - ICOM_METHODS defines the methods specific to this interface. It is then aggregated with the
|
1999-02-10 07:42:03 +01:00
|
|
|
* inherited methods to form ICOM_IMETHODS.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - ICOM_IMETHODS defines the list of methods that are inheritable from this interface. It must
|
|
|
|
* be written manually (rather than using a macro to generate the equivalent code) to avoid
|
1999-03-17 16:16:35 +01:00
|
|
|
* macro recursion (which compilers don't like).
|
2002-06-01 01:06:46 +02:00
|
|
|
* - The ICOM_DEFINE finally declares all the structures necessary for the interface. We have to
|
1999-03-17 16:16:35 +01:00
|
|
|
* explicitly use the interface name for macro expansion reasons again.
|
2002-06-01 01:06:46 +02:00
|
|
|
* Inherited methods are inherited in C by using the IDirect3D_METHODS macro and the parent's
|
|
|
|
* Xxx_IMETHODS macro. In C++ we need only use the IDirect3D_METHODS since method inheritance
|
1999-03-17 16:16:35 +01:00
|
|
|
* is taken care of by the language.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - In C++ the ICOM_METHOD macros generate a function prototype and a call to a function pointer
|
|
|
|
* method. This means using once 't1 p1, t2 p2, ...' and once 'p1, p2' without the types. The
|
|
|
|
* only way I found to handle this is to have one ICOM_METHOD macro per number of parameters and
|
1999-01-17 17:32:32 +01:00
|
|
|
* to have it take only the type information (with const if necessary) as parameters.
|
2002-06-01 01:06:46 +02:00
|
|
|
* The 'undef ICOM_INTERFACE' is here to remind you that using ICOM_INTERFACE in the following
|
|
|
|
* macros will not work. This time it's because the ICOM_CALL macro expansion is done only once
|
|
|
|
* the 'IDirect3D_Xxx' macro is expanded. And by that time ICOM_INTERFACE will be long gone
|
1999-01-17 17:32:32 +01:00
|
|
|
* anyway.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - You may have noticed the double commas after each parameter type. This allows you to put the
|
|
|
|
* name of that parameter which I think is good for documentation. It is not required and since
|
|
|
|
* I did not know what to put there for this example (I could only find doc about IDirect3D2),
|
1999-01-17 17:32:32 +01:00
|
|
|
* I left them blank.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - Finally the set of 'IDirect3D_Xxx' macros is a standard set of macros defined to ease access
|
|
|
|
* to the interface methods in C. Unfortunately I don't see any way to avoid having to duplicate
|
|
|
|
* the inherited method definitions there. This time I could have used a trick to use only one
|
1999-02-10 07:42:03 +01:00
|
|
|
* macro whatever the number of parameters but I prefered to have it work the same way as above.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - You probably have noticed that we don't define the fields we need to actually implement this
|
|
|
|
* interface: reference count, pointer to other resources and miscellaneous fields. That's
|
|
|
|
* because these interfaces are just that: interfaces. They may be implemented more than once, in
|
|
|
|
* different contexts and sometimes not even in Wine. Thus it would not make sense to impose
|
1999-02-10 07:42:03 +01:00
|
|
|
* that the interface contains some specific fields.
|
1999-01-17 17:32:32 +01:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* In C this gives:
|
1999-02-10 07:42:03 +01:00
|
|
|
* typedef struct IDirect3DVtbl IDirect3DVtbl;
|
1999-01-17 17:32:32 +01:00
|
|
|
* struct IDirect3D {
|
1999-10-25 17:43:36 +02:00
|
|
|
* IDirect3DVtbl* lpVtbl;
|
1999-01-17 17:32:32 +01:00
|
|
|
* };
|
1999-02-10 07:42:03 +01:00
|
|
|
* struct IDirect3DVtbl {
|
2001-01-04 23:59:48 +01:00
|
|
|
* HRESULT (*QueryInterface)(IDirect3D* me, REFIID riid, LPVOID* ppvObj);
|
|
|
|
* ULONG (*QueryInterface)(IDirect3D* me);
|
|
|
|
* ULONG (*QueryInterface)(IDirect3D* me);
|
|
|
|
* HRESULT (*Initialize)(IDirect3D* me, REFIID a);
|
|
|
|
* HRESULT (*EnumDevices)(IDirect3D* me, LPD3DENUMDEVICESCALLBACK a, LPVOID b);
|
|
|
|
* HRESULT (*CreateLight)(IDirect3D* me, LPDIRECT3DLIGHT* a, IUnknown* b);
|
|
|
|
* HRESULT (*CreateMaterial)(IDirect3D* me, LPDIRECT3DMATERIAL* a, IUnknown* b);
|
|
|
|
* HRESULT (*CreateViewport)(IDirect3D* me, LPDIRECT3DVIEWPORT* a, IUnknown* b);
|
|
|
|
* HRESULT (*FindDevice)(IDirect3D* me, LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b);
|
2002-06-01 01:06:46 +02:00
|
|
|
* };
|
1999-01-17 17:32:32 +01:00
|
|
|
*
|
1999-02-10 07:42:03 +01:00
|
|
|
* #ifdef ICOM_CINTERFACE
|
1999-01-17 17:32:32 +01:00
|
|
|
* // *** IUnknown methods *** //
|
2001-01-04 23:59:48 +01:00
|
|
|
* #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
|
|
|
* #define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
|
|
|
|
* #define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
|
1999-01-17 17:32:32 +01:00
|
|
|
* // *** IDirect3D methods *** //
|
2001-01-04 23:59:48 +01:00
|
|
|
* #define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
|
|
|
|
* #define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevice(p,a,b)
|
|
|
|
* #define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b)
|
|
|
|
* #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
|
|
|
|
* #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
|
|
|
|
* #define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b)
|
1999-01-17 17:32:32 +01:00
|
|
|
* #endif
|
|
|
|
*
|
|
|
|
* Comments:
|
2002-06-01 01:06:46 +02:00
|
|
|
* - IDirect3D only contains a pointer to the IDirect3D virtual/jump table. This is the only thing
|
|
|
|
* the user needs to know to use the interface. Of course the structure we will define to
|
1999-01-17 17:32:32 +01:00
|
|
|
* implement this interface will have more fields but the first one will match this pointer.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - The code generated by ICOM_DEFINE defines both the structure representing the interface and
|
|
|
|
* the structure for the jump table. ICOM_DEFINE uses the parent's Xxx_IMETHODS macro to
|
|
|
|
* automatically repeat the prototypes of all the inherited methods and then uses IDirect3D_METHODS
|
1999-02-10 07:42:03 +01:00
|
|
|
* to define the IDirect3D methods.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - Each method is declared as a pointer to function field in the jump table. The implementation
|
|
|
|
* will fill this jump table with appropriate values, probably using a static variable, and
|
1999-10-25 17:43:36 +02:00
|
|
|
* initialize the lpVtbl field to point to this variable.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - The IDirect3D_Xxx macros then just derefence the lpVtbl pointer and use the function pointer
|
|
|
|
* corresponding to the macro name. This emulates the behavior of a virtual table and should be
|
1999-02-10 07:42:03 +01:00
|
|
|
* just as fast.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - This C code should be quite compatible with the Windows headers both for code that uses COM
|
1999-02-10 07:42:03 +01:00
|
|
|
* interfaces and for code implementing a COM interface.
|
1999-01-17 17:32:32 +01:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* And in C++ (with gcc's g++):
|
|
|
|
*
|
|
|
|
* typedef struct IDirect3D: public IUnknown {
|
2001-01-04 23:59:48 +01:00
|
|
|
* private: HRESULT (*Initialize)(IDirect3D* me, REFIID a);
|
|
|
|
* public: inline HRESULT Initialize(REFIID a) { return ((IDirect3D*)t.lpVtbl)->Initialize(this,a); };
|
|
|
|
* private: HRESULT (*EnumDevices)(IDirect3D* me, LPD3DENUMDEVICESCALLBACK a, LPVOID b);
|
1999-01-17 17:32:32 +01:00
|
|
|
* public: inline HRESULT EnumDevices(LPD3DENUMDEVICESCALLBACK a, LPVOID b)
|
2001-01-04 23:59:48 +01:00
|
|
|
* { return ((IDirect3D*)t.lpVtbl)->EnumDevices(this,a,b); };
|
|
|
|
* private: HRESULT (*freateLight)(IDirect3D* me, LPDIRECT3DLIGHT* a, IUnknown* b);
|
1999-01-17 17:32:32 +01:00
|
|
|
* public: inline HRESULT CreateLight(LPDIRECT3DLIGHT* a, IUnknown* b)
|
2001-01-04 23:59:48 +01:00
|
|
|
* { return ((IDirect3D*)t.lpVtbl)->CreateLight(this,a,b); };
|
|
|
|
* private: HRESULT (*CreateMaterial)(IDirect3D* me, LPDIRECT3DMATERIAL* a, IUnknown* b);
|
1999-01-17 17:32:32 +01:00
|
|
|
* public: inline HRESULT CreateMaterial(LPDIRECT3DMATERIAL* a, IUnknown* b)
|
2001-01-04 23:59:48 +01:00
|
|
|
* { return ((IDirect3D*)t.lpVtbl)->CreateMaterial(this,a,b); };
|
|
|
|
* private: HRESULT (*CreateViewport)(IDirect3D* me, LPDIRECT3DVIEWPORT* a, IUnknown* b);
|
1999-01-17 17:32:32 +01:00
|
|
|
* public: inline HRESULT CreateViewport(LPDIRECT3DVIEWPORT* a, IUnknown* b)
|
2001-01-04 23:59:48 +01:00
|
|
|
* { return ((IDirect3D*)t.lpVtbl)->CreateViewport(this,a,b); };
|
|
|
|
* private: HRESULT (*FindDevice)(IDirect3D* me, LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b);
|
1999-01-17 17:32:32 +01:00
|
|
|
* public: inline HRESULT FindDevice(LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b)
|
2001-01-04 23:59:48 +01:00
|
|
|
* { return ((IDirect3D*)t.lpVtbl)->FindDevice(this,a,b); };
|
2002-06-01 01:06:46 +02:00
|
|
|
* };
|
1999-01-17 17:32:32 +01:00
|
|
|
*
|
|
|
|
* Comments:
|
2002-06-01 01:06:46 +02:00
|
|
|
* - In C++ IDirect3D does double duty as both the virtual/jump table and as the interface
|
|
|
|
* definition. The reason for this is to avoid having to duplicate the mehod definitions: once
|
|
|
|
* to have the function pointers in the jump table and once to have the methods in the interface
|
|
|
|
* class. Here one macro can generate both. This means though that the first pointer, t.lpVtbl
|
|
|
|
* defined in IUnknown, must be interpreted as the jump table pointer if we interpret the
|
|
|
|
* structure as the the interface class, and as the function pointer to the QueryInterface
|
|
|
|
* method, t.QueryInterface, if we interpret the structure as the jump table. Fortunately this
|
1999-01-17 17:32:32 +01:00
|
|
|
* gymnastic is entirely taken care of in the header of IUnknown.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - Of course in C++ we use inheritance so that we don't have to duplicate the method definitions.
|
|
|
|
* - Since IDirect3D does double duty, each ICOM_METHOD macro defines both a function pointer and
|
|
|
|
* a non-vritual inline method which dereferences it and calls it. This way this method behaves
|
|
|
|
* just like a virtual method but does not create a true C++ virtual table which would break the
|
|
|
|
* structure layout. If you look at the implementation of these methods you'll notice that they
|
|
|
|
* would not work for void functions. We have to return something and fortunately this seems to
|
1999-01-17 17:32:32 +01:00
|
|
|
* be what all the COM methods do (otherwise we would need another set of macros).
|
2002-06-01 01:06:46 +02:00
|
|
|
* - Note how the ICOM_METHOD generates both function prototypes mixing types and formal parameter
|
|
|
|
* names and the method invocation using only the formal parameter name. This is the reason why
|
1999-01-17 17:32:32 +01:00
|
|
|
* we need different macros to handle different numbers of parameters.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - Finally there is no IDirect3D_Xxx macro. These are not needed in C++ unless the CINTERFACE
|
1999-01-17 17:32:32 +01:00
|
|
|
* macro is defined in which case we would not be here.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - This C++ code works well for code that just uses COM interfaces. But it will not work with
|
|
|
|
* C++ code implement a COM interface. That's because such code assumes the interface methods
|
1999-02-10 07:42:03 +01:00
|
|
|
* are declared as virtual C++ methods which is not the case here.
|
1999-01-17 17:32:32 +01:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* Implementing a COM interface.
|
|
|
|
*
|
1999-02-10 07:42:03 +01:00
|
|
|
* This continues the above example. This example assumes that the implementation is in C.
|
1999-01-17 17:32:32 +01:00
|
|
|
*
|
|
|
|
* typedef struct _IDirect3D {
|
1999-10-25 17:43:36 +02:00
|
|
|
* void* lpVtbl;
|
1999-01-17 17:32:32 +01:00
|
|
|
* // ...
|
|
|
|
*
|
|
|
|
* } _IDirect3D;
|
|
|
|
*
|
|
|
|
* static ICOM_VTABLE(IDirect3D) d3dvt;
|
|
|
|
*
|
|
|
|
* // implement the IDirect3D methods here
|
|
|
|
*
|
2001-01-04 23:59:48 +01:00
|
|
|
* int IDirect3D_QueryInterface(IDirect3D* me)
|
1999-01-17 17:32:32 +01:00
|
|
|
* {
|
|
|
|
* ICOM_THIS(IDirect3D,me);
|
|
|
|
* // ...
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* // ...
|
|
|
|
*
|
|
|
|
* static ICOM_VTABLE(IDirect3D) d3dvt = {
|
2000-01-30 03:55:16 +01:00
|
|
|
* ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
2001-01-04 23:59:48 +01:00
|
|
|
* IDirect3D_QueryInterface,
|
|
|
|
* IDirect3D_Add,
|
|
|
|
* IDirect3D_Add2,
|
|
|
|
* IDirect3D_Initialize,
|
|
|
|
* IDirect3D_SetWidth
|
1999-01-17 17:32:32 +01:00
|
|
|
* };
|
|
|
|
*
|
|
|
|
* Comments:
|
2002-06-01 01:06:46 +02:00
|
|
|
* - We first define what the interface really contains. This is th e_IDirect3D structure. The
|
1999-01-17 17:32:32 +01:00
|
|
|
* first field must of course be the virtual table pointer. Everything else is free.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - Then we predeclare our static virtual table variable, we will need its address in some
|
1999-01-17 17:32:32 +01:00
|
|
|
* methods to initialize the virtual table pointer of the returned interface objects.
|
2002-06-01 01:06:46 +02:00
|
|
|
* - Then we implement the interface methods. To match what has been declared in the header file
|
|
|
|
* they must take a pointer to a IDirect3D structure and we must cast it to an _IDirect3D so that
|
1999-01-17 17:32:32 +01:00
|
|
|
* we can manipulate the fields. This is performed by the ICOM_THIS macro.
|
1999-02-10 07:42:03 +01:00
|
|
|
* - Finally we initialize the virtual table.
|
1999-01-17 17:32:32 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-02-10 07:42:03 +01:00
|
|
|
#if !defined(__cplusplus) || defined(CINTERFACE)
|
|
|
|
#define ICOM_CINTERFACE 1
|
|
|
|
#endif
|
1999-01-17 17:32:32 +01:00
|
|
|
|
2002-11-06 20:56:59 +01:00
|
|
|
#ifdef ICOM_USE_COM_INTERFACE_ATTRIBUTE
|
|
|
|
#define ICOM_COM_INTERFACE_ATTRIBUTE __attribute__((com_interface))
|
|
|
|
#else
|
|
|
|
#define ICOM_COM_INTERFACE_ATTRIBUTE
|
|
|
|
#endif
|
|
|
|
|
1999-02-10 07:42:03 +01:00
|
|
|
#ifndef ICOM_CINTERFACE
|
1999-01-17 17:32:32 +01:00
|
|
|
/* C++ interface */
|
|
|
|
|
|
|
|
#define ICOM_METHOD(ret,xfn) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual ret CALLBACK (xfn)(void) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD1(ret,xfn,ta,na) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual ret CALLBACK (xfn)(ta a) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD2(ret,xfn,ta,na,tb,nb) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD3(ret,xfn,ta,na,tb,nb,tc,nc) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD4(ret,xfn,ta,na,tb,nb,tc,nc,td,nd) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD5(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD6(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD7(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g) = 0;
|
1999-02-10 07:42:03 +01:00
|
|
|
#define ICOM_METHOD8(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h) = 0;
|
1999-03-10 19:03:53 +01:00
|
|
|
#define ICOM_METHOD9(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i) = 0;
|
1999-03-10 19:03:53 +01:00
|
|
|
#define ICOM_METHOD10(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j) = 0;
|
2000-11-16 00:05:13 +01:00
|
|
|
#define ICOM_METHOD11(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k) = 0;
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD12(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l) = 0;
|
|
|
|
#define ICOM_METHOD13(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m) = 0;
|
|
|
|
#define ICOM_METHOD14(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n) = 0;
|
|
|
|
#define ICOM_METHOD15(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o) = 0;
|
|
|
|
#define ICOM_METHOD16(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p) = 0;
|
|
|
|
#define ICOM_METHOD17(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q) = 0;
|
|
|
|
#define ICOM_METHOD18(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r) = 0;
|
|
|
|
#define ICOM_METHOD19(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s) = 0;
|
|
|
|
#define ICOM_METHOD20(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t) = 0;
|
|
|
|
#define ICOM_METHOD21(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u) = 0;
|
|
|
|
#define ICOM_METHOD22(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v) = 0;
|
|
|
|
#define ICOM_METHOD23(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w) = 0;
|
|
|
|
#define ICOM_METHOD24(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x) = 0;
|
|
|
|
#define ICOM_METHOD25(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y) = 0;
|
|
|
|
#define ICOM_METHOD26(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny,tz,nz) \
|
|
|
|
public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y,tz z) = 0;
|
1999-03-10 19:03:53 +01:00
|
|
|
|
1999-01-17 17:32:32 +01:00
|
|
|
|
|
|
|
#define ICOM_VMETHOD(xfn) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual void CALLBACK (xfn)(void) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD1(xfn,ta,na) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual void CALLBACK (xfn)(ta a) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD2(xfn,ta,na,tb,nb) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD3(xfn,ta,na,tb,nb,tc,nc) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD4(xfn,ta,na,tb,nb,tc,nc,td,nd) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD5(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD6(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f) = 0;
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD7(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g) = 0;
|
1999-02-10 07:42:03 +01:00
|
|
|
#define ICOM_VMETHOD8(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh) \
|
2000-06-11 22:07:58 +02:00
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h) = 0;
|
2000-11-16 00:05:13 +01:00
|
|
|
#define ICOM_VMETHOD9(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i) = 0;
|
|
|
|
#define ICOM_VMETHOD10(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i, tj j) = 0;
|
|
|
|
#define ICOM_VMETHOD11(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i, tj j, tk k) = 0;
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD12(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l) = 0;
|
|
|
|
#define ICOM_VMETHOD13(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m) = 0;
|
|
|
|
#define ICOM_VMETHOD14(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n) = 0;
|
|
|
|
#define ICOM_VMETHOD15(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o) = 0;
|
|
|
|
#define ICOM_VMETHOD16(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p) = 0;
|
|
|
|
#define ICOM_VMETHOD17(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q) = 0;
|
|
|
|
#define ICOM_VMETHOD18(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r) = 0;
|
|
|
|
#define ICOM_VMETHOD19(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s) = 0;
|
|
|
|
#define ICOM_VMETHOD20(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t) = 0;
|
|
|
|
#define ICOM_VMETHOD21(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u) = 0;
|
|
|
|
#define ICOM_VMETHOD22(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v) = 0;
|
|
|
|
#define ICOM_VMETHOD23(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w) = 0;
|
|
|
|
#define ICOM_VMETHOD24(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x) = 0;
|
|
|
|
#define ICOM_VMETHOD25(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y) = 0;
|
|
|
|
#define ICOM_VMETHOD26(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny,tz,nz) \
|
|
|
|
public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y,tz z) = 0;
|
1999-02-10 07:42:03 +01:00
|
|
|
|
1999-01-17 17:32:32 +01:00
|
|
|
|
1999-04-06 09:06:05 +02:00
|
|
|
#define ICOM_DEFINE(iface,ibase) \
|
2002-02-21 21:09:42 +01:00
|
|
|
struct iface: public ibase { \
|
1999-04-06 09:06:05 +02:00
|
|
|
iface##_METHODS \
|
2002-11-06 20:56:59 +01:00
|
|
|
} ICOM_COM_INTERFACE_ATTRIBUTE;
|
|
|
|
#define ICOM_DEFINE1(iface) \
|
|
|
|
struct iface { \
|
1999-02-10 07:42:03 +01:00
|
|
|
iface##_METHODS \
|
2002-11-06 20:56:59 +01:00
|
|
|
} ICOM_COM_INTERFACE_ATTRIBUTE;
|
1999-05-22 13:41:38 +02:00
|
|
|
|
2000-12-29 06:24:50 +01:00
|
|
|
#define ICOM_VTBL(iface) (iface)
|
1999-01-17 17:32:32 +01:00
|
|
|
|
|
|
|
#else
|
|
|
|
/* C interface */
|
|
|
|
|
|
|
|
#define ICOM_METHOD(ret,xfn) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD1(ret,xfn,ta,na) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD2(ret,xfn,ta,na,tb,nb) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD3(ret,xfn,ta,na,tb,nb,tc,nc) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD4(ret,xfn,ta,na,tb,nb,tc,nc,td,nd) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD5(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD6(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_METHOD7(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g);
|
1999-02-10 07:42:03 +01:00
|
|
|
#define ICOM_METHOD8(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h);
|
1999-03-10 19:03:53 +01:00
|
|
|
#define ICOM_METHOD9(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i);
|
1999-03-10 19:03:53 +01:00
|
|
|
#define ICOM_METHOD10(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j);
|
2000-11-16 00:05:13 +01:00
|
|
|
#define ICOM_METHOD11(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD12(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD13(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD14(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD15(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD16(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD17(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD18(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD19(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD20(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD21(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD22(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD23(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD24(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD25(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_METHOD26(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny,tz,nz) \
|
2002-02-01 00:22:07 +01:00
|
|
|
ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y,tz z);
|
1999-03-10 19:03:53 +01:00
|
|
|
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD(xfn) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD1(xfn,ta,na) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD2(xfn,ta,na,tb,nb) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD3(xfn,ta,na,tb,nb,tc,nc) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD4(xfn,ta,na,tb,nb,tc,nc,td,nd) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD5(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD6(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f);
|
1999-01-17 17:32:32 +01:00
|
|
|
#define ICOM_VMETHOD7(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g);
|
1999-02-10 07:42:03 +01:00
|
|
|
#define ICOM_VMETHOD8(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,nh) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h);
|
2000-11-16 00:05:13 +01:00
|
|
|
#define ICOM_VMETHOD9(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ni) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i);
|
2000-11-16 00:05:13 +01:00
|
|
|
#define ICOM_VMETHOD10(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,nj) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j);
|
2000-11-16 00:05:13 +01:00
|
|
|
#define ICOM_VMETHOD11(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,nk) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD12(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD13(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD14(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD15(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD16(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD17(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD18(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD19(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD20(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD21(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD22(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD23(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD24(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD25(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y);
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_VMETHOD26(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny,tz,nz) \
|
2002-02-01 00:22:07 +01:00
|
|
|
void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y,tz z);
|
1999-10-25 17:43:36 +02:00
|
|
|
|
|
|
|
|
2000-12-29 06:24:50 +01:00
|
|
|
#define ICOM_VTABLE(iface) iface##Vtbl
|
|
|
|
#define ICOM_VFIELD(iface) ICOM_VTABLE(iface)* lpVtbl
|
|
|
|
#define ICOM_VTBL(iface) (iface)->lpVtbl
|
1999-01-17 17:32:32 +01:00
|
|
|
|
1999-05-22 13:41:38 +02:00
|
|
|
#ifdef ICOM_MSVTABLE_COMPAT
|
2002-11-06 20:56:59 +01:00
|
|
|
#define ICOM_MSVTABLE_COMPAT_FIELDS \
|
|
|
|
long dummyRTTI1; \
|
|
|
|
long dummyRTTI2;
|
|
|
|
#define ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 0,0,
|
|
|
|
#else
|
|
|
|
#define ICOM_MSVTABLE_COMPAT_FIELDS
|
|
|
|
#define ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|
|
|
#endif /* ICOM_MSVTABLE_COMPAT */
|
|
|
|
|
1999-02-10 07:42:03 +01:00
|
|
|
#define ICOM_DEFINE(iface,ibase) \
|
|
|
|
typedef struct ICOM_VTABLE(iface) ICOM_VTABLE(iface); \
|
|
|
|
struct iface { \
|
1999-10-25 17:43:36 +02:00
|
|
|
const ICOM_VFIELD(iface); \
|
1999-02-10 07:42:03 +01:00
|
|
|
}; \
|
|
|
|
struct ICOM_VTABLE(iface) { \
|
2002-11-06 20:56:59 +01:00
|
|
|
ICOM_MSVTABLE_COMPAT_FIELDS \
|
1999-02-10 07:42:03 +01:00
|
|
|
ibase##_IMETHODS \
|
|
|
|
iface##_METHODS \
|
|
|
|
};
|
2002-11-06 20:56:59 +01:00
|
|
|
#define ICOM_DEFINE1(iface) \
|
1999-05-22 13:41:38 +02:00
|
|
|
typedef struct ICOM_VTABLE(iface) ICOM_VTABLE(iface); \
|
|
|
|
struct iface { \
|
1999-10-25 17:43:36 +02:00
|
|
|
const ICOM_VFIELD(iface); \
|
1999-05-22 13:41:38 +02:00
|
|
|
}; \
|
|
|
|
struct ICOM_VTABLE(iface) { \
|
2002-11-06 20:56:59 +01:00
|
|
|
ICOM_MSVTABLE_COMPAT_FIELDS \
|
1999-05-22 13:41:38 +02:00
|
|
|
iface##_METHODS \
|
|
|
|
};
|
1999-01-17 17:32:32 +01:00
|
|
|
|
2001-09-26 00:38:43 +02:00
|
|
|
#define ICOM_THIS(impl,iface) impl* const This=(impl*)(iface)
|
|
|
|
#define ICOM_CTHIS(impl,iface) const impl* const This=(const impl*)(iface)
|
|
|
|
|
|
|
|
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
|
|
|
|
#define ICOM_CTHIS_MULTI(impl,field,iface) const impl* const This=(const impl*)((char*)(iface) - offsetof(impl,field))
|
1999-01-17 17:32:32 +01:00
|
|
|
|
2000-12-29 06:24:50 +01:00
|
|
|
#endif /*ICOM_CINTERFACE */
|
|
|
|
|
2001-08-27 21:00:12 +02:00
|
|
|
#define ICOM_CALL(xfn, ptr) ICOM_VTBL(ptr)->xfn(ptr)
|
|
|
|
#define ICOM_CALL1(xfn, ptr,a) ICOM_VTBL(ptr)->xfn(ptr,a)
|
|
|
|
#define ICOM_CALL2(xfn, ptr,a,b) ICOM_VTBL(ptr)->xfn(ptr,a,b)
|
|
|
|
#define ICOM_CALL3(xfn, ptr,a,b,c) ICOM_VTBL(ptr)->xfn(ptr,a,b,c)
|
|
|
|
#define ICOM_CALL4(xfn, ptr,a,b,c,d) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d)
|
|
|
|
#define ICOM_CALL5(xfn, ptr,a,b,c,d,e) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e)
|
|
|
|
#define ICOM_CALL6(xfn, ptr,a,b,c,d,e,f) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f)
|
|
|
|
#define ICOM_CALL7(xfn, ptr,a,b,c,d,e,f,g) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g)
|
|
|
|
#define ICOM_CALL8(xfn, ptr,a,b,c,d,e,f,g,h) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h)
|
|
|
|
#define ICOM_CALL9(xfn, ptr,a,b,c,d,e,f,g,h,i) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i)
|
|
|
|
#define ICOM_CALL10(xfn, ptr,a,b,c,d,e,f,g,h,i,j) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j)
|
|
|
|
#define ICOM_CALL11(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k)
|
|
|
|
#define ICOM_CALL12(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l)
|
|
|
|
#define ICOM_CALL13(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m)
|
|
|
|
#define ICOM_CALL14(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n)
|
|
|
|
#define ICOM_CALL15(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o)
|
|
|
|
#define ICOM_CALL16(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
|
|
|
|
#define ICOM_CALL17(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q)
|
|
|
|
#define ICOM_CALL18(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r)
|
|
|
|
#define ICOM_CALL19(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s)
|
|
|
|
#define ICOM_CALL20(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t)
|
|
|
|
#define ICOM_CALL21(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u)
|
|
|
|
#define ICOM_CALL22(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v)
|
|
|
|
#define ICOM_CALL23(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w)
|
|
|
|
#define ICOM_CALL24(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x)
|
|
|
|
#define ICOM_CALL25(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y)
|
|
|
|
#define ICOM_CALL26(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z)
|
1999-01-17 17:32:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* Predeclare the interfaces
|
|
|
|
*/
|
|
|
|
DEFINE_OLEGUID(IID_IClassFactory, 0x00000001L, 0, 0);
|
|
|
|
typedef struct IClassFactory IClassFactory, *LPCLASSFACTORY;
|
|
|
|
|
|
|
|
DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0);
|
|
|
|
typedef struct IUnknown IUnknown, *LPUNKNOWN;
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* IUnknown interface
|
|
|
|
*/
|
|
|
|
#define ICOM_INTERFACE IUnknown
|
2002-11-06 20:56:59 +01:00
|
|
|
#define IUnknown_METHODS \
|
1999-02-18 17:02:41 +01:00
|
|
|
ICOM_METHOD2(HRESULT,QueryInterface,REFIID,riid, LPVOID*,ppvObj) \
|
|
|
|
ICOM_METHOD (ULONG,AddRef) \
|
|
|
|
ICOM_METHOD (ULONG,Release)
|
2002-11-06 20:56:59 +01:00
|
|
|
#define IUnknown_IMETHODS \
|
|
|
|
IUnknown_METHODS
|
|
|
|
ICOM_DEFINE1(IUnknown)
|
1999-01-17 17:32:32 +01:00
|
|
|
#undef ICOM_INTERFACE
|
|
|
|
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
#define IUnknown_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
|
|
|
|
#define IUnknown_AddRef(p) ICOM_CALL (AddRef,p)
|
|
|
|
#define IUnknown_Release(p) ICOM_CALL (Release,p)
|
|
|
|
|
2001-09-26 00:38:43 +02:00
|
|
|
HRESULT CALLBACK IUnknown_QueryInterface_Proxy(IUnknown *This,REFIID riid,LPVOID*ppvObj);
|
|
|
|
ULONG CALLBACK IUnknown_AddRef_Proxy(IUnknown *This);
|
|
|
|
ULONG CALLBACK IUnknown_Release_Proxy(IUnknown *This);
|
|
|
|
|
1999-01-17 17:32:32 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* IClassFactory interface
|
|
|
|
*/
|
|
|
|
#define ICOM_INTERFACE IClassFactory
|
1999-02-10 07:42:03 +01:00
|
|
|
#define IClassFactory_METHODS \
|
1999-02-18 17:02:41 +01:00
|
|
|
ICOM_METHOD3(HRESULT,CreateInstance, LPUNKNOWN,pUnkOuter, REFIID,riid, LPVOID*,ppvObject) \
|
1999-02-26 12:11:13 +01:00
|
|
|
ICOM_METHOD1(HRESULT,LockServer, BOOL,fLock)
|
1999-02-10 07:42:03 +01:00
|
|
|
#define IClassFactory_IMETHODS \
|
1999-02-18 17:02:41 +01:00
|
|
|
IUnknown_IMETHODS \
|
|
|
|
IClassFactory_METHODS
|
1999-02-10 07:42:03 +01:00
|
|
|
ICOM_DEFINE(IClassFactory,IUnknown)
|
1999-01-17 17:32:32 +01:00
|
|
|
#undef ICOM_INTERFACE
|
|
|
|
|
|
|
|
/*** IUnknown methods ***/
|
1999-02-10 07:42:03 +01:00
|
|
|
#define IClassFactory_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
|
|
|
|
#define IClassFactory_AddRef(p) ICOM_CALL (AddRef,p)
|
|
|
|
#define IClassFactory_Release(p) ICOM_CALL (Release,p)
|
1999-01-17 17:32:32 +01:00
|
|
|
/*** IClassFactory methods ***/
|
|
|
|
#define IClassFactory_CreateInstance(p,a,b,c) ICOM_CALL3(CreateInstance,p,a,b,c)
|
|
|
|
#define IClassFactory_LockServer(p,a) ICOM_CALL1(LockServer,p,a)
|
|
|
|
|
|
|
|
|
1999-02-17 18:32:55 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* Additional API
|
|
|
|
*/
|
|
|
|
|
|
|
|
HRESULT WINAPI CoCreateGuid(GUID* pguid);
|
|
|
|
|
2000-08-10 00:35:05 +02:00
|
|
|
HINSTANCE WINAPI CoLoadLibrary(LPOLESTR lpszLibName, BOOL bAutoFree);
|
|
|
|
|
1999-02-17 18:32:55 +01:00
|
|
|
void WINAPI CoFreeAllLibraries(void);
|
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
void WINAPI CoFreeLibrary(HINSTANCE hLibrary);
|
1999-02-17 18:32:55 +01:00
|
|
|
|
|
|
|
void WINAPI CoFreeUnusedLibraries(void);
|
|
|
|
|
|
|
|
HRESULT WINAPI CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv);
|
|
|
|
|
2001-04-09 20:33:49 +02:00
|
|
|
HRESULT WINAPI CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv);
|
1999-02-17 18:32:55 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
HRESULT WINAPI CoInitialize(LPVOID lpReserved);
|
1999-03-23 14:48:56 +01:00
|
|
|
HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit);
|
|
|
|
|
|
|
|
void WINAPI CoUninitialize(void);
|
1999-02-17 18:32:55 +01:00
|
|
|
|
|
|
|
typedef enum tagCOINIT
|
|
|
|
{
|
|
|
|
COINIT_APARTMENTTHREADED = 0x2, /* Apartment model */
|
|
|
|
COINIT_MULTITHREADED = 0x0, /* OLE calls objects on any thread */
|
|
|
|
COINIT_DISABLE_OLE1DDE = 0x4, /* Don't use DDE for Ole1 support */
|
|
|
|
COINIT_SPEED_OVER_MEMORY = 0x8 /* Trade memory for speed */
|
|
|
|
} COINIT;
|
|
|
|
|
|
|
|
|
|
|
|
/* FIXME: not implemented */
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI CoIsOle1Class(REFCLSID rclsid);
|
1999-02-17 18:32:55 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
HRESULT WINAPI CoLockObjectExternal(LPUNKNOWN pUnk, BOOL fLock, BOOL fLastUnlockReleases);
|
1999-02-17 18:32:55 +01:00
|
|
|
|
|
|
|
/* class registration flags; passed to CoRegisterClassObject */
|
|
|
|
typedef enum tagREGCLS
|
|
|
|
{
|
|
|
|
REGCLS_SINGLEUSE = 0,
|
|
|
|
REGCLS_MULTIPLEUSE = 1,
|
|
|
|
REGCLS_MULTI_SEPARATE = 2,
|
|
|
|
REGCLS_SUSPENDED = 4
|
|
|
|
} REGCLS;
|
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid,LPUNKNOWN pUnk,DWORD dwClsContext,DWORD flags,LPDWORD lpdwRegister);
|
1999-02-17 18:32:55 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
HRESULT WINAPI CoRevokeClassObject(DWORD dwRegister);
|
1999-02-17 18:32:55 +01:00
|
|
|
|
2001-09-26 00:38:43 +02:00
|
|
|
HRESULT WINAPI CoGetPSClsid(REFIID riid,CLSID *pclsid);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-03-25 11:57:12 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* COM Server dll - exports
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv);
|
|
|
|
HRESULT WINAPI DllCanUnloadNow(void);
|
|
|
|
|
2000-08-07 04:35:05 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
1999-01-17 17:32:32 +01:00
|
|
|
#endif /* __WINE_WINE_OBJ_BASE_H */
|