Files
Momentum-Firmware/applications/services/desktop/desktop_settings.h
Nikolay Minaylov 15f92f765d [FL-3479] Desktop: more favorites, configurable dummy mode (#2972)
* Desktop: more favorite app shortcuts
* Making PVS happy
* Desktop settings submenu fix

Co-authored-by: あく <alleteam@gmail.com>
2023-08-23 21:26:47 +09:00

61 lines
1.4 KiB
C

#pragma once
#include <furi_hal.h>
#include <stdint.h>
#include <stdbool.h>
#include <toolbox/saved_struct.h>
#include <storage/storage.h>
#define DESKTOP_SETTINGS_OLD_PATH CFG_PATH("desktop.settings")
#define DESKTOP_SETTINGS_PATH INT_PATH(".desktop.settings")
#define DESKTOP_SETTINGS_MAGIC (0x17)
#define DESKTOP_SETTINGS_VER (11)
#define DESKTOP_KEYBINDS_OLD_PATH CFG_PATH(".desktop.keybinds")
#define DESKTOP_KEYBINDS_PATH CFG_PATH("desktop.keybinds")
#define DESKTOP_KEYBINDS_MAGIC (0x14)
#define DESKTOP_KEYBINDS_VER (1)
#define DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG "run_pin_setup"
#define MAX_PIN_SIZE 10
#define MIN_PIN_SIZE 4
#define MAX_KEYBIND_LENGTH 64
typedef struct {
InputKey data[MAX_PIN_SIZE];
uint8_t length;
} PinCode;
typedef struct {
char data[MAX_KEYBIND_LENGTH];
} Keybind;
typedef enum {
KeybindTypePress,
KeybindTypeHold,
KeybindTypeCount,
} KeybindType;
typedef enum {
KeybindKeyUp,
KeybindKeyDown,
KeybindKeyRight,
KeybindKeyLeft,
KeybindKeyCount,
} KeybindKey;
typedef struct {
PinCode pin_code;
uint32_t auto_lock_delay_ms;
bool auto_lock_with_pin;
} DesktopSettings;
bool DESKTOP_SETTINGS_SAVE(DesktopSettings* x);
bool DESKTOP_SETTINGS_LOAD(DesktopSettings* x);
bool DESKTOP_KEYBINDS_SAVE(Keybind (*x)[KeybindTypeCount][KeybindKeyCount], size_t size);
bool DESKTOP_KEYBINDS_LOAD(Keybind (*x)[KeybindTypeCount][KeybindKeyCount], size_t size);