2021-10-03 13:36:05 +03:00
|
|
|
/**
|
|
|
|
* @file view_port_i.h
|
|
|
|
* GUI: internal ViewPort API
|
|
|
|
*/
|
|
|
|
|
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 13:21:55 +03:00
|
|
|
#pragma once
|
|
|
|
|
2020-10-16 18:25:06 +03:00
|
|
|
#include "gui_i.h"
|
2021-01-29 16:52:16 +03:00
|
|
|
#include "view_port.h"
|
2020-10-15 18:56:47 +03:00
|
|
|
|
2021-01-29 16:52:16 +03:00
|
|
|
struct ViewPort {
|
2020-10-29 10:11:16 +03:00
|
|
|
Gui* gui;
|
|
|
|
bool is_enabled;
|
2021-05-19 12:43:15 +03:00
|
|
|
ViewPortOrientation orientation;
|
2020-12-14 13:50:32 +03:00
|
|
|
|
2020-10-29 10:11:16 +03:00
|
|
|
uint8_t width;
|
|
|
|
uint8_t height;
|
2020-12-14 13:50:32 +03:00
|
|
|
|
2021-01-29 16:52:16 +03:00
|
|
|
ViewPortDrawCallback draw_callback;
|
2020-10-29 10:11:16 +03:00
|
|
|
void* draw_callback_context;
|
2020-12-14 13:50:32 +03:00
|
|
|
|
2021-01-29 16:52:16 +03:00
|
|
|
ViewPortInputCallback input_callback;
|
2020-10-29 10:11:16 +03:00
|
|
|
void* input_callback_context;
|
|
|
|
};
|
|
|
|
|
2021-10-03 13:36:05 +03:00
|
|
|
/** Set GUI reference.
|
|
|
|
*
|
2021-01-29 16:52:16 +03:00
|
|
|
* To be used by GUI, called upon view_port tree insert
|
2021-10-03 13:36:05 +03:00
|
|
|
*
|
|
|
|
* @param view_port ViewPort instance
|
|
|
|
* @param gui gui instance pointer
|
2020-10-29 10:11:16 +03:00
|
|
|
*/
|
2021-01-29 16:52:16 +03: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 13:21:55 +03:00
|
|
|
|
2021-10-03 13:36:05 +03:00
|
|
|
/** Process draw call. Calls draw callback.
|
|
|
|
*
|
2020-12-14 13:50:32 +03:00
|
|
|
* To be used by GUI, called on tree redraw.
|
2021-10-03 13:36:05 +03:00
|
|
|
*
|
|
|
|
* @param view_port ViewPort instance
|
|
|
|
* @param canvas canvas to draw at
|
2020-10-29 10:11:16 +03:00
|
|
|
*/
|
2021-01-29 16:52:16 +03: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 13:21:55 +03:00
|
|
|
|
2021-10-03 13:36:05 +03:00
|
|
|
/** Process input. Calls input callback.
|
|
|
|
*
|
2020-12-14 13:50:32 +03:00
|
|
|
* To be used by GUI, called on input dispatch.
|
2021-10-03 13:36:05 +03:00
|
|
|
*
|
|
|
|
* @param view_port ViewPort instance
|
|
|
|
* @param event pointer to input event
|
2020-10-29 10:11:16 +03:00
|
|
|
*/
|
2021-01-29 16:52:16 +03:00
|
|
|
void view_port_input(ViewPort* view_port, InputEvent* event);
|