summaryrefslogtreecommitdiff
path: root/ldmicro/lib/freezeLD/freezeLD.h
diff options
context:
space:
mode:
Diffstat (limited to 'ldmicro/lib/freezeLD/freezeLD.h')
-rw-r--r--ldmicro/lib/freezeLD/freezeLD.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/ldmicro/lib/freezeLD/freezeLD.h b/ldmicro/lib/freezeLD/freezeLD.h
new file mode 100644
index 0000000..f14ef07
--- /dev/null
+++ b/ldmicro/lib/freezeLD/freezeLD.h
@@ -0,0 +1,52 @@
+/*
+ * A library for storing parameters in a key file
+ *
+ * This library is an analog to the windows freeze library
+ * developed by Jonathan Westhues.
+ *
+ * R Ramana, 2018
+ */
+
+#ifndef __FREEZE_H
+#define __FREEZE_H
+
+#define LDMICRO_REGISTER "/usr/share/ldmicro"
+
+#define FREEZE_SUBKEY "LDMicro"
+
+// #ifndef FREEZE_SUBKEY
+// #error must define FREEZE_SUBKEY to a string uniquely identifying the app
+// #endif
+
+#define FreezeWindowPos(hwnd) FreezeWindowPosF(hwnd, FREEZE_SUBKEY, #hwnd)
+void FreezeWindowPosF(HWID hWid, char *subKey, char *name);
+
+#define ThawWindowPos(hwnd) ThawWindowPosF(hwnd, FREEZE_SUBKEY, #hwnd)
+void ThawWindowPosF(HWID hWid, char *subKey, char *name);
+
+#define FreezeDWORD(val) FreezeDWORDF(val, FREEZE_SUBKEY, #val)
+void FreezeDWORDF(DWORD val, char *subKey, char *name);
+
+#define ThawDWORD(val) val = ThawDWORDF(val, FREEZE_SUBKEY, #val)
+DWORD ThawDWORDF(DWORD val, char *subKey, char *name);
+
+#define FreezeString(val) FreezeStringF(val, FREEZE_SUBKEY, #val)
+void FreezeStringF(char *val, char *subKey, char *name);
+
+#define ThawString(val, max) ThawStringF(val, max, FREEZE_SUBKEY, #val)
+void ThawStringF(char *val, int max, char *subKey, char *name);
+
+typedef union regKeyVal{
+ int i;
+ float f;
+ bool b;
+ DWORD D;
+} KeyVal;
+
+
+typedef struct regKeys{
+ char type;
+ KeyVal val;
+} Key;
+
+#endif