#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.
◆ 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}
static void awakeWithDictionary(View *self, const Dictionary *dictionary)
#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.
◆ 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}
static Box * initWithFrame(Box *self, const SDL_Rect *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}
static View * init(View *self)
static void layoutSubviews(View *self)
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}
static Label * initWithText(Label *self, const char *text, Font *font)
static void addSubview(View *self, View *subview)
static void addClassName(View *self, const char *className)
StackView * contentView
The internal container.
Labels provide a configurable container for Text.
StackViews are containers that manage the arrangement of their subviews.
◆ 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}
static SDL_Size size(const Image *self)
static SDL_Size sizeThatContains(const View *self)
SDL_Rect frame
The frame, relative to the superview.
bool hidden
If true, this View is not drawn.