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);
}
}
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");