<!-- gsmarkup.dtd

   Copyright (C) 2002 - 2008 Free Software Foundation, Inc.

   Author: Nicola Pero <nicola.pero@meta-innovation.com>
   Date: 2002 - 2008

   This file is part of GNUstep Renaissance

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
   
   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this library; see the file COPYING.LIB.
   If not, write to the Free Software Foundation,
   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

-->

<!-- FIXME: Sort out validation problems (using nsgmls) for empty tags -->

<!-- TODO: Do we need these XML predefined entities declarations ?  
     Without them, nsgmls barfs on &lt; -->
<!ENTITY quot    "&#34;">
<!ENTITY amp     "&#38;#38;">
<!ENTITY lt      "&#38;#60;">
<!ENTITY gt      "&#62;">
<!ENTITY apos     "&#39;">

<!-- Not all the syntax of gsmarkup can be described using a DTD.
Comments explain what we can't say using a DTD.  Mainly, in some
ELEMENTs we use 'ANY' as element content model because the available
DTD content-model syntax is not flexible enough; and in most CDATA
ATTRIBUTEs we actually have some syntax constrains we'd like to impose
on the attribute values, but those can't be expressed in a DTD, so we
just annotate them in comments but use a generic CDATA in the DTD
code. -->

<!-- top-level object -->
<!ELEMENT gsmarkup (objects | connectors)*>

<!-- the enumerated attributes that we use. -->

<!-- Boolean attributes; we'd like to define them as taking the values
 (yes|no) but that is invalid SGML because SGML does not allow the
 same value (eg, 'yes') to appear in multiple attributes with
 enumerated values.  So we just use CDATA for now.  Same for all other
 enumerated attributes; we'd like to list the enumerated values, but
 we can't because of SGML limitations; so we define them as CDATA (ie,
 any value) instead -->
<!-- <!ENTITY % boolean "(yes|no)"> -->
<!ENTITY % boolean "CDATA">
<!-- <!ENTITY % halign "(expand|wexpand|left|center|right|min|max)"> -->
<!ENTITY % halign "CDATA">
<!-- <!ENTITY % valign "(expand|wexpand|top|center|bottom|min|max)"> -->
<!ENTITY % valign "CDATA">
<!-- <!ENTITY % textAlignment "(left|center|right"> -->
<!ENTITY % textAlignment "CDATA">
<!-- <!ENTITY % state "(on|off|mixed)"> -->
<!ENTITY % state "CDATA">
<!-- <!ENTITY % menuType "(main|windows|services|font|apple)"> -->
<!ENTITY % menuType "CDATA">
<!-- <!ENTITY % imagePosition "(above|below|left|right|overlaps|imageOnly)"> -->
<!ENTITY % imagePosition "CDATA">
<!-- <!ENTITY % buttonType "(momentaryPushIn|momentaryChange|pushOnPushOff|toggle|switch)"> -->
<!ENTITY % buttonType "CDATA">
<!-- <!ENTITY % boxType "(standard|proportional)"> -->
<!ENTITY % boxType "CDATA">

<!-- objects section -->

<!-- Any valid tag is allowed, but no #PCDATA, and no gnustep, no
objects and no connectors --> 
<!ELEMENT objects ANY>

<!-- custom object -->
<!ELEMENT instance EMPTY>
<!ATTLIST instance
    instanceOf    CDATA    #REQUIRED
    id            ID       #IMPLIED>

<!-- menus -->
<!ELEMENT menu (menuItem | menuSeparator | menu)*>
<!ATTLIST menu
    id               ID         #IMPLIED
    autoenablesItems %boolean   #IMPLIED
    title            CDATA      #IMPLIED
    type             %menuType  #IMPLIED>

<!ELEMENT menuItem EMPTY>
<!ATTLIST menuItem
    id                ID             #IMPLIED
    action            CDATA          #IMPLIED 
    keyEquivalent     CDATA          #IMPLIED
    keyEquivalentModifierMask CDATA          #IMPLIED
    enabled           %boolean       #IMPLIED
    image             CDATA          #IMPLIED
    target            CDATA          #IMPLIED
    tag               CDATA          #IMPLIED 
    state             %state         #IMPLIED
    title             CDATA          #IMPLIED
    representedObject CDATA          #IMPLIED>

<!-- ATTLIST menuItem comments:
    action should end with :
    target should begin with #
    tag should be an integer
    representableObject should begin with # -->

<!ELEMENT menuSeparator EMPTY>
<!-- No attributes allowed for a menuSeparator -->

