From a041d9898e6d699bd8c0c25482ec574feb03c547 Mon Sep 17 00:00:00 2001 From: "John Ankarstr\\xf6m" Date: Sat, 29 May 2021 12:54:47 +0200 Subject: 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. --- src/theme.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 src/theme.c (limited to 'src/theme.c') 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); + +} + -- cgit v1.2.3