ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
Loading...
Searching...
No Matches
View.h File Reference

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 []
 

Detailed Description

Views are the fundamental building blocks of ObjectivelyMVC user interfaces.

Definition in file View.h.

Macro Definition Documentation

◆ AddPadding

#define AddPadding (   a,
  b 
)     MakePadding(a.top + b.top, a.right + b.right, a.bottom + b.bottom, a.left + b.left)
Returns
A ViewPadding that is the sum of a and b.

Definition at line 182 of file View.h.

190 {
191 int topLeft, topRight, bottomRight, bottomLeft;
193
197#define MakeCornerCut(topLeft, topRight, bottomRight, bottomLeft) \
198 (ViewCornerCut) { (topLeft), (topRight), (bottomRight), (bottomLeft) }
199
203#define CornerCutIsEmpty(cut) \
204 ((cut).topLeft == 0 && (cut).topRight == 0 && (cut).bottomRight == 0 && (cut).bottomLeft == 0)
205
209typedef enum {
213
214typedef struct ViewInterface ViewInterface;
215
224struct View {
225
229 Object object;
230
235 ViewInterface *interface[0];
236
242
248
253 SDL_Color backgroundColor;
254
261
268 SDL_Color backgroundGradientColor;
269
274 SDL_Color borderColor;
275
280 int borderRadius;
281
286 int borderWidth;
287
292 Set *classNames;
293
299 struct {
300 SDL_Rect frame;
301 unsigned generation;
302 } clippingFrameCache;
303
308 bool clipsSubviews;
309
314
322
326 SDL_Rect frame;
327
332 char *identifier;
333
338 SDL_Size maxSize;
339
344 SDL_Size minSize;
345
352 bool needsApplyTheme;
353
361 bool needsApplyStyle;
362
369 bool needsApplyThemeSubviews;
370
376 bool needsLayout;
377
384 bool needsLayoutSubviews;
385
392
398
408
414 struct {
415 SDL_Rect frame;
416 unsigned generation;
417 } renderFrameCache;
418
424 Style *style;
425
435 bool stretch;
436
443
447 Array *subviews;
448
454
460
468
473 Array *warnings;
474
479 SDL_Window *window;
480};
481
485struct ViewInterface {
486
490 ObjectInterface parentInterface;
491
498 bool (*acceptsKeyResponder)(const View *self);
499
506 bool (*acceptsTouchResponder)(const View *self);
507
515 void (*addClassName)(View *self, const char *className);
516
525 void (*addSubview)(View *self, View *subview);
526
536 void (*addSubviewRelativeTo)(View *self, View *subview, View *other, ViewPosition position);
537
545 View *(*ancestorWithIdentifier)(const View *self, const char *identifier);
546
554 void (*applyStyle)(View *self, const Style *style);
555
563 void (*applyTheme)(View *self, const Theme *theme);
564
572 void (*applyThemeIfNeeded)(View *self, const Theme *theme);
573
581 void (*attachStylesheet)(View *self, SDL_Window *window);
582
591 void (*awakeWithCharacters)(View *self, const char *chars);
592
601 void (*awakeWithData)(View *self, const Data *data);
602
612 void (*awakeWithDictionary)(View *self, const Dictionary *dictionary);
613
621 void (*awakeWithResource)(View *self, const Resource *resource);
622
630 void (*awakeWithResourceName)(View *self, const char *name);
631
639 void (*becomeKeyResponder)(View *self);
640
648 void (*becomeTouchResponder)(View *self);
649
660 bool (*bind)(View *self, const Inlet *inlets, const Dictionary *dictionary);
661
668 SDL_Rect (*bounds)(const View *self);
669
677 void (*bringSubviewToFront)(View *self, View *subview);
678
686 void (*clearWarnings)(const View *self, WarningType level);
687
696 SDL_Rect (*clippingFrame)(const View *self);
697
705 bool (*containsPoint)(const View *self, const SDL_Point *point);
706
713 int (*depth)(const View *self);
714
722 View *(*descendantWithIdentifier)(const View *self, const char *identifier);
723
731 void (*detachStylesheet)(View *self, SDL_Window *window);
732
740 void (*didMoveToWindow)(View *self, SDL_Window *window);
741
749 bool (*didReceiveEvent)(const View *self, const SDL_Event *event);
750
761 void (*draw)(View *self, Renderer *renderer);
762
773 void (*emitViewEvent)(View *self, ViewEvent code, ident data);
774
783 void (*enumerate)(View *self, ViewEnumerator enumerator, ident data);
784
793 void (*enumerateAdjacent)(const View *self, ViewEnumerator enumerator, ident data);
794
803 void (*enumerateAncestors)(const View *self, ViewEnumerator enumerator, ident data);
804
813 void (*enumerateDescendants)(const View *self, ViewEnumerator enumerator, ident data);
814
824 void (*enumerateSelection)(View *self, const char *rule, ViewEnumerator enumerator, ident data);
825
834 void (*enumerateSiblings)(const View *self, ViewEnumerator enumerator, ident data);
835
844 void (*enumerateSubviews)(const View *self, ViewEnumerator enumerator, ident data);
845
854 void (*enumerateSuperview)(const View *self, ViewEnumerator enumerator, ident data);
855
865 void (*enumerateVisible)(View *self, ViewEnumerator enumerator, ident data);
866
874 bool (*hasClassName)(const View *self, const char *className);
875
882 bool (*hasOverflow)(const View *self);
883
894 View *(*hitTest)(const View *self, const SDL_Point *point);
895
906 View *(*init)(View *self);
907
917 View *(*initWithFrame)(View *self, const SDL_Rect *frame);
918
925 void (*invalidateStyle)(View *self);
926
933 bool (*isContainer)(const View *self);
934
942 bool (*isDescendantOfView)(const View *self, const View *view);
943
950 bool (*isKeyResponder)(const View *self);
951
958 bool (*isTouchResponder)(const View *self);
959
966 bool (*isVisible)(const View *self);
967
978 void (*layoutIfNeeded)(View *self);
979
990 void (*layoutSubviews)(View *self);
991
1003 void (*layoutWithConstraint)(View *self, ViewConstraint width, ViewConstraint height);
1004
1016 void (*layoutWithSize)(View *self, const SDL_Size *size);
1017
1025 bool (*matchesSelector)(const View *self, const SimpleSelector *simpleSelector);
1026
1034 void (*moveToWindow)(View *self, SDL_Window *window);
1035
1042 String *(*path)(const View *self);
1043
1050 void (*removeAllClassNames)(View *self);
1051
1058 void (*removeAllSubviews)(View *self);
1059
1067 void (*removeClassName)(View *self, const char *className);
1068
1075 void (*removeFromSuperview)(View *self);
1076
1084 void (*removeSubview)(View *self, View *subview);
1085
1095 void (*render)(View *self, Renderer *renderer);
1096
1104 void (*renderDeviceDidReset)(View *self);
1105
1113 void (*renderDeviceWillReset)(View *self);
1114
1121 SDL_Rect (*renderFrame)(const View *self);
1122
1131 void (*replaceSubview)(View *self, View *subview, View *replacement);
1132
1139 void (*resignKeyResponder)(View *self);
1140
1147 void (*resignTouchResponder)(View *self);
1148
1158 void (*resize)(View *self, const SDL_Size *size);
1159
1167 void (*resolve)(View *self, Outlet *outlets);
1168
1176 void (*respondToEvent)(View *self, const SDL_Event *event);
1177
1186 Set *(*select)(View *self, const char *rule);
1187
1196 View *(*selectFirst)(View *self, const char *rule);
1197
1208 void (*setVisibility)(View *self, ViewVisibility visibility);
1209
1219 void (*setNeedsApplyTheme)(View *self);
1220
1230 void (*setNeedsLayout)(View *self);
1231
1238 SDL_Size (*size)(const View *self);
1239
1247 SDL_Size (*sizeThatContains)(const View *self);
1248
1259 SDL_Size (*sizeThatFits)(const View *self);
1260
1267 SDL_Size (*sizeThatFills)(const View *self);
1268
1280 SDL_Size (*sizeThatSatisfies)(View *self, ViewConstraint width, ViewConstraint height);
1281
1289 void (*sizeToContain)(View *self);
1290
1298 void (*sizeToFill)(View *self);
1299
1307 void (*sizeToFit)(View *self);
1308
1318 void (*sizeToSatisfy)(View *self, ViewConstraint width, ViewConstraint height);
1319
1327 View *(*subviewWithIdentifier)(const View *self, const char *identifier);
1328
1345 void (*updateBindings)(View *self, ident data);
1346
1353 SDL_Rect (*viewport)(const View *self);
1354
1364 View *(*viewWithCharacters)(const char *chars, Outlet *outlets);
1365
1375 View *(*viewWithData)(const Data *data, Outlet *outlets);
1376
1387 View *(*viewWithDictionary)(const Dictionary *dictionary, Outlet *outlets);
1388
1399 View *(*viewWithResource)(const Resource *resource, Outlet *outlets);
1400
1411 View *(*viewWithResourceName)(const char *name, Outlet *outlets);
1412
1420 Array *(*visibleSubviews)(const View *self);
1421
1430 void (*warn)(View *self, WarningType level, const char *fmt, ...);
1431
1439 void (*willMoveToWindow)(View *self, SDL_Window *window);
1440};
1441
1448OBJECTIVELYMVC_EXPORT Class *_View(void);
1449
static String * name(const Font *self)
Definition Font.c:303
static Theme * theme(SDL_Window *window)
Definition Theme.c:295
ViewEvent
View event relay codes.
Definition Types.h:61
void(* ViewEnumerator)(View *view, ident data)
A function type for View enumeration.
Definition Types.h:56
#define OBJECTIVELYMVC_EXPORT
Definition Types.h:40
ViewPointerEvents
Whether a View is the result of a hit test.
Definition View.h:109
OBJECTIVELYMVC_EXPORT Class * _View(void)
Definition View.c:2336
OBJECTIVELYMVC_EXPORT void MVC_InvalidateRenderFrames(void)
Invalidates every View's cached View::renderFrame and View::clippingFrame.
Definition View.c:46
ViewVisibility
Visibility constants.
Definition View.h:119
ViewPosition
Relative positioning of subviews within their superview.
Definition View.h:210
@ ViewPositionBefore
Definition View.h:211
@ ViewPositionAfter
Definition View.h:212
ViewAlignment
Alignment constants, used to align a View within its superview.
Definition View.h:64
WarningType
Warning types.
Definition Warning.h:33
Inlets enable inbound data binding of View attributes through JSON.
Definition View+JSON.h:149
Outlets enable outbound data binding of Views through JSON.
Definition View+JSON.h:194
Renderer extends Object with ObjectivelyMVC's UI rendering layer.
Definition Renderer.h:75
The SimpleSelector type.
The Style type.
Definition Style.h:43
Stylesheets are comprised of Selectors and Styles.
Definition Stylesheet.h:44
The Theme type.
Definition Theme.h:54
A constraint offered by an ancestor View to a descendant during View::sizeThatSatisfies.
Definition View.h:131
A ViewController manages a View and its descendants.
The horizontal inset of each of a View's corners.
Definition View.h:191
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
Definition View.h:225
Stylesheet * stylesheet
An optional Stylesheet.
Definition View.h:443
bool clipsSubviews
If true, subviews will be clipped to this View's frame.
Definition View.h:309
View * superview
The super View.
Definition View.h:454
Array * subviews
The immediate subviews.
Definition View.h:448
unsigned generation
Definition View.h:302
ViewController * viewController
The ViewController.
Definition View.h:460
Style * style
The element-level Style of this View.
Definition View.h:425
ViewAlignment alignment
The alignment.
Definition View.h:242
SDL_Window * window
The window.
Definition View.h:480
bool needsApplyTheme
If true, this View will apply the Theme before it is drawn.
Definition View.h:353
ViewCornerCut cornerCut
The horizontal inset of each corner of the background and border.
Definition View.h:322
SDL_Color borderColor
The border color.
Definition View.h:275
int autoresizingMask
The ViewAutoresizing bitmask.
Definition View.h:248
View * nextResponder
The next responder, or event handler, in the chain.
Definition View.h:392
ViewPointerEvents pointerEvents
Whether this View is the result of a hit test; its subviews always are.
Definition View.h:408
bool needsLayout
If true, this View will layout its subviews before it is drawn.
Definition View.h:377
char * identifier
An optional identifier.
Definition View.h:333
Array * warnings
The Warnings this View generated.
Definition View.h:474
ViewPadding padding
The padding.
Definition View.h:398
int borderWidth
The border width.
Definition View.h:287
SDL_Size minSize
The minimum size this View may be resized to during layout.
Definition View.h:345
int backgroundGradientAngle
The angle of the background gradient, in degrees, clockwise from south: 0 (the default) fills downwar...
Definition View.h:261
Object object
The superclass.
Definition View.h:230
Style * computedStyle
The computed Style of this View.
Definition View.h:314
Set * classNames
The class names.
Definition View.h:293
ViewVisibility visibility
Whether this View is drawn, and contributes to its superview's size.
Definition View.h:468
int borderRadius
The corner radius applied to the background, border and bevel.
Definition View.h:281
SDL_Color backgroundGradientColor
The far color of the background gradient, which runs from View::backgroundColor.
Definition View.h:269
SDL_Size maxSize
The maximum size this View may be resized to during layout.
Definition View.h:339
SDL_Color backgroundColor
The background color.
Definition View.h:254
bool stretch
Whether this View takes a share of the space its StackView leaves along its axis.
Definition View.h:436
SDL_Rect frame
The frame, relative to the superview.
Definition View.h:301
ViewInterface * interface[0]
The interface type.
Definition View.h:236
Spacing applied to the inside of a View's frame.
Definition View.h:169

◆ ClampSize

#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.

Definition at line 103 of file View.h.

104 : INT32_MAX)

◆ CornerCutIsEmpty

#define CornerCutIsEmpty (   cut)     ((cut).topLeft == 0 && (cut).topRight == 0 && (cut).bottomRight == 0 && (cut).bottomLeft == 0)
Returns
True if cut insets no corner.

Definition at line 204 of file View.h.

◆ MakeConstraint

#define MakeConstraint (   mode,
  value 
)     (ViewConstraint) { (mode), (value) }
Returns
A ViewConstraint with the given mode and value.

