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);
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
HTMLElement element;
|
|
|
|
const IHTMLCommentElementVtbl *lpIHTMLCommentElementVtbl;
|
|
|
|
} HTMLCommentElement;
|
|
|
|
|
|
|
|
#define HTMLCOMMENT(x) ((IHTMLCommentElement*) &(x)->lpIHTMLCommentElementVtbl)
|
|
|
|
|
|
|
|
#define HTMLCOMMENT_THIS(iface) DEFINE_THIS(HTMLCommentElement, IHTMLCommentElement, iface)
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_QueryInterface(IHTMLCommentElement *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLCommentElement_AddRef(IHTMLCommentElement *iface)
|
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLCommentElement_Release(IHTMLCommentElement *iface)
|
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_GetTypeInfoCount(IHTMLCommentElement *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
2008-11-23 10:53:49 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
|
2008-04-30 18:19:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_GetTypeInfo(IHTMLCommentElement *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
2008-11-23 10:53:49 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), 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)
|
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
2008-11-23 10:53:49 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), 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)
|
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
2008-11-23 10:53:49 +01:00
|
|
|
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), 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)
|
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_get_text(IHTMLCommentElement *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_put_atomic(IHTMLCommentElement *iface, long v)
|
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
|
|
|
FIXME("(%p)->(%ld)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLCommentElement_get_atomic(IHTMLCommentElement *iface, long *p)
|
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef HTMLCOMMENT_THIS
|
|
|
|
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
|
|
|
#define HTMLCOMMENT_NODE_THIS(iface) DEFINE_THIS2(HTMLCommentElement, element.node, iface)
|
|
|
|
|
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
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_NODE_THIS(iface);
|
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IHTMLCommentElement, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLCommentElement %p)\n", This, ppv);
|
|
|
|
*ppv = HTMLCOMMENT(This);
|
|
|
|
}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
|
|
|
{
|
|
|
|
HTMLCommentElement *This = HTMLCOMMENT_NODE_THIS(iface);
|
|
|
|
|
|
|
|
HTMLElement_destructor(&This->element.node);
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef HTMLCOMMENT_NODE_THIS
|
|
|
|
|
|
|
|
static const NodeImplVtbl HTMLCommentElementImplVtbl = {
|
|
|
|
HTMLCommentElement_QI,
|
|
|
|
HTMLCommentElement_destructor
|
|
|
|
};
|
|
|
|
|
2008-05-06 16:04:58 +02:00
|
|
|
static const tid_t HTMLCommentElement_iface_tids[] = {
|
2008-06-18 00:11:03 +02:00
|
|
|
IHTMLDOMNode_tid,
|
|
|
|
IHTMLDOMNode2_tid,
|
|
|
|
IHTMLElement_tid,
|
|
|
|
IHTMLElement2_tid,
|
2008-10-09 22:30:06 +02:00
|
|
|
IHTMLElement3_tid,
|
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
|
|
|
};
|
|
|
|
|
2008-06-19 23:13:16 +02:00
|
|
|
HTMLElement *HTMLCommentElement_Create(HTMLDocument *doc, nsIDOMNode *nsnode)
|
2008-04-30 18:19:49 +02:00
|
|
|
{
|
|
|
|
HTMLCommentElement *ret = heap_alloc_zero(sizeof(*ret));
|
|
|
|
|
|
|
|
ret->element.node.vtbl = &HTMLCommentElementImplVtbl;
|
|
|
|
ret->lpIHTMLCommentElementVtbl = &HTMLCommentElementVtbl;
|
|
|
|
|
2008-04-30 18:20:48 +02:00
|
|
|
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLCOMMENT(ret), &HTMLCommentElement_dispex);
|
2008-04-30 18:19:49 +02:00
|
|
|
HTMLElement_Init(&ret->element);
|
2008-06-19 23:13:16 +02:00
|
|
|
HTMLDOMNode_Init(doc, &ret->element.node, nsnode);
|
2008-04-30 18:19:49 +02:00
|
|
|
|
|
|
|
return &ret->element;
|
|
|
|
}
|