From f444f4d35942301f4486da384b52edefdb54b5cb Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Mon, 5 Nov 2018 13:34:56 +0900 Subject: [PATCH] [NUI] Add WebView event handlers (#522) --- src/Tizen.NUI/src/internal/NDalicPINVOKE.cs | 468 ++---------------------- src/Tizen.NUI/src/internal/WebView.cs | 185 +++++++++- src/Tizen.NUI/src/internal/WebViewLite.cs | 203 ---------- src/Tizen.NUI/src/internal/WebViewLiteSignal.cs | 181 --------- src/Tizen.NUI/src/internal/WebViewSignal.cs | 186 ---------- 5 files changed, 209 insertions(+), 1014 deletions(-) delete mode 100755 src/Tizen.NUI/src/internal/WebViewLite.cs delete mode 100755 src/Tizen.NUI/src/internal/WebViewLiteSignal.cs delete mode 100755 src/Tizen.NUI/src/internal/WebViewSignal.cs diff --git a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs index a3b8cd4..8aa585d 100755 --- a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs @@ -67203,44 +67203,6 @@ namespace Tizen.NUI } } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebView_PageLoadStartedSignal")] - public static extern WebViewSignal WebView_PageLoadStartedSignal_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebView_PageLoadStartedSignal")] - public static extern WebViewSignal WebView_PageLoadStartedSignal_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static WebViewSignal WebView_PageLoadStartedSignal(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebView_PageLoadStartedSignal_vulkan(jarg1); - } - else - { - return WebView_PageLoadStartedSignal_gl(jarg1); - } - } - - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebView_PageLoadFinishedSignal")] - public static extern WebViewSignal WebView_PageLoadFinishedSignal_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebView_PageLoadFinishedSignal")] - public static extern WebViewSignal WebView_PageLoadFinishedSignal_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static WebViewSignal WebView_PageLoadFinishedSignal(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebView_PageLoadFinishedSignal_vulkan(jarg1); - } - else - { - return WebView_PageLoadFinishedSignal_gl(jarg1); - } - } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebView_SWIGUpcast")] public static extern global::System.IntPtr WebView_SWIGUpcast_gl(global::System.IntPtr jarg1); @@ -67259,453 +67221,93 @@ namespace Tizen.NUI } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Empty")] - public static extern bool WebViewSignal_Empty_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Empty")] - public static extern bool WebViewSignal_Empty_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static bool WebViewSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewSignal_Empty_vulkan(jarg1); - } - else - { - return WebViewSignal_Empty_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_GetConnectionCount")] - public static extern uint WebViewSignal_GetConnectionCount_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_GetConnectionCount")] - public static extern uint WebViewSignal_GetConnectionCount_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static uint WebViewSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewSignal_GetConnectionCount_vulkan(jarg1); - } - else - { - return WebViewSignal_GetConnectionCount_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Connect")] - public static extern void WebViewSignal_Connect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Connect")] - public static extern void WebViewSignal_Connect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - public static void WebViewSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewSignal_Connect_vulkan(jarg1, jarg2); - } - else - { - WebViewSignal_Connect_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Disconnect")] - public static extern void WebViewSignal_Disconnect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Disconnect")] - public static extern void WebViewSignal_Disconnect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - public static void WebViewSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewSignal_Disconnect_vulkan(jarg1, jarg2); - } - else - { - WebViewSignal_Disconnect_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Emit")] - public static extern void WebViewSignal_Emit_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Emit")] - public static extern void WebViewSignal_Emit_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - public static void WebViewSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewSignal_Emit_vulkan(jarg1, jarg2); - } - else - { - WebViewSignal_Emit_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignal")] - public static extern global::System.IntPtr new_WebViewSignal_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignal")] - public static extern global::System.IntPtr new_WebViewSignal_vulkan(); - - public static global::System.IntPtr new_WebViewSignal() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return new_WebViewSignal_vulkan(); - } - else - { - return new_WebViewSignal_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewSignal")] - public static extern void delete_WebViewSignal_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewSignal")] - public static extern void delete_WebViewSignal_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static void delete_WebViewSignal(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - delete_WebViewSignal_vulkan(jarg1); - } - else - { - delete_WebViewSignal_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_New")] - public static extern global::System.IntPtr WebViewLite_New_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_New")] - public static extern global::System.IntPtr WebViewLite_New_vulkan(); - - public static global::System.IntPtr WebViewLite_New() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLite_New_vulkan(); - } - else - { - return WebViewLite_New_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLite__SWIG_0")] - public static extern global::System.IntPtr new_WebViewLite__SWIG_0_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLite__SWIG_0")] - public static extern global::System.IntPtr new_WebViewLite__SWIG_0_vulkan(); - - public static global::System.IntPtr new_WebViewLite__SWIG_0() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return new_WebViewLite__SWIG_0_vulkan(); - } - else - { - return new_WebViewLite__SWIG_0_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewLite")] - public static extern void delete_WebViewLite_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewLite")] - public static extern void delete_WebViewLite_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static void delete_WebViewLite(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - delete_WebViewLite_vulkan(jarg1); - } - else - { - delete_WebViewLite_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLite__SWIG_1")] - public static extern global::System.IntPtr new_WebViewLite__SWIG_1_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLite__SWIG_1")] - public static extern global::System.IntPtr new_WebViewLite__SWIG_1_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static global::System.IntPtr new_WebViewLite__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return new_WebViewLite__SWIG_1_vulkan(jarg1); - } - else - { - return new_WebViewLite__SWIG_1_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_Assign")] - public static extern global::System.IntPtr WebViewLite_Assign_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_Assign")] - public static extern global::System.IntPtr WebViewLite_Assign_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - public static global::System.IntPtr WebViewLite_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLite_Assign_vulkan(jarg1, jarg2); - } - else - { - return WebViewLite_Assign_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_DownCast")] - public static extern global::System.IntPtr WebViewLite_DownCast_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_DownCast")] - public static extern global::System.IntPtr WebViewLite_DownCast_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static global::System.IntPtr WebViewLite_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLite_DownCast_vulkan(jarg1); - } - else - { - return WebViewLite_DownCast_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_CreateInstance")] - public static extern void WebViewLite_CreateInstance_gl(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_CreateInstance")] - public static extern void WebViewLite_CreateInstance_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7); - - public static void WebViewLite_CreateInstance(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewLite_CreateInstance_vulkan(jarg1, jarg2, jarg3, jarg4, jarg5, jarg6, jarg7); - } - else - { - WebViewLite_CreateInstance_gl(jarg1, jarg2, jarg3, jarg4, jarg5, jarg6, jarg7); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_DestroyInstance")] - public static extern void WebViewLite_DestroyInstance_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_DestroyInstance")] - public static extern void WebViewLite_DestroyInstance_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static void WebViewLite_DestroyInstance(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewLite_DestroyInstance_vulkan(jarg1); - } - else - { - WebViewLite_DestroyInstance_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_LoadHtml")] - public static extern void WebViewLite_LoadHtml_gl(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_LoadHtml")] - public static extern void WebViewLite_LoadHtml_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - - public static void WebViewLite_LoadHtml(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewLite_LoadHtml_vulkan(jarg1, jarg2); - } - else - { - WebViewLite_LoadHtml_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_FinishedSignal")] - public static extern global::System.IntPtr WebViewLite_FinishedSignal_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_FinishedSignal")] - public static extern global::System.IntPtr WebViewLite_FinishedSignal_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static global::System.IntPtr WebViewLite_FinishedSignal(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLite_FinishedSignal_vulkan(jarg1); - } - else - { - return WebViewLite_FinishedSignal_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Empty")] - public static extern bool WebViewLiteSignal_Empty_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Empty")] - public static extern bool WebViewLiteSignal_Empty_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static bool WebViewLiteSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLiteSignal_Empty_vulkan(jarg1); - } - else - { - return WebViewLiteSignal_Empty_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_GetConnectionCount")] - public static extern uint WebViewLiteSignal_GetConnectionCount_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_GetConnectionCount")] - public static extern uint WebViewLiteSignal_GetConnectionCount_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static uint WebViewLiteSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLiteSignal_GetConnectionCount_vulkan(jarg1); - } - else - { - return WebViewLiteSignal_GetConnectionCount_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Connect")] - public static extern void WebViewLiteSignal_Connect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Connect")] - public static extern void WebViewLiteSignal_Connect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - public static void WebViewLiteSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewLiteSignal_Connect_vulkan(jarg1, jarg2); - } - else - { - WebViewLiteSignal_Connect_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Disconnect")] - public static extern void WebViewLiteSignal_Disconnect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignalProxy_PageLoadStarted")] + public static extern global::System.IntPtr new_WebViewSignalProxy_PageLoadStarted_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Disconnect")] - public static extern void WebViewLiteSignal_Disconnect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignalProxy_PageLoadStarted")] + public static extern global::System.IntPtr new_WebViewSignalProxy_PageLoadStarted_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - public static void WebViewLiteSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) + public static global::System.IntPtr new_WebViewSignalProxy_PageLoadStarted(global::System.Runtime.InteropServices.HandleRef jarg1) { if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) { - WebViewLiteSignal_Disconnect_vulkan(jarg1, jarg2); + return new_WebViewSignalProxy_PageLoadStarted_vulkan(jarg1); } else { - WebViewLiteSignal_Disconnect_gl(jarg1, jarg2); + return new_WebViewSignalProxy_PageLoadStarted_gl(jarg1); } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Emit")] - public static extern void WebViewLiteSignal_Emit_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignalProxy_PageLoadFinished")] + public static extern global::System.IntPtr new_WebViewSignalProxy_PageLoadFinished_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Emit")] - public static extern void WebViewLiteSignal_Emit_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignalProxy_PageLoadFinished")] + public static extern global::System.IntPtr new_WebViewSignalProxy_PageLoadFinished_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - public static void WebViewLiteSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) + public static global::System.IntPtr new_WebViewSignalProxy_PageLoadFinished(global::System.Runtime.InteropServices.HandleRef jarg1) { if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) { - WebViewLiteSignal_Emit_vulkan(jarg1, jarg2); + return new_WebViewSignalProxy_PageLoadFinished_vulkan(jarg1); } else { - WebViewLiteSignal_Emit_gl(jarg1, jarg2); + return new_WebViewSignalProxy_PageLoadFinished_gl(jarg1); } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLiteSignal")] - public static extern global::System.IntPtr new_WebViewLiteSignal_gl(); + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewSignalProxy")] + public static extern void delete_WebViewSignalProxy_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLiteSignal")] - public static extern global::System.IntPtr new_WebViewLiteSignal_vulkan(); + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewSignalProxy")] + public static extern void delete_WebViewSignalProxy_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - public static global::System.IntPtr new_WebViewLiteSignal() + public static void delete_WebViewSignalProxy(global::System.Runtime.InteropServices.HandleRef jarg1) { if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) { - return new_WebViewLiteSignal_vulkan(); + delete_WebViewSignalProxy_vulkan(jarg1); } else { - return new_WebViewLiteSignal_gl(); + delete_WebViewSignalProxy_gl(jarg1); } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewLiteSignal")] - public static extern void delete_WebViewLiteSignal_gl(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignalProxy_Connect")] + public static extern void WebViewSignalProxy_Connect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewLiteSignal")] - public static extern void delete_WebViewLiteSignal_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignalProxy_Connect")] + public static extern void WebViewSignalProxy_Connect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - public static void delete_WebViewLiteSignal(global::System.Runtime.InteropServices.HandleRef jarg1) + public static void WebViewSignalProxy_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) { if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) { - delete_WebViewLiteSignal_vulkan(jarg1); + WebViewSignalProxy_Connect_vulkan(jarg1, jarg2); } else { - delete_WebViewLiteSignal_gl(jarg1); + WebViewSignalProxy_Connect_gl(jarg1, jarg2); } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_SWIGUpcast")] - public static extern global::System.IntPtr WebViewLite_SWIGUpcast_gl(global::System.IntPtr jarg1); + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignalProxy_Disconnect")] + public static extern void WebViewSignalProxy_Disconnect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_SWIGUpcast")] - public static extern global::System.IntPtr WebViewLite_SWIGUpcast_vulkan(global::System.IntPtr jarg1); + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignalProxy_Disconnect")] + public static extern void WebViewSignalProxy_Disconnect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - public static global::System.IntPtr WebViewLite_SWIGUpcast(global::System.IntPtr jarg1) + public static void WebViewSignalProxy_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) { if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) { - return WebViewLite_SWIGUpcast_vulkan(jarg1); + WebViewSignalProxy_Disconnect_vulkan(jarg1, jarg2); } else { - return WebViewLite_SWIGUpcast_gl(jarg1); + WebViewSignalProxy_Disconnect_gl(jarg1, jarg2); } } diff --git a/src/Tizen.NUI/src/internal/WebView.cs b/src/Tizen.NUI/src/internal/WebView.cs index 4feefd4..8c11196 100755 --- a/src/Tizen.NUI/src/internal/WebView.cs +++ b/src/Tizen.NUI/src/internal/WebView.cs @@ -32,6 +32,16 @@ namespace Tizen.NUI internal WebView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.WebView_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + + InitializeSignals(); + } + + private global::System.Runtime.InteropServices.HandleRef pageLoadStartedSignalProxy; + private global::System.Runtime.InteropServices.HandleRef pageLoadFinishedSignalProxy; + private void InitializeSignals() + { + pageLoadStartedSignalProxy = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_WebViewSignalProxy_PageLoadStarted(swigCPtr)); + pageLoadFinishedSignalProxy = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_WebViewSignalProxy_PageLoadFinished(swigCPtr)); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebView obj) @@ -63,7 +73,7 @@ namespace Tizen.NUI //You should not access any managed member here except static instance. //because the execution order of Finalizes is non-deterministic. - DisConnectFromSignals(); + DisposeSignals(); if (swigCPtr.Handle != global::System.IntPtr.Zero) { @@ -78,17 +88,27 @@ namespace Tizen.NUI base.Dispose(type); } - private void DisConnectFromSignals() + private void DisposeSignals() { - // Save current CPtr. - global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr; - - // Use BaseHandle CPtr as current might have been deleted already in derived classes. - swigCPtr = GetBaseHandleCPtrHandleRef; - - // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. - // Restore current CPtr. - swigCPtr = currentCPtr; + if (pageLoadStartedSignalProxy.Handle != global::System.IntPtr.Zero) + { + if (pageLoadStartedCallback != null) + { + WebViewProxyDisconnect(pageLoadStartedSignalProxy, pageLoadStartedCallback); + } + NDalicPINVOKE.delete_WebViewSignalProxy(pageLoadStartedSignalProxy); + pageLoadStartedSignalProxy = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + if (pageLoadFinishedSignalProxy.Handle != global::System.IntPtr.Zero) + { + if (pageLoadFinishedCallback != null) + { + WebViewProxyDisconnect(pageLoadFinishedSignalProxy, pageLoadFinishedCallback); + } + NDalicPINVOKE.delete_WebViewSignalProxy(pageLoadFinishedSignalProxy); + pageLoadFinishedSignalProxy = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } } /// @@ -137,6 +157,149 @@ namespace Tizen.NUI } /// + /// Event arguments that passed via the webview signal. + /// + public class WebViewEventArgs : EventArgs + { + private WebView _webView; + /// + /// The view for displaying webpages. + /// + public WebView WebView + { + get + { + return _webView; + } + set + { + _webView = value; + } + } + + private string _pageUrl; + /// + /// The url string of current webpage. + /// + public string PageUrl + { + get + { + return _pageUrl; + } + set + { + _pageUrl = value; + } + } + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WebViewCallbackDelegate(IntPtr data, string pageUrl); + + private void WebViewProxyConnect(global::System.Runtime.InteropServices.HandleRef proxy, System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicPINVOKE.WebViewSignalProxy_Connect(proxy, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + private void WebViewProxyDisconnect(global::System.Runtime.InteropServices.HandleRef proxy, System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicPINVOKE.WebViewSignalProxy_Disconnect(proxy, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + private EventHandler pageLoadStartedEventHandler; + private WebViewCallbackDelegate pageLoadStartedCallback; + + /// + /// Event for the PageLoadStarted signal which can be used to subscribe or unsubscribe the event handler.
+ /// This signal is emitted when page loading has started.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler PageLoadStarted + { + add + { + if (pageLoadStartedEventHandler == null) + { + pageLoadStartedCallback = (OnPageLoadStarted); + WebViewProxyConnect(pageLoadStartedSignalProxy, pageLoadStartedCallback); + } + pageLoadStartedEventHandler += value; + } + remove + { + pageLoadStartedEventHandler -= value; + if (pageLoadStartedEventHandler == null && pageLoadStartedCallback != null) + { + WebViewProxyDisconnect(pageLoadStartedSignalProxy, pageLoadStartedCallback); + } + } + } + + private void OnPageLoadStarted(IntPtr data, string pageUrl) + { + WebViewEventArgs e = new WebViewEventArgs(); + + e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView; + e.PageUrl = pageUrl; + + if (pageLoadStartedEventHandler != null) + { + pageLoadStartedEventHandler(this, e); + } + } + + private EventHandler pageLoadFinishedEventHandler; + private WebViewCallbackDelegate pageLoadFinishedCallback; + + /// + /// Event for the PageLoadFinished signal which can be used to subscribe or unsubscribe the event handler.
+ /// This signal is emitted when page loading has finished.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler PageLoadFinished + { + add + { + if (pageLoadFinishedEventHandler == null) + { + pageLoadFinishedCallback = (OnPageLoadFinished); + WebViewProxyConnect(pageLoadFinishedSignalProxy, pageLoadFinishedCallback); + } + pageLoadFinishedEventHandler += value; + } + remove + { + pageLoadFinishedEventHandler -= value; + if (pageLoadFinishedEventHandler == null && pageLoadFinishedCallback != null) + { + WebViewProxyDisconnect(pageLoadFinishedSignalProxy, pageLoadFinishedCallback); + } + } + } + + private void OnPageLoadFinished(IntPtr data, string pageUrl) + { + WebViewEventArgs e = new WebViewEventArgs(); + + e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView; + e.PageUrl = pageUrl; + + if (pageLoadFinishedEventHandler != null) + { + pageLoadFinishedEventHandler(this, e); + } + } + + /// /// Loads a html. /// The path of Web /// diff --git a/src/Tizen.NUI/src/internal/WebViewLite.cs b/src/Tizen.NUI/src/internal/WebViewLite.cs deleted file mode 100755 index bcc0ba6..0000000 --- a/src/Tizen.NUI/src/internal/WebViewLite.cs +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2017 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.Runtime.InteropServices; -using Tizen.NUI.BaseComponents; - -namespace Tizen.NUI { - -/// -/// WebViewLite. -/// -internal class WebViewLite : View -{ - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal WebViewLite(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.WebViewLite_SWIGUpcast(cPtr), cMemoryOwn) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebViewLite obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// To make Button instance be disposed. - /// - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - DisConnectFromSignals(); - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_WebViewLite(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - - private void DisConnectFromSignals() - { - // Save current CPtr. - global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr; - - // Use BaseHandle CPtr as current might have been deleted already in derived classes. - swigCPtr = GetBaseHandleCPtrHandleRef; - - if (_loadingFinishedEventCallback != null) - { - FinishedSignal().Disconnect(_loadingFinishedEventCallback); - } - - // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. - // Restore current CPtr. - swigCPtr = currentCPtr; - } - - private LoadingFinishedCallbackType _loadingFinishedEventCallback; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void LoadingFinishedCallbackType(global::System.IntPtr data); - private EventHandler _loadingFinishedEventHandler; - - /// - /// Web View loading finished event. - /// - public event EventHandler LoadingFinished - { - add - { - if (_loadingFinishedEventHandler == null) - { - NUILog.Debug("[add before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); - _loadingFinishedEventCallback = OnFinished; - FinishedSignal().Connect(_loadingFinishedEventCallback); - NUILog.Debug("[add after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); - } - _loadingFinishedEventHandler += value; - } - remove - { - _loadingFinishedEventHandler -= value; - - if (_loadingFinishedEventHandler == null && FinishedSignal().Empty() == false) - { - NUILog.Debug("[remove before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); - FinishedSignal().Disconnect(_loadingFinishedEventCallback); - NUILog.Debug("[remove after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); - } - } - } - private void OnFinished(IntPtr data) - { - if (_loadingFinishedEventHandler != null) - { - //here we send all data to user event handlers - _loadingFinishedEventHandler(this, null); - } - } - - /// - /// Creates an uninitialized WebViewLite. - /// - public WebViewLite () : this (NDalicPINVOKE.WebViewLite_New(), true) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - /// - /// Copy constructor. - /// WebViewLite to copy. The copied WebViewLite will point at the same implementation - /// - public WebViewLite(WebViewLite webViewLite) : this(NDalicPINVOKE.new_WebViewLite__SWIG_1(WebViewLite.getCPtr(webViewLite)), true) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal WebViewLite Assign(WebViewLite webViewLite) { - WebViewLite ret = new WebViewLite(NDalicPINVOKE.WebViewLite_Assign(swigCPtr, WebViewLite.getCPtr(webViewLite)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static WebViewLite DownCast(BaseHandle handle) { - WebViewLite ret = new WebViewLite(NDalicPINVOKE.WebViewLite_DownCast(BaseHandle.getCPtr(handle)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Creates an internal web view instance (e.g. minimized web engine instance). - /// The width of Web - /// The height of Web - /// The x position of window - /// The y position of window - /// The locale of Web - /// The timezoneID of Web - /// - public void CreateInstance(int width, int height, int windowX, int windowY, string locale, string timezoneID) { - NDalicPINVOKE.WebViewLite_CreateInstance(swigCPtr, width, height, windowX, windowY, locale, timezoneID); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Destroys an internal web view instance (e.g. minimized web engine instance). - /// - public void DestroyInstance() { - NDalicPINVOKE.WebViewLite_DestroyInstance(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Loads a html file. - /// The path of Web - /// - public void LoadHtml(string path) { - NDalicPINVOKE.WebViewLite_LoadHtml(swigCPtr, path); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal WebViewLiteSignal FinishedSignal() { - WebViewLiteSignal ret = new WebViewLiteSignal(NDalicPINVOKE.WebViewLite_FinishedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - -} - -} diff --git a/src/Tizen.NUI/src/internal/WebViewLiteSignal.cs b/src/Tizen.NUI/src/internal/WebViewLiteSignal.cs deleted file mode 100755 index 4ea2305..0000000 --- a/src/Tizen.NUI/src/internal/WebViewLiteSignal.cs +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2017 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 { - -/// -/// WebViewLiteSignal. -/// -internal class WebViewLiteSignal : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - /// - /// swigCMemOwn. - /// - protected bool swigCMemOwn; - - internal WebViewLiteSignal(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebViewLiteSignal obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - - /// - /// A Flat to check if it is already disposed. - /// - protected bool disposed = false; - - /// - /// Distructor. - /// - ~WebViewLiteSignal() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// - /// Dispose. - /// - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - /// - /// you can override it to clean-up your own resources. - /// - /// DisposeTypes - /// 3 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_WebViewLiteSignal(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - - /// - /// Empty - /// - /// true if there is no signal attached - public bool Empty() { - bool ret = NDalicPINVOKE.WebViewLiteSignal_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// GetConnectionCount - /// - /// number of attached signals - public uint GetConnectionCount() { - uint ret = NDalicPINVOKE.WebViewLiteSignal_GetConnectionCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// signal connect - /// - /// - public void Connect(System.Delegate func) { -System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicPINVOKE.WebViewLiteSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// - /// signal disconnect - /// - /// - public void Disconnect(System.Delegate func) { -System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicPINVOKE.WebViewLiteSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// - /// Emit - /// - public void Emit(WebViewLite arg) { - NDalicPINVOKE.WebViewLiteSignal_Emit(swigCPtr, WebViewLite.getCPtr(arg)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// WebViewLiteSignal - /// - public WebViewLiteSignal() : this(NDalicPINVOKE.new_WebViewLiteSignal(), true) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - -} - -} diff --git a/src/Tizen.NUI/src/internal/WebViewSignal.cs b/src/Tizen.NUI/src/internal/WebViewSignal.cs deleted file mode 100755 index 5346f4d..0000000 --- a/src/Tizen.NUI/src/internal/WebViewSignal.cs +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (c) 2017 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.ComponentModel; - -namespace Tizen.NUI { - -/// -/// WebViewSignal. -/// -[EditorBrowsable(EditorBrowsableState.Never)] -public class WebViewSignal : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - protected bool swigCMemOwn; - - [EditorBrowsable(EditorBrowsableState.Never)] - public WebViewSignal(global::System.IntPtr cPtr, bool cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebViewSignal obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - - protected bool disposed = false; - - /// - /// Distructor. - /// - ~WebViewSignal() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// - /// Dispose. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - /// - /// you can override it to clean-up your own resources. - /// - /// DisposeTypes - [EditorBrowsable(EditorBrowsableState.Never)] - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_WebViewSignal(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - - /// - /// Empty - /// - /// true if there is no signal attached - [EditorBrowsable(EditorBrowsableState.Never)] - public bool Empty() { - bool ret = NDalicPINVOKE.WebViewSignal_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// GetConnectionCount - /// - /// number of attached signals - [EditorBrowsable(EditorBrowsableState.Never)] - public uint GetConnectionCount() { - uint ret = NDalicPINVOKE.WebViewSignal_GetConnectionCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// signal connect - /// - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicPINVOKE.WebViewSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// - /// signal disconnect - /// - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicPINVOKE.WebViewSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// - /// Emit - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void Emit(WebView arg) { - NDalicPINVOKE.WebViewSignal_Emit(swigCPtr, WebView.getCPtr(arg)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// WebViewSignal - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public WebViewSignal() : this(NDalicPINVOKE.new_WebViewSignal(), true) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - -} - -} -- 2.7.4