view.c 7.6 KB
Newer Older
1 2
/*
 * Copyright 2005 Jacek Caban
3
 * Copyright 2010 Ilya Shpigor
4 5 6 7 8 9 10 11 12 13 14 15 16
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 19
 */

20 21
#include "ieframe.h"

22 23
#include "wine/debug.h"

24
WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
25

26 27 28 29
/**********************************************************************
 * Implement the IViewObject interface
 */

30 31
static inline WebBrowser *impl_from_IViewObject2(IViewObject2 *iface)
{
32
    return CONTAINING_RECORD(iface, WebBrowser, IViewObject2_iface);
33
}
34

35
static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppv)
36
{
37
    WebBrowser *This = impl_from_IViewObject2(iface);
38
    return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
39 40
}

41
static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
42
{
43
    WebBrowser *This = impl_from_IViewObject2(iface);
44
    return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
45 46
}

47
static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
48
{
49
    WebBrowser *This = impl_from_IViewObject2(iface);
50
    return IWebBrowser2_Release(&This->IWebBrowser2_iface);
51 52
}

53
static HRESULT WINAPI ViewObject_Draw(IViewObject2 *iface, DWORD dwDrawAspect,
54 55 56 57 58
        LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev,
        HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds,
        BOOL (STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR),
        ULONG_PTR dwContinue)
{
59
    WebBrowser *This = impl_from_IViewObject2(iface);
60
    FIXME("(%p)->(%d %d %p %p %p %p %p %p %p %08lx)\n", This, dwDrawAspect, lindex,
61 62 63 64 65
            pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue,
            dwContinue);
    return E_NOTIMPL;
}

66
static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwAspect,
67 68 69
        LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev,
        LOGPALETTE **ppColorSet)
{
70
    WebBrowser *This = impl_from_IViewObject2(iface);
71
    FIXME("(%p)->(%d %d %p %p %p %p)\n", This, dwAspect, lindex, pvAspect, ptd,
72 73 74 75
            hicTargetDev, ppColorSet);
    return E_NOTIMPL;
}

76
static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex,
77 78
                                        void *pvAspect, DWORD *pdwFreeze)
{
79
    WebBrowser *This = impl_from_IViewObject2(iface);
80
    FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, pvAspect, pdwFreeze);
81 82 83
    return E_NOTIMPL;
}

84
static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
85
{
86
    WebBrowser *This = impl_from_IViewObject2(iface);
87
    FIXME("(%p)->(%d)\n", This, dwFreeze);
88 89 90
    return E_NOTIMPL;
}

91
static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf,
92 93
        IAdviseSink *pAdvSink)
{
94
    WebBrowser *This = impl_from_IViewObject2(iface);
95
    FIXME("(%p)->(%d %08x %p)\n", This, aspects, advf, pAdvSink);
96 97 98
    return E_NOTIMPL;
}

99
static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects,
100 101
        DWORD *pAdvf, IAdviseSink **ppAdvSink)
{
102
    WebBrowser *This = impl_from_IViewObject2(iface);
103 104 105 106
    FIXME("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
    return E_NOTIMPL;
}

107
static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG lindex,
108 109
        DVTARGETDEVICE *ptd, LPSIZEL lpsizel)
{
110
    WebBrowser *This = impl_from_IViewObject2(iface);
111
    FIXME("(%p)->(%d %d %p %p)\n", This, dwAspect, lindex, ptd, lpsizel);
112 113 114
    return E_NOTIMPL;
}

115
static const IViewObject2Vtbl ViewObjectVtbl = {
116 117 118 119 120 121 122 123 124
    ViewObject_QueryInterface,
    ViewObject_AddRef,
    ViewObject_Release,
    ViewObject_Draw,
    ViewObject_GetColorSet,
    ViewObject_Freeze,
    ViewObject_Unfreeze,
    ViewObject_SetAdvise,
    ViewObject_GetAdvise,
125
    ViewObject_GetExtent
126 127
};

128 129 130 131
/**********************************************************************
 * Implement the IDataObject interface
 */

