CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::UIView Class Reference

The infrastructure for drawing and handling events in a UI. More...

#include <CeresEngine/UI/UIView.hpp>

Inheritance diagram for CeresEngine::UIView:
CeresEngine::UIResponder CeresEngine::RefCounted< UIView, RefCounter< false > > CeresEngine::UIClipView CeresEngine::UIContainerView CeresEngine::UIControl CeresEngine::UIGizmo CeresEngine::UILabel CeresEngine::UIMenuBar CeresEngine::UIScrollView CeresEngine::UISplitView CeresEngine::UIStackView CeresEngine::UIToolBar CeresEngine::UIViewport

Public Member Functions

 UIView ()
 Initializes new UIView object with an empty frame rectangle.
 
 UIView (const String &name)
 Initializes new UIView object with an empty frame rectangle and custom name.
 
 UIView (const UIRect &frame, const String &name="")
 Initializes new UIView object with a frame rectangle.
 
 UIView (const UISize &size, const String &name="")
 Initializes new UIView object with an frame rectangle size.
 
 UIView (const UIPoint &origin, const UISize &size, const String &name="")
 Initializes new UIView object with an frame rectangle size.
 
 UIView (const double x, const double y, const double width, const double height, const String &name="")
 Initializes new UIView object with an frame rectangle size.
 
 ~UIView () override
 Destroys a UIView.
 
UIViewgetSuperView () const
 The view that is the parent of the current view.
 
const Vector< UIView * > & getSubViews () const
 The list of views embedded in the current view.
 
void setSubViews (const Vector< UIView * > &subViews)
 The list of views embedded in the current view.
 
UInt32 getSubViewCount () const noexcept
 Gets the number of sub-views in the view.
 
UIViewgetSubView (UInt32 index) const
 Gets the sub-view at the given index.
 
UInt32 getSubViewIndex (const UIView *view) const
 Gtes the sub-view index for the given sub-view, if it is a sub-view.
 
void addSubView (UIView *view)
 Adds a view to the view's subviews so it's displayed above its siblings.
 
void addSubView (const UIViewPtr &view)
 Adds a view to the view's subviews so it's displayed above its siblings.
 
template<typename T , typename... Args>
TaddSubView (Args &&... args)
 Adds a view to the view's subviews so it's displayed above its siblings.
 
void replaceSubView (UIView *view, UIView *replacement)
 Replaces one of the view's subviews with another view.
 
void removeFromSuperview ()
 Unlinks the view from its superview and its window, removes it from the responder chain, and invalidates its cursor rectangles.
 
bool isDescendant (const UIView *view) const
 Returns true if the view is a subview of a given view or if it's identical to that view; otherwise, it returns false.
 
UIViewgetOpaqueAncestor () const
 The view's closest opaque ancestor, which might be the view itself.
 
virtual UIWindowgetWindow () const
 The view's window object, if it is installed in a window.
 
UIRect getFrame () const
 The view's frame rectangle, which defines its position and size in its superview's coordinate system.
 
virtual void setFrame (const UIRect &frame)
 The view's frame rectangle, which defines its position and size in its superview's coordinate system.
 
void setFrame (const UIPoint &point, const UISize &size)
 The view's frame rectangle, which defines its position and size in its superview's coordinate system.
 
void setFrame (const UIPoint &point, const double width, const double height)
 The view's frame rectangle, which defines its position and size in its superview's coordinate system.
 
void setFrame (const double x, const double y, const UISize &size)
 The view's frame rectangle, which defines its position and size in its superview's coordinate system.
 
void setFrame (const double x, const double y, const double width, const double height)
 The view's frame rectangle, which defines its position and size in its superview's coordinate system.
 
void setFrameOrigin (const UIPoint &point)
 Sets the origin of the view's frame rectangle to the specified point, effectively repositioning it within its superview.
 
void setFrameOrigin (const double x, const double y)
 Sets the origin of the view's frame rectangle to the specified point, effectively repositioning it within its superview.
 
void setFrameSize (const UISize &size)
 Sets the size of the view's frame rectangle to the specified dimensions, resizing it within its superview without affecting its coordinate system.
 
void setFrameSize (const double width, const double height)
 Sets the size of the view's frame rectangle to the specified dimensions, resizing it within its superview without affecting its coordinate system.
 
UIRect getBounds () const
 The view's bounds rectangle, which expresses its location and size in its own coordinate system.
 
virtual void setBounds (const UIRect &bounds)
 The view's bounds rectangle, which expresses its location and size in its own coordinate system.
 
void setBounds (const UIPoint &point, const UISize &size)
 The view's bounds rectangle, which expresses its location and size in its own coordinate system.
 
void setBounds (const UIPoint &point, const double width, const double height)
 The view's bounds rectangle, which expresses its location and size in its own coordinate system.
 
void setBounds (const double x, const double y, const UISize &size)
 The view's bounds rectangle, which expresses its location and size in its own coordinate system.
 
void setBounds (const double x, const double y, const double width, const double height)
 The view's bounds rectangle, which expresses its location and size in its own coordinate system.
 
void setBoundsOrigin (const UIPoint &point)
 Sets the origin of the view's bounds rectangle to a specified point.
 
void setBoundsOrigin (const double x, const double y)
 Sets the origin of the view's bounds rectangle to a specified point.
 
void setBoundsSize (const UISize &size)
 Sets the size of the view's bounds rectangle to specified dimensions, inversely scaling its coordinate system relative to its frame rectangle.
 
void setBoundsSize (const double width, const double height)
 Sets the size of the view's bounds rectangle to specified dimensions, inversely scaling its coordinate system relative to its frame rectangle.
 
virtual bool acceptsFirstMouse (const UIEvent &theEvent)
 Overridden by subclasses to return true if the view should call mouseDown() for an initial mouse-down event, false if not.
 
UIViewhitTest (UIPoint aPoint, const Optional< const UIEvent & > &event=nullopt)
 Returns the farthest descendant of the view in the view hierarchy (including itself) that contains a specified point, or nil if that point lies completely outside the view.
 
virtual bool isPointInside (const UIPoint &point, const Optional< const UIEvent & > &event=nullopt)
 Returns a Boolean value indicating whether the receiver contains the specified point.
 
bool isMousePoint (const UIPoint &aPoint, const UIRect &aRect)
 Returns whether a region of the view contains a specified point, accounting for whether the view is flipped or not.
 
virtual bool getMouseDownCanMoveWindow () const
 This property lets you determine the region by which a window can be moved.
 
const UIAppearancegetAppearance () const noexcept
 The UI appearance to be used by the view.
 
void setAppearance (UIAppearance *appearance)
 The UI appearance to be used by the view.
 
UIColor getTintColor () const
 The first non-default tint color value in the view's hierarchy, ascending from and starting with the view itself.
 
void setTintColor (const UIColor &color)
 The first non-default tint color value in the view's hierarchy, ascending from and starting with the view itself.
 
void clearTintColor ()
 Clears the tint color for the current view.
 
const UIColorgetBackgroundColor () const noexcept
 The view's background color.
 
void setBackgroundColor (const UIColor &color)
 The view's background color.
 
const UICornerRadiusgetCornerRadius () const noexcept
 The view's background corner radius.
 
void setCornerRadius (const UICornerRadius &color)
 The view's background corner radius.
 
double getAlpha () const noexcept
 This property contains the opacity value from the view's layer.
 
void setAlpha (double alpha)
 This property contains the opacity value from the view's layer.
 
bool isOpaque () const noexcept
 A Boolean value indicating whether the view fills its frame rectangle with opaque content.
 
void setOpaque (bool isOpaque)
 A Boolean value indicating whether the view fills its frame rectangle with opaque content.
 
UIRect getVisibleRect () const
 Visibility, as reflected by this property, does not account for whether other view or window objects overlap the current view or whether the current view is installed in a window at all.
 
bool isVisible () const
 A Boolean value indicating whether the view is visible.
 
void setVisible (bool visible)
 A Boolean value indicating whether the view is visible.
 
bool isHidden () const
 A Boolean value indicating whether the view is hidden.
 
void setHidden (const bool hidden)
 A Boolean value indicating whether the view is hidden.
 
bool isHiddenOrHasHiddenAncestor () const
 A Boolean value indicating whether the view is hidden from sight because it, or one of its ancestors, is marked as hidden.
 
bool isActive () const
 A Boolean value indicating whether the view is active.
 
void setActive (bool active)
 A Boolean value indicating whether the view is active.
 
bool getAutoresizesSubViews () const
 A Boolean value indicating whether the view applies the autoresizing behavior to its subviews when its frame size changes.
 
void setAutoresizesSubViews (bool state)
 Generates a hash for the provided type.
 
const UIViewAutoresizingMaskgetAutoresizingMask () const
 The options that determine how the view is resized relative to its superview.
 
void setAutoresizingMask (const UIViewAutoresizingMask &autoresizingMask)
 The options that determine how the view is resized relative to its superview.
 
virtual void resizeSubviews (const UISize &oldBoundsSize)
 Informs the view's subviews that the view's bounds rectangle size has changed.
 
virtual void resize (const UISize &oldBoundsSize)
 Informs the view that the bounds size of its superview has changed.
 
virtual UISize getIntrinsicContentSize () const
 The natural size for the receiving view, considering only properties of the view itself.
 
bool getNeedsLayout () const
 A Boolean value indicating whether the view needs a layout pass before it can be drawn.
 
void setNeedsLayout ()
 A Boolean value indicating whether the view needs a layout pass before it can be drawn.
 
void setNeedsLayout (bool state)
 A Boolean value indicating whether the view needs a layout pass before it can be drawn.
 
void layout ()
 Perform layout in concert with the layout system.
 
void layoutIfNeeded ()
 Updates the layout of the receiving view and its subviews based on the current views and constraints.
 
virtual void layoutSubviews ()
 Lays out subviews.
 
virtual UISize calculateFittingLayoutSize (const UISize &targetSize) const
 Returns the optimal size of the view based on its current constraints.
 
UISize calculateMinimumLayoutSize () const
 Returns the minimum size of the view based on its current constraints.
 
UISize calculateMaximumLayoutSize () const
 Returns the maximum size of the view based on its current constraints.
 
bool getNeedsUpdateConstraints () const
 A Boolean value that determines whether the view’s constraints need updating.
 
void setNeedsUpdateConstraints ()
 A Boolean value that determines whether the view’s constraints need updating.
 
void setNeedsUpdateConstraints (bool state)
 A Boolean value that determines whether the view’s constraints need updating.
 
virtual void updateConstraints ()
 Updates constraints for the view.
 
void updateConstraintsIfNeeded ()
 Updates the constraints for the receiving view and its subviews.
 
Span< const UILayoutConstraintgetConstraints () const
 Returns the constraints held by the view.
 
void setConstraints (Vector< UILayoutConstraint > &&constraints)
 Returns the constraints held by the view.
 
void setConstraints (const Span< const UILayoutConstraint > &constraints)
 Returns the constraints held by the view.
 
void addConstraint (const UILayoutConstraint &constraint)
 Adds a constraint on the layout of the receiving view or its subviews.
 
void addConstraints (const Span< const UILayoutConstraint > &constraints)
 Adds multiple constraints on the layout of the receiving view or its subviews.
 
void addConstraints (const InitializerList< UILayoutConstraint > constraints)
 Adds multiple constraints on the layout of the receiving view or its subviews.
 
void removeConstraint (const UILayoutConstraint &constraint)
 Removes the specified constraint from the view.
 
void removeConstraints (const Span< const UILayoutConstraint > &constraints)
 Removes the specified constraints from the view.
 
void removeConstraints (const InitializerList< UILayoutConstraint > constraints)
 Removes the specified constraints from the view.
 
const UIEdgeInsetsgetLayoutMargins () const
 The default spacing to use when laying out content in the view.
 
void setLayoutMargins (const UIEdgeInsets &layoutMargins)
 The default spacing to use when laying out content in the view.
 
double getLayoutTopMargin () const
 The default spacing to use when laying out content in the view.
 
void setTopLayoutMargin (double topLayoutMargin)
 Generates a hash for the provided type.
 
double getBottomLayoutMargin () const
 The default spacing to use when laying out content in the view.
 
void setBottomLayoutMargin (double bottomLayoutMargin)
 The default spacing to use when laying out content in the view.
 
double getLeftLayoutMargin () const
 The default spacing to use when laying out content in the view.
 
void setLeftLayoutMargin (double leftLayoutMargin)
 The default spacing to use when laying out content in the view.
 
double getRightLayoutMargin () const
 The default spacing to use when laying out content in the view.
 
void setRightLayoutMargin (double rightLayoutMargin)
 The default spacing to use when laying out content in the view.
 
void setNeedsDisplay ()
 The displayIfNeeded methods check the value of this property to avoid unnecessary drawing, and all display methods set the value back to false when the view is up to date.
 
void setNeedsDisplay (const UIRect &invalidRect)
 Marks the region of the view within the specified rectangle as needing display, increasing the view's existing invalid region to include it.
 
bool getNeedsDisplay () const
 The displayIfNeeded methods check the value of this property to avoid unnecessary drawing, and all display methods set the value back to false when the view is up to date.
 
void display (UIGraphicsContext &context)
 Displays the view and all its subviews if possible.
 
void display (UIGraphicsContext &context, const UIRect &aRect)
 Acts as display(), but confining drawing to a rectangular region of the view.
 
void displayIgnoringOpacity (UIGraphicsContext &context)
 Displays the view but does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.
 
virtual void displayIgnoringOpacity (UIGraphicsContext &context, const UIRect &aRect)
 Displays the view but confines drawing to a specified region and does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.
 
void displayIfNeeded (UIGraphicsContext &context)
 Displays the view and all its subviews if any part of the view has been marked as needing display.
 
void displayIfNeeded (UIGraphicsContext &context, const UIRect &aRect)
 Acts as displayIfNeeded(), but confining drawing to a rectangular region of the view.
 
void displayIfNeededIgnoringOpacity (UIGraphicsContext &context)
 Acts as displayIfNeeded(), except that this method doesn’t back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.
 
void displayIfNeededIgnoringOpacity (UIGraphicsContext &context, const UIRect &aRect)
 Displays the view but confines drawing to a specified region and does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.
 
bool canDraw () const
 A Boolean value indicating whether drawing commands will produce any results.
 
virtual void draw (UIGraphicsContext &context, const UIRect &dirtyRect)
 Overridden by subclasses to draw the view's texture within the specified rectangle.
 
const Vector< UIRect > & getRectsBeingDrawn () const
 Returns by a list of non-overlapping rectangles that define the area the view is being asked to draw in draw().
 
bool needsToDraw (const UIRect &aRect) const noexcept
 Returns a Boolean value indicating whether the specified rectangle intersects any part of the area that the view is being asked to draw.
 
virtual bool getClearsContextBeforeDrawing () const noexcept
 A Boolean value that determines whether the view's bounds should be automatically cleared before drawing.
 
