[NUI][API10] Change property get/set not to use PropertyValue (patch set5)
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 20 Oct 2022 10:21:46 +0000 (19:21 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 20 Oct 2022 10:37:43 +0000 (19:37 +0900)
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/Tizen.NUI.csproj
src/Tizen.NUI/src/internal/Interop/Interop.View.cs
src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs
src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs
src/Tizen.NUI/src/public/Visuals/VisualConstants.cs

index 35761fe5bec240c7ce59f4087fffef293def6cb8..93e8196a38bd9ec82b4b79c553ab909bc0b27835 100755 (executable)
@@ -5,7 +5,7 @@
         <LangVersion>8.0</LangVersion>
     </PropertyGroup>
     <PropertyGroup>
-        <DefineConstants>NUI_DEBUG_OFF;NUI_PROPERTY_CHANGE_1;NUI_PROPERTY_CHANGE_2;NUI_PROPERTY_CHANGE_3;</DefineConstants>
+        <DefineConstants>NUI_DEBUG_OFF;NUI_PROPERTY_CHANGE_1;NUI_PROPERTY_CHANGE_2;NUI_PROPERTY_CHANGE_3;NUI_VISUAL_PROPERTY_CHANGE_1;</DefineConstants>
     </PropertyGroup>
     <ItemGroup>
         <TizenPreloadFile Include="Tizen.NUI.preload"
index 51010075be15b0ab3c5642dd0c897f6f81f9de66..3ecaca74d12d0a3bb8616b48d911966d4fead2c2 100755 (executable)
@@ -15,6 +15,8 @@
  *
  */
 
+using global::System.Runtime.InteropServices;
+
 namespace Tizen.NUI
 {
     internal static partial class Interop
@@ -85,6 +87,29 @@ namespace Tizen.NUI
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_DoActionExtension")]
             public static extern void DoActionExtension(global::System.Runtime.InteropServices.HandleRef control, int visualIndex, int actionId, int id, string keyPath, int property, global::System.IntPtr callback);
+
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_DoActionWithEmptyAttributes")]
+            public static extern void DoActionWithEmptyAttributes(HandleRef control, int visualIndex, int actionId);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_InternalUpdateVisualPropertyFloat")]
+            public static extern int InternalUpdateVisualPropertyFloat(HandleRef control, int visualIndex, int visualPropertyIndex, float valFloat);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_InternalUpdateVisualPropertyInt")]
+            public static extern int InternalUpdateVisualPropertyInt(HandleRef control, int visualIndex, int visualPropertyIndex, int valInt);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_InternalUpdateVisualPropertyVector4")]
+            public static extern int InternalUpdateVisualPropertyVector4(HandleRef control, int visualIndex, int visualPropertyIndex, HandleRef vector4);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_InternalRetrievingVisualPropertyInt")]
+            public static extern int InternalRetrievingVisualPropertyInt(HandleRef actor,  int visualIndex, int visualPropertyIndex, out int valInt);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_InternalRetrievingVisualPropertyString")]
+            public static extern int InternalRetrievingVisualPropertyString(HandleRef actor,  int visualIndex, int visualPropertyIndex, out string valString);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_InternalRetrievingVisualPropertyVector4")]
+            public static extern int InternalRetrievingVisualPropertyVector4(HandleRef actor,  int visualIndex, int visualPropertyIndex, HandleRef retrievingVector4);
+#endif
         }
     }
 }
index 725010b11fbae5ab4d912dfa7f6bfd3a1aa4b662..91a90f9253efcecd772ba4c1382989b7b3c3aff8 100755 (executable)
@@ -669,9 +669,13 @@ PixelAreaSetter++;
             // Sync as current properties
             UpdateImage();
 
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            Interop.View.DoActionWithEmptyAttributes(this.SwigCPtr, ImageView.Property.IMAGE, ActionReload);
+#else
             PropertyValue attributes = new PropertyValue(0);
             this.DoAction(ImageView.Property.IMAGE, ActionReload, attributes);
             attributes?.Dispose();
