28#define _Class _PageView
39 memset(&this->delegate, 0,
sizeof(this->delegate));
57 if (this->currentPage == NULL) {
82 if (subview == this->currentPage) {
93 return $$(Array, arrayWithArray, (Array *) self->
subviews);
96#pragma mark - PageView
119 if (subview == ((
PageView *) data)->currentPage) {
155#pragma mark - Class lifecycle
162 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
164 ((ViewInterface *) clazz->interface)->addSubview =
addSubview;
165 ((ViewInterface *) clazz->interface)->init =
init;
167 ((ViewInterface *) clazz->interface)->visibleSubviews =
visibleSubviews;
169 ((PageViewInterface *) clazz->interface)->initWithFrame =
initWithFrame;
182 clazz = _initialize(&(
const ClassDef) {
184 .superclass =
_View(),
186 .interfaceOffset = offsetof(
PageView, interface),
187 .interfaceSize =
sizeof(PageViewInterface),
static View * init(View *self)
static void setCurrentPage(PageView *self, View *currentPage)
static void setCurrentPage_enumerate(const Array *array, ident obj, ident data)
ArrayEnumerator for setCurrentPage.
static void removeSubview(View *self, View *subview)
static Array * visibleSubviews(const View *self)
static void dealloc(Object *self)
static void addSubview(View *self, View *subview)
static void initialize(Class *clazz)
static PageView * initWithFrame(PageView *self, const SDL_Rect *frame)
PageViews manage their subviews as pages in a book.
static void addClassName(View *self, const char *className)
static void enumerate(View *self, ViewEnumerator enumerator, ident data)
void(* didSetCurrentPage)(PageView *pageView)
Called when the current page is set.
PageViews manage their subviews as pages in a book.
void setCurrentPage(PageView *self, View *currentPage)
Presents the specified subview as the current page of this PageView.
View * currentPage
The index of the current page.
PageViewDelegate delegate
The delegate.
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
Array * subviews
The immediate subviews.
bool needsLayout
If true, this View will layout its subviews before it is drawn.
void removeSubview(View *self, View *subview)
Removes the given subview from this View.
bool hidden
If true, this View is not drawn.