virtual bool getClipsToBounds () const
 A Boolean value that determines whether subviews are confined to the bounds of the view.
 
double getContentScaleFactor () const
 The scale factor applied to the view.
 
void setContentScaleFactor (const Optional< double > &contentScaleFactor)
 The scale factor applied to the view.
 
bool isFirstResponder () const noexcept
 Determines if this view is the current first responder.
 
virtual UIScrollViewgetScrollView () const
 Gets the closest parent scroll view to this view.
 
virtual bool canBecomeKeyView () const
 When the value of this property is true, the view can become the key view.
 
virtual bool needsPanelToBecomeKey () const
 The default value of this property is false.
 
UIViewgetNextKeyView () const
 The view object that follows the current view in the key view loop.
 
void setNextKeyView (UIView *nextKeyView)
 The view object that follows the current view in the key view loop.
 
UIViewgetNextValidKeyView () const
 The value in this property is nullptr if there is no view that follows the current view and accepts the first responder status.
 
UIViewgetPreviousKeyView () const
 The value in this property is nullptr if there is no view preceding the current view in the key view loop.
 
UIViewgetPreviousValidKeyView () const
 The value in this property is nullptr if there is no view that precedes the current view and accepts the first responder status.
 
AffineTransform getTransformFrom (const UIView *aView=nullptr) const
 
const AffineTransform & getTransformFromWindow () const
 
AffineTransform getTransformFromSuperView () const
 
const AffineTransform & getTransformFromBacking () const
 
AffineTransform getTransformTo (const UIView *aView=nullptr) const
 
const AffineTransform & getTransformToWindow () const
 
AffineTransform getTransformToSuperView () const
 
const AffineTransform & getTransformToBacking () const
 
UIPoint convertFrom (const UIPoint &aPoint, const UIView *aView=nullptr) const
 Converts a point from the coordinate system of a given view to that of the view.
 
UIPoint convertFromWindow (const UIPoint &aPoint) const
 Converts a point from the coordinate system of a given view to that of the view.
 
UIPoint convertFromSuperView (const UIPoint &aPoint) const
 Converts a point from the coordinate system of a given view to that of the view.
 
UIPoint convertFromBacking (const UIPoint &aPoint) const
 Converts a point from its pixel aligned backing store coordinate system to the view’s interior coordinate system.
 
UIPoint convertTo (const UIPoint &aPoint, const UIView *aView=nullptr) const
 Converts a point from the view's coordinate system to that of a given view.
 
UIPoint convertToWindow (const UIPoint &aPoint) const
 Converts a point from the view's coordinate system to that of a given view.
 
UIPoint convertToSuperView (const UIPoint &aPoint) const
 Converts a point from the view's coordinate system to that of a given view.
 
UIPoint convertToBacking (const UIPoint &aPoint) const
 Converts a point from the view’s interior coordinate system to its pixel aligned backing store coordinate system.
 
UISize convertFrom (const UISize &aSize, const UIView *aView=nullptr) const
 Converts a size from another view's coordinate system to that of the view.
 
UISize convertFromWindow (const UISize &aSize) const
 Converts a point from the coordinate system of a given view to that of the view.
 
UISize convertFromSuperView (const UISize &aSize) const
 Converts a point from the coordinate system of a given view to that of the view.
 
UISize convertFromBacking (const UISize &aSize) const
 Converts a size from its pixel aligned backing store coordinate system to the view’s interior coordinate system.
 
UISize convertTo (const UISize &aSize, const UIView *aView=nullptr) const
 Converts a size from the view's coordinate system to that of another view.
 
UISize convertToWindow (const UISize &aSize) const
 Converts a point from the view's coordinate system to that of a given view.
 
UISize convertToSuperView (const UISize &aSize) const
 Converts a point from the view's coordinate system to that of a given view.
 
UISize convertToBacking (const UISize &aSize) const
 Converts a size from the view’s interior coordinate system to its pixel aligned backing store coordinate system.
 
UIRect convertFrom (const UIRect &aRect, const UIView *aView=nullptr) const
 Converts a rectangle from the coordinate system of another view to that of the view.
 
UIRect convertFromWindow (const UIRect &aRect) const
 Converts a point from the coordinate system of a given view to that of the view.
 
UIRect convertFromSuperView (const UIRect &aRect) const
 Converts a point from the coordinate system of a given view to that of the view.
 
UIRect convertFromBacking (const UIRect &aRect) const
 Converts a rectangle from its pixel aligned backing store coordinate system to the view’s interior coordinate system.
 
UIRect convertTo (const UIRect &aRect, const UIView *aView=nullptr) const
 Converts a rectangle from the view's coordinate system to that of another view.
 
UIRect convertToWindow (const UIRect &aRect) const
 Converts a point from the view's coordinate system to that of a given view.
 
UIRect convertToSuperView (const UIRect &aRect) const
 Converts a point from the view's coordinate system to that of a given view.
 
UIRect convertToBacking (const UIRect &aRect) const
 Converts a rectangle from the view’s interior coordinate system to its pixel aligned backing store coordinate system.
 
UIViewControllergetViewController () const noexcept
 The UIView controller, if any.
 
const StringgetName () const
 A human readable string that represents the view.
 
void setName (const String &name)
 Generates a hash for the provided type.
 
virtual StringView getTypeName () const
 A string that represents the view type.
 
UIRespondergetNextResponder () const final
 The next responder after this one, or nil if it has none.
 
- Public Member Functions inherited from CeresEngine::UIResponder
virtual ~UIResponder ()=default
 
virtual bool acceptsFirstResponder () const
 A Boolean value that indicates whether the responder accepts first responder status.
 
virtual bool becomeFirstResponder ()
 Notifies the receiver that it's about to become first responder in its window.
 
virtual bool resignFirstResponder ()
 Notifies the receiver that it's been asked to relinquish its status as first responder in its window.
 
virtual void mouseDown (const UIMouseEvent &event)
 Informs the receiver that the user has pressed the left mouse button.
 
virtual void mouseDragged (const UIMouseEvent &event)
 Informs the receiver that the user has moved the mouse with the left button pressed.
 
virtual void mouseUp (const UIMouseEvent &event)
 Informs the receiver that the user has released the left mouse button.
 
virtual void mouseMoved (const UIMouseEvent &event)
 Informs the receiver that the mouse has moved.
 
virtual void mouseEntered (const UIMouseEvent &event)
 Informs the receiver that the cursor has entered a tracking rectangle.
 
virtual void mouseExited (const UIMouseEvent &event)
 Informs the receiver that the cursor has exited a tracking rectangle.
 
virtual void rightMouseDown (const UIMouseEvent &event)
 Informs the receiver that the user has pressed the right mouse button.
 
virtual void rightMouseDragged (const UIMouseEvent &event)
 Informs the receiver that the user has moved the mouse with the right button pressed.
 
virtual void rightMouseUp (const UIMouseEvent &event)
 Informs the receiver that the user has released the right mouse button.
 
virtual void otherMouseDown (const UIMouseEvent &event)
 Informs the receiver that the user has pressed a mouse button other than the left or right one.
 
virtual void otherMouseDragged (const UIMouseEvent &event)
 Informs the receiver that the user has moved the mouse with a button other than the left or right button pressed.
 
virtual void otherMouseUp (const UIMouseEvent &event)
 Informs the receiver that the user has released a mouse button other than the left or right button.
 
virtual void scrollWheel (const UIMouseEvent &event)
 Informs the receiver that the mouse's scroll wheel has moved.
 
virtual void keyDown (const UIKeyEvent &event)
 Informs the receiver that the user has pressed a key.
 
virtual void keyUp (const UIKeyEvent &event)
 Informs the receiver that the user has released a key.
 
virtual void interpretKeyEvents (const Vector< UIKeyEvent > &events)
 Handles a series of key events.
 
virtual bool performKeyEquivalent (const UIKeyEvent &event)
 Handle a key equivalent.
 
virtual void flushBufferedKeyEvents ()
 Clears any unprocessed key events when overridden by subclasses.
 
virtual void cursorUpdate (const UIEvent &event)
 Informs the receiver that the mouse cursor has moved into a cursor rectangle.
 
virtual void flagsChanged (const UIEvent &event)
 Informs the receiver that the user has pressed or released a modifier key (Shift, Control, and so on).
 
- Public Member Functions inherited from CeresEngine::RefCounted< UIView, RefCounter< false > >
 RefCounted (Args &&... args)
 Creates a new RefCounted object and constructs a new Deleter by forwarding Args to it.
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Relases the object by decrementing it's reference count by one.
 

Public Attributes

const UILayoutAnchor left
 The left side of the object's alignment rectangle.
 
const UILayoutAnchor right
 The right side of the object's alignment rectangle.
 
const UILayoutAnchor top
 The top of the object's alignment rectangle.
 
const UILayoutAnchor bottom
 The bottom of the object's alignment rectangle.
 
const UILayoutAnchor width
 The width of the object's alignment rectangle.
 
const UILayoutAnchor height
 The height of the object's alignment rectangle.
 
const UILayoutAnchor centerX
 The center along the x-axis of the object's alignment rectangle.
 
const UILayoutAnchor centerY
 The center along the y-axis of the object's alignment rectangle.
 
const UILayoutAnchor lastBaseline
 The object's baseline.
 
const UILayoutAnchor firstBaseline
 The object's baseline.
 
const UILayoutAnchor leftMargin
 The object's left margin.
 
const UILayoutAnchor rightMargin
 The object's right margin.
 
const UILayoutAnchor topMargin
 The object's top margin.
 
const UILayoutAnchor bottomMargin
 The object's bottom margin.
 
const UILayoutAnchor centerXWithinMargins
 The center along the x-axis between the object's left and right margin.
 
const UILayoutAnchor centerYWithinMargins
 The center along the y-axis between the object's top and bottom margin.
 

Static Public Attributes

static const double kNoInstrinsicMetric
 Used to indicate that a view has no intrinsic metric for a given numeric property.
 
static const UISize kNoIntrinsicSize
 Used to indicate that a view has no intrinsic metric for a given size property.
 
static const UInt32 kInvalidViewIndex
 Used to indicate that an invalid view index.
 
static const UIRect kDefaultFrame
 A rectangle that represents the default frame set by a view without an explicit frame.
 
static const UIColorAppearanceProperty tintColorProperty
 Determines the default value for the tintColor property if not overridden by the view.
 
static const UIPaintAppearanceProperty labelPaintProperty
 The primary color to use for text labels.
 
static const UIPaintAppearanceProperty secondaryLabelPaintProperty
 The secondary color to use for text labels.
 
static const UIPaintAppearanceProperty tertiaryLabelPaintProperty
 The tertiary color to use for text labels.
 
static const UIPaintAppearanceProperty quaternaryLabelPaintProperty
 The quaternary color to use for text labels and separators.
 
static const UIPaintAppearanceProperty textPaintProperty
 The color to use for text.
 
static const UIPaintAppearanceProperty placeholderTextPaintProperty
 The color to use for placeholder text in controls or text views.
 
static const UIPaintAppearanceProperty selectedTextPaintProperty
 The color to use for selected text.
 
static const UIPaintAppearanceProperty textBackgroundPaintProperty
 The color to use for the background area behind text.
 
static const UIPaintAppearanceProperty selectedTextBackgroundPaintProperty
 The color to use for the background of selected text.
 
static const UIPaintAppearanceProperty keyboardFocusIndicatorPaintProperty
 The color to use for the keyboard focus ring around controls.
 
static const UIPaintAppearanceProperty unemphasizedSelectedTextPaintProperty
 The color to use for selected text in an unemphasized context.
 
static const UIPaintAppearanceProperty unemphasizedSelectedTextBackgroundPaintProperty
 The color to use for the text background in an unemphasized context.
 
static const UIPaintAppearanceProperty linkPaintProperty
 The color to use for links.
 
static const UIPaintAppearanceProperty separatorPaintProperty
 The color to use for separators between different sections of content.
 
static const UIPaintAppearanceProperty selectedContentBackgroundPaintProperty
 The color to use for the background of selected and emphasized content.
 
static const UIPaintAppearanceProperty unemphasizedSelectedContentBackgroundPaintProperty
 The color to use for selected and unemphasized content.
 
static const UIPaintAppearanceProperty selectedMenuItemTextPaintProperty
 The color to use for the text in menu items.
 
static const UIPaintAppearanceProperty gridPaintProperty
 The color to use for the optional gridlines, such as those in a table view.
 
static const UIPaintAppearanceProperty headerTextPaintProperty
 The color to use for text in header cells in table views and outline views.
 
static const UIPaintAppearanceProperty alternatingContentBackgroundColorsProperty
 The colors to use for alternating content, typically found in table views and collection views.
 
static const UIPaintAppearanceProperty controlAccentPaintProperty
 The user's current accent color preference.
 
static const UIPaintAppearanceProperty controlPaintProperty
 The color to use for the flat surfaces of a control.
 
static const UIPaintAppearanceProperty controlBackgroundPaintProperty
 The color to use for the background of large controls, such as scroll views or table views.
 
static const UIPaintAppearanceProperty controlTextPaintProperty
 The color to use for text on enabled controls.
 
static const UIPaintAppearanceProperty disabledControlTextPaintProperty
 The color to use for text on disabled controls.
 
static const UIPaintAppearanceProperty currentControlTintProperty
 The current system control tint color.
 
static const UIPaintAppearanceProperty selectedControlPaintProperty
 The color to use for the face of a selected control—that is, a control that has been clicked or is being dragged.
 
static const UIPaintAppearanceProperty selectedControlTextPaintProperty
 The color to use for text in a selected control—that is, a control being clicked or dragged.
 
static const UIPaintAppearanceProperty alternateSelectedControlTextPaintProperty
 The color to use for text in a selected control.
 
static const UIPaintAppearanceProperty scrubberTexturedBackgroundPaintProperty
 The patterned color to use for the background of a scrubber control.
 
static const UIPaintAppearanceProperty windowBackgroundPaintProperty
 The color to use for the window background.
 
static const UIPaintAppearanceProperty windowFrameTextPaintProperty
 The color to use for text in a window's frame.
 
static const UIPaintAppearanceProperty underPageBackgroundPaintProperty
 The color to use in the area beneath your window's views.
 
static const UIPaintAppearanceProperty findHighlightPaintProperty
 The highlight color to use for the bubble that shows inline search result values.
 
static const UIPaintAppearanceProperty highlightPaintProperty
 The color to use as a virtual light source on the screen.
 
static const UIPaintAppearanceProperty shadowPaintProperty
 The color to use for virtual shadows cast by raised objects on the screen.
 
static const UIFontAppearanceProperty fontProperty
 The default font used by all UI elements.
 
static const UIFloatAppearanceProperty fontSizeProperty
 The default font size used by all UI elements.
 

Protected Member Functions

virtual void didAddSubview (UIView &view)
 Overridden by subclasses to perform additional actions when subviews are added to the view.
 
