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.
18 using System.Collections.Generic;
19 using Tizen.NUI.BaseComponents;
22 /// A class encapsulating the transform map of visual.
24 public class VisualMap
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;
33 private PropertyMap _visualTransformMap = null;
35 private int? _depthIndex = null;
36 protected PropertyMap _outputVisualMap = null;
44 internal int VisualIndex
50 internal VisualView Parent
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>
70 return _visualSize ?? (new Size2D(1, 1));
75 if (_visualSizePolicy == null)
77 _visualSizePolicy = new Vector2(0.0f, 0.0f);
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>
89 public Vector2 Position
93 return _visualOffset ?? (new Vector2(0.0f, 0.0f));
97 _visualOffset = value;
98 if (_visualOffsetPolicy == null)
100 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
107 /// Get or set relative size of the visual<br>
108 /// (percentage [0.0f to 1.0f] of the control).<br>
111 public RelativeVector2 RelativeSize
115 return _visualSize ?? (new RelativeVector2(1.0f, 1.0f));
120 _visualSizePolicy = new Vector2(0.0f, 0.0f);
126 /// Get or set relative offset of the visual<br>
127 /// (percentage [0.0f to 1.0f] of the control).<br>
130 public RelativeVector2 RelativePosition
134 return _visualOffset ?? (new RelativeVector2(0.0f, 0.0f));
138 _visualOffset = value;
139 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
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>
150 public VisualTransformPolicyType PositionPolicy
154 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f
155 && _visualOffsetPolicy.Y == 1.0f)
157 return VisualTransformPolicyType.Absolute;
159 return VisualTransformPolicyType.Relative;
165 case VisualTransformPolicyType.Relative:
166 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
168 case VisualTransformPolicyType.Absolute:
169 _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
172 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
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>
185 public VisualTransformPolicyType PositionPolicyX
189 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f)
191 return VisualTransformPolicyType.Absolute;
193 return VisualTransformPolicyType.Relative;
197 if (_visualOffsetPolicy == null)
199 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
204 case VisualTransformPolicyType.Relative:
205 _visualOffsetPolicy.X = 0.0f;
207 case VisualTransformPolicyType.Absolute:
208 _visualOffsetPolicy.X = 1.0f;
211 _visualOffsetPolicy.X = 0.0f;
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>
225 public VisualTransformPolicyType PositionPolicyY
229 if (_visualOffsetPolicy != null && _visualOffsetPolicy.Y == 1.0f)
231 return VisualTransformPolicyType.Absolute;
233 return VisualTransformPolicyType.Relative;
237 if (_visualOffsetPolicy == null)
239 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
244 case VisualTransformPolicyType.Relative:
245 _visualOffsetPolicy.Y = 0.0f;
247 case VisualTransformPolicyType.Absolute:
248 _visualOffsetPolicy.Y = 1.0f;
251 _visualOffsetPolicy.Y = 0.0f;
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>
264 public VisualTransformPolicyType SizePolicy
268 if (_visualSizePolicy != null && _visualSizePolicy.X == 1.0f
269 && _visualSizePolicy.Y == 1.0f)
271 return VisualTransformPolicyType.Absolute;
273 return VisualTransformPolicyType.Relative;
279 case VisualTransformPolicyType.Relative:
280 _visualSizePolicy = new Vector2(0.0f, 0.0f);
282 case VisualTransformPolicyType.Absolute:
283 _visualSizePolicy = new Vector2(1.0f, 1.0f);
286 _visualSizePolicy = new Vector2(0.0f, 0.0f);
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>
299 public VisualTransformPolicyType SizePolicyWidth
303 if (_visualSizePolicy != null && _visualSizePolicy.Width == 1.0f)
305 return VisualTransformPolicyType.Absolute;
307 return VisualTransformPolicyType.Relative;
311 if (_visualSizePolicy == null)
313 _visualSizePolicy = new Vector2(0.0f, 0.0f);
318 case VisualTransformPolicyType.Relative:
319 _visualSizePolicy.Width = 0.0f;
321 case VisualTransformPolicyType.Absolute:
322 _visualSizePolicy.Width = 1.0f;
325 _visualSizePolicy.Width = 0.0f;
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>
338 public VisualTransformPolicyType SizePolicyHeight
342 if (_visualSizePolicy != null && _visualSizePolicy.Height == 1.0f)
344 return VisualTransformPolicyType.Absolute;
346 return VisualTransformPolicyType.Relative;
350 if (_visualSizePolicy == null)
352 _visualSizePolicy = new Vector2(0.0f, 0.0f);
357 case VisualTransformPolicyType.Relative:
358 _visualSizePolicy.Height = 0.0f;
360 case VisualTransformPolicyType.Absolute:
361 _visualSizePolicy.Height = 1.0f;
364 _visualSizePolicy.Height = 0.0f;
372 /// Get or set the origin of the visual within its control area.<br>
373 /// By default, the origin is Center.<br>
376 public Visual.AlignType Origin
380 return _visualOrigin ?? (Visual.AlignType.Center);
384 _visualOrigin = value;
390 /// Get or set the anchor-point of the visual.<br>
391 /// By default, the anchor point is Center.<br>
394 public Visual.AlignType AnchorPoint
398 return _visualAnchorPoint ?? (Visual.AlignType.Center);
402 _visualAnchorPoint = value;
408 /// Get or set the depth index of the visual.<br>
409 /// By default, the depth index is 0.<br>
412 public int DepthIndex
416 return _depthIndex ?? (0);
424 private void ComposingTransformMap()
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)); }
436 /// Get the transform map used by the visual.
438 public PropertyMap OutputTransformMap
442 ComposingTransformMap();
443 return _visualTransformMap;
447 protected virtual void ComposingPropertyMap()
449 _outputVisualMap = new PropertyMap();
453 /// Get the property map to create the visual.
455 public PropertyMap OutputVisualMap
459 ComposingPropertyMap();
460 return _outputVisualMap;
464 internal void UpdateVisual()
468 NUILog.Debug("UpdateVisual()! VisualIndex=" + VisualIndex);
469 Parent.UpdateVisual(VisualIndex, Name, this);
473 NUILog.Debug("VisualIndex was not set");
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;
485 /// The shader to use in the visual.
487 public PropertyMap Shader
501 /// Enables/disables premultiplied alpha. <br>
502 /// The premultiplied alpha is false by default unless this behaviour is modified by the derived Visual type.
504 public bool PremultipliedAlpha
508 return _premultipliedAlpha ?? (false);
512 _premultipliedAlpha = value;
518 /// Mix color is a blend color for any visual.
520 public Color MixColor
534 /// Opacity is the alpha component of the mixColor, above.
540 return _opacity ?? (1.0f);
552 /// A class encapsulating the property map of a image visual.
554 public class ImageVisual : VisualMap
556 public ImageVisual() : base()
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;
575 /// Get or set the URL of the image.<br>
594 /// Get or set the URL of the alpha mask.<br>
597 public string AlphaMaskURL
601 return _alphaMaskUrl;
605 _alphaMaskUrl = value;
611 /// Get or set fitting options, used when resizing images to fit desired dimensions.<br>
612 /// If not supplied, default is FittingModeType.ShrinkToFit.<br>
613 /// For Normal Quad images only.<br>
616 public FittingModeType FittingMode
620 return _fittingMode ?? (FittingModeType.ShrinkToFit);
624 _fittingMode = value;
630 /// Get or set filtering options, used when resizing images to sample original pixels.<br>
631 /// If not supplied, default is SamplingModeType.Box.<br>
632 /// For Normal Quad images only.<br>
635 public SamplingModeType SamplingMode
639 return _samplingMode ?? (SamplingModeType.Box);
643 _samplingMode = value;
649 /// Get or set the desired image width.<br>
650 /// If not specified, the actual image width is used.<br>
651 /// For Normal Quad images only.<br>
654 public int DesiredWidth
658 return _desiredWidth ?? (-1);
662 _desiredWidth = value;
668 /// Get or set the desired image height.<br>
669 /// If not specified, the actual image height is used.<br>
670 /// For Normal Quad images only.<br>
673 public int DesiredHeight
677 return _desiredHeight ?? (-1);
681 _desiredHeight = value;
687 /// Get or set whether to load the image synchronously.<br>
688 /// If not specified, the default is false, i.e. the image is loaded asynchronously.<br>
689 /// For Normal Quad images only.<br>
692 public bool SynchronousLoading
696 return _synchronousLoading ?? (false);
700 _synchronousLoading = value;
706 /// Get or set whether to draws the borders only(If true).<br>
707 /// If not specified, the default is false.<br>
708 /// For N-Patch images only.<br>
711 public bool BorderOnly
715 return _borderOnly ?? (false);
725 /// Get or set the image area to be displayed.<br>
726 /// It is a rectangular area.<br>
727 /// 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>
728 /// 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>
729 /// For For Normal QUAD image only.<br>
732 public Vector4 PixelArea
736 return _pixelArea ?? (new Vector4(0.0f, 0.0f, 1.0f, 1.0f));
746 /// Get or set the wrap mode for u coordinate.<br>
747 /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.<br>
748 /// If not specified, the default is WrapModeType.Default(CLAMP).<br>
749 /// For Normal QUAD image only.<br>
752 public WrapModeType WrapModeU
756 return _wrapModeU ?? (WrapModeType.Default);
766 /// Get or set the wrap mode for v coordinate.<br>
767 /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.<br>
768 /// 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>
769 /// If not specified, the default is WrapModeType.Default(CLAMP).<br>
770 /// For Normal QUAD image only.
773 public WrapModeType WrapModeV
777 return _wrapModeV ?? (WrapModeType.Default);
786 public float MaskContentScale
790 return _maskContentScale ?? 1.0f;
794 _maskContentScale = value;
799 public bool CropToMask
803 return _cropToMask ?? false;
812 protected override void ComposingPropertyMap()
816 _outputVisualMap = new PropertyMap();
817 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
818 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
819 if (_alphaMaskUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AlphaMaskURL, new PropertyValue(_alphaMaskUrl)); }
820 if (_fittingMode != null) { _outputVisualMap.Add(ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode)); }
821 if (_samplingMode != null) { _outputVisualMap.Add(ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode)); }
822 if (_desiredWidth != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, new PropertyValue((int)_desiredWidth)); }
823 if (_desiredHeight != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredHeight, new PropertyValue((int)_desiredHeight)); }
824 if (_synchronousLoading != null) { _outputVisualMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
825 if (_borderOnly != null) { _outputVisualMap.Add(ImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
826 if (_pixelArea != null) { _outputVisualMap.Add(ImageVisualProperty.PixelArea, new PropertyValue(_pixelArea)); }
827 if (_wrapModeU != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeU, new PropertyValue((int)_wrapModeU)); }
828 if (_wrapModeV != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeV, new PropertyValue((int)_wrapModeV)); }
829 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
830 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
831 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
832 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
833 if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
834 if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
840 /// A class encapsulating the property map of a text visual.
842 public class TextVisual : VisualMap
844 public TextVisual() : base()
848 private string _text = null;
849 private string _fontFamily = null;
850 private PropertyMap _fontStyle = null;
851 private float? _pointSize = null;
852 private bool? _multiLine = null;
853 private string _horizontalAlignment = null;
854 private string _verticalAlignment = null;
855 private Color _textColor = null;
856 private bool? _enableMarkup = null;
859 /// Get or set the text to display in UTF-8 format.<br>
876 /// Get or set the requested font family to use.<br>
879 public string FontFamily
893 /// Get or set the requested font style to use.<br>
896 public PropertyMap FontStyle
910 /// Get or set the size of font in points.<br>
913 public float PointSize
917 return _pointSize ?? (0.0f);
927 /// Get or set the single-line or multi-line layout option.<br>
928 /// If not specified, the default is false.<br>
931 public bool MultiLine
935 return _multiLine ?? (false);
945 /// Get or set the line horizontal alignment.<br>
946 /// If not specified, the default is Begin.<br>
949 public HorizontalAlignment HorizontalAlignment
953 switch (_horizontalAlignment)
956 return HorizontalAlignment.Begin;
958 return HorizontalAlignment.Center;
960 return HorizontalAlignment.End;
962 return HorizontalAlignment.Begin;
969 case HorizontalAlignment.Begin:
971 _horizontalAlignment = "BEGIN";
974 case HorizontalAlignment.Center:
976 _horizontalAlignment = "CENTER";
979 case HorizontalAlignment.End:
981 _horizontalAlignment = "END";
986 _horizontalAlignment = "BEGIN";
995 /// Get or set the line vertical alignment.<br>
996 /// If not specified, the default is Top.<br>
999 public VerticalAlignment VerticalAlignment
1003 switch (_verticalAlignment)
1006 return VerticalAlignment.Top;
1008 return VerticalAlignment.Center;
1010 return VerticalAlignment.Bottom;
1012 return VerticalAlignment.Top;
1019 case VerticalAlignment.Top:
1021 _verticalAlignment = "TOP";
1024 case VerticalAlignment.Center:
1026 _verticalAlignment = "CENTER";
1029 case VerticalAlignment.Bottom:
1031 _verticalAlignment = "BOTTOM";
1036 _verticalAlignment = "TOP";
1045 /// Get or set the color of the text.<br>
1048 public Color TextColor
1062 /// Get or set whether the mark-up processing is enabled.<br>
1065 public bool EnableMarkup
1069 return _enableMarkup ?? (false);
1073 _enableMarkup = value;
1078 protected override void ComposingPropertyMap()
1080 if (_text != null && _pointSize != null)
1082 _outputVisualMap = new PropertyMap();
1083 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
1084 _outputVisualMap.Add(TextVisualProperty.Text, new PropertyValue(_text));
1085 _outputVisualMap.Add(TextVisualProperty.PointSize, new PropertyValue((float)_pointSize));
1086 if (_fontFamily != null) { _outputVisualMap.Add(TextVisualProperty.FontFamily, new PropertyValue(_fontFamily)); }
1087 if (_fontStyle != null) { _outputVisualMap.Add(TextVisualProperty.FontStyle, new PropertyValue(_fontStyle)); }
1088 if (_multiLine != null) { _outputVisualMap.Add(TextVisualProperty.MultiLine, new PropertyValue((bool)_multiLine)); }
1089 if (_horizontalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue(_horizontalAlignment)); }
1090 if (_verticalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, new PropertyValue(_verticalAlignment)); }
1091 if (_textColor != null) { _outputVisualMap.Add(TextVisualProperty.TextColor, new PropertyValue(_textColor)); }
1092 if (_enableMarkup != null) { _outputVisualMap.Add(TextVisualProperty.EnableMarkup, new PropertyValue((bool)_enableMarkup)); }
1093 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1094 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1095 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1096 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1102 /// A class encapsulating the property map of a border visual.
1104 public class BorderVisual : VisualMap
1106 public BorderVisual() : base()
1110 private Color _color = null;
1111 private float? _size = null;
1112 private bool? _antiAliasing = null;
1115 /// Get or set the color of the border.<br>
1132 /// Get or set the width of the border (in pixels).<br>
1135 public float BorderSize
1139 return _size ?? (-1.0f);
1149 /// Get or set whether anti-aliasing of the border is required.<br>
1150 /// If not supplied, default is false.<br>
1153 public bool AntiAliasing
1157 return _antiAliasing ?? (false);
1161 _antiAliasing = value;
1166 protected override void ComposingPropertyMap()
1168 if (_color != null && _size != null)
1170 _outputVisualMap = new PropertyMap();
1171 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Border));
1172 _outputVisualMap.Add(BorderVisualProperty.Size, new PropertyValue((float)_size));
1173 _outputVisualMap.Add(BorderVisualProperty.Color, new PropertyValue(_color));
1174 if (_antiAliasing != null) { _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, new PropertyValue((bool)_antiAliasing)); }
1175 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1176 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1177 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1178 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1184 /// A class encapsulating the property map of a color visual.
1186 public class ColorVisual : VisualMap
1188 public ColorVisual() : base()
1192 private Color _mixColorForColorVisual = null;
1195 /// Get or set the solid color required.<br>
1202 return _mixColorForColorVisual;
1206 _mixColorForColorVisual = value;
1211 protected override void ComposingPropertyMap()
1213 if (_mixColorForColorVisual != null)
1215 _outputVisualMap = new PropertyMap();
1216 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
1217 _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(_mixColorForColorVisual));
1218 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1219 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1220 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1226 /// A class encapsulating the property map of a gradient visual.
1228 public class GradientVisual : VisualMap
1230 public GradientVisual() : base()
1234 private Vector2 _startPosition = null;
1235 private Vector2 _endPosition = null;
1236 private Vector2 _center = null;
1237 private float? _radius = null;
1238 private PropertyArray _stopOffset = null;
1239 private PropertyArray _stopColor = null;
1240 private GradientVisualUnitsType? _units = null;
1241 private GradientVisualSpreadMethodType? _spreadMethod = null;
1244 /// Get or set the start position of a linear gradient.<br>
1245 /// Mandatory for Linear.<br>
1247 public Vector2 StartPosition
1251 return _startPosition;
1255 _startPosition = value;
1261 /// Get or set the end position of a linear gradient.<br>
1262 /// Mandatory for Linear.<br>
1264 public Vector2 EndPosition
1268 return _endPosition;
1272 _endPosition = value;
1278 /// Get or set the center point of a radial gradient.<br>
1279 /// Mandatory for Radial.<br>
1281 public Vector2 Center
1295 /// Get or set the size of the radius of a radial gradient.<br>
1296 /// Mandatory for Radial.<br>
1302 return _radius ?? (-1.0f);
1312 /// Get or set all the stop offsets.<br>
1313 /// A PropertyArray of float.<br>
1314 /// If not supplied, default is 0.0f and 1.0f.<br>
1317 public PropertyArray StopOffset
1325 _stopOffset = value;
1331 /// Get or set the color at the stop offsets.<br>
1332 /// A PropertyArray of Color.<br>
1333 /// At least 2 values required to show a gradient.<br>
1336 public PropertyArray StopColor
1350 /// Get or set defines the coordinate system for certain attributes of the points in a gradient.<br>
1351 /// If not supplied, default is GradientVisualUnitsType.ObjectBoundingBox.<br>
1354 public GradientVisualUnitsType Units
1358 return _units ?? (GradientVisualUnitsType.ObjectBoundingBox);
1368 /// Get or set indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.<br>
1369 /// If not supplied, default is GradientVisualSpreadMethodType.Pad.<br>
1372 public GradientVisualSpreadMethodType SpreadMethod
1376 return _spreadMethod ?? (GradientVisualSpreadMethodType.Pad);
1380 _spreadMethod = value;
1385 protected override void ComposingPropertyMap()
1387 if (((_startPosition != null && _endPosition != null) || (_center != null && _radius != null)) && _stopColor != null)
1389 _outputVisualMap = new PropertyMap();
1390 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Gradient));
1391 _outputVisualMap.Add(GradientVisualProperty.StopColor, new PropertyValue(_stopColor));
1392 if (_startPosition != null) { _outputVisualMap.Add(GradientVisualProperty.StartPosition, new PropertyValue(_startPosition)); }
1393 if (_endPosition != null) { _outputVisualMap.Add(GradientVisualProperty.EndPosition, new PropertyValue(_endPosition)); }
1394 if (_center != null) { _outputVisualMap.Add(GradientVisualProperty.Center, new PropertyValue(_center)); }
1395 if (_radius != null) { _outputVisualMap.Add(GradientVisualProperty.Radius, new PropertyValue((float)_radius)); }
1396 if (_stopOffset != null) { _outputVisualMap.Add(GradientVisualProperty.StopOffset, new PropertyValue(_stopOffset)); }
1397 if (_units != null) { _outputVisualMap.Add(GradientVisualProperty.Units, new PropertyValue((int)_units)); }
1398 if (_spreadMethod != null) { _outputVisualMap.Add(GradientVisualProperty.SpreadMethod, new PropertyValue((int)_spreadMethod)); }
1399 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1400 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1401 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1402 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1408 /// A class encapsulating the property map of a mesh visual.
1410 public class MeshVisual : VisualMap
1412 public MeshVisual() : base()
1416 private string _objectURL = null;
1417 private string _materialtURL = null;
1418 private string _texturesPath = null;
1419 private MeshVisualShadingModeValue? _shadingMode = null;
1420 private bool? _useMipmapping = null;
1421 private bool? _useSoftNormals = null;
1422 private Vector3 _lightPosition = null;
1425 /// Get or set the location of the ".obj" file.<br>
1428 public string ObjectURL
1442 /// Get or set the location of the ".mtl" file.<br>
1443 /// If not specified, then a textureless object is assumed.<br>
1446 public string MaterialtURL
1450 return _materialtURL;
1454 _materialtURL = value;
1460 /// Get or set path to the directory the textures (including gloss and normal) are stored in.<br>
1461 /// Mandatory if using material.<br>
1463 public string TexturesPath
1467 return _texturesPath;
1471 _texturesPath = value;
1477 /// Get or set the type of shading mode that the mesh will use.<br>
1478 /// 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>
1479 /// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting first).<br>
1482 public MeshVisualShadingModeValue ShadingMode
1486 return _shadingMode ?? (MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting);
1490 _shadingMode = value;
1496 /// Get or set whether to use mipmaps for textures or not.<br>
1497 /// If not specified, the default is true.<br>
1500 public bool UseMipmapping
1504 return _useMipmapping ?? (true);
1508 _useMipmapping = value;
1514 /// Get or set whether to average normals at each point to smooth textures or not.<br>
1515 /// If not specified, the default is true.<br>
1518 public bool UseSoftNormals
1522 return _useSoftNormals ?? (true);
1526 _useSoftNormals = value;
1532 /// Get or set the position, in stage space, of the point light that applies lighting to the model.<br>
1533 /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
1534 /// and using all zeroes will place the light at the top left corner.<br>
1535 /// If not specified, the default is an offset outwards from the center of the screen.<br>
1538 public Vector3 LightPosition
1542 return _lightPosition;
1546 _lightPosition = value;
1551 protected override void ComposingPropertyMap()
1553 if (_objectURL != null)
1555 _outputVisualMap = new PropertyMap();
1556 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Mesh));
1557 _outputVisualMap.Add(MeshVisualProperty.ObjectURL, new PropertyValue(_objectURL));
1558 if (_materialtURL != null) { _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, new PropertyValue(_materialtURL)); }
1559 if (_texturesPath != null) { _outputVisualMap.Add(MeshVisualProperty.TexturesPath, new PropertyValue(_texturesPath)); }
1560 if (_shadingMode != null) { _outputVisualMap.Add(MeshVisualProperty.ShadingMode, new PropertyValue((int)_shadingMode)); }
1561 if (_useMipmapping != null) { _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, new PropertyValue((bool)_useMipmapping)); }
1562 if (_useSoftNormals != null) { _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, new PropertyValue((bool)_useSoftNormals)); }
1563 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1564 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1565 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1566 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1572 /// A class encapsulating the property map of a primetive visual.
1574 public class PrimitiveVisual : VisualMap
1576 public PrimitiveVisual() : base()
1580 private PrimitiveVisualShapeType? _shape = null;
1581 private Color _mixColorForPrimitiveVisual = null;
1582 private int? _slices = null;
1583 private int? _stacks = null;
1584 private float? _scaleTopRadius = null;
1585 private float? _scaleBottomRadius = null;
1586 private float? _scaleHeight = null;
1587 private float? _scaleRadius = null;
1588 private Vector3 _scaleDimensions = null;
1589 private float? _bevelPercentage = null;
1590 private float? _bevelSmoothness = null;
1591 private Vector3 _lightPosition = null;
1594 /// Get or set the specific shape to render.<br>
1595 /// If not specified, the default is PrimitiveVisualShapeType.Sphere.<br>
1598 public PrimitiveVisualShapeType Shape
1602 return _shape ?? (PrimitiveVisualShapeType.Sphere);
1612 /// Get or set the color of the shape.<br>
1613 /// If not specified, the default is Color(0.5, 0.5, 0.5, 1.0).<br>
1614 /// Applies to ALL shapes.<br>
1617 public Color MixColor
1621 return _mixColorForPrimitiveVisual ?? (new Color(0.5f, 0.5f, 0.5f, 1.0f));
1625 _mixColorForPrimitiveVisual = value;
1631 /// Get or set the number of slices as you go around the shape.<br>
1632 /// For spheres and conical frustrums, this determines how many divisions there are as you go around the object.<br>
1633 /// If not specified, the default is 128.<br>
1634 /// The range is from 1 to 255.<br>
1641 return _slices ?? (128);
1651 /// Get or set the number of stacks as you go down the shape.<br>
1652 /// For spheres, 'stacks' determines how many layers there are as you go down the object.<br>
1653 /// If not specified, the default is 128.<br>
1654 /// The range is from 1 to 255.<br>
1661 return _stacks ?? (128);
1671 /// Get or set the scale of the radius of the top circle of a conical frustrum.<br>
1672 /// If not specified, the default is 1.0f.<br>
1673 /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br>
1674 /// Only values greater than or equal to 0.0f are accepted.<br>
1677 public float ScaleTopRadius
1681 return _scaleTopRadius ?? (1.0f);
1685 _scaleTopRadius = value;
1691 /// Get or set the scale of the radius of the bottom circle of a conical frustrum.<br>
1692 /// If not specified, the default is 1.5f.<br>
1693 /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br>
1694 /// - PrimitiveVisualShapeType.Cone<br>
1695 /// Only values greater than or equal to 0.0f are accepted.<br>
1698 public float ScaleBottomRadius
1702 return _scaleBottomRadius ?? (1.5f);
1706 _scaleBottomRadius = value;
1712 /// Get or set the scale of the height of a conic.<br>
1713 /// If not specified, the default is 3.0f.<br>
1715 /// - PrimitiveVisualShapeType.ConicalFrustrum<br>
1716 /// - PrimitiveVisualShapeType.Cone<br>
1717 /// - PrimitiveVisualShapeType.Cylinder<br>
1718 /// Only values greater than or equal to 0.0f are accepted.<br>
1721 public float ScaleHeight
1725 return _scaleHeight ?? (3.0f);
1729 _scaleHeight = value;
1735 /// Get or set the scale of the radius of a cylinder.<br>
1736 /// If not specified, the default is 1.0f.<br>
1738 /// - PrimitiveVisualShapeType.Cylinder<br>
1739 /// Only values greater than or equal to 0.0f are accepted.<br>
1742 public float ScaleRadius
1746 return _scaleRadius ?? (1.0f);
1750 _scaleRadius = value;
1756 /// Get or set the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.<br>
1757 /// If not specified, the default is Vector3.One.<br>
1759 /// - PrimitiveVisualShapeType.Cube<br>
1760 /// - PrimitiveVisualShapeType.Octahedron<br>
1761 /// - PrimitiveVisualShapeType.BevelledCube<br>
1762 /// Each vector3 parameter should be greater than or equal to 0.0f.<br>
1765 public Vector3 ScaleDimensions
1769 return _scaleDimensions ?? (Vector3.One);
1773 _scaleDimensions = value;
1779 /// Get or set determines how bevelled the cuboid should be, based off the smallest dimension.<br>
1780 /// 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>
1781 /// If not specified, the default is 0.0f (no bevel).<br>
1783 /// - PrimitiveVisualShapeType.BevelledCube<br>
1784 /// The range is from 0.0f to 1.0f.<br>
1787 public float BevelPercentage
1791 return _bevelPercentage ?? (0.0f);
1795 _bevelPercentage = value;
1801 /// Get or set defines how smooth the bevelled edges should be.<br>
1802 /// If not specified, the default is 0.0f (sharp edges).<br>
1804 /// - PrimitiveVisualShapeType.BevelledCube<br>
1805 /// The range is from 0.0f to 1.0f.<br>
1808 public float BevelSmoothness
1812 return _bevelSmoothness ?? (0.0f);
1816 _bevelSmoothness = value;
1822 /// Get or set the position, in stage space, of the point light that applies lighting to the model.<br>
1823 /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
1824 /// and using all zeroes will place the light at the top left corner.<br>
1825 /// If not specified, the default is an offset outwards from the center of the screen.<br>
1826 /// Applies to ALL shapes.<br>
1829 public Vector3 LightPosition
1833 return _lightPosition;
1837 _lightPosition = value;
1842 protected override void ComposingPropertyMap()
1844 _outputVisualMap = new PropertyMap(); ;
1845 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Primitive));
1846 if (_shape != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Shape, new PropertyValue((int)_shape)); }
1847 if (_mixColorForPrimitiveVisual != null) { _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, new PropertyValue(_mixColorForPrimitiveVisual)); }
1848 if (_slices != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Slices, new PropertyValue((int)_slices)); }
1849 if (_stacks != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Stacks, new PropertyValue((int)_stacks)); }
1850 if (_scaleTopRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleTopRadius, new PropertyValue((float)_scaleTopRadius)); }
1851 if (_scaleBottomRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleBottomRadius, new PropertyValue((float)_scaleBottomRadius)); }
1852 if (_scaleHeight != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleHeight, new PropertyValue((float)_scaleHeight)); }
1853 if (_scaleRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleRadius, new PropertyValue((float)_scaleRadius)); }
1854 if (_scaleDimensions != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(_scaleDimensions)); }
1855 if (_bevelPercentage != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, new PropertyValue((float)_bevelPercentage)); }
1856 if (_bevelSmoothness != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, new PropertyValue((float)_bevelSmoothness)); }
1857 if (_lightPosition != null) { _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, new PropertyValue(_lightPosition)); }
1858 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1859 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1860 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1865 /// A class encapsulating the property map of a n-patch image visual.
1867 public class NPatchVisual : VisualMap
1869 public NPatchVisual() : base()
1873 private string _url = null;
1874 private bool? _borderOnly = null;
1875 private Rectangle _border = null;
1878 /// Get or set the URL of the image.<br>
1895 /// Get or set whether to draws the borders only(If true).<br>
1896 /// If not specified, the default is false.<br>
1897 /// For N-Patch images only.<br>
1900 public bool BorderOnly
1904 return _borderOnly ?? false;
1908 _borderOnly = value;
1914 /// The border of the image in the order: left, right, bottom, top.<br>
1915 /// For N-Patch images only.<br>
1918 public Rectangle Border
1931 protected override void ComposingPropertyMap()
1935 _outputVisualMap = new PropertyMap();
1936 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
1937 _outputVisualMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
1938 if (_borderOnly != null) { _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
1939 if (_border != null) { _outputVisualMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border)); }
1940 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1941 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1942 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1943 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1949 /// A class encapsulating the property map of a SVG visual.
1951 public class SVGVisual : VisualMap
1953 public SVGVisual() : base()
1957 private string _url = null;
1972 protected override void ComposingPropertyMap()
1976 _outputVisualMap = new PropertyMap();
1977 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG));
1978 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
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)); }
1988 /// A class encapsulating the property map of a Animated Image(AGIF) visual.
1990 public class AnimatedImageVisual : VisualMap
1992 public AnimatedImageVisual() : base()
1996 private List<string> _urls = null;
1997 private int? _batchSize = null;
1998 private int? _cacheSize = null;
1999 private float? _frameDelay = null;
2018 _urls = new List<string>();
2029 public List<string> URLS
2042 public int BatchSize
2046 return _batchSize ?? 1;
2055 public int CacheSize
2059 return _cacheSize ?? 1;
2067 public float FrameDelay
2071 return _frameDelay ?? 0.1f;
2075 _frameDelay = value;
2080 protected override void ComposingPropertyMap()
2084 _outputVisualMap = new PropertyMap();
2085 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
2086 if( _urls.Count == 1 )
2088 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_urls[0]));
2092 var urlArray = new PropertyArray();
2093 foreach( var url in _urls)
2095 urlArray.Add(new PropertyValue(url));
2097 _outputVisualMap.Add( ImageVisualProperty.URL, ( new PropertyValue( urlArray ) ) );
2099 if (_batchSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.BatchSize, new PropertyValue((int)_batchSize)); }
2100 if (_cacheSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.CacheSize, new PropertyValue((int)_cacheSize)); }
2101 if (_frameDelay != null ) {_outputVisualMap.Add((int)ImageVisualProperty.FrameDelay, new PropertyValue((float)_frameDelay)); }
2102 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2103 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2104 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2105 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2112 //temporary fix for TCT
2113 public class VisualAnimator : VisualMap
2115 public VisualAnimator() : base()
2119 private string _alphaFunction = null;
2120 private int _startTime = 0;
2121 private int _endTime = 0;
2122 private string _target = null;
2123 private string _propertyIndex = null;
2124 private object _destinationValue = null;
2126 public AlphaFunction.BuiltinFunctions AlphaFunction
2130 switch (_alphaFunction)
2133 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear;
2135 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse;
2136 case "EASE_IN_SQUARE":
2137 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare;
2138 case "EASE_OUT_SQUARE":
2139 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare;
2141 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn;
2143 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut;
2145 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut;
2146 case "EASE_IN_SINE":
2147 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine;
2148 case "EASE_OUT_SINE":
2149 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine;
2150 case "EASE_IN_OUT_SINE":
2151 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine;
2153 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce;
2155 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin;
2156 case "EASE_OUT_BACK":
2157 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack;
2159 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Default;
2166 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear:
2168 _alphaFunction = "LINEAR";
2171 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse:
2173 _alphaFunction = "REVERSE";
2176 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare:
2178 _alphaFunction = "EASE_IN_SQUARE";
2181 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare:
2183 _alphaFunction = "EASE_OUT_SQUARE";
2186 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn:
2188 _alphaFunction = "EASE_IN";
2191 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut:
2193 _alphaFunction = "EASE_OUT";
2196 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut:
2198 _alphaFunction = "EASE_IN_OUT";
2201 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine:
2203 _alphaFunction = "EASE_IN_SINE";
2206 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine:
2208 _alphaFunction = "EASE_OUT_SINE";
2211 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine:
2213 _alphaFunction = "EASE_IN_OUT_SINE";
2216 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce:
2218 _alphaFunction = "BOUNCE";
2221 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin:
2223 _alphaFunction = "SIN";
2226 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack:
2228 _alphaFunction = "EASE_OUT_BACK";
2233 _alphaFunction = "DEFAULT";
2240 public int StartTime
2264 public string Target
2276 public string PropertyIndex
2280 return _propertyIndex;
2284 _propertyIndex = value;
2288 public object DestinationValue
2292 return _destinationValue;
2296 _destinationValue = value;
2300 protected override void ComposingPropertyMap()
2302 PropertyMap _animator = new PropertyMap();
2303 _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
2305 PropertyMap _timePeriod = new PropertyMap();
2306 _timePeriod.Add("duration", new PropertyValue((_endTime - _startTime) / 1000.0f));
2307 _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
2308 _animator.Add("timePeriod", new PropertyValue(_timePeriod));
2310 string _str1 = _propertyIndex.Substring(0, 1);
2311 string _str2 = _propertyIndex.Substring(1);
2312 string _str = _str1.ToLower() + _str2;
2314 PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
2316 PropertyMap _transition = new PropertyMap();
2317 _transition.Add("target", new PropertyValue(_target));
2318 _transition.Add("property", new PropertyValue(_str));
2319 _transition.Add("targetValue", val);
2320 _transition.Add("animator", new PropertyValue(_animator));
2322 _outputVisualMap = _transition;
2325 //temporary fix for TCT