[NUI] nui 0.2.61.1 integration 08/158608/6
authordongsug.song <dongsug.song@samsung.com>
Thu, 2 Nov 2017 06:29:06 +0000 (15:29 +0900)
committerhuiyu,eun <huiyu.eun@samsung.com>
Thu, 2 Nov 2017 09:27:09 +0000 (18:27 +0900)
the following patches are integrated
- Stop deleting ViewWrapperImpl native object from C# side as native handle will take care of it.
- Adding ImageVisual OrientationCorrection
- Adding ImageVisual ReleasePolicy & LoadPolicy

Conflicts:
    src/Tizen.NUI/src/public/NUIConstants.cs

Change-Id: If662906f7aa8fdbe992dfae721bd4118d62ace5e
Signed-off-by: dongsug.song <dongsug.song@samsung.com>
src/Tizen.NUI/src/internal/NDalic.cs
src/Tizen.NUI/src/internal/NDalicPINVOKE.cs
src/Tizen.NUI/src/internal/ViewWrapperImpl.cs
src/Tizen.NUI/src/public/NUIConstants.cs
src/Tizen.NUI/src/public/VisualMaps.cs

index ef7d80a..1b62c0a 100755 (executable)
@@ -886,7 +886,9 @@ namespace Tizen.NUI
         internal static readonly int IMAGE_VISUAL_FRAME_DELAY = NDalicPINVOKE.IMAGE_VISUAL_FRAME_DELAY_get();
         internal static readonly int IMAGE_VISUAL_MASK_CONTENT_SCALE = NDalicPINVOKE.IMAGE_VISUAL_MASK_CONTENT_SCALE_get();
         internal static readonly int IMAGE_VISUAL_CROP_TO_MASK = NDalicPINVOKE.IMAGE_VISUAL_CROP_TO_MASK_get();
-
+        internal static readonly int IMAGE_VISUAL_RELEASE_POLICY = NDalicPINVOKE.IMAGE_VISUAL_RELEASE_POLICY_get();
+        internal static readonly int IMAGE_VISUAL_LOAD_POLICY = NDalicPINVOKE.IMAGE_VISUAL_LOAD_POLICY_get();
+        internal static readonly int IMAGE_VISUAL_ORIENTATION_CORRECTION = NDalicPINVOKE.IMAGE_VISUAL_ORIENTATION_CORRECTION_get();
         internal static readonly int MESH_VISUAL_OBJECT_URL = NDalicPINVOKE.MESH_VISUAL_OBJECT_URL_get();
         internal static readonly int MESH_VISUAL_MATERIAL_URL = NDalicPINVOKE.MESH_VISUAL_MATERIAL_URL_get();
         internal static readonly int MESH_VISUAL_TEXTURES_PATH = NDalicPINVOKE.MESH_VISUAL_TEXTURES_PATH_get();
index b5693d1..61cb7ba 100755 (executable)
@@ -6631,6 +6631,15 @@ class NDalicPINVOKE {
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_CROP_TO_MASK_get")]
   public static extern int IMAGE_VISUAL_CROP_TO_MASK_get();
 
+  [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_RELEASE_POLICY_get")]
+  public static extern int IMAGE_VISUAL_RELEASE_POLICY_get();
+
+  [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_LOAD_POLICY_get")]
+  public static extern int IMAGE_VISUAL_LOAD_POLICY_get();
+
+  [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint ="CSharp_Dali_IMAGE_VISUAL_ORIENTATION_CORRECTION_get")]
+  public static extern int IMAGE_VISUAL_ORIENTATION_CORRECTION_get();
+
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_MESH_VISUAL_OBJECT_URL_get")]
   public static extern int MESH_VISUAL_OBJECT_URL_get();
 
index 3735036..c1cb572 100755 (executable)
@@ -170,7 +170,6 @@ namespace Tizen.NUI
                 if (swigCMemOwn)
                 {
                     swigCMemOwn = false;
-                    NDalicManualPINVOKE.delete_ViewWrapperImpl(swigCPtr);
                 }
                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
             }
index 2e47cb3..b1297d7 100755 (executable)
@@ -650,6 +650,45 @@ namespace Tizen.NUI
     }
 
     /// <summary>
