#pragma once #include #include #include #include #include "mag_icons.h" #define MAG_DEV_NAME_MAX_LEN 22 #define MAG_APP_FOLDER ANY_PATH("mag") #define MAG_APP_EXTENSION ".mag" typedef void (*MagLoadingCallback)(void* context, bool state); typedef struct MagDevice MagDevice; struct MagDevice { Storage* storage; DialogsApp* dialogs; FuriString* dev_data; char dev_name[MAG_DEV_NAME_MAX_LEN + 1]; FuriString* load_path; MagLoadingCallback loading_cb; void* loading_cb_ctx; }; MagDevice* mag_device_alloc(); void mag_device_free(MagDevice* mag_dev); void mag_device_set_name(MagDevice* mag_dev, const char* name); bool mag_device_save(MagDevice* mag_dev, const char* dev_name); bool mag_file_select(MagDevice* mag_dev); void mag_device_data_clear(FuriString* dev_data); void mag_device_clear(MagDevice* mag_dev); bool mag_device_delete(MagDevice* mag_dev, bool use_load_path); void mag_device_set_loading_callback( MagDevice* mag_dev, MagLoadingCallback callback, void* context);