mshtml: Added IHTMLAnchorElement::get_href tests.
[wine/hacks.git] / dlls / riched20 / txthost.c
blob950d200251a0af8038e8320b2cbe589c6b45cb13
1 /*
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
21 #include "config.h"
22 #include "wine/port.h"
24 #define NONAMELESSSTRUCT
25 #define NONAMELESSUNION
26 #define COBJMACROS
28 #include "editor.h"
29 #include "ole2.h"
30 #include "richole.h"
31 #include "imm.h"
32 #include "textserv.h"
33 #include "wine/debug.h"
34 #include "editstr.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(richedit);
38 typedef struct ITextHostImpl {
39 const ITextHostVtbl *lpVtbl;
40 LONG ref;
41 HWND hWnd;
42 BOOL bEmulateVersion10;
43 } ITextHostImpl;
45 static const ITextHostVtbl textHostVtbl;
47 ITextHost *ME_CreateTextHost(HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersion10)
49 ITextHostImpl *texthost;
50 texthost = CoTaskMemAlloc(sizeof(*texthost));
51 if (texthost)
53 ME_TextEditor *editor;
55 texthost->lpVtbl = &textHostVtbl;
56 texthost->ref = 1;
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,
71 REFIID riid,
72 LPVOID *ppvObject)
74 ITextHostImpl *This = (ITextHostImpl *)iface;
76 if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextHost)) {
77 *ppvObject = This;
78 ITextHost_AddRef((ITextHost *)*ppvObject);
79 return S_OK;
82 FIXME("Unknown interface: %s\n", debugstr_guid(riid));
83 return E_NOINTERFACE;
86 static ULONG WINAPI ITextHostImpl_AddRef(ITextHost *iface)
88 ITextHostImpl *This = (ITextHostImpl *)iface;
89 ULONG ref = InterlockedIncrement(&This->ref);
90 return ref;
93 static ULONG WINAPI ITextHostImpl_Release(ITextHost *iface)
95 ITextHostImpl *This = (ITextHostImpl *)iface;
96 ULONG ref = InterlockedDecrement(&This->ref);
98 if (!ref)
100 SetWindowLongPtrW(This->hWnd, 0, 0);
101 CoTaskMemFree(This);
103 return ref;
106 HDC WINAPI ITextHostImpl_TxGetDC(ITextHost *iface)
108 ITextHostImpl *This = (ITextHostImpl *)iface;
109 return GetDC(This->hWnd);
112 INT WINAPI ITextHostImpl_TxReleaseDC(ITextHost *iface,
113 HDC hdc)
115 ITextHostImpl *This = (ITextHostImpl *)iface;
116 return ReleaseDC(This->hWnd, hdc);
119 BOOL WINAPI ITextHostImpl_TxShowScrollBar(ITextHost *iface,
120 INT fnBar,
121 BOOL fShow)
123 ITextHostImpl *This = (ITextHostImpl *)iface;
124 return ShowScrollBar(This->hWnd, fnBar, fShow);
127 BOOL WINAPI ITextHostImpl_TxEnableScrollBar(ITextHost *iface,
128 INT fuSBFlags,
129 INT fuArrowflags)
131 ITextHostImpl *This = (ITextHostImpl *)iface;
132 return EnableScrollBar(This->hWnd, fuSBFlags, fuArrowflags);
135 BOOL WINAPI ITextHostImpl_TxSetScrollRange(ITextHost *iface,
136 INT fnBar,
137 LONG nMinPos,
138 INT nMaxPos,
139 BOOL fRedraw)
141 ITextHostImpl *This = (ITextHostImpl *)iface;
142 return SetScrollRange(This->hWnd, fnBar, nMinPos, nMaxPos, fRedraw);
145 BOOL WINAPI ITextHostImpl_TxSetScrollPos(ITextHost *iface,
146 INT fnBar,
147 INT nPos,
148 BOOL fRedraw)
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,
156 LPCRECT prc,
157 BOOL fMode)
159 ITextHostImpl *This = (ITextHostImpl *)iface;
160 InvalidateRect(This->hWnd, prc, fMode);
163 void WINAPI ITextHostImpl_TxViewChange(ITextHost *iface,
164 BOOL fUpdate)
166 ITextHostImpl *This = (ITextHostImpl *)iface;
167 if (fUpdate)
168 UpdateWindow(This->hWnd);
171 BOOL WINAPI ITextHostImpl_TxCreateCaret(ITextHost *iface,
172 HBITMAP hbmp,
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;
182 if (fShow)
183 return ShowCaret(This->hWnd);
184 else
185 return HideCaret(This->hWnd);
188 BOOL WINAPI ITextHostImpl_TxSetCaretPos(ITextHost *iface,
189 INT x, INT y)
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,
202 UINT idTimer)
204 ITextHostImpl *This = (ITextHostImpl *)iface;
205 KillTimer(This->hWnd, idTimer);
208 void WINAPI ITextHostImpl_TxScrollWindowEx(ITextHost *iface,
209 INT dx, INT dy,
210 LPCRECT lprcScroll,
211 LPCRECT lprcClip,
212 HRGN hRgnUpdate,
213 LPRECT lprcUpdate,
214 UINT fuScroll)
216 ITextHostImpl *This = (ITextHostImpl *)iface;
217 ScrollWindowEx(This->hWnd, dx, dy, lprcScroll, lprcClip,
218 hRgnUpdate, lprcUpdate, fuScroll);
221 void WINAPI ITextHostImpl_TxSetCapture(ITextHost *iface,
222 BOOL fCapture)
224 ITextHostImpl *This = (ITextHostImpl *)iface;
225 if (fCapture)
226 SetCapture(This->hWnd);
227 else
228 ReleaseCapture();
231 void WINAPI ITextHostImpl_TxSetFocus(ITextHost *iface)
233 ITextHostImpl *This = (ITextHostImpl *)iface;
234 SetFocus(This->hWnd);
237 void WINAPI ITextHostImpl_TxSetCursor(ITextHost *iface,
238 HCURSOR hcur,
239 BOOL fText)
241 SetCursor(hcur);
244 BOOL WINAPI ITextHostImpl_TxScreenToClient(ITextHost *iface,
245 LPPOINT lppt)
247 ITextHostImpl *This = (ITextHostImpl *)iface;
248 return ScreenToClient(This->hWnd, lppt);
251 BOOL WINAPI ITextHostImpl_TxClientToScreen(ITextHost *iface,
252 LPPOINT lppt)
254 ITextHostImpl *This = (ITextHostImpl *)iface;
255 return ClientToScreen(This->hWnd, lppt);
258 HRESULT WINAPI ITextHostImpl_TxActivate(ITextHost *iface,
259 LONG *plOldState)
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,
267 LONG lNewState)
269 HWND ret = SetActiveWindow(LongToHandle(lNewState));
270 return (ret ? S_OK : E_FAIL);
273 HRESULT WINAPI ITextHostImpl_TxGetClientRect(ITextHost *iface,
274 LPRECT prc)
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,
282 LPRECT prc)
284 prc->top = 0;
285 prc->left = 0;
286 prc->bottom = 0;
287 prc->right = 0;
288 return S_OK;
291 HRESULT WINAPI ITextHostImpl_TxGetCharFormat(ITextHost *iface,
292 const CHARFORMATW **ppCF)
294 return E_NOTIMPL;
297 HRESULT WINAPI ITextHostImpl_TxGetParaFormat(ITextHost *iface,
298 const PARAFORMAT **ppPF)
300 return E_NOTIMPL;
303 COLORREF WINAPI ITextHostImpl_TxGetSysColor(ITextHost *iface,
304 int nIndex)
306 return GetSysColor(nIndex);
309 HRESULT WINAPI ITextHostImpl_TxGetBackStyle(ITextHost *iface,
310 TXTBACKSTYLE *pStyle)
312 *pStyle = TXTBACK_OPAQUE;
313 return S_OK;
316 HRESULT WINAPI ITextHostImpl_TxGetMaxLength(ITextHost *iface,
317 DWORD *pLength)
319 *pLength = INFINITE;
320 return S_OK;
323 HRESULT WINAPI ITextHostImpl_TxGetScrollBars(ITextHost *iface,
324 DWORD *pdwScrollBar)
326 ITextHostImpl *This = (ITextHostImpl *)iface;
327 ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW(This->hWnd, 0);
328 const DWORD mask = WS_VSCROLL|
329 WS_HSCROLL|
330 ES_AUTOVSCROLL|
331 ES_AUTOHSCROLL|
332 ES_DISABLENOSCROLL;
333 if (editor)
335 *pdwScrollBar = editor->styleFlags & mask;
336 } else {
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;
344 return S_OK;
347 HRESULT WINAPI ITextHostImpl_TxGetPasswordChar(ITextHost *iface,
348 WCHAR *pch)
350 *pch = '*';
351 return S_OK;
354 HRESULT WINAPI ITextHostImpl_TxGetAcceleratorPos(ITextHost *iface,
355 LONG *pch)
357 *pch = -1;
358 return S_OK;
361 HRESULT WINAPI ITextHostImpl_TxGetExtent(ITextHost *iface,
362 LPSIZEL lpExtent)
364 return E_NOTIMPL;
367 HRESULT WINAPI ITextHostImpl_OnTxCharFormatChange(ITextHost *iface,
368 const CHARFORMATW *pcf)
370 return S_OK;
373 HRESULT WINAPI ITextHostImpl_OnTxParaFormatChange(ITextHost *iface,
374 const PARAFORMAT *ppf)
376 return S_OK;
379 HRESULT WINAPI ITextHostImpl_TxGetPropertyBits(ITextHost *iface,
380 DWORD dwMask,
381 DWORD *pdwBits)
383 ITextHostImpl *This = (ITextHostImpl *)iface;
384 ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(This->hWnd, 0);
385 DWORD style;
386 DWORD dwBits = 0;
388 if (editor)
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;
397 } else {
398 DWORD dwScrollBar;
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;
444 return S_OK;
447 HRESULT WINAPI ITextHostImpl_TxNotify(ITextHost *iface,
448 DWORD iNotify,
449 void *pv)
451 ITextHostImpl *This = (ITextHostImpl *)iface;
452 ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW(This->hWnd, 0);
453 HWND hwnd = This->hWnd;
454 UINT id;
456 if (!editor || !editor->hwndParent) return S_OK;
458 id = GetWindowLongW(hwnd, GWLP_ID);
460 switch (iNotify)
462 case EN_DROPFILES:
463 case EN_LINK:
464 case EN_OLEOPFAILED:
465 case EN_PROTECTED:
466 case EN_REQUESTRESIZE:
467 case EN_SAVECLIPBOARD:
468 case EN_SELCHANGE:
469 case EN_STOPNOUNDO:
471 /* FIXME: Verify this assumption that pv starts with NMHDR. */
472 NMHDR *info = pv;
473 if (!info)
474 return E_FAIL;
476 info->hwndFrom = hwnd;
477 info->idFrom = id;
478 info->code = iNotify;
479 SendMessageW(editor->hwndParent, WM_NOTIFY, id, (LPARAM)info);
480 break;
483 case EN_UPDATE:
484 /* Only sent when the window is visible. */
485 if (!IsWindowVisible(hwnd))
486 break;
487 /* Fall through */
488 case EN_CHANGE:
489 case EN_ERRSPACE:
490 case EN_HSCROLL:
491 case EN_KILLFOCUS:
492 case EN_MAXTEXT:
493 case EN_SETFOCUS:
494 case EN_VSCROLL:
495 SendMessageW(editor->hwndParent, WM_COMMAND, MAKEWPARAM(id, iNotify), (LPARAM)hwnd);
496 break;
498 case EN_MSGFILTER:
499 FIXME("EN_MSGFILTER is documented as not being sent to TxNotify\n");
500 /* fall through */
501 default:
502 return E_FAIL;
504 return S_OK;
507 HIMC WINAPI ITextHostImpl_TxImmGetContext(ITextHost *iface)
509 ITextHostImpl *This = (ITextHostImpl *)iface;
510 return ImmGetContext(This->hWnd);
513 void WINAPI ITextHostImpl_TxImmReleaseContext(ITextHost *iface,
514 HIMC himc)
516 ITextHostImpl *This = (ITextHostImpl *)iface;
517 ImmReleaseContext(This->hWnd, himc);
520 HRESULT WINAPI ITextHostImpl_TxGetSelectionBarWidth(ITextHost *iface,
521 LONG *lSelBarWidth)
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 */
529 return S_OK;
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, \
539 "popl %eax\n\t" \
540 "pushl %ecx\n\t" \
541 "pushl %eax\n\t" \
542 "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) )
544 #else /* __i386__ */
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, \
597 "popl %eax\n\t" \
598 "popl %ecx\n\t" \
599 "pushl %eax\n\t" \
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 = {
644 NULL,
645 NULL,
646 NULL,
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),