ReactOS 0.4.16-dev-1311-g81a4d83
txtsrv.c
Go to the documentation of this file.
1/*
2 * RichEdit - functions and interfaces around CreateTextServices
3 *
4 * Copyright 2005, 2006, Maarten Lankhorst
5 *
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.
10 *
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.
15 *
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
19 */
20
21#define COBJMACROS
22
23#include "editor.h"
24#include "ole2.h"
25#include "oleauto.h"
26#include "richole.h"
27#include "tom.h"
28#include "imm.h"
29#include "textserv.h"
30#include "wine/debug.h"
31#include "editstr.h"
32#include "riched20.h"
33
35
36static inline struct text_services *impl_from_IUnknown( IUnknown *iface )
37{
38 return CONTAINING_RECORD( iface, struct text_services, IUnknown_inner );
39}
40
42{
43 struct text_services *services = impl_from_IUnknown( iface );
44
45 TRACE( "(%p)->(%s, %p)\n", iface, debugstr_guid( iid ), obj );
46
47 if (IsEqualIID( iid, &IID_IUnknown )) *obj = &services->IUnknown_inner;
48 else if (IsEqualIID( iid, &IID_ITextServices )) *obj = &services->ITextServices_iface;
49 else if (IsEqualIID( iid, &IID_IRichEditOle )) *obj= &services->IRichEditOle_iface;
50 else if (IsEqualIID( iid, &IID_IDispatch ) ||
51 IsEqualIID( iid, &IID_ITextDocument ) ||
52 IsEqualIID( iid, &IID_ITextDocument2Old )) *obj = &services->ITextDocument2Old_iface;
53 else
54 {
55 *obj = NULL;
56 FIXME( "Unknown interface: %s\n", debugstr_guid( iid ) );
57 return E_NOINTERFACE;
58 }
59
60 IUnknown_AddRef( (IUnknown *)*obj );
61 return S_OK;
62}
63
65{
66 struct text_services *services = impl_from_IUnknown( iface );
68
69 TRACE( "(%p) ref = %ld\n", services, ref );
70
71 return ref;
72}
73
75{
76 struct text_services *services = impl_from_IUnknown( iface );
78
79 TRACE( "(%p) ref = %ld\n", services, ref );
80
81 if (!ref)
82 {
84 ME_DestroyEditor( services->editor );
85 free( services );
86 }
87 return ref;
88}
89
90static const IUnknownVtbl textservices_inner_vtbl =
91{
95};
96
97static inline struct text_services *impl_from_ITextServices( ITextServices *iface )
98{
100}
101
102static HRESULT WINAPI fnTextSrv_QueryInterface( ITextServices *iface, REFIID iid, void **obj )
103{
105 return IUnknown_QueryInterface( services->outer_unk, iid, obj );
106}
107
108static ULONG WINAPI fnTextSrv_AddRef(ITextServices *iface)
109{
111 return IUnknown_AddRef( services->outer_unk );
112}
113
114static ULONG WINAPI fnTextSrv_Release(ITextServices *iface)
115{
117 return IUnknown_Release( services->outer_unk );
118}
119
123{
125 HRESULT hr;
126 LRESULT res;
127
129 if (result) *result = res;
130 return hr;
131}
132
134{
135 RECT rect;
136 HRESULT hr;
137
138 if (!client)
139 {
140 if (!services->editor->in_place_active) return E_INVALIDARG;
141 hr = ITextHost_TxGetClientRect( services->editor->texthost, &rect );
142 if (FAILED( hr )) return hr;
143 }
144 else rect = *client;
145
146 rect.left += services->editor->selofs;
147
148 if (EqualRect( &rect, &services->editor->rcFormat )) return S_FALSE;
149 services->editor->rcFormat = rect;
150 return S_OK;
151}
152
154HRESULT __thiscall fnTextSrv_TxDraw( ITextServices *iface, DWORD aspect, LONG index, void *aspect_info,
155 DVTARGETDEVICE *td, HDC draw, HDC target,
156 const RECTL *bounds, const RECTL *mf_bounds, RECT *update,
157 BOOL (CALLBACK *continue_fn)(DWORD), DWORD continue_param,
158 LONG view_id )
159{
161 HRESULT hr;
162 HDC dc = draw;
163 BOOL rewrap = FALSE;
164
165 TRACE( "%p: aspect %ld, %ld, %p, %p, draw %p, target %p, bounds %s, mf_bounds %s, update %s, %p, %ld, view %ld\n",
166 services, aspect, index, aspect_info, td, draw, target, wine_dbgstr_rect( (RECT *)bounds ),
167 wine_dbgstr_rect( (RECT *)mf_bounds ), wine_dbgstr_rect( update ), continue_fn, continue_param, view_id );
168
169 if (aspect != DVASPECT_CONTENT || aspect_info || td || target || mf_bounds || continue_fn )
170 FIXME( "Many arguments are ignored\n" );
171
172 if (view_id == TXTVIEW_ACTIVE && services->editor->freeze_count) return E_UNEXPECTED;
173
174 hr = update_client_rect( services, (RECT *)bounds );
175 if (FAILED( hr )) return hr;
176 if (hr == S_OK) rewrap = TRUE;
177
178 if (!dc && services->editor->in_place_active)
179 dc = ITextHost_TxGetDC( services->editor->texthost );
180 if (!dc) return E_FAIL;
181
182 if (rewrap)
183 {
186 }
187
188 if (!services->editor->bEmulateVersion10 || services->editor->nEventMask & ENM_UPDATE)
189 ITextHost_TxNotify( services->editor->texthost, EN_UPDATE, NULL );
190
191 editor_draw( services->editor, dc, update );
192
193 if (!draw) ITextHost_TxReleaseDC( services->editor->texthost, dc );
194 return S_OK;
195}
196
198HRESULT __thiscall fnTextSrv_TxGetHScroll( ITextServices *iface, LONG *min_pos, LONG *max_pos, LONG *pos,
199 LONG *page, BOOL *enabled )
200{
202
203 if (min_pos) *min_pos = services->editor->horz_si.nMin;
204 if (max_pos) *max_pos = services->editor->horz_si.nMax;
205 if (pos) *pos = services->editor->horz_si.nPos;
206 if (page) *page = services->editor->horz_si.nPage;
207 if (enabled) *enabled = services->editor->horz_sb_enabled;
208 return S_OK;
209}
210
212HRESULT __thiscall fnTextSrv_TxGetVScroll( ITextServices *iface, LONG *min_pos, LONG *max_pos, LONG *pos,
213 LONG *page, BOOL *enabled )
214{
216
217 if (min_pos) *min_pos = services->editor->vert_si.nMin;
218 if (max_pos) *max_pos = services->editor->vert_si.nMax;
219 if (pos) *pos = services->editor->vert_si.nPos;
220 if (page) *page = services->editor->vert_si.nPage;
221 if (enabled) *enabled = services->editor->vert_sb_enabled;
222 return S_OK;
223}
224
227 void *aspect_info, DVTARGETDEVICE *td, HDC draw,
229{
231
232 TRACE( "%p: %ld, %ld, %p, %p, draw %p target %p client %s pos (%d, %d)\n", services, aspect, index, aspect_info, td, draw,
234
235 if (aspect != DVASPECT_CONTENT || index || aspect_info || td || draw || target || client)
236 FIXME( "Ignoring most params\n" );
237
238 link_notify( services->editor, WM_SETCURSOR, 0, MAKELPARAM( x, y ) );
239 editor_set_cursor( services->editor, x, y );
240 return S_OK;
241}
242
244HRESULT __thiscall fnTextSrv_TxQueryHitPoint(ITextServices *iface, DWORD dwDrawAspect, LONG lindex,
245 void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcDraw,
246 HDC hicTargetDev, LPCRECT lprcClient, INT x, INT y,
247 DWORD *pHitResult)
248{
250
251 FIXME( "%p: STUB\n", services );
252 return E_NOTIMPL;
253}
254
257{
259 HRESULT hr;
260 BOOL old_active = services->editor->in_place_active;
261
262 TRACE( "%p: %s\n", services, wine_dbgstr_rect( client ) );
263
264 services->editor->in_place_active = TRUE;
266 if (FAILED( hr ))
267 {
268 services->editor->in_place_active = old_active;
269 return hr;
270 }
271 ME_RewrapRepaint( services->editor );
272 return S_OK;
273}
274
277{
279
280 TRACE( "%p\n", services );
281 services->editor->in_place_active = FALSE;
282 return S_OK;
283}
284
287{
289
290 FIXME( "%p: STUB\n", services );
291 return E_NOTIMPL;
292}
293
296{
298
299 FIXME( "%p: STUB\n", services );
300 return E_NOTIMPL;
301}
302
305{
307 int length;
308
309 length = ME_GetTextLength( services->editor );
310 if (length)
311 {
313 BSTR bstr;
314 bstr = SysAllocStringByteLen( NULL, length * sizeof(WCHAR) );
315 if (bstr == NULL) return E_OUTOFMEMORY;
316
317 cursor_from_char_ofs( services->editor, 0, &start );
318 ME_GetTextW( services->editor, bstr, length, &start, INT_MAX, FALSE, FALSE );
319 *text = bstr;
320 }
321 else *text = NULL;
322
323 return S_OK;
324}
325
328{
331
334 if (text) ME_InsertTextFromCursor( services->editor, 0, text, -1, services->editor->pBuffer->pDefaultStyle );
335 set_selection_cursors( services->editor, 0, 0);
336 services->editor->nModifyStep = 0;
338 ME_EmptyUndoStack( services->editor );
339 ME_UpdateRepaint( services->editor, FALSE );
340
341 return S_OK;
342}
343
346{
348
349 FIXME( "%p: STUB\n", services );
350 return E_NOTIMPL;
351}
352
355{
357
358 FIXME( "%p: STUB\n", services );
359 return E_NOTIMPL;
360}
361
363HRESULT __thiscall fnTextSrv_TxGetNaturalSize( ITextServices *iface, DWORD aspect, HDC draw,
364 HDC target, DVTARGETDEVICE *td, DWORD mode,
366{
368 RECT rect;
369 HDC dc = draw;
370 BOOL rewrap = FALSE;
371 HRESULT hr;
372
373 TRACE( "%p: aspect %ld, draw %p, target %p, td %p, mode %08lx, extent %s, *width %ld, *height %ld\n", services,
374 aspect, draw, target, td, mode, wine_dbgstr_point( (POINT *)extent ), *width, *height );
375
376 if (aspect != DVASPECT_CONTENT || target || td || mode != TXTNS_FITTOCONTENT )
377 FIXME( "Many arguments are ignored\n" );
378
379 SetRect( &rect, 0, 0, *width, *height );
380
382 if (FAILED( hr )) return hr;
383 if (hr == S_OK) rewrap = TRUE;
384
385 if (!dc && services->editor->in_place_active)
386 dc = ITextHost_TxGetDC( services->editor->texthost );
387 if (!dc) return E_FAIL;
388
389 if (rewrap)
390 {
393 }
394
395 *width = services->editor->nTotalWidth;
396 *height = services->editor->nTotalLength;
397
398 if (!draw) ITextHost_TxReleaseDC( services->editor->texthost, dc );
399 return S_OK;
400}
401
403HRESULT __thiscall fnTextSrv_TxGetDropTarget(ITextServices *iface, IDropTarget **ppDropTarget)
404{
406
407 FIXME( "%p: STUB\n", services );
408 return E_NOTIMPL;
409}
410
413{
415 DWORD scrollbars;
416 HRESULT hr;
417 BOOL repaint = FALSE;
418
419 TRACE( "%p, mask %08lx, bits %08lx\n", services, mask, bits );
420
421 services->editor->props = (services->editor->props & ~mask) | (bits & mask);
423 services->editor->bWordWrap = (services->editor->props & TXTBIT_WORDWRAP) && (services->editor->props & TXTBIT_MULTILINE);
424
426 {
427 hr = ITextHost_TxGetScrollBars( services->editor->texthost, &scrollbars );
428 if (SUCCEEDED( hr ))
429 {
430 if ((services->editor->scrollbars ^ scrollbars) & WS_HSCROLL)
431 ITextHost_TxShowScrollBar( services->editor->texthost, SB_HORZ, (scrollbars & WS_HSCROLL) &&
432 services->editor->nTotalWidth > services->editor->sizeWindow.cx );
433 if ((services->editor->scrollbars ^ scrollbars) & WS_VSCROLL)
434 ITextHost_TxShowScrollBar( services->editor->texthost, SB_VERT, (scrollbars & WS_VSCROLL) &&
435 services->editor->nTotalLength > services->editor->sizeWindow.cy );
436 services->editor->scrollbars = scrollbars;
437 }
438 }
439
440 if ((mask & TXTBIT_HIDESELECTION) && !services->editor->bHaveFocus) ME_InvalidateSelection( services->editor );
441
443 {
444 LONG width;
445
446 hr = ITextHost_TxGetSelectionBarWidth( services->editor->texthost, &width );
447 if (hr == S_OK)
448 {
449 ITextHost_TxInvalidateRect( services->editor->texthost, &services->editor->rcFormat, TRUE );
450 services->editor->rcFormat.left -= services->editor->selofs;
451 services->editor->selofs = width ? SELECTIONBAR_WIDTH : 0; /* FIXME: convert from HIMETRIC */
452 services->editor->rcFormat.left += services->editor->selofs;
453 repaint = TRUE;
454 }
455 }
456
458 {
460 if (SUCCEEDED( hr )) repaint = TRUE;
461 }
462
464 {
465 if (bits & TXTBIT_USEPASSWORD) ITextHost_TxGetPasswordChar( services->editor->texthost, &services->editor->password_char );
466 else services->editor->password_char = 0;
467 repaint = TRUE;
468 }
469
470 if (repaint) ME_RewrapRepaint( services->editor );
471
472 return S_OK;
473}
474
476HRESULT __thiscall fnTextSrv_TxGetCachedSize(ITextServices *iface, DWORD *pdwWidth, DWORD *pdwHeight)
477{
479
480 FIXME( "%p: STUB\n", services );
481 return E_NOTIMPL;
482}
483
484#ifdef __ASM_USE_THISCALL_WRAPPER
485
486#define STDCALL(func) (void *) __stdcall_ ## func
487#ifdef _MSC_VER
488#define DEFINE_STDCALL_WRAPPER(num,func) \
489 __declspec(naked) HRESULT __stdcall_##func(void) \
490 { \
491 __asm pop eax \
492 __asm pop ecx \
493 __asm push eax \
494 __asm mov eax, [ecx] \
495 __asm jmp dword ptr [eax + 4*num] \
496 }
497#else /* _MSC_VER */
498#define DEFINE_STDCALL_WRAPPER(num,func) \
499 extern HRESULT __stdcall_ ## func(void); \
500 __ASM_GLOBAL_FUNC(__stdcall_ ## func, \
501 "popl %eax\n\t" \
502 "popl %ecx\n\t" \
503 "pushl %eax\n\t" \
504 "movl (%ecx), %eax\n\t" \
505 "jmp *(4*(" #num "))(%eax)" )
506#endif /* _MSC_VER */
507
508DEFINE_STDCALL_WRAPPER(3, ITextServices_TxSendMessage)
509DEFINE_STDCALL_WRAPPER(4, ITextServices_TxDraw)
510DEFINE_STDCALL_WRAPPER(5, ITextServices_TxGetHScroll)
511DEFINE_STDCALL_WRAPPER(6, ITextServices_TxGetVScroll)
512DEFINE_STDCALL_WRAPPER(7, ITextServices_OnTxSetCursor)
513DEFINE_STDCALL_WRAPPER(8, ITextServices_TxQueryHitPoint)
514DEFINE_STDCALL_WRAPPER(9, ITextServices_OnTxInPlaceActivate)
515DEFINE_STDCALL_WRAPPER(10, ITextServices_OnTxInPlaceDeactivate)
516DEFINE_STDCALL_WRAPPER(11, ITextServices_OnTxUIActivate)
517DEFINE_STDCALL_WRAPPER(12, ITextServices_OnTxUIDeactivate)
518DEFINE_STDCALL_WRAPPER(13, ITextServices_TxGetText)
519DEFINE_STDCALL_WRAPPER(14, ITextServices_TxSetText)
520DEFINE_STDCALL_WRAPPER(15, ITextServices_TxGetCurTargetX)
521DEFINE_STDCALL_WRAPPER(16, ITextServices_TxGetBaseLinePos)
522DEFINE_STDCALL_WRAPPER(17, ITextServices_TxGetNaturalSize)
523DEFINE_STDCALL_WRAPPER(18, ITextServices_TxGetDropTarget)
524DEFINE_STDCALL_WRAPPER(19, ITextServices_OnTxPropertyBitsChange)
525DEFINE_STDCALL_WRAPPER(20, ITextServices_TxGetCachedSize)
526
527const ITextServicesVtbl text_services_stdcall_vtbl =
528{
529 NULL,
530 NULL,
531 NULL,
550};
551
552#endif /* __ASM_USE_THISCALL_WRAPPER */
553
554static const ITextServicesVtbl textservices_vtbl =
555{
577};
578
579HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10 )
580{
581 struct text_services *services;
582
583 TRACE( "%p %p --> %p\n", outer, text_host, unk );
584 if (text_host == NULL) return E_POINTER;
585
586 services = malloc( sizeof(*services) );
587 if (services == NULL) return E_OUTOFMEMORY;
588 services->ref = 1;
589 services->IUnknown_inner.lpVtbl = &textservices_inner_vtbl;
590 services->ITextServices_iface.lpVtbl = &textservices_vtbl;
591 services->IRichEditOle_iface.lpVtbl = &re_ole_vtbl;
592 services->ITextDocument2Old_iface.lpVtbl = &text_doc2old_vtbl;
593 services->editor = ME_MakeEditor( text_host, emulate_10 );
594 services->editor->richole = &services->IRichEditOle_iface;
595
596 if (outer) services->outer_unk = outer;
597 else services->outer_unk = &services->IUnknown_inner;
598
599 services->text_selection = NULL;
600 list_init( &services->rangelist );
601 list_init( &services->clientsites );
602
603 *unk = &services->IUnknown_inner;
604 return S_OK;
605}
606
607/******************************************************************
608 * CreateTextServices (RICHED20.4)
609 */
610HRESULT WINAPI CreateTextServices( IUnknown *outer, ITextHost *text_host, IUnknown **unk )
611{
612 return create_text_services( outer, text_host, unk, FALSE );
613}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
static const char * wine_dbgstr_point(const POINT *ppt)
Definition: atltest.h:138
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
Definition: cvt.cpp:355
HDC dc
Definition: cylfrac.c:34
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
OLECHAR * BSTR
Definition: compat.h:2293
#define CALLBACK
Definition: compat.h:35
const WCHAR * text
Definition: package.c:1794
HRESULT WINAPI OleFlushClipboard(void)
Definition: clipboard.c:2293
void ME_SetCursorToStart(ME_TextEditor *editor, ME_Cursor *cursor)
Definition: caret.c:27
void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style)
Definition: caret.c:584
BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start, int nChars, BOOL bForce)
Definition: caret.c:339
int set_selection_cursors(ME_TextEditor *editor, int from, int to)
Definition: caret.c:132
int ME_GetTextLength(ME_TextEditor *editor)
Definition: caret.c:83
ME_TextEditor * ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
Definition: editor.c:2936
void editor_set_cursor(ME_TextEditor *editor, int x, int y)
Definition: editor.c:2831
int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen, const ME_Cursor *start, int srcChars, BOOL bCRLF, BOOL bEOP)
Definition: editor.c:4325
LRESULT editor_handle_message(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam, HRESULT *phresult)
Definition: editor.c:3266
void ME_DestroyEditor(ME_TextEditor *editor)
Definition: editor.c:3077
void link_notify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: editor.c:3133
static ULONG WINAPI ITextServicesImpl_Release(IUnknown *iface)
Definition: txtsrv.c:74
static const IUnknownVtbl textservices_inner_vtbl
Definition: txtsrv.c:90
HRESULT create_text_services(IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10)
Definition: txtsrv.c:579
HRESULT __thiscall fnTextSrv_OnTxUIDeactivate(ITextServices *iface)
Definition: txtsrv.c:295
HRESULT __thiscall fnTextSrv_OnTxSetCursor(ITextServices *iface, DWORD aspect, LONG index, void *aspect_info, DVTARGETDEVICE *td, HDC draw, HDC target, const RECT *client, INT x, INT y)
Definition: txtsrv.c:226
HRESULT __thiscall fnTextSrv_TxSendMessage(ITextServices *iface, UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *result)
Definition: txtsrv.c:121
static ULONG WINAPI ITextServicesImpl_AddRef(IUnknown *iface)
Definition: txtsrv.c:64
static ULONG WINAPI fnTextSrv_Release(ITextServices *iface)
Definition: txtsrv.c:114
HRESULT __thiscall fnTextSrv_OnTxInPlaceDeactivate(ITextServices *iface)
Definition: txtsrv.c:276
HRESULT __thiscall fnTextSrv_TxGetNaturalSize(ITextServices *iface, DWORD aspect, HDC draw, HDC target, DVTARGETDEVICE *td, DWORD mode, const SIZEL *extent, LONG *width, LONG *height)
Definition: txtsrv.c:363
HRESULT __thiscall fnTextSrv_TxGetBaseLinePos(ITextServices *iface, LONG *x)
Definition: txtsrv.c:354
HRESULT __thiscall fnTextSrv_TxGetVScroll(ITextServices *iface, LONG *min_pos, LONG *max_pos, LONG *pos, LONG *page, BOOL *enabled)
Definition: txtsrv.c:212
HRESULT __thiscall fnTextSrv_TxGetDropTarget(ITextServices *iface, IDropTarget **ppDropTarget)
Definition: txtsrv.c:403
HRESULT __thiscall fnTextSrv_TxQueryHitPoint(ITextServices *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcDraw, HDC hicTargetDev, LPCRECT lprcClient, INT x, INT y, DWORD *pHitResult)
Definition: txtsrv.c:244
static HRESULT WINAPI ITextServicesImpl_QueryInterface(IUnknown *iface, REFIID iid, void **obj)
Definition: txtsrv.c:41
static HRESULT WINAPI fnTextSrv_QueryInterface(ITextServices *iface, REFIID iid, void **obj)
Definition: txtsrv.c:102
HRESULT __thiscall fnTextSrv_TxSetText(ITextServices *iface, const WCHAR *text)
Definition: txtsrv.c:327
static ULONG WINAPI fnTextSrv_AddRef(ITextServices *iface)
Definition: txtsrv.c:108
static const ITextServicesVtbl textservices_vtbl
Definition: txtsrv.c:554
HRESULT __thiscall fnTextSrv_TxGetCurTargetX(ITextServices *iface, LONG *x)
Definition: txtsrv.c:345
HRESULT WINAPI CreateTextServices(IUnknown *outer, ITextHost *text_host, IUnknown **unk)
Definition: txtsrv.c:610
HRESULT __thiscall fnTextSrv_OnTxUIActivate(ITextServices *iface)
Definition: txtsrv.c:286
static struct text_services * impl_from_ITextServices(ITextServices *iface)
Definition: txtsrv.c:97
HRESULT __thiscall fnTextSrv_OnTxInPlaceActivate(ITextServices *iface, const RECT *client)
Definition: txtsrv.c:256
HRESULT __thiscall fnTextSrv_TxGetCachedSize(ITextServices *iface, DWORD *pdwWidth, DWORD *pdwHeight)
Definition: txtsrv.c:476
HRESULT __thiscall fnTextSrv_TxGetHScroll(ITextServices *iface, LONG *min_pos, LONG *max_pos, LONG *pos, LONG *page, BOOL *enabled)
Definition: txtsrv.c:198
static struct text_services * impl_from_IUnknown(IUnknown *iface)
Definition: txtsrv.c:36
HRESULT __thiscall fnTextSrv_TxDraw(ITextServices *iface, DWORD aspect, LONG index, void *aspect_info, DVTARGETDEVICE *td, HDC draw, HDC target, const RECTL *bounds, const RECTL *mf_bounds, RECT *update, BOOL(CALLBACK *continue_fn)(DWORD), DWORD continue_param, LONG view_id)
Definition: txtsrv.c:154
HRESULT __thiscall fnTextSrv_OnTxPropertyBitsChange(ITextServices *iface, DWORD mask, DWORD bits)
Definition: txtsrv.c:412
static HRESULT update_client_rect(struct text_services *services, const RECT *client)
Definition: txtsrv.c:133
HRESULT __thiscall fnTextSrv_TxGetText(ITextServices *iface, BSTR *text)
Definition: txtsrv.c:304
void ME_InvalidateSelection(ME_TextEditor *editor)
Definition: paint.c:1253
#define ITextHost_TxShowScrollBar(This, a, b)
Definition: editor.h:334
void ME_RewrapRepaint(ME_TextEditor *editor)
Definition: paint.c:160
#define ITextServices_TxSetText(This, a)
Definition: editor.h:425
void editor_draw(ME_TextEditor *editor, HDC hDC, const RECT *update)
Definition: paint.c:33
const IRichEditOleVtbl re_ole_vtbl
Definition: richole.c:1419
#define ITextServices_TxDraw(This, a, b, c, d, e, f, g, h, i, j, k, l)
Definition: editor.h:415
#define ITextHost_TxInvalidateRect(This, a, b)
Definition: editor.h:338
#define ITextServices_TxGetCachedSize(This, a, b)
Definition: editor.h:431
void richole_release_children(struct text_services *services)
Definition: richole.c:5943
#define ITextServices_TxGetCurTargetX(This, a)
Definition: editor.h:426
#define ITextServices_OnTxInPlaceDeactivate(This)
Definition: editor.h:421
#define ITextServices_OnTxUIActivate(This)
Definition: editor.h:422
#define ITextServices_TxQueryHitPoint(This, a, b, c, d, e, f, g, h, i, j)
Definition: editor.h:419
#define ITextServices_OnTxUIDeactivate(This)
Definition: editor.h:423
#define ITextServices_TxSendMessage(This, a, b, c, d)
Definition: editor.h:414
#define ITextHost_TxNotify(This, a, b)
Definition: editor.h:367
void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now)
Definition: paint.c:132
BOOL wrap_marked_paras_dc(ME_TextEditor *editor, HDC hdc, BOOL invalidate)
Definition: wrap.c:1032
#define ITextServices_OnTxInPlaceActivate(This, a)
Definition: editor.h:420
#define ITextHost_TxGetClientRect(This, a)
Definition: editor.h:353
#define ITextHost_TxGetDC(This)
Definition: editor.h:332
#define ITextServices_TxGetHScroll(This, a, b, c, d, e)
Definition: editor.h:416
#define ITextHost_TxGetScrollBars(This, a)
Definition: editor.h:360
const ITextDocument2OldVtbl text_doc2old_vtbl
Definition: richole.c:4527
#define ITextHost_TxGetSelectionBarWidth(This, a)
Definition: editor.h:370
#define ITextHost_TxGetPasswordChar(This, a)
Definition: editor.h:361
#define ITextHost_TxReleaseDC(This, a)
Definition: editor.h:333
void editor_mark_rewrap_all(ME_TextEditor *editor)
Definition: para.c:235
#define ITextServices_TxGetDropTarget(This, a)
Definition: editor.h:429
#define ITextServices_TxGetVScroll(This, a, b, c, d, e)
Definition: editor.h:417
#define ITextServices_TxGetBaseLinePos(This, a)
Definition: editor.h:427
void cursor_from_char_ofs(ME_TextEditor *editor, int char_ofs, ME_Cursor *cursor)
Definition: run.c:245
#define ITextServices_OnTxPropertyBitsChange(This, a, b)
Definition: editor.h:430
void ME_EmptyUndoStack(ME_TextEditor *editor)
Definition: undo.c:53
#define ITextServices_TxGetText(This, a)
Definition: editor.h:424
#define ITextServices_TxGetNaturalSize(This, a, b, c, d, e, f, g, h)
Definition: editor.h:428
#define ITextServices_OnTxSetCursor(This, a, b, c, d, e, f, g, h, i)
Definition: editor.h:418
#define SELECTIONBAR_WIDTH
Definition: editstr.h:98
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint start
Definition: gl.h:1545
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
GLuint res
Definition: glext.h:9613
GLuint index
Definition: glext.h:6031
GLenum GLint GLuint mask
Definition: glext.h:6028
GLenum mode
Definition: glext.h:6217
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLuint64EXT * result
Definition: glext.h:11304
GLenum target
Definition: glext.h:7315
const char cursor[]
Definition: icontest.c:13
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define INT_MAX
Definition: intsafe.h:150
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
static HDC
Definition: imagelist.c:88
#define __thiscall
Definition: cpp.c:43
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_THISCALL_WRAPPER(func, args)
Definition: msvc-thiscall.c:2
BSTR WINAPI DECLSPEC_HOTPATCH SysAllocStringByteLen(LPCSTR str, UINT len)
Definition: oleaut.c:428
const GUID IID_IDispatch
#define WS_VSCROLL
Definition: pedump.c:627
long LONG
Definition: pedump.c:60
#define WS_HSCROLL
Definition: pedump.c:628
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define THISCALL(func)
Definition: asm.h:195
#define ENM_UPDATE
Definition: richedit.h:469
static FILE * client
Definition: client.c:41
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
Definition: module.h:576
Definition: send.c:48
IUnknown IUnknown_inner
Definition: editstr.h:487
ITextServices ITextServices_iface
Definition: editstr.h:488
@ TXTNS_FITTOCONTENT
Definition: textserv.h:176
EXTERN_C const IID IID_ITextServices
Definition: textserv.h:36
#define TXTBIT_WORDWRAP
Definition: textserv.h:195
#define TXTBIT_CLIENTRECTCHANGE
Definition: textserv.h:205
#define TXTBIT_MULTILINE
Definition: textserv.h:186
#define TXTBIT_SCROLLBARCHANGE
Definition: textserv.h:201
#define TXTBIT_USEPASSWORD
Definition: textserv.h:189
@ TXTVIEW_ACTIVE
Definition: textserv.h:181
#define TXTBIT_HIDESELECTION
Definition: textserv.h:190
#define TXTBIT_SELBARCHANGE
Definition: textserv.h:194
int32_t INT
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define STDCALL
Definition: wdf.h:45
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define E_UNEXPECTED
Definition: winerror.h:2456
#define E_POINTER
Definition: winerror.h:2365
#define MAKELPARAM(l, h)
Definition: winuser.h:4084
#define EN_UPDATE
Definition: winuser.h:2047
#define SB_VERT
Definition: winuser.h:553
#define WM_SETCURSOR
Definition: winuser.h:1655
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
#define SB_HORZ
Definition: winuser.h:552
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define const
Definition: zconf.h:233