From: dongsug.song Date: Thu, 2 Nov 2017 06:29:06 +0000 (+0900) Subject: [NUI] nui 0.2.61.1 integration X-Git-Tag: 5.0.0-preview1-00362~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7cb56ee6635570b8c83be783702c31223f514a8;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] nui 0.2.61.1 integration 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 --- diff --git a/src/Tizen.NUI/src/internal/NDalic.cs b/src/Tizen.NUI/src/internal/NDalic.cs index ef7d80a..1b62c0a 100755 --- a/src/Tizen.NUI/src/internal/NDalic.cs +++ b/src/Tizen.NUI/src/internal/NDalic.cs @@ -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(); diff --git a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs index b5693d1..61cb7ba 100755 --- a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs @@ -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(); diff --git a/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs b/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs index 3735036..c1cb572 100755 --- a/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs +++ b/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs @@ -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); } diff --git a/src/Tizen.NUI/src/public/NUIConstants.cs b/src/Tizen.NUI/src/public/NUIConstants.cs index 2e47cb3..b1297d7 100755 --- a/src/Tizen.NUI/src/public/NUIConstants.cs +++ b/src/Tizen.NUI/src/public/NUIConstants.cs @@ -650,6 +650,45 @@ namespace Tizen.NUI } /// + /// Specifies the Release Policy types
+ /// Decides if the image should be cached in different conditions + ///
+ /// 5 + public enum ReleasePolicyType + { + /// + /// Image is released when visual detached from scene + /// + Detached = 0, + /// + /// Image is only released when visual is destroyed + /// + Destroyed, + /// + /// Image is not released. + /// + Never + } + + /// + /// Specifies the Load Policy types
+ /// Decides when the image texture should be loaded + ///
+ /// 5 + public enum LoadPolicyType + { + /// + /// Load texture once the image source has been provided. Even if not being used yet. + /// + Immediate = 0, + /// + /// Only load texture once the visual is attached, when the image needs to be shown. + /// + Attached + } + + + /// /// The type of coordinate system for certain attributes of the points in a gradient. /// /// 3 @@ -1216,12 +1255,20 @@ namespace Tizen.NUI /// 4 public static readonly int FrameDelay = NDalic.IMAGE_VISUAL_FRAME_DELAY; /// - /// Whether to corrcet orientation of image + /// The policy to determine when an image should no longer be cached /// /// 5 - /// 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; + /// + /// The policy to determine when an image should be loaded + /// + /// 5 + public static readonly int LoadPolicy = NDalic.IMAGE_VISUAL_LOAD_POLICY; + /// + /// Determines if image orientation should be corrected so the image displays as it was intended + /// + /// 5 + public static readonly int OrientationCorrection = NDalic.IMAGE_VISUAL_ORIENTATION_CORRECTION; } /// @@ -2347,4 +2394,4 @@ namespace Tizen.NUI Character } -} \ No newline at end of file +} diff --git a/src/Tizen.NUI/src/public/VisualMaps.cs b/src/Tizen.NUI/src/public/VisualMaps.cs index 3d4c996..261a510 100755 --- a/src/Tizen.NUI/src/public/VisualMaps.cs +++ b/src/Tizen.NUI/src/public/VisualMaps.cs @@ -15,13 +15,13 @@ * */ +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; - /// /// A class encapsulating the transform map of the visual. /// @@ -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; /// /// Gets or sets the URL of the image.
@@ -893,6 +896,65 @@ namespace Tizen.NUI } } + + /// + /// Get or set the Image Visual release policy
+ /// It decides if a texture should be released from the cache or kept to reduce loading time
+ ///
+ /// 5 + public ReleasePolicyType ReleasePolicy + { + get + { + return _releasePolicy ?? (ReleasePolicyType.Destroyed ); + } + set + { + _releasePolicy = value; + UpdateVisual(); + } + } + + + /// + /// Get or set the Image Visual image loading policy
+ /// It decides if a texture should be loaded immediately after source set or only after visual is added to window
+ ///
+ /// 5 + public LoadPolicyType LoadPolicy + { + get + { + return _loadPolicy ?? (LoadPolicyType.Attached); + } + set + { + _loadPolicy = value; + UpdateVisual(); + } + } + + /// + /// Get or set whether to automatically correct the orientation based on exif data.
+ /// If not specified, the default is true.<
+ /// For JPEG images only.
+ /// Optional. + ///
+ /// 5 + public bool OrientationCorrection + { + get + { + return _orientationCorrection ?? (true); + } + set + { + _orientationCorrection = value; + UpdateVisual(); + } + } + + /// /// Compose the out visual map. /// @@ -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)); } } } }