~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/mshtml/htmlattr.c

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * Copyright 2011 Jacek Caban for CodeWeavers
  3  *
  4  * This library is free software; you can redistribute it and/or
  5  * modify it under the terms of the GNU Lesser General Public
  6  * License as published by the Free Software Foundation; either
  7  * version 2.1 of the License, or (at your option) any later version.
  8  *
  9  * This library is distributed in the hope that it will be useful,
 10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 12  * Lesser General Public License for more details.
 13  *
 14  * You should have received a copy of the GNU Lesser General Public
 15  * License along with this library; if not, write to the Free Software
 16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 17  */
 18 
 19 
 20 #include <stdarg.h>
 21 #include <assert.h>
 22 
 23 #define COBJMACROS
 24 
 25 #include "windef.h"
 26 #include "winbase.h"
 27 #include "winuser.h"
 28 #include "ole2.h"
 29 
 30 #include "mshtml_private.h"
 31 
 32 #include "wine/debug.h"
 33 
 34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
 35 
 36 static inline HTMLDOMAttribute *impl_from_IHTMLDOMAttribute(IHTMLDOMAttribute *iface)
 37 {
 38     return CONTAINING_RECORD(iface, HTMLDOMAttribute, IHTMLDOMAttribute_iface);
 39 }
 40 
 41 static HRESULT WINAPI HTMLDOMAttribute_QueryInterface(IHTMLDOMAttribute *iface,
 42                                                  REFIID riid, void **ppv)
 43 {
 44     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
 45 
 46     if(IsEqualGUID(&IID_IUnknown, riid)) {
 47         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
 48         *ppv = &This->IHTMLDOMAttribute_iface;
 49     }else if(IsEqualGUID(&IID_IHTMLDOMAttribute, riid)) {
 50         TRACE("(%p)->(IID_IHTMLDOMAttribute %p)\n", This, ppv);
 51         *ppv = &This->IHTMLDOMAttribute_iface;
 52     }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
 53         return *ppv ? S_OK : E_NOINTERFACE;
 54     }else {
 55         WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
 56         *ppv =  NULL;
 57         return E_NOINTERFACE;
 58     }
 59 
 60     IUnknown_AddRef((IUnknown*)*ppv);
 61     return S_OK;
 62 }
 63 
 64 static ULONG WINAPI HTMLDOMAttribute_AddRef(IHTMLDOMAttribute *iface)
 65 {
 66     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
 67     LONG ref = InterlockedIncrement(&This->ref);
 68 
 69     TRACE("(%p) ref=%d\n", This, ref);
 70 
 71     return ref;
 72 }
 73 
 74 static ULONG WINAPI HTMLDOMAttribute_Release(IHTMLDOMAttribute *iface)
 75 {
 76     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
 77     LONG ref = InterlockedDecrement(&This->ref);
 78 
 79     TRACE("(%p) ref=%d\n", This, ref);
 80 
 81     if(!ref) {
 82         assert(!This->elem);
 83         release_dispex(&This->dispex);
 84         heap_free(This);
 85     }
 86 
 87     return ref;
 88 }
 89 
 90 static HRESULT WINAPI HTMLDOMAttribute_GetTypeInfoCount(IHTMLDOMAttribute *iface, UINT *pctinfo)
 91 {
 92     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
 93     return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
 94 }
 95 
 96 static HRESULT WINAPI HTMLDOMAttribute_GetTypeInfo(IHTMLDOMAttribute *iface, UINT iTInfo,
 97                                               LCID lcid, ITypeInfo **ppTInfo)
 98 {
 99     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
100     return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
101 }
102 
103 static HRESULT WINAPI HTMLDOMAttribute_GetIDsOfNames(IHTMLDOMAttribute *iface, REFIID riid,
104                                                 LPOLESTR *rgszNames, UINT cNames,
105                                                 LCID lcid, DISPID *rgDispId)
106 {
107     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
108     return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
109             lcid, rgDispId);
110 }
111 
112 static HRESULT WINAPI HTMLDOMAttribute_Invoke(IHTMLDOMAttribute *iface, DISPID dispIdMember,
113                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
114                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
115 {
116     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
117     return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
118             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
119 }
120 
121 static HRESULT WINAPI HTMLDOMAttribute_get_nodeName(IHTMLDOMAttribute *iface, BSTR *p)
122 {
123     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
124 
125     TRACE("(%p)->(%p)\n", This, p);
126 
127     return IDispatchEx_GetMemberName(&This->elem->node.dispex.IDispatchEx_iface, This->dispid, p);
128 }
129 
130 static HRESULT WINAPI HTMLDOMAttribute_put_nodeName(IHTMLDOMAttribute *iface, VARIANT v)
131 {
132     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
133     FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
134     return E_NOTIMPL;
135 }
136 
137 static HRESULT WINAPI HTMLDOMAttribute_get_nodeValue(IHTMLDOMAttribute *iface, VARIANT *p)
138 {
139     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
140     DISPPARAMS dp = {NULL, NULL, 0, 0};
141     EXCEPINFO ei;
142 
143     TRACE("(%p)->(%p)\n", This, p);
144 
145     if(!This->elem) {
146         FIXME("NULL This->elem\n");
147         return E_UNEXPECTED;
148     }
149 
150     memset(&ei, 0, sizeof(ei));
151     return IDispatchEx_InvokeEx(&This->elem->node.dispex.IDispatchEx_iface, This->dispid, LOCALE_SYSTEM_DEFAULT,
152             DISPATCH_PROPERTYGET, &dp, p, &ei, NULL);
153 }
154 
155 static HRESULT WINAPI HTMLDOMAttribute_get_specified(IHTMLDOMAttribute *iface, VARIANT_BOOL *p)
156 {
157     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
158     FIXME("(%p)->(%p)\n", This, p);
159     return E_NOTIMPL;
160 }
161 
162 static const IHTMLDOMAttributeVtbl HTMLDOMAttributeVtbl = {
163     HTMLDOMAttribute_QueryInterface,
164     HTMLDOMAttribute_AddRef,
165     HTMLDOMAttribute_Release,
166     HTMLDOMAttribute_GetTypeInfoCount,
167     HTMLDOMAttribute_GetTypeInfo,
168     HTMLDOMAttribute_GetIDsOfNames,
169     HTMLDOMAttribute_Invoke,
170     HTMLDOMAttribute_get_nodeName,
171     HTMLDOMAttribute_put_nodeName,
172     HTMLDOMAttribute_get_nodeValue,
173     HTMLDOMAttribute_get_specified
174 };
175 
176 static const tid_t HTMLDOMAttribute_iface_tids[] = {
177     IHTMLDOMAttribute_tid,
178     0
179 };
180 static dispex_static_data_t HTMLDOMAttribute_dispex = {
181     NULL,
182     DispHTMLDOMAttribute_tid,
183     0,
184     HTMLDOMAttribute_iface_tids
185 };
186 
187 HRESULT HTMLDOMAttribute_Create(HTMLElement *elem, DISPID dispid, HTMLDOMAttribute **attr)
188 {
189     HTMLAttributeCollection *col;
190     HTMLDOMAttribute *ret;
191     HRESULT hres;
192 
193     ret = heap_alloc_zero(sizeof(*ret));
194     if(!ret)
195         return E_OUTOFMEMORY;
196 
197     hres = HTMLElement_get_attr_col(&elem->node, &col);
198     if(FAILED(hres)) {
199         heap_free(ret);
200         return hres;
201     }
202     IHTMLAttributeCollection_Release(&col->IHTMLAttributeCollection_iface);
203 
204     ret->IHTMLDOMAttribute_iface.lpVtbl = &HTMLDOMAttributeVtbl;
205     ret->ref = 1;
206 
207     ret->dispid = dispid;
208     ret->elem = elem;
209     list_add_tail(&elem->attrs->attrs, &ret->entry);
210 
211     init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLDOMAttribute_iface,
212             &HTMLDOMAttribute_dispex);
213 
214     *attr = ret;
215     return S_OK;
216 }
217 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.