Definition at line 163 of file View.h.

164 { (mode), (value) }

◆ MakeCornerCut

#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.

199 { (topLeft), (topRight), (bottomRight), (bottomLeft) }

◆ MakePadding

#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.

177 { (top), (right), (bottom), (left) }

◆ ViewAlignmentMaskAny

#define ViewAlignmentMaskAny    (ViewAlignmentMaskHorizontal | ViewAlignmentMaskVertical)

Definition at line 58 of file View.h.

◆ ViewAlignmentMaskBottom

#define ViewAlignmentMaskBottom   0x4

Definition at line 46 of file View.h.

◆ ViewAlignmentMaskCenter

#define ViewAlignmentMaskCenter   0x10

Definition at line 48 of file View.h.

◆ ViewAlignmentMaskHorizontal

#define ViewAlignmentMaskHorizontal    (ViewAlignmentMaskLeft | ViewAlignmentMaskCenter | ViewAlignmentMaskRight)

Definition at line 55 of file View.h.

◆ ViewAlignmentMaskInternal

#define ViewAlignmentMaskInternal   0x100

Definition at line 50 of file View.h.

◆ ViewAlignmentMaskLeft

#define ViewAlignmentMaskLeft   0x8

Definition at line 47 of file View.h.

◆ ViewAlignmentMaskMiddle

