Loading...
Searching...
No Matches
view_port.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <input/input.h>
9#include "canvas.h"
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15typedef struct ViewPort ViewPort;
16
17typedef enum {
18 ViewPortOrientationHorizontal,
19 ViewPortOrientationHorizontalFlip,
20 ViewPortOrientationVertical,
21 ViewPortOrientationVerticalFlip,
24
28typedef void (*ViewPortDrawCallback)(Canvas* canvas, void* context);
29
33typedef void (*ViewPortInputCallback)(InputEvent* event, void* context);
34
42
49void view_port_free(ViewPort* view_port);
50
58void view_port_set_width(ViewPort* view_port, uint8_t width);
59uint8_t view_port_get_width(const ViewPort* view_port);
60
68void view_port_set_height(ViewPort* view_port, uint8_t height);
69uint8_t view_port_get_height(const ViewPort* view_port);
70
77void view_port_enabled_set(ViewPort* view_port, bool enabled);
78bool view_port_is_enabled(const ViewPort* view_port);
79
86void view_port_draw_callback_set(ViewPort* view_port, ViewPortDrawCallback callback, void* context);
87void view_port_input_callback_set(
88 ViewPort* view_port,
89 ViewPortInputCallback callback,
90 void* context);
91
98void view_port_update(ViewPort* view_port);
99
105void view_port_set_orientation(ViewPort* view_port, ViewPortOrientation orientation);
106ViewPortOrientation view_port_get_orientation(const ViewPort* view_port);
107
108#ifdef __cplusplus
109}
110#endif
GUI: Canvas API.
Input: main API.
Canvas structure.
Definition canvas_i.h:40
Input Event, dispatches with FuriPubSub.
Definition input.h:31
Definition view_port_i.h:11
void view_port_update(ViewPort *view_port)
Emit update signal to GUI system.
Definition view_port.c:182
void view_port_set_orientation(ViewPort *view_port, ViewPortOrientation orientation)
Set ViewPort orientation.
Definition view_port.c:236
void(* ViewPortInputCallback)(InputEvent *event, void *context)
ViewPort Input callback.
Definition view_port.h:33
void view_port_set_height(ViewPort *view_port, uint8_t height)
Set view_port height.
Definition view_port.c:125
void view_port_draw_callback_set(ViewPort *view_port, ViewPortDrawCallback callback, void *context)
ViewPort event callbacks.
Definition view_port.c:163
void(* ViewPortDrawCallback)(Canvas *canvas, void *context)
ViewPort Draw callback.
Definition view_port.h:28
void view_port_free(ViewPort *view_port)
ViewPort deallocator.
Definition view_port.c:101
void view_port_set_width(ViewPort *view_port, uint8_t width)
Set view_port width.
Definition view_port.c:110
void view_port_enabled_set(ViewPort *view_port, bool enabled)
Enable or disable view_port rendering.
Definition view_port.c:140
ViewPort * view_port_alloc(void)
ViewPort allocator.
Definition view_port.c:93
ViewPortOrientation
Definition view_port.h:17
@ ViewPortOrientationMAX
Special value, don't use it.
Definition view_port.h:22