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-12-14 10:50:32 +00:00
|
|
|
#include "canvas.h"
|
2021-02-03 09:52:54 +00:00
|
|
|
#include <u8g2.h>
|
|
|
|
|
|
|
|
struct Canvas {
|
|
|
|
u8g2_t fb;
|
2021-05-19 09:43:15 +00:00
|
|
|
CanvasOrientation orientation;
|
2021-02-03 09:52:54 +00:00
|
|
|
uint8_t offset_x;
|
|
|
|
uint8_t offset_y;
|
|
|
|
uint8_t width;
|
|
|
|
uint8_t height;
|
|
|
|
};
|
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-12-14 10:50:32 +00:00
|
|
|
/*
|
|
|
|
* Allocate memory and initialize canvas
|
|
|
|
*/
|
|
|
|
Canvas* canvas_init();
|
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-12-14 10:50:32 +00:00
|
|
|
/*
|
|
|
|
* Free canvas memory
|
|
|
|
*/
|
|
|
|
void canvas_free(Canvas* canvas);
|
2020-10-29 07:11:16 +00:00
|
|
|
|
2020-12-14 10:50:32 +00:00
|
|
|
/*
|
|
|
|
* Reset canvas drawing tools configuration
|
|
|
|
*/
|
|
|
|
void canvas_reset(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-12-14 10:50:32 +00:00
|
|
|
/*
|
|
|
|
* Commit canvas. Send buffer to display
|
|
|
|
*/
|
|
|
|
void canvas_commit(Canvas* canvas);
|
|
|
|
|
2021-02-13 11:40:20 +00:00
|
|
|
/*
|
|
|
|
* Get canvas buffer.
|
|
|
|
* @return pointer to buffer
|
|
|
|
*/
|
|
|
|
uint8_t* canvas_get_buffer(Canvas* canvas);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get canvas buffer size.
|
|
|
|
* @return size of canvas in bytes
|
|
|
|
*/
|
|
|
|
size_t canvas_get_buffer_size(Canvas* canvas);
|
|
|
|
|
2020-12-14 10:50:32 +00:00
|
|
|
/*
|
|
|
|
* Set drawing region relative to real screen buffer
|
|
|
|
*/
|
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
|
|
|
void canvas_frame_set(
|
2020-12-14 10:50:32 +00:00
|
|
|
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
|
|
|
uint8_t offset_x,
|
|
|
|
uint8_t offset_y,
|
|
|
|
uint8_t width,
|
|
|
|
uint8_t height);
|
2021-05-19 09:43:15 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Set canvas orientation
|
|
|
|
*/
|
|
|
|
void canvas_set_orientation(Canvas* canvas, CanvasOrientation orientation);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get canvas orientation
|
|
|
|
*/
|
|
|
|
CanvasOrientation canvas_get_orientation(const Canvas* canvas);
|