]> Dogcows Code - chaz/openbox/commitdiff
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 c1432124b62abd4b1b7e6b266062fe8d79e86aef..63f8af514b378c6b0d3cac1adaa6bad21fe24f41 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 43d076e1e95450eb11e699f5e77ad7e8982c7913..167456509e63a44e983ba1660dfb0f4669700ef4 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 5ed344742ee80b425ffe2c88c7cfdff15fc73bd7..2bf0cd84cdbe4897d488945566f14493fa96f807 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 3173853e730be9ee8848f3b4cbf969c2ccb103c8..d5130f01b2719d67283b8eb954c852265b1dde2a 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 c57b26ec7119444522f9bc3a3cda3a19d2e6b781..c811a1c3dcd8500de6e1279cb6aaf1216c73d20f 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 f4ab5f84bdf63aa45d0b593334eb75551a53524f..00f45dfa4e9dc29f08f0f2f7cc554d19d4d7f7d8 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 b1ee489e51c2479f943e2a9ebaff8386d2f91a9f..6008d4db033a612944034e3edf1c326b08772552 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 7ce66a8003904c386801cbe9f173824ae236b93f..188410519265adf58650275438d83b6d68ac2c76 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 5f2e4ff36c5314c0a436eb446fa40e9769dd7b20..f8e3c7b3474901ed59af26f5a86dbf9a3cf06e44 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 7e7462e9486e2ad099ac4e680504ea4ddcaa8aaa..8931a9c898ab5d09cd0264a68510275e82c8507e 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 12944f88ba0f871d0612d01f8cad3412fbda3d22..f7d5aa6e0b365a9f1531f845132cccf9889f8409 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");
This page took 0.036126 seconds and 4 git commands to generate.