13 private bool _isInputEnabled =
true;
14 private bool _isPointerInputEnabled =
true;
15 private bool _isKeyboardInputEnabled;
16 private bool _canReceiveFocus;
61 public event Action<WidgetPointerEventArgs>?
PointerUp;
71 public event Action<WidgetMouseWheelEventArgs>?
MouseWheel;
98 PointF anchor =
default,
99 string? nickname =
null)
116 get => _isInputEnabled;
119 if (_isInputEnabled == value)
122 _isInputEnabled = value;
125 WidgetInputRouterRegistry.NotifyInputDisabled(
this);
137 get => _isPointerInputEnabled;
140 if (_isPointerInputEnabled == value)
143 _isPointerInputEnabled = value;
146 WidgetInputRouterRegistry.NotifyPointerInputDisabled(
this);
158 get => _isKeyboardInputEnabled;
161 if (_isKeyboardInputEnabled == value)
164 _isKeyboardInputEnabled = value;
167 WidgetInputRouterRegistry.NotifyKeyboardFocusDisabled(
this);
179 get => _canReceiveFocus;
182 if (_canReceiveFocus == value)
185 _canReceiveFocus = value;
188 WidgetInputRouterRegistry.NotifyKeyboardFocusDisabled(
this);
210 Point screenPositionPx)
212 ArgumentNullException.ThrowIfNull(view);
222 && !ReferenceEquals(
View, view))
228 (layer.WrapHorizontally || layer.WrapVertically))
229 return GetWrappedHitOffset(view, screenPositionPx).HasValue;
233 return !screenBounds.IsEmpty
234 && screenBounds.Contains(screenPositionPx.X, screenPositionPx.Y);
237 internal PointF? GetWrappedHitOffset(
View view, Point screenPositionPx)
244 foreach (var offset
in layer.GetWrappedOffsets(
253 bounds.Offset(offset);
255 if (bounds.Contains(world))
269 public virtual bool HitTest(Point screenPositionPx)
273 for (
int index = views.Count - 1; index >= 0; index--)
275 View view = views[index];
282 return HitTest(view, screenPositionPx);
294 WidgetInputRouterRegistry.TryRegister(
this);
311 WidgetInputRouterRegistry.NotifyHidden(
this);
328 WidgetInputRouterRegistry.TryBringToFront(
this);
356 ArgumentNullException.ThrowIfNull(args);
367 protected internal void DispatchPointerLeave(WidgetPointerEventArgs args)
369 ArgumentNullException.ThrowIfNull(args);
380 protected internal void DispatchPointerDown(WidgetPointerEventArgs args)
382 ArgumentNullException.ThrowIfNull(args);
393 protected internal void DispatchPointerMove(WidgetPointerEventArgs args)
395 ArgumentNullException.ThrowIfNull(args);
406 protected internal void DispatchPointerUp(WidgetPointerEventArgs args)
408 ArgumentNullException.ThrowIfNull(args);
419 protected internal void DispatchPointerClick(WidgetPointerEventArgs args)
421 ArgumentNullException.ThrowIfNull(args);
434 protected internal void DispatchMouseWheel(WidgetMouseWheelEventArgs args)
436 ArgumentNullException.ThrowIfNull(args);
445 protected internal void DispatchFocusGained()
457 protected internal void DispatchFocusLost()
470 protected internal void DispatchKeyboardInput(WidgetKeyboardEventArgs args)
472 ArgumentNullException.ThrowIfNull(args);
bool Visible
Gets or sets the visibility of all descendants.
RenderSurfaceHostBase RenderSurfaceHost
Gets the render surface host shared by the composite and its children.
SceneLayer? SceneLayer
Gets the scene layer shared by all children in scene-layer mode.
RectangleF GetDrawLocationScreen(View view)
Gets the union of all visible descendants as projected through a view.
DirectComposite SetIsVisible(bool visible)
Applies one visibility value to every descendant.
Rectangle WorldBounds
Gets the union of all visible descendants' world-space bounds.
View? View
Gets the view shared by all children in view mode.
DirectComposite(RenderSurfaceHostBase renderSurfaceHost, DirectDrawingMode mode, PointF anchor=default, string? nickname=null)
Initializes a new instance of the DirectComposite class.
DirectDrawingMode Mode
Gets the coordinate mode shared by the composite and its children.
Represents a base class for hosting a render surface, providing functionality for managing rendering ...
Represents a rendered view of a scene, combining a camera position with a viewport configuration to c...
PointF ScreenPxToWorldPx(SceneLayer layer, PointF screenPx)
Converts a screen-space pixel position into world-space coordinates for the specified scene layer,...
Viewport Viewport
Gets the viewport that defines the screen-space rectangle, zoom level, and other rendering parameters...
Rectangle TargetRectPx
Screen-space rectangle (in SCREEN / RenderSurface pixels) where this view is drawn....
DirectDrawingMode
Specifies where direct drawing operations are applied within the rendering pipeline.
@ SceneLayer
Performs direct drawing within a scene layer using world-space coordinates.