Merge remote-tracking branch 'origin/master' into tizen
authorTizenAPI-Bot <tizenapi@samsung.com>
Tue, 5 Dec 2023 07:57:03 +0000 (07:57 +0000)
committerTizenAPI-Bot <tizenapi@samsung.com>
Tue, 5 Dec 2023 07:57:03 +0000 (07:57 +0000)
21 files changed:
packaging/csapi-tizenfx.spec
packaging/version.txt
src/Tizen.Applications.PackageManager/Interop/Interop.Libraries.cs
src/Tizen.Applications.PackageManager/Interop/Interop.Package.cs
src/Tizen.Applications.PackageManager/Interop/Interop.PackageManagerInfoInternal.cs [new file with mode: 0755]
src/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageCertificate.cs
src/Tizen.NUI.Physics2D/src/internal/chipmunk/NativeInterop.cs
src/Tizen.NUI.Physics2D/src/internal/chipmunk/cpSpaceDebugDrawOptions.cs
src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs
src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.ModelNode.cs
src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.MotionData.cs
src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs
src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs
src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs
src/Tizen.NUI.Scene3D/src/public/ModelComponents/ModelNode.cs
src/Tizen.NUI.Scene3D/src/public/ModelMotion/MotionData.cs
src/Tizen.NUI/src/public/BaseComponents/DirectRenderingGLView.cs
src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothDevice.cs
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothStructs.cs

index fb7e455..8f988f2 100644 (file)
@@ -1,8 +1,8 @@
 # Auto-generated from csapi-tizenfx.spec.in by makespec.sh
 
 %define TIZEN_NET_API_VERSION 12
-%define TIZEN_NET_RPM_VERSION 12.0.0.18156+nui22300
-%define TIZEN_NET_NUGET_VERSION 12.0.0.18156
+%define TIZEN_NET_RPM_VERSION 12.0.0.999+nui22301
+%define TIZEN_NET_NUGET_VERSION 12.0.0.99999
 
 %define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
 %define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
index 49c4258..6b15d73 100755 (executable)
@@ -6,4 +6,4 @@ RPM_VERSION=12.0.0.999
 NUGET_VERSION=12.0.0.99999
 
 # RPM Version Suffix
-RPM_VERSION_SUFFIX=nui22300
+RPM_VERSION_SUFFIX=nui22301
index f486d8c..c093b03 100755 (executable)
@@ -20,5 +20,7 @@ internal static partial class Interop
     {
         public const string PackageManager = "libcapi-appfw-package-manager.so.0";
         public const string PackageManagerInternal = "libpkgmgr-client.so.0";
+        public const string PackageManagerInfoInternal = "libpkgmgr-info.so.0";
+        public const string Libc = "libc.so.6";
     }
 }
index 02b03b5..2e5ace5 100644 (file)
@@ -64,9 +64,6 @@ internal static partial class Interop
         [DllImport(Libraries.PackageManager, EntryPoint = "package_info_foreach_app_from_package")]
         internal static extern ErrorCode PackageInfoForeachAppInfo(IntPtr handle, AppType appType, PackageInfoAppInfoCallback callback, IntPtr userData);
 
-        [DllImport(Libraries.PackageManager, EntryPoint = "package_info_foreach_cert_info")]
-        internal static extern ErrorCode PackageInfoForeachCertificateInfo(IntPtr handle, PackageInfoCertificateInfoCallback callback, IntPtr user_data);
-
         [DllImport(Libraries.PackageManager, EntryPoint = "package_info_foreach_privilege_info")]
         internal static extern ErrorCode PackageInfoForeachPrivilegeInfo(IntPtr handle, PackageInfoPrivilegeInfoCallback callback, IntPtr userData);
 
