GUI: ViewHolder API. More...
Go to the source code of this file.
Typedefs | |
typedef struct ViewHolder | ViewHolder |
typedef void(* | FreeCallback) (void *free_context) |
Free callback type. | |
typedef void(* | BackCallback) (void *back_context) |
Back callback type. | |
Functions | |
ViewHolder * | view_holder_alloc (void) |
Allocate ViewHolder. | |
void | view_holder_free (ViewHolder *view_holder) |
Free ViewHolder and call Free callback. | |
void | view_holder_set_view (ViewHolder *view_holder, View *view) |
Set view for ViewHolder. | |
void | view_holder_set_free_callback (ViewHolder *view_holder, FreeCallback free_callback, void *free_context) |
Set Free callback. | |
void * | view_holder_get_free_context (ViewHolder *view_holder) |
Free callback context getter. | |
void | view_holder_set_back_callback (ViewHolder *view_holder, BackCallback back_callback, void *back_context) |
Set the back key callback. | |
void | view_holder_attach_to_gui (ViewHolder *view_holder, Gui *gui) |
Attach ViewHolder to GUI. | |
void | view_holder_update (View *view, void *context) |
View Update Handler. | |
void | view_holder_send_to_front (ViewHolder *view_holder) |
Send ViewPort of this ViewHolder instance to front. | |
void | view_holder_send_to_back (ViewHolder *view_holder) |
Send ViewPort of this ViewHolder instance to back. | |
GUI: ViewHolder API.
ViewHolder is used to connect a single View to a Gui instance. This is useful in smaller applications with a simple user interface. If advanced view switching capabilites are required, consider using ViewDispatcher instead.
typedef void(* BackCallback) (void *back_context) |
Back callback type.
ViewHolder * view_holder_alloc | ( | void | ) |
Allocate ViewHolder.
void view_holder_attach_to_gui | ( | ViewHolder * | view_holder, |
Gui * | gui ) |
Attach ViewHolder to GUI.
view_holder | ViewHolder instance |
gui | GUI instance to attach to |
void view_holder_free | ( | ViewHolder * | view_holder | ) |
Free ViewHolder and call Free callback.
view_holder | pointer to ViewHolder |
void * view_holder_get_free_context | ( | ViewHolder * | view_holder | ) |
Free callback context getter.
Useful if your Free callback is a module destructor, so you can get an instance of the module using this method.
view_holder | ViewHolder instance |
void view_holder_send_to_back | ( | ViewHolder * | view_holder | ) |
Send ViewPort of this ViewHolder instance to back.
view_holder | ViewHolder instance |
void view_holder_send_to_front | ( | ViewHolder * | view_holder | ) |
Send ViewPort of this ViewHolder instance to front.
view_holder | ViewHolder instance |
void view_holder_set_back_callback | ( | ViewHolder * | view_holder, |
BackCallback | back_callback, | ||
void * | back_context ) |
Set the back key callback.
The callback function will be called if the user has pressed the Back key and the current view did not handle this event.
view_holder | ViewHolder instance |
back_callback | pointer to the callback function |
back_context | pointer to a user-specific object, can be NULL |
void view_holder_set_free_callback | ( | ViewHolder * | view_holder, |
FreeCallback | free_callback, | ||
void * | free_context ) |
Set Free callback.
view_holder | ViewHolder instance |
free_callback | callback pointer |
free_context | callback context |
void view_holder_set_view | ( | ViewHolder * | view_holder, |
View * | view ) |
Set view for ViewHolder.
Pass NULL as the view parameter to unset the current view.
view_holder | ViewHolder instance |
view | View instance |
void view_holder_update | ( | View * | view, |
void * | context ) |
View Update Handler.
view | View Instance |
context | ViewHolder instance |