aboutsummaryrefslogtreecommitdiff
path: root/src/theme.c
diff options
context:
space:
mode:
authorJohn Ankarstr\xf6m <john@ankarstrom.se>2021-05-29 12:54:47 +0200
committerJohn Ankarstr\xf6m <john@ankarstrom.se>2021-05-29 13:18:40 +0200
commita041d9898e6d699bd8c0c25482ec574feb03c547 (patch)
tree7f094e33fb530152c3ab6238ce7300750b47addb /src/theme.c
downloadjwm-a041d9898e6d699bd8c0c25482ec574feb03c547.tar.gz
First commit
This is the original state of the released tarball for JWM 1.8, which will serve as my starting point for further modifications.
Diffstat (limited to 'src/theme.c')
-rw-r--r--src/theme.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/theme.c b/src/theme.c
new file mode 100644
index 0000000..4560abc
--- /dev/null
+++ b/src/theme.c
@@ -0,0 +1,88 @@
+/****************************************************************************
+ * Theme functions.
+ * Copyright (C) 2006 Joe Wingbermuehle
+ ****************************************************************************/
+
+#include "jwm.h"
+#include "theme.h"
+#include "error.h"
+#include "misc.h"
+
+typedef struct ThemePathNode {
+ char *path;
+ struct ThemePathNode *next;
+} ThemePathNode;
+
+static ThemePathNode *themePaths;
+static char *themeName;
+
+/****************************************************************************
+ ****************************************************************************/
+void InitializeThemes() {
+
+ themeName = NULL;
+ themePaths = NULL;
+
+}
+
+/****************************************************************************
+ ****************************************************************************/
+void StartupThemes() {
+}
+
+/****************************************************************************
+ ****************************************************************************/
+void ShutdownThemes() {
+}
+
+/****************************************************************************
+ ****************************************************************************/
+void DestroyThemes() {
+
+ ThemePathNode *tp;
+
+ if(themeName) {
+ Release(themeName);
+ }
+
+ while(themePaths) {
+ tp = themePaths->next;
+ Release(themePaths->path);
+ Release(themePaths);
+ themePaths = tp;
+ }
+
+}
+
+/****************************************************************************
+ ****************************************************************************/
+void AddThemePath(const char *path) {
+
+ ThemePathNode *tp;
+
+ if(!path) {
+ return;
+ }
+
+ tp = Allocate(sizeof(ThemePathNode));
+ tp->path = CopyString(path);
+ Trim(tp->path);
+
+ tp->next = themePaths;
+ themePaths = tp;
+
+}
+
+/****************************************************************************
+ ****************************************************************************/
+void SetTheme(const char *name) {
+
+ if(themeName) {
+ Warning("theme set multiple times");
+ }
+
+ themeName = CopyString(name);
+ Trim(themeName);
+
+}
+