Files
Momentum-Firmware/applications/services/desktop/desktop_settings.h
MMX f75fcd4e34 UI: Clock on Desktop (#2891)
* Clock on desktop
* Gui: gui_active_view_port_count
* Gui: move gui_active_view_port_count to private header, update docs
* Desktop: simplify desktop clock code
* Desktop: refactor clock
* Desktop: optimize clock code
* Desktop: 3rd cleanup round
* Desktop: 4th cleanup round, missing bits and pieces

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2023-08-11 01:10:15 +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);