-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsana.h
45 lines (33 loc) · 1.37 KB
/
sana.h
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
//
// sana.h
//
// Created by Tomi Casagrande on 30/10/2020.
// Copyright © 2020 Tomi Casagrande. All rights reserved.
#define PLIST @"/var/mobile/Library/Preferences/com.samoht.sana.plist"
BOOL isEnabled;
// Label.
BOOL wantsLabelHidden;
// Y axis.
BOOL wantsToChangeAxis;
int Y;
// Width (only for mini state).
BOOL wantsToChangeWidth;
double width;
// Glyph.
BOOL wantsGlyph;
int glyphSize;
static void loadPreferences() {
NSMutableDictionary *prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:PLIST];
isEnabled = [prefs objectForKey:@"isEnabled"] ? [[prefs objectForKey:@"isEnabled"] boolValue] : YES;
// Label.
wantsLabelHidden = [prefs objectForKey:@"wantsLabelHidden"] ? [[prefs objectForKey:@"wantsLabelHidden"] boolValue] : YES;
// Y axis.
wantsToChangeAxis = [prefs objectForKey:@"wantsToChangeAxis"] ? [[prefs objectForKey:@"wantsToChangeAxis"] boolValue] : NO;
Y = [[prefs objectForKey:@"Y"] intValue];
// Width (only for mini state).
wantsToChangeWidth = [prefs objectForKey:@"wantsToChangeWidth"] ? [[prefs objectForKey:@"wantsToChangeWidth"] boolValue] : NO;
width = [[prefs objectForKey:@"width"] doubleValue];
// Glyph.
wantsGlyph = [prefs objectForKey:@"wantsGlyph"] ? [[prefs objectForKey:@"wantsGlyph"] boolValue] : NO;
glyphSize = [[prefs objectForKey:@"glyphSize"] intValue];
}