[NUI] Modify Component-application window (#1711)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Tue, 23 Jun 2020 02:25:03 +0000 (11:25 +0900)
committerGitHub <noreply@github.com>
Tue, 23 Jun 2020 02:25:03 +0000 (11:25 +0900)
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/internal/ComponentApplication.cs
src/Tizen.NUI/src/internal/NUIComponentCoreBackend.cs
src/Tizen.NUI/src/public/NUIFrameComponent.cs

index 6c186ab..e2ef652 100755 (executable)
@@ -8,12 +8,10 @@ namespace Tizen.NUI
     class ComponentApplication : Application
     {
         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
-        private List<NUIFrameComponent> _frameComponentList;
 
         internal ComponentApplication(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
         {
             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
-            _frameComponentList = new List<NUIFrameComponent>();
         }
 
         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ComponentApplication obj)
@@ -77,14 +75,14 @@ namespace Tizen.NUI
             return ret;
         }
 
-               
+
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate IntPtr NUIComponentApplicationCreatenativeEventCallbackDelegate(IntPtr data);
+        private delegate IntPtr NUIComponentApplicationCreatenativeEventCallbackDelegate();
 
-               public delegate IntPtr CreateNativeEventHandler(IntPtr data);
-               private CreateNativeEventHandler _applicationCreateNativeEventHandler;
+        public delegate IntPtr CreateNativeEventHandler();
+        private CreateNativeEventHandler _applicationCreateNativeEventHandler;
         private NUIComponentApplicationCreatenativeEventCallbackDelegate _applicationCreateNativeEventCallbackDelegate;
-               
+
 
         /**
           * @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
@@ -152,31 +150,19 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
-               
 
-               
-               // Callback for Application InitSignal
-               private IntPtr OnApplicationCreateNative(IntPtr data)
-        {
-            IntPtr ptr = IntPtr.Zero;
-               
-                       if (_applicationCreateNativeEventHandler != null)
-                       {
-                               ptr = _applicationCreateNativeEventHandler.Invoke(data);
-                       }
-                   return ptr;
-               }
-
-        internal void RegisterFrameComponent(NUIFrameComponent nuiFrameComponent)
+        // Callback for Application InitSignal
+        private IntPtr OnApplicationCreateNative()
         {
-            _frameComponentList.Add(nuiFrameComponent);
-        }
+            IntPtr handle = IntPtr.Zero;
 
-        internal int GetFrameComponentCount()
-        {
-            return _frameComponentList.Count;
-        }
+            if (_applicationCreateNativeEventHandler != null)
+            {
+                handle = _applicationCreateNativeEventHandler.Invoke();
+            }
 
+            return handle;
+        }
 
     }
 
index c7c13d9..b5334c0 100755 (executable)
@@ -131,8 +131,7 @@ namespace Tizen.NUI
         /// <summary>
         /// Callback for Component Application CreateSignal
         /// </summary>
-        /// <param name="data">user data</param>
-        private IntPtr OnCreateNative(IntPtr data)
+        private IntPtr OnCreateNative()
         {
             IntPtr nativeComponentFactoryMap = IntPtr.Zero;
             int n = 0;
@@ -141,7 +140,6 @@ namespace Tizen.NUI
                 nativeComponentFactoryMap = entry.Value.Bind(nativeComponentFactoryMap);
                 n++;
             }
-
             return nativeComponentFactoryMap;
         }
 
index c6746bf..e9d577b 100755 (executable)
@@ -15,6 +15,7 @@ namespace Tizen.NUI
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class NUIFrameComponent : FrameComponent
     {
+        private bool defaultWindowSet = false;
         internal NUIWindowInfo NUIWindowInfo
         {
             get;
@@ -36,17 +37,18 @@ namespace Tizen.NUI
         public override IWindowInfo CreateWindowInfo()
         {
             ComponentApplication instance = ComponentApplication.Instance as ComponentApplication;
-            if(instance)
+            if (instance)
             {
-                instance.RegisterFrameComponent(this);
-                if(instance.GetFrameComponentCount() == 1)
+                if (!defaultWindowSet)
                 {
-                    Window = instance.GetWindow();
-                }
-                else
-                {
-                    Window = new Window();
+                    instance.GetWindow().WindowPositionSize = new Rectangle(0, 0, 1, 1);
+                    instance.GetWindow().BackgroundColor = new Color(0, 0, 0, 0);
+                    instance.GetWindow().Hide();
+                    defaultWindowSet = true;
                 }
+
+                Window = new Window();
+                Window.Show();
             }
             NUIWindowInfo = new NUIWindowInfo(Window);
             return NUIWindowInfo;