From 24c0d618471276fd514cd666bc7067d30be8d0ca Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 7 May 2007 02:38:13 +0000 Subject: [PATCH] add the 'engine="box"' to the theme format, and require it to be there so we can change that in the future --- data/themerc.xsd | 1 + parser/parse.c | 23 +++++++++++++++++++---- themes/Artwiz-boxed/openbox-3/themerc.xml | 2 +- themes/Bear2/openbox-3/themerc.xml | 2 +- themes/Clearlooks-Olive/openbox-3/themerc.xml | 2 +- themes/Clearlooks/openbox-3/themerc.xml | 2 +- themes/Mikachu/openbox-3/themerc.xml | 2 +- themes/Natura/openbox-3/themerc.xml | 2 +- themes/Orang/openbox-3/themerc.xml | 2 +- themes/Syscrash/openbox-3/themerc.xml | 2 +- tools/themetoxml/themetoxml.c | 1 + 11 files changed, 29 insertions(+), 12 deletions(-) diff --git a/data/themerc.xsd b/data/themerc.xsd index c143212..63f8af5 100755 --- a/data/themerc.xsd +++ b/data/themerc.xsd @@ -163,5 +163,6 @@ + diff --git a/parser/parse.c b/parser/parse.c index 43d076e..1674565 100644 --- a/parser/parse.c +++ b/parser/parse.c @@ -108,20 +108,35 @@ gboolean parse_load_theme(const gchar *name, xmlDocPtr *doc, xmlNodePtr *root, GSList *it; gchar *path; gboolean r = FALSE; + gchar *eng; /* backward compatibility.. */ path = g_build_filename(g_get_home_dir(), ".themes", name, "openbox-3", "themerc.xml", NULL); - if ((r = parse_load(path, "openbox_theme", doc, root))) - *retpath = g_path_get_dirname(path); + if (parse_load(path, "openbox_theme", doc, root) && + parse_attr_string("engine", *root, &eng)) + { + if (!strcmp(eng, "box")) { + *retpath = g_path_get_dirname(path); + r = TRUE; + } + g_free(eng); + } g_free(path); if (!r) { for (it = xdg_data_dir_paths; !r && it; it = g_slist_next(it)) { path = g_build_filename(it->data, "themes", name, "openbox-3", "themerc.xml", NULL); - if ((r = parse_load(path, "openbox_theme", doc, root))) - *retpath = g_path_get_dirname(path); + if (parse_load(path, "openbox_theme", doc, root) && + parse_attr_string("engine", *root, &eng)) + { + if (!strcmp(eng, "box")) { + *retpath = g_path_get_dirname(path); + r = TRUE; + } + g_free(eng); + } g_free(path); } } diff --git a/themes/Artwiz-boxed/openbox-3/themerc.xml b/themes/Artwiz-boxed/openbox-3/themerc.xml index 5ed3447..2bf0cd8 100644 --- a/themes/Artwiz-boxed/openbox-3/themerc.xml +++ b/themes/Artwiz-boxed/openbox-3/themerc.xml @@ -1,5 +1,5 @@ - + 4 diff --git a/themes/Bear2/openbox-3/themerc.xml b/themes/Bear2/openbox-3/themerc.xml index 3173853..d5130f0 100644 --- a/themes/Bear2/openbox-3/themerc.xml +++ b/themes/Bear2/openbox-3/themerc.xml @@ -1,5 +1,5 @@ - + 4 diff --git a/themes/Clearlooks-Olive/openbox-3/themerc.xml b/themes/Clearlooks-Olive/openbox-3/themerc.xml index c57b26e..c811a1c 100644 --- a/themes/Clearlooks-Olive/openbox-3/themerc.xml +++ b/themes/Clearlooks-Olive/openbox-3/themerc.xml @@ -1,5 +1,5 @@ - + 3 diff --git a/themes/Clearlooks/openbox-3/themerc.xml b/themes/Clearlooks/openbox-3/themerc.xml index f4ab5f8..00f45df 100644 --- a/themes/Clearlooks/openbox-3/themerc.xml +++ b/themes/Clearlooks/openbox-3/themerc.xml @@ -1,5 +1,5 @@ - + 3 diff --git a/themes/Mikachu/openbox-3/themerc.xml b/themes/Mikachu/openbox-3/themerc.xml index b1ee489..6008d4d 100644 --- a/themes/Mikachu/openbox-3/themerc.xml +++ b/themes/Mikachu/openbox-3/themerc.xml @@ -1,5 +1,5 @@ - + 0 diff --git a/themes/Natura/openbox-3/themerc.xml b/themes/Natura/openbox-3/themerc.xml index 7ce66a8..1884105 100644 --- a/themes/Natura/openbox-3/themerc.xml +++ b/themes/Natura/openbox-3/themerc.xml @@ -1,5 +1,5 @@ - + 2 diff --git a/themes/Orang/openbox-3/themerc.xml b/themes/Orang/openbox-3/themerc.xml index 5f2e4ff..f8e3c7b 100644 --- a/themes/Orang/openbox-3/themerc.xml +++ b/themes/Orang/openbox-3/themerc.xml @@ -1,5 +1,5 @@ - + 3 diff --git a/themes/Syscrash/openbox-3/themerc.xml b/themes/Syscrash/openbox-3/themerc.xml index 7e7462e..8931a9c 100644 --- a/themes/Syscrash/openbox-3/themerc.xml +++ b/themes/Syscrash/openbox-3/themerc.xml @@ -1,5 +1,5 @@ - + 0 diff --git a/tools/themetoxml/themetoxml.c b/tools/themetoxml/themetoxml.c index 12944f8..f7d5aa6 100644 --- a/tools/themetoxml/themetoxml.c +++ b/tools/themetoxml/themetoxml.c @@ -314,6 +314,7 @@ int main(int argc, char **argv) doc = xmlNewDoc((const xmlChar*) "1.0"); xmlDocSetRootElement (doc,(root = xmlNewNode(NULL, (const xmlChar*)"openbox_theme"))); + xmlSetProp(root, (const xmlChar*)"engine", (const xmlChar*)"box"); xmlSetProp(root, (const xmlChar*)"version", (const xmlChar*)"1"); xmlSetProp(root, (const xmlChar*)"xmlns", (const xmlChar*)"http://openbox.org/themerc"); -- 1.9.1