Files
new_install/xml/interface_ng.xml
lizhi-rocky 5ed4600bf7 ~~~
2010-07-12 17:35:16 +08:00

179 lines
3.8 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<element name="interface">
<attribute name="base_widget"/>
<attribute name="sequence"/>
<oneOrMore>
<ref name="widget"/>
</oneOrMore>
<oneOrMore>
<ref name="message_box"/>
</oneOrMore>
<zeroOrMore>
<ref name="message"/>
</zeroOrMore>
<oneOrMore>
<ref name="sequence"/>
</oneOrMore>
</element>
</start>
<define name="widget">
<element name="widget">
<attribute name="type"/>
<optional>
<attribute name="name"/>
</optional>
<optional>
<ref name="widget_attribute"/>
</optional>
<interleave>
<optional>
<!-- geometry management is to manage its sons -->
<ref name="geometry_management"/>
</optional>
<optional>
<!-- geometry location is the location inside its parent -->
<ref name="geometry_location"/>
</optional>
<optional>
<ref name="variable"/>
</optional>
</interleave>
<zeroOrMore>
<ref name="widget"/>
</zeroOrMore>
</element>
</define>
<!-- I split widget attributes from attributes added by I. So I
can easily convert add widget attributes into a dict without processing
on special cases -->
<define name="widget_attribute">
<element name="widget_attribute">
<interleave>
<optional>
<attribute name="background"/>
</optional>
<optional>
<attribute name="height"/>
</optional>
<optional>
<attribute name="width"/>
</optional>
<optional>
<attribute name="text"/>
</optional>
<optional>
<attribute name="command"/>
</optional>
<optional>
<attribute name="image"/>
</optional>
<optional>
<attribute name="state"/>
</optional>
<optional>
<attribute name="textvariable"/>
</optional>
</interleave>
</element>
</define>
<define name="geometry_management">
<!-- why choice? because there may be other geometry management-->
<choice>
<element name="grid_management">
<attribute name="rows"/>
<attribute name="columns"/>
<oneOrMore>
<element name="configure">
<choice>
<attribute name="row"/>
<attribute name="column"/>
</choice>
<attribute name="weight"/>
</element>
</oneOrMore>
</element>
</choice>
</define>
<define name="geometry_location">
<!-- why choice? because there may be other geometry location -->
<choice>
<element name="grid_location">
<attribute name="row"/>
<attribute name="column"/>
<interleave>
<optional>
<attribute name="columnspan"/>
</optional>
<optional>
<attribute name="rowspan"/>
</optional>
<optional>
<attribute name="sticky"/>
</optional>
<optional>
<attribute name="padx"/>
</optional>
<optional>
<attribute name="pady"/>
</optional>
</interleave>
</element>
</choice>
</define>
<define name="variable">
<element name="variable">
<attribute name="name"/>
<attribute name="type"/>
<optional>
<attribute name="value"/>
</optional>
</element>
</define>
<define name="message_box">
<element name="message_box">
<attribute name="name"/>
<attribute name="type"/>
<attribute name="title"/>
<attribute name="message"/>
</element>
</define>
<define name="message">
<element name="message">
<optional>
<attribute name="key"/>
</optional>
<interleave>
<element name="English">
<text/>
</element>
<element name="Chinese">
<text/>
</element>
</interleave>
</element>
</define>
<define name="sequence">
<element name="sequence">
<attribute name="name"/>
<oneOrMore>
<element name="widget">
<attribute name="name"/>
</element>
</oneOrMore>
</element>
</define>
</grammar>