diff --git a/src/Tizen.Applications.PackageManager/Interop/Interop.PackageManagerInfoInternal.cs b/src/Tizen.Applications.PackageManager/Interop/Interop.PackageManagerInfoInternal.cs
new file mode 100755 (executable)
index 0000000..edbcec6
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+using CertificateType = Interop.Package.CertificateType;
+
+internal static partial class Interop
+{
+    internal static partial class PackageManagerInfoInternal
+    {
+        [DllImport(Libraries.PackageManagerInfoInternal, EntryPoint = "pkgmgrinfo_pkginfo_create_certinfo")]
+        internal static extern int PkgmgrinfoPkginfoCreateCertinfo(out IntPtr handle);
+
+        [DllImport(Libraries.PackageManagerInfoInternal, EntryPoint = "pkgmgrinfo_pkginfo_destroy_certinfo")]
+        internal static extern int PkgmgrinfoPkginfoDestroyCertinfo(IntPtr handle);
+
+        [DllImport(Libraries.PackageManagerInfoInternal, EntryPoint = "pkgmgrinfo_pkginfo_load_certinfo")]
+        internal static extern int PkgmgrinfoPkginfoLoadCertinfo(string pkgid, IntPtr handle, int uid);
+
+        [DllImport(Libraries.PackageManagerInfoInternal, EntryPoint = "pkgmgrinfo_pkginfo_get_cert_value")]
+        internal static extern int PkgmgrinfoPkginfoGetCertValue(IntPtr handle, CertificateType certType, out IntPtr value);
+
+        [DllImport(Libraries.PackageManagerInfoInternal, EntryPoint = "pkgmgrinfo_pkginfo_foreach_depends_on_by_pkgid")]
+        internal static extern int PkgmgrinfoPkginfoForeachDependsOnByPkgId(string pkgid, Interop.Package.PackageInfoDependencyInfoCallback callback, IntPtr userData, int uid);
+
+        [DllImport(Libraries.Libc, EntryPoint = "getuid")]
+        internal static extern int GetUID();
+    }
+}
index 7932ac4..5de2b1b 100644 (file)
@@ -42,14 +42,14 @@ namespace Tizen.Applications
         private bool _isRemovable;
         private bool _isPreloaded;
         private bool _isAccessible;
-        private IReadOnlyDictionary<CertificateType, PackageCertificate> _certificates;
+        private Lazy<IReadOnlyDictionary<CertificateType, PackageCertificate>> _certificates;
         private List<string> _privileges;
         private int _installedTime;
 
         private Dictionary<IntPtr, Interop.PackageManager.PackageManagerSizeInfoCallback> _packageManagerSizeInfoCallbackDict = new Dictionary<IntPtr, Interop.PackageManager.PackageManagerSizeInfoCallback>();
         private int _callbackId = 0;
         private List<PackageDependencyInformation> _dependencyTo;
-        private List<PackageDependencyInformation> _dependencyFrom;
+        private Lazy<List<PackageDependencyInformation>> _dependencyFrom;
         private IReadOnlyDictionary<string, IEnumerable<string>> _allowedPackagesAndPrivilegesList;
 
         private Package(string pkgId)
@@ -135,7 +135,7 @@ namespace Tizen.Applications
         /// Certificate information for the package.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
-        public IReadOnlyDictionary<CertificateType, PackageCertificate> Certificates { get { return _certificates; } }
+        public IReadOnlyDictionary<CertificateType, PackageCertificate> Certificates { get { return _certificates.Value; } }
 
         /// <summary>
         /// Requested privilege for the package.
@@ -229,7 +229,7 @@ namespace Tizen.Applications
         /// Packages that require this package
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
-        public IEnumerable<PackageDependencyInformation> DependencyFrom { get { return _dependencyFrom; } }
+        public IEnumerable<PackageDependencyInformation> DependencyFrom { get { return _dependencyFrom.Value; } }
 
         /// <summary>
         /// Gets the package size information.
@@ -383,10 +383,10 @@ namespace Tizen.Applications
                 package._installedTime = 0;
             }
 
-            package._certificates = PackageCertificate.GetPackageCertificates(handle);
+            package._certificates = new Lazy<IReadOnlyDictionary<CertificateType, PackageCertificate>>(() => { return PackageCertificate.GetPackageCertificates(pkgId); });
             package._privileges = GetPackagePrivilegeInformation(handle);
             package._dependencyTo = GetPackageDependency(handle);
-            package._dependencyFrom = GetPackageDependencyDependsOn(handle);
+            package._dependencyFrom = new Lazy<List<PackageDependencyInformation>>(() => { return GetPackageDependencyDependsOn(pkgId); });
             package._allowedPackagesAndPrivilegesList = GetAllowedPackagesAndPrivileges(handle);
             return package;
         }
@@ -470,7 +470,7 @@ namespace Tizen.Applications
             return dependencies;
         }
 
-        private static List<PackageDependencyInformation> GetPackageDependencyDependsOn(IntPtr packageInfoHandle)
+        private static List<PackageDependencyInformation> GetPackageDependencyDependsOn(string packageId)
         {
             List<PackageDependencyInformation> dependencies = new List<PackageDependencyInformation>();
             Interop.Package.PackageInfoDependencyInfoCallback dependencyInfoCb = (from, to, type, requiredVersion, userData) =>
@@ -478,9 +478,8 @@ namespace Tizen.Applications
                 dependencies.Add(PackageDependencyInformation.GetPackageDependencyInformation(from, to, type, requiredVersion));
                 return true;
             };
