mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 22:50:43 +00:00
mshtml: Added QuickActivation support.
This commit is contained in:
parent
c706bba6a8
commit
410501e6c9
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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*);
|
||||
|
Loading…
Reference in New Issue
Block a user