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 IHTMLScreen IHTMLScreen_iface
;
41 static inline HTMLScreen
*impl_from_IHTMLScreen(IHTMLScreen
*iface
)
43 return CONTAINING_RECORD(iface
, HTMLScreen
, IHTMLScreen_iface
);
46 static HRESULT WINAPI
HTMLScreen_QueryInterface(IHTMLScreen
*iface
, REFIID riid
, void **ppv
)
48 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
52 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
53 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
54 *ppv
= &This
->IHTMLScreen_iface
;
55 }else if(IsEqualGUID(&IID_IHTMLScreen
, riid
)) {
56 TRACE("(%p)->(IID_IHTMLScreen %p)\n", This
, ppv
);
57 *ppv
= &This
->IHTMLScreen_iface
;
58 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
59 return *ppv
? S_OK
: E_NOINTERFACE
;
63 IUnknown_AddRef((IUnknown
*)*ppv
);
67 WARN("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
71 static ULONG WINAPI
HTMLScreen_AddRef(IHTMLScreen
*iface
)
73 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
74 LONG ref
= InterlockedIncrement(&This
->ref
);
76 TRACE("(%p) ref=%d\n", This
, ref
);
81 static ULONG WINAPI
HTMLScreen_Release(IHTMLScreen
*iface
)
83 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
84 LONG ref
= InterlockedDecrement(&This
->ref
);
86 TRACE("(%p) ref=%d\n", This
, ref
);
89 release_dispex(&This
->dispex
);
96 static HRESULT WINAPI
HTMLScreen_GetTypeInfoCount(IHTMLScreen
*iface
, UINT
*pctinfo
)
98 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
99 FIXME("(%p)\n", This
);
103 static HRESULT WINAPI
HTMLScreen_GetTypeInfo(IHTMLScreen
*iface
, UINT iTInfo
,
104 LCID lcid
, ITypeInfo
**ppTInfo
)
106 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
107 FIXME("(%p)\n", This
);
111 static HRESULT WINAPI
HTMLScreen_GetIDsOfNames(IHTMLScreen
*iface
, REFIID riid
,
112 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
114 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
115 FIXME("(%p)\n", This
);
119 static HRESULT WINAPI
HTMLScreen_Invoke(IHTMLScreen
*iface
, DISPID dispIdMember
,
120 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
121 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
123 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
124 FIXME("(%p)\n", This
);
128 static HRESULT WINAPI
HTMLScreen_get_colorDepth(IHTMLScreen
*iface
, LONG
*p
)
130 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
132 TRACE("(%p)->(%p)\n", This
, p
);
134 *p
= GetDeviceCaps(get_display_dc(), BITSPIXEL
);
138 static HRESULT WINAPI
HTMLScreen_put_bufferDepth(IHTMLScreen
*iface
, LONG v
)
140 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
141 FIXME("(%p)->(%d)\n", This
, v
);
145 static HRESULT WINAPI
HTMLScreen_get_bufferDepth(IHTMLScreen
*iface
, LONG
*p
)
147 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
148 FIXME("(%p)->(%p)\n", This
, p
);
152 static HRESULT WINAPI
HTMLScreen_get_width(IHTMLScreen
*iface
, LONG
*p
)
154 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
156 TRACE("(%p)->(%p)\n", This
, p
);
158 *p
= GetDeviceCaps(get_display_dc(), HORZRES
);
162 static HRESULT WINAPI
HTMLScreen_get_height(IHTMLScreen
*iface
, LONG
*p
)
164 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
166 TRACE("(%p)->(%p)\n", This
, p
);
168 *p
= GetDeviceCaps(get_display_dc(), VERTRES
);
172 static HRESULT WINAPI
HTMLScreen_put_updateInterval(IHTMLScreen
*iface
, LONG v
)
174 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
175 FIXME("(%p)->(%d)\n", This
, v
);
179 static HRESULT WINAPI
HTMLScreen_get_updateInterval(IHTMLScreen
*iface
, LONG
*p
)
181 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
182 FIXME("(%p)->(%p)\n", This
, p
);
186 static HRESULT WINAPI
HTMLScreen_get_availHeight(IHTMLScreen
*iface
, LONG
*p
)
188 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
191 TRACE("(%p)->(%p)\n", This
, p
);
193 if(!SystemParametersInfoW(SPI_GETWORKAREA
, 0, &work_area
, 0))
196 *p
= work_area
.bottom
-work_area
.top
;
200 static HRESULT WINAPI
HTMLScreen_get_availWidth(IHTMLScreen
*iface
, LONG
*p
)
202 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
205 TRACE("(%p)->(%p)\n", This
, p
);
207 if(!SystemParametersInfoW(SPI_GETWORKAREA
, 0, &work_area
, 0))
210 *p
= work_area
.right
-work_area
.left
;
214 static HRESULT WINAPI
HTMLScreen_get_fontSmoothingEnabled(IHTMLScreen
*iface
, VARIANT_BOOL
*p
)
216 HTMLScreen
*This
= impl_from_IHTMLScreen(iface
);
217 FIXME("(%p)->(%p)\n", This
, p
);
221 static const IHTMLScreenVtbl HTMLSreenVtbl
= {
222 HTMLScreen_QueryInterface
,
225 HTMLScreen_GetTypeInfoCount
,
226 HTMLScreen_GetTypeInfo
,
227 HTMLScreen_GetIDsOfNames
,
229 HTMLScreen_get_colorDepth
,
230 HTMLScreen_put_bufferDepth
,
231 HTMLScreen_get_bufferDepth
,
232 HTMLScreen_get_width
,
233 HTMLScreen_get_height
,
234 HTMLScreen_put_updateInterval
,
235 HTMLScreen_get_updateInterval
,
236 HTMLScreen_get_availHeight
,
237 HTMLScreen_get_availWidth
,
238 HTMLScreen_get_fontSmoothingEnabled
241 static const tid_t HTMLScreen_iface_tids
[] = {
245 static dispex_static_data_t HTMLScreen_dispex
= {
249 HTMLScreen_iface_tids
252 HRESULT
HTMLScreen_Create(IHTMLScreen
**ret
)
256 screen
= heap_alloc_zero(sizeof(HTMLScreen
));
258 return E_OUTOFMEMORY
;
260 screen
->IHTMLScreen_iface
.lpVtbl
= &HTMLSreenVtbl
;
263 init_dispex(&screen
->dispex
, (IUnknown
*)&screen
->IHTMLScreen_iface
, &HTMLScreen_dispex
);
265 *ret
= &screen
->IHTMLScreen_iface
;