132 133
static inline WebBrowser *impl_from_IDataObject(IDataObject *iface)
{
134
    return CONTAINING_RECORD(iface, WebBrowser, IDataObject_iface);
135
}
136 137 138

static HRESULT WINAPI DataObject_QueryInterface(LPDATAOBJECT iface, REFIID riid, LPVOID * ppvObj)
{
139
    WebBrowser *This = impl_from_IDataObject(iface);
140
    return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppvObj);
141 142 143 144
}

static ULONG WINAPI DataObject_AddRef(LPDATAOBJECT iface)
{
145
    WebBrowser *This = impl_from_IDataObject(iface);
146
    return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
147 148 149 150
}

static ULONG WINAPI DataObject_Release(LPDATAOBJECT iface)
{
151
    WebBrowser *This = impl_from_IDataObject(iface);
152
    return IWebBrowser2_Release(&This->IWebBrowser2_iface);
153 154 155 156
}

static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
{
157
    WebBrowser *This = impl_from_IDataObject(iface);
158 159 160 161 162 163
    FIXME("(%p)->()\n", This);
    return E_NOTIMPL;
}

static HRESULT WINAPI DataObject_GetDataHere(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
{
164
    WebBrowser *This = impl_from_IDataObject(iface);
165 166 167 168 169 170
    FIXME("(%p)->()\n", This);
    return E_NOTIMPL;
}

static HRESULT WINAPI DataObject_QueryGetData(LPDATAOBJECT iface, LPFORMATETC pformatetc)
{
171
    WebBrowser *This = impl_from_IDataObject(iface);
172 173 174 175 176 177
    FIXME("(%p)->()\n", This);
    return E_NOTIMPL;
}

static HRESULT WINAPI DataObject_GetCanonicalFormatEtc(LPDATAOBJECT iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
{
178
    WebBrowser *This = impl_from_IDataObject(iface);
179 180 181 182 183 184
    FIXME("(%p)->()\n", This);
    return E_NOTIMPL;
}

static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
{
185
    WebBrowser *This = impl_from_IDataObject(iface);
186 187 188 189 190 191
    FIXME("(%p)->()\n", This);
    return E_NOTIMPL;
}

static HRESULT WINAPI DataObject_EnumFormatEtc(LPDATAOBJECT iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
{
192
    WebBrowser *This = impl_from_IDataObject(iface);
193 194 195 196 197 198
    FIXME("(%p)->()\n", This);
    return E_NOTIMPL;
}

static HRESULT WINAPI DataObject_DAdvise(LPDATAOBJECT iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
{
199
    WebBrowser *This = impl_from_IDataObject(iface);
200 201 202 203 204 205
    FIXME("(%p)->()\n", This);
    return E_NOTIMPL;
}

static HRESULT WINAPI DataObject_DUnadvise(LPDATAOBJECT iface, DWORD dwConnection)
{
206
    WebBrowser *This = impl_from_IDataObject(iface);
207 208 209 210 211 212
    FIXME("(%p)->()\n", This);
    return E_NOTIMPL;
}

static HRESULT WINAPI DataObject_EnumDAdvise(LPDATAOBJECT iface, IEnumSTATDATA **ppenumAdvise)
{
213
    WebBrowser *This = impl_from_IDataObject(iface);
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
    FIXME("(%p)->()\n", This);
    return E_NOTIMPL;
}

static const IDataObjectVtbl DataObjectVtbl = {
    DataObject_QueryInterface,
    DataObject_AddRef,
    DataObject_Release,
    DataObject_GetData,
    DataObject_GetDataHere,
    DataObject_QueryGetData,
    DataObject_GetCanonicalFormatEtc,
    DataObject_SetData,
    DataObject_EnumFormatEtc,
    DataObject_DAdvise,
    DataObject_DUnadvise,
    DataObject_EnumDAdvise
};

233
void WebBrowser_ViewObject_Init(WebBrowser *This)
234
{
235 236
    This->IViewObject2_iface.lpVtbl = &ViewObjectVtbl;
    This->IDataObject_iface.lpVtbl  = &DataObjectVtbl;
237
}