Merge remote-tracking branch 'origin/master' into tizen
authorTizenAPI-Bot <tizenapi@samsung.com>
Tue, 11 Jul 2023 05:56:18 +0000 (05:56 +0000)
committerTizenAPI-Bot <tizenapi@samsung.com>
Tue, 11 Jul 2023 05:56:18 +0000 (05:56 +0000)
12 files changed:
packaging/csapi-tizenfx.spec
packaging/version.txt
src/Tizen.NUI.Components/Controls/Menu.cs
src/Tizen.NUI.Components/Controls/Navigation/DialogPage.cs
src/Tizen.NUI/src/internal/Interop/Interop.Window.cs
src/Tizen.NUI/src/internal/Widget/WidgetImpl.cs
src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs
src/Tizen.NUI/src/public/Widget/Widget.cs
src/Tizen.NUI/src/public/Window/BorderWindow.cs
src/Tizen.NUI/src/public/Window/Window.cs
test/Tizen.NUI.WidgetViewTest/0.Template/Tizen.NUI.WidgetTest/SimpleWidgetApp.cs
test/Tizen.NUI.WidgetViewTest/0.Template/Tizen.NUI.WidgetViewTest/SimpleWidgetViewApp.cs

index 545dd56..557541f 100644 (file)
@@ -1,8 +1,8 @@
 # Auto-generated from csapi-tizenfx.spec.in by makespec.sh
 
 %define TIZEN_NET_API_VERSION 11
-%define TIZEN_NET_RPM_VERSION 11.0.0.17895+nui22231
-%define TIZEN_NET_NUGET_VERSION 11.0.0.17895
+%define TIZEN_NET_RPM_VERSION 11.0.0.999+nui22234
+%define TIZEN_NET_NUGET_VERSION 11.0.0.99999
 
 %define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
 %define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
index 69993e4..c078c8f 100755 (executable)
@@ -6,4 +6,4 @@ RPM_VERSION=11.0.0.999
 NUGET_VERSION=11.0.0.99999
 
 # RPM Version Suffix
-RPM_VERSION_SUFFIX=nui22231
+RPM_VERSION_SUFFIX=nui22234
index 4b129bd..6677af4 100755 (executable)
@@ -529,6 +529,7 @@ namespace Tizen.NUI.Components
                 ExcludeLayouting = true,
                 BackgroundColor = Color.Transparent,
                 Size = new Size(NUIApplication.GetDefaultWindow().Size),
+                DispatchParentGestureEvents = false,
             };
 
             scrim.TouchEvent += (object source, TouchEventArgs e) =>
index 5931fab..1df0542 100755 (executable)
@@ -325,6 +325,7 @@ namespace Tizen.NUI.Components
                 }
                 return true;
             };
+            scrim.DispatchParentGestureEvents = false;
 
             return scrim;
         }
index 26cf90f..644cbe2 100755 (executable)
@@ -276,6 +276,10 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_EnableFloatingMode")]
             public static extern void EnableFloatingMode(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_IsFloatingModeEnabled")]
+            [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+            public static extern bool IsFloatingModeEnabled(global::System.Runtime.InteropServices.HandleRef window);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_RequestMoveToServer")]
             public static extern void RequestMoveToServer(global::System.Runtime.InteropServices.HandleRef jarg1);
 
index b2850db..15e8ef7 100755 (executable)
@@ -35,6 +35,21 @@ namespace Tizen.NUI
             //throw new global::System.MethodAccessException("C++ destructor does not have public access");
         }
 
+        protected override void Dispose(DisposeTypes type)
+        {
+            if (disposed)
+            {
+                return;
+            }
+
+            if (type == DisposeTypes.Explicit)
+            {
+                SwigDirectorDisconnect();
+            }
+
+            base.Dispose(type);
+        }
+
         public class WIdgetInstanceOnCreateArgs : EventArgs
         {
             private string contentInfo;
@@ -298,6 +313,20 @@ namespace Tizen.NUI
             Interop.WidgetImpl.DirectorConnect(SwigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7);
         }
 
+        private void SwigDirectorDisconnect()
+        {
+            swigDelegate0 = null;
+            swigDelegate1 = null;
+            swigDelegate2 = null;
+            swigDelegate3 = null;
+            swigDelegate4 = null;
+            swigDelegate5 = null;
+            swigDelegate6 = null;
+            swigDelegate7 = null;
+
+            Interop.WidgetImpl.DirectorConnect(SwigCPtr,  null, null, null, null, null, null, null, null);
+        }
+
         private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)
         {
             global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
@@ -312,6 +341,12 @@ namespace Tizen.NUI
             {
                 ret = new Window(window, true);
             }
+            else
+            {
+                System.Runtime.InteropServices.HandleRef CPtr = new System.Runtime.InteropServices.HandleRef(this, window);
+                Interop.BaseHandle.DeleteBaseHandle(CPtr);
+                CPtr = new System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
+            }
             OnCreate(contentInfo, ret);
         }
 
