GUI: abolish API injection into instances. (#265)

* GUI: abolish API injection into instances. Update usage by 3rd party apps.
* GUI: update documentation. Cleanup api usage. Adjust status bar item spacing.
This commit is contained in:
あく
2020-12-14 13:50:32 +03:00
committed by GitHub
parent ff7ce6f00f
commit d3ff787864
39 changed files with 486 additions and 422 deletions

View File

@@ -18,10 +18,10 @@ typedef struct {
// describe state here
} State;
static void render_callback(CanvasApi* canvas, void* ctx) {
static void render_callback(Canvas* canvas, void* ctx) {
State* state = (State*)acquire_mutex((ValueMutex*)ctx, 25);
canvas->clear(canvas);
canvas_clear(canvas);
// draw your app
@@ -54,12 +54,12 @@ void template_app(void* p) {
widget_input_callback_set(widget, input_callback, event_queue);
// Open GUI and register widget
GuiApi* gui = (GuiApi*)furi_open("gui");
Gui* gui = (Gui*)furi_open("gui");
if(gui == NULL) {
printf("gui is not available\n");
furiac_exit(NULL);
}
gui->add_widget(gui, widget, /* specify UI layer */);
gui_add_widget(gui, widget, /* specify UI layer */);
Event event;
while(1) {