includes: Fix macros for ITextServices

Dylan Smith dylan.ah.smith at gmail.com
Sun Nov 30 12:03:56 CST 2008


The problems with having the macros in the public headers are that they
won't work on x86 machines, and are not included in the public headers.
Therefore someone developing for another platform will have their code break
when using the native public headers or when porting the code to an x86
where the thiscall calling convention is used.

On Sun, Nov 30, 2008 at 5:42 AM, Maarten Lankhorst
<m.b.lankhorst at gmail.com>wrote:

> Commit e4ef9c5c removed the ITextServices macros from
> wine/include/textserv.h. With this they are added again, and  COBJMACROS
> before including that header, so that they won't conflict.
> ---
>
> From c04fcab5168309395602f4c4fd07a319a9a532ab Mon Sep 17 00:00:00 2001
> From: Maarten Lankhorst <maarten at codeweavers.com>
> Date: Sun, 30 Nov 2008 11:37:54 +0100
> Subject: [PATCH] includes: Fix macros for ITextServices
>
> ---
>  dlls/riched20/tests/txtsrv.c |    8 +++++++-
>  include/textserv.h           |   19 +++++++++++++++++++
>  2 files changed, 26 insertions(+), 1 deletions(-)
>
> diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c
> index 3d47490..c28f5a7 100644
> --- a/dlls/riched20/tests/txtsrv.c
> +++ b/dlls/riched20/tests/txtsrv.c
> @@ -29,6 +29,9 @@
>  #include <objbase.h>
>  #include <richedit.h>
>  #include <initguid.h>
> +
> +#undef COBJMACROS
> +/* Don't define ITextServices, we override it here */
>  #include <textserv.h>
>  #include <wine/test.h>
>
> @@ -44,6 +47,9 @@ static HMODULE hmoduleRichEdit;
>  #define TXTSERV_VTABLE(This) (This)->lpVtbl
>  #endif /* __i386__ */
>
> +#define ITextServices_QueryInterface(p,a,b)
> (p)->lpVtbl->QueryInterface(p,a,b)
> +#define ITextServices_AddRef(p) (p)->lpVtbl->AddRef(p)
> +#define ITextServices_Release(p) (p)->lpVtbl->Release(p)
>  #define ITextServices_TxSendMessage(This,a,b,c,d)
> TXTSERV_VTABLE(This)->TxSendMessage(This,a,b,c,d)
>  #define ITextServices_TxDraw(This,a,b,c,d,e,f,g,h,i,j,k,l)
> TXTSERV_VTABLE(This)->TxDraw(This,a,b,c,d,e,f,g,h,i,j,k,l)
>  #define ITextServices_TxGetHScroll(This,a,b,c,d,e)
> TXTSERV_VTABLE(This)->TxGetHScroll(This,a,b,c,d,e)
> @@ -84,7 +90,7 @@ static HRESULT WINAPI
> ITextHostImpl_QueryInterface(ITextHost *iface,
>
>     if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid,
> &IID_ITextHost)) {
>         *ppvObject = This;
> -        ITextHost_AddRef((ITextHost *)*ppvObject);
> +        IUnknown_AddRef((IUnknown *)*ppvObject);
>         return S_OK;
>     }
>
> diff --git a/include/textserv.h b/include/textserv.h
> index 977b742..820fc0a 100644
> --- a/include/textserv.h
> +++ b/include/textserv.h
> @@ -147,6 +147,25 @@ DECLARE_INTERFACE_(ITextServices,IUnknown)
>  #define ITextServices_QueryInterface(p,a,b)
> (p)->lpVtbl->QueryInterface(p,a,b)
>  #define ITextServices_AddRef(p) (p)->lpVtbl->AddRef(p)
>  #define ITextServices_Release(p) (p)->lpVtbl->Release(p)
> +/*** ITextServices methods ***/
> +#define ITextServices_TxSendMessage(p,a,b,c,d)
> (p)->lpVtbl->TxSendMessage(p,a,b
> +#define ITextServices_TxDraw(p,a,b,c,d,e,f,g,h,i,j,k,l)
> (p)->lpVtbl->TxDraw(p,a
> +#define ITextServices_TxGetHScroll(p,a,b,c,d,e)
> (p)->lpVtbl->TxGetHScroll(p,a,b
> +#define ITextServices_TxGetVScroll(p,a,b,c,d,e)
> (p)->lpVtbl->TxGetVScroll(p,a,b
> +#define ITextServices_OnTxSetCursor(p,a,b,c,d,e,f,g,h,i)
> (p)->lpVtbl->OnTxSetCu
> +#define ITextServices_TxQueryHitPoint(p,a,b,c,d,e,f,g,h,i,j)
> (p)->lpVtbl->TxQue
> +#define ITextServices_OnTxInplaceActivate(p,a)
> (p)->lpVtbl->OnTxInplaceActivate
> +#define ITextServices_OnTxInplaceDeactivate(p)
> (p)->lpVtbl->OnTxInplaceDeactiva
> +#define ITextServices_OnTxUIActivate(p) (p)->lpVtbl->OnTxUIActivate(p)
> +#define ITextServices_OnTxUIDeactivate(p) (p)->lpVtbl->OnTxUIDeactivate(p)
> +#define ITextServices_TxGetText(p,a) (p)->lpVtbl->TxGetText(p,a)
> +#define ITextServices_TxSetText(p,a) (p)->lpVtbl->TxSetText(p,a)
> +#define ITextServices_TxGetCurrentTargetX(p,a)
> (p)->lpVtbl->TxGetCurrentTargetX
> +#define ITextServices_TxGetBaseLinePos(p,a)
> (p)->lpVtbl->TxGetBaseLinePos(p,a)
> +#define ITextServices_TxGetNaturalSize(p,a,b,c,d,e,f,g,h)
> (p)->lpVtbl->TxGetNat
> +#define ITextServices_TxGetDropTarget(p,a)
> (p)->lpVtbl->TxGetDropTarget(p,a)
> +#define ITextServices_OnTxPropertyBitsChange(p,a,b)
> (p)->lpVtbl->OnTxPropertyBi
> +#define ITextServices_TxGetCachedSize(p,a,b)
> (p)->lpVtbl->TxGetCachedSize(p,a,b
>  #endif
>
>  #undef INTERFACE
> --
> 1.5.6.5
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-devel/attachments/20081130/32686ef1/attachment.htm 


More information about the wine-devel mailing list