2008-04-30 18:19:49 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2008 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 "ole2.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2009-01-28 06:59:34 +01:00
|
|
|
struct HTMLCommentElement {
|
2008-04-30 18:19:49 +02:00
|
|
|
HTMLElement element;
|
2011-01-04 01:48:22 +01:00
|
|
|
IHTMLCommentElement IHTMLCommentElement_iface;
|
2009-01-28 06:59:34 +01:00
|
|
|
};
|
2008-04-30 18:19:49 +02:00
|
|
|
|
2011-01-04 01:48:22 +01:00
|
|
|
static inline HTMLCommentElement *impl_from_IHTMLCommentElement(IHTMLCommentElement *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLCommentElement, IHTMLCommentElement_iface);
|
|
|
|
}
|
2008-04-30 18:19:49 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_QueryInterface(IHTMLCommentElement *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2011-01-04 01:48:22 +01:00
|
|
|
HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
|
2008-04-30 18:19:49 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
2008-04-30 18:19:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLCommentElement_AddRef(IHTMLCommentElement *iface)
|
|
|
|
{
|
2011-01-04 01:48:22 +01:00
|
|
|
HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
|
2008-04-30 18:19:49 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
2008-04-30 18:19:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLCommentElement_Release(IHTMLCommentElement *iface)
|
|
|
|
{
|
2011-01-04 01:48:22 +01:00
|
|
|
HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
|
2008-04-30 18:19:49 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
2008-04-30 18:19:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_GetTypeInfoCount(IHTMLCommentElement *iface, UINT *pctinfo)
|
|
|
|
{
|
2011-01-04 01:48:22 +01:00
|
|
|
HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
|
2008-04-30 18:19:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_GetTypeInfo(IHTMLCommentElement *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2011-01-04 01:48:22 +01:00
|
|
|
HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
|
|
|
|
ppTInfo);
|
2008-04-30 18:19:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2011-01-04 01:48:22 +01:00
|
|
|
HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
|
|
|
|
cNames, lcid, rgDispId);
|
2008-04-30 18:19:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_Invoke(IHTMLCommentElement *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2011-01-04 01:48:22 +01:00
|
|
|
HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2008-04-30 18:19:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_put_text(IHTMLCommentElement *iface, BSTR v)
|
|
|
|
{
|
2011-01-04 01:48:22 +01:00
|
|
|
HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
|
2008-04-30 18:19:49 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_get_text(IHTMLCommentElement *iface, BSTR *p)
|
|
|
|
{
|
2011-01-04 01:48:22 +01:00
|
|
|
HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
|
2010-02-09 19:35:20 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2010-12-30 01:24:59 +01:00
|
|
|
return IHTMLElement_get_outerHTML(&This->element.IHTMLElement_iface, p);
|
2008-04-30 18:19:49 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLCommentElement_put_atomic(IHTMLCommentElement *iface, LONG v)
|
2008-04-30 18:19:49 +02:00
|
|
|
{
|
2011-01-04 01:48:22 +01:00
|
|
|
HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
|
2009-03-12 01:43:31 +01:00
|
|
|
FIXME("(%p)->(%d)\n", This, v);
|
2008-04-30 18:19:49 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLCommentElement_get_atomic(IHTMLCommentElement *iface, LONG *p)
|
2008-04-30 18:19:49 +02:00
|
|
|
{
|
2011-01-04 01:48:22 +01:00
|
|
|
HTMLCommentElement *This = impl_from_IHTMLCommentElement(iface);
|
2008-04-30 18:19:49 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLCommentElementVtbl HTMLCommentElementVtbl = {
|
|
|
|
HTMLCommentElement_QueryInterface,
|
|
|
|
HTMLCommentElement_AddRef,
|
|
|
|
HTMLCommentElement_Release,
|
|
|
|
HTMLCommentElement_GetTypeInfoCount,
|
|
|
|
HTMLCommentElement_GetTypeInfo,
|
|
|
|
HTMLCommentElement_GetIDsOfNames,
|
|
|
|
HTMLCommentElement_Invoke,
|
|
|
|
HTMLCommentElement_put_text,
|
|
|
|
HTMLCommentElement_get_text,
|
|
|
|
HTMLCommentElement_put_atomic,
|
|
|
|
HTMLCommentElement_get_atomic
|
|
|
|
};
|
|
|
|
|
2010-12-27 20:13:09 +01:00
|
|
|
static inline HTMLCommentElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLCommentElement, element.node);
|
|
|
|
}
|
2008-04-30 18:19:49 +02:00
|
|
|
|
2008-12-02 15:28:04 +01:00
|
|
|
static HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
2008-04-30 18:19:49 +02:00
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLCommentElement *This = impl_from_HTMLDOMNode(iface);
|
2008-04-30 18:19:49 +02:00
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IHTMLCommentElement, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLCommentElement %p)\n", This, ppv);
|
2011-01-04 01:48:22 +01:00
|
|
|
*ppv = &This->IHTMLCommentElement_iface;
|
2008-04-30 18:19:49 +02:00
|
|
|
}else {
|
|
|
|
return HTMLElement_QI(&This->element.node, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2008-12-02 15:28:04 +01:00
|
|
|
static void HTMLCommentElement_destructor(HTMLDOMNode *iface)
|
2008-04-30 18:19:49 +02:00
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLCommentElement *This = impl_from_HTMLDOMNode(iface);
|
2008-04-30 18:19:49 +02:00
|
|
|
|
|
|
|
HTMLElement_destructor(&This->element.node);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const NodeImplVtbl HTMLCommentElementImplVtbl = {
|
|
|
|
HTMLCommentElement_QI,
|
2010-11-14 14:41:39 +01:00
|
|
|
HTMLCommentElement_destructor,
|
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
|
2008-04-30 18:19:49 +02:00
|
|
|
};
|
|
|
|
|
2008-05-06 16:04:58 +02:00
|
|
|
static const tid_t HTMLCommentElement_iface_tids[] = {
|
2010-01-28 02:09:02 +01:00
|
|
|
HTMLELEMENT_TIDS,
|
2008-05-06 16:04:58 +02:00
|
|
|
IHTMLCommentElement_tid,
|
|
|
|
0
|
|
|
|
};
|
2008-04-30 18:20:48 +02:00
|
|
|
static dispex_static_data_t HTMLCommentElement_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLCommentElement_tid,
|
|
|
|
NULL,
|
2008-05-06 16:04:58 +02:00
|
|
|
HTMLCommentElement_iface_tids
|
2008-04-30 18:20:48 +02:00
|
|
|
};
|
|
|
|
|
2010-12-01 22:42:03 +01:00
|
|
|
HRESULT HTMLCommentElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLElement **elem)
|
2008-04-30 18:19:49 +02:00
|
|
|
{
|
2010-12-01 22:42:03 +01:00
|
|
|
HTMLCommentElement *ret;
|
|
|
|
|
|
|
|
ret = heap_alloc_zero(sizeof(*ret));
|
|
|
|
if(!ret)
|
|
|
|
return E_OUTOFMEMORY;
|
2008-04-30 18:19:49 +02:00
|
|
|
|
|
|
|
ret->element.node.vtbl = &HTMLCommentElementImplVtbl;
|
2011-01-04 01:48:22 +01:00
|
|
|
ret->IHTMLCommentElement_iface.lpVtbl = &HTMLCommentElementVtbl;
|
2008-04-30 18:19:49 +02:00
|
|
|
|
2009-11-01 19:16:48 +01:00
|
|
|
HTMLElement_Init(&ret->element, doc, NULL, &HTMLCommentElement_dispex);
|
2012-06-26 12:34:21 +02:00
|
|
|
HTMLDOMNode_Init(doc, &ret->element.node, nsnode);
|
2008-04-30 18:19:49 +02:00
|
|
|
|
2010-12-01 22:42:03 +01:00
|
|
|
*elem = &ret->element;
|
|
|
|
return S_OK;
|
2008-04-30 18:19:49 +02:00
|
|
|
}
|