virtual void willRemoveSubview (UIView &view)
 Overridden by subclasses to perform additional actions before subviews are removed from the view.
 
virtual void didRemoveSubview (UIView &view)
 Overridden by subclasses to perform additional actions when subviews are removed to the view.
 
virtual void willMoveToSuperView (UIView *superView)
 Informs the view that its superview is about to change to the specified superview (which may be nil).
 
virtual void didMoveToSuperView (UIView *superView)
 Informs the view that its superview has changed (possibly to nil).
 
virtual void willMoveToWindow (UIWindow *window)
 Informs the view that it's being added to the view hierarchy of the specified window object (which may be nil).
 
virtual void didMoveToWindow (UIWindow *window)
 Informs the view that it has been added to a new view hierarchy.
 
virtual void didHide ()
 Invoked when the view is hidden, either directly, or in response to an ancestor being hidden.
 
virtual void didUnhide ()
 Invoked when the view is unhidden, either directly, or in response to an ancestor being unhidden.
 
virtual void willDraw ()
 Informs the view that it will be required to draw content.
 
virtual void tintColorDidChange ()
 Called by the system when the tintColor property changes.
 
virtual void didChangeFrame (const UIRect &oldFrame)
 Called whenever the view frame changes, either internally or programmatically by calls to setFrame.
 
virtual void didChangeBounds (const UIRect &oldBounds)
 Called whenever the view bounds changes, either internally or programmatically by calls to setBounds.
 
void invalidateIntrinsicContentSize ()
 Invalidates the view's intrinsic content size.
 
void updateIntrinsicContentSize ()
 

Private Member Functions

UILayoutSolverensureLayoutSolver ()
 Ensures that a layout solver is present on the view.
 
void registerLayoutAnchor (const UILayoutAnchor &layoutAnchor)
 Registers a new layout anchor with the view.
 
void invalidateTransforms ()
 Internal method called by the system whenever it needs to invalidate transforms.
 
void updateTransformsIfNeeded ()
 
void invalidateBackingStore ()
 Called whenever the UIView backing store must be invalidated.
 
void setWindow (UIWindow *window)
 
void setSuperView (UIView *superView)
 
void insertSubView (UIView *view, UInt32 index)
 
void setViewController (UIViewController *viewController)
 The UIView controller, if any.
 

Private Attributes

friend UIWindow
 
friend UIViewController
 
UIViewmSuperView = nullptr
 The parent view.
 
Vector< UIView * > mSubViews
 A list of children views.
 
UIWindowmWindow = nullptr
 The window this UIView is attached to.
 
UIRect mFrame
 The view's frame rectangle, which defines its position and size in its superview's coordinate system.
 
UIRect mBounds
 The view's bounds rectangle, which expresses its location and size in its own coordinate system.
 
Optional< doublemContentScaleFactor = nullopt
 The scale factor applied to the view.
 
bool mCustomBounds = false
 Determines if the view uses a custom bounds rectangle.
 
UIViewStateFlags mFlags
 The view flags.
 
UIAppearancePtr mAppearance = nullptr
 The UI appearance to be used by the view.
 
Optional< UIColormTintColor = std::nullopt
 The base color to be used for UI tinting.
 
UIColor mBackgroundColor = UIColor::white
 The view's background color.
 
UICornerRadius mCornerRadius
 The view's background corner radius.
 
bool mOpaque = false
 A Boolean value indicating whether the view fills its frame rectangle with opaque content.
 
UIViewAutoresizingMask mResizingMask = UIViewAutoResizing::Height | UIViewAutoResizing::Width
 The options that determine how the view is resized relative to its superview.
 
String mName
 A human readable string that represents the view.
 
UIViewmNextKeyView = nullptr
 The view object that follows the current view in the key view loop.
 
UIViewmPreviousKeyView = nullptr
 The view object preceding the current view in the key view loop.
 
AffineTransform mTransformToWindow
 A 2D transformation matrix that transforms a point from the view coordinate space into the window coordinate space.
 
AffineTransform mTransformFromWindow
 A 2D transformation matrix that transforms a point from the window coordinate space into the view coordinate space.
 
AffineTransform mTransformToBacking
 A 2D transformation matrix that transforms a point from the view’s interior coordinate system to its pixel aligned backing store coordinate system.
 
AffineTransform mTransformFromBacking
 A 2D transformation matrix that transforms a point from its pixel aligned backing store coordinate system to the view’s interior coordinate system.
 
Vector< UIRectmTrackingRects
 A list of tracking rectangles.
 
UISize mIntrinsicContentSize
 The natural size for the receiving view, considering only properties of the view itself.
 
UIEdgeInsets mLayoutMargins
 The default spacing to use when laying out content in the view.
 
Vector< UIRectmInvalidRects
 
Vector< UIRectmRectsBeingDrawn
 A cache for getRectsBeingDrawn() the values returned.
 
UIViewControllermViewController = nullptr
 The UIView controller, if any.
 
UILayerPtr mLayer
 The UI layer that the view uses as its backing store.
 
UPtr< UILayoutSolvermLayoutSolver
 The layout solver for this view.
 
Vector< UILayoutAnchormLayoutAnchors
 A vector that contains all anchors for the view.
 

Friends

class UILayoutAnchorVariable
 

Additional Inherited Members

- Static Public Member Functions inherited from CeresEngine::UIResponder
static void dispatch (UIResponder *const firstResponder, const UIEvent &event)
 Dispatches a UIEvent to the given first responder.
 

Detailed Description

The infrastructure for drawing and handling events in a UI.

You typically don't use UIView objects directly. Instead, you use objects whose classes descend from UIView or you subclass UIView yourself and override its methods to implement the behavior you need. An instance of the UIView class (or one of its subclasses) is commonly known as a view object, or simply as a view.

Views handle the presentation and interaction with your app's visible content. You arrange one or more views inside an UIWindow object, which acts as a wrapper for your content. A view object defines a rectangular region for drawing and receiving mouse events. Views handle other chores as well, including the dragging of icons and working with the UIScrollView class to support efficient scrolling.

Most of the functionality of the UIView class is automatically invoked by the UI framework. Unless you're implementing a concrete subclass of UIView or working intimately with the content of the view hierarchy at runtime, you don't need to know much about this class's interface. For any view, there are many methods that you can use as-is. The following methods are commonly used:

  • getFrame: returns the location and size of the UIView object.
  • getBounds: returns the internal origin and size of the UIView object.
  • needsDisplay: determines whether the UIView object needs to be redrawn.
  • getWindow: returns the UIWindow object that contains the UIView object.

If you subclass UIView directly and handle specific types of events, the implementation of your event-related methods should generally not call the base. Views inherit their event-handling capabilities from their UIResponder parent class. The default behavior for responders is to pass events up the responder chain, which is not the behavior you typically want if you handle events in a custom view. Therefore, you should not call super if your view implements any of the following methods and handles the event:

If your view descends from a class other than UIView, call super to let the parent view handle any events that you do not.

Constructor & Destructor Documentation

◆ UIView() [1/6]

CeresEngine::UIView::UIView ( )

Initializes new UIView object with an empty frame rectangle.

◆ UIView() [2/6]

CeresEngine::UIView::UIView ( const String name)
explicit

Initializes new UIView object with an empty frame rectangle and custom name.

◆ UIView() [3/6]

CeresEngine::UIView::UIView ( const UIRect frame,
const String name = "" 
)
explicit

Initializes new UIView object with a frame rectangle.

Parameters
frameThe frame rectangle for the created view object.

◆ UIView() [4/6]

CeresEngine::UIView::UIView ( const UISize size,
const String name = "" 
)
inlineexplicit

Initializes new UIView object with an frame rectangle size.

The view is placed at the origin.

Parameters
sizeThe frame rectangle size for the created view object.

◆ UIView() [5/6]

CeresEngine::UIView::UIView ( const UIPoint origin,
const UISize size,
const String name = "" 
)
inlineexplicit

Initializes new UIView object with an frame rectangle size.

The view is placed at the origin.

Parameters
originThe frame rectangle origin for the created view object.
sizeThe frame rectangle size for the created view object.

◆ UIView() [6/6]

CeresEngine::UIView::UIView ( const double  x,
const double  y,
const double  width,
const double  height,
const String name = "" 
)
inlineexplicit

Initializes new UIView object with an frame rectangle size.

The view is placed at the origin.

Parameters
xThe frame rectangle origin x coordinate for the created view object.
yThe frame rectangle origin y coordinate for the created view object.
widthThe frame rectangle width for the created view object.
heightThe frame rectangle height for the created view object.

◆ ~UIView()

CeresEngine::UIView::~UIView ( )
override

Destroys a UIView.

Member Function Documentation

◆ acceptsFirstMouse()

virtual bool CeresEngine::UIView::acceptsFirstMouse ( const UIEvent theEvent)
inlinevirtual

Overridden by subclasses to return true if the view should call mouseDown() for an initial mouse-down event, false if not.

The view can either return a value unconditionally or use the location of theEvent to determine whether or not it wants the event. The default implementation ignores theEvent and returns false.

Override this method in a subclass to allow instances to respond to click-through. This allows the user to click on a view in an inactive window, activating the view with one click, instead of clicking first to make the window active and then clicking the view. Most view objects refuse a click-through attempt, so the event simply activates the window. Many control objects, however, such as instances of UIButton and UISlider, do accept them, so the user can immediately manipulate the control without having to release the mouse button.

Parameters
theEventThe initial mouse-down event, which must be over the view in its window.

◆ addConstraint()

void CeresEngine::UIView::addConstraint ( const UILayoutConstraint constraint)

Adds a constraint on the layout of the receiving view or its subviews.

The constraint must involve only views that are within scope of the receiving view. Specifically, any views involved must be either the receiving view itself, or a subview of the receiving view. Constraints that are added to a view are said to be held by that view. The coordinate system used when evaluating the constraint is the coordinate system of the view that holds the constraint.

Parameters
constraintThe constraint to be added to the view. The constraint may only reference the view itself or its subviews.

◆ addConstraints() [1/2]

void CeresEngine::UIView::addConstraints ( const InitializerList< UILayoutConstraint constraints)
inline

Adds multiple constraints on the layout of the receiving view or its subviews.

All constraints must involve only views that are within scope of the receiving view. Specifically, any views involved must be either the receiving view itself, or a subview of the receiving view. Constraints that are added to a view are said to be held by that view. The coordinate system used when evaluating each constraint is the coordinate system of the view that holds the constraint.

Parameters
constraintsAn array of constraints to be added to the view. All constraints may only reference the view itself or its subviews.

◆ addConstraints() [2/2]

void CeresEngine::UIView::addConstraints ( const Span< const UILayoutConstraint > &  constraints)

Adds multiple constraints on the layout of the receiving view or its subviews.

All constraints must involve only views that are within scope of the receiving view. Specifically, any views involved must be either the receiving view itself, or a subview of the receiving view. Constraints that are added to a view are said to be held by that view. The coordinate system used when evaluating each constraint is the coordinate system of the view that holds the constraint.

Parameters
constraintsAn array of constraints to be added to the view. All constraints may only reference the view itself or its subviews.

◆ addSubView() [1/3]

template<typename T , typename... Args>
T * CeresEngine::UIView::addSubView ( Args &&...  args)
inline

Adds a view to the view's subviews so it's displayed above its siblings.

◆ addSubView() [2/3]

void CeresEngine::UIView::addSubView ( const UIViewPtr view)
inline

Adds a view to the view's subviews so it's displayed above its siblings.

◆ addSubView() [3/3]

void CeresEngine::UIView::addSubView ( UIView view)

Adds a view to the view's subviews so it's displayed above its siblings.

◆ calculateFittingLayoutSize()

virtual UISize CeresEngine::UIView::calculateFittingLayoutSize ( const UISize targetSize) const
virtual

Returns the optimal size of the view based on its current constraints.

Parameters
targetSizeThe size that you prefer for the view. To obtain a view that is as small as possible, specify the constant UILayoutFittingCompressedSize. To obtain a view that is as large as possible, specify the constant UILayoutFittingExpandedSize.
Note
This method returns a size value for the view that optimally satisfies the view's current constraints and is as close to the value in the targetSize parameter as possible. This method does not actually change the size of the view.
Returns
The optimal size for the view.

Reimplemented in CeresEngine::UIScrollView.

◆ calculateMaximumLayoutSize()

UISize CeresEngine::UIView::calculateMaximumLayoutSize ( ) const
inline

Returns the maximum size of the view based on its current constraints.

See also
calculateFittingLayoutSize

◆ calculateMinimumLayoutSize()

UISize CeresEngine::UIView::calculateMinimumLayoutSize ( ) const
inline

Returns the minimum size of the view based on its current constraints.

See also
calculateFittingLayoutSize

◆ canBecomeKeyView()

virtual bool CeresEngine::UIView::canBecomeKeyView ( ) const
inlinevirtual

When the value of this property is true, the view can become the key view.

In order to become the key view, the view must be visible, it must be installed in a window that supports keyboard entry, and the view's acceptsFirstResponder method must return true.

Returns
A Boolean value indicating whether the view can become key view.

◆ canDraw()

bool CeresEngine::UIView::canDraw ( ) const

A Boolean value indicating whether drawing commands will produce any results.

The value of this property is true when drawing produces expected results. A view object can draw onscreen if it is not hidden, it is attached to a view hierarchy in a window (UIWindow), and the window has a corresponding window device.

Check the value of this property before attempting to force drawing to a specific context. For example, if the value of this property is false, do not call draw() or do issue any drawing commands from the view. You do not need to check whether drawing can occur when calling the display method or any of its related methods. The display methods perform appropriate checks before asking the view to draw itself.

◆ clearTintColor()

void CeresEngine::UIView::clearTintColor ( )

Clears the tint color for the current view.

◆ convertFrom() [1/3]

UIPoint CeresEngine::UIView::convertFrom ( const UIPoint aPoint,
const UIView aView = nullptr 
) const

Converts a point from the coordinate system of a given view to that of the view.

Parameters
aPointA point specifying a location in the coordinate system of aView.
aViewThe view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead.
Returns
The point converted to the coordinate system of the view.

◆ convertFrom() [2/3]

UIRect CeresEngine::UIView::convertFrom ( const UIRect aRect,
const UIView aView = nullptr 
) const

Converts a rectangle from the coordinate system of another view to that of the view.

Parameters
aRectThe rectangle in aView's coordinate system.
aViewThe view with aRect in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead.
Returns
The converted rectangle.

◆ convertFrom() [3/3]

UISize CeresEngine::UIView::convertFrom ( const UISize aSize,
const UIView aView = nullptr 
) const

Converts a size from another view's coordinate system to that of the view.

The returned UISize values are always forced to have positive a width and height.

Parameters
aSizeThe size (width and height) in aView's coordinate system.
aViewThe view with aSize in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead.
Returns
The converted size, as an UISize structure.

◆ convertFromBacking() [1/3]

