Add new API to relayout & flush update/render thread messages.
It is for advanced app developer.
This API will flush all queued messages and rendering well.
But if we call it frequency, it will occure main thread overhead.
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
return ret;
}
+ public void FlushUpdateMessages()
+ {
+ Interop.Application.FlushUpdateMessages(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
[EditorBrowsable(EditorBrowsableState.Never)]
public static List<Window> GetWindowList()
{
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_New_WithWindowData")]
public static extern global::System.IntPtr New(int argc, string argv, string styleSheet, bool uiThread, global::System.Runtime.InteropServices.HandleRef windowData);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Application_FlushUpdateMessages")]
+ public static extern void FlushUpdateMessages(global::System.Runtime.InteropServices.HandleRef jarg1);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GetScreenSize")]
public static extern global::System.IntPtr GetScreenSize();
}
}
/// <summary>
+ /// Flush render/update thread messages synchronously.
+ /// </summary>
+ /// <remarks>
+ /// This function will relayout forcibily.
+ /// This function is used for advanced developer. It will make main-thread overhead if you call this function frequencely.
+ /// </remarks>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void FlushUpdateMessages()
+ {
+ ApplicationHandle.FlushUpdateMessages();
+ }
+
+ /// <summary>
/// Sets the number of frames per render.
/// </summary>
/// <param name="numberOfVSyncsPerRender">The number of vsyncs between successive renders.</param>
}
/// <summary>
+ /// Flush render/update thread messages synchronously.
+ /// </summary>
+ /// <remarks>
+ /// This function will relayout forcibily.
+ /// This function is used for advanced developer. It will make main-thread overhead if you call this function frequencely.
+ /// </remarks>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void FlushUpdateMessages()
+ {
+ ApplicationHandle.FlushUpdateMessages();
+ }
+
+ /// <summary>
/// Overrides this method if want to handle OnLocaleChanged behavior.
/// </summary>
/// <since_tizen> 4 </since_tizen>
string exceptionMessage = "Unknown!";
try
{
+ // Hard coding to set NUIApplication into IExample
+ if(name == "Tizen.NUI.Samples.FlushApplicationMessageSample")
+ {
+ (example as FlushApplicationMessageSample)?.SetCurrentApplication(this);
+ }
example.Activate();
}
catch (Exception e)
--- /dev/null
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using System.Threading;
+
+namespace Tizen.NUI.Samples
+{
+ public class FlushApplicationMessageSample : IExample
+ {
+ private View root;
+ private TextLabel textLabel;
+ private NUIApplication application;
+
+ public void SetCurrentApplication(Tizen.NUI.NUIApplication application)
+ {
+ Tizen.Log.Error("NUITEST", $"SetCurrentApplication {application}\n");
+ this.application = application;
+ }
+
+ public Tizen.NUI.NUIApplication GetCurrentApplication()
+ {
+ Tizen.Log.Error("NUITEST", $"GetCurrentApplication {application}\n");
+ return application;
+ }
+
+ public void Activate()
+ {
+ Window window = NUIApplication.GetDefaultWindow();
+
+ root = new View()
+ {
+ Size = window.Size,
+ BackgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.6f),
+ ParentOrigin = ParentOrigin.Center,
+ PivotPoint = PivotPoint.Center,
+ PositionUsesPivotPoint = true,
+ };
+ window.Add(root);
+
+ textLabel = new TextLabel()
+ {
+ Text = "SceneOn",
+ };
+
+ root.Add(textLabel);
+ Tizen.Log.Error("NUITEST", "SceneOn\n");
+
+ textLabel.Text = "Sleep 5 seconds";
+
+ GetCurrentApplication()?.FlushUpdateMessages();
+ Tizen.Log.Error("NUITEST", "FlushUpdateMessages\n");
+
+ Tizen.Log.Error("NUITEST", "Sleep 5 seconds\n");
+ Thread.Sleep(5000); /// sleep 5 seconds
+ Tizen.Log.Error("NUITEST", "Sleep done\n");
+
+ textLabel.Text = "Sleep done!\n";
+ }
+
+ public void Deactivate()
+ {
+ if (root != null)
+ {
+ NUIApplication.GetDefaultWindow().Remove(root);
+ root.Dispose();
+ }
+ }
+ }
+}