#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 134 of file Box.c.
134 {
135 static Class *clazz;
136 static Once once;
137
138 do_once(&once, {
139 clazz = _initialize(&(const ClassDef) {
140 .name = "Box",
141 .superclass =
_View(),
142 .instanceSize =
sizeof(
Box),
143 .interfaceSize = sizeof(BoxInterface),
145 });
146 });
147
148 return clazz;
149}
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 119 of file Box.c.
119 {
120
121 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
122
124 ((ViewInterface *) clazz->interface)->init =
init;
126
127 ((BoxInterface *) clazz->interface)->initWithFrame =
initWithFrame;
128}
static View * init(View *self)
static void layoutSubviews(View *self)
layoutSubviews(View *self)
Arranges this View's immediate subviews within its (already final) frame.
◆ 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 }
110
111 return self;
112}
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
80
83 }
84}
static SDL_Size size(const Image *self)
static SDL_Size sizeThatContains(const View *self)
ViewVisibility visibility
Whether this View is drawn, and contributes to its superview's size.
SDL_Rect frame
The frame, relative to the superview.