UIPoint CeresEngine::UIView::convertFromBacking ( const UIPoint aPoint) const

Converts a point from its pixel aligned backing store coordinate system to the view’s interior coordinate system.

Parameters
aPointThe point in the pixel backing store aligned coordinate system.
Returns
A point in the view’s interior coordinate system.

◆ convertFromBacking() [2/3]

UIRect CeresEngine::UIView::convertFromBacking ( const UIRect aRect) const

Converts a rectangle from its pixel aligned backing store coordinate system to the view’s interior coordinate system.

Parameters
aRectThe rectangle in the pixel backing store coordinate system.
Returns
A rectangle in the view’s interior coordinate system.

◆ convertFromBacking() [3/3]

UISize CeresEngine::UIView::convertFromBacking ( const UISize aSize) const

Converts a size from its pixel aligned backing store coordinate system to the view’s interior coordinate system.

Parameters
aSizeThe size in the pixel backing store aligned coordinate system.
Returns
A size in the view’s interior coordinate system.

◆ convertFromSuperView() [1/3]

UIPoint CeresEngine::UIView::convertFromSuperView ( const UIPoint aPoint) const
inline

Converts a point from the coordinate system of a given view to that of the view.

Parameters
aPointA point specifying a location in the coordinate system of aView.
aViewThe view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead.
Returns
The point converted to the coordinate system of the view.

◆ convertFromSuperView() [2/3]

UIRect CeresEngine::UIView::convertFromSuperView ( const UIRect aRect) const
inline

Converts a point from the coordinate system of a given view to that of the view.

Parameters
aPointA point specifying a location in the coordinate system of aView.
aViewThe view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead.
Returns
The point converted to the coordinate system of the view.

◆ convertFromSuperView() [3/3]

UISize CeresEngine::UIView::convertFromSuperView ( const UISize aSize) const
inline

Converts a point from the coordinate system of a given view to that of the view.

Parameters
aPointA point specifying a location in the coordinate system of aView.
aViewThe view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead.
Returns
The point converted to the coordinate system of the view.

◆ convertFromWindow() [1/3]

UIPoint CeresEngine::UIView::convertFromWindow ( const UIPoint aPoint) const
inline

Converts a point from the coordinate system of a given view to that of the view.

Parameters
aPointA point specifying a location in the coordinate system of aView.
aViewThe view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead.
Returns
The point converted to the coordinate system of the view.

◆ convertFromWindow() [2/3]

UIRect CeresEngine::UIView::convertFromWindow ( const UIRect aRect) const
inline

Converts a point from the coordinate system of a given view to that of the view.

Parameters
aPointA point specifying a location in the coordinate system of aView.
aViewThe view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead.
Returns
The point converted to the coordinate system of the view.

◆ convertFromWindow() [3/3]

UISize CeresEngine::UIView::convertFromWindow ( const UISize aSize) const
inline

Converts a point from the coordinate system of a given view to that of the view.

Parameters
aPointA point specifying a location in the coordinate system of aView.
aViewThe view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead.
Returns
The point converted to the coordinate system of the view.

◆ convertTo() [1/3]

UIPoint CeresEngine::UIView::convertTo ( const UIPoint aPoint,
const UIView aView = nullptr 
) const

Converts a point from the view's coordinate system to that of a given view.

Parameters
aPointA point specifying a location in the coordinate system of the view.
aViewThe view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead.
Returns
The point converted to the coordinate system of aView.

◆ convertTo() [2/3]

UIRect CeresEngine::UIView::convertTo ( const UIRect aRect,
const UIView aView = nullptr 
) const

Converts a rectangle from the view's coordinate system to that of another view.

Parameters
aRectA rectangle in the view's coordinate system.
aViewThe view that is the target of the conversion operation. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts the rectangle to window coordinates instead.
Returns
The converted rectangle.

◆ convertTo() [3/3]

UISize CeresEngine::UIView::convertTo ( const UISize aSize,
const UIView aView = nullptr 
) const

Converts a size from the view's coordinate system to that of another view.

The returned UISize values are always forced to have positive a width and height.

Parameters
aSizeThe size (width and height) in the view's coordinate system.
aViewThe view that is the target of the conversion operation. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead.
Returns
The converted size, as an UISize structure.

◆ convertToBacking() [1/3]

UIPoint CeresEngine::UIView::convertToBacking ( const UIPoint aPoint) const

Converts a point from the view’s interior coordinate system to its pixel aligned backing store coordinate system.

Parameters
aPointThe point in the view’s interior coordinate system.
Returns
A point in its pixel aligned backing store coordinate system.

◆ convertToBacking() [2/3]

UIRect CeresEngine::UIView::convertToBacking ( const UIRect aRect) const

Converts a rectangle from the view’s interior coordinate system to its pixel aligned backing store coordinate system.

Parameters
aRectA rectangle in the view’s interior coordinate system.
Returns
A rectangle in its pixel aligned backing store coordinate system.

◆ convertToBacking() [3/3]

UISize CeresEngine::UIView::convertToBacking ( const UISize aSize) const

Converts a size from the view’s interior coordinate system to its pixel aligned backing store coordinate system.

Parameters
aSizeThe size in the view’s interior coordinate system.
Returns
A size in its pixel aligned backing store coordinate system.

◆ convertToSuperView() [1/3]

UIPoint CeresEngine::UIView::convertToSuperView ( const UIPoint aPoint) const
inline

Converts a point from the view's coordinate system to that of a given view.

Parameters
aPointA point specifying a location in the coordinate system of the view.
aViewThe view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead.
Returns
The point converted to the coordinate system of aView.

◆ convertToSuperView() [2/3]

UIRect CeresEngine::UIView::convertToSuperView ( const UIRect aRect) const
inline

Converts a point from the view's coordinate system to that of a given view.

Parameters
aPointA point specifying a location in the coordinate system of the view.
aViewThe view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead.
Returns
The point converted to the coordinate system of aView.

◆ convertToSuperView() [3/3]

UISize CeresEngine::UIView::convertToSuperView ( const UISize aSize) const
inline

Converts a point from the view's coordinate system to that of a given view.

Parameters
aPointA point specifying a location in the coordinate system of the view.
aViewThe view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead.
Returns
The point converted to the coordinate system of aView.

◆ convertToWindow() [1/3]

UIPoint CeresEngine::UIView::convertToWindow ( const UIPoint aPoint) const
inline

Converts a point from the view's coordinate system to that of a given view.

Parameters
aPointA point specifying a location in the coordinate system of the view.
aViewThe view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead.
Returns
The point converted to the coordinate system of aView.

◆ convertToWindow() [2/3]

UIRect CeresEngine::UIView::convertToWindow ( const UIRect aRect) const
inline

Converts a point from the view's coordinate system to that of a given view.

Parameters
aPointA point specifying a location in the coordinate system of the view.
aViewThe view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead.
Returns
The point converted to the coordinate system of aView.

◆ convertToWindow() [3/3]

UISize CeresEngine::UIView::convertToWindow ( const UISize aSize) const
inline

Converts a point from the view's coordinate system to that of a given view.

Parameters
aPointA point specifying a location in the coordinate system of the view.
aViewThe view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead.
Returns
The point converted to the coordinate system of aView.

◆ didAddSubview()

virtual void CeresEngine::UIView::didAddSubview ( UIView view)
protectedvirtual

Overridden by subclasses to perform additional actions when subviews are added to the view.

Reimplemented in CeresEngine::UISplitView, and CeresEngine::UIStackView.

◆ didChangeBounds()

virtual void CeresEngine::UIView::didChangeBounds ( const UIRect oldBounds)
inlineprotectedvirtual

Called whenever the view bounds changes, either internally or programmatically by calls to setBounds.

Reimplemented in CeresEngine::UIButton, CeresEngine::UIViewport, and CeresEngine::UIToolBar.

◆ didChangeFrame()

virtual void CeresEngine::UIView::didChangeFrame ( const UIRect oldFrame)
inlineprotectedvirtual

Called whenever the view frame changes, either internally or programmatically by calls to setFrame.

Reimplemented in CeresEngine::UIButton.

◆ didHide()

virtual void CeresEngine::UIView::didHide ( )
protectedvirtual

Invoked when the view is hidden, either directly, or in response to an ancestor being hidden.

◆ didMoveToSuperView()

virtual void CeresEngine::UIView::didMoveToSuperView ( UIView superView)
protectedvirtual

Informs the view that its superview has changed (possibly to nil).

Reimplemented in CeresEngine::UIGizmoManipulator, and CeresEngine::UIViewport.

◆ didMoveToWindow()

virtual void CeresEngine::UIView::didMoveToWindow ( UIWindow window)
protectedvirtual

Informs the view that it has been added to a new view hierarchy.

Reimplemented in CeresEngine::UIViewport.

◆ didRemoveSubview()

virtual void CeresEngine::UIView::didRemoveSubview ( UIView view)
protectedvirtual

Overridden by subclasses to perform additional actions when subviews are removed to the view.

Reimplemented in CeresEngine::UISplitView, and CeresEngine::UIStackView.

◆ didUnhide()

virtual void CeresEngine::UIView::didUnhide ( )
protectedvirtual

Invoked when the view is unhidden, either directly, or in response to an ancestor being unhidden.

◆ display() [1/2]

void CeresEngine::UIView::display ( UIGraphicsContext context)

Displays the view and all its subviews if possible.

If the view isn't opaque, this method backs up the view hierarchy to the first opaque ancestor, calculates the portion of the opaque ancestor covered by the view, and begins displaying from there.

◆ display() [2/2]

void CeresEngine::UIView::display ( UIGraphicsContext context,
const UIRect aRect 
)

Acts as display(), but confining drawing to a rectangular region of the view.

Parameters
contextThe graphics context in which drawing will occur.
aRectA rectangle defining the region of the view to be redrawn; it should be specified in the coordinate system of the view.

◆ displayIfNeeded() [1/2]

void CeresEngine::UIView::displayIfNeeded ( UIGraphicsContext context)

Displays the view and all its subviews if any part of the view has been marked as needing display.

If the view isn't opaque, this method backs up the view hierarchy to the first opaque ancestor, calculates the portion of the opaque ancestor covered by the view, and begins displaying from there.

Parameters
contextThe graphics context in which drawing will occur.

◆ displayIfNeeded() [2/2]

void CeresEngine::UIView::displayIfNeeded ( UIGraphicsContext context,
const UIRect aRect 
)

Acts as displayIfNeeded(), but confining drawing to a rectangular region of the view.

Parameters
contextThe graphics context in which drawing will occur.
aRectA rectangle defining the region of the view to be redrawn; it should be specified in the coordinate system of the view.

◆ displayIfNeededIgnoringOpacity() [1/2]

void CeresEngine::UIView::displayIfNeededIgnoringOpacity ( UIGraphicsContext context)

Acts as displayIfNeeded(), except that this method doesn’t back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.

Parameters
contextThe graphics context in which drawing will occur.

◆ displayIfNeededIgnoringOpacity() [2/2]

void CeresEngine::UIView::displayIfNeededIgnoringOpacity ( UIGraphicsContext context,
const UIRect aRect 
)

Displays the view but confines drawing to a specified region and does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.

Parameters
contextThe graphics context in which drawing will occur.
aRectA rectangle defining the region of the view to be redrawn; it should be specified in the coordinate system of the view.

◆ displayIgnoringOpacity() [1/2]

void CeresEngine::UIView::displayIgnoringOpacity ( UIGraphicsContext context)

Displays the view but does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.

Parameters
contextThe graphics context in which drawing will occur.

◆ displayIgnoringOpacity() [2/2]

virtual void CeresEngine::UIView::displayIgnoringOpacity ( UIGraphicsContext context,
const UIRect aRect 
)
virtual

Displays the view but confines drawing to a specified region and does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.

Parameters
contextThe graphics context in which drawing will occur.
aRectA rectangle defining the region of the view to be redrawn; it should be specified in the coordinate system of the view.

Reimplemented in CeresEngine::UIClipView.

◆ draw()

virtual void CeresEngine::UIView::draw ( UIGraphicsContext context,
const UIRect dirtyRect 
)
virtual

Overridden by subclasses to draw the view's texture within the specified rectangle.

Use this method to draw the specified portion of your view's content. Your implementation of this method should be as fast as possible and do as little work as possible. The dirtyRect parameter helps you achieve better performance by specifying the portion of the view that needs to be drawn. You should always limit drawing to the content inside this rectangle. For even better performance, you can call the getRectsBeingDrawn() method and use the list of rectangles returned by that method to limit drawing even further. You can also use the needsToDraw() method test whether objects in a particular rectangle need to be drawn.

The default implementation does nothing. Subclasses should override this method if they do custom drawing. Prior to calling this method, the framework creates an appropriate drawing context and configures it for drawing to the view; you do not need to configure the drawing context yourself.

If your custom view is a direct UIView subclass, you do not need to call super. For all other views, call super at some point in your implementation so that the parent class can perform any additional drawing.

Note
If the view's isOpaque property is true, the view must completely fill the dirtyRect rectangle with opaque content.
Parameters
dirtyRectA rectangle defining the portion of the view that requires redrawing. This rectangle usually represents the portion of the view that requires updating. When responsive scrolling is enabled, this rectangle can also represent a nonvisible portion of the view that frameworks wants to cache.

Reimplemented in CeresEngine::UIScrollView, CeresEngine::UIButton, CeresEngine::UICheckbox, CeresEngine::UIGizmoArrowManipulator, CeresEngine::UIGizmoCircleManipulator, CeresEngine::UILabel, CeresEngine::UIMenuBar, CeresEngine::UIScroller, CeresEngine::UISlider, CeresEngine::UISplitView, CeresEngine::UITextField, CeresEngine::UIToolBar, and CeresEngine::UIViewport.

◆ ensureLayoutSolver()

UILayoutSolver & CeresEngine::UIView::ensureLayoutSolver ( )
private

Ensures that a layout solver is present on the view.

◆ getAlpha()

double CeresEngine::UIView::getAlpha ( ) const
inlinenoexcept

This property contains the opacity value from the view's layer.

The acceptable range of values for this property are between 0.0 (transparent) and 1.0 (opaque). The default value of this property is 1.0.

Returns
The opacity of the view.

◆ getAppearance()

const UIAppearance & CeresEngine::UIView::getAppearance ( ) const
noexcept

The UI appearance to be used by the view.

The default value for this property is nulltpr, which means that the view uses the appearance it inherits from the nearest ancestor that has set an appearance. When you set appearance to a non-null value, the view and the views it contains use the specified appearance.

◆ getAutoresizesSubViews()

bool CeresEngine::UIView::getAutoresizesSubViews ( ) const

A Boolean value indicating whether the view applies the autoresizing behavior to its subviews when its frame size changes.

When the value of this property is true and the view's frame changes, the view automatically calls the resizeSubViews() method to facilitate the resizing of its subviews. When the value of this property is false, the view does not autoresize its subviews.