-
-            Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoForeachDependencyInfoDependsOn(packageInfoHandle, dependencyInfoCb, IntPtr.Zero);
-            if (err != Interop.PackageManager.ErrorCode.None)
+            int err = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoForeachDependsOnByPkgId(packageId, dependencyInfoCb, IntPtr.Zero, Interop.PackageManagerInfoInternal.GetUID());
+            if (err != 0)
             {
                 Log.Warn(LogTag, string.Format("Failed to get dependency info. err = {0}", err));
             }
index ed68134..1fa88fd 100755 (executable)
@@ -57,53 +57,55 @@ namespace Tizen.Applications
         /// <since_tizen> 3 </since_tizen>
         public string Signer { get { return _signer; } }
 
-        internal static IReadOnlyDictionary<CertificateType, PackageCertificate> GetPackageCertificates(IntPtr packageInfoHandle)
+        internal static IReadOnlyDictionary<CertificateType, PackageCertificate> GetPackageCertificates(string packageId)
         {
-            Dictionary<Interop.Package.CertificateType, string> nativeCertificates = new Dictionary<Interop.Package.CertificateType, string>();
-            Interop.Package.PackageInfoCertificateInfoCallback certificateInfoCb = (handle, certType, certValue, userData) =>
+            Dictionary<CertificateType, PackageCertificate> certificates = new Dictionary<CertificateType, PackageCertificate>();
+
+            int ret = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoCreateCertinfo(out IntPtr handle);
+            if (ret != 0)
             {
-                if (certValue == null) certValue = string.Empty;
-                try
-                {
-                    nativeCertificates.Add(certType, certValue);
-                }
-                catch (ArgumentException ex)
-                {
-                    Log.Warn(LogTag, string.Format("Failed to add cert value. certType = {0}, err = {1}", certType, ex.Message));
-                }
-                return true;
-            };
+                Log.Error(LogTag, string.Format("Failed to create cert info handle"));
+                return certificates;
+            }
 
-            Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoForeachCertificateInfo(packageInfoHandle, certificateInfoCb, IntPtr.Zero);
-            if (err != Interop.PackageManager.ErrorCode.None)
+            ret = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoLoadCertinfo(packageId, handle, Interop.PackageManagerInfoInternal.GetUID());
+            if (ret != 0)
             {
-                Log.Warn(LogTag, string.Format("Failed to get certificate info. err = {0}", err));
+                Log.Error(LogTag, string.Format("Failed to load cert info of {0}", packageId));
+                return certificates;
             }
 
-            Dictionary<CertificateType, PackageCertificate> certificates = new Dictionary<CertificateType, PackageCertificate>();
-            string authorRootCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.AuthorRootCertificate);
-            string authorIntermediateCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.AuthorIntermediateCertificate);
-            string aurthorSignerCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.AuthorSignerCertificate);
+            _ = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoGetCertValue(handle, Interop.Package.CertificateType.AuthorRootCertificate, out IntPtr authorRootCertificatePtr);
+            string authorRootCertificate = authorRootCertificatePtr != IntPtr.Zero ? Marshal.PtrToStringAnsi(authorRootCertificatePtr) : string.Empty;
+            _ = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoGetCertValue(handle, Interop.Package.CertificateType.AuthorIntermediateCertificate, out IntPtr authorIntermediateCertificatePtr);
+            string authorIntermediateCertificate = authorIntermediateCertificatePtr != IntPtr.Zero ? Marshal.PtrToStringAnsi(authorIntermediateCertificatePtr) : string.Empty;
+            _ = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoGetCertValue(handle, Interop.Package.CertificateType.AuthorSignerCertificate, out IntPtr aurthorSignerCertificatePtr);
+            string aurthorSignerCertificate = aurthorSignerCertificatePtr != IntPtr.Zero ? Marshal.PtrToStringAnsi(aurthorSignerCertificatePtr) : string.Empty;
             certificates.Add(CertificateType.Author, new PackageCertificate(authorRootCertificate, authorIntermediateCertificate, aurthorSignerCertificate));
 
-            string distRootCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.DistributorRootCertificate);
-            string distIntermediateCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.DistributorIntermediateCertificate);
-            string distSignerCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.DistributorSignerCertificate);
+            _ = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoGetCertValue(handle, Interop.Package.CertificateType.DistributorRootCertificate, out IntPtr distRootCertificatePtr);
+            string distRootCertificate = distRootCertificatePtr != IntPtr.Zero ? Marshal.PtrToStringAnsi(distRootCertificatePtr) : string.Empty;
+            _ = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoGetCertValue(handle, Interop.Package.CertificateType.DistributorIntermediateCertificate, out IntPtr distIntermediateCertificatePtr);
+            string distIntermediateCertificate = distIntermediateCertificatePtr != IntPtr.Zero ? Marshal.PtrToStringAnsi(distIntermediateCertificatePtr) : string.Empty;
+            _ = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoGetCertValue(handle, Interop.Package.CertificateType.DistributorSignerCertificate, out IntPtr distSignerCertificatePtr);
+            string distSignerCertificate = distSignerCertificatePtr != IntPtr.Zero ? Marshal.PtrToStringAnsi(distSignerCertificatePtr) : string.Empty;
             certificates.Add(CertificateType.Distributor, new PackageCertificate(distRootCertificate, distIntermediateCertificate, distSignerCertificate));
 
