#include <assert.h>
#include "Label.h"
Go to the source code of this file.
◆ _Class
◆ _Label()
Definition at line 131 of file Label.c.
131 {
132 static Class *clazz;
133 static Once once;
134
135 do_once(&once, {
136 clazz = _initialize(&(const ClassDef) {
137 .name = "Label",
138 .superclass =
_View(),
139 .instanceSize =
sizeof(
Label),
140 .interfaceSize = sizeof(LabelInterface),
142 });
143 });
144
145 return clazz;
146}
static void initialize(Class *clazz)
Labels provide a configurable container for Text.
◆ awakeWithDictionary()
| static void awakeWithDictionary |
( |
View * |
self, |
|
|
const Dictionary * |
dictionary |
|
) |
| |
|
static |
- See also
- View::awakeWithDictionary(View *, const Dictionary *)
Definition at line 69 of file Label.c.
69 {
70
72
74
77 );
78
79 $(self, bind, inlets, dictionary);
80
82}
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.
static void setNeedsLayout(View *self)
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 Label.c.
35 {
36
38
39 release(this->text);
40
42}
static void dealloc(Object *self)
◆ description()
| static String * description |
( |
const Object * |
self | ) |
|
|
static |
- See also
- Object::description(const Object *)
Definition at line 47 of file Label.c.
47 {
48
51
52 String *classNames = $((Object *) this->classNames,
description);
53 String *
description = str(
"%s@%p \"%s\" %s [%d, %d, %d, %d]",
54 this->identifier ?: classnameof(self),
55 self,
56 ((
Label *) self)->text->text,
57 classNames->chars,
59
60 release(classNames);
62}
static String * description(const Object *self)
static SDL_Rect bounds(const View *self)
◆ init()
- See also
- View::init(View *)
Definition at line 87 of file Label.c.
87 {
89}
static Label * initWithText(Label *self, const char *text, Font *font)
◆ initialize()
| static void initialize |
( |
Class * |
clazz | ) |
|
|
static |
- See also
- Class::initialize(Class *)
Definition at line 116 of file Label.c.
116 {
117
118 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
119 ((ObjectInterface *) clazz->interface)->description =
description;
120
122 ((ViewInterface *) clazz->interface)->init =
init;
123
124 ((LabelInterface *) clazz->interface)->initWithText =
initWithText;
125}
static View * init(View *self)
◆ initWithText()
| static Label * initWithText |
( |
Label * |
self, |
|
|
const char * |
text, |
|
|
Font * |
font |
|
) |
| |
|
static |
Definition at line 97 of file Label.c.
97 {
98
100 if (self) {
101
104
106 }
107
108 return self;
109}
static Box * initWithFrame(Box *self, const SDL_Rect *frame)
static void addSubview(View *self, View *subview)
static Font * font(Theme *self, const FontAttributes *attributes, float pixelDensity)
Text * text
The Label Text.
Text rendered with TrueType fonts.