The default value of this property is true.

◆ getAutoresizingMask()

const UIViewAutoresizingMask & CeresEngine::UIView::getAutoresizingMask ( ) const
inline

The options that determine how the view is resized relative to its superview.

The value of this property is an integer bit mask specified by combining the options described in UIViewAutoresizingMask. This mask is used by the resize() method when the view needs to be resized.

If the autoresizing mask is set to UIViewNotSizable (that is, if none of the options are set), the view does not resize at all. When more than one option along an axis is set, the resize() method distributes the size difference as evenly as possible among the flexible portions. For example, if UIViewWidthSizable and UIViewMaxXMargin are set and the superview's width has increased by 10.0 points, the view's frame and right margin are each widened by 5.0 points.

◆ getBackgroundColor()

const UIColor & CeresEngine::UIView::getBackgroundColor ( ) const
inlinenoexcept

The view's background color.

◆ getBottomLayoutMargin()

double CeresEngine::UIView::getBottomLayoutMargin ( ) const
inline

The default spacing to use when laying out content in the view.

This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.

◆ getBounds()

UIRect CeresEngine::UIView::getBounds ( ) const
inline

The view's bounds rectangle, which expresses its location and size in its own coordinate system.

By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).

If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.

Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ getClearsContextBeforeDrawing()

virtual bool CeresEngine::UIView::getClearsContextBeforeDrawing ( ) const
inlinevirtualnoexcept

A Boolean value that determines whether the view's bounds should be automatically cleared before drawing.

When set to true, the drawing buffer is automatically cleared to transparent black before the draw method is called. This behavior ensures that there are no visual artifacts left over when the view's contents are redrawn. If the view's isOpaque property is also set to true, the getBackgroundColor property of the view will be used when clearing. The default value of this property is true.

If you set the value of this property to false, you are responsible for ensuring the contents of the view are drawn properly in your draw method. If your drawing code is already heavily optimized, setting this property to false can improve performance, especially during scrolling when only a portion of the view might need to be redrawn.

Reimplemented in CeresEngine::UICheckbox, CeresEngine::UIMenuBar, CeresEngine::UIToolBar, and CeresEngine::UIViewport.

◆ getClipsToBounds()

virtual bool CeresEngine::UIView::getClipsToBounds ( ) const
inlinevirtual

A Boolean value that determines whether subviews are confined to the bounds of the view.

Setting this value to true causes subviews to be clipped to the bounds of the receiver. If set to false, subviews whose frames extend beyond the visible bounds of the receiver are not clipped. The default value is true.

◆ getConstraints()

Span< const UILayoutConstraint > CeresEngine::UIView::getConstraints ( ) const

Returns the constraints held by the view.

◆ getContentScaleFactor()

double CeresEngine::UIView::getContentScaleFactor ( ) const

The scale factor applied to the view.

The scale factor determines how content in the view is mapped from the logical coordinate space (measured in points) to the device coordinate space (measured in pixels). This value is typically either 1.0 or 2.0. Higher scale factors indicate that each point in the view is represented by more than one pixel in the underlying layer. For example, if the scale factor is 2.0 and the view frame size is 50 x 50 points, the size of the bitmap used to present that content is 100 x 100 pixels.

The default value for this property is the scale factor associated with the screen currently displaying the view. If your custom view implements a custom draw method and is associated with a window your view draws at the full resolution of the screen.

In general, you should not need to modify the value in this property. However, if your application draws using very expensive rendering operations, like a scene viewport, you may want to change the scale factor to trade texture quality for rendering performance.

◆ getCornerRadius()

const UICornerRadius & CeresEngine::UIView::getCornerRadius ( ) const
inlinenoexcept

The view's background corner radius.

If a background color is set, will specify the corner radius it should be draw with.

◆ getFrame()

UIRect CeresEngine::UIView::getFrame ( ) const
inline

The view's frame rectangle, which defines its position and size in its superview's coordinate system.

Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.

If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ getIntrinsicContentSize()

virtual UISize CeresEngine::UIView::getIntrinsicContentSize ( ) const
virtual

The natural size for the receiving view, considering only properties of the view itself.

The default width and height values of this property are set to NSViewNoInstrinsicMetric. For a custom view, you can override this property and use it to communicate what size you would like your view to be based on its content. You might do this in cases where the layout system cannot determine the size of the view based solely on its current constraints. For example, a text field might override this method and return an intrinsic size based on the text it contains. The intrinsic size you supply must be independent of the content frame, because there's no way to dynamically communicate a changed width to the layout system based on a changed height. If your custom view has no intrinsic size for a given dimension, you can set the corresponding dimension to the UIViewNoInstrinsicMetric.

Returns
A size indicating the natural size for the receiving view based on its intrinsic properties.

Reimplemented in CeresEngine::UIButton, CeresEngine::UICheckbox, CeresEngine::UILabel, CeresEngine::UIMenuBar, CeresEngine::UISlider, CeresEngine::UITextField, and CeresEngine::UIToolBar.

◆ getLayoutMargins()

const UIEdgeInsets & CeresEngine::UIView::getLayoutMargins ( ) const
inline

The default spacing to use when laying out content in the view.

This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.

◆ getLayoutTopMargin()

double CeresEngine::UIView::getLayoutTopMargin ( ) const
inline

The default spacing to use when laying out content in the view.

This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.

◆ getLeftLayoutMargin()

double CeresEngine::UIView::getLeftLayoutMargin ( ) const
inline

The default spacing to use when laying out content in the view.

This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.

◆ getMouseDownCanMoveWindow()

virtual bool CeresEngine::UIView::getMouseDownCanMoveWindow ( ) const
inlinevirtual

This property lets you determine the region by which a window can be moved.

The default value of this property is false if the view is opaque; otherwise, it is set to true. Subclasses can override this property to return different values based on the event.

Returns
A Boolean value indicating whether the view can pass mouse down events through to its superviews.

◆ getName()

const String & CeresEngine::UIView::getName ( ) const
inline

A human readable string that represents the view.

Used for debugging only.

◆ getNeedsDisplay()

bool CeresEngine::UIView::getNeedsDisplay ( ) const

The displayIfNeeded methods check the value of this property to avoid unnecessary drawing, and all display methods set the value back to false when the view is up to date.

Whenever the data or state affecting the view's appearance changes, set this property to true. This marks the view as needing to update its display. On the next pass through the app's event loop, the view is automatically redisplayed.

Returns
A Boolean value that determines whether the view needs to be redrawn before being displayed.

◆ getNeedsLayout()

bool CeresEngine::UIView::getNeedsLayout ( ) const

A Boolean value indicating whether the view needs a layout pass before it can be drawn.

You only ever need to change the value of this property if your view implements the layout method. Setting this property to true lets the system know that the view's layout needs to be updated before it is drawn. The system checks the value of this property prior to applying layout rules for the view.

Returns
true if the view needs a layout pass, false otherwise.

◆ getNeedsUpdateConstraints()

bool CeresEngine::UIView::getNeedsUpdateConstraints ( ) const

A Boolean value that determines whether the view’s constraints need updating.

The constraint-based layout system uses the return value of this method to determine whether it needs to call updateConstraints on your view as part of its normal layout pass.

When a property of your custom view changes in a way that would impact constraints, you can call this method to indicate that the constraints need to be updated at some point in the future. The system will then call updateConstraints as part of its normal layout pass. Use this as an optimization tool to batch constraint changes. Updating constraints all at once just before they are needed ensures that you don’t needlessly recalculate constraints when multiple changes are made to your view in between layout passes.

Returns
true if the view’s constraints need updating, false otherwise.

◆ getNextKeyView()

UIView * CeresEngine::UIView::getNextKeyView ( ) const
inline

The view object that follows the current view in the key view loop.

The value in this property is nullptr if there is no next view in the key view loop. You can assign a view to this property to make that view the next view in the loop. The view in this property should, if possible, be made first responder when the user navigates forward from the view using keyboard interface control.

Returns
The view object that follows the current view in the key view loop.

◆ getNextResponder()

UIResponder * CeresEngine::UIView::getNextResponder ( ) const
finalvirtual

The next responder after this one, or nil if it has none.

The next responder must be an object that inherits, directly or indirectly, from UIResponder.

Reimplemented from CeresEngine::UIResponder.

◆ getNextValidKeyView()

UIView * CeresEngine::UIView::getNextValidKeyView ( ) const

The value in this property is nullptr if there is no view that follows the current view and accepts the first responder status.

The framework ignores hidden views when it determines the next valid key view.

Returns
The closest view object in the key view loop that follows the view and accepts first responder status, or nullptr if there is none.

◆ getOpaqueAncestor()

UIView * CeresEngine::UIView::getOpaqueAncestor ( ) const

The view's closest opaque ancestor, which might be the view itself.

◆ getPreviousKeyView()

UIView * CeresEngine::UIView::getPreviousKeyView ( ) const
inline

The value in this property is nullptr if there is no view preceding the current view in the key view loop.

The view in this property should, if possible, be made first responder when the user navigates backward from the current view using keyboard interface control.

Returns
The view object preceding the current view in the key view loop.

◆ getPreviousValidKeyView()

UIView * CeresEngine::UIView::getPreviousValidKeyView ( ) const

The value in this property is nullptr if there is no view that precedes the current view and accepts the first responder status.

The framework ignores hidden views when it determines the previous valid key view.

Returns
The closest view object in the key view loop that precedes the current view and accepts first responder status.

◆ getRectsBeingDrawn()

const Vector< UIRect > & CeresEngine::UIView::getRectsBeingDrawn ( ) const

Returns by a list of non-overlapping rectangles that define the area the view is being asked to draw in draw().

An implementation of draw() can use this information to test whether objects or regions within the view intersect with the rectangles in the list, and thereby avoid unnecessary drawing that would be completely clipped away.

The needsToDraw() method gives you a convenient way to test individual objects for intersection with the area being drawn in draw(). However, you may want to retrieve and directly inspect the rectangle list if this is a more efficient way to perform intersection testing.

You should call this method only from within a draw() implementation. The aRect parameter of draw() is the rectangle enclosing the returned list of rectangles; you can use it in an initial pass to reject objects that are clearly outside the area to be drawn.

◆ getRightLayoutMargin()

double CeresEngine::UIView::getRightLayoutMargin ( ) const
inline

The default spacing to use when laying out content in the view.

This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.

◆ getScrollView()

virtual UIScrollView * CeresEngine::UIView::getScrollView ( ) const
virtual

Gets the closest parent scroll view to this view.

Reimplemented in CeresEngine::UIScrollView.

◆ getSubView()

UIView * CeresEngine::UIView::getSubView ( UInt32  index) const

Gets the sub-view at the given index.

◆ getSubViewCount()

UInt32 CeresEngine::UIView::getSubViewCount ( ) const
inlinenoexcept

Gets the number of sub-views in the view.

◆ getSubViewIndex()

UInt32 CeresEngine::UIView::getSubViewIndex ( const UIView view) const

Gtes the sub-view index for the given sub-view, if it is a sub-view.

◆ getSubViews()

const Vector< UIView * > & CeresEngine::UIView::getSubViews ( ) const
inline

The list of views embedded in the current view.

This array contains zero or more UIView objects that represent the views embedded in the current view's content. The current view acts as the superview for each subview. The order of the subviews may be considered as being back-to-front, but this does not imply invalidation and drawing behavior.

When performing hit-test operations on a view, you should start at the last view in this array and work backwards.

Set this property to reorder the view's existing subviews, add or remove subviews en masse, replace all of the view's subviews with a new set of subviews, or remove all the view's subviews. When you assign a valid, new array of subviews, the system performs required sorting and calls addSubView() and removeFromSuperview() as necessary to leave the property with the requested new array. Any member of the new array that isn't already a subview of the view is added. Any member of the view's existing subviews array that isn't in the new array is removed. Any views that are in both subviews and the new array are moved in the subviews array as needed, without being removed and re-added.

This property marks the affected view and window areas as needing display.

◆ getSuperView()

UIView * CeresEngine::UIView::getSuperView ( ) const
inline

The view that is the parent of the current view.

The superview is the immediate ancestor of the current view. The value of this property is nil when the view is not installed in a view hierarchy. To set the value of this property, use the addSubView method to embed the current view inside another view.

When checking the value of this property iteratively or recursively, be sure to compare the superview object to the content view of the window to avoid proceeding out of the view hierarchy.

◆ getTintColor()

UIColor CeresEngine::UIView::getTintColor ( ) const

The first non-default tint color value in the view's hierarchy, ascending from and starting with the view itself.

If the system cannot find a non-default color in the hierarchy, this property's value is a system-defined color instead.

To refresh subview rendering when this property changes, override the tintColorDidChange() method.

◆ getTransformFrom()

AffineTransform CeresEngine::UIView::getTransformFrom ( const UIView aView = nullptr) const
Returns
A 2D transformation matrix that transforms a point from the coordinate system of a given view to that of the view.
Parameters
aViewThe view into whose coordinate system transformation matrix is to be returned. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead.

◆ getTransformFromBacking()

const AffineTransform & CeresEngine::UIView::getTransformFromBacking ( ) const
Returns
A 2D transformation matrix that transforms a point from its pixel aligned backing store coordinate system to the view’s interior coordinate system.

◆ getTransformFromSuperView()

AffineTransform CeresEngine::UIView::getTransformFromSuperView ( ) const
inline
Returns
A 2D transformation matrix that transforms a point from the super view coordinate space into the view coordinate space.

◆ getTransformFromWindow()

const AffineTransform & CeresEngine::UIView::getTransformFromWindow ( ) const
Returns
A 2D transformation matrix that transforms a point from the window coordinate space into the view coordinate space.

◆ getTransformTo()

AffineTransform CeresEngine::UIView::getTransformTo ( const UIView aView = nullptr) const
Returns
A 2D transformation matrix that transforms a point from the view's coordinate system to that of a given view.
Parameters
aViewThe view into whose coordinate system transformation matrix is to be returned. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead.

◆ getTransformToBacking()

const AffineTransform & CeresEngine::UIView::getTransformToBacking ( ) const
Returns
A 2D transformation matrix that transforms a point from the view’s interior coordinate system to its pixel aligned backing store coordinate system.

◆ getTransformToSuperView()

AffineTransform CeresEngine::UIView::getTransformToSuperView ( ) const
inline
Returns
A 2D transformation matrix that transforms a point from the view coordinate space into the super view coordinate space.

◆ getTransformToWindow()

const AffineTransform & CeresEngine::UIView::getTransformToWindow ( ) const
Returns
A 2D transformation matrix that transforms a point from the view coordinate space into the window coordinate space.

◆ getTypeName()

virtual StringView CeresEngine::UIView::getTypeName ( ) const
virtual

A string that represents the view type.

◆ getViewController()

UIViewController * CeresEngine::UIView::getViewController ( ) const
inlinenoexcept

The UIView controller, if any.

Can be nullptr if the view is not attached to a controller.

