Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-10-16 15:25:06 +00:00
|
|
|
#include "gui_i.h"
|
2021-01-29 13:52:16 +00:00
|
|
|
#include "view_port.h"
|
2020-10-15 15:56:47 +00:00
|
|
|
|
2021-01-29 13:52:16 +00:00
|
|
|
struct ViewPort {
|
2020-10-29 07:11:16 +00:00
|
|
|
Gui* gui;
|
|
|
|
bool is_enabled;
|
2020-12-14 10:50:32 +00:00
|
|
|
|
2020-10-29 07:11:16 +00:00
|
|
|
uint8_t width;
|
|
|
|
uint8_t height;
|
2020-12-14 10:50:32 +00:00
|
|
|
|
2021-01-29 13:52:16 +00:00
|
|
|
ViewPortDrawCallback draw_callback;
|
2020-10-29 07:11:16 +00:00
|
|
|
void* draw_callback_context;
|
2020-12-14 10:50:32 +00:00
|
|
|
|
2021-01-29 13:52:16 +00:00
|
|
|
ViewPortInputCallback input_callback;
|
2020-10-29 07:11:16 +00:00
|
|
|
void* input_callback_context;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
2020-12-14 10:50:32 +00:00
|
|
|
* Set GUI reference.
|
2021-01-29 13:52:16 +00:00
|
|
|
* To be used by GUI, called upon view_port tree insert
|
2020-10-29 07:11:16 +00:00
|
|
|
* @param gui - gui instance pointer.
|
|
|
|
*/
|
2021-01-29 13:52:16 +00:00
|
|
|
void view_port_gui_set(ViewPort* view_port, Gui* gui);
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
|
2020-10-29 07:11:16 +00:00
|
|
|
/*
|
|
|
|
* Process draw call. Calls draw callback.
|
2020-12-14 10:50:32 +00:00
|
|
|
* To be used by GUI, called on tree redraw.
|
|
|
|
* @param canvas - canvas to draw at.
|
2020-10-29 07:11:16 +00:00
|
|
|
*/
|
2021-01-29 13:52:16 +00:00
|
|
|
void view_port_draw(ViewPort* view_port, Canvas* canvas);
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
|
2020-10-29 07:11:16 +00:00
|
|
|
/*
|
2020-12-14 10:50:32 +00:00
|
|
|
* Process input. Calls input callbac
|
|
|
|
* To be used by GUI, called on input dispatch.
|
2020-10-29 07:11:16 +00:00
|
|
|
* @param event - pointer to input event.
|
|
|
|
*/
|
2021-01-29 13:52:16 +00:00
|
|
|
void view_port_input(ViewPort* view_port, InputEvent* event);
|