2010-10-29 15:53:15 +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>
|
|
|
|
|
|
|
|
#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"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
HTMLElement element;
|
|
|
|
|
2011-01-05 00:35:12 +01:00
|
|
|
IHTMLEmbedElement IHTMLEmbedElement_iface;
|
2010-10-29 15:53:15 +02:00
|
|
|
} HTMLEmbedElement;
|
|
|
|
|
2011-01-05 00:35:12 +01:00
|
|
|
static inline HTMLEmbedElement *impl_from_IHTMLEmbedElement(IHTMLEmbedElement *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLEmbedElement, IHTMLEmbedElement_iface);
|
|
|
|
}
|
2010-10-29 15:53:15 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_QueryInterface(IHTMLEmbedElement *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
2010-10-29 15:53:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLEmbedElement_AddRef(IHTMLEmbedElement *iface)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLEmbedElement_Release(IHTMLEmbedElement *iface)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_GetTypeInfoCount(IHTMLEmbedElement *iface, UINT *pctinfo)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
|
2010-10-29 15:53:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_GetTypeInfo(IHTMLEmbedElement *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
|
2010-12-31 11:07:33 +01:00
|
|
|
ppTInfo);
|
2010-10-29 15:53:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_GetIDsOfNames(IHTMLEmbedElement *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
|
2010-12-31 11:07:33 +01:00
|
|
|
cNames, lcid, rgDispId);
|
2010-10-29 15:53:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_Invoke(IHTMLEmbedElement *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2015-05-14 13:24:19 +02:00
|
|
|
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
|
2010-12-31 11:07:33 +01:00
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2010-10-29 15:53:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_hidden(IHTMLEmbedElement *iface, BSTR v)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_hidden(IHTMLEmbedElement *iface, BSTR *p)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-04-13 11:30:10 +02:00
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_palette(IHTMLEmbedElement *iface, BSTR *p)
|
2010-10-29 15:53:15 +02:00
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_pluginspage(IHTMLEmbedElement *iface, BSTR *p)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_src(IHTMLEmbedElement *iface, BSTR v)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_src(IHTMLEmbedElement *iface, BSTR *p)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_units(IHTMLEmbedElement *iface, BSTR v)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_units(IHTMLEmbedElement *iface, BSTR *p)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_name(IHTMLEmbedElement *iface, BSTR v)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_name(IHTMLEmbedElement *iface, BSTR *p)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_width(IHTMLEmbedElement *iface, VARIANT v)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_width(IHTMLEmbedElement *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_put_height(IHTMLEmbedElement *iface, VARIANT v)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLEmbedElement_get_height(IHTMLEmbedElement *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-05 00:35:12 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_IHTMLEmbedElement(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
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,
|
2016-04-13 11:30:10 +02:00
|
|
|
HTMLEmbedElement_get_palette,
|
2010-10-29 15:53:15 +02:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2010-12-27 20:13:09 +01:00
|
|
|
static inline HTMLEmbedElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLEmbedElement, element.node);
|
|
|
|
}
|
2010-10-29 15:53:15 +02:00
|
|
|
|
|
|
|
static HRESULT HTMLEmbedElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_HTMLDOMNode(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
|
2015-04-13 13:26:32 +02:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
2010-10-29 15:53:15 +02:00
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
2011-01-05 00:35:12 +01:00
|
|
|
*ppv = &This->IHTMLEmbedElement_iface;
|
2010-10-29 15:53:15 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
2011-01-05 00:35:12 +01:00
|
|
|
*ppv = &This->IHTMLEmbedElement_iface;
|
2010-10-29 15:53:15 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLEmbedElement, riid)) {
|
2011-01-05 00:35:12 +01:00
|
|
|
*ppv = &This->IHTMLEmbedElement_iface;
|
2010-10-29 15:53:15 +02:00
|
|
|
}else {
|
|
|
|
return HTMLElement_QI(&This->element.node, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLEmbedElement_destructor(HTMLDOMNode *iface)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLEmbedElement *This = impl_from_HTMLDOMNode(iface);
|
2010-10-29 15:53:15 +02:00
|
|
|
|
|
|
|
HTMLElement_destructor(&This->element.node);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const NodeImplVtbl HTMLEmbedElementImplVtbl = {
|
|
|
|
HTMLEmbedElement_QI,
|
2010-11-14 14:41:39 +01:00
|
|
|
HTMLEmbedElement_destructor,
|
2013-03-15 15:01:53 +01:00
|
|
|
HTMLElement_cpc,
|
2011-08-25 15:23:35 +02: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-10-29 15:53:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2010-12-01 22:43:14 +01:00
|
|
|
HRESULT HTMLEmbedElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
2010-10-29 15:53:15 +02:00
|
|
|
{
|
2010-12-01 22:43:14 +01:00
|
|
|
HTMLEmbedElement *ret;
|
|
|
|
|
|
|
|
ret = heap_alloc_zero(sizeof(*ret));
|
|
|
|
if(!ret)
|
|
|
|
return E_OUTOFMEMORY;
|
2010-10-29 15:53:15 +02:00
|
|
|
|
2011-01-05 00:35:12 +01:00
|
|
|
ret->IHTMLEmbedElement_iface.lpVtbl = &HTMLEmbedElementVtbl;
|
2010-10-29 15:53:15 +02:00
|
|
|
ret->element.node.vtbl = &HTMLEmbedElementImplVtbl;
|
|
|
|
|
|
|
|
HTMLElement_Init(&ret->element, doc, nselem, &HTMLEmbedElement_dispex);
|
2010-12-01 22:43:14 +01:00
|
|
|
*elem = &ret->element;
|
|
|
|
return S_OK;
|
2010-10-29 15:53:15 +02:00
|
|
|
}
|