mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-24 11:43:09 +00:00
f218c41d83
* TODO FL-3497: impossible to fix with current memory allocator * TODO FL-3497: removed, requires radically different settings approach * TODO FL-3514: removed, yes we should * TODO FL-3498: implemented, guarding view port access with mutex. * TODO FL-3515: removed, questionable but ok * TODO FL-3510: removed, comment added * TODO FL-3500: refactored, store pin numbers in GpioPinRecord, fix gpio app crash caused by incorrect gpio_pins traversal. * Format Sources * TODO FL-3505: removed, mutex alone is not going to fix issue with WPAN architecture * TODO FL-3506: removed, change ownership by copy is good * TODO FL-3519: documentation and link to source added * Lib: remove unneded total sum from comment in bq27220 --------- Co-authored-by: hedger <hedger@users.noreply.github.com>
52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
/**
|
|
* @file view_port_i.h
|
|
* GUI: internal ViewPort API
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "gui_i.h"
|
|
#include "view_port.h"
|
|
|
|
struct ViewPort {
|
|
Gui* gui;
|
|
FuriMutex* mutex;
|
|
bool is_enabled;
|
|
ViewPortOrientation orientation;
|
|
|
|
uint8_t width;
|
|
uint8_t height;
|
|
|
|
ViewPortDrawCallback draw_callback;
|
|
void* draw_callback_context;
|
|
|
|
ViewPortInputCallback input_callback;
|
|
void* input_callback_context;
|
|
};
|
|
|
|
/** Set GUI reference.
|
|
*
|
|
* To be used by GUI, called upon view_port tree insert
|
|
*
|
|
* @param view_port ViewPort instance
|
|
* @param gui gui instance pointer
|
|
*/
|
|
void view_port_gui_set(ViewPort* view_port, Gui* gui);
|
|
|
|
/** Process draw call. Calls draw callback.
|
|
*
|
|
* To be used by GUI, called on tree redraw.
|
|
*
|
|
* @param view_port ViewPort instance
|
|
* @param canvas canvas to draw at
|
|
*/
|
|
void view_port_draw(ViewPort* view_port, Canvas* canvas);
|
|
|
|
/** Process input. Calls input callback.
|
|
*
|
|
* To be used by GUI, called on input dispatch.
|
|
*
|
|
* @param view_port ViewPort instance
|
|
* @param event pointer to input event
|
|
*/
|
|
void view_port_input(ViewPort* view_port, InputEvent* event);
|