<!-- FIXME: there is really NO way to say in a DTD that we want the
window to contain a *single* tag - but we don't know which one ? -->
<!ELEMENT window ANY>

<!-- NB: If you touch this list, please update the list for panel too -->
<!ATTLIST window
    id                    ID             #IMPLIED
    instanceOf            CDATA          #IMPLIED
    borderless            %boolean       #IMPLIED
    closable              %boolean       #IMPLIED
    miniaturizable        %boolean       #IMPLIED
    resizable             %boolean       #IMPLIED
    titled                %boolean       #IMPLIED
    center                %boolean       #IMPLIED
    contentHeight         CDATA          #IMPLIED
    contentWidth          CDATA          #IMPLIED
    x                     CDATA          #IMPLIED
    y                     CDATA          #IMPLIED
    height                CDATA          #IMPLIED
    width                 CDATA          #IMPLIED
    maxHeight             CDATA          #IMPLIED
    maxWidth              CDATA          #IMPLIED
    minHeight             CDATA          #IMPLIED
    minWidth              CDATA          #IMPLIED
    releasedWhenClosed    %boolean       #IMPLIED
    title                 CDATA          #IMPLIED
    autosaveName          CDATA          #IMPLIED
    backgroundColor       CDATA          #IMPLIED
    visible               %boolean       #IMPLIED
    keyWindow             %boolean       #IMPLIED
    mainWindow            %boolean       #IMPLIED
    delegate              CDATA          #IMPLIED
    initialFirstResponder CDATA          #IMPLIED
    contentView           CDATA          #IMPLIED>

<!-- NB: panel has the same attributes as window, plus three more.  In
theory we should use parameter entitites here ... but we prefer to keep
it trivial, and repeat the whole list of attributes -->
<!ELEMENT panel ANY>
<!ATTLIST panel
    id                    ID             #IMPLIED
    instanceOf            CDATA          #IMPLIED
    borderless            %boolean       #IMPLIED
    closable              %boolean       #IMPLIED
    miniaturizable        %boolean       #IMPLIED
    resizable             %boolean       #IMPLIED
    titled                %boolean       #IMPLIED
    center                %boolean       #IMPLIED
    contentHeight         CDATA          #IMPLIED
    contentWidth          CDATA          #IMPLIED
    x                     CDATA          #IMPLIED
    y                     CDATA          #IMPLIED
    height                CDATA          #IMPLIED
    width                 CDATA          #IMPLIED
    maxHeight             CDATA          #IMPLIED
    maxWidth              CDATA          #IMPLIED
    minHeight             CDATA          #IMPLIED
    minWidth              CDATA          #IMPLIED
    releasedWhenClosed    %boolean       #IMPLIED
    title                 CDATA          #IMPLIED
    autosaveName          CDATA          #IMPLIED
    backgroundColor       CDATA          #IMPLIED
    visible               %boolean       #IMPLIED     
    keyWindow             %boolean       #IMPLIED
    mainWindow            %boolean       #IMPLIED
    delegate              CDATA          #IMPLIED
    initialFirstResponder CDATA          #IMPLIED
    contentView           CDATA          #IMPLIED

    floating               %boolean      #IMPLIED
    becomesKeyOnlyIfNeeded %boolean      #IMPLIED
    worksWhenModal         %boolean      #IMPLIED>

<!ELEMENT view ANY>
<!ATTLIST view
    id                  ID          #IMPLIED
    instanceOf          CDATA       #IMPLIED
    autoresizesSubviews %boolean    #IMPLIED
    autoresizingMask    CDATA       #IMPLIED
    border              CDATA       #IMPLIED
    halign              %halign     #IMPLIED
    hborder             CDATA       #IMPLIED
    height              CDATA       #IMPLIED
    hidden              %boolean    #IMPLIED
    proportion          CDATA       #IMPLIED
    toolTip             CDATA       #IMPLIED
    valign              %valign     #IMPLIED
    vborder             CDATA       #IMPLIED
    width               CDATA       #IMPLIED
    x                   CDATA       #IMPLIED
    y                   CDATA       #IMPLIED
    nextKeyView         CDATA       #IMPLIED>

