shdocvw: Added WebBrowser::TheaterMode implementation.

This commit is contained in:
Jacek Caban 2008-02-22 11:34:06 +01:00 committed by Alexandre Julliard
parent 89069761ba
commit 71d07da2d3
3 changed files with 57 additions and 4 deletions

View File

@ -144,6 +144,7 @@ struct WebBrowser {
VARIANT_BOOL status_bar;
VARIANT_BOOL tool_bar;
VARIANT_BOOL full_screen;
VARIANT_BOOL theater_mode;
DocHost doc_host;
};

View File

@ -89,6 +89,7 @@ DEFINE_EXPECT(Invoke_ONADDRESSBAR);
DEFINE_EXPECT(Invoke_ONSTATUSBAR);
DEFINE_EXPECT(Invoke_ONTOOLBAR);
DEFINE_EXPECT(Invoke_ONFULLSCREEN);
DEFINE_EXPECT(Invoke_ONTHEATERMODE);
DEFINE_EXPECT(Invoke_WINDOWSETRESIZABLE);
DEFINE_EXPECT(EnableModeless_TRUE);
DEFINE_EXPECT(EnableModeless_FALSE);
@ -620,6 +621,11 @@ static HRESULT WINAPI WebBrowserEvents2_Invoke(IDispatch *iface, DISPID dispIdMe
test_invoke_bool(pDispParams);
break;
case DISPID_ONTHEATERMODE:
CHECK_EXPECT(Invoke_ONTHEATERMODE);
test_invoke_bool(pDispParams);
break;
case DISPID_WINDOWSETRESIZABLE:
CHECK_EXPECT(Invoke_WINDOWSETRESIZABLE);
test_invoke_bool(pDispParams);
@ -1575,6 +1581,35 @@ static void test_ie_funcs(IUnknown *unk)
ok(hres == S_OK, "put_FullScreen failed: %08x\n", hres);
CHECK_CALLED(Invoke_ONFULLSCREEN);
/* TheaterMode */
hres = IWebBrowser2_get_TheaterMode(wb, &b);
ok(hres == S_OK, "get_TheaterMode failed: %08x\n", hres);
ok(b == VARIANT_FALSE, "b=%x\n", b);
SET_EXPECT(Invoke_ONTHEATERMODE);
hres = IWebBrowser2_put_TheaterMode(wb, (exvb = VARIANT_TRUE));
ok(hres == S_OK, "put_TheaterMode failed: %08x\n", hres);
CHECK_CALLED(Invoke_ONTHEATERMODE);
hres = IWebBrowser2_get_TheaterMode(wb, &b);
ok(hres == S_OK, "get_TheaterMode failed: %08x\n", hres);
ok(b == VARIANT_TRUE, "b=%x\n", b);
SET_EXPECT(Invoke_ONTHEATERMODE);
hres = IWebBrowser2_put_TheaterMode(wb, (exvb = 100));
ok(hres == S_OK, "put_TheaterMode failed: %08x\n", hres);
CHECK_CALLED(Invoke_ONTHEATERMODE);
hres = IWebBrowser2_get_TheaterMode(wb, &b);
ok(hres == S_OK, "get_TheaterMode failed: %08x\n", hres);
ok(b == VARIANT_TRUE, "b=%x\n", b);
SET_EXPECT(Invoke_ONTHEATERMODE);
hres = IWebBrowser2_put_TheaterMode(wb, (exvb = VARIANT_FALSE));
ok(hres == S_OK, "put_TheaterMode failed: %08x\n", hres);
CHECK_CALLED(Invoke_ONTHEATERMODE);
/* Resizable */
b = 0x100;

View File

@ -817,15 +817,31 @@ static HRESULT WINAPI WebBrowser_put_RegisterAsDropTarget(IWebBrowser2 *iface,
static HRESULT WINAPI WebBrowser_get_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL *pbRegister)
{
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, pbRegister);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, pbRegister);
*pbRegister = This->theater_mode;
return S_OK;
}
static HRESULT WINAPI WebBrowser_put_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL bRegister)
{
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%x)\n", This, bRegister);
return E_NOTIMPL;
VARIANTARG arg;
DISPPARAMS dispparams = {&arg, NULL, 1, 0};
TRACE("(%p)->(%x)\n", This, bRegister);
This->theater_mode = bRegister ? VARIANT_TRUE : VARIANT_FALSE;
/* In opposition to InternetExplorer, all we should do here is
* inform the embedder about the theater mode change. */
V_VT(&arg) = VT_BOOL;
V_BOOL(&arg) = bRegister;
call_sink(This->doc_host.cps.wbe2, DISPID_ONTHEATERMODE, &dispparams);
return S_OK;
}
static HRESULT WINAPI WebBrowser_get_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
@ -984,6 +1000,7 @@ static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, voi
ret->status_bar = VARIANT_TRUE;
ret->tool_bar = VARIANT_TRUE;
ret->full_screen = VARIANT_FALSE;
ret->theater_mode = VARIANT_FALSE;
WebBrowser_OleObject_Init(ret);
WebBrowser_ViewObject_Init(ret);