28#define _Class _CollectionItemView
39 release(this->imageView);
40 release(this->selectionOverlay);
53 assert(simpleSelector);
56 const char *pattern = simpleSelector->
pattern;
58 switch (simpleSelector->
type) {
60 if (strcmp(
"selected", pattern) == 0) {
71#pragma mark - CollectionItemView
92 assert(self->selectionOverlay);
94 $(self->selectionOverlay,
addClassName,
"selectionOverlay");
115#pragma mark - Class lifecycle
122 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
124 ((ViewInterface *) clazz->interface)->matchesSelector =
matchesSelector;
126 ((CollectionItemViewInterface *) clazz->interface)->initWithFrame =
initWithFrame;
127 ((CollectionItemViewInterface *) clazz->interface)->setSelected =
setSelected;
139 clazz = _initialize(&(
const ClassDef) {
140 .name =
"CollectionItemView",
141 .superclass =
_View(),
143 .interfaceSize =
sizeof(CollectionItemViewInterface),
static void initialize(Class *clazz)
static void dealloc(Object *self)
static Box * initWithFrame(Box *self, const SDL_Rect *frame)
static void setSelected(CollectionItemView *self, bool isSelected)
Class * _CollectionItemView(void)
static bool matchesSelector(const View *self, const SimpleSelector *simpleSelector)
static void dealloc(Object *self)
static void initialize(Class *clazz)
static CollectionItemView * initWithFrame(CollectionItemView *self, const SDL_Rect *frame)
The CollectionItemView type.
static bool isSelected(const Control *self)
static Label * initWithText(Label *self, const char *text, Font *font)
@ SimpleSelectorTypePseudo
CollectionViewItems are a visual representation of an item within a CollectionView.
CollectionItemView * initWithFrame(CollectionItemView *self)
bool isSelected
True when this item is selected, false otherwise.
ImageView * imageView
The ImageView.
ImageViews render an Image in the context of a View hierarchy.
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.
void invalidateStyle(View *self)
Invalidates the computed Style for this View and its descendants.
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.
SDL_Rect frame
The frame, relative to the superview.
bool matchesSelector(const View *self, const SimpleSelector *simpleSelector)