1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 using System.Collections.Generic;
20 using Tizen.NUI.BaseComponents;
23 /// A class encapsulating the transform map of the visual.
25 public class VisualMap
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;
34 private PropertyMap _visualTransformMap = null;
36 private int? _depthIndex = null;
37 protected PropertyMap _outputVisualMap = null;
45 internal int VisualIndex
51 internal VisualView Parent
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>
71 return _visualSize ?? (new Size2D(1, 1));
76 if (_visualSizePolicy == null)
78 _visualSizePolicy = new Vector2(1.0f, 1.0f);
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>
90 public Vector2 Position
94 return _visualOffset ?? (new Vector2(0.0f, 0.0f));
98 _visualOffset = value;
99 if (_visualOffsetPolicy == null)
101 _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
108 /// Gets or sets the relative size of the visual<br>
109 /// (percentage [0.0f to 1.0f] of the control).<br>
112 public RelativeVector2 RelativeSize
116 return _visualSize ?? (new RelativeVector2(1.0f, 1.0f));
121 _visualSizePolicy = new Vector2(0.0f, 0.0f);
127 /// Gets or sets the relative offset of the visual<br>
128 /// (percentage [0.0f to 1.0f] of the control).<br>
131 public RelativeVector2 RelativePosition
135 return _visualOffset ?? (new RelativeVector2(0.0f, 0.0f));
139 _visualOffset = value;
140 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
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>
151 public VisualTransformPolicyType PositionPolicy
155 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f
156 && _visualOffsetPolicy.Y == 1.0f)
158 return VisualTransformPolicyType.Absolute;
160 return VisualTransformPolicyType.Relative;
166 case VisualTransformPolicyType.Relative:
167 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
169 case VisualTransformPolicyType.Absolute:
170 _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
173 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
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>
186 public VisualTransformPolicyType PositionPolicyX
190 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f)
192 return VisualTransformPolicyType.Absolute;
194 return VisualTransformPolicyType.Relative;
198 if (_visualOffsetPolicy == null)
200 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
205 case VisualTransformPolicyType.Relative:
206 _visualOffsetPolicy.X = 0.0f;
208 case VisualTransformPolicyType.Absolute:
209 _visualOffsetPolicy.X = 1.0f;
212 _visualOffsetPolicy.X = 0.0f;
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>
226 public VisualTransformPolicyType PositionPolicyY
230 if (_visualOffsetPolicy != null && _visualOffsetPolicy.Y == 1.0f)
232 return VisualTransformPolicyType.Absolute;
234 return VisualTransformPolicyType.Relative;
238 if (_visualOffsetPolicy == null)
240 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
245 case VisualTransformPolicyType.Relative:
246 _visualOffsetPolicy.Y = 0.0f;
248 case VisualTransformPolicyType.Absolute:
249 _visualOffsetPolicy.Y = 1.0f;
252 _visualOffsetPolicy.Y = 0.0f;
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>
265 public VisualTransformPolicyType SizePolicy
269 if (_visualSizePolicy != null && _visualSizePolicy.X == 1.0f
270 && _visualSizePolicy.Y == 1.0f)
272 return VisualTransformPolicyType.Absolute;
274 return VisualTransformPolicyType.Relative;
280 case VisualTransformPolicyType.Relative:
281 _visualSizePolicy = new Vector2(0.0f, 0.0f);
283 case VisualTransformPolicyType.Absolute:
284 _visualSizePolicy = new Vector2(1.0f, 1.0f);
287 _visualSizePolicy = new Vector2(0.0f, 0.0f);
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>
300 public VisualTransformPolicyType SizePolicyWidth
304 if (_visualSizePolicy != null && _visualSizePolicy.Width == 1.0f)
306 return VisualTransformPolicyType.Absolute;
308 return VisualTransformPolicyType.Relative;
312 if (_visualSizePolicy == null)
314 _visualSizePolicy = new Vector2(0.0f, 0.0f);
319 case VisualTransformPolicyType.Relative:
320 _visualSizePolicy.Width = 0.0f;
322 case VisualTransformPolicyType.Absolute:
323 _visualSizePolicy.Width = 1.0f;
326 _visualSizePolicy.Width = 0.0f;
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>
339 public VisualTransformPolicyType SizePolicyHeight
343 if (_visualSizePolicy != null && _visualSizePolicy.Height == 1.0f)
345 return VisualTransformPolicyType.Absolute;
347 return VisualTransformPolicyType.Relative;
351 if (_visualSizePolicy == null)
353 _visualSizePolicy = new Vector2(0.0f, 0.0f);
358 case VisualTransformPolicyType.Relative:
359 _visualSizePolicy.Height = 0.0f;
361 case VisualTransformPolicyType.Absolute:
362 _visualSizePolicy.Height = 1.0f;
365 _visualSizePolicy.Height = 0.0f;
373 /// Gets or sets the origin of the visual within its control area.<br>
374 /// By default, the origin is center.<br>
377 public Visual.AlignType Origin
381 return _visualOrigin ?? (Visual.AlignType.Center);
385 _visualOrigin = value;
391 /// Gets or sets the anchor point of the visual.<br>
392 /// By default, the anchor point is center.<br>
395 public Visual.AlignType AnchorPoint
399 return _visualAnchorPoint ?? (Visual.AlignType.Center);
403 _visualAnchorPoint = value;
409 /// Gets or sets the depth index of the visual.<br>
410 /// By default, the depth index is 0.<br>
413 public int DepthIndex
417 return _depthIndex ?? (0);
425 private void ComposingTransformMap()
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)); }
437 /// Gets the transform map used by the visual.
439 public PropertyMap OutputTransformMap
443 ComposingTransformMap();
444 return _visualTransformMap;
448 protected virtual void ComposingPropertyMap()
450 _outputVisualMap = new PropertyMap();
454 /// Gets the property map to create the visual.
456 public PropertyMap OutputVisualMap
460 ComposingPropertyMap();
461 return _outputVisualMap;
465 internal void UpdateVisual()
469 NUILog.Debug("UpdateVisual()! VisualIndex=" + VisualIndex);
470 Parent.UpdateVisual(VisualIndex, Name, this);
474 NUILog.Debug("VisualIndex was not set");
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;
486 /// The shader to use in the visual.
488 public PropertyMap Shader
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.
505 public bool PremultipliedAlpha
509 return _premultipliedAlpha ?? (false);
513 _premultipliedAlpha = value;
519 /// Mix color is a blend color for any visual.
521 public Color MixColor
535 /// Opacity is the alpha component of the mix color discussed above.
541 return _opacity ?? (1.0f);
553 /// A class encapsulating the property map of the image visual.
555 public class ImageVisual : VisualMap
557 public ImageVisual() : base()
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;
576 /// Gets or sets the URL of the image.<br>
595 /// Gets or sets the URL of the alpha mask.<br>
598 public string AlphaMaskURL
602 return _alphaMaskUrl;
606 _alphaMaskUrl = value;
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>
617 public FittingModeType FittingMode
621 return _fittingMode ?? (FittingModeType.ShrinkToFit);
625 _fittingMode = value;
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>
636 public SamplingModeType SamplingMode
640 return _samplingMode ?? (SamplingModeType.Box);
644 _samplingMode = value;
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>
655 public int DesiredWidth
659 return _desiredWidth ?? (-1);
663 _desiredWidth = value;
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>
674 public int DesiredHeight
678 return _desiredHeight ?? (-1);
682 _desiredHeight = value;
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>
693 public bool SynchronousLoading
697 return _synchronousLoading ?? (false);
701 _synchronousLoading = value;
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>
712 public bool BorderOnly
716 return _borderOnly ?? (false);
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>
733 public Vector4 PixelArea
737 return _pixelArea ?? (new Vector4(0.0f, 0.0f, 1.0f, 1.0f));
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>
753 public WrapModeType WrapModeU
757 return _wrapModeU ?? (WrapModeType.Default);
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.
774 public WrapModeType WrapModeV
778 return _wrapModeV ?? (WrapModeType.Default);
787 public float MaskContentScale
791 return _maskContentScale ?? 1.0f;
795 _maskContentScale = value;
800 public bool CropToMask
804 return _cropToMask ?? false;
813 protected override void ComposingPropertyMap()
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)); }
841 /// A class encapsulating the property map of the text visual.
843 public class TextVisual : VisualMap
845 public TextVisual() : base()
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;
860 /// Gets or sets the text to display in the UTF-8 format.<br>
877 /// Gets or sets the requested font family to use.<br>
880 public string FontFamily
894 /// Gets or sets the requested font style to use.<br>
897 public PropertyMap FontStyle
911 /// Gets or sets the size of font in points.<br>
914 public float PointSize
918 return _pointSize ?? (0.0f);
928 /// Gets or sets the single-line or multi-line layout option.<br>
929 /// If not specified, the default is false.<br>
932 public bool MultiLine
936 return _multiLine ?? (false);
946 /// Gets or sets the line horizontal alignment.<br>
947 /// If not specified, the default is begin.<br>
950 public HorizontalAlignment HorizontalAlignment
954 switch (_horizontalAlignment)
957 return HorizontalAlignment.Begin;
959 return HorizontalAlignment.Center;
961 return HorizontalAlignment.End;
963 return HorizontalAlignment.Begin;
970 case HorizontalAlignment.Begin:
972 _horizontalAlignment = "BEGIN";
975 case HorizontalAlignment.Center:
977 _horizontalAlignment = "CENTER";
980 case HorizontalAlignment.End:
982 _horizontalAlignment = "END";
987 _horizontalAlignment = "BEGIN";
996 /// Gets or sets the line vertical alignment.<br>
997 /// If not specified, the default is top.<br>
1000 public VerticalAlignment VerticalAlignment
1004 switch (_verticalAlignment)
1007 return VerticalAlignment.Top;
1009 return VerticalAlignment.Center;
1011 return VerticalAlignment.Bottom;
1013 return VerticalAlignment.Top;
1020 case VerticalAlignment.Top:
1022 _verticalAlignment = "TOP";
1025 case VerticalAlignment.Center:
1027 _verticalAlignment = "CENTER";
1030 case VerticalAlignment.Bottom:
1032 _verticalAlignment = "BOTTOM";
1037 _verticalAlignment = "TOP";
1046 /// Gets or sets the color of the text.<br>
1049 public Color TextColor
1063 /// Gets or sets whether the mark-up processing is enabled.<br>
1066 public bool EnableMarkup
1070 return _enableMarkup ?? (false);
1074 _enableMarkup = value;
1079 protected override void ComposingPropertyMap()
1081 if (_text != null && _pointSize != null)
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)); }
1103 /// A class encapsulating the property map of the border visual.
1105 public class BorderVisual : VisualMap
1107 public BorderVisual() : base()
1111 private Color _color = null;
1112 private float? _size = null;
1113 private bool? _antiAliasing = null;
1116 /// Gets or sets the color of the border.<br>
1133 /// Gets or sets the width of the border (in pixels).<br>
1136 public float BorderSize
1140 return _size ?? (-1.0f);
1150 /// Gets or sets whether the anti-aliasing of the border is required.<br>
1151 /// If not supplied, the default is false.<br>
1154 public bool AntiAliasing
1158 return _antiAliasing ?? (false);
1162 _antiAliasing = value;
1167 protected override void ComposingPropertyMap()
1169 if (_color != null && _size != null)
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)); }
1185 /// A class encapsulating the property map of the color visual.
1187 public class ColorVisual : VisualMap
1189 public ColorVisual() : base()
1193 private Color _mixColorForColorVisual = null;
1196 /// Gets or sets the solid color required.<br>
1203 return _mixColorForColorVisual;
1207 _mixColorForColorVisual = value;
1212 protected override void ComposingPropertyMap()
1214 if (_mixColorForColorVisual != null)
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)); }
1227 /// A class encapsulating the property map of the gradient visual.
1229 public class GradientVisual : VisualMap
1231 public GradientVisual() : base()
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;
1245 /// Gets or sets the start position of a linear gradient.<br>
1246 /// Mandatory for linear.<br>
1248 public Vector2 StartPosition
1252 return _startPosition;
1256 _startPosition = value;
1262 /// Gets or sets the end position of a linear gradient.<br>
1263 /// Mandatory for linear.<br>
1265 public Vector2 EndPosition
1269 return _endPosition;
1273 _endPosition = value;
1279 /// Gets or sets the center point of a radial gradient.<br>
1280 /// Mandatory for radial.<br>
1282 public Vector2 Center
1296 /// Gets or sets the size of the radius of a radial gradient.<br>
1297 /// Mandatory for radial.<br>
1303 return _radius ?? (-1.0f);
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>
1318 public PropertyArray StopOffset
1326 _stopOffset = value;
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>
1337 public PropertyArray StopColor
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>
1355 public GradientVisualUnitsType Units
1359 return _units ?? (GradientVisualUnitsType.ObjectBoundingBox);
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>
1373 public GradientVisualSpreadMethodType SpreadMethod
1377 return _spreadMethod ?? (GradientVisualSpreadMethodType.Pad);
1381 _spreadMethod = value;
1386 protected override void ComposingPropertyMap()
1388 if (((_startPosition != null && _endPosition != null) || (_center != null && _radius != null)) && _stopColor != null)
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)); }
1409 /// A class encapsulating the property map of the mesh visual.
1411 public class MeshVisual : VisualMap
1413 public MeshVisual() : base()
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;
1426 /// Gets or sets the location of the ".obj" file.<br>
1429 public string ObjectURL
1443 /// Gets or sets the location of the ".mtl" file.<br>
1444 /// If not specified, then a textureless object is assumed.<br>
1447 public string MaterialtURL
1451 return _materialtURL;
1455 _materialtURL = value;
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>
1464 public string TexturesPath
1468 return _texturesPath;
1472 _texturesPath = value;
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>
1483 public MeshVisualShadingModeValue ShadingMode
1487 return _shadingMode ?? (MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting);
1491 _shadingMode = value;
1497 /// Gets or sets whether to use mipmaps for textures or not.<br>
1498 /// If not specified, the default is true.<br>
1501 public bool UseMipmapping
1505 return _useMipmapping ?? (true);
1509 _useMipmapping = value;
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>
1519 public bool UseSoftNormals
1523 return _useSoftNormals ?? (true);
1527 _useSoftNormals = value;
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>
1539 public Vector3 LightPosition
1543 return _lightPosition;
1547 _lightPosition = value;
1552 protected override void ComposingPropertyMap()
1554 if (_objectURL != null)
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)); }
1573 /// A class encapsulating the property map of the primetive visual.
1575 public class PrimitiveVisual : VisualMap
1577 public PrimitiveVisual() : base()
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;
1595 /// Gets or sets the specific shape to render.<br>
1596 /// If not specified, the default is PrimitiveVisualShapeType.Sphere.<br>
1599 public PrimitiveVisualShapeType Shape
1603 return _shape ?? (PrimitiveVisualShapeType.Sphere);
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>
1618 public new Color MixColor
1622 return _mixColorForPrimitiveVisual ?? (new Color(0.5f, 0.5f, 0.5f, 1.0f));
1626 _mixColorForPrimitiveVisual = value;
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>
1642 return _slices ?? (128);
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>
1662 return _stacks ?? (128);
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>
1678 public float ScaleTopRadius
1682 return _scaleTopRadius ?? (1.0f);
1686 _scaleTopRadius = value;
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>
1699 public float ScaleBottomRadius
1703 return _scaleBottomRadius ?? (1.5f);
1707 _scaleBottomRadius = value;
1713 /// Gets or sets the scale of the height of a conic.<br>
1714 /// If not specified, the default is 3.0f.<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>
1722 public float ScaleHeight
1726 return _scaleHeight ?? (3.0f);
1730 _scaleHeight = value;
1736 /// Gets or sets the scale of the radius of a cylinder.<br>
1737 /// If not specified, the default is 1.0f.<br>
1739 /// - PrimitiveVisualShapeType.Cylinder<br>
1740 /// Only values greater than or equal to 0.0f are accepted.<br>
1743 public float ScaleRadius
1747 return _scaleRadius ?? (1.0f);
1751 _scaleRadius = value;
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>
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>
1766 public Vector3 ScaleDimensions
1770 return _scaleDimensions ?? (Vector3.One);
1774 _scaleDimensions = value;
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>
1784 /// - PrimitiveVisualShapeType.BevelledCube<br>
1785 /// The range is from 0.0f to 1.0f.<br>
1788 public float BevelPercentage
1792 return _bevelPercentage ?? (0.0f);
1796 _bevelPercentage = value;
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>
1805 /// - PrimitiveVisualShapeType.BevelledCube<br>
1806 /// The range is from 0.0f to 1.0f.<br>
1809 public float BevelSmoothness
1813 return _bevelSmoothness ?? (0.0f);
1817 _bevelSmoothness = value;
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>
1830 public Vector3 LightPosition
1834 return _lightPosition;
1838 _lightPosition = value;
1843 protected override void ComposingPropertyMap()
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)); }
1866 /// A class encapsulating the property map of the n-patch image visual.
1868 public class NPatchVisual : VisualMap
1870 public NPatchVisual() : base()
1874 private string _url = null;
1875 private bool? _borderOnly = null;
1876 private Rectangle _border = null;
1879 /// Gets or sets the URL of the image.<br>
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>
1901 public bool BorderOnly
1905 return _borderOnly ?? false;
1909 _borderOnly = value;
1915 /// The border of the image is in the order: left, right, bottom, top.<br>
1916 /// For n-patch images only.<br>
1919 public Rectangle Border
1932 protected override void ComposingPropertyMap()
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)); }
1950 /// A class encapsulating the property map of the SVG visual.
1952 public class SVGVisual : VisualMap
1954 public SVGVisual() : base()
1958 private string _url = null;
1973 protected override void ComposingPropertyMap()
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)); }
1989 /// A class encapsulating the property map of the animated image (AGIF) visual.
1991 public class AnimatedImageVisual : VisualMap
1993 public AnimatedImageVisual() : base()
1997 private List<string> _urls = null;
1998 private int? _batchSize = null;
1999 private int? _cacheSize = null;
2000 private float? _frameDelay = null;
2019 _urls = new List<string>();
2030 public List<string> URLS
2043 public int BatchSize
2047 return _batchSize ?? 1;
2056 public int CacheSize
2060 return _cacheSize ?? 1;
2068 public float FrameDelay
2072 return _frameDelay ?? 0.1f;
2076 _frameDelay = value;
2081 protected override void ComposingPropertyMap()
2085 _outputVisualMap = new PropertyMap();
2086 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
2087 if( _urls.Count == 1 )
2089 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_urls[0]));
2093 var urlArray = new PropertyArray();
2094 foreach( var url in _urls)
2096 urlArray.Add(new PropertyValue(url));
2098 _outputVisualMap.Add( ImageVisualProperty.URL, ( new PropertyValue( urlArray ) ) );
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)); }
2113 //temporary fix for TCT
2114 public class VisualAnimator : VisualMap
2116 public VisualAnimator() : base()
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;
2127 public AlphaFunction.BuiltinFunctions AlphaFunction
2131 switch (_alphaFunction)
2134 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear;
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;
2142 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn;
2144 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut;
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;
2154 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce;
2156 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin;
2157 case "EASE_OUT_BACK":
2158 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack;
2160 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Default;
2167 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear:
2169 _alphaFunction = "LINEAR";
2172 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse:
2174 _alphaFunction = "REVERSE";
2177 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare:
2179 _alphaFunction = "EASE_IN_SQUARE";
2182 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare:
2184 _alphaFunction = "EASE_OUT_SQUARE";
2187 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn:
2189 _alphaFunction = "EASE_IN";
2192 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut:
2194 _alphaFunction = "EASE_OUT";
2197 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut:
2199 _alphaFunction = "EASE_IN_OUT";
2202 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine:
2204 _alphaFunction = "EASE_IN_SINE";
2207 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine:
2209 _alphaFunction = "EASE_OUT_SINE";
2212 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine:
2214 _alphaFunction = "EASE_IN_OUT_SINE";
2217 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce:
2219 _alphaFunction = "BOUNCE";
2222 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin:
2224 _alphaFunction = "SIN";
2227 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack:
2229 _alphaFunction = "EASE_OUT_BACK";
2234 _alphaFunction = "DEFAULT";
2241 public int StartTime
2265 public string Target
2277 public string PropertyIndex
2281 return _propertyIndex;
2285 _propertyIndex = value;
2289 public object DestinationValue
2293 return _destinationValue;
2297 _destinationValue = value;
2301 protected override void ComposingPropertyMap()
2303 PropertyMap _animator = new PropertyMap();
2304 _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
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));
2311 StringBuilder sb = new StringBuilder(_propertyIndex);
2312 sb[0] = (char)(sb[0] | 0x20);
2313 string _str = sb.ToString();
2315 PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
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));
2323 _outputVisualMap = _transition;
2326 //temporary fix for TCT