ReactOS 0.4.15-dev-7834-g00c4b3d
ipwindow.c
Go to the documentation of this file.
1/*
2 * Copyright 2010 Jacek Caban for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include "mshtml_private.h"
20
21typedef struct {
25
27{
28 return CONTAINING_RECORD(iface, InPlaceFrame, IOleInPlaceFrame_iface);
29}
30
32 REFIID riid, void **ppv)
33{
35
36 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
37
39 *ppv = &This->IOleInPlaceFrame_iface;
40 }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
41 *ppv = &This->IOleInPlaceFrame_iface;
43 *ppv = &This->IOleInPlaceFrame_iface;
45 *ppv = &This->IOleInPlaceFrame_iface;
46 }else {
47 WARN("Unsopported interface %s\n", debugstr_mshtml_guid(riid));
48 *ppv = NULL;
49 return E_NOINTERFACE;
50 }
51
52 IUnknown_AddRef((IUnknown*)*ppv);
53 return S_OK;
54}
55
57{
60
61 TRACE("(%p) ref=%d\n", This, ref);
62
63 return ref;
64}
65
67{
70
71 TRACE("(%p) ref=%d\n", This, ref);
72
73 if(!ref)
75
76 return ref;
77}
78
80{
82 FIXME("(%p)->(%p)\n", This, phwnd);
83 return E_NOTIMPL;
84}
85
87 BOOL fEnterMode)
88{
90 FIXME("(%p)->(%x)\n", This, fEnterMode);
91 return E_NOTIMPL;
92}
93
95{
97 FIXME("(%p)->(%p)\n", This, lprectBorder);
98 return E_NOTIMPL;
99}
100
102 LPCBORDERWIDTHS pborderwidths)
103{
105 FIXME("(%p)->(%p)\n", This, pborderwidths);
106 return E_NOTIMPL;
107}
108
110 LPCBORDERWIDTHS pborderwidths)
111{
113 FIXME("(%p)->(%p)\n", This, pborderwidths);
114 return E_NOTIMPL;
115}
116
118 IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
119{
121 FIXME("(%p)->(%p %s)\n", This, pActiveObject, debugstr_w(pszObjName));
122 return E_NOTIMPL;
123}
124
126 LPOLEMENUGROUPWIDTHS lpMenuWidths)
127{
129 FIXME("(%p)->(%p %p)\n", This, hmenuShared, lpMenuWidths);
130 return E_NOTIMPL;
131}
132
134 HOLEMENU holemenu, HWND hwndActiveObject)
135{
137 FIXME("(%p)->(%p %p %p)\n", This, hmenuShared, holemenu, hwndActiveObject);
138 return E_NOTIMPL;
139}
140
142{
144 FIXME("(%p)->(%p)\n", This, hmenuShared);
145 return E_NOTIMPL;
146}
147
149 LPCOLESTR pszStatusText)
150{
152 FIXME("(%p)->(%s)\n", This, debugstr_w(pszStatusText));
153 return E_NOTIMPL;
154}
155
157{
159 FIXME("(%p)->(%x)\n", This, fEnable);
160 return E_NOTIMPL;
161}
162
164 WORD wID)
165{
167 FIXME("(%p)->(%p %d)\n", This, lpmsg, wID);
168 return E_NOTIMPL;
169}
170
171static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl = {
187};
188
190{
191 InPlaceFrame *frame;
192
193 frame = heap_alloc_zero(sizeof(*frame));
194 if(!frame)
195 return E_OUTOFMEMORY;
196
198 frame->ref = 1;
199
200 *ret = &frame->IOleInPlaceFrame_iface;
201 return S_OK;
202}
203
204typedef struct {
208
210{
211 return CONTAINING_RECORD(iface, InPlaceUIWindow, IOleInPlaceUIWindow_iface);
212}
213
215{
217
218 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
219
221 *ppv = &This->IOleInPlaceUIWindow_iface;
222 }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
223 *ppv = &This->IOleInPlaceUIWindow_iface;
225 *ppv = &This->IOleInPlaceUIWindow_iface;
226 }else {
227 WARN("Unsopported interface %s\n", debugstr_mshtml_guid(riid));
228 *ppv = NULL;
229 return E_NOINTERFACE;
230 }
231
232 IUnknown_AddRef((IUnknown*)*ppv);
233 return S_OK;
234}
235
237{
240
241 TRACE("(%p) ref=%d\n", This, ref);
242
243 return ref;
244}
245
247{
250
251 TRACE("(%p) ref=%d\n", This, ref);
252
253 if(!ref)
255
256 return ref;
257}
258
260{
262 FIXME("(%p)->(%p)\n", This, phwnd);
263 return E_NOTIMPL;
264}
265
267 BOOL fEnterMode)
268{
270 FIXME("(%p)->(%x)\n", This, fEnterMode);
271 return E_NOTIMPL;
272}
273
275{
277 FIXME("(%p)->(%p)\n", This, lprectBorder);
278 return E_NOTIMPL;
279}
280
282 LPCBORDERWIDTHS pborderwidths)
283{
285 FIXME("(%p)->(%p)\n", This, pborderwidths);
286 return E_NOTIMPL;
287}
288
290 LPCBORDERWIDTHS pborderwidths)
291{
293 FIXME("(%p)->(%p)\n", This, pborderwidths);
294 return E_NOTIMPL;
295}
296
298 IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
299{
301 FIXME("(%p)->(%p %s)\n", This, pActiveObject, debugstr_w(pszObjName));
302 return E_NOTIMPL;
303}
304
305static const IOleInPlaceUIWindowVtbl OleInPlaceUIWindowVtbl = {
315};
316
318{
319 InPlaceUIWindow *uiwindow;
320
321 uiwindow = heap_alloc_zero(sizeof(*uiwindow));
322 if(!uiwindow)
323 return E_OUTOFMEMORY;
324
326 uiwindow->ref = 1;
327
328 *ret = &uiwindow->IOleInPlaceUIWindow_iface;
329 return S_OK;
330}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
const GUID IID_IUnknown
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:542
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned short WORD
Definition: ntddk_ex.h:93
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)
Definition: ipwindow.c:125
static ULONG WINAPI InPlaceUIWindow_Release(IOleInPlaceUIWindow *iface)
Definition: ipwindow.c:246
static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
Definition: ipwindow.c:156
HRESULT create_ip_window(IOleInPlaceUIWindow **ret)
Definition: ipwindow.c:317
static ULONG WINAPI InPlaceUIWindow_AddRef(IOleInPlaceUIWindow *iface)
Definition: ipwindow.c:236
static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd)
Definition: ipwindow.c:79
static HRESULT WINAPI InPlaceUIWindow_SetBorderSpace(IOleInPlaceUIWindow *iface, LPCBORDERWIDTHS pborderwidths)
Definition: ipwindow.c:289
static HRESULT WINAPI InPlaceUIWindow_SetActiveObject(IOleInPlaceUIWindow *iface, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
Definition: ipwindow.c:297
static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder)
Definition: ipwindow.c:94
static ULONG WINAPI InPlaceFrame_Release(IOleInPlaceFrame *iface)
Definition: ipwindow.c:66
static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl
Definition: ipwindow.c:171
static HRESULT WINAPI InPlaceUIWindow_ContextSensitiveHelp(IOleInPlaceUIWindow *iface, BOOL fEnterMode)
Definition: ipwindow.c:266
static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
Definition: ipwindow.c:117
static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame *iface, BOOL fEnterMode)
Definition: ipwindow.c:86
static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface, LPCOLESTR pszStatusText)
Definition: ipwindow.c:148
static InPlaceUIWindow * impl_from_IOleInPlaceUIWindow(IOleInPlaceUIWindow *iface)
Definition: ipwindow.c:209
static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject)
Definition: ipwindow.c:133
static HRESULT WINAPI InPlaceUIWindow_GetWindow(IOleInPlaceUIWindow *iface, HWND *phwnd)
Definition: ipwindow.c:259
HRESULT create_ip_frame(IOleInPlaceFrame **ret)
Definition: ipwindow.c:189
static HRESULT WINAPI InPlaceUIWindow_QueryInterface(IOleInPlaceUIWindow *iface, REFIID riid, void **ppv)
Definition: ipwindow.c:214
static const IOleInPlaceUIWindowVtbl OleInPlaceUIWindowVtbl
Definition: ipwindow.c:305
static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared)
Definition: ipwindow.c:141
static HRESULT WINAPI InPlaceUIWindow_GetBorder(IOleInPlaceUIWindow *iface, LPRECT lprectBorder)
Definition: ipwindow.c:274
static HRESULT WINAPI InPlaceUIWindow_RequestBorderSpace(IOleInPlaceUIWindow *iface, LPCBORDERWIDTHS pborderwidths)
Definition: ipwindow.c:281
static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg, WORD wID)
Definition: ipwindow.c:163
static HRESULT WINAPI InPlaceFrame_QueryInterface(IOleInPlaceFrame *iface, REFIID riid, void **ppv)
Definition: ipwindow.c:31
static ULONG WINAPI InPlaceFrame_AddRef(IOleInPlaceFrame *iface)
Definition: ipwindow.c:56
static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface, LPCBORDERWIDTHS pborderwidths)
Definition: ipwindow.c:109
static InPlaceFrame * impl_from_IOleInPlaceFrame(IOleInPlaceFrame *iface)
Definition: ipwindow.c:26
static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface, LPCBORDERWIDTHS pborderwidths)
Definition: ipwindow.c:101
#define debugstr_w
Definition: kernel32.h:32
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
const GUID IID_IOleInPlaceFrame
const GUID IID_IOleWindow
const GUID IID_IOleInPlaceUIWindow
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define TRACE(s)
Definition: solgame.cpp:4
IOleInPlaceFrame IOleInPlaceFrame_iface
Definition: ipwindow.c:22
LONG ref
Definition: ipwindow.c:23
IOleInPlaceUIWindow IOleInPlaceUIWindow_iface
Definition: ipwindow.c:205
Definition: send.c:48
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364