<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Definition of save XML format for Codeblocks -->

<!-- Root element -->
<!ELEMENT CodeBlocks (Pages?, BlockDrawerSets?)>

<!ELEMENT Pages (Page+)>
<!-- NOTE: Exclusive saving (where only changed information or information that
           differs from the language definition file is saved) is not 
           enabled for pages YET -->
<!ATTLIST Pages is-blank-page (yes|no) "no">
<!ELEMENT Page (PageBlocks?)>
<!ATTLIST Page page-name CDATA #REQUIRED>
<!ATTLIST Page page-width CDATA #REQUIRED>
<!ATTLIST Page page-color CDATA #REQUIRED>
<!ATTLIST Page page-drawer CDATA #IMPLIED>  



<!-- If the Block is a BlockStub, then specify the following -->
<!ELEMENT BlockStub (StubParentName, StubParentGenus, Block)>
<!ELEMENT StubParentName (#PCDATA)>
<!ELEMENT StubParentGenus (#PCDATA)>

<!ELEMENT Block (Label?, PageLabel?, Location?, BoxSize?, Collapsed?, Comment?, BeforeBlockId?, AfterBlockId?, CompilerErrorMsg?, Plug?, Sockets*, LangSpecProperties?)>
<!ATTLIST Block id CDATA #REQUIRED>
<!ATTLIST Block genus-name CDATA #REQUIRED>
<!ATTLIST Block has-focus (yes|no) "no">

<!ELEMENT PageBlocks (Block*, BlockStub*)>

<!ELEMENT Label (#PCDATA)>
<!ELEMENT PageLabel (#PCDATA)>
<!ELEMENT CompilerErrorMsg (#PCDATA)>

<!-- x, y  location within the block's page-->
<!ELEMENT Location (X, Y)>
<!ELEMENT X (#PCDATA)>
<!ELEMENT Y (#PCDATA)>

<!-- width, height box size -->
<!ELEMENT BoxSize (Width, Height)>
<!ELEMENT Width (#PCDATA)>
<!ELEMENT Height (#PCDATA)>

<!-- existence of this element implies the block is collapsed -->
<!ELEMENT Collapsed EMPTY>

<!-- Comment widget associated with a Block -->
<!ELEMENT Comment (Text, Location, Collapsed?)>
<!ELEMENT Text (#PCDATA)>

<!--  Only the Block ID of the block connected at these connectors are 
      specified.   -->
<!ELEMENT BeforeBlockId (#PCDATA)>
<!ELEMENT AfterBlockId (#PCDATA)>

<!ELEMENT Plug (BlockConnector)>
<!ELEMENT Sockets (BlockConnector*)>

<!-- NOTE: Exclusive saving is not enabled for Block Connectors YET -->
<!ELEMENT BlockConnector EMPTY>
<!ATTLIST BlockConnector label CDATA #IMPLIED>
<!ATTLIST BlockConnector connector-kind (plug|socket) "socket">
<!ATTLIST BlockConnector init-type CDATA #IMPLIED> 
<!ATTLIST BlockConnector connector-type CDATA #IMPLIED> 
<!ATTLIST BlockConnector con-block-id CDATA #IMPLIED>
<!ATTLIST BlockConnector position-type (single|mirror|bottom) #IMPLIED>
<!ATTLIST BlockConnector is-expandable (yes|no) #IMPLIED> 

<!ELEMENT LangSpecProperties (LangSpecProperty*)>
<!ELEMENT LangSpecProperty (#PCDATA)>
<!ATTLIST LangSpecProperty key CDATA #REQUIRED>
<!ATTLIST LangSpecProperty value CDATA #REQUIRED>

<!-- To dynamically add drawers and blocks within them to the workspace 
    	If a drawer set or drawer already exists with the name specified for
    	these widgets within the lang def file, then the loader will 
    	simply insert the new drawers or 	blocks into the these already loaded widgets.   -->

<!-- Defines BlockDrawerSets and their Block Drawer content-->
<!ELEMENT BlockDrawerSets (BlockDrawerSet*)>
<!ELEMENT BlockDrawerSet (BlockDrawer*)>
<!ATTLIST BlockDrawerSet type (bar|stack) "bar">
<!ATTLIST BlockDrawerSet name CDATA #REQUIRED>
<!ATTLIST BlockDrawerSet location (east|west|north|south|northeast|southeast|southwest|northwest) "west">
<!-- window-per-drawer specifies if each drawer should be its own draggable window.  otherwise, all the drawers 
	are contained within one draggable window and only one drawer can be opened at once. 
	Whether or not the window is draggable depends if drawer-draggable is set to "yes." --> 
<!ATTLIST BlockDrawerSet window-per-drawer (yes|no) "yes">
<!ATTLIST BlockDrawerSet drawer-draggable (yes|no) "yes">

<!--This defines BlockDrawers and their content-->
<!ELEMENT BlockDrawer ( (BlockGenusMember | Separator | NextLine)* )>
<!ATTLIST BlockDrawer name CDATA #REQUIRED>
<!ATTLIST BlockDrawer type (default|factory|page|custom) "default">
<!ATTLIST BlockDrawer is-open (yes|no) "no">
<!ATTLIST BlockDrawer button-color CDATA #REQUIRED>
<!ELEMENT BlockGenusMember (#PCDATA)>
<!ELEMENT Separator EMPTY>
<!ELEMENT NextLine EMPTY>