renamed struct types
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "desktop.h"
|
||||
#include "core_defines.h"
|
||||
#include "nb_hardware.h"
|
||||
#include "devices.h"
|
||||
|
||||
static int32_t prv_desktop_main(void* param) {
|
||||
UNUSED(param);
|
||||
@@ -8,7 +8,7 @@ static int32_t prv_desktop_main(void* param) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const NbApp desktop_app = {
|
||||
const App desktop_app = {
|
||||
.id = "desktop",
|
||||
.name = "Desktop",
|
||||
.type = SERVICE,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const NbApp desktop_app;
|
||||
extern const App desktop_app;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#define TAG "gui"
|
||||
|
||||
// Forward declarations from gui_draw.c
|
||||
bool gui_redraw_fs(NbGui* gui);
|
||||
void gui_redraw(NbGui* gui);
|
||||
bool gui_redraw_fs(Gui* gui);
|
||||
void gui_redraw(Gui* gui);
|
||||
|
||||
ViewPort* gui_view_port_find_enabled(ViewPortArray_t array) {
|
||||
// Iterating backward
|
||||
@@ -23,7 +23,7 @@ ViewPort* gui_view_port_find_enabled(ViewPortArray_t array) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t gui_active_view_port_count(NbGui* gui, GuiLayer layer) {
|
||||
size_t gui_active_view_port_count(Gui* gui, GuiLayer layer) {
|
||||
furi_assert(gui);
|
||||
furi_check(layer < GuiLayerMAX);
|
||||
size_t ret = 0;
|
||||
@@ -43,23 +43,23 @@ size_t gui_active_view_port_count(NbGui* gui, GuiLayer layer) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void gui_update(NbGui* gui) {
|
||||
void gui_update(Gui* gui) {
|
||||
ESP_LOGI(TAG, "gui_update");
|
||||
furi_assert(gui);
|
||||
furi_thread_flags_set(gui->thread_id, GUI_THREAD_FLAG_DRAW);
|
||||
}
|
||||
|
||||
void gui_lock(NbGui* gui) {
|
||||
void gui_lock(Gui* gui) {
|
||||
furi_assert(gui);
|
||||
furi_check(furi_mutex_acquire(gui->mutex, FuriWaitForever) == FuriStatusOk);
|
||||
}
|
||||
|
||||
void gui_unlock(NbGui* gui) {
|
||||
void gui_unlock(Gui* gui) {
|
||||
furi_assert(gui);
|
||||
furi_check(furi_mutex_release(gui->mutex) == FuriStatusOk);
|
||||
}
|
||||
|
||||
void gui_add_view_port(NbGui* gui, ViewPort* view_port, GuiLayer layer) {
|
||||
void gui_add_view_port(Gui* gui, ViewPort* view_port, GuiLayer layer) {
|
||||
furi_assert(gui);
|
||||
furi_assert(view_port);
|
||||
furi_check(layer < GuiLayerMAX);
|
||||
@@ -83,7 +83,7 @@ void gui_add_view_port(NbGui* gui, ViewPort* view_port, GuiLayer layer) {
|
||||
gui_update(gui);
|
||||
}
|
||||
|
||||
void gui_remove_view_port(NbGui* gui, ViewPort* view_port) {
|
||||
void gui_remove_view_port(Gui* gui, ViewPort* view_port) {
|
||||
furi_assert(gui);
|
||||
furi_assert(view_port);
|
||||
|
||||
@@ -111,7 +111,7 @@ void gui_remove_view_port(NbGui* gui, ViewPort* view_port) {
|
||||
gui_update(gui);
|
||||
}
|
||||
|
||||
void gui_view_port_send_to_front(NbGui* gui, ViewPort* view_port) {
|
||||
void gui_view_port_send_to_front(Gui* gui, ViewPort* view_port) {
|
||||
furi_assert(gui);
|
||||
furi_assert(view_port);
|
||||
|
||||
@@ -140,7 +140,7 @@ void gui_view_port_send_to_front(NbGui* gui, ViewPort* view_port) {
|
||||
gui_update(gui);
|
||||
}
|
||||
|
||||
void gui_view_port_send_to_back(NbGui* gui, ViewPort* view_port) {
|
||||
void gui_view_port_send_to_back(Gui* gui, ViewPort* view_port) {
|
||||
furi_assert(gui);
|
||||
furi_assert(view_port);
|
||||
|
||||
@@ -169,7 +169,7 @@ void gui_view_port_send_to_back(NbGui* gui, ViewPort* view_port) {
|
||||
gui_update(gui);
|
||||
}
|
||||
|
||||
void gui_set_lockdown(NbGui* gui, bool lockdown) {
|
||||
void gui_set_lockdown(Gui* gui, bool lockdown) {
|
||||
furi_assert(gui);
|
||||
|
||||
gui_lock(gui);
|
||||
@@ -180,8 +180,8 @@ void gui_set_lockdown(NbGui* gui, bool lockdown) {
|
||||
gui_update(gui);
|
||||
}
|
||||
|
||||
NbGui* gui_alloc() {
|
||||
NbGui* gui = malloc(sizeof(NbGui));
|
||||
Gui* gui_alloc() {
|
||||
Gui* gui = malloc(sizeof(Gui));
|
||||
gui->thread_id = furi_thread_get_current_id();
|
||||
gui->mutex = furi_mutex_alloc(FuriMutexTypeNormal);
|
||||
gui->lvgl_parent = lv_scr_act();
|
||||
@@ -204,7 +204,7 @@ NbGui* gui_alloc() {
|
||||
|
||||
__attribute((__noreturn__)) int32_t prv_gui_main(void* parameter) {
|
||||
UNUSED(parameter);
|
||||
NbGui* gui = gui_alloc();
|
||||
Gui* gui = gui_alloc();
|
||||
|
||||
furi_record_create(RECORD_GUI, gui);
|
||||
|
||||
@@ -231,7 +231,7 @@ __attribute((__noreturn__)) int32_t prv_gui_main(void* parameter) {
|
||||
}
|
||||
}
|
||||
|
||||
const NbApp gui_app = {
|
||||
const App gui_app = {
|
||||
.id = "gui",
|
||||
.name = "GUI",
|
||||
.type = SERVICE,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const NbApp gui_app;
|
||||
extern const App gui_app;
|
||||
|
||||
/** Canvas Orientation */
|
||||
typedef enum {
|
||||
@@ -42,7 +42,7 @@ typedef void (*GuiCanvasCommitCallback)(
|
||||
|
||||
#define RECORD_GUI "gui"
|
||||
|
||||
typedef struct NbGui NbGui;
|
||||
typedef struct Gui Gui;
|
||||
|
||||
/** Add view_port to view_port tree
|
||||
*
|
||||
@@ -52,7 +52,7 @@ typedef struct NbGui NbGui;
|
||||
* @param view_port ViewPort instance
|
||||
* @param[in] layer GuiLayer where to place view_port
|
||||
*/
|
||||
void gui_add_view_port(NbGui* gui, ViewPort* view_port, GuiLayer layer);
|
||||
void gui_add_view_port(Gui* gui, ViewPort* view_port, GuiLayer layer);
|
||||
|
||||
/** Remove view_port from rendering tree
|
||||
*
|
||||
@@ -61,7 +61,7 @@ void gui_add_view_port(NbGui* gui, ViewPort* view_port, GuiLayer layer);
|
||||
* @param gui Gui instance
|
||||
* @param view_port ViewPort instance
|
||||
*/
|
||||
void gui_remove_view_port(NbGui* gui, ViewPort* view_port);
|
||||
void gui_remove_view_port(Gui* gui, ViewPort* view_port);
|
||||
|
||||
/** Send ViewPort to the front
|
||||
*
|
||||
@@ -70,7 +70,7 @@ void gui_remove_view_port(NbGui* gui, ViewPort* view_port);
|
||||
* @param gui Gui instance
|
||||
* @param view_port ViewPort instance
|
||||
*/
|
||||
void gui_view_port_send_to_front(NbGui* gui, ViewPort* view_port);
|
||||
void gui_view_port_send_to_front(Gui* gui, ViewPort* view_port);
|
||||
|
||||
/** Send ViewPort to the back
|
||||
*
|
||||
@@ -79,7 +79,7 @@ void gui_view_port_send_to_front(NbGui* gui, ViewPort* view_port);
|
||||
* @param gui Gui instance
|
||||
* @param view_port ViewPort instance
|
||||
*/
|
||||
void gui_view_port_send_to_back(NbGui* gui, ViewPort* view_port);
|
||||
void gui_view_port_send_to_back(Gui* gui, ViewPort* view_port);
|
||||
|
||||
/** Set lockdown mode
|
||||
*
|
||||
@@ -89,7 +89,7 @@ void gui_view_port_send_to_back(NbGui* gui, ViewPort* view_port);
|
||||
* @param gui Gui instance
|
||||
* @param lockdown bool, true if enabled
|
||||
*/
|
||||
void gui_set_lockdown(NbGui* gui, bool lockdown);
|
||||
void gui_set_lockdown(Gui* gui, bool lockdown);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "check.h"
|
||||
#include "gui_i.h"
|
||||
|
||||
static void gui_redraw_status_bar(NbGui* gui, bool need_attention) {
|
||||
static void gui_redraw_status_bar(Gui* gui, bool need_attention) {
|
||||
/*
|
||||
ViewPortArray_it_t it;
|
||||
uint8_t left_used = 0;
|
||||
@@ -149,7 +149,7 @@ static void gui_redraw_status_bar(NbGui* gui, bool need_attention) {
|
||||
*/
|
||||
}
|
||||
|
||||
static bool gui_redraw_window(NbGui* gui) {
|
||||
static bool gui_redraw_window(Gui* gui) {
|
||||
/*
|
||||
canvas_frame_set(gui->lvgl_parent, GUI_WINDOW_X, GUI_WINDOW_Y, GUI_WINDOW_WIDTH, GUI_WINDOW_HEIGHT);
|
||||
ViewPort* view_port = gui_view_port_find_enabled(gui->layers[GuiLayerWindow]);
|
||||
@@ -161,7 +161,7 @@ static bool gui_redraw_window(NbGui* gui) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool gui_redraw_desktop(NbGui* gui) {
|
||||
static bool gui_redraw_desktop(Gui* gui) {
|
||||
/*
|
||||
canvas_frame_set(gui->lvgl_parent, 0, 0, GUI_DISPLAY_WIDTH, GUI_DISPLAY_HEIGHT);
|
||||
ViewPort* view_port = gui_view_port_find_enabled(gui->layers[GuiLayerDesktop]);
|
||||
@@ -174,7 +174,7 @@ static bool gui_redraw_desktop(NbGui* gui) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool gui_redraw_fs(NbGui* gui) {
|
||||
bool gui_redraw_fs(Gui* gui) {
|
||||
ViewPort* view_port = gui_view_port_find_enabled(gui->layers[GuiLayerFullscreen]);
|
||||
if (view_port) {
|
||||
view_port_draw(view_port, gui->lvgl_parent);
|
||||
@@ -184,7 +184,7 @@ bool gui_redraw_fs(NbGui* gui) {
|
||||
}
|
||||
}
|
||||
|
||||
void gui_redraw(NbGui* gui) {
|
||||
void gui_redraw(Gui* gui) {
|
||||
furi_assert(gui);
|
||||
gui_lock(gui);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ typedef struct {
|
||||
} CanvasCallbackPair;
|
||||
|
||||
/** Gui structure */
|
||||
struct NbGui {
|
||||
struct Gui {
|
||||
// Thread and lock
|
||||
FuriThreadId thread_id;
|
||||
FuriMutex* mutex;
|
||||
@@ -75,7 +75,7 @@ ViewPort* gui_view_port_find_enabled(ViewPortArray_t array);
|
||||
*
|
||||
* @param gui Gui instance
|
||||
*/
|
||||
void gui_update(NbGui* gui);
|
||||
void gui_update(Gui* gui);
|
||||
|
||||
///** Input event callback
|
||||
// *
|
||||
@@ -91,16 +91,16 @@ void gui_update(NbGui* gui);
|
||||
* @param gui The Gui instance
|
||||
* @param[in] layer GuiLayer that we want to get count of view ports
|
||||
*/
|
||||
size_t gui_active_view_port_count(NbGui* gui, GuiLayer layer);
|
||||
size_t gui_active_view_port_count(Gui* gui, GuiLayer layer);
|
||||
|
||||
/** Lock GUI
|
||||
*
|
||||
* @param gui The Gui instance
|
||||
*/
|
||||
void gui_lock(NbGui* gui);
|
||||
void gui_lock(Gui* gui);
|
||||
|
||||
/** Unlock GUI
|
||||
*
|
||||
* @param gui The Gui instance
|
||||
*/
|
||||
void gui_unlock(NbGui* gui);
|
||||
void gui_unlock(Gui* gui);
|
||||
|
||||
@@ -68,7 +68,7 @@ void view_port_update(ViewPort* view_port) {
|
||||
furi_mutex_release(view_port->mutex);
|
||||
}
|
||||
|
||||
void view_port_gui_set(ViewPort* view_port, NbGui* gui) {
|
||||
void view_port_gui_set(ViewPort* view_port, Gui* gui) {
|
||||
furi_assert(view_port);
|
||||
furi_check(furi_mutex_acquire(view_port->mutex, FuriWaitForever) == FuriStatusOk);
|
||||
view_port->gui = gui;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "view_port.h"
|
||||
|
||||
struct ViewPort {
|
||||
NbGui* gui;
|
||||
Gui* gui;
|
||||
FuriMutex* mutex;
|
||||
bool is_enabled;
|
||||
|
||||
@@ -25,7 +25,7 @@ struct ViewPort {
|
||||
* @param view_port ViewPort instance
|
||||
* @param gui gui instance pointer
|
||||
*/
|
||||
void view_port_gui_set(ViewPort* view_port, NbGui* gui);
|
||||
void view_port_gui_set(ViewPort* view_port, Gui* gui);
|
||||
|
||||
/** Process draw call. Calls draw callback.
|
||||
*
|
||||
|
||||
@@ -7,7 +7,7 @@ static int32_t prv_loader_main(void* param) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const NbApp loader_app = {
|
||||
const App loader_app = {
|
||||
.id = "loader",
|
||||
.name = "Loader",
|
||||
.type = SERVICE,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const NbApp loader_app;
|
||||
extern const App loader_app;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user