+#endif
         }
 
         /// <summary>
@@ -683,9 +687,13 @@ PixelAreaSetter++;
             // Sync as current properties
             UpdateImage();
 
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            Interop.View.DoActionWithEmptyAttributes(this.SwigCPtr, ImageView.Property.IMAGE, ActionPlay);
+#else
             PropertyValue attributes = new PropertyValue(0);
             this.DoAction(ImageView.Property.IMAGE, ActionPlay, attributes);
             attributes?.Dispose();
+#endif
         }
 
         /// <summary>
@@ -697,9 +705,13 @@ PixelAreaSetter++;
             // Sync as current properties
             UpdateImage();
 
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            Interop.View.DoActionWithEmptyAttributes(this.SwigCPtr, ImageView.Property.IMAGE, ActionPause);
+#else
             PropertyValue attributes = new PropertyValue(0);
             this.DoAction(ImageView.Property.IMAGE, ActionPause, attributes);
             attributes?.Dispose();
+#endif
         }
 
         /// <summary>
@@ -711,9 +723,14 @@ PixelAreaSetter++;
             // Sync as current properties
             UpdateImage();
 
+
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            Interop.View.DoActionWithEmptyAttributes(this.SwigCPtr, ImageView.Property.IMAGE, ActionStop);
+#else
             PropertyValue attributes = new PropertyValue(0);
             this.DoAction(ImageView.Property.IMAGE, ActionStop, attributes);
             attributes?.Dispose();
+#endif
         }
 
         /// <summary>
@@ -1208,6 +1225,14 @@ PixelAreaSetter++;
 
             if (backgroundExtraData == null) return;
 
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            // Update corner radius properties to image by ActionUpdateProperty
+            if (backgroundExtraData.CornerRadius != null)
+            {
+                Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius));
+            }
+            Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy);
+#else
             // Apply corner radius to IMAGE.
             var cornerRadiusValue = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius);
             var cornerRadiusPolicyValue = new PropertyValue((int)backgroundExtraData.CornerRadiusPolicy);
@@ -1225,6 +1250,7 @@ PixelAreaSetter++;
             currentPropertyMap.Dispose();
             cornerRadiusValue.Dispose();
             cornerRadiusPolicyValue.Dispose();
+#endif
         }
 
         internal override void ApplyBorderline()
@@ -1233,6 +1259,12 @@ PixelAreaSetter++;
 
             if (backgroundExtraData == null) return;
 
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            // Update borderline properties to image by ActionUpdateProperty
+            Interop.View.InternalUpdateVisualPropertyFloat(this.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.BorderlineWidth, backgroundExtraData.BorderlineWidth);
+            Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.BorderlineColor, Vector4.getCPtr(backgroundExtraData.BorderlineColor ?? Color.Black));
+            Interop.View.InternalUpdateVisualPropertyFloat(this.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.BorderlineOffset, backgroundExtraData.BorderlineOffset);
+#else
             // Apply borderline to IMAGE.
             var borderlineWidthValue = new PropertyValue(backgroundExtraData.BorderlineWidth);
             var borderlineColorValue = backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor);
@@ -1253,6 +1285,7 @@ PixelAreaSetter++;
             borderlineWidthValue.Dispose();
             borderlineColorValue.Dispose();
             borderlineOffsetValue.Dispose();
+#endif
         }
 
         internal ResourceLoadingStatusType GetResourceStatus()
index 77ab5adef15d9e9f4e8ae7b42be3a7a0ae8cb84c..143fa9170506dd34c086af2f0e3d18d164e8c023 100755 (executable)
@@ -87,8 +87,8 @@ namespace Tizen.NUI.BaseComponents
         private string internalName = string.Empty;
 #endif
 #if NUI_PROPERTY_CHANGE_3