#define ViewAlignmentMaskMiddle   0x2

Definition at line 45 of file View.h.

◆ ViewAlignmentMaskRight

#define ViewAlignmentMaskRight   0x20

Definition at line 49 of file View.h.

◆ ViewAlignmentMaskTop

#define ViewAlignmentMaskTop   0x1

Definition at line 44 of file View.h.

◆ ViewAlignmentMaskVertical

#define ViewAlignmentMaskVertical    (ViewAlignmentMaskTop | ViewAlignmentMaskMiddle | ViewAlignmentMaskBottom)

Definition at line 52 of file View.h.

Enumeration Type Documentation

◆ ViewAlignment

Alignment constants, used to align a View within its superview.

Enumerator
ViewAlignmentNone 
ViewAlignmentTop 
ViewAlignmentMiddle 
ViewAlignmentBottom 
ViewAlignmentLeft 
ViewAlignmentCenter 
ViewAlignmentRight 
ViewAlignmentTopLeft 
ViewAlignmentTopCenter 
ViewAlignmentTopRight 
ViewAlignmentMiddleLeft 
ViewAlignmentMiddleCenter 
ViewAlignmentMiddleRight 
ViewAlignmentBottomLeft 
ViewAlignmentBottomCenter 
ViewAlignmentBottomRight 
ViewAlignmentInternal 

