add the 'engine="box"' to the theme format, and require it to be there so we can change that in the future
This commit is contained in:
parent
974391d345
commit
24c0d61847
11 changed files with 29 additions and 12 deletions
|
@ -163,5 +163,6 @@
|
|||
<xs:element name="window" type="obt:allwindows" minOccurs="0"/>
|
||||
</xs:all>
|
||||
<xs:attribute name="version" type="xs:integer" use="required" fixed="1"/>
|
||||
<xs:attribute name="engine" type="xs:string" use="required" fixed="box"/>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
|
|
@ -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)))
|
||||
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)))
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<openbox_theme version="1" xmlns="http://openbox.org/themerc">
|
||||
<openbox_theme version="1" engine="box" xmlns="http://openbox.org/themerc">
|
||||
<dimensions>
|
||||
<handle>4</handle>
|
||||
<padding x="1" y="1"/>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<openbox_theme version="1" xmlns="http://openbox.org/themerc">
|
||||
<openbox_theme version="1" engine="box" xmlns="http://openbox.org/themerc">
|
||||
<dimensions>
|
||||
<handle>4</handle>
|
||||
<padding x="3" y="3"/>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<openbox_theme version="1" xmlns="http://openbox.org/themerc">
|
||||
<openbox_theme version="1" engine="box" xmlns="http://openbox.org/themerc">
|
||||
<dimensions>
|
||||
<handle>3</handle>
|
||||
<padding x="2" y="2"/>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<openbox_theme version="1" xmlns="http://openbox.org/themerc">
|
||||
<openbox_theme version="1" engine="box" xmlns="http://openbox.org/themerc">
|
||||
<dimensions>
|
||||
<handle>3</handle>
|
||||
<padding x="2" y="2"/>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<openbox_theme version="1" xmlns="http://openbox.org/themerc">
|
||||
<openbox_theme version="1" engine="box" xmlns="http://openbox.org/themerc">
|
||||
<dimensions>
|
||||
<handle>0</handle>
|
||||
<padding x="1" y="1"/>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<openbox_theme version="1" xmlns="http://openbox.org/themerc">
|
||||
<openbox_theme version="1" engine="box" xmlns="http://openbox.org/themerc">
|
||||
<dimensions>
|
||||
<handle>2</handle>
|
||||
<padding x="2" y="2"/>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<openbox_theme version="1" xmlns="http://openbox.org/themerc">
|
||||
<openbox_theme version="1" engine="box" xmlns="http://openbox.org/themerc">
|
||||
<dimensions>
|
||||
<handle>3</handle>
|
||||
<padding x="1" y="1"/>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<openbox_theme version="1" xmlns="http://openbox.org/themerc">
|
||||
<openbox_theme version="1" engine="box" xmlns="http://openbox.org/themerc">
|
||||
<dimensions>
|
||||
<handle>0</handle>
|
||||
<padding x="1" y="1"/>
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue