// Callback for View TouchSignal private bool OnTouch(IntPtr view, IntPtr touchData) { if (touchData == global::System.IntPtr.Zero) { NUILog.Error("touchData should not be null!"); return(true); } TouchEventArgs e = new TouchEventArgs(); e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); bool consumed = false; if (_touchDataEventHandler != null) { consumed = _touchDataEventHandler(this, e); } if (enableControlState && !consumed) { consumed = HandleControlStateOnTouch(e.Touch); } return(consumed); }
/// <summary> /// Lowers the view to below the target view. /// </summary> /// <remarks>The sibling order of views within the parent will be updated automatically. /// Once a raise or lower API is used then that view will have an exclusive sibling order independent of insertion. /// </remarks> /// <param name="target">Will be lowered below this view.</param> /// <since_tizen> 9 </since_tizen> public void LowerBelow(View target) { var parentChildren = GetParent()?.Children; if (parentChildren != null) { int currentIndex = parentChildren.IndexOf(this); int targetIndex = parentChildren.IndexOf(target); if (currentIndex < 0 || targetIndex < 0 || currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count) { NUILog.Error("index should be bigger than 0 and less than children of layer count"); return; } // If the currentIndex is not already the 0th index and the target has the same parent. if ((currentIndex != 0) && (targetIndex != -1) && (currentIndex > targetIndex)) { parentChildren.Remove(this); parentChildren.Insert(targetIndex, this); Interop.NDalic.LowerBelow(SwigCPtr, View.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } } } }
// Callback for View TouchSignal private bool OnInterceptTouch(IntPtr view, IntPtr touchData) { if (touchData == global::System.IntPtr.Zero) { NUILog.Error("touchData should not be null!"); return(true); } // DisallowInterceptTouchEvent prevents the parent from intercepting touch. if (DisallowInterceptTouchEvent) { return(false); } TouchEventArgs e = new TouchEventArgs(); e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); bool consumed = false; if (_interceptTouchDataEventHandler != null) { consumed = _interceptTouchDataEventHandler(this, e); } return(consumed); }
private bool OnKeyEvent(IntPtr view, IntPtr keyEvent) { if (keyEvent == global::System.IntPtr.Zero) { NUILog.Error("keyEvent should not be null!"); return(true); } KeyEventArgs e = new KeyEventArgs(); bool result = false; e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent); if (_keyEventHandler != null) { Delegate[] delegateList = _keyEventHandler.GetInvocationList(); // Oring the result of each callback. foreach (EventHandlerWithReturnType <object, KeyEventArgs, bool> del in delegateList) { result |= del(this, e); } } return(result); }
/// <summary> /// Raises the view to above the target view. /// </summary> /// <remarks>The sibling order of views within the parent will be updated automatically. /// Views on the level above the target view will still be shown above this view. /// Raising this view above views with the same sibling order as each other will raise this view above them. /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. /// </remarks> /// <param name="target">Will be raised above this view.</param> internal void RaiseAbove(View target) { var parentChildren = GetParent()?.Children; if (parentChildren != null) { int currentIndex = parentChildren.IndexOf(this); int targetIndex = parentChildren.IndexOf(target); if (currentIndex < 0 || targetIndex < 0 || currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count) { NUILog.Error("index should be bigger than 0 and less than children of layer count"); return; } // If the currentIndex is less than the target index and the target has the same parent. if (currentIndex < targetIndex) { parentChildren.Remove(this); parentChildren.Insert(targetIndex, this); Interop.NDalic.RaiseAbove(swigCPtr, View.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } } } }
// Callback for View Wheel signal private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent) { if (wheelEvent == global::System.IntPtr.Zero) { NUILog.Error("wheelEvent should not be null!"); return(true); } WheelEventArgs e = new WheelEventArgs(); e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent); if (_wheelEventHandler != null) { return(_wheelEventHandler(this, e)); } return(false); }
// Callback for View Hover signal private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent) { if (hoverEvent == global::System.IntPtr.Zero) { NUILog.Error("hoverEvent should not be null!"); return(true); } HoverEventArgs e = new HoverEventArgs(); e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent); if (_hoverEventHandler != null) { return(_hoverEventHandler(this, e)); } return(false); }
// Callback for View TouchSignal private bool OnTouch(IntPtr view, IntPtr touchData) { if (touchData == global::System.IntPtr.Zero) { NUILog.Error("touchData should not be null!"); return(true); } TouchEventArgs e = new TouchEventArgs(); e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); if (_touchDataEventHandler != null) { return(_touchDataEventHandler(this, e)); } return(false); }
private static uint AccessibilityGetInterfaces(IntPtr self) { // Currently a maximum of one AccessibilityInterface per View is supported. // This will change when we implement AT-SPI interfaces as native C# interfaces. // Then, this method will look like: // // uint flags = 0U; // if (view is IAtspiSelection) flags |= (1U << (int)AccessibilityInterface.Selection) // if (view is IAtspiValue) flags |= (1U << (int)AccessibilityInterface.Value) // ... // return flags; View view = GetViewFromRefObject(self); if (!view.AtspiInterfaceFlags.HasValue) { NUILog.Error("AtspiInterfaceFlags are not set!"); return(0U); } return(view.AtspiInterfaceFlags.Value); }