From b48cb82825e7587adf86ae477a65cee6b43e305b Mon Sep 17 00:00:00 2001 From: Xiaohui Fang Date: Sat, 8 Feb 2025 09:20:55 +0800 Subject: [PATCH] [Optimization] Add int/float/vector to PropertyMap directly. --- .../internal/FrameBroker/FrameBrokerBase.cs | 4 +- .../internal/Interop/Interop.PropertyMap.cs | 21 ++ .../WebView/WebHttpRequestInterceptor.cs | 5 +- .../src/public/BaseComponents/ImageView.cs | 32 +- .../BaseComponents/LottieAnimationView.cs | 38 +-- .../src/public/BaseComponents/TextEditor.cs | 5 +- .../src/public/BaseComponents/TextField.cs | 5 +- .../public/BaseComponents/TextMapHelper.cs | 3 +- .../BaseComponents/ViewBindableProperty.cs | 66 ++--- .../BaseComponents/ViewPublicMethods.cs | 22 +- .../src/public/BaseComponents/VisualView.cs | 58 +--- .../src/public/Common/PropertyMap.cs | 275 ++++++++++++++++++ src/Tizen.NUI/src/public/CustomView/Spin.cs | 38 +-- src/Tizen.NUI/src/public/Input/InputMethod.cs | 17 +- .../src/public/Theme/DefaultThemeCommon.cs | 80 ++--- .../src/public/Visuals/AnimatedImageVisual.cs | 29 +- src/Tizen.NUI/src/public/Visuals/ArcVisual.cs | 24 +- .../src/public/Visuals/BorderVisual.cs | 18 +- .../src/public/Visuals/ColorVisual.cs | 9 +- .../src/public/Visuals/GradientVisual.cs | 37 +-- .../src/public/Visuals/ImageVisual.cs | 81 ++---- .../src/public/Visuals/MeshVisual.cs | 29 +- .../src/public/Visuals/NPatchVisual.cs | 17 +- .../src/public/Visuals/PrimitiveVisual.cs | 52 +--- src/Tizen.NUI/src/public/Visuals/SVGVisual.cs | 8 +- .../src/public/Visuals/TextVisual.cs | 58 +--- .../src/public/Visuals/VisualAnimator.cs | 30 +- .../src/public/Visuals/VisualMaps.cs | 64 +--- .../VisualObject/AnimatedImageVisual.cs | 3 +- 29 files changed, 526 insertions(+), 602 deletions(-) diff --git a/src/Tizen.NUI/src/internal/FrameBroker/FrameBrokerBase.cs b/src/Tizen.NUI/src/internal/FrameBroker/FrameBrokerBase.cs index f6ba093f6b5..c11af917ece 100755 --- a/src/Tizen.NUI/src/internal/FrameBroker/FrameBrokerBase.cs +++ b/src/Tizen.NUI/src/internal/FrameBroker/FrameBrokerBase.cs @@ -296,9 +296,8 @@ private struct TexturedQuadVertex private PropertyBuffer CreateQuadPropertyBuffer() { /* Create Property buffer */ - PropertyValue value = new PropertyValue((int)PropertyType.Vector2); PropertyMap vertexFormat = new PropertyMap(); - vertexFormat.Add("aPosition", value); + vertexFormat.Add("aPosition", (int)PropertyType.Vector2); PropertyBuffer vertexBuffer = new PropertyBuffer(vertexFormat); @@ -335,7 +334,6 @@ private PropertyBuffer CreateQuadPropertyBuffer() Marshal.FreeHGlobal(pA); } - value.Dispose(); vertexFormat.Dispose(); return vertexBuffer; diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.PropertyMap.cs b/src/Tizen.NUI/src/internal/Interop/Interop.PropertyMap.cs index 7ee9ed1090e..72b186b7654 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.PropertyMap.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.PropertyMap.cs @@ -98,21 +98,39 @@ internal static partial class PropertyMap [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Int_Bool")] public static extern IntPtr AddBool(HandleRef propertyMap, int key, bool value); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Str_Bool")] + public static extern IntPtr AddBool(HandleRef propertyMap, string key, bool value); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Int_Int")] public static extern IntPtr AddInt(HandleRef propertyMap, int key, int value); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Str_Int")] + public static extern IntPtr AddInt(HandleRef propertyMap, string key, int value); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Int_Float")] public static extern IntPtr AddFloat(HandleRef propertyMap, int key, float value); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Str_Float")] + public static extern IntPtr AddFloat(HandleRef propertyMap, string key, float value); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Int_Str")] public static extern IntPtr AddString(HandleRef propertyMap, int key, string value); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Str_Str")] + public static extern IntPtr AddString(HandleRef propertyMap, string key, string value); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Int_Vector2")] public static extern IntPtr AddVector2(HandleRef propertyMap, int key, HandleRef value); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Str_Vector2")] + public static extern IntPtr AddVector2(HandleRef propertyMap, string key, HandleRef value); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Int_NVector2")] public static extern IntPtr AddVector2(HandleRef propertyMap, int key, float x, float y); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Str_NVector2")] + public static extern IntPtr AddVector2(HandleRef propertyMap, string key, float x, float y); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Int_Vector3")] public static extern IntPtr AddVector3(HandleRef propertyMap, int key, HandleRef value); @@ -122,6 +140,9 @@ internal static partial class PropertyMap [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Int_NVector4")] public static extern IntPtr AddVector4(HandleRef propertyMap, int key, float x, float y, float z, float w); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Str_NVector4")] + public static extern IntPtr AddVector4(HandleRef propertyMap, string key, float x, float y, float z, float w); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Add_Int_Rectangle")] public static extern IntPtr AddRectangle(HandleRef propertyMap, int key, HandleRef value); diff --git a/src/Tizen.NUI/src/internal/WebView/WebHttpRequestInterceptor.cs b/src/Tizen.NUI/src/internal/WebView/WebHttpRequestInterceptor.cs index c5b081152dc..13cc047cbaf 100755 --- a/src/Tizen.NUI/src/internal/WebView/WebHttpRequestInterceptor.cs +++ b/src/Tizen.NUI/src/internal/WebView/WebHttpRequestInterceptor.cs @@ -171,10 +171,7 @@ public bool AddResponseHeaders(IDictionary headers) PropertyMap headerMap = new PropertyMap(); foreach (KeyValuePair kvp in headers) { - using (PropertyValue value = new PropertyValue(kvp.Value)) - { - headerMap.Add(kvp.Key, value); - } + headerMap.Add(kvp.Key, kvp.Value); } bool result = Interop.WebHttpRequestInterceptor.AddResponseHeaders(interceptorHandle, PropertyMap.getCPtr(headerMap)); headerMap.Dispose(); diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index c39e3d778ec..234bd431962 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -1365,39 +1365,23 @@ public void SetTransitionEffectOption(object initialImageAlpha,object destinatio using (PropertyMap timePeriod = new PropertyMap()) using (PropertyValue initValue = PropertyValue.CreateFromObject(initialImageAlpha)) using (PropertyValue destValue = PropertyValue.CreateFromObject(destinationImageAlpha)) - using (PropertyValue pvDelay = new PropertyValue(delay)) - using (PropertyValue pvSpeed = new PropertyValue(speed)) - using (PropertyValue pvProperty = new PropertyValue("opacity")) - using (PropertyValue pvAnimationType = new PropertyValue("BETWEEN")) using (PropertyMap transition = new PropertyMap()) { if (alphaFunction != null) { - using (PropertyValue pvAlpha = new PropertyValue(AlphaFunction.BuiltinToPropertyKey(alphaFunction))) - { - animator.Add("alphaFunction", pvAlpha); - } + animator.Add("alphaFunction", AlphaFunction.BuiltinToPropertyKey(alphaFunction)); } - timePeriod.Add("duration", pvSpeed); - timePeriod.Add("delay", pvDelay); - using (PropertyValue pvTimePeriod = new PropertyValue(timePeriod)) - { - animator.Add("timePeriod", pvTimePeriod); - } + timePeriod.Add("duration", speed); + timePeriod.Add("delay", delay); + animator.Add("timePeriod", timePeriod); - animator.Add("animationType", pvAnimationType); + animator.Add("animationType", "BETWEEN"); - using (PropertyValue pvAnimator = new PropertyValue(animator)) - { - transition.Add("animator", pvAnimator); - } - using(PropertyValue pvTarget = new PropertyValue("image")) - { - transition.Add("target", pvTarget); - } + transition.Add("animator", animator); - transition.Add("property", pvProperty); + transition.Add("target", "image"); + transition.Add("property", "opacity"); transition.Add("initialValue", initValue); transition.Add("targetValue", destValue); diff --git a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs index 51c30ee0258..0b19aa6c562 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs @@ -217,37 +217,25 @@ private string InternalURL // TODO : Could create new Image without additional creation? using PropertyMap map = new PropertyMap(); - using PropertyValue type = new PropertyValue((int)Visual.Type.AnimatedVectorImage); - using PropertyValue url = new PropertyValue(currentStates.url); - using PropertyValue loopCnt = new PropertyValue(currentStates.loopCount); - using PropertyValue stopAction = new PropertyValue((int)currentStates.stopEndAction); - using PropertyValue loopMode = new PropertyValue((int)currentStates.loopMode); - using PropertyValue redrawInScalingDown = new PropertyValue(currentStates.redrawInScalingDown); - using PropertyValue synchronousLoading = new PropertyValue(currentStates.synchronousLoading); - using PropertyValue enableFrameCache = new PropertyValue(currentStates.enableFrameCache); - using PropertyValue notifyAfterRasterization = new PropertyValue(currentStates.notifyAfterRasterization); - using PropertyValue frameSpeedFactor = new PropertyValue(currentStates.frameSpeedFactor); - - map.Add(Visual.Property.Type, type) - .Add(ImageVisualProperty.URL, url) - .Add(ImageVisualProperty.LoopCount, loopCnt) - .Add(ImageVisualProperty.StopBehavior, stopAction) - .Add(ImageVisualProperty.LoopingMode, loopMode) - .Add(ImageVisualProperty.RedrawInScalingDown, redrawInScalingDown) - .Add(ImageVisualProperty.SynchronousLoading, synchronousLoading) - .Add(ImageVisualProperty.EnableFrameCache, enableFrameCache) - .Add(ImageVisualProperty.NotifyAfterRasterization, notifyAfterRasterization) - .Add(ImageVisualProperty.FrameSpeedFactor, frameSpeedFactor); + + map.Add(Visual.Property.Type, (int)Visual.Type.AnimatedVectorImage) + .Add(ImageVisualProperty.URL, currentStates.url) + .Add(ImageVisualProperty.LoopCount, currentStates.loopCount) + .Add(ImageVisualProperty.StopBehavior, (int)currentStates.stopEndAction) + .Add(ImageVisualProperty.LoopingMode, (int)currentStates.loopMode) + .Add(ImageVisualProperty.RedrawInScalingDown, currentStates.redrawInScalingDown) + .Add(ImageVisualProperty.SynchronousLoading, currentStates.synchronousLoading) + .Add(ImageVisualProperty.EnableFrameCache, currentStates.enableFrameCache) + .Add(ImageVisualProperty.NotifyAfterRasterization, currentStates.notifyAfterRasterization) + .Add(ImageVisualProperty.FrameSpeedFactor, currentStates.frameSpeedFactor); if (currentStates.desiredWidth > 0) { - using PropertyValue desiredWidth = new PropertyValue((int)currentStates.desiredWidth); - map.Add(ImageVisualProperty.DesiredWidth, desiredWidth); + map.Add(ImageVisualProperty.DesiredWidth, currentStates.desiredWidth); } if (currentStates.desiredHeight > 0) { - using PropertyValue desiredHeight = new PropertyValue((int)currentStates.desiredHeight); - map.Add(ImageVisualProperty.DesiredHeight, desiredHeight); + map.Add(ImageVisualProperty.DesiredHeight, currentStates.desiredHeight); } Image = map; diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 29c92094bc5..286d78b5e00 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -3087,10 +3087,7 @@ public Tizen.NUI.PropertyMap Placeholder using (var fontStyle = new PropertyMap()) { properyValue.Get(fontStyle); - using (var fontStyleValue = new PropertyValue(fontStyle)) - { - map.Add("fontStyle", fontStyleValue); - } + map.Add("fontStyle", fontStyle); } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index a282d190bb4..f701b5fdbcd 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -3362,10 +3362,7 @@ public Tizen.NUI.PropertyMap Placeholder using (var fontStyle = new PropertyMap()) { properyValue.Get(fontStyle); - using (var fontStyleValue = new PropertyValue(fontStyle)) - { - map.Add("fontStyle", fontStyleValue); - } + map.Add("fontStyle", fontStyle); } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextMapHelper.cs b/src/Tizen.NUI/src/public/BaseComponents/TextMapHelper.cs index 7683ab462d4..6df2e9fc869 100644 --- a/src/Tizen.NUI/src/public/BaseComponents/TextMapHelper.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextMapHelper.cs @@ -489,9 +489,8 @@ public static PropertyMap GetPlaceholderMap(Placeholder placeholder) if (placeholder.FontStyle != null) { using (var fontStyleMap = GetFontStyleMap((FontStyle)placeholder.FontStyle)) - using (var fontStyleValue = new PropertyValue(fontStyleMap)) { - map.Add("fontStyle", fontStyleValue); + map.Add("fontStyle", fontStyleMap); } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs index 2a6b9775b40..770261798b2 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs @@ -2649,43 +2649,28 @@ private void SetBackgroundImage(string value) } using var map = new PropertyMap(); - using var url = new PropertyValue(value); - using var synchronousLoading = new PropertyValue(backgroundImageSynchronousLoading); - map.Add(ImageVisualProperty.URL, url) - .Add(ImageVisualProperty.SynchronousLoading, synchronousLoading); + map.Add(ImageVisualProperty.URL, value) + .Add(ImageVisualProperty.SynchronousLoading, backgroundImageSynchronousLoading); if ((backgroundExtraData?.BackgroundImageBorder) != null) { - using var npatchType = new PropertyValue((int)Visual.Type.NPatch); - using var border = new PropertyValue(backgroundExtraData.BackgroundImageBorder); - map.Add(Visual.Property.Type, npatchType) - .Add(NpatchImageVisualProperty.Border, border); + map.Add(Visual.Property.Type, (int)Visual.Type.NPatch) + .Add(NpatchImageVisualProperty.Border, backgroundExtraData.BackgroundImageBorder); } else { - using var imageType = new PropertyValue((int)Visual.Type.Image); - map.Add(Visual.Property.Type, imageType); + map.Add(Visual.Property.Type, (int)Visual.Type.Image); } if (backgroundExtraData != null) { - using var cornerRadiusValue = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius); - using var cornerRadius = new PropertyValue(cornerRadiusValue); - using var cornerSquarenessValue = backgroundExtraData.CornerSquareness == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerSquareness); - using var cornerSquareness = new PropertyValue(cornerSquarenessValue); - using var cornerRadiusPolicy = new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy)); - using var borderlineWidth = new PropertyValue(backgroundExtraData.BorderlineWidth); - using var borderlineColorValue = backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor); - using var borderlineColor = new PropertyValue(borderlineColorValue); - using var borderlineOffset = new PropertyValue(backgroundExtraData.BorderlineOffset); - - map.Add(Visual.Property.CornerRadius, cornerRadius) - .Add(Visual.Property.CornerSquareness, cornerSquareness) - .Add(Visual.Property.CornerRadiusPolicy, cornerRadiusPolicy) - .Add(Visual.Property.BorderlineWidth, borderlineWidth) - .Add(Visual.Property.BorderlineColor, borderlineColor) - .Add(Visual.Property.BorderlineOffset, borderlineOffset); + map.Add(Visual.Property.CornerRadius, backgroundExtraData.CornerRadius) + .Add(Visual.Property.CornerSquareness, backgroundExtraData.CornerSquareness) + .Add(Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy) + .Add(Visual.Property.BorderlineWidth, backgroundExtraData.BorderlineWidth) + .Add(Visual.Property.BorderlineColor, backgroundExtraData.BorderlineColor == null ? Color.Black : backgroundExtraData.BorderlineColor) + .Add(Visual.Property.BorderlineOffset, backgroundExtraData.BorderlineOffset); } backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background; @@ -2760,26 +2745,15 @@ private void SetBackgroundColor(Color value) } using var map = new PropertyMap(); - using var colorType = new PropertyValue((int)Visual.Type.Color); - using var mixColor = new PropertyValue(value); - using var cornerRadiusValue = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius); - using var cornerRadius = new PropertyValue(cornerRadiusValue); - using var cornerSquarenessValue = backgroundExtraData.CornerSquareness == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerSquareness); - using var cornerSquareness = new PropertyValue(cornerSquarenessValue); - using var cornerRadiusPolicy = new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy)); - using var borderlineWidth = new PropertyValue(backgroundExtraData.BorderlineWidth); - using var borderlineColorValue = backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor); - using var borderlineColor = new PropertyValue(borderlineColorValue); - using var borderlineOffset = new PropertyValue(backgroundExtraData.BorderlineOffset); - - map.Add(Visual.Property.Type, colorType) - .Add(ColorVisualProperty.MixColor, mixColor) - .Add(Visual.Property.CornerRadius, cornerRadius) - .Add(Visual.Property.CornerSquareness, cornerSquareness) - .Add(Visual.Property.CornerRadiusPolicy, cornerRadiusPolicy) - .Add(Visual.Property.BorderlineWidth, borderlineWidth) - .Add(Visual.Property.BorderlineColor, borderlineColor) - .Add(Visual.Property.BorderlineOffset, borderlineOffset); + + map.Add(Visual.Property.Type, (int)Visual.Type.Color) + .Add(ColorVisualProperty.MixColor, value) + .Add(Visual.Property.CornerRadius, backgroundExtraData.CornerRadius) + .Add(Visual.Property.CornerSquareness, backgroundExtraData.CornerSquareness) + .Add(Visual.Property.CornerRadiusPolicy, (int)(backgroundExtraData.CornerRadiusPolicy)) + .Add(Visual.Property.BorderlineWidth, backgroundExtraData.BorderlineWidth) + .Add(Visual.Property.BorderlineColor, backgroundExtraData.BorderlineColor == null ? Color.Black : backgroundExtraData.BorderlineColor) + .Add(Visual.Property.BorderlineOffset, backgroundExtraData.BorderlineOffset); backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background; diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs index c1c8f18e53a..bee915987b5 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs @@ -72,11 +72,7 @@ public Animation AnimateColor(string targetVisual, object destinationColor, int Animation animation = null; using (PropertyMap animator = new PropertyMap()) using (PropertyMap timePeriod = new PropertyMap()) - using (PropertyValue pvDuration = new PropertyValue((endTime - startTime) / 1000.0f)) - using (PropertyValue pvDelay = new PropertyValue(startTime / 1000.0f)) using (PropertyMap transition = new PropertyMap()) - using (PropertyValue pvTarget = new PropertyValue(targetVisual)) - using (PropertyValue pvProperty = new PropertyValue("mixColor")) using (PropertyValue destValue = PropertyValue.CreateFromObject(destinationColor)) { if (alphaFunction != null) @@ -87,18 +83,12 @@ public Animation AnimateColor(string targetVisual, object destinationColor, int } } - timePeriod.Add("duration", pvDuration); - timePeriod.Add("delay", pvDelay); - using (PropertyValue pvTimePeriod = new PropertyValue(timePeriod)) - { - animator.Add("timePeriod", pvTimePeriod); - } - using (PropertyValue pvAnimator = new PropertyValue(animator)) - { - transition.Add("animator", pvAnimator); - } - transition.Add("target", pvTarget); - transition.Add("property", pvProperty); + timePeriod.Add("duration", (endTime - startTime) / 1000.0f); + timePeriod.Add("delay", startTime / 1000.0f); + animator.Add("timePeriod", timePeriod); + transition.Add("animator", animator); + transition.Add("target", targetVisual); + transition.Add("property", "mixColor"); if (initialColor != null) { diff --git a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs index 41f6813a5f8..9ea5693c62a 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs @@ -255,36 +255,24 @@ public Animation AnimateVisual(VisualMap target, string property, object destina { using (PropertyMap animator = new PropertyMap()) using (PropertyMap timePeriod = new PropertyMap()) - using (PropertyValue pvDuration = new PropertyValue((endTime - startTime) / 1000.0f)) - using (PropertyValue pvDelay = new PropertyValue(startTime / 1000.0f)) using (PropertyValue destVal = PropertyValue.CreateFromObject(destinationValue)) using (PropertyMap transition = new PropertyMap()) - using (PropertyValue pvTarget = new PropertyValue(target.Name)) { if (strAlpha != null) { - using (PropertyValue pvAlpha = new PropertyValue(strAlpha)) - { - animator.Add("alphaFunction", pvAlpha); - } - } - timePeriod.Add("duration", pvDuration); - timePeriod.Add("delay", pvDelay); - using (PropertyValue pvTimePeriod = new PropertyValue(timePeriod)) - { - animator.Add("timePeriod", pvTimePeriod); + animator.Add("alphaFunction", strAlpha); } + timePeriod.Add("duration", (endTime - startTime) / 1000.0f); + timePeriod.Add("delay", startTime / 1000.0f); + animator.Add("timePeriod", timePeriod); StringBuilder sb = new StringBuilder(property); sb[0] = (char)(sb[0] | 0x20); string _str = sb.ToString(); if (_str == "position") { _str = "offset"; } - transition.Add("target", pvTarget); - using (PropertyValue pvStr = new PropertyValue(_str)) - { - transition.Add("property", pvStr); - } + transition.Add("target", target.Name); + transition.Add("property", _str); if (initialValue != null) { @@ -295,10 +283,7 @@ public Animation AnimateVisual(VisualMap target, string property, object destina } } transition.Add("targetValue", destVal); - using (PropertyValue pvAnimator = new PropertyValue(animator)) - { - transition.Add("animator", pvAnimator); - } + transition.Add("animator", animator); using (TransitionData transitionData = new TransitionData(transition)) { @@ -337,37 +322,25 @@ public void AnimateVisualAdd(VisualMap target, string property, object destinati { using (PropertyMap animator = new PropertyMap()) using (PropertyMap timePeriod = new PropertyMap()) - using (PropertyValue pvDuration = new PropertyValue((endTime - startTime) / 1000.0f)) - using (PropertyValue pvDelay = new PropertyValue(startTime / 1000.0f)) using (PropertyValue destVal = PropertyValue.CreateFromObject(destinationValue)) using (PropertyMap transition = new PropertyMap()) - using (PropertyValue pvTarget = new PropertyValue(target.Name)) { if (strAlpha != null) { - using (PropertyValue pvStrAlpha = new PropertyValue(strAlpha)) - { - animator.Add("alphaFunction", pvStrAlpha); - } + animator.Add("alphaFunction", strAlpha); } - timePeriod.Add("duration", pvDuration); - timePeriod.Add("delay", pvDelay); - using (PropertyValue pvTimePeriod = new PropertyValue(timePeriod)) - { - animator.Add("timePeriod", pvTimePeriod); - } + timePeriod.Add("duration", (endTime - startTime) / 1000.0f); + timePeriod.Add("delay", startTime / 1000.0f); + animator.Add("timePeriod", timePeriod); StringBuilder sb = new StringBuilder(property); sb[0] = (char)(sb[0] | 0x20); string _str = sb.ToString(); if (_str == "position") { _str = "offset"; } - transition.Add("target", pvTarget); - using (PropertyValue pvStr = new PropertyValue(_str)) - { - transition.Add("property", pvStr); - } + transition.Add("target", target.Name); + transition.Add("property", _str); if (initialValue != null) { @@ -378,10 +351,7 @@ public void AnimateVisualAdd(VisualMap target, string property, object destinati } } transition.Add("targetValue", destVal); - using (PropertyValue pvAnimator = new PropertyValue(animator)) - { - transition.Add("animator", pvAnimator); - } + transition.Add("animator", animator); using (PropertyValue pvTransition = new PropertyValue(transition)) { diff --git a/src/Tizen.NUI/src/public/Common/PropertyMap.cs b/src/Tizen.NUI/src/public/Common/PropertyMap.cs index 9c5c4376b1e..5c93f327717 100755 --- a/src/Tizen.NUI/src/public/Common/PropertyMap.cs +++ b/src/Tizen.NUI/src/public/Common/PropertyMap.cs @@ -623,6 +623,281 @@ internal void SetValue(string key, PropertyValue value) NDalicPINVOKE.ThrowExceptionIfExists(); } + internal PropertyMap Add(string key, PropertyMap propertyMapValue) + { + using var propertyValue = new PropertyValue(propertyMapValue); + return Add(key, propertyValue); + } + + internal PropertyMap Add(int key, PropertyMap propertyMapValue) + { + using var propertyValue = new PropertyValue(propertyMapValue); + return Add(key, propertyValue); + } + + internal PropertyMap Add(string key, PropertyArray propertyArrayValue) + { + using var propertyValue = new PropertyValue(propertyArrayValue); + return Add(key, propertyValue); + } + + internal PropertyMap Add(int key, PropertyArray propertyArrayValue) + { + using var propertyValue = new PropertyValue(propertyArrayValue); + return Add(key, propertyValue); + } + + internal PropertyMap Add(int key, Vector2 value) + { + if (null == value) + { + using var propertyValue1 = new PropertyValue(); + using var propertyValue2 = new PropertyValue(propertyValue1); + Add(key, propertyValue2); + } + else + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddVector2(SwigCPtr, key, value.X, value.Y); + } + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(string key, Vector2 value) + { + if (null == value) + { + using var propertyValue1 = new PropertyValue(); + using var propertyValue2 = new PropertyValue(propertyValue1); + Add(key, propertyValue2); + } + else + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddVector2(SwigCPtr, key, value.X, value.Y); + } + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + + internal PropertyMap Add(int key, Vector3 value) + { + if (null == value) + { + using var propertyValue1 = new PropertyValue(); + using var propertyValue2 = new PropertyValue(propertyValue1); + Add(key, propertyValue2); + } + else + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddVector3(SwigCPtr, key, getCPtr(value)); + } + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(int key, Vector4 value) + { + if (null == value) + { + using var propertyValue1 = new PropertyValue(); + using var propertyValue2 = new PropertyValue(propertyValue1); + Add(key, propertyValue2); + } + else + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddVector4(SwigCPtr, key, value.X, value.Y, value.Z, value.W); + } + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(string key, Vector4 value) + { + if (null == value) + { + using var propertyValue1 = new PropertyValue(); + using var propertyValue2 = new PropertyValue(propertyValue1); + Add(key, propertyValue2); + } + else + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddVector4(SwigCPtr, key, value.X, value.Y, value.Z, value.W); + } + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(int key, Rectangle value) + { + if (null == value) + { + using var propertyValue1 = new PropertyValue(); + using var propertyValue2 = new PropertyValue(propertyValue1); + Add(key, propertyValue2); + } + else + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddVector4(SwigCPtr, key, value.X, value.Y, value.Width, value.Height); + } + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(int key, string value) + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddString(SwigCPtr, key, value); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(string key, string value) + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddString(SwigCPtr, key, value); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(int key, bool value) + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddBool(SwigCPtr, key, value); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(string key, bool value) + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddBool(SwigCPtr, key, value); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(int key, int value) + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddInt(SwigCPtr, key, value); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(string key, int value) + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddInt(SwigCPtr, key, value); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(int key, float value) + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddFloat(SwigCPtr, key, value); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + + internal PropertyMap Add(string key, float value) + { + global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, key); + if (cPtr != global::System.IntPtr.Zero) + { + Tizen.Log.Error("NUI", $"The key {key} already exists. please do not use duplicate key"); + } + + Interop.PropertyMap.AddFloat(SwigCPtr, key, value); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return this; + } + /// This will not be public opened. [EditorBrowsable(EditorBrowsableState.Never)] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) diff --git a/src/Tizen.NUI/src/public/CustomView/Spin.cs b/src/Tizen.NUI/src/public/CustomView/Spin.cs index eda31b84be3..fc383066b8f 100755 --- a/src/Tizen.NUI/src/public/CustomView/Spin.cs +++ b/src/Tizen.NUI/src/public/CustomView/Spin.cs @@ -750,21 +750,10 @@ private string InternalIndicatorImage { arrowImage = value; var ptMap = new PropertyMap(); - var temp = new PropertyValue((int)Visual.Type.Image); - ptMap.Add(Visual.Property.Type, temp); - temp.Dispose(); - - temp = new PropertyValue(arrowImage); - ptMap.Add(ImageVisualProperty.URL, temp); - temp.Dispose(); - - temp = new PropertyValue(150); - ptMap.Add(ImageVisualProperty.DesiredHeight, temp); - temp.Dispose(); - - temp = new PropertyValue(150); - ptMap.Add(ImageVisualProperty.DesiredWidth, temp); - temp.Dispose(); + ptMap.Add(Visual.Property.Type, (int)Visual.Type.Image); + ptMap.Add(ImageVisualProperty.URL, arrowImage); + ptMap.Add(ImageVisualProperty.DesiredHeight, 150); + ptMap.Add(ImageVisualProperty.DesiredWidth, 150); arrowVisual = VisualFactory.Instance.CreateVisual(ptMap); ptMap.Dispose(); @@ -802,21 +791,10 @@ public override void OnInitialize() temp.Dispose(); var ptMap = new PropertyMap(); - temp = new PropertyValue((int)Visual.Type.Image); - ptMap.Add(Visual.Property.Type, temp); - temp.Dispose(); - - temp = new PropertyValue(arrowImage); - ptMap.Add(ImageVisualProperty.URL, temp); - temp.Dispose(); - - temp = new PropertyValue(150); - ptMap.Add(ImageVisualProperty.DesiredHeight, temp); - temp.Dispose(); - - temp = new PropertyValue(150); - ptMap.Add(ImageVisualProperty.DesiredWidth, temp); - temp.Dispose(); + ptMap.Add(Visual.Property.Type, (int)Visual.Type.Image); + ptMap.Add(ImageVisualProperty.URL, arrowImage); + ptMap.Add(ImageVisualProperty.DesiredHeight, arrowImage); + ptMap.Add(ImageVisualProperty.DesiredWidth, arrowImage); arrowVisual = VisualFactory.Instance.CreateVisual(ptMap); ptMap.Dispose(); diff --git a/src/Tizen.NUI/src/public/Input/InputMethod.cs b/src/Tizen.NUI/src/public/Input/InputMethod.cs index eaf00a6f2cf..8caf47b66be 100755 --- a/src/Tizen.NUI/src/public/Input/InputMethod.cs +++ b/src/Tizen.NUI/src/public/Input/InputMethod.cs @@ -389,12 +389,9 @@ public PropertyMap OutputMap private PropertyMap ComposingInputMethodMap() { PropertyMap outputMap = new PropertyMap(); - PropertyValue temp; if (panelLayout != null) { - temp = new PropertyValue((int)panelLayout); - outputMap.Add("PANEL_LAYOUT", temp); - temp.Dispose(); + outputMap.Add("PANEL_LAYOUT", (int)panelLayout); } if (actionButton != null) { @@ -403,21 +400,15 @@ private PropertyMap ComposingInputMethodMap() else if (actionButton == InputMethod.ActionButtonTitleType.Send) actionButton = (InputMethod.ActionButtonTitleType.Send - 1); // 7 else if (actionButton == InputMethod.ActionButtonTitleType.SignIn) actionButton = (InputMethod.ActionButtonTitleType.SignIn - 1); // 8 else if (actionButton == InputMethod.ActionButtonTitleType.Unspecified || actionButton == InputMethod.ActionButtonTitleType.None) actionButton = InputMethod.ActionButtonTitleType.Default; - temp = new PropertyValue((int)actionButton); - outputMap.Add("BUTTON_ACTION", temp); - temp.Dispose(); + outputMap.Add("BUTTON_ACTION", (int)actionButton); } if (autoCapital != null) { - temp = new PropertyValue((int)autoCapital); - outputMap.Add("AUTO_CAPITALIZE", temp); - temp.Dispose(); + outputMap.Add("AUTO_CAPITALIZE", (int)autoCapital); } if (variation != null) { - temp = new PropertyValue((int)variation); - outputMap.Add("VARIATION", temp); - temp.Dispose(); + outputMap.Add("VARIATION", (int)variation); } return outputMap; } diff --git a/src/Tizen.NUI/src/public/Theme/DefaultThemeCommon.cs b/src/Tizen.NUI/src/public/Theme/DefaultThemeCommon.cs index b88af1f8487..a86785cc9aa 100644 --- a/src/Tizen.NUI/src/public/Theme/DefaultThemeCommon.cs +++ b/src/Tizen.NUI/src/public/Theme/DefaultThemeCommon.cs @@ -40,7 +40,7 @@ public Theme Create() FontFamily = Tizen.NUI.FontFamily.UseSystemSetting, PixelSize = 24, TextColor = new Color(0.04f, 0.05f, 0.13f, 1), - FontStyle = new PropertyMap().Add("weight", new PropertyValue("regular")), + FontStyle = new PropertyMap().Add("weight", "regular"), AutoScrollLoopCount = 2, AutoScrollGap = 50.0f, AutoScrollSpeed = 80, @@ -56,7 +56,7 @@ public Theme Create() PixelSize = 24, TextColor = new Color(0.04f, 0.05f, 0.13f, 1), PlaceholderTextColor = new Vector4(0.79f, 0.79f, 0.79f, 1), - FontStyle = new PropertyMap().Add("weight", new PropertyValue("regular")), + FontStyle = new PropertyMap().Add("weight", "regular"), PrimaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1), SecondaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1), CursorWidth = 2, @@ -64,26 +64,26 @@ public Theme Create() SelectionHighlightColor = new Vector4(1.00f, 0.38f, 0.00f, 0.30f), GrabHandleColor = new Color(1.00f, 1.00f, 1.00f, 1), GrabHandleImage = FrameworkInformation.ResourcePath + "IoT_handler_center_downW.png", - SelectionHandleImageLeft = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downleftW.png")), - SelectionHandleImageRight = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downrightW.png")), + SelectionHandleImageLeft = new PropertyMap().Add("filename", FrameworkInformation.ResourcePath + "IoT_handler_downleftW.png"), + SelectionHandleImageRight = new PropertyMap().Add("filename", FrameworkInformation.ResourcePath + "IoT_handler_downrightW.png"), SelectionPopupStyle = new PropertyMap() - .Add(SelectionPopupStyleProperty.MaxSize, new PropertyValue(new Vector2(1200.0f, 40.0f))) - .Add(SelectionPopupStyleProperty.DividerSize, new PropertyValue(new Vector2(0.0f, 0.0f))) - .Add(SelectionPopupStyleProperty.DividerPadding, new PropertyValue(new Vector4(0.0f, 0.0f, 0.0f, 0.0f))) - .Add(SelectionPopupStyleProperty.Background, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-background.9.png")))) - .Add(SelectionPopupStyleProperty.BackgroundBorder, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-border.9.png")))) - .Add(SelectionPopupStyleProperty.PressedColor, new PropertyValue(new Vector4(1.0f, 0.39f, 0.0f, 0.16f))) - .Add(SelectionPopupStyleProperty.PressedCornerRadius, new PropertyValue(12.0f)) - .Add(SelectionPopupStyleProperty.FadeInDuration, new PropertyValue(0.25f)) - .Add(SelectionPopupStyleProperty.FadeOutDuration, new PropertyValue(0.25f)) - .Add(SelectionPopupStyleProperty.EnableScrollBar, new PropertyValue(false)) - .Add(SelectionPopupStyleProperty.LabelMinimumSize, new PropertyValue(new Vector2(0, 40.0f))) - .Add(SelectionPopupStyleProperty.LabelPadding, new PropertyValue(new Vector4(-4.0f, -4.0f, 0.0f, 0.0f))) - .Add(SelectionPopupStyleProperty.LabelTextVisual, new PropertyValue(new PropertyMap() - .Add(TextVisualProperty.PointSize, new PropertyValue(6.0f)) - .Add(TextVisualProperty.TextColor, new PropertyValue(new Vector4(1.00f, 0.38f, 0.00f, 1))) - .Add(TextVisualProperty.FontFamily, new PropertyValue("TizenSans")) - .Add(TextVisualProperty.FontStyle, new PropertyValue(new PropertyMap().Add("weight", new PropertyValue("regular")))))), + .Add(SelectionPopupStyleProperty.MaxSize, new Vector2(1200.0f, 40.0f)) + .Add(SelectionPopupStyleProperty.DividerSize, new Vector2(0.0f, 0.0f)) + .Add(SelectionPopupStyleProperty.DividerPadding, new Vector4(0.0f, 0.0f, 0.0f, 0.0f)) + .Add(SelectionPopupStyleProperty.Background, new PropertyMap().Add(ImageVisualProperty.URL, FrameworkInformation.ResourcePath + "IoT-selection-popup-background.9.png")) + .Add(SelectionPopupStyleProperty.BackgroundBorder, new PropertyMap().Add(ImageVisualProperty.URL, FrameworkInformation.ResourcePath + "IoT-selection-popup-border.9.png")) + .Add(SelectionPopupStyleProperty.PressedColor, new Vector4(1.0f, 0.39f, 0.0f, 0.16f)) + .Add(SelectionPopupStyleProperty.PressedCornerRadius, 12.0f) + .Add(SelectionPopupStyleProperty.FadeInDuration, 0.25f) + .Add(SelectionPopupStyleProperty.FadeOutDuration, 0.25f) + .Add(SelectionPopupStyleProperty.EnableScrollBar, false) + .Add(SelectionPopupStyleProperty.LabelMinimumSize, new Vector2(0, 40.0f)) + .Add(SelectionPopupStyleProperty.LabelPadding, new Vector4(-4.0f, -4.0f, 0.0f, 0.0f)) + .Add(SelectionPopupStyleProperty.LabelTextVisual, new PropertyMap() + .Add(TextVisualProperty.PointSize, 6.0f) + .Add(TextVisualProperty.TextColor, new Vector4(1.00f, 0.38f, 0.00f, 1)) + .Add(TextVisualProperty.FontFamily, "TizenSans") + .Add(TextVisualProperty.FontStyle, new PropertyMap().Add("weight", "regular"))), }); // TextEditor style. @@ -93,7 +93,7 @@ public Theme Create() PixelSize = 24, TextColor = new Color(0.04f, 0.05f, 0.13f, 1), PlaceholderTextColor = new Color(0.79f, 0.79f, 0.79f, 1), - FontStyle = new PropertyMap().Add("weight", new PropertyValue("regular")), + FontStyle = new PropertyMap().Add("weight", "regular"), PrimaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1), SecondaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1), CursorWidth = 2, @@ -104,26 +104,26 @@ public Theme Create() SelectionHighlightColor = new Vector4(1.00f, 0.38f, 0.00f, 0.30f), GrabHandleColor = new Color(1.00f, 1.00f, 1.00f, 1), GrabHandleImage = FrameworkInformation.ResourcePath + "IoT_handler_center_downW.png", - SelectionHandleImageLeft = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downleftW.png")), - SelectionHandleImageRight = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downrightW.png")), + SelectionHandleImageLeft = new PropertyMap().Add("filename", FrameworkInformation.ResourcePath + "IoT_handler_downleftW.png"), + SelectionHandleImageRight = new PropertyMap().Add("filename", FrameworkInformation.ResourcePath + "IoT_handler_downrightW.png"), SelectionPopupStyle = new PropertyMap() - .Add(SelectionPopupStyleProperty.MaxSize, new PropertyValue(new Vector2(1200.0f, 40.0f))) - .Add(SelectionPopupStyleProperty.DividerSize, new PropertyValue(new Vector2(0.0f, 0.0f))) - .Add(SelectionPopupStyleProperty.DividerPadding, new PropertyValue(new Vector4(0.0f, 0.0f, 0.0f, 0.0f))) - .Add(SelectionPopupStyleProperty.Background, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-background.9.png")))) - .Add(SelectionPopupStyleProperty.BackgroundBorder, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-border.9.png")))) - .Add(SelectionPopupStyleProperty.PressedColor, new PropertyValue(new Vector4(1.0f, 0.39f, 0.0f, 0.16f))) - .Add(SelectionPopupStyleProperty.PressedCornerRadius, new PropertyValue(12.0f)) - .Add(SelectionPopupStyleProperty.FadeInDuration, new PropertyValue(0.25f)) - .Add(SelectionPopupStyleProperty.FadeOutDuration, new PropertyValue(0.25f)) - .Add(SelectionPopupStyleProperty.EnableScrollBar, new PropertyValue(false)) - .Add(SelectionPopupStyleProperty.LabelMinimumSize, new PropertyValue(new Vector2(0, 40.0f))) - .Add(SelectionPopupStyleProperty.LabelPadding, new PropertyValue(new Vector4(-4.0f, -4.0f, 0.0f, 0.0f))) + .Add(SelectionPopupStyleProperty.MaxSize, new Vector2(1200.0f, 40.0f)) + .Add(SelectionPopupStyleProperty.DividerSize, new Vector2(0.0f, 0.0f)) + .Add(SelectionPopupStyleProperty.DividerPadding, new Vector4(0.0f, 0.0f, 0.0f, 0.0f)) + .Add(SelectionPopupStyleProperty.Background, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, FrameworkInformation.ResourcePath + "IoT-selection-popup-background.9.png"))) + .Add(SelectionPopupStyleProperty.BackgroundBorder, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, FrameworkInformation.ResourcePath + "IoT-selection-popup-border.9.png"))) + .Add(SelectionPopupStyleProperty.PressedColor, new Vector4(1.0f, 0.39f, 0.0f, 0.16f)) + .Add(SelectionPopupStyleProperty.PressedCornerRadius, 12.0f) + .Add(SelectionPopupStyleProperty.FadeInDuration, 0.25f) + .Add(SelectionPopupStyleProperty.FadeOutDuration, 0.25f) + .Add(SelectionPopupStyleProperty.EnableScrollBar, false) + .Add(SelectionPopupStyleProperty.LabelMinimumSize, new Vector2(0, 40.0f)) + .Add(SelectionPopupStyleProperty.LabelPadding, new Vector4(-4.0f, -4.0f, 0.0f, 0.0f)) .Add(SelectionPopupStyleProperty.LabelTextVisual, new PropertyValue(new PropertyMap() - .Add(TextVisualProperty.PointSize, new PropertyValue(6.0f)) - .Add(TextVisualProperty.TextColor, new PropertyValue(new Vector4(1.00f, 0.38f, 0.00f, 1))) - .Add(TextVisualProperty.FontFamily, new PropertyValue("TizenSans")) - .Add(TextVisualProperty.FontStyle, new PropertyValue(new PropertyMap().Add("weight", new PropertyValue("regular")))))), + .Add(TextVisualProperty.PointSize, 6.0f) + .Add(TextVisualProperty.TextColor, new Vector4(1.00f, 0.38f, 0.00f, 1)) + .Add(TextVisualProperty.FontFamily, "TizenSans") + .Add(TextVisualProperty.FontStyle, new PropertyValue(new PropertyMap().Add("weight", "regular"))))), }); return theme; diff --git a/src/Tizen.NUI/src/public/Visuals/AnimatedImageVisual.cs b/src/Tizen.NUI/src/public/Visuals/AnimatedImageVisual.cs index 32dcf8bcc5a..60ae45618b4 100755 --- a/src/Tizen.NUI/src/public/Visuals/AnimatedImageVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/AnimatedImageVisual.cs @@ -165,14 +165,11 @@ protected override void ComposingPropertyMap() if (urls != null) { _outputVisualMap = new PropertyMap(); - PropertyValue temp = new PropertyValue((int)Visual.Type.AnimatedImage); - _outputVisualMap.Add(Visual.Property.Type, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Type, (int)Visual.Type.AnimatedImage); + if (urls.Count == 1) { - temp = new PropertyValue(urls[0]); - _outputVisualMap.Add(ImageVisualProperty.URL, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.URL, urls[0]); } else { @@ -181,34 +178,24 @@ protected override void ComposingPropertyMap() { urlArray.Add(new PropertyValue(url)); } - temp = new PropertyValue(urlArray); - _outputVisualMap.Add(ImageVisualProperty.URL, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.URL, urls[0]); urlArray.Dispose(); } if (batchSize != null) { - temp = new PropertyValue((int)batchSize); - _outputVisualMap.Add(ImageVisualProperty.BatchSize, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.BatchSize, batchSize.Value); } if (cacheSize != null) { - temp = new PropertyValue((int)cacheSize); - _outputVisualMap.Add(ImageVisualProperty.CacheSize, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.CacheSize, cacheSize.Value); } if (frameDelay != null) { - temp = new PropertyValue((float)frameDelay); - _outputVisualMap.Add(ImageVisualProperty.FrameDelay, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.FrameDelay, frameDelay.Value); } if (loopCount != null) { - temp = new PropertyValue((int)loopCount); - _outputVisualMap.Add(ImageVisualProperty.LoopCount, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.LoopCount, cacheSize.Value); } base.ComposingPropertyMap(); } diff --git a/src/Tizen.NUI/src/public/Visuals/ArcVisual.cs b/src/Tizen.NUI/src/public/Visuals/ArcVisual.cs index b7e3528fe68..8edfa550609 100755 --- a/src/Tizen.NUI/src/public/Visuals/ArcVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/ArcVisual.cs @@ -141,25 +141,11 @@ protected override void ComposingPropertyMap() _outputVisualMap = null; base.ComposingPropertyMap(); - PropertyValue temp = new PropertyValue((int)Visual.Type.Arc); - _outputVisualMap.Add(Visual.Property.Type, temp); - temp.Dispose(); - - temp = new PropertyValue(Thickness < 0.0f ? 0.0f : Thickness); - _outputVisualMap.Add(ArcVisualProperty.Thickness, temp); - temp.Dispose(); - - temp = new PropertyValue(StartAngle); - _outputVisualMap.Add(ArcVisualProperty.StartAngle, temp); - temp.Dispose(); - - temp = new PropertyValue(SweepAngle); - _outputVisualMap.Add(ArcVisualProperty.SweepAngle, temp); - temp.Dispose(); - - temp = new PropertyValue((int)Cap); - _outputVisualMap.Add(ArcVisualProperty.Cap, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Type, (int)Visual.Type.Arc); + _outputVisualMap.Add(ArcVisualProperty.Thickness, Thickness < 0.0f ? 0.0f : Thickness); + _outputVisualMap.Add(ArcVisualProperty.StartAngle, StartAngle); + _outputVisualMap.Add(ArcVisualProperty.SweepAngle, SweepAngle); + _outputVisualMap.Add(ArcVisualProperty.Cap, (int)Cap); } #endregion Methods diff --git a/src/Tizen.NUI/src/public/Visuals/BorderVisual.cs b/src/Tizen.NUI/src/public/Visuals/BorderVisual.cs index c458a053cd8..89dc308e7d9 100755 --- a/src/Tizen.NUI/src/public/Visuals/BorderVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/BorderVisual.cs @@ -99,23 +99,13 @@ protected override void ComposingPropertyMap() if (color != null && size != null) { _outputVisualMap = new PropertyMap(); - PropertyValue temp = new PropertyValue((int)Visual.Type.Border); - _outputVisualMap.Add(Visual.Property.Type, temp); - temp.Dispose(); - - temp = new PropertyValue((float)size); - _outputVisualMap.Add(BorderVisualProperty.Size, temp); - temp.Dispose(); - - temp = new PropertyValue(color); - _outputVisualMap.Add(BorderVisualProperty.Color, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Type, (int)Visual.Type.Border); + _outputVisualMap.Add(BorderVisualProperty.Size, (float)size); + _outputVisualMap.Add(BorderVisualProperty.Color, color); if (antiAliasing != null) { - temp = new PropertyValue((bool)antiAliasing); - _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, temp); - temp.Dispose(); + _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, (bool)antiAliasing); } base.ComposingPropertyMap(); } diff --git a/src/Tizen.NUI/src/public/Visuals/ColorVisual.cs b/src/Tizen.NUI/src/public/Visuals/ColorVisual.cs index 1607bd188a5..3f8cbf9efe7 100755 --- a/src/Tizen.NUI/src/public/Visuals/ColorVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/ColorVisual.cs @@ -84,13 +84,8 @@ protected override void ComposingPropertyMap() base.ComposingPropertyMap(); - PropertyValue temp = new PropertyValue((int)Visual.Type.Color); - _outputVisualMap.Add(Visual.Property.Type, temp); - temp.Dispose(); - - temp = new PropertyValue(color); - _outputVisualMap.Add(ColorVisualProperty.MixColor, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Type, (int)Visual.Type.Color); + _outputVisualMap.Add(ColorVisualProperty.MixColor, color); } else { diff --git a/src/Tizen.NUI/src/public/Visuals/GradientVisual.cs b/src/Tizen.NUI/src/public/Visuals/GradientVisual.cs index cd2738872d6..64bde54dea7 100755 --- a/src/Tizen.NUI/src/public/Visuals/GradientVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/GradientVisual.cs @@ -199,61 +199,42 @@ protected override void ComposingPropertyMap() if (((_startPosition != null && _endPosition != null) || (_center != null && _radius != null)) && _stopColor != null) { _outputVisualMap = new PropertyMap(); - PropertyValue temp = new PropertyValue((int)Visual.Type.Gradient); - _outputVisualMap.Add(Visual.Property.Type, temp); - temp.Dispose(); - - temp = new PropertyValue(_stopColor); - _outputVisualMap.Add(GradientVisualProperty.StopColor, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Type, (int)Visual.Type.Gradient); + _outputVisualMap.Add(GradientVisualProperty.StopColor, _stopColor); if (_startPosition != null) { - temp = new PropertyValue(_startPosition); - _outputVisualMap.Add(GradientVisualProperty.StartPosition, temp); - temp.Dispose(); + _outputVisualMap.Add(GradientVisualProperty.StartPosition, _startPosition); } if (_endPosition != null) { - temp = new PropertyValue(_endPosition); - _outputVisualMap.Add(GradientVisualProperty.EndPosition, temp); - temp.Dispose(); + _outputVisualMap.Add(GradientVisualProperty.EndPosition, _endPosition); } if (_center != null) { - temp = new PropertyValue(_center); - _outputVisualMap.Add(GradientVisualProperty.Center, temp); - temp.Dispose(); + _outputVisualMap.Add(GradientVisualProperty.Center, _center); } if (_radius != null) { - temp = new PropertyValue((float)_radius); - _outputVisualMap.Add(GradientVisualProperty.Radius, temp); - temp.Dispose(); + _outputVisualMap.Add(GradientVisualProperty.Radius, (float)_radius); } if (_stopOffset != null) { - temp = new PropertyValue(_stopOffset); - _outputVisualMap.Add(GradientVisualProperty.StopOffset, temp); - temp.Dispose(); + _outputVisualMap.Add(GradientVisualProperty.StopOffset, _stopOffset); } if (_units != null) { - temp = new PropertyValue((int)_units); - _outputVisualMap.Add(GradientVisualProperty.Units, temp); - temp.Dispose(); + _outputVisualMap.Add(GradientVisualProperty.Units, (int)_units); } if (_spreadMethod != null) { - temp = new PropertyValue((int)_spreadMethod); - _outputVisualMap.Add(GradientVisualProperty.SpreadMethod, temp); - temp.Dispose(); + _outputVisualMap.Add(GradientVisualProperty.SpreadMethod, (int)_spreadMethod); } base.ComposingPropertyMap(); } diff --git a/src/Tizen.NUI/src/public/Visuals/ImageVisual.cs b/src/Tizen.NUI/src/public/Visuals/ImageVisual.cs index db7ea5fedf2..cb31d71ecba 100755 --- a/src/Tizen.NUI/src/public/Visuals/ImageVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/ImageVisual.cs @@ -426,138 +426,97 @@ protected override void ComposingPropertyMap() if (url != null) { _outputVisualMap = new PropertyMap(); - PropertyValue temp = new PropertyValue((int)Visual.Type.Image); - _outputVisualMap.Add(Visual.Property.Type, temp); - temp.Dispose(); - - temp = new PropertyValue(url); - _outputVisualMap.Add(ImageVisualProperty.URL, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Type, (int)Visual.Type.Image); + _outputVisualMap.Add(ImageVisualProperty.URL, url); if (alphaMaskUrl != null) { - temp = new PropertyValue(alphaMaskUrl); - _outputVisualMap.Add(ImageVisualProperty.AlphaMaskURL, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.AlphaMaskURL, alphaMaskUrl); } if (auxiliaryImageUrl != null) { - temp = new PropertyValue(auxiliaryImageUrl); - _outputVisualMap.Add(ImageVisualProperty.AuxiliaryImageURL, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.AuxiliaryImageURL, auxiliaryImageUrl); } if (fittingMode != null) { - temp = new PropertyValue((int)fittingMode); - _outputVisualMap.Add(ImageVisualProperty.FittingMode, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.FittingMode, (int)fittingMode); } if (samplingMode != null) { - temp = new PropertyValue((int)samplingMode); - _outputVisualMap.Add(ImageVisualProperty.SamplingMode, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.SamplingMode, (int)samplingMode); } if (desiredWidth != null) { - temp = new PropertyValue((int)desiredWidth); - _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, (int)desiredWidth); } if (desiredHeight != null) { - temp = new PropertyValue((int)desiredHeight); - _outputVisualMap.Add(ImageVisualProperty.DesiredHeight, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.DesiredHeight, (int)desiredHeight); } if (synchronousLoading != null) { - temp = new PropertyValue((bool)synchronousLoading); - _outputVisualMap.Add(ImageVisualProperty.SynchronousLoading, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.SynchronousLoading, (bool)synchronousLoading); } if (borderOnly != null) { - temp = new PropertyValue((bool)borderOnly); - _outputVisualMap.Add(ImageVisualProperty.BorderOnly, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.BorderOnly, (bool)borderOnly); } if (pixelArea != null) { - temp = new PropertyValue(pixelArea); - _outputVisualMap.Add(ImageVisualProperty.PixelArea, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.PixelArea, pixelArea); } if (wrapModeU != null) { - temp = new PropertyValue((int)wrapModeU); - _outputVisualMap.Add(ImageVisualProperty.WrapModeU, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.WrapModeU, (int)wrapModeU); } if (wrapModeV != null) { - temp = new PropertyValue((int)wrapModeV); - _outputVisualMap.Add(ImageVisualProperty.WrapModeV, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.WrapModeV, (int)wrapModeV); } if (maskContentScale != null) { - temp = new PropertyValue((float)maskContentScale); - _outputVisualMap.Add(ImageVisualProperty.MaskContentScale, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.MaskContentScale, (float)maskContentScale); } if (cropToMask != null) { - temp = new PropertyValue((bool)cropToMask); - _outputVisualMap.Add(ImageVisualProperty.CropToMask, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.CropToMask, (bool)cropToMask); } if (auxiliaryImageAlpha != null) { - temp = new PropertyValue((float)auxiliaryImageAlpha); - _outputVisualMap.Add(ImageVisualProperty.AuxiliaryImageAlpha, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.AuxiliaryImageAlpha, (float)auxiliaryImageAlpha); } if (releasePolicy != null) { - temp = new PropertyValue((int)releasePolicy); - _outputVisualMap.Add(ImageVisualProperty.ReleasePolicy, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.ReleasePolicy, (int)releasePolicy); } if (loadPolicy != null) { - temp = new PropertyValue((int)loadPolicy); - _outputVisualMap.Add(ImageVisualProperty.LoadPolicy, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.LoadPolicy, (int)loadPolicy); } if (orientationCorrection != null) { - temp = new PropertyValue((bool)orientationCorrection); - _outputVisualMap.Add(ImageVisualProperty.OrientationCorrection, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.OrientationCorrection, (bool)orientationCorrection); } if (atlasing != null) { - temp = new PropertyValue((bool)atlasing); - _outputVisualMap.Add(ImageVisualProperty.Atlasing, temp); - temp.Dispose(); + _outputVisualMap.Add(ImageVisualProperty.Atlasing, (bool)atlasing); } base.ComposingPropertyMap(); } diff --git a/src/Tizen.NUI/src/public/Visuals/MeshVisual.cs b/src/Tizen.NUI/src/public/Visuals/MeshVisual.cs index ca515f4005a..b4d42375c8c 100755 --- a/src/Tizen.NUI/src/public/Visuals/MeshVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/MeshVisual.cs @@ -203,43 +203,28 @@ protected override void ComposingPropertyMap() if (objectURL != null) { _outputVisualMap = new PropertyMap(); - PropertyValue temp = new PropertyValue((int)Visual.Type.Mesh); - _outputVisualMap.Add(Visual.Property.Type, temp); - temp.Dispose(); - - temp = new PropertyValue(objectURL); - _outputVisualMap.Add(MeshVisualProperty.ObjectURL, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Type, (int)Visual.Type.Mesh); + _outputVisualMap.Add(MeshVisualProperty.ObjectURL, objectURL); if (materialURL != null) { - temp = new PropertyValue(materialURL); - _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, temp); - temp.Dispose(); + _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, materialURL); } if (texturesPath != null) { - temp = new PropertyValue(texturesPath); - _outputVisualMap.Add(MeshVisualProperty.TexturesPath, temp); - temp.Dispose(); + _outputVisualMap.Add(MeshVisualProperty.TexturesPath, texturesPath); } if (shadingMode != null) { - temp = new PropertyValue((int)shadingMode); - _outputVisualMap.Add(MeshVisualProperty.ShadingMode, temp); - temp.Dispose(); + _outputVisualMap.Add(MeshVisualProperty.ShadingMode, (int)shadingMode); } if (useMipmapping != null) { - temp = new PropertyValue((bool)useMipmapping); - _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, temp); - temp.Dispose(); + _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, (bool)useMipmapping); } if (useSoftNormals != null) { - temp = new PropertyValue((bool)useSoftNormals); - _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, temp); - temp.Dispose(); + _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, (bool)useSoftNormals); } base.ComposingPropertyMap(); } diff --git a/src/Tizen.NUI/src/public/Visuals/NPatchVisual.cs b/src/Tizen.NUI/src/public/Visuals/NPatchVisual.cs index 473c36a57ad..2f517a37f58 100755 --- a/src/Tizen.NUI/src/public/Visuals/NPatchVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/NPatchVisual.cs @@ -101,26 +101,17 @@ protected override void ComposingPropertyMap() if (url != null) { _outputVisualMap = new PropertyMap(); - PropertyValue temp = new PropertyValue((int)Visual.Type.NPatch); - _outputVisualMap.Add(Visual.Property.Type, temp); - temp.Dispose(); - - temp = new PropertyValue(url); - _outputVisualMap.Add(NpatchImageVisualProperty.URL, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Type, (int)Visual.Type.NPatch); + _outputVisualMap.Add(NpatchImageVisualProperty.URL, url); if (borderOnly != null) { - temp = new PropertyValue((bool)borderOnly); - _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, temp); - temp.Dispose(); + _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, (bool)borderOnly); } if (border != null) { - temp = new PropertyValue(border); - _outputVisualMap.Add(NpatchImageVisualProperty.Border, temp); - temp.Dispose(); + _outputVisualMap.Add(NpatchImageVisualProperty.Border, border); } base.ComposingPropertyMap(); } diff --git a/src/Tizen.NUI/src/public/Visuals/PrimitiveVisual.cs b/src/Tizen.NUI/src/public/Visuals/PrimitiveVisual.cs index e099479e4a4..dceb21320d0 100755 --- a/src/Tizen.NUI/src/public/Visuals/PrimitiveVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/PrimitiveVisual.cs @@ -312,92 +312,66 @@ public Vector3 LightPosition protected override void ComposingPropertyMap() { _outputVisualMap = new PropertyMap(); - PropertyValue temp = new PropertyValue((int)Visual.Type.Primitive); - _outputVisualMap.Add(Visual.Property.Type, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Type, (int)Visual.Type.Primitive); if (_shape != null) { - temp = new PropertyValue((int)_shape); - _outputVisualMap.Add(PrimitiveVisualProperty.Shape, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.Shape, (int)_shape); } if (_mixColorForPrimitiveVisual != null) { - temp = new PropertyValue(_mixColorForPrimitiveVisual); - _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, _mixColorForPrimitiveVisual); } if (_slices != null) { - temp = new PropertyValue((int)_slices); - _outputVisualMap.Add(PrimitiveVisualProperty.Slices, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.Slices, (int)_slices); } if (_stacks != null) { - temp = new PropertyValue((int)_stacks); - _outputVisualMap.Add(PrimitiveVisualProperty.Stacks, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.Stacks, (int)_stacks); } if (_scaleTopRadius != null) { - temp = new PropertyValue((float)_scaleTopRadius); - _outputVisualMap.Add(PrimitiveVisualProperty.ScaleTopRadius, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.ScaleTopRadius, (float)_scaleTopRadius); } if (_scaleBottomRadius != null) { - temp = new PropertyValue((float)_scaleBottomRadius); - _outputVisualMap.Add(PrimitiveVisualProperty.ScaleBottomRadius, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.ScaleBottomRadius, (float)_scaleBottomRadius); } if (_scaleHeight != null) { - temp = new PropertyValue((float)_scaleHeight); - _outputVisualMap.Add(PrimitiveVisualProperty.ScaleHeight, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.ScaleHeight, (float)_scaleHeight); } if (_scaleRadius != null) { - temp = new PropertyValue((float)_scaleRadius); - _outputVisualMap.Add(PrimitiveVisualProperty.ScaleRadius, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.ScaleRadius, (float)_scaleRadius); } if (_scaleDimensions != null) { - temp = new PropertyValue(_scaleDimensions); - _outputVisualMap.Add(PrimitiveVisualProperty.ScaleDimensions, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.ScaleDimensions, _scaleDimensions); } if (_bevelPercentage != null) { - temp = new PropertyValue((float)_bevelPercentage); - _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, (float)_bevelPercentage); } if (_bevelSmoothness != null) { - temp = new PropertyValue((float)_bevelSmoothness); - _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, (float)_bevelSmoothness); } if (_lightPosition != null) { - temp = new PropertyValue(_lightPosition); - _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, temp); - temp.Dispose(); + _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, _lightPosition); } base.ComposingPropertyMap(); } diff --git a/src/Tizen.NUI/src/public/Visuals/SVGVisual.cs b/src/Tizen.NUI/src/public/Visuals/SVGVisual.cs index 3e17c88041f..5dd8f55a7a0 100755 --- a/src/Tizen.NUI/src/public/Visuals/SVGVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/SVGVisual.cs @@ -59,12 +59,8 @@ protected override void ComposingPropertyMap() if (url != null) { _outputVisualMap = new PropertyMap(); - PropertyValue temp = new PropertyValue((int)Visual.Type.SVG); - _outputVisualMap.Add(Visual.Property.Type, temp); - temp.Dispose(); - temp = new PropertyValue(url); - _outputVisualMap.Add(ImageVisualProperty.URL, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Type, (int)Visual.Type.SVG); + _outputVisualMap.Add(ImageVisualProperty.URL, url); base.ComposingPropertyMap(); } } diff --git a/src/Tizen.NUI/src/public/Visuals/TextVisual.cs b/src/Tizen.NUI/src/public/Visuals/TextVisual.cs index 801a9b3a2b7..667a3e83b2a 100755 --- a/src/Tizen.NUI/src/public/Visuals/TextVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/TextVisual.cs @@ -353,83 +353,53 @@ protected override void ComposingPropertyMap() if (text != null) { - PropertyValue temp = new PropertyValue((int)Visual.Type.Text); - _outputVisualMap.Add(Visual.Property.Type, temp); - temp.Dispose(); - - temp = new PropertyValue(text); - _outputVisualMap.Add(TextVisualProperty.Text, temp); - temp.Dispose(); - - temp = new PropertyValue((float)pointSize); - _outputVisualMap.Add(TextVisualProperty.PointSize, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Type, (int)Visual.Type.Text); + _outputVisualMap.Add(TextVisualProperty.Text, text); + _outputVisualMap.Add(TextVisualProperty.PointSize, pointSize); if (fontFamily != null) { - temp = new PropertyValue(fontFamily); - _outputVisualMap.Add(TextVisualProperty.FontFamily, temp); - temp.Dispose(); + _outputVisualMap.Add(TextVisualProperty.FontFamily, fontFamily); } if (fontStyle != null) { - temp = new PropertyValue(fontStyle); - _outputVisualMap.Add(TextVisualProperty.FontStyle, temp); - temp.Dispose(); + _outputVisualMap.Add(TextVisualProperty.FontStyle, fontStyle); } if (multiLine != null) { - temp = new PropertyValue((bool)multiLine); - _outputVisualMap.Add(TextVisualProperty.MultiLine, temp); - temp.Dispose(); + _outputVisualMap.Add(TextVisualProperty.MultiLine, (bool)multiLine); } if (horizontalAlignment != null) { - temp = new PropertyValue(horizontalAlignment); - _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, temp); - temp.Dispose(); + _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, horizontalAlignment); } if (verticalAlignment != null) { - temp = new PropertyValue(verticalAlignment); - _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, temp); - temp.Dispose(); + _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, verticalAlignment); } if (textColor != null) { - temp = new PropertyValue(textColor); - _outputVisualMap.Add(TextVisualProperty.TextColor, temp); - temp.Dispose(); + _outputVisualMap.Add(TextVisualProperty.TextColor, textColor); } if (enableMarkup != null) { - temp = new PropertyValue((bool)enableMarkup); - _outputVisualMap.Add(TextVisualProperty.EnableMarkup, temp); - temp.Dispose(); + _outputVisualMap.Add(TextVisualProperty.EnableMarkup, (bool)enableMarkup); } if (shadow != null) { - temp = new PropertyValue(shadow); - _outputVisualMap.Add(TextVisualProperty.Shadow, temp); - temp.Dispose(); + _outputVisualMap.Add(TextVisualProperty.Shadow, shadow); } if (underline != null) { - temp = new PropertyValue(underline); - _outputVisualMap.Add(TextVisualProperty.Underline, temp); - temp.Dispose(); + _outputVisualMap.Add(TextVisualProperty.Underline, underline); } if (outline != null) { - temp = new PropertyValue(outline); - _outputVisualMap.Add(TextVisualProperty.Outline, temp); - temp.Dispose(); + _outputVisualMap.Add(TextVisualProperty.Outline, outline); } if (background != null) { - temp = new PropertyValue(background); - _outputVisualMap.Add(TextVisualProperty.Background, temp); - temp.Dispose(); + _outputVisualMap.Add(TextVisualProperty.Background, background); } base.ComposingPropertyMap(); } diff --git a/src/Tizen.NUI/src/public/Visuals/VisualAnimator.cs b/src/Tizen.NUI/src/public/Visuals/VisualAnimator.cs index 23597e91a47..0bd4c14654d 100755 --- a/src/Tizen.NUI/src/public/Visuals/VisualAnimator.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualAnimator.cs @@ -143,22 +143,13 @@ public object DestinationValue protected override void ComposingPropertyMap() { PropertyMap animator = new PropertyMap(); - PropertyValue temp = new PropertyValue(alphaFunction); - animator.Add("alphaFunction", temp); - temp.Dispose(); + animator.Add("alphaFunction", alphaFunction); PropertyMap timePeriod = new PropertyMap(); - temp = new PropertyValue((endTime - startTime) / 1000.0f); - timePeriod.Add("duration", temp); - temp.Dispose(); + timePeriod.Add("duration", (endTime - startTime) / 1000.0f); + timePeriod.Add("delay", startTime / 1000.0f); - temp = new PropertyValue(startTime / 1000.0f); - timePeriod.Add("delay", temp); - temp.Dispose(); - - temp = new PropertyValue(timePeriod); - animator.Add("timePeriod", temp); - temp.Dispose(); + animator.Add("timePeriod", animator); StringBuilder sb = new StringBuilder(propertyIndex); sb[0] = (char)(sb[0] | 0x20); @@ -167,18 +158,11 @@ protected override void ComposingPropertyMap() PropertyValue val = PropertyValue.CreateFromObject(destinationValue); PropertyMap transition = new PropertyMap(); - temp = new PropertyValue(target); - transition.Add("target", temp); - temp.Dispose(); - - temp = new PropertyValue(str); - transition.Add("property", temp); - temp.Dispose(); + transition.Add("target", target); + transition.Add("property", str); transition.Add("targetValue", val); - temp = new PropertyValue(animator); - transition.Add("animator", temp); - temp.Dispose(); + transition.Add("animator", transition); _outputVisualMap = transition; base.ComposingPropertyMap(); diff --git a/src/Tizen.NUI/src/public/Visuals/VisualMaps.cs b/src/Tizen.NUI/src/public/Visuals/VisualMaps.cs index 5521c788240..02c69b0fd04 100755 --- a/src/Tizen.NUI/src/public/Visuals/VisualMaps.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualMaps.cs @@ -745,63 +745,43 @@ protected virtual void ComposingPropertyMap() if (_shader != null) { - PropertyValue temp = new PropertyValue(_shader); - _outputVisualMap.Add(Visual.Property.Shader, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Shader, _shader); } if (_premultipliedAlpha != null) { - PropertyValue temp = new PropertyValue((bool)_premultipliedAlpha); - _outputVisualMap.Add(Visual.Property.PremultipliedAlpha, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.PremultipliedAlpha, (bool)_premultipliedAlpha); } if (_mixColor != null) { - PropertyValue temp = new PropertyValue(_mixColor); - _outputVisualMap.Add(Visual.Property.MixColor, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.MixColor, _mixColor); } if (_opacity != null) { - PropertyValue temp = new PropertyValue((float)_opacity); - _outputVisualMap.Add(Visual.Property.Opacity, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.Opacity, (float)_opacity); } if (_visualFittingMode != null) { - PropertyValue temp = new PropertyValue((int)_visualFittingMode); - _outputVisualMap.Add(Visual.Property.VisualFittingMode, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.VisualFittingMode, (int)_visualFittingMode); } if (cornerRadius != null) { - PropertyValue temp = new PropertyValue(cornerRadius); - _outputVisualMap.Add(Visual.Property.CornerRadius, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.CornerRadius, cornerRadius); } if (cornerRadiusPolicy != null) { - PropertyValue temp = new PropertyValue((int)cornerRadiusPolicy); - _outputVisualMap.Add(Visual.Property.CornerRadiusPolicy, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.CornerRadiusPolicy, (int)cornerRadiusPolicy); } if (borderlineWidth != null) { - PropertyValue temp = new PropertyValue((float)borderlineWidth); - _outputVisualMap.Add(Visual.Property.BorderlineWidth, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.BorderlineWidth, (float)borderlineWidth); } if (borderlineColor != null) { - PropertyValue temp = new PropertyValue(borderlineColor); - _outputVisualMap.Add(Visual.Property.BorderlineColor, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.BorderlineColor, borderlineColor); } if (borderlineOffset != null) { - PropertyValue temp = new PropertyValue((float)borderlineOffset); - _outputVisualMap.Add(Visual.Property.BorderlineOffset, temp); - temp.Dispose(); + _outputVisualMap.Add(Visual.Property.BorderlineOffset, (float)borderlineOffset); } } @@ -810,39 +790,27 @@ private void ComposingTransformMap() visualTransformMap = new PropertyMap(); if (visualSize != null) { - PropertyValue temp = new PropertyValue(visualSize); - visualTransformMap.Add((int)VisualTransformPropertyType.Size, temp); - temp.Dispose(); + visualTransformMap.Add((int)VisualTransformPropertyType.Size, visualSize); } if (visualOffset != null) { - PropertyValue temp = new PropertyValue(visualOffset); - visualTransformMap.Add((int)VisualTransformPropertyType.Offset, temp); - temp.Dispose(); + visualTransformMap.Add((int)VisualTransformPropertyType.Offset, visualOffset); } if (visualOffsetPolicy != null) { - PropertyValue temp = new PropertyValue(visualOffsetPolicy); - visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, temp); - temp.Dispose(); + visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, visualOffsetPolicy); } if (visualSizePolicy != null) { - PropertyValue temp = new PropertyValue(visualSizePolicy); - visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, temp); - temp.Dispose(); + visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, visualSizePolicy); } if (visualOrigin != null) { - PropertyValue temp = new PropertyValue((int)visualOrigin); - visualTransformMap.Add((int)VisualTransformPropertyType.Origin, temp); - temp.Dispose(); + visualTransformMap.Add((int)VisualTransformPropertyType.Origin, (int)visualOrigin); } if (visualAnchorPoint != null) { - PropertyValue temp = new PropertyValue((int)visualAnchorPoint); - visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, temp); - temp.Dispose(); + visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, (int)visualAnchorPoint); } } diff --git a/src/Tizen.NUI/src/public/Visuals/VisualObject/AnimatedImageVisual.cs b/src/Tizen.NUI/src/public/Visuals/VisualObject/AnimatedImageVisual.cs index 3f8fc462fc5..bf1d6610e07 100644 --- a/src/Tizen.NUI/src/public/Visuals/VisualObject/AnimatedImageVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualObject/AnimatedImageVisual.cs @@ -299,13 +299,12 @@ internal override void OnUpdateVisualPropertyMap() using var urlValue = new PropertyValue(url); urlArray.Add(urlValue); } - using var urlArrayValue = new PropertyValue(urlArray); if (cachedVisualPropertyMap != null) { // Remove ResourceUrl from cachedVisualPropertyMap cachedVisualPropertyMap.Remove((int)Tizen.NUI.ImageVisualProperty.URL); - cachedVisualPropertyMap.Add((int)Tizen.NUI.ImageVisualProperty.URL, urlArrayValue); + cachedVisualPropertyMap.Add((int)Tizen.NUI.ImageVisualProperty.URL, urlArray); } } else