ReactOS 0.4.16-dev-1272-g2c12489
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 COBJMACROS
25
26#include "windef.h"
27#include "winbase.h"
28#include "wingdi.h"
29#include "winuser.h"
30#include "ole2.h"
31#include "richole.h"
32#include "editor.h"
33#include "richedit.h"
34#include "tom.h"
35#include "wine/debug.h"
36
38
39/* there is no way to be consistent across different sets of headers - mingw, Wine, Win32 SDK*/
40
41#include "initguid.h"
42
43DEFINE_GUID(LIBID_tom, 0x8cc497c9, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
44DEFINE_GUID(IID_ITextServices, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5);
45DEFINE_GUID(IID_ITextHost, 0x13e670f4,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
46DEFINE_GUID(IID_ITextHost2, 0x13e670f5,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
47DEFINE_GUID(IID_ITextDocument, 0x8cc497c0, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
48DEFINE_GUID(IID_ITextDocument2Old, 0x01c25500, 0x4268, 0x11d1, 0x88, 0x3a, 0x3c, 0x8b, 0x00, 0xc1, 0x00, 0x00);
49DEFINE_GUID(IID_ITextRange, 0x8cc497c2, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
50DEFINE_GUID(IID_ITextSelection, 0x8cc497c1, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
51DEFINE_GUID(IID_ITextFont, 0x8cc497c3, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
52DEFINE_GUID(IID_ITextPara, 0x8cc497c4, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
53
55
56enum tid_t {
64};
65
66static const IID * const tid_ids[] =
67{
68 &IID_NULL,
69 &IID_ITextDocument,
70 &IID_ITextRange,
71 &IID_ITextSelection,
72 &IID_ITextFont,
73 &IID_ITextPara,
74};
76
78{
79 ITypeLib *tl;
80 HRESULT hr;
81
82 hr = LoadRegTypeLib(&LIBID_tom, 1, 0, LOCALE_SYSTEM_DEFAULT, &tl);
83 if (FAILED(hr)) {
84 ERR("LoadRegTypeLib failed: %08lx\n", hr);
85 return hr;
86 }
87
89 ITypeLib_Release(tl);
90 return hr;
91}
92
94{
95 unsigned i;
96
97 if (!typelib)
98 return;
99
100 for (i = 0; i < ARRAY_SIZE(typeinfos); i++)
101 if (typeinfos[i])
102 ITypeInfo_Release(typeinfos[i]);
103
104 ITypeLib_Release(typelib);
105}
106
108{
109 HRESULT hr;
110
111 if (!typelib)
112 hr = load_typelib();
113 if (!typelib)
114 return hr;
115
116 if (!typeinfos[tid])
117 {
118 ITypeInfo *ti;
119
120 hr = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti);
121 if (FAILED(hr))
122 {
123 ERR("GetTypeInfoOfGuid(%s) failed: %08lx\n", debugstr_guid(tid_ids[tid]), hr);
124 return hr;
125 }
126
128 ITypeInfo_Release(ti);
129 }
130
132 return S_OK;
133}
134
135/* private IID used to get back IRichEditOleImpl pointer */
136DEFINE_GUID(IID_Igetrichole, 0xe3ce5c7a, 0x8247, 0x4622, 0x81, 0xad, 0x11, 0x81, 0x02, 0xaa, 0x01, 0x30);
137
140
169
170static const DWORD textfont_prop_masks[][2] = {
172 { CFM_ANIMATION },
174 { CFM_BOLD, CFE_BOLD },
180 { CFM_KERNING },
181 { CFM_LCID },
182 { CFM_FACE },
184 { CFM_OFFSET },
187 { CFM_SIZE },
189 { CFM_SPACING },
194 { CFM_WEIGHT }
195};
196
197typedef union {
202
206
208 struct list entry;
210};
211
217};
218
219typedef struct ITextFontImpl {
222
228
229typedef struct ITextParaImpl {
232
235
241};
242
243static inline struct text_services *impl_from_IRichEditOle( IRichEditOle *iface )
244{
245 return CONTAINING_RECORD( iface, struct text_services, IRichEditOle_iface );
246}
247
249{
251}
252
254{
255 return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleInPlaceSite_iface);
256}
257
259{
260 return CONTAINING_RECORD(iface, ITextRangeImpl, ITextRange_iface);
261}
262
264{
266}
267
269{
270 return CONTAINING_RECORD(iface, ITextFontImpl, ITextFont_iface);
271}
272
274{
275 return CONTAINING_RECORD(iface, ITextParaImpl, ITextPara_iface);
276}
277
280static struct text_selection *text_selection_create( struct text_services * );
281
283{
284 if (!length)
285 return E_INVALIDARG;
286
287 *length = ME_GetTextLength(editor) + 1;
288 return S_OK;
289}
290
292{
294
296 switch (op)
297 {
299 /* range fully covered by deleted range - collapse to insertion point */
300 if (range->start >= start && range->end <= end)
301 range->start = range->end = start;
302 /* deleted range cuts from the right */
303 else if (range->start < start && range->end <= end)
304 range->end = start;
305 /* deleted range cuts from the left */
306 else if (range->start >= start && range->end > end) {
307 range->start = start;
308 range->end -= end - start;
309 }
310 /* deleted range cuts within */
311 else
312 range->end -= end - start;
313 break;
314 default:
315 FIXME("unknown update op, %d\n", op);
316 }
317 }
318}
319
322{
323 switch (propid)
324 {
325 case FONT_ALLCAPS:
326 case FONT_ANIMATION:
327 case FONT_BACKCOLOR:
328 case FONT_BOLD:
329 case FONT_EMBOSS:
330 case FONT_FORECOLOR:
331 case FONT_HIDDEN:
332 case FONT_ENGRAVE:
333 case FONT_ITALIC:
334 case FONT_KERNING:
335 case FONT_LANGID:
336 case FONT_OUTLINE:
337 case FONT_PROTECTED:
338 case FONT_SHADOW:
339 case FONT_SMALLCAPS:
341 case FONT_SUBSCRIPT:
342 case FONT_SUPERSCRIPT:
343 case FONT_UNDERLINE:
344 case FONT_WEIGHT:
345 return left->l == right->l;
346 case FONT_NAME:
347 return !wcscmp(left->str, right->str);
348 case FONT_POSITION:
349 case FONT_SIZE:
350 case FONT_SPACING:
351 return left->f == right->f;
352 default:
353 FIXME("unhandled font property %d\n", propid);
354 return FALSE;
355 }
356}
357
359{
360 switch (propid)
361 {
362 case FONT_ALLCAPS:
363 case FONT_ANIMATION:
364 case FONT_BACKCOLOR:
365 case FONT_BOLD:
366 case FONT_EMBOSS:
367 case FONT_FORECOLOR:
368 case FONT_HIDDEN:
369 case FONT_ENGRAVE:
370 case FONT_ITALIC:
371 case FONT_KERNING:
372 case FONT_LANGID:
373 case FONT_OUTLINE:
374 case FONT_PROTECTED:
375 case FONT_SHADOW:
376 case FONT_SMALLCAPS:
378 case FONT_SUBSCRIPT:
379 case FONT_SUPERSCRIPT:
380 case FONT_UNDERLINE:
381 case FONT_WEIGHT:
382 v->l = tomUndefined;
383 return;
384 case FONT_NAME:
385 v->str = NULL;
386 return;
387 case FONT_POSITION:
388 case FONT_SIZE:
389 case FONT_SPACING:
390 v->f = tomUndefined;
391 return;
392 default:
393 FIXME("unhandled font property %d\n", propid);
394 v->l = tomUndefined;
395 return;
396 }
397}
398
400{
401 return value * 72.0 / 1440;
402}
403
405{
406 return value * 1440 / 72.0;
407}
408
411{
412 ME_Cursor from, to;
414
415 memset(&fmt, 0, sizeof(fmt));
416 fmt.cbSize = sizeof(fmt);
417 fmt.dwMask = textfont_prop_masks[propid][0];
418
420 to = from;
421 ME_MoveCursorChars( services->editor, &to, 1, FALSE );
422 ME_GetCharFormat( services->editor, &from, &to, &fmt );
423
424 switch (propid)
425 {
426 case FONT_ALLCAPS:
427 case FONT_BOLD:
428 case FONT_EMBOSS:
429 case FONT_HIDDEN:
430 case FONT_ENGRAVE:
431 case FONT_ITALIC:
432 case FONT_OUTLINE:
433 case FONT_PROTECTED:
434 case FONT_SHADOW:
435 case FONT_SMALLCAPS:
437 case FONT_SUBSCRIPT:
438 case FONT_SUPERSCRIPT:
439 case FONT_UNDERLINE:
440 value->l = fmt.dwEffects & textfont_prop_masks[propid][1] ? tomTrue : tomFalse;
441 break;
442 case FONT_ANIMATION:
443 value->l = fmt.bAnimation;
444 break;
445 case FONT_BACKCOLOR:
446 value->l = fmt.dwEffects & CFE_AUTOBACKCOLOR ? GetSysColor(COLOR_WINDOW) : fmt.crBackColor;
447 break;
448 case FONT_FORECOLOR:
449 value->l = fmt.dwEffects & CFE_AUTOCOLOR ? GetSysColor(COLOR_WINDOWTEXT) : fmt.crTextColor;
450 break;
451 case FONT_KERNING:
452 value->f = twips_to_points(fmt.wKerning);
453 break;
454 case FONT_LANGID:
455 value->l = fmt.lcid;
456 break;
457 case FONT_NAME:
458 /* this case is used exclusively by GetName() */
459 value->str = SysAllocString(fmt.szFaceName);
460 if (!value->str)
461 return E_OUTOFMEMORY;
462 break;
463 case FONT_POSITION:
464 value->f = twips_to_points(fmt.yOffset);
465 break;
466 case FONT_SIZE:
467 value->f = twips_to_points(fmt.yHeight);
468 break;
469 case FONT_SPACING:
470 value->f = fmt.sSpacing;
471 break;
472 case FONT_WEIGHT:
473 value->l = fmt.wWeight;
474 break;
475 default:
476 FIXME("unhandled font property %d\n", propid);
477 return E_FAIL;
478 }
479
480 return S_OK;
481}
482
483static inline const struct text_services *get_range_reole(ITextRange *range)
484{
485 struct text_services *services = NULL;
486 ITextRange_QueryInterface(range, &IID_Igetrichole, (void**)&services);
487 return services;
488}
489
491{
493 HRESULT hr;
494 LONG value;
495 BSTR str;
496 FLOAT f;
497
498#define CHARFORMAT_SET_B_FIELD(mask, value) \
499 if (hr == S_OK && value != tomUndefined) { \
500 fmt.dwMask |= CFM_##mask; \
501 if (value == tomTrue) fmt.dwEffects |= CFE_##mask; \
502 } \
503
504 /* fill format data from font */
505 memset(&fmt, 0, sizeof(fmt));
506 fmt.cbSize = sizeof(fmt);
507
509 hr = ITextFont_GetAllCaps(font, &value);
511
513 hr = ITextFont_GetBold(font, &value);
515
517 hr = ITextFont_GetEmboss(font, &value);
519
521 hr = ITextFont_GetHidden(font, &value);
523
525 hr = ITextFont_GetEngrave(font, &value);
527
529 hr = ITextFont_GetItalic(font, &value);
531
533 hr = ITextFont_GetOutline(font, &value);
535
537 hr = ITextFont_GetProtected(font, &value);
538 CHARFORMAT_SET_B_FIELD(PROTECTED, value);
539
541 hr = ITextFont_GetShadow(font, &value);
543
545 hr = ITextFont_GetSmallCaps(font, &value);
546 CHARFORMAT_SET_B_FIELD(SMALLCAPS, value);
547
549 hr = ITextFont_GetStrikeThrough(font, &value);
550 CHARFORMAT_SET_B_FIELD(STRIKEOUT, value);
551
553 hr = ITextFont_GetSubscript(font, &value);
555
557 hr = ITextFont_GetSuperscript(font, &value);
558 CHARFORMAT_SET_B_FIELD(SUPERSCRIPT, value);
559
561 hr = ITextFont_GetUnderline(font, &value);
562 CHARFORMAT_SET_B_FIELD(UNDERLINE, value);
563
564#undef CHARFORMAT_SET_B_FIELD
565
567 hr = ITextFont_GetAnimation(font, &value);
568 if (hr == S_OK && value != tomUndefined) {
569 fmt.dwMask |= CFM_ANIMATION;
570 fmt.bAnimation = value;
571 }
572
574 hr = ITextFont_GetBackColor(font, &value);
575 if (hr == S_OK && value != tomUndefined) {
576 fmt.dwMask |= CFM_BACKCOLOR;
577 if (value == tomAutoColor)
578 fmt.dwEffects |= CFE_AUTOBACKCOLOR;
579 else
580 fmt.crBackColor = value;
581 }
582
584 hr = ITextFont_GetForeColor(font, &value);
585 if (hr == S_OK && value != tomUndefined) {
586 fmt.dwMask |= CFM_COLOR;
587 if (value == tomAutoColor)
588 fmt.dwEffects |= CFE_AUTOCOLOR;
589 else
590 fmt.crTextColor = value;
591 }
592
594 hr = ITextFont_GetKerning(font, &f);
595 if (hr == S_OK && f != tomUndefined) {
596 fmt.dwMask |= CFM_KERNING;
597 fmt.wKerning = points_to_twips(f);
598 }
599
601 hr = ITextFont_GetLanguageID(font, &value);
602 if (hr == S_OK && value != tomUndefined) {
603 fmt.dwMask |= CFM_LCID;
604 fmt.lcid = value;
605 }
606
607 if (ITextFont_GetName(font, &str) == S_OK) {
608 fmt.dwMask |= CFM_FACE;
609 lstrcpynW(fmt.szFaceName, str, ARRAY_SIZE(fmt.szFaceName));
611 }
612
613 hr = ITextFont_GetPosition(font, &f);
614 if (hr == S_OK && f != tomUndefined) {
615 fmt.dwMask |= CFM_OFFSET;
616 fmt.yOffset = points_to_twips(f);
617 }
618
619 hr = ITextFont_GetSize(font, &f);
620 if (hr == S_OK && f != tomUndefined) {
621 fmt.dwMask |= CFM_SIZE;
622 fmt.yHeight = points_to_twips(f);
623 }
624
625 hr = ITextFont_GetSpacing(font, &f);
626 if (hr == S_OK && f != tomUndefined) {
627 fmt.dwMask |= CFM_SPACING;
628 fmt.sSpacing = f;
629 }
630
631 hr = ITextFont_GetWeight(font, &value);
632 if (hr == S_OK && value != tomUndefined) {
633 fmt.dwMask |= CFM_WEIGHT;
634 fmt.wWeight = value;
635 }
636
637 if (fmt.dwMask)
638 {
640 ME_Cursor from, to;
641 LONG start, end;
642
643 ITextRange_GetStart(range, &start);
644 ITextRange_GetEnd(range, &end);
645
647 cursor_from_char_ofs( services->editor, end, &to );
648 ME_SetCharFormat( services->editor, &from, &to, &fmt );
649 ME_CommitUndo( services->editor );
651 ME_UpdateScrollBar( services->editor );
652 }
653}
654
656{
657 const struct text_services *services;
659 LONG start, end, i;
660 HRESULT hr;
661
662 /* when font is not attached to any range use cached values */
663 if (!font->range || font->get_cache_enabled) {
664 *value = font->props[propid];
665 return S_OK;
666 }
667
668 if (!(services = get_range_reole(font->range)))
669 return CO_E_RELEASED;
670
672
673 ITextRange_GetStart(font->range, &start);
674 ITextRange_GetEnd(font->range, &end);
675
676 /* iterate trough a range to see if property value is consistent */
678 if (FAILED(hr))
679 return hr;
680
681 for (i = start + 1; i < end; i++) {
683
684 hr = get_textfont_prop_for_pos( services, i, propid, &cur );
685 if (FAILED(hr))
686 return hr;
687
688 if (!is_equal_textfont_prop_value(propid, &v, &cur))
689 return S_OK;
690 }
691
692 *value = v;
693 return S_OK;
694}
695
697{
699 HRESULT hr;
700
701 if (!value)
702 return E_INVALIDARG;
703
704 hr = get_textfont_prop(font, propid, &v);
705 *value = v.f;
706 return hr;
707}
708
710{
712 HRESULT hr;
713
714 if (!value)
715 return E_INVALIDARG;
716
717 hr = get_textfont_prop(font, propid, &v);
718 *value = v.l;
719 return hr;
720}
721
722/* Value should already have a terminal value, for boolean properties it means tomToggle is not handled */
724{
725 const struct text_services *services;
726 ME_Cursor from, to;
728 LONG start, end;
729
730 /* when font is not attached to any range use cache */
731 if (!font->range || font->set_cache_enabled) {
732 if (propid == FONT_NAME) {
733 SysFreeString(font->props[propid].str);
734 font->props[propid].str = SysAllocString(value->str);
735 }
736 else
737 font->props[propid] = *value;
738 return S_OK;
739 }
740
741 if (!(services = get_range_reole(font->range)))
742 return CO_E_RELEASED;
743
744 memset(&fmt, 0, sizeof(fmt));
745 fmt.cbSize = sizeof(fmt);
746 fmt.dwMask = textfont_prop_masks[propid][0];
747
748 switch (propid)
749 {
750 case FONT_ALLCAPS:
751 case FONT_BOLD:
752 case FONT_EMBOSS:
753 case FONT_HIDDEN:
754 case FONT_ENGRAVE:
755 case FONT_ITALIC:
756 case FONT_OUTLINE:
757 case FONT_PROTECTED:
758 case FONT_SHADOW:
759 case FONT_SMALLCAPS:
761 case FONT_SUBSCRIPT:
762 case FONT_SUPERSCRIPT:
763 case FONT_UNDERLINE:
764 fmt.dwEffects = value->l == tomTrue ? textfont_prop_masks[propid][1] : 0;
765 break;
766 case FONT_ANIMATION:
767 fmt.bAnimation = value->l;
768 break;
769 case FONT_BACKCOLOR:
770 case FONT_FORECOLOR:
771 if (value->l == tomAutoColor)
772 fmt.dwEffects = textfont_prop_masks[propid][1];
773 else if (propid == FONT_BACKCOLOR)
774 fmt.crBackColor = value->l;
775 else
776 fmt.crTextColor = value->l;
777 break;
778 case FONT_KERNING:
779 fmt.wKerning = value->f;
780 break;
781 case FONT_LANGID:
782 fmt.lcid = value->l;
783 break;
784 case FONT_POSITION:
785 fmt.yOffset = value->f;
786 break;
787 case FONT_SIZE:
788 fmt.yHeight = value->f;
789 break;
790 case FONT_SPACING:
791 fmt.sSpacing = value->f;
792 break;
793 case FONT_WEIGHT:
794 fmt.wWeight = value->l;
795 break;
796 case FONT_NAME:
797 lstrcpynW(fmt.szFaceName, value->str, ARRAY_SIZE(fmt.szFaceName));
798 break;
799 default:
800 FIXME("unhandled font property %d\n", propid);
801 return E_FAIL;
802 }
803
804 ITextRange_GetStart(font->range, &start);
805 ITextRange_GetEnd(font->range, &end);
806
808 cursor_from_char_ofs( services->editor, end, &to );
809 ME_SetCharFormat( services->editor, &from, &to, &fmt );
810 ME_CommitUndo( services->editor );
812 ME_UpdateScrollBar( services->editor );
813
814 return S_OK;
815}
816
818{
820 v.l = value;
821 return set_textfont_prop(font, propid, &v);
822}
823
825{
827 v.f = value;
828 return set_textfont_prop(font, propid, &v);
829}
830
832{
834
835 switch (value)
836 {
837 case tomUndefined:
838 return S_OK;
839 case tomToggle: {
840 LONG oldvalue;
841 get_textfont_propl(font, propid, &oldvalue);
842 if (oldvalue == tomFalse)
843 value = tomTrue;
844 else if (oldvalue == tomTrue)
845 value = tomFalse;
846 else
847 return E_INVALIDARG;
848 /* fallthrough */
849 }
850 case tomTrue:
851 case tomFalse:
852 v.l = value;
853 return set_textfont_prop(font, propid, &v);
854 default:
855 return E_INVALIDARG;
856 }
857}
858
860{
861 const struct text_services *services;
863 HRESULT hr;
864 LONG start;
865
866 if (!(services = get_range_reole( range )))
867 return CO_E_RELEASED;
868
869 ITextRange_GetStart(range, &start);
871 *ret = v.str;
872 return hr;
873}
874
876{
877 enum textfont_prop_id propid;
878 for (propid = FONT_PROPID_FIRST; propid < FONT_PROPID_LAST; propid++) {
879 if (propid == FONT_NAME)
880 textfont_getname_from_range(font->range, &font->props[propid].str);
881 else
882 get_textfont_prop(font, propid, &font->props[propid]);
883 }
884}
885
887{
888 LONG expand_start, expand_end;
889
890 switch (unit)
891 {
892 case tomStory:
893 expand_start = 0;
894 ITextRange_GetStoryLength(range, &expand_end);
895 break;
896 default:
897 FIXME("unit %ld is not supported\n", unit);
898 return E_NOTIMPL;
899 }
900
901 if (delta) {
902 LONG start, end;
903
904 ITextRange_GetStart(range, &start);
905 ITextRange_GetEnd(range, &end);
906 *delta = expand_end - expand_start - (end - start);
907 }
908
909 ITextRange_SetStart(range, expand_start);
910 ITextRange_SetEnd(range, expand_end);
911
912 return S_OK;
913}
914
915static HRESULT WINAPI
917{
919 return IUnknown_QueryInterface( services->outer_unk, riid, ppvObj );
920}
921
922static ULONG WINAPI
924{
926 return IUnknown_AddRef( services->outer_unk );
927}
928
929static ULONG WINAPI
931{
933 return IUnknown_Release( services->outer_unk );
934}
935
936static HRESULT WINAPI
938{
940 FIXME( "stub %p\n", services );
941 return E_NOTIMPL;
942}
943
944static HRESULT WINAPI
946{
948 FIXME( "stub %p\n", services );
949 return E_NOTIMPL;
950}
951
952static HRESULT WINAPI
954{
956 FIXME( "stub %p\n", services );
957 return E_NOTIMPL;
958}
959
961{
962 return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleClientSite_iface);
963}
964
965static HRESULT WINAPI
967{
969 TRACE("%p %s\n", me, debugstr_guid(riid) );
970
971 *ppvObj = NULL;
974 *ppvObj = me;
975 else if (IsEqualGUID(riid, &IID_IOleWindow) ||
977 *ppvObj = &This->IOleInPlaceSite_iface;
978 if (*ppvObj)
979 {
980 IOleClientSite_AddRef(me);
981 return S_OK;
982 }
983 FIXME("%p: unhandled interface %s\n", me, debugstr_guid(riid) );
984
985 return E_NOINTERFACE;
986}
987
989{
992 TRACE("(%p)->(%lu)\n", This, ref);
993 return ref;
994}
995
997{
1000
1001 TRACE("(%p)->(%lu)\n", This, ref);
1002
1003 if (ref == 0) {
1004 if (This->child.reole) {
1005 list_remove(&This->child.entry);
1006 This->child.reole = NULL;
1007 }
1008 free(This);
1009 }
1010 return ref;
1011}
1012
1014{
1016 if (!This->child.reole)
1017 return CO_E_RELEASED;
1018
1019 FIXME("stub %p\n", iface);
1020 return E_NOTIMPL;
1021}
1022
1024 DWORD dwWhichMoniker, IMoniker **ppmk)
1025{
1027 if (!This->child.reole)
1028 return CO_E_RELEASED;
1029
1030 FIXME("stub %p\n", iface);
1031 return E_NOTIMPL;
1032}
1033
1035 IOleContainer **ppContainer)
1036{
1038 if (!This->child.reole)
1039 return CO_E_RELEASED;
1040
1041 FIXME("stub %p\n", iface);
1042 return E_NOTIMPL;
1043}
1044
1046{
1048 if (!This->child.reole)
1049 return CO_E_RELEASED;
1050
1051 FIXME("stub %p\n", iface);
1052 return E_NOTIMPL;
1053}
1054
1056{
1058 if (!This->child.reole)
1059 return CO_E_RELEASED;
1060
1061 FIXME("stub %p\n", iface);
1062 return E_NOTIMPL;
1063}
1064
1066{
1068 if (!This->child.reole)
1069 return CO_E_RELEASED;
1070
1071 FIXME("stub %p\n", iface);
1072 return E_NOTIMPL;
1073}
1074
1075static const IOleClientSiteVtbl ocst = {
1085};
1086
1087/* IOleInPlaceSite interface */
1089{
1091 return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppvObj);
1092}
1093
1095{
1097 return IOleClientSite_AddRef(&This->IOleClientSite_iface);
1098}
1099
1101{
1103 return IOleClientSite_Release(&This->IOleClientSite_iface);
1104}
1105
1107{
1109
1110 TRACE( "(%p)->(%p)\n", This, window );
1111
1112 if (!This->child.reole)
1113 return CO_E_RELEASED;
1114
1115 if (!window) return E_INVALIDARG;
1116
1117 if (!This->child.reole->editor->have_texthost2) return E_NOTIMPL;
1118 return ITextHost2_TxGetWindow( This->child.reole->editor->texthost, window );
1119}
1120
1122{
1124 FIXME("not implemented: (%p)->(%d)\n", This, fEnterMode);
1125 return E_NOTIMPL;
1126}
1127
1129{
1131 FIXME("not implemented: (%p)\n", This);
1132 return E_NOTIMPL;
1133}
1134
1136{
1138 FIXME("not implemented: (%p)\n", This);
1139 return E_NOTIMPL;
1140}
1141
1143{
1145 FIXME("not implemented: (%p)\n", This);
1146 return E_NOTIMPL;
1147}
1148
1150 IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect,
1151 LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
1152{
1154 FIXME("not implemented: (%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect, lprcClipRect, lpFrameInfo);
1155 return E_NOTIMPL;
1156}
1157
1159{
1161 FIXME("not implemented: (%p)\n", This);
1162 return E_NOTIMPL;
1163}
1164
1166{
1168 FIXME("not implemented: (%p)->(%d)\n", This, fUndoable);
1169 return E_NOTIMPL;
1170}
1171
1173{
1175 FIXME("not implemented: (%p)\n", This);
1176 return E_NOTIMPL;
1177}
1178
1180{
1182 FIXME("not implemented: (%p)\n", This);
1183 return E_NOTIMPL;
1184}
1185
1187{
1189 FIXME("not implemented: (%p)\n", This);
1190 return E_NOTIMPL;
1191}
1192
1194{
1196 FIXME("not implemented: (%p)->(%p)\n", This, lprcPosRect);
1197 return E_NOTIMPL;
1198}
1199
1200static const IOleInPlaceSiteVtbl olestvt =
1201{
1217};
1218
1220{
1221 IOleClientSiteImpl *clientSite = malloc(sizeof *clientSite);
1222
1223 if (!clientSite)
1224 return E_OUTOFMEMORY;
1225
1226 clientSite->IOleClientSite_iface.lpVtbl = &ocst;
1227 clientSite->IOleInPlaceSite_iface.lpVtbl = &olestvt;
1228 clientSite->ref = 1;
1229 clientSite->child.reole = services;
1230 list_add_head( &services->clientsites, &clientSite->child.entry );
1231
1232 *ret = &clientSite->IOleClientSite_iface;
1233 return S_OK;
1234}
1235
1236static HRESULT WINAPI
1238{
1240
1241 TRACE("(%p)->(%p)\n", services, clientsite);
1242
1243 if (!clientsite)
1244 return E_INVALIDARG;
1245
1246 return CreateOleClientSite( services, clientsite );
1247}
1248
1249static HRESULT WINAPI
1251 DWORD reco, LPDATAOBJECT *lplpdataobj)
1252{
1255 int nChars;
1256
1257 TRACE("(%p,%p,%ld)\n", services, lpchrg, reco);
1258 if(!lplpdataobj)
1259 return E_INVALIDARG;
1260 if(!lpchrg)
1261 {
1262 LONG nFrom, nTo;
1263 int nStartCur = ME_GetSelectionOfs( services->editor, &nFrom, &nTo );
1264 start = services->editor->pCursors[nStartCur];
1265 nChars = nTo - nFrom;
1266 }
1267 else
1268 {
1269 cursor_from_char_ofs( services->editor, lpchrg->cpMin, &start );
1270 nChars = lpchrg->cpMax - lpchrg->cpMin;
1271 }
1272 return ME_GetDataObject( services->editor, &start, nChars, lplpdataobj );
1273}
1274
1276{
1278 FIXME("stub %p\n", services);
1279 return E_NOTIMPL;
1280}
1281
1282static HRESULT WINAPI
1284 REOBJECT *lpreobject, DWORD dwFlags)
1285{
1287 struct re_object *reobj = NULL;
1288 LONG count = 0;
1289
1290 TRACE("(%p)->(%lx, %p, %lx)\n", services, iob, lpreobject, dwFlags);
1291
1292 if (!lpreobject || !lpreobject->cbStruct)
1293 return E_INVALIDARG;
1294
1295 if (iob == REO_IOB_USE_CP)
1296 {
1298
1299 TRACE("character offset: %ld\n", lpreobject->cp);
1300 cursor_from_char_ofs( services->editor, lpreobject->cp, &cursor );
1301 if (!cursor.run->reobj)
1302 return E_INVALIDARG;
1303 else
1304 reobj = cursor.run->reobj;
1305 }
1306 else if (iob == REO_IOB_SELECTION)
1307 {
1308 ME_Cursor *from, *to;
1309
1310 ME_GetSelection(services->editor, &from, &to);
1311 if (!from->run->reobj)
1312 return E_INVALIDARG;
1313 else
1314 reobj = from->run->reobj;
1315 }
1316 else
1317 {
1318 if (iob < 0 || iob >= IRichEditOle_GetObjectCount( iface ))
1319 return E_INVALIDARG;
1320 LIST_FOR_EACH_ENTRY(reobj, &services->editor->reobj_list, struct re_object, entry)
1321 {
1322 if (count == iob)
1323 break;
1324 count++;
1325 }
1326 }
1327 ME_CopyReObject(lpreobject, &reobj->obj, dwFlags);
1328 lpreobject->cp = run_char_ofs( reobj->run, 0 );
1329 return S_OK;
1330}
1331
1332static LONG WINAPI
1334{
1336 TRACE("(%p)\n", services);
1337 return list_count( &services->editor->reobj_list );
1338}
1339
1340static HRESULT WINAPI
1342{
1344 FIXME("stub %p\n", services);
1345 return E_NOTIMPL;
1346}
1347
1348static HRESULT WINAPI
1350 CLIPFORMAT cf, HGLOBAL hMetaPict)
1351{
1353 FIXME("stub %p\n", services);
1354 return E_NOTIMPL;
1355}
1356
1357static HRESULT WINAPI
1359{
1361 FIXME("stub %p\n", services);
1362 return E_NOTIMPL;
1363}
1364
1365static HRESULT WINAPI
1367{
1369 HRESULT hr;
1370
1371 TRACE("(%p,%p)\n", services, reo);
1372
1373 if (!reo)
1374 return E_INVALIDARG;
1375
1376 if (reo->cbStruct < sizeof(*reo)) return STG_E_INVALIDPARAMETER;
1377
1378 hr = editor_insert_oleobj(services->editor, reo);
1379 if (hr != S_OK)
1380 return hr;
1381
1382 ME_CommitUndo(services->editor);
1384 return S_OK;
1385}
1386
1388 LPSTORAGE lpstg)
1389{
1391 FIXME("stub %p\n", services);
1392 return E_NOTIMPL;
1393}
1394
1395static HRESULT WINAPI
1397{
1399 FIXME("stub %p\n", services);
1400 return E_NOTIMPL;
1401}
1402
1404 LPCSTR lpstrContainerApp, LPCSTR lpstrContainerObj)
1405{
1407 FIXME("stub %p %s %s\n", services, lpstrContainerApp, lpstrContainerObj);
1408 return E_NOTIMPL;
1409}
1410
1411static HRESULT WINAPI
1413{
1415 FIXME("stub %p\n", services);
1416 return E_NOTIMPL;
1417}
1418
1419const IRichEditOleVtbl re_ole_vtbl =
1420{
1440};
1441
1442/* ITextRange interface */
1444{
1446
1447 *ppvObj = NULL;
1450 || IsEqualGUID(riid, &IID_ITextRange))
1451 {
1452 *ppvObj = me;
1453 ITextRange_AddRef(me);
1454 return S_OK;
1455 }
1456 else if (IsEqualGUID(riid, &IID_Igetrichole))
1457 {
1458 *ppvObj = This->child.reole;
1459 return S_OK;
1460 }
1461
1462 return E_NOINTERFACE;
1463}
1464
1466{
1468 return InterlockedIncrement(&This->ref);
1469}
1470
1472{
1475
1476 TRACE ("%p ref=%lu\n", This, ref);
1477 if (ref == 0)
1478 {
1479 if (This->child.reole)
1480 {
1481 list_remove(&This->child.entry);
1482 This->child.reole = NULL;
1483 }
1484 free(This);
1485 }
1486 return ref;
1487}
1488
1490{
1492 TRACE("(%p)->(%p)\n", This, pctinfo);
1493 *pctinfo = 1;
1494 return S_OK;
1495}
1496
1498 ITypeInfo **ppTInfo)
1499{
1501 HRESULT hr;
1502
1503 TRACE("(%p)->(%u,%ld,%p)\n", This, iTInfo, lcid, ppTInfo);
1504
1505 hr = get_typeinfo(ITextRange_tid, ppTInfo);
1506 if (SUCCEEDED(hr))
1507 ITypeInfo_AddRef(*ppTInfo);
1508 return hr;
1509}
1510
1512 UINT cNames, LCID lcid, DISPID *rgDispId)
1513{
1515 ITypeInfo *ti;
1516 HRESULT hr;
1517
1518 TRACE("(%p)->(%s, %p, %u, %ld, %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid,
1519 rgDispId);
1520
1522 if (SUCCEEDED(hr))
1523 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
1524 return hr;
1525}
1526
1528 LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1529 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
1530 UINT *puArgErr)
1531{
1533 ITypeInfo *ti;
1534 HRESULT hr;
1535
1536 TRACE("(%p)->(%ld, %s, %ld, %u, %p, %p, %p, %p)\n", This, dispIdMember, debugstr_guid(riid),
1537 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1538
1540 if (SUCCEEDED(hr))
1541 hr = ITypeInfo_Invoke(ti, me, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1542 return hr;
1543}
1544
1546{
1550 int length;
1551 BOOL bEOP;
1552
1553 TRACE("(%p)->(%p)\n", This, str);
1554
1555 if (!This->child.reole)
1556 return CO_E_RELEASED;
1557
1558 if (!str)
1559 return E_INVALIDARG;
1560
1561 /* return early for degenerate range */
1562 if (This->start == This->end) {
1563 *str = NULL;
1564 return S_OK;
1565 }
1566
1567 editor = This->child.reole->editor;
1570
1571 length = This->end - This->start;
1573 if (!*str)
1574 return E_OUTOFMEMORY;
1575
1576 bEOP = (!para_next( para_next( end.para )) && This->end > ME_GetTextLength(editor));
1578 return S_OK;
1579}
1580
1582{
1586 ME_Style *style;
1587 int len;
1588
1589 TRACE("(%p)->(%s)\n", This, debugstr_w(str));
1590
1591 if (!This->child.reole)
1592 return CO_E_RELEASED;
1593
1594 editor = This->child.reole->editor;
1595
1596 /* delete only where's something to delete */
1597 if (This->start != This->end)
1598 {
1600 ME_InternalDeleteText(editor, &cursor, This->end - This->start, FALSE);
1601 }
1602
1603 if (!str || !*str)
1604 {
1605 /* will update this range as well */
1606 textranges_update_ranges(This->child.reole, This->start, This->end, RANGE_UPDATE_DELETE);
1607 return S_OK;
1608 }
1609
1610 /* it's safer not to rely on stored BSTR length */
1611 len = lstrlenW(str);
1612 cursor = editor->pCursors[0];
1617 editor->pCursors[0] = cursor;
1618
1619 if (len < This->end - This->start)
1620 textranges_update_ranges(This->child.reole, This->start + len, This->end, RANGE_UPDATE_DELETE);
1621 else
1622 This->end = len - This->start;
1623
1624 return S_OK;
1625}
1626
1628{
1629 WCHAR wch[2];
1630
1631 ME_GetTextW(editor, wch, 1, cursor, 1, FALSE, !para_next( para_next( cursor->para ) ));
1632 *pch = wch[0];
1633
1634 return S_OK;
1635}
1636
1638{
1642
1643 TRACE("(%p)->(%p)\n", This, pch);
1644
1645 if (!This->child.reole)
1646 return CO_E_RELEASED;
1647
1648 if (!pch)
1649 return E_INVALIDARG;
1650
1651 editor = This->child.reole->editor;
1653 return range_GetChar(editor, &cursor, pch);
1654}
1655
1657{
1659
1660 FIXME("(%p)->(%lx): stub\n", This, ch);
1661
1662 if (!This->child.reole)
1663 return CO_E_RELEASED;
1664
1665 return E_NOTIMPL;
1666}
1667
1669
1671{
1673
1674 TRACE("(%p)->(%p)\n", This, ppRange);
1675
1676 if (!This->child.reole)
1677 return CO_E_RELEASED;
1678
1679 if (!ppRange)
1680 return E_INVALIDARG;
1681
1682 return CreateITextRange(This->child.reole, This->start, This->end, ppRange);
1683}
1684
1686{
1688
1689 FIXME("(%p)->(%p): stub\n", This, range);
1690
1691 if (!This->child.reole)
1692 return CO_E_RELEASED;
1693
1694 return E_NOTIMPL;
1695}
1696
1698{
1700
1701 FIXME("(%p)->(%p): stub\n", This, range);
1702
1703 if (!This->child.reole)
1704 return CO_E_RELEASED;
1705
1706 return E_NOTIMPL;
1707}
1708
1710{
1712
1713 TRACE("(%p)->(%p)\n", This, start);
1714
1715 if (!This->child.reole)
1716 return CO_E_RELEASED;
1717
1718 if (!start)
1719 return E_INVALIDARG;
1720
1721 *start = This->start;
1722 return S_OK;
1723}
1724
1726{
1727 int len;
1728
1729 if (value < 0)
1730 value = 0;
1731
1732 if (value == *start)
1733 return S_FALSE;
1734
1735 if (value <= *end) {
1736 *start = value;
1737 return S_OK;
1738 }
1739
1740 len = ME_GetTextLength(services->editor);
1741 *start = *end = value > len ? len : value;
1742 return S_OK;
1743}
1744
1746{
1748
1749 TRACE("(%p)->(%ld)\n", This, value);
1750
1751 if (!This->child.reole)
1752 return CO_E_RELEASED;
1753
1754 return textrange_setstart(This->child.reole, value, &This->start, &This->end);
1755}
1756
1758{
1760
1761 TRACE("(%p)->(%p)\n", This, end);
1762
1763 if (!This->child.reole)
1764 return CO_E_RELEASED;
1765
1766 if (!end)
1767 return E_INVALIDARG;
1768
1769 *end = This->end;
1770 return S_OK;
1771}
1772
1774{
1775 int len;
1776
1777 if (value == *end)
1778 return S_FALSE;
1779
1780 if (value < *start) {
1781 *start = *end = max(0, value);
1782 return S_OK;
1783 }
1784
1785 len = ME_GetTextLength( services->editor );
1786 *end = value > len ? len + 1 : value;
1787 return S_OK;
1788}
1789
1791{
1793
1794 TRACE("(%p)->(%ld)\n", This, value);
1795
1796 if (!This->child.reole)
1797 return CO_E_RELEASED;
1798
1799 return textrange_setend(This->child.reole, value, &This->start, &This->end);
1800}
1801
1803{
1805
1806 TRACE("(%p)->(%p)\n", This, font);
1807
1808 if (!This->child.reole)
1809 return CO_E_RELEASED;
1810
1811 if (!font)
1812 return E_INVALIDARG;
1813
1814 return create_textfont(me, NULL, font);
1815}
1816
1818{
1820
1821 TRACE("(%p)->(%p)\n", This, font);
1822
1823 if (!font)
1824 return E_INVALIDARG;
1825
1826 if (!This->child.reole)
1827 return CO_E_RELEASED;
1828
1830 return S_OK;
1831}
1832
1834{
1836
1837 TRACE("(%p)->(%p)\n", This, para);
1838
1839 if (!This->child.reole)
1840 return CO_E_RELEASED;
1841
1842 if (!para)
1843 return E_INVALIDARG;
1844
1845 return create_textpara(me, para);
1846}
1847
1849{
1851
1852 FIXME("(%p)->(%p): stub\n", This, para);
1853
1854 if (!This->child.reole)
1855 return CO_E_RELEASED;
1856
1857 return E_NOTIMPL;
1858}
1859
1861{
1863
1864 TRACE("(%p)->(%p)\n", This, length);
1865
1866 if (!This->child.reole)
1867 return CO_E_RELEASED;
1868
1869 return textrange_get_storylength(This->child.reole->editor, length);
1870}
1871
1873{
1875
1876 TRACE("(%p)->(%p)\n", This, value);
1877
1878 if (!This->child.reole)
1879 return CO_E_RELEASED;
1880
1881 if (!value)
1882 return E_INVALIDARG;
1883
1885 return S_OK;
1886}
1887
1889{
1890 if (*end == *start)
1891 return S_FALSE;
1892
1893 if (bStart == tomEnd)
1894 *start = *end;
1895 else
1896 *end = *start;
1897 return S_OK;
1898}
1899
1901{
1903
1904 TRACE("(%p)->(%ld)\n", This, bStart);
1905
1906 if (!This->child.reole)
1907 return CO_E_RELEASED;
1908
1909 return range_Collapse(bStart, &This->start, &This->end);
1910}
1911
1913{
1915
1916 TRACE("(%p)->(%ld %p)\n", This, unit, delta);
1917
1918 if (!This->child.reole)
1919 return CO_E_RELEASED;
1920
1921 return textrange_expand(me, unit, delta);
1922}
1923
1925{
1927
1928 FIXME("(%p)->(%ld %p): stub\n", This, unit, index);
1929
1930 if (!This->child.reole)
1931 return CO_E_RELEASED;
1932
1933 return E_NOTIMPL;
1934}
1935
1937 LONG extend)
1938{
1940
1941 FIXME("(%p)->(%ld %ld %ld): stub\n", This, unit, index, extend);
1942
1943 if (!This->child.reole)
1944 return CO_E_RELEASED;
1945
1946 return E_NOTIMPL;
1947}
1948
1949static void cp2range(ME_TextEditor *editor, LONG *cp1, LONG *cp2)
1950{
1951 int len = ME_GetTextLength(editor) + 1;
1952
1953 *cp1 = max(*cp1, 0);
1954 *cp2 = max(*cp2, 0);
1955 *cp1 = min(*cp1, len);
1956 *cp2 = min(*cp2, len);
1957 if (*cp1 > *cp2)
1958 {
1959 int tmp = *cp1;
1960 *cp1 = *cp2;
1961 *cp2 = tmp;
1962 }
1963 if (*cp1 == len)
1964 *cp1 = *cp2 = len - 1;
1965}
1966
1968{
1970
1971 TRACE("(%p)->(%ld %ld)\n", This, anchor, active);
1972
1973 if (!This->child.reole)
1974 return CO_E_RELEASED;
1975
1976 cp2range(This->child.reole->editor, &anchor, &active);
1977 if (anchor == This->start && active == This->end)
1978 return S_FALSE;
1979
1980 This->start = anchor;
1981 This->end = active;
1982 return S_OK;
1983}
1984
1986{
1987 LONG from, to, v;
1988
1989 if (!ret)
1990 ret = &v;
1991
1992 if (FAILED(ITextRange_GetStart(range, &from)) || FAILED(ITextRange_GetEnd(range, &to))) {
1993 *ret = tomFalse;
1994 }
1995 else
1996 *ret = (start >= from && end <= to) ? tomTrue : tomFalse;
1997 return *ret == tomTrue ? S_OK : S_FALSE;
1998}
1999
2001{
2003
2004 TRACE("(%p)->(%p %p)\n", This, range, ret);
2005
2006 if (ret)
2007 *ret = tomFalse;
2008
2009 if (!This->child.reole)
2010 return CO_E_RELEASED;
2011
2012 if (!range)
2013 return S_FALSE;
2014
2015 return textrange_inrange(This->start, This->end, range, ret);
2016}
2017
2019{
2021
2022 FIXME("(%p)->(%p): stub\n", This, ret);
2023
2024 if (!This->child.reole)
2025 return CO_E_RELEASED;
2026
2027 return E_NOTIMPL;
2028}
2029
2031{
2032 LONG from, to, v;
2033
2034 if (!ret)
2035 ret = &v;
2036
2037 if (FAILED(ITextRange_GetStart(range, &from)) || FAILED(ITextRange_GetEnd(range, &to))) {
2038 *ret = tomFalse;
2039 }
2040 else
2041 *ret = (start == from && end == to) ? tomTrue : tomFalse;
2042 return *ret == tomTrue ? S_OK : S_FALSE;
2043}
2044
2046{
2048
2049 TRACE("(%p)->(%p %p)\n", This, range, ret);
2050
2051 if (ret)
2052 *ret = tomFalse;
2053
2054 if (!This->child.reole)
2055 return CO_E_RELEASED;
2056
2057 if (!range)
2058 return S_FALSE;
2059
2060 return textrange_isequal(This->start, This->end, range, ret);
2061}
2062
2064{
2066
2067 TRACE("(%p)\n", This);
2068
2069 if (!This->child.reole)
2070 return CO_E_RELEASED;
2071
2072 set_selection(This->child.reole->editor, This->start, This->end);
2073 return S_OK;
2074}
2075
2077{
2078 HRESULT hr;
2079 LONG start, end;
2080 LONG moved;
2081
2082 ITextRange_GetStart(range, &start);
2083 ITextRange_GetEnd(range, &end);
2084
2085 switch (unit)
2086 {
2087 case tomCharacter:
2088 {
2089 moved = 0;
2090 if (extend == tomMove) {
2091 if (start != end) {
2092 ITextRange_SetEnd(range, start);
2093 moved = -1;
2094 }
2095 }
2096 if (delta)
2097 *delta = moved;
2098 hr = moved ? S_OK : S_FALSE;
2099 break;
2100 }
2101 default:
2102 FIXME("unit %ld is not supported\n", unit);
2103 return E_NOTIMPL;
2104 }
2105 return hr;
2106}
2107
2109 LONG *delta)
2110{
2112
2113 TRACE("(%p)->(%ld %ld %p)\n", This, unit, extend, delta);
2114
2115 if (!This->child.reole)
2116 return CO_E_RELEASED;
2117
2118 return textrange_startof(me, unit, extend, delta);
2119}
2120
2122{
2123 HRESULT hr;
2124 LONG old_start, old_end, new_end;
2125 LONG moved;
2126
2127 ITextRange_GetStart(range, &old_start);
2128 ITextRange_GetEnd(range, &old_end);
2129
2130 switch (unit)
2131 {
2132 case tomCharacter:
2133 {
2134 moved = 0;
2135 new_end = old_end;
2136 if (old_end == 0)
2137 {
2139 cursor_from_char_ofs( editor, old_end, &cursor );
2140 moved = ME_MoveCursorChars(editor, &cursor, 1, TRUE);
2141 new_end = old_end + moved;
2142 }
2143 else if (extend == tomMove && old_start != old_end)
2144 moved = 1;
2145
2146 ITextRange_SetEnd(range, new_end);
2147 if (extend == tomMove)
2148 ITextRange_SetStart(range, new_end);
2149 if (delta)
2150 *delta = moved;
2151 hr = moved ? S_OK : S_FALSE;
2152 break;
2153 }
2154 default:
2155 FIXME("unit %ld is not supported\n", unit);
2156 return E_NOTIMPL;
2157 }
2158 return hr;
2159}
2160
2162 LONG *delta)
2163{
2165
2166 TRACE("(%p)->(%ld %ld %p)\n", This, unit, extend, delta);
2167
2168 if (!This->child.reole)
2169 return CO_E_RELEASED;
2170
2171 return textrange_endof(me, This->child.reole->editor, unit, extend, delta);
2172}
2173
2175{
2176 LONG old_start, old_end, new_start, new_end;
2177 LONG move_by;
2178 LONG moved;
2179 HRESULT hr = S_OK;
2180
2181 if (!count)
2182 {
2183 if (delta)
2184 *delta = 0;
2185 return S_FALSE;
2186 }
2187
2188 ITextRange_GetStart(range, &old_start);
2189 ITextRange_GetEnd(range, &old_end);
2190 switch (unit)
2191 {
2192 case tomCharacter:
2193 {
2195
2196 if (count > 0)
2197 {
2198 cursor_from_char_ofs( editor, old_end, &cursor );
2199 move_by = count;
2200 if (old_start != old_end)
2201 --move_by;
2202 }
2203 else
2204 {
2205 cursor_from_char_ofs( editor, old_start, &cursor );
2206 move_by = count;
2207 if (old_start != old_end)
2208 ++move_by;
2209 }
2210 moved = ME_MoveCursorChars(editor, &cursor, move_by, FALSE);
2211 if (count > 0)
2212 {
2213 new_end = old_end + moved;
2214 new_start = new_end;
2215 if (old_start != old_end)
2216 ++moved;
2217 }
2218 else
2219 {
2220 new_start = old_start + moved;
2221 new_end = new_start;
2222 if (old_start != old_end)
2223 --moved;
2224 }
2225 if (delta) *delta = moved;
2226 break;
2227 }
2228 default:
2229 FIXME("unit %ld is not supported\n", unit);
2230 return E_NOTIMPL;
2231 }
2232 if (moved == 0)
2233 hr = S_FALSE;
2234 ITextRange_SetStart(range, new_start);
2235 ITextRange_SetEnd(range, new_end);
2236
2237 return hr;
2238}
2239
2241{
2243
2244 TRACE("(%p)->(%ld %ld %p)\n", This, unit, count, delta);
2245
2246 if (!This->child.reole)
2247 return CO_E_RELEASED;
2248
2249 return textrange_move(me, This->child.reole->editor, unit, count, delta);
2250}
2251
2253{
2254 LONG old_start, old_end, new_start, new_end;
2255 HRESULT hr = S_OK;
2256
2257 if (!count)
2258 {
2259 if (delta)
2260 *delta = 0;
2261 return S_FALSE;
2262 }
2263
2264 ITextRange_GetStart(range, &old_start);
2265 ITextRange_GetEnd(range, &old_end);
2266 switch (unit)
2267 {
2268 case tomCharacter:
2269 {
2271 LONG moved;
2272
2273 cursor_from_char_ofs( editor, old_start, &cursor );
2275 new_start = old_start + moved;
2276 new_end = old_end;
2277 if (new_end < new_start)
2278 new_end = new_start;
2279 if (delta)
2280 *delta = moved;
2281 break;
2282 }
2283 default:
2284 FIXME("unit %ld is not supported\n", unit);
2285 return E_NOTIMPL;
2286 }
2287 if (new_start == old_start)
2288 hr = S_FALSE;
2289 ITextRange_SetStart(range, new_start);
2290 ITextRange_SetEnd(range, new_end);
2291
2292 return hr;
2293}
2294
2296 LONG *delta)
2297{
2299
2300 TRACE("(%p)->(%ld %ld %p)\n", This, unit, count, delta);
2301
2302 if (!This->child.reole)
2303 return CO_E_RELEASED;
2304
2305 return textrange_movestart(me, This->child.reole->editor, unit, count, delta);
2306}
2307
2309{
2310 LONG old_start, old_end, new_start, new_end;
2311 HRESULT hr = S_OK;
2312
2313 if (!count)
2314 {
2315 if (delta)
2316 *delta = 0;
2317 return S_FALSE;
2318 }
2319
2320 ITextRange_GetStart(range, &old_start);
2321 ITextRange_GetEnd(range, &old_end);
2322 switch (unit)
2323 {
2324 case tomCharacter:
2325 {
2327 LONG moved;
2328
2329 cursor_from_char_ofs( editor, old_end, &cursor );
2331 new_start = old_start;
2332 new_end = old_end + moved;
2333 if (new_end < new_start)
2334 new_start = new_end;
2335 if (delta)
2336 *delta = moved;
2337 break;
2338 }
2339 case tomStory:
2340 if (count < 0)
2341 new_start = new_end = 0;
2342 else
2343 {
2344 new_start = old_start;
2345 ITextRange_GetStoryLength(range, &new_end);
2346 }
2347 if (delta)
2348 {
2349 if (new_end < old_end)
2350 *delta = -1;
2351 else if (new_end == old_end)
2352 *delta = 0;
2353 else
2354 *delta = 1;
2355 }
2356 break;
2357 default:
2358 FIXME("unit %ld is not supported\n", unit);
2359 return E_NOTIMPL;
2360 }
2361 if (new_end == old_end)
2362 hr = S_FALSE;
2363 ITextRange_SetStart(range, new_start);
2364 ITextRange_SetEnd(range, new_end);
2365
2366 return hr;
2367}
2368
2370 LONG *delta)
2371{
2373
2374 TRACE("(%p)->(%ld %ld %p)\n", This, unit, count, delta);
2375
2376 if (!This->child.reole)
2377 return CO_E_RELEASED;
2378
2379 return textrange_moveend(me, This->child.reole->editor, unit, count, delta);
2380}
2381
2383 LONG *delta)
2384{
2386
2387 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
2388
2389 if (!This->child.reole)
2390 return CO_E_RELEASED;
2391
2392 return E_NOTIMPL;
2393}
2394
2396 LONG *delta)
2397{
2399
2400 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
2401
2402 if (!This->child.reole)
2403 return CO_E_RELEASED;
2404
2405 return E_NOTIMPL;
2406}
2407
2409 LONG *delta)
2410{
2412
2413 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
2414
2415 if (!This->child.reole)
2416 return CO_E_RELEASED;
2417
2418 return E_NOTIMPL;
2419}
2420
2422 LONG *delta)
2423{
2425
2426 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
2427
2428 if (!This->child.reole)
2429 return CO_E_RELEASED;
2430
2431 return E_NOTIMPL;
2432}
2433
2435 LONG *delta)
2436{
2438
2439 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
2440
2441 if (!This->child.reole)
2442 return CO_E_RELEASED;
2443
2444 return E_NOTIMPL;
2445}
2446
2448 LONG *delta)
2449{
2451
2452 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
2453
2454 if (!This->child.reole)
2455 return CO_E_RELEASED;
2456
2457 return E_NOTIMPL;
2458}
2459
2461 LONG *length)
2462{
2464
2465 FIXME("(%p)->(%s %ld %lx %p): stub\n", This, debugstr_w(text), count, flags, length);
2466
2467 if (!This->child.reole)
2468 return CO_E_RELEASED;
2469
2470 return E_NOTIMPL;
2471}
2472
2475{
2477
2478 FIXME("(%p)->(%s %ld %lx %p): stub\n", This, debugstr_w(text), count, flags, length);
2479
2480 if (!This->child.reole)
2481 return CO_E_RELEASED;
2482
2483 return E_NOTIMPL;
2484}
2485
2488{
2490
2491 FIXME("(%p)->(%s %ld %lx %p): stub\n", This, debugstr_w(text), count, flags, length);
2492
2493 if (!This->child.reole)
2494 return CO_E_RELEASED;
2495
2496 return E_NOTIMPL;
2497}
2498
2500{
2502
2503 FIXME("(%p)->(%ld %ld %p): stub\n", This, unit, count, delta);
2504
2505 if (!This->child.reole)
2506 return CO_E_RELEASED;
2507
2508 return E_NOTIMPL;
2509}
2510
2512{
2513 LONG start, end;
2515 IDataObject **data_out = NULL;
2516
2517 ITextRange_GetStart( range, &start );
2518 ITextRange_GetEnd( range, &end );
2519 if (start == end)
2520 {
2521 /* If the range is empty, all text is copied */
2522 LONG prev_end = end;
2523 ITextRange_SetEnd( range, MAXLONG );
2524 start = 0;
2525 ITextRange_GetEnd( range, &end );
2526 ITextRange_SetEnd( range, prev_end );
2527 }
2529
2530 if (v && V_VT(v) == (VT_UNKNOWN | VT_BYREF) && V_UNKNOWNREF( v ))
2531 data_out = (IDataObject **)V_UNKNOWNREF( v );
2532
2533 return editor_copy_or_cut( editor, cut, &cursor, end - start, data_out );
2534}
2535
2537{
2539
2540 TRACE("(%p)->(%p)\n", This, v);
2541
2542 if (!This->child.reole)
2543 return CO_E_RELEASED;
2544
2545 return textrange_copy_or_cut(me, This->child.reole->editor, TRUE, v);
2546}
2547
2549{
2551
2552 TRACE("(%p)->(%p)\n", This, v);
2553
2554 if (!This->child.reole)
2555 return CO_E_RELEASED;
2556
2557 return textrange_copy_or_cut(me, This->child.reole->editor, FALSE, v);
2558}
2559
2561{
2563
2564 FIXME("(%p)->(%s %lx): stub\n", This, debugstr_variant(v), format);
2565
2566 if (!This->child.reole)
2567 return CO_E_RELEASED;
2568
2569 return E_NOTIMPL;
2570}
2571
2573{
2575
2576 FIXME("(%p)->(%s %lx %p): stub\n", This, debugstr_variant(v), format, ret);
2577
2578 if (!This->child.reole)
2579 return CO_E_RELEASED;
2580
2581 return E_NOTIMPL;
2582}
2583
2585{
2587
2588 FIXME("(%p)->(%p): stub\n", This, ret);
2589
2590 if (!This->child.reole)
2591 return CO_E_RELEASED;
2592
2593 return E_NOTIMPL;
2594}
2595
2597{
2599
2600 FIXME("(%p)->(%ld): stub\n", This, type);
2601
2602 if (!This->child.reole)
2603 return CO_E_RELEASED;
2604
2605 return E_NOTIMPL;
2606}
2607
2609{
2611
2612 FIXME("(%p)->(%ld %p %p): stub\n", This, type, cx, cy);
2613
2614 if (!This->child.reole)
2615 return CO_E_RELEASED;
2616
2617 return E_NOTIMPL;
2618}
2619
2621 LONG extend)
2622{
2624
2625 FIXME("(%p)->(%ld %ld %ld %ld): stub\n", This, x, y, type, extend);
2626
2627 if (!This->child.reole)
2628 return CO_E_RELEASED;
2629
2630 return E_NOTIMPL;
2631}
2632
2634{
2638 int x, y, height;
2639
2640 TRACE("(%p)->(%ld)\n", This, value);
2641
2642 if (!This->child.reole)
2643 return CO_E_RELEASED;
2644
2645 editor = This->child.reole->editor;
2646
2647 switch (value)
2648 {
2649 case tomStart:
2651 cursor_coords( editor, &cursor, &x, &y, &height );
2652 break;
2653 case tomEnd:
2655 cursor_coords( editor, &cursor, &x, &y, &height );
2656 break;
2657 default:
2658 FIXME("bStart value %ld not handled\n", value);
2659 return E_NOTIMPL;
2660 }
2661 scroll_abs( editor, x, y, TRUE );
2662 return S_OK;
2663}
2664
2666{
2668
2669 FIXME("(%p)->(%p): stub\n", This, ppv);
2670
2671 if (!This->child.reole)
2672 return CO_E_RELEASED;
2673
2674 return E_NOTIMPL;
2675}
2676
2677static const ITextRangeVtbl trvt = {
2736};
2737
2738/* ITextFont */
2740{
2742
2743 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
2744
2745 if (IsEqualIID(riid, &IID_ITextFont) ||
2748 {
2749 *ppv = iface;
2750 ITextFont_AddRef(iface);
2751 return S_OK;
2752 }
2753
2754 *ppv = NULL;
2755 return E_NOINTERFACE;
2756}
2757
2759{
2762 TRACE("(%p)->(%lu)\n", This, ref);
2763 return ref;
2764}
2765
2767{
2770
2771 TRACE("(%p)->(%lu)\n", This, ref);
2772
2773 if (!ref)
2774 {
2775 if (This->range)
2776 ITextRange_Release(This->range);
2777 SysFreeString(This->props[FONT_NAME].str);
2778 free(This);
2779 }
2780
2781 return ref;
2782}
2783
2785{
2787 TRACE("(%p)->(%p)\n", This, pctinfo);
2788 *pctinfo = 1;
2789 return S_OK;
2790}
2791
2793 ITypeInfo **ppTInfo)
2794{
2796 HRESULT hr;
2797
2798 TRACE("(%p)->(%u,%ld,%p)\n", This, iTInfo, lcid, ppTInfo);
2799
2800 hr = get_typeinfo(ITextFont_tid, ppTInfo);
2801 if (SUCCEEDED(hr))
2802 ITypeInfo_AddRef(*ppTInfo);
2803 return hr;
2804}
2805
2807 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
2808{
2810 ITypeInfo *ti;
2811 HRESULT hr;
2812
2813 TRACE("(%p)->(%s, %p, %u, %ld, %p)\n", This, debugstr_guid(riid),
2814 rgszNames, cNames, lcid, rgDispId);
2815
2817 if (SUCCEEDED(hr))
2818 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
2819 return hr;
2820}
2821
2823 ITextFont *iface,
2824 DISPID dispIdMember,
2825 REFIID riid,
2826 LCID lcid,
2827 WORD wFlags,
2828 DISPPARAMS *pDispParams,
2829 VARIANT *pVarResult,
2830 EXCEPINFO *pExcepInfo,
2831 UINT *puArgErr)
2832{
2834 ITypeInfo *ti;
2835 HRESULT hr;
2836
2837 TRACE("(%p)->(%ld, %s, %ld, %u, %p, %p, %p, %p)\n", This, dispIdMember, debugstr_guid(riid),
2838 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2839
2841 if (SUCCEEDED(hr))
2842 hr = ITypeInfo_Invoke(ti, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2843 return hr;
2844}
2845
2847{
2849
2850 TRACE("(%p)->(%p)\n", This, ret);
2851
2852 if (!ret)
2853 return E_INVALIDARG;
2854
2855 *ret = NULL;
2856 if (This->range && !get_range_reole(This->range))
2857 return CO_E_RELEASED;
2858
2859 return create_textfont(NULL, This, ret);
2860}
2861
2863{
2865 FIXME("(%p)->(%p): stub\n", This, pFont);
2866 return E_NOTIMPL;
2867}
2868
2870{
2872 FIXME("(%p)->(%p): stub\n", This, ret);
2873 return E_NOTIMPL;
2874}
2875
2877{
2879 FIXME("(%p)->(%p %p): stub\n", This, font, ret);
2880 return E_NOTIMPL;
2881}
2882
2884{
2885 enum textfont_prop_id id;
2886
2887 for (id = FONT_PROPID_FIRST; id < FONT_PROPID_LAST; id++) {
2888 switch (id)
2889 {
2890 case FONT_ALLCAPS:
2891 case FONT_ANIMATION:
2892 case FONT_BOLD:
2893 case FONT_EMBOSS:
2894 case FONT_HIDDEN:
2895 case FONT_ENGRAVE:
2896 case FONT_ITALIC:
2897 case FONT_OUTLINE:
2898 case FONT_PROTECTED:
2899 case FONT_SHADOW:
2900 case FONT_SMALLCAPS:
2901 case FONT_STRIKETHROUGH:
2902 case FONT_SUBSCRIPT:
2903 case FONT_SUPERSCRIPT:
2904 case FONT_UNDERLINE:
2905 font->props[id].l = tomFalse;
2906 break;
2907 case FONT_BACKCOLOR:
2908 case FONT_FORECOLOR:
2909 font->props[id].l = tomAutoColor;
2910 break;
2911 case FONT_KERNING:
2912 case FONT_POSITION:
2913 case FONT_SIZE:
2914 case FONT_SPACING:
2915 font->props[id].f = 0.0;
2916 break;
2917 case FONT_LANGID:
2918 font->props[id].l = GetSystemDefaultLCID();
2919 break;
2920 case FONT_NAME: {
2921 SysFreeString(font->props[id].str);
2922 font->props[id].str = SysAllocString(L"System");
2923 break;
2924 }
2925 case FONT_WEIGHT:
2926 font->props[id].l = FW_NORMAL;
2927 break;
2928 default:
2929 FIXME("font property %d not handled\n", id);
2930 }
2931 }
2932}
2933
2935{
2936 enum textfont_prop_id id;
2937
2938 for (id = FONT_PROPID_FIRST; id < FONT_PROPID_LAST; id++) {
2939 switch (id)
2940 {
2941 case FONT_ALLCAPS:
2942 case FONT_ANIMATION:
2943 case FONT_BOLD:
2944 case FONT_EMBOSS:
2945 case FONT_HIDDEN:
2946 case FONT_ENGRAVE:
2947 case FONT_ITALIC:
2948 case FONT_OUTLINE:
2949 case FONT_PROTECTED:
2950 case FONT_SHADOW:
2951 case FONT_SMALLCAPS:
2952 case FONT_STRIKETHROUGH:
2953 case FONT_SUBSCRIPT:
2954 case FONT_SUPERSCRIPT:
2955 case FONT_UNDERLINE:
2956 case FONT_BACKCOLOR:
2957 case FONT_FORECOLOR:
2958 case FONT_LANGID:
2959 case FONT_WEIGHT:
2960 font->props[id].l = tomUndefined;
2961 break;
2962 case FONT_KERNING:
2963 case FONT_POSITION:
2964 case FONT_SIZE:
2965 case FONT_SPACING:
2966 font->props[id].f = tomUndefined;
2967 break;
2968 case FONT_NAME:
2969 break;
2970 default:
2971 FIXME("font property %d not handled\n", id);
2972 }
2973 }
2974}
2975
2977{
2978 enum textfont_prop_id propid;
2979 for (propid = FONT_PROPID_FIRST; propid < FONT_PROPID_LAST; propid++)
2980 set_textfont_prop(font, propid, &font->props[propid]);
2981}
2982
2984{
2986
2987 TRACE("(%p)->(%ld)\n", This, value);
2988
2989 /* If font is attached to a range, released or not, we can't
2990 reset to undefined */
2991 if (This->range) {
2992 if (!get_range_reole(This->range))
2993 return CO_E_RELEASED;
2994
2995 switch (value)
2996 {
2997 case tomUndefined:
2998 return E_INVALIDARG;
2999 case tomCacheParms:
3001 This->get_cache_enabled = TRUE;
3002 break;
3003 case tomTrackParms:
3004 This->get_cache_enabled = FALSE;
3005 break;
3006 case tomApplyLater:
3007 This->set_cache_enabled = TRUE;
3008 break;
3009 case tomApplyNow:
3010 This->set_cache_enabled = FALSE;
3012 break;
3013 case tomUsePoints:
3014 case tomUseTwips:
3015 return E_INVALIDARG;
3016 default:
3017 FIXME("reset mode %ld not supported\n", value);
3018 }
3019
3020 return S_OK;
3021 }
3022 else {
3023 switch (value)
3024 {
3025 /* reset to global defaults */
3026 case tomDefault:
3028 return S_OK;
3029 /* all properties are set to tomUndefined, font name is retained */
3030 case tomUndefined:
3032 return S_OK;
3033 case tomApplyNow:
3034 case tomApplyLater:
3035 case tomTrackParms:
3036 case tomCacheParms:
3037 return S_OK;
3038 case tomUsePoints:
3039 case tomUseTwips:
3040 return E_INVALIDARG;
3041 }
3042 }
3043
3044 FIXME("reset mode %ld not supported\n", value);
3045 return E_NOTIMPL;
3046}
3047
3049{
3051 FIXME("(%p)->(%p): stub\n", This, value);
3052 return E_NOTIMPL;
3053}
3054
3056{
3058 FIXME("(%p)->(%ld): stub\n", This, value);
3059 return E_NOTIMPL;
3060}
3061
3063{
3065 TRACE("(%p)->(%p)\n", This, value);
3067}
3068
3070{
3072 TRACE("(%p)->(%ld)\n", This, value);
3074}
3075
3077{
3079 TRACE("(%p)->(%p)\n", This, value);
3081}
3082
3084{
3086
3087 TRACE("(%p)->(%ld)\n", This, value);
3088
3089 if (value < tomNoAnimation || value > tomAnimationMax)
3090 return E_INVALIDARG;
3091
3093}
3094
3096{
3098 TRACE("(%p)->(%p)\n", This, value);
3100}
3101
3103{
3105 TRACE("(%p)->(%ld)\n", This, value);
3107}
3108
3110{
3112 TRACE("(%p)->(%p)\n", This, value);
3114}
3115
3117{
3119 TRACE("(%p)->(%ld)\n", This, value);
3121}
3122
3124{
3126 TRACE("(%p)->(%p)\n", This, value);
3128}
3129
3131{
3133 TRACE("(%p)->(%ld)\n", This, value);
3135}
3136
3138{
3140 TRACE("(%p)->(%p)\n", This, value);
3142}
3143
3145{
3147 TRACE("(%p)->(%ld)\n", This, value);
3149}
3150
3152{
3154 TRACE("(%p)->(%p)\n", This, value);
3156}
3157
3159{
3161 TRACE("(%p)->(%ld)\n", This, value);
3163}
3164
3166{
3168 TRACE("(%p)->(%p)\n", This, value);
3170}
3171
3173{
3175 TRACE("(%p)->(%ld)\n", This, value);
3177}
3178
3180{
3182 TRACE("(%p)->(%p)\n", This, value);
3184}
3185
3187{
3189 TRACE("(%p)->(%ld)\n", This, value);
3191}
3192
3194{
3196 TRACE("(%p)->(%p)\n", This, value);
3198}
3199
3201{
3203 TRACE("(%p)->(%.2f)\n", This, value);
3205}
3206
3208{
3210 TRACE("(%p)->(%p)\n", This, value);
3212}
3213
3215{
3217 TRACE("(%p)->(%ld)\n", This, value);
3219}
3220
3222{
3224
3225 TRACE("(%p)->(%p)\n", This, value);
3226
3227 if (!value)
3228 return E_INVALIDARG;
3229
3230 *value = NULL;
3231
3232 if (!This->range) {
3233 if (This->props[FONT_NAME].str)
3234 *value = SysAllocString(This->props[FONT_NAME].str);
3235 else
3237 return *value ? S_OK : E_OUTOFMEMORY;
3238 }
3239
3240 return textfont_getname_from_range(This->range, value);
3241}
3242
3244{
3247
3248 TRACE("(%p)->(%s)\n", This, debugstr_w(value));
3249
3250 v.str = value;
3251 return set_textfont_prop(This, FONT_NAME, &v);
3252}
3253
3255{
3257 TRACE("(%p)->(%p)\n", This, value);
3259}
3260
3262{
3264 TRACE("(%p)->(%ld)\n", This, value);
3266}
3267
3269{
3271 TRACE("(%p)->(%p)\n", This, value);
3273}
3274
3276{
3278 TRACE("(%p)->(%.2f)\n", This, value);
3280}
3281
3283{
3285 TRACE("(%p)->(%p)\n", This, value);
3287}
3288
3290{
3292 TRACE("(%p)->(%ld)\n", This, value);
3294}
3295
3297{
3299 TRACE("(%p)->(%p)\n", This, value);
3301}
3302
3304{
3306 TRACE("(%p)->(%ld)\n", This, value);
3308}
3309
3311{
3313 TRACE("(%p)->(%p)\n", This, value);
3315}
3316
3318{
3320 TRACE("(%p)->(%.2f)\n", This, value);
3322}
3323
3325{
3327 TRACE("(%p)->(%p)\n", This, value);
3329}
3330
3332{
3334 TRACE("(%p)->(%ld)\n", This, value);
3336}
3337
3339{
3341 TRACE("(%p)->(%p)\n", This, value);
3343}
3344
3346{
3348 TRACE("(%p)->(%.2f)\n", This, value);
3350}
3351
3353{
3355 TRACE("(%p)->(%p)\n", This, value);
3357}
3358
3360{
3362 TRACE("(%p)->(%ld)\n", This, value);
3364}
3365
3367{
3369 TRACE("(%p)->(%p)\n", This, value);
3371}
3372
3374{
3376 TRACE("(%p)->(%ld)\n", This, value);
3378}
3379
3381{
3383 TRACE("(%p)->(%p)\n", This, value);
3385}
3386
3388{
3390 TRACE("(%p)->(%ld)\n", This, value);
3392}
3393
3395{
3397 TRACE("(%p)->(%p)\n", This, value);
3399}
3400
3402{
3404 TRACE("(%p)->(%ld)\n", This, value);
3406}
3407
3409{
3411 TRACE("(%p)->(%p)\n", This, value);
3413}
3414
3416{
3418 TRACE("(%p)->(%ld)\n", This, value);
3420}
3421
3422static ITextFontVtbl textfontvtbl = {
3485};
3486
3488{
3490
3491 *ret = NULL;
3492 font = malloc(sizeof(*font));
3493 if (!font)
3494 return E_OUTOFMEMORY;
3495
3496 font->ITextFont_iface.lpVtbl = &textfontvtbl;
3497 font->ref = 1;
3498
3499 if (src) {
3500 font->range = NULL;
3501 font->get_cache_enabled = TRUE;
3502 font->set_cache_enabled = TRUE;
3503 memcpy(&font->props, &src->props, sizeof(font->props));
3504 if (font->props[FONT_NAME].str)
3505 font->props[FONT_NAME].str = SysAllocString(font->props[FONT_NAME].str);
3506 }
3507 else {
3508 font->range = range;
3509 ITextRange_AddRef(range);
3510
3511 /* cache current properties */
3512 font->get_cache_enabled = FALSE;
3513 font->set_cache_enabled = FALSE;
3515 }
3516
3517 *ret = &font->ITextFont_iface;
3518 return S_OK;
3519}
3520
3521/* ITextPara */
3523{
3525
3526 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
3527
3528 if (IsEqualIID(riid, &IID_ITextPara) ||
3531 {
3532 *ppv = iface;
3533 ITextPara_AddRef(iface);
3534 return S_OK;
3535 }
3536
3537 *ppv = NULL;
3538 return E_NOINTERFACE;
3539}
3540
3542{
3545 TRACE("(%p)->(%lu)\n", This, ref);
3546 return ref;
3547}
3548
3550{
3553
3554 TRACE("(%p)->(%lu)\n", This, ref);
3555
3556 if (!ref)
3557 {
3558 ITextRange_Release(This->range);
3559 free(This);
3560 }
3561
3562 return ref;
3563}
3564
3566{
3568 TRACE("(%p)->(%p)\n", This, pctinfo);
3569 *pctinfo = 1;
3570 return S_OK;
3571}
3572
3574 ITypeInfo **ppTInfo)
3575{
3577 HRESULT hr;
3578
3579 TRACE("(%p)->(%u,%ld,%p)\n", This, iTInfo, lcid, ppTInfo);
3580
3581 hr = get_typeinfo(ITextPara_tid, ppTInfo);
3582 if (SUCCEEDED(hr))
3583 ITypeInfo_AddRef(*ppTInfo);
3584 return hr;
3585}
3586
3588 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
3589{
3591 ITypeInfo *ti;
3592 HRESULT hr;
3593
3594 TRACE("(%p)->(%s, %p, %u, %ld, %p)\n", This, debugstr_guid(riid), rgszNames,
3595 cNames, lcid, rgDispId);
3596
3598 if (SUCCEEDED(hr))
3599 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
3600 return hr;
3601}
3602
3604 ITextPara *iface,
3605 DISPID dispIdMember,
3606 REFIID riid,
3607 LCID lcid,
3608 WORD wFlags,
3609 DISPPARAMS *pDispParams,
3610 VARIANT *pVarResult,
3611 EXCEPINFO *pExcepInfo,
3612 UINT *puArgErr)
3613{
3615 ITypeInfo *ti;
3616 HRESULT hr;
3617
3618 TRACE("(%p)->(%ld, %s, %ld, %u, %p, %p, %p, %p)\n", This, dispIdMember,
3619 debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult,
3620 pExcepInfo, puArgErr);
3621
3623 if (SUCCEEDED(hr))
3624 hr = ITypeInfo_Invoke(ti, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3625 return hr;
3626}
3627
3629{
3631 FIXME("(%p)->(%p)\n", This, ret);
3632 return E_NOTIMPL;
3633}
3634
3636{
3638 FIXME("(%p)->(%p)\n", This, para);
3639 return E_NOTIMPL;
3640}
3641
3643{
3645 FIXME("(%p)->(%p)\n", This, ret);
3646 return E_NOTIMPL;
3647}
3648
3650{
3652 FIXME("(%p)->(%p %p)\n", This, para, ret);
3653 return E_NOTIMPL;
3654}
3655
3657{
3659 FIXME("(%p)->(%ld)\n", This, value);
3660 return E_NOTIMPL;
3661}
3662
3664{
3666 FIXME("(%p)->(%p)\n", This, value);
3667 return E_NOTIMPL;
3668}
3669
3671{
3673 FIXME("(%p)->(%ld)\n", This, value);
3674 return E_NOTIMPL;
3675}
3676
3678{
3680 FIXME("(%p)->(%p)\n", This, value);
3681 return E_NOTIMPL;
3682}
3683
3685{
3687 FIXME("(%p)->(%ld)\n", This, value);
3688 return E_NOTIMPL;
3689}
3690
3692{
3694 FIXME("(%p)->(%p)\n", This, value);
3695 return E_NOTIMPL;
3696}
3697
3699{
3701 FIXME("(%p)->(%ld)\n", This, value);
3702 return E_NOTIMPL;
3703}
3704
3706{
3708 FIXME("(%p)->(%p)\n", This, value);
3709 return E_NOTIMPL;
3710}
3711
3713{
3715 FIXME("(%p)->(%p)\n", This, value);
3716 return E_NOTIMPL;
3717}
3718
3720{
3722 FIXME("(%p)->(%ld)\n", This, value);
3723 return E_NOTIMPL;
3724}
3725
3727{
3729 FIXME("(%p)->(%p)\n", This, value);
3730 return E_NOTIMPL;
3731}
3732
3734{
3736 FIXME("(%p)->(%ld)\n", This, value);
3737 return E_NOTIMPL;
3738}
3739
3741{
3743 FIXME("(%p)->(%p)\n", This, value);
3744 return E_NOTIMPL;
3745}
3746
3748{
3750 FIXME("(%p)->(%p)\n", This, value);
3751 return E_NOTIMPL;
3752}
3753
3755{
3757 FIXME("(%p)->(%p)\n", This, value);
3758 return E_NOTIMPL;
3759}
3760
3762{
3764 FIXME("(%p)->(%p)\n", This, value);
3765 return E_NOTIMPL;
3766}
3767
3769{
3771 FIXME("(%p)->(%ld)\n", This, value);
3772 return E_NOTIMPL;
3773}
3774
3776{
3778 FIXME("(%p)->(%p)\n", This, value);
3779 return E_NOTIMPL;
3780}
3781
3783{
3785 FIXME("(%p)->(%ld)\n", This, value);
3786 return E_NOTIMPL;
3787}
3788
3790{
3792 FIXME("(%p)->(%p)\n", This, value);
3793 return E_NOTIMPL;
3794}
3795
3797{
3799 FIXME("(%p)->(%ld)\n", This, value);
3800 return E_NOTIMPL;
3801}
3802
3804{
3806 FIXME("(%p)->(%p)\n", This, value);
3807 return E_NOTIMPL;
3808}
3809
3811{
3813 FIXME("(%p)->(%.2f)\n", This, value);
3814 return E_NOTIMPL;
3815}
3816
3818{
3820 FIXME("(%p)->(%p)\n", This, value);
3821 return E_NOTIMPL;
3822}
3823
3825{
3827 FIXME("(%p)->(%ld)\n", This, value);
3828 return E_NOTIMPL;
3829}
3830
3832{
3834 FIXME("(%p)->(%p)\n", This, value);
3835 return E_NOTIMPL;
3836}
3837
3839{
3841 FIXME("(%p)->(%ld)\n", This, value);
3842 return E_NOTIMPL;
3843}
3844
3846{
3848 FIXME("(%p)->(%p)\n", This, value);
3849 return E_NOTIMPL;
3850}
3851
3853{
3855 FIXME("(%p)->(%ld)\n", This, value);
3856 return E_NOTIMPL;
3857}
3858
3860{
3862 FIXME("(%p)->(%p)\n", This, value);
3863 return E_NOTIMPL;
3864}
3865
3867{
3869 FIXME("(%p)->(%.2f)\n", This, value);
3870 return E_NOTIMPL;
3871}
3872
3873static HRESULT WINAPI TextPara_SetIndents(ITextPara *iface, FLOAT StartIndent, FLOAT LeftIndent, FLOAT RightIndent)
3874{
3876 FIXME("(%p)->(%.2f %.2f %.2f)\n", This, StartIndent, LeftIndent, RightIndent);
3877 return E_NOTIMPL;
3878}
3879
3880static HRESULT WINAPI TextPara_SetLineSpacing(ITextPara *iface, LONG LineSpacingRule, FLOAT LineSpacing)
3881{
3883 FIXME("(%p)->(%ld %.2f)\n", This, LineSpacingRule, LineSpacing);
3884 return E_NOTIMPL;
3885}
3886
3888{
3890 FIXME("(%p)->(%p)\n", This, value);
3891 return E_NOTIMPL;
3892}
3893
3895{
3897 FIXME("(%p)->(%.2f)\n", This, value);
3898 return E_NOTIMPL;
3899}
3900
3902{
3904 FIXME("(%p)->(%p)\n", This, value);
3905 return E_NOTIMPL;
3906}
3907
3909{
3911 FIXME("(%p)->(%.2f)\n", This, value);
3912 return E_NOTIMPL;
3913}
3914
3916{
3918 FIXME("(%p)->(%p)\n", This, value);
3919 return E_NOTIMPL;
3920}
3921
3923{
3925 FIXME("(%p)->(%ld)\n", This, value);
3926 return E_NOTIMPL;
3927}
3928
3930{
3932 FIXME("(%p)->(%p)\n", This, value);
3933 return E_NOTIMPL;
3934}
3935
3936static HRESULT WINAPI TextPara_AddTab(ITextPara *iface, FLOAT tbPos, LONG tbAlign, LONG tbLeader)
3937{
3939 FIXME("(%p)->(%.2f %ld %ld)\n", This, tbPos, tbAlign, tbLeader);
3940 return E_NOTIMPL;
3941}
3942
3944{
3946 FIXME("(%p)\n", This);
3947 return E_NOTIMPL;
3948}
3949
3951{
3953 FIXME("(%p)->(%.2f)\n", This, pos);
3954 return E_NOTIMPL;
3955}
3956
3957static HRESULT WINAPI TextPara_GetTab(ITextPara *iface, LONG iTab, FLOAT *ptbPos, LONG *ptbAlign, LONG *ptbLeader)
3958{
3960 FIXME("(%p)->(%ld %p %p %p)\n", This, iTab, ptbPos, ptbAlign, ptbLeader);
3961 return E_NOTIMPL;
3962}
3963
3964static ITextParaVtbl textparavtbl = {
4020};
4021
4023{
4024 ITextParaImpl *para;
4025
4026 *ret = NULL;
4027 para = malloc(sizeof(*para));
4028 if (!para)
4029 return E_OUTOFMEMORY;
4030
4031 para->ITextPara_iface.lpVtbl = &textparavtbl;
4032 para->ref = 1;
4033 para->range = range;
4034 ITextRange_AddRef(range);
4035
4036 *ret = &para->ITextPara_iface;
4037 return S_OK;
4038}
4039
4040/* ITextDocument */
4042 void **ppvObject)
4043{
4045 return IUnknown_QueryInterface( services->outer_unk, riid, ppvObject );
4046}
4047
4049{
4051 return IUnknown_AddRef( services->outer_unk );
4052}
4053
4055{
4057 return IUnknown_Release( services->outer_unk );
4058}
4059
4061 UINT *pctinfo)
4062{
4064 TRACE("(%p)->(%p)\n", services, pctinfo);
4065 *pctinfo = 1;
4066 return S_OK;
4067}
4068
4070 ITypeInfo **ppTInfo)
4071{
4073 HRESULT hr;
4074
4075 TRACE("(%p)->(%u,%ld,%p)\n", services, iTInfo, lcid, ppTInfo);
4076
4077 hr = get_typeinfo(ITextDocument_tid, ppTInfo);
4078 if (SUCCEEDED(hr))
4079 ITypeInfo_AddRef(*ppTInfo);
4080 return hr;
4081}
4082
4084 LPOLESTR *rgszNames, UINT cNames,
4085 LCID lcid, DISPID *rgDispId)
4086{
4088 ITypeInfo *ti;
4089 HRESULT hr;
4090
4091 TRACE("(%p)->(%s, %p, %u, %ld, %p)\n", services, debugstr_guid(riid),
4092 rgszNames, cNames, lcid, rgDispId);
4093
4095 if (SUCCEEDED(hr))
4096 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
4097 return hr;
4098}
4099
4102 DISPPARAMS *pDispParams, VARIANT *pVarResult,
4103 EXCEPINFO *pExcepInfo, UINT *puArgErr)
4104{
4106 ITypeInfo *ti;
4107 HRESULT hr;
4108
4109 TRACE("(%p)->(%ld, %s, %ld, %u, %p, %p, %p, %p)\n", services, dispIdMember,
4110 debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult,
4111 pExcepInfo, puArgErr);
4112
4114 if (SUCCEEDED(hr))
4115 hr = ITypeInfo_Invoke(ti, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4116 return hr;
4117}
4118
4120{
4122 FIXME("stub %p\n", services);
4123 return E_NOTIMPL;
4124}
4125
4127{
4129
4130 TRACE("(%p)->(%p)\n", iface, selection);
4131
4132 if (!selection)
4133 return E_INVALIDARG;
4134
4135 if (!services->text_selection)
4136 {
4137 services->text_selection = text_selection_create( services );
4138 if (!services->text_selection)
4139 {
4140 *selection = NULL;
4141 return E_OUTOFMEMORY;
4142 }
4143 }
4144
4145 *selection = &services->text_selection->ITextSelection_iface;
4146 ITextSelection_AddRef(*selection);
4147 return S_OK;
4148}
4149
4151{
4153 FIXME("stub %p\n", services);
4154 return E_NOTIMPL;
4155}
4156
4158 ITextStoryRanges **ppStories)
4159{
4161 FIXME("stub %p\n", services);
4162 return E_NOTIMPL;
4163}
4164
4166{
4168 FIXME("stub %p\n", services);
4169 return E_NOTIMPL;
4170}
4171
4173{
4175 FIXME("stub %p\n", services);
4176 return E_NOTIMPL;
4177}
4178
4180{
4182 FIXME("stub %p\n", services);
4183 return E_NOTIMPL;
4184}
4185
4187{
4189 FIXME("stub %p\n", services);
4190 return E_NOTIMPL;
4191}
4192
4194{
4196 FIXME("stub %p\n", services);
4197 return E_NOTIMPL;
4198}
4199
4201 LONG Flags, LONG CodePage)
4202{
4204 FIXME("stub %p\n", services);
4205 return E_NOTIMPL;
4206}
4207
4209 LONG Flags, LONG CodePage)
4210{
4212 FIXME("stub %p\n", services);
4213 return E_NOTIMPL;
4214}
4215
4217{
4219
4220 if (services->editor->freeze_count < LONG_MAX) services->editor->freeze_count++;
4221
4222 if (pCount) *pCount = services->editor->freeze_count;
4223 return services->editor->freeze_count != 0 ? S_OK : S_FALSE;
4224}
4225
4227{
4229
4230 if (services->editor->freeze_count && !--services->editor->freeze_count)
4231 ME_RewrapRepaint(services->editor);
4232
4233 if (pCount) *pCount = services->editor->freeze_count;
4234 return services->editor->freeze_count == 0 ? S_OK : S_FALSE;
4235}
4236
4238{
4240 FIXME("stub %p\n", services);
4241 return E_NOTIMPL;
4242}
4243
4245{
4247 FIXME("stub %p\n", services);
4248 return E_NOTIMPL;
4249}
4250
4252{
4254 LONG actual_undo_count;
4255
4256 if (prop) *prop = 0;
4257
4258 switch (Count)
4259 {
4260 case tomFalse:
4262 return S_OK;
4263 default:
4264 if (Count > 0) break;
4265 /* fallthrough */
4266 case tomTrue:
4268 return S_FALSE;
4269 case tomSuspend:
4270 if (services->editor->undo_ctl_state == undoActive)
4271 {
4272 services->editor->undo_ctl_state = undoSuspended;
4273 }
4274 return S_FALSE;
4275 case tomResume:
4276 services->editor->undo_ctl_state = undoActive;
4277 return S_FALSE;
4278 }
4279
4280 for (actual_undo_count = 0; actual_undo_count < Count; actual_undo_count++)
4281 {
4282 if (!ME_Undo(services->editor)) break;
4283 }
4284
4285 if (prop) *prop = actual_undo_count;
4286 return actual_undo_count == Count ? S_OK : S_FALSE;
4287}
4288
4290{
4292 LONG actual_redo_count;
4293
4294 if (prop) *prop = 0;
4295
4296 for (actual_redo_count = 0; actual_redo_count < Count; actual_redo_count++)
4297 {
4298 if (!ME_Redo(services->editor)) break;
4299 }
4300
4301 if (prop) *prop = actual_redo_count;
4302 return actual_redo_count == Count ? S_OK : S_FALSE;
4303}
4304
4306{
4307 ITextRangeImpl *txtRge = malloc(sizeof(ITextRangeImpl));
4308
4309 if (!txtRge)
4310 return E_OUTOFMEMORY;
4311 txtRge->ITextRange_iface.lpVtbl = &trvt;
4312 txtRge->ref = 1;
4313 txtRge->child.reole = services;
4314 txtRge->start = start;
4315 txtRge->end = end;
4316 list_add_head( &services->rangelist, &txtRge->child.entry );
4317 *ppRange = &txtRge->ITextRange_iface;
4318 return S_OK;
4319}
4320
4322 ITextRange **ppRange)
4323{
4325
4326 TRACE("%p %p %ld %ld\n", services, ppRange, cp1, cp2);
4327 if (!ppRange)
4328 return E_INVALIDARG;
4329
4330 cp2range(services->editor, &cp1, &cp2);
4331 return CreateITextRange(services, cp1, cp2, ppRange);
4332}
4333
4335 ITextRange **ppRange)
4336{
4338 FIXME("stub %p\n", services);
4339 return E_NOTIMPL;
4340}
4341
4342/* ITextDocument2Old methods */
4344{
4346
4347 FIXME("(%p)->(%p): stub\n", services, filter);
4348
4349 return E_NOTIMPL;
4350}
4351
4353{
4355
4356 FIXME("(%p)->(%ld, 0x%lx): stub\n", services, index, cr);
4357
4358 return E_NOTIMPL;
4359}
4360
4362{
4364
4365 FIXME("(%p)->(%ld, %p): stub\n", services, index, cr);
4366
4367 return E_NOTIMPL;
4368}
4369
4371{
4373
4374 FIXME("(%p)->(%p): stub\n", services, type);
4375
4376 return E_NOTIMPL;
4377}
4378
4380{
4382
4383 FIXME("(%p)->(%ld): stub\n", services, type);
4384
4385 return E_NOTIMPL;
4386}
4387
4389{
4391
4392 FIXME("(%p)->(%p): stub\n", services, context);
4393
4394 return E_NOTIMPL;
4395}
4396
4398{
4400
4401 FIXME("(%p)->(%ld): stub\n", services, context);
4402
4403 return E_NOTIMPL;
4404}
4405
4407 LONG options, LONG current_charrep, LONG current_fontsize,
4408 BSTR *bstr, LONG *pitch_family, LONG *new_fontsize)
4409{
4411
4412 FIXME("(%p)->(%ld, %ld, %ld, %ld, %ld, %p, %p, %p): stub\n", services, cp, charrep, options, current_charrep,
4413 current_fontsize, bstr, pitch_family, new_fontsize);
4414
4415 return E_NOTIMPL;
4416}
4417
4419{
4421
4422 FIXME("(%p)->(%p): stub\n", services, mode);
4423
4424 return E_NOTIMPL;
4425}
4426
4428{
4430
4431 FIXME("(%p)->(0x%lx): stub\n", services, mode);
4432
4433 return E_NOTIMPL;
4434}
4435
4437 LONG *right, LONG *bottom)
4438{
4440
4441 FIXME("(%p)->(%ld, %p, %p, %p, %p): stub\n", services, type, left, top, right, bottom);
4442
4443 return E_NOTIMPL;
4444}
4445
4447{
4449
4450 FIXME("(%p)->(%p): stub\n", services, selection);
4451
4452 return E_NOTIMPL;
4453}
4454
4456{
4458
4459 FIXME("(%p)->(%p): stub\n", services, hwnd);
4460
4461 return E_NOTIMPL;
4462}
4463
4465{
4467
4468 FIXME("(%p)->(%p): stub\n", services, flags);
4469
4470 return E_NOTIMPL;
4471}
4472
4474{
4476
4477 FIXME("(%p): stub\n", services);
4478
4479 return E_NOTIMPL;
4480}
4481
4483{
4485
4486 FIXME("(%p)->(%ld, %p): stub\n", services, cch, exceed);
4487
4488 return E_NOTIMPL;
4489}
4490
4492{
4494
4495 FIXME("(%p)->(0x%lx): stub\n", services, mode);
4496
4497 return E_NOTIMPL;
4498}
4499
4501{
4503
4504 FIXME("(%p): stub\n", services);
4505
4506 return E_NOTIMPL;
4507}
4508
4510{
4512
4513 FIXME("(%p)->(0x%lx): stub\n", services, mode);
4514
4515 return E_NOTIMPL;
4516}
4517
4519{
4521
4522 FIXME("(%p)->(%ld): stub\n", services, notify);
4523
4524 return E_NOTIMPL;
4525}
4526
4527const ITextDocument2OldVtbl text_doc2old_vtbl =
4528{
4555 /* ITextDocument2Old methods */
4576};
4577
4578/* ITextSelection */
4580 ITextSelection *me,
4581 REFIID riid,
4582 void **ppvObj)
4583{
4585
4586 *ppvObj = NULL;
4589 || IsEqualGUID(riid, &IID_ITextRange)
4590 || IsEqualGUID(riid, &IID_ITextSelection))
4591 {
4592 *ppvObj = me;
4593 ITextSelection_AddRef(me);
4594 return S_OK;
4595 }
4596 else if (IsEqualGUID(riid, &IID_Igetrichole))
4597 {
4598 *ppvObj = This->services;
4599 return S_OK;
4600 }
4601
4602 return E_NOINTERFACE;
4603}
4604
4606{
4608 return InterlockedIncrement(&This->ref);
4609}
4610
4612{
4615 if (ref == 0)
4616 free(This);
4617 return ref;
4618}
4619
4621{
4623 TRACE("(%p)->(%p)\n", This, pctinfo);
4624 *pctinfo = 1;
4625 return S_OK;
4626}
4627
4629 ITypeInfo **ppTInfo)
4630{
4632 HRESULT hr;
4633
4634 TRACE("(%p)->(%u,%ld,%p)\n", This, iTInfo, lcid, ppTInfo);
4635
4637 if (SUCCEEDED(hr))
4638 ITypeInfo_AddRef(*ppTInfo);
4639 return hr;
4640}
4641
4643 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
4644{
4646 ITypeInfo *ti;
4647 HRESULT hr;
4648
4649 TRACE("(%p)->(%s, %p, %u, %ld, %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid,
4650 rgDispId);
4651
4653 if (SUCCEEDED(hr))
4654 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
4655 return hr;
4656}
4657
4659 ITextSelection *me,
4660 DISPID dispIdMember,
4661 REFIID riid,
4662 LCID lcid,
4663 WORD wFlags,
4664 DISPPARAMS *pDispParams,
4665 VARIANT *pVarResult,
4666 EXCEPINFO *pExcepInfo,
4667 UINT *puArgErr)
4668{
4670 ITypeInfo *ti;
4671 HRESULT hr;
4672
4673 TRACE("(%p)->(%ld, %s, %ld, %u, %p, %p, %p, %p)\n", This, dispIdMember, debugstr_guid(riid), lcid,
4674 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4675
4677 if (SUCCEEDED(hr))
4678 hr = ITypeInfo_Invoke(ti, me, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
4679 return hr;
4680}
4681
4682/*** ITextRange methods ***/
4684{
4686 ME_Cursor *start = NULL, *end = NULL;
4687 int nChars, endOfs;
4688 BOOL bEOP;
4689
4690 TRACE("(%p)->(%p)\n", This, pbstr);
4691
4692 if (!This->services)
4693 return CO_E_RELEASED;
4694
4695 if (!pbstr)
4696 return E_INVALIDARG;
4697
4698 ME_GetSelection(This->services->editor, &start, &end);
4699 endOfs = ME_GetCursorOfs(end);
4700 nChars = endOfs - ME_GetCursorOfs(start);
4701 if (!nChars)
4702 {
4703 *pbstr = NULL;
4704 return S_OK;
4705 }
4706
4707 *pbstr = SysAllocStringLen(NULL, nChars);
4708 if (!*pbstr)
4709 return E_OUTOFMEMORY;
4710
4711 bEOP = (!para_next( para_next( end->para ) ) && endOfs > ME_GetTextLength(This->services->editor));
4712 ME_GetTextW(This->services->editor, *pbstr, nChars, start, nChars, FALSE, bEOP);
4713 TRACE("%s\n", wine_dbgstr_w(*pbstr));
4714
4715 return S_OK;
4716}
4717
4719{
4721 ME_TextEditor *editor;
4722 int len;
4723 LONG to, from;
4724
4725 TRACE("(%p)->(%s)\n", This, debugstr_w(str));
4726
4727 if (!This->services)
4728 return CO_E_RELEASED;
4729
4730 editor = This->services->editor;
4731 len = lstrlenW(str);
4732 ME_GetSelectionOfs(editor, &from, &to);
4733 ME_ReplaceSel(editor, FALSE, str, len);
4734
4735 if (len < to - from)
4737
4738 return S_OK;
4739}
4740
4742{
4744 ME_Cursor *start = NULL, *end = NULL;
4745
4746 TRACE("(%p)->(%p)\n", This, pch);
4747
4748 if (!This->services)
4749 return CO_E_RELEASED;
4750
4751 if (!pch)
4752 return E_INVALIDARG;
4753
4754 ME_GetSelection(This->services->editor, &start, &end);
4755 return range_GetChar(This->services->editor, start, pch);
4756}
4757
4759{
4761
4762 FIXME("(%p)->(%lx): stub\n", This, ch);
4763
4764 if (!This->services)
4765 return CO_E_RELEASED;
4766
4767 return E_NOTIMPL;
4768}
4769
4771{
4773 LONG start, end;
4774
4775 TRACE("(%p)->(%p)\n", This, range);
4776
4777 if (!This->services)
4778 return CO_E_RELEASED;
4779
4780 if (!range)
4781 return E_INVALIDARG;
4782
4783 ITextSelection_GetStart(me, &start);
4784 ITextSelection_GetEnd(me, &end);
4785 return CreateITextRange(This->services, start, end, range);
4786}
4787
4789{
4791
4792 FIXME("(%p)->(%p): stub\n", This, range);
4793
4794 if (!This->services)
4795 return CO_E_RELEASED;
4796
4797 return E_NOTIMPL;
4798}
4799
4801{
4803
4804 FIXME("(%p)->(%p): stub\n", This, range);
4805
4806 if (!This->services)
4807 return CO_E_RELEASED;
4808
4809 FIXME("not implemented\n");
4810 return E_NOTIMPL;
4811}
4812
4814{
4816 LONG lim;
4817
4818 TRACE("(%p)->(%p)\n", This, pcpFirst);
4819
4820 if (!This->services)
4821 return CO_E_RELEASED;
4822
4823 if (!pcpFirst)
4824 return E_INVALIDARG;
4825 ME_GetSelectionOfs(This->services->editor, pcpFirst, &lim);
4826 return S_OK;
4827}
4828
4830{
4832 LONG start, end;
4833 HRESULT hr;
4834
4835 TRACE("(%p)->(%ld)\n", This, value);
4836
4837 if (!This->services)
4838 return CO_E_RELEASED;
4839
4840 ME_GetSelectionOfs(This->services->editor, &start, &end);
4841 hr = textrange_setstart(This->services, value, &start, &end);
4842 if (hr == S_OK)
4843 set_selection(This->services->editor, start, end);
4844
4845 return hr;
4846}
4847
4849{
4851 LONG first;
4852
4853 TRACE("(%p)->(%p)\n", This, pcpLim);
4854
4855 if (!This->services)
4856 return CO_E_RELEASED;
4857
4858 if (!pcpLim)
4859 return E_INVALIDARG;
4860 ME_GetSelectionOfs(This->services->editor, &first, pcpLim);
4861 return S_OK;
4862}
4863
4865{
4867 LONG start, end;
4868 HRESULT hr;
4869
4870 TRACE("(%p)->(%ld)\n", This, value);
4871
4872 if (!This->services)
4873 return CO_E_RELEASED;
4874
4875 ME_GetSelectionOfs(This->services->editor, &start, &end);
4876 hr = textrange_setend(This->services, value, &start, &end);
4877 if (hr == S_OK)
4878 set_selection(This->services->editor, start, end);
4879
4880 return hr;
4881}
4882
4884{
4887 HRESULT hr;
4888
4889 TRACE("(%p)->(%p)\n", This, font);
4890
4891 if (!This->services)
4892 return CO_E_RELEASED;
4893
4894 if (!font)
4895 return E_INVALIDARG;
4896
4897 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
4899 ITextRange_Release(range);
4900 return hr;
4901}
4902
4904{
4907
4908 TRACE("(%p)->(%p)\n", This, font);
4909
4910 if (!font)
4911 return E_INVALIDARG;
4912
4913 if (!This->services)
4914 return CO_E_RELEASED;
4915
4916 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
4918 ITextRange_Release(range);
4919 return S_OK;
4920}
4921
4923{
4926 HRESULT hr;
4927
4928 TRACE("(%p)->(%p)\n", This, para);
4929
4930 if (!This->services)
4931 return CO_E_RELEASED;
4932
4933 if (!para)
4934 return E_INVALIDARG;
4935
4936 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
4937 hr = create_textpara(range, para);
4938 ITextRange_Release(range);
4939 return hr;
4940}
4941
4943{
4945
4946 FIXME("(%p)->(%p): stub\n", This, para);
4947
4948 if (!This->services)
4949 return CO_E_RELEASED;
4950
4951 FIXME("not implemented\n");
4952 return E_NOTIMPL;
4953}
4954
4956{
4958
4959 TRACE("(%p)->(%p)\n", This, length);
4960
4961 if (!This->services)
4962 return CO_E_RELEASED;
4963
4964 return textrange_get_storylength(This->services->editor, length);
4965}
4966
4968{
4970
4971 TRACE("(%p)->(%p)\n", This, value);
4972
4973 if (!This->services)
4974 return CO_E_RELEASED;
4975
4976 if (!value)
4977 return E_INVALIDARG;
4978
4980 return S_OK;
4981}
4982
4984{
4986 LONG start, end;
4987 HRESULT hres;
4988
4989 TRACE("(%p)->(%ld)\n", This, bStart);
4990
4991 if (!This->services)
4992 return CO_E_RELEASED;
4993
4994 ME_GetSelectionOfs(This->services->editor, &start, &end);
4995 hres = range_Collapse(bStart, &start, &end);
4996 if (SUCCEEDED(hres))
4997 set_selection(This->services->editor, start, end);
4998 return hres;
4999}
5000
5002{
5005 HRESULT hr;
5006
5007 TRACE("(%p)->(%ld %p)\n", This, unit, delta);
5008
5009 if (!This->services)
5010 return CO_E_RELEASED;
5011
5012 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5013 hr = textrange_expand(range, unit, delta);
5014 ITextRange_Release(range);
5015 return hr;
5016}
5017
5019{
5021
5022 FIXME("(%p)->(%ld %p): stub\n", This, unit, index);
5023
5024 if (!This->services)
5025 return CO_E_RELEASED;
5026
5027 return E_NOTIMPL;
5028}
5029
5031 LONG extend)
5032{
5034
5035 FIXME("(%p)->(%ld %ld %ld): stub\n", This, unit, index, extend);
5036
5037 if (!This->services)
5038 return CO_E_RELEASED;
5039
5040 return E_NOTIMPL;
5041}
5042
5044{
5046
5047 FIXME("(%p)->(%ld %ld): stub\n", This, anchor, active);
5048
5049 if (!This->services)
5050 return CO_E_RELEASED;
5051
5052 return E_NOTIMPL;
5053}
5054
5056{
5059 LONG start, end;
5060
5061 TRACE("(%p)->(%p %p)\n", This, range, ret);
5062
5063 if (ret)
5064 *ret = tomFalse;
5065
5066 if (!This->services)
5067 return CO_E_RELEASED;
5068
5069 if (!range)
5070 return S_FALSE;
5071
5072 ITextRange_QueryInterface(range, &IID_ITextSelection, (void**)&selection);
5073 if (!selection)
5074 return S_FALSE;
5075 ITextSelection_Release(selection);
5076
5077 ITextSelection_GetStart(me, &start);
5078 ITextSelection_GetEnd(me, &end);
5079 return textrange_inrange(start, end, range, ret);
5080}
5081
5083{
5085
5086 FIXME("(%p)->(%p %p): stub\n", This, range, ret);
5087
5088 if (!This->services)
5089 return CO_E_RELEASED;
5090
5091 return E_NOTIMPL;
5092}
5093
5095{
5098 LONG start, end;
5099
5100 TRACE("(%p)->(%p %p)\n", This, range, ret);
5101
5102 if (ret)
5103 *ret = tomFalse;
5104
5105 if (!This->services)
5106 return CO_E_RELEASED;
5107
5108 if (!range)
5109 return S_FALSE;
5110
5111 ITextRange_QueryInterface(range, &IID_ITextSelection, (void**)&selection);
5112 if (!selection)
5113 return S_FALSE;
5114 ITextSelection_Release(selection);
5115
5116 ITextSelection_GetStart(me, &start);
5117 ITextSelection_GetEnd(me, &end);
5118 return textrange_isequal(start, end, range, ret);
5119}
5120
5122{
5124
5125 TRACE("(%p)\n", This);
5126
5127 if (!This->services)
5128 return CO_E_RELEASED;
5129
5130 /* nothing to do */
5131 return S_OK;
5132}
5133
5135 LONG *delta)
5136{
5139 HRESULT hr;
5140
5141 TRACE("(%p)->(%ld %ld %p)\n", This, unit, extend, delta);
5142
5143 if (!This->services)
5144 return CO_E_RELEASED;
5145
5146 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5147 hr = textrange_startof(range, unit, extend, delta);
5148 ITextRange_Release(range);
5149 return hr;
5150}
5151
5153 LONG *delta)
5154{
5157 HRESULT hr;
5158
5159 TRACE("(%p)->(%ld %ld %p)\n", This, unit, extend, delta);
5160
5161 if (!This->services)
5162 return CO_E_RELEASED;
5163
5164 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5165 hr = textrange_endof(range, This->services->editor, unit, extend, delta);
5166 ITextRange_Release(range);
5167 return hr;
5168}
5169
5171{
5174 HRESULT hr;
5175
5176 TRACE("(%p)->(%ld %ld %p)\n", This, unit, count, delta);
5177
5178 if (!This->services)
5179 return CO_E_RELEASED;
5180
5181 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5182 hr = textrange_movestart(range, This->services->editor, unit, count, delta);
5183 ITextRange_Release(range);
5184 return hr;
5185}
5186
5188 LONG *delta)
5189{
5192 HRESULT hr;
5193
5194 TRACE("(%p)->(%ld %ld %p)\n", This, unit, count, delta);
5195
5196 if (!This->services)
5197 return CO_E_RELEASED;
5198
5199 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5200 hr = textrange_movestart(range, This->services->editor, unit, count, delta);
5201 ITextRange_Release(range);
5202 return hr;
5203}
5204
5206 LONG *delta)
5207{
5210 HRESULT hr;
5211
5212 TRACE("(%p)->(%ld %ld %p)\n", This, unit, count, delta);
5213
5214 if (!This->services)
5215 return CO_E_RELEASED;
5216
5217 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5218 hr = textrange_moveend(range, This->services->editor, unit, count, delta);
5219 ITextRange_Release(range);
5220 return hr;
5221}
5222
5224 LONG *delta)
5225{
5227
5228 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
5229
5230 if (!This->services)
5231 return CO_E_RELEASED;
5232
5233 return E_NOTIMPL;
5234}
5235
5237 LONG *delta)
5238{
5240
5241 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
5242
5243 if (!This->services)
5244 return CO_E_RELEASED;
5245
5246 return E_NOTIMPL;
5247}
5248
5250 LONG *delta)
5251{
5253
5254 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
5255
5256 if (!This->services)
5257 return CO_E_RELEASED;
5258
5259 return E_NOTIMPL;
5260}
5261
5263 LONG *delta)
5264{
5266
5267 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
5268
5269 if (!This->services)
5270 return CO_E_RELEASED;
5271
5272 return E_NOTIMPL;
5273}
5274
5276 LONG *delta)
5277{
5279
5280 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
5281
5282 if (!This->services)
5283 return CO_E_RELEASED;
5284
5285 return E_NOTIMPL;
5286}
5287
5289 LONG *delta)
5290{
5292
5293 FIXME("(%p)->(%s %ld %p): stub\n", This, debugstr_variant(charset), count, delta);
5294
5295 if (!This->services)
5296 return CO_E_RELEASED;
5297
5298 return E_NOTIMPL;
5299}
5300
5302 LONG *length)
5303{
5305
5306 FIXME("(%p)->(%s %ld %lx %p): stub\n", This, debugstr_w(text), count, flags, length);
5307
5308 if (!This->services)
5309 return CO_E_RELEASED;
5310
5311 FIXME("not implemented\n");
5312 return E_NOTIMPL;
5313}
5314
5317{
5319
5320 FIXME("(%p)->(%s %ld %lx %p): stub\n", This, debugstr_w(text), count, flags, length);
5321
5322 if (!This->services)
5323 return CO_E_RELEASED;
5324
5325 return E_NOTIMPL;
5326}
5327
5330{
5332
5333 FIXME("(%p)->(%s %ld %lx %p): stub\n", This, debugstr_w(text), count, flags, length);
5334
5335 if (!This->services)
5336 return CO_E_RELEASED;
5337
5338 return E_NOTIMPL;
5339}
5340
5342 LONG *delta)
5343{
5345
5346 FIXME("(%p)->(%ld %ld %p): stub\n", This, unit, count, delta);
5347
5348 if (!This->services)
5349 return CO_E_RELEASED;
5350
5351 return E_NOTIMPL;
5352}
5353
5355{
5358 HRESULT hr;
5359
5360 TRACE("(%p)->(%p): stub\n", This, v);
5361
5362 if (!This->services)
5363 return CO_E_RELEASED;
5364
5365 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5366 hr = textrange_copy_or_cut(range, This->services->editor, TRUE, v);
5367 ITextRange_Release(range);
5368 return hr;
5369}
5370
5372{
5375 HRESULT hr;
5376
5377 TRACE("(%p)->(%p)\n", This, v);
5378
5379 if (!This->services)
5380 return CO_E_RELEASED;
5381
5382 ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
5383 hr = textrange_copy_or_cut(range, This->services->editor, FALSE, v);
5384 ITextRange_Release(range);
5385 return hr;
5386}
5387
5389{
5391
5392 FIXME("(%p)->(%s %lx): stub\n", This, debugstr_variant(v), format);
5393
5394 if (!This->services)
5395 return CO_E_RELEASED;
5396
5397 return E_NOTIMPL;
5398}
5399
5401 LONG *ret)
5402{
5404
5405 FIXME("(%p)->(%s %lx %p): stub\n", This, debugstr_variant(v), format, ret);
5406
5407 if (!This->services)
5408 return CO_E_RELEASED;
5409
5410 return E_NOTIMPL;
5411}
5412
5414{
5416
5417 FIXME("(%p)->(%p): stub\n", This, ret);
5418
5419 if (!This->services)
5420 return CO_E_RELEASED;
5421
5422 return E_NOTIMPL;
5423}
5424
5426{
5428
5429 FIXME("(%p)->(%ld): stub\n", This, type);
5430
5431 if (!This->services)
5432 return CO_E_RELEASED;
5433
5434 return E_NOTIMPL;
5435}
5436
5438{
5440
5441 FIXME("(%p)->(%ld %p %p): stub\n", This, type, cx, cy);
5442
5443 if (!This->services)
5444 return CO_E_RELEASED;
5445
5446 return E_NOTIMPL;
5447}
5448
5450 LONG extend)
5451{
5453
5454 FIXME("(%p)->(%ld %ld %ld %ld): stub\n", This, x, y, type, extend);
5455
5456 if (!This->services)
5457 return CO_E_RELEASED;
5458
5459 return E_NOTIMPL;
5460}
5461
5463{
5465
5466 FIXME("(%p)->(%ld): stub\n", This, value);
5467
5468 if (!This->services)
5469 return CO_E_RELEASED;
5470
5471 return E_NOTIMPL;
5472}
5473
5475{
5477
5478 FIXME("(%p)->(%p): stub\n", This, ppv);
5479
5480 if (!This->services)
5481 return CO_E_RELEASED;
5482
5483 return E_NOTIMPL;
5484}
5485
5486/*** ITextSelection methods ***/
5488{
5490
5491 FIXME("(%p)->(%p): stub\n", This, flags);
5492
5493 if (!This->services)
5494 return CO_E_RELEASED;
5495
5496 return E_NOTIMPL;
5497}
5498
5500{
5502
5503 FIXME("(%p)->(%lx): stub\n", This, flags);
5504
5505 if (!This->services)
5506 return CO_E_RELEASED;
5507
5508 return E_NOTIMPL;
5509}
5510
5512{
5514
5515 FIXME("(%p)->(%p): stub\n", This, type);
5516
5517 if (!This->services)
5518 return CO_E_RELEASED;
5519
5520 return E_NOTIMPL;
5521}
5522
5524 LONG extend, LONG *delta)
5525{
5527
5528 FIXME("(%p)->(%ld %ld %ld %p): stub\n", This, unit, count, extend, delta);
5529
5530 if (!This->services)
5531 return CO_E_RELEASED;
5532
5533 return E_NOTIMPL;
5534}
5535
5537 LONG extend, LONG *delta)
5538{
5540
5541 FIXME("(%p)->(%ld %ld %ld %p): stub\n", This, unit, count, extend, delta);
5542
5543 if (!This->services)
5544 return CO_E_RELEASED;
5545
5546 return E_NOTIMPL;
5547}
5548
5550 LONG extend, LONG *delta)
5551{
5553
5554 FIXME("(%p)->(%ld %ld %ld %p): stub\n", This, unit, count, extend, delta);
5555
5556 if (!This->services)
5557 return CO_E_RELEASED;
5558
5559 return E_NOTIMPL;
5560}
5561
5563 LONG extend, LONG *delta)
5564{
5566
5567 FIXME("(%p)->(%ld %ld %ld %p): stub\n", This, unit, count, extend, delta);
5568
5569 if (!This->services)
5570 return CO_E_RELEASED;
5571
5572 return E_NOTIMPL;
5573}
5574
5576 LONG *delta)
5577{
5579
5580 FIXME("(%p)->(%ld %ld %p): stub\n", This, unit, extend, delta);
5581
5582 if (!This->services)
5583 return CO_E_RELEASED;
5584
5585 return E_NOTIMPL;
5586}
5587
5589 LONG *delta)
5590{
5592
5593 FIXME("(%p)->(%ld %ld %p): stub\n", This, unit, extend, delta);
5594
5595 if (!This->services)
5596 return CO_E_RELEASED;
5597
5598 return E_NOTIMPL;
5599}
5600
5602{
5604
5605 FIXME("(%p)->(%s): stub\n", This, debugstr_w(text));
5606
5607 if (!This->services)
5608 return CO_E_RELEASED;
5609
5610 return E_NOTIMPL;
5611}
5612
5613static const ITextSelectionVtbl tsvt = {
5682};
5683
5685{
5686 struct text_selection *txtSel = malloc(sizeof *txtSel);
5687 if (!txtSel)
5688 return NULL;
5689
5690 txtSel->ITextSelection_iface.lpVtbl = &tsvt;
5691 txtSel->ref = 1;
5692 txtSel->services = services;
5693 return txtSel;
5694}
5695
5696static void convert_sizel(const ME_Context *c, const SIZEL* szl, SIZE* sz)
5697{
5698 /* sizel is in .01 millimeters, sz in pixels */
5699 sz->cx = MulDiv(szl->cx, c->dpi.cx, 2540);
5700 sz->cy = MulDiv(szl->cy, c->dpi.cy, 2540);
5701}
5702
5703/******************************************************************************
5704 * ME_GetOLEObjectSize
5705 *
5706 * Sets run extent for OLE objects.
5707 */
5708void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize)
5709{
5710 IDataObject* ido;
5711 FORMATETC fmt;
5712 STGMEDIUM stgm;
5713 DIBSECTION dibsect;
5714 ENHMETAHEADER emh;
5715
5716 assert(run->nFlags & MERF_GRAPHICS);
5717 assert(run->reobj);
5718
5719 if (run->reobj->obj.sizel.cx != 0 || run->reobj->obj.sizel.cy != 0)
5720 {
5721 convert_sizel(c, &run->reobj->obj.sizel, pSize);
5722 if (c->editor->nZoomNumerator != 0)
5723 {
5724 pSize->cx = MulDiv(pSize->cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5725 pSize->cy = MulDiv(pSize->cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5726 }
5727 return;
5728 }
5729
5730 if (!run->reobj->obj.poleobj)
5731 {
5732 pSize->cx = pSize->cy = 0;
5733 return;
5734 }
5735
5736 if (IOleObject_QueryInterface(run->reobj->obj.poleobj, &IID_IDataObject, (void**)&ido) != S_OK)
5737 {
5738 FIXME("Query Interface IID_IDataObject failed!\n");
5739 pSize->cx = pSize->cy = 0;
5740 return;
5741 }
5742 fmt.cfFormat = CF_BITMAP;
5743 fmt.ptd = NULL;
5744 fmt.dwAspect = DVASPECT_CONTENT;
5745 fmt.lindex = -1;
5746 fmt.tymed = TYMED_GDI;
5747 if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5748 {
5749 fmt.cfFormat = CF_ENHMETAFILE;
5750 fmt.tymed = TYMED_ENHMF;
5751 if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5752 {
5753 FIXME("unsupported format\n");
5754 pSize->cx = pSize->cy = 0;
5755 IDataObject_Release(ido);
5756 return;
5757 }
5758 }
5759 IDataObject_Release(ido);
5760
5761 switch (stgm.tymed)
5762 {
5763 case TYMED_GDI:
5764 GetObjectW(stgm.hBitmap, sizeof(dibsect), &dibsect);
5765 pSize->cx = dibsect.dsBm.bmWidth;
5766 pSize->cy = dibsect.dsBm.bmHeight;
5767 break;
5768 case TYMED_ENHMF:
5769 GetEnhMetaFileHeader(stgm.hEnhMetaFile, sizeof(emh), &emh);
5770 pSize->cx = emh.rclBounds.right - emh.rclBounds.left;
5771 pSize->cy = emh.rclBounds.bottom - emh.rclBounds.top;
5772 break;
5773 default:
5774 FIXME("Unsupported tymed %ld\n", stgm.tymed);
5775 break;
5776 }
5777 ReleaseStgMedium(&stgm);
5778 if (c->editor->nZoomNumerator != 0)
5779 {
5780 pSize->cx = MulDiv(pSize->cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5781 pSize->cy = MulDiv(pSize->cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5782 }
5783}
5784
5785void draw_ole( ME_Context *c, int x, int y, ME_Run *run, BOOL selected )
5786{
5787 IDataObject* ido;
5788 IViewObject* ivo;
5789 FORMATETC fmt;
5790 STGMEDIUM stgm;
5791 DIBSECTION dibsect;
5792 ENHMETAHEADER emh;
5793 HDC hMemDC;
5794 SIZE sz;
5795 BOOL has_size;
5796 HBITMAP old_bm;
5797 RECT rc;
5798
5799 assert(run->nFlags & MERF_GRAPHICS);
5800 assert(run->reobj);
5801
5802 if (!run->reobj->obj.poleobj) return;
5803
5804 if (SUCCEEDED(IOleObject_QueryInterface(run->reobj->obj.poleobj, &IID_IViewObject, (void**)&ivo)))
5805 {
5806 HRESULT hr;
5807 RECTL bounds;
5808
5809 convert_sizel(c, &run->reobj->obj.sizel, &sz);
5810 if (c->editor->nZoomNumerator != 0)
5811 {
5812 sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5813 sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5814 }
5815
5816 bounds.left = x;
5817 bounds.top = y - sz.cy;
5818 bounds.right = x + sz.cx;
5819 bounds.bottom = y;
5820
5821 hr = IViewObject_Draw(ivo, DVASPECT_CONTENT, -1, 0, 0, 0, c->hDC, &bounds, NULL, NULL, 0);
5822 if (FAILED(hr))
5823 {
5824 WARN("failed to draw object: %#08lx\n", hr);
5825 }
5826
5827 IViewObject_Release(ivo);
5828 return;
5829 }
5830
5831 if (IOleObject_QueryInterface(run->reobj->obj.poleobj, &IID_IDataObject, (void**)&ido) != S_OK)
5832 {
5833 FIXME("Couldn't get interface\n");
5834 return;
5835 }
5836 has_size = run->reobj->obj.sizel.cx != 0 || run->reobj->obj.sizel.cy != 0;
5837 fmt.cfFormat = CF_BITMAP;
5838 fmt.ptd = NULL;
5839 fmt.dwAspect = DVASPECT_CONTENT;
5840 fmt.lindex = -1;
5841 fmt.tymed = TYMED_GDI;
5842 if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5843 {
5844 fmt.cfFormat = CF_ENHMETAFILE;
5845 fmt.tymed = TYMED_ENHMF;
5846 if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
5847 {
5848 FIXME("Couldn't get storage medium\n");
5849 IDataObject_Release(ido);
5850 return;
5851 }
5852 }
5853 IDataObject_Release(ido);
5854
5855 switch (stgm.tymed)
5856 {
5857 case TYMED_GDI:
5858 GetObjectW(stgm.hBitmap, sizeof(dibsect), &dibsect);
5859 hMemDC = CreateCompatibleDC(c->hDC);
5860 old_bm = SelectObject(hMemDC, stgm.hBitmap);
5861 if (has_size)
5862 {
5863 convert_sizel(c, &run->reobj->obj.sizel, &sz);
5864 } else {
5865 sz.cx = dibsect.dsBm.bmWidth;
5866 sz.cy = dibsect.dsBm.bmHeight;
5867 }
5868 if (c->editor->nZoomNumerator != 0)
5869 {
5870 sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5871 sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5872 }
5873 StretchBlt(c->hDC, x, y - sz.cy, sz.cx, sz.cy,
5874 hMemDC, 0, 0, dibsect.dsBm.bmWidth, dibsect.dsBm.bmHeight, SRCCOPY);
5875
5876 SelectObject(hMemDC, old_bm);
5877 DeleteDC(hMemDC);
5878 break;
5879 case TYMED_ENHMF:
5880 GetEnhMetaFileHeader(stgm.hEnhMetaFile, sizeof(emh), &emh);
5881 if (has_size)
5882 {
5883 convert_sizel(c, &run->reobj->obj.sizel, &sz);
5884 } else {
5885 sz.cx = emh.rclBounds.right - emh.rclBounds.left;
5886 sz.cy = emh.rclBounds.bottom - emh.rclBounds.top;
5887 }
5888 if (c->editor->nZoomNumerator != 0)
5889 {
5890 sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5891 sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
5892 }
5893
5894 rc.left = x;
5895 rc.top = y - sz.cy;
5896 rc.right = x + sz.cx;
5897 rc.bottom = y;
5898 PlayEnhMetaFile(c->hDC, stgm.hEnhMetaFile, &rc);
5899 break;
5900 default:
5901 FIXME("Unsupported tymed %ld\n", stgm.tymed);
5902 selected = FALSE;
5903 break;
5904 }
5905 ReleaseStgMedium(&stgm);
5906
5907 if (selected && !c->editor->bHideSelection)
5908 PatBlt(c->hDC, x, y - sz.cy, sz.cx, sz.cy, DSTINVERT);
5909}
5910
5911void ME_DeleteReObject(struct re_object *reobj)
5912{
5913 if (reobj->obj.poleobj) IOleObject_Release(reobj->obj.poleobj);
5914 if (reobj->obj.pstg) IStorage_Release(reobj->obj.pstg);
5915 if (reobj->obj.polesite) IOleClientSite_Release(reobj->obj.polesite);
5916 free(reobj);
5917}
5918
5920{
5921 *dst = *src;
5922 dst->poleobj = NULL;
5923 dst->pstg = NULL;
5924 dst->polesite = NULL;
5925
5926 if ((flags & REO_GETOBJ_POLEOBJ) && src->poleobj)
5927 {
5928 dst->poleobj = src->poleobj;
5929 IOleObject_AddRef(dst->poleobj);
5930 }
5931 if ((flags & REO_GETOBJ_PSTG) && src->pstg)
5932 {
5933 dst->pstg = src->pstg;
5934 IStorage_AddRef(dst->pstg);
5935 }
5936 if ((flags & REO_GETOBJ_POLESITE) && src->polesite)
5937 {
5938 dst->polesite = src->polesite;
5939 IOleClientSite_AddRef(dst->polesite);
5940 }
5941}
5942
5944{
5947
5948 if (services->text_selection)
5949 {
5950 services->text_selection->services = NULL;
5951 ITextSelection_Release( &services->text_selection->ITextSelection_iface );
5952 }
5953
5954 LIST_FOR_EACH_ENTRY( range, &services->rangelist, ITextRangeImpl, child.entry )
5955 range->child.reole = NULL;
5956
5957 LIST_FOR_EACH_ENTRY( site, &services->clientsites, IOleClientSiteImpl, child.entry )
5958 site->child.reole = NULL;
5959}
small capitals from c petite p scientific f SUBSCRIPT
Definition: afcover.h:86
Arabic default style
Definition: afstyles.h:94
#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 WARN(fmt,...)
Definition: precomp.h:61
#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
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
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
LCID lcid
Definition: locale.c:5656
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:923
void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style)
Definition: caret.c:584
int ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs, BOOL final_eop)
Definition: caret.c:709
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
HRESULT editor_insert_oleobj(ME_TextEditor *editor, const REOBJECT *reo)
Definition: caret.c:504
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, LONG *from, LONG *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:402
void ME_ReplaceSel(ME_TextEditor *editor, BOOL can_undo, const WCHAR *str, int len)
Definition: editor.c:3170
HRESULT editor_copy_or_cut(ME_TextEditor *editor, BOOL cut, ME_Cursor *start, int count, IDataObject **data_out)
Definition: editor.c:2362
int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen, const ME_Cursor *start, int srcChars, BOOL bCRLF, BOOL bEOP)
Definition: editor.c:4325
static HRESULT WINAPI ITextRange_fnMoveStartUntil(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2434
static ITextParaVtbl textparavtbl
Definition: richole.c:3964
static HRESULT WINAPI ITextSelection_fnGetEnd(ITextSelection *me, LONG *pcpLim)
Definition: richole.c:4848
static HRESULT WINAPI IOleClientSite_fnGetContainer(IOleClientSite *iface, IOleContainer **ppContainer)
Definition: richole.c:1034
static HRESULT WINAPI TextPara_SetRightIndent(ITextPara *iface, FLOAT value)
Definition: richole.c:3866
static HRESULT textrange_get_storylength(ME_TextEditor *editor, LONG *length)
Definition: richole.c:282
static HRESULT WINAPI ITextRange_fnMoveWhile(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2382
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode)
Definition: richole.c:1121
static HRESULT WINAPI IRichEditOle_fnConvertObject(IRichEditOle *iface, LONG iob, REFCLSID class, LPCSTR user_type)
Definition: richole.c:953
static HRESULT WINAPI ITextSelection_fnGetFlags(ITextSelection *me, LONG *flags)
Definition: richole.c:5487
static HRESULT WINAPI TextPara_GetLineSpacingRule(ITextPara *iface, LONG *value)
Definition: richole.c:3754
static HRESULT WINAPI ITextSelection_fnMoveStart(ITextSelection *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:5187
static HRESULT WINAPI ITextRange_fnCollapse(ITextRange *me, LONG bStart)
Definition: richole.c:1900
static HRESULT WINAPI ITextSelection_fnStartOf(ITextSelection *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:5134
static HRESULT WINAPI ITextRange_fnGetStoryLength(ITextRange *me, LONG *length)
Definition: richole.c:1860
static HRESULT WINAPI TextFont_GetIDsOfNames(ITextFont *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: richole.c:2806
const IRichEditOleVtbl re_ole_vtbl
Definition: richole.c:1419
static HRESULT WINAPI ITextDocument2Old_fnGetFEFlags(ITextDocument2Old *iface, LONG *flags)
Definition: richole.c:4464
static HRESULT WINAPI ITextSelection_fnMoveDown(ITextSelection *me, LONG unit, LONG count, LONG extend, LONG *delta)
Definition: richole.c:5562
static HRESULT WINAPI ITextSelection_fnDelete(ITextSelection *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:5341
static HRESULT WINAPI ITextRange_fnGetEmbeddedObject(ITextRange *me, IUnknown **ppv)
Definition: richole.c:2665
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:409
static HRESULT WINAPI ITextRange_fnScrollIntoView(ITextRange *me, LONG value)
Definition: richole.c:2633
static HRESULT WINAPI ITextDocument2Old_fnReleaseImmContext(ITextDocument2Old *iface, LONG context)
Definition: richole.c:4397
range_update_op
Definition: richole.c:203
@ RANGE_UPDATE_DELETE
Definition: richole.c:204
static HRESULT WINAPI ITextRange_fnMove(ITextRange *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2240
static HRESULT WINAPI TextPara_SetWidowControl(ITextPara *iface, LONG value)
Definition: richole.c:3922
static HRESULT WINAPI ITextRange_fnSetChar(ITextRange *me, LONG ch)
Definition: richole.c:1656
static HRESULT WINAPI ITextSelection_fnSelect(ITextSelection *me)
Definition: richole.c:5121
static HRESULT WINAPI TextFont_GetDuplicate(ITextFont *iface, ITextFont **ret)
Definition: richole.c:2846
static HRESULT WINAPI TextFont_GetSubscript(ITextFont *iface, LONG *value)
Definition: richole.c:3366
static HRESULT WINAPI ITextSelection_fnGetPara(ITextSelection *me, ITextPara **para)
Definition: richole.c:4922
static HRESULT WINAPI ITextRange_fnInStory(ITextRange *me, ITextRange *pRange, LONG *ret)
Definition: richole.c:2018
static HRESULT WINAPI TextFont_SetBold(ITextFont *iface, LONG value)
Definition: richole.c:3116
static HRESULT textrange_endof(ITextRange *range, ME_TextEditor *editor, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:2121
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnUIActivate(IOleInPlaceSite *iface)
Definition: richole.c:1142
static HRESULT get_textfont_prop(const ITextFontImpl *font, enum textfont_prop_id propid, textfont_prop_val *value)
Definition: richole.c:655
static HRESULT WINAPI TextFont_SetSuperscript(ITextFont *iface, LONG value)
Definition: richole.c:3387
static HRESULT WINAPI TextPara_GetTypeInfo(ITextPara *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: richole.c:3573
static HRESULT WINAPI TextPara_GetLeftIndent(ITextPara *iface, FLOAT *value)
Definition: richole.c:3740
static const ITextRangeVtbl trvt
Definition: richole.c:2677
static ITextFontVtbl textfontvtbl
Definition: richole.c:3422
static HRESULT WINAPI IRichEditOle_fnSaveCompleted(IRichEditOle *iface, LONG iob, LPSTORAGE lpstg)
Definition: richole.c:1387
static HRESULT WINAPI TextFont_SetShadow(ITextFont *iface, LONG value)
Definition: richole.c:3303
static HRESULT WINAPI ITextSelection_fnInRange(ITextSelection *me, ITextRange *range, LONG *ret)
Definition: richole.c:5055
static HRESULT WINAPI ITextSelection_fnChangeCase(ITextSelection *me, LONG type)
Definition: richole.c:5425
static HRESULT WINAPI ITextSelection_fnFindTextEnd(ITextSelection *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:5328
static HRESULT WINAPI TextPara_SetListLevelIndex(ITextPara *iface, LONG value)
Definition: richole.c:3782
static HRESULT WINAPI TextPara_GetTabCount(ITextPara *iface, LONG *value)
Definition: richole.c:3929
static HRESULT WINAPI ITextSelection_fnEndOf(ITextSelection *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:5152
static HRESULT WINAPI ITextRange_fnGetPara(ITextRange *me, ITextPara **para)
Definition: richole.c:1833
static HRESULT WINAPI ITextDocument2Old_fnGetImmContext(ITextDocument2Old *iface, LONG *context)
Definition: richole.c:4388
static const IOleInPlaceSiteVtbl olestvt
Definition: richole.c:1200
static HRESULT WINAPI TextFont_GetAnimation(ITextFont *iface, LONG *value)
Definition: richole.c:3076
static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnAddRef(IOleInPlaceSite *iface)
Definition: richole.c:1094
static HRESULT WINAPI ITextRange_fnChangeCase(ITextRange *me, LONG type)
Definition: richole.c:2596
static const ITextSelectionVtbl tsvt
Definition: richole.c:5613
static HRESULT WINAPI ITextDocument2Old_fnRange(ITextDocument2Old *iface, LONG cp1, LONG cp2, ITextRange **ppRange)
Definition: richole.c:4321
static HRESULT range_Collapse(LONG bStart, LONG *start, LONG *end)
Definition: richole.c:1888
static HRESULT WINAPI TextPara_SetListType(ITextPara *iface, LONG value)
Definition: richole.c:3824
static HRESULT WINAPI TextFont_GetStrikeThrough(ITextFont *iface, LONG *value)
Definition: richole.c:3352
static HRESULT WINAPI ITextDocument2Old_fnGetCaretType(ITextDocument2Old *iface, LONG *type)
Definition: richole.c:4370
static HRESULT WINAPI ITextSelection_fnSetPoint(ITextSelection *me, LONG x, LONG y, LONG type, LONG extend)
Definition: richole.c:5449
void richole_release_children(struct text_services *services)
Definition: richole.c:5943
static HRESULT WINAPI ITextRange_fnDelete(ITextRange *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2499
static HRESULT WINAPI ITextSelection_fnMoveEndWhile(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5249
static struct text_selection * text_selection_create(struct text_services *)
Definition: richole.c:5684
static HRESULT WINAPI ITextRange_fnGetPoint(ITextRange *me, LONG type, LONG *cx, LONG *cy)
Definition: richole.c:2608
static HRESULT WINAPI ITextSelection_fnSetEnd(ITextSelection *me, LONG value)
Definition: richole.c:4864
static HRESULT WINAPI ITextSelection_fnGetStoryType(ITextSelection *me, LONG *value)
Definition: richole.c:4967
static void textfont_reset_to_default(ITextFontImpl *font)
Definition: richole.c:2883
static HRESULT WINAPI TextPara_GetRightIndent(ITextPara *iface, FLOAT *value)
Definition: richole.c:3859
static HRESULT WINAPI ITextSelection_fnCut(ITextSelection *me, VARIANT *v)
Definition: richole.c:5354
static HRESULT WINAPI TextPara_QueryInterface(ITextPara *iface, REFIID riid, void **ppv)
Definition: richole.c:3522
static HRESULT WINAPI ITextDocument2Old_fnIMEInProgress(ITextDocument2Old *iface, LONG mode)
Definition: richole.c:4491
static HRESULT WINAPI ITextSelection_fnMoveStartWhile(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5236
static HRESULT WINAPI ITextRange_fnMoveStartWhile(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2395
static HRESULT WINAPI IRichEditOle_fnQueryInterface(IRichEditOle *iface, REFIID riid, LPVOID *ppvObj)
Definition: richole.c:916
static HRESULT WINAPI ITextSelection_fnScrollIntoView(ITextSelection *me, LONG value)
Definition: richole.c:5462
static HRESULT WINAPI ITextRange_fnMoveEnd(ITextRange *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2369
static HRESULT WINAPI ITextDocument2Old_fnOpen(ITextDocument2Old *iface, VARIANT *pVar, LONG Flags, LONG CodePage)
Definition: richole.c:4200
static HRESULT WINAPI TextPara_GetPageBreakBefore(ITextPara *iface, LONG *value)
Definition: richole.c:3845
static HRESULT WINAPI ITextSelection_fnGetType(ITextSelection *me, LONG *type)
Definition: richole.c:5511
static HRESULT WINAPI ITextSelection_fnCollapse(ITextSelection *me, LONG bStart)
Definition: richole.c:4983
static HRESULT WINAPI TextPara_SetListTab(ITextPara *iface, FLOAT value)
Definition: richole.c:3810
static IOleClientSiteImpl * impl_from_IOleInPlaceSite(IOleInPlaceSite *iface)
Definition: richole.c:253
#define CHARFORMAT_SET_B_FIELD(mask, value)
static const DWORD textfont_prop_masks[][2]
Definition: richole.c:170
static HRESULT WINAPI TextFont_GetLanguageID(ITextFont *iface, LONG *value)
Definition: richole.c:3207
static HRESULT WINAPI TextPara_GetListAlignment(ITextPara *iface, LONG *value)
Definition: richole.c:3761
static HRESULT WINAPI TextFont_SetAllCaps(ITextFont *iface, LONG value)
Definition: richole.c:3069
static HRESULT WINAPI TextFont_GetTypeInfo(ITextFont *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: richole.c:2792
static HRESULT WINAPI ITextDocument2Old_fnGetClientRect(ITextDocument2Old *iface, LONG type, LONG *left, LONG *top, LONG *right, LONG *bottom)
Definition: richole.c:4436
static HRESULT WINAPI ITextRange_fnMoveEndWhile(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2408
static HRESULT WINAPI TextFont_SetSmallCaps(ITextFont *iface, LONG value)
Definition: richole.c:3331
static HRESULT WINAPI ITextDocument2Old_fnSetEffectColor(ITextDocument2Old *iface, LONG index, COLORREF cr)
Definition: richole.c:4352
static HRESULT WINAPI ITextRange_fnFindText(ITextRange *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:2460
static void textrange_set_font(ITextRange *range, ITextFont *font)
Definition: richole.c:490
@ ITextSelection_tid
Definition: richole.c:60
@ LAST_tid
Definition: richole.c:63
@ ITextPara_tid
Definition: richole.c:62
@ NULL_tid
Definition: richole.c:57
@ ITextRange_tid
Definition: richole.c:59
@ ITextDocument_tid
Definition: richole.c:58
@ ITextFont_tid
Definition: richole.c:61
static BOOL is_equal_textfont_prop_value(enum textfont_prop_id propid, textfont_prop_val *left, textfont_prop_val *right)
Definition: richole.c:320
static HRESULT WINAPI ITextSelection_fnMoveEnd(ITextSelection *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:5205
static HRESULT textrange_inrange(LONG start, LONG end, ITextRange *range, LONG *ret)
Definition: richole.c:1985
static ITypeLib * typelib
Definition: richole.c:54
static HRESULT WINAPI IRichEditOle_fnGetClipboardData(IRichEditOle *iface, CHARRANGE *lpchrg, DWORD reco, LPDATAOBJECT *lplpdataobj)
Definition: richole.c:1250
static HRESULT WINAPI TextPara_SetDuplicate(ITextPara *iface, ITextPara *para)
Definition: richole.c:3635
static void init_textfont_prop_value(enum textfont_prop_id propid, textfont_prop_val *v)
Definition: richole.c:358
static HRESULT WINAPI TextFont_IsEqual(ITextFont *iface, ITextFont *font, LONG *ret)
Definition: richole.c:2876
static HRESULT WINAPI ITextDocument2Old_fnBeginEditCollection(ITextDocument2Old *iface)
Definition: richole.c:4237
static HRESULT WINAPI ITextDocument2Old_fnGetStoryRanges(ITextDocument2Old *iface, ITextStoryRanges **ppStories)
Definition: richole.c:4157
static HRESULT WINAPI IRichEditOle_fnGetClientSite(IRichEditOle *iface, IOleClientSite **clientsite)
Definition: richole.c:1237
static HRESULT WINAPI ITextRange_fnSelect(ITextRange *me)
Definition: richole.c:2063
static HRESULT textrange_startof(ITextRange *range, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:2076
static HRESULT WINAPI ITextRange_fnIsEqual(ITextRange *me, ITextRange *range, LONG *ret)
Definition: richole.c:2045
static HRESULT WINAPI TextFont_GetName(ITextFont *iface, BSTR *value)
Definition: richole.c:3221
static ULONG WINAPI ITextSelection_fnRelease(ITextSelection *me)
Definition: richole.c:4611
static HRESULT WINAPI ITextRange_fnEndOf(ITextRange *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:2161
static HRESULT WINAPI ITextRange_fnGetEnd(ITextRange *me, LONG *end)
Definition: richole.c:1757
static HRESULT WINAPI ITextSelection_fnPaste(ITextSelection *me, VARIANT *v, LONG format)
Definition: richole.c:5388
static HRESULT WINAPI TextFont_GetStyle(ITextFont *iface, LONG *value)
Definition: richole.c:3048
static HRESULT WINAPI TextPara_GetWidowControl(ITextPara *iface, LONG *value)
Definition: richole.c:3915
static ULONG WINAPI TextPara_Release(ITextPara *iface)
Definition: richole.c:3549
static HRESULT WINAPI ITextSelection_fnSetFlags(ITextSelection *me, LONG flags)
Definition: richole.c:5499
static HRESULT WINAPI ITextSelection_fnMoveUp(ITextSelection *me, LONG unit, LONG count, LONG extend, LONG *delta)
Definition: richole.c:5549
static HRESULT WINAPI TextPara_Reset(ITextPara *iface, LONG value)
Definition: richole.c:3656
static HRESULT WINAPI ITextDocument2Old_fnSysBeep(ITextDocument2Old *iface)
Definition: richole.c:4500
static HRESULT set_textfont_propl(ITextFontImpl *font, enum textfont_prop_id propid, LONG value)
Definition: richole.c:817
static ULONG WINAPI ITextRange_fnRelease(ITextRange *me)
Definition: richole.c:1471
static HRESULT WINAPI ITextSelection_fnGetTypeInfoCount(ITextSelection *me, UINT *pctinfo)
Definition: richole.c:4620
static HRESULT WINAPI ITextRange_fnGetFont(ITextRange *me, ITextFont **font)
Definition: richole.c:1802
static HRESULT WINAPI IRichEditOle_fnGetObject(IRichEditOle *iface, LONG iob, REOBJECT *lpreobject, DWORD dwFlags)
Definition: richole.c:1283
void ME_CopyReObject(REOBJECT *dst, const REOBJECT *src, DWORD flags)
Definition: richole.c:5919
static FLOAT twips_to_points(LONG value)
Definition: richole.c:399
static HRESULT WINAPI TextFont_GetSmallCaps(ITextFont *iface, LONG *value)
Definition: richole.c:3324
static HRESULT WINAPI ITextDocument2Old_fnCheckTextLimit(ITextDocument2Old *iface, LONG cch, LONG *exceed)
Definition: richole.c:4482
static ULONG WINAPI IOleClientSite_fnAddRef(IOleClientSite *iface)
Definition: richole.c:988
static HRESULT WINAPI TextPara_GetListTab(ITextPara *iface, FLOAT *value)
Definition: richole.c:3803
static HRESULT get_textfont_propl(const ITextFontImpl *font, enum textfont_prop_id propid, LONG *value)
Definition: richole.c:709
static HRESULT WINAPI ITextSelection_fnCanPaste(ITextSelection *me, VARIANT *v, LONG format, LONG *ret)
Definition: richole.c:5400
static HRESULT textfont_getname_from_range(ITextRange *range, BSTR *ret)
Definition: richole.c:859
static ULONG WINAPI ITextDocument2Old_fnAddRef(ITextDocument2Old *iface)
Definition: richole.c:4048
static HRESULT WINAPI ITextDocument2Old_fnUpdate(ITextDocument2Old *iface, LONG mode)
Definition: richole.c:4509
static ULONG WINAPI IRichEditOle_fnAddRef(IRichEditOle *iface)
Definition: richole.c:923
static HRESULT WINAPI TextPara_GetListLevelIndex(ITextPara *iface, LONG *value)
Definition: richole.c:3775
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:2822
static HRESULT textrange_isequal(LONG start, LONG end, ITextRange *range, LONG *ret)
Definition: richole.c:2030
static HRESULT WINAPI TextFont_Reset(ITextFont *iface, LONG value)
Definition: richole.c:2983
static HRESULT create_textpara(ITextRange *, ITextPara **)
Definition: richole.c:4022
static HRESULT WINAPI ITextDocument2Old_fnGetSelectionEx(ITextDocument2Old *iface, ITextSelection **selection)
Definition: richole.c:4446
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnDeactivateAndUndo(IOleInPlaceSite *iface)
Definition: richole.c:1186
static HRESULT get_textfont_propf(const ITextFontImpl *font, enum textfont_prop_id propid, FLOAT *value)
Definition: richole.c:696
static HRESULT WINAPI ITextSelection_fnSetStart(ITextSelection *me, LONG value)
Definition: richole.c:4829
static HRESULT WINAPI IOleClientSite_fnQueryInterface(IOleClientSite *me, REFIID riid, LPVOID *ppvObj)
Definition: richole.c:966
static HRESULT WINAPI ITextSelection_fnCanEdit(ITextSelection *me, LONG *ret)
Definition: richole.c:5413
static LONG WINAPI IRichEditOle_fnGetLinkCount(IRichEditOle *iface)
Definition: richole.c:1275
static HRESULT WINAPI TextFont_SetLanguageID(ITextFont *iface, LONG value)
Definition: richole.c:3214
static HRESULT WINAPI ITextDocument2Old_fnQueryInterface(ITextDocument2Old *iface, REFIID riid, void **ppvObject)
Definition: richole.c:4041
void draw_ole(ME_Context *c, int x, int y, ME_Run *run, BOOL selected)
Definition: richole.c:5785
static HRESULT WINAPI TextPara_GetHyphenation(ITextPara *iface, LONG *value)
Definition: richole.c:3691
static HRESULT WINAPI TextFont_SetUnderline(ITextFont *iface, LONG value)
Definition: richole.c:3401
static HRESULT WINAPI TextFont_SetForeColor(ITextFont *iface, LONG value)
Definition: richole.c:3144
static HRESULT WINAPI TextPara_GetTypeInfoCount(ITextPara *iface, UINT *pctinfo)
Definition: richole.c:3565
static FLOAT points_to_twips(FLOAT value)
Definition: richole.c:404
void ME_DeleteReObject(struct re_object *reobj)
Definition: richole.c:5911
static HRESULT textrange_copy_or_cut(ITextRange *range, ME_TextEditor *editor, BOOL cut, VARIANT *v)
Definition: richole.c:2511
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnUIDeactivate(IOleInPlaceSite *iface, BOOL fUndoable)
Definition: richole.c:1165
static HRESULT WINAPI ITextRange_fnSetStart(ITextRange *me, LONG value)
Definition: richole.c:1745
static LONG WINAPI IRichEditOle_fnGetObjectCount(IRichEditOle *iface)
Definition: richole.c:1333
static HRESULT WINAPI ITextRange_fnCanPaste(ITextRange *me, VARIANT *v, LONG format, LONG *ret)
Definition: richole.c:2572
static HRESULT WINAPI IOleClientSite_fnShowObject(IOleClientSite *iface)
Definition: richole.c:1045
static HRESULT WINAPI TextFont_GetBackColor(ITextFont *iface, LONG *value)
Definition: richole.c:3095
static HRESULT WINAPI ITextDocument2Old_fnNew(ITextDocument2Old *iface)
Definition: richole.c:4193
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:1527
static HRESULT WINAPI TextPara_SetListStart(ITextPara *iface, LONG value)
Definition: richole.c:3796
static HRESULT WINAPI IOleClientSite_fnSaveObject(IOleClientSite *iface)
Definition: richole.c:1013
static HRESULT WINAPI ITextDocument2Old_fnEndEditCollection(ITextDocument2Old *iface)
Definition: richole.c:4244
static void textfont_apply_range_props(ITextFontImpl *font)
Definition: richole.c:2976
static HRESULT WINAPI ITextRange_fnGetStoryType(ITextRange *me, LONG *value)
Definition: richole.c:1872
static HRESULT range_GetChar(ME_TextEditor *editor, ME_Cursor *cursor, LONG *pch)
Definition: richole.c:1627
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnQueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppvObj)
Definition: richole.c:1088
static HRESULT WINAPI TextPara_GetKeepTogether(ITextPara *iface, LONG *value)
Definition: richole.c:3712
static HRESULT textrange_setend(const struct text_services *services, LONG value, LONG *start, LONG *end)
Definition: richole.c:1773
static HRESULT WINAPI TextFont_QueryInterface(ITextFont *iface, REFIID riid, void **ppv)
Definition: richole.c:2739
static HRESULT WINAPI ITextSelection_fnGetChar(ITextSelection *me, LONG *pch)
Definition: richole.c:4741
static HRESULT WINAPI TextFont_SetItalic(ITextFont *iface, LONG value)
Definition: richole.c:3186
static struct text_services * impl_from_ITextDocument2Old(ITextDocument2Old *iface)
Definition: richole.c:248
static HRESULT WINAPI ITextRange_fnSetText(ITextRange *me, BSTR str)
Definition: richole.c:1581
static const struct text_services * get_range_reole(ITextRange *range)
Definition: richole.c:483
static HRESULT WINAPI ITextSelection_fnMoveRight(ITextSelection *me, LONG unit, LONG count, LONG extend, LONG *delta)
Definition: richole.c:5536
static HRESULT WINAPI TextPara_SetSpaceBefore(ITextPara *iface, FLOAT value)
Definition: richole.c:3908
static HRESULT WINAPI ITextDocument2Old_fnGetWindow(ITextDocument2Old *iface, LONG *hwnd)
Definition: richole.c:4455
static HRESULT WINAPI TextFont_SetKerning(ITextFont *iface, FLOAT value)
Definition: richole.c:3200
static HRESULT WINAPI ITextDocument2Old_fnUpdateWindow(ITextDocument2Old *iface)
Definition: richole.c:4473
static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnRelease(IOleInPlaceSite *iface)
Definition: richole.c:1100
static HRESULT WINAPI TextPara_GetSpaceBefore(ITextPara *iface, FLOAT *value)
Definition: richole.c:3901
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnInPlaceDeactivate(IOleInPlaceSite *iface)
Definition: richole.c:1172
static HRESULT WINAPI TextFont_SetEmboss(ITextFont *iface, LONG value)
Definition: richole.c:3130
static HRESULT WINAPI ITextDocument2Old_fnRangeFromPoint(ITextDocument2Old *iface, LONG x, LONG y, ITextRange **ppRange)
Definition: richole.c:4334
static HRESULT WINAPI ITextSelection_fnMoveEndUntil(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5288
static HRESULT WINAPI ITextRange_fnGetFormattedText(ITextRange *me, ITextRange **range)
Definition: richole.c:1685
static HRESULT WINAPI ITextDocument2Old_fnGetTypeInfoCount(ITextDocument2Old *iface, UINT *pctinfo)
Definition: richole.c:4060
static HRESULT WINAPI ITextDocument2Old_fnGetStoryCount(ITextDocument2Old *iface, LONG *pCount)
Definition: richole.c:4150
static HRESULT WINAPI TextPara_SetHyphenation(ITextPara *iface, LONG value)
Definition: richole.c:3698
static HRESULT WINAPI ITextDocument2Old_fnSetSaved(ITextDocument2Old *iface, LONG Value)
Definition: richole.c:4172
static HRESULT WINAPI TextPara_GetIDsOfNames(ITextPara *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: richole.c:3587
static HRESULT WINAPI TextPara_IsEqual(ITextPara *iface, ITextPara *para, LONG *ret)
Definition: richole.c:3649
static HRESULT WINAPI ITextRange_fnFindTextEnd(ITextRange *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:2486
static HRESULT WINAPI ITextDocument2Old_fnAttachMsgFilter(ITextDocument2Old *iface, IUnknown *filter)
Definition: richole.c:4343
static HRESULT WINAPI TextPara_ClearAllTabs(ITextPara *iface)
Definition: richole.c:3943
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnDiscardUndoState(IOleInPlaceSite *iface)
Definition: richole.c:1179
static HRESULT WINAPI TextFont_GetSpacing(ITextFont *iface, FLOAT *value)
Definition: richole.c:3338
static HRESULT WINAPI ITextRange_fnExpand(ITextRange *me, LONG unit, LONG *delta)
Definition: richole.c:1912
static HRESULT CreateITextRange(struct text_services *services, LONG start, LONG end, ITextRange **ppRange)
Definition: richole.c:4305
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnGetWindowContext(IOleInPlaceSite *iface, IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
Definition: richole.c:1149
static HRESULT WINAPI ITextSelection_fnHomeKey(ITextSelection *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:5575
static HRESULT WINAPI TextPara_GetAlignment(ITextPara *iface, LONG *value)
Definition: richole.c:3677
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:4406
static HRESULT WINAPI TextFont_SetName(ITextFont *iface, BSTR value)
Definition: richole.c:3243
static HRESULT WINAPI ITextRange_fnCanEdit(ITextRange *me, LONG *ret)
Definition: richole.c:2584
static ULONG WINAPI ITextDocument2Old_fnRelease(ITextDocument2Old *iface)
Definition: richole.c:4054
static HRESULT WINAPI ITextRange_fnMoveUntil(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2421
static HRESULT WINAPI TextFont_SetSpacing(ITextFont *iface, FLOAT value)
Definition: richole.c:3345
static HRESULT WINAPI IRichEditOle_fnInsertObject(IRichEditOle *iface, REOBJECT *reo)
Definition: richole.c:1366
static HRESULT WINAPI ITextRange_fnGetText(ITextRange *me, BSTR *str)
Definition: richole.c:1545
textfont_prop_id
Definition: richole.c:141
@ FONT_SPACING
Definition: richole.c:160
@ FONT_UNDERLINE
Definition: richole.c:164
@ FONT_OUTLINE
Definition: richole.c:154
@ FONT_SIZE
Definition: richole.c:158
@ FONT_PROPID_LAST
Definition: richole.c:166
@ FONT_BACKCOLOR
Definition: richole.c:144
@ FONT_HIDDEN
Definition: richole.c:148
@ FONT_STRIKETHROUGH
Definition: richole.c:161
@ FONT_SUPERSCRIPT
Definition: richole.c:163
@ FONT_SMALLCAPS
Definition: richole.c:159
@ FONT_PROTECTED
Definition: richole.c:156
@ FONT_EMBOSS
Definition: richole.c:146
@ FONT_ALLCAPS
Definition: richole.c:142
@ FONT_ENGRAVE
Definition: richole.c:149
@ FONT_SUBSCRIPT
Definition: richole.c:162
@ FONT_BOLD
Definition: richole.c:145
@ FONT_LANGID
Definition: richole.c:152
@ FONT_PROPID_FIRST
Definition: richole.c:167
@ FONT_FORECOLOR
Definition: richole.c:147
@ FONT_POSITION
Definition: richole.c:155
@ FONT_NAME
Definition: richole.c:153
@ FONT_ANIMATION
Definition: richole.c:143
@ FONT_KERNING
Definition: richole.c:151
@ FONT_SHADOW
Definition: richole.c:157
@ FONT_WEIGHT
Definition: richole.c:165
@ FONT_ITALIC
Definition: richole.c:150
static HRESULT WINAPI ITextRange_fnPaste(ITextRange *me, VARIANT *v, LONG format)
Definition: richole.c:2560
static HRESULT WINAPI ITextRange_fnCut(ITextRange *me, VARIANT *v)
Definition: richole.c:2536
static HRESULT WINAPI TextPara_GetStyle(ITextPara *iface, LONG *value)
Definition: richole.c:3663
static HRESULT WINAPI ITextDocument2Old_fnGetSaved(ITextDocument2Old *iface, LONG *pValue)
Definition: richole.c:4165
static HRESULT WINAPI ITextSelection_fnGetDuplicate(ITextSelection *me, ITextRange **range)
Definition: richole.c:4770
static HRESULT WINAPI ITextRange_fnStartOf(ITextRange *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:2108
static HRESULT WINAPI ITextRange_fnCopy(ITextRange *me, VARIANT *v)
Definition: richole.c:2548
static HRESULT WINAPI TextFont_GetTypeInfoCount(ITextFont *iface, UINT *pctinfo)
Definition: richole.c:2784
static HRESULT WINAPI TextPara_SetPageBreakBefore(ITextPara *iface, LONG value)
Definition: richole.c:3852
static HRESULT WINAPI IOleClientSite_fnRequestNewObjectLayout(IOleClientSite *iface)
Definition: richole.c:1065
static HRESULT WINAPI ITextSelection_fnFindText(ITextSelection *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:5301
static HRESULT WINAPI ITextSelection_fnMoveStartUntil(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5275
static HRESULT WINAPI IRichEditOle_fnActivateAs(IRichEditOle *iface, REFCLSID rclsid, REFCLSID rclsidAs)
Definition: richole.c:937
static HRESULT WINAPI TextFont_GetOutline(ITextFont *iface, LONG *value)
Definition: richole.c:3254
static HRESULT WINAPI TextPara_SetAlignment(ITextPara *iface, LONG value)
Definition: richole.c:3684
static IOleClientSiteImpl * impl_from_IOleClientSite(IOleClientSite *iface)
Definition: richole.c:960
static HRESULT WINAPI IRichEditOle_fnSetHostNames(IRichEditOle *iface, LPCSTR lpstrContainerApp, LPCSTR lpstrContainerObj)
Definition: richole.c:1403
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:4658
static HRESULT WINAPI ITextSelection_fnSetText(ITextSelection *me, BSTR str)
Definition: richole.c:4718
static HRESULT WINAPI ITextSelection_fnMove(ITextSelection *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:5170
static HRESULT WINAPI TextPara_GetNoLineNumber(ITextPara *iface, LONG *value)
Definition: richole.c:3831
static HRESULT WINAPI ITextSelection_fnSetChar(ITextSelection *me, LONG ch)
Definition: richole.c:4758
static HRESULT WINAPI ITextRange_fnGetStart(ITextRange *me, LONG *start)
Definition: richole.c:1709
static HRESULT WINAPI ITextDocument2Old_fnFreeze(ITextDocument2Old *iface, LONG *pCount)
Definition: richole.c:4216
void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize)
Definition: richole.c:5708
static HRESULT WINAPI ITextDocument2Old_fnGetDefaultTabStop(ITextDocument2Old *iface, float *pValue)
Definition: richole.c:4179
static HRESULT WINAPI ITextRange_fnGetTypeInfo(ITextRange *me, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: richole.c:1497
static HRESULT textrange_movestart(ITextRange *range, ME_TextEditor *editor, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2252
static HRESULT WINAPI ITextRange_fnMoveStart(ITextRange *me, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2295
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:4100
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnScroll(IOleInPlaceSite *iface, SIZE scrollExtent)
Definition: richole.c:1158
static HRESULT WINAPI ITextSelection_fnSetIndex(ITextSelection *me, LONG unit, LONG index, LONG extend)
Definition: richole.c:5030
static HRESULT WINAPI TextPara_GetListType(ITextPara *iface, LONG *value)
Definition: richole.c:3817
static ULONG WINAPI ITextRange_fnAddRef(ITextRange *me)
Definition: richole.c:1465
static HRESULT WINAPI TextFont_GetEngrave(ITextFont *iface, LONG *value)
Definition: richole.c:3165
static HRESULT WINAPI TextFont_SetAnimation(ITextFont *iface, LONG value)
Definition: richole.c:3083
static HRESULT WINAPI ITextDocument2Old_fnRedo(ITextDocument2Old *iface, LONG Count, LONG *prop)
Definition: richole.c:4289
static HRESULT get_typeinfo(enum tid_t tid, ITypeInfo **typeinfo)
Definition: richole.c:107
static HRESULT WINAPI ITextDocument2Old_fnSave(ITextDocument2Old *iface, VARIANT *pVar, LONG Flags, LONG CodePage)
Definition: richole.c:4208
void release_typelib(void)
Definition: richole.c:93
static HRESULT WINAPI ITextRange_fnInRange(ITextRange *me, ITextRange *range, LONG *ret)
Definition: richole.c:2000
static HRESULT WINAPI ITextDocument2Old_fnGetTypeInfo(ITextDocument2Old *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: richole.c:4069
static HRESULT WINAPI TextFont_GetShadow(ITextFont *iface, LONG *value)
Definition: richole.c:3296
static HRESULT WINAPI ITextDocument2Old_fnGetIDsOfNames(ITextDocument2Old *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: richole.c:4083
const ITextDocument2OldVtbl text_doc2old_vtbl
Definition: richole.c:4527
static HRESULT WINAPI TextFont_GetAllCaps(ITextFont *iface, LONG *value)
Definition: richole.c:3062
static HRESULT WINAPI TextFont_SetEngrave(ITextFont *iface, LONG value)
Definition: richole.c:3172
static HRESULT WINAPI TextPara_SetStyle(ITextPara *iface, LONG value)
Definition: richole.c:3670
static HRESULT WINAPI IOleClientSite_fnOnShowWindow(IOleClientSite *iface, BOOL fShow)
Definition: richole.c:1055
static HRESULT load_typelib(void)
Definition: richole.c:77
static HRESULT WINAPI IRichEditOle_fnImportDataObject(IRichEditOle *iface, LPDATAOBJECT lpdataobj, CLIPFORMAT cf, HGLOBAL hMetaPict)
Definition: richole.c:1349
static HRESULT WINAPI ITextDocument2Old_fnSetNotificationMode(ITextDocument2Old *iface, LONG mode)
Definition: richole.c:4427
static HRESULT WINAPI TextFont_SetStyle(ITextFont *iface, LONG value)
Definition: richole.c:3055
static HRESULT WINAPI TextPara_SetSpaceAfter(ITextPara *iface, FLOAT value)
Definition: richole.c:3894
static HRESULT WINAPI ITextSelection_fnInStory(ITextSelection *me, ITextRange *range, LONG *ret)
Definition: richole.c:5082
static HRESULT WINAPI ITextSelection_fnGetStoryLength(ITextSelection *me, LONG *length)
Definition: richole.c:4955
static HRESULT WINAPI TextPara_SetNoLineNumber(ITextPara *iface, LONG value)
Definition: richole.c:3838
static HRESULT WINAPI TextFont_GetUnderline(ITextFont *iface, LONG *value)
Definition: richole.c:3394
static HRESULT WINAPI ITextSelection_fnTypeText(ITextSelection *me, BSTR text)
Definition: richole.c:5601
static HRESULT WINAPI TextPara_SetIndents(ITextPara *iface, FLOAT StartIndent, FLOAT LeftIndent, FLOAT RightIndent)
Definition: richole.c:3873
static HRESULT WINAPI ITextSelection_fnGetText(ITextSelection *me, BSTR *pbstr)
Definition: richole.c:4683
static HRESULT WINAPI ITextSelection_fnGetFormattedText(ITextSelection *me, ITextRange **range)
Definition: richole.c:4788
static HRESULT WINAPI TextPara_CanChange(ITextPara *iface, LONG *ret)
Definition: richole.c:3642
static HRESULT WINAPI TextFont_GetProtected(ITextFont *iface, LONG *value)
Definition: richole.c:3282
static HRESULT WINAPI ITextRange_fnSetPara(ITextRange *me, ITextPara *para)
Definition: richole.c:1848
static HRESULT WINAPI ITextSelection_fnSetRange(ITextSelection *me, LONG anchor, LONG active)
Definition: richole.c:5043
static HRESULT WINAPI TextFont_SetSubscript(ITextFont *iface, LONG value)
Definition: richole.c:3373
static HRESULT WINAPI ITextRange_fnSetFont(ITextRange *me, ITextFont *font)
Definition: richole.c:1817
static HRESULT WINAPI ITextSelection_fnQueryInterface(ITextSelection *me, REFIID riid, void **ppvObj)
Definition: richole.c:4579
static HRESULT WINAPI TextFont_GetBold(ITextFont *iface, LONG *value)
Definition: richole.c:3109
static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG anchor, LONG active)
Definition: richole.c:1967
static HRESULT WINAPI ITextSelection_fnGetStart(ITextSelection *me, LONG *pcpFirst)
Definition: richole.c:4813
static HRESULT WINAPI ITextDocument2Old_fnUnfreeze(ITextDocument2Old *iface, LONG *pCount)
Definition: richole.c:4226
static HRESULT WINAPI ITextRange_fnSetFormattedText(ITextRange *me, ITextRange *range)
Definition: richole.c:1697
static HRESULT WINAPI IRichEditOle_fnInPlaceDeactivate(IRichEditOle *iface)
Definition: richole.c:1358
static HRESULT WINAPI ITextSelection_fnGetFont(ITextSelection *me, ITextFont **font)
Definition: richole.c:4883
static HRESULT create_textfont(ITextRange *, const ITextFontImpl *, ITextFont **)
Definition: richole.c:3487
static HRESULT WINAPI ITextSelection_fnGetPoint(ITextSelection *me, LONG type, LONG *cx, LONG *cy)
Definition: richole.c:5437
static HRESULT WINAPI ITextDocument2Old_fnGetNotificationMode(ITextDocument2Old *iface, LONG *mode)
Definition: richole.c:4418
static HRESULT WINAPI TextPara_DeleteTab(ITextPara *iface, FLOAT pos)
Definition: richole.c:3950
static HRESULT WINAPI TextPara_SetKeepWithNext(ITextPara *iface, LONG value)
Definition: richole.c:3733
static ULONG WINAPI IOleClientSite_fnRelease(IOleClientSite *iface)
Definition: richole.c:996
static HRESULT WINAPI ITextSelection_fnFindTextStart(ITextSelection *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:5315
static HRESULT WINAPI IRichEditOle_fnSetDvaspect(IRichEditOle *iface, LONG iob, DWORD dvaspect)
Definition: richole.c:1396
static HRESULT set_textfont_prop(ITextFontImpl *font, enum textfont_prop_id propid, const textfont_prop_val *value)
Definition: richole.c:723
static ITextFontImpl * impl_from_ITextFont(ITextFont *iface)
Definition: richole.c:268
static HRESULT textrange_moveend(ITextRange *range, ME_TextEditor *editor, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2308
static HRESULT WINAPI ITextSelection_fnGetTypeInfo(ITextSelection *me, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: richole.c:4628
static HRESULT WINAPI TextPara_GetSpaceAfter(ITextPara *iface, FLOAT *value)
Definition: richole.c:3887
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:3603
static HRESULT WINAPI TextFont_SetOutline(ITextFont *iface, LONG value)
Definition: richole.c:3261
static HRESULT WINAPI TextFont_SetProtected(ITextFont *iface, LONG value)
Definition: richole.c:3289
static HRESULT WINAPI IRichEditOle_fnContextSensitiveHelp(IRichEditOle *iface, BOOL fEnterMode)
Definition: richole.c:945
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnPosRectChange(IOleInPlaceSite *iface, LPCRECT lprcPosRect)
Definition: richole.c:1193
static HRESULT WINAPI ITextRange_fnGetChar(ITextRange *me, LONG *pch)
Definition: richole.c:1637
static HRESULT WINAPI ITextSelection_fnGetEmbeddedObject(ITextSelection *me, IUnknown **ppv)
Definition: richole.c:5474
static HRESULT WINAPI TextPara_AddTab(ITextPara *iface, FLOAT tbPos, LONG tbAlign, LONG tbLeader)
Definition: richole.c:3936
static HRESULT WINAPI IOleClientSite_fnGetMoniker(IOleClientSite *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk)
Definition: richole.c:1023
static HRESULT WINAPI ITextDocument2Old_fnGetEffectColor(ITextDocument2Old *iface, LONG index, COLORREF *cr)
Definition: richole.c:4361
static ULONG WINAPI TextFont_Release(ITextFont *iface)
Definition: richole.c:2766
static HRESULT WINAPI ITextDocument2Old_fnGetName(ITextDocument2Old *iface, BSTR *pName)
Definition: richole.c:4119
static HRESULT WINAPI TextPara_SetListAlignment(ITextPara *iface, LONG value)
Definition: richole.c:3768
static HRESULT WINAPI TextFont_SetPosition(ITextFont *iface, FLOAT value)
Definition: richole.c:3275
static HRESULT WINAPI ITextSelection_fnSetPara(ITextSelection *me, ITextPara *para)
Definition: richole.c:4942
static ULONG WINAPI TextPara_AddRef(ITextPara *iface)
Definition: richole.c:3541
static HRESULT WINAPI TextFont_CanChange(ITextFont *iface, LONG *ret)
Definition: richole.c:2869
static HRESULT WINAPI TextFont_GetKerning(ITextFont *iface, FLOAT *value)
Definition: richole.c:3193
static HRESULT WINAPI ITextSelection_fnEndKey(ITextSelection *me, LONG unit, LONG extend, LONG *delta)
Definition: richole.c:5588
static HRESULT WINAPI ITextDocument2Old_fnGetSelection(ITextDocument2Old *iface, ITextSelection **selection)
Definition: richole.c:4126
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnCanInPlaceActivate(IOleInPlaceSite *iface)
Definition: richole.c:1128
static void cp2range(ME_TextEditor *editor, LONG *cp1, LONG *cp2)
Definition: richole.c:1949
static ULONG WINAPI TextFont_AddRef(ITextFont *iface)
Definition: richole.c:2758
static HRESULT WINAPI ITextSelection_fnSetFont(ITextSelection *me, ITextFont *font)
Definition: richole.c:4903
static HRESULT WINAPI ITextRange_fnSetPoint(ITextRange *me, LONG x, LONG y, LONG type, LONG extend)
Definition: richole.c:2620
static void textfont_cache_range_props(ITextFontImpl *font)
Definition: richole.c:875
static void textranges_update_ranges(struct text_services *services, LONG start, LONG end, enum range_update_op op)
Definition: richole.c:291
static HRESULT WINAPI TextFont_GetHidden(ITextFont *iface, LONG *value)
Definition: richole.c:3151
static HRESULT WINAPI TextFont_GetForeColor(ITextFont *iface, LONG *value)
Definition: richole.c:3137
static HRESULT WINAPI TextPara_GetFirstLineIndent(ITextPara *iface, FLOAT *value)
Definition: richole.c:3705
static HRESULT WINAPI ITextRange_fnGetIDsOfNames(ITextRange *me, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: richole.c:1511
static HRESULT WINAPI TextPara_GetListStart(ITextPara *iface, LONG *value)
Definition: richole.c:3789
static HRESULT WINAPI TextFont_GetSize(ITextFont *iface, FLOAT *value)
Definition: richole.c:3310
static HRESULT WINAPI ITextDocument2Old_fnUndo(ITextDocument2Old *iface, LONG Count, LONG *prop)
Definition: richole.c:4251
static void convert_sizel(const ME_Context *c, const SIZEL *szl, SIZE *sz)
Definition: richole.c:5696
static HRESULT WINAPI TextFont_GetSuperscript(ITextFont *iface, LONG *value)
Definition: richole.c:3380
static HRESULT WINAPI ITextSelection_fnSetFormattedText(ITextSelection *me, ITextRange *range)
Definition: richole.c:4800
static HRESULT WINAPI TextFont_SetHidden(ITextFont *iface, LONG value)
Definition: richole.c:3158
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnGetWindow(IOleInPlaceSite *iface, HWND *window)
Definition: richole.c:1106
static HRESULT WINAPI TextFont_GetPosition(ITextFont *iface, FLOAT *value)
Definition: richole.c:3268
static const IID *const tid_ids[]
Definition: richole.c:66
static HRESULT WINAPI TextFont_GetWeight(ITextFont *iface, LONG *value)
Definition: richole.c:3408
static HRESULT WINAPI ITextSelection_fnMoveUntil(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5262
static HRESULT WINAPI ITextRange_fnGetTypeInfoCount(ITextRange *me, UINT *pctinfo)
Definition: richole.c:1489
static HRESULT WINAPI TextFont_SetBackColor(ITextFont *iface, LONG value)
Definition: richole.c:3102
static HRESULT WINAPI TextPara_GetLineSpacing(ITextPara *iface, FLOAT *value)
Definition: richole.c:3747
static struct text_services * impl_from_IRichEditOle(IRichEditOle *iface)
Definition: richole.c:243
static HRESULT WINAPI ITextSelection_fnExpand(ITextSelection *me, LONG unit, LONG *delta)
Definition: richole.c:5001
static HRESULT WINAPI ITextRange_fnFindTextStart(ITextRange *me, BSTR text, LONG count, LONG flags, LONG *length)
Definition: richole.c:2473
static HRESULT WINAPI IRichEditOle_fnSetLinkAvailable(IRichEditOle *iface, LONG iob, BOOL fAvailable)
Definition: richole.c:1412
static HRESULT WINAPI TextFont_SetDuplicate(ITextFont *iface, ITextFont *pFont)
Definition: richole.c:2862
static HRESULT WINAPI TextPara_GetKeepWithNext(ITextPara *iface, LONG *value)
Definition: richole.c:3726
static HRESULT WINAPI TextFont_SetSize(ITextFont *iface, FLOAT value)
Definition: richole.c:3317
static HRESULT WINAPI ITextDocument2Old_fnSetCaretType(ITextDocument2Old *iface, LONG type)
Definition: richole.c:4379
static HRESULT set_textfont_propd(ITextFontImpl *font, enum textfont_prop_id propid, LONG value)
Definition: richole.c:831
static HRESULT WINAPI ITextRange_fnMoveEndUntil(ITextRange *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:2447
static HRESULT WINAPI ITextSelection_fnMoveWhile(ITextSelection *me, VARIANT *charset, LONG count, LONG *delta)
Definition: richole.c:5223
static HRESULT WINAPI TextPara_SetKeepTogether(ITextPara *iface, LONG value)
Definition: richole.c:3719
static void textfont_reset_to_undefined(ITextFontImpl *font)
Definition: richole.c:2934
static ULONG WINAPI ITextSelection_fnAddRef(ITextSelection *me)
Definition: richole.c:4605
static HRESULT WINAPI ITextSelection_fnMoveLeft(ITextSelection *me, LONG unit, LONG count, LONG extend, LONG *delta)
Definition: richole.c:5523
static HRESULT WINAPI TextFont_SetWeight(ITextFont *iface, LONG value)
Definition: richole.c:3415
static HRESULT WINAPI ITextSelection_fnGetIndex(ITextSelection *me, LONG unit, LONG *index)
Definition: richole.c:5018
static HRESULT WINAPI ITextDocument2Old_fnNotify(ITextDocument2Old *iface, LONG notify)
Definition: richole.c:4518
static HRESULT WINAPI IRichEditOle_fnHandsOffStorage(IRichEditOle *iface, LONG iob)
Definition: richole.c:1341
static struct text_selection * impl_from_ITextSelection(ITextSelection *iface)
Definition: richole.c:263
static HRESULT CreateOleClientSite(struct text_services *services, IOleClientSite **ret)
Definition: richole.c:1219
static HRESULT set_textfont_propf(ITextFontImpl *font, enum textfont_prop_id propid, FLOAT value)
Definition: richole.c:824
static HRESULT WINAPI ITextSelection_fnCopy(ITextSelection *me, VARIANT *v)
Definition: richole.c:5371
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnInPlaceActivate(IOleInPlaceSite *iface)
Definition: richole.c:1135
static HRESULT WINAPI ITextRange_fnSetEnd(ITextRange *me, LONG value)
Definition: richole.c:1790
static HRESULT WINAPI ITextDocument2Old_fnSetDefaultTabStop(ITextDocument2Old *iface, float Value)
Definition: richole.c:4186
static HRESULT WINAPI TextPara_GetTab(ITextPara *iface, LONG iTab, FLOAT *ptbPos, LONG *ptbAlign, LONG *ptbLeader)
Definition: richole.c:3957
static HRESULT WINAPI ITextSelection_fnIsEqual(ITextSelection *me, ITextRange *range, LONG *ret)
Definition: richole.c:5094
static ULONG WINAPI IRichEditOle_fnRelease(IRichEditOle *iface)
Definition: richole.c:930
static HRESULT textrange_expand(ITextRange *range, LONG unit, LONG *delta)
Definition: richole.c:886
static ITypeInfo * typeinfos[LAST_tid]
Definition: richole.c:75
static HRESULT WINAPI ITextRange_fnGetDuplicate(ITextRange *me, ITextRange **ppRange)
Definition: richole.c:1670
static HRESULT WINAPI ITextRange_fnQueryInterface(ITextRange *me, REFIID riid, void **ppvObj)
Definition: richole.c:1443
static HRESULT WINAPI ITextSelection_fnGetIDsOfNames(ITextSelection *me, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: richole.c:4642
static HRESULT WINAPI TextFont_SetStrikeThrough(ITextFont *iface, LONG value)
Definition: richole.c:3359
static HRESULT WINAPI TextFont_GetEmboss(ITextFont *iface, LONG *value)
Definition: richole.c:3123
static const IOleClientSiteVtbl ocst
Definition: richole.c:1075
static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG unit, LONG index, LONG extend)
Definition: richole.c:1936
static ITextParaImpl * impl_from_ITextPara(ITextPara *iface)
Definition: richole.c:273
static HRESULT WINAPI TextFont_GetItalic(ITextFont *iface, LONG *value)
Definition: richole.c:3179
static HRESULT WINAPI ITextRange_fnGetIndex(ITextRange *me, LONG unit, LONG *index)
Definition: richole.c:1924
static HRESULT WINAPI TextPara_SetLineSpacing(ITextPara *iface, LONG LineSpacingRule, FLOAT LineSpacing)
Definition: richole.c:3880
static HRESULT textrange_move(ITextRange *range, ME_TextEditor *editor, LONG unit, LONG count, LONG *delta)
Definition: richole.c:2174
static ITextRangeImpl * impl_from_ITextRange(ITextRange *iface)
Definition: richole.c:258
static HRESULT WINAPI TextPara_GetDuplicate(ITextPara *iface, ITextPara **ret)
Definition: richole.c:3628
static HRESULT textrange_setstart(const struct text_services *services, LONG value, LONG *start, LONG *end)
Definition: richole.c:1725
#define assert(x)
Definition: debug.h:53
void ME_RewrapRepaint(ME_TextEditor *editor)
Definition: paint.c:160
void editor_disable_undo(ME_TextEditor *editor)
Definition: undo.c:483
ME_Style * style_get_insert_style(ME_TextEditor *editor, ME_Cursor *cursor)
Definition: style.c:476
void ME_SetCharFormat(ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, CHARFORMAT2W *pFmt)
Definition: run.c:782
void ME_ReleaseStyle(ME_Style *item)
Definition: style.c:462
int run_char_ofs(ME_Run *run, int ofs)
Definition: run.c:233
void ME_UpdateScrollBar(ME_TextEditor *editor)
Definition: paint.c:1151
void ME_CommitUndo(ME_TextEditor *editor)
Definition: undo.c:227
BOOL ME_Undo(ME_TextEditor *editor)
Definition: undo.c:410
BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
Definition: wrap.c:1103
void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now)
Definition: paint.c:132
void editor_enable_undo(ME_TextEditor *editor)
Definition: undo.c:489
void ME_GetCharFormat(ME_TextEditor *editor, const ME_Cursor *from, const ME_Cursor *to, CHARFORMAT2W *pFmt)
Definition: run.c:876
BOOL ME_Redo(ME_TextEditor *editor)
Definition: undo.c:448
#define ITextHost2_TxGetWindow(This, a)
Definition: editor.h:373
void cursor_from_char_ofs(ME_TextEditor *editor, int char_ofs, ME_Cursor *cursor)
Definition: run.c:245
void scroll_abs(ME_TextEditor *editor, int x, int y, BOOL notify)
Definition: paint.c:1091
ME_Paragraph * para_next(ME_Paragraph *para)
Definition: para.c:57
#define MERF_GRAPHICS
Definition: editstr.h:103
@ undoSuspended
Definition: editstr.h:289
@ undoActive
Definition: editstr.h:288
#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:144
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define LONG_MAX
Definition: intsafe.h:154
#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_IViewObject
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:237
IOleClientSite IOleClientSite_iface
Definition: richole.c:238
IOleInPlaceSite IOleInPlaceSite_iface
Definition: richole.c:239
textfont_prop_val props[FONT_PROPID_LAST]
Definition: richole.c:224
ITextFont ITextFont_iface
Definition: richole.c:220
BOOL set_cache_enabled
Definition: richole.c:226
BOOL get_cache_enabled
Definition: richole.c:225
ITextRange * range
Definition: richole.c:223
ITextPara ITextPara_iface
Definition: richole.c:230
ITextRange * range
Definition: richole.c:233
ITextRange ITextRange_iface
Definition: richole.c:214
struct reole_child child
Definition: richole.c:213
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
struct tagME_Run * run
Definition: editstr.h:155
REOBJECT obj
Definition: editstr.h:154
Definition: send.c:48
struct text_services * reole
Definition: richole.c:209
struct list entry
Definition: richole.c:208
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:168
int nFlags
Definition: editstr.h:165
ME_Cursor * pCursors
Definition: editstr.h:396
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:479
struct text_services * services
Definition: editstr.h:482
ME_TextEditor * editor
Definition: editstr.h:493
ITextDocument2Old ITextDocument2Old_iface
Definition: editstr.h:490
IRichEditOle IRichEditOle_iface
Definition: editstr.h:489
#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
@ tomResume
Definition: tom.idl:35
@ tomUsePoints
Definition: tom.idl:45
@ tomDefault
Definition: tom.idl:33
@ tomApplyLater
Definition: tom.idl:39
@ tomSuspend
Definition: tom.idl:34
@ 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
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337
_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