wined3d: Disable TEXTURE_RECTANGLE in SetupForBlit.
[wine.git] / dlls / mshtml / omnavigator.c
blob32bd9bf7493aca3dd33184e4f6205140c2e7ed5d
1 /*
2 * Copyright 2008 Jacek Caban for CodeWeavers
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.
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.
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
19 #include <stdarg.h>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
34 typedef struct {
35 DispatchEx dispex;
36 const IOmNavigatorVtbl *lpIOmNavigatorVtbl;
38 LONG ref;
39 } OmNavigator;
41 #define OMNAVIGATOR(x) ((IOmNavigator*) &(x)->lpIOmNavigatorVtbl)
43 #define OMNAVIGATOR_THIS(iface) DEFINE_THIS(OmNavigator, IOmNavigator, iface)
45 static HRESULT WINAPI OmNavigator_QueryInterface(IOmNavigator *iface, REFIID riid, void **ppv)
47 OmNavigator *This = OMNAVIGATOR_THIS(iface);
49 *ppv = NULL;
51 if(IsEqualGUID(&IID_IUnknown, riid)) {
52 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
53 *ppv = OMNAVIGATOR(This);
54 }else if(IsEqualGUID(&IID_IOmNavigator, riid)) {
55 TRACE("(%p)->(IID_IOmNavigator %p)\n", This, ppv);
56 *ppv = OMNAVIGATOR(This);
57 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
58 return *ppv ? S_OK : E_NOINTERFACE;
61 if(*ppv) {
62 IUnknown_AddRef((IUnknown*)*ppv);
63 return S_OK;
66 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
67 return E_NOINTERFACE;
70 static ULONG WINAPI OmNavigator_AddRef(IOmNavigator *iface)
72 OmNavigator *This = OMNAVIGATOR_THIS(iface);
73 LONG ref = InterlockedIncrement(&This->ref);
75 TRACE("(%p) ref=%d\n", This, ref);
77 return ref;
80 static ULONG WINAPI OmNavigator_Release(IOmNavigator *iface)
82 OmNavigator *This = OMNAVIGATOR_THIS(iface);
83 LONG ref = InterlockedDecrement(&This->ref);
85 TRACE("(%p) ref=%d\n", This, ref);
87 if(!ref)
88 heap_free(This);
90 return ref;
93 static HRESULT WINAPI OmNavigator_GetTypeInfoCount(IOmNavigator *iface, UINT *pctinfo)
95 OmNavigator *This = OMNAVIGATOR_THIS(iface);
96 FIXME("(%p)->(%p)\n", This, pctinfo);
97 return E_NOTIMPL;
100 static HRESULT WINAPI OmNavigator_GetTypeInfo(IOmNavigator *iface, UINT iTInfo,
101 LCID lcid, ITypeInfo **ppTInfo)
103 OmNavigator *This = OMNAVIGATOR_THIS(iface);
105 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
108 static HRESULT WINAPI OmNavigator_GetIDsOfNames(IOmNavigator *iface, REFIID riid,
109 LPOLESTR *rgszNames, UINT cNames,
110 LCID lcid, DISPID *rgDispId)
112 OmNavigator *This = OMNAVIGATOR_THIS(iface);
114 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
117 static HRESULT WINAPI OmNavigator_Invoke(IOmNavigator *iface, DISPID dispIdMember,
118 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
119 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
121 OmNavigator *This = OMNAVIGATOR_THIS(iface);
123 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
124 pVarResult, pExcepInfo, puArgErr);
127 static HRESULT WINAPI OmNavigator_get_appCodeName(IOmNavigator *iface, BSTR *p)
129 OmNavigator *This = OMNAVIGATOR_THIS(iface);
131 static const WCHAR mozillaW[] = {'M','o','z','i','l','l','a',0};
133 TRACE("(%p)->(%p)\n", This, p);
135 *p = SysAllocString(mozillaW);
136 return S_OK;
139 static HRESULT WINAPI OmNavigator_get_appName(IOmNavigator *iface, BSTR *p)
141 OmNavigator *This = OMNAVIGATOR_THIS(iface);
142 FIXME("(%p)->(%p)\n", This, p);
143 return E_NOTIMPL;
146 static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p)
148 OmNavigator *This = OMNAVIGATOR_THIS(iface);
149 FIXME("(%p)->(%p)\n", This, p);
150 return E_NOTIMPL;
153 static HRESULT WINAPI OmNavigator_get_userAgent(IOmNavigator *iface, BSTR *p)
155 OmNavigator *This = OMNAVIGATOR_THIS(iface);
156 FIXME("(%p)->(%p)\n", This, p);
157 return E_NOTIMPL;
160 static HRESULT WINAPI OmNavigator_javaEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
162 OmNavigator *This = OMNAVIGATOR_THIS(iface);
163 FIXME("(%p)->(%p)\n", This, enabled);
164 return E_NOTIMPL;
167 static HRESULT WINAPI OmNavigator_taintEnabled(IOmNavigator *iface, VARIANT_BOOL *enabled)
169 OmNavigator *This = OMNAVIGATOR_THIS(iface);
170 FIXME("(%p)->(%p)\n", This, enabled);
171 return E_NOTIMPL;
174 static HRESULT WINAPI OmNavigator_get_mimeTypes(IOmNavigator *iface, IHTMLMimeTypesCollection **p)
176 OmNavigator *This = OMNAVIGATOR_THIS(iface);
177 FIXME("(%p)->(%p)\n", This, p);
178 return E_NOTIMPL;
181 static HRESULT WINAPI OmNavigator_get_plugins(IOmNavigator *iface, IHTMLPluginsCollection **p)
183 OmNavigator *This = OMNAVIGATOR_THIS(iface);
184 FIXME("(%p)->(%p)\n", This, p);
185 return E_NOTIMPL;
188 static HRESULT WINAPI OmNavigator_get_cookieEnabled(IOmNavigator *iface, VARIANT_BOOL *p)
190 OmNavigator *This = OMNAVIGATOR_THIS(iface);
191 FIXME("(%p)->(%p)\n", This, p);
192 return E_NOTIMPL;
195 static HRESULT WINAPI OmNavigator_get_opsProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
197 OmNavigator *This = OMNAVIGATOR_THIS(iface);
198 FIXME("(%p)->(%p)\n", This, p);
199 return E_NOTIMPL;
202 static HRESULT WINAPI OmNavigator_toString(IOmNavigator *iface, BSTR *String)
204 OmNavigator *This = OMNAVIGATOR_THIS(iface);
205 FIXME("(%p)->(%p)\n", This, String);
206 return E_NOTIMPL;
209 static HRESULT WINAPI OmNavigator_get_cpuClass(IOmNavigator *iface, BSTR *p)
211 OmNavigator *This = OMNAVIGATOR_THIS(iface);
212 FIXME("(%p)->(%p)\n", This, p);
213 return E_NOTIMPL;
216 static HRESULT WINAPI OmNavigator_get_systemLanguage(IOmNavigator *iface, BSTR *p)
218 OmNavigator *This = OMNAVIGATOR_THIS(iface);
219 FIXME("(%p)->(%p)\n", This, p);
220 return E_NOTIMPL;
223 static HRESULT WINAPI OmNavigator_get_browserLanguage(IOmNavigator *iface, BSTR *p)
225 OmNavigator *This = OMNAVIGATOR_THIS(iface);
226 FIXME("(%p)->(%p)\n", This, p);
227 return E_NOTIMPL;
230 static HRESULT WINAPI OmNavigator_get_userLanguage(IOmNavigator *iface, BSTR *p)
232 OmNavigator *This = OMNAVIGATOR_THIS(iface);
233 FIXME("(%p)->(%p)\n", This, p);
234 return E_NOTIMPL;
237 static HRESULT WINAPI OmNavigator_get_platform(IOmNavigator *iface, BSTR *p)
239 OmNavigator *This = OMNAVIGATOR_THIS(iface);
241 static const WCHAR win32W[] = {'W','i','n','3','2',0};
243 TRACE("(%p)->(%p)\n", This, p);
245 *p = SysAllocString(win32W);
246 return S_OK;
249 static HRESULT WINAPI OmNavigator_get_appMinorVersion(IOmNavigator *iface, BSTR *p)
251 OmNavigator *This = OMNAVIGATOR_THIS(iface);
252 FIXME("(%p)->(%p)\n", This, p);
253 return E_NOTIMPL;
256 static HRESULT WINAPI OmNavigator_get_connectionSpeed(IOmNavigator *iface, long *p)
258 OmNavigator *This = OMNAVIGATOR_THIS(iface);
259 FIXME("(%p)->(%p)\n", This, p);
260 return E_NOTIMPL;
263 static HRESULT WINAPI OmNavigator_get_onLine(IOmNavigator *iface, VARIANT_BOOL *p)
265 OmNavigator *This = OMNAVIGATOR_THIS(iface);
266 FIXME("(%p)->(%p)\n", This, p);
267 return E_NOTIMPL;
270 static HRESULT WINAPI OmNavigator_get_userProfile(IOmNavigator *iface, IHTMLOpsProfile **p)
272 OmNavigator *This = OMNAVIGATOR_THIS(iface);
273 FIXME("(%p)->(%p)\n", This, p);
274 return E_NOTIMPL;
277 #undef OMNAVIGATOR_THIS
279 static const IOmNavigatorVtbl OmNavigatorVtbl = {
280 OmNavigator_QueryInterface,
281 OmNavigator_AddRef,
282 OmNavigator_Release,
283 OmNavigator_GetTypeInfoCount,
284 OmNavigator_GetTypeInfo,
285 OmNavigator_GetIDsOfNames,
286 OmNavigator_Invoke,
287 OmNavigator_get_appCodeName,
288 OmNavigator_get_appName,
289 OmNavigator_get_appVersion,
290 OmNavigator_get_userAgent,
291 OmNavigator_javaEnabled,
292 OmNavigator_taintEnabled,
293 OmNavigator_get_mimeTypes,
294 OmNavigator_get_plugins,
295 OmNavigator_get_cookieEnabled,
296 OmNavigator_get_opsProfile,
297 OmNavigator_toString,
298 OmNavigator_get_cpuClass,
299 OmNavigator_get_systemLanguage,
300 OmNavigator_get_browserLanguage,
301 OmNavigator_get_userLanguage,
302 OmNavigator_get_platform,
303 OmNavigator_get_appMinorVersion,
304 OmNavigator_get_connectionSpeed,
305 OmNavigator_get_onLine,
306 OmNavigator_get_userProfile
309 static const tid_t OmNavigator_iface_tids[] = {
310 IOmNavigator_tid,
313 static dispex_static_data_t OmNavigator_dispex = {
314 NULL,
315 IOmNavigator_tid,
316 NULL,
317 OmNavigator_iface_tids
320 IOmNavigator *OmNavigator_Create(void)
322 OmNavigator *ret;
324 ret = heap_alloc_zero(sizeof(*ret));
325 ret->lpIOmNavigatorVtbl = &OmNavigatorVtbl;
326 ret->ref = 1;
328 init_dispex(&ret->dispex, (IUnknown*)OMNAVIGATOR(ret), &OmNavigator_dispex);
330 return OMNAVIGATOR(ret);