◆ getVisibleRect()

UIRect CeresEngine::UIView::getVisibleRect ( ) const

Visibility, as reflected by this property, does not account for whether other view or window objects overlap the current view or whether the current view is installed in a window at all.

This value of this property is zero if the current view is effectively hidden.

Returns
The portion of the view that is not clipped by its superviews.

◆ getWindow()

virtual UIWindow * CeresEngine::UIView::getWindow ( ) const
inlinevirtual

The view's window object, if it is installed in a window.

The value of this property is nullptr if the view is not currently installed in a window.

◆ hitTest()

UIView * CeresEngine::UIView::hitTest ( UIPoint  aPoint,
const Optional< const UIEvent & > &  event = nullopt 
)

Returns the farthest descendant of the view in the view hierarchy (including itself) that contains a specified point, or nil if that point lies completely outside the view.

This method is used primarily by an UIWindow object to determine which view should receive a mouse-down event. You'd rarely need to invoke this method, but you might want to override it to have a view object hide mouse-down events from its subviews. This method ignores hidden views.

This method traverses the view hierarchy by calling the isMousePoint method of each subview to determine which subview should receive a mouse event. If isPointInside returns true, then the subview's hierarchy is similarly traversed until the frontmost view containing the specified point is found. If a view does not contain the point, its branch of the view hierarchy is ignored. You rarely need to call this method yourself.

This method ignores view objects that are hidden or have an alpha level less than 0.01. This method does not take the view's content into account when determining a hit. Thus, a view can still be returned even if the specified point is in a transparent portion of that view's content.

Points that lie outside the receiver's bounds are never reported as hits, even if they actually lie within one of the receiver's subviews. This can occur if the current view's clipsToBounds property is set to false and the affected subview extends beyond the view's bounds.

Parameters
aPointA point that is in the coordinate system of the view's superview, not of the view itself.
eventThe event that warranted a call to this method. If you are calling this method from outside your event-handling code, you may specify nullptr.
Returns
A view object that is the farthest descendent of aPoint.

◆ insertSubView()

void CeresEngine::UIView::insertSubView ( UIView view,
UInt32  index 
)
private

◆ invalidateBackingStore()

void CeresEngine::UIView::invalidateBackingStore ( )
private

Called whenever the UIView backing store must be invalidated.

Usually called whenever the UIWindow changes or when the backing UIWindowDevice of a window changes.

◆ invalidateIntrinsicContentSize()

void CeresEngine::UIView::invalidateIntrinsicContentSize ( )
protected

Invalidates the view's intrinsic content size.

Call this when something changes in your custom view that invalidates its intrinsic content size. This allows the layout system to take the new intrinsic content size into account in its next layout pass.

◆ invalidateTransforms()

void CeresEngine::UIView::invalidateTransforms ( )
private

Internal method called by the system whenever it needs to invalidate transforms.

◆ isActive()

bool CeresEngine::UIView::isActive ( ) const

A Boolean value indicating whether the view is active.

◆ isDescendant()

bool CeresEngine::UIView::isDescendant ( const UIView view) const

Returns true if the view is a subview of a given view or if it's identical to that view; otherwise, it returns false.

◆ isFirstResponder()

bool CeresEngine::UIView::isFirstResponder ( ) const
noexcept

Determines if this view is the current first responder.

◆ isHidden()

bool CeresEngine::UIView::isHidden ( ) const
inline

A Boolean value indicating whether the view is hidden.

This property reflects the state of the current view only, as set in through the most recent change to this property. The property does not account for the state of the view's ancestors in the view hierarchy. Thus, if the view has a hidden ancestor, the value of this property may still be false even though the view itself is not visible. To determine whether a view is effectively hidden, for whatever reason, get the value of the isHiddenOrHasHiddenAncestor method instead.

A hidden view disappears from its window and does not receive input events. It remains in its superview's list of subviews, however, and participates in autoresizing as usual. The framework also disables any cursor rectangle, tool-tip rectangle, or tracking rectangle associated with a hidden view. Hiding a view with subviews has the effect of hiding those subviews and any view descendants they might have. This effect is implicit and does not alter the hidden state of the view's descendants as reported by this property.

Hiding the view that is the window's current first responder causes the view's next valid key view (nextValidKeyView) to become the new first responder. A hidden view remains in the nextKeyView chain of views it was previously part of, but is ignored during keyboard navigation.

◆ isHiddenOrHasHiddenAncestor()

bool CeresEngine::UIView::isHiddenOrHasHiddenAncestor ( ) const

A Boolean value indicating whether the view is hidden from sight because it, or one of its ancestors, is marked as hidden.

◆ isMousePoint()

bool CeresEngine::UIView::isMousePoint ( const UIPoint aPoint,
const UIRect aRect 
)

Returns whether a region of the view contains a specified point, accounting for whether the view is flipped or not.

Point-in-rectangle functions generally assume that the bottom edge of a rectangle is outside of the rectangle boundaries, while the upper edge is inside the boundaries. This method views aRect from the point of view of the user—that is, this method always treats the bottom edge of the rectangle as the one closest to the bottom edge of the user's screen. By making this adjustment, this function ensures consistent mouse-detection behavior from the user's perspective.

Parameters
aPointA point that is expressed in the view's coordinate system. This point generally represents the hot spot of the mouse cursor.
aRectA rectangle that is expressed in the view's coordinate system.
Returns
true if aRect contains aPoint, false otherwise.

◆ isOpaque()

bool CeresEngine::UIView::isOpaque ( ) const
inlinenoexcept

A Boolean value indicating whether the view fills its frame rectangle with opaque content.

The default value of this property is false to reflect the fact that views do no drawing by default. Subclasses can override this property and return true to indicate that the view completely covers its frame rectangle with opaque content. Doing so can improve performance during drawing operations by eliminating the need to render content behind the view.

◆ isPointInside()

virtual bool CeresEngine::UIView::isPointInside ( const UIPoint point,
const Optional< const UIEvent & > &  event = nullopt 
)
virtual

Returns a Boolean value indicating whether the receiver contains the specified point.

Parameters
pointA point that is in the receiver's local coordinate system (bounds).
eventThe event that warranted a call to this method. If you are calling this method from outside your event-handling code, you may specify nullptr.
Returns
true if point is inside the receiver's bounds; otherwise, false.

Reimplemented in CeresEngine::UIGizmoArrowManipulator, CeresEngine::UIGizmoCircleManipulator, and CeresEngine::UIButton.

◆ isVisible()

bool CeresEngine::UIView::isVisible ( ) const

A Boolean value indicating whether the view is visible.

◆ layout()

void CeresEngine::UIView::layout ( )

Perform layout in concert with the layout system.

Override this method if your custom view needs to perform custom layout. In this case you are responsible for calling setNeedsLayout to true when something that impacts your custom layout changes.

You may not invalidate the layout of your superview or views outside of your view hierarchy. You also may not invoke a drawing pass as part of layout.

You must call the base layout() as part of your implementation.

◆ layoutIfNeeded()

void CeresEngine::UIView::layoutIfNeeded ( )

Updates the layout of the receiving view and its subviews based on the current views and constraints.

This method updates the layout if needed. This method is called automatically by the system, but may be invoked manually if you need to examine the most up to date layout.

◆ layoutSubviews()

virtual void CeresEngine::UIView::layoutSubviews ( )
virtual

Lays out subviews.

Subclasses can override this method as needed to perform more precise layout of their subviews. You should override this method only if the autoresizing behavior of the subviews do not offer the behavior you want. You can use your implementation to set the frame rectangles of your subviews directly.

You should not call this method directly. If you want to force a layout update, call the setNeedsLayout() method instead to do so prior to the next drawing update. If you want to update the layout of your views immediately, call the layoutIfNeeded() method.

Reimplemented in CeresEngine::UIClipView, CeresEngine::UILabel, CeresEngine::UIScrollView, CeresEngine::UISplitView, CeresEngine::UITextField, and CeresEngine::UIToolBar.

◆ needsPanelToBecomeKey()

virtual bool CeresEngine::UIView::needsPanelToBecomeKey ( ) const
inlinevirtual

The default value of this property is false.

Subclasses can override this property and use their implementation to determine if the view requires its panel to become the key window so that it can handle keyboard input and navigation. Such a subclass should also override acceptsFirstResponder to return true.

This property is also used in keyboard navigation. It determines if a mouse click should give focus to a view—that is, make it the first responder). Some views (for example, text fields) want to receive the keyboard focus when you click in them. Other views (for example, buttons) receive focus only when you tab to them. You wouldn't want focus to shift from a textfield that has editing in progress simply because you clicked on a check box.

Returns
A Boolean value indicating whether the view needs its panel to become the key window before it can handle keyboard input and navigation.

Reimplemented in CeresEngine::UISlider, and CeresEngine::UITextField.

◆ needsToDraw()

bool CeresEngine::UIView::needsToDraw ( const UIRect aRect) const
noexcept

Returns a Boolean value indicating whether the specified rectangle intersects any part of the area that the view is being asked to draw.

You typically call this method from within a draw() implementation. It gives you a convenient way to determine whether any part of a given graphical entity might need to be drawn. It is optimized to efficiently reject any rectangle that lies outside the bounding box of the area that the view is being asked to draw in draw().

Parameters
aRectA rectangle defining a region of the view.

◆ registerLayoutAnchor()

void CeresEngine::UIView::registerLayoutAnchor ( const UILayoutAnchor layoutAnchor)
private

Registers a new layout anchor with the view.

This is called automatically by the anchor constructor.

◆ removeConstraint()

void CeresEngine::UIView::removeConstraint ( const UILayoutConstraint constraint)

Removes the specified constraint from the view.

Parameters
constraintThe constraint to remove. Removing a constraint not held by the view has no effect.

◆ removeConstraints() [1/2]

void CeresEngine::UIView::removeConstraints ( const InitializerList< UILayoutConstraint constraints)
inline

Removes the specified constraints from the view.

Parameters
constraintsThe constraints to remove.

◆ removeConstraints() [2/2]

void CeresEngine::UIView::removeConstraints ( const Span< const UILayoutConstraint > &  constraints)

Removes the specified constraints from the view.

Parameters
constraintsThe constraints to remove.

◆ removeFromSuperview()

void CeresEngine::UIView::removeFromSuperview ( )

Unlinks the view from its superview and its window, removes it from the responder chain, and invalidates its cursor rectangles.

The view is also released; if you plan to reuse it, be sure to retain it before sending this message and to release it as appropriate when adding it as a subview of another UIView.

◆ replaceSubView()

void CeresEngine::UIView::replaceSubView ( UIView view,
UIView replacement 
)

Replaces one of the view's subviews with another view.

◆ resize()

virtual void CeresEngine::UIView::resize ( const UISize oldBoundsSize)
virtual

Informs the view that the bounds size of its superview has changed.

This method is normally invoked automatically from resizeSubviews().

The default implementation resizes the view according to the autoresizing options specified by the autoresizingMask property. You shouldn't invoke this method directly, but you can override it to define a specific resizing behavior.

If you override this method and call the base as part of your implementation, you should be sure to call the base before making changes to the receiving view's frame yourself.

Parameters
oldBoundsSizeThe previous size of the view's bounds rectangle.

◆ resizeSubviews()

virtual void CeresEngine::UIView::resizeSubviews ( const UISize oldBoundsSize)
virtual

Informs the view's subviews that the view's bounds rectangle size has changed.

If the view is configured to autoresize its subviews, this method is automatically invoked by any method that changes the view's frame size.

The default implementation calls resize() to the view's subviews with oldBoundsSize as the argument. You shouldn't invoke this method directly, but you can override it to define a specific resizing behavior.

Parameters
oldBoundsSizeThe previous size of the view's bounds rectangle.

◆ setActive()

void CeresEngine::UIView::setActive ( bool  active)

A Boolean value indicating whether the view is active.

◆ setAlpha()

void CeresEngine::UIView::setAlpha ( double  alpha)

This property contains the opacity value from the view's layer.

The acceptable range of values for this property are between 0.0 (transparent) and 1.0 (opaque). The default value of this property is 1.0.

Returns
The opacity of the view.

◆ setAppearance()

void CeresEngine::UIView::setAppearance ( UIAppearance appearance)

The UI appearance to be used by the view.

The default value for this property is nulltpr, which means that the view uses the appearance it inherits from the nearest ancestor that has set an appearance. When you set appearance to a non-null value, the view and the views it contains use the specified appearance.

◆ setAutoresizesSubViews()

void CeresEngine::UIView::setAutoresizesSubViews ( bool  state)

Generates a hash for the provided type.

Type must have a std::hash specialization.

Template Parameters
Tthe type to be hashed
Parameters
vThe value to be hashed
Returns
The hashed value

◆ setAutoresizingMask()

void CeresEngine::UIView::setAutoresizingMask ( const UIViewAutoresizingMask autoresizingMask)

The options that determine how the view is resized relative to its superview.

The value of this property is an integer bit mask specified by combining the options described in UIViewAutoresizingMask. This mask is used by the resize() method when the view needs to be resized.

If the autoresizing mask is set to none (that is, if none of the options are set), the view does not resize at all. When more than one option along an axis is set, the resize() method distributes the size difference as evenly as possible among the flexible portions. For example, if widthSizable and maxXMargin are set and the superview's width has increased by 10.0 points, the view's frame and right margin are each widened by 5.0 points.

◆ setBackgroundColor()

void CeresEngine::UIView::setBackgroundColor ( const UIColor color)

The view's background color.

◆ setBottomLayoutMargin()

void CeresEngine::UIView::setBottomLayoutMargin ( double  bottomLayoutMargin)

The default spacing to use when laying out content in the view.

This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.

◆ setBounds() [1/5]

void CeresEngine::UIView::setBounds ( const double  x,
const double  y,
const double  width,
const double  height 
)
inline

The view's bounds rectangle, which expresses its location and size in its own coordinate system.

By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).

If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.

Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ setBounds() [2/5]

void CeresEngine::UIView::setBounds ( const double  x,
const double  y,
const UISize size 
)
inline

The view's bounds rectangle, which expresses its location and size in its own coordinate system.

By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).

If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.

Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ setBounds() [3/5]

void CeresEngine::UIView::setBounds ( const UIPoint point,
const double  width,
const double  height 
)
inline

The view's bounds rectangle, which expresses its location and size in its own coordinate system.

By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).

If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.

Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ setBounds() [4/5]

void CeresEngine::UIView::setBounds ( const UIPoint point,
const UISize size 
)
inline

The view's bounds rectangle, which expresses its location and size in its own coordinate system.

By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).

If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.

Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ setBounds() [5/5]

virtual void CeresEngine::UIView::setBounds ( const UIRect bounds)
virtual

The view's bounds rectangle, which expresses its location and size in its own coordinate system.

By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).

If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.

Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ setBoundsOrigin() [1/2]

void CeresEngine::UIView::setBoundsOrigin ( const double  x,
const double  y 
)
inline

