mshtml: Added QuickActivation support.

This commit is contained in:
Jacek Caban 2010-12-06 18:49:00 +01:00 committed by Alexandre Julliard
parent c706bba6a8
commit 410501e6c9
3 changed files with 63 additions and 2 deletions

View File

@ -303,8 +303,16 @@ static NPError CDECL NPP_Destroy(NPP instance, NPSavedData **save)
static NPError CDECL NPP_SetWindow(NPP instance, NPWindow *window)
{
FIXME("(%p %p)\n", instance, window);
return NPERR_GENERIC_ERROR;
PluginHost *host = instance->pdata;
RECT pos_rect = {0, 0, window->width, window->height};
TRACE("(%p %p)\n", instance, window);
if(!host)
return NPERR_GENERIC_ERROR;
update_plugin_window(host, window->window, &pos_rect);
return NPERR_NO_ERROR;
}
static NPError CDECL NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, UINT16 *stype)

View File

@ -36,6 +36,57 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static void activate_plugin(PluginHost *host)
{
IClientSecurity *client_security;
IQuickActivate *quick_activate;
HRESULT hres;
if(!host->plugin_unk)
return;
/* Note native calls QI on plugin for an undocumented IID and CLSID_HTMLDocument */
/* FIXME: call FreezeEvents(TRUE) */
hres = IUnknown_QueryInterface(host->plugin_unk, &IID_IClientSecurity, (void**)&client_security);
if(SUCCEEDED(hres)) {
FIXME("Handle IClientSecurity\n");
IClientSecurity_Release(client_security);
return;
}
hres = IUnknown_QueryInterface(host->plugin_unk, &IID_IQuickActivate, (void**)&quick_activate);
if(SUCCEEDED(hres)) {
QACONTAINER container = {sizeof(container)};
QACONTROL control = {sizeof(control)};
container.pClientSite = &host->IOleClientSite_iface;
container.dwAmbientFlags = QACONTAINER_SUPPORTSMNEMONICS|QACONTAINER_MESSAGEREFLECT|QACONTAINER_USERMODE;
container.pAdviseSink = NULL; /* FIXME */
container.pPropertyNotifySink = NULL; /* FIXME */
hres = IQuickActivate_QuickActivate(quick_activate, &container, &control);
if(FAILED(hres))
FIXME("QuickActivate failed: %08x\n", hres);
}else {
FIXME("No IQuickActivate\n");
}
}
void update_plugin_window(PluginHost *host, HWND hwnd, const RECT *rect)
{
if(!hwnd || (host->hwnd && host->hwnd != hwnd)) {
FIXME("unhandled hwnd\n");
return;
}
if(!host->hwnd) {
host->hwnd = hwnd;
activate_plugin(host);
}
}
static inline PluginHost *impl_from_IOleClientSite(IOleClientSite *iface)
{
return CONTAINING_RECORD(iface, PluginHost, IOleClientSite_iface);

View File

@ -24,6 +24,8 @@ typedef struct {
LONG ref;
IUnknown *plugin_unk;
HWND hwnd;
} PluginHost;
HRESULT create_plugin_host(IUnknown*,PluginHost**);
void update_plugin_window(PluginHost*,HWND,const RECT*);