Fix gcc 4.0 -Wpointer-sign warnings.
[wine] / dlls / mshtml / olewnd.c
1 /*
2  * Copyright 2005 Jacek Caban
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #include "config.h"
20
21 #include <stdarg.h>
22 #include <stdio.h>
23
24 #define COBJMACROS
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "ole2.h"
30 #include "docobj.h"
31
32 #include "mshtml.h"
33
34 #include "wine/debug.h"
35
36 #include "mshtml_private.h"
37
38 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
39
40 /**********************************************************
41  * IOleInPlaceActiveObject implementation
42  */
43
44 #define ACTOBJ_THIS DEFINE_THIS(HTMLDocument, OleInPlaceActiveObject)
45
46 static HRESULT WINAPI OleInPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface, REFIID riid, void **ppvObject)
47 {
48     ACTOBJ_THIS
49     return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
50 }
51
52 static ULONG WINAPI OleInPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface)
53 {
54     ACTOBJ_THIS
55     return IHTMLDocument2_AddRef(HTMLDOC(This));
56 }
57
58 static ULONG WINAPI OleInPlaceActiveObject_Release(IOleInPlaceActiveObject *iface)
59 {
60     ACTOBJ_THIS
61     return IHTMLDocument2_Release(HTMLDOC(This));
62 }
63
64 static HRESULT WINAPI OleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, HWND *phwnd)
65 {
66     ACTOBJ_THIS
67     TRACE("(%p)->(%p)\n", This, phwnd);
68
69     if(!phwnd)
70         return E_INVALIDARG;
71
72     *phwnd = This->hwnd;
73     return S_OK;
74 }
75
76 static HRESULT WINAPI OleInPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface, BOOL fEnterMode)
77 {
78     ACTOBJ_THIS
79     FIXME("(%p)->(%x)\n", This, fEnterMode);
80     return E_NOTIMPL;
81 }
82
83 static HRESULT WINAPI OleInPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface, LPMSG lpmsg)
84 {
85     ACTOBJ_THIS
86     FIXME("(%p)->(%p)\n", This, lpmsg);
87     return E_NOTIMPL;
88 }
89
90 static HRESULT WINAPI OleInPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate)
91 {
92     ACTOBJ_THIS
93     FIXME("(%p)->(%x)\n", This, fActivate);
94     return E_NOTIMPL;
95 }
96
97 static HRESULT WINAPI OleInPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate)
98 {
99     ACTOBJ_THIS
100     FIXME("(%p)->(%x)\n", This, fActivate);
101     return E_NOTIMPL;
102 }
103
104 static HRESULT WINAPI OleInPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface, LPCRECT prcBorder,
105                                                 IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow)
106 {
107     ACTOBJ_THIS
108     FIXME("(%p)->(%p %p %x)\n", This, prcBorder, pUIWindow, fFrameWindow);
109     return E_NOTIMPL;
110 }
111
112 static HRESULT WINAPI OleInPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface, BOOL fEnable)
113 {
114     ACTOBJ_THIS
115     FIXME("(%p)->(%x)\n", This, fEnable);
116     return E_NOTIMPL;
117 }
118
119 static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = {
120     OleInPlaceActiveObject_QueryInterface,
121     OleInPlaceActiveObject_AddRef,
122     OleInPlaceActiveObject_Release,
123     OleInPlaceActiveObject_GetWindow,
124     OleInPlaceActiveObject_ContextSensitiveHelp,
125     OleInPlaceActiveObject_TranslateAccelerator,
126     OleInPlaceActiveObject_OnFrameWindowActivate,
127     OleInPlaceActiveObject_OnDocWindowActivate,
128     OleInPlaceActiveObject_ResizeBorder,
129     OleInPlaceActiveObject_EnableModeless
130 };
131
132 #undef ACTOBJ_THIS
133
134 /**********************************************************
135  * IOleInPlaceObjectWindowless implementation
136  */
137
138 #define OLEINPLACEWND_THIS DEFINE_THIS(HTMLDocument, OleInPlaceObjectWindowless)
139
140 static HRESULT WINAPI OleInPlaceObjectWindowless_QueryInterface(IOleInPlaceObjectWindowless *iface,
141         REFIID riid, void **ppvObject)
142 {
143     OLEINPLACEWND_THIS
144     return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
145 }
146
147 static ULONG WINAPI OleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface)
148 {
149     OLEINPLACEWND_THIS
150     return IHTMLDocument2_AddRef(HTMLDOC(This));
151 }
152
153 static ULONG WINAPI OleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface)
154 {
155     OLEINPLACEWND_THIS
156     return IHTMLDocument2_Release(HTMLDOC(This));
157 }
158
159 static HRESULT WINAPI OleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface,
160         HWND *phwnd)
161 {
162     OLEINPLACEWND_THIS
163     return IOleWindow_GetWindow(OLEWIN(This), phwnd);
164 }
165
166 static HRESULT WINAPI OleInPlaceObjectWindowless_ContextSensitiveHelp(IOleInPlaceObjectWindowless *iface,
167         BOOL fEnterMode)
168 {
169     OLEINPLACEWND_THIS
170     return IOleWindow_ContextSensitiveHelp(OLEWIN(This), fEnterMode);
171 }
172
173 static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface)
174 {
175     OLEINPLACEWND_THIS
176     FIXME("(%p)\n", This);
177     return E_NOTIMPL;
178 }
179
180 static HRESULT WINAPI OleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless *iface)
181 {
182     OLEINPLACEWND_THIS
183     FIXME("(%p)\n", This);
184     return E_NOTIMPL;
185 }
186
187 static HRESULT WINAPI OleInPlaceObjectWindowless_SetObjectRects(IOleInPlaceObjectWindowless *iface,
188         LPCRECT lprcPosRect, LPCRECT lprcClipRect)
189 {
190     OLEINPLACEWND_THIS
191     FIXME("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
192     return E_NOTIMPL;
193 }
194
195 static HRESULT WINAPI OleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceObjectWindowless *iface)
196 {
197     OLEINPLACEWND_THIS
198     FIXME("(%p)\n", This);
199     return E_NOTIMPL;
200 }
201
202 static HRESULT WINAPI OleInPlaceObjectWindowless_OnWindowMessage(IOleInPlaceObjectWindowless *iface,
203         UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *lpResult)
204 {
205     OLEINPLACEWND_THIS
206     FIXME("(%p)->(%u %u %lu %p)\n", This, msg, wParam, lParam, lpResult);
207     return E_NOTIMPL;
208 }
209
210 static HRESULT WINAPI OleInPlaceObjectWindowless_GetDropTarget(IOleInPlaceObjectWindowless *iface,
211         IDropTarget **ppDropTarget)
212 {
213     OLEINPLACEWND_THIS
214     FIXME("(%p)->(%p)\n", This, ppDropTarget);
215     return E_NOTIMPL;
216 }
217
218 static IOleInPlaceObjectWindowlessVtbl OleInPlaceObjectWindowlessVtbl = {
219     OleInPlaceObjectWindowless_QueryInterface,
220     OleInPlaceObjectWindowless_AddRef,
221     OleInPlaceObjectWindowless_Release,
222     OleInPlaceObjectWindowless_GetWindow,
223     OleInPlaceObjectWindowless_ContextSensitiveHelp,
224     OleInPlaceObjectWindowless_InPlaceDeactivate,
225     OleInPlaceObjectWindowless_UIDeactivate,
226     OleInPlaceObjectWindowless_SetObjectRects,
227     OleInPlaceObjectWindowless_ReactivateAndUndo,
228     OleInPlaceObjectWindowless_OnWindowMessage,
229     OleInPlaceObjectWindowless_GetDropTarget
230 };
231
232 #undef INPLACEWIN_THIS
233
234 void HTMLDocument_Window_Init(HTMLDocument *This)
235 {
236     This->lpOleInPlaceActiveObjectVtbl = &OleInPlaceActiveObjectVtbl;
237     This->lpOleInPlaceObjectWindowlessVtbl = &OleInPlaceObjectWindowlessVtbl;
238 }