2 AUTO : Number.POSITIVE_INFINITY,
\r
3 FLOOR : new Function( 'v', 'return 0 <= v ? v | 0 : -( -v | 0 )' ),
\r
13 LENGTH : 1, // '1.5em'
\r
15 PERCENT : 4, // '90%', 0.0 ~ 1.0 こういう指定はできない!
\r
17 NUMERICAL : 16, // 1.1 (lineHeight only)
\r
18 AUTO : 32, // 'auto'
\r
19 COLOR : 64, // 0x000000 ~ 0xFFFFFF, RED, #000000 ~ #FFFFFF, #000 ~ #FFF
\r
26 DEFAULT_ONLY : 4096,
\r
31 BORDER_STYLE : X.UI.Util.createChecker( 'none,hidden,dotted,dashed,solid,double,groove,ridge,inset,outset' ),
\r
32 ALIGN : X.UI.Util.createChecker( 'left,center,right,justify' ),
\r
33 TEXT_DECORATION : X.UI.Util.createChecker( 'none,underline,overline,line-through,blink' ),
\r
34 TEXT_TRANSFORM : X.UI.Util.createChecker( 'none,capitalize,lowercase,uppercase' ),
\r
35 BOX_SIZING : X.UI.Util.createChecker( 'content,padding,border' ), // ,margin-box
\r
36 CURSOR : X.UI.Util.createChecker( 'pointer,wait' )
\r
39 createAttrDef : function( base, defs ){
\r
40 var F = base ? X.cloneObject( base ) : {},
\r
41 z = base ? base._last : 0,
\r
47 if( p === '_last' ) continue;
\r
48 if( !X.Type.isArray( def = defs[ p ] ) ) continue;
\r
50 if( !base || !X.Type.isArray( base[ p ] ) ){
\r
53 n = def[ 3 ] & X.UI.Attr.Type.QUARTET ? 4 :
\r
54 def[ 3 ] & X.UI.Attr.Type.COMBI ? 2 : 1;
\r
56 def.No = base[ p ].No;
\r
65 bgColorAlpha : true,
\r
67 bgGradientAplha : true,
\r
68 cournerRadius : true,
\r
69 boxShadowBlur : true,
\r
70 boxShadowAlpha : true,
\r
73 textShadowBlur : true,
\r
74 textShadowAlpha : true
\r
78 bgColor : 'background-color',
\r
79 fontColor : 'color',
\r
80 fontBold : 'fontWeight',
\r
81 fontItalic : 'fontStyle',
\r
82 fontSmallCaps : 'fontVariant'
\r
87 * 0: 初期値 : undefined は不可!
\r
93 X.UI.Attr.Support = X.UI.Attr.createAttrDef( false,
\r
95 className : [ null, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.DEFAULT_ONLY | X.UI.Attr.Type.STRING ],
\r
96 pointerHoverClass : [ null, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.DEFAULT_ONLY | X.UI.Attr.Type.STRING ],
\r
97 pointerDownClass : [ null, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.DEFAULT_ONLY | X.UI.Attr.Type.STRING ],
\r
98 invalidLayoutColor: [ null, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.DEFAULT_ONLY | X.UI.Attr.Type.COLOR ],
\r
100 role : [ 0, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.INIT_ONLY | X.UI.Attr.Type.LIST, 'none,chrome' ],
\r
101 selectable : [ false, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.INIT_ONLY | X.UI.Attr.Type.BOOLEAN ],
\r
103 visible : [ true, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.BOOLEAN ],
\r
104 pointerEnabled : [ false, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.BOOLEAN ],
\r
105 pointerChildren : [ true, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.BOOLEAN ],
\r
106 cursor : [ null, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.LIST, X.UI.Attr.Option.CURSOR ],
\r
107 tooltip : [ null, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.STRING ],
\r
109 borderWidth : [ 0, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.QUARTET | X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT ], // em [ top, right, bottom, left ]
\r
110 padding : [ 0, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.QUARTET | X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT ],
\r
112 width : [ X.UI.Attr.AUTO, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.AUTO ],
\r
113 minWidth : [ 0, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT ],
\r
114 maxWidth : [ X.UI.Attr.AUTO, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.AUTO ],
\r
115 height : [ X.UI.Attr.AUTO, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.AUTO ],
\r
116 minHeight : [ 0, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT ],
\r
117 maxHeight : [ X.UI.Attr.AUTO, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.AUTO ],
\r
118 sizing : [ 0, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LIST, X.UI.Attr.Option.BOX_SIZING ],
\r
119 left : [ null, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.MINUS_LENGTH | X.UI.Attr.Type.MINUS_PERCENT ],
\r
120 top : [ null, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.MINUS_LENGTH | X.UI.Attr.Type.MINUS_PERCENT ],
\r
121 bottom : [ null, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.MINUS_LENGTH | X.UI.Attr.Type.MINUS_PERCENT ],
\r
122 right : [ null, X.UI.Dirty.LAYOUT, X.UI.Attr.USER.LAYOUT, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT | X.UI.Attr.Type.MINUS_LENGTH | X.UI.Attr.Type.MINUS_PERCENT ],
\r
124 borderColor : [ 0x0, X.UI.Dirty.PAINT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.QUARTET | X.UI.Attr.Type.COLOR ], // color [ top, right, bottom, left ]
\r
125 borderStyle : [ 0, X.UI.Dirty.PAINT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.QUARTET | X.UI.Attr.Type.LIST, X.UI.Attr.Option.BORDER_STYLE ], // string [ top, right, bottom, left ]
\r
126 bgColor : [ 0xFFFFFF, X.UI.Dirty.PAINT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.COLOR ], // color
\r
128 fontColor : [ 0x0, X.UI.Dirty.PAINT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.COLOR ],
\r
129 fontFamily : [ null, X.UI.Dirty.FONT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.FONT_NAME ],
\r
130 fontSize : [ 1, X.UI.Dirty.FONT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.LENGTH | X.UI.Attr.Type.PERCENT ],
\r
131 fontBold : [ false, X.UI.Dirty.FONT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.BOOLEAN, 'bold' ],
\r
132 fontItalic : [ false, X.UI.Dirty.FONT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.BOOLEAN, 'italic' ],
\r
133 fontSmallCaps : [ false, X.UI.Dirty.FONT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.BOOLEAN, 'small-caps' ],
\r
134 lineHeight : [ 1, X.UI.Dirty.FONT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.NUMERICAL ], // percent
\r
135 letterSpacing : [ 0, X.UI.Dirty.FONT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.LENGTH ],
\r
136 wordSpacing : [ 0, X.UI.Dirty.FONT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.LENGTH ],
\r
137 textAlign : [ 0, X.UI.Dirty.FONT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.LIST, X.UI.Attr.Option.ALIGN ],
\r
138 textDecoration : [ 0, X.UI.Dirty.FONT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.LIST, X.UI.Attr.Option.TEXT_DECORATION ],
\r
139 textTransform : [ 0, X.UI.Dirty.FONT, X.UI.Attr.USER.XNODE, X.UI.Attr.Type.LIST, X.UI.Attr.Option.TEXT_TRANSFORM ]
\r
144 * 共通する attr 指定を prototype に設定しながら拡張できる、属性データ保持クラス
\r
147 X.UI.attrClassProto = null;
\r
149 X.UI.AttrClass = function( opt_supports, opt_attrs ){
\r
150 var klass, proto, p, support;
\r
151 if( opt_supports && opt_attrs ){
\r
153 klass = new Function( 'a,b', 'var f=arguments.callee;if(a||b)return f._(a,b)' );
\r
154 klass._ = X.UI.AttrClass;
\r
155 klass.prototype = proto = new ( this._ === X.UI.AttrClass ? this : X.UI.AttrClass )();
\r
156 proto.constructor = klass;
\r
159 for( p in opt_supports ){
\r
160 if( p === '_last' ) continue;
\r
161 support = opt_supports[ p ];
\r
162 proto[ support.No ] = support[ 0 ];
\r
163 if( support[ 3 ] & X.UI.Attr.Type.QUARTET ){
\r
164 proto[ support.No + 1 ] = support[ 0 ];
\r
165 proto[ support.No + 2 ] = support[ 0 ];
\r
166 proto[ support.No + 3 ] = support[ 0 ];
\r
168 if( support[ 3 ] & X.UI.Attr.Type.COMBI ){
\r
169 proto[ support.No + 1 ] = support[ 0 ];
\r
174 X.UI.attrClassProto = proto;
\r
175 for( p in opt_attrs ){
\r
176 _AbstractUINode.prototype.setAttr( p, opt_supports[ p ], opt_attrs[ p ] );
\r
178 X.UI.attrClassProto = null;
\r
184 var proto = X.UI.AttrClass.prototype,
\r
185 supports = X.UI.Attr.Support,
\r
188 for( p in supports ){
\r
189 if( p === '_last' ) continue;
\r
190 support = supports[ p ];
\r
191 proto[ support.No ] = support[ 0 ];
\r
192 if( support[ 3 ] & X.UI.Attr.Type.QUARTET ){
\r
193 proto[ support.No + 1 ] = support[ 0 ];
\r
194 proto[ support.No + 2 ] = support[ 0 ];
\r
195 proto[ support.No + 3 ] = support[ 0 ];
\r
197 if( support[ 3 ] & X.UI.Attr.Type.COMBI ){
\r
198 proto[ support.No + 1 ] = support[ 0 ];
\r