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