-        private Vector3 internalCurrentParentOrigin = null;
-        private Vector3 internalCurrentAnchorPoint = null;
+        private Position internalCurrentParentOrigin = null;
+        private Position internalCurrentAnchorPoint = null;
         private Vector3 internalTargetSize = null;
         private Size2D internalCurrentSize = null;
         private Vector3 internalNaturalSize = null;
@@ -99,6 +99,9 @@ namespace Tizen.NUI.BaseComponents
         private Vector4 internalCurrentColor = null;
         private Vector4 internalCurrentWorldColor = null;
 #endif
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+        private Vector2 internalCurrentScreenPosition = null;
+#endif
 
         static View()
         {
@@ -1348,11 +1351,7 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                Vector2 temp = new Vector2(0.0f, 0.0f);
-                var pValue = GetProperty(View.Property.ScreenPosition);
-                pValue.Get(temp);
-                pValue.Dispose();
-                return temp;
+                return GetCurrentScreenPosition();
             }
         }
 
@@ -1404,17 +1403,25 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
+#else
                 bool temp = false;
                 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
                 pValue.Get(out temp);
                 pValue.Dispose();
                 return temp;
+#endif
             }
             set
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
+#else
                 var temp = new Tizen.NUI.PropertyValue(value);
                 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
                 temp.Dispose();
+#endif
                 NotifyPropertyChanged();
             }
         }
@@ -1736,11 +1743,15 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                return GetCurrentWorldPosition();
+#else
                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
                 var pValue = GetProperty(View.Property.WorldPosition);
                 pValue.Get(temp);
                 pValue.Dispose();
                 return temp;
+#endif
             }
         }
 
@@ -1909,11 +1920,15 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                return GetCurrentWorldScale();
+#else
                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
                 var pValue = GetProperty(View.Property.WorldScale);
                 pValue.Get(temp);
                 pValue.Dispose();
                 return temp;
+#endif
             }
         }
 
@@ -1937,11 +1952,15 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
+#else
                 bool temp = false;
                 var pValue = GetProperty(View.Property.VISIBLE);
                 pValue.Get(out temp);
                 pValue.Dispose();
                 return temp;
+#endif
             }
         }
 
@@ -1953,11 +1972,15 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                return GetCurrentWorldColor();
+#else
                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
                 var pValue = GetProperty(View.Property.WorldColor);
                 pValue.Get(temp);
                 pValue.Dispose();
                 return temp;
+#endif
             }
         }
 
@@ -2418,6 +2441,9 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                return GetCurrentAnchorPoint();
+#else
                 Position temp = new Position(0.0f, 0.0f, 0.0f);
                 var pValue = GetProperty(View.Property.AnchorPoint);
                 pValue.Get(temp);
@@ -2425,12 +2451,17 @@ namespace Tizen.NUI.BaseComponents
                 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
                 temp.Dispose();
                 return ret;
+#endif
             }
             set
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                SetAnchorPoint(value);
+#else
                 var temp = new Tizen.NUI.PropertyValue(value);
                 SetProperty(View.Property.AnchorPoint, temp);
                 temp.Dispose();
+#endif
                 NotifyPropertyChanged();
             }
         }
@@ -3095,12 +3126,16 @@ namespace Tizen.NUI.BaseComponents
             {
                 backgroundImageSynchronousLoading = value;
 
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                if (!string.IsNullOrEmpty(BackgroundImage))
+#else
                 string bgUrl = null;
                 var pValue = Background.Find(ImageVisualProperty.URL);
                 pValue?.Get(out bgUrl);
                 pValue?.Dispose();
 
                 if (!string.IsNullOrEmpty(bgUrl))
+#endif
                 {
                     PropertyMap bgMap = this.Background;
                     var temp = new PropertyValue(backgroundImageSynchronousLoading);
@@ -3229,17 +3264,25 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
+#else
                 bool temp = false;
                 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
                 pValue.Get(out temp);
                 pValue.Dispose();
                 return temp;
+#endif
             }
             set
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
+#else
                 var temp = new Tizen.NUI.PropertyValue(value);
                 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
                 temp.Dispose();
+#endif
                 NotifyPropertyChanged();
             }
         }
