61 $(self,
bind, inlets, dictionary);
78 if (event->type == SDL_MOUSEBUTTONDOWN) {
84 if (event->type == SDL_MOUSEBUTTONUP) {
85 self->
state &= ~ControlStateHighlighted;
144#pragma mark - Class lifecycle
151 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
154 ((ViewInterface *) clazz->interface)->init =
init;
158 ((ButtonInterface *) clazz->interface)->initWithFrame =
initWithFrame;
159 ((ButtonInterface *) clazz->interface)->initWithImage =
initWithImage;
172 clazz = _initialize(&(
const ClassDef) {
175 .instanceSize =
sizeof(
Button),
176 .interfaceOffset = offsetof(
Button, interface),
177 .interfaceSize =
sizeof(ButtonInterface),
@ ControlStateHighlighted
OBJECTIVELYMVC_EXPORT void MVC_PlaySound(const Sound *sound)
Plays the specified Sound through the current SoundStage (if any).
#define MakeInlets(...)
Creates a null-termianted array of Inlets.
#define MakeInlet(name, type, dest, data)
Creates an Inlet with the specified parameters.
Box * initWithFrame(Box *self, const SDL_Rect *frame)
Initializes this Box with the given frame.
CollectionView * init(CollectionView *self, const SDL_Rect *frame)
Initializes this CollectionView with the specified frame and style.
Controls are Views which capture events and dispatch Actions.
_Bool captureEvent(Control *self, const SDL_Event *event)
Captures a given event, potentially altering the state of this Control.
Class * _Control(void)
The Control archetype.
unsigned int state
The bit mask of ControlState.
ImageViews render an Image in the context of a View hierarchy.
void setImage(ImageView *self, Image *image)
Sets the Image for this ImageView.
Inlets enable inbound data binding of View attributes through JSON.
Label * initWithText(Label *self, const char *text, Font *font)
Initializes this Label with the given text and Font.
Text rendered with TrueType fonts.
void setText(Text *self, const char *text)
Sets this Text's text.
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 addSubview(View *self, View *subview)
Adds a subview to this view, to be drawn above its siblings.
void awakeWithDictionary(View *self, const Dictionary *dictionary)
Wakes this View with the specified Dictionary.