24#define NONAMELESSUNION
44DEFINE_GUID(LIBID_tom, 0x8cc497c9, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
45DEFINE_GUID(IID_ITextServices, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5);
46DEFINE_GUID(IID_ITextHost, 0x13e670f4,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
47DEFINE_GUID(IID_ITextHost2, 0x13e670f5,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
48DEFINE_GUID(IID_ITextDocument, 0x8cc497c0, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
49DEFINE_GUID(IID_ITextDocument2Old, 0x01c25500, 0x4268, 0x11d1, 0x88, 0x3a, 0x3c, 0x8b, 0x00, 0xc1, 0x00, 0x00);
50DEFINE_GUID(IID_ITextRange, 0x8cc497c2, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
51DEFINE_GUID(IID_ITextSelection, 0x8cc497c1, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
52DEFINE_GUID(IID_ITextFont, 0x8cc497c3, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
53DEFINE_GUID(IID_ITextPara, 0x8cc497c4, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
85 ERR(
"LoadRegTypeLib failed: %08x\n",
hr);
129 ITypeInfo_Release(ti);
137DEFINE_GUID(IID_Igetrichole, 0xe3ce5c7a, 0x8247, 0x4622, 0x81, 0xad, 0x11, 0x81, 0x02, 0xaa, 0x01, 0x30);
343 FIXME(
"unknown update op, %d\n",
op);
381 FIXME(
"unhandled font property %d\n", propid);
421 FIXME(
"unhandled font property %d\n", propid);
429 return value * 72.0 / 1440;
434 return value * 1440 / 72.0;
504 FIXME(
"unhandled font property %d\n", propid);
514 ITextRange_QueryInterface(
range, &IID_Igetrichole, (
void**)&
reole);
526#define CHARFORMAT_SET_B_FIELD(mask, value) \
527 if (hr == S_OK && value != tomUndefined) { \
528 fmt.dwMask |= CFM_##mask; \
529 if (value == tomTrue) fmt.dwEffects |= CFE_##mask; \
592#undef CHARFORMAT_SET_B_FIELD
622 hr = ITextFont_GetKerning(
font, &
f);
641 hr = ITextFont_GetPosition(
font, &
f);
647 hr = ITextFont_GetSize(
font, &
f);
653 hr = ITextFont_GetSpacing(
font, &
f);
687 if (!
font->range ||
font->get_cache_enabled) {
697 ITextRange_GetStart(
font->range, &
start);
698 ITextRange_GetEnd(
font->range, &
end);
755 if (!
font->range ||
font->set_cache_enabled) {
824 FIXME(
"unhandled font property %d\n", propid);
828 ITextRange_GetStart(
font->range, &
start);
829 ITextRange_GetEnd(
font->range, &
end);
909 LONG expand_start, expand_end;
915 ITextRange_GetStoryLength(
range, &expand_end);
918 FIXME(
"unit %d is not supported\n",
unit);
927 *delta = expand_end - expand_start - (
end -
start);
930 ITextRange_SetStart(
range, expand_start);
931 ITextRange_SetEnd(
range, expand_end);
944 *ppvObj = &
This->IUnknown_inner;
946 *ppvObj = &
This->IRichEditOle_iface;
948 *ppvObj = &
This->ITextDocument2Old_iface;
951 IUnknown_AddRef((
IUnknown *)*ppvObj);
958 if (!once++)
FIXME(
"%p: unhandled interface IID_ITextServices\n",
This);
992 ITextSelection_Release(&
This->txtSel->ITextSelection_iface);
1017 return IUnknown_QueryInterface(
This->outer_unk,
riid, ppvObj);
1024 return IUnknown_AddRef(
This->outer_unk);
1031 return IUnknown_Release(
This->outer_unk);
1076 *ppvObj = &
This->IOleInPlaceSite_iface;
1079 IOleClientSite_AddRef(me);
1103 if (
This->child.reole) {
1115 if (!
This->child.reole)
1118 FIXME(
"stub %p\n", iface);
1126 if (!
This->child.reole)
1129 FIXME(
"stub %p\n", iface);
1137 if (!
This->child.reole)
1140 FIXME(
"stub %p\n", iface);
1147 if (!
This->child.reole)
1150 FIXME(
"stub %p\n", iface);
1157 if (!
This->child.reole)
1160 FIXME(
"stub %p\n", iface);
1167 if (!
This->child.reole)
1170 FIXME(
"stub %p\n", iface);
1174static const IOleClientSiteVtbl
ocst = {
1190 return IOleClientSite_QueryInterface(&
This->IOleClientSite_iface,
riid, ppvObj);
1196 return IOleClientSite_AddRef(&
This->IOleClientSite_iface);
1202 return IOleClientSite_Release(&
This->IOleClientSite_iface);
1211 if (!
This->child.reole)
1217 *phwnd =
This->child.reole->editor->hWnd;
1224 FIXME(
"not implemented: (%p)->(%d)\n",
This, fEnterMode);
1251 LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
1254 FIXME(
"not implemented: (%p)->(%p %p %p %p %p)\n",
This, ppFrame, ppDoc, lprcPosRect, lprcClipRect, lpFrameInfo);
1268 FIXME(
"not implemented: (%p)->(%d)\n",
This, fUndoable);
1296 FIXME(
"not implemented: (%p)->(%p)\n",
This, lprcPosRect);
1328 clientSite->
ref = 1;
1329 clientSite->
child.reole = reOle;
1341 TRACE(
"(%p)->(%p)\n",
This, clientsite);
1357 TRACE(
"(%p,%p,%d)\n",
This, lpchrg, reco);
1362 start =
This->editor->pCursors[nStartCur];
1363 nChars = nTo - nFrom;
1388 if (!lpreobject || !lpreobject->
cbStruct)
1391 if (iob == REO_IOB_USE_CP)
1395 TRACE(
"character offset: %d\n", lpreobject->
cp);
1397 if (!
cursor.pRun->member.run.reobj)
1400 reobj =
cursor.pRun->member.run.reobj;
1402 else if (iob == REO_IOB_SELECTION)
1407 if (!
from->pRun->member.run.reobj)
1410 reobj =
from->pRun->member.run.reobj;
1414 if (iob > IRichEditOle_GetObjectCount(me))
1498 FIXME(
"stub %p %s %s\n",
This, lpstrContainerApp, lpstrContainerObj);
1510static const IRichEditOleVtbl
revt = {
1543 ITextRange_AddRef(me);
1548 *ppvObj =
This->child.reole;
1569 if (
This->child.reole)
1593 TRACE(
"(%p)->(%u,%d,%p)\n",
This, iTInfo, lcid, ppTInfo);
1597 ITypeInfo_AddRef(*ppTInfo);
1608 TRACE(
"(%p)->(%s, %p, %u, %d, %p)\n",
This,
debugstr_guid(
riid), rgszNames, cNames, lcid,
1613 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
1619 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
1626 TRACE(
"(%p)->(%d, %s, %d, %u, %p, %p, %p, %p)\n",
This, dispIdMember,
debugstr_guid(
riid),
1627 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1631 hr = ITypeInfo_Invoke(ti, me, dispIdMember,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1645 if (!
This->child.reole)
1657 editor =
This->child.reole->editor;
1681 if (!
This->child.reole)
1684 editor =
This->child.reole->editor;
1707 if (len < This->
end -
This->start)
1733 if (!
This->child.reole)
1739 editor =
This->child.reole->editor;
1750 if (!
This->child.reole)
1764 if (!
This->child.reole)
1779 if (!
This->child.reole)
1791 if (!
This->child.reole)
1803 if (!
This->child.reole)
1839 if (!
This->child.reole)
1851 if (!
This->child.reole)
1884 if (!
This->child.reole)
1896 if (!
This->child.reole)
1914 if (!
This->child.reole)
1927 if (!
This->child.reole)
1940 FIXME(
"(%p)->(%p): stub\n",
This, para);
1942 if (!
This->child.reole)
1954 if (!
This->child.reole)
1966 if (!
This->child.reole)
1994 if (!
This->child.reole)
2006 if (!
This->child.reole)
2018 if (!
This->child.reole)
2031 if (!
This->child.reole)
2041 *cp1 =
max(*cp1, 0);
2042 *cp2 =
max(*cp2, 0);
2052 *cp1 = *cp2 =
len - 1;
2059 FIXME(
"(%p)->(%d %d): stub\n",
This, anchor, active);
2061 if (!
This->child.reole)
2065 if (anchor ==
This->start && active ==
This->end)
2068 This->start = anchor;
2097 if (!
This->child.reole)
2112 if (!
This->child.reole)
2142 if (!
This->child.reole)
2157 if (!
This->child.reole)
2169 FIXME(
"(%p)->(%d %d %p): stub\n",
This,
unit, extend, delta);
2171 if (!
This->child.reole)
2182 FIXME(
"(%p)->(%d %d %p): stub\n",
This,
unit, extend, delta);
2184 if (!
This->child.reole)
2196 if (!
This->child.reole)
2209 if (!
This->child.reole)
2217 LONG old_start, old_end, new_start, new_end;
2227 ITextRange_GetStart(
range, &old_start);
2228 ITextRange_GetEnd(
range, &old_end);
2233 new_start = new_end = 0;
2236 new_start = old_start;
2237 ITextRange_GetStoryLength(
range, &new_end);
2241 if (new_end < old_end)
2243 else if (new_end == old_end)
2250 FIXME(
"unit %d is not supported\n",
unit);
2253 if (new_end == old_end)
2255 ITextRange_SetStart(
range, new_start);
2256 ITextRange_SetEnd(
range, new_end);
2268 if (!
This->child.reole)
2281 if (!
This->child.reole)
2294 if (!
This->child.reole)
2307 if (!
This->child.reole)
2320 if (!
This->child.reole)
2333 if (!
This->child.reole)
2346 if (!
This->child.reole)
2359 if (!
This->child.reole)
2372 if (!
This->child.reole)
2385 if (!
This->child.reole)
2397 if (!
This->child.reole)
2409 if (!
This->child.reole)
2421 if (!
This->child.reole)
2433 if (!
This->child.reole)
2445 if (!
This->child.reole)
2457 if (!
This->child.reole)
2469 if (!
This->child.reole)
2481 if (!
This->child.reole)
2494 if (!
This->child.reole)
2509 if (!
This->child.reole)
2512 editor =
This->child.reole->editor;
2525 FIXME(
"bStart value %d not handled\n",
value);
2538 if (!
This->child.reole)
2544static const ITextRangeVtbl
trvt = {
2617 ITextFont_AddRef(iface);
2643 ITextRange_Release(
This->range);
2665 TRACE(
"(%p)->(%u,%d,%p)\n",
This, iTInfo, lcid, ppTInfo);
2669 ITypeInfo_AddRef(*ppTInfo);
2681 rgszNames, cNames, lcid, rgDispId);
2685 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
2695 DISPPARAMS *pDispParams,
2697 EXCEPINFO *pExcepInfo,
2704 TRACE(
"(%p)->(%d, %s, %d, %u, %p, %p, %p, %p)\n",
This, dispIdMember,
debugstr_guid(
riid),
2705 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2709 hr = ITypeInfo_Invoke(ti, iface, dispIdMember,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2732 FIXME(
"(%p)->(%p): stub\n",
This, pFont);
2788 static const WCHAR sysW[] = {
'S',
'y',
's',
't',
'e',
'm',0};
2797 FIXME(
"font property %d not handled\n",
id);
2839 FIXME(
"font property %d not handled\n",
id);
2885 FIXME(
"reset mode %d not supported\n",
value);
2912 FIXME(
"reset mode %d not supported\n",
value);
3377 ITextRange_AddRef(
range);
3385 *
ret = &
font->ITextFont_iface;
3401 ITextPara_AddRef(iface);
3426 ITextRange_Release(
This->range);
3438 return rng->
child.reole;
3457 TRACE(
"(%p)->(%u,%d,%p)\n",
This, iTInfo, lcid, ppTInfo);
3461 ITypeInfo_AddRef(*ppTInfo);
3473 cNames, lcid, rgDispId);
3477 hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
3487 DISPPARAMS *pDispParams,
3489 EXCEPINFO *pExcepInfo,
3496 TRACE(
"(%p)->(%d, %s, %d, %u, %p, %p, %p, %p)\n",
This, dispIdMember,
3498 pExcepInfo, puArgErr);
3502 hr = ITypeInfo_Invoke(ti, iface, dispIdMember,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);