@@ -3265,17 +3308,25 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
+#else
                 bool temp = false;
                 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
                 pValue.Get(out temp);
                 pValue.Dispose();
                 return temp;
+#endif
             }
             set
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
+#else
                 var temp = new Tizen.NUI.PropertyValue(value);
                 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
                 temp.Dispose();
+#endif
                 NotifyPropertyChanged();
             }
         }
@@ -3302,17 +3353,25 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
+#else
                 int temp = 0;
                 var pValue = GetProperty(View.Property.BlendEquation);
                 pValue.Get(out temp);
                 pValue.Dispose();
                 return (BlendEquationType)temp;
+#endif
             }
             set
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
+#else
                 var temp = new Tizen.NUI.PropertyValue((int)value);
                 SetProperty(View.Property.BlendEquation, temp);
                 temp.Dispose();
+#endif
                 NotifyPropertyChanged();
             }
         }
@@ -3422,11 +3481,15 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
+#else
                 bool temp = false;
                 var pValue = GetProperty(View.Property.Culled);
                 pValue.Get(out temp);
                 pValue.Dispose();
                 return temp;
+#endif
             }
         }
 
index 22a51ebce94ccf660f9547b298c5d5a9d1c07ca2..753c85eacc9dcfd708db4a4e647f122f46124afd 100755 (executable)
@@ -130,6 +130,14 @@ namespace Tizen.NUI.BaseComponents
                     view.internalBackgroundColor = new Color(view.OnBackgroundColorChanged, 0, 0, 0, 0);
                 }
 
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                int visualType = (int)Visual.Type.Invalid;
+                Interop.View.InternalRetrievingVisualPropertyInt(view.SwigCPtr, Property.BACKGROUND, Visual.Property.Type, out visualType);
+                if (visualType == (int)Visual.Type.Color)
+                {
+                    Interop.View.InternalRetrievingVisualPropertyVector4(view.SwigCPtr, Property.BACKGROUND, ColorVisualProperty.MixColor, Color.getCPtr(view.internalBackgroundColor));
+                }
+#else
                 PropertyMap background = view.Background;
                 int visualType = 0;
                 background.Find(Visual.Property.Type)?.Get(out visualType);
@@ -140,7 +148,7 @@ namespace Tizen.NUI.BaseComponents
 
                 background?.Dispose();
                 background = null;
-
+#endif
                 return view.internalBackgroundColor;
             }
         );
@@ -287,11 +295,15 @@ namespace Tizen.NUI.BaseComponents
                 var view = (View)bindable;
                 string backgroundImage = "";
 
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+                Interop.View.InternalRetrievingVisualPropertyString(view.SwigCPtr, Property.BACKGROUND, ImageVisualProperty.URL, out backgroundImage);
+#else
                 PropertyMap background = view.Background;
                 background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
 
                 background.Dispose();
                 background = null;
+#endif
 
                 return backgroundImage;
             }
index 7cffd69678957785bc033066a6efb55e502dc72a..6eb72730c8ee60aa9546ea44914caed3b67ca6c7 100755 (executable)
@@ -629,30 +629,30 @@ namespace Tizen.NUI.BaseComponents
             return FindChildById(id);
         }
 
-        internal void SetParentOrigin(Vector3 origin)
+        internal void SetParentOrigin(Position origin)
         {
-            Interop.ActorInternal.SetParentOrigin(SwigCPtr, Vector3.getCPtr(origin));
+            Interop.ActorInternal.SetParentOrigin(SwigCPtr, Position.getCPtr(origin));
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal Vector3 GetCurrentParentOrigin()
+        internal Position GetCurrentParentOrigin()
         {
 #if NUI_PROPERTY_CHANGE_3
             if(internalCurrentParentOrigin == null)
             {
-                internalCurrentParentOrigin = new Vector3(0, 0, 0);
+                internalCurrentParentOrigin = new Position(0, 0, 0);
             }
-            
+
             Interop.ActorInternal.RetrieveCurrentPropertyVector3(SwigCPtr, View.Property.ParentOrigin, internalCurrentParentOrigin.SwigCPtr);
-            
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
             {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             }
             return internalCurrentParentOrigin;
 #else
-            Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentParentOrigin(SwigCPtr), true);
+            Position ret = new Position(Interop.ActorInternal.GetCurrentParentOrigin(SwigCPtr), true);
 
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
@@ -660,30 +660,30 @@ namespace Tizen.NUI.BaseComponents
 #endif            
         }
 
