[Wine-patches] [eter-2.1] mshtml: Add IHTMLEditServices stub implementation. (eterbug #10841).

Dmitry Timoshkov dtimoshkov на etersoft.ru
Чт Окт 8 13:38:31 MSK 2015


---
 dlls/mshtml/htmldoc.c        |   2 +
 dlls/mshtml/mshtml_private.h |   1 +
 dlls/mshtml/service.c        | 131 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 134 insertions(+)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 1dc35ae..e2dca52 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -2455,6 +2455,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/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 54b8359..c9f9f2b 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -547,6 +547,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..8b98fd1 100644
--- a/dlls/mshtml/service.c
+++ b/dlls/mshtml/service.c
@@ -203,6 +203,128 @@ 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);
+
+    if(IsEqualGUID(riid, &IID_IUnknown)) {
+        TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
+        *ppv = &This->IHTMLEditServices_iface;
+    } else if(IsEqualGUID(riid, &IID_IHTMLEditServices)) {
+        TRACE("(%p)->(IID_IHTMLEditServices %p)\n", This, ppv);
+        *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));
+
+    ret->IHTMLEditServices_iface.lpVtbl = &editsvcsVtbl;
+    ret->ref = 1;
+
+    return &ret->IHTMLEditServices_iface;
+}
+
 /**********************************************************
  * IServiceProvider implementation
  */
@@ -259,6 +381,15 @@ static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFG
         return IWindowForBindingUI_QueryInterface(&This->doc_obj->IWindowForBindingUI_iface, riid, ppv);
     }
 
+    if(IsEqualGUID(&SID_SHTMLEditServices, guidService)) {
+        FIXME("SID_SHTMLEditServices\n");
+
+        if(!This->doc_obj->editsvcs)
+            This->doc_obj->editsvcs = create_editsvcs();
+
+        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



Подробная информация о списке рассылки Wine-patches