<?xml version="1.0" encoding="UTF-8"?>

<?context-directive job ctxfile x-setups.ctx ?>

<cd:interface xmlns:cd="http://www.pragma-ade.com/commands">

    <cd:command name="defineframed" level="style" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupframed" level="style" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-list-optional"/>
            <cd:assignments list="yes">
                <cd:parameter name="corner">
                    <cd:constant type="rectangular" default="yes"/>
                    <cd:constant type="round"/>
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="framecorner">
                    <cd:constant type="rectangular" default="yes"/>
                    <cd:constant type="round"/>
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="backgroundcorner">
                    <cd:constant type="rectangular" default="yes"/>
                    <cd:constant type="round"/>
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="radius">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="frameradius">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="backgroundradius">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="depth">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="framedepth">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="backgrounddepth">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="framecolor">
                    <cd:constant type="cd:color"/>
                </cd:parameter>
                <cd:parameter name="topframe">
                    <cd:constant type="on" default="yes"/>
                    <cd:constant type="off"/>
                    <cd:constant type="small"/>
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="bottomframe">
                    <cd:constant type="on" default="yes"/>
                    <cd:constant type="off"/>
                    <cd:constant type="small"/>
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="leftframe">
                    <cd:constant type="on" default="yes"/>
                    <cd:constant type="off"/>
                    <cd:constant type="small"/>
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="rightframe">
                    <cd:constant type="on" default="yes"/>
                    <cd:constant type="off"/>
                    <cd:constant type="small"/>
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="region">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                </cd:parameter>
                <cd:parameter name="rulethickness">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="frameoffset">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="frame">
                    <cd:constant type="on" default="yes"/>
                    <cd:constant type="off"/>
                    <cd:constant type="overlay"/>
                    <cd:constant type="small"/>
                    <cd:constant type="closed"/>
                    <cd:constant type="none"/>
                </cd:parameter>
                <cd:parameter name="background">
                    <cd:resolve name="value-background"/>
                </cd:parameter>
                <cd:parameter name="backgroundoffset">
                    <cd:constant type="frame"/>
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="component">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="extras">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="foregroundstyle">
                    <cd:resolve name="value-style"/>
                </cd:parameter>
                <cd:parameter name="foregroundcolor">
                    <cd:constant type="cd:color"/>
                </cd:parameter>
                <cd:parameter name="setups">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="offset">
                    <cd:constant type="default"/>
                    <cd:constant type="overlay"/>
                    <cd:constant type="none"/>
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="width">
                    <cd:constant type="local"/>
                    <cd:constant type="fit" default="yes"/>
                    <cd:constant type="max"/>
                    <cd:constant type="broad"/>
                    <cd:constant type="fixed"/>
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="height">
                    <cd:constant type="fit"/>
                    <cd:constant type="max"/>
                    <cd:constant type="broad" default="yes"/>
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="minheight">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="align">
                    <cd:inherit name="setupalign"/>
                </cd:parameter>
                <cd:parameter name="strut">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                    <cd:constant type="none"/>
                    <cd:constant type="local"/>
                    <cd:constant type="global"/>
                </cd:parameter>
                <cd:parameter name="autostrut">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                </cd:parameter>
                <cd:parameter name="location">
                    <cd:constant type="height"/>
                    <cd:constant type="depth"/>
                    <cd:constant type="high"/>
                    <cd:constant type="low"/>
                    <cd:constant type="top"/>
                    <cd:constant type="middle"/>
                    <cd:constant type="bottom"/>
                    <cd:constant type="line"/>
                    <cd:constant type="lohi"/>
                    <cd:constant type="hanging"/>
                    <cd:constant type="keep"/>
                    <cd:constant type="formula"/>
                    <cd:constant type="mathematics"/>
                    <cd:constant type="normal" default="yes"/>
                </cd:parameter>
                <cd:parameter name="autowidth">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                    <cd:constant type="force"/>
                </cd:parameter>
                <!--
                    <cd:parameter name="fr!analyze">
                        <cd:constant type="yes"/>
                        <cd:constant type="no" default="yes"/>
                    </cd:parameter>
                -->
                <cd:parameter name="lines">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="top">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="bottom">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="blank">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                </cd:parameter>
                <cd:parameter name="profile">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="empty">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                </cd:parameter>
                <cd:parameter name="loffset">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="roffset">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="toffset">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="boffset">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="orientation">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <!--
                    <cd:parameter name="style">
                        <cd:resolve name="value-style"/>
                    </cd:parameter>
                    <cd:parameter name="color">
                        <cd:constant type="cd:color"/>
                    </cd:parameter>
                -->
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="frameddimension" level="system" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-key"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="framedparameter" level="system" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-key"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="framed" level="document" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
            <cd:content/>
        </cd:arguments>
    </cd:command>

    <cd:command name="framed" generated="yes" variant="instance" level="document" category="background rules" file="pack-rul.mkiv">
        <cd:sequence>
            <cd:instance value="framed"/>
        </cd:sequence>
        <cd:arguments>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
            <cd:content/>
        </cd:arguments>
        <cd:instances>
            <cd:resolve name="instance-framed"/>
        </cd:instances>
    </cd:command>

    <cd:command name="normalframedwithsettings" level="system" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:assignments list="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
            <cd:content/>
        </cd:arguments>
    </cd:command>

    <cd:command name="framed" type="environment" level="document" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="fastlocalframed" level="system" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:assignments list="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
            <cd:content/>
        </cd:arguments>
    </cd:command>

    <cd:command name="localframed" level="system" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
            <cd:content/>
        </cd:arguments>
    </cd:command>

    <cd:command name="directlocalframed" level="system" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:content/>
        </cd:arguments>
    </cd:command>

    <cd:command name="localframedwithsettings" level="system" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:assignments list="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
            <cd:content/>
        </cd:arguments>
    </cd:command>

    <cd:command name="placeframed" level="document" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
            <cd:content/>
        </cd:arguments>
    </cd:command>

    <cd:command name="inframed" level="document" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
            <cd:content/>
        </cd:arguments>
    </cd:command>

    <!--

        <cd:command name="unframed" level="document" category="background rules" file="pack-rul.mkiv">
            <cd:arguments>
                <cd:assignments list="yes" optional="yes">
                    <cd:inherit name="setupframed"/>
                </cd:assignments>
                <cd:content/>
            </cd:arguments>
        </cd:command>

    -->

    <cd:command name="definemathframed" level="style" category="background rules mathematics" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupmathframed"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupmathframed" level="style" category="background rules mathematics" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-list-optional"/>
            <cd:assignments list="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="mathframed" generated="yes" variant="instance" level="document" category="background rules mathematics" file="pack-rul.mkiv">
        <cd:sequence>
            <cd:instance value="mathframed"/>
        </cd:sequence>
        <cd:arguments>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupmathframed"/>
            </cd:assignments>
            <cd:content/>
        </cd:arguments>
        <cd:instances>
            <cd:resolve name="instance-mathframed"/>
        </cd:instances>
    </cd:command>

    <!--

        <cd:command name="mframed" level="document" category="background rules mathematics" file="pack-rul.mkiv">
            <cd:arguments>
                <cd:assignments list="yes" optional="yes">
                    <cd:inherit name="setupmathframed"/>
                </cd:assignments>
                <cd:content/>
            </cd:arguments>
        </cd:command>

        <cd:command name="inmframed" level="document" category="background rules mathematics" file="pack-rul.mkiv">
            <cd:arguments>
                <cd:assignments list="yes" optional="yes">
                    <cd:inherit name="setupmathframed"/>
                </cd:assignments>
                <cd:content/>
            </cd:arguments>
        </cd:command>

        <cd:command name="mcframed" level="document" category="background rules mathematics" file="pack-rul.mkiv">
            <cd:arguments>
                <cd:assignments list="yes" optional="yes">
                    <cd:inherit name="setupmathframed"/>
                </cd:assignments>
                <cd:content/>
            </cd:arguments>
        </cd:command>

    -->

    <cd:command name="defineformulaframed" level="style" category="background rules mathematics" file="math-for.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupformulaframed"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupformulaframed" level="style" category="background rules mathematics" file="math-for.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-list-optional"/>
            <cd:assignments list="yes">
                <cd:inherit name="setupframed"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="defineframedtext" level="style" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupframedtext"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupframedtext" level="style" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-list-optional"/>
            <cd:assignments list="yes">
                <cd:parameter name="left">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="right">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="inner">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="location">
                    <cd:constant type="left"/>
                    <cd:constant type="right"/>
                    <cd:constant type="middle"/>
                    <cd:constant type="none"/>
                </cd:parameter>
                <cd:parameter name="depthcorrection">
                    <cd:constant type="on" default="yes"/>
                    <cd:constant type="off"/>
                </cd:parameter>
                <cd:parameter name="bodyfont">
                    <cd:inherit name="setupbodyfont"/>
                </cd:parameter>
                <cd:parameter name="indenting">
                    <cd:inherit name="setupindenting"/>
                </cd:parameter>
                <cd:parameter name="style">
                    <cd:resolve name="value-style"/>
                </cd:parameter>
                <cd:parameter name="color">
                    <cd:constant type="cd:color"/>
                </cd:parameter>
                <cd:inherit name="setupframed"/>
                <cd:inherit name="setupplacement"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupframedtexts" level="style" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-list-optional"/>
            <cd:assignments list="yes">
                <cd:inherit name="setupframedtext"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="framedtext" generated="yes" variant="instance" level="document" category="background rules" file="pack-rul.mkiv">
        <cd:sequence>
            <cd:instance value="framedtext"/>
        </cd:sequence>
        <cd:arguments>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupframedtext"/>
            </cd:assignments>
            <cd:content/>
        </cd:arguments>
        <cd:instances>
            <cd:resolve name="instance-framedtext"/>
        </cd:instances>
    </cd:command>

    <cd:command name="framedtext" type="environment" generated="yes" variant="instance" level="document" category="background rules" file="pack-rul.mkiv">
        <cd:sequence>
            <cd:instance value="framedtext"/>
        </cd:sequence>
        <cd:arguments>
            <cd:keywords optional="yes">
                <cd:constant type="left"/>
                <cd:constant type="right"/>
                <cd:constant type="middle"/>
                <cd:constant type="none"/>
            </cd:keywords>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupframedtext"/>
            </cd:assignments>
        </cd:arguments>
        <cd:instances>
            <cd:resolve name="instance-framedtext"/>
        </cd:instances>
    </cd:command>

    <!--

        <cd:command name="framedtext" level="document" category="background rules" file="pack-rul.mkiv">
            <cd:arguments>
                <cd:assignments list="yes" optional="yes">
                    <cd:inherit name="setupframedtext"/>
                </cd:assignments>
                <cd:content/>
            </cd:arguments>
        </cd:command>

        <cd:command name="framedtext" type="environment" level="document" category="background rules" file="pack-rul.mkiv">
            <cd:arguments>
                <cd:keywords optional="yes">
                    <cd:constant type="left"/>
                    <cd:constant type="right"/>
                    <cd:constant type="middle"/>
                    <cd:constant type="none"/>
                </cd:keywords>
                <cd:assignments list="yes" optional="yes">
                    <cd:inherit name="setupframedtext"/>
                </cd:assignments>
            </cd:arguments>
        </cd:command>

    -->

    <cd:command name="defineframedcontent" level="style" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupframedcontent"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupframedcontent" level="style" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-list-optional"/>
            <cd:assignments list="yes">
                <cd:parameter name="left">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="right">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="leftoffser">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="rightoffset">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="topoffset">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="bottomoffset">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="linecorrection">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                </cd:parameter>
                <cd:inherit name="setupframed"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="framedcontent" type="environment" level="system" category="background rules" file="pack-rul.mkiv">
        <cd:arguments>
            <cd:keywords optional="yes">
                <cd:constant type="cd:name"/>
                <cd:constant type="off"/>
            </cd:keywords>
        </cd:arguments>
    </cd:command>

    <cd:command name="installleftframerenderer" level="system" category="background rules" file="pack-fen.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-command"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="installrightframerenderer" level="system" category="background rules" file="pack-fen.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-command"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="installtopframerenderer" level="system" category="background rules" file="pack-fen.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-command"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="installbottomframerenderer" level="system" category="background rules" file="pack-fen.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-command"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="doifelseframed" level="system" category="background rules">
        <cd:arguments>
            <cd:csname/>
            <cd:resolve name="argument-true"/>
            <cd:resolve name="argument-false"/>
        </cd:arguments>
    </cd:command>

</cd:interface>