[NUI] Add GLWindow (#1945)
authordkdk-ryu <38246983+dkdk-ryu@users.noreply.github.com>
Thu, 3 Sep 2020 06:19:14 +0000 (15:19 +0900)
committerGitHub <noreply@github.com>
Thu, 3 Sep 2020 06:19:14 +0000 (15:19 +0900)
GLWindow allows you to render scenes with OpenGL ES.

src/Tizen.NUI/src/internal/GLWindowResizedSignal.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/Interop/Interop.GLWindow.cs [new file with mode: 0644]
src/Tizen.NUI/src/internal/Interop/Interop.GLWindowFocusChangeSignal.cs [new file with mode: 0644]
src/Tizen.NUI/src/internal/Interop/Interop.GLWindowResizedSignal.cs [new file with mode: 0644]
src/Tizen.NUI/src/internal/Interop/interop.GLWindowVisibilityChangedSignal.cs [new file with mode: 0644]
src/Tizen.NUI/src/public/GLWindow.cs [new file with mode: 0644]
src/Tizen.NUI/src/public/GLWindowEvent.cs [new file with mode: 0644]
src/Tizen.NUI/src/public/GLWindowVisibilityChangedEvent.cs [new file with mode: 0644]

diff --git a/src/Tizen.NUI/src/internal/GLWindowResizedSignal.cs b/src/Tizen.NUI/src/internal/GLWindowResizedSignal.cs
new file mode 100755 (executable)
index 0000000..76dd3b7
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ *
+ */
+
+namespace Tizen.NUI
+{
+    internal class GLWindowResizedSignal : Disposable
+    {
+
+        internal GLWindowResizedSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+        {
+        }
+
+        protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+        {
+            Interop.GLWindowResizedSignal.GlWindow_delete_ResizedSignal(swigCPtr);
+        }
+
+        public bool Empty()
+        {
+            bool ret = Interop.GLWindowResizedSignal.GlWindow_ResizedSignal_Empty(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public uint GetConnectionCount()
+        {
+            uint ret = Interop.GLWindowResizedSignal.GlWindow_ResizedSignal_GetConnectionCount(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public void Connect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
+            {
+                Interop.GLWindowResizedSignal.GlWindow_ResizedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Disconnect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
+            {
+                Interop.GLWindowResizedSignal.GlWindow_ResizedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Emit(Size2D arg)
+        {
+            Interop.GLWindowResizedSignal.GlWindow_ResizedSignal_Emit(swigCPtr, Size2D.getCPtr(arg));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public GLWindowResizedSignal() : this(Interop.GLWindowResizedSignal.new_GlWindow_ResizedSignal(), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.GLWindow.cs b/src/Tizen.NUI/src/internal/Interop/Interop.GLWindow.cs
new file mode 100644 (file)
index 0000000..c6831b6
--- /dev/null
@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using global::System.Runtime.InteropServices;
+
+namespace Tizen.NUI
+{
+    internal static partial class Interop
+    {
+        internal static partial class GLWindow
+        {
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_New__SWIG_0")]
+            public static extern global::System.IntPtr GlWindow_New__SWIG_0();
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_New__SWIG_1")]
+            public static extern global::System.IntPtr GlWindow_New__SWIG_1(HandleRef jarg1, string jarg2, string jarg3, bool jarg4 );
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_GlWindow__SWIG_0")]
+            public static extern global::System.IntPtr new_GlWindow__SWIG_0();
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_GlWindow")]
+            public static extern void delete_GlWindow(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_GlWindow__SWIG_1")]
+            public static extern global::System.IntPtr new_GlWindow__SWIG_1(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Assign")]
+            public static extern global::System.IntPtr GlWindow_Assign(HandleRef jarg1, HandleRef jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_SetEglConfig")]
+            public static extern global::System.IntPtr GlWindow_SetEglConfig(HandleRef jarg1, bool jarg2, bool jarg3, int jarg4, int jarg5);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Raise")]
+            public static extern void GlWindow_Raise(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Lower")]
+            public static extern void GlWindow_Lower(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Activate")]
+            public static extern void GlWindow_Activate(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Show")]
+            public static extern void GlWindow_Show(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Hide")]
+            public static extern void GlWindow_Hide(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_SetPositionSize")]
+            public static extern void GlWindow_SetPositionSize(HandleRef jarg1, HandleRef jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_GetPositionSize")]
+            public static extern global::System.IntPtr GlWindow_GetPositionSize(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_GetSupportedAuxiliaryHintCount")]
+            public static extern uint GlWindow_GetSupportedAuxiliaryHintCount(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_GetSupportedAuxiliaryHint")]
+            public static extern string GlWindow_GetSupportedAuxiliaryHint(HandleRef jarg1, uint jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_AddAuxiliaryHint")]
+            public static extern uint GlWindow_AddAuxiliaryHint(HandleRef jarg1, string jarg2, string jarg3);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_RemoveAuxiliaryHint")]
+            public static extern bool GlWindow_RemoveAuxiliaryHint(HandleRef jarg1, uint jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_SetAuxiliaryHintValue")]
+            public static extern bool GlWindow_SetAuxiliaryHintValue(HandleRef jarg1, uint jarg2, string jarg3);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_GetAuxiliaryHintValue")]
+            public static extern string GlWindow_GetAuxiliaryHintValue(HandleRef jarg1, uint jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_GetAuxiliaryHintId")]
+            public static extern uint GlWindow_GetAuxiliaryHintId(HandleRef jarg1, string jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_SetInputRegion")]
+            public static extern void GlWindow_SetInputRegion(HandleRef jarg1, HandleRef jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_SetOpaqueState")]
+            public static extern void GlWindow_SetOpaqueState(HandleRef jarg1, bool jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_IsOpaqueState")]
+            public static extern bool GlWindow_IsOpaqueState(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_GetCurrentOrientation")]
+            public static extern int GlWindow_GetCurrentOrientation(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_SetAvailableOrientations")]
+            public static extern void GlWindow_SetAvailableOrientations(HandleRef jarg1, HandleRef jarg2, int jarg3);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_SetPreferredOrientation")]
+            public static extern void GlWindow_SetPreferredOrientation(HandleRef jarg1, int jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_RegisterGlCallback")]
+            public static extern void GlWindow_RegisterGlCallback(HandleRef  jarg1, HandleRef  jarg2, HandleRef  jarg3, HandleRef  jarg4);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_RenderOnce")]
+            public static extern void GlWindow_RenderOnce(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_SWIGUpcast")]
+            public static extern global::System.IntPtr GlWindow_SWIGUpcast(global::System.IntPtr jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_TouchSignal")]
+            public static extern global::System.IntPtr GlWindow_TouchSignal(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_FocusChangedSignal")]
+            public static extern global::System.IntPtr GlWindow_FocusChangedSignal(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_KeyEventSignal")]
+            public static extern global::System.IntPtr GlWindow_KeyEventSignal(HandleRef jarg1);
+
+            // For windows resized signal
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_ResizedSignal")]
+            public static extern global::System.IntPtr GlWindow_ResizedSignal(HandleRef jarg1);
+
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.GLWindowFocusChangeSignal.cs b/src/Tizen.NUI/src/internal/Interop/Interop.GLWindowFocusChangeSignal.cs
new file mode 100644 (file)
index 0000000..29df9c9
--- /dev/null
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using global::System.Runtime.InteropServices;
+
+namespace Tizen.NUI
+{
+    internal static partial class Interop
+    {
+        internal static partial class GLWindowFocusSignalType
+        {
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_FocusSignalType_Empty")]
+            public static extern bool GlWindow_FocusSignalType_Empty(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_FocusSignalType_GetConnectionCount")]
+            public static extern uint GlWindow_FocusSignalType_GetConnectionCount(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_FocusSignalType_Connect")]
+            public static extern void GlWindow_FocusSignalType_Connect(HandleRef jarg1, HandleRef jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_FocusSignalType_Disconnect")]
+            public static extern void GlWindow_FocusSignalType_Disconnect(HandleRef jarg1, HandleRef jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_FocusSignalType_Emit")]
+            public static extern void GlWindow_FocusSignalType_Emit(HandleRef signalType, HandleRef window, bool focusIn);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_GlWindow_FocusSignalType")]
+            public static extern global::System.IntPtr new_GlWindow_FocusSignalType();
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_GlWindow_FocusSignalType")]
+            public static extern void delete_GlWindow_FocusSignalType(HandleRef jarg1);
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.GLWindowResizedSignal.cs b/src/Tizen.NUI/src/internal/Interop/Interop.GLWindowResizedSignal.cs
new file mode 100644 (file)
index 0000000..7e9ad1e
--- /dev/null
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using global::System.Runtime.InteropServices;
+
+namespace Tizen.NUI
+{
+    internal static partial class Interop
+    {
+        internal static partial class GLWindowResizedSignal
+        {
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_ResizedSignal_Empty")]
+            public static extern bool GlWindow_ResizedSignal_Empty(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_ResizedSignal_GetConnectionCount")]
+            public static extern uint GlWindow_ResizedSignal_GetConnectionCount(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_ResizedSignal_Connect")]
+            public static extern void GlWindow_ResizedSignal_Connect(HandleRef jarg1, HandleRef jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_ResizedSignal_Disconnect")]
+            public static extern void GlWindow_ResizedSignal_Disconnect(HandleRef jarg1, HandleRef jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_ResizedSignal_Emit")]
+            public static extern void GlWindow_ResizedSignal_Emit(HandleRef jarg1, HandleRef jarg2);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_GlWindow_ResizedSignal")]
+            public static extern global::System.IntPtr new_GlWindow_ResizedSignal();
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_delete_ResizedSignal")]
+            public static extern void GlWindow_delete_ResizedSignal(HandleRef jarg1);
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/Interop/interop.GLWindowVisibilityChangedSignal.cs b/src/Tizen.NUI/src/internal/Interop/interop.GLWindowVisibilityChangedSignal.cs
new file mode 100644 (file)
index 0000000..29a4672
--- /dev/null
@@ -0,0 +1,32 @@
+using System;
+using global::System.Runtime.InteropServices;
+
+namespace Tizen.NUI
+{
+    internal static partial class Interop
+    {
+        internal static partial class GLWindowVisibilityChangedSignal
+        {
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Visibility_Changed_Signal")]
+            public static extern global::System.IntPtr GetSignal(HandleRef glWindow);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Visibility_Changed_Signal_Empty")]
+            public static extern bool Empty(HandleRef signalType);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Visibility_Changed_Signal_GetConnectionCount")]
+            public static extern uint GetConnectionCount(HandleRef signalType);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Visibility_Changed_Signal_Connect")]
+            public static extern void Connect(HandleRef signalType, HandleRef callback);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Visibility_Changed_Signal_Disconnect")]
+            public static extern void Disconnect(HandleRef signalType, HandleRef callback);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Visibility_Changed_Signal_Emit")]
+            public static extern void Emit(HandleRef signalType, HandleRef window, bool visibility);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_Visibility_Changed_Signal_delete")]
+            public static extern void DeleteSignal(HandleRef signalType);
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/public/GLWindow.cs b/src/Tizen.NUI/src/public/GLWindow.cs
new file mode 100644 (file)
index 0000000..9fd5359
--- /dev/null
@@ -0,0 +1,497 @@
+/*
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ *
+ */
+
+extern alias TizenSystemInformation;
+using TizenSystemInformation.Tizen.System;
+using global::System;
+using System.ComponentModel;
+using System.Collections.Generic;
+using global::System.Runtime.InteropServices;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI
+{
+    /// <summary>
+    /// The GLWindow class is to draw with native GLES.<br />
+    /// This class is the special window. It is for native GLES application.<br />
+    /// So, some special funtions and type are supported.<br />
+    /// In addition, basic window's functions are supported, too.<br />
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public partial class GLWindow : BaseHandle
+    {
+        internal GLWindow(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.GLWindow.GlWindow_SWIGUpcast(cPtr), cMemoryOwn)
+        {
+
+        }
+
+        /// <summary>
+        /// Creates an initialized handle to a new GLWindow.<br />
+        /// This creates an GLWindow with default options.!--<br />
+        /// </summary>
+        /// <returns>A new GLWindow.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public GLWindow() : this(Interop.GLWindow.GlWindow_New__SWIG_0(), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Creates an initialized handle to a new GLWindow.<br />
+        /// This API can create GLWindow with specifc option.<br />
+        /// </summary>
+        /// <param name="name">The name for GL window. </param>
+        /// <param name="windowPosition">The position and size of the Window.</param>
+        /// <param name="isTranslucent">Whether Window is translucent.</param>
+        /// <returns>A new Window.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public GLWindow(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.GLWindow.GlWindow_New__SWIG_1( Rectangle.getCPtr(windowPosition), name, "", isTranslucent), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum GLWindowOrientation
+        {
+            /// <summary>
+            /// Portrait orientation. The height of the display area is greater than the width.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Portrait = 0,
+
+            /// <summary>
+            /// Landscape orientation. A wide view area is needed.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Landscape = 1,
+
+            /// <summary>
+            /// Portrait inverse orientation.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            PortraitInverse = 2,
+
+            /// <summary>
+            /// Landscape inverse orientation.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            LandscapeInverse = 3,
+
+            /// <summary>
+            /// No orientation. It is for the preferred orientation
+            /// Especially, NoOrientationPreference only has the effect for the preferred orientation.
+            /// It is used to unset the preferred orientation with SetPreferredOrientation.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            NoOrientationPreference = -1
+        }
+
+        /// <summary>
+        /// Gets or sets a size of the window.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Size2D WindowSize
+        {
+            get
+            {
+                var val = new Rectangle(Interop.GLWindow.GlWindow_GetPositionSize(swigCPtr), true);
+                Size2D ret = new Size2D(val.Width, val.Height);
+
+                return ret;
+            }
+            set
+            {
+                var val = new Rectangle(Interop.GLWindow.GlWindow_GetPositionSize(swigCPtr), true);
+                Rectangle ret = new Rectangle(val.X, val.Y, value.Width, value.Height );
+
+                Interop.GLWindow.GlWindow_SetPositionSize(swigCPtr, Rectangle.getCPtr(ret));
+            }
+        }
+
+        /// <summary>
+        /// This Enumeration is used the GLES version for EGL configuration.<br />
+        /// If the device can not support GLES version 3.0 over, the version will be chosen with GLES version 2.0<br />
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum GLESVersion
+        {
+            /// <summary>
+            /// GLES version 2.0
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Version_2_0 = 0,
+
+            /// <summary>
+            /// GLES version 3.0
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Version_3_0
+        }
+
+        /// <summary>
+        /// Sets egl configuration for GLWindow
+        /// </summary>
+        /// <param name="depth">The flag of depth buffer. If true is set, 24bit depth buffer is enabled.</param>
+        /// <param name="stencil">The flag of stencil. it true is set, 8bit stencil buffer is enabled.</param>
+        /// <param name="msaa">The bit of msaa.</param>
+        /// <param name="version">The GLES version.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetEglConfig( bool depth, bool stencil, int msaa, GLESVersion version )
+        {
+            Interop.GLWindow.GlWindow_SetEglConfig(swigCPtr, depth, stencil, msaa, (int)version);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Shows the GLWindow if it is hidden.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Show()
+        {
+            Interop.GLWindow.GlWindow_Show(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Hides the GLWindow if it is showing.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Hide()
+        {
+            Interop.GLWindow.GlWindow_Hide(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Raises the window to the top of the window stack.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Raise()
+        {
+            Interop.GLWindow.GlWindow_Raise(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Lowers the window to the bottom of the window stack.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Lower()
+        {
+            Interop.GLWindow.GlWindow_Lower(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Activates the window to the top of the window stack even it is iconified.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Activate()
+        {
+            Interop.GLWindow.GlWindow_Activate(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets position and size of the window. This API guarantees that
+        /// both moving and resizing of window will appear on the screen at once.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Rectangle WindowPositionSize
+        {
+            get
+            {
+                Rectangle val = new Rectangle(Interop.GLWindow.GlWindow_GetPositionSize(swigCPtr), true);
+                Rectangle ret = new Rectangle(val.X, val.Y, val.Width, val.Height );
+
+                return ret;
+            }
+            set
+            {
+                Interop.GLWindow.GlWindow_SetPositionSize(swigCPtr, Rectangle.getCPtr(value));
+            }
+        }
+
+        /// <summary>
+        /// Gets the count of supported auxiliary hints of the GLWindow.
+        /// </summary>
+        /// <returns>The number of supported auxiliary hints.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public uint GetSupportedAuxiliaryHintCount()
+        {
+            uint ret = Interop.GLWindow.GlWindow_GetSupportedAuxiliaryHintCount(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Gets the supported auxiliary hint string of the GLWindow.
+        /// </summary>
+        /// <param name="index">The index of the supported auxiliary hint lists.</param>
+        /// <returns>The auxiliary hint string of the index.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public string GetSupportedAuxiliaryHint(uint index)
+        {
+            string ret = Interop.GLWindow.GlWindow_GetSupportedAuxiliaryHint(swigCPtr, index);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Creates an auxiliary hint of the GLWindow.
+        /// </summary>
+        /// <param name="hint">The auxiliary hint string.</param>
+        /// <param name="value">The value string.</param>
+        /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public uint AddAuxiliaryHint(string hint, string value)
+        {
+            uint ret = Interop.GLWindow.GlWindow_AddAuxiliaryHint(swigCPtr, hint, value);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Removes an auxiliary hint of the GLWindow.
+        /// </summary>
+        /// <param name="id">The ID of the auxiliary hint.</param>
+        /// <returns>True if no error occurred, false otherwise.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool RemoveAuxiliaryHint(uint id)
+        {
+            bool ret = Interop.GLWindow.GlWindow_RemoveAuxiliaryHint(swigCPtr, id);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Changes a value of the auxiliary hint.
+        /// </summary>
+        /// <param name="id">The auxiliary hint ID.</param>
+        /// <param name="value">The value string to be set.</param>
+        /// <returns>True if no error occurred, false otherwise.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool SetAuxiliaryHintValue(uint id, string value)
+        {
+            bool ret = Interop.GLWindow.GlWindow_SetAuxiliaryHintValue(swigCPtr, id, value);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Gets a value of the auxiliary hint.
+        /// </summary>
+        /// <param name="id">The auxiliary hint ID.</param>
+        /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public string GetAuxiliaryHintValue(uint id)
+        {
+            string ret = Interop.GLWindow.GlWindow_GetAuxiliaryHintValue(swigCPtr, id);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Gets an ID of the auxiliary hint string.
+        /// </summary>
+        /// <param name="hint">The auxiliary hint string.</param>
+        /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public uint GetAuxiliaryHintId(string hint)
+        {
+            uint ret = Interop.GLWindow.GlWindow_GetAuxiliaryHintId(swigCPtr, hint);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Sets a region to accept input events.
+        /// </summary>
+        /// <param name="inputRegion">The region to accept input events.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetInputRegion(Rectangle inputRegion)
+        {
+            Interop.GLWindow.GlWindow_SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets a transparent window's visual state to opaque. <br />
+        /// If a visual state of a transparent window is opaque, <br />
+        /// then the window manager could handle it as an opaque window when calculating visibility.
+        /// </summary>
+        /// <param name="opaque">Whether the window's visual state is opaque.</param>
+        /// <remarks>This will have no effect on an opaque window. <br />
+        /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetOpaqueState(bool opaque)
+        {
+            Interop.GLWindow.GlWindow_SetOpaqueState(swigCPtr, opaque);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Returns whether a transparent window's visual state is opaque or not.
+        /// </summary>
+        /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
+        /// <remarks> The return value has no meaning on an opaque window. </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool IsOpaqueState()
+        {
+            bool ret = Interop.GLWindow.GlWindow_IsOpaqueState(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Sets a preferred orientation.
+        /// </summary>
+        /// <param name="orientation">The preferred orientation.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPreferredOrientation(GLWindow.GLWindowOrientation orientation)
+        {
+            Interop.GLWindow.GlWindow_SetPreferredOrientation(swigCPtr, (int)orientation);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Gets current orientation of the window.
+        /// </summary>
+        /// <returns>The current window orientation if previously set, or none.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public GLWindow.GLWindowOrientation GetCurrentOrientation()
+        {
+            GLWindow.GLWindowOrientation ret = (GLWindow.GLWindowOrientation)Interop.GLWindow.GlWindow_GetCurrentOrientation(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Sets available orientations of the window.
+        /// This API is for setting several orientations one time.
+        /// </summary>
+        /// <param name="orientations">The list of orientations.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetAvailableOrientations(List<GLWindow.GLWindowOrientation> orientations)
+        {
+            PropertyArray orientationArray = new PropertyArray();
+            for (int i = 0; i < orientations.Count; i++)
+            {
+                orientationArray.PushBack(new PropertyValue((int)orientations[i]));
+            }
+
+            Interop.GLWindow.GlWindow_SetAvailableOrientations(swigCPtr, PropertyArray.getCPtr(orientationArray), orientations.Count);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Allows at least one more render, even when paused.
+        /// The window should be shown, not minimised.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void RenderOnce()
+        {
+            Interop.GLWindow.GlWindow_RenderOnce(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Type of callback to initialize native GL code.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public delegate void GLInitializeCallbackType();
+
+        GLInitializeCallbackType GLInitializeCallback;
+        HandleRef InitHandleRef;
+
+        /// <summary>
+        /// Type of callback to render to frame to use native GL code.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public delegate void GLRenderFrameCallbackType();
+
+        GLRenderFrameCallbackType GLRenderFrameCallback;
+        HandleRef RenderHandlerRef;
+
+
+        /// <summary>
+        /// Type of callback to cleanup native GL resource.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public delegate void GLTerminateCallbackType();
+
+        GLTerminateCallbackType GLTerminateCallback;
+        HandleRef TerminateHandlerRef;
+
+        /// <summary>
+        /// Registers a GL callback function for application.
+        /// </summary>
+        /// <param name="glInit">The callback function for application initialize</param>
+        /// <param name="glRenderFrame">The callback function to render to the frame</param>
+        /// <param name="glTerminate">The callback function to clean-up application GL resource</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void RegisterGlCallback( GLInitializeCallbackType glInit, GLRenderFrameCallbackType glRenderFrame, GLTerminateCallbackType glTerminate )
+        {
+            GLInitializeCallback = glInit;
+            InitHandleRef = new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(GLInitializeCallback));
+
+            GLRenderFrameCallback = glRenderFrame;
+            RenderHandlerRef = new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(GLRenderFrameCallback));
+
+            GLTerminateCallback = glTerminate;
+            TerminateHandlerRef = new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(GLTerminateCallback));
+
+            Interop.GLWindow.GlWindow_RegisterGlCallback(swigCPtr, InitHandleRef, RenderHandlerRef, TerminateHandlerRef);
+
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Destroy the window immediately.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Destroy()
+        {
+            this.Dispose();
+        }
+
+        /// <summary>
+        /// Dispose for Window
+        /// </summary>
+        protected override void Dispose(DisposeTypes type)
+        {
+            if (disposed)
+            {
+                return;
+            }
+
+            this.DisconnectNativeSignals();
+
+            base.Dispose(type);
+        }
+
+        /// This will not be public opened.
+        protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+        {
+            Interop.Window.delete_Window(swigCPtr);
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/public/GLWindowEvent.cs b/src/Tizen.NUI/src/public/GLWindowEvent.cs
new file mode 100644 (file)
index 0000000..3b86c55
--- /dev/null
@@ -0,0 +1,454 @@
+/*
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * 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.ComponentModel;
+using System.Runtime.InteropServices;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI
+{
+    public partial class GLWindow
+    {
+        private FocusChangedEventCallbackType _focusChangedEventCallback;
+        private GLWindowTouchDataCallbackType _windowTouchDataCallback;
+        private EventCallbackDelegateType1 _windowKeyCallbackDelegate;
+        private WindowResizedEventCallbackType _windowResizedEventCallback;
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void FocusChangedEventCallbackType(IntPtr window, bool focusGained);
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate bool GLWindowTouchDataCallbackType(IntPtr touchData);
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
+
+        /// <summary>
+        /// FocusChanged event.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public event EventHandler<FocusChangedEventArgs> FocusChanged
+        {
+            add
+            {
+                if (_focusChangedEventCallback == null)
+                {
+                    _focusChangedEventCallback = OnWindowFocusedChanged;
+                    FocusChangedSignal().Connect(_focusChangedEventCallback);
+                }
+
+                _focusChangedEventHandler += value;
+            }
+            remove
+            {
+                _focusChangedEventHandler -= value;
+
+                if (_focusChangedEventHandler == null && FocusChangedSignal().Empty() == false && _focusChangedEventCallback != null)
+                {
+                    FocusChangedSignal().Disconnect(_focusChangedEventCallback);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Emits the event when the screen is touched and when the touch ends.<br />
+        /// If there are multiple touch points then it is emitted when the first touch occurs and
+        /// when the last finger is lifted too.<br />
+        /// Even though incoming events are interrupted, the event occurs.<br />
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public event EventHandler<TouchEventArgs> TouchEvent
+        {
+            add
+            {
+                if (_windoTouchDataEventHandler == null)
+                {
+                    _windowTouchDataCallback = OnWindowTouch;
+                    this.TouchSignal().Connect(_windowTouchDataCallback);
+                }
+                _windoTouchDataEventHandler += value;
+            }
+            remove
+            {
+                _windoTouchDataEventHandler -= value;
+                if (_windoTouchDataEventHandler == null && TouchSignal().Empty() == false && _windowTouchDataCallback != null)
+                {
+                    this.TouchSignal().Disconnect(_windowTouchDataCallback);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Emits the event when the key event is received.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public event EventHandler<KeyEventArgs> KeyEvent
+        {
+            add
+            {
+                if (_stageKeyHandler == null)
+                {
+                    _windowKeyCallbackDelegate = OnStageKey;
+                    KeyEventSignal().Connect(_windowKeyCallbackDelegate);
+                }
+                _stageKeyHandler += value;
+            }
+            remove
+            {
+                _stageKeyHandler -= value;
+                if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
+                {
+                    KeyEventSignal().Disconnect(_windowKeyCallbackDelegate);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Emits the event when the window resized.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public event EventHandler<ResizedEventArgs> Resized
+        {
+            add
+            {
+                if (_windowResizedEventHandler == null)
+                {
+                    _windowResizedEventCallback = OnResized;
+                    GLWindowResizedSignal().Connect(_windowResizedEventCallback);
+                }
+
+                _windowResizedEventHandler += value;
+            }
+            remove
+            {
+                _windowResizedEventHandler -= value;
+
+                if (_windowResizedEventHandler == null && GLWindowResizedSignal().Empty() == false && _windowResizedEventCallback != null)
+                {
+                    GLWindowResizedSignal().Disconnect(_windowResizedEventCallback);
+                }
+            }
+        }
+
+        private event EventHandler<FocusChangedEventArgs> _focusChangedEventHandler;
+        private event EventHandler<TouchEventArgs> _windoTouchDataEventHandler;
+        private event EventHandler<KeyEventArgs> _stageKeyHandler;
+        private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
+
+        internal WindowFocusSignalType FocusChangedSignal()
+        {
+            WindowFocusSignalType ret = new WindowFocusSignalType(Interop.GLWindow.GlWindow_FocusChangedSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        internal KeyEventSignal KeyEventSignal()
+        {
+            KeyEventSignal ret = new KeyEventSignal(Interop.GLWindow.GlWindow_KeyEventSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        internal TouchSignal TouchSignal()
+        {
+            TouchSignal ret = new TouchSignal(Interop.GLWindow.GlWindow_TouchSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        internal GLWindowResizedSignal GLWindowResizedSignal()
+        {
+            GLWindowResizedSignal ret = new GLWindowResizedSignal(Interop.GLWindow.GlWindow_ResizedSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Disconnect all native signals
+        /// </summary>
+        internal void DisconnectNativeSignals()
+        {
+            if (_focusChangedEventCallback != null)
+            {
+                FocusChangedSignal().Disconnect(_focusChangedEventCallback);
+            }
+
+            if (_windowTouchDataCallback != null)
+            {
+                TouchSignal().Disconnect(_windowTouchDataCallback);
+            }
+
+            if (_windowKeyCallbackDelegate != null)
+            {
+                KeyEventSignal().Disconnect(_windowKeyCallbackDelegate);
+            }
+
+            if (_windowResizedEventCallback != null)
+            {
+                GLWindowResizedSignal().Disconnect(_windowResizedEventCallback);
+            }
+        }
+
+        private void OnWindowFocusedChanged(IntPtr window, bool focusGained)
+        {
+            if (window == IntPtr.Zero)
+            {
+                NUILog.Error("OnWindowFocusedChanged() Window is null! Do nothing!");
+                return;
+            }
+
+            FocusChangedEventArgs e = new FocusChangedEventArgs();
+
+            e.FocusGained = focusGained;
+
+            if (_focusChangedEventHandler != null)
+            {
+                _focusChangedEventHandler(this, e);
+            }
+        }
+
+        private bool OnWindowTouch(IntPtr touchData)
+        {
+            if (touchData == global::System.IntPtr.Zero)
+            {
+                NUILog.Error("touchData should not be null!");
+                return false;
+            }
+
+            TouchEventArgs e = new TouchEventArgs();
+
+            e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
+
+            if (_windoTouchDataEventHandler != null)
+            {
+                _windoTouchDataEventHandler(this, e);
+            }
+            return false;
+        }
+
+        // Callback for Stage KeyEventsignal
+        private void OnStageKey(IntPtr data)
+        {
+            KeyEventArgs e = new KeyEventArgs();
+            e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
+
+
+            if (_stageKeyHandler != null)
+            {
+                //here we send all data to user event handlers
+                _stageKeyHandler(this, e);
+            }
+        }
+
+        private void OnResized(IntPtr windowSize)
+        {
+            ResizedEventArgs e = new ResizedEventArgs();
+            // var val = new Uint16Pair(windowSize, false);
+            // e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
+            // val.Dispose();
+
+            // Workaround : windowSize should be valid pointer from dali, 
+            // but currenlty it is fixed and is not Uint16Pair class.
+            // will be fixed later.
+            e.WindowSize = this.WindowSize;
+
+            if (_windowResizedEventHandler != null)
+            {
+                _windowResizedEventHandler(this, e);
+            }
+        }
+
+        /// <summary>
+        /// The focus changed event argument.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public class FocusChangedEventArgs : EventArgs
+        {
+            /// <summary>
+            /// FocusGained flag.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public bool FocusGained
+            {
+                get;
+                set;
+            }
+        }
+
+        /// <summary>
+        /// The touch event argument.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public class TouchEventArgs : EventArgs
+        {
+            private Touch _touch;
+
+            /// <summary>
+            /// Touch.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public Touch Touch
+            {
+                get
+                {
+                    return _touch;
+                }
+                set
+                {
+                    _touch = value;
+                }
+            }
+        }
+
+        /// <summary>
+        /// Key event arguments.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public class KeyEventArgs : EventArgs
+        {
+            private Key _key;
+
+            /// <summary>
+            /// Key.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public Key Key
+            {
+                get
+                {
+                    return _key;
+                }
+                set
+                {
+                    _key = value;
+                }
+            }
+        }
+
+        /// <summary>
+        /// Feeds a key event into the window.
+        /// This resized event arguments.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public class ResizedEventArgs : EventArgs
+        {
+            Size2D _windowSize;
+
+            /// <summary>
+            /// This window size.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public Size2D WindowSize
+            {
+                get
+                {
+                    return _windowSize;
+                }
+                set
+                {
+                    _windowSize = value;
+                }
+            }
+        }
+
+        /// <summary>
+        /// VisibilityChangedArgs
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public class VisibilityChangedArgs : EventArgs
+        {
+            private bool _visibility;
+            /// <summary>
+            /// Visibility
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            public bool Visibility
+            {
+                get => _visibility;
+                set {
+                    _visibility = value;
+                }
+            }
+        }
+
+        private void OnVisibilityChanged(IntPtr window, bool visibility)
+        {
+            if (window == global::System.IntPtr.Zero)
+            {
+                NUILog.Error("[ERR] OnVisibilityChanged() window is null");
+                return;
+            }
+
+            VisibilityChangedArgs e = new VisibilityChangedArgs();
+            e.Visibility = visibility;
+            if (VisibilityChangedEventHandler != null)
+            {
+                VisibilityChangedEventHandler.Invoke(this, e);
+            }
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void GLVisibilityChangedEventCallbackType(IntPtr window, bool visibility);
+        private GLVisibilityChangedEventCallbackType _GLVisibilityChangedEventCallback;
+        private event EventHandler<VisibilityChangedArgs> VisibilityChangedEventHandler;
+        private GLWindowVisibilityChangedEvent _GLVisibilityChangedEventSignal;
+
+        /// <summary>
+        /// EffectStart
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public event EventHandler<VisibilityChangedArgs> VisibilityChanged
+        {
+            add
+            {
+                if (VisibilityChangedEventHandler == null)
+                {
+                    _GLVisibilityChangedEventCallback = OnVisibilityChanged;
+                    _GLVisibilityChangedEventSignal = new GLWindowVisibilityChangedEvent(this);
+                    _GLVisibilityChangedEventSignal.Connect(_GLVisibilityChangedEventCallback);
+                }
+                VisibilityChangedEventHandler += value;
+            }
+            remove
+            {
+                VisibilityChangedEventHandler -= value;
+                if (VisibilityChangedEventHandler == null)
+                {
+                    if(_GLVisibilityChangedEventSignal != null)
+                    {
+                        if(_GLVisibilityChangedEventSignal.Empty() == false)
+                        {
+                            _GLVisibilityChangedEventSignal.Disconnect(_GLVisibilityChangedEventCallback);
+                        }
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// VisibiltyChangedSignalEmit
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void VisibiltyChangedSignalEmit(bool visibility)
+        {
+            if(_GLVisibilityChangedEventSignal == null)
+            {
+                _GLVisibilityChangedEventSignal = new GLWindowVisibilityChangedEvent(this);
+            }
+            _GLVisibilityChangedEventSignal.Emit(this, visibility);
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/public/GLWindowVisibilityChangedEvent.cs b/src/Tizen.NUI/src/public/GLWindowVisibilityChangedEvent.cs
new file mode 100644 (file)
index 0000000..d1e8248
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ *
+ */
+
+namespace Tizen.NUI
+{
+    internal class GLWindowVisibilityChangedEvent : Disposable
+    {
+        internal GLWindowVisibilityChangedEvent(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+        {
+        }
+
+        public GLWindowVisibilityChangedEvent(GLWindow glWindow) : this(Interop.GLWindowVisibilityChangedSignal.GetSignal(GLWindow.getCPtr(glWindow)), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+        {
+            Interop.GLWindowVisibilityChangedSignal.DeleteSignal(swigCPtr);
+        }
+
+        public bool Empty()
+        {
+            bool ret = Interop.GLWindowVisibilityChangedSignal.Empty(swigCPtr);
+
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public uint GetConnectionCount()
+        {
+            uint ret = Interop.GLWindowVisibilityChangedSignal.GetConnectionCount(swigCPtr);
+
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public void Connect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
+            {
+                Interop.GLWindowVisibilityChangedSignal.Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Disconnect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
+            {
+                Interop.GLWindowVisibilityChangedSignal.Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Emit(GLWindow glWindow, bool visibility)
+        {
+            Interop.GLWindowVisibilityChangedSignal.Emit(swigCPtr, GLWindow.getCPtr(glWindow), visibility);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+    }
+}