private string windowTitle;
private List<Layer> childLayers = new List<Layer>();
private LayoutController localController;
+ private Key internalLastKeyEvent;
+ private Touch internalLastTouchEvent;
+ private Timer internalHoverTimer;
static internal bool IsSupportedMultiWindow()
{
{
overlayLayer = new Layer(Interop.Window.GetOverlayLayer(SwigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ LayersChildren?.Add(overlayLayer);
overlayLayer.SetWindow(this);
}
return overlayLayer;
/// <since_tizen> 3 </since_tizen>
public void KeepRendering(float durationSeconds)
{
- Interop.Stage.KeepRendering(stageCPtr, durationSeconds);
+ Interop.Window.KeepRendering(SwigCPtr, durationSeconds);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
/// <summary>
+ /// Feeds a hover event into the window. <br />
+ /// This is feed after a default time of 48 ms. You can also set this time.
+ /// </summary>
+ /// <param name="time">The time of how much later it will be feed (default is 48ms)</param>
+ /// <remarks>If you want to do FeedHover after the UI is updated, it is recommended to set the time to at least 16ms. This will be a good time waiting for the UI to update.<br />
+ /// and LazyFeedHover called within the set time are ignored. Only the last request becomes a FeedHover.
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void LazyFeedHover(uint time = 48)
+ {
+ if (internalHoverTimer == null)
+ {
+ internalHoverTimer = new Timer(time);
+ internalHoverTimer.Tick += (s, e) =>
+ {
+ FeedHover();
+ internalHoverTimer?.Stop();
+ internalHoverTimer?.Dispose();
+ internalHoverTimer = null;
+ return false;
+ };
+ internalHoverTimer.Start();
+ }
+ else
+ {
+ internalHoverTimer.Start();
+ }
+ }
+
+ /// <summary>
/// Feeds a touch point into the window.
/// </summary>
/// <param name="touchPoint">The touch point to feed.</param>
}
/// <summary>
+ /// Feeds a hover event into the window.
+ /// </summary>
+ /// <param name="touchPoint">The touch point to feed hover event. If null is entered, the feed hover event is generated with the last inputed touch point.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ internal void FeedHover(TouchPoint touchPoint = null)
+ {
+ if (touchPoint == null)
+ {
+ using Touch touch = GetLastTouchEvent();
+ using Vector2 screenPosition = touch.GetScreenPosition(0);
+ touchPoint = new TouchPoint(touch.GetDeviceId(0), TouchPoint.StateType.Motion, screenPosition.X, screenPosition.Y);
+ }
+ Interop.Window.FeedHoverEvent(SwigCPtr, TouchPoint.getCPtr(touchPoint));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
/// Allows at least one more render, even when paused.
/// The window should be shown, not minimised.
/// </summary>
if (isBorderWindow)
{
- Interop.Actor.Add(GetBorderWindowRootLayer().SwigCPtr, layer.SwigCPtr);
+ Interop.Actor.Add(GetRootLayer().SwigCPtr, layer.SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); }
}
else
[EditorBrowsable(EditorBrowsableState.Never)]
public Key GetLastKeyEvent()
{
- Key ret = new Key(Interop.Window.GetLastKeyEvent(SwigCPtr), false);
+ if(internalLastKeyEvent == null)
+ {
+ internalLastKeyEvent = new Key();
+ }
+ Interop.Window.InternalRetrievingLastKeyEvent(SwigCPtr, internalLastKeyEvent.SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ return internalLastKeyEvent;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Touch GetLastTouchEvent()
{
- Touch ret = new Touch(Interop.Window.GetLastTouchEvent(SwigCPtr), false);
+ if(internalLastTouchEvent == null)
+ {
+ internalLastTouchEvent = new Touch();
+ }
+ Interop.Window.InternalRetrievingLastTouchEvent(SwigCPtr, internalLastTouchEvent.SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ return internalLastTouchEvent;
}
/// <summary>
childLayers.Clear();
localController?.Dispose();
+
+ internalLastKeyEvent?.Dispose();
+ internalLastKeyEvent = null;
+ internalLastTouchEvent?.Dispose();
+ internalLastTouchEvent = null;
+
+ internalHoverTimer?.Stop();
+ internalHoverTimer?.Dispose();
+ internalHoverTimer = null;
}