-            string dist2RootCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.Distributor2RootCertificate);
-            string dist2IntermediateCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.Distributor2IntermediateCertificate);
-            string dist2SignerCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.Distributor2SignerCertificate);
+            _ = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoGetCertValue(handle, Interop.Package.CertificateType.Distributor2RootCertificate, out IntPtr dist2RootCertificatePtr);
+            string dist2RootCertificate = dist2RootCertificatePtr != IntPtr.Zero ? Marshal.PtrToStringAnsi(dist2RootCertificatePtr) : string.Empty;
+            _ = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoGetCertValue(handle, Interop.Package.CertificateType.Distributor2IntermediateCertificate, out IntPtr dist2IntermediateCertificatePtr);
+            string dist2IntermediateCertificate = dist2IntermediateCertificatePtr != IntPtr.Zero ? Marshal.PtrToStringAnsi(dist2IntermediateCertificatePtr) : string.Empty;
+            _ = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoGetCertValue(handle, Interop.Package.CertificateType.Distributor2SignerCertificate, out IntPtr dist2SignerCertificatePtr);
+            string dist2SignerCertificate = dist2SignerCertificatePtr != IntPtr.Zero ? Marshal.PtrToStringAnsi(dist2SignerCertificatePtr) : string.Empty;
             certificates.Add(CertificateType.Distributor2, new PackageCertificate(dist2RootCertificate, dist2IntermediateCertificate, dist2SignerCertificate));
 
-            return certificates;
-        }
+            ret = Interop.PackageManagerInfoInternal.PkgmgrinfoPkginfoDestroyCertinfo(handle);
+            if (ret != 0)
+            {
+                Log.Warn(LogTag, string.Format("Failed to destroy cert info handle"));
+            }
 
-        private static string GetValue(IDictionary<Interop.Package.CertificateType, string> dict, Interop.Package.CertificateType key)
-        {
-            string value;
-            dict.TryGetValue(key, out value);
-            return value;
+            return certificates;
         }
     }
-}
\ No newline at end of file
+}
index a86f6bf..063968c 100644 (file)
@@ -81,6 +81,9 @@ namespace Tizen.NUI.Physics2D.Chipmunk
         public static IntPtr AllocStructure<T>()
         {
             int size = SizeOf<T>();
+
+            Debug.Assert(size>0, "The memory size to be allocated should be greater than 0");
+
             return Marshal.AllocHGlobal(size);
         }
 
