[PATCH v2 5/8] dhtmled.ocx: Add IOleObject interface to DHTMLEdit object

Alex Henrie alexhenrie24 at gmail.com
Tue Dec 5 03:09:23 CST 2017


Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 dlls/dhtmled.ocx/edit.c | 226 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 225 insertions(+), 1 deletion(-)

diff --git a/dlls/dhtmled.ocx/edit.c b/dlls/dhtmled.ocx/edit.c
index e2a1c38ee7..804c32dfb7 100644
--- a/dlls/dhtmled.ocx/edit.c
+++ b/dlls/dhtmled.ocx/edit.c
@@ -29,6 +29,8 @@ typedef struct
     IDHTMLEdit IDHTMLEdit_iface;
     IQuickActivate IQuickActivate_iface;
     IViewObject IViewObject_iface;
+    IOleObject IOleObject_iface;
+    IOleClientSite *client_site;
     LONG ref;
 } DHTMLEditImpl;
 
@@ -47,6 +49,11 @@ static inline DHTMLEditImpl *impl_from_IViewObject(IViewObject *iface)
     return CONTAINING_RECORD(iface, DHTMLEditImpl, IViewObject_iface);
 }
 
+static inline DHTMLEditImpl *impl_from_IOleObject(IOleObject *iface)
+{
+    return CONTAINING_RECORD(iface, DHTMLEditImpl, IOleObject_iface);
+}
+
 static HRESULT dhtml_edit_addref(DHTMLEditImpl *This)
 {
     LONG ref = InterlockedIncrement(&This->ref);
@@ -81,6 +88,12 @@ static HRESULT dhtml_edit_qi(DHTMLEditImpl *This, REFIID iid, void **out)
         *out = &This->IViewObject_iface;
         return S_OK;
     }
+    else if (IsEqualGUID(iid, &IID_IOleObject))
+    {
+        dhtml_edit_addref(This);
+        *out = &This->IOleObject_iface;
+        return S_OK;
+    }
 
     *out = NULL;
     ERR("no interface for %s\n", debugstr_guid(iid));
@@ -568,7 +581,11 @@ static HRESULT WINAPI QuickActivate_QuickActivate(IQuickActivate *iface,
                                                   QACONTAINER *container_info, QACONTROL *control_info)
 {
     DHTMLEditImpl *This = impl_from_IQuickActivate(iface);
-    FIXME("(%p)->(%p, %p) stub\n", This, container_info, control_info);
+
+    FIXME("(%p)->(%p, %p) semi-stub\n", This, container_info, control_info);
+
+    This->client_site = container_info->pClientSite;
+
     return S_OK;
 }
 
@@ -674,6 +691,212 @@ static const IViewObjectVtbl ViewObjectVtbl = {
     ViewObject_GetAdvise
 };
 
+static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID iid, void **out)
+{
+    return dhtml_edit_qi(impl_from_IOleObject(iface), iid, out);
+}
+
+static ULONG WINAPI OleObject_AddRef(IOleObject *iface)
+{
+    return dhtml_edit_addref(impl_from_IOleObject(iface));
+}
+
+static ULONG WINAPI OleObject_Release(IOleObject *iface)
+{
+    return dhtml_edit_release(impl_from_IOleObject(iface));
+}
+
+static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite *value)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%p) stub\n", This, value);
+    return S_OK;
+}
+
+static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, IOleClientSite **value)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%p) stub\n", This, value);
+    *value = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface,
+                                             const OLECHAR *container_app, const OLECHAR *container_obj)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%p, %p) stub\n", This, container_app, container_obj);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD save)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%u) stub\n", This, save);
+    return S_OK;
+}
+
+static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD moniker_id, IMoniker *value)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%u, %p) stub\n", This, moniker_id, value);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD assign, DWORD moniker_id, IMoniker **value)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%u, %p) stub\n", This, moniker_id, value);
+    *value = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, IDataObject *data_obj, BOOL creation, DWORD reserved)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%p, %u, %u) stub\n", This, data_obj, creation, reserved);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD reserved, IDataObject **value)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%u, %p) stub\n", This, reserved, value);
+    *value = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG verb, MSG *msg, IOleClientSite *active_site,
+                                       LONG index, HWND parent, const RECT *pos)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    TRACE("(%p)->(%d, %p, %p, %d, %p, %p) stub\n", This, verb, msg, active_site, index, parent, pos);
+
+    if (verb == OLEIVERB_INPLACEACTIVATE)
+    {
+        IOleClientSite_OnShowWindow(This->client_site, TRUE);
+        return S_OK;
+    }
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **verb)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%p) stub\n", This, verb);
+    *verb = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_Update(IOleObject *iface)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p) stub\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p) stub\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID *clsid)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%p) stub\n", This, clsid);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD type_type, OLECHAR **type)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%u, %p) stub\n", This, type_type, type);
+    *type = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD aspect, SIZEL *size_limit)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%u, %p) stub\n", This, aspect, size_limit);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD aspect, SIZEL *size_limit)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%u, %p) stub\n", This, aspect, size_limit);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *sink, DWORD *conn)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%p, %p) stub\n", This, sink, conn);
+    *conn = 0;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD conn)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%u) stub\n", This, conn);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **advise)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%p) stub\n", This, advise);
+    *advise = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD aspect, DWORD *status)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%u, %p) stub\n", This, aspect, status);
+    *status = 0;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE *palette)
+{
+    DHTMLEditImpl *This = impl_from_IOleObject(iface);
+    FIXME("(%p)->(%p) stub\n", This, palette);
+    return E_NOTIMPL;
+}
+
+static const IOleObjectVtbl OleObjectVtbl = {
+    OleObject_QueryInterface,
+    OleObject_AddRef,
+    OleObject_Release,
+    OleObject_SetClientSite,
+    OleObject_GetClientSite,
+    OleObject_SetHostNames,
+    OleObject_Close,
+    OleObject_SetMoniker,
+    OleObject_GetMoniker,
+    OleObject_InitFromData,
+    OleObject_GetClipboardData,
+    OleObject_DoVerb,
+    OleObject_EnumVerbs,
+    OleObject_Update,
+    OleObject_IsUpToDate,
+    OleObject_GetUserClassID,
+    OleObject_GetUserType,
+    OleObject_SetExtent,
+    OleObject_GetExtent,
+    OleObject_Advise,
+    OleObject_Unadvise,
+    OleObject_EnumAdvise,
+    OleObject_GetMiscStatus,
+    OleObject_SetColorScheme
+};
+
 HRESULT dhtml_edit_create(REFIID iid, void **out)
 {
     DHTMLEditImpl *This;
@@ -689,6 +912,7 @@ HRESULT dhtml_edit_create(REFIID iid, void **out)
     This->IDHTMLEdit_iface.lpVtbl = &DHTMLEditVtbl;
     This->IQuickActivate_iface.lpVtbl = &QuickActivateVtbl;
     This->IViewObject_iface.lpVtbl = &ViewObjectVtbl;
+    This->IOleObject_iface.lpVtbl = &OleObjectVtbl;
     This->ref = 1;
 
     *out = &This->IDHTMLEdit_iface;
-- 
2.15.1




More information about the wine-devel mailing list