-        internal void SetAnchorPoint(Vector3 anchorPoint)
+        internal void SetAnchorPoint(Position anchorPoint)
         {
-            Interop.Actor.SetAnchorPoint(SwigCPtr, Vector3.getCPtr(anchorPoint));
+            Interop.Actor.SetAnchorPoint(SwigCPtr, Position.getCPtr(anchorPoint));
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal Vector3 GetCurrentAnchorPoint()
+        internal Position GetCurrentAnchorPoint()
         {
 #if NUI_PROPERTY_CHANGE_3
             if(internalCurrentAnchorPoint == null)
             {
-                internalCurrentAnchorPoint = new Vector3(0, 0, 0);
+                internalCurrentAnchorPoint = new Position(0, 0, 0);
             }
-            
+
             Interop.ActorInternal.RetrieveCurrentPropertyVector3(SwigCPtr, View.Property.AnchorPoint, internalCurrentAnchorPoint.SwigCPtr);
-            
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
             {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             }
             return internalCurrentAnchorPoint;
 #else
-            Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentAnchorPoint(SwigCPtr), true);
+            Position ret = new Position(Interop.ActorInternal.GetCurrentAnchorPoint(SwigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
@@ -837,7 +837,6 @@ namespace Tizen.NUI.BaseComponents
             return ret;
 #endif
         }
-
         internal Vector3 GetCurrentWorldPosition()
         {
 #if NUI_PROPERTY_CHANGE_3
@@ -861,6 +860,30 @@ namespace Tizen.NUI.BaseComponents
 #endif
         }
 
+        internal Vector2 GetCurrentScreenPosition()
+        {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            if(internalCurrentScreenPosition == null)
+            {
+                internalCurrentScreenPosition = new Vector2(0, 0);
+            }
+
+            Object.InternalRetrievingPropertyVector2(SwigCPtr, View.Property.ScreenPosition, internalCurrentScreenPosition.SwigCPtr);
+
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+            return internalCurrentScreenPosition;
+#else
+            Vector2 temp = new Vector2(0.0f, 0.0f);
+            var pValue = GetProperty(View.Property.ScreenPosition);
+            pValue.Get(temp);
+            pValue.Dispose();
+            return temp;
+#endif
+        }
+
         internal void SetInheritPosition(bool inherit)
         {
             Interop.ActorInternal.SetInheritPosition(SwigCPtr, inherit);
@@ -1284,6 +1307,21 @@ namespace Tizen.NUI.BaseComponents
             return false;
         }
 
+        /// <summary>
+        /// Check whether Current view don't has BackgroundVisual or not.
+        /// Some API (like Animation, Borderline) required non-empty backgrounds.
+        /// </summary>
+        internal bool IsBackgroundEmpty()
+        {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            int visualType = (int)Visual.Type.Invalid;
+            Interop.View.InternalRetrievingVisualPropertyInt(this.SwigCPtr, Property.BACKGROUND, Visual.Property.Type, out visualType);
+            return visualType == (int)Visual.Type.Invalid;
+#else
+            return Background.Empty();
+#endif
+        }
+
         internal void SetKeyInputFocus()
         {
             Interop.ViewInternal.SetKeyInputFocus(SwigCPtr);
@@ -1376,6 +1414,16 @@ namespace Tizen.NUI.BaseComponents
         {
             if (backgroundExtraData == null) return;
 
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            // Update corner radius properties to background and shadow by ActionUpdateProperty
+            if (backgroundExtraData.CornerRadius != null)
+            {
+                Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius));
+                Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.SHADOW, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius));
+            }
+            Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy);
+            Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, View.Property.SHADOW, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy);
+#else
             var cornerRadiusValue = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius);
             var cornerRadiusPolicyValue = new PropertyValue((int)backgroundExtraData.CornerRadiusPolicy);
 
