|
|
@@ -5,9 +5,11 @@
|
|
|
* @param context The context - unused
|
|
|
* @return next view id (VIEW_NONE to exit the app)
|
|
|
*/
|
|
|
-uint32_t easy_flipper_callback_exit_app(void* context) {
|
|
|
+uint32_t easy_flipper_callback_exit_app(void *context)
|
|
|
+{
|
|
|
// Exit the application
|
|
|
- if(!context) {
|
|
|
+ if (!context)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Context is NULL");
|
|
|
return VIEW_NONE;
|
|
|
}
|
|
|
@@ -21,13 +23,16 @@ uint32_t easy_flipper_callback_exit_app(void* context) {
|
|
|
* @param buffer_size The size of the buffer
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
-bool easy_flipper_set_buffer(char** buffer, uint32_t buffer_size) {
|
|
|
- if(!buffer) {
|
|
|
+bool easy_flipper_set_buffer(char **buffer, uint32_t buffer_size)
|
|
|
+{
|
|
|
+ if (!buffer)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_buffer");
|
|
|
return false;
|
|
|
}
|
|
|
- *buffer = (char*)malloc(buffer_size);
|
|
|
- if(!*buffer) {
|
|
|
+ *buffer = (char *)malloc(buffer_size);
|
|
|
+ if (!*buffer)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate buffer");
|
|
|
return false;
|
|
|
}
|
|
|
@@ -46,32 +51,39 @@ bool easy_flipper_set_buffer(char** buffer, uint32_t buffer_size) {
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
bool easy_flipper_set_view(
|
|
|
- View** view,
|
|
|
+ View **view,
|
|
|
int32_t view_id,
|
|
|
- void draw_callback(Canvas*, void*),
|
|
|
- bool input_callback(InputEvent*, void*),
|
|
|
- uint32_t (*previous_callback)(void*),
|
|
|
- ViewDispatcher** view_dispatcher,
|
|
|
- void* context) {
|
|
|
- if(!view || !view_dispatcher) {
|
|
|
+ void draw_callback(Canvas *, void *),
|
|
|
+ bool input_callback(InputEvent *, void *),
|
|
|
+ uint32_t (*previous_callback)(void *),
|
|
|
+ ViewDispatcher **view_dispatcher,
|
|
|
+ void *context)
|
|
|
+{
|
|
|
+ if (!view || !view_dispatcher)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_view");
|
|
|
return false;
|
|
|
}
|
|
|
*view = view_alloc();
|
|
|
- if(!*view) {
|
|
|
+ if (!*view)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate View");
|
|
|
return false;
|
|
|
}
|
|
|
- if(draw_callback) {
|
|
|
+ if (draw_callback)
|
|
|
+ {
|
|
|
view_set_draw_callback(*view, draw_callback);
|
|
|
}
|
|
|
- if(input_callback) {
|
|
|
+ if (input_callback)
|
|
|
+ {
|
|
|
view_set_input_callback(*view, input_callback);
|
|
|
}
|
|
|
- if(context) {
|
|
|
+ if (context)
|
|
|
+ {
|
|
|
view_set_context(*view, context);
|
|
|
}
|
|
|
- if(previous_callback) {
|
|
|
+ if (previous_callback)
|
|
|
+ {
|
|
|
view_set_previous_callback(*view, previous_callback);
|
|
|
}
|
|
|
view_dispatcher_add_view(*view_dispatcher, view_id, *view);
|
|
|
@@ -85,18 +97,22 @@ bool easy_flipper_set_view(
|
|
|
* @param context The context to pass to the event callback
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
-bool easy_flipper_set_view_dispatcher(ViewDispatcher** view_dispatcher, Gui* gui, void* context) {
|
|
|
- if(!view_dispatcher) {
|
|
|
+bool easy_flipper_set_view_dispatcher(ViewDispatcher **view_dispatcher, Gui *gui, void *context)
|
|
|
+{
|
|
|
+ if (!view_dispatcher)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_view_dispatcher");
|
|
|
return false;
|
|
|
}
|
|
|
*view_dispatcher = view_dispatcher_alloc();
|
|
|
- if(!*view_dispatcher) {
|
|
|
+ if (!*view_dispatcher)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate ViewDispatcher");
|
|
|
return false;
|
|
|
}
|
|
|
view_dispatcher_attach_to_gui(*view_dispatcher, gui, ViewDispatcherTypeFullscreen);
|
|
|
- if(context) {
|
|
|
+ if (context)
|
|
|
+ {
|
|
|
view_dispatcher_set_event_callback_context(*view_dispatcher, context);
|
|
|
}
|
|
|
return true;
|
|
|
@@ -113,24 +129,29 @@ bool easy_flipper_set_view_dispatcher(ViewDispatcher** view_dispatcher, Gui* gui
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
bool easy_flipper_set_submenu(
|
|
|
- Submenu** submenu,
|
|
|
+ Submenu **submenu,
|
|
|
int32_t view_id,
|
|
|
- char* title,
|
|
|
- uint32_t(previous_callback)(void*),
|
|
|
- ViewDispatcher** view_dispatcher) {
|
|
|
- if(!submenu) {
|
|
|
+ char *title,
|
|
|
+ uint32_t(previous_callback)(void *),
|
|
|
+ ViewDispatcher **view_dispatcher)
|
|
|
+{
|
|
|
+ if (!submenu)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_submenu");
|
|
|
return false;
|
|
|
}
|
|
|
*submenu = submenu_alloc();
|
|
|
- if(!*submenu) {
|
|
|
+ if (!*submenu)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate Submenu");
|
|
|
return false;
|
|
|
}
|
|
|
- if(title) {
|
|
|
+ if (title)
|
|
|
+ {
|
|
|
submenu_set_header(*submenu, title);
|
|
|
}
|
|
|
- if(previous_callback) {
|
|
|
+ if (previous_callback)
|
|
|
+ {
|
|
|
view_set_previous_callback(submenu_get_view(*submenu), previous_callback);
|
|
|
}
|
|
|
view_dispatcher_add_view(*view_dispatcher, view_id, submenu_get_view(*submenu));
|
|
|
@@ -147,20 +168,24 @@ bool easy_flipper_set_submenu(
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
bool easy_flipper_set_menu(
|
|
|
- Menu** menu,
|
|
|
+ Menu **menu,
|
|
|
int32_t view_id,
|
|
|
- uint32_t(previous_callback)(void*),
|
|
|
- ViewDispatcher** view_dispatcher) {
|
|
|
- if(!menu) {
|
|
|
+ uint32_t(previous_callback)(void *),
|
|
|
+ ViewDispatcher **view_dispatcher)
|
|
|
+{
|
|
|
+ if (!menu)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_menu");
|
|
|
return false;
|
|
|
}
|
|
|
*menu = menu_alloc();
|
|
|
- if(!*menu) {
|
|
|
+ if (!*menu)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate Menu");
|
|
|
return false;
|
|
|
}
|
|
|
- if(previous_callback) {
|
|
|
+ if (previous_callback)
|
|
|
+ {
|
|
|
view_set_previous_callback(menu_get_view(*menu), previous_callback);
|
|
|
}
|
|
|
view_dispatcher_add_view(*view_dispatcher, view_id, menu_get_view(*menu));
|
|
|
@@ -177,24 +202,29 @@ bool easy_flipper_set_menu(
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
bool easy_flipper_set_widget(
|
|
|
- Widget** widget,
|
|
|
+ Widget **widget,
|
|
|
int32_t view_id,
|
|
|
- char* text,
|
|
|
- uint32_t(previous_callback)(void*),
|
|
|
- ViewDispatcher** view_dispatcher) {
|
|
|
- if(!widget) {
|
|
|
+ char *text,
|
|
|
+ uint32_t(previous_callback)(void *),
|
|
|
+ ViewDispatcher **view_dispatcher)
|
|
|
+{
|
|
|
+ if (!widget)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_widget");
|
|
|
return false;
|
|
|
}
|
|
|
*widget = widget_alloc();
|
|
|
- if(!*widget) {
|
|
|
+ if (!*widget)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate Widget");
|
|
|
return false;
|
|
|
}
|
|
|
- if(text) {
|
|
|
+ if (text)
|
|
|
+ {
|
|
|
widget_add_text_scroll_element(*widget, 0, 0, 128, 64, text);
|
|
|
}
|
|
|
- if(previous_callback) {
|
|
|
+ if (previous_callback)
|
|
|
+ {
|
|
|
view_set_previous_callback(widget_get_view(*widget), previous_callback);
|
|
|
}
|
|
|
view_dispatcher_add_view(*view_dispatcher, view_id, widget_get_view(*widget));
|
|
|
@@ -213,30 +243,33 @@ bool easy_flipper_set_widget(
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
bool easy_flipper_set_variable_item_list(
|
|
|
- VariableItemList** variable_item_list,
|
|
|
+ VariableItemList **variable_item_list,
|
|
|
int32_t view_id,
|
|
|
- void (*enter_callback)(void*, uint32_t),
|
|
|
- uint32_t(previous_callback)(void*),
|
|
|
- ViewDispatcher** view_dispatcher,
|
|
|
- void* context) {
|
|
|
- if(!variable_item_list) {
|
|
|
+ void (*enter_callback)(void *, uint32_t),
|
|
|
+ uint32_t(previous_callback)(void *),
|
|
|
+ ViewDispatcher **view_dispatcher,
|
|
|
+ void *context)
|
|
|
+{
|
|
|
+ if (!variable_item_list)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_variable_item_list");
|
|
|
return false;
|
|
|
}
|
|
|
*variable_item_list = variable_item_list_alloc();
|
|
|
- if(!*variable_item_list) {
|
|
|
+ if (!*variable_item_list)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate VariableItemList");
|
|
|
return false;
|
|
|
}
|
|
|
- if(enter_callback) {
|
|
|
+ if (enter_callback)
|
|
|
+ {
|
|
|
variable_item_list_set_enter_callback(*variable_item_list, enter_callback, context);
|
|
|
}
|
|
|
- if(previous_callback) {
|
|
|
- view_set_previous_callback(
|
|
|
- variable_item_list_get_view(*variable_item_list), previous_callback);
|
|
|
+ if (previous_callback)
|
|
|
+ {
|
|
|
+ view_set_previous_callback(variable_item_list_get_view(*variable_item_list), previous_callback);
|
|
|
}
|
|
|
- view_dispatcher_add_view(
|
|
|
- *view_dispatcher, view_id, variable_item_list_get_view(*variable_item_list));
|
|
|
+ view_dispatcher_add_view(*view_dispatcher, view_id, variable_item_list_get_view(*variable_item_list));
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -249,38 +282,38 @@ bool easy_flipper_set_variable_item_list(
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
bool easy_flipper_set_text_input(
|
|
|
- TextInput** text_input,
|
|
|
+ TextInput **text_input,
|
|
|
int32_t view_id,
|
|
|
- char* header_text,
|
|
|
- char* text_input_temp_buffer,
|
|
|
+ char *header_text,
|
|
|
+ char *text_input_temp_buffer,
|
|
|
uint32_t text_input_buffer_size,
|
|
|
- void (*result_callback)(void*),
|
|
|
- uint32_t(previous_callback)(void*),
|
|
|
- ViewDispatcher** view_dispatcher,
|
|
|
- void* context) {
|
|
|
- if(!text_input) {
|
|
|
+ void (*result_callback)(void *),
|
|
|
+ uint32_t(previous_callback)(void *),
|
|
|
+ ViewDispatcher **view_dispatcher,
|
|
|
+ void *context)
|
|
|
+{
|
|
|
+ if (!text_input)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_text_input");
|
|
|
return false;
|
|
|
}
|
|
|
*text_input = text_input_alloc();
|
|
|
- if(!*text_input) {
|
|
|
+ if (!*text_input)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate TextInput");
|
|
|
return false;
|
|
|
}
|
|
|
- if(previous_callback) {
|
|
|
+ if (previous_callback)
|
|
|
+ {
|
|
|
view_set_previous_callback(text_input_get_view(*text_input), previous_callback);
|
|
|
}
|
|
|
- if(header_text) {
|
|
|
+ if (header_text)
|
|
|
+ {
|
|
|
text_input_set_header_text(*text_input, header_text);
|
|
|
}
|
|
|
- if(text_input_temp_buffer && text_input_buffer_size && result_callback) {
|
|
|
- text_input_set_result_callback(
|
|
|
- *text_input,
|
|
|
- result_callback,
|
|
|
- context,
|
|
|
- text_input_temp_buffer,
|
|
|
- text_input_buffer_size,
|
|
|
- false);
|
|
|
+ if (text_input_temp_buffer && text_input_buffer_size && result_callback)
|
|
|
+ {
|
|
|
+ text_input_set_result_callback(*text_input, result_callback, context, text_input_temp_buffer, text_input_buffer_size, false);
|
|
|
}
|
|
|
view_dispatcher_add_view(*view_dispatcher, view_id, text_input_get_view(*text_input));
|
|
|
return true;
|
|
|
@@ -295,38 +328,38 @@ bool easy_flipper_set_text_input(
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
bool easy_flipper_set_uart_text_input(
|
|
|
- TextInput** uart_text_input,
|
|
|
+ TextInput **uart_text_input,
|
|
|
int32_t view_id,
|
|
|
- char* header_text,
|
|
|
- char* uart_text_input_temp_buffer,
|
|
|
+ char *header_text,
|
|
|
+ char *uart_text_input_temp_buffer,
|
|
|
uint32_t uart_text_input_buffer_size,
|
|
|
- void (*result_callback)(void*),
|
|
|
- uint32_t(previous_callback)(void*),
|
|
|
- ViewDispatcher** view_dispatcher,
|
|
|
- void* context) {
|
|
|
- if(!uart_text_input) {
|
|
|
+ void (*result_callback)(void *),
|
|
|
+ uint32_t(previous_callback)(void *),
|
|
|
+ ViewDispatcher **view_dispatcher,
|
|
|
+ void *context)
|
|
|
+{
|
|
|
+ if (!uart_text_input)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_uart_text_input");
|
|
|
return false;
|
|
|
}
|
|
|
*uart_text_input = text_input_alloc();
|
|
|
- if(!*uart_text_input) {
|
|
|
+ if (!*uart_text_input)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate UART_TextInput");
|
|
|
return false;
|
|
|
}
|
|
|
- if(previous_callback) {
|
|
|
+ if (previous_callback)
|
|
|
+ {
|
|
|
view_set_previous_callback(text_input_get_view(*uart_text_input), previous_callback);
|
|
|
}
|
|
|
- if(header_text) {
|
|
|
+ if (header_text)
|
|
|
+ {
|
|
|
text_input_set_header_text(*uart_text_input, header_text);
|
|
|
}
|
|
|
- if(uart_text_input_temp_buffer && uart_text_input_buffer_size && result_callback) {
|
|
|
- text_input_set_result_callback(
|
|
|
- *uart_text_input,
|
|
|
- result_callback,
|
|
|
- context,
|
|
|
- uart_text_input_temp_buffer,
|
|
|
- uart_text_input_buffer_size,
|
|
|
- false);
|
|
|
+ if (uart_text_input_temp_buffer && uart_text_input_buffer_size && result_callback)
|
|
|
+ {
|
|
|
+ text_input_set_result_callback(*uart_text_input, result_callback, context, uart_text_input_temp_buffer, uart_text_input_buffer_size, false);
|
|
|
}
|
|
|
text_input_show_illegal_symbols(*uart_text_input, true);
|
|
|
view_dispatcher_add_view(*view_dispatcher, view_id, text_input_get_view(*uart_text_input));
|
|
|
@@ -353,52 +386,63 @@ bool easy_flipper_set_uart_text_input(
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
bool easy_flipper_set_dialog_ex(
|
|
|
- DialogEx** dialog_ex,
|
|
|
+ DialogEx **dialog_ex,
|
|
|
int32_t view_id,
|
|
|
- char* header,
|
|
|
+ char *header,
|
|
|
uint16_t header_x,
|
|
|
uint16_t header_y,
|
|
|
- char* text,
|
|
|
+ char *text,
|
|
|
uint16_t text_x,
|
|
|
uint16_t text_y,
|
|
|
- char* left_button_text,
|
|
|
- char* right_button_text,
|
|
|
- char* center_button_text,
|
|
|
- void (*result_callback)(DialogExResult, void*),
|
|
|
- uint32_t(previous_callback)(void*),
|
|
|
- ViewDispatcher** view_dispatcher,
|
|
|
- void* context) {
|
|
|
- if(!dialog_ex) {
|
|
|
+ char *left_button_text,
|
|
|
+ char *right_button_text,
|
|
|
+ char *center_button_text,
|
|
|
+ void (*result_callback)(DialogExResult, void *),
|
|
|
+ uint32_t(previous_callback)(void *),
|
|
|
+ ViewDispatcher **view_dispatcher,
|
|
|
+ void *context)
|
|
|
+{
|
|
|
+ if (!dialog_ex)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_dialog_ex");
|
|
|
return false;
|
|
|
}
|
|
|
*dialog_ex = dialog_ex_alloc();
|
|
|
- if(!*dialog_ex) {
|
|
|
+ if (!*dialog_ex)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate DialogEx");
|
|
|
return false;
|
|
|
}
|
|
|
- if(header) {
|
|
|
+ if (header)
|
|
|
+ {
|
|
|
dialog_ex_set_header(*dialog_ex, header, header_x, header_y, AlignLeft, AlignTop);
|
|
|
}
|
|
|
- if(text) {
|
|
|
+ if (text)
|
|
|
+ {
|
|
|
dialog_ex_set_text(*dialog_ex, text, text_x, text_y, AlignLeft, AlignTop);
|
|
|
}
|
|
|
- if(left_button_text) {
|
|
|
+ if (left_button_text)
|
|
|
+ {
|
|
|
dialog_ex_set_left_button_text(*dialog_ex, left_button_text);
|
|
|
}
|
|
|
- if(right_button_text) {
|
|
|
+ if (right_button_text)
|
|
|
+ {
|
|
|
dialog_ex_set_right_button_text(*dialog_ex, right_button_text);
|
|
|
}
|
|
|
- if(center_button_text) {
|
|
|
+ if (center_button_text)
|
|
|
+ {
|
|
|
dialog_ex_set_center_button_text(*dialog_ex, center_button_text);
|
|
|
}
|
|
|
- if(result_callback) {
|
|
|
+ if (result_callback)
|
|
|
+ {
|
|
|
dialog_ex_set_result_callback(*dialog_ex, result_callback);
|
|
|
}
|
|
|
- if(previous_callback) {
|
|
|
+ if (previous_callback)
|
|
|
+ {
|
|
|
view_set_previous_callback(dialog_ex_get_view(*dialog_ex), previous_callback);
|
|
|
}
|
|
|
- if(context) {
|
|
|
+ if (context)
|
|
|
+ {
|
|
|
dialog_ex_set_context(*dialog_ex, context);
|
|
|
}
|
|
|
view_dispatcher_add_view(*view_dispatcher, view_id, dialog_ex_get_view(*dialog_ex));
|
|
|
@@ -422,40 +466,48 @@ bool easy_flipper_set_dialog_ex(
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
bool easy_flipper_set_popup(
|
|
|
- Popup** popup,
|
|
|
+ Popup **popup,
|
|
|
int32_t view_id,
|
|
|
- char* header,
|
|
|
+ char *header,
|
|
|
uint16_t header_x,
|
|
|
uint16_t header_y,
|
|
|
- char* text,
|
|
|
+ char *text,
|
|
|
uint16_t text_x,
|
|
|
uint16_t text_y,
|
|
|
- void (*result_callback)(void*),
|
|
|
- uint32_t(previous_callback)(void*),
|
|
|
- ViewDispatcher** view_dispatcher,
|
|
|
- void* context) {
|
|
|
- if(!popup) {
|
|
|
+ void (*result_callback)(void *),
|
|
|
+ uint32_t(previous_callback)(void *),
|
|
|
+ ViewDispatcher **view_dispatcher,
|
|
|
+ void *context)
|
|
|
+{
|
|
|
+ if (!popup)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_popup");
|
|
|
return false;
|
|
|
}
|
|
|
*popup = popup_alloc();
|
|
|
- if(!*popup) {
|
|
|
+ if (!*popup)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate Popup");
|
|
|
return false;
|
|
|
}
|
|
|
- if(header) {
|
|
|
+ if (header)
|
|
|
+ {
|
|
|
popup_set_header(*popup, header, header_x, header_y, AlignLeft, AlignTop);
|
|
|
}
|
|
|
- if(text) {
|
|
|
+ if (text)
|
|
|
+ {
|
|
|
popup_set_text(*popup, text, text_x, text_y, AlignLeft, AlignTop);
|
|
|
}
|
|
|
- if(result_callback) {
|
|
|
+ if (result_callback)
|
|
|
+ {
|
|
|
popup_set_callback(*popup, result_callback);
|
|
|
}
|
|
|
- if(previous_callback) {
|
|
|
+ if (previous_callback)
|
|
|
+ {
|
|
|
view_set_previous_callback(popup_get_view(*popup), previous_callback);
|
|
|
}
|
|
|
- if(context) {
|
|
|
+ if (context)
|
|
|
+ {
|
|
|
popup_set_context(*popup, context);
|
|
|
}
|
|
|
view_dispatcher_add_view(*view_dispatcher, view_id, popup_get_view(*popup));
|
|
|
@@ -471,20 +523,24 @@ bool easy_flipper_set_popup(
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
bool easy_flipper_set_loading(
|
|
|
- Loading** loading,
|
|
|
+ Loading **loading,
|
|
|
int32_t view_id,
|
|
|
- uint32_t(previous_callback)(void*),
|
|
|
- ViewDispatcher** view_dispatcher) {
|
|
|
- if(!loading) {
|
|
|
+ uint32_t(previous_callback)(void *),
|
|
|
+ ViewDispatcher **view_dispatcher)
|
|
|
+{
|
|
|
+ if (!loading)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_loading");
|
|
|
return false;
|
|
|
}
|
|
|
*loading = loading_alloc();
|
|
|
- if(!*loading) {
|
|
|
+ if (!*loading)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate Loading");
|
|
|
return false;
|
|
|
}
|
|
|
- if(previous_callback) {
|
|
|
+ if (previous_callback)
|
|
|
+ {
|
|
|
view_set_previous_callback(loading_get_view(*loading), previous_callback);
|
|
|
}
|
|
|
view_dispatcher_add_view(*view_dispatcher, view_id, loading_get_view(*loading));
|
|
|
@@ -497,16 +553,19 @@ bool easy_flipper_set_loading(
|
|
|
* @param buffer The buffer to copy the string to
|
|
|
* @return true if successful, false otherwise
|
|
|
*/
|
|
|
-bool easy_flipper_set_char_to_furi_string(FuriString** furi_string, char* buffer) {
|
|
|
- if(!furi_string) {
|
|
|
+bool easy_flipper_set_char_to_furi_string(FuriString **furi_string, char *buffer)
|
|
|
+{
|
|
|
+ if (!furi_string)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Invalid arguments provided to set_buffer_to_furi_string");
|
|
|
return false;
|
|
|
}
|
|
|
*furi_string = furi_string_alloc();
|
|
|
- if(!furi_string) {
|
|
|
+ if (!furi_string)
|
|
|
+ {
|
|
|
FURI_LOG_E(EASY_TAG, "Failed to allocate FuriString");
|
|
|
return false;
|
|
|
}
|
|
|
furi_string_set_str(*furi_string, buffer);
|
|
|
return true;
|
|
|
-}
|
|
|
+}
|