OSDN Git Service

text要素関連のインターフェースをbase関数で表現
authordhrname <sie-developers@lists.sourceforge.jp>
Sun, 9 Nov 2014 14:06:18 +0000 (23:06 +0900)
committerdhrname <sie-developers@lists.sourceforge.jp>
Sun, 9 Nov 2014 14:06:18 +0000 (23:06 +0900)
org/w3c/dom/svg.js

index fe40643..721dfe3 100644 (file)
@@ -3708,7 +3708,8 @@ base.$1.up("http://www.w3.org/2000/svgpolygon")
   _doc = void 0;\r
 } );\r
 \r
-function SVGTextContentElement(_doc) {\r
+base.$1.up("http://www.w3.org/2000/svgtext").mix( {\r
+  SVGTextContentElement: function(_doc) {\r
   /*readonly SVGAnimatedLength*/      this.textLength = new SVGAnimatedLength();\r
   /*readonly SVGAnimatedEnumeration*/ this.lengthAdjust = base("$SVGAnimatedEnumeration").up();\r
   this.addEventListener("DOMNodeInserted", function(evt){\r
@@ -3771,20 +3772,18 @@ function SVGTextContentElement(_doc) {
       tar = evt = void 0;\r
     }\r
   }, false);\r
-};\r
-\r
-(function(t) {\r
-  var tproto = t.prototype;\r
+},\r
     // lengthAdjust Types\r
-  /*unsigned short t.LENGTHADJUST_UNKNOWN           = 0;\r
-  /*unsigned short t.LENGTHADJUST_SPACING           = 1;\r
-  /*unsigned short t.LENGTHADJUST_SPACINGANDGLYPHS  = 2;*/\r
-  tproto._list = null;         //文字の位置を格納しておくリストのキャッシュ\r
-  tproto._length = null;       //全文字数のキャッシュ\r
-  tproto._stx = tproto._sty = 0; //初めの文字の位置\r
-  tproto._chars = 0;           //tspan (tref)要素が全体の何文字目から始まっているか\r
-  tproto._isYokogaki = true;   //横書きかどうか\r
-/*long*/     tproto.getNumberOfChars = function() {\r
+  /*unsigned short SVGTextContentElement.LENGTHADJUST_UNKNOWN           = 0;\r
+  /*unsigned short SVGTextContentElement.LENGTHADJUST_SPACING           = 1;\r
+  /*unsigned short SVGTextContentElement.LENGTHADJUST_SPACINGANDGLYPHS  = 2;*/\r
+  _list: null,         //文字の位置を格納しておくリストのキャッシュ\r
+  _length: null,       //全文字数のキャッシュ\r
+  _stx: 0,\r
+  _sty: 0, //初めの文字の位置\r
+  _chars: 0,           //tspan (tref)要素が全体の何文字目から始まっているか\r
+  _isYokogaki: true,   //横書きかどうか\r
+/*long*/     getNumberOfChars: function() {\r
   if (this._length) {\r
     return (this._length);\r
   } else {\r
@@ -3811,8 +3810,8 @@ function SVGTextContentElement(_doc) {
     this._length = s;\r
     return s;\r
   }\r
-};\r
-/*float*/    tproto.getComputedTextLength = function() {\r
+},\r
+/*float*/    getComputedTextLength: function() {\r
   var l = this.textLength.baseVal;\r
   if ((l.value === 0) && (this.getNumberOfChars() > 0)) {\r
     /*何も設定されていない場合のみ、初期化を行う*/\r
@@ -3820,11 +3819,11 @@ function SVGTextContentElement(_doc) {
   }\r
   l = void 0;\r
   return (this.textLength.baseVal.value);\r
-};\r
+},\r
 /*getSubStringLengthメソッド\r
  *charnum番目の文字からnchars+charnum-1番目までの文字列の長さを求めて返す\r
  */\r
-/*float*/    tproto.getSubStringLength = function(/*unsigned long*/ charnum, /*unsigned long*/ nchars ) {\r
+/*float*/    getSubStringLength: function(/*unsigned long*/ charnum, /*unsigned long*/ nchars ) {\r
   if (nchars === 0) {\r
     return 0;\r
   }\r
@@ -3843,8 +3842,8 @@ function SVGTextContentElement(_doc) {
   }\r
   tg = end = st = void 0;\r
   return s;\r
-};\r
-/*SVGPoint*/ tproto.getStartPositionOfChar = function (/*unsigned long*/ charnum ) {\r
+},\r
+/*SVGPoint*/ getStartPositionOfChar: function (/*unsigned long*/ charnum ) {\r
   if (charnum > this.getNumberOfChars() || charnum < 0) {\r
     throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1));\r
   } else {\r
@@ -3996,8 +3995,8 @@ function SVGTextContentElement(_doc) {
     s = s.matrixTransform(this.getScreenCTM());\r
     return s;\r
   }\r
-};\r
-/*SVGPoint*/ tproto.getEndPositionOfChar = function(/*unsigned long*/ charnum ) {\r
+},\r
+/*SVGPoint*/ getEndPositionOfChar: function(/*unsigned long*/ charnum ) {\r
   if (charnum > this.getNumberOfChars() || charnum < 0) {\r
     throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1));\r
   } else {\r
@@ -4011,24 +4010,22 @@ function SVGTextContentElement(_doc) {
     }\r
     return s;\r
   }\r
-};\r
-/*SVGRect*/  tproto.getExtentOfChar = function(/*unsigned long*/ charnum ) {\r
+},\r
+/*SVGRect*/  getExtentOfChar: function(/*unsigned long*/ charnum ) {\r
 \r
-};\r
-/*float*/    tproto.getRotationOfChar = function(/*unsigned long*/ charnum ) {\r
+},\r
+/*float*/    getRotationOfChar: function(/*unsigned long*/ charnum ) {\r
 \r
-};\r
-/*long*/     tproto.getCharNumAtPosition = function(/*SVGPoint*/ point ) {\r
+},\r
+/*long*/     getCharNumAtPosition: function(/*SVGPoint*/ point ) {\r
 \r
-};\r
-/*void*/     tproto.selectSubString = function(/*unsigned long*/ charnum,/*unsigned long*/ nchars ) {\r
+},\r
+/*void*/     selectSubString: function(/*unsigned long*/ charnum,/*unsigned long*/ nchars ) {\r
 \r
-};\r
- t = tproto = void 0;\r
-})(SVGTextContentElement);\r
+},\r
 \r
-function SVGTextPositioningElement(_doc) {\r
-  SVGTextContentElement.apply(this, arguments);\r
+SVGTextPositioningElement: function(_doc) {\r
+  this.SVGTextContentElement(_doc);\r
   var sl = SVGAnimatedLengthList;\r
   /*readonly SVGAnimatedLengthList*/ this.x = new sl();\r
   /*readonly SVGAnimatedLengthList*/ this.y = new sl();\r
@@ -4132,9 +4129,8 @@ function SVGTextPositioningElement(_doc) {
     tar.addEventListener("DOMNodeInsertedIntoDocument", tar._texto, false);\r
     evt = tar = void 0;\r
   },false);\r
-};\r
-SVGTextPositioningElement.prototype = Object._create(SVGTextContentElement);\r
-SVGTextPositioningElement.prototype._texto = function(evt) {\r
+},\r
+  _texto: function(evt) {\r
   var tar = evt.target,\r
       ti = tar.firstChild,\r
       ttp = tar._tar,\r
@@ -4289,20 +4285,20 @@ SVGTextPositioningElement.prototype._texto = function(evt) {
     tts.display = "block";\r
   }\r
   tar._cacheMatrix = anchor = isEnd = isMiddle = searchChild = tstylefunc = isMore = mt = lh = isRect = evt = tar = style = tedeco = style = color = cursor = disp = vis = ttps = backr = backrs = jt = lts = deter = void 0;\r
-};\r
+}\r
+} )\r
+ .on("initialize",  function (_doc) {\r
+  this.SVGTextPositioningElement(_doc);\r
+} );\r
 \r
