2010-10-27 23:18:42 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2010 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
2012-06-27 10:58:23 +02:00
|
|
|
#include <assert.h>
|
2010-10-27 23:18:42 +02:00
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "winreg.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
2010-12-09 16:28:18 +01:00
|
|
|
#include "pluginhost.h"
|
2010-10-27 23:18:42 +02:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2017-04-20 16:23:27 +02:00
|
|
|
struct HTMLObjectElement {
|
2010-12-09 16:28:18 +01:00
|
|
|
HTMLPluginContainer plugin_container;
|
2010-10-27 23:18:42 +02:00
|
|
|
|
2010-12-06 23:31:42 +01:00
|
|
|
IHTMLObjectElement IHTMLObjectElement_iface;
|
2012-03-27 13:39:21 +02:00
|
|
|
IHTMLObjectElement2 IHTMLObjectElement2_iface;
|
2010-11-12 12:30:49 +01:00
|
|
|
|
|
|
|
nsIDOMHTMLObjectElement *nsobject;
|
2017-04-20 16:23:27 +02:00
|
|
|
};
|
2010-10-27 23:18:42 +02:00
|
|
|
|
2010-12-06 23:31:42 +01:00
|
|
|
static inline HTMLObjectElement *impl_from_IHTMLObjectElement(IHTMLObjectElement *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLObjectElement, IHTMLObjectElement_iface);
|
|
|
|
}
|
2010-10-27 23:18:42 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_QueryInterface(IHTMLObjectElement *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_QueryInterface(&This->plugin_container.element.node.IHTMLDOMNode_iface,
|
|
|
|
riid, ppv);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLObjectElement_AddRef(IHTMLObjectElement *iface)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_AddRef(&This->plugin_container.element.node.IHTMLDOMNode_iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLObjectElement_Release(IHTMLObjectElement *iface)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_Release(&This->plugin_container.element.node.IHTMLDOMNode_iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_GetTypeInfoCount(IHTMLObjectElement *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->plugin_container.element.node.event_target.dispex.IDispatchEx_iface,
|
2010-12-31 11:07:33 +01:00
|
|
|
pctinfo);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_GetTypeInfo(IHTMLObjectElement *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->plugin_container.element.node.event_target.dispex.IDispatchEx_iface,
|
2010-12-31 11:07:33 +01:00
|
|
|
iTInfo, lcid, ppTInfo);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_GetIDsOfNames(IHTMLObjectElement *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->plugin_container.element.node.event_target.dispex.IDispatchEx_iface,
|
2010-12-31 11:07:33 +01:00
|
|
|
riid, rgszNames, cNames, lcid, rgDispId);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_Invoke(IHTMLObjectElement *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_Invoke(&This->plugin_container.element.node.event_target.dispex.IDispatchEx_iface,
|
2010-12-31 11:07:33 +01:00
|
|
|
dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_object(IHTMLObjectElement *iface, IDispatch **p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-12-17 03:38:21 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_plugin_disp(&This->plugin_container, p);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_classid(IHTMLObjectElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2012-03-27 13:39:35 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-07-26 11:37:48 +02:00
|
|
|
return IHTMLObjectElement2_get_classid(&This->IHTMLObjectElement2_iface, p);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_data(IHTMLObjectElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2012-03-27 13:39:35 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-07-26 11:37:48 +02:00
|
|
|
return IHTMLObjectElement2_get_data(&This->IHTMLObjectElement2_iface, p);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_recordset(IHTMLObjectElement *iface, IDispatch *v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_recordset(IHTMLObjectElement *iface, IDispatch **p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_align(IHTMLObjectElement *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_align(IHTMLObjectElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_name(IHTMLObjectElement *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2012-11-07 12:55:28 +01:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&nsstr, v);
|
|
|
|
nsres = nsIDOMHTMLObjectElement_SetName(This->nsobject, &nsstr);
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
return NS_SUCCEEDED(nsres) ? S_OK : E_FAIL;
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_name(IHTMLObjectElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2012-11-07 12:55:28 +01:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&nsstr, NULL);
|
|
|
|
nsres = nsIDOMHTMLObjectElement_GetName(This->nsobject, &nsstr);
|
|
|
|
return return_nsstr(nsres, &nsstr, p);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_codeBase(IHTMLObjectElement *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_codeBase(IHTMLObjectElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_codeType(IHTMLObjectElement *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_codeType(IHTMLObjectElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_code(IHTMLObjectElement *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_code(IHTMLObjectElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_BaseHref(IHTMLObjectElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_type(IHTMLObjectElement *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_type(IHTMLObjectElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_form(IHTMLObjectElement *iface, IHTMLFormElement **p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_width(IHTMLObjectElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2012-08-16 15:42:32 +02:00
|
|
|
nsAString width_str;
|
|
|
|
PRUnichar buf[12];
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
switch(V_VT(&v)) {
|
|
|
|
case VT_I4: {
|
2020-11-24 00:49:05 +01:00
|
|
|
swprintf(buf, ARRAY_SIZE(buf), L"%d", V_I4(&v));
|
2012-08-16 15:42:32 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
FIXME("unimplemented for arg %s\n", debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_InitDepend(&width_str, buf);
|
|
|
|
nsres = nsIDOMHTMLObjectElement_SetWidth(This->nsobject, &width_str);
|
|
|
|
nsAString_Finish(&width_str);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
FIXME("SetWidth failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
notif_container_change(&This->plugin_container, DISPID_UNKNOWN);
|
|
|
|
return S_OK;
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_width(IHTMLObjectElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2012-08-16 15:42:20 +02:00
|
|
|
nsAString width_str;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&width_str, NULL);
|
|
|
|
nsres = nsIDOMHTMLObjectElement_GetWidth(This->nsobject, &width_str);
|
|
|
|
if(NS_SUCCEEDED(nsres)) {
|
|
|
|
const PRUnichar *width;
|
|
|
|
|
|
|
|
nsAString_GetData(&width_str, &width);
|
|
|
|
V_VT(p) = VT_BSTR;
|
|
|
|
V_BSTR(p) = SysAllocString(width);
|
|
|
|
hres = V_BSTR(p) ? S_OK : E_OUTOFMEMORY;
|
|
|
|
}else {
|
|
|
|
ERR("GetWidth failed: %08x\n", nsres);
|
|
|
|
hres = E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_Finish(&width_str);
|
|
|
|
return hres;
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_height(IHTMLObjectElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2012-08-16 15:42:48 +02:00
|
|
|
nsAString height_str;
|
|
|
|
PRUnichar buf[12];
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
switch(V_VT(&v)) {
|
|
|
|
case VT_I4: {
|
2020-11-24 00:49:05 +01:00
|
|
|
swprintf(buf, ARRAY_SIZE(buf), L"%d", V_I4(&v));
|
2012-08-16 15:42:48 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
FIXME("unimplemented for arg %s\n", debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_InitDepend(&height_str, buf);
|
|
|
|
nsres = nsIDOMHTMLObjectElement_SetHeight(This->nsobject, &height_str);
|
|
|
|
nsAString_Finish(&height_str);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
FIXME("SetHeight failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
notif_container_change(&This->plugin_container, DISPID_UNKNOWN);
|
|
|
|
return S_OK;
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_height(IHTMLObjectElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2012-08-16 15:43:03 +02:00
|
|
|
nsAString height_str;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&height_str, NULL);
|
|
|
|
nsres = nsIDOMHTMLObjectElement_GetHeight(This->nsobject, &height_str);
|
|
|
|
if(NS_SUCCEEDED(nsres)) {
|
|
|
|
const PRUnichar *height;
|
|
|
|
|
|
|
|
nsAString_GetData(&height_str, &height);
|
|
|
|
V_VT(p) = VT_BSTR;
|
|
|
|
V_BSTR(p) = SysAllocString(height);
|
|
|
|
hres = V_BSTR(p) ? S_OK : E_OUTOFMEMORY;
|
|
|
|
}else {
|
|
|
|
ERR("GetHeight failed: %08x\n", nsres);
|
|
|
|
hres = E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_Finish(&height_str);
|
|
|
|
return hres;
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_readyState(IHTMLObjectElement *iface, LONG *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_onreadystatechange(IHTMLObjectElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_onreadystatechange(IHTMLObjectElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_onerror(IHTMLObjectElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_onerror(IHTMLObjectElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_altHtml(IHTMLObjectElement *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_altHtml(IHTMLObjectElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_vspace(IHTMLObjectElement *iface, LONG v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%d)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_vspace(IHTMLObjectElement *iface, LONG *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-11-12 12:30:49 +01:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2013-01-18 14:05:50 +01:00
|
|
|
nsres = nsIDOMHTMLObjectElement_GetVspace(This->nsobject, p);
|
2010-11-12 12:30:49 +01:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetVspace failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_put_hspace(IHTMLObjectElement *iface, LONG v)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%d)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement_get_hspace(IHTMLObjectElement *iface, LONG *p)
|
|
|
|
{
|
2010-12-06 23:31:42 +01:00
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLObjectElementVtbl HTMLObjectElementVtbl = {
|
|
|
|
HTMLObjectElement_QueryInterface,
|
|
|
|
HTMLObjectElement_AddRef,
|
|
|
|
HTMLObjectElement_Release,
|
|
|
|
HTMLObjectElement_GetTypeInfoCount,
|
|
|
|
HTMLObjectElement_GetTypeInfo,
|
|
|
|
HTMLObjectElement_GetIDsOfNames,
|
|
|
|
HTMLObjectElement_Invoke,
|
|
|
|
HTMLObjectElement_get_object,
|
|
|
|
HTMLObjectElement_get_classid,
|
|
|
|
HTMLObjectElement_get_data,
|
|
|
|
HTMLObjectElement_put_recordset,
|
|
|
|
HTMLObjectElement_get_recordset,
|
|
|
|
HTMLObjectElement_put_align,
|
|
|
|
HTMLObjectElement_get_align,
|
|
|
|
HTMLObjectElement_put_name,
|
|
|
|
HTMLObjectElement_get_name,
|
|
|
|
HTMLObjectElement_put_codeBase,
|
|
|
|
HTMLObjectElement_get_codeBase,
|
|
|
|
HTMLObjectElement_put_codeType,
|
|
|
|
HTMLObjectElement_get_codeType,
|
|
|
|
HTMLObjectElement_put_code,
|
|
|
|
HTMLObjectElement_get_code,
|
|
|
|
HTMLObjectElement_get_BaseHref,
|
|
|
|
HTMLObjectElement_put_type,
|
|
|
|
HTMLObjectElement_get_type,
|
|
|
|
HTMLObjectElement_get_form,
|
|
|
|
HTMLObjectElement_put_width,
|
|
|
|
HTMLObjectElement_get_width,
|
|
|
|
HTMLObjectElement_put_height,
|
|
|
|
HTMLObjectElement_get_height,
|
|
|
|
HTMLObjectElement_get_readyState,
|
|
|
|
HTMLObjectElement_put_onreadystatechange,
|
|
|
|
HTMLObjectElement_get_onreadystatechange,
|
|
|
|
HTMLObjectElement_put_onerror,
|
|
|
|
HTMLObjectElement_get_onerror,
|
|
|
|
HTMLObjectElement_put_altHtml,
|
|
|
|
HTMLObjectElement_get_altHtml,
|
|
|
|
HTMLObjectElement_put_vspace,
|
|
|
|
HTMLObjectElement_get_vspace,
|
|
|
|
HTMLObjectElement_put_hspace,
|
|
|
|
HTMLObjectElement_get_hspace
|
|
|
|
};
|
|
|
|
|
2012-03-27 13:39:21 +02:00
|
|
|
static inline HTMLObjectElement *impl_from_IHTMLObjectElement2(IHTMLObjectElement2 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLObjectElement, IHTMLObjectElement2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement2_QueryInterface(IHTMLObjectElement2 *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_QueryInterface(&This->plugin_container.element.node.IHTMLDOMNode_iface,
|
|
|
|
riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLObjectElement2_AddRef(IHTMLObjectElement2 *iface)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_AddRef(&This->plugin_container.element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLObjectElement2_Release(IHTMLObjectElement2 *iface)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_Release(&This->plugin_container.element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement2_GetTypeInfoCount(IHTMLObjectElement2 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->plugin_container.element.node.event_target.dispex.IDispatchEx_iface,
|
2012-03-27 13:39:21 +02:00
|
|
|
pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement2_GetTypeInfo(IHTMLObjectElement2 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->plugin_container.element.node.event_target.dispex.IDispatchEx_iface,
|
2012-03-27 13:39:21 +02:00
|
|
|
iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement2_GetIDsOfNames(IHTMLObjectElement2 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->plugin_container.element.node.event_target.dispex.IDispatchEx_iface,
|
2012-03-27 13:39:21 +02:00
|
|
|
riid, rgszNames, cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement2_Invoke(IHTMLObjectElement2 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_Invoke(&This->plugin_container.element.node.event_target.dispex.IDispatchEx_iface,
|
2012-03-27 13:39:21 +02:00
|
|
|
dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement2_namedRecordset(IHTMLObjectElement2 *iface, BSTR dataMember,
|
|
|
|
VARIANT *hierarchy, IDispatch **ppRecordset)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
|
|
|
FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(dataMember), hierarchy, ppRecordset);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement2_put_classid(IHTMLObjectElement2 *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
2014-12-11 16:26:18 +01:00
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
FIXME("(%p)->(%s) semi-stub\n", This, debugstr_w(v));
|
|
|
|
|
2020-11-24 00:49:05 +01:00
|
|
|
hres = elem_string_attr_setter(&This->plugin_container.element, L"classid", v);
|
2014-12-11 16:26:18 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
if(This->plugin_container.plugin_host) {
|
2015-03-18 08:44:56 +01:00
|
|
|
FIXME("Host already associated.\n");
|
2014-12-11 16:26:18 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NOTE:
|
|
|
|
* If the element is not yet in DOM tree, we should embed it as soon as it's added.
|
|
|
|
* However, Gecko for some reason decides not to create NP plugin in this case,
|
|
|
|
* so this won't work.
|
|
|
|
*/
|
|
|
|
|
|
|
|
return create_plugin_host(This->plugin_container.element.node.doc, &This->plugin_container);
|
2012-03-27 13:39:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement2_get_classid(IHTMLObjectElement2 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement2_put_data(IHTMLObjectElement2 *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLObjectElement2_get_data(IHTMLObjectElement2 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLObjectElement2Vtbl HTMLObjectElement2Vtbl = {
|
|
|
|
HTMLObjectElement2_QueryInterface,
|
|
|
|
HTMLObjectElement2_AddRef,
|
|
|
|
HTMLObjectElement2_Release,
|
|
|
|
HTMLObjectElement2_GetTypeInfoCount,
|
|
|
|
HTMLObjectElement2_GetTypeInfo,
|
|
|
|
HTMLObjectElement2_GetIDsOfNames,
|
|
|
|
HTMLObjectElement2_Invoke,
|
|
|
|
HTMLObjectElement2_namedRecordset,
|
|
|
|
HTMLObjectElement2_put_classid,
|
|
|
|
HTMLObjectElement2_get_classid,
|
|
|
|
HTMLObjectElement2_put_data,
|
|
|
|
HTMLObjectElement2_get_data
|
|
|
|
};
|
|
|
|
|
2010-12-27 20:13:09 +01:00
|
|
|
static inline HTMLObjectElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLObjectElement, plugin_container.element.node);
|
|
|
|
}
|
2010-10-27 23:18:42 +02:00
|
|
|
|
|
|
|
static HRESULT HTMLObjectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
|
2015-04-13 13:26:32 +02:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
2010-10-27 23:18:42 +02:00
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
2010-12-06 23:31:42 +01:00
|
|
|
*ppv = &This->IHTMLObjectElement_iface;
|
2010-10-27 23:18:42 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
2010-12-06 23:31:42 +01:00
|
|
|
*ppv = &This->IHTMLObjectElement_iface;
|
2010-10-27 23:18:42 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLObjectElement, riid)) {
|
2010-12-06 23:31:42 +01:00
|
|
|
*ppv = &This->IHTMLObjectElement_iface;
|
2012-03-27 13:39:21 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLObjectElement2, riid)) {
|
|
|
|
*ppv = &This->IHTMLObjectElement2_iface;
|
2010-12-09 16:28:18 +01:00
|
|
|
}else if(IsEqualGUID(&IID_HTMLPluginContainer, riid)) {
|
2015-04-13 13:26:26 +02:00
|
|
|
/* Special pseudo-interface returning HTMLPluginContainse struct. */
|
2010-12-09 16:28:18 +01:00
|
|
|
*ppv = &This->plugin_container;
|
2015-04-13 13:26:26 +02:00
|
|
|
node_addref(&This->plugin_container.element.node);
|
2010-12-09 16:28:18 +01:00
|
|
|
return S_OK;
|
2010-10-27 23:18:42 +02:00
|
|
|
}else {
|
2011-12-05 17:29:43 +01:00
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = HTMLElement_QI(&This->plugin_container.element.node, riid, ppv);
|
|
|
|
if(hres == E_NOINTERFACE && This->plugin_container.plugin_host && This->plugin_container.plugin_host->plugin_unk) {
|
|
|
|
IUnknown *plugin_iface, *ret;
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(This->plugin_container.plugin_host->plugin_unk, riid, (void**)&plugin_iface);
|
|
|
|
if(hres == S_OK) {
|
|
|
|
hres = wrap_iface(plugin_iface, (IUnknown*)&This->IHTMLObjectElement_iface, &ret);
|
|
|
|
IUnknown_Release(plugin_iface);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
TRACE("returning plugin iface %p wrapped to %p\n", plugin_iface, ret);
|
|
|
|
*ppv = ret;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return hres;
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLObjectElement_destructor(HTMLDOMNode *iface)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
|
2010-10-27 23:18:42 +02:00
|
|
|
|
2010-12-09 16:28:34 +01:00
|
|
|
if(This->plugin_container.plugin_host)
|
2010-12-13 16:00:37 +01:00
|
|
|
detach_plugin_host(This->plugin_container.plugin_host);
|
2010-11-12 12:30:49 +01:00
|
|
|
|
2010-12-09 16:28:18 +01:00
|
|
|
HTMLElement_destructor(&This->plugin_container.element.node);
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
|
|
|
|
2010-11-14 14:42:00 +01:00
|
|
|
static HRESULT HTMLObjectElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
|
2010-11-14 14:42:00 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2010-12-17 03:38:33 +01:00
|
|
|
static HRESULT HTMLObjectElement_get_dispid(HTMLDOMNode *iface, BSTR name,
|
|
|
|
DWORD grfdex, DISPID *pid)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
|
2010-12-17 03:38:33 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(name), grfdex, pid);
|
|
|
|
|
|
|
|
return get_plugin_dispid(&This->plugin_container, name, pid);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT HTMLObjectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
|
|
|
|
WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
|
2010-12-17 03:38:33 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%d)\n", This, id);
|
|
|
|
|
|
|
|
return invoke_plugin_prop(&This->plugin_container, id, lcid, flags, params, res, ei);
|
|
|
|
}
|
|
|
|
|
2014-09-25 12:11:59 +02:00
|
|
|
static void HTMLObjectElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->nsobject)
|
|
|
|
note_cc_edge((nsISupports*)This->nsobject, "This->nsobject", cb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLObjectElement_unlink(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->nsobject) {
|
|
|
|
nsIDOMHTMLObjectElement *nsobject = This->nsobject;
|
|
|
|
|
|
|
|
This->nsobject = NULL;
|
|
|
|
nsIDOMHTMLObjectElement_Release(nsobject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-27 23:18:42 +02:00
|
|
|
static const NodeImplVtbl HTMLObjectElementImplVtbl = {
|
2017-04-21 13:50:49 +02:00
|
|
|
&CLSID_HTMLObjectElement,
|
2010-10-27 23:18:42 +02:00
|
|
|
HTMLObjectElement_QI,
|
2010-11-14 14:41:39 +01:00
|
|
|
HTMLObjectElement_destructor,
|
2013-03-15 15:01:53 +01:00
|
|
|
HTMLElement_cpc,
|
2010-11-14 14:42:00 +01:00
|
|
|
HTMLElement_clone,
|
2012-09-04 13:58:58 +02:00
|
|
|
HTMLElement_handle_event,
|
2011-08-25 15:23:35 +02:00
|
|
|
HTMLElement_get_attr_col,
|
2010-11-14 14:42:00 +01:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2010-12-17 03:38:33 +01:00
|
|
|
HTMLObjectElement_get_readystate,
|
|
|
|
HTMLObjectElement_get_dispid,
|
2014-09-25 12:11:59 +02:00
|
|
|
HTMLObjectElement_invoke,
|
|
|
|
NULL,
|
|
|
|
HTMLObjectElement_traverse,
|
|
|
|
HTMLObjectElement_unlink
|
2010-10-27 23:18:42 +02:00
|
|
|
};
|
|
|
|
|
2010-10-27 23:19:30 +02:00
|
|
|
static const tid_t HTMLObjectElement_iface_tids[] = {
|
2012-03-27 13:39:21 +02:00
|
|
|
IHTMLObjectElement2_tid,
|
2014-12-14 17:54:00 +01:00
|
|
|
IHTMLObjectElement_tid,
|
|
|
|
HTMLELEMENT_TIDS,
|
2010-10-27 23:19:30 +02:00
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLObjectElement_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLObjectElement_tid,
|
2016-07-07 12:50:18 +02:00
|
|
|
HTMLObjectElement_iface_tids,
|
|
|
|
HTMLElement_init_dispex_info
|
2010-10-27 23:19:30 +02:00
|
|
|
};
|
|
|
|
|
2018-02-12 01:29:41 +01:00
|
|
|
HRESULT HTMLObjectElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
|
2010-10-27 23:18:42 +02:00
|
|
|
{
|
2010-12-01 22:43:14 +01:00
|
|
|
HTMLObjectElement *ret;
|
2010-11-12 12:30:49 +01:00
|
|
|
nsresult nsres;
|
2010-10-27 23:18:42 +02:00
|
|
|
|
2010-12-01 22:43:14 +01:00
|
|
|
ret = heap_alloc_zero(sizeof(*ret));
|
|
|
|
if(!ret)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2010-12-06 23:31:42 +01:00
|
|
|
ret->IHTMLObjectElement_iface.lpVtbl = &HTMLObjectElementVtbl;
|
2012-03-27 13:39:21 +02:00
|
|
|
ret->IHTMLObjectElement2_iface.lpVtbl = &HTMLObjectElement2Vtbl;
|
2010-12-09 16:28:18 +01:00
|
|
|
ret->plugin_container.element.node.vtbl = &HTMLObjectElementImplVtbl;
|
2010-10-27 23:18:42 +02:00
|
|
|
|
2012-06-27 10:58:23 +02:00
|
|
|
HTMLElement_Init(&ret->plugin_container.element, doc, nselem, &HTMLObjectElement_dispex);
|
|
|
|
|
2018-02-12 01:29:41 +01:00
|
|
|
nsres = nsIDOMElement_QueryInterface(nselem, &IID_nsIDOMHTMLObjectElement, (void**)&ret->nsobject);
|
2014-09-25 12:11:59 +02:00
|
|
|
assert(nsres == NS_OK);
|
2010-11-12 12:30:49 +01:00
|
|
|
|
2010-12-09 16:28:18 +01:00
|
|
|
*elem = &ret->plugin_container.element;
|
2010-12-01 22:43:14 +01:00
|
|
|
return S_OK;
|
2010-10-27 23:18:42 +02:00
|
|
|
}
|
2018-02-27 14:57:53 +01:00
|
|
|
|
|
|
|
struct HTMLEmbed {
|
|
|
|
HTMLElement element;
|
|
|
|
|
|
|
|
IHTMLEmbedElement IHTMLEmbedElement_iface;
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline HTMLEmbed *impl_from_IHTMLEmbedElement(IHTMLEmbedElement *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLEmbed, IHTMLEmbedElement_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_QueryInterface(IHTMLEmbedElement *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLEmbedElement_AddRef(IHTMLEmbedElement *iface)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLEmbedElement_Release(IHTMLEmbedElement *iface)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_GetTypeInfoCount(IHTMLEmbedElement *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_GetTypeInfo(IHTMLEmbedElement *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
|
|
|
|
ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_GetIDsOfNames(IHTMLEmbedElement *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
|
|
|
|
cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_Invoke(IHTMLEmbedElement *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_hidden(IHTMLEmbedElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_hidden(IHTMLEmbedElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_palette(IHTMLEmbedElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_pluginspage(IHTMLEmbedElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_src(IHTMLEmbedElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_src(IHTMLEmbedElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_units(IHTMLEmbedElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_units(IHTMLEmbedElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_name(IHTMLEmbedElement *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_name(IHTMLEmbedElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_width(IHTMLEmbedElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_width(IHTMLEmbedElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_height(IHTMLEmbedElement *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_height(IHTMLEmbedElement *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = impl_from_IHTMLEmbedElement(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLEmbedElementVtbl HTMLEmbedElementVtbl = {
|
|
|
|
HTMLEmbedElement_QueryInterface,
|
|
|
|
HTMLEmbedElement_AddRef,
|
|
|
|
HTMLEmbedElement_Release,
|
|
|
|
HTMLEmbedElement_GetTypeInfoCount,
|
|
|
|
HTMLEmbedElement_GetTypeInfo,
|
|
|
|
HTMLEmbedElement_GetIDsOfNames,
|
|
|
|
HTMLEmbedElement_Invoke,
|
|
|
|
HTMLEmbedElement_put_hidden,
|
|
|
|
HTMLEmbedElement_get_hidden,
|
|
|
|
HTMLEmbedElement_get_palette,
|
|
|
|
HTMLEmbedElement_get_pluginspage,
|
|
|
|
HTMLEmbedElement_put_src,
|
|
|
|
HTMLEmbedElement_get_src,
|
|
|
|
HTMLEmbedElement_put_units,
|
|
|
|
HTMLEmbedElement_get_units,
|
|
|
|
HTMLEmbedElement_put_name,
|
|
|
|
HTMLEmbedElement_get_name,
|
|
|
|
HTMLEmbedElement_put_width,
|
|
|
|
HTMLEmbedElement_get_width,
|
|
|
|
HTMLEmbedElement_put_height,
|
|
|
|
HTMLEmbedElement_get_height
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline HTMLEmbed *embed_from_HTMLDOMNode(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLEmbed, element.node);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT HTMLEmbedElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = embed_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
*ppv = &This->IHTMLEmbedElement_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
|
|
|
*ppv = &This->IHTMLEmbedElement_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IHTMLEmbedElement, riid)) {
|
|
|
|
*ppv = &This->IHTMLEmbedElement_iface;
|
|
|
|
}else {
|
|
|
|
return HTMLElement_QI(&This->element.node, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLEmbedElement_destructor(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
HTMLEmbed *This = embed_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
HTMLElement_destructor(&This->element.node);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const NodeImplVtbl HTMLEmbedElementImplVtbl = {
|
|
|
|
&CLSID_HTMLEmbed,
|
|
|
|
HTMLEmbedElement_QI,
|
|
|
|
HTMLEmbedElement_destructor,
|
|
|
|
HTMLElement_cpc,
|
|
|
|
HTMLElement_clone,
|
|
|
|
HTMLElement_handle_event,
|
|
|
|
HTMLElement_get_attr_col
|
|
|
|
};
|
|
|
|
|
|
|
|
static const tid_t HTMLEmbedElement_iface_tids[] = {
|
|
|
|
HTMLELEMENT_TIDS,
|
|
|
|
IHTMLEmbedElement_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLEmbedElement_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLEmbed_tid,
|
|
|
|
HTMLEmbedElement_iface_tids,
|
|
|
|
HTMLElement_init_dispex_info
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT HTMLEmbedElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
|
|
|
|
{
|
|
|
|
HTMLEmbed *ret;
|
|
|
|
|
|
|
|
ret = heap_alloc_zero(sizeof(*ret));
|
|
|
|
if(!ret)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
ret->IHTMLEmbedElement_iface.lpVtbl = &HTMLEmbedElementVtbl;
|
|
|
|
ret->element.node.vtbl = &HTMLEmbedElementImplVtbl;
|
|
|
|
|
|
|
|
HTMLElement_Init(&ret->element, doc, nselem, &HTMLEmbedElement_dispex);
|
|
|
|
*elem = &ret->element;
|
|
|
|
return S_OK;
|
|
|
|
}
|