From d188686b166222fc0adbed86a46554ae8ad8f682 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 3 Mar 2021 11:29:38 +0000 Subject: [PATCH] riched20: Remove the host structure's typedef. Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/riched20/txthost.c | 269 +++++++++++++++++++--------------------- 1 file changed, 130 insertions(+), 139 deletions(-) diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c index a193c7b0813..d0b43add364 100644 --- a/dlls/riched20/txthost.c +++ b/dlls/riched20/txthost.c @@ -32,30 +32,31 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit); -typedef struct ITextHostImpl { +struct host +{ ITextHost ITextHost_iface; LONG ref; - HWND hWnd; - BOOL bEmulateVersion10; + HWND window; + BOOL emulate_10; PARAFORMAT2 para_fmt; -} ITextHostImpl; +}; static const ITextHostVtbl textHostVtbl; static BOOL listbox_registered; static BOOL combobox_registered; -static ITextHost *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersion10 ) +static ITextHost *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 ) { - ITextHostImpl *texthost; + struct host *texthost; texthost = CoTaskMemAlloc(sizeof(*texthost)); if (!texthost) return NULL; texthost->ITextHost_iface.lpVtbl = &textHostVtbl; texthost->ref = 1; - texthost->hWnd = hwnd; - texthost->bEmulateVersion10 = bEmulateVersion10; + texthost->window = hwnd; + texthost->emulate_10 = emulate_10; memset( &texthost->para_fmt, 0, sizeof(texthost->para_fmt) ); texthost->para_fmt.cbSize = sizeof(texthost->para_fmt); texthost->para_fmt.dwMask = PFM_ALIGNMENT; @@ -68,18 +69,19 @@ static ITextHost *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersio return &texthost->ITextHost_iface; } -static inline ITextHostImpl *impl_from_ITextHost(ITextHost *iface) +static inline struct host *impl_from_ITextHost( ITextHost *iface ) { - return CONTAINING_RECORD(iface, ITextHostImpl, ITextHost_iface); + return CONTAINING_RECORD( iface, struct host, ITextHost_iface ); } -static HRESULT WINAPI ITextHostImpl_QueryInterface(ITextHost *iface, REFIID riid, void **ppvObject) +static HRESULT WINAPI ITextHostImpl_QueryInterface( ITextHost *iface, REFIID riid, void **obj ) { - ITextHostImpl *This = impl_from_ITextHost(iface); + struct host *host = impl_from_ITextHost( iface ); - if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextHost)) { - *ppvObject = &This->ITextHost_iface; - ITextHost_AddRef((ITextHost *)*ppvObject); + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextHost)) + { + *obj = &host->ITextHost_iface; + ITextHost_AddRef( (ITextHost *)*obj ); return S_OK; } @@ -89,20 +91,20 @@ static HRESULT WINAPI ITextHostImpl_QueryInterface(ITextHost *iface, REFIID riid static ULONG WINAPI ITextHostImpl_AddRef(ITextHost *iface) { - ITextHostImpl *This = impl_from_ITextHost(iface); - ULONG ref = InterlockedIncrement(&This->ref); + struct host *host = impl_from_ITextHost( iface ); + ULONG ref = InterlockedIncrement( &host->ref ); return ref; } static ULONG WINAPI ITextHostImpl_Release(ITextHost *iface) { - ITextHostImpl *This = impl_from_ITextHost(iface); - ULONG ref = InterlockedDecrement(&This->ref); + struct host *host = impl_from_ITextHost( iface ); + ULONG ref = InterlockedDecrement( &host->ref ); if (!ref) { - SetWindowLongPtrW(This->hWnd, 0, 0); - CoTaskMemFree(This); + SetWindowLongPtrW( host->window, 0, 0 ); + CoTaskMemFree( host ); } return ref; } @@ -110,176 +112,165 @@ static ULONG WINAPI ITextHostImpl_Release(ITextHost *iface) DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetDC,4) DECLSPEC_HIDDEN HDC __thiscall ITextHostImpl_TxGetDC(ITextHost *iface) { - ITextHostImpl *This = impl_from_ITextHost(iface); - return GetDC(This->hWnd); + struct host *host = impl_from_ITextHost( iface ); + return GetDC( host->window ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxReleaseDC,8) DECLSPEC_HIDDEN INT __thiscall ITextHostImpl_TxReleaseDC(ITextHost *iface, HDC hdc) { - ITextHostImpl *This = impl_from_ITextHost(iface); - return ReleaseDC(This->hWnd, hdc); + struct host *host = impl_from_ITextHost( iface ); + return ReleaseDC( host->window, hdc ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxShowScrollBar,12) -DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowScrollBar(ITextHost *iface, INT fnBar, BOOL fShow) +DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowScrollBar( ITextHost *iface, INT bar, BOOL show ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - return ShowScrollBar(This->hWnd, fnBar, fShow); + struct host *host = impl_from_ITextHost( iface ); + return ShowScrollBar( host->window, bar, show ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxEnableScrollBar,12) -DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxEnableScrollBar(ITextHost *iface, INT fuSBFlags, INT fuArrowflags) +DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxEnableScrollBar( ITextHost *iface, INT bar, INT arrows ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - return EnableScrollBar(This->hWnd, fuSBFlags, fuArrowflags); + struct host *host = impl_from_ITextHost( iface ); + return EnableScrollBar( host->window, bar, arrows ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetScrollRange,20) -DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollRange(ITextHost *iface, INT fnBar, LONG nMinPos, INT nMaxPos, - BOOL fRedraw) +DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollRange( ITextHost *iface, INT bar, LONG min_pos, INT max_pos, BOOL redraw ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - return SetScrollRange(This->hWnd, fnBar, nMinPos, nMaxPos, fRedraw); + struct host *host = impl_from_ITextHost( iface ); + return SetScrollRange( host->window, bar, min_pos, max_pos, redraw ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetScrollPos,16) -DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollPos(ITextHost *iface, INT fnBar, INT nPos, BOOL fRedraw) +DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollPos( ITextHost *iface, INT bar, INT pos, BOOL redraw ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - return SetScrollPos(This->hWnd, fnBar, nPos, fRedraw) != 0; + struct host *host = impl_from_ITextHost( iface ); + return SetScrollPos( host->window, bar, pos, redraw ) != 0; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxInvalidateRect,12) -DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxInvalidateRect(ITextHost *iface, LPCRECT prc, BOOL fMode) +DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxInvalidateRect( ITextHost *iface, const RECT *rect, BOOL mode ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - InvalidateRect(This->hWnd, prc, fMode); + struct host *host = impl_from_ITextHost( iface ); + InvalidateRect( host->window, rect, mode ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxViewChange,8) -DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxViewChange(ITextHost *iface, BOOL fUpdate) +DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxViewChange( ITextHost *iface, BOOL update ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - if (fUpdate) - UpdateWindow(This->hWnd); + struct host *host = impl_from_ITextHost( iface ); + if (update) UpdateWindow( host->window ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxCreateCaret,16) -DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxCreateCaret(ITextHost *iface, HBITMAP hbmp, INT xWidth, INT yHeight) +DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxCreateCaret( ITextHost *iface, HBITMAP bitmap, INT width, INT height ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - return CreateCaret(This->hWnd, hbmp, xWidth, yHeight); + struct host *host = impl_from_ITextHost( iface ); + return CreateCaret( host->window, bitmap, width, height ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxShowCaret,8) -DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowCaret(ITextHost *iface, BOOL fShow) +DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowCaret( ITextHost *iface, BOOL show ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - if (fShow) - return ShowCaret(This->hWnd); - else - return HideCaret(This->hWnd); + struct host *host = impl_from_ITextHost( iface ); + if (show) return ShowCaret( host->window ); + else return HideCaret( host->window ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetCaretPos,12) -DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetCaretPos(ITextHost *iface, - INT x, INT y) +DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetCaretPos( ITextHost *iface, INT x, INT y ) { return SetCaretPos(x, y); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetTimer,12) -DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetTimer(ITextHost *iface, UINT idTimer, UINT uTimeout) +DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetTimer( ITextHost *iface, UINT id, UINT timeout ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - return SetTimer(This->hWnd, idTimer, uTimeout, NULL) != 0; + struct host *host = impl_from_ITextHost( iface ); + return SetTimer( host->window, id, timeout, NULL ) != 0; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxKillTimer,8) -DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxKillTimer(ITextHost *iface, UINT idTimer) +DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxKillTimer( ITextHost *iface, UINT id ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - KillTimer(This->hWnd, idTimer); + struct host *host = impl_from_ITextHost( iface ); + KillTimer( host->window, id ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxScrollWindowEx,32) -DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxScrollWindowEx(ITextHost *iface, INT dx, INT dy, LPCRECT lprcScroll, - LPCRECT lprcClip, HRGN hRgnUpdate, LPRECT lprcUpdate, - UINT fuScroll) +DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxScrollWindowEx( ITextHost *iface, INT dx, INT dy, const RECT *scroll, + const RECT *clip, HRGN update_rgn, RECT *update_rect, + UINT flags ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - ScrollWindowEx(This->hWnd, dx, dy, lprcScroll, lprcClip, - hRgnUpdate, lprcUpdate, fuScroll); + struct host *host = impl_from_ITextHost( iface ); + ScrollWindowEx( host->window, dx, dy, scroll, clip, update_rgn, update_rect, flags ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetCapture,8) -DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCapture(ITextHost *iface, BOOL fCapture) +DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCapture( ITextHost *iface, BOOL capture ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - if (fCapture) - SetCapture(This->hWnd); - else - ReleaseCapture(); + struct host *host = impl_from_ITextHost( iface ); + if (capture) SetCapture( host->window ); + else ReleaseCapture(); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetFocus,4) DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetFocus(ITextHost *iface) { - ITextHostImpl *This = impl_from_ITextHost(iface); - SetFocus(This->hWnd); + struct host *host = impl_from_ITextHost( iface ); + SetFocus( host->window ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetCursor,12) -DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCursor(ITextHost *iface, HCURSOR hcur, BOOL fText) +DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCursor( ITextHost *iface, HCURSOR cursor, BOOL text ) { - SetCursor(hcur); + SetCursor( cursor ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxScreenToClient,8) -DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxScreenToClient(ITextHost *iface, LPPOINT lppt) +DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxScreenToClient( ITextHost *iface, POINT *pt ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - return ScreenToClient(This->hWnd, lppt); + struct host *host = impl_from_ITextHost( iface ); + return ScreenToClient( host->window, pt ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxClientToScreen,8) -DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxClientToScreen(ITextHost *iface, LPPOINT lppt) +DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxClientToScreen( ITextHost *iface, POINT *pt ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - return ClientToScreen(This->hWnd, lppt); + struct host *host = impl_from_ITextHost( iface ); + return ClientToScreen( host->window, pt ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxActivate,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxActivate(ITextHost *iface, LONG *plOldState) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxActivate( ITextHost *iface, LONG *old_state ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - *plOldState = HandleToLong(SetActiveWindow(This->hWnd)); - return (*plOldState ? S_OK : E_FAIL); + struct host *host = impl_from_ITextHost( iface ); + *old_state = HandleToLong( SetActiveWindow( host->window ) ); + return *old_state ? S_OK : E_FAIL; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxDeactivate,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxDeactivate(ITextHost *iface, LONG lNewState) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxDeactivate( ITextHost *iface, LONG new_state ) { - HWND ret = SetActiveWindow(LongToHandle(lNewState)); - return (ret ? S_OK : E_FAIL); + HWND ret = SetActiveWindow( LongToHandle( new_state ) ); + return ret ? S_OK : E_FAIL; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetClientRect,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetClientRect(ITextHost *iface, LPRECT prc) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetClientRect( ITextHost *iface, RECT *rect ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - int ret = GetClientRect(This->hWnd, prc); - return (ret ? S_OK : E_FAIL); + struct host *host = impl_from_ITextHost( iface ); + int ret = GetClientRect( host->window, rect ); + return ret ? S_OK : E_FAIL; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetViewInset,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetViewInset(ITextHost *iface, LPRECT prc) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetViewInset( ITextHost *iface, RECT *rect ) { - prc->top = 0; - prc->left = 0; - prc->bottom = 0; - prc->right = 0; + SetRectEmpty( rect ); return S_OK; } @@ -290,38 +281,38 @@ DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetCharFormat(ITextHost *ifac } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetParaFormat,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetParaFormat(ITextHost *iface, const PARAFORMAT **fmt) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetParaFormat( ITextHost *iface, const PARAFORMAT **fmt ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - *fmt = (const PARAFORMAT *)&This->para_fmt; + struct host *host = impl_from_ITextHost( iface ); + *fmt = (const PARAFORMAT *)&host->para_fmt; return S_OK; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetSysColor,8) -DECLSPEC_HIDDEN COLORREF __thiscall ITextHostImpl_TxGetSysColor(ITextHost *iface, int nIndex) +DECLSPEC_HIDDEN COLORREF __thiscall ITextHostImpl_TxGetSysColor( ITextHost *iface, int index ) { - return GetSysColor(nIndex); + return GetSysColor( index ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetBackStyle,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetBackStyle(ITextHost *iface, TXTBACKSTYLE *pStyle) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetBackStyle( ITextHost *iface, TXTBACKSTYLE *style ) { - *pStyle = TXTBACK_OPAQUE; + *style = TXTBACK_OPAQUE; return S_OK; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetMaxLength,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetMaxLength(ITextHost *iface, DWORD *pLength) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetMaxLength( ITextHost *iface, DWORD *length ) { - *pLength = INFINITE; + *length = INFINITE; return S_OK; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetScrollBars,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetScrollBars(ITextHost *iface, DWORD *pdwScrollBar) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetScrollBars( ITextHost *iface, DWORD *scrollbar ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW(This->hWnd, 0); + struct host *host = impl_from_ITextHost( iface ); + ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW( host->window, 0 ); const DWORD mask = WS_VSCROLL| WS_HSCROLL| ES_AUTOVSCROLL| @@ -329,34 +320,34 @@ DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetScrollBars(ITextHost *ifac ES_DISABLENOSCROLL; if (editor) { - *pdwScrollBar = editor->styleFlags & mask; + *scrollbar = editor->styleFlags & mask; } else { - DWORD style = GetWindowLongW(This->hWnd, GWL_STYLE); + DWORD style = GetWindowLongW( host->window, GWL_STYLE ); if (style & WS_VSCROLL) style |= ES_AUTOVSCROLL; - if (!This->bEmulateVersion10 && (style & WS_HSCROLL)) + if (!host->emulate_10 && (style & WS_HSCROLL)) style |= ES_AUTOHSCROLL; - *pdwScrollBar = style & mask; + *scrollbar = style & mask; } return S_OK; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetPasswordChar,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPasswordChar(ITextHost *iface, WCHAR *pch) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPasswordChar( ITextHost *iface, WCHAR *c ) { - *pch = '*'; + *c = '*'; return S_OK; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetAcceleratorPos,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetAcceleratorPos(ITextHost *iface, LONG *pch) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetAcceleratorPos( ITextHost *iface, LONG *pos ) { - *pch = -1; + *pos = -1; return S_OK; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetExtent,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetExtent(ITextHost *iface, LPSIZEL lpExtent) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetExtent( ITextHost *iface, SIZEL *extent ) { return E_NOTIMPL; } @@ -374,10 +365,10 @@ DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_OnTxParaFormatChange(ITextHost } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetPropertyBits,12) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPropertyBits(ITextHost *iface, DWORD dwMask, DWORD *pdwBits) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPropertyBits( ITextHost *iface, DWORD mask, DWORD *bits ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(This->hWnd, 0); + struct host *host = impl_from_ITextHost( iface ); + ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW( host->window, 0 ); DWORD style; DWORD dwBits = 0; @@ -393,7 +384,7 @@ DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPropertyBits(ITextHost *if } else { DWORD dwScrollBar; - style = GetWindowLongW(This->hWnd, GWL_STYLE); + style = GetWindowLongW( host->window, GWL_STYLE ); ITextHostImpl_TxGetScrollBars(iface, &dwScrollBar); dwBits |= TXTBIT_RICHTEXT|TXTBIT_AUTOWORDSEL; @@ -436,16 +427,16 @@ DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPropertyBits(ITextHost *if * TXTBIT_USECURRENTBKG */ - *pdwBits = dwBits & dwMask; + *bits = dwBits & mask; return S_OK; } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxNotify,12) DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxNotify(ITextHost *iface, DWORD iNotify, void *pv) { - ITextHostImpl *This = impl_from_ITextHost(iface); - ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW(This->hWnd, 0); - HWND hwnd = This->hWnd; + struct host *host = impl_from_ITextHost( iface ); + ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW( host->window, 0 ); + HWND hwnd = host->window; UINT id; if (!editor || !editor->hwndParent) return S_OK; @@ -502,26 +493,26 @@ DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxNotify(ITextHost *iface, DWOR DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxImmGetContext,4) DECLSPEC_HIDDEN HIMC __thiscall ITextHostImpl_TxImmGetContext(ITextHost *iface) { - ITextHostImpl *This = impl_from_ITextHost(iface); - return ImmGetContext(This->hWnd); + struct host *host = impl_from_ITextHost( iface ); + return ImmGetContext( host->window ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxImmReleaseContext,8) -DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxImmReleaseContext(ITextHost *iface, HIMC himc) +DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxImmReleaseContext( ITextHost *iface, HIMC context ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - ImmReleaseContext(This->hWnd, himc); + struct host *host = impl_from_ITextHost( iface ); + ImmReleaseContext( host->window, context ); } DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetSelectionBarWidth,8) -DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetSelectionBarWidth(ITextHost *iface, LONG *lSelBarWidth) +DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetSelectionBarWidth( ITextHost *iface, LONG *width ) { - ITextHostImpl *This = impl_from_ITextHost(iface); - ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(This->hWnd, 0); + struct host *host = impl_from_ITextHost( iface ); + ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW( host->window, 0 ); DWORD style = editor ? editor->styleFlags - : GetWindowLongW(This->hWnd, GWL_STYLE); - *lSelBarWidth = (style & ES_SELECTIONBAR) ? 225 : 0; /* in HIMETRIC */ + : GetWindowLongW( host->window, GWL_STYLE ); + *width = (style & ES_SELECTIONBAR) ? 225 : 0; /* in HIMETRIC */ return S_OK; }