-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathsettings.h
More file actions
executable file
·127 lines (101 loc) · 2.73 KB
/
settings.h
File metadata and controls
executable file
·127 lines (101 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#pragma once
#include <pebble.h>
#include "sidebar_widgets.h"
#define CURRENT_SETTINGS_VERSION 7
// persistent storage keys
#define SETTINGS_PERSIST_KEY 100
#define SETTINGS_VERSION_PERSIST_KEY 4
#define FONT_SETTING_DEFAULT 0
#define FONT_SETTING_LECO 1
#define FONT_SETTING_BOLD 2
#define FONT_SETTING_BOLD_H 3
#define FONT_SETTING_BOLD_M 4
typedef enum {
NO_VIBE = 0,
VIBE_EVERY_HOUR = 1,
VIBE_EVERY_HALF_HOUR = 2
} VibeIntervalType;
// Settings struct -- note, all new settings should ALWAYS be added to the bottom
typedef struct {
// color settings
GColor timeColor;
GColor timeBgColor;
GColor sidebarColor;
GColor sidebarTextColor;
// general settings
uint8_t languageId;
bool showLeadingZero;
uint8_t clockFontId;
// vibration settings
bool btVibe;
VibeIntervalType hourlyVibe;
// sidebar settings
SidebarWidgetType widgets[3];
bool sidebarOnLeft;
bool useLargeFonts;
bool activateDisconnectIcon;
// weather widget settings
bool useMetric;
// battery meter widget settings
bool showBatteryPct;
bool disableAutobattery;
// alt tz widget settings
char altclockName[8];
int altclockOffset;
// health widget Settings
bool healthUseDistance;
bool healthUseRestfulSleep;
char decimalSeparator;
// apparent temperature option
bool useApparentTemperature;
} Settings;
// Dynamic settings (calculated at runtime based on currently-selected widgets)
typedef struct {
bool disableWeather;
bool updateScreenEverySecond;
bool enableAutoBatteryWidget;
bool enableBeats;
bool enableAltTimeZone;
GColor iconFillColor;
GColor iconStrokeColor;
} DynamicSettings;
// Legacy packed settings struct
// this is now deprecated, and will be removed in the next version
typedef struct {
GColor timeColor;
GColor timeBgColor;
GColor sidebarColor;
GColor sidebarTextColor;
// general settings
uint8_t languageId;
uint8_t showLeadingZero:1;
uint8_t clockFontId:7;
// vibration settings
uint8_t btVibe:1;
int8_t hourlyVibe:7;
// sidebar settings
uint8_t widgets[3];
uint8_t sidebarOnLeft:1;
uint8_t useLargeFonts:1;
// weather widget settings
uint8_t useMetric:1;
// battery meter widget settings
uint8_t showBatteryPct:1;
uint8_t disableAutobattery:1;
// health widget Settings
uint8_t healthUseDistance:1;
uint8_t healthUseRestfulSleep:1;
char decimalSeparator;
// alt tz widget settings
char altclockName[8];
int8_t altclockOffset;
// bluetooth disconnection icon
int8_t activateDisconnectIcon:1;
} LegacyStoredSettings;
extern Settings settings;
extern DynamicSettings dynamicSettings;
void Settings_init();
void Settings_deinit();
void Settings_loadFromStorage();
void Settings_saveToStorage();
void Settings_updateDynamicSettings();