Sets the origin of the view's bounds rectangle to a specified point.

◆ setBoundsOrigin() [2/2]

void CeresEngine::UIView::setBoundsOrigin ( const UIPoint point)
inline

Sets the origin of the view's bounds rectangle to a specified point.

◆ setBoundsSize() [1/2]

void CeresEngine::UIView::setBoundsSize ( const double  width,
const double  height 
)
inline

Sets the size of the view's bounds rectangle to specified dimensions, inversely scaling its coordinate system relative to its frame rectangle.

◆ setBoundsSize() [2/2]

void CeresEngine::UIView::setBoundsSize ( const UISize size)
inline

Sets the size of the view's bounds rectangle to specified dimensions, inversely scaling its coordinate system relative to its frame rectangle.

◆ setConstraints() [1/2]

void CeresEngine::UIView::setConstraints ( const Span< const UILayoutConstraint > &  constraints)

Returns the constraints held by the view.

◆ setConstraints() [2/2]

void CeresEngine::UIView::setConstraints ( Vector< UILayoutConstraint > &&  constraints)

Returns the constraints held by the view.

◆ setContentScaleFactor()

void CeresEngine::UIView::setContentScaleFactor ( const Optional< double > &  contentScaleFactor)

The scale factor applied to the view.

The scale factor determines how content in the view is mapped from the logical coordinate space (measured in points) to the device coordinate space (measured in pixels). This value is typically either 1.0 or 2.0. Higher scale factors indicate that each point in the view is represented by more than one pixel in the underlying layer. For example, if the scale factor is 2.0 and the view frame size is 50 x 50 points, the size of the bitmap used to present that content is 100 x 100 pixels.

The default value for this property is the scale factor associated with the screen currently displaying the view. If your custom view implements a custom draw method and is associated with a window your view draws at the full resolution of the screen.

In general, you should not need to modify the value in this property. However, if your application draws using very expensive rendering operations, like a scene viewport, you may want to change the scale factor to trade texture quality for rendering performance.

◆ setCornerRadius()

void CeresEngine::UIView::setCornerRadius ( const UICornerRadius color)

The view's background corner radius.

If a background color is set, will specify the corner radius it should be draw with.

◆ setFrame() [1/5]

void CeresEngine::UIView::setFrame ( const double  x,
const double  y,
const double  width,
const double  height 
)
inline

The view's frame rectangle, which defines its position and size in its superview's coordinate system.

Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.

If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ setFrame() [2/5]

void CeresEngine::UIView::setFrame ( const double  x,
const double  y,
const UISize size 
)
inline

The view's frame rectangle, which defines its position and size in its superview's coordinate system.

Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.

If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ setFrame() [3/5]

void CeresEngine::UIView::setFrame ( const UIPoint point,
const double  width,
const double  height 
)
inline

The view's frame rectangle, which defines its position and size in its superview's coordinate system.

Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.

If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ setFrame() [4/5]

void CeresEngine::UIView::setFrame ( const UIPoint point,
const UISize size 
)
inline

The view's frame rectangle, which defines its position and size in its superview's coordinate system.

Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.

If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ setFrame() [5/5]

virtual void CeresEngine::UIView::setFrame ( const UIRect frame)
virtual

The view's frame rectangle, which defines its position and size in its superview's coordinate system.

Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.

If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.

◆ setFrameOrigin() [1/2]

void CeresEngine::UIView::setFrameOrigin ( const double  x,
const double  y 
)
inline

Sets the origin of the view's frame rectangle to the specified point, effectively repositioning it within its superview.

◆ setFrameOrigin() [2/2]

void CeresEngine::UIView::setFrameOrigin ( const UIPoint point)
inline

Sets the origin of the view's frame rectangle to the specified point, effectively repositioning it within its superview.

◆ setFrameSize() [1/2]

void CeresEngine::UIView::setFrameSize ( const double  width,
const double  height 
)
inline

Sets the size of the view's frame rectangle to the specified dimensions, resizing it within its superview without affecting its coordinate system.

◆ setFrameSize() [2/2]

void CeresEngine::UIView::setFrameSize ( const UISize size)
inline

Sets the size of the view's frame rectangle to the specified dimensions, resizing it within its superview without affecting its coordinate system.

◆ setHidden()

void CeresEngine::UIView::setHidden ( const bool  hidden)
inline

A Boolean value indicating whether the view is hidden.

This property reflects the state of the current view only, as set in through the most recent change to this property. The property does not account for the state of the view's ancestors in the view hierarchy. Thus, if the view has a hidden ancestor, the value of this property may still be false even though the view itself is not visible. To determine whether a view is effectively hidden, for whatever reason, get the value of the isHiddenOrHasHiddenAncestor method instead.

A hidden view disappears from its window and does not receive input events. It remains in its superview's list of subviews, however, and participates in autoresizing as usual. The framework also disables any cursor rectangle, tool-tip rectangle, or tracking rectangle associated with a hidden view. Hiding a view with subviews has the effect of hiding those subviews and any view descendants they might have. This effect is implicit and does not alter the hidden state of the view's descendants as reported by this property.

Hiding the view that is the window's current first responder causes the view's next valid key view (nextValidKeyView) to become the new first responder. A hidden view remains in the nextKeyView chain of views it was previously part of, but is ignored during keyboard navigation.

◆ setLayoutMargins()

void CeresEngine::UIView::setLayoutMargins ( const UIEdgeInsets layoutMargins)

The default spacing to use when laying out content in the view.

This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.

◆ setLeftLayoutMargin()

void CeresEngine::UIView::setLeftLayoutMargin ( double  leftLayoutMargin)

The default spacing to use when laying out content in the view.

This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.

◆ setName()

void CeresEngine::UIView::setName ( const String name)

Generates a hash for the provided type.

Type must have a std::hash specialization.

Template Parameters
Tthe type to be hashed
Parameters
vThe value to be hashed
Returns
The hashed value

◆ setNeedsDisplay() [1/2]

void CeresEngine::UIView::setNeedsDisplay ( )

The displayIfNeeded methods check the value of this property to avoid unnecessary drawing, and all display methods set the value back to false when the view is up to date.

Whenever the data or state affecting the view's appearance changes, set this property to true. This marks the view as needing to update its display. On the next pass through the app's event loop, the view is automatically redisplayed.

◆ setNeedsDisplay() [2/2]

void CeresEngine::UIView::setNeedsDisplay ( const UIRect invalidRect)

Marks the region of the view within the specified rectangle as needing display, increasing the view's existing invalid region to include it.

A later displayIfNeeded method will then perform drawing only within the invalid region. View objects marked as needing display are automatically redisplayed on each pass through the application's event loop. (View objects that need to redisplay before the event loop comes around can of course immediately be sent the appropriate display method.)

Parameters
invalidRectThe rectangular region of the view to mark as invalid; it should be specified in the coordinate system of the view.

◆ setNeedsLayout() [1/2]

void CeresEngine::UIView::setNeedsLayout ( )

A Boolean value indicating whether the view needs a layout pass before it can be drawn.

You only ever need to change the value of this property if your view implements the layout method. Setting this property to true lets the system know that the view's layout needs to be updated before it is drawn. The system checks the value of this property prior to applying layout rules for the view.

Returns
true if the view needs a layout pass, false otherwise.

◆ setNeedsLayout() [2/2]

void CeresEngine::UIView::setNeedsLayout ( bool  state)

A Boolean value indicating whether the view needs a layout pass before it can be drawn.

You only ever need to change the value of this property if your view implements the layout method. Setting this property to true lets the system know that the view's layout needs to be updated before it is drawn. The system checks the value of this property prior to applying layout rules for the view.

Returns
true if the view needs a layout pass, false otherwise.

◆ setNeedsUpdateConstraints() [1/2]

void CeresEngine::UIView::setNeedsUpdateConstraints ( )

A Boolean value that determines whether the view’s constraints need updating.

The constraint-based layout system uses the return value of this method to determine whether it needs to call updateConstraints on your view as part of its normal layout pass.

When a property of your custom view changes in a way that would impact constraints, you can call this method to indicate that the constraints need to be updated at some point in the future. The system will then call updateConstraints as part of its normal layout pass. Use this as an optimization tool to batch constraint changes. Updating constraints all at once just before they are needed ensures that you don’t needlessly recalculate constraints when multiple changes are made to your view in between layout passes.

Returns
true if the view’s constraints need updating, false otherwise.

◆ setNeedsUpdateConstraints() [2/2]

void CeresEngine::UIView::setNeedsUpdateConstraints ( bool  state)

A Boolean value that determines whether the view’s constraints need updating.

The constraint-based layout system uses the return value of this method to determine whether it needs to call updateConstraints on your view as part of its normal layout pass.

When a property of your custom view changes in a way that would impact constraints, you can call this method to indicate that the constraints need to be updated at some point in the future. The system will then call updateConstraints as part of its normal layout pass. Use this as an optimization tool to batch constraint changes. Updating constraints all at once just before they are needed ensures that you don’t needlessly recalculate constraints when multiple changes are made to your view in between layout passes.

Returns
true if the view’s constraints need updating, false otherwise.

◆ setNextKeyView()

void CeresEngine::UIView::setNextKeyView ( UIView nextKeyView)

The view object that follows the current view in the key view loop.

The value in this property is nullptr if there is no next view in the key view loop. You can assign a view to this property to make that view the next view in the loop. The view in this property should, if possible, be made first responder when the user navigates forward from the view using keyboard interface control.

Returns
The view object that follows the current view in the key view loop.

◆ setOpaque()

void CeresEngine::UIView::setOpaque ( bool  isOpaque)

A Boolean value indicating whether the view fills its frame rectangle with opaque content.

The default value of this property is false to reflect the fact that views do no drawing by default. Subclasses can override this property and return true to indicate that the view completely covers its frame rectangle with opaque content. Doing so can improve performance during drawing operations by eliminating the need to render content behind the view.

◆ setRightLayoutMargin()

void CeresEngine::UIView::setRightLayoutMargin ( double  rightLayoutMargin)

The default spacing to use when laying out content in the view.

This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.

◆ setSubViews()

void CeresEngine::UIView::setSubViews ( const Vector< UIView * > &  subViews)

The list of views embedded in the current view.

This array contains zero or more UIView objects that represent the views embedded in the current view's content. The current view acts as the superview for each subview. The order of the subviews may be considered as being back-to-front, but this does not imply invalidation and drawing behavior.

When performing hit-test operations on a view, you should start at the last view in this array and work backwards.

Set this property to reorder the view's existing subviews, add or remove subviews en masse, replace all of the view's subviews with a new set of subviews, or remove all the view's subviews. When you assign a valid, new array of subviews, the system performs required sorting and calls addSubView() and removeFromSuperview() as necessary to leave the property with the requested new array. Any member of the new array that isn't already a subview of the view is added. Any member of the view's existing subviews array that isn't in the new array is removed. Any views that are in both subviews and the new array are moved in the subviews array as needed, without being removed and re-added.

This property marks the affected view and window areas as needing display.

◆ setSuperView()

void CeresEngine::UIView::setSuperView ( UIView superView)
private

◆ setTintColor()

void CeresEngine::UIView::setTintColor ( const UIColor color)

The first non-default tint color value in the view's hierarchy, ascending from and starting with the view itself.

If the system cannot find a non-default color in the hierarchy, this property's value is a system-defined color instead.

To refresh subview rendering when this property changes, override the tintColorDidChange() method.

◆ setTopLayoutMargin()

void CeresEngine::UIView::setTopLayoutMargin ( double  topLayoutMargin)

Generates a hash for the provided type.

Type must have a std::hash specialization.

Template Parameters
Tthe type to be hashed
Parameters
vThe value to be hashed
Returns
The hashed value

◆ setViewController()

void CeresEngine::UIView::setViewController ( UIViewController viewController)
private

The UIView controller, if any.

Can be nullptr if the view is not attached to a controller.

◆ setVisible()

void CeresEngine::UIView::setVisible ( bool  visible)

A Boolean value indicating whether the view is visible.

◆ setWindow()

void CeresEngine::UIView::setWindow ( UIWindow window)
private

◆ tintColorDidChange()

virtual void CeresEngine::UIView::tintColorDidChange ( )
protectedvirtual

Called by the system when the tintColor property changes.

The system calls this method on a view when your code changes the value of the tintColor property on that view. In addition, the system calls this method on a subview that inherits a changed interaction tint color.

In your implementation, refresh the view rendering as needed.

◆ updateConstraints()

virtual void CeresEngine::UIView::updateConstraints ( )
virtual

Updates constraints for the view.

Override this method to optimize changes to your constraints.

It is almost always cleaner and easier to update a constraint immediately after the affecting change has occurred. For example, if you want to change a constraint in response to a button tap, make that change directly in the button’s action method. You should only override this method when changing constraints in place is too slow, or when a view is producing a number of redundant changes.

To schedule a change, call setNeedsUpdateConstraints on the view. The system then calls your implementation of updateConstraints before the layout occurs. This lets you verify that all necessary constraints for your content are in place at a time when your custom view’s properties are not changing. Your implementation must be as efficient as possible. Do not deactivate all your constraints, then reactivate the ones you need. Instead, your app must have some way of tracking your constraints, and validating them during each update pass. Only change items that need to be changed. During each update pass, you must ensure that you have the appropriate constraints for the app’s current state.

Do not call setNeedsUpdateConstraints inside your implementation. Calling setNeedsUpdateConstraints schedules another update pass, creating a feedback loop.

Call super as the final step in your implementation.

Reimplemented in CeresEngine::UIStackView.

◆ updateConstraintsIfNeeded()

void CeresEngine::UIView::updateConstraintsIfNeeded ( )

Updates the constraints for the receiving view and its subviews.

Whenever a new layout pass is triggered for a view, the system invokes this method to ensure that any constraints for the view and its subviews are updated with information from the current view hierarchy and its constraints. This method is called automatically by the system, but may be invoked manually if you need to examine the most up to date constraints.

◆ updateIntrinsicContentSize()

void CeresEngine::UIView::updateIntrinsicContentSize ( )
protected

◆ updateTransformsIfNeeded()

void CeresEngine::UIView::updateTransformsIfNeeded ( )
private

◆ willDraw()

virtual void CeresEngine::UIView::willDraw ( )
protectedvirtual

Informs the view that it will be required to draw content.

In response to receiving one of the display methods, the view will recurse down the view hierarchy, sending this message to each of the views that may be involved in the display operation.

Subclasses can override this method to move or resize views, mark additional areas as requiring display, or other actions that can best be deferred until they are required for drawing. During the recursion, calling the setNeedsDisplay to views in the hierarchy that are about to be drawn is valid and supported, and will affect the assessment of the total area to be rendered in that drawing pass.

A subclass's implementation of willDraw can use the existing UIView getRectsBeingDrawn method to obtain a list of rectangles that bound the affected area, enabling it to restrict its efforts to that area.

◆ willMoveToSuperView()

