[Tizen] Restore AddIdle function for NUIApplication
authorminho.sun <minho.sun@samsung.com>
Fri, 25 Aug 2017 07:57:26 +0000 (16:57 +0900)
committerminho.sun <minho.sun@samsung.com>
Fri, 25 Aug 2017 07:57:26 +0000 (16:57 +0900)
Restore AddIdle function for NUIApplication.

Change-Id: Ia1047c9982ea63dd810cb513652c0d992697624f
Signed-off-by: minho.sun <minho.sun@samsung.com>
src/Tizen.NUI/src/internal/Application.cs
src/Tizen.NUI/src/internal/ManualPINVOKE.cs
src/Tizen.NUI/src/internal/NUICoreBackend.cs
src/Tizen.NUI/src/public/NUIApplication.cs

index 1bfbc8d..298fd16 100755 (executable)
@@ -1149,8 +1149,12 @@ namespace Tizen.NUI
             return _instance;
         }
 
-        //Removed from v0.2.33
-        /*public bool AddIdle(System.Delegate func)
+        /// <summary>
+        /// Ensures that the function passed in is called from the main loop when it is idle.
+        /// </summary>
+        /// <param name="func">The function to call</param>
+        /// <returns>true if added successfully, false otherwise</returns>
+        public bool AddIdle(System.Delegate func)
         {
             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
             System.IntPtr ip2 = NDalicManualPINVOKE.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
@@ -1159,9 +1163,7 @@ namespace Tizen.NUI
 
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
-        }*/
-
-
+        }
 
         /**
         * Outer::outer_method(int)
index c9164ca..bb017c9 100755 (executable)
@@ -1042,5 +1042,8 @@ namespace Tizen.NUI
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_AdaptorSignalType")]
         public static extern void delete_AdaptorSignalType(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_MakeCallback")]
+        public static extern global::System.IntPtr MakeCallback(global::System.Runtime.InteropServices.HandleRef jarg1);
+
     }
 }
index d8dcd81..3f28755 100755 (executable)
@@ -109,6 +109,16 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Ensures that the function passed in is called from the main loop when it is idle.
+        /// </summary>
+        /// <param name="func">The function to call</param>
+        /// <returns>true if added successfully, false otherwise</returns>
+        public bool AddIdle(System.Delegate func)
+        {
+            return _application.AddIdle(func);
+        }
+
+        /// <summary>
         /// Run Application.
         /// </summary>
         /// <param name="args">Arguments from commandline.</param>
@@ -240,8 +250,8 @@ namespace Tizen.NUI
         private void OnAppControl(object source, NUIApplicationAppControlEventArgs e)
         {
             Log.Debug("NUI", "NUICorebackend OnAppControl Called");
-            var handler = Handlers[EventType.AppControlReceived] as Action<AppControlReceivedEventArgs>;\r
-            SafeAppControlHandle handle = new SafeAppControlHandle(e.VoidP,false);\r
+            var handler = Handlers[EventType.AppControlReceived] as Action<AppControlReceivedEventArgs>;
+            SafeAppControlHandle handle = new SafeAppControlHandle(e.VoidP,false);
             handler?.Invoke( new AppControlReceivedEventArgs(new ReceivedAppControl(handle)) );
         }
 
index 32f9950..77639e8 100755 (executable)
@@ -182,6 +182,16 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Ensures that the function passed in is called from the main loop when it is idle.
+        /// </summary>
+        /// <param name="func">The function to call</param>
+        /// <returns>true if added successfully, false otherwise</returns>
+        public bool AddIdle(System.Delegate func)
+        {
+            return ((NUICoreBackend)this.Backend).AddIdle(func);
+        }
+
+        /// <summary>
         /// Enumeration for deciding whether a NUI application window is opaque or transparent.
         /// </summary>
         public enum WindowMode