#include <assert.h>
#include "Box.h"
Go to the source code of this file.
◆ _Class
Definition at line 28 of file Box.c.
◆ _Box()
Definition at line 138 of file Box.c.
138 {
139 static Class *clazz;
140 static Once once;
141
142 do_once(&once, {
143 clazz = _initialize(&(const ClassDef) {
144 .name = "Box",
145 .superclass =
_View(),
146 .instanceSize =
sizeof(
Box),
147 .interfaceOffset = offsetof(
Box, interface),
148 .interfaceSize = sizeof(BoxInterface),
150 });
151 });
152
153 return clazz;
154}
static void initialize(Class *clazz)
A container View with a positioned Label.
Class * _View(void)
The View archetype.
◆ awakeWithDictionary()
static void awakeWithDictionary |
( |
View * |
self, |
|
|
const Dictionary * |
dictionary |
|
) |
| |
|
static |
- See also
- View::awakeWithDictionar(View *, const Dictionary *)
Definition at line 50 of file Box.c.
50 {
51
53
55
59 );
60
61 $(self,
bind, inlets, dictionary);
62}
#define MakeInlets(...)
Creates a null-termianted array of Inlets.
#define MakeInlet(name, type, dest, data)
Creates an Inlet with the specified parameters.
Inlets enable inbound data binding of View attributes through JSON.
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
_Bool bind(View *self, const Inlet *inlets, const Dictionary *dictionary)
Performs data binding for the Inlets described in dictionary.
void awakeWithDictionary(View *self, const Dictionary *dictionary)
Wakes this View with the specified Dictionary.
◆ dealloc()
static void dealloc |
( |
Object * |
self | ) |
|
|
static |
- See also
- Object::dealloc(Object *)
Definition at line 35 of file Box.c.
35 {
36
38
39 release(this->contentView);
40 release(this->label);
41
43}
static void dealloc(Object *self)
◆ init()
- See also
- View::init(View *)
Definition at line 67 of file Box.c.
67 {
69}
Box * initWithFrame(Box *self, const SDL_Rect *frame)
Initializes this Box with the given frame.
◆ initialize()
static void initialize |
( |
Class * |
clazz | ) |
|
|
static |
- See also
- Class::initialize(Class *)
Definition at line 123 of file Box.c.
123 {
124
125 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
126
128 ((ViewInterface *) clazz->interface)->init =
init;
130
131 ((BoxInterface *) clazz->interface)->initWithFrame =
initWithFrame;
132}
CollectionView * init(CollectionView *self, const SDL_Rect *frame)
Initializes this CollectionView with the specified frame and style.
layoutSubviews(View *self)
Performs layout for this View's immediate subviews.
◆ initWithFrame()
static Box * initWithFrame |
( |
Box * |
self, |
|
|
const SDL_Rect * |
frame |
|
) |
| |
|
static |
Definition at line 92 of file Box.c.
92 {
93
95 if (self) {
96
99
102
104
106 assert(self->label);
107
109
111
113 }
114
115 return self;
116}
StackView * contentView
The internal container.
Labels provide a configurable container for Text.
Label * initWithText(Label *self, const char *text, Font *font)
Initializes this Label with the given text and Font.
StackViews are containers that manage the arrangement of their subviews.
ViewAlignment alignment
The alignment.
void addSubview(View *self, View *subview)
Adds a subview to this view, to be drawn above its siblings.
void addClassName(View *self, const char *className)
Adds the given class name to this View.
◆ layoutSubviews()
static void layoutSubviews |
( |
View * |
self | ) |
|
|
static |
- See also
- View::layoutSubviews(View *)
Definition at line 74 of file Box.c.
74 {
75
77
79 if (label->
hidden ==
false) {
80
83 }
84}
SDL_Size size(const Image *self)
_Bool hidden
If true, this View is not drawn.
SDL_Size sizeThatContains(const View *self)
SDL_Rect frame
The frame, relative to the superview.