@@ -1393,6 +1441,7 @@ namespace Tizen.NUI.BaseComponents
             currentPropertyMap.Dispose();
             cornerRadiusValue.Dispose();
             cornerRadiusPolicyValue.Dispose();
+#endif
         }
 
         /// TODO open as a protected level
@@ -1400,6 +1449,23 @@ namespace Tizen.NUI.BaseComponents
         {
             if (backgroundExtraData == null) return;
 
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            // ActionUpdateProperty works well only if BACKGROUND visual setup before.
+            // If view don't have BACKGROUND visual, we set transparent background color in default.
+            if (IsBackgroundEmpty())
+            {
+                // BACKGROUND visual doesn't exist.
+                SetBackgroundColor(Color.Transparent);
+                // SetBackgroundColor function apply borderline internally.
+                // So we can just return now.
+                return;
+            }
+
+            // Update borderline properties to background by ActionUpdateProperty
+            Interop.View.InternalUpdateVisualPropertyFloat(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.BorderlineWidth, backgroundExtraData.BorderlineWidth);
+            Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.BorderlineColor, Vector4.getCPtr(backgroundExtraData.BorderlineColor ?? Color.Black));
+            Interop.View.InternalUpdateVisualPropertyFloat(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.BorderlineOffset, backgroundExtraData.BorderlineOffset);
+#else
             // ActionUpdateProperty works well only if BACKGROUND visual setup before.
             // If view don't have BACKGROUND visual, we set transparent background color in default.
             using (PropertyMap backgroundPropertyMap = new PropertyMap())
@@ -1437,6 +1503,7 @@ namespace Tizen.NUI.BaseComponents
             borderlineWidthValue.Dispose();
             borderlineColorValue.Dispose();
             borderlineOffsetValue.Dispose();
+#endif
         }
 
         /// <summary>
@@ -1548,6 +1615,10 @@ namespace Tizen.NUI.BaseComponents
             internalSizeModeFactor?.Dispose();
             internalSizeModeFactor = null;
 #endif
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            internalCurrentScreenPosition?.Dispose();
+            internalCurrentScreenPosition = null;
+#endif
 
             if (type == DisposeTypes.Explicit)
             {
index 50724b90d7d4db351bdf6d3cd0bbdd189646b708..d595446146c20dad5f789fc8200c39af68fdb3b1 100755 (executable)
@@ -54,6 +54,14 @@ namespace Tizen.NUI.BaseComponents
                                                  AlphaFunction.BuiltinFunctions? alphaFunction = null,
                                                  object initialValue = null)
         {
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+            if (IsBackgroundEmpty())
+            {
+                // If there is no background yet, ensure there is a transparent
+                // color visual
+                BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
+            }
+#else
             Tizen.NUI.PropertyMap background = Background;
 
             if (background.Empty())
@@ -63,6 +71,7 @@ namespace Tizen.NUI.BaseComponents
                 BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
                 background = Background;
             }
+#endif
             return AnimateColor("background", destinationValue, startTime, endTime, alphaFunction, initialValue);
         }
 
index 595fce772fd9201edfa83fb575119f0d954d328e..23df9cacb6c08692b1fc360fc05203828c013dc0 100755 (executable)
@@ -445,6 +445,12 @@ namespace Tizen.NUI
             /// </summary>
             [EditorBrowsable(EditorBrowsableState.Never)]
             Arc = AnimatedImage + 3,
+
+            /// <summary>
+            /// Keyword for invalid visual type. (NUI only)
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Invalid = Border - 1,
         }
 
         /// <summary>