@@ -337,6 +372,12 @@ namespace Tizen.NUI
             {
                 ret = new Window(window, true);
             }
+            else
+            {
+                System.Runtime.InteropServices.HandleRef CPtr = new System.Runtime.InteropServices.HandleRef(this, window);
+                Interop.BaseHandle.DeleteBaseHandle(CPtr);
+                CPtr = new System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
+            }
             OnResize(ret);
         }
 
index 1d34cee..0301e50 100755 (executable)
@@ -1137,11 +1137,11 @@ namespace Tizen.NUI.BaseComponents
         private const float FontSizeScaleGiant = 2.5f;
 #else   // PROFILE_MOBILE and etc
         // The following values from 'system-settings/libutil/sstu.c'
-        private const float FontSizeScaleSmall = 0.8f;
+        private const float FontSizeScaleSmall = 0.87f;
         private const float FontSizeScaleNormal = 1.0f;
-        private const float FontSizeScaleLarge = 1.5f;
-        private const float FontSizeScaleHuge = 1.9f;
-        private const float FontSizeScaleGiant = 2.5f;
+        private const float FontSizeScaleLarge = 1.1f;
+        private const float FontSizeScaleHuge = 1.2f;
+        private const float FontSizeScaleGiant = 1.4f;
 #endif
 
         /// <summary>
index ce65cb5..a10d238 100755 (executable)
@@ -46,8 +46,6 @@ namespace Tizen.NUI
             widgetImpl.WidgetInstanceResumed += OnWidgetInstanceResumed;
             widgetImpl.WidgetInstanceResized += OnWidgetInstanceResized;
             widgetImpl.WidgetInstanceUpdated += OnWidgetInstanceUpdated;
-
-            (WidgetApplication.Instance as WidgetApplication)?.AddWidgetInstance(this);
         }
 
         internal Widget(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
index 64477db..c84700e 100755 (executable)
@@ -35,6 +35,7 @@ namespace Tizen.NUI
         private IBorderInterface borderInterface = null;
         private Layer borderWindowRootLayer = null;
         private Layer borderWindowBottomLayer = null;
+        private WindowOrientation currentOrientation;
 
         // for border area
         private View rootView = null;
@@ -52,6 +53,7 @@ namespace Tizen.NUI
         private bool isEnabledOverlayMode = false;
         private bool isMaximized = false;
 
+
         // for config
         private Size2D minSize = null;
         private Size2D maxSize = null;
@@ -261,6 +263,10 @@ namespace Tizen.NUI
 
             if (CreateBorder() == true)
             {
+                Tizen.Log.Info("NUI", $"currentOrientation {currentOrientation}\n");
+                currentOrientation = GetCurrentOrientation();
+                currentOrientation = (currentOrientation == WindowOrientation.Portrait || currentOrientation == WindowOrientation.PortraitInverse) ? WindowOrientation.Portrait : WindowOrientation.Landscape;
+
                 using var realWindowSize = new Size2D(WindowSize.Width, WindowSize.Height);
 
                 isBorderWindow = true;
@@ -273,6 +279,8 @@ namespace Tizen.NUI
 
                 ResizeCompleted += OnBorderWindowResizeCompleted;
 
+                OrientationChanged += OnBorderWindowOrientationChanged;
+
                 borderInterface.OnCreated(borderView);
 
                 // Increase the window size as much as the border area.
@@ -552,6 +560,22 @@ namespace Tizen.NUI
             borderInterface.OnResizeCompleted(e.WindowCompletedSize.Width, e.WindowCompletedSize.Height);
         }
 
+        private void OnBorderWindowOrientationChanged(object sender, WindowOrientationChangedEventArgs e)
+        {
+            WindowOrientation orientation = e.WindowOrientation;
+            orientation = (orientation == WindowOrientation.Portrait || orientation == WindowOrientation.PortraitInverse) ? WindowOrientation.Portrait : WindowOrientation.Landscape;
+            if (currentOrientation != orientation)
+            {
+                if (isEnabledOverlayMode == false && IsFloatingModeEnabled() == false)
+                {
+                    using var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), true);
+                    Tizen.Log.Info("NUI", $"OnBorderWindowOrientationChanged {e.WindowOrientation} {val.GetWidth()},{val.GetHeight()}\n");
+                    uint borderLine = borderLineThickness * 2;
+                    WindowSize = new Size2D((int)(val.GetWidth() - borderHeight - borderLine), (int)(val.GetHeight() - borderLine));
+                }
+            }
+            currentOrientation = orientation;
+        }
 
         // Called when the window size has changed.
         private void OnBorderWindowResized(object sender, Window.ResizedEventArgs e)
@@ -641,6 +665,10 @@ namespace Tizen.NUI
         {
             Resized -= OnBorderWindowResized;
             FocusChanged -= OnWindowFocusChanged;
+            Moved -= OnBorderWindowMoved;
+            MoveCompleted -= OnBorderWindowMoveCompleted;
+            ResizeCompleted -= OnBorderWindowResizeCompleted;
+            OrientationChanged -= OnBorderWindowOrientationChanged;
             borderInterface.Dispose();
             GetBorderWindowBottomLayer().Dispose();
         }
index 96e2950..ccfa9c3 100755 (executable)
@@ -1688,6 +1688,18 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Returns whether the window is floating mode or not.
+        /// </summary>
+        /// <returns>True if the window is enabled floating mode, false otherwise.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsFloatingModeEnabled()
+        {
+            bool ret = Interop.Window.IsFloatingModeEnabled(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
         /// Requests to display server for the window is moved by display server.
         /// It can be work with setting window floating mode.
         /// </summary>
index 4189942..79caa8f 100755 (executable)
@@ -122,7 +122,17 @@ namespace WidgetTemplate
 
         protected override void OnTerminate(string contentInfo, TerminationType type)
         {
+            Tizen.Log.Info("NUI", "OnTerminate(BlueWidget) \n");
+            mAnimation.Stop();
+            mAnimation = null;
+            mRootView.Dispose();
+            mRootView = null;
             base.OnTerminate(contentInfo, type);
+
+            // Call GC for deleting window directly
+            global::System.GC.Collect();
+            global::System.GC.WaitForPendingFinalizers();
+            global::System.GC.Collect();
         }
 
         protected override void OnUpdate(string contentInfo, int force)
index 66e9067..061ab2c 100755 (executable)
@@ -62,8 +62,40 @@ namespace WidgetApplicationTemplate
             mWidgetView2.Position = new Position(100, widgetHeight + 110);
             window.GetDefaultLayer().Add(mWidgetView2);
 
+            mTimer = new Timer(4000);
+            mTimer.Tick += onTick;
+            mTimer.Start();
 
+            created = true;
         }
+
+        private bool onTick(object o, Timer.TickEventArgs e)
+        {
+            Window window = GetDefaultWindow();
+            if(created)
+            {
+                WidgetViewManager.Instance.RemoveWidget(mWidgetView2);
+                mWidgetView2.Dispose();
+                mWidgetView2 = null;
+                created = false;
+            }
+            else
+            {
+                Bundle bundle = new Bundle();
+                bundle.AddItem("COUNT", "1");
+                String encodedBundle = bundle.Encode();
+
+                mWidgetView2 = WidgetViewManager.Instance.AddWidget("class2@Tizen.NUI.WidgetTest", encodedBundle, widgetWidth, widgetHeight, 0.0f);
+                mWidgetView2.Position = new Position(100, widgetHeight + 110);
+                window.GetDefaultLayer().Add(mWidgetView2);
+
+                bundle.Dispose();
+                bundle = null;
+                created = true;
+            }
+            return true;
+        }
+
         public void OnKeyEvent(object sender, Window.KeyEventArgs e)
         {
             if (e.Key.State == Key.StateType.Down )
@@ -109,6 +141,11 @@ namespace WidgetApplicationTemplate
         WidgetView mWidgetView2;
         int widgetWidth;
         int widgetHeight;
+
+        Timer mTimer;
+        bool created;
+
+        Window mWindow;
     }
 }