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(1.0f, 1.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(1.0f, 1.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;
573 private ReleasePolicyType? _releasePolicy = null;
574 private LoadPolicyType? _loadPolicy = null;
577 /// Get or set the URL of the image.<br>
596 /// Get or set the URL of the alpha mask.<br>
599 public string AlphaMaskURL
603 return _alphaMaskUrl;
607 _alphaMaskUrl = value;
613 /// Get or set fitting options, used when resizing images to fit desired dimensions.<br>
614 /// If not supplied, default is FittingModeType.ShrinkToFit.<br>
615 /// For Normal Quad images only.<br>
618 public FittingModeType FittingMode
622 return _fittingMode ?? (FittingModeType.ShrinkToFit);
626 _fittingMode = value;
632 /// Get or set filtering options, used when resizing images to sample original pixels.<br>
633 /// If not supplied, default is SamplingModeType.Box.<br>
634 /// For Normal Quad images only.<br>
637 public SamplingModeType SamplingMode
641 return _samplingMode ?? (SamplingModeType.Box);
645 _samplingMode = value;
651 /// Get or set the desired image width.<br>
652 /// If not specified, the actual image width is used.<br>
653 /// For Normal Quad images only.<br>
656 public int DesiredWidth
660 return _desiredWidth ?? (-1);
664 _desiredWidth = value;
670 /// Get or set the desired image height.<br>
671 /// If not specified, the actual image height is used.<br>
672 /// For Normal Quad images only.<br>
675 public int DesiredHeight
679 return _desiredHeight ?? (-1);
683 _desiredHeight = value;
689 /// Get or set whether to load the image synchronously.<br>
690 /// If not specified, the default is false, i.e. the image is loaded asynchronously.<br>
691 /// For Normal Quad images only.<br>
694 public bool SynchronousLoading
698 return _synchronousLoading ?? (false);
702 _synchronousLoading = value;
708 /// Get or set whether to draws the borders only(If true).<br>
709 /// If not specified, the default is false.<br>
710 /// For N-Patch images only.<br>
713 public bool BorderOnly
717 return _borderOnly ?? (false);
727 /// Get or set the image area to be displayed.<br>
728 /// It is a rectangular area.<br>
729 /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.<br>
730 /// If not specified, the default value is Vector4(0.0, 0.0, 1.0, 1.0), i.e. the entire area of the image.<br>
731 /// For For Normal QUAD image only.<br>
734 public Vector4 PixelArea
738 return _pixelArea ?? (new Vector4(0.0f, 0.0f, 1.0f, 1.0f));
748 /// Get or set the wrap mode for u coordinate.<br>
749 /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.<br>
750 /// If not specified, the default is WrapModeType.Default(CLAMP).<br>
751 /// For Normal QUAD image only.<br>
754 public WrapModeType WrapModeU
758 return _wrapModeU ?? (WrapModeType.Default);
768 /// Get or set the wrap mode for v coordinate.<br>
769 /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.<br>
770 /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.<br>
771 /// If not specified, the default is WrapModeType.Default(CLAMP).<br>
772 /// For Normal QUAD image only.
775 public WrapModeType WrapModeV
779 return _wrapModeV ?? (WrapModeType.Default);
788 public float MaskContentScale
792 return _maskContentScale ?? 1.0f;
796 _maskContentScale = value;
801 public bool CropToMask
805 return _cropToMask ?? false;
815 /// Get or set the Image Visual release policy<br>
816 /// It decides if a texture should be released from the cache or kept to reduce loading time <br>
818 public ReleasePolicyType ReleasePolicy
822 return _releasePolicy ?? (ReleasePolicyType.Destroyed );
826 _releasePolicy = value;
833 /// Get or set the Image Visual image loading policy<br>
834 /// It decides if a texture should be loaded immediately after source set or only after visual is added to window <br>
836 public LoadPolicyType LoadPolicy
840 return _loadPolicy ?? (LoadPolicyType.Attached);
849 protected override void ComposingPropertyMap()
853 _outputVisualMap = new PropertyMap();
854 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
855 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
856 if (_alphaMaskUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AlphaMaskURL, new PropertyValue(_alphaMaskUrl)); }
857 if (_fittingMode != null) { _outputVisualMap.Add(ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode)); }
858 if (_samplingMode != null) { _outputVisualMap.Add(ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode)); }
859 if (_desiredWidth != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, new PropertyValue((int)_desiredWidth)); }
860 if (_desiredHeight != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredHeight, new PropertyValue((int)_desiredHeight)); }
861 if (_synchronousLoading != null) { _outputVisualMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
862 if (_borderOnly != null) { _outputVisualMap.Add(ImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
863 if (_pixelArea != null) { _outputVisualMap.Add(ImageVisualProperty.PixelArea, new PropertyValue(_pixelArea)); }
864 if (_wrapModeU != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeU, new PropertyValue((int)_wrapModeU)); }
865 if (_wrapModeV != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeV, new PropertyValue((int)_wrapModeV)); }
866 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
867 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
868 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
869 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
870 if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
871 if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
872 if (_releasePolicy != null) { _outputVisualMap.Add( ImageVisualProperty.ReleasePolicy , new PropertyValue((int)_releasePolicy)); }
873 if (_loadPolicy != null) { _outputVisualMap.Add( ImageVisualProperty.LoadPolicy, new PropertyValue((int)_loadPolicy)); }
879 /// A class encapsulating the property map of a text visual.
881 public class TextVisual : VisualMap
883 public TextVisual() : base()
887 private string _text = null;
888 private string _fontFamily = null;
889 private PropertyMap _fontStyle = null;
890 private float? _pointSize = null;
891 private bool? _multiLine = null;
892 private string _horizontalAlignment = null;
893 private string _verticalAlignment = null;
894 private Color _textColor = null;
895 private bool? _enableMarkup = null;
898 /// Get or set the text to display in UTF-8 format.<br>
915 /// Get or set the requested font family to use.<br>
918 public string FontFamily
932 /// Get or set the requested font style to use.<br>
935 public PropertyMap FontStyle
949 /// Get or set the size of font in points.<br>
952 public float PointSize
956 return _pointSize ?? (0.0f);
966 /// Get or set the single-line or multi-line layout option.<br>
967 /// If not specified, the default is false.<br>
970 public bool MultiLine
974 return _multiLine ?? (false);
984 /// Get or set the line horizontal alignment.<br>
985 /// If not specified, the default is Begin.<br>
988 public HorizontalAlignment HorizontalAlignment
992 switch (_horizontalAlignment)
995 return HorizontalAlignment.Begin;
997 return HorizontalAlignment.Center;
999 return HorizontalAlignment.End;
1001 return HorizontalAlignment.Begin;
1008 case HorizontalAlignment.Begin:
1010 _horizontalAlignment = "BEGIN";
1013 case HorizontalAlignment.Center:
1015 _horizontalAlignment = "CENTER";
1018 case HorizontalAlignment.End:
1020 _horizontalAlignment = "END";
1025 _horizontalAlignment = "BEGIN";
1034 /// Get or set the line vertical alignment.<br>
1035 /// If not specified, the default is Top.<br>
1038 public VerticalAlignment VerticalAlignment
1042 switch (_verticalAlignment)
1045 return VerticalAlignment.Top;
1047 return VerticalAlignment.Center;
1049 return VerticalAlignment.Bottom;
1051 return VerticalAlignment.Top;
1058 case VerticalAlignment.Top:
1060 _verticalAlignment = "TOP";
1063 case VerticalAlignment.Center:
1065 _verticalAlignment = "CENTER";
1068 case VerticalAlignment.Bottom:
1070 _verticalAlignment = "BOTTOM";
1075 _verticalAlignment = "TOP";
1084 /// Get or set the color of the text.<br>
1087 public Color TextColor
1101 /// Get or set whether the mark-up processing is enabled.<br>
1104 public bool EnableMarkup
1108 return _enableMarkup ?? (false);
1112 _enableMarkup = value;
1117 protected override void ComposingPropertyMap()
1119 if (_text != null && _pointSize != null)
1121 _outputVisualMap = new PropertyMap();
1122 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
1123 _outputVisualMap.Add(TextVisualProperty.Text, new PropertyValue(_text));
1124 _outputVisualMap.Add(TextVisualProperty.PointSize, new PropertyValue((float)_pointSize));
1125 if (_fontFamily != null) { _outputVisualMap.Add(TextVisualProperty.FontFamily, new PropertyValue(_fontFamily)); }
1126 if (_fontStyle != null) { _outputVisualMap.Add(TextVisualProperty.FontStyle, new PropertyValue(_fontStyle)); }
1127 if (_multiLine != null) { _outputVisualMap.Add(TextVisualProperty.MultiLine, new PropertyValue((bool)_multiLine)); }
1128 if (_horizontalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue(_horizontalAlignment)); }
1129 if (_verticalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, new PropertyValue(_verticalAlignment)); }
1130 if (_textColor != null) { _outputVisualMap.Add(TextVisualProperty.TextColor, new PropertyValue(_textColor)); }
1131 if (_enableMarkup != null) { _outputVisualMap.Add(TextVisualProperty.EnableMarkup, new PropertyValue((bool)_enableMarkup)); }
1132 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1133 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1134 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1135 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1141 /// A class encapsulating the property map of a border visual.
1143 public class BorderVisual : VisualMap
1145 public BorderVisual() : base()
1149 private Color _color = null;
1150 private float? _size = null;
1151 private bool? _antiAliasing = null;
1154 /// Get or set the color of the border.<br>
1171 /// Get or set the width of the border (in pixels).<br>
1174 public float BorderSize
1178 return _size ?? (-1.0f);
1188 /// Get or set whether anti-aliasing of the border is required.<br>
1189 /// If not supplied, default is false.<br>
1192 public bool AntiAliasing
1196 return _antiAliasing ?? (false);
1200 _antiAliasing = value;
1205 protected override void ComposingPropertyMap()
1207 if (_color != null && _size != null)
1209 _outputVisualMap = new PropertyMap();
1210 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Border));
1211 _outputVisualMap.Add(BorderVisualProperty.Size, new PropertyValue((float)_size));
1212 _outputVisualMap.Add(BorderVisualProperty.Color, new PropertyValue(_color));
1213 if (_antiAliasing != null) { _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, new PropertyValue((bool)_antiAliasing)); }
1214 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1215 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1216 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1217 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1223 /// A class encapsulating the property map of a color visual.
1225 public class ColorVisual : VisualMap
1227 public ColorVisual() : base()
1231 private Color _mixColorForColorVisual = null;
1234 /// Get or set the solid color required.<br>
1241 return _mixColorForColorVisual;
1245 _mixColorForColorVisual = value;
1250 protected override void ComposingPropertyMap()
1252 if (_mixColorForColorVisual != null)
1254 _outputVisualMap = new PropertyMap();
1255 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
1256 _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(_mixColorForColorVisual));
1257 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1258 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1259 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1265 /// A class encapsulating the property map of a gradient visual.
1267 public class GradientVisual : VisualMap
1269 public GradientVisual() : base()
1273 private Vector2 _startPosition = null;
1274 private Vector2 _endPosition = null;
1275 private Vector2 _center = null;
1276 private float? _radius = null;
1277 private PropertyArray _stopOffset = null;
1278 private PropertyArray _stopColor = null;
1279 private GradientVisualUnitsType? _units = null;
1280 private GradientVisualSpreadMethodType? _spreadMethod = null;
1283 /// Get or set the start position of a linear gradient.<br>
1284 /// Mandatory for Linear.<br>
1286 public Vector2 StartPosition
1290 return _startPosition;
1294 _startPosition = value;
1300 /// Get or set the end position of a linear gradient.<br>
1301 /// Mandatory for Linear.<br>
1303 public Vector2 EndPosition
1307 return _endPosition;
1311 _endPosition = value;
1317 /// Get or set the center point of a radial gradient.<br>
1318 /// Mandatory for Radial.<br>
1320 public Vector2 Center
1334 /// Get or set the size of the radius of a radial gradient.<br>
1335 /// Mandatory for Radial.<br>
1341 return _radius ?? (-1.0f);
1351 /// Get or set all the stop offsets.<br>
1352 /// A PropertyArray of float.<br>
1353 /// If not supplied, default is 0.0f and 1.0f.<br>
1356 public PropertyArray StopOffset
1364 _stopOffset = value;
1370 /// Get or set the color at the stop offsets.<br>
1371 /// A PropertyArray of Color.<br>
1372 /// At least 2 values required to show a gradient.<br>
1375 public PropertyArray StopColor
1389 /// Get or set defines the coordinate system for certain attributes of the points in a gradient.<br>
1390 /// If not supplied, default is GradientVisualUnitsType.ObjectBoundingBox.<br>
1393 public GradientVisualUnitsType Units
1397 return _units ?? (GradientVisualUnitsType.ObjectBoundingBox);
1407 /// Get or set indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.<br>
1408 /// If not supplied, default is GradientVisualSpreadMethodType.Pad.<br>
1411 public GradientVisualSpreadMethodType SpreadMethod
1415 return _spreadMethod ?? (GradientVisualSpreadMethodType.Pad);
1419 _spreadMethod = value;
1424 protected override void ComposingPropertyMap()
1426 if (((_startPosition != null && _endPosition != null) || (_center != null && _radius != null)) && _stopColor != null)
1428 _outputVisualMap = new PropertyMap();
1429 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Gradient));
1430 _outputVisualMap.Add(GradientVisualProperty.StopColor, new PropertyValue(_stopColor));
1431 if (_startPosition != null) { _outputVisualMap.Add(GradientVisualProperty.StartPosition, new PropertyValue(_startPosition)); }
1432 if (_endPosition != null) { _outputVisualMap.Add(GradientVisualProperty.EndPosition, new PropertyValue(_endPosition)); }
1433 if (_center != null) { _outputVisualMap.Add(GradientVisualProperty.Center, new PropertyValue(_center)); }
1434 if (_radius != null) { _outputVisualMap.Add(GradientVisualProperty.Radius, new PropertyValue((float)_radius)); }
1435 if (_stopOffset != null) { _outputVisualMap.Add(GradientVisualProperty.StopOffset, new PropertyValue(_stopOffset)); }
1436 if (_units != null) { _outputVisualMap.Add(GradientVisualProperty.Units, new PropertyValue((int)_units)); }
1437 if (_spreadMethod != null) { _outputVisualMap.Add(GradientVisualProperty.SpreadMethod, new PropertyValue((int)_spreadMethod)); }
1438 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1439 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1440 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1441 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1447 /// A class encapsulating the property map of a mesh visual.
1449 public class MeshVisual : VisualMap
1451 public MeshVisual() : base()
1455 private string _objectURL = null;
1456 private string _materialtURL = null;
1457 private string _texturesPath = null;
1458 private MeshVisualShadingModeValue? _shadingMode = null;
1459 private bool? _useMipmapping = null;
1460 private bool? _useSoftNormals = null;
1461 private Vector3 _lightPosition = null;
1464 /// Get or set the location of the ".obj" file.<br>
1467 public string ObjectURL
1481 /// Get or set the location of the ".mtl" file.<br>
1482 /// If not specified, then a textureless object is assumed.<br>
1485 public string MaterialtURL
1489 return _materialtURL;
1493 _materialtURL = value;
1499 /// Get or set path to the directory the textures (including gloss and normal) are stored in.<br>
1500 /// Mandatory if using material.<br>
1502 public string TexturesPath
1506 return _texturesPath;
1510 _texturesPath = value;
1516 /// Get or set the type of shading mode that the mesh will use.<br>
1517 /// If anything the specified shading mode requires is missing, a simpler mode that can be handled with what has been supplied will be used instead.<br>
1518 /// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting first).<br>
1521 public MeshVisualShadingModeValue ShadingMode
1525 return _shadingMode ?? (MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting);
1529 _shadingMode = value;
1535 /// Get or set whether to use mipmaps for textures or not.<br>
1536 /// If not specified, the default is true.<br>
1539 public bool UseMipmapping
1543 return _useMipmapping ?? (true);
1547 _useMipmapping = value;
1553 /// Get or set whether to average normals at each point to smooth textures or not.<br>
1554 /// If not specified, the default is true.<br>
1557 public bool UseSoftNormals
1561 return _useSoftNormals ?? (true);
1565 _useSoftNormals = value;
1571 /// Get or set the position, in stage space, of the point light that applies lighting to the model.<br>
1572 /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
1573 /// and using all zeroes will place the light at the top left corner.<br>
1574 /// If not specified, the default is an offset outwards from the center of the screen.<br>
1577 public Vector3 LightPosition
1581 return _lightPosition;
1585 _lightPosition = value;
1590 protected override void ComposingPropertyMap()
1592 if (_objectURL != null)
1594 _outputVisualMap = new PropertyMap();
1595 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Mesh));
1596 _outputVisualMap.Add(MeshVisualProperty.ObjectURL, new PropertyValue(_objectURL));
1597 if (_materialtURL != null) { _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, new PropertyValue(_materialtURL)); }
1598 if (_texturesPath != null) { _outputVisualMap.Add(MeshVisualProperty.TexturesPath, new PropertyValue(_texturesPath)); }
1599 if (_shadingMode != null) { _outputVisualMap.Add(MeshVisualProperty.ShadingMode, new PropertyValue((int)_shadingMode)); }
1600 if (_useMipmapping != null) { _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, new PropertyValue((bool)_useMipmapping)); }
1601 if (_useSoftNormals != null) { _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, new PropertyValue((bool)_useSoftNormals)); }
1602 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1603 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1604 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1605 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1611 /// A class encapsulating the property map of a primetive visual.
1613 public class PrimitiveVisual : VisualMap
1615 public PrimitiveVisual() : base()
1619 private PrimitiveVisualShapeType? _shape = null;
1620 private Color _mixColorForPrimitiveVisual = null;
1621 private int? _slices = null;
1622 private int? _stacks = null;
1623 private float? _scaleTopRadius = null;
1624 private float? _scaleBottomRadius = null;
1625 private float? _scaleHeight = null;
1626 private float? _scaleRadius = null;
1627 private Vector3 _scaleDimensions = null;
1628 private float? _bevelPercentage = null;
1629 private float? _bevelSmoothness = null;
1630 private Vector3 _lightPosition = null;
1633 /// Get or set the specific shape to render.<br>
1634 /// If not specified, the default is PrimitiveVisualShapeType.Sphere.<br>
1637 public PrimitiveVisualShapeType Shape
1641 return _shape ?? (PrimitiveVisualShapeType.Sphere);
1651 /// Get or set the color of the shape.<br>
1652 /// If not specified, the default is Color(0.5, 0.5, 0.5, 1.0).<br>
1653 /// Applies to ALL shapes.<br>
1656 public Color MixColor
1660 return _mixColorForPrimitiveVisual ?? (new Color(0.5f, 0.5f, 0.5f, 1.0f));
1664 _mixColorForPrimitiveVisual = value;
1670 /// Get or set the number of slices as you go around the shape.<br>
1671 /// For spheres and conical frustrums, this determines how many divisions there are as you go around the object.<br>
1672 /// If not specified, the default is 128.<br>
1673 /// The range is from 1 to 255.<br>
1680 return _slices ?? (128);
1690 /// Get or set the number of stacks as you go down the shape.<br>
1691 /// For spheres, 'stacks' determines how many layers there are as you go down the object.<br>
1692 /// If not specified, the default is 128.<br>
1693 /// The range is from 1 to 255.<br>
1700 return _stacks ?? (128);
1710 /// Get or set the scale of the radius of the top circle of a conical frustrum.<br>
1711 /// If not specified, the default is 1.0f.<br>
1712 /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br>
1713 /// Only values greater than or equal to 0.0f are accepted.<br>
1716 public float ScaleTopRadius
1720 return _scaleTopRadius ?? (1.0f);
1724 _scaleTopRadius = value;
1730 /// Get or set the scale of the radius of the bottom circle of a conical frustrum.<br>
1731 /// If not specified, the default is 1.5f.<br>
1732 /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br>
1733 /// - PrimitiveVisualShapeType.Cone<br>
1734 /// Only values greater than or equal to 0.0f are accepted.<br>
1737 public float ScaleBottomRadius
1741 return _scaleBottomRadius ?? (1.5f);
1745 _scaleBottomRadius = value;
1751 /// Get or set the scale of the height of a conic.<br>
1752 /// If not specified, the default is 3.0f.<br>
1754 /// - PrimitiveVisualShapeType.ConicalFrustrum<br>
1755 /// - PrimitiveVisualShapeType.Cone<br>
1756 /// - PrimitiveVisualShapeType.Cylinder<br>
1757 /// Only values greater than or equal to 0.0f are accepted.<br>
1760 public float ScaleHeight
1764 return _scaleHeight ?? (3.0f);
1768 _scaleHeight = value;
1774 /// Get or set the scale of the radius of a cylinder.<br>
1775 /// If not specified, the default is 1.0f.<br>
1777 /// - PrimitiveVisualShapeType.Cylinder<br>
1778 /// Only values greater than or equal to 0.0f are accepted.<br>
1781 public float ScaleRadius
1785 return _scaleRadius ?? (1.0f);
1789 _scaleRadius = value;
1795 /// Get or set the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.<br>
1796 /// If not specified, the default is Vector3.One.<br>
1798 /// - PrimitiveVisualShapeType.Cube<br>
1799 /// - PrimitiveVisualShapeType.Octahedron<br>
1800 /// - PrimitiveVisualShapeType.BevelledCube<br>
1801 /// Each vector3 parameter should be greater than or equal to 0.0f.<br>
1804 public Vector3 ScaleDimensions
1808 return _scaleDimensions ?? (Vector3.One);
1812 _scaleDimensions = value;
1818 /// Get or set determines how bevelled the cuboid should be, based off the smallest dimension.<br>
1819 /// Bevel percentage ranges from 0.0 to 1.0. It affects the ratio of the outer face widths to the width of the overall cube.<br>
1820 /// If not specified, the default is 0.0f (no bevel).<br>
1822 /// - PrimitiveVisualShapeType.BevelledCube<br>
1823 /// The range is from 0.0f to 1.0f.<br>
1826 public float BevelPercentage
1830 return _bevelPercentage ?? (0.0f);
1834 _bevelPercentage = value;
1840 /// Get or set defines how smooth the bevelled edges should be.<br>
1841 /// If not specified, the default is 0.0f (sharp edges).<br>
1843 /// - PrimitiveVisualShapeType.BevelledCube<br>
1844 /// The range is from 0.0f to 1.0f.<br>
1847 public float BevelSmoothness
1851 return _bevelSmoothness ?? (0.0f);
1855 _bevelSmoothness = value;
1861 /// Get or set the position, in stage space, of the point light that applies lighting to the model.<br>
1862 /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
1863 /// and using all zeroes will place the light at the top left corner.<br>
1864 /// If not specified, the default is an offset outwards from the center of the screen.<br>
1865 /// Applies to ALL shapes.<br>
1868 public Vector3 LightPosition
1872 return _lightPosition;
1876 _lightPosition = value;
1881 protected override void ComposingPropertyMap()
1883 _outputVisualMap = new PropertyMap(); ;
1884 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Primitive));
1885 if (_shape != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Shape, new PropertyValue((int)_shape)); }
1886 if (_mixColorForPrimitiveVisual != null) { _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, new PropertyValue(_mixColorForPrimitiveVisual)); }
1887 if (_slices != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Slices, new PropertyValue((int)_slices)); }
1888 if (_stacks != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Stacks, new PropertyValue((int)_stacks)); }
1889 if (_scaleTopRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleTopRadius, new PropertyValue((float)_scaleTopRadius)); }
1890 if (_scaleBottomRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleBottomRadius, new PropertyValue((float)_scaleBottomRadius)); }
1891 if (_scaleHeight != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleHeight, new PropertyValue((float)_scaleHeight)); }
1892 if (_scaleRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleRadius, new PropertyValue((float)_scaleRadius)); }
1893 if (_scaleDimensions != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(_scaleDimensions)); }
1894 if (_bevelPercentage != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, new PropertyValue((float)_bevelPercentage)); }
1895 if (_bevelSmoothness != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, new PropertyValue((float)_bevelSmoothness)); }
1896 if (_lightPosition != null) { _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, new PropertyValue(_lightPosition)); }
1897 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1898 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1899 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1904 /// A class encapsulating the property map of a n-patch image visual.
1906 public class NPatchVisual : VisualMap
1908 public NPatchVisual() : base()
1912 private string _url = null;
1913 private bool? _borderOnly = null;
1914 private Rectangle _border = null;
1917 /// Get or set the URL of the image.<br>
1934 /// Get or set whether to draws the borders only(If true).<br>
1935 /// If not specified, the default is false.<br>
1936 /// For N-Patch images only.<br>
1939 public bool BorderOnly
1943 return _borderOnly ?? false;
1947 _borderOnly = value;
1953 /// The border of the image in the order: left, right, bottom, top.<br>
1954 /// For N-Patch images only.<br>
1957 public Rectangle Border
1970 protected override void ComposingPropertyMap()
1974 _outputVisualMap = new PropertyMap();
1975 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
1976 _outputVisualMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
1977 if (_borderOnly != null) { _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
1978 if (_border != null) { _outputVisualMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border)); }
1979 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1980 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1981 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1982 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1988 /// A class encapsulating the property map of a SVG visual.
1990 public class SVGVisual : VisualMap
1992 public SVGVisual() : base()
1996 private string _url = null;
2011 protected override void ComposingPropertyMap()
2015 _outputVisualMap = new PropertyMap();
2016 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG));
2017 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
2018 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2019 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2020 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2021 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2027 /// A class encapsulating the property map of a Animated Image(AGIF) visual.
2029 public class AnimatedImageVisual : VisualMap
2031 public AnimatedImageVisual() : base()
2035 private List<string> _urls = null;
2036 private int? _batchSize = null;
2037 private int? _cacheSize = null;
2038 private float? _frameDelay = null;
2057 _urls = new List<string>();
2068 public List<string> URLS
2081 public int BatchSize
2085 return _batchSize ?? 1;
2094 public int CacheSize
2098 return _cacheSize ?? 1;
2106 public float FrameDelay
2110 return _frameDelay ?? 0.1f;
2114 _frameDelay = value;
2119 protected override void ComposingPropertyMap()
2123 _outputVisualMap = new PropertyMap();
2124 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
2125 if( _urls.Count == 1 )
2127 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_urls[0]));
2131 var urlArray = new PropertyArray();
2132 foreach( var url in _urls)
2134 urlArray.Add(new PropertyValue(url));
2136 _outputVisualMap.Add( ImageVisualProperty.URL, ( new PropertyValue( urlArray ) ) );
2138 if (_batchSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.BatchSize, new PropertyValue((int)_batchSize)); }
2139 if (_cacheSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.CacheSize, new PropertyValue((int)_cacheSize)); }
2140 if (_frameDelay != null ) {_outputVisualMap.Add((int)ImageVisualProperty.FrameDelay, new PropertyValue((float)_frameDelay)); }
2141 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2142 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2143 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2144 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2151 //temporary fix for TCT
2152 public class VisualAnimator : VisualMap
2154 public VisualAnimator() : base()
2158 private string _alphaFunction = null;
2159 private int _startTime = 0;
2160 private int _endTime = 0;
2161 private string _target = null;
2162 private string _propertyIndex = null;
2163 private object _destinationValue = null;
2165 public AlphaFunction.BuiltinFunctions AlphaFunction
2169 switch (_alphaFunction)
2172 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear;
2174 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse;
2175 case "EASE_IN_SQUARE":
2176 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare;
2177 case "EASE_OUT_SQUARE":
2178 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare;
2180 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn;
2182 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut;
2184 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut;
2185 case "EASE_IN_SINE":
2186 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine;
2187 case "EASE_OUT_SINE":
2188 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine;
2189 case "EASE_IN_OUT_SINE":
2190 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine;
2192 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce;
2194 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin;
2195 case "EASE_OUT_BACK":
2196 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack;
2198 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Default;
2205 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear:
2207 _alphaFunction = "LINEAR";
2210 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse:
2212 _alphaFunction = "REVERSE";
2215 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare:
2217 _alphaFunction = "EASE_IN_SQUARE";
2220 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare:
2222 _alphaFunction = "EASE_OUT_SQUARE";
2225 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn:
2227 _alphaFunction = "EASE_IN";
2230 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut:
2232 _alphaFunction = "EASE_OUT";
2235 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut:
2237 _alphaFunction = "EASE_IN_OUT";
2240 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine:
2242 _alphaFunction = "EASE_IN_SINE";
2245 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine:
2247 _alphaFunction = "EASE_OUT_SINE";
2250 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine:
2252 _alphaFunction = "EASE_IN_OUT_SINE";
2255 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce:
2257 _alphaFunction = "BOUNCE";
2260 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin:
2262 _alphaFunction = "SIN";
2265 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack:
2267 _alphaFunction = "EASE_OUT_BACK";
2272 _alphaFunction = "DEFAULT";
2279 public int StartTime
2303 public string Target
2315 public string PropertyIndex
2319 return _propertyIndex;
2323 _propertyIndex = value;
2327 public object DestinationValue
2331 return _destinationValue;
2335 _destinationValue = value;
2339 protected override void ComposingPropertyMap()
2341 PropertyMap _animator = new PropertyMap();
2342 _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
2344 PropertyMap _timePeriod = new PropertyMap();
2345 _timePeriod.Add("duration", new PropertyValue((_endTime - _startTime) / 1000.0f));
2346 _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
2347 _animator.Add("timePeriod", new PropertyValue(_timePeriod));
2349 string _str1 = _propertyIndex.Substring(0, 1);
2350 string _str2 = _propertyIndex.Substring(1);
2351 string _str = _str1.ToLower() + _str2;
2353 PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
2355 PropertyMap _transition = new PropertyMap();
2356 _transition.Add("target", new PropertyValue(_target));
2357 _transition.Add("property", new PropertyValue(_str));
2358 _transition.Add("targetValue", val);
2359 _transition.Add("animator", new PropertyValue(_animator));
2361 _outputVisualMap = _transition;
2364 //temporary fix for TCT