-function SVGTextElement(_doc) {\r
-  SVGTextPositioningElement.apply(this, arguments);\r
-};\r
-SVGTextElement.prototype = Object._create(SVGTextPositioningElement);\r
+/*text要素のインターフェースとなるオブジェクトをtspan要素に流用する*/\r
+base.$1["http://www.w3.org/2000/svgtspan"] = base.$1["http://www.w3.org/2000/svgtext"].up()\r
 \r
-function SVGTSpanElement() {\r
-  SVGTextElement.apply(this, arguments);\r
-};\r
-SVGTSpanElement.prototype = Object._create(SVGTextPositioningElement);\r
 \r
-function SVGTRefElement(_doc) {\r
-  SVGTextPositioningElement.apply(this, arguments);\r
+/*text要素のインターフェースとなるオブジェクトをtref要素に流用する*/\r
+base.$1["http://www.w3.org/2000/svgtref"] = base.$1["http://www.w3.org/2000/svgtext"].up()\r
+ .on("initialize",  function (_doc) {\r
+  this.SVGTextPositioningElement(_doc);\r
   this.addEventListener("DOMNodeInserted", function(evt){\r
     if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) {\r
       return; //強制終了させる\r
@@ -4322,28 +4318,28 @@ function SVGTRefElement(_doc) {
     tar = tic = evtt = void 0;\r
   }, false);\r
   SVGURIReference.apply(this);\r
-};\r
-SVGTRefElement.prototype = Object._create(SVGTextPositioningElement);\r
+} );\r
 \r
-function SVGTextPathElement() {\r
-  SVGTextContentElement.apply(this, arguments);\r
+/*text要素のインターフェースとなるオブジェクトをtextPath要素に流用する*/\r
+base.$1["http://www.w3.org/2000/svgtextPath"] = base.$1["http://www.w3.org/2000/svgtext"].up()\r
+ .on("initialize",  function (_doc) {\r
+  this.SVGTextContentElement(_doc);\r
   /*readonly SVGAnimatedLength*/      this.startOffset;\r
   /*readonly SVGAnimatedEnumeration*/ this.method;\r
   /*readonly SVGAnimatedEnumeration*/ this.spacing;\r
   SVGURIReference.apply(this);\r
-};\r
-SVGTextPathElement.prototype = Object._create(SVGTextContentElement);\r
+} );\r
+\r
 \r
-(function(t){\r
     // textPath Method Types\r
-  /*unsigned short t.TEXTPATH_METHODTYPE_UNKNOWN   = 0;\r
+  /*t = SVGTextPathElement\r
+   *unsigned short t.TEXTPATH_METHODTYPE_UNKNOWN   = 0;\r
   /*unsigned short t.TEXTPATH_METHODTYPE_ALIGN     = 1;\r
   /*unsigned short t.TEXTPATH_METHODTYPE_STRETCH     = 2;\r
     // textPath Spacing Types\r
   /*unsigned short t.TEXTPATH_SPACINGTYPE_UNKNOWN   = 0;\r
   /*unsigned short t.TEXTPATH_SPACINGTYPE_AUTO     = 1;\r
   /*unsigned short t.TEXTPATH_SPACINGTYPE_EXACT     = 2;*/\r
-})(SVGTextPathElement);\r
 \r
 \r
 base("$CSSValue").$SVGColor.up("$SVGPaint").mix( {\r
@@ -6267,8 +6263,6 @@ function SVGForeignObjectElement(_doc) /*:
 \r
 //#endif  _SVG_IDL_\r
 base("DOMImplementation")["http://www.w3.org/2000/svg"] = {\r
-  text:            SVGTextElement,\r
-  tspan:           SVGTSpanElement,\r
   image:           SVGImageElement,\r
   line:            SVGLineElement,\r
   a:               SVGAElement,\r
@@ -6291,8 +6285,6 @@ base("DOMImplementation")["http://www.w3.org/2000/svg"] = {
   style:           SVGStyleElement,\r
   "switch":        SVGSwitchElement,\r
   "symbol":        SVGSymbolElement,\r
-  textPath:        SVGTextPathElement,\r
-  tref:            SVGTRefElement,\r
   view:            SVGViewElement,\r
   pattern:         SVGPatternElement\r
 };\r