#include <stdlib.h>
#include <string.h>
-static XrmDatabase loaddb(RrTheme *theme, const gchar *name, gchar **path);
+static XrmDatabase loaddb(const gchar *name, gchar **path);
static gboolean read_int(XrmDatabase db, const gchar *rname, gint *value);
static gboolean read_string(XrmDatabase db, const gchar *rname, gchar **value);
static gboolean read_color(XrmDatabase db, const RrInstance *inst,
gchar *path;
gboolean userdef;
+ if (name) {
+ db = loaddb(name, &path);
+ if (db == NULL) {
+ g_message("Unable to load the theme '%s'", name);
+ g_message("Falling back to the default theme '%s'",
+ DEFAULT_THEME);
+ }
+ }
+ if (db == NULL) {
+ db = loaddb(DEFAULT_THEME, &path);
+ if (db == NULL) {
+ g_message("Unable to load the theme '%s'", DEFAULT_THEME);
+ return NULL;
+ }
+ name = DEFAULT_THEME;
+ }
+
theme = g_new0(RrTheme, 1);
theme->inst = inst;
theme->a_clear = RrAppearanceNew(inst, 0);
theme->a_clear_tex = RrAppearanceNew(inst, 1);
- if (name) {
- db = loaddb(theme, name, &path);
- if (db == NULL) {
- g_message("Unable to load the theme '%s'", name);
- g_message("Falling back to the default theme '%s'",
- DEFAULT_THEME);
- }
- }
- if (db == NULL) {
- db = loaddb(theme, DEFAULT_THEME, &path);
- if (db == NULL) {
- g_message("Unable to load the theme '%s'", DEFAULT_THEME);
- return NULL;
- }
- }
-
/* load the font stuff */
if (active_window_font) {
theme->win_font_focused = active_window_font;
}
}
-static XrmDatabase loaddb(RrTheme *theme, const gchar *name, gchar **path)
+static XrmDatabase loaddb(const gchar *name, gchar **path)
{
GSList *it;
XrmDatabase db = NULL;