index 7b9afef..6e3366f 100644 (file)
@@ -104,10 +104,6 @@ namespace Tizen.NUI.Physics2D.Chipmunk
         private IntPtr ToPointer()
         {
             IntPtr drawOptionsPtr = NativeInterop.AllocStructure<cpSpaceDebugDrawOptions>();
-            if (Marshal.SizeOf(typeof(cpSpaceDebugDrawOptions)) == 0)
-            {
-                throw new ArgumentNullException("The size of type cpSpaceDebugDrawOptions should not be 0.");
-            }
 
             Marshal.StructureToPtr<cpSpaceDebugDrawOptions>(this, drawOptionsPtr, false);
 
index adf1bde..610c542 100755 (executable)
  * limitations under the License.
  *
  */
-
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
 namespace Tizen.NUI.Scene3D
 {
     internal static partial class Interop
     {
         internal static partial class Model
-        {
+        {            
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Model_New_SWIG_0")]
             public static extern global::System.IntPtr ModelNew(string modelUrl, string resourcePasth);
 
@@ -106,6 +108,13 @@ namespace Tizen.NUI.Scene3D
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Model_LoadFacialAnimation_2")]
             public static extern global::System.IntPtr LoadBlendShapeAnimationFromBuffer(global::System.Runtime.InteropServices.HandleRef model, string jsonBuffer, int jsonBufferLength);
+            
+            // Signals
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Model_MeshHitSignal_Connect")]
+            public static extern void MeshHitSignalConnect(global::System.Runtime.InteropServices.HandleRef model, global::System.Runtime.InteropServices.HandleRef handler);
+
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_MotionData_MeshHitSignal_Disconnect")]
+            public static extern void MeshHitSignalDisconnect(global::System.Runtime.InteropServices.HandleRef model, global::System.Runtime.InteropServices.HandleRef handler);
         }
     }
 }
index ae5af29..c2acf46 100755 (executable)
  *
  */
 
+using System;
+using System.Runtime.InteropServices;
+
 namespace Tizen.NUI.Scene3D
 {
     internal static partial class Interop
     {
         internal static partial class ModelNode
         {
+            [StructLayout(LayoutKind.Sequential)]
+            internal struct Vec3
+            {
+                internal float x, y, z;
+            }
+        
+            [StructLayout(LayoutKind.Sequential)]
+            internal struct ElementIndex
+            {
+                internal Int32 index;
+            }
+            
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Model_Node_New_SWIG_0")]
             public static extern global::System.IntPtr ModelNodeNew();
 
@@ -62,6 +77,11 @@ namespace Tizen.NUI.Scene3D
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Model_Node_GetChildModelNodeAt")]
             public static extern global::System.IntPtr GetChildModelNodeAt(global::System.Runtime.InteropServices.HandleRef model, uint index);
+
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelNode_SetColliderMesh")]
+            public static extern global::System.IntPtr SetColliderMesh(global::System.Runtime.InteropServices.HandleRef modelNode,
+                Vec3[] vPtr,
+                Vec3[] nPtr, int vLength, int[] iPtr, int iLength);            
         }
     }
 }
index 6f8845b..d7bdcb3 100755 (executable)
@@ -64,16 +64,16 @@ namespace Tizen.NUI.Scene3D
             public static extern float GetDuration(global::System.Runtime.InteropServices.HandleRef motionData);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_MotionData_LoadBvh")]
-            public static extern float LoadMotionCaptureAnimation(global::System.Runtime.InteropServices.HandleRef motionData, string motionCaptureFilename, global::System.Runtime.InteropServices.HandleRef scale, bool synchronousLoad);
+            public static extern void LoadMotionCaptureAnimation(global::System.Runtime.InteropServices.HandleRef motionData, string motionCaptureFilename, bool useRootTranslationOnly, global::System.Runtime.InteropServices.HandleRef scale, bool synchronousLoad);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_MotionData_LoadBvhFromBuffer")]
-            public static extern float LoadMotionCaptureAnimationFromBuffer(global::System.Runtime.InteropServices.HandleRef motionData, string motionCaptureBuffer, int motionCaptureBufferLength, global::System.Runtime.InteropServices.HandleRef scale, bool synchronousLoad);
+            public static extern void LoadMotionCaptureAnimationFromBuffer(global::System.Runtime.InteropServices.HandleRef motionData, string motionCaptureBuffer, int motionCaptureBufferLength, bool useRootTranslationOnly, global::System.Runtime.InteropServices.HandleRef scale, bool synchronousLoad);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_MotionData_LoadFacialAnimation")]
-            public static extern float LoadBlendShapeAnimation(global::System.Runtime.InteropServices.HandleRef motionData, string blendShapeFilename, bool synchronousLoad);
+            public static extern void LoadBlendShapeAnimation(global::System.Runtime.InteropServices.HandleRef motionData, string blendShapeFilename, bool synchronousLoad);
 
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_MotionData_LoadFacialAnimationFromBuffer")]
-            public static extern float LoadBlendShapeAnimationFromBuffer(global::System.Runtime.InteropServices.HandleRef motionData, string blendShapeBuffer, int blendShapeBufferLength, bool synchronousLoad);
+            public static extern void LoadBlendShapeAnimationFromBuffer(global::System.Runtime.InteropServices.HandleRef motionData, string blendShapeBuffer, int blendShapeBufferLength, bool synchronousLoad);
 
             // Signals
 
index 3eeba19..59e4f86 100755 (executable)
@@ -79,6 +79,18 @@ namespace Tizen.NUI.Scene3D
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
             public static extern bool IsUsingFramebuffer(global::System.Runtime.InteropServices.HandleRef sceneView);
 
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_SetResolution")]
+            public static extern void SetResolution(global::System.Runtime.InteropServices.HandleRef sceneView, uint width, uint height);
+
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_GetResolutionWidth")]
+            public static extern uint GetResolutionWidth(global::System.Runtime.InteropServices.HandleRef sceneView);
+
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_GetResolutionHeight")]
+            public static extern uint GetResolutionHeight(global::System.Runtime.InteropServices.HandleRef sceneView);
+
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_ResetResolution")]
+            public static extern void ResetResolution(global::System.Runtime.InteropServices.HandleRef sceneView);
+
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_SetFramebufferMultiSamplingLevel")]
             public static extern void SetFramebufferMultiSamplingLevel(global::System.Runtime.InteropServices.HandleRef sceneView, uint multiSamplingLevel);
 
index 419e770..7083221 100755 (executable)
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.ComponentModel;
 using Tizen.NUI;
@@ -686,5 +687,76 @@ namespace Tizen.NUI.Scene3D
         {
             Interop.Model.DeleteModel(swigCPtr);
         }
+        
+        
+        private EventHandler<MeshHitEventArgs> meshHitEventHandler;
+        private MeshHitCallbackType meshHitCallback;
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        private delegate void MeshHitCallbackType(IntPtr motionData);
+
+        /// <summary>
+        /// MeshHitEventArgs
+        /// Contains arguments when MeshHitSignal called
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public class MeshHitEventArgs : EventArgs
+        {
+            private ModelNode modelNode;
+            
+            /// <summary>
+            /// ModelNode that's been hit
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public ModelNode ModelNode
+            {
+                get
+                {
+                    return modelNode;
+                }
+                set
+                {
+                    modelNode = value;
+                }
+            }
+        }
+        
+        /// <summary>
+        /// EventHandler event.
+        /// It will be invoked when collider mesh is hit.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public event EventHandler<MeshHitEventArgs> ColliderMeshHitted
+        {
+            add
+            {
+                if (meshHitEventHandler == null)
+                {
+                    meshHitCallback = MeshHitCollision;
+                    Interop.Model.MeshHitSignalConnect(SwigCPtr, meshHitCallback.ToHandleRef(this));
+                    NDalicPINVOKE.ThrowExceptionIfExists();
+                }
+                meshHitEventHandler += value;
+            }
+            remove
+            {
+                meshHitEventHandler -= value;
+                if (meshHitEventHandler == null && meshHitCallback != null)
+                {
+                    Interop.Model.MeshHitSignalDisconnect(SwigCPtr, meshHitCallback.ToHandleRef(this));
+                    NDalicPINVOKE.ThrowExceptionIfExists();
+                    meshHitCallback = null;
+                }
+            }
+        }
+
+        private void MeshHitCollision(IntPtr modelNode)
+        {
+            if (meshHitEventHandler != null)
+            {
+                var args = new MeshHitEventArgs();
+                args.ModelNode = new ModelNode(modelNode, false);
+                meshHitEventHandler(this, args);
+            }
+        }
     }
 }
