|
ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
|
Views are the fundamental building blocks of ObjectivelyMVC user interfaces. More...
#include <Objectively/Data.h>#include <Objectively/Enum.h>#include <Objectively/Dictionary.h>#include <Objectively/Array.h>#include <Objectively/Set.h>#include <Objectively/Resource.h>#include <ObjectivelyMVC/Colors.h>#include <ObjectivelyMVC/Renderer.h>#include <ObjectivelyMVC/Theme.h>#include <ObjectivelyMVC/View+JSON.h>#include <ObjectivelyMVC/Warning.h>Go to the source code of this file.
Data Structures | |
| struct | View |
| Views are the fundamental building blocks of ObjectivelyMVC user interfaces. More... | |
| struct | ViewConstraint |
| A constraint offered by an ancestor View to a descendant during View::sizeThatSatisfies. More... | |
| struct | ViewCornerCut |
| The horizontal inset of each of a View's corners. More... | |
| struct | ViewPadding |
| Spacing applied to the inside of a View's frame. More... | |
Macros | |
| #define | AddPadding(a, b) MakePadding(a.top + b.top, a.right + b.right, a.bottom + b.bottom, a.left + b.left) |
| #define | ClampSize(size, min, max) clamp((size), (min), (max) ? (max) : INT32_MAX) |
Clamps size to min and max, where a max of zero is unbounded. | |
| #define | CornerCutIsEmpty(cut) ((cut).topLeft == 0 && (cut).topRight == 0 && (cut).bottomRight == 0 && (cut).bottomLeft == 0) |
| #define | MakeConstraint(mode, value) (ViewConstraint) { (mode), (value) } |
| #define | MakeCornerCut(topLeft, topRight, bottomRight, bottomLeft) (ViewCornerCut) { (topLeft), (topRight), (bottomRight), (bottomLeft) } |
| Creates a ViewCornerCut with the given insets. | |
| #define | MakePadding(top, right, bottom, left) (ViewPadding) { (top), (right), (bottom), (left) } |
| Creates a ViewPadding with the given dimensions. | |
| #define | ViewAlignmentMaskAny (ViewAlignmentMaskHorizontal | ViewAlignmentMaskVertical) |
| #define | ViewAlignmentMaskBottom 0x4 |
| #define | ViewAlignmentMaskCenter 0x10 |
| #define | ViewAlignmentMaskHorizontal (ViewAlignmentMaskLeft | ViewAlignmentMaskCenter | ViewAlignmentMaskRight) |
| #define | ViewAlignmentMaskInternal 0x100 |
| #define | ViewAlignmentMaskLeft 0x8 |
| #define | ViewAlignmentMaskMiddle 0x2 |
| #define | ViewAlignmentMaskRight 0x20 |
| #define | ViewAlignmentMaskTop 0x1 |
| #define | ViewAlignmentMaskVertical (ViewAlignmentMaskTop | ViewAlignmentMaskMiddle | ViewAlignmentMaskBottom) |
Enumerations | |
| enum | ViewAlignment { ViewAlignmentNone , ViewAlignmentTop = ViewAlignmentMaskTop , ViewAlignmentMiddle = ViewAlignmentMaskMiddle , ViewAlignmentBottom = ViewAlignmentMaskBottom , ViewAlignmentLeft = ViewAlignmentMaskLeft , ViewAlignmentCenter = ViewAlignmentMaskCenter , ViewAlignmentRight = ViewAlignmentMaskRight , ViewAlignmentTopLeft = (ViewAlignmentMaskTop | ViewAlignmentMaskLeft) , ViewAlignmentTopCenter = (ViewAlignmentMaskTop | ViewAlignmentMaskCenter) , ViewAlignmentTopRight = (ViewAlignmentMaskTop | ViewAlignmentMaskRight) , ViewAlignmentMiddleLeft = (ViewAlignmentMaskMiddle | ViewAlignmentMaskLeft) , ViewAlignmentMiddleCenter = (ViewAlignmentMaskMiddle | ViewAlignmentMaskCenter) , ViewAlignmentMiddleRight = (ViewAlignmentMaskMiddle | ViewAlignmentMaskRight) , ViewAlignmentBottomLeft = (ViewAlignmentMaskBottom | ViewAlignmentMaskLeft) , ViewAlignmentBottomCenter = (ViewAlignmentMaskBottom | ViewAlignmentMaskCenter) , ViewAlignmentBottomRight = (ViewAlignmentMaskBottom | ViewAlignmentMaskRight) , ViewAlignmentInternal = ViewAlignmentMaskInternal } |
| Alignment constants, used to align a View within its superview. More... | |
| enum | ViewAutoresizing { ViewAutoresizingNone = 0 , ViewAutoresizingWidth = 0x1 , ViewAutoresizingHeight = 0x2 , ViewAutoresizingFill = 0x3 , ViewAutoresizingFit = 0x4 , ViewAutoresizingContain = 0x8 } |
| Auto-resizing constants, which are bitmasked. More... | |
| enum | ViewPointerEvents { ViewPointerEventsAuto , ViewPointerEventsNone } |
| Whether a View is the result of a hit test. More... | |
| enum | ViewPosition { ViewPositionBefore = -1 , ViewPositionAfter = 1 } |
| Relative positioning of subviews within their superview. More... | |
| enum | ViewVisibility { ViewVisibilityUnspecified , ViewVisibilityVisible , ViewVisibilityHidden } |
| Visibility constants. More... | |
Functions | |
| OBJECTIVELYMVC_EXPORT Class * | _View (void) |
| OBJECTIVELYMVC_EXPORT void | MVC_InvalidateRenderFrames (void) |
| Invalidates every View's cached View::renderFrame and View::clippingFrame. | |
Variables | |
| OBJECTIVELYMVC_EXPORT const EnumName | ViewAlignmentNames [] |
| OBJECTIVELYMVC_EXPORT const EnumName | ViewAutoresizingNames [] |
| OBJECTIVELYMVC_EXPORT const EnumName | ViewPointerEventsNames [] |
| OBJECTIVELYMVC_EXPORT const EnumName | ViewVisibilityNames [] |
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
Definition in file View.h.
| #define AddPadding | ( | a, | |
| b | |||
| ) | MakePadding(a.top + b.top, a.right + b.right, a.bottom + b.bottom, a.left + b.left) |
a and b. Definition at line 182 of file View.h.
| #define CornerCutIsEmpty | ( | cut | ) | ((cut).topLeft == 0 && (cut).topRight == 0 && (cut).bottomRight == 0 && (cut).bottomLeft == 0) |
| #define MakeConstraint | ( | mode, | |
| value | |||
| ) | (ViewConstraint) { (mode), (value) } |
Definition at line 163 of file View.h.
| #define MakeCornerCut | ( | topLeft, | |
| topRight, | |||
| bottomRight, | |||
| bottomLeft | |||
| ) | (ViewCornerCut) { (topLeft), (topRight), (bottomRight), (bottomLeft) } |
Creates a ViewCornerCut with the given insets.
Definition at line 198 of file View.h.
| #define MakePadding | ( | top, | |
| right, | |||
| bottom, | |||
| left | |||
| ) | (ViewPadding) { (top), (right), (bottom), (left) } |
Creates a ViewPadding with the given dimensions.
Definition at line 176 of file View.h.
| #define ViewAlignmentMaskAny (ViewAlignmentMaskHorizontal | ViewAlignmentMaskVertical) |
| #define ViewAlignmentMaskHorizontal (ViewAlignmentMaskLeft | ViewAlignmentMaskCenter | ViewAlignmentMaskRight) |
| #define ViewAlignmentMaskVertical (ViewAlignmentMaskTop | ViewAlignmentMaskMiddle | ViewAlignmentMaskBottom) |
| enum ViewAlignment |
Alignment constants, used to align a View within its superview.
Definition at line 64 of file View.h.
| enum ViewAutoresizing |
Auto-resizing constants, which are bitmasked.
| Enumerator | |
|---|---|
| ViewAutoresizingNone | |
| ViewAutoresizingWidth | |
| ViewAutoresizingHeight | |
| ViewAutoresizingFill | |
| ViewAutoresizingFit | |
| ViewAutoresizingContain | |
Definition at line 89 of file View.h.
| enum ViewPointerEvents |
Whether a View is the result of a hit test.
| Enumerator | |
|---|---|
| ViewPointerEventsAuto | |
| ViewPointerEventsNone | |
Definition at line 109 of file View.h.
| enum ViewPosition |
| enum ViewVisibility |
Visibility constants.
| Enumerator | |
|---|---|
| ViewVisibilityUnspecified | |
| ViewVisibilityVisible | |
| ViewVisibilityHidden | |
Definition at line 119 of file View.h.
| OBJECTIVELYMVC_EXPORT Class * _View | ( | void | ) |
Definition at line 2336 of file View.c.
| OBJECTIVELYMVC_EXPORT void MVC_InvalidateRenderFrames | ( | void | ) |
Invalidates every View's cached View::renderFrame and View::clippingFrame.
WindowController::renderTo invokes this after layout, before drawing, so that drawing and subsequent hit-testing observe post-layout frames; both methods memoize their result until the next invocation. Callers that mutate View frames outside of a layout pass MUST invoke this afterwards if hit-testing precision is required before the next render.
Definition at line 46 of file View.c.
| OBJECTIVELYMVC_EXPORT const EnumName ViewAlignmentNames[] |
| OBJECTIVELYMVC_EXPORT const EnumName ViewAutoresizingNames[] |
| OBJECTIVELYMVC_EXPORT const EnumName ViewPointerEventsNames[] |
| OBJECTIVELYMVC_EXPORT const EnumName ViewVisibilityNames[] |