ObjectivelyMVC 0.1.0
Object oriented MVC framework for OpenGL, SDL2 and GNU C
Public Member Functions | Data Fields | Protected Attributes
TabViewController Struct Reference

TabViewControllers arrange and manage their child ViewControllers in a tab view interface. More...

#include <TabViewController.h>

Inheritance diagram for TabViewController:
ViewController

Public Member Functions

Class * _TabViewController (void)
 The TabViewController archetype. More...
 
TabViewControllerinit (TabViewController *self)
 Initializes this TabViewController. More...
 
TabViewItemtabForViewController (const TabViewController *self, const ViewController *viewController)
 Returns the TabViewItem for the specified child ViewController, or NULL. More...
 
- Public Member Functions inherited from ViewController
Class * _ViewController (void)
 The ViewController archetype. More...
 
void addChildViewController (ViewController *self, ViewController *childViewController)
 Adds the specified child ViewController to this ViewController. More...
 
void handleNotification (ViewController *self, const Notification *notification)
 Handles a broadcast notification. More...
 
ViewControllerinit (ViewController *self)
 Initializes this ViewController. More...
 
void loadView (ViewController *self)
 Loads this ViewController's View. More...
 
void loadViewIfNeeded (ViewController *self)
 Loads this ViewController's View if it is not already loaded. More...
 
void moveToParentViewController (ViewController *self, ViewController *parentViewController)
 Moves this ViewController to the specified parent. More...
 
void removeChildViewController (ViewController *self, ViewController *childViewController)
 Removes the specified child ViewController from this ViewController. More...
 
void removeFromParentViewController (ViewController *self)
 Removes this ViewController from its parent. More...
 
void respondToEvent (ViewController *self, const SDL_Event *event)
 Responds to the given event. More...
 
void setView (ViewController *self, View *view)
 Sets this ViewController's View. More...
 
void viewDidAppear (ViewController *self)
 This method is invoked after this ViewController's View is added to the View hierarchy. More...
 
void viewDidDisappear (ViewController *self)
 This method is invoked after this ViewController's View is removed to the View hierarchy. More...
 
void viewWillAppear (ViewController *self)
 This method is invoked before this ViewController's View is added to the View hierarchy. More...
 
void viewWillDisappear (ViewController *self)
 This method is invoked before this ViewController's View is removed from the View hierarchy. More...
 

Data Fields

TabViewtabView
 The TabView. More...
 
ViewController viewController
 The superclass. More...
 
- Data Fields inherited from ViewController
MutableArray * childViewControllers
 The child view controllers. More...
 
ViewControllerInterface * interface
 The interface. More...
 
Object object
 The superclass. More...
 
ViewControllerparentViewController
 The parent view controller. More...
 
Viewview
 The main view. More...
 

Protected Attributes

TabViewControllerInterface * interface
 The interface. More...
 

Detailed Description

TabViewControllers arrange and manage their child ViewControllers in a tab view interface.

Tabs are added to the tab view interface by adding child ViewControllers to a TabViewController.

Definition at line 45 of file TabViewController.h.

Member Function Documentation

◆ _TabViewController()

Class * _TabViewController ( void  )

The TabViewController archetype.

Returns
The TabViewController Class.

Definition at line 148 of file TabViewController.c.

148 {
149 static Class *clazz;
150 static Once once;
151
152 do_once(&once, {
153 clazz = _initialize(&(const ClassDef) {
154 .name = "TabViewController",
155 .superclass = _ViewController(),
156 .instanceSize = sizeof(TabViewController),
157 .interfaceOffset = offsetof(TabViewController, interface),
158 .interfaceSize = sizeof(TabViewControllerInterface),
160 });
161 });
162
163 return clazz;
164}
static void initialize(Class *clazz)
TabViewControllers arrange and manage their child ViewControllers in a tab view interface.
TabViewControllerInterface * interface
The interface.
Class * _ViewController(void)
The ViewController archetype.

◆ init()

Initializes this TabViewController.

Parameters
selfThe TabViewController.
Returns
The initialized TabViewController, or NULL on error.

Definition at line 101 of file TabViewController.c.

101 {
102 return (TabViewController *) super(ViewController, self, init);
103}
TabViewController * init(TabViewController *self)
Initializes this TabViewController.
A ViewController manages a View and its descendants.

◆ tabForViewController()

TabViewItem * tabForViewController ( const TabViewController self,
const ViewController viewController 
)

Returns the TabViewItem for the specified child ViewController, or NULL.

Parameters
selfThe TabViewController.
viewControllerThe child ViewController.
Returns
The TabViewItem associated with the specified child ViewController.

Definition at line 116 of file TabViewController.c.

116 {
117
118 assert(viewController);
119
120 if (viewController->view) {
121 return $((Array *) self->tabView->tabs, findObject, tabForViewController_predicate, (ident) viewController->view);
122 }
123
124 return NULL;
125}
static _Bool tabForViewController_predicate(const ident obj, ident data)
Predicate for tabViewItemFor.
ViewController viewController
The superclass.
TabView * tabView
The TabView.
MutableArray * tabs
The TabViewItems.
Definition: TabView.h:115
View * view
The main view.

Field Documentation

◆ interface

TabViewControllerInterface* TabViewController::interface
protected

The interface.

Definition at line 56 of file TabViewController.h.

◆ tabView

TabView* TabViewController::tabView

The TabView.

Definition at line 61 of file TabViewController.h.

◆ viewController

ViewController TabViewController::viewController

The superclass.

Definition at line 50 of file TabViewController.h.


The documentation for this struct was generated from the following files: