aboutsummaryrefslogtreecommitdiff
path: root/src/theme.c
diff options
context:
space:
mode:
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);
+
+}
+