include/mscvpdb.h: Use flexible array members for the rest of structures.
[wine.git] / dlls / mshtml / svg.c
blobc72046f1e3fd7e18b7ac3b8c4e41ed431843d56f
1 /*
2 * Copyright 2019 Jacek Caban for CodeWeavers
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.
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.
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
19 #include <stdarg.h>
20 #include <math.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "winreg.h"
28 #include "ole2.h"
29 #include "mshtmdid.h"
31 #include "wine/debug.h"
33 #include "mshtml_private.h"
34 #include "htmlevent.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 struct SVGElement {
39 HTMLElement element;
40 ISVGElement ISVGElement_iface;
43 static inline SVGElement *impl_from_ISVGElement(ISVGElement *iface)
45 return CONTAINING_RECORD(iface, SVGElement, ISVGElement_iface);
48 DISPEX_IDISPATCH_IMPL(SVGElement, ISVGElement,
49 impl_from_ISVGElement(iface)->element.node.event_target.dispex)
51 static HRESULT WINAPI SVGElement_put_xmlbase(ISVGElement *iface, BSTR v)
53 SVGElement *This = impl_from_ISVGElement(iface);
54 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
55 return E_NOTIMPL;
58 static HRESULT WINAPI SVGElement_get_xmlbase(ISVGElement *iface, BSTR *p)
60 SVGElement *This = impl_from_ISVGElement(iface);
61 FIXME("(%p)->(%p)\n", This, p);
62 return E_NOTIMPL;
65 static HRESULT WINAPI SVGElement_putref_ownerSVGElement(ISVGElement *iface, ISVGSVGElement *v)
67 SVGElement *This = impl_from_ISVGElement(iface);
68 FIXME("(%p)->(%p)\n", This, v);
69 return E_NOTIMPL;
72 static HRESULT WINAPI SVGElement_get_ownerSVGElement(ISVGElement *iface, ISVGSVGElement **p)
74 SVGElement *This = impl_from_ISVGElement(iface);
75 FIXME("(%p)->(%p)\n", This, p);
76 return E_NOTIMPL;
79 static HRESULT WINAPI SVGElement_putref_viewportElement(ISVGElement *iface, ISVGElement *v)
81 SVGElement *This = impl_from_ISVGElement(iface);
82 FIXME("(%p)->(%p)\n", This, v);
83 return E_NOTIMPL;
86 static HRESULT WINAPI SVGElement_get_viewportElement(ISVGElement *iface, ISVGElement **p)
88 SVGElement *This = impl_from_ISVGElement(iface);
89 FIXME("(%p)->(%p)\n", This, p);
90 return E_NOTIMPL;
93 static HRESULT WINAPI SVGElement_putref_focusable(ISVGElement *iface, ISVGAnimatedEnumeration *v)
95 SVGElement *This = impl_from_ISVGElement(iface);
96 FIXME("(%p)->(%p)\n", This, v);
97 return E_NOTIMPL;
100 static HRESULT WINAPI SVGElement_get_focusable(ISVGElement *iface, ISVGAnimatedEnumeration **p)
102 SVGElement *This = impl_from_ISVGElement(iface);
103 FIXME("(%p)->(%p)\n", This, p);
104 return E_NOTIMPL;
107 static const ISVGElementVtbl SVGElementVtbl = {
108 SVGElement_QueryInterface,
109 SVGElement_AddRef,
110 SVGElement_Release,
111 SVGElement_GetTypeInfoCount,
112 SVGElement_GetTypeInfo,
113 SVGElement_GetIDsOfNames,
114 SVGElement_Invoke,
115 SVGElement_put_xmlbase,
116 SVGElement_get_xmlbase,
117 SVGElement_putref_ownerSVGElement,
118 SVGElement_get_ownerSVGElement,
119 SVGElement_putref_viewportElement,
120 SVGElement_get_viewportElement,
121 SVGElement_putref_focusable,
122 SVGElement_get_focusable
125 static inline SVGElement *SVGElement_from_DispatchEx(DispatchEx *iface)
127 return CONTAINING_RECORD(iface, SVGElement, element.node.event_target.dispex);
130 static void *SVGElement_query_interface(DispatchEx *dispex, REFIID riid)
132 SVGElement *This = SVGElement_from_DispatchEx(dispex);
134 if(IsEqualGUID(&IID_ISVGElement, riid))
135 return &This->ISVGElement_iface;
137 return HTMLElement_query_interface(&This->element.node.event_target.dispex, riid);
140 static const NodeImplVtbl SVGElementImplVtbl = {
141 .clsid = &CLSID_SVGElement,
142 .cpc_entries = HTMLElement_cpc,
143 .clone = HTMLElement_clone,
144 .get_attr_col = HTMLElement_get_attr_col,
147 static const event_target_vtbl_t SVGElement_event_target_vtbl = {
149 HTMLELEMENT_DISPEX_VTBL_ENTRIES,
150 .query_interface= SVGElement_query_interface,
151 .destructor = HTMLElement_destructor,
152 .traverse = HTMLElement_traverse,
153 .unlink = HTMLElement_unlink
155 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
156 .handle_event = HTMLElement_handle_event
159 static dispex_static_data_t SVGElement_dispex = {
160 "HTMLUnknownElement",
161 &SVGElement_event_target_vtbl.dispex_vtbl,
162 DispHTMLUnknownElement_tid,
163 HTMLElement_iface_tids,
164 HTMLElement_init_dispex_info
167 static void init_svg_element(SVGElement *svg_element, HTMLDocumentNode *doc, nsIDOMSVGElement *nselem, dispex_static_data_t *dispex_data)
169 svg_element->ISVGElement_iface.lpVtbl = &SVGElementVtbl;
170 HTMLElement_Init(&svg_element->element, doc, (nsIDOMElement*)nselem, dispex_data);
173 struct SVGSVGElement {
174 SVGElement svg_element;
175 ISVGSVGElement ISVGSVGElement_iface;
178 static inline SVGSVGElement *impl_from_ISVGSVGElement(ISVGSVGElement *iface)
180 return CONTAINING_RECORD(iface, SVGSVGElement, ISVGSVGElement_iface);
183 DISPEX_IDISPATCH_IMPL(SVGSVGElement, ISVGSVGElement,
184 impl_from_ISVGSVGElement(iface)->svg_element.element.node.event_target.dispex)
186 static HRESULT WINAPI SVGSVGElement_putref_x(ISVGSVGElement *iface, ISVGAnimatedLength *v)
188 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
189 FIXME("(%p)->(%p)\n", This, v);
190 return E_NOTIMPL;
193 static HRESULT WINAPI SVGSVGElement_get_x(ISVGSVGElement *iface, ISVGAnimatedLength **p)
195 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
196 FIXME("(%p)->(%p)\n", This, p);
197 return E_NOTIMPL;
200 static HRESULT WINAPI SVGSVGElement_putref_y(ISVGSVGElement *iface, ISVGAnimatedLength *v)
202 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
203 FIXME("(%p)->(%p)\n", This, v);
204 return E_NOTIMPL;
207 static HRESULT WINAPI SVGSVGElement_get_y(ISVGSVGElement *iface, ISVGAnimatedLength **p)
209 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
210 FIXME("(%p)->(%p)\n", This, p);
211 return E_NOTIMPL;
214 static HRESULT WINAPI SVGSVGElement_putref_width(ISVGSVGElement *iface, ISVGAnimatedLength *v)
216 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
217 FIXME("(%p)->(%p)\n", This, v);
218 return E_NOTIMPL;
221 static HRESULT WINAPI SVGSVGElement_get_width(ISVGSVGElement *iface, ISVGAnimatedLength **p)
223 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
224 FIXME("(%p)->(%p)\n", This, p);
225 return E_NOTIMPL;
228 static HRESULT WINAPI SVGSVGElement_putref_height(ISVGSVGElement *iface, ISVGAnimatedLength *v)
230 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
231 FIXME("(%p)->(%p)\n", This, v);
232 return E_NOTIMPL;
235 static HRESULT WINAPI SVGSVGElement_get_height(ISVGSVGElement *iface, ISVGAnimatedLength **p)
237 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
238 FIXME("(%p)->(%p)\n", This, p);
239 return E_NOTIMPL;
242 static HRESULT WINAPI SVGSVGElement_put_contentScriptType(ISVGSVGElement *iface, BSTR v)
244 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
245 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
246 return E_NOTIMPL;
249 static HRESULT WINAPI SVGSVGElement_get_contentScriptType(ISVGSVGElement *iface, BSTR *p)
251 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
252 FIXME("(%p)->(%p)\n", This, p);
253 return E_NOTIMPL;
256 static HRESULT WINAPI SVGSVGElement_put_contentStyleType(ISVGSVGElement *iface, BSTR v)
258 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
259 FIXME("(%p)->(%p)\n", This, v);
260 return E_NOTIMPL;
263 static HRESULT WINAPI SVGSVGElement_get_contentStyleType(ISVGSVGElement *iface, BSTR *p)
265 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
266 FIXME("(%p)->(%p)\n", This, p);
267 return E_NOTIMPL;
270 static HRESULT WINAPI SVGSVGElement_putref_viewport(ISVGSVGElement *iface, ISVGRect *v)
272 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
273 FIXME("(%p)->(%p)\n", This, v);
274 return E_NOTIMPL;
277 static HRESULT WINAPI SVGSVGElement_get_viewport(ISVGSVGElement *iface, ISVGRect **p)
279 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
280 FIXME("(%p)->(%p)\n", This, p);
281 return E_NOTIMPL;
284 static HRESULT WINAPI SVGSVGElement_put_pixelUnitToMillimeterX(ISVGSVGElement *iface, float v)
286 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
287 FIXME("(%p)->(%f)\n", This, v);
288 return E_NOTIMPL;
291 static HRESULT WINAPI SVGSVGElement_get_pixelUnitToMillimeterX(ISVGSVGElement *iface, float *p)
293 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
294 FIXME("(%p)->(%p)\n", This, p);
295 return E_NOTIMPL;
298 static HRESULT WINAPI SVGSVGElement_put_pixelUnitToMillimeterY(ISVGSVGElement *iface, float v)
300 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
301 FIXME("(%p)->(%f)\n", This, v);
302 return E_NOTIMPL;
305 static HRESULT WINAPI SVGSVGElement_get_pixelUnitToMillimeterY(ISVGSVGElement *iface, float *p)
307 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
308 FIXME("(%p)->(%p)\n", This, p);
309 return E_NOTIMPL;
312 static HRESULT WINAPI SVGSVGElement_put_screenPixelToMillimeterX(ISVGSVGElement *iface, float v)
314 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
315 FIXME("(%p)->(%f)\n", This, v);
316 return E_NOTIMPL;
319 static HRESULT WINAPI SVGSVGElement_get_screenPixelToMillimeterX(ISVGSVGElement *iface, float *p)
321 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
322 FIXME("(%p)->(%p)\n", This, p);
323 return E_NOTIMPL;
326 static HRESULT WINAPI SVGSVGElement_put_screenPixelToMillimeterY(ISVGSVGElement *iface, float v)
328 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
329 FIXME("(%p)->(%f)\n", This, v);
330 return E_NOTIMPL;
333 static HRESULT WINAPI SVGSVGElement_get_screenPixelToMillimeterY(ISVGSVGElement *iface, float *p)
335 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
336 FIXME("(%p)->(%p)\n", This, p);
337 return E_NOTIMPL;
340 static HRESULT WINAPI SVGSVGElement_put_useCurrentView(ISVGSVGElement *iface, VARIANT_BOOL v)
342 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
343 FIXME("(%p)->(%x)\n", This, v);
344 return E_NOTIMPL;
347 static HRESULT WINAPI SVGSVGElement_get_useCurrentView(ISVGSVGElement *iface, VARIANT_BOOL *p)
349 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
350 FIXME("(%p)->(%p)\n", This, p);
351 return E_NOTIMPL;
354 static HRESULT WINAPI SVGSVGElement_putref_currentView(ISVGSVGElement *iface, ISVGViewSpec *v)
356 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
357 FIXME("(%p)->(%p)\n", This, v);
358 return E_NOTIMPL;
361 static HRESULT WINAPI SVGSVGElement_get_currentView(ISVGSVGElement *iface, ISVGViewSpec **p)
363 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
364 FIXME("(%p)->(%p)\n", This, p);
365 return E_NOTIMPL;
368 static HRESULT WINAPI SVGSVGElement_put_currentScale(ISVGSVGElement *iface, float v)
370 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
371 FIXME("(%p)->(%f)\n", This, v);
372 return E_NOTIMPL;
375 static HRESULT WINAPI SVGSVGElement_get_currentScale(ISVGSVGElement *iface, float *p)
377 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
378 FIXME("(%p)->(%p)\n", This, p);
379 return E_NOTIMPL;
382 static HRESULT WINAPI SVGSVGElement_putref_currentTranslate(ISVGSVGElement *iface, ISVGPoint *v)
384 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
385 FIXME("(%p)->(%p)\n", This, v);
386 return E_NOTIMPL;
389 static HRESULT WINAPI SVGSVGElement_get_currentTranslate(ISVGSVGElement *iface, ISVGPoint **p)
391 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
392 FIXME("(%p)->(%p)\n", This, p);
393 return E_NOTIMPL;
396 static HRESULT WINAPI SVGSVGElement_suspendRedraw(ISVGSVGElement *iface, ULONG max_wait, ULONG *p)
398 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
399 FIXME("(%p)->(%lu %p)\n", This, max_wait, p);
400 return E_NOTIMPL;
403 static HRESULT WINAPI SVGSVGElement_unsuspendRedraw(ISVGSVGElement *iface, ULONG id)
405 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
406 FIXME("(%p)->(%lu)\n", This, id);
407 return E_NOTIMPL;
410 static HRESULT WINAPI SVGSVGElement_unsuspendRedrawAll(ISVGSVGElement *iface)
412 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
413 FIXME("(%p)\n", This);
414 return E_NOTIMPL;
417 static HRESULT WINAPI SVGSVGElement_forceRedraw(ISVGSVGElement *iface)
419 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
420 FIXME("(%p)\n", This);
421 return E_NOTIMPL;
424 static HRESULT WINAPI SVGSVGElement_pauseAnimations(ISVGSVGElement *iface)
426 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
427 FIXME("(%p)\n", This);
428 return E_NOTIMPL;
431 static HRESULT WINAPI SVGSVGElement_unpauseAnimations(ISVGSVGElement *iface)
433 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
434 FIXME("(%p)\n", This);
435 return E_NOTIMPL;
438 static HRESULT WINAPI SVGSVGElement_animationsPaused(ISVGSVGElement *iface, VARIANT_BOOL *p)
440 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
441 FIXME("(%p)->(%p)\n", This, p);
442 return E_NOTIMPL;
445 static HRESULT WINAPI SVGSVGElement_getCurrentTime(ISVGSVGElement *iface, float *p)
447 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
448 FIXME("(%p)->(%p)\n", This, p);
449 return E_NOTIMPL;
452 static HRESULT WINAPI SVGSVGElement_setCurrentTime(ISVGSVGElement *iface, float v)
454 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
455 FIXME("(%p)->(%f)\n", This, v);
456 return E_NOTIMPL;
459 static HRESULT WINAPI SVGSVGElement_getIntersectionList(ISVGSVGElement *iface, ISVGRect *rect,
460 ISVGElement *reference_element, VARIANT *p)
462 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
463 FIXME("(%p)->(%p %p %p)\n", This, rect, reference_element, p);
464 return E_NOTIMPL;
467 static HRESULT WINAPI SVGSVGElement_getEnclosureList(ISVGSVGElement *iface, ISVGRect *rect,
468 ISVGElement *reference_element, VARIANT *p)
470 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
471 FIXME("(%p)->()\n", This);
472 return E_NOTIMPL;
475 static HRESULT WINAPI SVGSVGElement_checkIntersection(ISVGSVGElement *iface, ISVGElement *element,
476 ISVGRect *rect, VARIANT_BOOL *p)
478 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
479 FIXME("(%p)->(%p %p %p)\n", This, element, rect, p);
480 return E_NOTIMPL;
483 static HRESULT WINAPI SVGSVGElement_checkEnclosure(ISVGSVGElement *iface, ISVGElement *element,
484 ISVGRect *rect, VARIANT_BOOL *p)
486 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
487 FIXME("(%p)->(%p %p %p)\n", This, element, rect, p);
488 return E_NOTIMPL;
491 static HRESULT WINAPI SVGSVGElement_deselectAll(ISVGSVGElement *iface)
493 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
494 FIXME("(%p)\n", This);
495 return E_NOTIMPL;
498 static HRESULT WINAPI SVGSVGElement_createSVGNumber(ISVGSVGElement *iface, ISVGNumber **p)
500 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
501 FIXME("(%p)->(%p)\n", This, p);
502 return E_NOTIMPL;
505 static HRESULT WINAPI SVGSVGElement_createSVGLength(ISVGSVGElement *iface, ISVGLength **p)
507 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
508 FIXME("(%p)->(%p)\n", This, p);
509 return E_NOTIMPL;
512 static HRESULT WINAPI SVGSVGElement_createSVGAngle(ISVGSVGElement *iface, ISVGAngle **p)
514 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
515 FIXME("(%p)->(%p)\n", This, p);
516 return E_NOTIMPL;
519 static HRESULT WINAPI SVGSVGElement_createSVGPoint(ISVGSVGElement *iface, ISVGPoint **p)
521 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
522 FIXME("(%p)->(%p)\n", This, p);
523 return E_NOTIMPL;
526 static HRESULT WINAPI SVGSVGElement_createSVGMatrix(ISVGSVGElement *iface, ISVGMatrix **p)
528 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
529 FIXME("(%p)->(%p)\n", This, p);
530 return E_NOTIMPL;
533 static HRESULT WINAPI SVGSVGElement_createSVGRect(ISVGSVGElement *iface, ISVGRect **p)
535 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
536 FIXME("(%p)->(%p)\n", This, p);
537 return E_NOTIMPL;
540 static HRESULT WINAPI SVGSVGElement_createSVGTransform(ISVGSVGElement *iface, ISVGTransform **p)
542 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
543 FIXME("(%p)->(%p)\n", This, p);
544 return E_NOTIMPL;
547 static HRESULT WINAPI SVGSVGElement_createSVGTransformFromMatrix(ISVGSVGElement *iface,
548 ISVGMatrix *matrix, ISVGTransform **p)
550 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
551 FIXME("(%p)->(%p %p)\n", This, matrix, p);
552 return E_NOTIMPL;
555 static HRESULT WINAPI SVGSVGElement_getElementById(ISVGSVGElement *iface, BSTR id, IHTMLElement **p)
557 SVGSVGElement *This = impl_from_ISVGSVGElement(iface);
558 FIXME("(%p)->(%s %p)\n", This, debugstr_w(id), p);
559 return E_NOTIMPL;
562 static const ISVGSVGElementVtbl SVGSVGElementVtbl = {
563 SVGSVGElement_QueryInterface,
564 SVGSVGElement_AddRef,
565 SVGSVGElement_Release,
566 SVGSVGElement_GetTypeInfoCount,
567 SVGSVGElement_GetTypeInfo,
568 SVGSVGElement_GetIDsOfNames,
569 SVGSVGElement_Invoke,
570 SVGSVGElement_putref_x,
571 SVGSVGElement_get_x,
572 SVGSVGElement_putref_y,
573 SVGSVGElement_get_y,
574 SVGSVGElement_putref_width,
575 SVGSVGElement_get_width,
576 SVGSVGElement_putref_height,
577 SVGSVGElement_get_height,
578 SVGSVGElement_put_contentScriptType,
579 SVGSVGElement_get_contentScriptType,
580 SVGSVGElement_put_contentStyleType,
581 SVGSVGElement_get_contentStyleType,
582 SVGSVGElement_putref_viewport,
583 SVGSVGElement_get_viewport,
584 SVGSVGElement_put_pixelUnitToMillimeterX,
585 SVGSVGElement_get_pixelUnitToMillimeterX,
586 SVGSVGElement_put_pixelUnitToMillimeterY,
587 SVGSVGElement_get_pixelUnitToMillimeterY,
588 SVGSVGElement_put_screenPixelToMillimeterX,
589 SVGSVGElement_get_screenPixelToMillimeterX,
590 SVGSVGElement_put_screenPixelToMillimeterY,
591 SVGSVGElement_get_screenPixelToMillimeterY,
592 SVGSVGElement_put_useCurrentView,
593 SVGSVGElement_get_useCurrentView,
594 SVGSVGElement_putref_currentView,
595 SVGSVGElement_get_currentView,
596 SVGSVGElement_put_currentScale,
597 SVGSVGElement_get_currentScale,
598 SVGSVGElement_putref_currentTranslate,
599 SVGSVGElement_get_currentTranslate,
600 SVGSVGElement_suspendRedraw,
601 SVGSVGElement_unsuspendRedraw,
602 SVGSVGElement_unsuspendRedrawAll,
603 SVGSVGElement_forceRedraw,
604 SVGSVGElement_pauseAnimations,
605 SVGSVGElement_unpauseAnimations,
606 SVGSVGElement_animationsPaused,
607 SVGSVGElement_getCurrentTime,
608 SVGSVGElement_setCurrentTime,
609 SVGSVGElement_getIntersectionList,
610 SVGSVGElement_getEnclosureList,
611 SVGSVGElement_checkIntersection,
612 SVGSVGElement_checkEnclosure,
613 SVGSVGElement_deselectAll,
614 SVGSVGElement_createSVGNumber,
615 SVGSVGElement_createSVGLength,
616 SVGSVGElement_createSVGAngle,
617 SVGSVGElement_createSVGPoint,
618 SVGSVGElement_createSVGMatrix,
619 SVGSVGElement_createSVGRect,
620 SVGSVGElement_createSVGTransform,
621 SVGSVGElement_createSVGTransformFromMatrix,
622 SVGSVGElement_getElementById
625 static inline SVGSVGElement *SVGSVGElement_from_DispatchEx(DispatchEx *iface)
627 return CONTAINING_RECORD(iface, SVGSVGElement, svg_element.element.node.event_target.dispex);
630 static void *SVGSVGElement_query_interface(DispatchEx *dispex, REFIID riid)
632 SVGSVGElement *This = SVGSVGElement_from_DispatchEx(dispex);
634 if(IsEqualGUID(&IID_ISVGSVGElement, riid))
635 return &This->ISVGSVGElement_iface;
637 return SVGElement_query_interface(&This->svg_element.element.node.event_target.dispex, riid);
640 static const NodeImplVtbl SVGSVGElementImplVtbl = {
641 .clsid = &CLSID_SVGSVGElement,
642 .cpc_entries = HTMLElement_cpc,
643 .clone = HTMLElement_clone,
644 .get_attr_col = HTMLElement_get_attr_col,
647 static const event_target_vtbl_t SVGSVGElement_event_target_vtbl = {
649 HTMLELEMENT_DISPEX_VTBL_ENTRIES,
650 .query_interface= SVGSVGElement_query_interface,
651 .destructor = HTMLElement_destructor,
652 .traverse = HTMLElement_traverse,
653 .unlink = HTMLElement_unlink
655 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
656 .handle_event = HTMLElement_handle_event
659 static dispex_static_data_t SVGSVGElement_dispex = {
660 "HTMLUnknownElement",
661 &SVGSVGElement_event_target_vtbl.dispex_vtbl,
662 DispHTMLUnknownElement_tid,
663 HTMLElement_iface_tids,
664 HTMLElement_init_dispex_info
667 static HRESULT create_viewport_element(HTMLDocumentNode *doc, nsIDOMSVGElement *nselem, HTMLElement **elem)
669 SVGSVGElement *ret;
671 ret = calloc(1, sizeof(SVGSVGElement));
672 if(!ret)
673 return E_OUTOFMEMORY;
675 ret->ISVGSVGElement_iface.lpVtbl = &SVGSVGElementVtbl;
676 ret->svg_element.element.node.vtbl = &SVGSVGElementImplVtbl;
678 init_svg_element(&ret->svg_element, doc, nselem, &SVGSVGElement_dispex);
680 *elem = &ret->svg_element.element;
681 return S_OK;
684 struct SVGCircleElement {
685 SVGElement svg_element;
686 ISVGCircleElement ISVGCircleElement_iface;
689 static inline SVGCircleElement *impl_from_ISVGCircleElement(ISVGCircleElement *iface)
691 return CONTAINING_RECORD(iface, SVGCircleElement, ISVGCircleElement_iface);
694 DISPEX_IDISPATCH_IMPL(SVGCircleElement, ISVGCircleElement,
695 impl_from_ISVGCircleElement(iface)->svg_element.element.node.event_target.dispex)
697 static HRESULT WINAPI SVGCircleElement_putref_cx(ISVGCircleElement *iface, ISVGAnimatedLength *v)
699 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
700 FIXME("(%p)->(%p)\n", This, v);
701 return E_NOTIMPL;
704 static HRESULT WINAPI SVGCircleElement_get_cx(ISVGCircleElement *iface, ISVGAnimatedLength **p)
706 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
707 FIXME("(%p)->(%p)\n", This, p);
708 return E_NOTIMPL;
711 static HRESULT WINAPI SVGCircleElement_putref_cy(ISVGCircleElement *iface, ISVGAnimatedLength *v)
713 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
714 FIXME("(%p)->(%p)\n", This, v);
715 return E_NOTIMPL;
718 static HRESULT WINAPI SVGCircleElement_get_cy(ISVGCircleElement *iface, ISVGAnimatedLength **p)
720 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
721 FIXME("(%p)->(%p)\n", This, p);
722 return E_NOTIMPL;
725 static HRESULT WINAPI SVGCircleElement_putref_r(ISVGCircleElement *iface, ISVGAnimatedLength *v)
727 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
728 FIXME("(%p)->(%p)\n", This, v);
729 return E_NOTIMPL;
732 static HRESULT WINAPI SVGCircleElement_get_r(ISVGCircleElement *iface, ISVGAnimatedLength **p)
734 SVGCircleElement *This = impl_from_ISVGCircleElement(iface);
735 FIXME("(%p)->(%p)\n", This, p);
736 return E_NOTIMPL;
739 static const ISVGCircleElementVtbl SVGCircleElementVtbl = {
740 SVGCircleElement_QueryInterface,
741 SVGCircleElement_AddRef,
742 SVGCircleElement_Release,
743 SVGCircleElement_GetTypeInfoCount,
744 SVGCircleElement_GetTypeInfo,
745 SVGCircleElement_GetIDsOfNames,
746 SVGCircleElement_Invoke,
747 SVGCircleElement_putref_cx,
748 SVGCircleElement_get_cx,
749 SVGCircleElement_putref_cy,
750 SVGCircleElement_get_cy,
751 SVGCircleElement_putref_r,
752 SVGCircleElement_get_r
755 static inline SVGCircleElement *SVGCircleElement_from_DispatchEx(DispatchEx *iface)
757 return CONTAINING_RECORD(iface, SVGCircleElement, svg_element.element.node.event_target.dispex);
760 static void *SVGCircleElement_query_interface(DispatchEx *dispex, REFIID riid)
762 SVGCircleElement *This = SVGCircleElement_from_DispatchEx(dispex);
764 if(IsEqualGUID(&IID_ISVGCircleElement, riid))
765 return &This->ISVGCircleElement_iface;
767 return SVGElement_query_interface(&This->svg_element.element.node.event_target.dispex, riid);
770 static const NodeImplVtbl SVGCircleElementImplVtbl = {
771 .clsid = &CLSID_SVGCircleElement,
772 .cpc_entries = HTMLElement_cpc,
773 .clone = HTMLElement_clone,
774 .get_attr_col = HTMLElement_get_attr_col,
777 static const event_target_vtbl_t SVGCircleElement_event_target_vtbl = {
779 HTMLELEMENT_DISPEX_VTBL_ENTRIES,
780 .query_interface= SVGCircleElement_query_interface,
781 .destructor = HTMLElement_destructor,
782 .traverse = HTMLElement_traverse,
783 .unlink = HTMLElement_unlink
785 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
786 .handle_event = HTMLElement_handle_event
789 static dispex_static_data_t SVGCircleElement_dispex = {
790 "HTMLUnknownElement",
791 &SVGCircleElement_event_target_vtbl.dispex_vtbl,
792 DispHTMLUnknownElement_tid,
793 HTMLElement_iface_tids,
794 HTMLElement_init_dispex_info
797 static HRESULT create_circle_element(HTMLDocumentNode *doc, nsIDOMSVGElement *nselem, HTMLElement **elem)
799 SVGCircleElement *ret;
801 ret = calloc(1, sizeof(SVGCircleElement));
802 if(!ret)
803 return E_OUTOFMEMORY;
805 ret->ISVGCircleElement_iface.lpVtbl = &SVGCircleElementVtbl;
806 ret->svg_element.element.node.vtbl = &SVGCircleElementImplVtbl;
808 init_svg_element(&ret->svg_element, doc, nselem, &SVGCircleElement_dispex);
810 *elem = &ret->svg_element.element;
811 return S_OK;
814 typedef struct {
815 ISVGTextContentElement ISVGTextContentElement_iface;
816 SVGElement *svg_element;
817 } SVGTextContentElement;
819 static inline SVGTextContentElement *impl_from_ISVGTextContentElement(ISVGTextContentElement *iface)
821 return CONTAINING_RECORD(iface, SVGTextContentElement, ISVGTextContentElement_iface);
824 DISPEX_IDISPATCH_IMPL(SVGTextContentElement, ISVGTextContentElement,
825 impl_from_ISVGTextContentElement(iface)->svg_element->element.node.event_target.dispex)
827 static HRESULT WINAPI SVGTextContentElement_putref_textLength(ISVGTextContentElement *iface, ISVGAnimatedLength *v)
829 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
830 FIXME("(%p)->(%p)\n", This, v);
831 return E_NOTIMPL;
834 static HRESULT WINAPI SVGTextContentElement_get_textLength(ISVGTextContentElement *iface, ISVGAnimatedLength **p)
836 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
837 FIXME("(%p)->(%p)\n", This, p);
838 return E_NOTIMPL;
841 static HRESULT WINAPI SVGTextContentElement_putref_lengthAdjust(ISVGTextContentElement *iface, ISVGAnimatedEnumeration *v)
843 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
844 FIXME("(%p)->(%p)\n", This, v);
845 return E_NOTIMPL;
848 static HRESULT WINAPI SVGTextContentElement_get_lengthAdjust(ISVGTextContentElement *iface, ISVGAnimatedEnumeration **p)
850 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
851 FIXME("(%p)->(%p)\n", This, p);
852 return E_NOTIMPL;
855 static HRESULT WINAPI SVGTextContentElement_getNumberOfChars(ISVGTextContentElement *iface, LONG *p)
857 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
858 FIXME("(%p)->(%p)\n", This, p);
859 return E_NOTIMPL;
862 static HRESULT WINAPI SVGTextContentElement_getComputedTextLength(ISVGTextContentElement *iface, float *p)
864 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
865 FIXME("(%p)->(%p)\n", This, p);
866 return E_NOTIMPL;
869 static HRESULT WINAPI SVGTextContentElement_getSubStringLength(ISVGTextContentElement *iface,
870 LONG charnum, LONG nchars, float *p)
872 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
873 FIXME("(%p)->(%ld %ld %p)\n", This, charnum, nchars, p);
874 return E_NOTIMPL;
877 static HRESULT WINAPI SVGTextContentElement_getStartPositionOfChar(ISVGTextContentElement *iface,
878 LONG charnum, ISVGPoint **p)
880 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
881 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
882 return E_NOTIMPL;
885 static HRESULT WINAPI SVGTextContentElement_getEndPositionOfChar(ISVGTextContentElement *iface,
886 LONG charnum, ISVGPoint **p)
888 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
889 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
890 return E_NOTIMPL;
893 static HRESULT WINAPI SVGTextContentElement_getExtentOfChar(ISVGTextContentElement *iface,
894 LONG charnum, ISVGRect **p)
896 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
897 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
898 return E_NOTIMPL;
901 static HRESULT WINAPI SVGTextContentElement_getRotationOfChar(ISVGTextContentElement *iface,
902 LONG charnum, float *p)
904 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
905 FIXME("(%p)->(%ld %p)\n", This, charnum, p);
906 return E_NOTIMPL;
909 static HRESULT WINAPI SVGTextContentElement_getCharNumAtPosition(ISVGTextContentElement *iface,
910 ISVGPoint *point, LONG *p)
912 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
913 FIXME("(%p)->(%p %p)\n", This, point, p);
914 return E_NOTIMPL;
917 static HRESULT WINAPI SVGTextContentElement_selectSubString(ISVGTextContentElement *iface,
918 LONG charnum, LONG nchars)
920 SVGTextContentElement *This = impl_from_ISVGTextContentElement(iface);
921 FIXME("(%p)->(%ld %ld)\n", This, charnum, nchars);
922 return E_NOTIMPL;
925 static const ISVGTextContentElementVtbl SVGTextContentElementVtbl = {
926 SVGTextContentElement_QueryInterface,
927 SVGTextContentElement_AddRef,
928 SVGTextContentElement_Release,
929 SVGTextContentElement_GetTypeInfoCount,
930 SVGTextContentElement_GetTypeInfo,
931 SVGTextContentElement_GetIDsOfNames,
932 SVGTextContentElement_Invoke,
933 SVGTextContentElement_putref_textLength,
934 SVGTextContentElement_get_textLength,
935 SVGTextContentElement_putref_lengthAdjust,
936 SVGTextContentElement_get_lengthAdjust,
937 SVGTextContentElement_getNumberOfChars,
938 SVGTextContentElement_getComputedTextLength,
939 SVGTextContentElement_getSubStringLength,
940 SVGTextContentElement_getStartPositionOfChar,
941 SVGTextContentElement_getEndPositionOfChar,
942 SVGTextContentElement_getExtentOfChar,
943 SVGTextContentElement_getRotationOfChar,
944 SVGTextContentElement_getCharNumAtPosition,
945 SVGTextContentElement_selectSubString
948 static void init_text_content_element(SVGTextContentElement *text_content, SVGElement *svg_element)
950 text_content->ISVGTextContentElement_iface.lpVtbl = &SVGTextContentElementVtbl;
951 text_content->svg_element = svg_element;
954 struct SVGTSpanElement {
955 SVGElement svg_element;
956 SVGTextContentElement text_content;
959 static inline SVGTSpanElement *SVGTSpanElement_from_DispatchEx(DispatchEx *iface)
961 return CONTAINING_RECORD(iface, SVGTSpanElement, svg_element.element.node.event_target.dispex);
964 static void *SVGTSpanElement_query_interface(DispatchEx *dispex, REFIID riid)
966 SVGTSpanElement *This = SVGTSpanElement_from_DispatchEx(dispex);
968 if(IsEqualGUID(&IID_ISVGTSpanElement, riid))
969 return &This->svg_element.ISVGElement_iface; /* no additional methods */
970 if(IsEqualGUID(&IID_ISVGTextContentElement, riid))
971 return &This->text_content.ISVGTextContentElement_iface;
973 return SVGElement_query_interface(&This->svg_element.element.node.event_target.dispex, riid);
976 static const NodeImplVtbl SVGTSpanElementImplVtbl = {
977 .clsid = &CLSID_SVGTSpanElement,
978 .cpc_entries = HTMLElement_cpc,
979 .clone = HTMLElement_clone,
980 .get_attr_col = HTMLElement_get_attr_col,
983 static const event_target_vtbl_t SVGTSpanElement_event_target_vtbl = {
985 HTMLELEMENT_DISPEX_VTBL_ENTRIES,
986 .query_interface= SVGTSpanElement_query_interface,
987 .destructor = HTMLElement_destructor,
988 .traverse = HTMLElement_traverse,
989 .unlink = HTMLElement_unlink
991 HTMLELEMENT_EVENT_TARGET_VTBL_ENTRIES,
992 .handle_event = HTMLElement_handle_event
995 static dispex_static_data_t SVGTSpanElement_dispex = {
996 "HTMLUnknownElement",
997 &SVGTSpanElement_event_target_vtbl.dispex_vtbl,
998 DispHTMLUnknownElement_tid,
999 HTMLElement_iface_tids,
1000 HTMLElement_init_dispex_info
1003 static HRESULT create_tspan_element(HTMLDocumentNode *doc, nsIDOMSVGElement *nselem, HTMLElement **elem)
1005 SVGTSpanElement *ret;
1007 ret = calloc(1, sizeof(SVGTSpanElement));
1008 if(!ret)
1009 return E_OUTOFMEMORY;
1011 ret->svg_element.element.node.vtbl = &SVGTSpanElementImplVtbl;
1012 init_text_content_element(&ret->text_content, &ret->svg_element);
1013 init_svg_element(&ret->svg_element, doc, nselem, &SVGTSpanElement_dispex);
1015 *elem = &ret->svg_element.element;
1016 return S_OK;
1019 HRESULT create_svg_element(HTMLDocumentNode *doc, nsIDOMSVGElement *dom_element, const WCHAR *tag_name, HTMLElement **elem)
1021 SVGElement *svg_element;
1023 TRACE("%s\n", debugstr_w(tag_name));
1025 if(!wcscmp(tag_name, L"svg"))
1026 return create_viewport_element(doc, dom_element, elem);
1027 if(!wcscmp(tag_name, L"circle"))
1028 return create_circle_element(doc, dom_element, elem);
1029 if(!wcscmp(tag_name, L"tspan"))
1030 return create_tspan_element(doc, dom_element, elem);
1032 svg_element = calloc(1, sizeof(*svg_element));
1033 if(!svg_element)
1034 return E_OUTOFMEMORY;
1036 svg_element->element.node.vtbl = &SVGElementImplVtbl;
1037 init_svg_element(svg_element, doc, dom_element, &SVGElement_dispex);
1038 *elem = &svg_element->element;
1039 return S_OK;