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
96 assert(self->selectionOverlay);
98 $(self->selectionOverlay,
addClassName,
"selectionOverlay");
118#pragma mark - Class lifecycle
125 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
127 ((ViewInterface *) clazz->interface)->matchesSelector =
matchesSelector;
129 ((CollectionItemViewInterface *) clazz->interface)->initWithFrame =
initWithFrame;
130 ((CollectionItemViewInterface *) clazz->interface)->setSelected =
setSelected;
142 clazz = _initialize(&(
const ClassDef) {
143 .name =
"CollectionItemView",
144 .superclass =
_View(),
147 .interfaceSize =
sizeof(CollectionItemViewInterface),
static void dealloc(Object *self)
static void initialize(Class *clazz)
The CollectionItemView type.
@ SimpleSelectorTypePseudo
@ ViewAlignmentMiddleCenter
Box * initWithFrame(Box *self, const SDL_Rect *frame)
Initializes this Box with the given frame.
CollectionViewItems are a visual representation of an item within a CollectionView.
Class * _CollectionItemView(void)
The CollectionItemView archetype.
void setSelected(CollectionItemView *self, _Bool isSelected)
Sets the selected state of this item.
ImageView * imageView
The ImageView.
_Bool isSelected
True when this item is selected, false otherwise.
_Bool isSelected(const Control *self)
ImageViews render an Image in the context of a View hierarchy.
Label * initWithText(Label *self, const char *text, Font *font)
Initializes this Label with the given text and Font.
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 clipsSubviews
If true, subviews will be clipped to this View's frame.
ViewAlignment alignment
The alignment.
Class * _View(void)
The View archetype.
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.
int autoresizingMask
The ViewAutoresizing bitmask.
_Bool matchesSelector(const View *self, const SimpleSelector *simpleSelector)