[1/2] mshtml: Add IHTMLEditServices stub implementation. Take 2.
Dmitry Timoshkov
dmitry at baikal.ru
Sun Oct 11 22:21:07 CDT 2015
Thanks Jacek for the comments.
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
dlls/mshtml/htmldoc.c | 2 +
dlls/mshtml/main.c | 1 +
dlls/mshtml/mshtml_private.h | 1 +
dlls/mshtml/service.c | 137 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 141 insertions(+)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 2b660df..8e53b8b 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -4761,6 +4761,8 @@ static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface)
IOleDocumentView_SetInPlaceSite(&This->basedoc.IOleDocumentView_iface, NULL);
if(This->undomgr)
IOleUndoManager_Release(This->undomgr);
+ if(This->editsvcs)
+ IHTMLEditServices_Release(This->editsvcs);
if(This->tooltips_hwnd)
DestroyWindow(This->tooltips_hwnd);
diff --git a/dlls/mshtml/main.c b/dlls/mshtml/main.c
index 8938f01e..0b6f6ac 100644
--- a/dlls/mshtml/main.c
+++ b/dlls/mshtml/main.c
@@ -554,6 +554,7 @@ const char *debugstr_mshtml_guid(const GUID *iid)
X(IID_IHlinkTarget);
X(IID_IHTMLDocument6);
X(IID_IHTMLDocument7);
+ X(IID_IHTMLEditServices);
X(IID_IHTMLFramesCollection2);
X(IID_IHTMLPrivateWindow);
X(IID_IHtmlLoadOptions);
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 55375d4..c32824e 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -602,6 +602,7 @@ struct HTMLDocumentObj {
DOCHOSTUIINFO hostinfo;
IOleUndoManager *undomgr;
+ IHTMLEditServices *editsvcs;
HWND hwnd;
HWND tooltips_hwnd;
diff --git a/dlls/mshtml/service.c b/dlls/mshtml/service.c
index 56744e6..b33518d 100644
--- a/dlls/mshtml/service.c
+++ b/dlls/mshtml/service.c
@@ -203,6 +203,131 @@ static IOleUndoManager *create_undomgr(void)
return &ret->IOleUndoManager_iface;
}
+typedef struct {
+ IHTMLEditServices IHTMLEditServices_iface;
+ LONG ref;
+} editsvcs;
+
+static inline editsvcs *impl_from_IHTMLEditServices(IHTMLEditServices *iface)
+{
+ return CONTAINING_RECORD(iface, editsvcs, IHTMLEditServices_iface);
+}
+
+static HRESULT WINAPI editsvcs_QueryInterface(IHTMLEditServices *iface, REFIID riid, void **ppv)
+{
+ editsvcs *This = impl_from_IHTMLEditServices(iface);
+
+ TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
+
+ if(IsEqualGUID(riid, &IID_IUnknown)) {
+ *ppv = &This->IHTMLEditServices_iface;
+ } else if(IsEqualGUID(riid, &IID_IHTMLEditServices)) {
+ *ppv = &This->IHTMLEditServices_iface;
+ } else {
+ *ppv = NULL;
+ FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
+ return E_NOINTERFACE;
+ }
+
+ IUnknown_AddRef((IUnknown*)*ppv);
+ return S_OK;
+}
+
+static ULONG WINAPI editsvcs_AddRef(IHTMLEditServices *iface)
+{
+ editsvcs *This = impl_from_IHTMLEditServices(iface);
+ LONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p) ref=%d\n", This, ref);
+ return ref;
+}
+
+static ULONG WINAPI editsvcs_Release(IHTMLEditServices *iface)
+{
+ editsvcs *This = impl_from_IHTMLEditServices(iface);
+ LONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p) ref=%d\n", This, ref);
+
+ if(!ref)
+ heap_free(This);
+
+ return ref;
+}
+
+static HRESULT WINAPI editsvcs_AddDesigner(IHTMLEditServices *iface,
+ IHTMLEditDesigner *pIDesigner)
+{
+ editsvcs *This = impl_from_IHTMLEditServices(iface);
+ FIXME("(%p)->(%p)\n", This, pIDesigner);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI editsvcs_RemoveDesigner(IHTMLEditServices *iface,
+ IHTMLEditDesigner *pIDesigner)
+{
+ editsvcs *This = impl_from_IHTMLEditServices(iface);
+ FIXME("(%p)->(%p)\n", This, pIDesigner);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI editsvcs_GetSelectionServices(IHTMLEditServices *iface,
+ IMarkupContainer *pIContainer, ISelectionServices **ppSelSvc)
+{
+ editsvcs *This = impl_from_IHTMLEditServices(iface);
+ FIXME("(%p)->(%p,%p)\n", This, pIContainer, ppSelSvc);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI editsvcs_MoveToSelectionAnchor(IHTMLEditServices *iface,
+ IMarkupPointer *pIStartAnchor)
+{
+ editsvcs *This = impl_from_IHTMLEditServices(iface);
+ FIXME("(%p)->(%p)\n", This, pIStartAnchor);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI editsvcs_MoveToSelectionEnd(IHTMLEditServices *iface,
+ IMarkupPointer *pIEndAnchor)
+{
+ editsvcs *This = impl_from_IHTMLEditServices(iface);
+ FIXME("(%p)->(%p)\n", This, pIEndAnchor);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI editsvcs_SelectRange(IHTMLEditServices *iface,
+ IMarkupPointer *pStart, IMarkupPointer *pEnd, SELECTION_TYPE eType)
+{
+ editsvcs *This = impl_from_IHTMLEditServices(iface);
+ FIXME("(%p)->(%p,%p,%#x)\n", This, pStart, pEnd, eType);
+ return E_NOTIMPL;
+}
+
+static const IHTMLEditServicesVtbl editsvcsVtbl = {
+ editsvcs_QueryInterface,
+ editsvcs_AddRef,
+ editsvcs_Release,
+ editsvcs_AddDesigner,
+ editsvcs_RemoveDesigner,
+ editsvcs_GetSelectionServices,
+ editsvcs_MoveToSelectionAnchor,
+ editsvcs_MoveToSelectionEnd,
+ editsvcs_SelectRange,
+};
+
+static IHTMLEditServices *create_editsvcs(void)
+{
+ editsvcs *ret = heap_alloc(sizeof(*ret));
+
+ if (ret) {
+ ret->IHTMLEditServices_iface.lpVtbl = &editsvcsVtbl;
+ ret->ref = 1;
+ return &ret->IHTMLEditServices_iface;
+ }
+
+ return NULL;
+}
+
/**********************************************************
* IServiceProvider implementation
*/
@@ -259,6 +384,18 @@ static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFG
return IWindowForBindingUI_QueryInterface(&This->doc_obj->IWindowForBindingUI_iface, riid, ppv);
}
+ if(IsEqualGUID(&SID_SHTMLEditServices, guidService)) {
+ TRACE("SID_SHTMLEditServices\n");
+
+ if(!This->doc_obj->editsvcs)
+ This->doc_obj->editsvcs = create_editsvcs();
+
+ if (!This->doc_obj->editsvcs)
+ return E_OUTOFMEMORY;
+
+ return IHTMLEditServices_QueryInterface(This->doc_obj->editsvcs, riid, ppv);
+ }
+
TRACE("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
if(This->doc_obj->client) {
--
2.6.0
More information about the wine-patches
mailing list