RICHEDIT: add textserv.idl
Mike McCormack
mike at codeweavers.com
Thu Jun 30 04:51:47 CDT 2005
Hi,
There's no textserv.idl or any C definition for ITextServices or
ITextHost in the Windows Platform SDK, instead there's textserv.h, which
only contains a C++ definition.
This causes a bit of a problem, because we need a C interface. To solve
this, I've created the attached IDL file which can be used to create a
textserv.h that should be compatible with the Windows version.
It contains some hacks, because the interfaces aren't propper COM
interfaces.
Mike
ChangeLog:
* add an idl to generate ITextHost and ITextServices used by riched20
-------------- next part --------------
Index: include/Makefile.in
===================================================================
RCS file: /home/wine/wine/include/Makefile.in,v
retrieving revision 1.175
diff -u -p -r1.175 Makefile.in
--- include/Makefile.in 29 Jun 2005 19:21:01 -0000 1.175
+++ include/Makefile.in 30 Jun 2005 09:51:29 -0000
@@ -34,6 +34,7 @@ IDL_SRCS = \
shobjidl.idl \
shtypes.idl \
strmif.idl \
+ textserv.idl \
unknwn.idl \
urlmon.idl \
wtypes.idl \
--- /dev/null 2005-06-30 08:05:08.000000000 +0900
+++ include/textserv.idl 2005-06-30 18:44:30.000000000 +0900
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2005 Mike McCormack
+ *
+ * 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
+ */
+
+import "unknwn.idl";
+import "objidl.idl";
+import "oleidl.idl";
+
+/* IDL hack: widl doesn't deal with funcion pointers */
+cpp_quote("#define __TEXTSERV_callback (CALLBACK *pfnContinue)(DWORD)");
+
+[
+object,
+local,
+uuid(8d33f740-cf58-11ce-a89d-00aa006cadc5)
+]
+interface ITextServices : IUnknown
+{
+ HRESULT TxSendMessage( UINT msg, WPARAM wparam, LPARAM lparam,
+ LRESULT *plresult );
+ HRESULT TxDraw( DWORD dwDrawAspect, LONG lindex, void *pvAspect,
+ DVTARGETDEVICE *ptd, HDC hdcDraw, HDC hicTargetDev,
+ LPCRECTL lprcBounds, LPCRECTL lprcWBounds, LPRECT lprcUpdate,
+ BOOL __TEXTSERV_callback, DWORD dwContinue, LONG lViewId );
+ HRESULT TxGetHScroll( LONG *plMin, LONG *plMax, LONG *plPos,
+ LONG *plPage, BOOL *pfEnabled );
+ HRESULT TxGetVScroll( LONG *plMin, LONG *plMax, LONG *plPos,
+ LONG *plPage, BOOL *pfEnabled );
+ HRESULT OnTxSetCursor( DWORD dwDrawAspect, LONG lindex, void *pvAspect,
+ DVTARGETDEVICE *ptd, HDC hdcDraw, HDC hicTargetDev,
+ LPCRECT lprcClient, INT x, INT y );
+ HRESULT TxQueryHitPoint( DWORD dwDrawAspect, LONG lindex, void *pvAspect,
+ DVTARGETDEVICE *ptd, HDC hdcDraw, HDC hicTargetDev,
+ LPCRECT lprcClient, INT x, INT y, DWORD *pHitResult );
+ HRESULT OnTxInplaceActivate( LPCRECT prcClient );
+ HRESULT OnTxUIActivate( void );
+ HRESULT OnTxUIDeactivate( void );
+ HRESULT TxGetText( BSTR *pbstrText );
+ HRESULT TxSetText( LPCWSTR pszText );
+ HRESULT TxGetCurrentTargetX( LONG *x );
+ HRESULT TxGetBaseLinePos( LONG *x );
+ HRESULT TxGetNaturalSize( DWORD dwAspect, HDC hdcDraw, HDC hicTargetDev,
+ DVTARGETDEVICE *ptd, DWORD dwMode, const SIZEL *psizelExtent,
+ LONG *pwidth, LONG *pheight );
+ HRESULT TxGetDropTarget( IDropTarget **ppDropTarget );
+ HRESULT OnTxPropertyBitsChange( DWORD dwMask, DWORD dwBits );
+ HRESULT TxGetCachedSize( DWORD *pdwWidth, DWORD *pdwHeight );
+};
+
+/*
+ * IDL hack:
+ *
+ * There's no idl definitions for the following, so define them to tempory
+ * internal names. In textserv.h, they'll be refined to the right types.
+ */
+typedef void *__TEXTSERV_CHARFORMATW;
+typedef void *__TEXTSERV_PARAFORMAT;
+typedef void *__TEXTSERV_HCURSOR;
+typedef void *__TEXTSERV_HIMC;
+
+cpp_quote("#define __TEXTSERV_CHARFORMATW CHARFORMATW");
+cpp_quote("#define __TEXTSERV_PARAFORMAT PARAFORMAT");
+cpp_quote("#define __TEXTSERV_HCURSOR HCURSOR");
+cpp_quote("#define __TEXTSERV_HIMC HIMC");
+
+typedef enum _TXTBACKSTYLE {
+ TXTBACK_TRANSPARENT = 0,
+ TXTBACK_OPAQUE
+} TXTBACKSTYLE;
+
+enum TXTHITRESULT {
+ TXTHITRESULT_NOHIT = 0,
+ TXTHITRESULT_TRANSPARENT = 1,
+ TXTHITRESULT_CLOSE = 2,
+ TXTHITRESULT_HIT = 3
+};
+
+enum TXTNATURALSIZE {
+ TXTNS_FITTOCONTENT = 1,
+ TXTNS_ROUNDTOLINE = 2
+};
+
+enum TXTVIEW {
+ TXTVIEW_ACTIVE = 0,
+ TXTVIEW_INACTIVE = 1,
+};
+
+[
+object,
+local,
+uuid(c5bdd8d0-d26e-11ce-a89e-00aa006cadc5)
+]
+interface ITextHost : IUnknown
+{
+ HDC TxGetDC( void );
+ INT TxReleaseDC( HDC hdc );
+ BOOL TxShowScrollBar( INT fnBar, BOOL fShow );
+ BOOL TxEnableScrollBar( INT fuSBFlags, INT fuArrowflags );
+ BOOL TxSetScrollRange( INT fnBar, LONG nMinPos, INT nMaxPos, BOOL fRedraw );
+ BOOL TxSetScrollPos( INT fnBar, INT nPos, BOOL fRedraw );
+ void TxInvalidateRect( LPCRECT prc, BOOL fMode );
+ void TxViewChange( BOOL fUpdate );
+ BOOL TxCreateCaret( HBITMAP hbmp, INT xWidth, INT yHeight );
+ BOOL TxShowCaret( BOOL fShow );
+ BOOL TxSetCarentPos( INT x, INT y );
+ BOOL TxSetTimer( UINT idTimer, UINT uTimeout );
+ void TxKillTimer( UINT idTimer );
+ void TxScrollWindowEx( INT dx, INT dy, LPCRECT lprcScroll,
+ LPCRECT lprcClip, HRGN hRgnUpdate, LPRECT lprcUpdate, UINT fuScroll );
+ void TxSetCapture( BOOL fCapture );
+ void TxSetFocus( void );
+ void TxSetCursor( __TEXTSERV_HCURSOR hcur, BOOL fText );
+ BOOL TxScreenToClient( LPPOINT lppt );
+ BOOL TxClientToScreen( LPPOINT lppt );
+ HRESULT TxActivate( LONG *plOldState );
+ HRESULT TxDeactivate( LONG lNewState );
+ HRESULT TxGetClientRect( LPRECT prc );
+ HRESULT TxGetViewInset( LPRECT prc );
+ HRESULT TxGetCharFormat( const __TEXTSERV_CHARFORMATW **ppCF );
+ HRESULT TxGetParaFormat( const __TEXTSERV_PARAFORMAT **ppPF );
+ COLORREF TxGetSysColor( int nIndex );
+ HRESULT TxGetBackStyle( TXTBACKSTYLE *pStyle );
+ HRESULT TxGetMaxLength( DWORD *plength );
+ HRESULT TxGetScrollbars( DWORD *pdwScrollBar );
+ HRESULT TxGetPasswordChar( WCHAR *pch );
+ HRESULT TxGetAcceleratorPos( LONG *pch );
+ HRESULT TxGetExtent( LPSIZEL lpExtent );
+ HRESULT OnTxCharFormatChange( const __TEXTSERV_CHARFORMATW * pcf );
+ HRESULT OnTxParaFormatChange( const __TEXTSERV_PARAFORMAT * ppf );
+ HRESULT TxGetPropertyBits( DWORD dwMask, DWORD *pdwBits );
+ HRESULT TxNotify( DWORD iNotify, void *pv );
+ __TEXTSERV_HIMC TxImmGetContext( void );
+ void TxImmReleaseContext( __TEXTSERV_HIMC himc );
+ HRESULT TxGetSelectionBarWidth( LONG *lSelBarWidth );
+};
+
More information about the wine-patches
mailing list