1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* ***** BEGIN LICENSE BLOCK *****
3 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 : *
5 : * The contents of this file are subject to the Mozilla Public License Version
6 : * 1.1 (the "License"); you may not use this file except in compliance with
7 : * the License. You may obtain a copy of the License at
8 : * http://www.mozilla.org/MPL/
9 : *
10 : * Software distributed under the License is distributed on an "AS IS" basis,
11 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : * for the specific language governing rights and limitations under the
13 : * License.
14 : *
15 : * The Original Code is the Mozilla SVG project.
16 : *
17 : * The Initial Developer of the Original Code is
18 : * Robert Longson <longsonr@gmail.com>
19 : * Portions created by the Initial Developer are Copyright (C) 2010
20 : * the Initial Developer. All Rights Reserved.
21 : *
22 : * Alternatively, the contents of this file may be used under the terms of
23 : * either of the GNU General Public License Version 2 or later (the "GPL"),
24 : * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
25 : * in which case the provisions of the GPL or the LGPL are applicable instead
26 : * of those above. If you wish to allow use of your version of this file only
27 : * under the terms of either the GPL or the LGPL, and not to allow others to
28 : * use your version of this file under the terms of the MPL, indicate your
29 : * decision by deleting the provisions above and replace them with the notice
30 : * and other provisions required by the GPL or the LGPL. If you do not delete
31 : * the provisions above, a recipient may use your version of this file under
32 : * the terms of any one of the MPL, the GPL or the LGPL.
33 : *
34 : * ***** END LICENSE BLOCK ***** */
35 :
36 : #include "mozilla/Util.h"
37 :
38 : #include "nsSVGTextPositioningElement.h"
39 : #include "SVGAnimatedLengthList.h"
40 : #include "DOMSVGAnimatedLengthList.h"
41 : #include "SVGLengthList.h"
42 : #include "DOMSVGAnimatedNumberList.h"
43 :
44 : using namespace mozilla;
45 :
46 :
47 : nsSVGElement::LengthListInfo nsSVGTextPositioningElement::sLengthListInfo[4] =
48 : {
49 : { &nsGkAtoms::x, nsSVGUtils::X, false },
50 : { &nsGkAtoms::y, nsSVGUtils::Y, false },
51 : { &nsGkAtoms::dx, nsSVGUtils::X, true },
52 : { &nsGkAtoms::dy, nsSVGUtils::Y, true }
53 : };
54 :
55 : nsSVGElement::LengthListAttributesInfo
56 0 : nsSVGTextPositioningElement::GetLengthListInfo()
57 : {
58 : return LengthListAttributesInfo(mLengthListAttributes, sLengthListInfo,
59 0 : ArrayLength(sLengthListInfo));
60 : }
61 :
62 :
63 : nsSVGElement::NumberListInfo nsSVGTextPositioningElement::sNumberListInfo[1] =
64 : {
65 : { &nsGkAtoms::rotate }
66 : };
67 :
68 : nsSVGElement::NumberListAttributesInfo
69 0 : nsSVGTextPositioningElement::GetNumberListInfo()
70 : {
71 : return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo,
72 0 : ArrayLength(sNumberListInfo));
73 : }
74 :
75 : //----------------------------------------------------------------------
76 : // nsIDOMSVGTextPositioningElement methods
77 :
78 : /* readonly attribute nsIDOMSVGAnimatedLengthList x; */
79 0 : NS_IMETHODIMP nsSVGTextPositioningElement::GetX(nsIDOMSVGAnimatedLengthList * *aX)
80 : {
81 : *aX = DOMSVGAnimatedLengthList::GetDOMWrapper(&mLengthListAttributes[X],
82 0 : this, X, nsSVGUtils::X).get();
83 0 : return NS_OK;
84 : }
85 :
86 : /* readonly attribute nsIDOMSVGAnimatedLengthList y; */
87 0 : NS_IMETHODIMP nsSVGTextPositioningElement::GetY(nsIDOMSVGAnimatedLengthList * *aY)
88 : {
89 : *aY = DOMSVGAnimatedLengthList::GetDOMWrapper(&mLengthListAttributes[Y],
90 0 : this, Y, nsSVGUtils::Y).get();
91 0 : return NS_OK;
92 : }
93 :
94 : /* readonly attribute nsIDOMSVGAnimatedLengthList dx; */
95 0 : NS_IMETHODIMP nsSVGTextPositioningElement::GetDx(nsIDOMSVGAnimatedLengthList * *aDx)
96 : {
97 : *aDx = DOMSVGAnimatedLengthList::GetDOMWrapper(&mLengthListAttributes[DX],
98 0 : this, DX, nsSVGUtils::X).get();
99 0 : return NS_OK;
100 : }
101 :
102 : /* readonly attribute nsIDOMSVGAnimatedLengthList dy; */
103 0 : NS_IMETHODIMP nsSVGTextPositioningElement::GetDy(nsIDOMSVGAnimatedLengthList * *aDy)
104 : {
105 : *aDy = DOMSVGAnimatedLengthList::GetDOMWrapper(&mLengthListAttributes[DY],
106 0 : this, DY, nsSVGUtils::Y).get();
107 0 : return NS_OK;
108 : }
109 :
110 : /* readonly attribute nsIDOMSVGAnimatedNumberList rotate; */
111 0 : NS_IMETHODIMP nsSVGTextPositioningElement::GetRotate(nsIDOMSVGAnimatedNumberList * *aRotate)
112 : {
113 : *aRotate = DOMSVGAnimatedNumberList::GetDOMWrapper(&mNumberListAttributes[ROTATE],
114 0 : this, ROTATE).get();
115 0 : return NS_OK;
116 : }
|