+    /// Specifies the Release Policy types <br />
+    /// Decides if the image should be cached in different conditions
+    /// </summary>
+    /// <since_tizen> 5 </since_tizen>
+    public enum ReleasePolicyType
+    {
+      /// <summary>
+      /// Image is released when visual detached from scene
+      /// </summary>
+      Detached = 0,
+      /// <summary>
+      /// Image is only released when visual is destroyed
+      /// </summary>
+      Destroyed,
+      /// <summary>
+      /// Image is not released.
+      /// </summary>
+      Never
+    }
+
+    /// <summary>
+    /// Specifies the Load Policy types <br />
+    /// Decides when the image texture should be loaded
+    /// </summary>
+    /// <since_tizen> 5 </since_tizen>
+    public enum LoadPolicyType
+    {
+       /// <summary>
+       /// Load texture once the image source has been provided. Even if not being used yet.
+       /// </summary>
+       Immediate = 0,
+       /// <summary>
+       /// Only load texture once the visual is attached, when the image needs to be shown.
+       /// </summary>
+       Attached
+    }
+
+
+    /// <summary>
     /// The type of coordinate system for certain attributes of the points in a gradient.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
@@ -1216,12 +1255,20 @@ namespace Tizen.NUI
         /// <since_tizen> 4 </since_tizen>
         public static readonly int FrameDelay = NDalic.IMAGE_VISUAL_FRAME_DELAY;
         /// <summary>
-        /// Whether to corrcet orientation of image
+        /// The policy to determine when an image should no longer be cached
         /// </summary>
         /// <since_tizen> 5 </since_tizen>
-        /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly int OrientationCorrection = CropToMask + 3;
+        public static readonly int ReleasePolicy = NDalic.IMAGE_VISUAL_RELEASE_POLICY;
+        /// <summary>
+        /// The policy to determine when an image should be loaded
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        public static readonly int LoadPolicy = NDalic.IMAGE_VISUAL_LOAD_POLICY;
+        /// <summary>
+        /// Determines if image orientation should be corrected so the image displays as it was intended
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        public static readonly int OrientationCorrection = NDalic.IMAGE_VISUAL_ORIENTATION_CORRECTION;
     }
 
     /// <summary>
@@ -2347,4 +2394,4 @@ namespace Tizen.NUI
         Character
     }
 
-}
\ No newline at end of file
+}
index 3d4c996..261a510 100755 (executable)
  *
  */
 
+using System.Text;
+using System.Collections.Generic;
+using Tizen.NUI.BaseComponents;
+using System.ComponentModel;
 
 namespace Tizen.NUI
 {
-    using System.Text;
-    using System.Collections.Generic;
-    using Tizen.NUI.BaseComponents;
-
     /// <summary>
     /// A class encapsulating the transform map of the visual.
     /// </summary>
@@ -636,6 +636,9 @@ namespace Tizen.NUI
         private WrapModeType? _wrapModeV = null;
         private float? _maskContentScale = null;
         private bool? _cropToMask = null;
+        private ReleasePolicyType? _releasePolicy = null;
+        private LoadPolicyType? _loadPolicy = null;
+        private bool? _orientationCorrection = true;
 
         /// <summary>
         /// Gets or sets the URL of the image.<br />
@@ -893,6 +896,65 @@ namespace Tizen.NUI
             }
         }
 
+
+        /// <summary>
+        /// Get or set the Image Visual release policy<br />
+        /// It decides if a texture should be released from the cache or kept to reduce loading time <br />
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        public ReleasePolicyType ReleasePolicy
+        {
+            get
+            {
+                return _releasePolicy ?? (ReleasePolicyType.Destroyed );
+            }
+            set
+            {
+                _releasePolicy = value;
+                UpdateVisual();
+            }
+        }
+
+
+        /// <summary>
+        /// Get or set the Image Visual image loading policy<br />
+        /// It decides if a texture should be loaded immediately after source set or only after visual is added to window <br />
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        public LoadPolicyType LoadPolicy
+        {
+            get
+            {
+                return _loadPolicy ?? (LoadPolicyType.Attached);
+            }
+            set
+            {
+                _loadPolicy = value;
+                UpdateVisual();
+            }
+        }
+
+        /// <summary>
+        /// Get or set whether to automatically correct the orientation based on exif data.<br />
+        /// If not specified, the default is true.<<br />
+        /// For JPEG images only.<br />
+        /// Optional.
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        public bool OrientationCorrection
+        {
+            get
+            {
+                return _orientationCorrection ?? (true);
+            }
+            set
+            {
+                _orientationCorrection = value;
+                UpdateVisual();
+            }
+        }
+
+
         /// <summary>
         /// Compose the out visual map.
         /// </summary>
@@ -920,6 +982,9 @@ namespace Tizen.NUI
                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
                 if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
                 if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
+                if (_releasePolicy != null) { _outputVisualMap.Add( ImageVisualProperty.ReleasePolicy , new PropertyValue((int)_releasePolicy)); }
+                if (_loadPolicy != null) { _outputVisualMap.Add( ImageVisualProperty.LoadPolicy, new PropertyValue((int)_loadPolicy)); }
+                if (_orientationCorrection != null) { _outputVisualMap.Add( ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
             }
         }
     }