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
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
36 const IHTMLScreenVtbl
*lpIHTMLScreenVtbl
;
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
);
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
;
62 IUnknown_AddRef((IUnknown
*)*ppv
);
66 WARN("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
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
);
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
);
88 release_dispex(&This
->dispex
);
95 static HRESULT WINAPI
HTMLScreen_GetTypeInfoCount(IHTMLScreen
*iface
, UINT
*pctinfo
)
97 HTMLScreen
*This
= HTMLSCREEN_THIS(iface
);
98 FIXME("(%p)\n", This
);
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
);
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
);
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
);
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
);
137 static HRESULT WINAPI
HTMLScreen_put_bufferDepth(IHTMLScreen
*iface
, LONG v
)
139 HTMLScreen
*This
= HTMLSCREEN_THIS(iface
);
140 FIXME("(%p)->(%d)\n", This
, v
);
144 static HRESULT WINAPI
HTMLScreen_get_bufferDepth(IHTMLScreen
*iface
, LONG
*p
)
146 HTMLScreen
*This
= HTMLSCREEN_THIS(iface
);
147 FIXME("(%p)->(%p)\n", This
, p
);
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
);
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
);
171 static HRESULT WINAPI
HTMLScreen_put_updateInterval(IHTMLScreen
*iface
, LONG v
)
173 HTMLScreen
*This
= HTMLSCREEN_THIS(iface
);
174 FIXME("(%p)->(%d)\n", This
, v
);
178 static HRESULT WINAPI
HTMLScreen_get_updateInterval(IHTMLScreen
*iface
, LONG
*p
)
180 HTMLScreen
*This
= HTMLSCREEN_THIS(iface
);
181 FIXME("(%p)->(%p)\n", This
, p
);
185 static HRESULT WINAPI
HTMLScreen_get_availHeight(IHTMLScreen
*iface
, LONG
*p
)
187 HTMLScreen
*This
= HTMLSCREEN_THIS(iface
);
188 FIXME("(%p)->(%p)\n", This
, p
);
192 static HRESULT WINAPI
HTMLScreen_get_availWidth(IHTMLScreen
*iface
, LONG
*p
)
194 HTMLScreen
*This
= HTMLSCREEN_THIS(iface
);
195 FIXME("(%p)->(%p)\n", This
, p
);
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
);
206 #undef HTMLSCREEN_THIS
208 static const IHTMLScreenVtbl HTMLSreenVtbl
= {
209 HTMLScreen_QueryInterface
,
212 HTMLScreen_GetTypeInfoCount
,
213 HTMLScreen_GetTypeInfo
,
214 HTMLScreen_GetIDsOfNames
,
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
[] = {
232 static dispex_static_data_t HTMLScreen_dispex
= {
236 HTMLScreen_iface_tids
239 HRESULT
HTMLScreen_Create(IHTMLScreen
**ret
)
243 screen
= heap_alloc_zero(sizeof(HTMLScreen
));
245 return E_OUTOFMEMORY
;
247 screen
->lpIHTMLScreenVtbl
= &HTMLSreenVtbl
;
250 init_dispex(&screen
->dispex
, (IUnknown
*)HTMLSCREEN(screen
), &HTMLScreen_dispex
);
252 *ret
= HTMLSCREEN(screen
);