<!ELEMENT hbox ANY>
<!ATTLIST hbox
    id                  ID          #IMPLIED
    instanceOf          CDATA       #IMPLIED
    autoresizesSubviews %boolean    #IMPLIED
    autoresizingMask    CDATA       #IMPLIED
    border              CDATA       #IMPLIED
    halign              %halign     #IMPLIED
    hborder             CDATA       #IMPLIED
    height              CDATA       #IMPLIED
    hidden              %boolean    #IMPLIED
    proportion          CDATA       #IMPLIED
    toolTip             CDATA       #IMPLIED
    valign              %valign     #IMPLIED
    vborder             CDATA       #IMPLIED
    width               CDATA       #IMPLIED
    x                   CDATA       #IMPLIED
    y                   CDATA       #IMPLIED
    nextKeyView         CDATA       #IMPLIED
    type                %boxType    #IMPLIED>

<!ELEMENT hspace EMPTY>
<!ATTLIST hspace
    id                  ID          #IMPLIED
    instanceOf          CDATA       #IMPLIED
    autoresizesSubviews %boolean    #IMPLIED
    autoresizingMask    CDATA       #IMPLIED
    border              CDATA       #IMPLIED
    halign              %halign     #IMPLIED
    hborder             CDATA       #IMPLIED
    height              CDATA       #IMPLIED
    hidden              %boolean    #IMPLIED
    proportion          CDATA       #IMPLIED
    toolTip             CDATA       #IMPLIED
    valign              %valign     #IMPLIED
    vborder             CDATA       #IMPLIED
    width               CDATA       #IMPLIED
    x                   CDATA       #IMPLIED
    y                   CDATA       #IMPLIED
    nextKeyView         CDATA       #IMPLIED>

<!ELEMENT vbox ANY>
<!ATTLIST vbox
    id                  ID          #IMPLIED
    instanceOf          CDATA       #IMPLIED
    autoresizesSubviews %boolean    #IMPLIED
    autoresizingMask    CDATA       #IMPLIED
    border              CDATA       #IMPLIED
    halign              %halign     #IMPLIED
    hborder             CDATA       #IMPLIED
    height              CDATA       #IMPLIED
    hidden              %boolean    #IMPLIED
    proportion          CDATA       #IMPLIED
    toolTip             CDATA       #IMPLIED
    valign              %valign     #IMPLIED
    vborder             CDATA       #IMPLIED
    width               CDATA       #IMPLIED
    x                   CDATA       #IMPLIED
    y                   CDATA       #IMPLIED
    nextKeyView         CDATA       #IMPLIED
    type                %boxType    #IMPLIED>

<!ELEMENT vspace EMPTY>
<!ATTLIST vspace
    id                  ID          #IMPLIED
    instanceOf          CDATA       #IMPLIED
    autoresizesSubviews %boolean    #IMPLIED
    autoresizingMask    CDATA       #IMPLIED
    border              CDATA       #IMPLIED
    halign              %halign     #IMPLIED
    hborder             CDATA       #IMPLIED
    height              CDATA       #IMPLIED
    hidden              %boolean    #IMPLIED
    proportion          CDATA       #IMPLIED
    toolTip             CDATA       #IMPLIED
    valign              %valign     #IMPLIED
    vborder             CDATA       #IMPLIED
    width               CDATA       #IMPLIED
    x                   CDATA       #IMPLIED
    y                   CDATA       #IMPLIED
    nextKeyView         CDATA       #IMPLIED>

<!ELEMENT control ANY>
<!ATTLIST control
    id                  ID          #IMPLIED
    instanceOf          CDATA       #IMPLIED
    autoresizesSubviews %boolean    #IMPLIED
    autoresizingMask    CDATA       #IMPLIED
    border              CDATA       #IMPLIED
    halign              %halign     #IMPLIED
    hborder             CDATA       #IMPLIED
    height              CDATA       #IMPLIED
    hidden              %boolean    #IMPLIED
    proportion          CDATA       #IMPLIED
    toolTip             CDATA       #IMPLIED
    valign              %valign     #IMPLIED
    vborder             CDATA       #IMPLIED
    width               CDATA       #IMPLIED
    x                   CDATA       #IMPLIED
    y                   CDATA       #IMPLIED
    nextKeyView         CDATA       #IMPLIED
    action              CDATA       #IMPLIED
    enabled             %boolean    #IMPLIED
    tag                 CDATA       #IMPLIED
    textAlignment       %textAlignment  #IMPLIED
    font                CDATA       #IMPLIED
    target              CDATA       #IMPLIED
    continuous          %boolean    #IMPLIED
    sendActionOn        CDATA       #IMPLIED>

