2 * RichEdit - ITextHost implementation for windowed richedit controls
4 * Copyright 2009 by Dylan Smith
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/port.h"
24 #define NONAMELESSSTRUCT
25 #define NONAMELESSUNION
33 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(richedit);
38 typedef struct ITextHostImpl {
39 const ITextHostVtbl *lpVtbl;
42 BOOL bEmulateVersion10;
45 static const ITextHostVtbl textHostVtbl;
47 ITextHost *ME_CreateTextHost(HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersion10)
49 ITextHostImpl *texthost;
50 texthost = CoTaskMemAlloc(sizeof(*texthost));
53 ME_TextEditor *editor;
55 texthost->lpVtbl = &textHostVtbl;
57 texthost->hWnd = hwnd;
58 texthost->bEmulateVersion10 = bEmulateVersion10;
60 editor = ME_MakeEditor((ITextHost*)texthost, bEmulateVersion10);
61 editor->exStyleFlags = GetWindowLongW(hwnd, GWL_EXSTYLE);
62 editor->hWnd = hwnd; /* FIXME: Remove editor's dependence on hWnd */
63 editor->hwndParent = cs->hwndParent;
64 SetWindowLongPtrW(hwnd, 0, (LONG_PTR)editor);
67 return (ITextHost*)texthost;
70 static HRESULT WINAPI ITextHostImpl_QueryInterface(ITextHost *iface,
74 ITextHostImpl *This = (ITextHostImpl *)iface;
76 if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextHost)) {
78 ITextHost_AddRef((ITextHost *)*ppvObject);
82 FIXME("Unknown interface: %s\n", debugstr_guid(riid));
86 static ULONG WINAPI ITextHostImpl_AddRef(ITextHost *iface)
88 ITextHostImpl *This = (ITextHostImpl *)iface;
89 ULONG ref = InterlockedIncrement(&This->ref);
93 static ULONG WINAPI ITextHostImpl_Release(ITextHost *iface)
95 ITextHostImpl *This = (ITextHostImpl *)iface;
96 ULONG ref = InterlockedDecrement(&This->ref);
100 SetWindowLongPtrW(This->hWnd, 0, 0);
106 HDC WINAPI ITextHostImpl_TxGetDC(ITextHost *iface)
108 ITextHostImpl *This = (ITextHostImpl *)iface;
109 return GetDC(This->hWnd);
112 INT WINAPI ITextHostImpl_TxReleaseDC(ITextHost *iface,
115 ITextHostImpl *This = (ITextHostImpl *)iface;
116 return ReleaseDC(This->hWnd, hdc);
119 BOOL WINAPI ITextHostImpl_TxShowScrollBar(ITextHost *iface,
123 ITextHostImpl *This = (ITextHostImpl *)iface;
124 return ShowScrollBar(This->hWnd, fnBar, fShow);
127 BOOL WINAPI ITextHostImpl_TxEnableScrollBar(ITextHost *iface,
131 ITextHostImpl *This = (ITextHostImpl *)iface;
132 return EnableScrollBar(This->hWnd, fuSBFlags, fuArrowflags);
135 BOOL WINAPI ITextHostImpl_TxSetScrollRange(ITextHost *iface,
141 ITextHostImpl *This = (ITextHostImpl *)iface;
142 return SetScrollRange(This->hWnd, fnBar, nMinPos, nMaxPos, fRedraw);
145 BOOL WINAPI ITextHostImpl_TxSetScrollPos(ITextHost *iface,
150 ITextHostImpl *This = (ITextHostImpl *)iface;
151 int pos = SetScrollPos(This->hWnd, fnBar, nPos, fRedraw);
152 return (pos ? TRUE : FALSE);
155 void WINAPI ITextHostImpl_TxInvalidateRect(ITextHost *iface,
159 ITextHostImpl *This = (ITextHostImpl *)iface;
160 InvalidateRect(This->hWnd, prc, fMode);
163 void WINAPI ITextHostImpl_TxViewChange(ITextHost *iface,
166 ITextHostImpl *This = (ITextHostImpl *)iface;
168 UpdateWindow(This->hWnd);
171 BOOL WINAPI ITextHostImpl_TxCreateCaret(ITextHost *iface,
173 INT xWidth, INT yHeight)
175 ITextHostImpl *This = (ITextHostImpl *)iface;
176 return CreateCaret(This->hWnd, hbmp, xWidth, yHeight);
179 BOOL WINAPI ITextHostImpl_TxShowCaret(ITextHost *iface, BOOL fShow)
181 ITextHostImpl *This = (ITextHostImpl *)iface;
183 return ShowCaret(This->hWnd);
185 return HideCaret(This->hWnd);
188 BOOL WINAPI ITextHostImpl_TxSetCaretPos(ITextHost *iface,
191 return SetCaretPos(x, y);
194 BOOL WINAPI ITextHostImpl_TxSetTimer(ITextHost *iface,
195 UINT idTimer, UINT uTimeout)
197 ITextHostImpl *This = (ITextHostImpl *)iface;
198 return SetTimer(This->hWnd, idTimer, uTimeout, NULL) != 0;
201 void WINAPI ITextHostImpl_TxKillTimer(ITextHost *iface,
204 ITextHostImpl *This = (ITextHostImpl *)iface;
205 KillTimer(This->hWnd, idTimer);
208 void WINAPI ITextHostImpl_TxScrollWindowEx(ITextHost *iface,
216 ITextHostImpl *This = (ITextHostImpl *)iface;
217 ScrollWindowEx(This->hWnd, dx, dy, lprcScroll, lprcClip,
218 hRgnUpdate, lprcUpdate, fuScroll);
221 void WINAPI ITextHostImpl_TxSetCapture(ITextHost *iface,
224 ITextHostImpl *This = (ITextHostImpl *)iface;
226 SetCapture(This->hWnd);
231 void WINAPI ITextHostImpl_TxSetFocus(ITextHost *iface)
233 ITextHostImpl *This = (ITextHostImpl *)iface;
234 SetFocus(This->hWnd);
237 void WINAPI ITextHostImpl_TxSetCursor(ITextHost *iface,
244 BOOL WINAPI ITextHostImpl_TxScreenToClient(ITextHost *iface,
247 ITextHostImpl *This = (ITextHostImpl *)iface;
248 return ScreenToClient(This->hWnd, lppt);
251 BOOL WINAPI ITextHostImpl_TxClientToScreen(ITextHost *iface,
254 ITextHostImpl *This = (ITextHostImpl *)iface;
255 return ClientToScreen(This->hWnd, lppt);
258 HRESULT WINAPI ITextHostImpl_TxActivate(ITextHost *iface,
261 ITextHostImpl *This = (ITextHostImpl *)iface;
262 *plOldState = HandleToLong(SetActiveWindow(This->hWnd));
263 return (*plOldState ? S_OK : E_FAIL);
266 HRESULT WINAPI ITextHostImpl_TxDeactivate(ITextHost *iface,
269 HWND ret = SetActiveWindow(LongToHandle(lNewState));
270 return (ret ? S_OK : E_FAIL);
273 HRESULT WINAPI ITextHostImpl_TxGetClientRect(ITextHost *iface,
276 ITextHostImpl *This = (ITextHostImpl *)iface;
277 int ret = GetClientRect(This->hWnd, prc);
278 return (ret ? S_OK : E_FAIL);
281 HRESULT WINAPI ITextHostImpl_TxGetViewInset(ITextHost *iface,
291 HRESULT WINAPI ITextHostImpl_TxGetCharFormat(ITextHost *iface,
292 const CHARFORMATW **ppCF)
297 HRESULT WINAPI ITextHostImpl_TxGetParaFormat(ITextHost *iface,
298 const PARAFORMAT **ppPF)
303 COLORREF WINAPI ITextHostImpl_TxGetSysColor(ITextHost *iface,
306 return GetSysColor(nIndex);
309 HRESULT WINAPI ITextHostImpl_TxGetBackStyle(ITextHost *iface,
310 TXTBACKSTYLE *pStyle)
312 *pStyle = TXTBACK_OPAQUE;
316 HRESULT WINAPI ITextHostImpl_TxGetMaxLength(ITextHost *iface,
323 HRESULT WINAPI ITextHostImpl_TxGetScrollBars(ITextHost *iface,
326 ITextHostImpl *This = (ITextHostImpl *)iface;
327 ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW(This->hWnd, 0);
328 const DWORD mask = WS_VSCROLL|
335 *pdwScrollBar = editor->styleFlags & mask;
337 DWORD style = GetWindowLongW(This->hWnd, GWL_STYLE);
338 if (style & WS_VSCROLL)
339 style |= ES_AUTOVSCROLL;
340 if (!This->bEmulateVersion10 && (style & WS_HSCROLL))
341 style |= ES_AUTOHSCROLL;
342 *pdwScrollBar = style & mask;
347 HRESULT WINAPI ITextHostImpl_TxGetPasswordChar(ITextHost *iface,
354 HRESULT WINAPI ITextHostImpl_TxGetAcceleratorPos(ITextHost *iface,
361 HRESULT WINAPI ITextHostImpl_TxGetExtent(ITextHost *iface,
367 HRESULT WINAPI ITextHostImpl_OnTxCharFormatChange(ITextHost *iface,
368 const CHARFORMATW *pcf)
373 HRESULT WINAPI ITextHostImpl_OnTxParaFormatChange(ITextHost *iface,
374 const PARAFORMAT *ppf)
379 HRESULT WINAPI ITextHostImpl_TxGetPropertyBits(ITextHost *iface,
383 ITextHostImpl *This = (ITextHostImpl *)iface;
384 ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(This->hWnd, 0);
390 style = editor->styleFlags;
391 if (editor->mode & TM_RICHTEXT)
392 dwBits |= TXTBIT_RICHTEXT;
393 if (editor->bWordWrap)
394 dwBits |= TXTBIT_WORDWRAP;
395 if (style & ECO_AUTOWORDSELECTION)
396 dwBits |= TXTBIT_AUTOWORDSEL;
400 style = GetWindowLongW(This->hWnd, GWL_STYLE);
401 ITextHostImpl_TxGetScrollBars(iface, &dwScrollBar);
403 dwBits |= TXTBIT_RICHTEXT|TXTBIT_AUTOWORDSEL;
404 if (!(dwScrollBar & ES_AUTOHSCROLL))
405 dwBits |= TXTBIT_WORDWRAP;
408 /* Bits that correspond to window styles. */
409 if (style & ES_MULTILINE)
410 dwBits |= TXTBIT_MULTILINE;
411 if (style & ES_READONLY)
412 dwBits |= TXTBIT_READONLY;
413 if (style & ES_PASSWORD)
414 dwBits |= TXTBIT_USEPASSWORD;
415 if (!(style & ES_NOHIDESEL))
416 dwBits |= TXTBIT_HIDESELECTION;
417 if (style & ES_SAVESEL)
418 dwBits |= TXTBIT_SAVESELECTION;
419 if (style & ES_VERTICAL)
420 dwBits |= TXTBIT_VERTICAL;
421 if (style & ES_NOOLEDRAGDROP)
422 dwBits |= TXTBIT_DISABLEDRAG;
424 dwBits |= TXTBIT_ALLOWBEEP;
426 /* The following bits are always FALSE because they are probably only
427 * needed for ITextServices_OnTxPropertyBitsChange:
428 * TXTBIT_VIEWINSETCHANGE
429 * TXTBIT_BACKSTYLECHANGE
430 * TXTBIT_MAXLENGTHCHANGE
431 * TXTBIT_CHARFORMATCHANGE
432 * TXTBIT_PARAFORMATCHANGE
433 * TXTBIT_SHOWACCELERATOR
434 * TXTBIT_EXTENTCHANGE
435 * TXTBIT_SELBARCHANGE
436 * TXTBIT_SCROLLBARCHANGE
437 * TXTBIT_CLIENTRECTCHANGE
439 * Documented by MSDN as not supported:
440 * TXTBIT_USECURRENTBKG
443 *pdwBits = dwBits & dwMask;
447 HRESULT WINAPI ITextHostImpl_TxNotify(ITextHost *iface,
451 ITextHostImpl *This = (ITextHostImpl *)iface;
452 ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW(This->hWnd, 0);
453 HWND hwnd = This->hWnd;
456 if (!editor || !editor->hwndParent) return S_OK;
458 id = GetWindowLongW(hwnd, GWLP_ID);
466 case EN_REQUESTRESIZE:
467 case EN_SAVECLIPBOARD:
471 /* FIXME: Verify this assumption that pv starts with NMHDR. */
476 info->hwndFrom = hwnd;
478 info->code = iNotify;
479 SendMessageW(editor->hwndParent, WM_NOTIFY, id, (LPARAM)info);
484 /* Only sent when the window is visible. */
485 if (!IsWindowVisible(hwnd))
495 SendMessageW(editor->hwndParent, WM_COMMAND, MAKEWPARAM(id, iNotify), (LPARAM)hwnd);
499 FIXME("EN_MSGFILTER is documented as not being sent to TxNotify\n");
507 HIMC WINAPI ITextHostImpl_TxImmGetContext(ITextHost *iface)
509 ITextHostImpl *This = (ITextHostImpl *)iface;
510 return ImmGetContext(This->hWnd);
513 void WINAPI ITextHostImpl_TxImmReleaseContext(ITextHost *iface,
516 ITextHostImpl *This = (ITextHostImpl *)iface;
517 ImmReleaseContext(This->hWnd, himc);
520 HRESULT WINAPI ITextHostImpl_TxGetSelectionBarWidth(ITextHost *iface,
523 ITextHostImpl *This = (ITextHostImpl *)iface;
524 ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(This->hWnd, 0);
526 DWORD style = editor ? editor->styleFlags
527 : GetWindowLongW(This->hWnd, GWL_STYLE);
528 *lSelBarWidth = (style & ES_SELECTIONBAR) ? 225 : 0; /* in HIMETRIC */
533 #ifdef __i386__ /* thiscall functions are i386-specific */
535 #define THISCALL(func) __thiscall_ ## func
536 #define DEFINE_THISCALL_WRAPPER(func,args) \
537 extern typeof(func) THISCALL(func); \
538 __ASM_STDCALL_FUNC(__thiscall_ ## func, args, \
542 "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) )
546 #define THISCALL(func) func
547 #define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */
549 #endif /* __i386__ */
551 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetDC,4)
552 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxReleaseDC,8)
553 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxShowScrollBar,12)
554 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxEnableScrollBar,12)
555 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetScrollRange,20)
556 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetScrollPos,16)
557 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxInvalidateRect,12)
558 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxViewChange,8)
559 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxCreateCaret,16)
560 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxShowCaret,8)
561 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetCaretPos,12)
562 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetTimer,12)
563 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxKillTimer,8)
564 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxScrollWindowEx,32)
565 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetCapture,8)
566 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetFocus,4)
567 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetCursor,12)
568 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxScreenToClient,8)
569 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxClientToScreen,8)
570 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxActivate,8)
571 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxDeactivate,8)
572 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetClientRect,8)
573 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetViewInset,8)
574 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetCharFormat,8)
575 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetParaFormat,8)
576 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetSysColor,8)
577 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetBackStyle,8)
578 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetMaxLength,8)
579 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetScrollBars,8)
580 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetPasswordChar,8)
581 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetAcceleratorPos,8)
582 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetExtent,8)
583 DEFINE_THISCALL_WRAPPER(ITextHostImpl_OnTxCharFormatChange,8)
584 DEFINE_THISCALL_WRAPPER(ITextHostImpl_OnTxParaFormatChange,8)
585 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetPropertyBits,12)
586 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxNotify,12)
587 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxImmGetContext,4)
588 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxImmReleaseContext,8)
589 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetSelectionBarWidth,8)
591 #ifdef __i386__ /* thiscall functions are i386-specific */
593 #define STDCALL(func) __stdcall_ ## func
594 #define DEFINE_STDCALL_WRAPPER(num,func,args) \
595 extern typeof(func) __stdcall_ ## func; \
596 __ASM_STDCALL_FUNC(__stdcall_ ## func, args, \
600 "movl (%ecx), %eax\n\t" \
601 "jmp *(4*(" #num "))(%eax)" )
603 DEFINE_STDCALL_WRAPPER(3,ITextHostImpl_TxGetDC,4)
604 DEFINE_STDCALL_WRAPPER(4,ITextHostImpl_TxReleaseDC,8)
605 DEFINE_STDCALL_WRAPPER(5,ITextHostImpl_TxShowScrollBar,12)
606 DEFINE_STDCALL_WRAPPER(6,ITextHostImpl_TxEnableScrollBar,12)
607 DEFINE_STDCALL_WRAPPER(7,ITextHostImpl_TxSetScrollRange,20)
608 DEFINE_STDCALL_WRAPPER(8,ITextHostImpl_TxSetScrollPos,16)
609 DEFINE_STDCALL_WRAPPER(9,ITextHostImpl_TxInvalidateRect,12)
610 DEFINE_STDCALL_WRAPPER(10,ITextHostImpl_TxViewChange,8)
611 DEFINE_STDCALL_WRAPPER(11,ITextHostImpl_TxCreateCaret,16)
612 DEFINE_STDCALL_WRAPPER(12,ITextHostImpl_TxShowCaret,8)
613 DEFINE_STDCALL_WRAPPER(13,ITextHostImpl_TxSetCaretPos,12)
614 DEFINE_STDCALL_WRAPPER(14,ITextHostImpl_TxSetTimer,12)
615 DEFINE_STDCALL_WRAPPER(15,ITextHostImpl_TxKillTimer,8)
616 DEFINE_STDCALL_WRAPPER(16,ITextHostImpl_TxScrollWindowEx,32)
617 DEFINE_STDCALL_WRAPPER(17,ITextHostImpl_TxSetCapture,8)
618 DEFINE_STDCALL_WRAPPER(18,ITextHostImpl_TxSetFocus,4)
619 DEFINE_STDCALL_WRAPPER(19,ITextHostImpl_TxSetCursor,12)
620 DEFINE_STDCALL_WRAPPER(20,ITextHostImpl_TxScreenToClient,8)
621 DEFINE_STDCALL_WRAPPER(21,ITextHostImpl_TxClientToScreen,8)
622 DEFINE_STDCALL_WRAPPER(22,ITextHostImpl_TxActivate,8)
623 DEFINE_STDCALL_WRAPPER(23,ITextHostImpl_TxDeactivate,8)
624 DEFINE_STDCALL_WRAPPER(24,ITextHostImpl_TxGetClientRect,8)
625 DEFINE_STDCALL_WRAPPER(25,ITextHostImpl_TxGetViewInset,8)
626 DEFINE_STDCALL_WRAPPER(26,ITextHostImpl_TxGetCharFormat,8)
627 DEFINE_STDCALL_WRAPPER(27,ITextHostImpl_TxGetParaFormat,8)
628 DEFINE_STDCALL_WRAPPER(28,ITextHostImpl_TxGetSysColor,8)
629 DEFINE_STDCALL_WRAPPER(29,ITextHostImpl_TxGetBackStyle,8)
630 DEFINE_STDCALL_WRAPPER(30,ITextHostImpl_TxGetMaxLength,8)
631 DEFINE_STDCALL_WRAPPER(31,ITextHostImpl_TxGetScrollBars,8)
632 DEFINE_STDCALL_WRAPPER(32,ITextHostImpl_TxGetPasswordChar,8)
633 DEFINE_STDCALL_WRAPPER(33,ITextHostImpl_TxGetAcceleratorPos,8)
634 DEFINE_STDCALL_WRAPPER(34,ITextHostImpl_TxGetExtent,8)
635 DEFINE_STDCALL_WRAPPER(35,ITextHostImpl_OnTxCharFormatChange,8)
636 DEFINE_STDCALL_WRAPPER(36,ITextHostImpl_OnTxParaFormatChange,8)
637 DEFINE_STDCALL_WRAPPER(37,ITextHostImpl_TxGetPropertyBits,12)
638 DEFINE_STDCALL_WRAPPER(38,ITextHostImpl_TxNotify,12)
639 DEFINE_STDCALL_WRAPPER(39,ITextHostImpl_TxImmGetContext,4)
640 DEFINE_STDCALL_WRAPPER(40,ITextHostImpl_TxImmReleaseContext,8)
641 DEFINE_STDCALL_WRAPPER(41,ITextHostImpl_TxGetSelectionBarWidth,8)
643 const ITextHostVtbl itextHostStdcallVtbl = {
647 __stdcall_ITextHostImpl_TxGetDC,
648 __stdcall_ITextHostImpl_TxReleaseDC,
649 __stdcall_ITextHostImpl_TxShowScrollBar,
650 __stdcall_ITextHostImpl_TxEnableScrollBar,
651 __stdcall_ITextHostImpl_TxSetScrollRange,
652 __stdcall_ITextHostImpl_TxSetScrollPos,
653 __stdcall_ITextHostImpl_TxInvalidateRect,
654 __stdcall_ITextHostImpl_TxViewChange,
655 __stdcall_ITextHostImpl_TxCreateCaret,
656 __stdcall_ITextHostImpl_TxShowCaret,
657 __stdcall_ITextHostImpl_TxSetCaretPos,
658 __stdcall_ITextHostImpl_TxSetTimer,
659 __stdcall_ITextHostImpl_TxKillTimer,
660 __stdcall_ITextHostImpl_TxScrollWindowEx,
661 __stdcall_ITextHostImpl_TxSetCapture,
662 __stdcall_ITextHostImpl_TxSetFocus,
663 __stdcall_ITextHostImpl_TxSetCursor,
664 __stdcall_ITextHostImpl_TxScreenToClient,
665 __stdcall_ITextHostImpl_TxClientToScreen,
666 __stdcall_ITextHostImpl_TxActivate,
667 __stdcall_ITextHostImpl_TxDeactivate,
668 __stdcall_ITextHostImpl_TxGetClientRect,
669 __stdcall_ITextHostImpl_TxGetViewInset,
670 __stdcall_ITextHostImpl_TxGetCharFormat,
671 __stdcall_ITextHostImpl_TxGetParaFormat,
672 __stdcall_ITextHostImpl_TxGetSysColor,
673 __stdcall_ITextHostImpl_TxGetBackStyle,
674 __stdcall_ITextHostImpl_TxGetMaxLength,
675 __stdcall_ITextHostImpl_TxGetScrollBars,
676 __stdcall_ITextHostImpl_TxGetPasswordChar,
677 __stdcall_ITextHostImpl_TxGetAcceleratorPos,
678 __stdcall_ITextHostImpl_TxGetExtent,
679 __stdcall_ITextHostImpl_OnTxCharFormatChange,
680 __stdcall_ITextHostImpl_OnTxParaFormatChange,
681 __stdcall_ITextHostImpl_TxGetPropertyBits,
682 __stdcall_ITextHostImpl_TxNotify,
683 __stdcall_ITextHostImpl_TxImmGetContext,
684 __stdcall_ITextHostImpl_TxImmReleaseContext,
685 __stdcall_ITextHostImpl_TxGetSelectionBarWidth,
688 #endif /* __i386__ */
690 static const ITextHostVtbl textHostVtbl = {
691 ITextHostImpl_QueryInterface,
692 ITextHostImpl_AddRef,
693 ITextHostImpl_Release,
694 THISCALL(ITextHostImpl_TxGetDC),
695 THISCALL(ITextHostImpl_TxReleaseDC),
696 THISCALL(ITextHostImpl_TxShowScrollBar),
697 THISCALL(ITextHostImpl_TxEnableScrollBar),
698 THISCALL(ITextHostImpl_TxSetScrollRange),
699 THISCALL(ITextHostImpl_TxSetScrollPos),
700 THISCALL(ITextHostImpl_TxInvalidateRect),
701 THISCALL(ITextHostImpl_TxViewChange),
702 THISCALL(ITextHostImpl_TxCreateCaret),
703 THISCALL(ITextHostImpl_TxShowCaret),
704 THISCALL(ITextHostImpl_TxSetCaretPos),
705 THISCALL(ITextHostImpl_TxSetTimer),
706 THISCALL(ITextHostImpl_TxKillTimer),
707 THISCALL(ITextHostImpl_TxScrollWindowEx),
708 THISCALL(ITextHostImpl_TxSetCapture),
709 THISCALL(ITextHostImpl_TxSetFocus),
710 THISCALL(ITextHostImpl_TxSetCursor),
711 THISCALL(ITextHostImpl_TxScreenToClient),
712 THISCALL(ITextHostImpl_TxClientToScreen),
713 THISCALL(ITextHostImpl_TxActivate),
714 THISCALL(ITextHostImpl_TxDeactivate),
715 THISCALL(ITextHostImpl_TxGetClientRect),
716 THISCALL(ITextHostImpl_TxGetViewInset),
717 THISCALL(ITextHostImpl_TxGetCharFormat),
718 THISCALL(ITextHostImpl_TxGetParaFormat),
719 THISCALL(ITextHostImpl_TxGetSysColor),
720 THISCALL(ITextHostImpl_TxGetBackStyle),
721 THISCALL(ITextHostImpl_TxGetMaxLength),
722 THISCALL(ITextHostImpl_TxGetScrollBars),
723 THISCALL(ITextHostImpl_TxGetPasswordChar),
724 THISCALL(ITextHostImpl_TxGetAcceleratorPos),
725 THISCALL(ITextHostImpl_TxGetExtent),
726 THISCALL(ITextHostImpl_OnTxCharFormatChange),
727 THISCALL(ITextHostImpl_OnTxParaFormatChange),
728 THISCALL(ITextHostImpl_TxGetPropertyBits),
729 THISCALL(ITextHostImpl_TxNotify),
730 THISCALL(ITextHostImpl_TxImmGetContext),
731 THISCALL(ITextHostImpl_TxImmReleaseContext),
732 THISCALL(ITextHostImpl_TxGetSelectionBarWidth),