index 82fa71b..217a7a1 100755 (executable)
@@ -473,6 +473,66 @@ namespace Tizen.NUI.Scene3D
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// Sets SceneView's resolution manually.
+        /// </summary>
+        /// <param name="width">The input width.</param>
+        /// <param name="height">The input height.</param>
+        /// <remarks>
+        /// This manual resolution is only available when the SceneView uses FBO for rendering by using FBO (UseFrameBuffer is true).
+        /// If the aspect ratio of input width/height is different with SceneView's aspect ratio, the rendered result is stretched to fill SceneView's area.
+        /// </remarks>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetResolution(uint width, uint height)
+        {
+            Interop.SceneView.SetResolution(SwigCPtr, width, height);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Retrieves width of resolution of the SceneView.
+        /// </summary>
+        /// <remarks>
+        ///  If the SceneView not uses FBO, this method returns SceneView's width.
+        /// </remarks>
+        /// <returns> Camera currently used in SceneView as a selected Camera.</returns>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public uint GetResolutionWidth()
+        {
+            uint result = Interop.SceneView.GetResolutionWidth(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return result;
+        }
+
+        /// <summary>
+        /// Retrieves height of resolution of the SceneView.
+        /// </summary>
+        /// <remarks>
+        ///  If the SceneView not uses FBO, this method returns SceneView's height.
+        /// </remarks>
+        /// <returns> Camera currently used in SceneView as a selected Camera.</returns>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public uint GetResolutionHeight()
+        {
+            uint result = Interop.SceneView.GetResolutionHeight(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return result;
+        }
+
+        /// <summary>
+        /// Resets SceneView's resolution to the current size of SceneView.
+        /// </summary>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void ResetResolution()
+        {
+            Interop.SceneView.ResetResolution(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
         internal void SetUseFramebuffer(bool useFramebuffer)
         {
             Interop.SceneView.UseFramebuffer(SwigCPtr, useFramebuffer);
index 64f15bb..2247436 100755 (executable)
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.ComponentModel;
 using System.Collections.Generic;
@@ -202,6 +203,40 @@ namespace Tizen.NUI.Scene3D
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
+        
+        /// <summary>
+        /// Sets collider mesh on current node
+        /// </summary>
+        /// <param name="vertexList">List of vertices</param>
+        /// <param name="normalList">List of vertex normals</param>
+        /// <param name="indexList">List of mesh indices</param>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetColliderMesh(List<Vector3> vertexList, List<Vector3> normalList, List<int> indexList)
+        {
+            var vertices = new Interop.ModelNode.Vec3[vertexList.Count];
+            var idx = 0;
+            foreach (var vertex in vertexList)
+            {
+                vertices[idx].x = vertex.X;
+                vertices[idx].y = vertex.Y;
+                vertices[idx].z = vertex.Z;
+                ++idx;
+            }
+            
+            var normals = new Interop.ModelNode.Vec3[normalList.Count];
+            idx = 0;
+            foreach (var normal in normalList)
+            {
+                normals[idx].x = normal.X;
+                normals[idx].y = normal.Y;
+                normals[idx].z = normal.Z;
+                ++idx;
+            }
+            
+            Interop.ModelNode.SetColliderMesh(SwigCPtr,vertices, normals, vertexList.Count, indexList.ToArray(), indexList.Count);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
 
         /// <summary>
         /// Gets the number of ModelPrimitive objects in the ModelNode object.
index 7307ca9..19ffcab 100644 (file)
@@ -262,7 +262,28 @@ namespace Tizen.NUI.Scene3D
         /// <since_tizen> 11 </since_tizen>
         public void LoadMotionCaptureAnimation(string motionCaptureFilename, Vector3 scale = null, bool synchronousLoad = false)
         {
-            Interop.MotionData.LoadMotionCaptureAnimation(SwigCPtr, motionCaptureFilename, Vector3.getCPtr(scale), synchronousLoad);
+            Interop.MotionData.LoadMotionCaptureAnimation(SwigCPtr, motionCaptureFilename, false, Vector3.getCPtr(scale), synchronousLoad);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Load motion capture animation.
+        /// We support bvh format.
+        /// After load completes, <see cref="LoadCompleted"/> event will be invoked.
+        /// </summary>
+        /// <remarks>
+        /// Scale is additional scale factor of motion capture animation. It is possible that
+        /// Model's scale may not match with motion capture animation scale.
+        /// If scale is null, default value will be used: <cref name="Vector3.ONE"/>
+        /// </remarks>
+        /// <param name="motionCaptureFilename">Name of motion capture format file.</param>
+        /// <param name="useRootTranslationOnly">True to use only root translation with rotation animation.</param>
+        /// <param name="scale">Scale value of motion capture animation match with model.</param>
+        /// <param name="synchronousLoad">Load synchronously or not. Default is async load.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void LoadMotionCaptureAnimation(string motionCaptureFilename, bool useRootTranslationOnly, Vector3 scale = null, bool synchronousLoad = false)
+        {
+            Interop.MotionData.LoadMotionCaptureAnimation(SwigCPtr, motionCaptureFilename, useRootTranslationOnly, Vector3.getCPtr(scale), synchronousLoad);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -282,7 +303,28 @@ namespace Tizen.NUI.Scene3D
         /// <since_tizen> 11 </since_tizen>
         public void LoadMotionCaptureAnimationFromBuffer(string motionCaptureBuffer, Vector3 scale = null, bool synchronousLoad = false)
         {
-            Interop.MotionData.LoadMotionCaptureAnimationFromBuffer(SwigCPtr, motionCaptureBuffer, motionCaptureBuffer.Length, Vector3.getCPtr(scale), synchronousLoad);
+            Interop.MotionData.LoadMotionCaptureAnimationFromBuffer(SwigCPtr, motionCaptureBuffer, motionCaptureBuffer.Length, false, Vector3.getCPtr(scale), synchronousLoad);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Load motion capture animation from string.
+        /// We support bvh format.
+        /// After load completes, <see cref="LoadCompleted"/> event will be invoked.
+        /// </summary>
+        /// <remarks>
+        /// Scale is additional scale factor of motion capture animation. It is possible that
+        /// Model's scale may not match with motion capture animation scale.
+        /// If scale is null, default value will be used: <cref name="Vector3.ONE"/>
+        /// </remarks>
+        /// <param name="motionCaptureBuffer">Contents of motion capture format string.</param>
+        /// <param name="useRootTranslationOnly">True to use only root translation with rotation animation.</param>
+        /// <param name="scale">Scale value of motion capture animation match with model.</param>
+        /// <param name="synchronousLoad">Load synchronously or not. Default is async load.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void LoadMotionCaptureAnimationFromBuffer(string motionCaptureBuffer, bool useRootTranslationOnly, Vector3 scale = null, bool synchronousLoad = false)
+        {
+            Interop.MotionData.LoadMotionCaptureAnimationFromBuffer(SwigCPtr, motionCaptureBuffer, motionCaptureBuffer.Length, useRootTranslationOnly, Vector3.getCPtr(scale), synchronousLoad);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
index 2946cb4..63dbda6 100644 (file)
@@ -186,18 +186,19 @@ namespace Tizen.NUI.BaseComponents
                 
                 if (textures != null)
                 {
-                    int intptrBytes = checked(sizeof(IntPtr) * textures.Count);
+                    int count = textures.Count;
+                    int intptrBytes = checked(sizeof(IntPtr) * count);
                     if (intptrBytes>0)
                     {
                         IntPtr unmanagedPointer = Marshal.AllocHGlobal(intptrBytes);
-                        IntPtr[] texturesArray = new IntPtr[textures.Count];
-                        for (int i = 0; i < textures.Count; i++)
+                        IntPtr[] texturesArray = new IntPtr[count];
+                        for (int i = 0; i < count; i++)
                         {
                             texturesArray[i] = HandleRef.ToIntPtr(Texture.getCPtr(textures[i]));
                         }
-                        System.Runtime.InteropServices.Marshal.Copy(texturesArray, 0, unmanagedPointer, textures.Count);
+                        Marshal.Copy(texturesArray, 0, unmanagedPointer, count);
 
-                        Interop.GLView.GlViewBindTextureResources(SwigCPtr, unmanagedPointer, textures.Count);
+                        Interop.GLView.GlViewBindTextureResources(SwigCPtr, unmanagedPointer, count);
                         Marshal.FreeHGlobal(unmanagedPointer);
                     }
                 }
index 47b4dec..32867f5 100755 (executable)
@@ -1146,6 +1146,7 @@ namespace Tizen.NUI.BaseComponents
             // If the view had focus, it clears focus.
             if (child == FocusManager.Instance.GetCurrentFocusView())
             {
+                Tizen.Log.Debug("NUI", $"ClearFocus due to View id:({child.ID}) removed from scene\n");
                 FocusManager.Instance.ClearFocus();
             }
             // Do actual child removal
@@ -1468,7 +1469,7 @@ namespace Tizen.NUI.BaseComponents
             NUILog.Debug($"=============================");
 
             base.Dispose(type);
-            
+
             aliveCount--;
         }
 
index 6f3586f..b7a83ae 100644 (file)
@@ -636,7 +636,7 @@ namespace Tizen.Network.Bluetooth
                 {
                     if (!profile.Equals(null))
                     {
-                        profileList.Add((BluetoothProfileType)profile);
+                        profileList.Add(BluetoothUtils.ConvertBtProfileToProfileType(profile));
                     }
                     return true;
                 };
@@ -670,7 +670,7 @@ namespace Tizen.Network.Bluetooth
             if (BluetoothAdapter.IsBluetoothEnabled)
             {
                 bool isConnected;
-                int ret = Interop.Bluetooth.IsProfileConnected(RemoteDeviceAddress, (int)profileType, out isConnected);
+                int ret = Interop.Bluetooth.IsProfileConnected(RemoteDeviceAddress, BluetoothUtils.ConvertProfileTypeToBtProfile(profileType), out isConnected);
                 if (ret != (int)BluetoothError.None)
                 {
                     Log.Error(Globals.LogTag, "Failed to get profile connected state, Error - " + (BluetoothError)ret);
index 60e63fd..b56a3ac 100644 (file)
@@ -465,6 +465,39 @@ namespace Tizen.Network.Bluetooth
 
             return connectionInfo;
         }
+
+        internal static int ConvertProfileTypeToBtProfile(BluetoothProfileType profileType)
+        {
+            return profileType switch
+            {
+                BluetoothProfileType.Rfcomm => 0x01,
+                BluetoothProfileType.AdvancedAudioDistribution => 0x02,
+                BluetoothProfileType.Headset => 0x04,
+                BluetoothProfileType.HumanInterfaceDevice => 0x08,
+                BluetoothProfileType.NetworkAccessPoint => 0x10,
+                BluetoothProfileType.AudioGateway => 0x20,
+                BluetoothProfileType.GenericAttribute => 0x40,
+                BluetoothProfileType.NapServer => 0x80,
+                BluetoothProfileType.AdvancedAudioDistributionSink => 0x100,
+                _ => -1,
+            };
+        }
+
+        internal static BluetoothProfileType ConvertBtProfileToProfileType(int btProfile)
+        {
+            return btProfile switch
+            {
+                0x01 => BluetoothProfileType.Rfcomm,
+                0x02 => BluetoothProfileType.AdvancedAudioDistribution,
+                0x04 => BluetoothProfileType.Headset,
+                0x08 => BluetoothProfileType.HumanInterfaceDevice,
+                0x10 => BluetoothProfileType.NetworkAccessPoint,
+                0x20 => BluetoothProfileType.AudioGateway,
+                0x40 => BluetoothProfileType.GenericAttribute,
+                0x80 => BluetoothProfileType.NapServer,
+                0x100 => BluetoothProfileType.AdvancedAudioDistributionSink,
+            };
+        }
     }
 }