ReactOS  0.4.14-dev-599-g2d4d3f5
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 
21 typedef struct {
24 } InPlaceFrame;
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)
74  heap_free(This);
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 
171 static 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 
204 typedef 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 
220  if(IsEqualGUID(&IID_IUnknown, riid)) {
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)
254  heap_free(This);
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 
305 static 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 }
const GUID IID_IOleInPlaceFrame
static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject)
Definition: ipwindow.c:133
static HRESULT WINAPI InPlaceUIWindow_RequestBorderSpace(IOleInPlaceUIWindow *iface, LPCBORDERWIDTHS pborderwidths)
Definition: ipwindow.c:281
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
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 InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface, LPCOLESTR pszStatusText)
Definition: ipwindow.c:148
static ULONG WINAPI InPlaceUIWindow_AddRef(IOleInPlaceUIWindow *iface)
Definition: ipwindow.c:236
REFIID riid
Definition: precomp.h:44
static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface, LPCBORDERWIDTHS pborderwidths)
Definition: ipwindow.c:101
#define WARN(fmt,...)
Definition: debug.h:111
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IOleInPlaceFrame InPlaceFrame
Definition: activex.c:1864
static ULONG WINAPI InPlaceFrame_AddRef(IOleInPlaceFrame *iface)
Definition: ipwindow.c:56
static InPlaceUIWindow * impl_from_IOleInPlaceUIWindow(IOleInPlaceUIWindow *iface)
Definition: ipwindow.c:209
Definition: send.c:47
static const IOleInPlaceUIWindowVtbl OleInPlaceUIWindowVtbl
Definition: ipwindow.c:305
static HRESULT WINAPI InPlaceUIWindow_GetBorder(IOleInPlaceUIWindow *iface, LPRECT lprectBorder)
Definition: ipwindow.c:274
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:535
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static ULONG WINAPI InPlaceFrame_Release(IOleInPlaceFrame *iface)
Definition: ipwindow.c:66
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame *iface, BOOL fEnterMode)
Definition: ipwindow.c:86
#define debugstr_w
Definition: kernel32.h:32
GLenum GLint ref
Definition: glext.h:6028
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
Definition: ipwindow.c:117
static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg, WORD wID)
Definition: ipwindow.c:163
static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)
Definition: ipwindow.c:125
static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared)
Definition: ipwindow.c:141
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
Definition: ipwindow.c:156
LONG ref
Definition: ipwindow.c:23
static HRESULT WINAPI InPlaceUIWindow_SetActiveObject(IOleInPlaceUIWindow *iface, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
Definition: ipwindow.c:297
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI InPlaceUIWindow_QueryInterface(IOleInPlaceUIWindow *iface, REFIID riid, void **ppv)
Definition: ipwindow.c:214
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:6
static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl
Definition: ipwindow.c:171
static HRESULT WINAPI InPlaceFrame_QueryInterface(IOleInPlaceFrame *iface, REFIID riid, void **ppv)
Definition: ipwindow.c:31
unsigned short WORD
Definition: ntddk_ex.h:93
static HRESULT WINAPI InPlaceUIWindow_ContextSensitiveHelp(IOleInPlaceUIWindow *iface, BOOL fEnterMode)
Definition: ipwindow.c:266
static HRESULT WINAPI InPlaceUIWindow_SetBorderSpace(IOleInPlaceUIWindow *iface, LPCBORDERWIDTHS pborderwidths)
Definition: ipwindow.c:289
int ret
#define InterlockedDecrement
Definition: armddk.h:52
static InPlaceFrame * impl_from_IOleInPlaceFrame(IOleInPlaceFrame *iface)
Definition: ipwindow.c:26
#define S_OK
Definition: intsafe.h:59
HRESULT create_ip_window(IOleInPlaceUIWindow **ret)
Definition: ipwindow.c:317
#define InterlockedIncrement
Definition: armddk.h:53
static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder)
Definition: ipwindow.c:94
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static IOleInPlaceFrame InPlaceUIWindow
Definition: activex.c:1878
const GUID IID_IOleWindow
unsigned int ULONG
Definition: retypes.h:1
static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd)
Definition: ipwindow.c:79
static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface, LPCBORDERWIDTHS pborderwidths)
Definition: ipwindow.c:109
const GUID IID_IOleInPlaceUIWindow
static ULONG WINAPI InPlaceUIWindow_Release(IOleInPlaceUIWindow *iface)
Definition: ipwindow.c:246
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
IOleInPlaceFrame IOleInPlaceFrame_iface
Definition: ipwindow.c:22
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
IOleInPlaceUIWindow IOleInPlaceUIWindow_iface
Definition: ipwindow.c:205