Merge remote-tracking branch 'origin/master' into tizen
authoradmin <tizenapi@samsung.com>
Fri, 17 Apr 2020 15:51:59 +0000 (15:51 +0000)
committeradmin <tizenapi@samsung.com>
Fri, 17 Apr 2020 15:51:59 +0000 (15:51 +0000)
src/Tizen.NUI/src/internal/Application.cs
src/Tizen.NUI/src/internal/FriendAssembly.cs
src/Tizen.NUI/src/internal/Interop/Interop.Application.cs
src/Tizen.NUI/src/public/Layouting/GridLayout.cs
src/Tizen.NUI/src/public/Layouting/LayoutItem.cs
src/Tizen.NUI/src/public/NUIApplication.cs

index 9f70268..204692c 100755 (executable)
@@ -1169,6 +1169,10 @@ namespace Tizen.NUI
         {
             // register all Views with the type registry, so that can be created / styled via JSON
             //ViewRegistryHelper.Initialize(); //moved to Application side.
+            if(_instance)
+            {
+                return _instance;
+            }
 
             Application ret = New(1, stylesheet, windowMode);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
@@ -1180,6 +1184,10 @@ namespace Tizen.NUI
 
         public static Application NewApplication(string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
         {
+            if (_instance)
+            {
+                return _instance;
+            }
             Application ret = New(1, stylesheet, windowMode, positionSize);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
@@ -1190,6 +1198,10 @@ namespace Tizen.NUI
 
         public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
         {
+            if (_instance)
+            {
+                return _instance;
+            }
             Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
@@ -1200,6 +1212,10 @@ namespace Tizen.NUI
 
         public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
         {
+            if (_instance)
+            {
+                return _instance;
+            }
             Application ret = New(args, stylesheet, (Application.WindowMode)windowMode, positionSize);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
index 3e2e42a..bdf2eec 100755 (executable)
 
 // friend assembly setting
 // compile with: /target:Tizen.NUI.ExtTEST /keyfile:FriendAssemblies.snk
+using System;
+using System.Collections.Generic;
+using System.Text;
 
 using System.Runtime.CompilerServices;
-[assembly: InternalsVisibleTo("Tizen.Multimedia, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b1004248416b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693bddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")]
-[assembly: InternalsVisibleTo("Tizen.NUI.Wearable, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b1004248416b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693bddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")]
 
-[assembly: InternalsVisibleTo("Tizen.TV.NUI, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed445c2a988d35b99e5766f42eef33d89d1f67225db051f011abcfce47a4788875c39750a2e5695f1ec117f41d96610419811762669f98131db30a6e64c6bb8fde3731f373f6cda4c0087d121f5108559f216dc015807dc46ec5a4d1b63f5deff64c01754a0db0dc849bc300672572cbd2697432ab6c193ebf9fade6bf0f2aad")]
-[assembly: InternalsVisibleTo("Tizen.TV.NUI.Component, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed445c2a988d35b99e5766f42eef33d89d1f67225db051f011abcfce47a4788875c39750a2e5695f1ec117f41d96610419811762669f98131db30a6e64c6bb8fde3731f373f6cda4c0087d121f5108559f216dc015807dc46ec5a4d1b63f5deff64c01754a0db0dc849bc300672572cbd2697432ab6c193ebf9fade6bf0f2aad")]
+[assembly: InternalsVisibleTo("Tizen.Multimedia, " + PublicKey.TizenFX)]
+[assembly: InternalsVisibleTo("Tizen.NUI.Wearable, " + PublicKey.TizenFX)]
+[assembly: InternalsVisibleTo("Tizen.NUI.Components, " + PublicKey.TizenFX)]
 
-//This is for Layout development and test. snk file will be shared internally. This will be removed at 2018-09-30.
-[assembly: InternalsVisibleTo("Tizen.TV.NUI.Example, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed445c2a988d35b99e5766f42eef33d89d1f67225db051f011abcfce47a4788875c39750a2e5695f1ec117f41d96610419811762669f98131db30a6e64c6bb8fde3731f373f6cda4c0087d121f5108559f216dc015807dc46ec5a4d1b63f5deff64c01754a0db0dc849bc300672572cbd2697432ab6c193ebf9fade6bf0f2aad")]
-[assembly: InternalsVisibleTo("NuiSample, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a5bcf6fb6095141fa8146ec74d5b0be8b09a063f8f1f32604b10df6e498788182840bd15c93ba1a5c0b9aeee8fe2be42ea9c0b5fe32e1d6d5602b2a4fa813114fd58c4b2910d93e5181b90925458b4b8b003c30d97830a17ad90a92f34f60a11f67a78757e6b2035e799be5ab69a41ede17cad2e2b7967fbf49b685452496be0")]
+[assembly: InternalsVisibleTo("Tizen.TV.NUI, " + PublicKey.TizenTV)]
+[assembly: InternalsVisibleTo("Tizen.TV.NUI.Component, " + PublicKey.TizenTV)]
 
-[assembly: InternalsVisibleTo("Tizen.TV.FLUX, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed445c2a988d35b99e5766f42eef33d89d1f67225db051f011abcfce47a4788875c39750a2e5695f1ec117f41d96610419811762669f98131db30a6e64c6bb8fde3731f373f6cda4c0087d121f5108559f216dc015807dc46ec5a4d1b63f5deff64c01754a0db0dc849bc300672572cbd2697432ab6c193ebf9fade6bf0f2aad")]    
-[assembly: InternalsVisibleTo("Tizen.TV.FLUX.Component, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed445c2a988d35b99e5766f42eef33d89d1f67225db051f011abcfce47a4788875c39750a2e5695f1ec117f41d96610419811762669f98131db30a6e64c6bb8fde3731f373f6cda4c0087d121f5108559f216dc015807dc46ec5a4d1b63f5deff64c01754a0db0dc849bc300672572cbd2697432ab6c193ebf9fade6bf0f2aad")]
-[assembly: InternalsVisibleTo("Tizen.TV.FLUX.Example, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed445c2a988d35b99e5766f42eef33d89d1f67225db051f011abcfce47a4788875c39750a2e5695f1ec117f41d96610419811762669f98131db30a6e64c6bb8fde3731f373f6cda4c0087d121f5108559f216dc015807dc46ec5a4d1b63f5deff64c01754a0db0dc849bc300672572cbd2697432ab6c193ebf9fade6bf0f2aad")]
+[assembly: InternalsVisibleTo("Tizen.TV.FLUX, " + PublicKey.TizenTV)]
+[assembly: InternalsVisibleTo("Tizen.TV.FLUX.Component, " + PublicKey.TizenTV)]
+[assembly: InternalsVisibleTo("Tizen.TV.FLUX.Example, " + PublicKey.TizenTV)]
+[assembly: InternalsVisibleTo("Tizen.TV.NUI.Example, " + PublicKey.TizenTV)]
+
+[assembly: InternalsVisibleTo("NuiSample, " + PublicKey.Sample)]
+internal static class PublicKey
+{
+    internal const string TizenFX =
+        "PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b100424841" +
+        "6b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693b" +
+        "ddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37" +
+        "b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2";
+
+    internal const string TizenTV = 
+        "PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed445c2a988d35b" +
+        "99e5766f42eef33d89d1f67225db051f011abcfce47a4788875c39750a2e5695f1ec117f41d96610419811762" + 
+        "669f98131db30a6e64c6bb8fde3731f373f6cda4c0087d121f5108559f216dc015807dc46ec5a4d1b63f5deff" +
+        "64c01754a0db0dc849bc300672572cbd2697432ab6c193ebf9fade6bf0f2aad";
+
+    internal const string Sample = 
+        "PublicKey=0024000004800000940000000602000000240000525341310004000001000100a5bcf6fb6095141f" +
+        "a8146ec74d5b0be8b09a063f8f1f32604b10df6e498788182840bd15c93ba1a5c0b9aeee8fe2be42ea9c0b5fe32" + 
+        "e1d6d5602b2a4fa813114fd58c4b2910d93e5181b90925458b4b8b003c30d97830a17ad90a92f34f60a11f67a78757" +
+        "e6b2035e799be5ab69a41ede17cad2e2b7967fbf49b685452496be0";
+
+}
index cbf5d5f..7e203b3 100755 (executable)
@@ -11,6 +11,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MakeCallback")]
             public static extern global::System.IntPtr MakeCallback(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_PreInitialize")]
+            public static extern void Application_PreInitialize();
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New__SWIG_0")]
             public static extern global::System.IntPtr Application_New__SWIG_0();
 
@@ -76,4 +79,4 @@ namespace Tizen.NUI
             public static extern global::System.IntPtr Application_New__SWIG_4(int jarg1, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5);
         }
     }
-}
\ No newline at end of file
+}
index 6615cd2..92f932b 100755 (executable)
@@ -205,7 +205,6 @@ namespace Tizen.NUI
 
             var childCount = LayoutChildren.Count;
 
-            // WIDTH SPECIFICATIONS
             if (childCount > 0)
             {
                 foreach (LayoutItem childLayout in LayoutChildren)
@@ -217,9 +216,19 @@ namespace Tizen.NUI
                 }
 
                 if (_GridOrientation == Orientation.Horizontal)
+                {
                     widthSize = CalculateHorizontalSize(gridWidthMode, gridHeightMode, widthSize, heightSize);
+                    heightSize = gridWidthMode == MeasureSpecification.ModeType.Exactly?
+                                    heightSize:
+                                    (int)(LayoutChildren[0].MeasuredHeight.Size.AsDecimal() + LayoutChildren[0].Margin.Top + LayoutChildren[0].Margin.Bottom)*Rows;
+                }
                 else
+                {
+                    widthSize = gridWidthMode == MeasureSpecification.ModeType.Exactly?
+                                    heightSize:
+                                    (int)(LayoutChildren[0].MeasuredWidth.Size.AsDecimal() + LayoutChildren[0].Margin.Start + LayoutChildren[0].Margin.End)*Columns;
                     heightSize = CalculateVerticalSize(gridWidthMode, gridHeightMode, widthSize, heightSize);
+                }
 
             } // Children exists
             else
index 7d3bb53..487447f 100755 (executable)
@@ -306,7 +306,15 @@ namespace Tizen.NUI
         public void RequestLayout()
         {
             Flags = Flags | LayoutFlags.ForceLayout;
-            Window.Instance.LayoutController.RequestLayout(this);
+            if (Parent != null)
+            {
+                 LayoutGroup layoutGroup =  Parent as LayoutGroup;
+                 if(! layoutGroup.LayoutRequested)
+                 {
+                    layoutGroup.RequestLayout();
+                 }
+            }
+                       
         }
 
         /// <summary>
index d3e8365..3ca83a7 100755 (executable)
@@ -374,6 +374,17 @@ namespace Tizen.NUI
         {
             base.OnCreate();
         }
+
+        /// <summary>
+        /// This is used to improve application launch performance.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        static public void PreLoad()
+        {
+            Interop.Application.Application_PreInitialize();
+            Application.NewApplication("", Application.WindowMode.Opaque);
+            NUIApplication.GetDefaultWindow();
+        }
     }
 
     /// <summary>