<!ELEMENT button EMPTY>
<!ATTLIST button
    id                  ID          #IMPLIED
    instanceOf          CDATA       #IMPLIED
    autoresizesSubviews %boolean    #IMPLIED
    autoresizingMask    CDATA       #IMPLIED
    border              CDATA       #IMPLIED
    halign              %halign     #IMPLIED
    hborder             CDATA       #IMPLIED
    height              CDATA       #IMPLIED
    hidden              %boolean    #IMPLIED
    proportion          CDATA       #IMPLIED
    toolTip             CDATA       #IMPLIED
    valign              %valign     #IMPLIED
    vborder             CDATA       #IMPLIED
    width               CDATA       #IMPLIED
    x                   CDATA       #IMPLIED
    y                   CDATA       #IMPLIED
    nextKeyView         CDATA       #IMPLIED
    action              CDATA       #IMPLIED
    enabled             %boolean    #IMPLIED
    tag                 CDATA       #IMPLIED
    textAlignment       %textAlignment  #IMPLIED
    font                CDATA       #IMPLIED
    target              CDATA       #IMPLIED
    continuous          %boolean    #IMPLIED
    sendActionOn        CDATA       #IMPLIED
    title               CDATA       #IMPLIED
    image               CDATA       #IMPLIED
    imagePosition       %imagePosition  #IMPLIED
    keyEquivalent       CDATA       #IMPLIED
    keyEquivalentModifierMask CDATA          #IMPLIED
    alternateTitle      CDATA       #IMPLIED
    alternateImage      CDATA       #IMPLIED
    type                %buttonType  #IMPLIED
    sound               CDATA       #IMPLIED>

<!ELEMENT label (#PCDATA)>
<!ATTLIST label
    id                  ID          #IMPLIED
    instanceOf          CDATA       #IMPLIED
    autoresizesSubviews %boolean    #IMPLIED
    autoresizingMask    CDATA       #IMPLIED
    border              CDATA       #IMPLIED
    halign              %halign     #IMPLIED
    hborder             CDATA       #IMPLIED
    height              CDATA       #IMPLIED
    hidden              %boolean    #IMPLIED
    proportion          CDATA       #IMPLIED
    toolTip             CDATA       #IMPLIED
    valign              %valign     #IMPLIED
    vborder             CDATA       #IMPLIED
    width               CDATA       #IMPLIED
    x                   CDATA       #IMPLIED
    y                   CDATA       #IMPLIED
    nextKeyView         CDATA       #IMPLIED
    action              CDATA       #IMPLIED
    enabled             %boolean    #IMPLIED
    tag                 CDATA       #IMPLIED
    textAlignment       %textAlignment  #IMPLIED
    font                CDATA       #IMPLIED
    target              CDATA       #IMPLIED
    continuous          %boolean    #IMPLIED
    sendActionOn        CDATA       #IMPLIED
    textColor           CDATA       #IMPLIED
    backgroundColor     CDATA       #IMPLIED
    selectable          %boolean    #IMPLIED>

<!ELEMENT textField (#PCDATA)>
<!ATTLIST textField
    id                  ID          #IMPLIED
    instanceOf          CDATA       #IMPLIED
    autoresizesSubviews %boolean    #IMPLIED
    autoresizingMask    CDATA       #IMPLIED
    border              CDATA       #IMPLIED
    halign              %halign     #IMPLIED
    hborder             CDATA       #IMPLIED
    height              CDATA       #IMPLIED
    hidden              %boolean    #IMPLIED
    proportion          CDATA       #IMPLIED
    toolTip             CDATA       #IMPLIED
    valign              %valign     #IMPLIED
    vborder             CDATA       #IMPLIED
    width               CDATA       #IMPLIED
    x                   CDATA       #IMPLIED
    y                   CDATA       #IMPLIED
    nextKeyView         CDATA       #IMPLIED
    action              CDATA       #IMPLIED
    enabled             %boolean    #IMPLIED
    tag                 CDATA       #IMPLIED
    textAlignment       %textAlignment  #IMPLIED
    font                CDATA       #IMPLIED
    target              CDATA       #IMPLIED
    continuous          %boolean    #IMPLIED
    sendActionOn        CDATA       #IMPLIED
    textColor           CDATA       #IMPLIED
    backgroundColor     CDATA       #IMPLIED
    drawsBackground     %boolean    #IMPLIED
    editable            %boolean    #IMPLIED
    selectable          %boolean    #IMPLIED
    allowsEditingTextAttributes     %boolean  #IMPLIED
    importsGraphics     %boolean    #IMPLIED
    delegate            CDATA       #IMPLIED>

<!ELEMENT secureTextField (#PCDATA)>
<!ATTLIST secureTextField
    id                  ID          #IMPLIED
    instanceOf          CDATA       #IMPLIED
    autoresizesSubviews %boolean    #IMPLIED
    autoresizingMask    CDATA       #IMPLIED
    border              CDATA       #IMPLIED
    halign              %halign     #IMPLIED
    hborder             CDATA       #IMPLIED
    height              CDATA       #IMPLIED
    hidden              %boolean    #IMPLIED
    proportion          CDATA       #IMPLIED
    toolTip             CDATA       #IMPLIED
    valign              %valign     #IMPLIED
    vborder             CDATA       #IMPLIED
    width               CDATA       #IMPLIED
    x                   CDATA       #IMPLIED
    y                   CDATA       #IMPLIED
    nextKeyView         CDATA       #IMPLIED
    action              CDATA       #IMPLIED
    enabled             %boolean    #IMPLIED
    tag                 CDATA       #IMPLIED
    textAlignment       %textAlignment  #IMPLIED
    font                CDATA       #IMPLIED
    target              CDATA       #IMPLIED
    continuous          %boolean    #IMPLIED
    sendActionOn        CDATA       #IMPLIED
    textColor           CDATA       #IMPLIED
    backgroundColor     CDATA       #IMPLIED
    drawsBackground     %boolean    #IMPLIED
    editable            %boolean    #IMPLIED
    selectable          %boolean    #IMPLIED
    allowsEditingTextAttributes     %boolean  #IMPLIED
    importsGraphics     %boolean    #IMPLIED
    delegate            CDATA       #IMPLIED>

<!ELEMENT colorWell EMPTY>
<!ATTLIST colorWell
    id                  ID          #IMPLIED
    instanceOf          CDATA       #IMPLIED
    autoresizesSubviews %boolean    #IMPLIED
    autoresizingMask    CDATA       #IMPLIED
    border              CDATA       #IMPLIED
    halign              %halign     #IMPLIED
    hborder             CDATA       #IMPLIED
    height              CDATA       #IMPLIED
    hidden              %boolean    #IMPLIED
    proportion          CDATA       #IMPLIED
    toolTip             CDATA       #IMPLIED
    valign              %valign     #IMPLIED
    vborder             CDATA       #IMPLIED
    width               CDATA       #IMPLIED
    x                   CDATA       #IMPLIED
    y                   CDATA       #IMPLIED
    nextKeyView         CDATA       #IMPLIED
    action              CDATA       #IMPLIED
    enabled             %boolean    #IMPLIED
    tag                 CDATA       #IMPLIED
    textAlignment       %textAlignment  #IMPLIED
    font                CDATA       #IMPLIED
    target              CDATA       #IMPLIED
    continuous          %boolean    #IMPLIED
    sendActionOn        CDATA       #IMPLIED
    color               CDATA       #IMPLIED
    bordered            %boolean    #IMPLIED>

<!-- FIXME/TODO: the image tag misses all the attributes inherited
     from <view> and from <control> -->
<!ELEMENT image EMPTY>
<!ATTLIST image
    id                ID             #IMPLIED
    instanceOf        CDATA          #IMPLIED
    name              CDATA          #IMPLIED
    alignment         CDATA          #IMPLIED
    scaling           CDATA          #IMPLIED>

<!-- connectors section -->

<!-- Any valid tag is allowed, but no #PCDATA, and no gnustep, no
objects and no connectors -->
<!ELEMENT connectors ANY>

<!-- control connector -->
<!-- FIXME: this has the same name as the control tag in the
     objects section, does dtd support it ? -->
<!-- <!ELEMENT control EMPTY> -->
<!-- <!ATTLIST control
    source   CDATA    #REQUIRED
    target   CDATA    #IMPLIED
    action   CDATA    #IMPLIED
    label    CDATA    #IMPLIED> -->

<!-- ATTLIST control comments:
    source should begin with #
    target should begin with #
    action should end with :
    label should end with :
    if there is an action, there should be not be a label, and vice versa -->

<!-- outlet connector -->
<!ELEMENT outlet EMPTY>
<!ATTLIST outlet
    source   CDATA    #REQUIRED
    target   CDATA    #IMPLIED
    key      CDATA    #IMPLIED
    label    CDATA    #IMPLIED>

<!-- ATTLIST outlet comments:
    source should begin with #
    target should begin with #
    either key/label is actually REQUIRED.  Only one of the two
    should be present -->
