add the 'engine="box"' to the theme format, and require it to be there so we can...
authorDana Jansens <danakj@orodu.net>
Mon, 7 May 2007 02:38:13 +0000 (02:38 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 7 May 2007 02:38:13 +0000 (02:38 +0000)
data/themerc.xsd
parser/parse.c
themes/Artwiz-boxed/openbox-3/themerc.xml
themes/Bear2/openbox-3/themerc.xml
themes/Clearlooks-Olive/openbox-3/themerc.xml
themes/Clearlooks/openbox-3/themerc.xml
themes/Mikachu/openbox-3/themerc.xml
themes/Natura/openbox-3/themerc.xml
themes/Orang/openbox-3/themerc.xml
themes/Syscrash/openbox-3/themerc.xml
tools/themetoxml/themetoxml.c

index c143212..63f8af5 100755 (executable)
       <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>
index 43d076e..1674565 100644 (file)
@@ -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);
         }
     }
index 5ed3447..2bf0cd8 100644 (file)
@@ -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"/>
index 3173853..d5130f0 100644 (file)
@@ -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"/>
index c57b26e..c811a1c 100644 (file)
@@ -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"/>
index f4ab5f8..00f45df 100644 (file)
@@ -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"/>
index b1ee489..6008d4d 100644 (file)
@@ -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"/>
index 7ce66a8..1884105 100644 (file)
@@ -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"/>
index 5f2e4ff..f8e3c7b 100644 (file)
@@ -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"/>
index 7e7462e..8931a9c 100644 (file)
@@ -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"/>
index 12944f8..f7d5aa6 100644 (file)
@@ -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");