ReactOS 0.4.16-dev-976-g18fc5a1
richole.c
Go to the documentation of this file.
1/*
2 * RichEdit GUIDs and OLE interface
3 *
4 * Copyright 2004 by Krzysztof Foltman
5 * Copyright 2004 Aric Stewart
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include <stdarg.h>
23
24#define NONAMELESSUNION
25#define COBJMACROS
26
27#include "windef.h"
28#include "winbase.h"
29#include "wingdi.h"
30#include "winuser.h"
31#include "ole2.h"
32#include "richole.h"
33#include "editor.h"
34#include "richedit.h"
35#include "tom.h"
36#include "wine/debug.h"
37
39
40/* there is no way to be consistent across different sets of headers - mingw, Wine, Win32 SDK*/
41
42#include "initguid.h"
43
44DEFINE_GUID(LIBID_tom, 0x8cc497c9, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
45DEFINE_GUID(IID_ITextServices, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5);
46DEFINE_GUID(IID_ITextHost, 0x13e670f4,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
47DEFINE_GUID(IID_ITextHost2, 0x13e670f5,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
48DEFINE_GUID(IID_ITextDocument, 0x8cc497c0, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
49DEFINE_GUID(IID_ITextDocument2Old, 0x01c25500, 0x4268, 0x11d1, 0x88, 0x3a, 0x3c, 0x8b, 0x00, 0xc1, 0x00, 0x00);
50DEFINE_GUID(IID_ITextRange, 0x8cc497c2, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
51DEFINE_GUID(IID_ITextSelection, 0x8cc497c1, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
52DEFINE_GUID(IID_ITextFont, 0x8cc497c3, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
53DEFINE_GUID(IID_ITextPara, 0x8cc497c4, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
54
56
57enum tid_t {
65};
66
67static const IID * const tid_ids[] =
68{
69 &IID_NULL,
70 &IID_ITextDocument,
71 &IID_ITextRange,
72 &IID_ITextSelection,
73 &IID_ITextFont,
74 &IID_ITextPara,
75};
77
79{
80 ITypeLib *tl;
81 HRESULT hr;
82
83 hr = LoadRegTypeLib(&LIBID_tom, 1, 0, LOCALE_SYSTEM_DEFAULT, &tl);
84 if (FAILED(hr)) {
85 ERR("LoadRegTypeLib failed: %08x\n", hr);
86 return hr;
87 }
88
90 ITypeLib_Release(tl);
91 return hr;
92}
93
95{
96 unsigned i;
97
98 if (!typelib)
99 return;
100
101 for (i = 0; i < ARRAY_SIZE(typeinfos); i++)
102 if (typeinfos[i])
103 ITypeInfo_Release(typeinfos[i]);
104
105 ITypeLib_Release(typelib);
106}
107
109{
110 HRESULT hr;
111
112 if (!typelib)
113 hr = load_typelib();
114 if (!typelib)
115 return hr;
116
117 if (!typeinfos[tid])
118 {
119 ITypeInfo *ti;
120
121 hr = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti);
122 if (FAILED(hr))
123 {
124 ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(tid_ids[tid]), hr);
125 return hr;
126 }
127
129 ITypeInfo_Release(ti);
130 }
131
133 return S_OK;
134}
135
136/* private IID used to get back IRichEditOleImpl pointer */
137DEFINE_GUID(IID_Igetrichole, 0xe3ce5c7a, 0x8247, 0x4622, 0x81, 0xad, 0x11, 0x81, 0x02, 0xaa, 0x01, 0x30);
138
141
170
171static const DWORD textfont_prop_masks[][2] = {
173 { CFM_ANIMATION },
175 { CFM_BOLD, CFE_BOLD },
181 { CFM_KERNING },
182 { CFM_LCID },
183 { CFM_FACE },
185 { CFM_OFFSET },
188 { CFM_SIZE },
190 { CFM_SPACING },
195 { CFM_WEIGHT }
196};
197
198typedef union {
203
207
209 struct list entry;
211};
212
218};
219
220typedef struct ITextFontImpl {
223
229
230typedef struct ITextParaImpl {
233
236
242};
243
244static inline struct text_services *impl_from_IRichEditOle( IRichEditOle *iface )
245{
246 return CONTAINING_RECORD( iface, struct text_services, IRichEditOle_iface );
247}
248
250{
252}
253
255{
256 return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleInPlaceSite_iface);
257}
258
260{
261 return CONTAINING_RECORD(iface, ITextRangeImpl, ITextRange_iface);
262}
263
265{
267}
268
270{
271 return CONTAINING_RECORD(iface, ITextFontImpl, ITextFont_iface);
272}
273
275{
276 return CONTAINING_RECORD(iface, ITextParaImpl, ITextPara_iface);
277}
278
281static struct text_selection *text_selection_create( struct text_services * );
282
284{
285 if (!length)
286 return E_INVALIDARG;
287
288 *length = ME_GetTextLength(editor) + 1;
289 return S_OK;
290}
291
293{
295
297 switch (op)
298 {
300 /* range fully covered by deleted range - collapse to insertion point */
301 if (range->start >= start && range->end <= end)
302 range->start = range->end = start;
303 /* deleted range cuts from the right */
304 else if (range->start < start && range->end <= end)
305 range->end = start;
306 /* deleted range cuts from the left */
307 else if (range->start >= start && range->end > end) {
308 range->start = start;
309 range->end -= end - start;
310 }
311 /* deleted range cuts within */
312 else
313 range->end -= end - start;
314 break;
315 default:
316 FIXME("unknown update op, %d\n", op);
317 }
318 }
319}
320
323{
324 switch (propid)
325 {
326 case FONT_ALLCAPS:
327 case FONT_ANIMATION:
328 case FONT_BACKCOLOR:
329 case FONT_BOLD:
330 case FONT_EMBOSS:
331 case FONT_FORECOLOR:
332 case FONT_HIDDEN:
333 case FONT_ENGRAVE:
334 case FONT_ITALIC:
335 case FONT_KERNING:
336 case FONT_LANGID:
337 case FONT_OUTLINE:
338 case FONT_PROTECTED:
339 case FONT_SHADOW:
340 case FONT_SMALLCAPS:
342 case FONT_SUBSCRIPT:
343 case FONT_SUPERSCRIPT:
344 case FONT_UNDERLINE:
345 case FONT_WEIGHT:
346 return left->l == right->l;
347 case FONT_NAME:
348 return !wcscmp(left->str, right->str);
349 case FONT_POSITION:
350 case FONT_SIZE:
351 case FONT_SPACING:
352 return left->f == right->f;
353 default:
354 FIXME("unhandled font property %d\n", propid);
355 return FALSE;
356 }
357}
358
360{
361 switch (propid)
362 {
363 case FONT_ALLCAPS:
364 case FONT_ANIMATION:
365 case FONT_BACKCOLOR:
366 case FONT_BOLD:
367 case FONT_EMBOSS:
368 case FONT_FORECOLOR:
369 case FONT_HIDDEN:
370 case FONT_ENGRAVE:
371 case FONT_ITALIC:
372 case FONT_KERNING:
373 case FONT_LANGID:
374 case FONT_OUTLINE:
375 case FONT_PROTECTED:
376 case FONT_SHADOW:
377 case FONT_SMALLCAPS:
379 case FONT_SUBSCRIPT:
380 case FONT_SUPERSCRIPT:
381 case FONT_UNDERLINE:
382 case FONT_WEIGHT:
383 v->l = tomUndefined;
384 return;
385 case FONT_NAME:
386 v->str = NULL;
387 return;
388 case FONT_POSITION:
389 case FONT_SIZE:
390 case FONT_SPACING:
391 v->f = tomUndefined;
392 return;
393 default:
394 FIXME("unhandled font property %d\n", propid);
395 v->l = tomUndefined;
396 return;
397 }
398}
399
401{
402 return value * 72.0 / 1440;
403}
404
406{
407 return value * 1440 / 72.0;
408}
409
412{
413 ME_Cursor from, to;
415
416 memset(&fmt, 0, sizeof(fmt));
417 fmt.cbSize = sizeof(fmt);
418 fmt.dwMask = textfont_prop_masks[propid][0];
419
421 to = from;
422 ME_MoveCursorChars( services->editor, &to, 1, FALSE );
423 ME_GetCharFormat( services->editor, &from, &to, &fmt );
424
425 switch (propid)
426 {
427 case FONT_ALLCAPS:
428 case FONT_BOLD:
429 case FONT_EMBOSS:
430 case FONT_HIDDEN:
431 case FONT_ENGRAVE:
432 case FONT_ITALIC:
433 case FONT_OUTLINE:
434 case FONT_PROTECTED:
435 case FONT_SHADOW:
436 case FONT_SMALLCAPS:
438 case FONT_SUBSCRIPT:
439 case FONT_SUPERSCRIPT:
440 case FONT_UNDERLINE:
441 value->l = fmt.dwEffects & textfont_prop_masks[propid][1] ? tomTrue : tomFalse;
442 break;
443 case FONT_ANIMATION:
444 value->l = fmt.bAnimation;
445 break;
446 case FONT_BACKCOLOR:
447 value->l = fmt.dwEffects & CFE_AUTOBACKCOLOR ? GetSysColor(COLOR_WINDOW) : fmt.crBackColor;
448 break;
449 case FONT_FORECOLOR:
450 value->l = fmt.dwEffects & CFE_AUTOCOLOR ? GetSysColor(COLOR_WINDOWTEXT) : fmt.crTextColor;
451 break;
452 case FONT_KERNING:
453 value->f = twips_to_points(fmt.wKerning);
454 break;
455 case FONT_LANGID:
456 value->l = fmt.lcid;
457 break;
458 case FONT_NAME:
459 /* this case is used exclusively by GetName() */
460 value->str = SysAllocString(fmt.szFaceName);
461 if (!value->str)
462 return E_OUTOFMEMORY;
463 break;
464 case FONT_POSITION:
465 value->f = twips_to_points(fmt.yOffset);
466 break;
467 case FONT_SIZE:
468 value->f = twips_to_points(fmt.yHeight);
469 break;
470 case FONT_SPACING:
471 value->f = fmt.sSpacing;
472 break;
473 case FONT_WEIGHT:
474 value->l = fmt.wWeight;
475 break;
476 default:
477 FIXME("unhandled font property %d\n", propid);
478 return E_FAIL;
479 }
480
481 return S_OK;
482}
483
484static inline const struct text_services *get_range_reole(ITextRange *range)
485{
486 struct text_services *services = NULL;
487 ITextRange_QueryInterface(range, &IID_Igetrichole, (void**)&services);
488 return services;
489}
490
492{
494 HRESULT hr;
495 LONG value;
496 BSTR str;
497 FLOAT f;
498
499#define CHARFORMAT_SET_B_FIELD(mask, value) \
500 if (hr == S_OK && value != tomUndefined) { \
501 fmt.dwMask |= CFM_##mask; \
502 if (value == tomTrue) fmt.dwEffects |= CFE_##mask; \
503 } \
504
505 /* fill format data from font */
506 memset(&fmt, 0, sizeof(fmt));
507 fmt.cbSize = sizeof(fmt);
508
510 hr = ITextFont_GetAllCaps(font, &value);
512
514 hr = ITextFont_GetBold(font, &value);
516
518 hr = ITextFont_GetEmboss(font, &value);
520
522 hr = ITextFont_GetHidden(font, &value);
524
526 hr = ITextFont_GetEngrave(font, &value);
528
530 hr = ITextFont_GetItalic(font, &value);
532
534 hr = ITextFont_GetOutline(font, &value);
536
538 hr = ITextFont_GetProtected(font, &value);
539 CHARFORMAT_SET_B_FIELD(PROTECTED, value);
540
542 hr = ITextFont_GetShadow(font, &value);
544
546 hr = ITextFont_GetSmallCaps(font, &value);
547 CHARFORMAT_SET_B_FIELD(SMALLCAPS, value);
548
550 hr = ITextFont_GetStrikeThrough(font, &value);
551 CHARFORMAT_SET_B_FIELD(STRIKEOUT, value);
552
554 hr = ITextFont_GetSubscript(font, &value);
556
558 hr = ITextFont_GetSuperscript(font, &value);
559 CHARFORMAT_SET_B_FIELD(SUPERSCRIPT, value);
560
562 hr = ITextFont_GetUnderline(font, &value);
563 CHARFORMAT_SET_B_FIELD(UNDERLINE, value);
564
565#undef CHARFORMAT_SET_B_FIELD
566
568 hr = ITextFont_GetAnimation(font, &value);
569 if (hr == S_OK && value != tomUndefined) {
570 fmt.dwMask |= CFM_ANIMATION;
571 fmt.bAnimation = value;
572 }
573
575 hr = ITextFont_GetBackColor(font, &value);
576 if (hr == S_OK && value != tomUndefined) {
577 fmt.dwMask |= CFM_BACKCOLOR;
578 if (value == tomAutoColor)
579 fmt.dwEffects |= CFE_AUTOBACKCOLOR;
580 else
581 fmt.crBackColor = value;
582 }
583
585 hr = ITextFont_GetForeColor(font, &value);
586 if (hr == S_OK && value != tomUndefined) {
587 fmt.dwMask |= CFM_COLOR;
588 if (value == tomAutoColor)
589 fmt.dwEffects |= CFE_AUTOCOLOR;
590 else
591 fmt.crTextColor = value;
592 }
593
595 hr = ITextFont_GetKerning(font, &f);
596 if (hr == S_OK && f != tomUndefined) {
597 fmt.dwMask |= CFM_KERNING;
598 fmt.wKerning = points_to_twips(f);
599 }
600
602 hr = ITextFont_GetLanguageID(font, &value);
603 if (hr == S_OK && value != tomUndefined) {
604 fmt.dwMask |= CFM_LCID;
605 fmt.lcid = value;
606 }
607
608 if (ITextFont_GetName(font, &str) == S_OK) {
609 fmt.dwMask |= CFM_FACE;
610 lstrcpynW(fmt.szFaceName, str, ARRAY_SIZE(fmt.szFaceName));
612 }
613
614 hr = ITextFont_GetPosition(font, &f);
615 if (hr == S_OK && f != tomUndefined) {
616 fmt.dwMask |= CFM_OFFSET;
617 fmt.yOffset = points_to_twips(f);
618 }
619
620 hr = ITextFont_GetSize(font, &f);
621 if (hr == S_OK && f != tomUndefined) {
622 fmt.dwMask |= CFM_SIZE;
623 fmt.yHeight = points_to_twips(f);
624 }
625
626 hr = ITextFont_GetSpacing(font, &f);
627 if (hr == S_OK && f != tomUndefined) {
628 fmt.dwMask |= CFM_SPACING;
629 fmt.sSpacing = f;
630 }
631
632 hr = ITextFont_GetWeight(font, &value);
633 if (hr == S_OK && value != tomUndefined) {
634 fmt.dwMask |= CFM_WEIGHT;
635 fmt.wWeight = value;
636 }
637
638 if (fmt.dwMask)
639 {
641 ME_Cursor from, to;
642 LONG start, end;
643
644 ITextRange_GetStart(range, &start);
645 ITextRange_GetEnd(range, &end);
646
648 cursor_from_char_ofs( services->editor, end, &to );
649 ME_SetCharFormat( services->editor, &from, &to, &fmt );
650 }
651}
652
654{
655 const struct text_services *services;
657 LONG start, end, i;
658 HRESULT hr;
659
660 /* when font is not attached to any range use cached values */
661 if (!font->range || font->get_cache_enabled) {
662 *value = font->props[propid];
663 return S_OK;
664 }
665
666 if (!(services = get_range_reole(font->range)))
667 return CO_E_RELEASED;
668
670
671 ITextRange_GetStart(font->range, &start);
672 ITextRange_GetEnd(font->range, &end);
673
674 /* iterate trough a range to see if property value is consistent */
676 if (FAILED(hr))
677 return hr;
678
679 for (i = start + 1; i < end; i++) {
681
682 hr = get_textfont_prop_for_pos( services, i, propid, &cur );
683 if (FAILED(hr))
684 return hr;
685
686 if (!is_equal_textfont_prop_value(propid, &v, &cur))
687 return S_OK;
688 }
689
690 *value = v;
691 return S_OK;
692}
693
695{
697 HRESULT hr;
698
699 if (!value)
700 return E_INVALIDARG;
701
702 hr = get_textfont_prop(font, propid, &v);
703 *value = v.f;
704 return hr;
705}
706
708{
710 HRESULT hr;
711
712 if (!value)
713 return E_INVALIDARG;
714
715 hr = get_textfont_prop(font, propid, &v);
716 *value = v.l;
717 return hr;
718}
719
720/* Value should already have a terminal value, for boolean properties it means tomToggle is not handled */
722{
723 const struct text_services *services;
724 ME_Cursor from, to;
726 LONG start, end;
727
728 /* when font is not attached to any range use cache */
729 if (!font->range || font->set_cache_enabled) {
730 if (propid == FONT_NAME) {
731 SysFreeString(font->props[propid].str);
732 font->props[propid].str = SysAllocString(value->str);
733 }
734 else
735 font->props[propid] = *value;
736 return S_OK;
737 }
738
739 if (!(services = get_range_reole(font->range)))
740 return CO_E_RELEASED;
741
742 memset(&fmt, 0, sizeof(fmt));
743 fmt.cbSize = sizeof(fmt);
744 fmt.dwMask = textfont_prop_masks[propid][0];
745
746 switch (propid)
747 {
748 case FONT_ALLCAPS:
749 case FONT_BOLD:
750 case FONT_EMBOSS:
751 case FONT_HIDDEN:
752 case FONT_ENGRAVE:
753 case FONT_ITALIC:
754 case FONT_OUTLINE:
755 case FONT_PROTECTED:
756 case FONT_SHADOW:
757 case FONT_SMALLCAPS:
759 case FONT_SUBSCRIPT:
760 case FONT_SUPERSCRIPT:
761 case FONT_UNDERLINE:
762 fmt.dwEffects = value->l == tomTrue ? textfont_prop_masks[propid][1] : 0;
763 break;
764 case FONT_ANIMATION:
765 fmt.bAnimation = value->l;
766 break;
767 case FONT_BACKCOLOR:
768 case FONT_FORECOLOR:
769 if (value->l == tomAutoColor)
770 fmt.dwEffects = textfont_prop_masks[propid][1];
771 else if (propid == FONT_BACKCOLOR)
772 fmt.crBackColor = value->l;
773 else
774 fmt.crTextColor = value->l;
775 break;
776 case FONT_KERNING:
777 fmt.wKerning = value->f;
778 break;
779 case FONT_LANGID:
780 fmt.lcid = value->l;
781 break;
782 case FONT_POSITION:
783 fmt.yOffset = value->f;
784 break;
785 case FONT_SIZE:
786 fmt.yHeight = value->f;
787 break;
788 case FONT_SPACING:
789 fmt.sSpacing = value->f;
790 break;
791 case FONT_WEIGHT:
792 fmt.wWeight = value->l;
793 break;
794 case FONT_NAME:
795 lstrcpynW(fmt.szFaceName, value->str, ARRAY_SIZE(fmt.szFaceName));
796 break;
797 default:
798 FIXME("unhandled font property %d\n", propid);
799 return E_FAIL;
800 }
801
802 ITextRange_GetStart(font->range, &start);
803 ITextRange_GetEnd(font->range, &end);
804
806 cursor_from_char_ofs( services->editor, end, &to );
807 ME_SetCharFormat( services->editor, &from, &to, &fmt );
808
809 return S_OK;
810}
811
813{
815 v.l = value;
816 return set_textfont_prop(font, propid, &v);
817}
818
820{
822 v.f = value;
823 return set_textfont_prop(font, propid, &v);
824}
825
827{
829
830 switch (value)
831 {
832 case tomUndefined:
833 return S_OK;
834 case tomToggle: {
835 LONG oldvalue;
836 get_textfont_propl(font, propid, &oldvalue);
837 if (oldvalue == tomFalse)
838 value = tomTrue;
839 else if (oldvalue == tomTrue)
840 value = tomFalse;
841 else
842 return E_INVALIDARG;
843 /* fallthrough */
844 }
845 case tomTrue:
846 case tomFalse:
847 v.l = value;
848 return set_textfont_prop(font, propid, &v);
849 default:
850 return E_INVALIDARG;
851 }
852}
853
855{
856 const struct text_services *services;
858 HRESULT hr;
859 LONG start;
860
861 if (!(services = get_range_reole( range )))
862 return CO_E_RELEASED;
863
864 ITextRange_GetStart(range, &start);
866 *ret = v.str;
867 return hr;
868}
869
871{
872 enum textfont_prop_id propid;
873 for (propid = FONT_PROPID_FIRST; propid < FONT_PROPID_LAST; propid++) {
874 if (propid == FONT_NAME)
875 textfont_getname_from_range(font->range, &font->props[propid].str);
876 else
877 get_textfont_prop(font, propid, &font->props[propid]);
878 }
879}
880
882{
883 LONG expand_start, expand_end;
884
885 switch (unit)
886 {
887 case tomStory:
888 expand_start = 0;
889 ITextRange_GetStoryLength(range, &expand_end);
890 break;
891 default:
892 FIXME("unit %d is not supported\n", unit);
893 return E_NOTIMPL;
894 }
895
896 if (delta) {
897 LONG start, end;
898
899 ITextRange_GetStart(range, &start);
900 ITextRange_GetEnd(range, &end);
901 *delta = expand_end - expand_start - (end - start);
902 }
903
904 ITextRange_SetStart(range, expand_start);
905 ITextRange_SetEnd(range, expand_end);
906
907 return S_OK;
908}
909
910static HRESULT WINAPI
912{
914 return IUnknown_QueryInterface( services->outer_unk, riid, ppvObj );
915}
916
917static ULONG WINAPI
919{
921 return IUnknown_AddRef( services->outer_unk );
922}
923
924static ULONG WINAPI
926{
928 return IUnknown_Release( services->outer_unk );
929}
930
931static HRESULT WINAPI
933{
935 FIXME( "stub %p\n", services );
936 return E_NOTIMPL;
937}
938
939static HRESULT WINAPI
941{
943 FIXME( "stub %p\n", services );
944 return E_NOTIMPL;
945}
946
947static HRESULT WINAPI
949{
951 FIXME( "stub %p\n", services );
952 return E_NOTIMPL;
953}
954
956{
957 return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleClientSite_iface);
958}
959
960static HRESULT WINAPI
962{
964 TRACE("%p %s\n", me, debugstr_guid(riid) );
965
966 *ppvObj = NULL;
969 *ppvObj = me;
970 else if (IsEqualGUID(riid, &IID_IOleWindow) ||
972 *ppvObj = &This->IOleInPlaceSite_iface;
973 if (*ppvObj)
974 {
975 IOleClientSite_AddRef(me);
976 return S_OK;
977 }
978 FIXME("%p: unhandled interface %s\n", me, debugstr_guid(riid) );
979
980 return E_NOINTERFACE;
981}
982
984{
987 TRACE("(%p)->(%u)\n", This, ref);
988 return ref;
989}
990
992{
995
996 TRACE("(%p)->(%u)\n", This, ref);
997
998 if (ref == 0) {
999 if (This->child.reole) {
1000 list_remove(&This->child.entry);
1001 This->child.reole = NULL;
1002 }
1003 heap_free(This);
1004 }
1005 return ref;
1006}
1007
1009{
1011 if (!This->child.reole)
1012 return CO_E_RELEASED;
1013
1014 FIXME("stub %p\n", iface);
1015 return E_NOTIMPL;
1016}
1017
1019 DWORD dwWhichMoniker, IMoniker **ppmk)
1020{
1022 if (!This->child.reole)
1023 return CO_E_RELEASED;
1024
1025 FIXME("stub %p\n", iface);
1026 return E_NOTIMPL;
1027}
1028
1030 IOleContainer **ppContainer)
1031{
1033 if (!This->child.reole)
1034 return CO_E_RELEASED;
1035
1036 FIXME("stub %p\n", iface);
1037 return E_NOTIMPL;
1038}
1039
1041{
1043 if (!This->child.reole)
1044 return CO_E_RELEASED;
1045
1046 FIXME("stub %p\n", iface);
1047 return E_NOTIMPL;
1048}
1049
1051{
1053 if (!This->child.reole)
1054 return CO_E_RELEASED;
1055
1056 FIXME("stub %p\n", iface);
1057 return E_NOTIMPL;
1058}
1059
1061{
1063 if (!This->child.reole)
1064 return CO_E_RELEASED;
1065
1066 FIXME("stub %p\n", iface);
1067 return E_NOTIMPL;
1068}
1069
1070static const IOleClientSiteVtbl ocst = {
1080};
1081
1082/* IOleInPlaceSite interface */
1084{
1086 return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppvObj);
1087}
1088
1090{
1092 return IOleClientSite_AddRef(&This->IOleClientSite_iface);
1093}
1094
1096{
1098 return IOleClientSite_Release(&This->IOleClientSite_iface);
1099}
1100
1102{
1104
1105 TRACE( "(%p)->(%p)\n", This, window );
1106
1107 if (!This->child.reole)
1108 return CO_E_RELEASED;
1109
1110 if (!window) return E_INVALIDARG;
1111
1112 if (!This->child.reole->editor->have_texthost2) return E_NOTIMPL;
1113 return ITextHost2_TxGetWindow( This->child.reole->editor->texthost, window );
1114}
1115
1117{
1119 FIXME("not implemented: (%p)->(%d)\n", This, fEnterMode);
1120 return E_NOTIMPL;
1121}
1122
1124{
1126 FIXME("not implemented: (%p)\n", This);
1127 return E_NOTIMPL;
1128}
1129
1131{
1133 FIXME("not implemented: (%p)\n", This);
1134 return E_NOTIMPL;
1135}
1136
1138{
1140 FIXME("not implemented: (%p)\n", This);
1141 return E_NOTIMPL;
1142}
1143
1145 IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect,
1146 LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
1147{
1149 FIXME("not implemented: (%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect, lprcClipRect, lpFrameInfo);
1150 return E_NOTIMPL;
1151}
1152
1154{
1156 FIXME("not implemented: (%p)\n", This);
1157 return E_NOTIMPL;
1158}
1159
1161{
1163 FIXME("not implemented: (%p)->(%d)\n", This, fUndoable);
1164 return E_NOTIMPL;
1165}
1166
1168{
1170 FIXME("not implemented: (%p)\n", This);
1171 return E_NOTIMPL;
1172}
1173
1175{
1177 FIXME("not implemented: (%p)\n", This);
1178 return E_NOTIMPL;
1179}
1180
1182{
1184 FIXME("not implemented: (%p)\n", This);
1185 return E_NOTIMPL;
1186}
1187
1189{
1191 FIXME("not implemented: (%p)->(%p)\n", This, lprcPosRect);
1192 return E_NOTIMPL;
1193}
1194
1195static const IOleInPlaceSiteVtbl olestvt =
1196{
1212};
1213
1215{
1216 IOleClientSiteImpl *clientSite = heap_alloc(sizeof *clientSite);
1217
1218 if (!clientSite)
1219 return E_OUTOFMEMORY;
1220
1221 clientSite->IOleClientSite_iface.lpVtbl = &ocst;
1222 clientSite->IOleInPlaceSite_iface.lpVtbl = &olestvt;
1223 clientSite->ref = 1;
1224 clientSite->child.reole = services;
1225 list_add_head( &services->clientsites, &clientSite->child.entry );
1226
1227 *ret = &clientSite->IOleClientSite_iface;
1228 return S_OK;
1229}
1230
1231static HRESULT WINAPI
1233{
1235
1236 TRACE("(%p)->(%p)\n", services, clientsite);
1237
1238 if (!clientsite)
1239 return E_INVALIDARG;
1240
1241 return CreateOleClientSite( services, clientsite );
1242}
1243
1244static HRESULT WINAPI
1246 DWORD reco, LPDATAOBJECT *lplpdataobj)
1247{
1250 int nChars;
1251
1252 TRACE("(%p,%p,%d)\n", services, lpchrg, reco);
1253 if(!lplpdataobj)
1254 return E_INVALIDARG;
1255 if(!lpchrg)
1256 {
1257 int nFrom, nTo, nStartCur = ME_GetSelectionOfs( services->editor, &nFrom, &nTo );
1258 start = services->editor->pCursors[nStartCur];
1259 nChars = nTo - nFrom;
1260 }
1261 else
1262 {
1263 cursor_from_char_ofs( services->editor, lpchrg->cpMin, &start );
1264 nChars = lpchrg->cpMax - lpchrg->cpMin;
1265 }
1266 return ME_GetDataObject( services->editor, &start, nChars, lplpdataobj );
1267}
1268
1270{
1272 FIXME("stub %p\n", services);
1273 return E_NOTIMPL;
1274}
1275
1276static HRESULT WINAPI
1278 REOBJECT *lpreobject, DWORD dwFlags)
1279{
1281 struct re_object *reobj = NULL;
1282 LONG count = 0;
1283
1284 TRACE("(%p)->(%x, %p, %x)\n", services, iob, lpreobject, dwFlags);
1285
1286 if (!lpreobject || !lpreobject->cbStruct)
1287 return E_INVALIDARG;
1288
1289 if (iob == REO_IOB_USE_CP)
1290 {
1292
1293 TRACE("character offset: %d\n", lpreobject->cp);
1294 cursor_from_char_ofs( services->editor, lpreobject->cp, &cursor );
1295 if (!cursor.run->reobj)
1296 return E_INVALIDARG;
1297 else
1298 reobj = cursor.run->reobj;
1299 }
1300 else if (iob == REO_IOB_SELECTION)
1301 {
1302 ME_Cursor *from, *to;
1303
1304 ME_GetSelection(services->editor, &from, &to);
1305 if (!from->run->reobj)
1306 return E_INVALIDARG;
1307 else
1308 reobj = from->run->reobj;
1309 }
1310 else
1311 {
1312 if (iob < 0 || iob >= IRichEditOle_GetObjectCount( iface ))
1313 return E_INVALIDARG;
1314 LIST_FOR_EACH_ENTRY(reobj, &services->editor->reobj_list, struct re_object, entry)
1315 {
1316 if (count == iob)
1317 break;
1318 count++;
1319 }
1320 }
1321 ME_CopyReObject(lpreobject, &reobj->obj, dwFlags);
1322 return S_OK;
1323}
1324
1325static LONG WINAPI
1327{
1329 TRACE("(%p)\n", services);
1330 return list_count( &services->editor->reobj_list );
1331}
1332
1333static HRESULT WINAPI
1335{
1337 FIXME("stub %p\n", services);
1338 return E_NOTIMPL;
1339}
1340
1341static HRESULT WINAPI
1343 CLIPFORMAT cf, HGLOBAL hMetaPict)
1344{
1346 FIXME("stub %p\n", services);
1347 return E_NOTIMPL;
1348}
1349
1350static HRESULT WINAPI
1352{
1354 FIXME("stub %p\n", services);
1355 return E_NOTIMPL;
1356}
1357
1358static HRESULT WINAPI
1360{
1362
1363 TRACE("(%p,%p)\n", services, reo);
1364
1365 if (!reo)
1366 return E_INVALIDARG;
1367
1368 if (reo->cbStruct < sizeof(*reo)) return STG_E_INVALIDPARAMETER;
1369
1370 ME_InsertOLEFromCursor(services->editor, reo, 0);
1371 ME_CommitUndo(services->editor);
1373 return S_OK;
1374}
1375
1377 LPSTORAGE lpstg)
1378{
1380 FIXME("stub %p\n", services);
1381 return E_NOTIMPL;
1382}
1383
1384static HRESULT WINAPI
1386{
1388 FIXME("stub %p\n", services);
1389 return E_NOTIMPL;
1390}
1391
1393 LPCSTR lpstrContainerApp, LPCSTR lpstrContainerObj)
1394{
1396 FIXME("stub %p %s %s\n", services, lpstrContainerApp, lpstrContainerObj);
1397 return E_NOTIMPL;
1398}
1399
1400static HRESULT WINAPI
1402{
1404 FIXME("stub %p\n", services);
1405 return E_NOTIMPL;
1406}
1407
1408const IRichEditOleVtbl re_ole_vtbl =
1409{
1429};
1430
1431/* ITextRange interface */
1433{
1435
1436 *ppvObj = NULL;
1439 || IsEqualGUID(riid, &IID_ITextRange))
1440 {
1441 *ppvObj = me;
1442 ITextRange_AddRef(me);
1443 return S_OK;
1444 }
1445 else if (IsEqualGUID(riid, &IID_Igetrichole))
1446 {
1447 *ppvObj = This->child.reole;
1448 return S_OK;
1449 }
1450
1451 return E_NOINTERFACE;
1452}
1453
1455{
1457 return InterlockedIncrement(&This->ref);
1458}
1459
1461{
1464
1465 TRACE ("%p ref=%u\n", This, ref);
1466 if (ref == 0)
1467 {
1468 if (This->child.reole)
1469 {
1470 list_remove(&This->child.entry);
1471 This->child.reole = NULL;
1472 }
1473 heap_free(This);
1474 }
1475 return ref;
1476}
1477
1479{
1481 TRACE("(%p)->(%p)\n", This, pctinfo);
1482 *pctinfo = 1;
1483 return S_OK;
1484}
1485
1487 ITypeInfo **ppTInfo)
1488{
1490 HRESULT hr;
1491
1492 TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
1493
1494 hr = get_typeinfo(ITextRange_tid, ppTInfo);
1495 if (SUCCEEDED(hr))
1496 ITypeInfo_AddRef(*ppTInfo);
1497 return hr;
1498}
1499
1501 UINT cNames, LCID lcid, DISPID *rgDispId)
1502{
1504 ITypeInfo *ti;
1505 HRESULT hr;
1506
1507 TRACE("(%p)->(%s, %p, %u, %d, %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid,
1508 rgDispId);
1509
1511 if (SUCCEEDED(hr))
1512 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
1513 return hr;
1514}
1515
1517 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1518 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
1519 UINT *puArgErr)
1520{
1522 ITypeInfo *ti;
1523 HRESULT hr;
1524
1525 TRACE("(%p)->(%d, %s, %d, %u, %p, %p, %p, %p)\n", This, dispIdMember, debugstr_guid(riid),
1526 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1527
1529 if (SUCCEEDED(hr))
1530 hr = ITypeInfo_Invoke(ti, me, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1531 return hr;
1532}
1533
1535{
1539 int length;
1540 BOOL bEOP;
1541
1542 TRACE("(%p)->(%p)\n", This, str);
1543
1544 if (!This->child.reole)
1545 return CO_E_RELEASED;
1546
1547 if (!str)
1548 return E_INVALIDARG;
1549
1550 /* return early for degenerate range */
1551 if (This->start == This->end) {
1552 *str = NULL;
1553 return S_OK;
1554 }
1555
1556 editor = This->child.reole->editor;
1559
1560 length = This->end - This->start;
1562 if (!*str)
1563 return E_OUTOFMEMORY;
1564
1565 bEOP = (!para_next( para_next( end.para )) && This->end > ME_GetTextLength(editor));
1567 return S_OK;
1568}
1569
1571{
1575 ME_Style *style;
1576 int len;
1577
1578 TRACE("(%p)->(%s)\n", This, debugstr_w(str));
1579
1580 if (!This->child.reole)
1581 return CO_E_RELEASED;
1582
1583 editor = This->child.reole->editor;
1584
1585 /* delete only where's something to delete */
1586 if (This->start != This->end)
1587 {
1589 ME_InternalDeleteText(editor, &cursor, This->end - This->start, FALSE);
1590 }
1591
1592 if (!str || !*str)
1593 {
1594 /* will update this range as well */
1595 textranges_update_ranges(This->child.reole, This->start, This->end, RANGE_UPDATE_DELETE);
1596 return S_OK;
1597 }
1598
1599 /* it's safer not to rely on stored BSTR length */
1600 len = lstrlenW(str);
1601 cursor = editor->pCursors[0];
1606 editor->pCursors[0] = cursor;
1607
1608 if (len < This->end - This->start)
1609 textranges_update_ranges(This->child.reole, This->start + len, This->end, RANGE_UPDATE_DELETE);
1610 else
1611 This->end = len - This->start;
1612
1613 return S_OK;
1614}
1615
1617{
1618 WCHAR wch[2];
1619
1620 ME_GetTextW(editor, wch, 1, cursor, 1, FALSE, !para_next( para_next( cursor->para ) ));
1621 *pch = wch[0];
1622
1623 return S_OK;
1624}
1625
1627{
1631
1632 TRACE("(%p)->(%p)\n", This, pch);
1633
1634 if (!This->child.reole)
1635 return CO_E_RELEASED;
1636
1637 if (!pch)
1638 return E_INVALIDARG;
1639
1640 editor = This->child.reole->editor;
1642 return range_GetChar(editor, &cursor, pch);
1643}
1644
1646{
1648
1649 FIXME("(%p)->(%x): stub\n", This, ch);
1650
1651 if (!This->child.reole)
1652 return CO_E_RELEASED;
1653
1654 return E_NOTIMPL;
1655}
1656
1658
1660{
1662
1663 TRACE("(%p)->(%p)\n", This, ppRange);
1664
1665 if (!This->child.reole)
1666 return CO_E_RELEASED;
1667
1668 if (!ppRange)
1669 return E_INVALIDARG;
1670
1671 return CreateITextRange(This->child.reole, This->start, This->end, ppRange);
1672}
1673
1675{
1677
1678 FIXME("(%p)->(%p): stub\n", This, range);
1679
1680 if (!This->child.reole)
1681 return CO_E_RELEASED;
1682
1683 return E_NOTIMPL;
1684}
1685
1687{
1689
1690 FIXME("(%p)->(%p): stub\n", This, range);
1691
1692 if (!This->child.reole)
1693 return CO_E_RELEASED;
1694
1695 return E_NOTIMPL;
1696}
1697
1699{
1701
1702 TRACE("(%p)->(%p)\n", This, start);
1703
1704 if (!This->child.reole)
1705 return CO_E_RELEASED;
1706
1707 if (!start)
1708 return E_INVALIDARG;
1709
1710 *start = This->start;
1711 return S_OK;
1712}
1713
1715{
1716 int len;
1717
1718 if (value < 0)
1719 value = 0;
1720
1721 if (value == *start)
1722 return S_FALSE;
1723
1724 if (value <= *end) {
1725 *start = value;
1726 return S_OK;
1727 }
1728
1729 len = ME_GetTextLength(services->editor);
1730 *start = *end = value > len ? len : value;
1731 return S_OK;
1732}
1733
1735{
1737
1738 TRACE("(%p)->(%d)\n", This, value);
1739
1740 if (!This->child.reole)
1741 return CO_E_RELEASED;
1742
1743 return textrange_setstart(This->child.reole, value, &This->start, &This->end);
1744}
1745
1747{
1749
1750 TRACE("(%p)->(%p)\n", This, end);
1751
1752 if (!This->child.reole)
1753 return CO_E_RELEASED;
1754
1755 if (!end)
1756 return E_INVALIDARG;
1757
1758 *end = This->end;
1759 return S_OK;
1760}
1761
1763{
1764 int len;
1765
1766 if (value == *end)
1767 return S_FALSE;
1768
1769 if (value < *start) {
1770 *start = *end = max(0, value);
1771 return S_OK;
1772 }
1773
1774 len = ME_GetTextLength( services->editor );
1775 *end = value > len ? len + 1 : value;
1776 return S_OK;
1777}
1778
1780{
1782
1783 TRACE("(%p)->(%d)\n", This, value);
1784
1785 if (!This->child.reole)
1786 return CO_E_RELEASED;
1787
1788 return textrange_setend(This->child.reole, value, &This->start, &This->end);
1789}
1790
1792{
1794
1795 TRACE("(%p)->(%p)\n", This, font);
1796
1797 if (!This->child.reole)
1798 return CO_E_RELEASED;
1799
1800 if (!font)
1801 return E_INVALIDARG;
1802
1803 return create_textfont(me, NULL, font);
1804}
1805
1807{
1809
1810 TRACE("(%p)->(%p)\n", This, font);
1811
1812 if (!font)
1813 return E_INVALIDARG;
1814
1815 if (!This->child.reole)
1816 return CO_E_RELEASED;
1817
1819 return S_OK;
1820}
1821
1823{
1825
1826 TRACE("(%p)->(%p)\n", This, para);
1827
1828 if (!This->child.reole)
1829 return CO_E_RELEASED;
1830
1831 if (!para)
1832 return E_INVALIDARG;
1833
1834 return create_textpara(me, para);
1835}
1836
1838{
1840
1841 FIXME("(%p)->(%p): stub\n", This, para);
1842
1843 if (!This->child.reole)
1844 return CO_E_RELEASED;
1845
1846 return E_NOTIMPL;
1847}
1848
1850{
1852
1853 TRACE("(%p)->(%p)\n", This, length);
1854
1855 if (!This->child.reole)
1856 return CO_E_RELEASED;
1857
1858 return textrange_get_storylength(This->child.reole->editor, length);
1859}
1860
1862{
1864
1865 TRACE("(%p)->(%p)\n", This, value);
1866
1867 if (!This->child.reole)
1868 return CO_E_RELEASED;
1869
1870 if (!value)
1871 return E_INVALIDARG;
1872
1874 return S_OK;
1875}
1876
1878{
1879 if (*end == *start)
1880 return S_FALSE;
1881
1882 if (bStart == tomEnd)
1883 *start = *end;
1884 else
1885 *end = *start;
1886 return S_OK;
1887}
1888
1890{
1892
1893 TRACE("(%p)->(%d)\n", This, bStart);
1894
1895 if (!This->child.reole)
1896 return CO_E_RELEASED;
1897
1898 return range_Collapse(bStart, &This->start, &This->end);
1899}
1900
1902{
1904
1905 TRACE("(%p)->(%d %p)\n", This, unit, delta);
1906
1907 if (!This->child.reole)
1908 return CO_E_RELEASED;
1909
1910 return textrange_expand(me, unit, delta);
1911}
1912
1914{
1916
1917 FIXME("(%p)->(%d %p): stub\n", This, unit, index);
1918
1919 if (!This->child.reole)
1920 return CO_E_RELEASED;
1921
1922 return E_NOTIMPL;
1923}
1924
1926 LONG extend)
1927{
1929
1930 FIXME("(%p)->(%d %d %d): stub\n", This, unit, index, extend);
1931
1932 if (!This->child.reole)
1933 return CO_E_RELEASED;
1934
1935 return E_NOTIMPL;
1936}
1937
1938static void cp2range(ME_TextEditor *editor, LONG *cp1, LONG *cp2)
1939{
1940 int len = ME_GetTextLength(editor) + 1;
1941
1942 *cp1 = max(*cp1, 0);
1943 *cp2 = max(*cp2, 0);
1944 *cp1 = min(*cp1, len);
1945 *cp2 = min(*cp2, len);
1946 if (*cp1 > *cp2)
1947 {
1948 int tmp = *cp1;
1949 *cp1 = *cp2;
1950 *cp2 = tmp;
1951 }
1952 if (*cp1 == len)
1953 *cp1 = *cp2 = len - 1;
1954}
1955
1957{
1959
1960 TRACE("(%p)->(%d %d)\n", This, anchor, active);
1961
1962 if (!This->child.reole)
1963 return CO_E_RELEASED;
1964
1965 cp2range(This->child.reole->editor, &anchor, &active);
1966 if (anchor == This->start && active == This->end)
1967 return S_FALSE;
1968
1969 This->start = anchor;
1970 This->end = active;
1971 return S_OK;
1972}
1973
1975{
1976 LONG from, to, v;
1977
1978 if (!ret)
1979 ret = &v;
1980
1981 if (FAILED(ITextRange_GetStart(range, &from)) || FAILED(ITextRange_GetEnd(range, &to))) {
1982 *ret = tomFalse;
1983 }
1984 else
1985 *ret = (start >= from && end <= to) ? tomTrue : tomFalse;
1986 return *ret == tomTrue ? S_OK : S_FALSE;
1987}
1988
1990{
1992
1993 TRACE("(%p)->(%p %p)\n", This, range, ret);
1994
1995 if (ret)
1996 *ret = tomFalse;
1997
1998 if (!This->child.reole)
1999 return CO_E_RELEASED;
2000
2001 if (!range)
2002 return S_FALSE;
2003
2004 return textrange_inrange(This->start, This->end, range, ret);
2005}
2006
2008{
2010
2011 FIXME("(%p)->(%p): stub\n", This, ret);
2012
2013 if (!This->child.reole)
2014 return CO_E_RELEASED;
2015
2016 return E_NOTIMPL;
2017}
2018
2020{
2021 LONG from, to, v;
2022
2023 if (!ret)
2024 ret = &v;
2025
2026 if (FAILED(ITextRange_GetStart(range, &from)) || FAILED(ITextRange_GetEnd(range, &to))) {
2027 *ret = tomFalse;
2028 }
2029 else
2030 *ret = (start == from && end == to) ? tomTrue : tomFalse;
2031 return *ret == tomTrue ? S_OK : S_FALSE;
2032}
2033
2035{
2037
2038 TRACE("(%p)->(%p %p)\n", This, range, ret);
2039
2040 if (ret)
2041 *ret = tomFalse;
2042
2043 if (!This->child.reole)
2044 return CO_E_RELEASED;
2045
2046 if (!range)
2047 return S_FALSE;
2048
2049 return textrange_isequal(This->start, This->end, range, ret);
2050}
2051
2053{
2055
2056 TRACE("(%p)\n", This);
2057
2058 if (!This->child.reole)
2059 return CO_E_RELEASED;
2060
2061 set_selection(This->child.reole->editor, This->start, This->end);
2062 return S_OK;
2063}
2064
2066{
2067 HRESULT hr;
2068 LONG start, end;
2069 LONG moved;
2070
2071 ITextRange_GetStart(range, &start);
2072 ITextRange_GetEnd(range, &end);
2073
2074 switch (unit)
2075 {
2076 case tomCharacter:
2077 {
2078 moved = 0;
2079 if (extend == tomMove) {
2080 if (start != end) {
2081 ITextRange_SetEnd(range, start);
2082 moved = -1;
2083 }
2084 }
2085 if (delta)
2086 *delta = moved;
2087 hr = moved ? S_OK : S_FALSE;
2088 break;
2089 }
2090 default:
2091 FIXME("unit %d is not supported\n", unit);
2092 return E_NOTIMPL;
2093 }
2094 return hr;
2095}
2096
2098 LONG *delta)
2099{
2101
2102 TRACE("(%p)->(%d %d %p)\n", This, unit, extend, delta);
2103
2104 if (!This->child.reole)
2105 return CO_E_RELEASED;
2106
2107 return textrange_startof(me, unit, extend, delta);
2108}
2109
2111{
2112 HRESULT hr;
2113 LONG old_start, old_end, new_end;
2114 LONG moved;
2115
2116 ITextRange_GetStart(range, &old_start);
2117 ITextRange_GetEnd(range, &old_end);
2118
2119 switch (unit)
2120 {
2121 case tomCharacter:
2122 {
2123 moved = 0;
2124 new_end = old_end;
2125 if (old_end == 0)
2126 {
2128 cursor_from_char_ofs( editor, old_end, &cursor );
2129 moved = ME_MoveCursorChars(editor, &cursor, 1, TRUE);
2130 new_end = old_end + moved;
2131 }
2132 else if (extend == tomMove && old_start != old_end)
2133 moved = 1;
2134
2135 ITextRange_SetEnd(range, new_end);
2136 if (extend == tomMove)
2137 ITextRange_SetStart(range, new_end);
2138 if (delta)
2139 *delta = moved;
2140 hr = moved ? S_OK : S_FALSE;
2141 break;
2142 }
2143 default:
2144 FIXME("unit %d is not supported\n", unit);
2145 return E_NOTIMPL;
2146 }
2147 return hr;
2148}
2149
2151 LONG *delta)
2152{
2154
2155 TRACE("(%p)->(%d %d %p)\n", This, unit, extend, delta);
2156
2157 if (!This->child.reole)
2158 return CO_E_RELEASED;
2159
2160 return textrange_endof(me, This->child.reole->editor, unit, extend, delta);
2161}
2162
2164{
2165 LONG old_start, old_end, new_start, new_end;
2166 LONG move_by;
2167 LONG moved;
2168 HRESULT hr = S_OK;
2169
2170 if (!count)
2171 {
2172 if (delta)
2173 *delta = 0;
2174 return S_FALSE;
2175 }
2176
2177 ITextRange_GetStart(range, &old_start);
2178 ITextRange_GetEnd(range, &old_end);
2179 switch (unit)
2180 {
2181 case tomCharacter:
2182 {
2184
2185 if (count > 0)
2186 {
2187 cursor_from_char_ofs( editor, old_end, &cursor );
2188 move_by = count;
2189 if (old_start != old_end)
2190 --move_by;
2191 }
2192 else
2193 {
2194 cursor_from_char_ofs( editor, old_start, &cursor );
2195 move_by = count;
2196 if (old_start != old_end)
2197 ++move_by;
2198 }
2199 moved = ME_MoveCursorChars(editor, &cursor, move_by, FALSE);
2200 if (count > 0)
2201 {
2202 new_end = old_end + moved;
2203 new_start = new_end;
2204 if (old_start != old_end)
2205 ++moved;
2206 }
2207 else
2208 {
2209 new_start = old_start + moved;
2210 new_end = new_start;
2211 if (old_start != old_end)
2212 --moved;
2213 }
2214 if (delta) *delta = moved;
2215 break;
2216 }
2217 default:
2218 FIXME("unit %d is not supported\n", unit);
2219 return E_NOTIMPL;
2220 }
2221 if (moved == 0)
2222 hr = S_FALSE;
2223 ITextRange_SetStart(range, new_start);
2224 ITextRange_SetEnd(range, new_end);
2225
2226 return hr;
2227}
2228
2230{
2232
2233 TRACE("(%p)->(%d %d %p)\n", This, unit, count, delta);
2234
2235 if (!This->child.reole)
2236 return CO_E_RELEASED;
2237
2238 return textrange_move(me, This->child.reole->editor, unit, count, delta);
2239}
2240
2242{
2243 LONG old_start, old_end, new_start, new_end;
2244 HRESULT hr = S_OK;
2245
2246 if (!count)
2247 {
2248 if (delta)
2249 *delta = 0;
2250 return S_FALSE;
2251 }
2252
2253 ITextRange_GetStart(range, &old_start);
2254 ITextRange_GetEnd(range, &old_end);
2255 switch (unit)
2256 {
2257 case tomCharacter:
2258 {
2260 LONG moved;
2261
2262 cursor_from_char_ofs( editor, old_start, &cursor );
2264 new_start = old_start + moved;
2265 new_end = old_end;
2266 if (new_end < new_start)
2267 new_end = new_start;
2268 if (delta)
2269 *delta = moved;
2270 break;
2271 }
2272 default:
2273 FIXME("unit %d is not supported\n", unit);
2274 return E_NOTIMPL;
2275 }
2276 if (new_start == old_start)
2277 hr = S_FALSE;
2278 ITextRange_SetStart(range, new_start);
2279 ITextRange_SetEnd(range, new_end);
2280
2281 return hr;
2282}
2283
2285 LONG *delta)
2286{
2288
2289 TRACE("(%p)->(%d %d %p)\n", This, unit, count, delta);
2290
2291 if (!This->child.reole)
2292 return CO_E_RELEASED;
2293
2294 return textrange_movestart(me, This->child.reole->editor, unit, count, delta);
2295}
2296
2298{
2299 LONG old_start, old_end, new_start, new_end;
2300 HRESULT hr = S_OK;
2301
2302 if (!count)
2303 {
2304 if (delta)
2305 *delta = 0;
2306 return S_FALSE;
2307 }
2308
2309 ITextRange_GetStart(range, &old_start);
2310 ITextRange_GetEnd(range, &old_end);
2311 switch (unit)
2312 {
2313 case tomCharacter:
2314 {
2316 LONG moved;
2317
2318 cursor_from_char_ofs( editor, old_end, &cursor );
2320 new_start = old_start;
2321 new_end = old_end + moved;
2322 if (new_end < new_start)
2323 new_start = new_end;
2324 if (delta)
2325 *delta = moved;
2326 break;
2327 }
2328 case tomStory:
2329 if (count < 0)
2330 new_start = new_end = 0;
2331 else
2332 {
2333 new_start = old_start;
2334 ITextRange_GetStoryLength(range, &new_end);
2335 }
2336 if (delta)
2337 {
2338 if (new_end < old_end)
2339 *delta = -1;
2340 else if (new_end == old_end)
2341 *delta = 0;
2342 else
2343 *delta = 1;
2344 }
2345 break;
2346 default:
2347 FIXME("unit %d is not supported\n", unit);
2348 return E_NOTIMPL;
2349 }
2350 if (new_end == old_end)
2351 hr = S_FALSE;
2352 ITextRange_SetStart(range, new_start);
2353 ITextRange_SetEnd(range, new_end);
2354
2355 return hr;
2356}
2357
2359 LONG *delta)
2360{
2362
2363 TRACE("(%p)->(%d %d %p)\n", This, unit, count, delta);
2364
2365 if (!This->child.reole)
2366 return CO_E_RELEASED;
2367
2368 return textrange_moveend(me, This->child.reole->editor, unit, count, delta);
2369}
2370
2372 LONG *delta)
2373{
2375
2376 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
2377
2378 if (!This->child.reole)
2379 return CO_E_RELEASED;
2380
2381 return E_NOTIMPL;
2382}
2383
2385 LONG *delta)
2386{
2388
2389 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
2390
2391 if (!This->child.reole)
2392 return CO_E_RELEASED;
2393
2394 return E_NOTIMPL;
2395}
2396
2398 LONG *delta)
2399{
2401
2402 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
2403
2404 if (!This->child.reole)
2405 return CO_E_RELEASED;
2406
2407 return E_NOTIMPL;
2408}
2409
2411 LONG *delta)
2412{
2414
2415 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
2416
2417 if (!This->child.reole)
2418 return CO_E_RELEASED;
2419
2420 return E_NOTIMPL;
2421}
2422
2424 LONG *delta)
2425{
2427
2428 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
2429
2430 if (!This->child.reole)
2431 return CO_E_RELEASED;
2432
2433 return E_NOTIMPL;
2434}
2435
2437 LONG *delta)
2438{
2440
2441 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
2442
2443 if (!This->child.reole)
2444 return CO_E_RELEASED;
2445
2446 return E_NOTIMPL;
2447}
2448
2450 LONG *length)
2451{
2453
2454 FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length);
2455
2456 if (!This->child.reole)
2457 return CO_E_RELEASED;
2458
2459 return E_NOTIMPL;
2460}
2461
2464{
2466
2467 FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length);
2468
2469 if (!This->child.reole)
2470 return CO_E_RELEASED;
2471
2472 return E_NOTIMPL;
2473}
2474
2477{
2479
2480 FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length);
2481
2482 if (!This->child.reole)
2483 return CO_E_RELEASED;
2484
2485 return E_NOTIMPL;
2486}
2487
2489{
2491
2492 FIXME("(%p)->(%d %d %p): stub\n", This, unit, count, delta);
2493
2494 if (!This->child.reole)
2495 return CO_E_RELEASED;
2496
2497 return E_NOTIMPL;
2498}
2499
2501{
2502 LONG start, end;
2504 IDataObject **data_out = NULL;
2505
2506 ITextRange_GetStart( range, &start );
2507 ITextRange_GetEnd( range, &end );
2508 if (start == end)
2509 {
2510 /* If the range is empty, all text is copied */
2511 LONG prev_end = end;
2512 ITextRange_SetEnd( range, MAXLONG );
2513 start = 0;
2514 ITextRange_GetEnd( range, &end );
2515 ITextRange_SetEnd( range, prev_end );
2516 }
2518
2519 if (v && V_VT(v) == (VT_UNKNOWN | VT_BYREF) && V_UNKNOWNREF( v ))
2520 data_out = (IDataObject **)V_UNKNOWNREF( v );
2521
2522 return editor_copy_or_cut( editor, cut, &cursor, end - start, data_out );
2523}
2524
2526{
2528
2529 TRACE("(%p)->(%p)\n", This, v);
2530
2531 if (!This->child.reole)
2532 return CO_E_RELEASED;
2533
2534 return textrange_copy_or_cut(me, This->child.reole->editor, TRUE, v);
2535}
2536
2538{
2540
2541 TRACE("(%p)->(%p)\n", This, v);
2542
2543 if (!This->child.reole)
2544 return CO_E_RELEASED;
2545
2546 return textrange_copy_or_cut(me, This->child.reole->editor, FALSE, v);
2547}
2548
2550{
2552
2553 FIXME("(%p)->(%s %x): stub\n", This, debugstr_variant(v), format);
2554
2555 if (!This->child.reole)
2556 return CO_E_RELEASED;
2557
2558 return E_NOTIMPL;
2559}
2560
2562{
2564
2565 FIXME("(%p)->(%s %x %p): stub\n", This, debugstr_variant(v), format, ret);
2566
2567 if (!This->child.reole)
2568 return CO_E_RELEASED;
2569
2570 return E_NOTIMPL;
2571}
2572
2574{
2576
2577 FIXME("(%p)->(%p): stub\n", This, ret);
2578
2579 if (!This->child.reole)
2580 return CO_E_RELEASED;
2581
2582 return E_NOTIMPL;
2583}
2584
2586{
2588
2589 FIXME("(%p)->(%d): stub\n", This, type);
2590
2591 if (!This->child.reole)
2592 return CO_E_RELEASED;
2593
2594 return E_NOTIMPL;
2595}
2596
2598{
2600
2601 FIXME("(%p)->(%d %p %p): stub\n", This, type, cx, cy);
2602
2603 if (!This->child.reole)
2604 return CO_E_RELEASED;
2605
2606 return E_NOTIMPL;
2607}
2608
2610 LONG extend)
2611{
2613
2614 FIXME("(%p)->(%d %d %d %d): stub\n", This, x, y, type, extend);
2615
2616 if (!This->child.reole)
2617 return CO_E_RELEASED;
2618
2619 return E_NOTIMPL;
2620}
2621
2623{
2627 int x, y, height;
2628
2629 TRACE("(%p)->(%d)\n", This, value);
2630
2631 if (!This->child.reole)
2632 return CO_E_RELEASED;
2633
2634 editor = This->child.reole->editor;
2635
2636 switch (value)
2637 {
2638 case tomStart:
2640 cursor_coords( editor, &cursor, &x, &y, &height );
2641 break;
2642 case tomEnd:
2644 cursor_coords( editor, &cursor, &x, &y, &height );
2645 break;
2646 default:
2647 FIXME("bStart value %d not handled\n", value);
2648 return E_NOTIMPL;
2649 }
2650 scroll_abs( editor, x, y, TRUE );
2651 return S_OK;
2652}
2653
2655{
2657
2658 FIXME("(%p)->(%p): stub\n", This, ppv);
2659
2660 if (!This->child.reole)
2661 return CO_E_RELEASED;
2662
2663 return E_NOTIMPL;
2664}
2665
2666static const ITextRangeVtbl trvt = {
2725};
2726
2727/* ITextFont */
2729{
2731
2732 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
2733
2734 if (IsEqualIID(riid, &IID_ITextFont) ||
2737 {
2738 *ppv = iface;
2739 ITextFont_AddRef(iface);
2740 return S_OK;
2741 }
2742
2743 *ppv = NULL;
2744 return E_NOINTERFACE;
2745}
2746
2748{
2751 TRACE("(%p)->(%u)\n", This, ref);
2752 return ref;
2753}
2754
2756{
2759
2760 TRACE("(%p)->(%u)\n", This, ref);
2761
2762 if (!ref)
2763 {
2764 if (This->range)
2765 ITextRange_Release(This->range);
2766 SysFreeString(This->props[FONT_NAME].str);
2767 heap_free(This);
2768 }
2769
2770 return ref;
2771}
2772
2774{
2776 TRACE("(%p)->(%p)\n", This, pctinfo);
2777 *pctinfo = 1;
2778 return S_OK;
2779}
2780
2782 ITypeInfo **ppTInfo)
2783{
2785 HRESULT hr;
2786
2787 TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
2788
2789 hr = get_typeinfo(ITextFont_tid, ppTInfo);
2790 if (SUCCEEDED(hr))
2791 ITypeInfo_AddRef(*ppTInfo);
2792 return hr;
2793}
2794
2796 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
2797{
2799 ITypeInfo *ti;
2800 HRESULT hr;
2801
2802 TRACE("(%p)->(%s, %p, %u, %d, %p)\n", This, debugstr_guid(riid),
2803 rgszNames, cNames, lcid, rgDispId);
2804
2806 if (SUCCEEDED(hr))
2807 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
2808 return hr;
2809}
2810
2812 ITextFont *iface,
2813 DISPID dispIdMember,
2814 REFIID riid,
2815 LCID lcid,
2816 WORD wFlags,
2817 DISPPARAMS *pDispParams,
2818 VARIANT *pVarResult,
2819 EXCEPINFO *pExcepInfo,
2820 UINT *puArgErr)
2821{
2823 ITypeInfo *ti;
2824 HRESULT hr;
2825
2826 TRACE("(%p)->(%d, %s, %d, %u, %p, %p, %p, %p)\n", This, dispIdMember, debugstr_guid(riid),
2827 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2828
2830 if (SUCCEEDED(hr))
2831 hr = ITypeInfo_Invoke(ti, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2832 return hr;
2833}
2834
2836{
2838
2839 TRACE("(%p)->(%p)\n", This, ret);
2840
2841 if (!ret)
2842 return E_INVALIDARG;
2843
2844 *ret = NULL;
2845 if (This->range && !get_range_reole(This->range))
2846 return CO_E_RELEASED;
2847
2848 return create_textfont(NULL, This, ret);
2849}
2850
2852{
2854 FIXME("(%p)->(%p): stub\n", This, pFont);
2855 return E_NOTIMPL;
2856}
2857
2859{
2861 FIXME("(%p)->(%p): stub\n", This, ret);
2862 return E_NOTIMPL;
2863}
2864
2866{
2868 FIXME("(%p)->(%p %p): stub\n", This, font, ret);
2869 return E_NOTIMPL;
2870}
2871
2873{
2874 enum textfont_prop_id id;
2875
2876 for (id = FONT_PROPID_FIRST; id < FONT_PROPID_LAST; id++) {
2877 switch (id)
2878 {
2879 case FONT_ALLCAPS:
2880 case FONT_ANIMATION:
2881 case FONT_BOLD:
2882 case FONT_EMBOSS:
2883 case FONT_HIDDEN:
2884 case FONT_ENGRAVE:
2885 case FONT_ITALIC:
2886 case FONT_OUTLINE:
2887 case FONT_PROTECTED:
2888 case FONT_SHADOW:
2889 case FONT_SMALLCAPS:
2890 case FONT_STRIKETHROUGH:
2891 case FONT_SUBSCRIPT:
2892 case FONT_SUPERSCRIPT:
2893 case FONT_UNDERLINE:
2894 font->props[id].l = tomFalse;
2895 break;
2896 case FONT_BACKCOLOR:
2897 case FONT_FORECOLOR:
2898 font->props[id].l = tomAutoColor;
2899 break;
2900 case FONT_KERNING:
2901 case FONT_POSITION:
2902 case FONT_SIZE:
2903 case FONT_SPACING:
2904 font->props[id].f = 0.0;
2905 break;
2906 case FONT_LANGID:
2907 font->props[id].l = GetSystemDefaultLCID();
2908 break;
2909 case FONT_NAME: {
2910 SysFreeString(font->props[id].str);
2911 font->props[id].str = SysAllocString(L"System");
2912 break;
2913 }
2914 case FONT_WEIGHT:
2915 font->props[id].l = FW_NORMAL;
2916 break;
2917 default:
2918 FIXME("font property %d not handled\n", id);
2919 }
2920 }
2921}
2922
2924{
2925 enum textfont_prop_id id;
2926
2927 for (id = FONT_PROPID_FIRST; id < FONT_PROPID_LAST; id++) {
2928 switch (id)
2929 {
2930 case FONT_ALLCAPS:
2931 case FONT_ANIMATION:
2932 case FONT_BOLD:
2933 case FONT_EMBOSS:
2934 case FONT_HIDDEN:
2935 case FONT_ENGRAVE:
2936 case FONT_ITALIC:
2937 case FONT_OUTLINE:
2938 case FONT_PROTECTED:
2939 case FONT_SHADOW:
2940 case FONT_SMALLCAPS:
2941 case FONT_STRIKETHROUGH:
2942 case FONT_SUBSCRIPT:
2943 case FONT_SUPERSCRIPT:
2944 case FONT_UNDERLINE:
2945 case FONT_BACKCOLOR:
2946 case FONT_FORECOLOR:
2947 case FONT_LANGID:
2948 case FONT_WEIGHT:
2949 font->props[id].l = tomUndefined;
2950 break;
2951 case FONT_KERNING:
2952 case FONT_POSITION:
2953 case FONT_SIZE:
2954 case FONT_SPACING:
2955 font->props[id].f = tomUndefined;
2956 break;
2957 case FONT_NAME:
2958 break;
2959 default:
2960 FIXME("font property %d not handled\n", id);
2961 }
2962 }
2963}
2964
2966{
2967 enum textfont_prop_id propid;
2968 for (propid = FONT_PROPID_FIRST; propid < FONT_PROPID_LAST; propid++)
2969 set_textfont_prop(font, propid, &font->props[propid]);
2970}
2971
2973{
2975
2976 TRACE("(%p)->(%d)\n", This, value);
2977
2978 /* If font is attached to a range, released or not, we can't
2979 reset to undefined */
2980 if (This->range) {
2981 if (!get_range_reole(This->range))
2982 return CO_E_RELEASED;
2983
2984 switch (value)
2985 {
2986 case tomUndefined:
2987 return E_INVALIDARG;
2988 case tomCacheParms:
2990 This->get_cache_enabled = TRUE;
2991 break;
2992 case tomTrackParms:
2993 This->get_cache_enabled = FALSE;
2994 break;
2995 case tomApplyLater:
2996 This->set_cache_enabled = TRUE;
2997 break;
2998 case tomApplyNow:
2999 This->set_cache_enabled = FALSE;
3001 break;
3002 case tomUsePoints:
3003 case tomUseTwips:
3004 return E_INVALIDARG;
3005 default:
3006 FIXME("reset mode %d not supported\n", value);
3007 }
3008
3009 return S_OK;
3010 }
3011 else {
3012 switch (value)
3013 {
3014 /* reset to global defaults */
3015 case tomDefault:
3017 return S_OK;
3018 /* all properties are set to tomUndefined, font name is retained */
3019 case tomUndefined:
3021 return S_OK;
3022 case tomApplyNow:
3023 case tomApplyLater:
3024 case tomTrackParms:
3025 case tomCacheParms:
3026 return S_OK;
3027 case tomUsePoints:
3028 case tomUseTwips:
3029 return E_INVALIDARG;
3030 }
3031 }
3032
3033 FIXME("reset mode %d not supported\n", value);
3034 return E_NOTIMPL;
3035}
3036
3038{
3040 FIXME("(%p)->(%p): stub\n", This, value);
3041 return E_NOTIMPL;
3042}
3043
3045{
3047 FIXME("(%p)->(%d): stub\n", This, value);
3048 return E_NOTIMPL;
3049}
3050
3052{
3054 TRACE("(%p)->(%p)\n", This, value);
3056}
3057
3059{
3061 TRACE("(%p)->(%d)\n", This, value);
3063}
3064
3066{
3068 TRACE("(%p)->(%p)\n", This, value);
3070}
3071
3073{
3075
3076 TRACE("(%p)->(%d)\n", This, value);
3077
3078 if (value < tomNoAnimation || value > tomAnimationMax)
3079 return E_INVALIDARG;
3080
3082}
3083
3085{
3087 TRACE("(%p)->(%p)\n", This, value);
3089}
3090
3092{
3094 TRACE("(%p)->(%d)\n", This, value);
3096}
3097
3099{
3101 TRACE("(%p)->(%p)\n", This, value);
3103}
3104
3106{
3108 TRACE("(%p)->(%d)\n", This, value);
3110}
3111
3113{
3115 TRACE("(%p)->(%p)\n", This, value);
3117}
3118
3120{
3122 TRACE("(%p)->(%d)\n", This, value);
3124}
3125
3127{
3129 TRACE("(%p)->(%p)\n", This, value);
3131}
3132
3134{
3136 TRACE("(%p)->(%d)\n", This, value);
3138}
3139
3141{
3143 TRACE("(%p)->(%p)\n", This, value);
3145}
3146
3148{
3150 TRACE("(%p)->(%d)\n", This, value);
3152}
3153
3155{
3157 TRACE("(%p)->(%p)\n", This, value);
3159}
3160
3162{
3164 TRACE("(%p)->(%d)\n", This, value);
3166}
3167
3169{
3171 TRACE("(%p)->(%p)\n", This, value);
3173}
3174
3176{
3178 TRACE("(%p)->(%d)\n", This, value);
3180}
3181
3183{
3185 TRACE("(%p)->(%p)\n", This, value);
3187}
3188
3190{
3192 TRACE("(%p)->(%.2f)\n", This, value);
3194}
3195
3197{
3199 TRACE("(%p)->(%p)\n", This, value);
3201}
3202
3204{
3206 TRACE("(%p)->(%d)\n", This, value);
3208}
3209
3211{
3213
3214 TRACE("(%p)->(%p)\n", This, value);
3215
3216 if (!value)
3217 return E_INVALIDARG;
3218
3219 *value = NULL;
3220
3221 if (!This->range) {
3222 if (This->props[FONT_NAME].str)
3223 *value = SysAllocString(This->props[FONT_NAME].str);
3224 else
3226 return *value ? S_OK : E_OUTOFMEMORY;
3227 }
3228
3229 return textfont_getname_from_range(This->range, value);
3230}
3231
3233{
3236
3237 TRACE("(%p)->(%s)\n", This, debugstr_w(value));
3238
3239 v.str = value;
3240 return set_textfont_prop(This, FONT_NAME, &v);
3241}
3242
3244{
3246 TRACE("(%p)->(%p)\n", This, value);
3248}
3249
3251{
3253 TRACE("(%p)->(%d)\n", This, value);
3255}
3256
3258{
3260 TRACE("(%p)->(%p)\n", This, value);
3262}
3263
3265{
3267 TRACE("(%p)->(%.2f)\n", This, value);
3269}
3270
3272{
3274 TRACE("(%p)->(%p)\n", This, value);
3276}
3277
3279{
3281 TRACE("(%p)->(%d)\n", This, value);
3283}
3284
3286{
3288 TRACE("(%p)->(%p)\n", This, value);
3290}
3291
3293{
3295 TRACE("(%p)->(%d)\n", This, value);
3297}
3298
3300{
3302 TRACE("(%p)->(%p)\n", This, value);
3304}
3305
3307{
3309 TRACE("(%p)->(%.2f)\n", This, value);
3311}
3312
3314{
3316 TRACE("(%p)->(%p)\n", This, value);
3318}
3319
3321{
3323 TRACE("(%p)->(%d)\n", This, value);
3325}
3326
3328{
3330 TRACE("(%p)->(%p)\n", This, value);
3332}
3333
3335{
3337 TRACE("(%p)->(%.2f)\n", This, value);
3339}
3340
3342{
3344 TRACE("(%p)->(%p)\n", This, value);
3346}
3347
3349{
3351 TRACE("(%p)->(%d)\n", This, value);
3353}
3354
3356{
3358 TRACE("(%p)->(%p)\n", This, value);
3360}
3361
3363{
3365 TRACE("(%p)->(%d)\n", This, value);
3367}
3368
3370{
3372 TRACE("(%p)->(%p)\n", This, value);
3374}
3375
3377{
3379 TRACE("(%p)->(%d)\n", This, value);
3381}
3382
3384{
3386 TRACE("(%p)->(%p)\n", This, value);
3388}
3389
3391{
3393 TRACE("(%p)->(%d)\n", This, value);
3395}
3396
3398{
3400 TRACE("(%p)->(%p)\n", This, value);
3402}
3403
3405{
3407 TRACE("(%p)->(%d)\n", This, value);
3409}
3410
3411static ITextFontVtbl textfontvtbl = {
3474};
3475
3477{
3479
3480 *ret = NULL;
3481 font = heap_alloc(sizeof(*font));
3482 if (!font)
3483 return E_OUTOFMEMORY;
3484
3485 font->ITextFont_iface.lpVtbl = &textfontvtbl;
3486 font->ref = 1;
3487
3488 if (src) {
3489 font->range = NULL;
3490 font->get_cache_enabled = TRUE;
3491 font->set_cache_enabled = TRUE;
3492 memcpy(&font->props, &src->props, sizeof(font->props));
3493 if (font->props[FONT_NAME].str)
3494 font->props[FONT_NAME].str = SysAllocString(font->props[FONT_NAME].str);
3495 }
3496 else {
3497 font->range = range;
3498 ITextRange_AddRef(range);
3499
3500 /* cache current properties */
3501 font->get_cache_enabled = FALSE;
3502 font->set_cache_enabled = FALSE;
3504 }
3505
3506 *ret = &font->ITextFont_iface;
3507 return S_OK;
3508}
3509
3510/* ITextPara */
3512{
3514
3515 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
3516
3517 if (IsEqualIID(riid, &IID_ITextPara) ||
3520 {
3521 *ppv = iface;
3522 ITextPara_AddRef(iface);
3523 return S_OK;
3524 }
3525
3526 *ppv = NULL;
3527 return E_NOINTERFACE;
3528}
3529
3531{
3534 TRACE("(%p)->(%u)\n", This, ref);
3535 return ref;
3536}
3537
3539{
3542
3543 TRACE("(%p)->(%u)\n", This, ref);
3544
3545 if (!ref)
3546 {
3547 ITextRange_Release(This->range);
3548 heap_free(This);
3549 }
3550
3551 return ref;
3552}
3553
3555{
3557 TRACE("(%p)->(%p)\n", This, pctinfo);
3558 *pctinfo = 1;
3559 return S_OK;
3560}
3561
3563 ITypeInfo **ppTInfo)
3564{
3566 HRESULT hr;
3567
3568 TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
3569
3570 hr = get_typeinfo(ITextPara_tid, ppTInfo);
3571 if (SUCCEEDED(hr))
3572 ITypeInfo_AddRef(*ppTInfo);
3573 return hr;
3574}
3575
3577 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
3578{
3580 ITypeInfo *ti;
3581 HRESULT hr;
3582
3583 TRACE("(%p)->(%s, %p, %u, %d, %p)\n", This, debugstr_guid(riid), rgszNames,
3584 cNames, lcid, rgDispId);
3585
3587 if (SUCCEEDED(hr))
3588 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
3589 return hr;
3590}
3591
3593 ITextPara *iface,
3594 DISPID dispIdMember,
3595 REFIID riid,
3596 LCID lcid,
3597 WORD wFlags,
3598 DISPPARAMS *pDispParams,
3599 VARIANT *pVarResult,
3600 EXCEPINFO *pExcepInfo,
3601 UINT *puArgErr)
3602{
3604 ITypeInfo *ti;
3605 HRESULT hr;
3606
3607 TRACE("(%p)->(%d, %s, %d, %u, %p, %p, %p, %p)\n", This, dispIdMember,
3608 debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult,
3609 pExcepInfo, puArgErr);
3610
3612 if (SUCCEEDED(hr))
3613 hr = ITypeInfo_Invoke(ti, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3614 return hr;
3615}
3616
3618{
3620 FIXME("(%p)->(%p)\n", This, ret);
3621 return E_NOTIMPL;
3622}
3623
3625{
3627 FIXME("(%p)->(%p)\n", This, para);
3628 return E_NOTIMPL;
3629}
3630
3632{
3634 FIXME("(%p)->(%p)\n", This, ret);
3635 return E_NOTIMPL;
3636}
3637
3639{
3641 FIXME("(%p)->(%p %p)\n", This, para, ret);
3642 return E_NOTIMPL;
3643}
3644
3646{
3648 FIXME("(%p)->(%d)\n", This, value);
3649 return E_NOTIMPL;
3650}
3651
3653{
3655 FIXME("(%p)->(%p)\n", This, value);
3656 return E_NOTIMPL;
3657}
3658
3660{
3662 FIXME("(%p)->(%d)\n", This, value);
3663 return E_NOTIMPL;
3664}
3665
3667{
3669 FIXME("(%p)->(%p)\n", This, value);
3670 return E_NOTIMPL;
3671}
3672
3674{
3676 FIXME("(%p)->(%d)\n", This, value);
3677 return E_NOTIMPL;
3678}
3679
3681{
3683 FIXME("(%p)->(%p)\n", This, value);
3684 return E_NOTIMPL;
3685}
3686
3688{
3690 FIXME("(%p)->(%d)\n", This, value);
3691 return E_NOTIMPL;
3692}
3693
3695{
3697 FIXME("(%p)->(%p)\n", This, value);
3698 return E_NOTIMPL;
3699}
3700
3702{
3704 FIXME("(%p)->(%p)\n", This, value);
3705 return E_NOTIMPL;
3706}
3707
3709{
3711 FIXME("(%p)->(%d)\n", This, value);
3712 return E_NOTIMPL;
3713}
3714
3716{
3718 FIXME("(%p)->(%p)\n", This, value);
3719 return E_NOTIMPL;
3720}
3721
3723{
3725 FIXME("(%p)->(%d)\n", This, value);
3726 return E_NOTIMPL;
3727}
3728
3730{
3732 FIXME("(%p)->(%p)\n", This, value);
3733 return E_NOTIMPL;
3734}
3735
3737{
3739 FIXME("(%p)->(%p)\n", This, value);
3740 return E_NOTIMPL;
3741}
3742
3744{
3746 FIXME("(%p)->(%p)\n", This, value);
3747 return E_NOTIMPL;
3748}
3749
3751{
3753 FIXME("(%p)->(%p)\n", This, value);
3754 return E_NOTIMPL;
3755}
3756
3758{
3760 FIXME("(%p)->(%d)\n", This, value);
3761 return E_NOTIMPL;
3762}
3763
3765{
3767 FIXME("(%p)->(%p)\n", This, value);
3768 return E_NOTIMPL;
3769}
3770
3772{
3774 FIXME("(%p)->(%d)\n", This, value);
3775 return E_NOTIMPL;
3776}
3777
3779{
3781 FIXME("(%p)->(%p)\n", This, value);
3782 return E_NOTIMPL;
3783}
3784
3786{
3788 FIXME("(%p)->(%d)\n", This, value);
3789 return E_NOTIMPL;
3790}
3791
3793{
3795 FIXME("(%p)->(%p)\n", This, value);
3796 return E_NOTIMPL;
3797}
3798
3800{
3802 FIXME("(%p)->(%.2f)\n", This, value);
3803 return E_NOTIMPL;
3804}
3805
3807{
3809 FIXME("(%p)->(%p)\n", This, value);
3810 return E_NOTIMPL;
3811}
3812
3814{
3816 FIXME("(%p)->(%d)\n", This, value);
3817 return E_NOTIMPL;
3818}
3819
3821{
3823 FIXME("(%p)->(%p)\n", This, value);
3824 return E_NOTIMPL;
3825}
3826
3828{
3830 FIXME("(%p)->(%d)\n", This, value);
3831 return E_NOTIMPL;
3832}
3833
3835{
3837 FIXME("(%p)->(%p)\n", This, value);
3838 return E_NOTIMPL;
3839}
3840
3842{
3844 FIXME("(%p)->(%d)\n", This, value);
3845 return E_NOTIMPL;
3846}
3847
3849{
3851 FIXME("(%p)->(%p)\n", This, value);
3852 return E_NOTIMPL;
3853}
3854
3856{
3858 FIXME("(%p)->(%.2f)\n", This, value);
3859 return E_NOTIMPL;
3860}
3861
3862static HRESULT WINAPI TextPara_SetIndents(ITextPara *iface, FLOAT StartIndent, FLOAT LeftIndent, FLOAT RightIndent)
3863{
3865 FIXME("(%p)->(%.2f %.2f %.2f)\n", This, StartIndent, LeftIndent, RightIndent);
3866 return E_NOTIMPL;
3867}
3868
3869static HRESULT WINAPI TextPara_SetLineSpacing(ITextPara *iface, LONG LineSpacingRule, FLOAT LineSpacing)
3870{
3872 FIXME("(%p)->(%d %.2f)\n", This, LineSpacingRule, LineSpacing);
3873 return E_NOTIMPL;
3874}
3875
3877{
3879 FIXME("(%p)->(%p)\n", This, value);
3880 return E_NOTIMPL;
3881}
3882
3884{
3886 FIXME("(%p)->(%.2f)\n", This, value);
3887 return E_NOTIMPL;
3888}
3889
3891{
3893 FIXME("(%p)->(%p)\n", This, value);
3894 return E_NOTIMPL;
3895}
3896
3898{
3900 FIXME("(%p)->(%.2f)\n", This, value);
3901 return E_NOTIMPL;
3902}
3903
3905{
3907 FIXME("(%p)->(%p)\n", This, value);
3908 return E_NOTIMPL;
3909}
3910
3912{
3914 FIXME("(%p)->(%d)\n", This, value);
3915 return E_NOTIMPL;
3916}
3917
3919{
3921 FIXME("(%p)->(%p)\n", This, value);
3922 return E_NOTIMPL;
3923}
3924
3925static HRESULT WINAPI TextPara_AddTab(ITextPara *iface, FLOAT tbPos, LONG tbAlign, LONG tbLeader)
3926{
3928 FIXME("(%p)->(%.2f %d %d)\n", This, tbPos, tbAlign, tbLeader);
3929 return E_NOTIMPL;
3930}
3931
3933{
3935 FIXME("(%p)\n", This);
3936 return E_NOTIMPL;
3937}
3938
3940{
3942 FIXME("(%p)->(%.2f)\n", This, pos);
3943 return E_NOTIMPL;
3944}
3945
3946static HRESULT WINAPI TextPara_GetTab(ITextPara *iface, LONG iTab, FLOAT *ptbPos, LONG *ptbAlign, LONG *ptbLeader)
3947{
3949 FIXME("(%p)->(%d %p %p %p)\n", This, iTab, ptbPos, ptbAlign, ptbLeader);
3950 return E_NOTIMPL;
3951}
3952
3953static ITextParaVtbl textparavtbl = {
4009};
4010
4012{
4013 ITextParaImpl *para;
4014
4015 *ret = NULL;
4016 para = heap_alloc(sizeof(*para));
4017 if (!para)
4018 return E_OUTOFMEMORY;
4019
4020 para->ITextPara_iface.lpVtbl = &textparavtbl;
4021 para->ref = 1;
4022 para->range = range;
4023 ITextRange_AddRef(range);
4024
4025 *ret = &para->ITextPara_iface;
4026 return S_OK;
4027}
4028
4029/* ITextDocument */
4031 void **ppvObject)
4032{
4034 return IUnknown_QueryInterface( services->outer_unk, riid, ppvObject );
4035}
4036
4038{
4040 return IUnknown_AddRef( services->outer_unk );
4041}
4042
4044{
4046 return IUnknown_Release( services->outer_unk );
4047}
4048
4050 UINT *pctinfo)
4051{
4053 TRACE("(%p)->(%p)\n", services, pctinfo);
4054 *pctinfo = 1;
4055 return S_OK;
4056}
4057
4059 ITypeInfo **ppTInfo)
4060{
4062 HRESULT hr;
4063
4064 TRACE("(%p)->(%u,%d,%p)\n", services, iTInfo, lcid, ppTInfo);
4065
4066 hr = get_typeinfo(ITextDocument_tid, ppTInfo);
4067 if (SUCCEEDED(hr))
4068 ITypeInfo_AddRef(*ppTInfo);
4069 return hr;
4070}
4071
4073 LPOLESTR *rgszNames, UINT cNames,
4074 LCID lcid, DISPID *rgDispId)
4075{
4077 ITypeInfo *ti;
4078 HRESULT hr;
4079
4080 TRACE("(%p)->(%s, %p, %u, %d, %p)\n", services, debugstr_guid(riid),
4081 rgszNames, cNames, lcid, rgDispId);
4082
4084 if (SUCCEEDED(hr))
4085 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
4086 return hr;
4087}
4088
4090 REFIID riid, LCID lcid, WORD wFlags,
4091 DISPPARAMS *pDispParams, VARIANT *pVarResult,
4092 EXCEPINFO *pExcepInfo, UINT *puArgErr)
4093{
4095 ITypeInfo *ti;
4096 HRESULT hr;
4097
4098 TRACE("(%p)->(%d, %s, %d, %u, %p, %p, %p, %p)\n", services, dispIdMember,
4099 debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult,
4100 pExcepInfo, puArgErr);
4101
4103 if (SUCCEEDED(hr))
4104 hr = ITypeInfo_Invoke(ti, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4105 return hr;
4106}
4107
4109{
4111 FIXME("stub %p\n", services);
4112 return E_NOTIMPL;
4113}
4114
4116{
4118
4119 TRACE("(%p)->(%p)\n", iface, selection);
4120
4121 if (!selection)
4122 return E_INVALIDARG;
4123
4124 if (!services->text_selection)
4125 {
4126 services->text_selection = text_selection_create( services );
4127 if (!services->text_selection)
4128 {
4129 *selection = NULL;
4130 return E_OUTOFMEMORY;
4131 }
4132 }
4133
4134 *selection = &services->text_selection->ITextSelection_iface;
4135 ITextSelection_AddRef(*selection);
4136 return S_OK;
4137}
4138
4140{
4142 FIXME("stub %p\n", services);
4143 return E_NOTIMPL;
4144}
4145
4147 ITextStoryRanges **ppStories)
4148{
4150 FIXME("stub %p\n", services);
4151 return E_NOTIMPL;
4152}
4153
4155{
4157 FIXME("stub %p\n", services);
4158 return E_NOTIMPL;
4159}
4160
4162{
4164 FIXME("stub %p\n", services);
4165 return E_NOTIMPL;
4166}
4167
4169{
4171 FIXME("stub %p\n", services);
4172 return E_NOTIMPL;
4173}
4174
4176{
4178 FIXME("stub %p\n", services);
4179 return E_NOTIMPL;
4180}
4181
4183{
4185 FIXME("stub %p\n", services);
4186 return E_NOTIMPL;
4187}
4188
4190 LONG Flags, LONG CodePage)
4191{
4193 FIXME("stub %p\n", services);
4194 return E_NOTIMPL;
4195}
4196
4198 LONG Flags, LONG CodePage)
4199{
4201 FIXME("stub %p\n", services);
4202 return E_NOTIMPL;
4203}
4204
4206{
4208 FIXME("stub %p\n", services);
4209 return E_NOTIMPL;
4210}
4211
4213{
4215 FIXME("stub %p\n", services);
4216 return E_NOTIMPL;
4217}
4218
4220{
4222 FIXME("stub %p\n", services);
4223 return E_NOTIMPL;
4224}
4225
4227{
4229 FIXME("stub %p\n", services);
4230 return E_NOTIMPL;
4231}
4232
4234{
4236 FIXME("stub %p\n", services);
4237 return E_NOTIMPL;
4238}
4239
4241{
4243 FIXME("stub %p\n", services);
4244 return E_NOTIMPL;
4245}
4246
4248{
4249 ITextRangeImpl *txtRge = heap_alloc(sizeof(ITextRangeImpl));
4250
4251 if (!txtRge)
4252 return E_OUTOFMEMORY;
4253 txtRge->ITextRange_iface.lpVtbl = &trvt;
4254 txtRge->ref = 1;
4255 txtRge->child.reole = services;
4256 txtRge->start = start;
4257 txtRge->end = end;
4258 list_add_head( &services->rangelist, &txtRge->child.entry );
4259 *ppRange = &txtRge->ITextRange_iface;
4260 return S_OK;
4261}
4262
4264 ITextRange **ppRange)
4265{
4267
4268 TRACE("%p %p %d %d\n", services, ppRange, cp1, cp2);
4269 if (!ppRange)
4270 return E_INVALIDARG;
4271
4272 cp2range(services->editor, &cp1, &cp2);
4273 return CreateITextRange(services, cp1, cp2, ppRange);
4274}
4275
4277 ITextRange **ppRange)
4278{
4280 FIXME("stub %p\n", services);
4281 return E_NOTIMPL;
4282}
4283
4284/* ITextDocument2Old methods */
4286{
4288
4289 FIXME("(%p)->(%p): stub\n", services, filter);
4290
4291 return E_NOTIMPL;
4292}
4293
4295{
4297
4298 FIXME("(%p)->(%d, 0x%x): stub\n", services, index, cr);
4299
4300 return E_NOTIMPL;
4301}
4302
4304{
4306
4307 FIXME("(%p)->(%d, %p): stub\n", services, index, cr);
4308
4309 return E_NOTIMPL;
4310}
4311
4313{
4315
4316 FIXME("(%p)->(%p): stub\n", services, type);
4317
4318 return E_NOTIMPL;
4319}
4320
4322{
4324
4325 FIXME("(%p)->(%d): stub\n", services, type);
4326
4327 return E_NOTIMPL;
4328}
4329
4331{
4333
4334 FIXME("(%p)->(%p): stub\n", services, context);
4335
4336 return E_NOTIMPL;
4337}
4338
4340{
4342
4343 FIXME("(%p)->(%d): stub\n", services, context);
4344
4345 return E_NOTIMPL;
4346}
4347
4349 LONG options, LONG current_charrep, LONG current_fontsize,
4350 BSTR *bstr, LONG *pitch_family, LONG *new_fontsize)
4351{
4353
4354 FIXME("(%p)->(%d, %d, %d, %d, %d, %p, %p, %p): stub\n", services, cp, charrep, options, current_charrep,
4355 current_fontsize, bstr, pitch_family, new_fontsize);
4356
4357 return E_NOTIMPL;
4358}
4359
4361{
4363
4364 FIXME("(%p)->(%p): stub\n", services, mode);
4365
4366 return E_NOTIMPL;
4367}
4368
4370{
4372
4373 FIXME("(%p)->(0x%x): stub\n", services, mode);
4374
4375 return E_NOTIMPL;
4376}
4377
4379 LONG *right, LONG *bottom)
4380{
4382
4383 FIXME("(%p)->(%d, %p, %p, %p, %p): stub\n", services, type, left, top, right, bottom);
4384
4385 return E_NOTIMPL;
4386}
4387
4389{
4391
4392 FIXME("(%p)->(%p): stub\n", services, selection);
4393
4394 return E_NOTIMPL;
4395}
4396
4398{
4400
4401 FIXME("(%p)->(%p): stub\n", services, hwnd);
4402
4403 return E_NOTIMPL;
4404}
4405
4407{
4409
4410 FIXME("(%p)->(%p): stub\n", services, flags);
4411
4412 return E_NOTIMPL;
4413}
4414
4416{
4418
4419 FIXME("(%p): stub\n", services);
4420
4421 return E_NOTIMPL;
4422}
4423
4425{
4427
4428 FIXME("(%p)->(%d, %p): stub\n", services, cch, exceed);
4429
4430 return E_NOTIMPL;
4431}
4432
4434{
4436
4437 FIXME("(%p)->(0x%x): stub\n", services, mode);
4438
4439 return E_NOTIMPL;
4440}
4441
4443{
4445
4446 FIXME("(%p): stub\n", services);
4447
4448 return E_NOTIMPL;
4449}
4450
4452{
4454
4455 FIXME("(%p)->(0x%x): stub\n", services, mode);
4456
4457 return E_NOTIMPL;
4458}
4459
4461{
4463
4464 FIXME("(%p)->(%d): stub\n", services, notify);
4465
4466 return E_NOTIMPL;
4467}
4468
4469const ITextDocument2OldVtbl text_doc2old_vtbl =
4470{
4497 /* ITextDocument2Old methods */
4518};
4519
4520/* ITextSelection */
4522 ITextSelection *me,
4523 REFIID riid,
4524 void **ppvObj)
4525{
4527
4528 *ppvObj = NULL;
4531 || IsEqualGUID(riid, &IID_ITextRange)
4532 || IsEqualGUID(riid, &IID_ITextSelection))
4533 {
4534 *ppvObj = me;
4535 ITextSelection_AddRef(me);
4536 return S_OK;
4537 }
4538 else if (IsEqualGUID(riid, &IID_Igetrichole))
4539 {
4540 *ppvObj = This->services;
4541 return S_OK;
4542 }
4543
4544 return E_NOINTERFACE;
4545}
4546
4548{
4550 return InterlockedIncrement(&This->ref);
4551}
4552
4554{
4557 if (ref == 0)
4558 heap_free(This);
4559 return ref;
4560}
4561
4563{
4565 TRACE("(%p)->(%p)\n", This, pctinfo);
4566 *pctinfo = 1;
4567 return S_OK;
4568}
4569
4571 ITypeInfo **ppTInfo)
4572{
4574 HRESULT hr;
4575
4576 TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
4577
4579 if (SUCCEEDED(hr))
4580 ITypeInfo_AddRef(*ppTInfo);
4581 return hr;
4582}
4583
4585 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
4586{
4588 ITypeInfo *ti;
4589 HRESULT hr;
4590
4591 TRACE("(%p)->(%s, %p, %u, %d, %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid,
4592 rgDispId);
4593
4595 if (SUCCEEDED(hr))
4596 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
4597 return hr;
4598}
4599
4601 ITextSelection *me,
4602 DISPID dispIdMember,
4603 REFIID riid,
4604 LCID lcid,
4605 WORD wFlags,
4606 DISPPARAMS *pDispParams,
4607 VARIANT *pVarResult,
4608 EXCEPINFO *pExcepInfo,
4609 UINT *puArgErr)
4610{
4612 ITypeInfo *ti;
4613 HRESULT hr;
4614
4615 TRACE("(%p)->(%d, %s, %d, %u, %p, %p, %p, %p)\n", This, dispIdMember, debugstr_guid(riid), lcid,
4616 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4617
4619 if (SUCCEEDED(hr))
4620 hr = ITypeInfo_Invoke(ti, me, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4621 return hr;
4622}
4623
4624/*** ITextRange methods ***/
4626{
4628 ME_Cursor *start = NULL, *end = NULL;
4629 int nChars, endOfs;
4630 BOOL bEOP;
4631
4632 TRACE("(%p)->(%p)\n", This, pbstr);
4633
4634 if (!This->services)
4635 return CO_E_RELEASED;
4636
4637 if (!pbstr)
4638 return E_INVALIDARG;
4639
4640 ME_GetSelection(This->services->editor, &start, &end);
4641 endOfs = ME_GetCursorOfs(end);
4642 nChars = endOfs - ME_GetCursorOfs(start);
4643 if (!nChars)
4644 {
4645 *pbstr = NULL;
4646 return S_OK;
4647 }
4648
4649 *pbstr = SysAllocStringLen(NULL, nChars);
4650 if (!*pbstr)
4651 return E_OUTOFMEMORY;
4652
4653 bEOP = (!para_next( para_next( end->para ) ) && endOfs > ME_GetTextLength(This->services->editor));
4654 ME_GetTextW(This->services->editor, *pbstr, nChars, start, nChars, FALSE, bEOP);
4655 TRACE("%s\n", wine_dbgstr_w(*pbstr));
4656
4657 return S_OK;
4658}
4659
4661{
4663 ME_TextEditor *editor;
4664 int len, to, from;
4665
4666 TRACE("(%p)->(%s)\n", This, debugstr_w(str));
4667
4668 if (!This->services)
4669 return CO_E_RELEASED;
4670
4671 editor = This->services->editor;
4672 len = lstrlenW(str);
4673 ME_GetSelectionOfs(editor, &from, &to);
4674 ME_ReplaceSel(editor, FALSE, str, len);
4675
4676 if (len < to - from)
4678
4679 return S_OK;
4680}
4681
4683{
4685 ME_Cursor *start = NULL, *end = NULL;
4686
4687 TRACE("(%p)->(%p)\n", This, pch);
4688
4689 if (!This->services)
4690 return CO_E_RELEASED;
4691
4692 if (!pch)
4693 return E_INVALIDARG;
4694
4695 ME_GetSelection(This->services->editor, &start, &end);
4696 return range_GetChar(This->services->editor, start, pch);
4697}
4698
4700{
4702
4703 FIXME("(%p)->(%x): stub\n", This, ch);
4704
4705 if (!This->services)
4706 return CO_E_RELEASED;
4707
4708 return E_NOTIMPL;
4709}
4710
4712{
4714 LONG start, end;
4715
4716 TRACE("(%p)->(%p)\n", This, range);
4717
4718 if (!This->services)
4719 return CO_E_RELEASED;
4720
4721 if (!range)
4722 return E_INVALIDARG;
4723
4724 ITextSelection_GetStart(me, &start);
4725 ITextSelection_GetEnd(me, &end);
4726 return CreateITextRange(This->services, start, end, range);
4727}
4728
4730{
4732
4733 FIXME("(%p)->(%p): stub\n", This, range);
4734
4735 if (!This->services)
4736 return CO_E_RELEASED;
4737
4738 return E_NOTIMPL;
4739}
4740
4742{
4744
4745 FIXME("(%p)->(%p): stub\n", This, range);
4746
4747 if (!This->services)
4748 return CO_E_RELEASED;
4749
4750 FIXME("not implemented\n");
4751 return E_NOTIMPL;
4752}
4753
4755{
4757 LONG lim;
4758
4759 TRACE("(%p)->(%p)\n", This, pcpFirst);
4760
4761 if (!This->services)
4762 return CO_E_RELEASED;
4763
4764 if (!pcpFirst)
4765 return E_INVALIDARG;
4766 ME_GetSelectionOfs(This->services->editor, pcpFirst, &lim);
4767 return S_OK;
4768}
4769
4771{
4773 LONG start, end;
4774 HRESULT hr;
4775
4776 TRACE("(%p)->(%d)\n", This, value);
4777
4778 if (!This->services)
4779 return CO_E_RELEASED;
4780
4781 ME_GetSelectionOfs(This->services->editor, &start, &end);
4782 hr = textrange_setstart(This->services, value, &start, &end);
4783 if (hr == S_OK)
4784 set_selection(This->services->editor, start, end);
4785
4786 return hr;
4787}
4788
4790{
4792 LONG first;
4793
4794 TRACE("(%p)->(%p)\n", This, pcpLim);
4795
4796 if (!This->services)
4797 return CO_E_RELEASED;
4798
4799 if (!pcpLim)
4800 return E_INVALIDARG;
4801 ME_GetSelectionOfs(This->services->editor, &first, pcpLim);
4802 return S_OK;
4803}
4804
4806{
4808 LONG start, end;
4809 HRESULT hr;
4810
4811 TRACE("(%p)->(%d)\n", This, value);
4812
4813 if (!This->services)
4814 return CO_E_RELEASED;
4815
4816 ME_GetSelectionOfs(This->services->editor, &start, &end);
4817 hr = textrange_setend(This->services, value, &start, &end);
4818 if (hr == S_OK)
4819 set_selection(This->services->editor, start, end);
4820
4821 return hr;
4822}
4823
4825{
4828 HRESULT hr;
4829
4830 TRACE("(%p)->(%p)\n", This, font);
4831
4832 if (!This->services)
4833 return CO_E_RELEASED;
4834
4835 if (!font)
4836 return E_INVALIDARG;
4837
4838 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
4840 ITextRange_Release(range);
4841 return hr;
4842}
4843
4845{
4848
4849 TRACE("(%p)->(%p)\n", This, font);
4850
4851 if (!font)
4852 return E_INVALIDARG;
4853
4854 if (!This->services)
4855 return CO_E_RELEASED;
4856
4857 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
4859 ITextRange_Release(range);
4860 return S_OK;
4861}
4862
4864{
4867 HRESULT hr;
4868
4869 TRACE("(%p)->(%p)\n", This, para);
4870
4871 if (!This->services)
4872 return CO_E_RELEASED;
4873
4874 if (!para)
4875 return E_INVALIDARG;
4876
4877 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
4878 hr = create_textpara(range, para);
4879 ITextRange_Release(range);
4880 return hr;
4881}
4882
4884{
4886
4887 FIXME("(%p)->(%p): stub\n", This, para);
4888
4889 if (!This->services)
4890 return CO_E_RELEASED;
4891
4892 FIXME("not implemented\n");
4893 return E_NOTIMPL;
4894}
4895
4897{
4899
4900 TRACE("(%p)->(%p)\n", This, length);
4901
4902 if (!This->services)
4903 return CO_E_RELEASED;
4904
4905 return textrange_get_storylength(This->services->editor, length);
4906}
4907
4909{
4911
4912 TRACE("(%p)->(%p)\n", This, value);
4913
4914 if (!This->services)
4915 return CO_E_RELEASED;
4916
4917 if (!value)
4918 return E_INVALIDARG;
4919
4921 return S_OK;
4922}
4923
4925{
4927 LONG start, end;
4928 HRESULT hres;
4929
4930 TRACE("(%p)->(%d)\n", This, bStart);
4931
4932 if (!This->services)
4933 return CO_E_RELEASED;
4934
4935 ME_GetSelectionOfs(This->services->editor, &start, &end);
4936 hres = range_Collapse(bStart, &start, &end);
4937 if (SUCCEEDED(hres))
4938 set_selection(This->services->editor, start, end);
4939 return hres;
4940}
4941
4943{
4946 HRESULT hr;
4947
4948 TRACE("(%p)->(%d %p)\n", This, unit, delta);
4949
4950 if (!This->services)
4951 return CO_E_RELEASED;
4952
4953 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
4954 hr = textrange_expand(range, unit, delta);
4955 ITextRange_Release(range);
4956 return hr;
4957}
4958
4960{
4962
4963 FIXME("(%p)->(%d %p): stub\n", This, unit, index);
4964
4965 if (!This->services)
4966 return CO_E_RELEASED;
4967
4968 return E_NOTIMPL;
4969}
4970
4972 LONG extend)
4973{
4975
4976 FIXME("(%p)->(%d %d %d): stub\n", This, unit, index, extend);
4977
4978 if (!This->services)
4979 return CO_E_RELEASED;
4980
4981 return E_NOTIMPL;
4982}
4983
4985{
4987
4988 FIXME("(%p)->(%d %d): stub\n", This, anchor, active);
4989
4990 if (!This->services)
4991 return CO_E_RELEASED;
4992
4993 return E_NOTIMPL;
4994}
4995
4997{
5000 LONG start, end;
5001
5002 TRACE("(%p)->(%p %p)\n", This, range, ret);
5003
5004 if (ret)
5005 *ret = tomFalse;
5006
5007 if (!This->services)
5008 return CO_E_RELEASED;
5009
5010 if (!range)
5011 return S_FALSE;
5012
5013 ITextRange_QueryInterface(range, &IID_ITextSelection, (void**)&selection);
5014 if (!selection)
5015 return S_FALSE;
5016 ITextSelection_Release(selection);
5017
5018 ITextSelection_GetStart(me, &start);
5019 ITextSelection_GetEnd(me, &end);
5020 return textrange_inrange(start, end, range, ret);
5021}
5022
5024{
5026
5027 FIXME("(%p)->(%p %p): stub\n", This, range, ret);
5028
5029 if (!This->services)
5030 return CO_E_RELEASED;
5031
5032 return E_NOTIMPL;
5033}
5034
5036{
5039 LONG start, end;
5040
5041 TRACE("(%p)->(%p %p)\n", This, range, ret);
5042
5043 if (ret)
5044 *ret = tomFalse;
5045
5046 if (!This->services)
5047 return CO_E_RELEASED;
5048
5049 if (!range)
5050 return S_FALSE;
5051
5052 ITextRange_QueryInterface(range, &IID_ITextSelection, (void**)&selection);
5053 if (!selection)
5054 return S_FALSE;
5055 ITextSelection_Release(selection);
5056
5057 ITextSelection_GetStart(me, &start);
5058 ITextSelection_GetEnd(me, &end);
5059 return textrange_isequal(start, end, range, ret);
5060}
5061
5063{
5065
5066 TRACE("(%p)\n", This);
5067
5068 if (!This->services)
5069 return CO_E_RELEASED;
5070
5071 /* nothing to do */
5072 return S_OK;
5073}
5074
5076 LONG *delta)
5077{
5080 HRESULT hr;
5081
5082 TRACE("(%p)->(%d %d %p)\n", This, unit, extend, delta);
5083
5084 if (!This->services)
5085 return CO_E_RELEASED;
5086
5087 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5088 hr = textrange_startof(range, unit, extend, delta);
5089 ITextRange_Release(range);
5090 return hr;
5091}
5092
5094 LONG *delta)
5095{
5098 HRESULT hr;
5099
5100 TRACE("(%p)->(%d %d %p)\n", This, unit, extend, delta);
5101
5102 if (!This->services)
5103 return CO_E_RELEASED;
5104
5105 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5106 hr = textrange_endof(range, This->services->editor, unit, extend, delta);
5107 ITextRange_Release(range);
5108 return hr;
5109}
5110
5112{
5115 HRESULT hr;
5116
5117 TRACE("(%p)->(%d %d %p)\n", This, unit, count, delta);
5118
5119 if (!This->services)
5120 return CO_E_RELEASED;
5121
5122 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5123 hr = textrange_movestart(range, This->services->editor, unit, count, delta);
5124 ITextRange_Release(range);
5125 return hr;
5126}
5127
5129 LONG *delta)
5130{
5133 HRESULT hr;
5134
5135 TRACE("(%p)->(%d %d %p)\n", This, unit, count, delta);
5136
5137 if (!This->services)
5138 return CO_E_RELEASED;
5139
5140 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5141 hr = textrange_movestart(range, This->services->editor, unit, count, delta);
5142 ITextRange_Release(range);
5143 return hr;
5144}
5145
5147 LONG *delta)
5148{
5151 HRESULT hr;
5152
5153 TRACE("(%p)->(%d %d %p)\n", This, unit, count, delta);
5154
5155 if (!This->services)
5156 return CO_E_RELEASED;
5157
5158 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5159 hr = textrange_moveend(range, This->services->editor, unit, count, delta);
5160 ITextRange_Release(range);
5161 return hr;
5162}
5163
5165 LONG *delta)
5166{
5168
5169 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
5170
5171 if (!This->services)
5172 return CO_E_RELEASED;
5173
5174 return E_NOTIMPL;
5175}
5176
5178 LONG *delta)
5179{
5181
5182 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
5183
5184 if (!This->services)
5185 return CO_E_RELEASED;
5186
5187 return E_NOTIMPL;
5188}
5189
5191 LONG *delta)
5192{
5194
5195 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
5196
5197 if (!This->services)
5198 return CO_E_RELEASED;
5199
5200 return E_NOTIMPL;
5201}
5202
5204 LONG *delta)
5205{
5207
5208 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
5209
5210 if (!This->services)
5211 return CO_E_RELEASED;
5212
5213 return E_NOTIMPL;
5214}
5215
5217 LONG *delta)
5218{
5220
5221 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
5222
5223 if (!This->services)
5224 return CO_E_RELEASED;
5225
5226 return E_NOTIMPL;
5227}
5228
5230 LONG *delta)
5231{
5233
5234 FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
5235
5236 if (!This->services)
5237 return CO_E_RELEASED;
5238
5239 return E_NOTIMPL;
5240}
5241
5243 LONG *length)
5244{
5246
5247 FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length);
5248
5249 if (!This->services)
5250 return CO_E_RELEASED;
5251
5252 FIXME("not implemented\n");
5253 return E_NOTIMPL;
5254}
5255
5258{
5260
5261 FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length);
5262
5263 if (!This->services)
5264 return CO_E_RELEASED;
5265
5266 return E_NOTIMPL;
5267}
5268
5271{
5273
5274 FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length);
5275
5276 if (!This->services)
5277 return CO_E_RELEASED;
5278
5279 return E_NOTIMPL;
5280}
5281
5283 LONG *delta)
5284{
5286
5287 FIXME("(%p)->(%d %d %p): stub\n", This, unit, count, delta);
5288
5289 if (!This->services)
5290 return CO_E_RELEASED;
5291
5292 return E_NOTIMPL;
5293}
5294
5296{
5299 HRESULT hr;
5300
5301 TRACE("(%p)->(%p): stub\n", This, v);
5302
5303 if (!This->services)
5304 return CO_E_RELEASED;
5305
5306 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5307 hr = textrange_copy_or_cut(range, This->services->editor, TRUE, v);
5308 ITextRange_Release(range);
5309 return hr;
5310}
5311
5313{
5316 HRESULT hr;
5317
5318 TRACE("(%p)->(%p)\n", This, v);
5319
5320 if (!This->services)
5321 return CO_E_RELEASED;
5322
5323 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5324 hr = textrange_copy_or_cut(range, This->services->editor, FALSE, v);
5325 ITextRange_Release(range);
5326 return hr;
5327}
5328
5330{
5332
5333 FIXME("(%p)->(%s %x): stub\n", This, debugstr_variant(v), format);
5334
5335 if (!This->services)
5336 return CO_E_RELEASED;
5337
5338 return E_NOTIMPL;
5339}
5340
5342 LONG *ret)
5343{
5345
5346 FIXME("(%p)->(%s %x %p): stub\n", This, debugstr_variant(v), format, ret);
5347
5348 if (!This->services)
5349 return CO_E_RELEASED;
5350
5351 return E_NOTIMPL;
5352}
5353
5355{
5357
5358 FIXME("(%p)->(%p): stub\n", This, ret);
5359
5360 if (!This->services)
5361 return CO_E_RELEASED;
5362
5363 return E_NOTIMPL;
5364}
5365
5367{
5369
5370 FIXME("(%p)->(%d): stub\n", This, type);
5371
5372 if (!This->services)
5373 return CO_E_RELEASED;
5374
5375 return E_NOTIMPL;
5376}
5377
5379{
5381
5382 FIXME("(%p)->(%d %p %p): stub\n", This, type, cx, cy);
5383
5384 if (!This->services)
5385 return CO_E_RELEASED;
5386
5387 return E_NOTIMPL;
5388}
5389
5391 LONG extend)
5392{
5394
5395 FIXME("(%p)->(%d %d %d %d): stub\n", This, x, y, type, extend);
5396
5397 if (!This->services)
5398 return CO_E_RELEASED;
5399
5400 return E_NOTIMPL;
5401}
5402
5404{
5406
5407 FIXME("(%p)->(%d): stub\n", This, value);
5408
5409 if (!This->services)
5410 return CO_E_RELEASED;
5411
5412 return E_NOTIMPL;
5413}
5414
5416{
5418
5419 FIXME("(%p)->(%p): stub\n", This, ppv);
5420
5421 if (!This->services)
5422 return CO_E_RELEASED;
5423
5424 return E_NOTIMPL;
5425}
5426
5427/*** ITextSelection methods ***/
5429{
5431
5432 FIXME("(%p)->(%p): stub\n", This, flags);
5433
5434 if (!This->services)
5435 return CO_E_RELEASED;
5436
5437 return E_NOTIMPL;
5438}
5439
5441{
5443
5444 FIXME("(%p)->(%x): stub\n", This, flags);
5445
5446 if (!This->services)
5447 return CO_E_RELEASED;
5448
5449 return E_NOTIMPL;
5450}
5451
5453{
5455
5456 FIXME("(%p)->(%p): stub\n", This, type);
5457
5458 if (!This->services)
5459 return CO_E_RELEASED;
5460
5461 return E_NOTIMPL;
5462}
5463
5465 LONG extend, LONG *delta)
5466{
5468
5469 FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta);
5470
5471 if (!This->services)
5472 return CO_E_RELEASED;
5473
5474 return E_NOTIMPL;
5475}
5476
5478 LONG extend, LONG *delta)
5479{
5481
5482 FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta);
5483
5484 if (!This->services)
5485 return CO_E_RELEASED;
5486
5487 return E_NOTIMPL;
5488}
5489
5491 LONG extend, LONG *delta)
5492{
5494
5495 FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta);
5496
5497 if (!This->services)
5498 return CO_E_RELEASED;
5499
5500 return E_NOTIMPL;
5501}
5502
5504 LONG extend, LONG *delta)
5505{
5507
5508 FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta);
5509
5510 if (!This->services)
5511 return CO_E_RELEASED;
5512
5513 return E_NOTIMPL;
5514}
5515
5517 LONG *delta)
5518{
5520
5521 FIXME("(%p)->(%d %d %p): stub\n", This, unit, extend, delta);
5522
5523 if (!This->services)
5524 return CO_E_RELEASED;
5525
5526 return E_NOTIMPL;
5527}
5528
5530 LONG *delta)
5531{
5533
5534 FIXME("(%p)->(%d %d %p): stub\n", This, unit, extend, delta);
5535
5536 if (!This->services)
5537 return CO_E_RELEASED;
5538
5539 return E_NOTIMPL;
5540}
5541
5543{
5545
5546 FIXME("(%p)->(%s): stub\n", This, debugstr_w(text));
5547
5548 if (!This->services)
5549 return CO_E_RELEASED;
5550
5551 return E_NOTIMPL;
5552}
5553
5554static const ITextSelectionVtbl tsvt = {
5623};
5624
5626{
5627 struct text_selection *txtSel = heap_alloc(sizeof *txtSel);
5628 if (!txtSel)
5629 return NULL;
5630
5631 txtSel->ITextSelection_iface.lpVtbl = &tsvt;
5632 txtSel->ref = 1;
5633 txtSel->services = services;
5634 return txtSel;
5635}
5636
5637static void convert_sizel(const ME_Context *c, const SIZEL* szl, SIZE* sz)
5638{
5639 /* sizel is in .01 millimeters, sz in pixels */
5640 sz->cx = MulDiv(szl->cx, c->dpi.cx, 2540);
5641 sz->cy = MulDiv(szl->cy, c->dpi.cy, 2540);
5642}
5643
5644/******************************************************************************
5645 * ME_GetOLEObjectSize
5646 *
5647 * Sets run extent for OLE objects.
5648 */
5649void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize)
5650{
5651 IDataObject* ido;
5652 FORMATETC fmt;
5653 STGMEDIUM stgm;
5654 DIBSECTION dibsect;
5655 ENHMETAHEADER emh;
5656
5657 assert(run->nFlags & MERF_GRAPHICS);
5658 assert(run->reobj);
5659
5660 if (run->reobj->obj.sizel.cx != 0 || run->reobj->obj.sizel.cy != 0)
5661 {
5662 convert_sizel(c, &run->reobj->obj.sizel, pSize);
5663 if (c->editor->nZoomNumerator != 0)
5664 {
5665 pSize->cx = MulDiv(pSize->cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5666 pSize->cy = MulDiv(pSize->cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5667 }
5668 return;
5669 }
5670
5671 if (!run->reobj->obj.poleobj)
5672 {
5673 pSize->cx = pSize->cy = 0;
5674 return;
5675 }
5676
5677 if (IOleObject_QueryInterface(run->reobj->obj.poleobj, &IID_IDataObject, (void**)&ido) != S_OK)
5678 {
5679 FIXME("Query Interface IID_IDataObject failed!\n");
5680 pSize->cx = pSize->cy = 0;
5681 return;
5682 }
5683 fmt.cfFormat = CF_BITMAP;
5684 fmt.ptd = NULL;
5685 fmt.dwAspect = DVASPECT_CONTENT;
5686 fmt.lindex = -1;
5687 fmt.tymed = TYMED_GDI;
5688 if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5689 {
5690 fmt.cfFormat = CF_ENHMETAFILE;
5691 fmt.tymed = TYMED_ENHMF;
5692 if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5693 {
5694 FIXME("unsupported format\n");
5695 pSize->cx = pSize->cy = 0;
5696 IDataObject_Release(ido);
5697 return;
5698 }
5699 }
5700 IDataObject_Release(ido);
5701
5702 switch (stgm.tymed)
5703 {
5704 case TYMED_GDI:
5705 GetObjectW(stgm.u.hBitmap, sizeof(dibsect), &dibsect);
5706 pSize->cx = dibsect.dsBm.bmWidth;
5707 pSize->cy = dibsect.dsBm.bmHeight;
5708 break;
5709 case TYMED_ENHMF:
5710 GetEnhMetaFileHeader(stgm.u.hEnhMetaFile, sizeof(emh), &emh);
5711 pSize->cx = emh.rclBounds.right - emh.rclBounds.left;
5712 pSize->cy = emh.rclBounds.bottom - emh.rclBounds.top;
5713 break;
5714 default:
5715 FIXME("Unsupported tymed %d\n", stgm.tymed);
5716 break;
5717 }
5718 ReleaseStgMedium(&stgm);
5719 if (c->editor->nZoomNumerator != 0)
5720 {
5721 pSize->cx = MulDiv(pSize->cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5722 pSize->cy = MulDiv(pSize->cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5723 }
5724}
5725
5726void draw_ole( ME_Context *c, int x, int y, ME_Run *run, BOOL selected )
5727{
5728 IDataObject* ido;
5729 FORMATETC fmt;
5730 STGMEDIUM stgm;
5731 DIBSECTION dibsect;
5732 ENHMETAHEADER emh;
5733 HDC hMemDC;
5734 SIZE sz;
5735 BOOL has_size;
5736 HBITMAP old_bm;
5737 RECT rc;
5738
5739 assert(run->nFlags & MERF_GRAPHICS);
5740 assert(run->reobj);
5741 if (IOleObject_QueryInterface(run->reobj->obj.poleobj, &IID_IDataObject, (void**)&ido) != S_OK)
5742 {
5743 FIXME("Couldn't get interface\n");
5744 return;
5745 }
5746 has_size = run->reobj->obj.sizel.cx != 0 || run->reobj->obj.sizel.cy != 0;
5747 fmt.cfFormat = CF_BITMAP;
5748 fmt.ptd = NULL;
5749 fmt.dwAspect = DVASPECT_CONTENT;
5750 fmt.lindex = -1;
5751 fmt.tymed = TYMED_GDI;
5752 if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5753 {
5754 fmt.cfFormat = CF_ENHMETAFILE;
5755 fmt.tymed = TYMED_ENHMF;
5756 if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5757 {
5758 FIXME("Couldn't get storage medium\n");
5759 IDataObject_Release(ido);
5760 return;
5761 }
5762 }
5763 IDataObject_Release(ido);
5764
5765 switch (stgm.tymed)
5766 {
5767 case TYMED_GDI:
5768 GetObjectW(stgm.u.hBitmap, sizeof(dibsect), &dibsect);
5769 hMemDC = CreateCompatibleDC(c->hDC);
5770 old_bm = SelectObject(hMemDC, stgm.u.hBitmap);
5771 if (has_size)
5772 {
5773 convert_sizel(c, &run->reobj->obj.sizel, &sz);
5774 } else {
5775 sz.cx = dibsect.dsBm.bmWidth;
5776 sz.cy = dibsect.dsBm.bmHeight;
5777 }
5778 if (c->editor->nZoomNumerator != 0)
5779 {
5780 sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5781 sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5782 }
5783 StretchBlt(c->hDC, x, y - sz.cy, sz.cx, sz.cy,
5784 hMemDC, 0, 0, dibsect.dsBm.bmWidth, dibsect.dsBm.bmHeight, SRCCOPY);
5785
5786 SelectObject(hMemDC, old_bm);
5787 DeleteDC(hMemDC);
5788 break;
5789 case TYMED_ENHMF:
5790 GetEnhMetaFileHeader(stgm.u.hEnhMetaFile, sizeof(emh), &emh);
5791 if (has_size)
5792 {
5793 convert_sizel(c, &run->reobj->obj.sizel, &sz);
5794 } else {
5795 sz.cx = emh.rclBounds.right - emh.rclBounds.left;
5796 sz.cy = emh.rclBounds.bottom - emh.rclBounds.top;
5797 }
5798 if (c->editor->nZoomNumerator != 0)
5799 {
5800 sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5801 sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5802 }
5803
5804 rc.left = x;
5805 rc.top = y - sz.cy;
5806 rc.right = x + sz.cx;
5807 rc.bottom = y;
5808 PlayEnhMetaFile(c->hDC, stgm.u.hEnhMetaFile, &rc);
5809 break;
5810 default:
5811 FIXME("Unsupported tymed %d\n", stgm.tymed);
5812 selected = FALSE;
5813 break;
5814 }
5815 ReleaseStgMedium(&stgm);
5816
5817 if (selected && !c->editor->bHideSelection)
5818 PatBlt(c->hDC, x, y - sz.cy, sz.cx, sz.cy, DSTINVERT);
5819}
5820
5821void ME_DeleteReObject(struct re_object *reobj)
5822{
5823 if (reobj->obj.poleobj) IOleObject_Release(reobj->obj.poleobj);
5824 if (reobj->obj.pstg) IStorage_Release(reobj->obj.pstg);
5825 if (reobj->obj.polesite) IOleClientSite_Release(reobj->obj.polesite);
5826 heap_free(reobj);
5827}
5828
5830{
5831 *dst = *src;
5832 dst->poleobj = NULL;
5833 dst->pstg = NULL;
5834 dst->polesite = NULL;
5835
5836 if ((flags & REO_GETOBJ_POLEOBJ) && src->poleobj)
5837 {
5838 dst->poleobj = src->poleobj;
5839 IOleObject_AddRef(dst->poleobj);
5840 }
5841 if ((flags & REO_GETOBJ_PSTG) && src->pstg)
5842 {
5843 dst->pstg = src->pstg;
5844 IStorage_AddRef(dst->pstg);
5845 }
5846 if ((flags & REO_GETOBJ_POLESITE) && src->polesite)
5847 {
5848 dst->polesite = src->polesite;
5849 IOleClientSite_AddRef(dst->polesite);
5850 }
5851}
5852
5854{
5857
5858 if (services->text_selection)
5859 {
5860 services->text_selection->services = NULL;
5861 ITextSelection_Release( &services->text_selection->ITextSelection_iface );
5862 }
5863
5864 LIST_FOR_EACH_ENTRY( range, &services->rangelist, ITextRangeImpl, child.entry )
5865 range->child.reole = NULL;
5866
5867 LIST_FOR_EACH_ENTRY( site, &services->clientsites, IOleClientSiteImpl, child.entry )
5868 site->child.reole = NULL;
5869}
small capitals from c petite p scientific f SUBSCRIPT
Definition: afcover.h:86
Arabic default style
Definition: afstyles.h:94
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define CF_BITMAP
Definition: constants.h:397
#define CF_ENHMETAFILE
Definition: constants.h:409
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
CFF_Charset charset
Definition: cffcmap.c:138
Definition: list.h:37
int selection
Definition: ctm.c:92
#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
static char selected[MAX_PATH+1]
Definition: dirdlg.c:7
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UINT op
Definition: effect.c:236
OLECHAR * BSTR
Definition: compat.h:2293
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_BYREF
Definition: compat.h:2342
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
LCID WINAPI GetSystemDefaultLCID(void)
Definition: locale.c:1230
const WCHAR * text
Definition: package.c:1794
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
HRESULT WINAPI LoadRegTypeLib(REFGUID rguid, WORD wVerMajor, WORD wVerMinor, LCID lcid, ITypeLib **ppTLib)
Definition: typelib.c:531
int ME_GetCursorOfs(const ME_Cursor *cursor)
Definition: caret.c:889
void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style)
Definition: caret.c:553
int ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs, BOOL final_eop)
Definition: caret.c:678
void ME_InsertOLEFromCursor(ME_TextEditor *editor, const REOBJECT *reo, int nCursor)
Definition: caret.c:503
int ME_GetSelection(ME_TextEditor *editor, ME_Cursor **from, ME_Cursor **to)
Definition: caret.c:57
BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start, int nChars, BOOL bForce)
Definition: caret.c:339
void cursor_coords(ME_TextEditor *editor, ME_Cursor *cursor, int *x, int *y, int *height)
Definition: caret.c:221
int ME_GetSelectionOfs(ME_TextEditor *editor, int *from, int *to)
Definition: caret.c:42
int ME_GetTextLength(ME_TextEditor *editor)
Definition: caret.c:83
HRESULT ME_GetDataObject(ME_TextEditor *editor, const ME_Cursor *start, int nChars, IDataObject **dataobj)
Definition: clipboard.c:404
void ME_ReplaceSel(ME_TextEditor *editor, BOOL can_undo, const WCHAR *str, int len)
Definition: editor.c:3161
HRESULT editor_copy_or_cut(ME_TextEditor *editor, BOOL cut, ME_Cursor *start, int count, IDataObject **data_out)
Definition: editor.c:2355
int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen, const ME_Cursor *start, int srcChars, BOOL bCRLF, BOOL bEOP)
Definition: editor.c:4310
static HRESULT WINAPI ITextRange_fnMoveStartUntil(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2423
static ITextParaVtbl textparavtbl
Definition: richole.c:3953
static HRESULT WINAPI ITextSelection_fnGetEnd(ITextSelection *me, LONG *pcpLim)
Definition: richole.c:4789
static HRESULT WINAPI IOleClientSite_fnGetContainer(IOleClientSite *iface, IOleContainer **ppContainer)
Definition: richole.c:1029
static HRESULT WINAPI TextPara_SetRightIndent(ITextPara *iface, FLOAT value)
Definition: richole.c:3855
static HRESULT textrange_get_storylength(ME_TextEditor *editor, LONG *length)
Definition: richole.c:283
static HRESULT WINAPI ITextRange_fnMoveWhile(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2371
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode)
Definition: richole.c:1116
static HRESULT WINAPI IRichEditOle_fnConvertObject(IRichEditOle *iface, LONG iob, REFCLSID class, LPCSTR user_type)
Definition: richole.c:948
static HRESULT WINAPI ITextSelection_fnGetFlags(ITextSelection *me, LONG *flags)
Definition: richole.c:5428
static HRESULT WINAPI TextPara_GetLineSpacingRule(ITextPara *iface, LONG *value)
Definition: richole.c:3743
static HRESULT WINAPI ITextSelection_fnMoveStart(ITextSelection *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:5128
static HRESULT WINAPI ITextRange_fnCollapse(ITextRange *me, LONG bStart)
Definition: richole.c:1889
static HRESULT WINAPI ITextSelection_fnStartOf(ITextSelection *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:5075
static HRESULT WINAPI ITextRange_fnGetStoryLength(ITextRange *me, LONG *length)
Definition: richole.c:1849
static HRESULT WINAPI TextFont_GetIDsOfNames(ITextFont *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: richole.c:2795
const IRichEditOleVtbl re_ole_vtbl
Definition: richole.c:1408
static HRESULT WINAPI ITextDocument2Old_fnGetFEFlags(ITextDocument2Old *iface, LONG *flags)
Definition: richole.c:4406
static HRESULT WINAPI ITextSelection_fnMoveDown(ITextSelection *me, LONG unit, LONG count, LONG extend, LONG *delta)
Definition: richole.c:5503
static HRESULT WINAPI ITextSelection_fnDelete(ITextSelection *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:5282
static HRESULT WINAPI ITextRange_fnGetEmbeddedObject(ITextRange *me, IUnknown **ppv)
Definition: richole.c:2654
static HRESULT get_textfont_prop_for_pos(const struct text_services *services, int pos, enum textfont_prop_id propid, textfont_prop_val *value)
Definition: richole.c:410
static HRESULT WINAPI ITextRange_fnScrollIntoView(ITextRange *me, LONG value)
Definition: richole.c:2622
static HRESULT WINAPI ITextDocument2Old_fnReleaseImmContext(ITextDocument2Old *iface, LONG context)
Definition: richole.c:4339
range_update_op
Definition: richole.c:204
@ RANGE_UPDATE_DELETE
Definition: richole.c:205
static HRESULT WINAPI ITextRange_fnMove(ITextRange *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2229
static HRESULT WINAPI TextPara_SetWidowControl(ITextPara *iface, LONG value)
Definition: richole.c:3911
static HRESULT WINAPI ITextRange_fnSetChar(ITextRange *me, LONG ch)
Definition: richole.c:1645
static HRESULT WINAPI ITextSelection_fnSelect(ITextSelection *me)
Definition: richole.c:5062
static HRESULT WINAPI TextFont_GetDuplicate(ITextFont *iface, ITextFont **ret)
Definition: richole.c:2835
static HRESULT WINAPI TextFont_GetSubscript(ITextFont *iface, LONG *value)
Definition: richole.c:3355
static HRESULT WINAPI ITextSelection_fnGetPara(ITextSelection *me, ITextPara **para)
Definition: richole.c:4863
static HRESULT WINAPI ITextRange_fnInStory(ITextRange *me, ITextRange *pRange, LONG *ret)
Definition: richole.c:2007
static HRESULT WINAPI TextFont_SetBold(ITextFont *iface, LONG value)
Definition: richole.c:3105
static HRESULT textrange_endof(ITextRange *range, ME_TextEditor *editor, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:2110
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnUIActivate(IOleInPlaceSite *iface)
Definition: richole.c:1137
static HRESULT get_textfont_prop(const ITextFontImpl *font, enum textfont_prop_id propid, textfont_prop_val *value)
Definition: richole.c:653
static HRESULT WINAPI TextFont_SetSuperscript(ITextFont *iface, LONG value)
Definition: richole.c:3376
static HRESULT WINAPI TextPara_GetTypeInfo(ITextPara *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: richole.c:3562
static HRESULT WINAPI TextPara_GetLeftIndent(ITextPara *iface, FLOAT *value)
Definition: richole.c:3729
static const ITextRangeVtbl trvt
Definition: richole.c:2666
static ITextFontVtbl textfontvtbl
Definition: richole.c:3411
static HRESULT WINAPI IRichEditOle_fnSaveCompleted(IRichEditOle *iface, LONG iob, LPSTORAGE lpstg)
Definition: richole.c:1376
static HRESULT WINAPI TextFont_SetShadow(ITextFont *iface, LONG value)
Definition: richole.c:3292
static HRESULT WINAPI ITextSelection_fnInRange(ITextSelection *me, ITextRange *range, LONG *ret)
Definition: richole.c:4996
static HRESULT WINAPI ITextSelection_fnChangeCase(ITextSelection *me, LONG type)
Definition: richole.c:5366
static HRESULT WINAPI ITextSelection_fnFindTextEnd(ITextSelection *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:5269
static HRESULT WINAPI TextPara_SetListLevelIndex(ITextPara *iface, LONG value)
Definition: richole.c:3771
static HRESULT WINAPI TextPara_GetTabCount(ITextPara *iface, LONG *value)
Definition: richole.c:3918
static HRESULT WINAPI ITextSelection_fnEndOf(ITextSelection *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:5093
static HRESULT WINAPI ITextRange_fnGetPara(ITextRange *me, ITextPara **para)
Definition: richole.c:1822
static HRESULT WINAPI ITextDocument2Old_fnGetImmContext(ITextDocument2Old *iface, LONG *context)
Definition: richole.c:4330
static const IOleInPlaceSiteVtbl olestvt
Definition: richole.c:1195
static HRESULT WINAPI TextFont_GetAnimation(ITextFont *iface, LONG *value)
Definition: richole.c:3065
static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnAddRef(IOleInPlaceSite *iface)
Definition: richole.c:1089
static HRESULT WINAPI ITextRange_fnChangeCase(ITextRange *me, LONG type)
Definition: richole.c:2585
static const ITextSelectionVtbl tsvt
Definition: richole.c:5554
static HRESULT WINAPI ITextDocument2Old_fnRange(ITextDocument2Old *iface, LONG cp1, LONG cp2, ITextRange **ppRange)
Definition: richole.c:4263
static HRESULT range_Collapse(LONG bStart, LONG *start, LONG *end)
Definition: richole.c:1877
static HRESULT WINAPI TextPara_SetListType(ITextPara *iface, LONG value)
Definition: richole.c:3813
static HRESULT WINAPI TextFont_GetStrikeThrough(ITextFont *iface, LONG *value)
Definition: richole.c:3341
static HRESULT WINAPI ITextDocument2Old_fnGetCaretType(ITextDocument2Old *iface, LONG *type)
Definition: richole.c:4312
static HRESULT WINAPI ITextSelection_fnSetPoint(ITextSelection *me, LONG x, LONG y, LONG type, LONG extend)
Definition: richole.c:5390
void richole_release_children(struct text_services *services)
Definition: richole.c:5853
static HRESULT WINAPI ITextRange_fnDelete(ITextRange *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2488
static HRESULT WINAPI ITextSelection_fnMoveEndWhile(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5190
static struct text_selection * text_selection_create(struct text_services *)
Definition: richole.c:5625
static HRESULT WINAPI ITextRange_fnGetPoint(ITextRange *me, LONG type, LONG *cx, LONG *cy)
Definition: richole.c:2597
static HRESULT WINAPI ITextSelection_fnSetEnd(ITextSelection *me, LONG value)
Definition: richole.c:4805
static HRESULT WINAPI ITextSelection_fnGetStoryType(ITextSelection *me, LONG *value)
Definition: richole.c:4908
static void textfont_reset_to_default(ITextFontImpl *font)
Definition: richole.c:2872
static HRESULT WINAPI TextPara_GetRightIndent(ITextPara *iface, FLOAT *value)
Definition: richole.c:3848
static HRESULT WINAPI ITextSelection_fnCut(ITextSelection *me, VARIANT *v)
Definition: richole.c:5295
static HRESULT WINAPI TextPara_QueryInterface(ITextPara *iface, REFIID riid, void **ppv)
Definition: richole.c:3511
static HRESULT WINAPI ITextDocument2Old_fnIMEInProgress(ITextDocument2Old *iface, LONG mode)
Definition: richole.c:4433
static HRESULT WINAPI ITextSelection_fnMoveStartWhile(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5177
static HRESULT WINAPI ITextRange_fnMoveStartWhile(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2384
static HRESULT WINAPI IRichEditOle_fnQueryInterface(IRichEditOle *iface, REFIID riid, LPVOID *ppvObj)
Definition: richole.c:911
static HRESULT WINAPI ITextSelection_fnScrollIntoView(ITextSelection *me, LONG value)
Definition: richole.c:5403
static HRESULT WINAPI ITextRange_fnMoveEnd(ITextRange *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2358
static HRESULT WINAPI ITextDocument2Old_fnOpen(ITextDocument2Old *iface, VARIANT *pVar, LONG Flags, LONG CodePage)
Definition: richole.c:4189
static HRESULT WINAPI TextPara_GetPageBreakBefore(ITextPara *iface, LONG *value)
Definition: richole.c:3834
static HRESULT WINAPI ITextSelection_fnGetType(ITextSelection *me, LONG *type)
Definition: richole.c:5452
static HRESULT WINAPI ITextSelection_fnCollapse(ITextSelection *me, LONG bStart)
Definition: richole.c:4924
static HRESULT WINAPI TextPara_SetListTab(ITextPara *iface, FLOAT value)
Definition: richole.c:3799
static IOleClientSiteImpl * impl_from_IOleInPlaceSite(IOleInPlaceSite *iface)
Definition: richole.c:254
#define CHARFORMAT_SET_B_FIELD(mask, value)
static const DWORD textfont_prop_masks[][2]
Definition: richole.c:171
static HRESULT WINAPI TextFont_GetLanguageID(ITextFont *iface, LONG *value)
Definition: richole.c:3196
static HRESULT WINAPI TextPara_GetListAlignment(ITextPara *iface, LONG *value)
Definition: richole.c:3750
static HRESULT WINAPI TextFont_SetAllCaps(ITextFont *iface, LONG value)
Definition: richole.c:3058
static HRESULT WINAPI TextFont_GetTypeInfo(ITextFont *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: richole.c:2781
static HRESULT WINAPI ITextDocument2Old_fnGetClientRect(ITextDocument2Old *iface, LONG type, LONG *left, LONG *top, LONG *right, LONG *bottom)
Definition: richole.c:4378
static HRESULT WINAPI ITextRange_fnMoveEndWhile(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2397
static HRESULT WINAPI TextFont_SetSmallCaps(ITextFont *iface, LONG value)
Definition: richole.c:3320
static HRESULT WINAPI ITextDocument2Old_fnSetEffectColor(ITextDocument2Old *iface, LONG index, COLORREF cr)
Definition: richole.c:4294
static HRESULT WINAPI ITextRange_fnFindText(ITextRange *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:2449
static void textrange_set_font(ITextRange *range, ITextFont *font)
Definition: richole.c:491
@ ITextSelection_tid
Definition: richole.c:61
@ LAST_tid
Definition: richole.c:64
@ ITextPara_tid
Definition: richole.c:63
@ NULL_tid
Definition: richole.c:58
@ ITextRange_tid
Definition: richole.c:60
@ ITextDocument_tid
Definition: richole.c:59
@ ITextFont_tid
Definition: richole.c:62
static BOOL is_equal_textfont_prop_value(enum textfont_prop_id propid, textfont_prop_val *left, textfont_prop_val *right)
Definition: richole.c:321
static HRESULT WINAPI ITextSelection_fnMoveEnd(ITextSelection *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:5146
static HRESULT textrange_inrange(LONG start, LONG end, ITextRange *range, LONG *ret)
Definition: richole.c:1974
static ITypeLib * typelib
Definition: richole.c:55
static HRESULT WINAPI IRichEditOle_fnGetClipboardData(IRichEditOle *iface, CHARRANGE *lpchrg, DWORD reco, LPDATAOBJECT *lplpdataobj)
Definition: richole.c:1245
static HRESULT WINAPI TextPara_SetDuplicate(ITextPara *iface, ITextPara *para)
Definition: richole.c:3624
static void init_textfont_prop_value(enum textfont_prop_id propid, textfont_prop_val *v)
Definition: richole.c:359
static HRESULT WINAPI TextFont_IsEqual(ITextFont *iface, ITextFont *font, LONG *ret)
Definition: richole.c:2865
static HRESULT WINAPI ITextDocument2Old_fnBeginEditCollection(ITextDocument2Old *iface)
Definition: richole.c:4219
static HRESULT WINAPI ITextDocument2Old_fnGetStoryRanges(ITextDocument2Old *iface, ITextStoryRanges **ppStories)
Definition: richole.c:4146
static HRESULT WINAPI IRichEditOle_fnGetClientSite(IRichEditOle *iface, IOleClientSite **clientsite)
Definition: richole.c:1232
static HRESULT WINAPI ITextRange_fnSelect(ITextRange *me)
Definition: richole.c:2052
static HRESULT textrange_startof(ITextRange *range, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:2065
static HRESULT WINAPI ITextRange_fnIsEqual(ITextRange *me, ITextRange *range, LONG *ret)
Definition: richole.c:2034
static HRESULT WINAPI TextFont_GetName(ITextFont *iface, BSTR *value)
Definition: richole.c:3210
static ULONG WINAPI ITextSelection_fnRelease(ITextSelection *me)
Definition: richole.c:4553
static HRESULT WINAPI ITextRange_fnEndOf(ITextRange *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:2150
static HRESULT WINAPI ITextRange_fnGetEnd(ITextRange *me, LONG *end)
Definition: richole.c:1746
static HRESULT WINAPI ITextSelection_fnPaste(ITextSelection *me, VARIANT *v, LONG format)
Definition: richole.c:5329
static HRESULT WINAPI TextFont_GetStyle(ITextFont *iface, LONG *value)
Definition: richole.c:3037
static HRESULT WINAPI TextPara_GetWidowControl(ITextPara *iface, LONG *value)
Definition: richole.c:3904
static ULONG WINAPI TextPara_Release(ITextPara *iface)
Definition: richole.c:3538
static HRESULT WINAPI ITextSelection_fnSetFlags(ITextSelection *me, LONG flags)
Definition: richole.c:5440
static HRESULT WINAPI ITextSelection_fnMoveUp(ITextSelection *me, LONG unit, LONG count, LONG extend, LONG *delta)
Definition: richole.c:5490
static HRESULT WINAPI TextPara_Reset(ITextPara *iface, LONG value)
Definition: richole.c:3645
static HRESULT WINAPI ITextDocument2Old_fnSysBeep(ITextDocument2Old *iface)
Definition: richole.c:4442
static HRESULT set_textfont_propl(ITextFontImpl *font, enum textfont_prop_id propid, LONG value)
Definition: richole.c:812
static ULONG WINAPI ITextRange_fnRelease(ITextRange *me)
Definition: richole.c:1460
static HRESULT WINAPI ITextSelection_fnGetTypeInfoCount(ITextSelection *me, UINT *pctinfo)
Definition: richole.c:4562
static HRESULT WINAPI ITextRange_fnGetFont(ITextRange *me, ITextFont **font)
Definition: richole.c:1791
static HRESULT WINAPI IRichEditOle_fnGetObject(IRichEditOle *iface, LONG iob, REOBJECT *lpreobject, DWORD dwFlags)
Definition: richole.c:1277
void ME_CopyReObject(REOBJECT *dst, const REOBJECT *src, DWORD flags)
Definition: richole.c:5829
static FLOAT twips_to_points(LONG value)
Definition: richole.c:400
static HRESULT WINAPI TextFont_GetSmallCaps(ITextFont *iface, LONG *value)
Definition: richole.c:3313
static HRESULT WINAPI ITextDocument2Old_fnCheckTextLimit(ITextDocument2Old *iface, LONG cch, LONG *exceed)
Definition: richole.c:4424
static ULONG WINAPI IOleClientSite_fnAddRef(IOleClientSite *iface)
Definition: richole.c:983
static HRESULT WINAPI TextPara_GetListTab(ITextPara *iface, FLOAT *value)
Definition: richole.c:3792
static HRESULT get_textfont_propl(const ITextFontImpl *font, enum textfont_prop_id propid, LONG *value)
Definition: richole.c:707
static HRESULT WINAPI ITextSelection_fnCanPaste(ITextSelection *me, VARIANT *v, LONG format, LONG *ret)
Definition: richole.c:5341
static HRESULT textfont_getname_from_range(ITextRange *range, BSTR *ret)
Definition: richole.c:854
static ULONG WINAPI ITextDocument2Old_fnAddRef(ITextDocument2Old *iface)
Definition: richole.c:4037
static HRESULT WINAPI ITextDocument2Old_fnUpdate(ITextDocument2Old *iface, LONG mode)
Definition: richole.c:4451
static ULONG WINAPI IRichEditOle_fnAddRef(IRichEditOle *iface)
Definition: richole.c:918
static HRESULT WINAPI TextPara_GetListLevelIndex(ITextPara *iface, LONG *value)
Definition: richole.c:3764
static HRESULT WINAPI TextFont_Invoke(ITextFont *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: richole.c:2811
static HRESULT textrange_isequal(LONG start, LONG end, ITextRange *range, LONG *ret)
Definition: richole.c:2019
static HRESULT WINAPI TextFont_Reset(ITextFont *iface, LONG value)
Definition: richole.c:2972
static HRESULT create_textpara(ITextRange *, ITextPara **)
Definition: richole.c:4011
static HRESULT WINAPI ITextDocument2Old_fnGetSelectionEx(ITextDocument2Old *iface, ITextSelection **selection)
Definition: richole.c:4388
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnDeactivateAndUndo(IOleInPlaceSite *iface)
Definition: richole.c:1181
static HRESULT get_textfont_propf(const ITextFontImpl *font, enum textfont_prop_id propid, FLOAT *value)
Definition: richole.c:694
static HRESULT WINAPI ITextSelection_fnSetStart(ITextSelection *me, LONG value)
Definition: richole.c:4770
static HRESULT WINAPI IOleClientSite_fnQueryInterface(IOleClientSite *me, REFIID riid, LPVOID *ppvObj)
Definition: richole.c:961
static HRESULT WINAPI ITextSelection_fnCanEdit(ITextSelection *me, LONG *ret)
Definition: richole.c:5354
static LONG WINAPI IRichEditOle_fnGetLinkCount(IRichEditOle *iface)
Definition: richole.c:1269
static HRESULT WINAPI TextFont_SetLanguageID(ITextFont *iface, LONG value)
Definition: richole.c:3203
static HRESULT WINAPI ITextDocument2Old_fnQueryInterface(ITextDocument2Old *iface, REFIID riid, void **ppvObject)
Definition: richole.c:4030
void draw_ole(ME_Context *c, int x, int y, ME_Run *run, BOOL selected)
Definition: richole.c:5726
static HRESULT WINAPI TextPara_GetHyphenation(ITextPara *iface, LONG *value)
Definition: richole.c:3680
static HRESULT WINAPI TextFont_SetUnderline(ITextFont *iface, LONG value)
Definition: richole.c:3390
static HRESULT WINAPI TextFont_SetForeColor(ITextFont *iface, LONG value)
Definition: richole.c:3133
static HRESULT WINAPI TextPara_GetTypeInfoCount(ITextPara *iface, UINT *pctinfo)
Definition: richole.c:3554
static FLOAT points_to_twips(FLOAT value)
Definition: richole.c:405
void ME_DeleteReObject(struct re_object *reobj)
Definition: richole.c:5821
static HRESULT textrange_copy_or_cut(ITextRange *range, ME_TextEditor *editor, BOOL cut, VARIANT *v)
Definition: richole.c:2500
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnUIDeactivate(IOleInPlaceSite *iface, BOOL fUndoable)
Definition: richole.c:1160
static HRESULT WINAPI ITextRange_fnSetStart(ITextRange *me, LONG value)
Definition: richole.c:1734
static LONG WINAPI IRichEditOle_fnGetObjectCount(IRichEditOle *iface)
Definition: richole.c:1326
static HRESULT WINAPI ITextRange_fnCanPaste(ITextRange *me, VARIANT *v, LONG format, LONG *ret)
Definition: richole.c:2561
static HRESULT WINAPI IOleClientSite_fnShowObject(IOleClientSite *iface)
Definition: richole.c:1040
static HRESULT WINAPI TextFont_GetBackColor(ITextFont *iface, LONG *value)
Definition: richole.c:3084
static HRESULT WINAPI ITextDocument2Old_fnNew(ITextDocument2Old *iface)
Definition: richole.c:4182
static HRESULT WINAPI ITextRange_fnInvoke(ITextRange *me, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: richole.c:1516
static HRESULT WINAPI TextPara_SetListStart(ITextPara *iface, LONG value)
Definition: richole.c:3785
static HRESULT WINAPI IOleClientSite_fnSaveObject(IOleClientSite *iface)
Definition: richole.c:1008
static HRESULT WINAPI ITextDocument2Old_fnEndEditCollection(ITextDocument2Old *iface)
Definition: richole.c:4226
static void textfont_apply_range_props(ITextFontImpl *font)
Definition: richole.c:2965
static HRESULT WINAPI ITextRange_fnGetStoryType(ITextRange *me, LONG *value)
Definition: richole.c:1861
static HRESULT range_GetChar(ME_TextEditor *editor, ME_Cursor *cursor, LONG *pch)
Definition: richole.c:1616
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnQueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppvObj)
Definition: richole.c:1083
static HRESULT WINAPI TextPara_GetKeepTogether(ITextPara *iface, LONG *value)
Definition: richole.c:3701
static HRESULT textrange_setend(const struct text_services *services, LONG value, LONG *start, LONG *end)
Definition: richole.c:1762
static HRESULT WINAPI TextFont_QueryInterface(ITextFont *iface, REFIID riid, void **ppv)
Definition: richole.c:2728
static HRESULT WINAPI ITextSelection_fnGetChar(ITextSelection *me, LONG *pch)
Definition: richole.c:4682
static HRESULT WINAPI TextFont_SetItalic(ITextFont *iface, LONG value)
Definition: richole.c:3175
static struct text_services * impl_from_ITextDocument2Old(ITextDocument2Old *iface)
Definition: richole.c:249
static HRESULT WINAPI ITextRange_fnSetText(ITextRange *me, BSTR str)
Definition: richole.c:1570
static const struct text_services * get_range_reole(ITextRange *range)
Definition: richole.c:484
static HRESULT WINAPI ITextSelection_fnMoveRight(ITextSelection *me, LONG unit, LONG count, LONG extend, LONG *delta)
Definition: richole.c:5477
static HRESULT WINAPI TextPara_SetSpaceBefore(ITextPara *iface, FLOAT value)
Definition: richole.c:3897
static HRESULT WINAPI ITextDocument2Old_fnGetWindow(ITextDocument2Old *iface, LONG *hwnd)
Definition: richole.c:4397
static HRESULT WINAPI TextFont_SetKerning(ITextFont *iface, FLOAT value)
Definition: richole.c:3189
static HRESULT WINAPI ITextDocument2Old_fnUpdateWindow(ITextDocument2Old *iface)
Definition: richole.c:4415
static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnRelease(IOleInPlaceSite *iface)
Definition: richole.c:1095
static HRESULT WINAPI TextPara_GetSpaceBefore(ITextPara *iface, FLOAT *value)
Definition: richole.c:3890
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnInPlaceDeactivate(IOleInPlaceSite *iface)
Definition: richole.c:1167
static HRESULT WINAPI TextFont_SetEmboss(ITextFont *iface, LONG value)
Definition: richole.c:3119
static HRESULT WINAPI ITextDocument2Old_fnRangeFromPoint(ITextDocument2Old *iface, LONG x, LONG y, ITextRange **ppRange)
Definition: richole.c:4276
static HRESULT WINAPI ITextSelection_fnMoveEndUntil(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5229
static HRESULT WINAPI ITextRange_fnGetFormattedText(ITextRange *me, ITextRange **range)
Definition: richole.c:1674
static HRESULT WINAPI ITextDocument2Old_fnGetTypeInfoCount(ITextDocument2Old *iface, UINT *pctinfo)
Definition: richole.c:4049
static HRESULT WINAPI ITextDocument2Old_fnGetStoryCount(ITextDocument2Old *iface, LONG *pCount)
Definition: richole.c:4139
static HRESULT WINAPI TextPara_SetHyphenation(ITextPara *iface, LONG value)
Definition: richole.c:3687
static HRESULT WINAPI ITextDocument2Old_fnSetSaved(ITextDocument2Old *iface, LONG Value)
Definition: richole.c:4161
static HRESULT WINAPI TextPara_GetIDsOfNames(ITextPara *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: richole.c:3576
static HRESULT WINAPI TextPara_IsEqual(ITextPara *iface, ITextPara *para, LONG *ret)
Definition: richole.c:3638
static HRESULT WINAPI ITextRange_fnFindTextEnd(ITextRange *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:2475
static HRESULT WINAPI ITextDocument2Old_fnAttachMsgFilter(ITextDocument2Old *iface, IUnknown *filter)
Definition: richole.c:4285
static HRESULT WINAPI TextPara_ClearAllTabs(ITextPara *iface)
Definition: richole.c:3932
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnDiscardUndoState(IOleInPlaceSite *iface)
Definition: richole.c:1174
static HRESULT WINAPI TextFont_GetSpacing(ITextFont *iface, FLOAT *value)
Definition: richole.c:3327
static HRESULT WINAPI ITextRange_fnExpand(ITextRange *me, LONG unit, LONG *delta)
Definition: richole.c:1901
static HRESULT CreateITextRange(struct text_services *services, LONG start, LONG end, ITextRange **ppRange)
Definition: richole.c:4247
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnGetWindowContext(IOleInPlaceSite *iface, IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
Definition: richole.c:1144
static HRESULT WINAPI ITextSelection_fnHomeKey(ITextSelection *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:5516
static HRESULT WINAPI TextPara_GetAlignment(ITextPara *iface, LONG *value)
Definition: richole.c:3666
static HRESULT WINAPI ITextDocument2Old_fnGetPreferredFont(ITextDocument2Old *iface, LONG cp, LONG charrep, LONG options, LONG current_charrep, LONG current_fontsize, BSTR *bstr, LONG *pitch_family, LONG *new_fontsize)
Definition: richole.c:4348
static HRESULT WINAPI TextFont_SetName(ITextFont *iface, BSTR value)
Definition: richole.c:3232
static HRESULT WINAPI ITextRange_fnCanEdit(ITextRange *me, LONG *ret)
Definition: richole.c:2573
static ULONG WINAPI ITextDocument2Old_fnRelease(ITextDocument2Old *iface)
Definition: richole.c:4043
static HRESULT WINAPI ITextRange_fnMoveUntil(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2410
static HRESULT WINAPI TextFont_SetSpacing(ITextFont *iface, FLOAT value)
Definition: richole.c:3334
static HRESULT WINAPI IRichEditOle_fnInsertObject(IRichEditOle *iface, REOBJECT *reo)
Definition: richole.c:1359
static HRESULT WINAPI ITextRange_fnGetText(ITextRange *me, BSTR *str)
Definition: richole.c:1534
textfont_prop_id
Definition: richole.c:142
@ FONT_SPACING
Definition: richole.c:161
@ FONT_UNDERLINE
Definition: richole.c:165
@ FONT_OUTLINE
Definition: richole.c:155
@ FONT_SIZE
Definition: richole.c:159
@ FONT_PROPID_LAST
Definition: richole.c:167
@ FONT_BACKCOLOR
Definition: richole.c:145
@ FONT_HIDDEN
Definition: richole.c:149
@ FONT_STRIKETHROUGH
Definition: richole.c:162
@ FONT_SUPERSCRIPT
Definition: richole.c:164
@ FONT_SMALLCAPS
Definition: richole.c:160
@ FONT_PROTECTED
Definition: richole.c:157
@ FONT_EMBOSS
Definition: richole.c:147
@ FONT_ALLCAPS
Definition: richole.c:143
@ FONT_ENGRAVE
Definition: richole.c:150
@ FONT_SUBSCRIPT
Definition: richole.c:163
@ FONT_BOLD
Definition: richole.c:146
@ FONT_LANGID
Definition: richole.c:153
@ FONT_PROPID_FIRST
Definition: richole.c:168
@ FONT_FORECOLOR
Definition: richole.c:148
@ FONT_POSITION
Definition: richole.c:156
@ FONT_NAME
Definition: richole.c:154
@ FONT_ANIMATION
Definition: richole.c:144
@ FONT_KERNING
Definition: richole.c:152
@ FONT_SHADOW
Definition: richole.c:158
@ FONT_WEIGHT
Definition: richole.c:166
@ FONT_ITALIC
Definition: richole.c:151
static HRESULT WINAPI ITextRange_fnPaste(ITextRange *me, VARIANT *v, LONG format)
Definition: richole.c:2549
static HRESULT WINAPI ITextRange_fnCut(ITextRange *me, VARIANT *v)
Definition: richole.c:2525
static HRESULT WINAPI TextPara_GetStyle(ITextPara *iface, LONG *value)
Definition: richole.c:3652
static HRESULT WINAPI ITextDocument2Old_fnGetSaved(ITextDocument2Old *iface, LONG *pValue)
Definition: richole.c:4154
static HRESULT WINAPI ITextSelection_fnGetDuplicate(ITextSelection *me, ITextRange **range)
Definition: richole.c:4711
static HRESULT WINAPI ITextRange_fnStartOf(ITextRange *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:2097
static HRESULT WINAPI ITextRange_fnCopy(ITextRange *me, VARIANT *v)
Definition: richole.c:2537
static HRESULT WINAPI TextFont_GetTypeInfoCount(ITextFont *iface, UINT *pctinfo)
Definition: richole.c:2773
static HRESULT WINAPI TextPara_SetPageBreakBefore(ITextPara *iface, LONG value)
Definition: richole.c:3841
static HRESULT WINAPI IOleClientSite_fnRequestNewObjectLayout(IOleClientSite *iface)
Definition: richole.c:1060
static HRESULT WINAPI ITextSelection_fnFindText(ITextSelection *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:5242
static HRESULT WINAPI ITextSelection_fnMoveStartUntil(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5216
static HRESULT WINAPI IRichEditOle_fnActivateAs(IRichEditOle *iface, REFCLSID rclsid, REFCLSID rclsidAs)
Definition: richole.c:932
static HRESULT WINAPI TextFont_GetOutline(ITextFont *iface, LONG *value)
Definition: richole.c:3243
static HRESULT WINAPI TextPara_SetAlignment(ITextPara *iface, LONG value)
Definition: richole.c:3673
static IOleClientSiteImpl * impl_from_IOleClientSite(IOleClientSite *iface)
Definition: richole.c:955
static HRESULT WINAPI IRichEditOle_fnSetHostNames(IRichEditOle *iface, LPCSTR lpstrContainerApp, LPCSTR lpstrContainerObj)
Definition: richole.c:1392
static HRESULT WINAPI ITextSelection_fnInvoke(ITextSelection *me, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: richole.c:4600
static HRESULT WINAPI ITextSelection_fnSetText(ITextSelection *me, BSTR str)
Definition: richole.c:4660
static HRESULT WINAPI ITextSelection_fnMove(ITextSelection *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:5111
static HRESULT WINAPI TextPara_GetNoLineNumber(ITextPara *iface, LONG *value)
Definition: richole.c:3820
static HRESULT WINAPI ITextSelection_fnSetChar(ITextSelection *me, LONG ch)
Definition: richole.c:4699
static HRESULT WINAPI ITextRange_fnGetStart(ITextRange *me, LONG *start)
Definition: richole.c:1698
static HRESULT WINAPI ITextDocument2Old_fnFreeze(ITextDocument2Old *iface, LONG *pCount)
Definition: richole.c:4205
void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize)
Definition: richole.c:5649
static HRESULT WINAPI ITextDocument2Old_fnGetDefaultTabStop(ITextDocument2Old *iface, float *pValue)
Definition: richole.c:4168
static HRESULT WINAPI ITextRange_fnGetTypeInfo(ITextRange *me, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: richole.c:1486
static HRESULT textrange_movestart(ITextRange *range, ME_TextEditor *editor, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2241
static HRESULT WINAPI ITextRange_fnMoveStart(ITextRange *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2284
static HRESULT WINAPI ITextDocument2Old_fnInvoke(ITextDocument2Old *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: richole.c:4089
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnScroll(IOleInPlaceSite *iface, SIZE scrollExtent)
Definition: richole.c:1153
static HRESULT WINAPI ITextSelection_fnSetIndex(ITextSelection *me, LONG unit, LONG index, LONG extend)
Definition: richole.c:4971
static HRESULT WINAPI TextPara_GetListType(ITextPara *iface, LONG *value)
Definition: richole.c:3806
static ULONG WINAPI ITextRange_fnAddRef(ITextRange *me)
Definition: richole.c:1454
static HRESULT WINAPI TextFont_GetEngrave(ITextFont *iface, LONG *value)
Definition: richole.c:3154
static HRESULT WINAPI TextFont_SetAnimation(ITextFont *iface, LONG value)
Definition: richole.c:3072
static HRESULT WINAPI ITextDocument2Old_fnRedo(ITextDocument2Old *iface, LONG Count, LONG *prop)
Definition: richole.c:4240
static HRESULT get_typeinfo(enum tid_t tid, ITypeInfo **typeinfo)
Definition: richole.c:108
static HRESULT WINAPI ITextDocument2Old_fnSave(ITextDocument2Old *iface, VARIANT *pVar, LONG Flags, LONG CodePage)
Definition: richole.c:4197
void release_typelib(void)
Definition: richole.c:94
static HRESULT WINAPI ITextRange_fnInRange(ITextRange *me, ITextRange *range, LONG *ret)
Definition: richole.c:1989
static HRESULT WINAPI ITextDocument2Old_fnGetTypeInfo(ITextDocument2Old *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: richole.c:4058
static HRESULT WINAPI TextFont_GetShadow(ITextFont *iface, LONG *value)
Definition: richole.c:3285
static HRESULT WINAPI ITextDocument2Old_fnGetIDsOfNames(ITextDocument2Old *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: richole.c:4072
const ITextDocument2OldVtbl text_doc2old_vtbl
Definition: richole.c:4469
static HRESULT WINAPI TextFont_GetAllCaps(ITextFont *iface, LONG *value)
Definition: richole.c:3051
static HRESULT WINAPI TextFont_SetEngrave(ITextFont *iface, LONG value)
Definition: richole.c:3161
static HRESULT WINAPI TextPara_SetStyle(ITextPara *iface, LONG value)
Definition: richole.c:3659
static HRESULT WINAPI IOleClientSite_fnOnShowWindow(IOleClientSite *iface, BOOL fShow)
Definition: richole.c:1050
static HRESULT load_typelib(void)
Definition: richole.c:78
static HRESULT WINAPI IRichEditOle_fnImportDataObject(IRichEditOle *iface, LPDATAOBJECT lpdataobj, CLIPFORMAT cf, HGLOBAL hMetaPict)
Definition: richole.c:1342
static HRESULT WINAPI ITextDocument2Old_fnSetNotificationMode(ITextDocument2Old *iface, LONG mode)
Definition: richole.c:4369
static HRESULT WINAPI TextFont_SetStyle(ITextFont *iface, LONG value)
Definition: richole.c:3044
static HRESULT WINAPI TextPara_SetSpaceAfter(ITextPara *iface, FLOAT value)
Definition: richole.c:3883
static HRESULT WINAPI ITextSelection_fnInStory(ITextSelection *me, ITextRange *range, LONG *ret)
Definition: richole.c:5023
static HRESULT WINAPI ITextSelection_fnGetStoryLength(ITextSelection *me, LONG *length)
Definition: richole.c:4896
static HRESULT WINAPI TextPara_SetNoLineNumber(ITextPara *iface, LONG value)
Definition: richole.c:3827
static HRESULT WINAPI TextFont_GetUnderline(ITextFont *iface, LONG *value)
Definition: richole.c:3383
static HRESULT WINAPI ITextSelection_fnTypeText(ITextSelection *me, BSTR text)
Definition: richole.c:5542
static HRESULT WINAPI TextPara_SetIndents(ITextPara *iface, FLOAT StartIndent, FLOAT LeftIndent, FLOAT RightIndent)
Definition: richole.c:3862
static HRESULT WINAPI ITextSelection_fnGetText(ITextSelection *me, BSTR *pbstr)
Definition: richole.c:4625
static HRESULT WINAPI ITextSelection_fnGetFormattedText(ITextSelection *me, ITextRange **range)
Definition: richole.c:4729
static HRESULT WINAPI TextPara_CanChange(ITextPara *iface, LONG *ret)
Definition: richole.c:3631
static HRESULT WINAPI TextFont_GetProtected(ITextFont *iface, LONG *value)
Definition: richole.c:3271
static HRESULT WINAPI ITextRange_fnSetPara(ITextRange *me, ITextPara *para)
Definition: richole.c:1837
static HRESULT WINAPI ITextSelection_fnSetRange(ITextSelection *me, LONG anchor, LONG active)
Definition: richole.c:4984
static HRESULT WINAPI TextFont_SetSubscript(ITextFont *iface, LONG value)
Definition: richole.c:3362
static HRESULT WINAPI ITextRange_fnSetFont(ITextRange *me, ITextFont *font)
Definition: richole.c:1806
static HRESULT WINAPI ITextSelection_fnQueryInterface(ITextSelection *me, REFIID riid, void **ppvObj)
Definition: richole.c:4521
static HRESULT WINAPI TextFont_GetBold(ITextFont *iface, LONG *value)
Definition: richole.c:3098
static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG anchor, LONG active)
Definition: richole.c:1956
static HRESULT WINAPI ITextSelection_fnGetStart(ITextSelection *me, LONG *pcpFirst)
Definition: richole.c:4754
static HRESULT WINAPI ITextDocument2Old_fnUnfreeze(ITextDocument2Old *iface, LONG *pCount)
Definition: richole.c:4212
static HRESULT WINAPI ITextRange_fnSetFormattedText(ITextRange *me, ITextRange *range)
Definition: richole.c:1686
static HRESULT WINAPI IRichEditOle_fnInPlaceDeactivate(IRichEditOle *iface)
Definition: richole.c:1351
static HRESULT WINAPI ITextSelection_fnGetFont(ITextSelection *me, ITextFont **font)
Definition: richole.c:4824
static HRESULT create_textfont(ITextRange *, const ITextFontImpl *, ITextFont **)
Definition: richole.c:3476
static HRESULT WINAPI ITextSelection_fnGetPoint(ITextSelection *me, LONG type, LONG *cx, LONG *cy)
Definition: richole.c:5378
static HRESULT WINAPI ITextDocument2Old_fnGetNotificationMode(ITextDocument2Old *iface, LONG *mode)
Definition: richole.c:4360
static HRESULT WINAPI TextPara_DeleteTab(ITextPara *iface, FLOAT pos)
Definition: richole.c:3939
static HRESULT WINAPI TextPara_SetKeepWithNext(ITextPara *iface, LONG value)
Definition: richole.c:3722
static ULONG WINAPI IOleClientSite_fnRelease(IOleClientSite *iface)
Definition: richole.c:991
static HRESULT WINAPI ITextSelection_fnFindTextStart(ITextSelection *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:5256
static HRESULT WINAPI IRichEditOle_fnSetDvaspect(IRichEditOle *iface, LONG iob, DWORD dvaspect)
Definition: richole.c:1385
static HRESULT set_textfont_prop(ITextFontImpl *font, enum textfont_prop_id propid, const textfont_prop_val *value)
Definition: richole.c:721
static ITextFontImpl * impl_from_ITextFont(ITextFont *iface)
Definition: richole.c:269
static HRESULT textrange_moveend(ITextRange *range, ME_TextEditor *editor, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2297
static HRESULT WINAPI ITextSelection_fnGetTypeInfo(ITextSelection *me, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: richole.c:4570
static HRESULT WINAPI TextPara_GetSpaceAfter(ITextPara *iface, FLOAT *value)
Definition: richole.c:3876
static HRESULT WINAPI TextPara_Invoke(ITextPara *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: richole.c:3592
static HRESULT WINAPI TextFont_SetOutline(ITextFont *iface, LONG value)
Definition: richole.c:3250
static HRESULT WINAPI TextFont_SetProtected(ITextFont *iface, LONG value)
Definition: richole.c:3278
static HRESULT WINAPI IRichEditOle_fnContextSensitiveHelp(IRichEditOle *iface, BOOL fEnterMode)
Definition: richole.c:940
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnPosRectChange(IOleInPlaceSite *iface, LPCRECT lprcPosRect)
Definition: richole.c:1188
static HRESULT WINAPI ITextRange_fnGetChar(ITextRange *me, LONG *pch)
Definition: richole.c:1626
static HRESULT WINAPI ITextSelection_fnGetEmbeddedObject(ITextSelection *me, IUnknown **ppv)
Definition: richole.c:5415
static HRESULT WINAPI TextPara_AddTab(ITextPara *iface, FLOAT tbPos, LONG tbAlign, LONG tbLeader)
Definition: richole.c:3925
static HRESULT WINAPI IOleClientSite_fnGetMoniker(IOleClientSite *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk)
Definition: richole.c:1018
static HRESULT WINAPI ITextDocument2Old_fnGetEffectColor(ITextDocument2Old *iface, LONG index, COLORREF *cr)
Definition: richole.c:4303
static ULONG WINAPI TextFont_Release(ITextFont *iface)
Definition: richole.c:2755
static HRESULT WINAPI ITextDocument2Old_fnGetName(ITextDocument2Old *iface, BSTR *pName)
Definition: richole.c:4108
static HRESULT WINAPI TextPara_SetListAlignment(ITextPara *iface, LONG value)
Definition: richole.c:3757
static HRESULT WINAPI TextFont_SetPosition(ITextFont *iface, FLOAT value)
Definition: richole.c:3264
static HRESULT WINAPI ITextSelection_fnSetPara(ITextSelection *me, ITextPara *para)
Definition: richole.c:4883
static ULONG WINAPI TextPara_AddRef(ITextPara *iface)
Definition: richole.c:3530
static HRESULT WINAPI TextFont_CanChange(ITextFont *iface, LONG *ret)
Definition: richole.c:2858
static HRESULT WINAPI TextFont_GetKerning(ITextFont *iface, FLOAT *value)
Definition: richole.c:3182
static HRESULT WINAPI ITextSelection_fnEndKey(ITextSelection *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:5529
static HRESULT WINAPI ITextDocument2Old_fnGetSelection(ITextDocument2Old *iface, ITextSelection **selection)
Definition: richole.c:4115
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnCanInPlaceActivate(IOleInPlaceSite *iface)
Definition: richole.c:1123
static void cp2range(ME_TextEditor *editor, LONG *cp1, LONG *cp2)
Definition: richole.c:1938
static ULONG WINAPI TextFont_AddRef(ITextFont *iface)
Definition: richole.c:2747
static HRESULT WINAPI ITextSelection_fnSetFont(ITextSelection *me, ITextFont *font)
Definition: richole.c:4844
static HRESULT WINAPI ITextRange_fnSetPoint(ITextRange *me, LONG x, LONG y, LONG type, LONG extend)
Definition: richole.c:2609
static void textfont_cache_range_props(ITextFontImpl *font)
Definition: richole.c:870
static void textranges_update_ranges(struct text_services *services, LONG start, LONG end, enum range_update_op op)
Definition: richole.c:292
static HRESULT WINAPI TextFont_GetHidden(ITextFont *iface, LONG *value)
Definition: richole.c:3140
static HRESULT WINAPI TextFont_GetForeColor(ITextFont *iface, LONG *value)
Definition: richole.c:3126
static HRESULT WINAPI TextPara_GetFirstLineIndent(ITextPara *iface, FLOAT *value)
Definition: richole.c:3694
static HRESULT WINAPI ITextRange_fnGetIDsOfNames(ITextRange *me, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: richole.c:1500
static HRESULT WINAPI TextPara_GetListStart(ITextPara *iface, LONG *value)
Definition: richole.c:3778
static HRESULT WINAPI TextFont_GetSize(ITextFont *iface, FLOAT *value)
Definition: richole.c:3299
static HRESULT WINAPI ITextDocument2Old_fnUndo(ITextDocument2Old *iface, LONG Count, LONG *prop)
Definition: richole.c:4233
static void convert_sizel(const ME_Context *c, const SIZEL *szl, SIZE *sz)
Definition: richole.c:5637
static HRESULT WINAPI TextFont_GetSuperscript(ITextFont *iface, LONG *value)
Definition: richole.c:3369
static HRESULT WINAPI ITextSelection_fnSetFormattedText(ITextSelection *me, ITextRange *range)
Definition: richole.c:4741
static HRESULT WINAPI TextFont_SetHidden(ITextFont *iface, LONG value)
Definition: richole.c:3147
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnGetWindow(IOleInPlaceSite *iface, HWND *window)
Definition: richole.c:1101
static HRESULT WINAPI TextFont_GetPosition(ITextFont *iface, FLOAT *value)
Definition: richole.c:3257
static const IID *const tid_ids[]
Definition: richole.c:67
static HRESULT WINAPI TextFont_GetWeight(ITextFont *iface, LONG *value)
Definition: richole.c:3397
static HRESULT WINAPI ITextSelection_fnMoveUntil(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5203
static HRESULT WINAPI ITextRange_fnGetTypeInfoCount(ITextRange *me, UINT *pctinfo)
Definition: richole.c:1478
static HRESULT WINAPI TextFont_SetBackColor(ITextFont *iface, LONG value)
Definition: richole.c:3091
static HRESULT WINAPI TextPara_GetLineSpacing(ITextPara *iface, FLOAT *value)
Definition: richole.c:3736
static struct text_services * impl_from_IRichEditOle(IRichEditOle *iface)
Definition: richole.c:244
static HRESULT WINAPI ITextSelection_fnExpand(ITextSelection *me, LONG unit, LONG *delta)
Definition: richole.c:4942
static HRESULT WINAPI ITextRange_fnFindTextStart(ITextRange *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:2462
static HRESULT WINAPI IRichEditOle_fnSetLinkAvailable(IRichEditOle *iface, LONG iob, BOOL fAvailable)
Definition: richole.c:1401
static HRESULT WINAPI TextFont_SetDuplicate(ITextFont *iface, ITextFont *pFont)
Definition: richole.c:2851
static HRESULT WINAPI TextPara_GetKeepWithNext(ITextPara *iface, LONG *value)
Definition: richole.c:3715
static HRESULT WINAPI TextFont_SetSize(ITextFont *iface, FLOAT value)
Definition: richole.c:3306
static HRESULT WINAPI ITextDocument2Old_fnSetCaretType(ITextDocument2Old *iface, LONG type)
Definition: richole.c:4321
static HRESULT set_textfont_propd(ITextFontImpl *font, enum textfont_prop_id propid, LONG value)
Definition: richole.c:826
static HRESULT WINAPI ITextRange_fnMoveEndUntil(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2436
static HRESULT WINAPI ITextSelection_fnMoveWhile(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5164
static HRESULT WINAPI TextPara_SetKeepTogether(ITextPara *iface, LONG value)
Definition: richole.c:3708
static void textfont_reset_to_undefined(ITextFontImpl *font)
Definition: richole.c:2923
static ULONG WINAPI ITextSelection_fnAddRef(ITextSelection *me)
Definition: richole.c:4547
static HRESULT WINAPI ITextSelection_fnMoveLeft(ITextSelection *me, LONG unit, LONG count, LONG extend, LONG *delta)
Definition: richole.c:5464
static HRESULT WINAPI TextFont_SetWeight(ITextFont *iface, LONG value)
Definition: richole.c:3404
static HRESULT WINAPI ITextSelection_fnGetIndex(ITextSelection *me, LONG unit, LONG *index)
Definition: richole.c:4959
static HRESULT WINAPI ITextDocument2Old_fnNotify(ITextDocument2Old *iface, LONG notify)
Definition: richole.c:4460
static HRESULT WINAPI IRichEditOle_fnHandsOffStorage(IRichEditOle *iface, LONG iob)
Definition: richole.c:1334
static struct text_selection * impl_from_ITextSelection(ITextSelection *iface)
Definition: richole.c:264
static HRESULT CreateOleClientSite(struct text_services *services, IOleClientSite **ret)
Definition: richole.c:1214
static HRESULT set_textfont_propf(ITextFontImpl *font, enum textfont_prop_id propid, FLOAT value)
Definition: richole.c:819
static HRESULT WINAPI ITextSelection_fnCopy(ITextSelection *me, VARIANT *v)
Definition: richole.c:5312
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnInPlaceActivate(IOleInPlaceSite *iface)
Definition: richole.c:1130
static HRESULT WINAPI ITextRange_fnSetEnd(ITextRange *me, LONG value)
Definition: richole.c:1779
static HRESULT WINAPI ITextDocument2Old_fnSetDefaultTabStop(ITextDocument2Old *iface, float Value)
Definition: richole.c:4175
static HRESULT WINAPI TextPara_GetTab(ITextPara *iface, LONG iTab, FLOAT *ptbPos, LONG *ptbAlign, LONG *ptbLeader)
Definition: richole.c:3946
static HRESULT WINAPI ITextSelection_fnIsEqual(ITextSelection *me, ITextRange *range, LONG *ret)
Definition: richole.c:5035
static ULONG WINAPI IRichEditOle_fnRelease(IRichEditOle *iface)
Definition: richole.c:925
static HRESULT textrange_expand(ITextRange *range, LONG unit, LONG *delta)
Definition: richole.c:881
static ITypeInfo * typeinfos[LAST_tid]
Definition: richole.c:76
static HRESULT WINAPI ITextRange_fnGetDuplicate(ITextRange *me, ITextRange **ppRange)
Definition: richole.c:1659
static HRESULT WINAPI ITextRange_fnQueryInterface(ITextRange *me, REFIID riid, void **ppvObj)
Definition: richole.c:1432
static HRESULT WINAPI ITextSelection_fnGetIDsOfNames(ITextSelection *me, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: richole.c:4584
static HRESULT WINAPI TextFont_SetStrikeThrough(ITextFont *iface, LONG value)
Definition: richole.c:3348
static HRESULT WINAPI TextFont_GetEmboss(ITextFont *iface, LONG *value)
Definition: richole.c:3112
static const IOleClientSiteVtbl ocst
Definition: richole.c:1070
static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG unit, LONG index, LONG extend)
Definition: richole.c:1925
static ITextParaImpl * impl_from_ITextPara(ITextPara *iface)
Definition: richole.c:274
static HRESULT WINAPI TextFont_GetItalic(ITextFont *iface, LONG *value)
Definition: richole.c:3168
static HRESULT WINAPI ITextRange_fnGetIndex(ITextRange *me, LONG unit, LONG *index)
Definition: richole.c:1913
static HRESULT WINAPI TextPara_SetLineSpacing(ITextPara *iface, LONG LineSpacingRule, FLOAT LineSpacing)
Definition: richole.c:3869
static HRESULT textrange_move(ITextRange *range, ME_TextEditor *editor, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2163
static ITextRangeImpl * impl_from_ITextRange(ITextRange *iface)
Definition: richole.c:259
static HRESULT WINAPI TextPara_GetDuplicate(ITextPara *iface, ITextPara **ret)
Definition: richole.c:3617
static HRESULT textrange_setstart(const struct text_services *services, LONG value, LONG *start, LONG *end)
Definition: richole.c:1714
#define assert(x)
Definition: debug.h:53
void ME_ReleaseStyle(ME_Style *item) DECLSPEC_HIDDEN
Definition: style.c:462
void cursor_from_char_ofs(ME_TextEditor *editor, int char_ofs, ME_Cursor *cursor) DECLSPEC_HIDDEN
Definition: run.c:240
ME_Style * style_get_insert_style(ME_TextEditor *editor, ME_Cursor *cursor) DECLSPEC_HIDDEN
Definition: style.c:476
ME_Paragraph * para_next(ME_Paragraph *para) DECLSPEC_HIDDEN
Definition: para.c:57
void ME_CommitUndo(ME_TextEditor *editor) DECLSPEC_HIDDEN
Definition: undo.c:227
void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now) DECLSPEC_HIDDEN
Definition: paint.c:129
#define ITextHost2_TxGetWindow(This, a)
Definition: editor.h:374
void ME_GetCharFormat(ME_TextEditor *editor, const ME_Cursor *from, const ME_Cursor *to, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
Definition: run.c:871
void ME_SetCharFormat(ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN
Definition: run.c:777
void scroll_abs(ME_TextEditor *editor, int x, int y, BOOL notify) DECLSPEC_HIDDEN
Definition: paint.c:1087
#define MERF_GRAPHICS
Definition: editstr.h:104
#define HIDDEN
Definition: fatfs.h:184
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
PWCHAR pValue
FxCollectionEntry * cur
GLuint start
Definition: gl.h:1545
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint GLuint end
Definition: gl.h:1545
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLenum src
Definition: glext.h:6340
const GLubyte * c
Definition: glext.h:8905
GLuint index
Definition: glext.h:6031
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLdouble GLdouble right
Definition: glext.h:10859
GLfloat f
Definition: glext.h:7540
GLenum GLint * range
Definition: glext.h:7539
GLenum mode
Definition: glext.h:6217
GLint left
Definition: glext.h:7726
GLenum GLenum dst
Definition: glext.h:6340
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
GLbitfield flags
Definition: glext.h:7161
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLint GLint bottom
Definition: glext.h:7726
const GLint * first
Definition: glext.h:5794
GLenum GLsizei len
Definition: glext.h:6722
GLuint id
Definition: glext.h:5910
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
const char cursor[]
Definition: icontest.c:13
tid_t
Definition: ieframe.h:311
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
#define f
Definition: ke_i.h:83
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
#define wine_dbgstr_w
Definition: kernel32.h:34
POINT cp
Definition: magnifier.c:59
#define pch(ap)
Definition: match.c:418
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static LPSTR pName
Definition: security.c:75
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
HRESULT hres
Definition: protocol.c:465
static TfClientId tid
static IHTMLWindow2 * window
Definition: events.c:77
static IActiveScriptSite * site
Definition: script.c:149
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
static HWND child
Definition: cursoricon.c:298
#define set_selection(hctl, start, end)
#define min(a, b)
Definition: monoChain.cc:55
int notify
Definition: msacm.c:1366
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
Definition: mk_font.cpp:20
unsigned int UINT
Definition: ndis.h:50
int Count
Definition: noreturn.cpp:7
#define LOCALE_SYSTEM_DEFAULT
#define L(x)
Definition: ntvdm.h:50
interface IStorage * LPSTORAGE
Definition: objfwd.h:30
interface IDataObject * LPDATAOBJECT
Definition: objfwd.h:21
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define V_UNKNOWNREF(A)
Definition: oleauto.h:282
#define V_VT(A)
Definition: oleauto.h:211
const GUID IID_IOleInPlaceSite
const GUID IID_IOleWindow
const GUID IID_IOleClientSite
const GUID IID_IDataObject
const GUID IID_IDispatch
long LONG
Definition: pedump.c:60
png_const_structrp png_const_inforp int * unit
Definition: png.h:2159
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define IID_NULL
Definition: guiddef.h:98
#define REFCLSID
Definition: guiddef.h:117
#define CFM_PROTECTED
Definition: richedit.h:336
#define CFE_SMALLCAPS
Definition: richedit.h:416
#define CFM_STRIKEOUT
Definition: richedit.h:335
#define CFM_SMALLCAPS
Definition: richedit.h:338
#define CFE_STRIKEOUT
Definition: richedit.h:409
#define CFE_OUTLINE
Definition: richedit.h:419
#define CFE_HIDDEN
Definition: richedit.h:418
#define CFE_BOLD
Definition: richedit.h:406
#define CFM_SHADOW
Definition: richedit.h:342
#define CFE_AUTOCOLOR
Definition: richedit.h:414
#define CFM_IMPRINT
Definition: richedit.h:344
#define CFM_OFFSET
Definition: richedit.h:359
#define CFE_ALLCAPS
Definition: richedit.h:417
#define CFM_WEIGHT
Definition: richedit.h:354
#define CFE_ITALIC
Definition: richedit.h:407
#define CFM_OUTLINE
Definition: richedit.h:341
#define CFE_SUPERSCRIPT
Definition: richedit.h:413
#define CFM_SPACING
Definition: richedit.h:353
#define CFM_EMBOSS
Definition: richedit.h:343
#define CFM_SUBSCRIPT
Definition: richedit.h:348
#define CFE_IMPRINT
Definition: richedit.h:422
#define CFM_HIDDEN
Definition: richedit.h:340
#define CFE_UNDERLINE
Definition: richedit.h:408
#define CFM_BACKCOLOR
Definition: richedit.h:357
#define CFE_SUBSCRIPT
Definition: richedit.h:412
#define CFM_KERNING
Definition: richedit.h:352
#define CFM_ITALIC
Definition: richedit.h:333
#define CFE_PROTECTED
Definition: richedit.h:410
#define CFM_LCID
Definition: richedit.h:356
#define CFM_SIZE
Definition: richedit.h:362
#define CFE_EMBOSS
Definition: richedit.h:421
#define CFE_AUTOBACKCOLOR
Definition: richedit.h:425
#define CFM_ANIMATION
Definition: richedit.h:350
#define CFM_BOLD
Definition: richedit.h:332
#define CFM_FACE
Definition: richedit.h:360
#define CFE_SHADOW
Definition: richedit.h:420
#define CFM_UNDERLINE
Definition: richedit.h:334
#define CFM_COLOR
Definition: richedit.h:361
#define CFM_ALLCAPS
Definition: richedit.h:339
#define CFM_SUPERSCRIPT
Definition: richedit.h:349
const WCHAR * str
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
DWORD LCID
Definition: nls.h:13
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:155
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define memset(x, y, z)
Definition: compat.h:39
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
CardRegion * from
Definition: spigame.cpp:19
struct reole_child child
Definition: richole.c:238
IOleClientSite IOleClientSite_iface
Definition: richole.c:239
IOleInPlaceSite IOleInPlaceSite_iface
Definition: richole.c:240
textfont_prop_val props[FONT_PROPID_LAST]
Definition: richole.c:225
ITextFont ITextFont_iface
Definition: richole.c:221
BOOL set_cache_enabled
Definition: richole.c:227
BOOL get_cache_enabled
Definition: richole.c:226
ITextRange * range
Definition: richole.c:224
ITextPara ITextPara_iface
Definition: richole.c:231
ITextRange * range
Definition: richole.c:234
ITextRange ITextRange_iface
Definition: richole.c:215
struct reole_child child
Definition: richole.c:214
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
LONG cpMax
Definition: richedit.h:501
LONG cpMin
Definition: richedit.h:500
LPSTORAGE pstg
Definition: richole.idl:62
LPOLEOBJECT poleobj
Definition: richole.idl:61
LPOLECLIENTSITE polesite
Definition: richole.idl:63
DWORD cbStruct
Definition: richole.idl:58
LONG cp
Definition: richole.idl:59
Definition: http.c:7252
Definition: dsound.c:943
Definition: format.c:58
REOBJECT obj
Definition: editstr.h:154
Definition: send.c:48
struct text_services * reole
Definition: richole.c:210
struct list entry
Definition: richole.c:209
IWbemServices * services
Definition: locator.c:1514
LONG bmHeight
Definition: wingdi.h:1423
LONG bmWidth
Definition: wingdi.h:1422
BITMAP dsBm
Definition: wingdi.h:1669
RECTL rclBounds
Definition: wingdi.h:2322
struct re_object * reobj
Definition: editstr.h:167
int nFlags
Definition: editstr.h:164
ME_Cursor * pCursors
Definition: editstr.h:389
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
ITextSelection ITextSelection_iface
Definition: editstr.h:470
struct text_services * services
Definition: editstr.h:473
ME_TextEditor * editor
Definition: editstr.h:484
ITextDocument2Old ITextDocument2Old_iface
Definition: editstr.h:481
IRichEditOle IRichEditOle_iface
Definition: editstr.h:480
#define max(a, b)
Definition: svc.c:63
EXTERN_C const IID IID_ITextServices
Definition: textserv.h:36
EXTERN_C const IID IID_ITextHost
Definition: textserv.h:37
EXTERN_C const IID IID_ITextHost2
Definition: textserv.h:38
@ tomUseTwips
Definition: tom.idl:46
@ tomAutoColor
Definition: tom.idl:32
@ tomApplyNow
Definition: tom.idl:38
@ tomAnimationMax
Definition: tom.idl:162
@ tomEnd
Definition: tom.idl:66
@ tomUnknownStory
Definition: tom.idl:139
@ tomStory
Definition: tom.idl:123
@ tomUsePoints
Definition: tom.idl:45
@ tomDefault
Definition: tom.idl:33
@ tomApplyLater
Definition: tom.idl:39
@ tomCharacter
Definition: tom.idl:118
@ tomMove
Definition: tom.idl:50
@ tomStart
Definition: tom.idl:67
@ tomCacheParms
Definition: tom.idl:41
@ tomTrue
Definition: tom.idl:29
@ tomToggle
Definition: tom.idl:31
@ tomFalse
Definition: tom.idl:28
@ tomTrackParms
Definition: tom.idl:40
@ tomUndefined
Definition: tom.idl:30
float FLOAT
Definition: typedefs.h:69
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define MAXLONG
Definition: umtypes.h:116
Definition: pdh_main.c:96
int ret
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
DWORD COLORREF
Definition: windef.h:300
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define STG_E_INVALIDPARAMETER
Definition: winerror.h:2580
#define CO_E_RELEASED
Definition: winerror.h:2818
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define SRCCOPY
Definition: wingdi.h:333
#define DSTINVERT
Definition: wingdi.h:327
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define FW_NORMAL
Definition: wingdi.h:373
UINT WINAPI GetEnhMetaFileHeader(_In_ HENHMETAFILE hemf, _In_ UINT nSize, _Out_writes_bytes_opt_(nSize) LPENHMETAHEADER lpEnhMetaHeader)
BOOL WINAPI DeleteDC(_In_ HDC)
BOOL WINAPI PlayEnhMetaFile(_In_ HDC, _In_ HENHMETAFILE, _In_ LPCRECT)
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_WINDOW
Definition: winuser.h:929
#define COLOR_WINDOWTEXT
Definition: winuser.h:932
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180