<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="layout"
    targetNamespace="http://panopainter.com/layout.xsd"
    elementFormDefault="qualified"
    xmlns="http://panopainter.com/layout.xsd"
    xmlns:mstns="http://panopainter.com/layout.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:element name="root">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="layout"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="layout">
    <xs:complexType>
      <xs:sequence>
        <xs:choice minOccurs="0">
          <xs:element ref="border"/>
          <xs:element ref="button-custom"/>
          <xs:element ref="popup-menu"/>
        </xs:choice>
        <xs:element minOccurs="0" ref="canvas"/>
        <xs:element minOccurs="0" ref="node"/>
      </xs:sequence>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="popup-menu">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="border"/>
        <xs:element ref="button-custom"/>
      </xs:choice>
      <xs:attribute name="border-color" use="required" type="xs:decimal"/>
      <xs:attribute name="color" use="required"/>
      <xs:attribute name="dir" use="required" type="xs:NCName"/>
      <xs:attribute name="position" use="required"/>
      <xs:attribute name="positioning" use="required" type="xs:NCName"/>
      <xs:attribute name="thickness" use="required" type="xs:integer"/>
      <xs:attribute name="width" use="required" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="canvas">
    <xs:complexType>
      <xs:attribute name="grow" use="required" type="xs:integer"/>
      <xs:attribute name="height" use="required"/>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
      <xs:attribute name="positioning" use="required" type="xs:NCName"/>
      <xs:attribute name="width" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="border">
    <xs:complexType>
      <xs:sequence>
        <xs:choice minOccurs="0">
          <xs:element ref="checkbox"/>
          <xs:element ref="image"/>
          <xs:element ref="image-texture"/>
          <xs:element ref="color-quad"/>
        </xs:choice>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="border"/>
          <xs:element ref="button"/>
          <xs:element ref="button-custom"/>
          <xs:element ref="combobox"/>
          <xs:element ref="node"/>
          <xs:element ref="scroll"/>
          <xs:element ref="slider-h"/>
          <xs:element ref="text"/>
          <xs:element ref="text-input"/>
          <xs:element ref="colorwheel"/>
        </xs:choice>
      </xs:sequence>
      <xs:attribute name="align" type="xs:NCName"/>
      <xs:attribute name="border-color" type="xs:decimal"/>
      <xs:attribute name="color"/>
      <xs:attribute name="dir" type="xs:NCName"/>
      <xs:attribute name="flood-events" type="xs:integer"/>
      <xs:attribute name="grow" type="xs:decimal"/>
      <xs:attribute name="height"/>
      <xs:attribute name="id" type="xs:NCName"/>
      <xs:attribute name="justify" type="xs:NCName"/>
      <xs:attribute name="margin"/>
      <xs:attribute name="max-width" type="xs:integer"/>
      <xs:attribute name="min-height" type="xs:integer"/>
      <xs:attribute name="min-width" type="xs:integer"/>
      <xs:attribute name="mouse-capture" type="xs:boolean"/>
      <xs:attribute name="pad"/>
      <xs:attribute name="position"/>
      <xs:attribute name="positioning" type="xs:NCName"/>
      <xs:attribute name="rtl" type="xs:NCName"/>
      <xs:attribute name="shrink" type="xs:integer"/>
      <xs:attribute name="thickness" type="xs:integer"/>
      <xs:attribute name="width"/>
      <xs:attribute name="wrap" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="color-quad">
    <xs:complexType>
      <xs:attribute name="color" use="required"/>
      <xs:attribute name="grow" use="required" type="xs:integer"/>
      <xs:attribute name="height" use="required"/>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="colorwheel">
    <xs:complexType>
      <xs:attribute name="aspect-ratio" use="required" type="xs:integer"/>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
      <xs:attribute name="width" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="button-custom">
    <xs:complexType>
      <xs:sequence>
        <xs:choice minOccurs="0">
          <xs:element ref="checkbox"/>
          <xs:element ref="icon"/>
        </xs:choice>
        <xs:element minOccurs="0" ref="image"/>
        <xs:element minOccurs="0" ref="border"/>
        <xs:element minOccurs="0" ref="stroke-preview"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="text"/>
        <xs:element minOccurs="0" ref="combobox"/>
      </xs:sequence>
      <xs:attribute name="align" type="xs:NCName"/>
      <xs:attribute name="border-color"/>
      <xs:attribute name="color"/>
      <xs:attribute name="dir" type="xs:NCName"/>
      <xs:attribute name="grow" type="xs:integer"/>
      <xs:attribute name="height"/>
      <xs:attribute name="id" type="xs:NCName"/>
      <xs:attribute name="justify" type="xs:NCName"/>
      <xs:attribute name="margin"/>
      <xs:attribute name="os"/>
      <xs:attribute name="pad"/>
      <xs:attribute name="shrink" type="xs:integer"/>
      <xs:attribute name="thickness" type="xs:integer"/>
      <xs:attribute name="width"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="icon">
    <xs:complexType>
      <xs:attribute name="icon" use="required" type="xs:NCName"/>
      <xs:attribute name="width" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="stroke-preview">
    <xs:complexType>
      <xs:attribute name="grow" type="xs:integer"/>
      <xs:attribute name="height" use="required"/>
      <xs:attribute name="id" type="xs:NCName"/>
      <xs:attribute name="width" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="node">
    <xs:complexType>
      <xs:sequence>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="border"/>
          <xs:element ref="button-custom"/>
          <xs:element ref="checkbox"/>
          <xs:element ref="image"/>
          <xs:element ref="image-texture"/>
          <xs:element ref="node"/>
          <xs:element ref="scroll"/>
          <xs:element ref="slider-h"/>
          <xs:element ref="text"/>
          <xs:element ref="panel-quick"/>
        </xs:choice>
        <xs:choice>
          <xs:element ref="combobox"/>
          <xs:element ref="text-input"/>
          <xs:element ref="slider-hue"/>
          <xs:element ref="slider-v"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="button"/>
        </xs:choice>
      </xs:sequence>
      <xs:attribute name="align" type="xs:NCName"/>
      <xs:attribute name="color"/>
      <xs:attribute name="dir" type="xs:NCName"/>
      <xs:attribute name="flood-events" type="xs:integer"/>
      <xs:attribute name="grow" type="xs:integer"/>
      <xs:attribute name="height"/>
      <xs:attribute name="id" type="xs:NCName"/>
      <xs:attribute name="justify" type="xs:NCName"/>
      <xs:attribute name="margin"/>
      <xs:attribute name="max-height" type="xs:integer"/>
      <xs:attribute name="min-height" type="xs:integer"/>
      <xs:attribute name="min-width" type="xs:integer"/>
      <xs:attribute name="os"/>
      <xs:attribute name="pad"/>
      <xs:attribute name="rtl" type="xs:NCName"/>
      <xs:attribute name="shrink" type="xs:integer"/>
      <xs:attribute name="width"/>
      <xs:attribute name="wrap" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="panel-quick">
    <xs:complexType>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="slider-hue">
    <xs:complexType>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="slider-v">
    <xs:complexType>
      <xs:attribute name="height" use="required" type="xs:integer"/>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
      <xs:attribute name="shrink" use="required" type="xs:integer"/>
      <xs:attribute name="width" use="required" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="image">
    <xs:complexType>
      <xs:attribute name="align" type="xs:NCName"/>
      <xs:attribute name="autosize" type="xs:integer"/>
      <xs:attribute name="height"/>
      <xs:attribute name="id" type="xs:NCName"/>
      <xs:attribute name="justify" type="xs:NCName"/>
      <xs:attribute name="mips" type="xs:boolean"/>
      <xs:attribute name="path"/>
      <xs:attribute name="width" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="checkbox">
    <xs:complexType>
      <xs:attribute name="height" type="xs:integer"/>
      <xs:attribute name="icon"/>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
      <xs:attribute name="margin"/>
      <xs:attribute name="width" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="image-texture">
    <xs:complexType>
      <xs:choice minOccurs="0">
        <xs:element ref="border"/>
        <xs:element ref="text"/>
      </xs:choice>
      <xs:attribute name="aspect-ratio" type="xs:integer"/>
      <xs:attribute name="grow" type="xs:integer"/>
      <xs:attribute name="height" use="required"/>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
      <xs:attribute name="pad" type="xs:integer"/>
      <xs:attribute name="width" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="text">
    <xs:complexType>
      <xs:attribute name="align" type="xs:NCName"/>
      <xs:attribute name="color"/>
      <xs:attribute name="font-size" type="xs:integer"/>
      <xs:attribute name="grow" type="xs:integer"/>
      <xs:attribute name="height" type="xs:integer"/>
      <xs:attribute name="id" type="xs:NCName"/>
      <xs:attribute name="justify" type="xs:NCName"/>
      <xs:attribute name="margin"/>
      <xs:attribute name="os"/>
      <xs:attribute name="pad" type="xs:integer"/>
      <xs:attribute name="text"/>
      <xs:attribute name="text-wrap-width" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="button">
    <xs:complexType>
      <xs:attribute name="color"/>
      <xs:attribute name="grow" type="xs:integer"/>
      <xs:attribute name="height" use="required"/>
      <xs:attribute name="id" type="xs:NCName"/>
      <xs:attribute name="margin"/>
      <xs:attribute name="os"/>
      <xs:attribute name="pad" type="xs:integer"/>
      <xs:attribute name="text" use="required"/>
      <xs:attribute name="width" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="scroll">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="ref"/>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="border"/>
          <xs:element ref="image"/>
          <xs:element ref="node"/>
        </xs:choice>
        <xs:choice>
          <xs:element ref="button"/>
          <xs:element minOccurs="0" maxOccurs="unbounded" ref="text"/>
        </xs:choice>
      </xs:sequence>
      <xs:attribute name="color" use="required"/>
      <xs:attribute name="dir" type="xs:NCName"/>
      <xs:attribute name="flood-events" type="xs:integer"/>
      <xs:attribute name="grow" type="xs:integer"/>
      <xs:attribute name="height"/>
      <xs:attribute name="id" type="xs:NCName"/>
      <xs:attribute name="justify" type="xs:NCName"/>
      <xs:attribute name="margin"/>
      <xs:attribute name="min-width" type="xs:integer"/>
      <xs:attribute name="mouse-capture" type="xs:boolean"/>
      <xs:attribute name="pad"/>
      <xs:attribute name="rtl" type="xs:NCName"/>
      <xs:attribute name="scroll-color" type="xs:decimal"/>
      <xs:attribute name="shrink" type="xs:integer"/>
      <xs:attribute name="wrap" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="ref">
    <xs:complexType>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="text-input">
    <xs:complexType>
      <xs:attribute name="align" type="xs:NCName"/>
      <xs:attribute name="color" use="required" type="xs:decimal"/>
      <xs:attribute name="grow" use="required" type="xs:integer"/>
      <xs:attribute name="height" type="xs:integer"/>
      <xs:attribute name="id" type="xs:NCName"/>
      <xs:attribute name="min-height" type="xs:integer"/>
      <xs:attribute name="multiline" type="xs:integer"/>
      <xs:attribute name="pad" use="required" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="combobox">
    <xs:complexType>
      <xs:attribute name="combo-list" use="required"/>
      <xs:attribute name="default" type="xs:integer"/>
      <xs:attribute name="height" use="required" type="xs:integer"/>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
      <xs:attribute name="margin"/>
      <xs:attribute name="text" type="xs:NMTOKEN"/>
      <xs:attribute name="width" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="slider-h">
    <xs:complexType>
      <xs:attribute name="grow" type="xs:integer"/>
      <xs:attribute name="height" type="xs:integer"/>
      <xs:attribute name="id" use="required" type="xs:NCName"/>
      <xs:attribute name="margin"/>
      <xs:attribute name="value" type="xs:decimal"/>
      <xs:attribute name="width" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
</xs:schema>
