*
*/
-using Tizen.NUI.BaseComponents;
using System.Runtime.InteropServices;
-using System.Collections.Generic;
-using System.Diagnostics;
using System;
using System.ComponentModel;
/// </summary>
internal sealed class ProcessorController : Disposable
{
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- internal delegate void ProcessorCallback();
-
- private ProcessorCallback callback = null;
-
- public event EventHandler ProcessorOnceEvent;
-
- public event EventHandler ProcessorEvent;
-
- public event EventHandler LayoutProcessorEvent;
+ private static ProcessorController instance = null;
private ProcessorController() : this(Interop.ProcessorController.New(), true)
{
internal ProcessorController(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
- callback = new ProcessorCallback(Process);
- Interop.ProcessorController.SetCallback(SwigCPtr, callback);
+ processorCallback = new ProcessorEventHandler(Process);
+ Interop.ProcessorController.SetCallback(SwigCPtr, processorCallback);
}
- private static ProcessorController instance = null;
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ internal delegate void ProcessorEventHandler();
+
+ private ProcessorEventHandler processorCallback = null;
+
+ public event EventHandler ProcessorOnceEvent;
+ public event EventHandler ProcessorEvent;
+ public event EventHandler LayoutProcessorEvent;
public static ProcessorController Instance
{
get
{
- if(instance == null)
+ if (instance == null)
{
instance = new ProcessorController();
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void Dispose(DisposeTypes type)
{
- Interop.ProcessorController.RemoveCallback(SwigCPtr, callback);
+ Interop.ProcessorController.RemoveCallback(SwigCPtr, processorCallback);
ProcessorOnceEvent = null;
ProcessorEvent = null;
LayoutProcessorEvent = null;
public static extern global::System.IntPtr DeleteProcessorController(global::System.Runtime.InteropServices.HandleRef processorController);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ProcessorController_SetCallback")]
- public static extern void SetCallback(global::System.Runtime.InteropServices.HandleRef processorController, Tizen.NUI.ProcessorController.ProcessorCallback processorCallback);
+ public static extern void SetCallback(global::System.Runtime.InteropServices.HandleRef processorController, Tizen.NUI.ProcessorController.ProcessorEventHandler processorCallback);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ProcessorController_RemoveCallback")]
- public static extern void RemoveCallback(global::System.Runtime.InteropServices.HandleRef processorController, Tizen.NUI.ProcessorController.ProcessorCallback processorCallback);
+ public static extern void RemoveCallback(global::System.Runtime.InteropServices.HandleRef processorController, Tizen.NUI.ProcessorController.ProcessorEventHandler processorCallback);
}
}
}
*/
using Tizen.NUI.BaseComponents;
-using System.Runtime.InteropServices;
using System.Collections.Generic;
-using System.Diagnostics;
using System;
using System.ComponentModel;
private static int layoutControllerID = 1;
private int id;
-
- private ProcessorController.ProcessorCallback LayoutProcessorCallback = null;
-
private Window window;
-
- Animation coreAnimation;
-
+ private Animation coreAnimation;
private List<LayoutData> layoutTransitionDataQueue;
-
private List<LayoutItem> itemRemovalQueue;
+ private ProcessorController.ProcessorEventHandler LayoutProcessorCallback = null;
+
/// <summary>
/// Constructs a LayoutController which controls the measuring and layouting.<br />
/// <param name="window">Window attach this LayoutController to.</param>
}
/// <summary>
+ /// Set or Get Layouting core animation override property.
+ /// Gives explicit control over the Layouting animation playback if set to True.
+ /// Reset to False if explicit control no longer required.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool OverrideCoreAnimation { get; set; } = false;
+
+ /// <summary>
/// Get the unique id of the LayoutController
/// </summary>
public int GetId()
}
}
+
+ /// <summary>
+ /// Entry point into the C# Layouting that starts the Processing
+ /// </summary>
+ public void Process(object source, EventArgs e)
+ {
+ Vector2 windowSize = window.GetSize();
+ float width = windowSize.Width;
+ float height = windowSize.Height;
+
+ window.LayersChildren?.ForEach(layer =>
+ {
+ layer?.Children?.ForEach(view =>
+ {
+ if (view != null)
+ {
+ FindRootLayouts(view, width, height);
+ }
+ });
+ });
+ windowSize.Dispose();
+ windowSize = null;
+ }
/// <summary>
/// Get the Layouting animation object that transitions layouts and content.
/// Use OverrideCoreAnimation to explicitly control Playback.
}
/// <summary>
- /// Set or Get Layouting core animation override property.
- /// Gives explicit control over the Layouting animation playback if set to True.
- /// Reset to False if explicit control no longer required.
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool OverrideCoreAnimation { get; set; } = false;
-
- /// <summary>
/// Create and set process callback
/// </summary>
internal void CreateProcessCallback()
return;
}
- if(LayoutProcessorCallback != null)
+ if (LayoutProcessorCallback != null)
{
ProcessorController.Instance.LayoutProcessorEvent -= Process;
LayoutProcessorCallback = null;
// Can be called from multiple starting roots but in series.
// Get parent View's Size. If using Legacy size negotiation then should have been set already.
// Parent not a View so assume it's a Layer which is the size of the window.
- void MeasureAndLayout(View root, float parentWidth, float parentHeight)
+ private void MeasureAndLayout(View root, float parentWidth, float parentHeight)
{
if (root.Layout != null)
{
}
/// <summary>
- /// Entry point into the C# Layouting that starts the Processing
- /// </summary>
- public void Process(object source, EventArgs e)
- {
- Vector2 windowSize = window.GetSize();
- float width = windowSize.Width;
- float height = windowSize.Height;
-
- window.LayersChildren?.ForEach(layer =>
- {
- layer?.Children?.ForEach(view =>
- {
- if (view != null)
- {
- FindRootLayouts(view, width, height);
- }
- });
- });
- windowSize.Dispose();
- windowSize = null;
- }
-
- /// <summary>
/// Starts measuring the tree, starting from the root layout.
/// </summary>
private void MeasureHierarchy(View root, MeasureSpecification widthSpec, MeasureSpecification heightSpec)