#include <assert.h>
#include "Input.h"
Go to the source code of this file.
◆ _Class
◆ _Input()
Definition at line 212 of file Input.c.
212 {
213 static Class *clazz;
214 static Once once;
215
216 do_once(&once, {
217 clazz = _initialize(&(const ClassDef) {
218 .name = "Input",
220 .instanceSize =
sizeof(
Input),
221 .interfaceOffset = offsetof(
Input, interface),
222 .interfaceSize = sizeof(InputInterface),
224 });
225 });
226
227 return clazz;
228}
Class * _StackView(void)
The StackView archetype.
◆ awakeWithDictionary()
static void awakeWithDictionary |
( |
View * |
self, |
|
|
const Dictionary * |
dictionary |
|
) |
| |
|
static |
- See also
- View::awakeWithDictionary(View *, const Dictionary *)
Definition at line 57 of file Input.c.
57 {
58
60
62
67 );
68
69 $(self,
bind, inlets, dictionary);
70
72}
#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 42 of file Input.c.
42 {
43
45
46 release(this->control);
47 release(this->label);
48
50}
◆ init()
- See also
- View::init(View *)
Definition at line 77 of file Input.c.
77 {
79}
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 195 of file Input.c.
195 {
196
197 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
198
200 ((ViewInterface *) clazz->interface)->init =
init;
201
203 ((InputInterface *) clazz->interface)->setControl =
setControl;
204 ((InputInterface *) clazz->interface)->setLabel =
setLabel;
205 ((InputInterface *) clazz->interface)->setOrientation =
setOrientation;
206}
CollectionView * initWithFrame(CollectionView *self, const SDL_Rect *frame)
CollectionView * init(CollectionView *self, const SDL_Rect *frame)
Initializes this CollectionView with the specified frame and style.
◆ initWithFrame()
static Input * initWithFrame |
( |
Input * |
self, |
|
|
const SDL_Rect * |
frame |
|
) |
| |
|
static |
Definition at line 87 of file Input.c.
87 {
88
90 if (self) {
91
94
97
100
102
104 }
105
106 return self;
107}
Controls are Views which capture events and dispatch Actions.
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.
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.
◆ setControl()
Definition at line 113 of file Input.c.
113 {
114
115 assert(control);
116
118 release(self->control);
119
120 self->control = retain(control);
122
124}
void removeSubview(View *self, View *subview)
Removes the given subview from this View.
◆ setLabel()
static void setLabel |
( |
Input * |
self, |
|
|
Label * |
label |
|
) |
| |
|
static |
Definition at line 130 of file Input.c.
130 {
131
132 assert(label);
133
135 release(self->label);
136
137 self->label = retain(label);
139
141}
◆ setOrientation()
Definition at line 147 of file Input.c.
147 {
148
150
153
159 break;
160
165 break;
166 }
167
168 switch (self->orientation) {
173 break;
174
179 break;
180
186 break;
187 }
188}
@ StackViewAxisHorizontal
@ ViewAlignmentMiddleCenter
@ ViewAlignmentMiddleRight
@ ViewAlignmentMiddleLeft
ViewAlignment alignment
The alignment.
void removeFromSuperview(View *self)
Removes this View from its superview.
◆ InputOrientationNames
const EnumName InputOrientationNames[] |
Initial value:
Definition at line 28 of file Input.c.