[PATCH 4/8] dhtmled.ocx: Add IViewObject interface to DHTMLEdit object

Alex Henrie alexhenrie24 at gmail.com
Thu Jan 18 11:24:23 CST 2018


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

diff --git a/dlls/dhtmled.ocx/edit.c b/dlls/dhtmled.ocx/edit.c
index 49580f3840..e2a1c38ee7 100644
--- a/dlls/dhtmled.ocx/edit.c
+++ b/dlls/dhtmled.ocx/edit.c
@@ -28,6 +28,7 @@ typedef struct
 {
     IDHTMLEdit IDHTMLEdit_iface;
     IQuickActivate IQuickActivate_iface;
+    IViewObject IViewObject_iface;
     LONG ref;
 } DHTMLEditImpl;
 
@@ -41,6 +42,11 @@ static inline DHTMLEditImpl *impl_from_IQuickActivate(IQuickActivate *iface)
     return CONTAINING_RECORD(iface, DHTMLEditImpl, IQuickActivate_iface);
 }
 
+static inline DHTMLEditImpl *impl_from_IViewObject(IViewObject *iface)
+{
+    return CONTAINING_RECORD(iface, DHTMLEditImpl, IViewObject_iface);
+}
+
 static HRESULT dhtml_edit_addref(DHTMLEditImpl *This)
 {
     LONG ref = InterlockedIncrement(&This->ref);
@@ -69,6 +75,12 @@ static HRESULT dhtml_edit_qi(DHTMLEditImpl *This, REFIID iid, void **out)
         *out = &This->IQuickActivate_iface;
         return S_OK;
     }
+    else if (IsEqualGUID(iid, &IID_IViewObject))
+    {
+        dhtml_edit_addref(This);
+        *out = &This->IViewObject_iface;
+        return S_OK;
+    }
 
     *out = NULL;
     ERR("no interface for %s\n", debugstr_guid(iid));
@@ -583,6 +595,85 @@ static const IQuickActivateVtbl QuickActivateVtbl = {
     QuickActivate_SetContentExtent
 };
 
+static HRESULT WINAPI ViewObject_QueryInterface(IViewObject *iface, REFIID iid, void **out)
+{
+    return dhtml_edit_qi(impl_from_IViewObject(iface), iid, out);
+}
+
+static ULONG WINAPI ViewObject_AddRef(IViewObject *iface)
+{
+    return dhtml_edit_addref(impl_from_IViewObject(iface));
+}
+
+static ULONG WINAPI ViewObject_Release(IViewObject *iface)
+{
+    return dhtml_edit_release(impl_from_IViewObject(iface));
+}
+
+static HRESULT WINAPI ViewObject_Draw(IViewObject *iface, DWORD aspect, LONG index, void *aspect_info,
+                                      DVTARGETDEVICE *target, HDC target_context, HDC draw_context,
+                                      const RECTL *bounds, const RECTL *metabounds,
+                                      BOOL WINAPI (*callback)(ULONG_PTR), ULONG_PTR callback_arg)
+{
+    DHTMLEditImpl *This = impl_from_IViewObject(iface);
+    FIXME("(%p)->(%u, %d, %p, %p, %p, %p, %p, %p, %p, %lu) stub\n", This, aspect, index, aspect_info,
+          target, target_context, draw_context, bounds, metabounds, callback, callback_arg);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ViewObject_GetColorSet(IViewObject *iface, DWORD aspect, LONG index, void *aspect_info,
+                                             DVTARGETDEVICE *target, HDC target_context, LOGPALETTE **value)
+{
+    DHTMLEditImpl *This = impl_from_IViewObject(iface);
+    FIXME("(%p)->(%u, %d, %p, %p, %p, %p) stub\n", This, aspect, index, aspect_info, target, target_context, value);
+    *value = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ViewObject_Freeze(IViewObject *iface, DWORD aspect, LONG index, void *aspect_info, DWORD *token)
+{
+    DHTMLEditImpl *This = impl_from_IViewObject(iface);
+    FIXME("(%p)->(%u, %d, %p, %p) stub\n", This, aspect, index, aspect_info, token);
+    *token = 0;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ViewObject_Unfreeze(IViewObject *iface, DWORD token)
+{
+    DHTMLEditImpl *This = impl_from_IViewObject(iface);
+    FIXME("(%p)->(%u) stub\n", This, token);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ViewObject_SetAdvise(IViewObject *iface, DWORD aspects, DWORD flags, IAdviseSink *value)
+{
+    DHTMLEditImpl *This = impl_from_IViewObject(iface);
+    FIXME("(%p)->(%u, %u, %p) stub\n", This, aspects, flags, value);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ViewObject_GetAdvise(IViewObject *iface, DWORD *aspects, DWORD *flags, IAdviseSink **value)
+{
+    DHTMLEditImpl *This = impl_from_IViewObject(iface);
+    FIXME("(%p)->(%p, %p, %p) stub\n", This, aspects, flags, value);
+    if (aspects) *aspects = 0;
+    if (flags) *flags = 0;
+    *value = NULL;
+    return E_NOTIMPL;
+}
+
+static const IViewObjectVtbl ViewObjectVtbl = {
+    ViewObject_QueryInterface,
+    ViewObject_AddRef,
+    ViewObject_Release,
+    ViewObject_Draw,
+    ViewObject_GetColorSet,
+    ViewObject_Freeze,
+    ViewObject_Unfreeze,
+    ViewObject_SetAdvise,
+    ViewObject_GetAdvise
+};
+
 HRESULT dhtml_edit_create(REFIID iid, void **out)
 {
     DHTMLEditImpl *This;
@@ -597,6 +688,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->ref = 1;
 
     *out = &This->IDHTMLEdit_iface;
-- 
2.15.1




More information about the wine-devel mailing list