virtual void CeresEngine::UIView::willMoveToSuperView ( UIView superView)
protectedvirtual

Informs the view that its superview is about to change to the specified superview (which may be nil).

◆ willMoveToWindow()

virtual void CeresEngine::UIView::willMoveToWindow ( UIWindow window)
protectedvirtual

Informs the view that it's being added to the view hierarchy of the specified window object (which may be nil).

◆ willRemoveSubview()

virtual void CeresEngine::UIView::willRemoveSubview ( UIView view)
protectedvirtual

Overridden by subclasses to perform additional actions before subviews are removed from the view.

Friends And Related Symbol Documentation

◆ UILayoutAnchorVariable

friend class UILayoutAnchorVariable
friend

Member Data Documentation

◆ alternateSelectedControlTextPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::alternateSelectedControlTextPaintProperty
static

The color to use for text in a selected control.

◆ alternatingContentBackgroundColorsProperty

const UIPaintAppearanceProperty CeresEngine::UIView::alternatingContentBackgroundColorsProperty
static

The colors to use for alternating content, typically found in table views and collection views.

◆ bottom

const UILayoutAnchor CeresEngine::UIView::bottom

The bottom of the object's alignment rectangle.

◆ bottomMargin

const UILayoutAnchor CeresEngine::UIView::bottomMargin

The object's bottom margin.

For UIView objects, the margins are defined by their layoutMargins property.

◆ centerX

const UILayoutAnchor CeresEngine::UIView::centerX

The center along the x-axis of the object's alignment rectangle.

◆ centerXWithinMargins

const UILayoutAnchor CeresEngine::UIView::centerXWithinMargins

The center along the x-axis between the object's left and right margin.

For UIView objects, the margins are defined by their layoutMargins property.

◆ centerY

const UILayoutAnchor CeresEngine::UIView::centerY

The center along the y-axis of the object's alignment rectangle.

◆ centerYWithinMargins

const UILayoutAnchor CeresEngine::UIView::centerYWithinMargins

The center along the y-axis between the object's top and bottom margin.

For UIView objects, the margins are defined by their layoutMargins property.

◆ controlAccentPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::controlAccentPaintProperty
static

The user's current accent color preference.

◆ controlBackgroundPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::controlBackgroundPaintProperty
static

The color to use for the background of large controls, such as scroll views or table views.

◆ controlPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::controlPaintProperty
static

The color to use for the flat surfaces of a control.

◆ controlTextPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::controlTextPaintProperty
static

The color to use for text on enabled controls.

◆ currentControlTintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::currentControlTintProperty
static

The current system control tint color.

◆ disabledControlTextPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::disabledControlTextPaintProperty
static

The color to use for text on disabled controls.

◆ findHighlightPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::findHighlightPaintProperty
static

The highlight color to use for the bubble that shows inline search result values.

◆ firstBaseline

const UILayoutAnchor CeresEngine::UIView::firstBaseline

The object's baseline.

For objects with more than one line of text, this is the baseline for the top-most line of text.

◆ fontProperty

const UIFontAppearanceProperty CeresEngine::UIView::fontProperty
static

The default font used by all UI elements.

◆ fontSizeProperty

const UIFloatAppearanceProperty CeresEngine::UIView::fontSizeProperty
static

The default font size used by all UI elements.

◆ gridPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::gridPaintProperty
static

The color to use for the optional gridlines, such as those in a table view.

◆ headerTextPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::headerTextPaintProperty
static

The color to use for text in header cells in table views and outline views.

◆ height

const UILayoutAnchor CeresEngine::UIView::height

The height of the object's alignment rectangle.

◆ highlightPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::highlightPaintProperty
static

The color to use as a virtual light source on the screen.

◆ kDefaultFrame

const UIRect CeresEngine::UIView::kDefaultFrame
static

A rectangle that represents the default frame set by a view without an explicit frame.

◆ keyboardFocusIndicatorPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::keyboardFocusIndicatorPaintProperty
static

The color to use for the keyboard focus ring around controls.

◆ kInvalidViewIndex

const UInt32 CeresEngine::UIView::kInvalidViewIndex
static

Used to indicate that an invalid view index.

◆ kNoInstrinsicMetric

const double CeresEngine::UIView::kNoInstrinsicMetric
static

Used to indicate that a view has no intrinsic metric for a given numeric property.

◆ kNoIntrinsicSize

const UISize CeresEngine::UIView::kNoIntrinsicSize
static

Used to indicate that a view has no intrinsic metric for a given size property.

◆ labelPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::labelPaintProperty
static

The primary color to use for text labels.

◆ lastBaseline

const UILayoutAnchor CeresEngine::UIView::lastBaseline

The object's baseline.

For objects with more than one line of text, this is the baseline for the bottom-most line of text.

◆ left

const UILayoutAnchor CeresEngine::UIView::left

The left side of the object's alignment rectangle.

◆ leftMargin

const UILayoutAnchor CeresEngine::UIView::leftMargin

The object's left margin.

For UIView objects, the margins are defined by their layoutMargins property.

◆ linkPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::linkPaintProperty
static

The color to use for links.

◆ mAppearance

UIAppearancePtr CeresEngine::UIView::mAppearance = nullptr
private

The UI appearance to be used by the view.

The default value for this property is nulltpr, which means that the view uses the appearance it inherits from the nearest ancestor that has set an appearance. When you set appearance to a non-null value, the view and the views it contains use the specified appearance.

◆ mBackgroundColor

UIColor CeresEngine::UIView::mBackgroundColor = UIColor::white
private

The view's background color.

◆ mBounds

UIRect CeresEngine::UIView::mBounds
private

The view's bounds rectangle, which expresses its location and size in its own coordinate system.

◆ mContentScaleFactor

Optional<double> CeresEngine::UIView::mContentScaleFactor = nullopt
private

The scale factor applied to the view.

The scale factor determines how content in the view is mapped from the logical coordinate space (measured in points) to the device coordinate space (measured in pixels). This value is typically either 1.0 or 2.0. Higher scale factors indicate that each point in the view is represented by more than one pixel in the underlying layer. For example, if the scale factor is 2.0 and the view frame size is 50 x 50 points, the size of the bitmap used to present that content is 100 x 100 pixels.

The default value for this property is the scale factor associated with the screen currently displaying the view. If your custom view implements a custom draw method and is associated with a window your view draws at the full resolution of the screen.

In general, you should not need to modify the value in this property. However, if your application draws using very expensive rendering operations, like a scene viewport, you may want to change the scale factor to trade texture quality for rendering performance.

◆ mCornerRadius

UICornerRadius CeresEngine::UIView::mCornerRadius
private

The view's background corner radius.

If a background color is set, will specify the corner radius it should be draw with.

◆ mCustomBounds

bool CeresEngine::UIView::mCustomBounds = false
private

Determines if the view uses a custom bounds rectangle.

If set to true, calls to setFrame() wont update the bounds anymore.

◆ mFlags

◆ mFrame

UIRect CeresEngine::UIView::mFrame
private

The view's frame rectangle, which defines its position and size in its superview's coordinate system.

◆ mIntrinsicContentSize

UISize CeresEngine::UIView::mIntrinsicContentSize
private

The natural size for the receiving view, considering only properties of the view itself.

The default width and height values of this property are set to NSViewNoInstrinsicMetric. For a custom view, you can override this property and use it to communicate what size you would like your view to be based on its content. You might do this in cases where the layout system cannot determine the size of the view based solely on its current constraints. For example, a text field might override this method and return an intrinsic size based on the text it contains. The intrinsic size you supply must be independent of the content frame, because there's no way to dynamically communicate a changed width to the layout system based on a changed height. If your custom view has no intrinsic size for a given dimension, you can set the corresponding dimension to the UIViewNoInstrinsicMetric.

Returns
A size indicating the natural size for the receiving view based on its intrinsic properties.

◆ mInvalidRects

Vector<UIRect> CeresEngine::UIView::mInvalidRects
private

◆ mLayer

UILayerPtr CeresEngine::UIView::mLayer
private

The UI layer that the view uses as its backing store.

Use this property to set or get the layer associated with the view, if any. When set, the layer serves as the backing store for the view’s contents.

◆ mLayoutAnchors

Vector<UILayoutAnchor> CeresEngine::UIView::mLayoutAnchors
private

A vector that contains all anchors for the view.

◆ mLayoutMargins

UIEdgeInsets CeresEngine::UIView::mLayoutMargins
private

The default spacing to use when laying out content in the view.

◆ mLayoutSolver

UPtr<UILayoutSolver> CeresEngine::UIView::mLayoutSolver
private

The layout solver for this view.

◆ mName

String CeresEngine::UIView::mName
private

A human readable string that represents the view.

Used for debugging only.

◆ mNextKeyView

UIView* CeresEngine::UIView::mNextKeyView = nullptr
private

The view object that follows the current view in the key view loop.

◆ mOpaque

bool CeresEngine::UIView::mOpaque = false
private

A Boolean value indicating whether the view fills its frame rectangle with opaque content.

The default value of this property is false to reflect the fact that views do no drawing by default. Subclasses can override this property and return true to indicate that the view completely covers its frame rectangle with opaque content. Doing so can improve performance during drawing operations by eliminating the need to render content behind the view.

◆ mPreviousKeyView

UIView* CeresEngine::UIView::mPreviousKeyView = nullptr
private

The view object preceding the current view in the key view loop.

◆ mRectsBeingDrawn

Vector<UIRect> CeresEngine::UIView::mRectsBeingDrawn
mutableprivate

A cache for getRectsBeingDrawn() the values returned.

◆ mResizingMask

UIViewAutoresizingMask CeresEngine::UIView::mResizingMask = UIViewAutoResizing::Height | UIViewAutoResizing::Width
private

The options that determine how the view is resized relative to its superview.

◆ mSubViews

Vector<UIView*> CeresEngine::UIView::mSubViews
private

A list of children views.

◆ mSuperView

UIView* CeresEngine::UIView::mSuperView = nullptr
private

The parent view.

◆ mTintColor

Optional<UIColor> CeresEngine::UIView::mTintColor = std::nullopt
private

The base color to be used for UI tinting.

◆ mTrackingRects

Vector<UIRect> CeresEngine::UIView::mTrackingRects
private

A list of tracking rectangles.

Tracking rectangles are rectangles that the view will receive mouseMoved, mouseEntered and mouseExited events for.

◆ mTransformFromBacking

AffineTransform CeresEngine::UIView::mTransformFromBacking
private

A 2D transformation matrix that transforms a point from its pixel aligned backing store coordinate system to the view’s interior coordinate system.

◆ mTransformFromWindow

AffineTransform CeresEngine::UIView::mTransformFromWindow
private

A 2D transformation matrix that transforms a point from the window coordinate space into the view coordinate space.

◆ mTransformToBacking

AffineTransform CeresEngine::UIView::mTransformToBacking
private

A 2D transformation matrix that transforms a point from the view’s interior coordinate system to its pixel aligned backing store coordinate system.

◆ mTransformToWindow

AffineTransform CeresEngine::UIView::mTransformToWindow
private

A 2D transformation matrix that transforms a point from the view coordinate space into the window coordinate space.

◆ mViewController

UIViewController* CeresEngine::UIView::mViewController = nullptr
private

The UIView controller, if any.

Can be nullptr if the view is not attached to a controller.

◆ mWindow

UIWindow* CeresEngine::UIView::mWindow = nullptr
private

The window this UIView is attached to.

◆ placeholderTextPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::placeholderTextPaintProperty
static

The color to use for placeholder text in controls or text views.

◆ quaternaryLabelPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::quaternaryLabelPaintProperty
static

The quaternary color to use for text labels and separators.

◆ right

const UILayoutAnchor CeresEngine::UIView::right

The right side of the object's alignment rectangle.

◆ rightMargin

const UILayoutAnchor CeresEngine::UIView::rightMargin

The object's right margin.

For UIView objects, the margins are defined by their layoutMargins property.

◆ scrubberTexturedBackgroundPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::scrubberTexturedBackgroundPaintProperty
static

The patterned color to use for the background of a scrubber control.

◆ secondaryLabelPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::secondaryLabelPaintProperty
static

The secondary color to use for text labels.

◆ selectedContentBackgroundPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::selectedContentBackgroundPaintProperty
static

The color to use for the background of selected and emphasized content.

◆ selectedControlPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::selectedControlPaintProperty
static

The color to use for the face of a selected control—that is, a control that has been clicked or is being dragged.

◆ selectedControlTextPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::selectedControlTextPaintProperty
static

The color to use for text in a selected control—that is, a control being clicked or dragged.

◆ selectedMenuItemTextPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::selectedMenuItemTextPaintProperty
static

The color to use for the text in menu items.

◆ selectedTextBackgroundPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::selectedTextBackgroundPaintProperty
static

The color to use for the background of selected text.

◆ selectedTextPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::selectedTextPaintProperty
static

The color to use for selected text.

◆ separatorPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::separatorPaintProperty
static

The color to use for separators between different sections of content.

◆ shadowPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::shadowPaintProperty
static

The color to use for virtual shadows cast by raised objects on the screen.

◆ tertiaryLabelPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::tertiaryLabelPaintProperty
static

The tertiary color to use for text labels.

◆ textBackgroundPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::textBackgroundPaintProperty
static

The color to use for the background area behind text.

◆ textPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::textPaintProperty
static

The color to use for text.

◆ tintColorProperty

const UIColorAppearanceProperty CeresEngine::UIView::tintColorProperty
static

Determines the default value for the tintColor property if not overridden by the view.

◆ top

const UILayoutAnchor CeresEngine::UIView::top

The top of the object's alignment rectangle.

◆ topMargin

const UILayoutAnchor CeresEngine::UIView::topMargin

The object's top margin.

For UIView objects, the margins are defined by their layoutMargins property.

◆ UIViewController

friend CeresEngine::UIView::UIViewController
private

◆ UIWindow

friend CeresEngine::UIView::UIWindow
private

◆ underPageBackgroundPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::underPageBackgroundPaintProperty
static

The color to use in the area beneath your window's views.

◆ unemphasizedSelectedContentBackgroundPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::unemphasizedSelectedContentBackgroundPaintProperty
static

The color to use for selected and unemphasized content.

◆ unemphasizedSelectedTextBackgroundPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::unemphasizedSelectedTextBackgroundPaintProperty
static

The color to use for the text background in an unemphasized context.

◆ unemphasizedSelectedTextPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::unemphasizedSelectedTextPaintProperty
static

The color to use for selected text in an unemphasized context.

◆ width

const UILayoutAnchor CeresEngine::UIView::width

The width of the object's alignment rectangle.

◆ windowBackgroundPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::windowBackgroundPaintProperty
static

The color to use for the window background.

◆ windowFrameTextPaintProperty

const UIPaintAppearanceProperty CeresEngine::UIView::windowFrameTextPaintProperty
static

The color to use for text in a window's frame.


The documentation for this class was generated from the following file: