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 ITextHostVtbl textHostVtbl;
47 ITextHost *ME_CreateTextHost(HWND hwnd, 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 dependance on hWnd */
63 SetWindowLongPtrW(hwnd, 0, (LONG_PTR)editor);
66 return (ITextHost*)texthost;
69 static HRESULT WINAPI ITextHostImpl_QueryInterface(ITextHost *iface,
73 ITextHostImpl *This = (ITextHostImpl *)iface;
75 if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextHost)) {
77 ITextHost_AddRef((ITextHost *)*ppvObject);
81 FIXME("Unknown interface: %s\n", debugstr_guid(riid));
85 static ULONG WINAPI ITextHostImpl_AddRef(ITextHost *iface)
87 ITextHostImpl *This = (ITextHostImpl *)iface;
88 ULONG ref = InterlockedIncrement(&This->ref);
92 static ULONG WINAPI ITextHostImpl_Release(ITextHost *iface)
94 ITextHostImpl *This = (ITextHostImpl *)iface;
95 ULONG ref = InterlockedDecrement(&This->ref);
99 SetWindowLongPtrW(This->hWnd, 0, 0);
105 HDC WINAPI ITextHostImpl_TxGetDC(ITextHost *iface)
107 ITextHostImpl *This = (ITextHostImpl *)iface;
108 return GetDC(This->hWnd);
111 INT WINAPI ITextHostImpl_TxReleaseDC(ITextHost *iface,
114 ITextHostImpl *This = (ITextHostImpl *)iface;
115 return ReleaseDC(This->hWnd, hdc);
118 BOOL WINAPI ITextHostImpl_TxShowScrollBar(ITextHost *iface,
122 ITextHostImpl *This = (ITextHostImpl *)iface;
123 return ShowScrollBar(This->hWnd, fnBar, fShow);
126 BOOL WINAPI ITextHostImpl_TxEnableScrollBar(ITextHost *iface,
130 ITextHostImpl *This = (ITextHostImpl *)iface;
131 return EnableScrollBar(This->hWnd, fuSBFlags, fuArrowflags);
134 BOOL WINAPI ITextHostImpl_TxSetScrollRange(ITextHost *iface,
140 ITextHostImpl *This = (ITextHostImpl *)iface;
141 return SetScrollRange(This->hWnd, fnBar, nMinPos, nMaxPos, fRedraw);
144 BOOL WINAPI ITextHostImpl_TxSetScrollPos(ITextHost *iface,
149 ITextHostImpl *This = (ITextHostImpl *)iface;
150 int pos = SetScrollPos(This->hWnd, fnBar, nPos, fRedraw);
151 return (pos ? TRUE : FALSE);
154 void WINAPI ITextHostImpl_TxInvalidateRect(ITextHost *iface,
158 ITextHostImpl *This = (ITextHostImpl *)iface;
159 InvalidateRect(This->hWnd, prc, fMode);
162 void WINAPI ITextHostImpl_TxViewChange(ITextHost *iface,
165 ITextHostImpl *This = (ITextHostImpl *)iface;
167 UpdateWindow(This->hWnd);
170 BOOL WINAPI ITextHostImpl_TxCreateCaret(ITextHost *iface,
172 INT xWidth, INT yHeight)
174 ITextHostImpl *This = (ITextHostImpl *)iface;
175 return CreateCaret(This->hWnd, hbmp, xWidth, yHeight);
178 BOOL WINAPI ITextHostImpl_TxShowCaret(ITextHost *iface, BOOL fShow)
180 ITextHostImpl *This = (ITextHostImpl *)iface;
182 return ShowCaret(This->hWnd);
184 return HideCaret(This->hWnd);
187 BOOL WINAPI ITextHostImpl_TxSetCaretPos(ITextHost *iface,
190 return SetCaretPos(x, y);
193 BOOL WINAPI ITextHostImpl_TxSetTimer(ITextHost *iface,
194 UINT idTimer, UINT uTimeout)
196 ITextHostImpl *This = (ITextHostImpl *)iface;
197 return SetTimer(This->hWnd, idTimer, uTimeout, NULL) != 0;
200 void WINAPI ITextHostImpl_TxKillTimer(ITextHost *iface,
203 ITextHostImpl *This = (ITextHostImpl *)iface;
204 KillTimer(This->hWnd, idTimer);
207 void WINAPI ITextHostImpl_TxScrollWindowEx(ITextHost *iface,
215 ITextHostImpl *This = (ITextHostImpl *)iface;
216 ScrollWindowEx(This->hWnd, dx, dy, lprcScroll, lprcClip,
217 hRgnUpdate, lprcUpdate, fuScroll);
220 void WINAPI ITextHostImpl_TxSetCapture(ITextHost *iface,
223 ITextHostImpl *This = (ITextHostImpl *)iface;
225 SetCapture(This->hWnd);
230 void WINAPI ITextHostImpl_TxSetFocus(ITextHost *iface)
232 ITextHostImpl *This = (ITextHostImpl *)iface;
233 SetFocus(This->hWnd);
236 void WINAPI ITextHostImpl_TxSetCursor(ITextHost *iface,
243 BOOL WINAPI ITextHostImpl_TxScreenToClient(ITextHost *iface,
246 ITextHostImpl *This = (ITextHostImpl *)iface;
247 return ScreenToClient(This->hWnd, lppt);
250 BOOL WINAPI ITextHostImpl_TxClientToScreen(ITextHost *iface,
253 ITextHostImpl *This = (ITextHostImpl *)iface;
254 return ClientToScreen(This->hWnd, lppt);
257 HRESULT WINAPI ITextHostImpl_TxActivate(ITextHost *iface,
260 ITextHostImpl *This = (ITextHostImpl *)iface;
261 *plOldState = (LONG)SetActiveWindow(This->hWnd);
262 return (*plOldState ? S_OK : E_FAIL);
265 HRESULT WINAPI ITextHostImpl_TxDeactivate(ITextHost *iface,
268 HWND ret = SetActiveWindow((HWND)lNewState);
269 return (ret ? S_OK : E_FAIL);
272 HRESULT WINAPI ITextHostImpl_TxGetClientRect(ITextHost *iface,
275 ITextHostImpl *This = (ITextHostImpl *)iface;
276 int ret = GetClientRect(This->hWnd, prc);
277 return (ret ? S_OK : E_FAIL);
280 HRESULT WINAPI ITextHostImpl_TxGetViewInset(ITextHost *iface,
290 HRESULT WINAPI ITextHostImpl_TxGetCharFormat(ITextHost *iface,
291 const CHARFORMATW **ppCF)
296 HRESULT WINAPI ITextHostImpl_TxGetParaFormat(ITextHost *iface,
297 const PARAFORMAT **ppPF)
302 COLORREF WINAPI ITextHostImpl_TxGetSysColor(ITextHost *iface,
305 return GetSysColor(nIndex);
308 HRESULT WINAPI ITextHostImpl_TxGetBackStyle(ITextHost *iface,
309 TXTBACKSTYLE *pStyle)
311 *pStyle = TXTBACK_OPAQUE;
315 HRESULT WINAPI ITextHostImpl_TxGetMaxLength(ITextHost *iface,
322 HRESULT WINAPI ITextHostImpl_TxGetScrollBars(ITextHost *iface,
325 ITextHostImpl *This = (ITextHostImpl *)iface;
326 ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongW(This->hWnd, 0);
327 const DWORD mask = WS_VSCROLL|
334 *pdwScrollBar = editor->styleFlags & mask;
336 DWORD style = GetWindowLongW(This->hWnd, GWL_STYLE);
337 if (style & WS_VSCROLL)
338 style |= ES_AUTOVSCROLL;
339 if (!This->bEmulateVersion10 && (style & WS_HSCROLL))
340 style |= ES_AUTOHSCROLL;
341 *pdwScrollBar = style & mask;
346 HRESULT WINAPI ITextHostImpl_TxGetPasswordChar(ITextHost *iface,
353 HRESULT WINAPI ITextHostImpl_TxGetAcceleratorPos(ITextHost *iface,
360 HRESULT WINAPI ITextHostImpl_TxGetExtent(ITextHost *iface,
366 HRESULT WINAPI ITextHostImpl_OnTxCharFormatChange(ITextHost *iface,
367 const CHARFORMATW *pcf)
372 HRESULT WINAPI ITextHostImpl_OnTxParaFormatChange(ITextHost *iface,
373 const PARAFORMAT *ppf)
378 HRESULT WINAPI ITextHostImpl_TxGetPropertyBits(ITextHost *iface,
382 ITextHostImpl *This = (ITextHostImpl *)iface;
383 ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(This->hWnd, 0);
389 style = editor->styleFlags;
390 if (editor->mode & TM_RICHTEXT)
391 dwBits |= TXTBIT_RICHTEXT;
392 if (editor->bWordWrap)
393 dwBits |= TXTBIT_WORDWRAP;
394 if (style & ECO_AUTOWORDSELECTION)
395 dwBits |= TXTBIT_AUTOWORDSEL;
399 style = GetWindowLongW(This->hWnd, GWL_STYLE);
400 ITextHostImpl_TxGetScrollBars(iface, &dwScrollBar);
402 dwBits |= TXTBIT_RICHTEXT|TXTBIT_AUTOWORDSEL;
403 if (!(dwScrollBar & ES_AUTOHSCROLL))
404 dwBits |= TXTBIT_WORDWRAP;
407 /* Bits that correspond to window styles. */
408 if (style & ES_MULTILINE)
409 dwBits |= TXTBIT_MULTILINE;
410 if (style & ES_READONLY)
411 dwBits |= TXTBIT_READONLY;
412 if (style & ES_PASSWORD)
413 dwBits |= TXTBIT_USEPASSWORD;
414 if (!(style & ES_NOHIDESEL))
415 dwBits |= TXTBIT_HIDESELECTION;
416 if (style & ES_SAVESEL)
417 dwBits |= TXTBIT_SAVESELECTION;
418 if (style & ES_VERTICAL)
419 dwBits |= TXTBIT_VERTICAL;
420 if (style & ES_NOOLEDRAGDROP)
421 dwBits |= TXTBIT_DISABLEDRAG;
423 dwBits |= TXTBIT_ALLOWBEEP;
425 /* The following bits are always FALSE because they are probably only
426 * needed for ITextServices_OnTxPropertyBitsChange:
427 * TXTBIT_VIEWINSETCHANGE
428 * TXTBIT_BACKSTYLECHANGE
429 * TXTBIT_MAXLENGTHCHANGE
430 * TXTBIT_CHARFORMATCHANGE
431 * TXTBIT_PARAFORMATCHANGE
432 * TXTBIT_SHOWACCELERATOR
433 * TXTBIT_EXTENTCHANGE
434 * TXTBIT_SELBARCHANGE
435 * TXTBIT_SCROLLBARCHANGE
436 * TXTBIT_CLIENTRECTCHANGE
438 * Documented by MSDN as not supported:
439 * TXTBIT_USECURRENTBKG
442 *pdwBits = dwBits & dwMask;
446 HRESULT WINAPI ITextHostImpl_TxNotify(ITextHost *iface,
450 ITextHostImpl *This = (ITextHostImpl *)iface;
451 HWND hwnd = This->hWnd;
452 HWND parent = GetParent(hwnd);
453 UINT id = GetWindowLongW(hwnd, GWLP_ID);
455 /* Note: EN_MSGFILTER is documented as not being sent to TxNotify */
463 case EN_REQUESTRESIZE:
464 case EN_SAVECLIPBOARD:
468 /* FIXME: Verify this assumption that pv starts with NMHDR. */
473 info->hwndFrom = hwnd;
475 info->code = iNotify;
476 SendMessageW(parent, WM_NOTIFY, id, (LPARAM)info);
481 /* Only sent when the window is visible. */
482 if (!IsWindowVisible(This->hWnd))
492 SendMessageW(parent, WM_COMMAND, MAKEWPARAM(id, iNotify), (LPARAM)hwnd);
501 HIMC WINAPI ITextHostImpl_TxImmGetContext(ITextHost *iface)
503 ITextHostImpl *This = (ITextHostImpl *)iface;
504 return ImmGetContext(This->hWnd);
507 void WINAPI ITextHostImpl_TxImmReleaseContext(ITextHost *iface,
510 ITextHostImpl *This = (ITextHostImpl *)iface;
511 ImmReleaseContext(This->hWnd, himc);
514 HRESULT WINAPI ITextHostImpl_TxGetSelectionBarWidth(ITextHost *iface,
517 ITextHostImpl *This = (ITextHostImpl *)iface;
518 ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(This->hWnd, 0);
520 DWORD style = editor ? editor->styleFlags
521 : GetWindowLongW(This->hWnd, GWL_STYLE);
522 *lSelBarWidth = (style & ES_SELECTIONBAR) ? 225 : 0; /* in HIMETRIC */
527 #ifdef __i386__ /* thiscall functions are i386-specific */
529 #define THISCALL(func) __thiscall_ ## func
530 #define DEFINE_THISCALL_WRAPPER(func) \
531 extern typeof(func) THISCALL(func); \
532 __ASM_GLOBAL_FUNC(__thiscall_ ## func, \
536 "jmp " __ASM_NAME(#func) )
540 #define THISCALL(func) func
541 #define DEFINE_THISCALL_WRAPPER(func) /* nothing */
543 #endif /* __i386__ */
545 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetDC);
546 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxReleaseDC);
547 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxShowScrollBar);
548 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxEnableScrollBar);
549 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetScrollRange);
550 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetScrollPos);
551 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxInvalidateRect);
552 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxViewChange);
553 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxCreateCaret);
554 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxShowCaret);
555 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetCaretPos);
556 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetTimer);
557 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxKillTimer);
558 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxScrollWindowEx);
559 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetCapture);
560 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetFocus);
561 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxSetCursor);
562 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxScreenToClient);
563 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxClientToScreen);
564 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxActivate);
565 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxDeactivate);
566 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetClientRect);
567 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetViewInset);
568 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetCharFormat);
569 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetParaFormat);
570 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetSysColor);
571 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetBackStyle);
572 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetMaxLength);
573 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetScrollBars);
574 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetPasswordChar);
575 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetAcceleratorPos);
576 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetExtent);
577 DEFINE_THISCALL_WRAPPER(ITextHostImpl_OnTxCharFormatChange);
578 DEFINE_THISCALL_WRAPPER(ITextHostImpl_OnTxParaFormatChange);
579 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetPropertyBits);
580 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxNotify);
581 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxImmGetContext);
582 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxImmReleaseContext);
583 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetSelectionBarWidth);
585 static ITextHostVtbl textHostVtbl = {
586 ITextHostImpl_QueryInterface,
587 ITextHostImpl_AddRef,
588 ITextHostImpl_Release,
589 THISCALL(ITextHostImpl_TxGetDC),
590 THISCALL(ITextHostImpl_TxReleaseDC),
591 THISCALL(ITextHostImpl_TxShowScrollBar),
592 THISCALL(ITextHostImpl_TxEnableScrollBar),
593 THISCALL(ITextHostImpl_TxSetScrollRange),
594 THISCALL(ITextHostImpl_TxSetScrollPos),
595 THISCALL(ITextHostImpl_TxInvalidateRect),
596 THISCALL(ITextHostImpl_TxViewChange),
597 THISCALL(ITextHostImpl_TxCreateCaret),
598 THISCALL(ITextHostImpl_TxShowCaret),
599 THISCALL(ITextHostImpl_TxSetCaretPos),
600 THISCALL(ITextHostImpl_TxSetTimer),
601 THISCALL(ITextHostImpl_TxKillTimer),
602 THISCALL(ITextHostImpl_TxScrollWindowEx),
603 THISCALL(ITextHostImpl_TxSetCapture),
604 THISCALL(ITextHostImpl_TxSetFocus),
605 THISCALL(ITextHostImpl_TxSetCursor),
606 THISCALL(ITextHostImpl_TxScreenToClient),
607 THISCALL(ITextHostImpl_TxClientToScreen),
608 THISCALL(ITextHostImpl_TxActivate),
609 THISCALL(ITextHostImpl_TxDeactivate),
610 THISCALL(ITextHostImpl_TxGetClientRect),
611 THISCALL(ITextHostImpl_TxGetViewInset),
612 THISCALL(ITextHostImpl_TxGetCharFormat),
613 THISCALL(ITextHostImpl_TxGetParaFormat),
614 THISCALL(ITextHostImpl_TxGetSysColor),
615 THISCALL(ITextHostImpl_TxGetBackStyle),
616 THISCALL(ITextHostImpl_TxGetMaxLength),
617 THISCALL(ITextHostImpl_TxGetScrollBars),
618 THISCALL(ITextHostImpl_TxGetPasswordChar),
619 THISCALL(ITextHostImpl_TxGetAcceleratorPos),
620 THISCALL(ITextHostImpl_TxGetExtent),
621 THISCALL(ITextHostImpl_OnTxCharFormatChange),
622 THISCALL(ITextHostImpl_OnTxParaFormatChange),
623 THISCALL(ITextHostImpl_TxGetPropertyBits),
624 THISCALL(ITextHostImpl_TxNotify),
625 THISCALL(ITextHostImpl_TxImmGetContext),
626 THISCALL(ITextHostImpl_TxImmReleaseContext),
627 THISCALL(ITextHostImpl_TxGetSelectionBarWidth),
630 #ifdef __i386__ /* thiscall functions are i386-specific */
632 #define STDCALL(func) __stdcall_ ## func
633 #define DEFINE_STDCALL_WRAPPER(num,func) \
634 extern typeof(func) __stdcall_ ## func; \
635 __ASM_GLOBAL_FUNC(__stdcall_ ## func, \
639 "movl (%ecx), %eax\n\t" \
640 "jmp *(4*(" #num "))(%eax)" )
642 DEFINE_STDCALL_WRAPPER(3,ITextHostImpl_TxGetDC);
643 DEFINE_STDCALL_WRAPPER(4,ITextHostImpl_TxReleaseDC);
644 DEFINE_STDCALL_WRAPPER(5,ITextHostImpl_TxShowScrollBar);
645 DEFINE_STDCALL_WRAPPER(6,ITextHostImpl_TxEnableScrollBar);
646 DEFINE_STDCALL_WRAPPER(7,ITextHostImpl_TxSetScrollRange);
647 DEFINE_STDCALL_WRAPPER(8,ITextHostImpl_TxSetScrollPos);
648 DEFINE_STDCALL_WRAPPER(9,ITextHostImpl_TxInvalidateRect);
649 DEFINE_STDCALL_WRAPPER(10,ITextHostImpl_TxViewChange);
650 DEFINE_STDCALL_WRAPPER(11,ITextHostImpl_TxCreateCaret);
651 DEFINE_STDCALL_WRAPPER(12,ITextHostImpl_TxShowCaret);
652 DEFINE_STDCALL_WRAPPER(13,ITextHostImpl_TxSetCaretPos);
653 DEFINE_STDCALL_WRAPPER(14,ITextHostImpl_TxSetTimer);
654 DEFINE_STDCALL_WRAPPER(15,ITextHostImpl_TxKillTimer);
655 DEFINE_STDCALL_WRAPPER(16,ITextHostImpl_TxScrollWindowEx);
656 DEFINE_STDCALL_WRAPPER(17,ITextHostImpl_TxSetCapture);
657 DEFINE_STDCALL_WRAPPER(18,ITextHostImpl_TxSetFocus);
658 DEFINE_STDCALL_WRAPPER(19,ITextHostImpl_TxSetCursor);
659 DEFINE_STDCALL_WRAPPER(20,ITextHostImpl_TxScreenToClient);
660 DEFINE_STDCALL_WRAPPER(21,ITextHostImpl_TxClientToScreen);
661 DEFINE_STDCALL_WRAPPER(22,ITextHostImpl_TxActivate);
662 DEFINE_STDCALL_WRAPPER(23,ITextHostImpl_TxDeactivate);
663 DEFINE_STDCALL_WRAPPER(24,ITextHostImpl_TxGetClientRect);
664 DEFINE_STDCALL_WRAPPER(25,ITextHostImpl_TxGetViewInset);
665 DEFINE_STDCALL_WRAPPER(26,ITextHostImpl_TxGetCharFormat);
666 DEFINE_STDCALL_WRAPPER(27,ITextHostImpl_TxGetParaFormat);
667 DEFINE_STDCALL_WRAPPER(28,ITextHostImpl_TxGetSysColor);
668 DEFINE_STDCALL_WRAPPER(29,ITextHostImpl_TxGetBackStyle);
669 DEFINE_STDCALL_WRAPPER(30,ITextHostImpl_TxGetMaxLength);
670 DEFINE_STDCALL_WRAPPER(31,ITextHostImpl_TxGetScrollBars);
671 DEFINE_STDCALL_WRAPPER(32,ITextHostImpl_TxGetPasswordChar);
672 DEFINE_STDCALL_WRAPPER(33,ITextHostImpl_TxGetAcceleratorPos);
673 DEFINE_STDCALL_WRAPPER(34,ITextHostImpl_TxGetExtent);
674 DEFINE_STDCALL_WRAPPER(35,ITextHostImpl_OnTxCharFormatChange);
675 DEFINE_STDCALL_WRAPPER(36,ITextHostImpl_OnTxParaFormatChange);
676 DEFINE_STDCALL_WRAPPER(37,ITextHostImpl_TxGetPropertyBits);
677 DEFINE_STDCALL_WRAPPER(38,ITextHostImpl_TxNotify);
678 DEFINE_STDCALL_WRAPPER(39,ITextHostImpl_TxImmGetContext);
679 DEFINE_STDCALL_WRAPPER(40,ITextHostImpl_TxImmReleaseContext);
680 DEFINE_STDCALL_WRAPPER(41,ITextHostImpl_TxGetSelectionBarWidth);
682 ITextHostVtbl itextHostStdcallVtbl = {
686 __stdcall_ITextHostImpl_TxGetDC,
687 __stdcall_ITextHostImpl_TxReleaseDC,
688 __stdcall_ITextHostImpl_TxShowScrollBar,
689 __stdcall_ITextHostImpl_TxEnableScrollBar,
690 __stdcall_ITextHostImpl_TxSetScrollRange,
691 __stdcall_ITextHostImpl_TxSetScrollPos,
692 __stdcall_ITextHostImpl_TxInvalidateRect,
693 __stdcall_ITextHostImpl_TxViewChange,
694 __stdcall_ITextHostImpl_TxCreateCaret,
695 __stdcall_ITextHostImpl_TxShowCaret,
696 __stdcall_ITextHostImpl_TxSetCaretPos,
697 __stdcall_ITextHostImpl_TxSetTimer,
698 __stdcall_ITextHostImpl_TxKillTimer,
699 __stdcall_ITextHostImpl_TxScrollWindowEx,
700 __stdcall_ITextHostImpl_TxSetCapture,
701 __stdcall_ITextHostImpl_TxSetFocus,
702 __stdcall_ITextHostImpl_TxSetCursor,
703 __stdcall_ITextHostImpl_TxScreenToClient,
704 __stdcall_ITextHostImpl_TxClientToScreen,
705 __stdcall_ITextHostImpl_TxActivate,
706 __stdcall_ITextHostImpl_TxDeactivate,
707 __stdcall_ITextHostImpl_TxGetClientRect,
708 __stdcall_ITextHostImpl_TxGetViewInset,
709 __stdcall_ITextHostImpl_TxGetCharFormat,
710 __stdcall_ITextHostImpl_TxGetParaFormat,
711 __stdcall_ITextHostImpl_TxGetSysColor,
712 __stdcall_ITextHostImpl_TxGetBackStyle,
713 __stdcall_ITextHostImpl_TxGetMaxLength,
714 __stdcall_ITextHostImpl_TxGetScrollBars,
715 __stdcall_ITextHostImpl_TxGetPasswordChar,
716 __stdcall_ITextHostImpl_TxGetAcceleratorPos,
717 __stdcall_ITextHostImpl_TxGetExtent,
718 __stdcall_ITextHostImpl_OnTxCharFormatChange,
719 __stdcall_ITextHostImpl_OnTxParaFormatChange,
720 __stdcall_ITextHostImpl_TxGetPropertyBits,
721 __stdcall_ITextHostImpl_TxNotify,
722 __stdcall_ITextHostImpl_TxImmGetContext,
723 __stdcall_ITextHostImpl_TxImmReleaseContext,
724 __stdcall_ITextHostImpl_TxGetSelectionBarWidth,
727 #endif /* __i386__ */