51 String *classNames = $((Object *) this->classNames,
description);
52 String *
description = str(
"%s@%p \"%s\" %s [%d, %d, %d, %d]",
53 this->identifier ?: classnameof(self),
55 ((
Option *) self)->title->text,
57 this->frame.x, this->frame.y, this->frame.w, this->frame.h);
77 assert(simpleSelector);
81 switch (simpleSelector->
type) {
83 if (strcmp(
"selected", simpleSelector->
pattern) == 0) {
129#pragma mark - Class lifecycle
136 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
137 ((ObjectInterface *) clazz->interface)->description =
description;
140 ((ViewInterface *) clazz->interface)->matchesSelector =
matchesSelector;
142 ((OptionInterface *) clazz->interface)->initWithTitle =
initWithTitle;
143 ((OptionInterface *) clazz->interface)->setSelected =
setSelected;
156 clazz = _initialize(&(
const ClassDef) {
158 .superclass =
_View(),
159 .instanceSize =
sizeof(
Option),
160 .interfaceOffset = offsetof(
Option, interface),
161 .interfaceSize =
sizeof(OptionInterface),
static String * description(const Object *self)
static void dealloc(Object *self)
static void initialize(Class *clazz)
@ SimpleSelectorTypePseudo
Box * initWithFrame(Box *self, const SDL_Rect *frame)
Initializes this Box with the given frame.
void setSelected(CollectionItemView *self, _Bool isSelected)
Sets the selected state of this item.
_Bool isSelected(const Control *self)
Label * initWithText(Label *self, const char *text, Font *font)
Initializes this Label with the given text and Font.
_Bool isSelected
True if this Option is selected, false otherwise.
Class * _Option(void)
The Option archetype.
SimpleSelectorType type
The SimpleSelectorType.
char * pattern
The pattern, as provided by the user.
Text rendered with TrueType fonts.
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
_Bool needsLayout
If true, this View will layout its subviews before it is drawn.
Class * _View(void)
The View archetype.
void addSubview(View *self, View *subview)
Adds a subview to this view, to be drawn above its siblings.
_Bool matchesSelector(const View *self, const SimpleSelector *simpleSelector)
_Bool acceptsFirstResponder(const View *self)