Definition at line 64 of file View.h.

64 {
#define ViewAlignmentMaskInternal
Definition View.h:50
#define ViewAlignmentMaskCenter
Definition View.h:48
#define ViewAlignmentMaskLeft
Definition View.h:47
#define ViewAlignmentMaskBottom
Definition View.h:46
#define ViewAlignmentMaskTop
Definition View.h:44
#define ViewAlignmentMaskRight
Definition View.h:49
#define ViewAlignmentMaskMiddle
Definition View.h:45
@ ViewAlignmentBottomRight
Definition View.h:80
@ ViewAlignmentBottomLeft
Definition View.h:78
@ ViewAlignmentMiddleCenter
Definition View.h:76
@ ViewAlignmentInternal
Definition View.h:81
@ ViewAlignmentTopCenter
Definition View.h:73
@ ViewAlignmentTopRight
Definition View.h:74
@ ViewAlignmentMiddleRight
Definition View.h:77
@ ViewAlignmentTopLeft
Definition View.h:72
@ ViewAlignmentCenter
Definition View.h:70
@ ViewAlignmentLeft
Definition View.h:69
@ ViewAlignmentRight
Definition View.h:71
@ ViewAlignmentTop
Definition View.h:66
@ ViewAlignmentMiddleLeft
Definition View.h:75
@ ViewAlignmentBottom
Definition View.h:68
@ ViewAlignmentMiddle
Definition View.h:67
@ ViewAlignmentBottomCenter
Definition View.h:79
@ ViewAlignmentNone
Definition View.h:65

◆ ViewAutoresizing

Auto-resizing constants, which are bitmasked.

Enumerator
ViewAutoresizingNone 
ViewAutoresizingWidth 
ViewAutoresizingHeight 
ViewAutoresizingFill 
ViewAutoresizingFit 
ViewAutoresizingContain 

Definition at line 89 of file View.h.

89 {
ViewAutoresizing
Auto-resizing constants, which are bitmasked.
Definition View.h:89
@ ViewAutoresizingNone
Definition View.h:90
@ ViewAutoresizingFill
Definition View.h:93
@ ViewAutoresizingContain
Definition View.h:95
@ ViewAutoresizingWidth
Definition View.h:91
@ ViewAutoresizingHeight
Definition View.h:92
@ ViewAutoresizingFit
Definition View.h:94

◆ ViewPointerEvents

Whether a View is the result of a hit test.

Enumerator
ViewPointerEventsAuto 
ViewPointerEventsNone 

Definition at line 109 of file View.h.

109 {
@ ViewPointerEventsNone
Definition View.h:111
@ ViewPointerEventsAuto
Definition View.h:110

◆ ViewPosition

Relative positioning of subviews within their superview.

Enumerator
ViewPositionBefore 
ViewPositionAfter 

Definition at line 210 of file View.h.

210 {

◆ ViewVisibility

Visibility constants.

Enumerator
ViewVisibilityUnspecified 
ViewVisibilityVisible 
ViewVisibilityHidden 

Definition at line 119 of file View.h.

119 {
@ ViewVisibilityUnspecified
Definition View.h:120
@ ViewVisibilityVisible
Definition View.h:121
@ ViewVisibilityHidden
Definition View.h:122

Function Documentation

◆ _View()

OBJECTIVELYMVC_EXPORT Class * _View ( void  )

Definition at line 2336 of file View.c.

2336 {
2337 static Class *clazz;
2338 static Once once;
2339
2340 do_once(&once, {
2341 clazz = _initialize(&(const ClassDef) {
2342 .name = "View",
2343 .superclass = _Object(),
2344 .instanceSize = sizeof(View),
2345 .interfaceSize = sizeof(ViewInterface),
2346 .initialize = initialize,
2347 });
2348 });
2349
2350 return clazz;
2351}
static void initialize(Class *clazz)
Definition View.c:2222

◆ MVC_InvalidateRenderFrames()

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.

46 {
47 if (++_renderFrameGeneration == 0) {
49 }
50}
static unsigned _renderFrameGeneration
The render frame generation; per-View renderFrame and clippingFrame caches are valid only while their...
Definition View.c:44

Variable Documentation

◆ ViewAlignmentNames

OBJECTIVELYMVC_EXPORT const EnumName ViewAlignmentNames[]

Definition at line 84 of file View.h.

◆ ViewAutoresizingNames

OBJECTIVELYMVC_EXPORT const EnumName ViewAutoresizingNames[]

Definition at line 98 of file View.h.

◆ ViewPointerEventsNames

OBJECTIVELYMVC_EXPORT const EnumName ViewPointerEventsNames[]

Definition at line 114 of file View.h.

◆ ViewVisibilityNames

OBJECTIVELYMVC_EXPORT const EnumName ViewVisibilityNames[]

Definition at line 126 of file View.h.