summaryrefslogtreecommitdiff
path: root/src/config.h
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2024-10-01 14:54:37 +1300
committerBossCode45 <human.cyborg42@gmail.com>2024-10-01 14:54:37 +1300
commit915532bf8fbda9ba2a36e04fcd6acc67c6c68fa5 (patch)
tree0d7a7569ab5fc30c90d5df91a54d312c764cf328 /src/config.h
parentf998705c5a0e50021875a811537962083b73ed26 (diff)
downloadYATwm-915532bf8fbda9ba2a36e04fcd6acc67c6c68fa5.tar.gz
YATwm-915532bf8fbda9ba2a36e04fcd6acc67c6c68fa5.zip
Restructure
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/config.h b/src/config.h
new file mode 100644
index 0000000..452db9c
--- /dev/null
+++ b/src/config.h
@@ -0,0 +1,53 @@
+#pragma once
+
+#include "commands.h"
+#include <X11/X.h>
+#include <X11/keysym.h>
+
+#include <string>
+#include <vector>
+
+struct Workspace
+{
+ std::string name;
+ int* screenPreferences;
+ int screenPreferencesc;
+};
+
+#define COMMAND(X) \
+ const void X (const CommandArg* argv)
+
+class Config
+{
+public:
+ Config(CommandsModule& commandsModule);
+ ~Config();
+ void free();
+
+ std::vector<Err> loadFromFile(std::string path);
+ std::vector<Err> reloadFile();
+
+ // Main
+ int gaps;
+ int outerGaps;
+ std::string logFile;
+
+ // Workspaces
+ std::vector<Workspace> workspaces;
+ int numWS;
+ bool loaded = false;
+
+ // Binds
+ bool swapSuperAlt;
+
+ // Config Commands
+ COMMAND(gapsCmd);
+ COMMAND(outerGapsCmd);
+ COMMAND(logFileCmd);
+ COMMAND(addWorkspaceCmd);
+ COMMAND(swapSuperAltCmd);
+
+private:
+ CommandsModule& commandsModule;
+ std::string file;
+};