07a38732b1d5288f16c71477884aefa3570d324f
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / VisualMaps.cs
1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15
16 namespace Tizen.NUI
17 {
18     using System.Text;
19     using System.Collections.Generic;
20     using Tizen.NUI.BaseComponents;
21
22     /// <summary>
23     /// A class encapsulating the transform map of the visual.
24     /// </summary>
25     public class VisualMap
26     {
27         private Vector2 _visualSize = null;
28         private Vector2 _visualOffset = null;
29         private Vector2 _visualOffsetPolicy = null;
30         private Vector2 _visualSizePolicy = null;
31         private Visual.AlignType? _visualOrigin = null;
32         private Visual.AlignType? _visualAnchorPoint = null;
33
34         private PropertyMap _visualTransformMap = null;
35
36         private int? _depthIndex = null;
37         protected PropertyMap _outputVisualMap = null;
38
39         internal string Name
40         {
41             set;
42             get;
43         }
44
45         internal int VisualIndex
46         {
47             set;
48             get;
49         }
50
51         internal VisualView Parent
52         {
53             set;
54             get;
55         }
56
57         public VisualMap()
58         {
59         }
60
61         /// <summary>
62         /// Gets or sets the size of the visual.<br>
63         /// It can be either relative (percentage of the parent)
64         /// or absolute (in world units).<br>
65         /// Optional.
66         /// </summary>
67         public Size2D Size
68         {
69             get
70             {
71                 return _visualSize ?? (new Size2D(1, 1));
72             }
73             set
74             {
75                 _visualSize = value;
76                 if (_visualSizePolicy == null)
77                 {
78                     _visualSizePolicy = new Vector2(1.0f, 1.0f);
79                 }
80                 UpdateVisual();
81             }
82         }
83
84         /// <summary>
85         /// Gets or sets the offset of the visual.<br>
86         /// It can be either relative (percentage of the parent)
87         /// or absolute (in world units).<br>
88         /// Optional.
89         /// </summary>
90         public Vector2 Position
91         {
92             get
93             {
94                 return _visualOffset ?? (new Vector2(0.0f, 0.0f));
95             }
96             set
97             {
98                 _visualOffset = value;
99                 if (_visualOffsetPolicy == null)
100                 {
101                     _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
102                 }
103                 UpdateVisual();
104             }
105         }
106
107         /// <summary>
108         /// Gets or sets the relative size of the visual<br>
109         /// (percentage [0.0f to 1.0f] of the control).<br>
110         /// Optional.
111         /// </summary>
112         public RelativeVector2 RelativeSize
113         {
114             get
115             {
116                 return _visualSize ?? (new RelativeVector2(1.0f, 1.0f));
117             }
118             set
119             {
120                 _visualSize = value;
121                 _visualSizePolicy = new Vector2(0.0f, 0.0f);
122                 UpdateVisual();
123             }
124         }
125
126         /// <summary>
127         /// Gets or sets the relative offset of the visual<br>
128         /// (percentage [0.0f to 1.0f] of the control).<br>
129         /// Optional.
130         /// </summary>
131         public RelativeVector2 RelativePosition
132         {
133             get
134             {
135                 return _visualOffset ?? (new RelativeVector2(0.0f, 0.0f));
136             }
137             set
138             {
139                 _visualOffset = value;
140                 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
141                 UpdateVisual();
142             }
143         }
144
145         /// <summary>
146         /// Gets or sets whether the x and y offset values are relative<br>
147         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
148         /// By default, both the x and the y offset are relative.<br>
149         /// Optional.
150         /// </summary>
151         public VisualTransformPolicyType PositionPolicy
152         {
153             get
154             {
155                 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f
156                     && _visualOffsetPolicy.Y == 1.0f)
157                 {
158                     return VisualTransformPolicyType.Absolute;
159                 }
160                 return VisualTransformPolicyType.Relative;
161             }
162             set
163             {
164                 switch (value)
165                 {
166                     case VisualTransformPolicyType.Relative:
167                         _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
168                         break;
169                     case VisualTransformPolicyType.Absolute:
170                         _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
171                         break;
172                     default:
173                         _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
174                         break;
175                 }
176                 UpdateVisual();
177             }
178         }
179
180         /// <summary>
181         /// Gets or sets whether the x offset values are relative<br>
182         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
183         /// By default, the x offset is relative.<br>
184         /// Optional.
185         /// </summary>
186         public VisualTransformPolicyType PositionPolicyX
187         {
188             get
189             {
190                 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f)
191                 {
192                     return VisualTransformPolicyType.Absolute;
193                 }
194                 return VisualTransformPolicyType.Relative;
195             }
196             set
197             {
198                 if (_visualOffsetPolicy == null)
199                 {
200                     _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
201                 }
202
203                 switch (value)
204                 {
205                     case VisualTransformPolicyType.Relative:
206                         _visualOffsetPolicy.X = 0.0f;
207                         break;
208                     case VisualTransformPolicyType.Absolute:
209                         _visualOffsetPolicy.X = 1.0f;
210                         break;
211                     default:
212                         _visualOffsetPolicy.X = 0.0f;
213                         break;
214                 }
215
216                 UpdateVisual();
217             }
218         }
219
220         /// <summary>
221         /// Gets or sets whether the y offset values are relative<br>
222         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
223         /// By default, the y offset is relative.<br>
224         /// Optional.
225         /// </summary>
226         public VisualTransformPolicyType PositionPolicyY
227         {
228             get
229             {
230                 if (_visualOffsetPolicy != null && _visualOffsetPolicy.Y == 1.0f)
231                 {
232                     return VisualTransformPolicyType.Absolute;
233                 }
234                 return VisualTransformPolicyType.Relative;
235             }
236             set
237             {
238                 if (_visualOffsetPolicy == null)
239                 {
240                     _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
241                 }
242
243                 switch (value)
244                 {
245                     case VisualTransformPolicyType.Relative:
246                         _visualOffsetPolicy.Y = 0.0f;
247                         break;
248                     case VisualTransformPolicyType.Absolute:
249                         _visualOffsetPolicy.Y = 1.0f;
250                         break;
251                     default:
252                         _visualOffsetPolicy.Y = 0.0f;
253                         break;
254                 }
255                 UpdateVisual();
256             }
257         }
258
259         /// <summary>
260         /// Gets or sets whether the size values of the width or the height are relative<br>
261         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
262         /// By default, offsets of both the width and the height are relative to the control's size.<br>
263         /// Optional.
264         /// </summary>
265         public VisualTransformPolicyType SizePolicy
266         {
267             get
268             {
269                 if (_visualSizePolicy != null && _visualSizePolicy.X == 1.0f
270                     && _visualSizePolicy.Y == 1.0f)
271                 {
272                     return VisualTransformPolicyType.Absolute;
273                 }
274                 return VisualTransformPolicyType.Relative;
275             }
276             set
277             {
278                 switch (value)
279                 {
280                     case VisualTransformPolicyType.Relative:
281                         _visualSizePolicy = new Vector2(0.0f, 0.0f);
282                         break;
283                     case VisualTransformPolicyType.Absolute:
284                         _visualSizePolicy = new Vector2(1.0f, 1.0f);
285                         break;
286                     default:
287                         _visualSizePolicy = new Vector2(0.0f, 0.0f);
288                         break;
289                 }
290                 UpdateVisual();
291             }
292         }
293
294         /// <summary>
295         /// Gets or sets whether size values of the width are relative.<br>
296         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
297         /// By default, the value of the width is relative to the control's width.<br>
298         /// Optional.
299         /// </summary>
300         public VisualTransformPolicyType SizePolicyWidth
301         {
302             get
303             {
304                 if (_visualSizePolicy != null && _visualSizePolicy.Width == 1.0f)
305                 {
306                     return VisualTransformPolicyType.Absolute;
307                 }
308                 return VisualTransformPolicyType.Relative;
309             }
310             set
311             {
312                 if (_visualSizePolicy == null)
313                 {
314                     _visualSizePolicy = new Vector2(0.0f, 0.0f);
315                 }
316
317                 switch (value)
318                 {
319                     case VisualTransformPolicyType.Relative:
320                         _visualSizePolicy.Width = 0.0f;
321                         break;
322                     case VisualTransformPolicyType.Absolute:
323                         _visualSizePolicy.Width = 1.0f;
324                         break;
325                     default:
326                         _visualSizePolicy.Width = 0.0f;
327                         break;
328                 }
329                 UpdateVisual();
330             }
331         }
332
333         /// <summary>
334         /// Gets or sets whether size values of the height are relative<br>
335         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
336         /// By default, the height value is relative to the control's height.<br>
337         /// Optional.
338         /// </summary>
339         public VisualTransformPolicyType SizePolicyHeight
340         {
341             get
342             {
343                 if (_visualSizePolicy != null && _visualSizePolicy.Height == 1.0f)
344                 {
345                     return VisualTransformPolicyType.Absolute;
346                 }
347                 return VisualTransformPolicyType.Relative;
348             }
349             set
350             {
351                 if (_visualSizePolicy == null)
352                 {
353                     _visualSizePolicy = new Vector2(0.0f, 0.0f);
354                 }
355
356                 switch (value)
357                 {
358                     case VisualTransformPolicyType.Relative:
359                         _visualSizePolicy.Height = 0.0f;
360                         break;
361                     case VisualTransformPolicyType.Absolute:
362                         _visualSizePolicy.Height = 1.0f;
363                         break;
364                     default:
365                         _visualSizePolicy.Height = 0.0f;
366                         break;
367                 }
368                 UpdateVisual();
369             }
370         }
371
372         /// <summary>
373         /// Gets or sets the origin of the visual within its control area.<br>
374         /// By default, the origin is center.<br>
375         /// Optional.
376         /// </summary>
377         public Visual.AlignType Origin
378         {
379             get
380             {
381                 return _visualOrigin ?? (Visual.AlignType.Center);
382             }
383             set
384             {
385                 _visualOrigin = value;
386                 UpdateVisual();
387             }
388         }
389
390         /// <summary>
391         /// Gets or sets the anchor point of the visual.<br>
392         /// By default, the anchor point is center.<br>
393         /// Optional.
394         /// </summary>
395         public Visual.AlignType AnchorPoint
396         {
397             get
398             {
399                 return _visualAnchorPoint ?? (Visual.AlignType.Center);
400             }
401             set
402             {
403                 _visualAnchorPoint = value;
404                 UpdateVisual();
405             }
406         }
407
408         /// <summary>
409         /// Gets or sets the depth index of the visual.<br>
410         /// By default, the depth index is 0.<br>
411         /// Optional.
412         /// </summary>
413         public int DepthIndex
414         {
415             get
416             {
417                 return _depthIndex ?? (0);
418             }
419             set
420             {
421                 _depthIndex = value;
422             }
423         }
424
425         private void ComposingTransformMap()
426         {
427             _visualTransformMap = new PropertyMap();
428             if (_visualSize != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Size, new PropertyValue(_visualSize)); }
429             if (_visualOffset != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(_visualOffset)); }
430             if (_visualOffsetPolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(_visualOffsetPolicy)); }
431             if (_visualSizePolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(_visualSizePolicy)); }
432             if (_visualOrigin != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)_visualOrigin)); }
433             if (_visualAnchorPoint != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)_visualAnchorPoint)); }
434         }
435
436         /// <summary>
437         /// Gets the transform map used by the visual.
438         /// </summary>
439         public PropertyMap OutputTransformMap
440         {
441             get
442             {
443                 ComposingTransformMap();
444                 return _visualTransformMap;
445             }
446         }
447
448         protected virtual void ComposingPropertyMap()
449         {
450             _outputVisualMap = new PropertyMap();
451         }
452
453         /// <summary>
454         /// Gets the property map to create the visual.
455         /// </summary>
456         public PropertyMap OutputVisualMap
457         {
458             get
459             {
460                 ComposingPropertyMap();
461                 return _outputVisualMap;
462             }
463         }
464
465         internal void UpdateVisual()
466         {
467             if (VisualIndex > 0)
468             {
469                 NUILog.Debug("UpdateVisual()! VisualIndex=" + VisualIndex);
470                 Parent.UpdateVisual(VisualIndex, Name, this);
471             }
472             else
473             {
474                 NUILog.Debug("VisualIndex was not set");
475             }
476         }
477
478         protected PropertyMap _shader = null;
479         //private PropertyMap _transform = null;
480         protected bool? _premultipliedAlpha = null;
481         protected Color _mixColor = null;
482         protected float? _opacity = null;
483         protected PropertyMap _commonlyUsedMap = null;
484
485         /// <summary>
486         /// The shader to use in the visual.
487         /// </summary>
488         public PropertyMap Shader
489         {
490             get
491             {
492                 return _shader;
493             }
494             set
495             {
496                 _shader = value;
497                 UpdateVisual();
498             }
499         }
500
501         /// <summary>
502         /// Enables or disables the premultiplied alpha. <br>
503         /// The premultiplied alpha is false by default unless this behavior is modified by the derived visual type.
504         /// </summary>
505         public bool PremultipliedAlpha
506         {
507             get
508             {
509                 return _premultipliedAlpha ?? (false);
510             }
511             set
512             {
513                 _premultipliedAlpha = value;
514                 UpdateVisual();
515             }
516         }
517
518         /// <summary>
519         /// Mix color is a blend color for any visual.
520         /// </summary>
521         public Color MixColor
522         {
523             get
524             {
525                 return _mixColor;
526             }
527             set
528             {
529                 _mixColor = value;
530                 UpdateVisual();
531             }
532         }
533
534         /// <summary>
535         /// Opacity is the alpha component of the mix color discussed above.
536         /// </summary>
537         public float Opacity
538         {
539             get
540             {
541                 return _opacity ?? (1.0f);
542             }
543             set
544             {
545                 _opacity = value;
546                 UpdateVisual();
547             }
548         }
549
550     }
551
552     /// <summary>
553     /// A class encapsulating the property map of the image visual.
554     /// </summary>
555     public class ImageVisual : VisualMap
556     {
557         public ImageVisual() : base()
558         {
559         }
560
561         private string _url = null;
562         private string _alphaMaskUrl = null;
563         private FittingModeType? _fittingMode = null;
564         private SamplingModeType? _samplingMode = null;
565         private int? _desiredWidth = null;
566         private int? _desiredHeight = null;
567         private bool? _synchronousLoading = false;
568         private bool? _borderOnly = null;
569         private Vector4 _pixelArea = null;
570         private WrapModeType? _wrapModeU = null;
571         private WrapModeType? _wrapModeV = null;
572         private float? _maskContentScale = null;
573         private bool? _cropToMask = null;
574
575         /// <summary>
576         /// Gets or sets the URL of the image.<br>
577         /// Mandatory.
578         /// </summary>
579
580         public string URL
581         {
582             get
583             {
584                 return _url;
585             }
586             set
587             {
588                 _url = value;
589                 UpdateVisual();
590             }
591         }
592
593
594         /// <summary>
595         /// Gets or sets the URL of the alpha mask.<br>
596         /// Optional.
597         /// </summary>
598         public string AlphaMaskURL
599         {
600             get
601             {
602                 return _alphaMaskUrl;
603             }
604             set
605             {
606                 _alphaMaskUrl = value;
607                 UpdateVisual();
608             }
609         }
610
611         /// <summary>
612         /// Gets or sets fitting options used when resizing images to fit the desired dimensions.<br>
613         /// If not supplied, the default is FittingModeType.ShrinkToFit.<br>
614         /// For normal quad images only.<br>
615         /// Optional.
616         /// </summary>
617         public FittingModeType FittingMode
618         {
619             get
620             {
621                 return _fittingMode ?? (FittingModeType.ShrinkToFit);
622             }
623             set
624             {
625                 _fittingMode = value;
626                 UpdateVisual();
627             }
628         }
629
630         /// <summary>
631         /// Gets or sets filtering options used when resizing images to the sample original pixels.<br>
632         /// If not supplied, the default is SamplingModeType.Box.<br>
633         /// For normal quad images only.<br>
634         /// Optional.
635         /// </summary>
636         public SamplingModeType SamplingMode
637         {
638             get
639             {
640                 return _samplingMode ?? (SamplingModeType.Box);
641             }
642             set
643             {
644                 _samplingMode = value;
645                 UpdateVisual();
646             }
647         }
648
649         /// <summary>
650         /// Gets or sets the desired image width.<br>
651         /// If not specified, the actual image width is used.<br>
652         /// For normal quad images only.<br>
653         /// Optional.
654         /// </summary>
655         public int DesiredWidth
656         {
657             get
658             {
659                 return _desiredWidth ?? (-1);
660             }
661             set
662             {
663                 _desiredWidth = value;
664                 UpdateVisual();
665             }
666         }
667
668         /// <summary>
669         /// Gets or sets the desired image height.<br>
670         /// If not specified, the actual image height is used.<br>
671         /// For normal quad images only.<br>
672         /// Optional.
673         /// </summary>
674         public int DesiredHeight
675         {
676             get
677             {
678                 return _desiredHeight ?? (-1);
679             }
680             set
681             {
682                 _desiredHeight = value;
683                 UpdateVisual();
684             }
685         }
686
687         /// <summary>
688         /// Gets or sets whether to load the image synchronously.<br>
689         /// If not specified, the default is false, i.e., the image is loaded asynchronously.<br>
690         /// For normal quad images only.<br>
691         /// Optional.
692         /// </summary>
693         public bool SynchronousLoading
694         {
695             get
696             {
697                 return _synchronousLoading ?? (false);
698             }
699             set
700             {
701                 _synchronousLoading = value;
702                 UpdateVisual();
703             }
704         }
705
706         /// <summary>
707         /// Gets or sets whether to draw the borders only (If true).<br>
708         /// If not specified, the default is false.<br>
709         /// For n-patch images only.<br>
710         /// Optional.
711         /// </summary>
712         public bool BorderOnly
713         {
714             get
715             {
716                 return _borderOnly ?? (false);
717             }
718             set
719             {
720                 _borderOnly = value;
721                 UpdateVisual();
722             }
723         }
724
725         /// <summary>
726         /// Gets or sets the image area to be displayed.<br>
727         /// It is a rectangular area.<br>
728         /// The first two elements indicate the top-left position of the area, and the last two elements are the areas of the width and the height respectively.<br>
729         /// If not specified, the default value is Vector4 (0.0, 0.0, 1.0, 1.0), i.e., the entire area of the image.<br>
730         /// For normal quad images only.<br>
731         /// Optional.
732         /// </summary>
733         public Vector4 PixelArea
734         {
735             get
736             {
737                 return _pixelArea ?? (new Vector4(0.0f, 0.0f, 1.0f, 1.0f));
738             }
739             set
740             {
741                 _pixelArea = value;
742                 UpdateVisual();
743             }
744         }
745
746         /// <summary>
747         /// Gets or sets the wrap mode for the u coordinate.<br>
748         /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.<br>
749         /// If not specified, the default is WrapModeType.Default(CLAMP).<br>
750         /// For normal quad images only.<br>
751         /// Optional.
752         /// </summary>
753         public WrapModeType WrapModeU
754         {
755             get
756             {
757                 return _wrapModeU ?? (WrapModeType.Default);
758             }
759             set
760             {
761                 _wrapModeU = value;
762                 UpdateVisual();
763             }
764         }
765
766         /// <summary>
767         /// Gets or sets the wrap mode for the v coordinate.<br>
768         /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.<br>
769         /// The first two elements indicate the top-left position of the area, and the last two elements are the areas of the width and the height respectively.<br>
770         /// If not specified, the default is WrapModeType.Default(CLAMP).<br>
771         /// For normal quad images only.
772         /// Optional.
773         /// </summary>
774         public WrapModeType WrapModeV
775         {
776             get
777             {
778                 return _wrapModeV ?? (WrapModeType.Default);
779             }
780             set
781             {
782                 _wrapModeV = value;
783                 UpdateVisual();
784             }
785         }
786
787         public float MaskContentScale
788         {
789             get
790             {
791                 return _maskContentScale ?? 1.0f;
792             }
793             set
794             {
795                 _maskContentScale = value;
796                 UpdateVisual();
797             }
798         }
799
800         public bool CropToMask
801         {
802             get
803             {
804                 return _cropToMask ?? false;
805             }
806             set
807             {
808                 _cropToMask = value;
809                 UpdateVisual();
810             }
811         }
812
813         protected override void ComposingPropertyMap()
814         {
815             if (_url != null)
816             {
817                 _outputVisualMap = new PropertyMap();
818                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
819                 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
820                 if (_alphaMaskUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AlphaMaskURL, new PropertyValue(_alphaMaskUrl)); }
821                 if (_fittingMode != null) { _outputVisualMap.Add(ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode)); }
822                 if (_samplingMode != null) { _outputVisualMap.Add(ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode)); }
823                 if (_desiredWidth != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, new PropertyValue((int)_desiredWidth)); }
824                 if (_desiredHeight != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredHeight, new PropertyValue((int)_desiredHeight)); }
825                 if (_synchronousLoading != null) { _outputVisualMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
826                 if (_borderOnly != null) { _outputVisualMap.Add(ImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
827                 if (_pixelArea != null) { _outputVisualMap.Add(ImageVisualProperty.PixelArea, new PropertyValue(_pixelArea)); }
828                 if (_wrapModeU != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeU, new PropertyValue((int)_wrapModeU)); }
829                 if (_wrapModeV != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeV, new PropertyValue((int)_wrapModeV)); }
830                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
831                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
832                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
833                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
834                 if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
835                 if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
836             }
837         }
838     }
839
840     /// <summary>
841     /// A class encapsulating the property map of the text visual.
842     /// </summary>
843     public class TextVisual : VisualMap
844     {
845         public TextVisual() : base()
846         {
847         }
848
849         private string _text = null;
850         private string _fontFamily = null;
851         private PropertyMap _fontStyle = null;
852         private float? _pointSize = null;
853         private bool? _multiLine = null;
854         private string _horizontalAlignment = null;
855         private string _verticalAlignment = null;
856         private Color _textColor = null;
857         private bool? _enableMarkup = null;
858
859         /// <summary>
860         /// Gets or sets the text to display in the UTF-8 format.<br>
861         /// Mandatory.
862         /// </summary>
863         public string Text
864         {
865             get
866             {
867                 return _text;
868             }
869             set
870             {
871                 _text = value;
872                 UpdateVisual();
873             }
874         }
875
876         /// <summary>
877         /// Gets or sets the requested font family to use.<br>
878         /// Optional.
879         /// </summary>
880         public string FontFamily
881         {
882             get
883             {
884                 return _fontFamily;
885             }
886             set
887             {
888                 _fontFamily = value;
889                 UpdateVisual();
890             }
891         }
892
893         /// <summary>
894         /// Gets or sets the requested font style to use.<br>
895         /// Optional.
896         /// </summary>
897         public PropertyMap FontStyle
898         {
899             get
900             {
901                 return _fontStyle;
902             }
903             set
904             {
905                 _fontStyle = value;
906                 UpdateVisual();
907             }
908         }
909
910         /// <summary>
911         /// Gets or sets the size of font in points.<br>
912         /// Mandatory.
913         /// </summary>
914         public float PointSize
915         {
916             get
917             {
918                 return _pointSize ?? (0.0f);
919             }
920             set
921             {
922                 _pointSize = value;
923                 UpdateVisual();
924             }
925         }
926
927         /// <summary>
928         /// Gets or sets the single-line or multi-line layout option.<br>
929         /// If not specified, the default is false.<br>
930         /// Optional.
931         /// </summary>
932         public bool MultiLine
933         {
934             get
935             {
936                 return _multiLine ?? (false);
937             }
938             set
939             {
940                 _multiLine = value;
941                 UpdateVisual();
942             }
943         }
944
945         /// <summary>
946         /// Gets or sets the line horizontal alignment.<br>
947         /// If not specified, the default is begin.<br>
948         /// Optional.
949         /// </summary>
950         public HorizontalAlignment HorizontalAlignment
951         {
952             get
953             {
954                 switch (_horizontalAlignment)
955                 {
956                     case "BEGIN":
957                         return HorizontalAlignment.Begin;
958                     case "CENTER":
959                         return HorizontalAlignment.Center;
960                     case "END":
961                         return HorizontalAlignment.End;
962                     default:
963                         return HorizontalAlignment.Begin;
964                 }
965             }
966             set
967             {
968                 switch (value)
969                 {
970                     case HorizontalAlignment.Begin:
971                     {
972                         _horizontalAlignment = "BEGIN";
973                         break;
974                     }
975                     case HorizontalAlignment.Center:
976                     {
977                         _horizontalAlignment = "CENTER";
978                         break;
979                     }
980                     case HorizontalAlignment.End:
981                     {
982                         _horizontalAlignment = "END";
983                         break;
984                     }
985                     default:
986                     {
987                         _horizontalAlignment = "BEGIN";
988                         break;
989                     }
990                 }
991                 UpdateVisual();
992             }
993         }
994
995         /// <summary>
996         /// Gets or sets the line vertical alignment.<br>
997         /// If not specified, the default is top.<br>
998         /// Optional.
999         /// </summary>
1000         public VerticalAlignment VerticalAlignment
1001         {
1002             get
1003             {
1004                 switch (_verticalAlignment)
1005                 {
1006                     case "TOP":
1007                         return VerticalAlignment.Top;
1008                     case "CENTER":
1009                         return VerticalAlignment.Center;
1010                     case "BOTTOM":
1011                         return VerticalAlignment.Bottom;
1012                     default:
1013                         return VerticalAlignment.Top;
1014                 }
1015             }
1016             set
1017             {
1018                 switch (value)
1019                 {
1020                     case VerticalAlignment.Top:
1021                     {
1022                         _verticalAlignment = "TOP";
1023                         break;
1024                     }
1025                     case VerticalAlignment.Center:
1026                     {
1027                         _verticalAlignment = "CENTER";
1028                         break;
1029                     }
1030                     case VerticalAlignment.Bottom:
1031                     {
1032                         _verticalAlignment = "BOTTOM";
1033                         break;
1034                     }
1035                     default:
1036                     {
1037                         _verticalAlignment = "TOP";
1038                         break;
1039                     }
1040                 }
1041                 UpdateVisual();
1042             }
1043         }
1044
1045         /// <summary>
1046         /// Gets or sets the color of the text.<br>
1047         /// Optional.
1048         /// </summary>
1049         public Color TextColor
1050         {
1051             get
1052             {
1053                 return _textColor;
1054             }
1055             set
1056             {
1057                 _textColor = value;
1058                 UpdateVisual();
1059             }
1060         }
1061
1062         /// <summary>
1063         /// Gets or sets whether the mark-up processing is enabled.<br>
1064         /// Optional.
1065         /// </summary>
1066         public bool EnableMarkup
1067         {
1068             get
1069             {
1070                 return _enableMarkup ?? (false);
1071             }
1072             set
1073             {
1074                 _enableMarkup = value;
1075                 UpdateVisual();
1076             }
1077         }
1078
1079         protected override void ComposingPropertyMap()
1080         {
1081             if (_text != null && _pointSize != null)
1082             {
1083                 _outputVisualMap = new PropertyMap();
1084                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
1085                 _outputVisualMap.Add(TextVisualProperty.Text, new PropertyValue(_text));
1086                 _outputVisualMap.Add(TextVisualProperty.PointSize, new PropertyValue((float)_pointSize));
1087                 if (_fontFamily != null) { _outputVisualMap.Add(TextVisualProperty.FontFamily, new PropertyValue(_fontFamily)); }
1088                 if (_fontStyle != null) { _outputVisualMap.Add(TextVisualProperty.FontStyle, new PropertyValue(_fontStyle)); }
1089                 if (_multiLine != null) { _outputVisualMap.Add(TextVisualProperty.MultiLine, new PropertyValue((bool)_multiLine)); }
1090                 if (_horizontalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue(_horizontalAlignment)); }
1091                 if (_verticalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, new PropertyValue(_verticalAlignment)); }
1092                 if (_textColor != null) { _outputVisualMap.Add(TextVisualProperty.TextColor, new PropertyValue(_textColor)); }
1093                 if (_enableMarkup != null) { _outputVisualMap.Add(TextVisualProperty.EnableMarkup, new PropertyValue((bool)_enableMarkup)); }
1094                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1095                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1096                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1097                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1098             }
1099         }
1100     }
1101
1102     /// <summary>
1103     /// A class encapsulating the property map of the border visual.
1104     /// </summary>
1105     public class BorderVisual : VisualMap
1106     {
1107         public BorderVisual() : base()
1108         {
1109         }
1110
1111         private Color _color = null;
1112         private float? _size = null;
1113         private bool? _antiAliasing = null;
1114
1115         /// <summary>
1116         /// Gets or sets the color of the border.<br>
1117         /// Mandatory.
1118         /// </summary>
1119         public Color Color
1120         {
1121             get
1122             {
1123                 return _color;
1124             }
1125             set
1126             {
1127                 _color = value;
1128                 UpdateVisual();
1129             }
1130         }
1131
1132         /// <summary>
1133         /// Gets or sets the width of the border (in pixels).<br>
1134         /// Mandatory.
1135         /// </summary>
1136         public float BorderSize
1137         {
1138             get
1139             {
1140                 return _size ?? (-1.0f);
1141             }
1142             set
1143             {
1144                 _size = value;
1145                 UpdateVisual();
1146             }
1147         }
1148
1149         /// <summary>
1150         /// Gets or sets whether the anti-aliasing of the border is required.<br>
1151         /// If not supplied, the default is false.<br>
1152         /// Optional.
1153         /// </summary>
1154         public bool AntiAliasing
1155         {
1156             get
1157             {
1158                 return _antiAliasing ?? (false);
1159             }
1160             set
1161             {
1162                 _antiAliasing = value;
1163                 UpdateVisual();
1164             }
1165         }
1166
1167         protected override void ComposingPropertyMap()
1168         {
1169             if (_color != null && _size != null)
1170             {
1171                 _outputVisualMap = new PropertyMap();
1172                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Border));
1173                 _outputVisualMap.Add(BorderVisualProperty.Size, new PropertyValue((float)_size));
1174                 _outputVisualMap.Add(BorderVisualProperty.Color, new PropertyValue(_color));
1175                 if (_antiAliasing != null) { _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, new PropertyValue((bool)_antiAliasing)); }
1176                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1177                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1178                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1179                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1180             }
1181         }
1182     }
1183
1184     /// <summary>
1185     /// A class encapsulating the property map of the color visual.
1186     /// </summary>
1187     public class ColorVisual : VisualMap
1188     {
1189         public ColorVisual() : base()
1190         {
1191         }
1192
1193         private Color _mixColorForColorVisual = null;
1194
1195         /// <summary>
1196         /// Gets or sets the solid color required.<br>
1197         /// Mandatory.
1198         /// </summary>
1199         public Color Color
1200         {
1201             get
1202             {
1203                 return _mixColorForColorVisual;
1204             }
1205             set
1206             {
1207                 _mixColorForColorVisual = value;
1208                 UpdateVisual();
1209             }
1210         }
1211
1212         protected override void ComposingPropertyMap()
1213         {
1214             if (_mixColorForColorVisual != null)
1215             {
1216                 _outputVisualMap = new PropertyMap();
1217                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
1218                 _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(_mixColorForColorVisual));
1219                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1220                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1221                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1222             }
1223         }
1224     }
1225
1226     /// <summary>
1227     /// A class encapsulating the property map of the gradient visual.
1228     /// </summary>
1229     public class GradientVisual : VisualMap
1230     {
1231         public GradientVisual() : base()
1232         {
1233         }
1234
1235         private Vector2 _startPosition = null;
1236         private Vector2 _endPosition = null;
1237         private Vector2 _center = null;
1238         private float? _radius = null;
1239         private PropertyArray _stopOffset = null;
1240         private PropertyArray _stopColor = null;
1241         private GradientVisualUnitsType? _units = null;
1242         private GradientVisualSpreadMethodType? _spreadMethod = null;
1243
1244         /// <summary>
1245         /// Gets or sets the start position of a linear gradient.<br>
1246         /// Mandatory for linear.<br>
1247         /// </summary>
1248         public Vector2 StartPosition
1249         {
1250             get
1251             {
1252                 return _startPosition;
1253             }
1254             set
1255             {
1256                 _startPosition = value;
1257                 UpdateVisual();
1258             }
1259         }
1260
1261         /// <summary>
1262         /// Gets or sets the end position of a linear gradient.<br>
1263         /// Mandatory for linear.<br>
1264         /// </summary>
1265         public Vector2 EndPosition
1266         {
1267             get
1268             {
1269                 return _endPosition;
1270             }
1271             set
1272             {
1273                 _endPosition = value;
1274                 UpdateVisual();
1275             }
1276         }
1277
1278         /// <summary>
1279         /// Gets or sets the center point of a radial gradient.<br>
1280         /// Mandatory for radial.<br>
1281         /// </summary>
1282         public Vector2 Center
1283         {
1284             get
1285             {
1286                 return _center;
1287             }
1288             set
1289             {
1290                 _center = value;
1291                 UpdateVisual();
1292             }
1293         }
1294
1295         /// <summary>
1296         /// Gets or sets the size of the radius of a radial gradient.<br>
1297         /// Mandatory for radial.<br>
1298         /// </summary>
1299         public float Radius
1300         {
1301             get
1302             {
1303                 return _radius ?? (-1.0f);
1304             }
1305             set
1306             {
1307                 _radius = value;
1308                 UpdateVisual();
1309             }
1310         }
1311
1312         /// <summary>
1313         /// Gets or sets all the stop offsets.<br>
1314         /// A PropertyArray of float.<br>
1315         /// If not supplied, the default is 0.0f and 1.0f.<br>
1316         /// Optional.
1317         /// </summary>
1318         public PropertyArray StopOffset
1319         {
1320             get
1321             {
1322                 return _stopOffset;
1323             }
1324             set
1325             {
1326                 _stopOffset = value;
1327                 UpdateVisual();
1328             }
1329         }
1330
1331         /// <summary>
1332         /// Gets or sets the color at the stop offsets.<br>
1333         /// A PropertyArray of color.<br>
1334         /// At least 2 values are required to show a gradient.<br>
1335         /// Mandatory.
1336         /// </summary>
1337         public PropertyArray StopColor
1338         {
1339             get
1340             {
1341                 return _stopColor;
1342             }
1343             set
1344             {
1345                 _stopColor = value;
1346                 UpdateVisual();
1347             }
1348         }
1349
1350         /// <summary>
1351         /// Gets or sets descriptions of the coordinate system for certain attributes of the points in a gradient.<br>
1352         /// If not supplied, the default is GradientVisualUnitsType.ObjectBoundingBox.<br>
1353         /// Optional.
1354         /// </summary>
1355         public GradientVisualUnitsType Units
1356         {
1357             get
1358             {
1359                 return _units ?? (GradientVisualUnitsType.ObjectBoundingBox);
1360             }
1361             set
1362             {
1363                 _units = value;
1364                 UpdateVisual();
1365             }
1366         }
1367
1368         /// <summary>
1369         /// Gets or sets indications of what happens if the gradient starts or ends inside the bounds of the target rectangle.<br>
1370         /// If not supplied, the default is GradientVisualSpreadMethodType.Pad.<br>
1371         /// Optional.
1372         /// </summary>
1373         public GradientVisualSpreadMethodType SpreadMethod
1374         {
1375             get
1376             {
1377                 return _spreadMethod ?? (GradientVisualSpreadMethodType.Pad);
1378             }
1379             set
1380             {
1381                 _spreadMethod = value;
1382                 UpdateVisual();
1383             }
1384         }
1385
1386         protected override void ComposingPropertyMap()
1387         {
1388             if (((_startPosition != null && _endPosition != null) || (_center != null && _radius != null)) && _stopColor != null)
1389             {
1390                 _outputVisualMap = new PropertyMap();
1391                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Gradient));
1392                 _outputVisualMap.Add(GradientVisualProperty.StopColor, new PropertyValue(_stopColor));
1393                 if (_startPosition != null) { _outputVisualMap.Add(GradientVisualProperty.StartPosition, new PropertyValue(_startPosition)); }
1394                 if (_endPosition != null) { _outputVisualMap.Add(GradientVisualProperty.EndPosition, new PropertyValue(_endPosition)); }
1395                 if (_center != null) { _outputVisualMap.Add(GradientVisualProperty.Center, new PropertyValue(_center)); }
1396                 if (_radius != null) { _outputVisualMap.Add(GradientVisualProperty.Radius, new PropertyValue((float)_radius)); }
1397                 if (_stopOffset != null) { _outputVisualMap.Add(GradientVisualProperty.StopOffset, new PropertyValue(_stopOffset)); }
1398                 if (_units != null) { _outputVisualMap.Add(GradientVisualProperty.Units, new PropertyValue((int)_units)); }
1399                 if (_spreadMethod != null) { _outputVisualMap.Add(GradientVisualProperty.SpreadMethod, new PropertyValue((int)_spreadMethod)); }
1400                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1401                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1402                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1403                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1404             }
1405         }
1406     }
1407
1408     /// <summary>
1409     /// A class encapsulating the property map of the mesh visual.
1410     /// </summary>
1411     public class MeshVisual : VisualMap
1412     {
1413         public MeshVisual() : base()
1414         {
1415         }
1416
1417         private string _objectURL = null;
1418         private string _materialtURL = null;
1419         private string _texturesPath = null;
1420         private MeshVisualShadingModeValue? _shadingMode = null;
1421         private bool? _useMipmapping = null;
1422         private bool? _useSoftNormals = null;
1423         private Vector3 _lightPosition = null;
1424
1425         /// <summary>
1426         /// Gets or sets the location of the ".obj" file.<br>
1427         /// Mandatory.
1428         /// </summary>
1429         public string ObjectURL
1430         {
1431             get
1432             {
1433                 return _objectURL;
1434             }
1435             set
1436             {
1437                 _objectURL = value;
1438                 UpdateVisual();
1439             }
1440         }
1441
1442         /// <summary>
1443         /// Gets or sets the location of the ".mtl" file.<br>
1444         /// If not specified, then a textureless object is assumed.<br>
1445         /// Optional.
1446         /// </summary>
1447         public string MaterialtURL
1448         {
1449             get
1450             {
1451                 return _materialtURL;
1452             }
1453             set
1454             {
1455                 _materialtURL = value;
1456                 UpdateVisual();
1457             }
1458         }
1459
1460         /// <summary>
1461         /// Gets or sets the path to the directory the textures (including gloss and normal) are stored in.<br>
1462         /// Mandatory if using material.<br>
1463         /// </summary>
1464         public string TexturesPath
1465         {
1466             get
1467             {
1468                 return _texturesPath;
1469             }
1470             set
1471             {
1472                 _texturesPath = value;
1473                 UpdateVisual();
1474             }
1475         }
1476
1477         /// <summary>
1478         /// Gets or sets the type of shading mode that the mesh will use.<br>
1479         /// If anything the specified shading mode requires is missing, a simpler mode that can be handled with what has been supplied will be used instead.<br>
1480         /// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting first).<br>
1481         /// Optional.
1482         /// </summary>
1483         public MeshVisualShadingModeValue ShadingMode
1484         {
1485             get
1486             {
1487                 return _shadingMode ?? (MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting);
1488             }
1489             set
1490             {
1491                 _shadingMode = value;
1492                 UpdateVisual();
1493             }
1494         }
1495
1496         /// <summary>
1497         /// Gets or sets whether to use mipmaps for textures or not.<br>
1498         /// If not specified, the default is true.<br>
1499         /// Optional.
1500         /// </summary>
1501         public bool UseMipmapping
1502         {
1503             get
1504             {
1505                 return _useMipmapping ?? (true);
1506             }
1507             set
1508             {
1509                 _useMipmapping = value;
1510                 UpdateVisual();
1511             }
1512         }
1513
1514         /// <summary>
1515         /// Gets or sets whether to average normals at each point to smooth textures or not.<br>
1516         /// If not specified, the default is true.<br>
1517         /// Optional.
1518         /// </summary>
1519         public bool UseSoftNormals
1520         {
1521             get
1522             {
1523                 return _useSoftNormals ?? (true);
1524             }
1525             set
1526             {
1527                 _useSoftNormals = value;
1528                 UpdateVisual();
1529             }
1530         }
1531
1532         /// <summary>
1533         /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.<br>
1534         /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center,
1535         /// and using all zeroes will place the light at the top-left corner.<br>
1536         /// If not specified, the default is an offset outwards from the center of the screen.<br>
1537         /// Optional.
1538         /// </summary>
1539         public Vector3 LightPosition
1540         {
1541             get
1542             {
1543                 return _lightPosition;
1544             }
1545             set
1546             {
1547                 _lightPosition = value;
1548                 UpdateVisual();
1549             }
1550         }
1551
1552         protected override void ComposingPropertyMap()
1553         {
1554             if (_objectURL != null)
1555             {
1556                 _outputVisualMap = new PropertyMap();
1557                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Mesh));
1558                 _outputVisualMap.Add(MeshVisualProperty.ObjectURL, new PropertyValue(_objectURL));
1559                 if (_materialtURL != null) { _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, new PropertyValue(_materialtURL)); }
1560                 if (_texturesPath != null) { _outputVisualMap.Add(MeshVisualProperty.TexturesPath, new PropertyValue(_texturesPath)); }
1561                 if (_shadingMode != null) { _outputVisualMap.Add(MeshVisualProperty.ShadingMode, new PropertyValue((int)_shadingMode)); }
1562                 if (_useMipmapping != null) { _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, new PropertyValue((bool)_useMipmapping)); }
1563                 if (_useSoftNormals != null) { _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, new PropertyValue((bool)_useSoftNormals)); }
1564                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1565                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1566                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1567                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1568             }
1569         }
1570     }
1571
1572     /// <summary>
1573     /// A class encapsulating the property map of the primetive visual.
1574     /// </summary>
1575     public class PrimitiveVisual : VisualMap
1576     {
1577         public PrimitiveVisual() : base()
1578         {
1579         }
1580
1581         private PrimitiveVisualShapeType? _shape = null;
1582         private Color _mixColorForPrimitiveVisual = null;
1583         private int? _slices = null;
1584         private int? _stacks = null;
1585         private float? _scaleTopRadius = null;
1586         private float? _scaleBottomRadius = null;
1587         private float? _scaleHeight = null;
1588         private float? _scaleRadius = null;
1589         private Vector3 _scaleDimensions = null;
1590         private float? _bevelPercentage = null;
1591         private float? _bevelSmoothness = null;
1592         private Vector3 _lightPosition = null;
1593
1594         /// <summary>
1595         /// Gets or sets the specific shape to render.<br>
1596         /// If not specified, the default is PrimitiveVisualShapeType.Sphere.<br>
1597         /// Optional.
1598         /// </summary>
1599         public PrimitiveVisualShapeType Shape
1600         {
1601             get
1602             {
1603                 return _shape ?? (PrimitiveVisualShapeType.Sphere);
1604             }
1605             set
1606             {
1607                 _shape = value;
1608                 UpdateVisual();
1609             }
1610         }
1611
1612         /// <summary>
1613         /// Gets or sets the color of the shape.<br>
1614         /// If not specified, the default is Color (0.5, 0.5, 0.5, 1.0).<br>
1615         /// Applies to all shapes.<br>
1616         /// Optional.
1617         /// </summary>
1618         public Color MixColor
1619         {
1620             get
1621             {
1622                 return _mixColorForPrimitiveVisual ?? (new Color(0.5f, 0.5f, 0.5f, 1.0f));
1623             }
1624             set
1625             {
1626                 _mixColorForPrimitiveVisual = value;
1627                 UpdateVisual();
1628             }
1629         }
1630
1631         /// <summary>
1632         /// Gets or sets the number of slices as you go around the shape.<br>
1633         /// For spheres and conical frustrums, this determines how many divisions there are as you go around the object.<br>
1634         /// If not specified, the default is 128.<br>
1635         /// The range is from 1 to 255.<br>
1636         /// Optional.
1637         /// </summary>
1638         public int Slices
1639         {
1640             get
1641             {
1642                 return _slices ?? (128);
1643             }
1644             set
1645             {
1646                 _slices = value;
1647                 UpdateVisual();
1648             }
1649         }
1650
1651         /// <summary>
1652         /// Gets or sets the number of stacks as you go down the shape.<br>
1653         /// For spheres, 'stacks' determines how many layers there are as you go down the object.<br>
1654         /// If not specified, the default is 128.<br>
1655         /// The range is from 1 to 255.<br>
1656         /// Optional.
1657         /// </summary>
1658         public int Stacks
1659         {
1660             get
1661             {
1662                 return _stacks ?? (128);
1663             }
1664             set
1665             {
1666                 _stacks = value;
1667                 UpdateVisual();
1668             }
1669         }
1670
1671         /// <summary>
1672         /// Gets or sets the scale of the radius of the top circle of a conical frustrum.<br>
1673         /// If not specified, the default is 1.0f.<br>
1674         /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br>
1675         /// Only values greater than or equal to 0.0f are accepted.<br>
1676         /// Optional.
1677         /// </summary>
1678         public float ScaleTopRadius
1679         {
1680             get
1681             {
1682                 return _scaleTopRadius ?? (1.0f);
1683             }
1684             set
1685             {
1686                 _scaleTopRadius = value;
1687                 UpdateVisual();
1688             }
1689         }
1690
1691         /// <summary>
1692         /// Gets or sets the scale of the radius of the bottom circle of a conical frustrum.<br>
1693         /// If not specified, the default is 1.5f.<br>
1694         /// Applies to:  - PrimitiveVisualShapeType.ConicalFrustrum<br>
1695         ///              - PrimitiveVisualShapeType.Cone<br>
1696         /// Only values greater than or equal to 0.0f are accepted.<br>
1697         /// Optional.
1698         /// </summary>
1699         public float ScaleBottomRadius
1700         {
1701             get
1702             {
1703                 return _scaleBottomRadius ?? (1.5f);
1704             }
1705             set
1706             {
1707                 _scaleBottomRadius = value;
1708                 UpdateVisual();
1709             }
1710         }
1711
1712         /// <summary>
1713         /// Gets or sets the scale of the height of a conic.<br>
1714         /// If not specified, the default is 3.0f.<br>
1715         /// Applies to:<br>
1716         ///      - PrimitiveVisualShapeType.ConicalFrustrum<br>
1717         ///      - PrimitiveVisualShapeType.Cone<br>
1718         ///      - PrimitiveVisualShapeType.Cylinder<br>
1719         /// Only values greater than or equal to 0.0f are accepted.<br>
1720         /// Optional.
1721         /// </summary>
1722         public float ScaleHeight
1723         {
1724             get
1725             {
1726                 return _scaleHeight ?? (3.0f);
1727             }
1728             set
1729             {
1730                 _scaleHeight = value;
1731                 UpdateVisual();
1732             }
1733         }
1734
1735         /// <summary>
1736         /// Gets or sets the scale of the radius of a cylinder.<br>
1737         /// If not specified, the default is 1.0f.<br>
1738         /// Applies to:<br>
1739         ///      - PrimitiveVisualShapeType.Cylinder<br>
1740         /// Only values greater than or equal to 0.0f are accepted.<br>
1741         /// Optional.
1742         /// </summary>
1743         public float ScaleRadius
1744         {
1745             get
1746             {
1747                 return _scaleRadius ?? (1.0f);
1748             }
1749             set
1750             {
1751                 _scaleRadius = value;
1752                 UpdateVisual();
1753             }
1754         }
1755
1756         /// <summary>
1757         /// Gets or sets the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.<br>
1758         /// If not specified, the default is Vector3.One.<br>
1759         /// Applies to:<br>
1760         ///      - PrimitiveVisualShapeType.Cube<br>
1761         ///      - PrimitiveVisualShapeType.Octahedron<br>
1762         ///      - PrimitiveVisualShapeType.BevelledCube<br>
1763         /// Each Vector3 parameter should be greater than or equal to 0.0f.<br>
1764         /// Optional.
1765         /// </summary>
1766         public Vector3 ScaleDimensions
1767         {
1768             get
1769             {
1770                 return _scaleDimensions ?? (Vector3.One);
1771             }
1772             set
1773             {
1774                 _scaleDimensions = value;
1775                 UpdateVisual();
1776             }
1777         }
1778
1779         /// <summary>
1780         /// Gets or sets determines how bevelled the cuboid should be, based off the smallest dimension.<br>
1781         /// Bevel percentage ranges from 0.0 to 1.0. It affects the ratio of the outer face widths to the width of the overall cube.<br>
1782         /// If not specified, the default is 0.0f (no bevel).<br>
1783         /// Applies to:<br>
1784         ///      - PrimitiveVisualShapeType.BevelledCube<br>
1785         /// The range is from 0.0f to 1.0f.<br>
1786         /// Optional.
1787         /// </summary>
1788         public float BevelPercentage
1789         {
1790             get
1791             {
1792                 return _bevelPercentage ?? (0.0f);
1793             }
1794             set
1795             {
1796                 _bevelPercentage = value;
1797                 UpdateVisual();
1798             }
1799         }
1800
1801         /// <summary>
1802         /// Gets or sets descriptions of how smooth the bevelled edges should be.<br>
1803         /// If not specified, the default is 0.0f (sharp edges).<br>
1804         /// Applies to:<br>
1805         ///      - PrimitiveVisualShapeType.BevelledCube<br>
1806         /// The range is from 0.0f to 1.0f.<br>
1807         /// Optional.
1808         /// </summary>
1809         public float BevelSmoothness
1810         {
1811             get
1812             {
1813                 return _bevelSmoothness ?? (0.0f);
1814             }
1815             set
1816             {
1817                 _bevelSmoothness = value;
1818                 UpdateVisual();
1819             }
1820         }
1821
1822         /// <summary>
1823         /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.<br>
1824         /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center,
1825         /// and using all zeroes will place the light at the top-left corner.<br>
1826         /// If not specified, the default is an offset outwards from the center of the screen.<br>
1827         /// Applies to all shapes.<br>
1828         /// Optional.
1829         /// </summary>
1830         public Vector3 LightPosition
1831         {
1832             get
1833             {
1834                 return _lightPosition;
1835             }
1836             set
1837             {
1838                 _lightPosition = value;
1839                 UpdateVisual();
1840             }
1841         }
1842
1843         protected override void ComposingPropertyMap()
1844         {
1845             _outputVisualMap = new PropertyMap(); ;
1846             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Primitive));
1847             if (_shape != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Shape, new PropertyValue((int)_shape)); }
1848             if (_mixColorForPrimitiveVisual != null) { _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, new PropertyValue(_mixColorForPrimitiveVisual)); }
1849             if (_slices != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Slices, new PropertyValue((int)_slices)); }
1850             if (_stacks != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Stacks, new PropertyValue((int)_stacks)); }
1851             if (_scaleTopRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleTopRadius, new PropertyValue((float)_scaleTopRadius)); }
1852             if (_scaleBottomRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleBottomRadius, new PropertyValue((float)_scaleBottomRadius)); }
1853             if (_scaleHeight != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleHeight, new PropertyValue((float)_scaleHeight)); }
1854             if (_scaleRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleRadius, new PropertyValue((float)_scaleRadius)); }
1855             if (_scaleDimensions != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(_scaleDimensions)); }
1856             if (_bevelPercentage != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, new PropertyValue((float)_bevelPercentage)); }
1857             if (_bevelSmoothness != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, new PropertyValue((float)_bevelSmoothness)); }
1858             if (_lightPosition != null) { _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, new PropertyValue(_lightPosition)); }
1859             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1860             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1861             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1862         }
1863     }
1864
1865     /// <summary>
1866     /// A class encapsulating the property map of the n-patch image visual.
1867     /// </summary>
1868     public class NPatchVisual : VisualMap
1869     {
1870         public NPatchVisual() : base()
1871         {
1872         }
1873
1874         private string _url = null;
1875         private bool? _borderOnly = null;
1876         private Rectangle _border = null;
1877
1878         /// <summary>
1879         /// Gets or sets the URL of the image.<br>
1880         /// Mandatory.
1881         /// </summary>
1882         public string URL
1883         {
1884             get
1885             {
1886                 return _url;
1887             }
1888             set
1889             {
1890                 _url = value;
1891                 UpdateVisual();
1892             }
1893         }
1894
1895         /// <summary>
1896         /// Gets or sets whether to draw the borders only (If true).<br>
1897         /// If not specified, the default is false.<br>
1898         /// For n-patch images only.<br>
1899         /// Optional.
1900         /// </summary>
1901         public bool BorderOnly
1902         {
1903             get
1904             {
1905                 return _borderOnly ?? false;
1906             }
1907             set
1908             {
1909                 _borderOnly = value;
1910                 UpdateVisual();
1911             }
1912         }
1913
1914         /// <summary>
1915         /// The border of the image is in the order: left, right, bottom, top.<br>
1916         /// For n-patch images only.<br>
1917         /// Optional.
1918         /// </summary>
1919         public Rectangle Border
1920         {
1921             get
1922             {
1923                 return _border;
1924             }
1925             set
1926             {
1927                 _border = value;
1928                 UpdateVisual();
1929             }
1930         }
1931
1932         protected override void ComposingPropertyMap()
1933         {
1934             if (_url != null)
1935             {
1936                 _outputVisualMap = new PropertyMap();
1937                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
1938                 _outputVisualMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
1939                 if (_borderOnly != null) { _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
1940                 if (_border != null) { _outputVisualMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border)); }
1941                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1942                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1943                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1944                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1945             }
1946         }
1947     }
1948
1949     /// <summary>
1950     /// A class encapsulating the property map of the SVG visual.
1951     /// </summary>
1952     public class SVGVisual : VisualMap
1953     {
1954         public SVGVisual() : base()
1955         {
1956         }
1957
1958         private string _url = null;
1959
1960         public string URL
1961         {
1962             get
1963             {
1964                 return _url;
1965             }
1966             set
1967             {
1968                 _url = value;
1969                 UpdateVisual();
1970             }
1971         }
1972
1973         protected override void ComposingPropertyMap()
1974         {
1975             if (_url != null)
1976             {
1977                 _outputVisualMap = new PropertyMap();
1978                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG));
1979                 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
1980                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1981                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1982                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1983                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1984             }
1985         }
1986     }
1987
1988     /// <summary>
1989     /// A class encapsulating the property map of the animated image (AGIF) visual.
1990     /// </summary>
1991     public class AnimatedImageVisual : VisualMap
1992     {
1993         public AnimatedImageVisual() : base()
1994         {
1995         }
1996
1997         private List<string> _urls = null;
1998         private int? _batchSize = null;
1999         private int? _cacheSize = null;
2000         private float? _frameDelay = null;
2001
2002         public string URL
2003         {
2004             get
2005             {
2006                 if( _urls != null )
2007                 {
2008                     return _urls[0];
2009                 }
2010                 else
2011                 {
2012                     return null;
2013                 }
2014             }
2015             set
2016             {
2017                 if( _urls == null )
2018                 {
2019                     _urls = new List<string>();
2020                     _urls.Add(value);
2021                 }
2022                 else
2023                 {
2024                     _urls[0] = value;
2025                 }
2026                 UpdateVisual();
2027             }
2028         }
2029
2030         public List<string> URLS
2031         {
2032             get
2033             {
2034                 return _urls;
2035             }
2036             set
2037             {
2038                 _urls = value;
2039                 UpdateVisual();
2040             }
2041         }
2042
2043         public int BatchSize
2044         {
2045             get
2046             {
2047                 return _batchSize ?? 1;
2048             }
2049             set
2050             {
2051                 _batchSize = value;
2052                 UpdateVisual();
2053             }
2054         }
2055
2056         public int CacheSize
2057         {
2058             get
2059             {
2060                 return _cacheSize ?? 1;
2061             }
2062             set
2063             {
2064                 _cacheSize = value;
2065                 UpdateVisual();
2066             }
2067         }
2068         public float FrameDelay
2069         {
2070             get
2071             {
2072                 return _frameDelay ?? 0.1f;
2073             }
2074             set
2075             {
2076                 _frameDelay = value;
2077                 UpdateVisual();
2078             }
2079         }
2080
2081         protected override void ComposingPropertyMap()
2082         {
2083             if (_urls != null)
2084             {
2085                 _outputVisualMap = new PropertyMap();
2086                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
2087                 if( _urls.Count == 1 )
2088                 {
2089                     _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_urls[0]));
2090                 }
2091                 else
2092                 {
2093                     var urlArray = new PropertyArray();
2094                     foreach( var url in _urls)
2095                     {
2096                         urlArray.Add(new PropertyValue(url));
2097                     }
2098                     _outputVisualMap.Add( ImageVisualProperty.URL, ( new PropertyValue( urlArray ) ) );
2099                 }
2100                 if (_batchSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.BatchSize, new PropertyValue((int)_batchSize)); }
2101                 if (_cacheSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.CacheSize, new PropertyValue((int)_cacheSize)); }
2102                 if (_frameDelay != null ) {_outputVisualMap.Add((int)ImageVisualProperty.FrameDelay, new PropertyValue((float)_frameDelay)); }
2103                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2104                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2105                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2106                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2107             }
2108         }
2109     }
2110
2111
2112
2113     //temporary fix for TCT
2114     public class VisualAnimator : VisualMap
2115     {
2116         public VisualAnimator() : base()
2117         {
2118         }
2119
2120         private string _alphaFunction = null;
2121         private int _startTime = 0;
2122         private int _endTime = 0;
2123         private string _target = null;
2124         private string _propertyIndex = null;
2125         private object _destinationValue = null;
2126
2127         public AlphaFunction.BuiltinFunctions AlphaFunction
2128         {
2129             get
2130             {
2131                 switch (_alphaFunction)
2132                 {
2133                     case "LINEAR":
2134                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear;
2135                     case "REVERSE":
2136                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse;
2137                     case "EASE_IN_SQUARE":
2138                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare;
2139                     case "EASE_OUT_SQUARE":
2140                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare;
2141                     case "EASE_IN":
2142                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn;
2143                     case "EASE_OUT":
2144                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut;
2145                     case "EASE_IN_OUT":
2146                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut;
2147                     case "EASE_IN_SINE":
2148                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine;
2149                     case "EASE_OUT_SINE":
2150                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine;
2151                     case "EASE_IN_OUT_SINE":
2152                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine;
2153                     case "BOUNCE":
2154                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce;
2155                     case "SIN":
2156                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin;
2157                     case "EASE_OUT_BACK":
2158                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack;
2159                     default:
2160                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Default;
2161                 }
2162             }
2163             set
2164             {
2165                 switch (value)
2166                 {
2167                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear:
2168                         {
2169                             _alphaFunction = "LINEAR";
2170                             break;
2171                         }
2172                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse:
2173                         {
2174                             _alphaFunction = "REVERSE";
2175                             break;
2176                         }
2177                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare:
2178                         {
2179                             _alphaFunction = "EASE_IN_SQUARE";
2180                             break;
2181                         }
2182                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare:
2183                         {
2184                             _alphaFunction = "EASE_OUT_SQUARE";
2185                             break;
2186                         }
2187                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn:
2188                         {
2189                             _alphaFunction = "EASE_IN";
2190                             break;
2191                         }
2192                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut:
2193                         {
2194                             _alphaFunction = "EASE_OUT";
2195                             break;
2196                         }
2197                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut:
2198                         {
2199                             _alphaFunction = "EASE_IN_OUT";
2200                             break;
2201                         }
2202                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine:
2203                         {
2204                             _alphaFunction = "EASE_IN_SINE";
2205                             break;
2206                         }
2207                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine:
2208                         {
2209                             _alphaFunction = "EASE_OUT_SINE";
2210                             break;
2211                         }
2212                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine:
2213                         {
2214                             _alphaFunction = "EASE_IN_OUT_SINE";
2215                             break;
2216                         }
2217                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce:
2218                         {
2219                             _alphaFunction = "BOUNCE";
2220                             break;
2221                         }
2222                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin:
2223                         {
2224                             _alphaFunction = "SIN";
2225                             break;
2226                         }
2227                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack:
2228                         {
2229                             _alphaFunction = "EASE_OUT_BACK";
2230                             break;
2231                         }
2232                     default:
2233                         {
2234                             _alphaFunction = "DEFAULT";
2235                             break;
2236                         }
2237                 }
2238             }
2239         }
2240
2241         public int StartTime
2242         {
2243             get
2244             {
2245                 return _startTime;
2246             }
2247             set
2248             {
2249                 _startTime = value;
2250             }
2251         }
2252
2253         public int EndTime
2254         {
2255             get
2256             {
2257                 return _endTime;
2258             }
2259             set
2260             {
2261                 _endTime = value;
2262             }
2263         }
2264
2265         public string Target
2266         {
2267             get
2268             {
2269                 return _target;
2270             }
2271             set
2272             {
2273                 _target = value;
2274             }
2275         }
2276
2277         public string PropertyIndex
2278         {
2279             get
2280             {
2281                 return _propertyIndex;
2282             }
2283             set
2284             {
2285                 _propertyIndex = value;
2286             }
2287         }
2288
2289         public object DestinationValue
2290         {
2291             get
2292             {
2293                 return _destinationValue;
2294             }
2295             set
2296             {
2297                 _destinationValue = value;
2298             }
2299         }
2300
2301         protected override void ComposingPropertyMap()
2302         {
2303             PropertyMap _animator = new PropertyMap();
2304             _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
2305
2306             PropertyMap _timePeriod = new PropertyMap();
2307             _timePeriod.Add("duration", new PropertyValue((_endTime - _startTime) / 1000.0f));
2308             _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
2309             _animator.Add("timePeriod", new PropertyValue(_timePeriod));
2310
2311             StringBuilder sb = new StringBuilder(_propertyIndex);
2312             sb[0] = (char)(sb[0] | 0x20);
2313             string _str = sb.ToString();
2314
2315             PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
2316
2317             PropertyMap _transition = new PropertyMap();
2318             _transition.Add("target", new PropertyValue(_target));
2319             _transition.Add("property", new PropertyValue(_str));
2320             _transition.Add("targetValue", val);
2321             _transition.Add("animator", new PropertyValue(_animator));
2322
2323             _outputVisualMap = _transition;
2324         }
2325     }
2326     //temporary fix for TCT
2327
2328
2329
2330 }