summaryrefslogtreecommitdiffstats
path: root/macos.c
diff options
context:
space:
mode:
authorGravatar Henrik Brautaset Aronsen <subsurface@henrik.synth.no>2013-02-12 13:03:24 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-28 15:39:49 -0800
commitb24d0f2f60fc8a7c0bbe2cf4ceac584f9ef24878 (patch)
treedc732dbf33a0910706bf11171445c008c5884367 /macos.c
parentd742d7b391fb1e28e784161368689b05af791b71 (diff)
downloadsubsurface-b24d0f2f60fc8a7c0bbe2cf4ceac584f9ef24878.tar.gz
Add MacOS support to window geometry save/restore
Also make sure the config is flushed to disk. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'macos.c')
-rw-r--r--macos.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/macos.c b/macos.c
index af72a69e3..daa9b00f1 100644
--- a/macos.c
+++ b/macos.c
@@ -47,7 +47,8 @@ void subsurface_set_conf_bool(char *name, int value)
void subsurface_set_conf_int(char *name, int value)
{
- /* CF pref stuff here? */
+ CFNumberRef numRef = CFNumberCreate(NULL, kCFNumberIntType, &value);
+ CFPreferencesSetAppValue(CFSTR_VAR(name), numRef, SUBSURFACE_PREFERENCES);
}
const void *subsurface_get_conf(char *name)
@@ -72,9 +73,13 @@ int subsurface_get_conf_bool(char *name)
int subsurface_get_conf_int(char *name)
{
+ Boolean exists;
+ CFIndex value;
- return -1; /* CF pref stuff here? */
-
+ value = CFPreferencesGetAppIntegerValue(CFSTR_VAR(name), SUBSURFACE_PREFERENCES, &exists);
+ if (!exists)
+ return -1;
+ return value;
}
void subsurface_flush_conf(void)