static HRESULT WINAPI HTMLImgElement_get_src(IHTMLImgElement *iface, BSTR *p) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); const PRUnichar *src; nsAString src_str; nsresult nsres; HRESULT hres = S_OK; static const WCHAR blockedW[] = {'B','L','O','C','K','E','D',':',':',0}; TRACE("(%p)->(%p)\n", This, p); nsAString_Init(&src_str, NULL); nsres = nsIDOMHTMLImageElement_GetSrc(This->nsimg, &src_str); if(NS_SUCCEEDED(nsres)) { nsAString_GetData(&src_str, &src); if(!strncmpiW(src, blockedW, sizeof(blockedW)/sizeof(WCHAR)-1)) { TRACE("returning BLOCKED::\n"); *p = SysAllocString(blockedW); if(!*p) hres = E_OUTOFMEMORY; }else { hres = nsuri_to_url(src, TRUE, p); } }else { ERR("GetSrc failed: %08x\n", nsres); hres = E_FAIL; } nsAString_Finish(&src_str); return hres; }
static HRESULT WINAPI HTMLImgElement_GetTypeInfo(IHTMLImgElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI HTMLImgElement_put_onerror(IHTMLImgElement *iface, VARIANT v) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); TRACE("(%p)->()\n", This); return set_node_event(&This->element.node, EVENTID_ERROR, &v); }
static HRESULT WINAPI HTMLImgElement_Invoke(IHTMLImgElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
static HRESULT WINAPI HTMLImgElement_get_onabort(IHTMLImgElement *iface, VARIANT *p) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); TRACE("(%p)->(%p)\n", This, p); return get_node_event(&This->element.node, EVENTID_ABORT, p); }
static HRESULT WINAPI HTMLImgElement_GetIDsOfNames(IHTMLImgElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
static HRESULT WINAPI HTMLImgElement_put_onload(IHTMLImgElement *iface, VARIANT v) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); return set_node_event(&This->element.node, EVENTID_LOAD, &v); }
static HRESULT WINAPI HTMLImgElement_get_alt(IHTMLImgElement *iface, BSTR *p) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); nsAString alt_str; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); nsAString_Init(&alt_str, NULL); nsres = nsIDOMHTMLImageElement_GetAlt(This->nsimg, &alt_str); return return_nsstr(nsres, &alt_str, p); }
static HRESULT WINAPI HTMLImgElement_get_name(IHTMLImgElement *iface, BSTR *p) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); nsAString name; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); nsAString_Init(&name, NULL); nsres = nsIDOMHTMLImageElement_GetName(This->nsimg, &name); return return_nsstr(nsres, &name, p); }
static HRESULT WINAPI HTMLImgElement_put_height(IHTMLImgElement *iface, LONG v) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); nsresult nsres; TRACE("(%p)->(%d)\n", This, v); nsres = nsIDOMHTMLImageElement_SetHeight(This->nsimg, v); if(NS_FAILED(nsres)) { ERR("SetHeight failed: %08x\n", nsres); return E_FAIL; } return S_OK; }
static HRESULT WINAPI HTMLImgElement_put_isMap(IHTMLImgElement *iface, VARIANT_BOOL v) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); nsresult nsres; TRACE("(%p)->(%x)\n", This, v); nsres = nsIDOMHTMLImageElement_SetIsMap(This->nsimg, v != VARIANT_FALSE); if (NS_FAILED(nsres)) { ERR("Set IsMap failed: %08x\n", nsres); return E_FAIL; } return S_OK; }
static HRESULT WINAPI HTMLImgElement_put_src(IHTMLImgElement *iface, BSTR v) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); nsAString src_str; nsresult nsres; TRACE("(%p)->(%s)\n", This, debugstr_w(v)); nsAString_InitDepend(&src_str, v); nsres = nsIDOMHTMLImageElement_SetSrc(This->nsimg, &src_str); nsAString_Finish(&src_str); if(NS_FAILED(nsres)) ERR("SetSrc failed: %08x\n", nsres); return NS_OK; }
static HRESULT WINAPI HTMLImgElement_get_width(IHTMLImgElement *iface, LONG *p) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); PRUint32 width; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); nsres = nsIDOMHTMLImageElement_GetWidth(This->nsimg, &width); if(NS_FAILED(nsres)) { ERR("GetWidth failed: %08x\n", nsres); return E_FAIL; } *p = width; return S_OK; }
static HRESULT WINAPI HTMLImgElement_get_complete(IHTMLImgElement *iface, VARIANT_BOOL *p) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); cpp_bool complete; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); nsres = nsIDOMHTMLImageElement_GetComplete(This->nsimg, &complete); if(NS_FAILED(nsres)) { ERR("GetComplete failed: %08x\n", nsres); return E_FAIL; } *p = complete ? VARIANT_TRUE : VARIANT_FALSE; return S_OK; }
static HRESULT WINAPI HTMLImgElement_get_height(IHTMLImgElement *iface, LONG *p) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); UINT32 height; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); nsres = nsIDOMHTMLImageElement_GetHeight(This->nsimg, &height); if(NS_FAILED(nsres)) { ERR("GetHeight failed: %08x\n", nsres); return E_FAIL; } *p = height; return S_OK; }
static HRESULT WINAPI HTMLImgElement_get_isMap(IHTMLImgElement *iface, VARIANT_BOOL *p) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); cpp_bool b; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); if (p == NULL) return E_INVALIDARG; nsres = nsIDOMHTMLImageElement_GetIsMap(This->nsimg, &b); if (NS_FAILED(nsres)) { ERR("Get IsMap failed: %08x\n", nsres); return E_FAIL; } *p = b ? VARIANT_TRUE : VARIANT_FALSE; return S_OK; }
static HRESULT WINAPI HTMLImgElement_get_name(IHTMLImgElement *iface, BSTR *p) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); nsAString strName; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); nsAString_Init(&strName, NULL); nsres = nsIDOMHTMLImageElement_GetName(This->nsimg, &strName); if(NS_SUCCEEDED(nsres)) { const PRUnichar *str; nsAString_GetData(&strName, &str); *p = *str ? SysAllocString(str) : NULL; }else { ERR("GetName failed: %08x\n", nsres); } nsAString_Finish(&strName); return NS_SUCCEEDED(nsres) ? S_OK : E_FAIL; }
static ULONG WINAPI HTMLImgElement_Release(IHTMLImgElement *iface) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface); }
static HRESULT WINAPI HTMLImgElement_GetTypeInfoCount(IHTMLImgElement *iface, UINT *pctinfo) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI HTMLImgElement_get_start(IHTMLImgElement *iface, BSTR *p) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLImgElement_put_hspace(IHTMLImgElement *iface, LONG v) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); FIXME("(%p)->(%d)\n", This, v); return E_NOTIMPL; }
static HRESULT WINAPI HTMLImgElement_put_loop(IHTMLImgElement *iface, VARIANT v) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLImgElement_QueryInterface(IHTMLImgElement *iface, REFIID riid, void **ppv) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv); }
static HRESULT WINAPI HTMLImgElement_get_border(IHTMLImgElement *iface, VARIANT *p) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLImgElement_put_name(IHTMLImgElement *iface, BSTR v) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLImgElement_put_isMap(IHTMLImgElement *iface, VARIANT_BOOL v) { HTMLImgElement *This = impl_from_IHTMLImgElement(iface); FIXME("(%p)->(%x)\n", This, v); return E_NOTIMPL; }