<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:simpleType name="positionType">
        <xs:restriction base="xs:string">
            <xs:pattern value="[0-9]+x[0-9]+" />
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="imageType">
        <xs:attribute name="image" use="required" type="xs:string" />
    </xs:complexType>

    <xs:complexType name="coverType">
        <xs:attribute name="image" use="required" type="xs:string" />
        <xs:attribute name="position" use="required" type="positionType" />
    </xs:complexType>

    <xs:complexType name="fontType">
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="size" use="optional" type="xs:positiveInteger" />
                <xs:attribute name="bold" use="optional" type="xs:boolean" />
                <xs:attribute name="color" use="optional" type="xs:string" />
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>

    <xs:complexType name="textElement">
        <xs:sequence>
            <xs:element name="font" type="fontType" minOccurs="0" maxOccurs="1" />
        </xs:sequence>
        <xs:attribute name="position" use="required" type="positionType" />
        <xs:attribute name="width" use="required" type="xs:unsignedInt" />
    </xs:complexType>

    <xs:complexType name="statusType">
        <xs:all>
            <xs:element name="paused" type="imageType" />
            <xs:element name="stopped" type="imageType" />
            <xs:element name="playing" type="imageType" />
        </xs:all>
        <xs:attribute name="position" use="required" type="positionType" />
    </xs:complexType>

    <xs:complexType name="skinType">
        <xs:sequence>
            <xs:element name="background" type="imageType" />
            <xs:element name="cover" type="coverType" minOccurs="0" maxOccurs="1" />
            <xs:element name="status" type="statusType" minOccurs="0" maxOccurs="1" />
            <xs:element name="artist" type="textElement" />
            <xs:element name="songname" type="textElement" />
            <xs:element name="album" type="textElement" minOccurs="0" maxOccurs="1" />
        </xs:sequence>
    </xs:complexType>

    <xs:element name="skin" type="skinType" />
</xs:schema>
