From 420d7581dcbab611cd08bb35c73d8f4166e182b7 Mon Sep 17 00:00:00 2001 From: "minho.sun" Date: Fri, 15 Sep 2017 10:57:05 +0900 Subject: [PATCH] [4.0] Remove redundant delegates and functions Remove redundant delegates and functions in Application / WidgetApplication. Change-Id: Idedac9b958ed8e809bbd4bfe94218bf63a5cf9c2 Signed-off-by: minho.sun --- Tizen.NUI/src/internal/Application.cs | 76 +---------------------------- Tizen.NUI/src/internal/WidgetApplication.cs | 49 +------------------ 2 files changed, 3 insertions(+), 122 deletions(-) diff --git a/Tizen.NUI/src/internal/Application.cs b/Tizen.NUI/src/internal/Application.cs index ac6d54d..8d224b7 100755 --- a/Tizen.NUI/src/internal/Application.cs +++ b/Tizen.NUI/src/internal/Application.cs @@ -1026,61 +1026,6 @@ namespace Tizen.NUI private static Application _instance; // singleton - public delegate void InitDelegate(); - - public delegate void TerminateDelegate(); - - public delegate void PauseDelegate(); - - public delegate void ResumeDelegate(); - - public delegate void ResizeDelegate(); - - public delegate void AppControlDelegate(); - - public delegate void LanguageChangedDelegate(); - - public delegate void RegionChangedDelegate(); - - public delegate void BatteryLowDelegate(); - - public delegate void MemoryLowDelegate(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void InitDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void TerminateDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void PauseDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void ResumeDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void ResizeDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void AppControlDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void LanguageChangedDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void RegionChangedDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void BatteryLowDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void MemoryLowDelegateInternal(); - - static void Initialization() - { - // instance.InitDelegate(); - } - public static Application Instance { get @@ -1096,27 +1041,14 @@ namespace Tizen.NUI return ret; } - internal void SetupDelegates() - { - InitDelegateInternal initializeCallback = new InitDelegateInternal(Initialization); - - NUILog.Debug("InitSignal connection count"); - - this.InitSignal().Connect(initializeCallback); - - NUILog.Debug("InitSignal connection count = " + InitSignal().GetConnectionCount()); - } - public static Application NewApplication() { - _instance = NewApplication("", Application.WindowMode.Opaque); - return _instance; + return NewApplication("", Application.WindowMode.Opaque); } public static Application NewApplication(string stylesheet) { - _instance = NewApplication(stylesheet, Application.WindowMode.Opaque); - return _instance; + return NewApplication(stylesheet, Application.WindowMode.Opaque); } public static Application NewApplication(string stylesheet, Application.WindowMode windowMode) @@ -1127,8 +1059,6 @@ namespace Tizen.NUI Application ret = New(1, stylesheet, windowMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - // we've got an application now connect the signals - ret.SetupDelegates(); // set the singleton _instance = ret; return ret; @@ -1142,8 +1072,6 @@ namespace Tizen.NUI Application ret = New(args, stylesheet, (Application.WindowMode)windowMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - // we've got an application now connect the signals - ret.SetupDelegates(); // set the singleton _instance = ret; return _instance; diff --git a/Tizen.NUI/src/internal/WidgetApplication.cs b/Tizen.NUI/src/internal/WidgetApplication.cs index 9d16fd9..a4ac014 100755 --- a/Tizen.NUI/src/internal/WidgetApplication.cs +++ b/Tizen.NUI/src/internal/WidgetApplication.cs @@ -101,7 +101,7 @@ namespace Tizen.NUI return ret; } - public static WidgetApplication instance + public static WidgetApplication Instance { get { @@ -109,23 +109,11 @@ namespace Tizen.NUI } } - internal void SetupDelegates() - { - InitDelegateInternal initializeCallback = new InitDelegateInternal(Initialization); - - NUILog.Debug("InitSignal connection count"); - this.InitSignal().Connect(initializeCallback); - - NUILog.Debug("InitSignal connection count = " + InitSignal().GetConnectionCount()); - } - public static WidgetApplication NewWidgetApplication(string[] args, string stylesheet) { WidgetApplication ret = New(args, stylesheet); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - // we've got an application now connect the signals - ret.SetupDelegates(); _instance = ret; return ret; } @@ -534,41 +522,6 @@ namespace Tizen.NUI return ret; } - public delegate void InitDelegate(); - - public delegate void TerminateDelegate(); - - public delegate void LanguageChangedDelegate(); - - public delegate void RegionChangedDelegate(); - - public delegate void BatteryLowDelegate(); - - public delegate void MemoryLowDelegate(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void InitDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void TerminateDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void LanguageChangedDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void RegionChangedDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void BatteryLowDelegateInternal(); - - [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] - internal delegate void MemoryLowDelegateInternal(); - - static void Initialization() - { - // instance.InitDelegate(); - } - private static WidgetApplication _instance; //singleton } -- 2.7.4