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 c1432124..63f8af51 100755 --- a/data/themerc.xsd +++ b/data/themerc.xsd @@ -163,5 +163,6 @@ + diff --git a/parser/parse.c b/parser/parse.c index 43d076e1..16745650 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 5ed34474..2bf0cd84 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 3173853e..d5130f01 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 c57b26ec..c811a1c3 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 f4ab5f84..00f45dfa 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 b1ee489e..6008d4db 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 7ce66a80..18841051 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 5f2e4ff3..f8e3c7b3 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 7e7462e9..8931a9c8 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 12944f88..f7d5aa6e 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"); -- 2.45.2