<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://openbox.org/4.0/themerc"
    xmlns:obt="http://openbox.org/4.0/themerc"
    elementFormDefault="qualified"
    version="1.0">

  <xs:annotation>
    <xs:documentation xml:lang="en">
      Openbox theme definition
      Version 1
      Copyright 2007 Dana Jansens
    </xs:documentation>
  </xs:annotation>

  <xs:element name="openbox_theme" type="obt:theme">
    <xs:annotation>
      <xs:documentation xml:lang="en">
        The root node
      </xs:documentation>
    </xs:annotation>
  </xs:element>

  <xs:complexType name="color">
    <xs:attribute name="r" type="xs:integer"/>
    <xs:attribute name="g" type="xs:integer"/>
    <xs:attribute name="b" type="xs:integer"/>
    <xs:attribute name="a" type="xs:integer"/>
  </xs:complexType>

  <xs:complexType name="point">
    <xs:attribute name="x" type="xs:integer"/>
    <xs:attribute name="y" type="xs:integer"/>
  </xs:complexType>

  <xs:simpleType name="justify">
    <xs:restriction base="xs:string">
      <xs:enumeration value="left"/>
      <xs:enumeration value="right"/>
      <xs:enumeration value="center"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="shadow">
    <xs:all>
      <xs:element name="offset" type="obt:point" minOccurs="0"/>
      <xs:element name="primary" type="obt:color" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="text">
    <xs:all>
      <xs:element name="primary" type="obt:color" minOccurs="0"/>
      <xs:element name="shadow" type="obt:shadow" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="textarea">
    <xs:all>
      <xs:element name="style" type="xs:string" minOccurs="0"/>
      <xs:element name="primary" type="obt:color" minOccurs="0"/>
      <xs:element name="secondary" type="obt:color" minOccurs="0"/>
      <xs:element name="interlace" type="obt:color" minOccurs="0"/>
      <xs:element name="border" type="obt:color" minOccurs="0"/>
      <xs:element name="text" type="obt:text" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="area">
    <xs:all>
      <xs:element name="style" type="xs:string" minOccurs="0"/>
      <xs:element name="primary" type="obt:color" minOccurs="0"/>
      <xs:element name="secondary" type="obt:color" minOccurs="0"/>
      <xs:element name="interlace" type="obt:color" minOccurs="0"/>
      <xs:element name="border" type="obt:color" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="buttonarea">
    <xs:all>
      <xs:element name="style" type="xs:string" minOccurs="0"/>
      <xs:element name="primary" type="obt:color" minOccurs="0"/>
      <xs:element name="secondary" type="obt:color" minOccurs="0"/>
      <xs:element name="interlace" type="obt:color" minOccurs="0"/>
      <xs:element name="border" type="obt:color" minOccurs="0"/> 
      <xs:element name="image" type="obt:color" minOccurs="0"/>
   </xs:all>
  </xs:complexType>

  <xs:complexType name="allmenus">
    <xs:all>
      <xs:element name="border" type="obt:color" minOccurs="0"/>
      <xs:element name="overlap" type="xs:integer" minOccurs="0"/>
      <xs:element name="justify" type="obt:justify" minOccurs="0"/>
      <xs:element name="title" type="obt:textarea" minOccurs="0"/>
      <xs:element name="entries" type="obt:area" minOccurs="0"/>
      <xs:element name="inactive" type="obt:text" minOccurs="0"/>
      <xs:element name="active" type="obt:textarea" minOccurs="0"/>
      <xs:element name="disabled" type="obt:text" minOccurs="0"/>
      <xs:element name="activedisabled" type="obt:textarea" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="allbuttons">
    <xs:all>
      <xs:element name="unpressed" type="obt:buttonarea" minOccurs="0"/>
      <xs:element name="pressed" type="obt:buttonarea" minOccurs="0"/>
      <xs:element name="hover" type="obt:buttonarea" minOccurs="0"/>
      <xs:element name="disabled" type="obt:buttonarea" minOccurs="0"/>
      <xs:element name="toggled-unpressed" type="obt:buttonarea" minOccurs="0"/>
      <xs:element name="toggled-pressed" type="obt:buttonarea" minOccurs="0"/>
      <xs:element name="toggled-hover" type="obt:buttonarea" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="window">
    <xs:all>
      <xs:element name="border" type="obt:color" minOccurs="0"/>
      <xs:element name="titleseparator" type="obt:color" minOccurs="0"/>
      <xs:element name="clientpadding" type="obt:color" minOccurs="0"/>
      <xs:element name="titlebar" type="obt:area" minOccurs="0"/>
      <xs:element name="label" type="obt:textarea" minOccurs="0"/>
      <xs:element name="handle" type="obt:area" minOccurs="0"/>
      <xs:element name="grip" type="obt:area" minOccurs="0"/>
      <xs:element name="buttons" type="obt:allbuttons" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="allwindows">
    <xs:all>
      <xs:element name="justify" type="obt:justify" minOccurs="0"/>
      <xs:element name="inactive" type="obt:window" minOccurs="0"/>
      <xs:element name="active" type="obt:window" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="allosd">
    <xs:all>
      <xs:element name="border" type="obt:color" minOccurs="0"/>
      <xs:element name="label" type="obt:textarea" minOccurs="0"/>
      <xs:element name="background" type="obt:area" minOccurs="0"/>
      <xs:element name="hilight" type="obt:area" minOccurs="0"/>
      <xs:element name="unhilight" type="obt:area" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="windowDimensions">
    <xs:all>
      <xs:element name="border" type="xs:integer" minOccurs="0"/>
      <xs:element name="clientpadding" type="obt:point" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="menuDimensions">
    <xs:all>
      <xs:element name="border" type="xs:integer" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="osdDimensions">
    <xs:all>
      <xs:element name="border" type="xs:integer" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="themeDimensions">
    <xs:all>
      <xs:element name="padding" type="obt:point" minOccurs="0"/>
      <xs:element name="handle" type="xs:integer" minOccurs="0"/>
      <xs:element name="window" type="obt:windowDimensions" minOccurs="0"/>
      <xs:element name="menu" type="obt:menuDimensions" minOccurs="0"/>
      <xs:element name="osd" type="obt:osdDimensions" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="about">
    <xs:all>
      <xs:element name="author" type="xs:string" minOccurs="0"/>
      <xs:element name="email" type="xs:string" minOccurs="0"/>
      <xs:element name="webpage" type="xs:string" minOccurs="0"/>
      <xs:element name="comment" type="xs:string" minOccurs="0"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="theme">
    <xs:all>
      <xs:element name="about" type="obt:about" minOccurs="0"/>
      <xs:element name="dimensions" type="obt:themeDimensions" minOccurs="0"/>
      <xs:element name="osd" type="obt:allosd" minOccurs="0"/>
      <xs:element name="menu" type="obt:allmenus" minOccurs="0"/>
      <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>