Release 1.1.37.
[wine/gsoc-2012-control.git] / dlls / mshtml / htmlscreen.c
blobcc3f4b2eb2123a0816ef5177031d9a038a8ab7fb
1 /*
2 * Copyright 2009 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 IHTMLScreenVtbl *lpIHTMLScreenVtbl;
38 LONG ref;
39 } HTMLScreen;
41 #define HTMLSCREEN(x) ((IHTMLScreen*) &(x)->lpIHTMLScreenVtbl)
43 #define HTMLSCREEN_THIS(iface) DEFINE_THIS(HTMLScreen, IHTMLScreen, iface)
45 static HRESULT WINAPI HTMLScreen_QueryInterface(IHTMLScreen *iface, REFIID riid, void **ppv)
47 HTMLScreen *This = HTMLSCREEN_THIS(iface);
49 *ppv = NULL;
51 if(IsEqualGUID(&IID_IUnknown, riid)) {
52 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
53 *ppv = HTMLSCREEN(This);
54 }else if(IsEqualGUID(&IID_IHTMLScreen, riid)) {
55 TRACE("(%p)->(IID_IHTMLScreen %p)\n", This, ppv);
56 *ppv = HTMLSCREEN(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 HTMLScreen_AddRef(IHTMLScreen *iface)
72 HTMLScreen *This = HTMLSCREEN_THIS(iface);
73 LONG ref = InterlockedIncrement(&This->ref);
75 TRACE("(%p) ref=%d\n", This, ref);
77 return ref;
80 static ULONG WINAPI HTMLScreen_Release(IHTMLScreen *iface)
82 HTMLScreen *This = HTMLSCREEN_THIS(iface);
83 LONG ref = InterlockedDecrement(&This->ref);
85 TRACE("(%p) ref=%d\n", This, ref);
87 if(!ref) {
88 release_dispex(&This->dispex);
89 heap_free(This);
92 return ref;
95 static HRESULT WINAPI HTMLScreen_GetTypeInfoCount(IHTMLScreen *iface, UINT *pctinfo)
97 HTMLScreen *This = HTMLSCREEN_THIS(iface);
98 FIXME("(%p)\n", This);
99 return E_NOTIMPL;
102 static HRESULT WINAPI HTMLScreen_GetTypeInfo(IHTMLScreen *iface, UINT iTInfo,
103 LCID lcid, ITypeInfo **ppTInfo)
105 HTMLScreen *This = HTMLSCREEN_THIS(iface);
106 FIXME("(%p)\n", This);
107 return E_NOTIMPL;
110 static HRESULT WINAPI HTMLScreen_GetIDsOfNames(IHTMLScreen *iface, REFIID riid,
111 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
113 HTMLScreen *This = HTMLSCREEN_THIS(iface);
114 FIXME("(%p)\n", This);
115 return E_NOTIMPL;
118 static HRESULT WINAPI HTMLScreen_Invoke(IHTMLScreen *iface, DISPID dispIdMember,
119 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
120 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
122 HTMLScreen *This = HTMLSCREEN_THIS(iface);
123 FIXME("(%p)\n", This);
124 return E_NOTIMPL;
127 static HRESULT WINAPI HTMLScreen_get_colorDepth(IHTMLScreen *iface, LONG *p)
129 HTMLScreen *This = HTMLSCREEN_THIS(iface);
131 TRACE("(%p)->(%p)\n", This, p);
133 *p = GetDeviceCaps(get_display_dc(), BITSPIXEL);
134 return S_OK;
137 static HRESULT WINAPI HTMLScreen_put_bufferDepth(IHTMLScreen *iface, LONG v)
139 HTMLScreen *This = HTMLSCREEN_THIS(iface);
140 FIXME("(%p)->(%d)\n", This, v);
141 return E_NOTIMPL;
144 static HRESULT WINAPI HTMLScreen_get_bufferDepth(IHTMLScreen *iface, LONG *p)
146 HTMLScreen *This = HTMLSCREEN_THIS(iface);
147 FIXME("(%p)->(%p)\n", This, p);
148 return E_NOTIMPL;
151 static HRESULT WINAPI HTMLScreen_get_width(IHTMLScreen *iface, LONG *p)
153 HTMLScreen *This = HTMLSCREEN_THIS(iface);
155 TRACE("(%p)->(%p)\n", This, p);
157 *p = GetDeviceCaps(get_display_dc(), HORZRES);
158 return S_OK;
161 static HRESULT WINAPI HTMLScreen_get_height(IHTMLScreen *iface, LONG *p)
163 HTMLScreen *This = HTMLSCREEN_THIS(iface);
165 TRACE("(%p)->(%p)\n", This, p);
167 *p = GetDeviceCaps(get_display_dc(), VERTRES);
168 return S_OK;
171 static HRESULT WINAPI HTMLScreen_put_updateInterval(IHTMLScreen *iface, LONG v)
173 HTMLScreen *This = HTMLSCREEN_THIS(iface);
174 FIXME("(%p)->(%d)\n", This, v);
175 return E_NOTIMPL;
178 static HRESULT WINAPI HTMLScreen_get_updateInterval(IHTMLScreen *iface, LONG *p)
180 HTMLScreen *This = HTMLSCREEN_THIS(iface);
181 FIXME("(%p)->(%p)\n", This, p);
182 return E_NOTIMPL;
185 static HRESULT WINAPI HTMLScreen_get_availHeight(IHTMLScreen *iface, LONG *p)
187 HTMLScreen *This = HTMLSCREEN_THIS(iface);
188 FIXME("(%p)->(%p)\n", This, p);
189 return E_NOTIMPL;
192 static HRESULT WINAPI HTMLScreen_get_availWidth(IHTMLScreen *iface, LONG *p)
194 HTMLScreen *This = HTMLSCREEN_THIS(iface);
195 FIXME("(%p)->(%p)\n", This, p);
196 return E_NOTIMPL;
199 static HRESULT WINAPI HTMLScreen_get_fontSmoothingEnabled(IHTMLScreen *iface, VARIANT_BOOL *p)
201 HTMLScreen *This = HTMLSCREEN_THIS(iface);
202 FIXME("(%p)->(%p)\n", This, p);
203 return E_NOTIMPL;
206 #undef HTMLSCREEN_THIS
208 static const IHTMLScreenVtbl HTMLSreenVtbl = {
209 HTMLScreen_QueryInterface,
210 HTMLScreen_AddRef,
211 HTMLScreen_Release,
212 HTMLScreen_GetTypeInfoCount,
213 HTMLScreen_GetTypeInfo,
214 HTMLScreen_GetIDsOfNames,
215 HTMLScreen_Invoke,
216 HTMLScreen_get_colorDepth,
217 HTMLScreen_put_bufferDepth,
218 HTMLScreen_get_bufferDepth,
219 HTMLScreen_get_width,
220 HTMLScreen_get_height,
221 HTMLScreen_put_updateInterval,
222 HTMLScreen_get_updateInterval,
223 HTMLScreen_get_availHeight,
224 HTMLScreen_get_availWidth,
225 HTMLScreen_get_fontSmoothingEnabled
228 static const tid_t HTMLScreen_iface_tids[] = {
229 IHTMLScreen_tid,
232 static dispex_static_data_t HTMLScreen_dispex = {
233 NULL,
234 DispHTMLScreen_tid,
235 NULL,
236 HTMLScreen_iface_tids
239 HRESULT HTMLScreen_Create(IHTMLScreen **ret)
241 HTMLScreen *screen;
243 screen = heap_alloc_zero(sizeof(HTMLScreen));
244 if(!screen)
245 return E_OUTOFMEMORY;
247 screen->lpIHTMLScreenVtbl = &HTMLSreenVtbl;
248 screen->ref = 1;
250 init_dispex(&screen->dispex, (IUnknown*)HTMLSCREEN(screen), &HTMLScreen_dispex);
252 *ret = HTMLSCREEN(screen);
253 return S_OK;