GUI: ViewPort API.
More...
#include <input/input.h>
#include "canvas.h"
Go to the source code of this file.
◆ ViewPortDrawCallback
| typedef void(* ViewPortDrawCallback) (Canvas *canvas, void *context) |
ViewPort Draw callback.
- Warning
- called from GUI thread
◆ ViewPortInputCallback
| typedef void(* ViewPortInputCallback) (InputEvent *event, void *context) |
ViewPort Input callback.
- Warning
- called from GUI thread
◆ ViewPortOrientation
| Enumerator |
|---|
| ViewPortOrientationMAX | Special value, don't use it.
|
◆ view_port_alloc()
ViewPort allocator.
always returns view_port or stops system if not enough memory.
- Returns
- ViewPort instance
◆ view_port_draw_callback_set()
Set the ViewPort draw callback.
- Warning
callback will be invoked on the GUI thread.
- Parameters
-
| view_port | ViewPort instance |
| callback | the draw callback function |
| context | context to pass to callback |
◆ view_port_enabled_set()
| void view_port_enabled_set |
( |
ViewPort * | view_port, |
|
|
bool | enabled ) |
Enable or disable view_port rendering.
- Parameters
-
| view_port | ViewPort instance |
| enabled | Indicates if enabled |
- Warning
- automatically dispatches update event
◆ view_port_free()
| void view_port_free |
( |
ViewPort * | view_port | ) |
|
ViewPort deallocator.
Ensure that view_port was unregistered in GUI system before use.
- Parameters
-
| view_port | ViewPort instance |
◆ view_port_input_callback_set()
Set the ViewPort input callback.
- Warning
callback will be invoked on the GUI thread.
- Parameters
-
| view_port | ViewPort instance |
| callback | the input callback function |
| context | context to pass to callback |
◆ view_port_set_height()
| void view_port_set_height |
( |
ViewPort * | view_port, |
|
|
uint8_t | height ) |
Set view_port height.
Will be used to limit canvas drawing area and autolayout feature.
- Parameters
-
| view_port | ViewPort instance |
| height | wanted height, 0 - auto. |
◆ view_port_set_orientation()
Set ViewPort orientation.
- Parameters
-
| view_port | ViewPort instance |
| orientation | display orientation, horizontal or vertical. |
◆ view_port_set_width()
| void view_port_set_width |
( |
ViewPort * | view_port, |
|
|
uint8_t | width ) |
Set view_port width.
Will be used to limit canvas drawing area and autolayout feature.
- Parameters
-
| view_port | ViewPort instance |
| width | wanted width, 0 - auto. |
◆ view_port_update()
| void view_port_update |
( |
ViewPort * | view_port | ) |
|
Emit update signal to GUI system.
Rendering will happen later after GUI system process signal.
- Parameters
-
| view_port | ViewPort instance |