<?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="defineexternalfigure" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupexternalfigure"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <!--

        <cd:command name="defineexternalfigures" level="style" category="graphics" file="grph-inc.mkiv">
            <cd:arguments>
                <cd:resolve name="keyword-name"/>
                <cd:resolve name="keyword-name-optional"/>
                <cd:assignments list="yes" optional="yes">
                    <cd:inherit name="setupexternalfigure"/>
                </cd:assignments>
            </cd:arguments>
        </cd:command>

    -->

    <cd:command name="setupexternalfigure" level="style" category="graphics" file="grph-inc.mkvi">
        <cd:arguments>
            <cd:resolve name="keyword-name-list-optional"/>
            <cd:assignments list="yes">
                <cd:parameter name="width">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="height">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="label">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="page">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="object">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                </cd:parameter>
                <cd:parameter name="prefix">
                    <cd:constant type="cd:text"/>
                </cd:parameter>
                <cd:parameter name="method">
                    <cd:constant type="pdf"/>
                    <cd:constant type="mps"/>
                    <cd:constant type="jpg"/>
                    <cd:constant type="png"/>
                    <cd:constant type="jp2"/>
                    <cd:constant type="jbig"/>
                    <cd:constant type="svg"/>
                    <cd:constant type="eps"/>
                    <cd:constant type="gif"/>
                    <cd:constant type="tif"/>
                    <cd:constant type="mov"/>
                    <cd:constant type="buffer"/>
                    <cd:constant type="tex"/>
                    <cd:constant type="cld"/>
                    <cd:constant type="auto"/>
                </cd:parameter>
                <cd:parameter name="controls">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                </cd:parameter>
                <cd:parameter name="preview">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                </cd:parameter>
                <cd:parameter name="mask">
                    <cd:constant type="none"/>
                </cd:parameter>
                <cd:parameter name="resolution">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="color">
                    <cd:constant type="cd:color"/>
                </cd:parameter>
                <cd:parameter name="arguments">
                    <cd:constant type="cd:text"/>
                </cd:parameter>
                <cd:parameter name="repeat">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                </cd:parameter>
                <cd:parameter name="factor">
                    <cd:constant type="fit"/>
                    <cd:constant type="broad"/>
                    <cd:constant type="max"/>
                    <cd:constant type="auto"/>
                    <cd:constant type="default"/>
                </cd:parameter>
                <cd:parameter name="hfactor">
                    <cd:constant type="fit"/>
                    <cd:constant type="broad"/>
                    <cd:constant type="max"/>
                    <cd:constant type="auto"/>
                    <cd:constant type="default"/>
                </cd:parameter>
                <cd:parameter name="wfactor">
                    <cd:constant type="fit"/>
                    <cd:constant type="broad"/>
                    <cd:constant type="max"/>
                    <cd:constant type="auto"/>
                    <cd:constant type="default"/>
                </cd:parameter>
                <cd:parameter name="maxwidth">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="maxheight">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="equalwidth">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="equalheight">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="scale">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="xscale">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="yscale">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="s">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="sx">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="sy">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="lines">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="location">
                    <cd:constant type="local" default="yes"/>
                    <cd:constant type="global" default="yes"/>
                    <cd:constant type="default"/>
                </cd:parameter>
                <cd:parameter name="directory">
                    <cd:constant type="cd:path"/>
                </cd:parameter>
                <cd:parameter name="option">
                    <cd:constant type="test"/>
                    <cd:constant type="frame"/>
                    <cd:constant type="empty"/>
                </cd:parameter>
                <cd:parameter name="foregroundcolor">
                    <cd:constant type="cd:color"/>
                </cd:parameter>
                <cd:parameter name="reset">
                    <cd:constant type="yes"/>
                    <cd:constant type="no" default="yes"/>
                </cd:parameter>
                <cd:parameter name="background">
                    <cd:constant type="color"/>
                    <cd:constant type="foreground"/>
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="frame">
                    <cd:constant type="on"/>
                    <cd:constant type="off" default="yes"/>
                </cd:parameter>
                <cd:parameter name="backgroundcolor">
                    <cd:constant type="cd:color"/>
                </cd:parameter>
                <!--
                    <cd:parameter name="align">
                        <cd:inherit name="setupalign"/>
                    </cd:parameter>
                -->
                <cd:parameter name="xmax">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="ymax">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="frames">
                    <cd:constant type="on"/>
                    <cd:constant type="off" default="yes"/>
                </cd:parameter>
                <cd:parameter name="interaction">
                    <cd:constant type="yes"/>
                    <cd:constant type="all"/>
                    <cd:constant type="none" default="yes"/>
                    <cd:constant type="reference"/>
                    <cd:constant type="layer"/>
                    <cd:constant type="bookmark"/>
                </cd:parameter>
                <cd:parameter name="bodyfont">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="comment">
                    <cd:constant type="cd:command"/>
                    <cd:constant type="cd:text"/>
                </cd:parameter>
                <cd:parameter name="size">
                    <cd:constant type="none"/>
                    <cd:constant type="media"/>
                    <cd:constant type="crop"/>
                    <cd:constant type="trim"/>
                    <cd:constant type="art"/>
                </cd:parameter>
                <cd:parameter name="cache">
                    <cd:constant type="cd:path"/>
                </cd:parameter>
                <cd:parameter name="resources">
                    <cd:constant type="cd:path"/>
                </cd:parameter>
                <cd:parameter name="display">
                    <cd:constant type="cd:file"/> <!-- an alternative figure often low res .. old school pdf stuff -->
                </cd:parameter>
                <cd:parameter name="conversion">
                    <cd:constant type="cd:text"/> <!-- a extra (kind of) suffix that triggers conversion -->
                </cd:parameter>
                <cd:parameter name="order">
                    <cd:constant type="cd:list"/> <!-- a list of suffixes/types to check -->
                </cd:parameter>
                <cd:parameter name="crossreference">
                    <cd:constant type="yes"/>
                    <cd:constant type="no"/>
                    <!-- only passed by the system: -->
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="transform">
                    <cd:constant type="auto" default="yes"/>
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="userpassword">
                    <cd:constant type="cd:text"/>
                </cd:parameter>
                <cd:parameter name="ownerpassword">
                    <cd:constant type="cd:text"/>
                </cd:parameter>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <!--

        <cd:command name="setupexternalfigures" level="style" category="graphics" file="grph-inc.mkvi">
            <cd:arguments>
                <cd:resolve name="keyword-name-list-optional"/>
                <cd:assignments list="yes">
                    <cd:inherit name="setupexternalfigure"/>
                </cd:assignments>
            </cd:arguments>
        </cd:command>

    -->

    <cd:command name="useexternalfigure" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-file"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupexternalfigure"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="externalfigure" level="document" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-file"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupexternalfigure"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="getfiguredimensions" level="system" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-file"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupexternalfigure"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="figurewidth" level="system" category="graphics" file="grph-inc.mkiv"/>

    <cd:command name="figureheight" level="system" category="graphics" file="grph-inc.mkiv"/>

    <cd:command name="figurenaturalwidth" level="system" category="graphics" file="grph-inc.mkiv"/>

    <cd:command name="figurenaturalheight" level="system" category="graphics" file="grph-inc.mkiv"/>

    <cd:command name="figurefullname" level="system" category="graphics" file="grph-inc.mkiv"/>

    <cd:command name="figurefilename" level="system" category="graphics" file="grph-inc.mkiv"/>

    <cd:command name="figurefilepath" level="system" category="graphics" file="grph-inc.mkiv"/>

    <cd:command name="figurefiletype" level="system" category="graphics" file="grph-inc.mkiv"/>

    <cd:command name="noffigurepages" level="system" category="graphics" file="grph-inc.mkiv"/>

    <cd:command name="definegraphictypesynonym" level="system" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="doifelsefigure" level="system" category="graphics conditional" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-file"/>
            <cd:resolve name="argument-true"/>
            <cd:resolve name="argument-false"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="doiffigureelse" level="system" category="graphics conditional" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-file"/>
            <cd:resolve name="argument-true"/>
            <cd:resolve name="argument-false"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="registerexternalfigure" level="system" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-file"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupexternalfigure"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="usefigurebase" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:keywords>
                <cd:constant type="reset"/>
                <cd:constant type="cd:file"/>
            </cd:keywords>
        </cd:arguments>
    </cd:command>

    <cd:command name="externalfigurecollection" type="environment" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="externalfigurecollectionminwidth" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="externalfigurecollectionmaxwidth" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="externalfigurecollectionminheight" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="externalfigurecollectionmaxheight" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="externalfigurecollectionparameter" level="system" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-key"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="efcminwidth" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="efcmaxwidth" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="efcminheight" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="efcmaxheight" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="efcparameter" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-key"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="overlayfigure" level="style" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-file"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="bitmapimage" level="document" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:assignments list="yes">
                <cd:parameter name="color">
                    <cd:constant type="rgb"/>
                    <cd:constant type="cmyk"/>
                    <cd:constant type="gray"/>
                </cd:parameter>
                <cd:parameter name="width">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="height">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="x">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="y">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
            </cd:assignments>
            <cd:keywords delimiters="braces">
                <cd:constant type="cd:number"/>
            </cd:keywords>
        </cd:arguments>
    </cd:command>

    <cd:command name="bitmapimage" type="environment" level="document" category="graphics" file="grph-inc.mkiv">
        <cd:arguments>
            <cd:assignments list="yes">
                <cd:parameter name="color">
                    <cd:constant type="rgb"/>
                    <cd:constant type="cmyk"/>
                    <cd:constant type="gray"/>
                </cd:parameter>
                <cd:parameter name="width">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="height">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="x">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="y">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="typesetbuffer" level="document" category="graphics buffer" file="grph-fig.mkiv">
        <cd:arguments>
            <cd:keywords optional="yes">
                <cd:constant type="*"/>
                <cd:constant type="cd:buffer"/>
            </cd:keywords>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupexternalfigure"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="definetypesetting" level="style" category="graphics structure" file="grph-fig.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-text-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupexternalfigure"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="typesetfile" level="document" category="graphics structure" file="grph-fig.mkiv">
        <cd:arguments>
            <cd:keywords>
                <cd:constant type="cd:name"/>
                <cd:constant type="cd:file"/>
            </cd:keywords>
            <cd:keywords optional="yes">
                <cd:constant type="cd:file"/>
                <cd:constant type="cd:text"/>
            </cd:keywords>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupexternalfigure"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="backgroundimage" level="style" category="graphics" file="pack-box.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-number"/>
            <cd:resolve name="argument-dimension"/>
            <cd:resolve name="argument-dimension"/>
            <cd:resolve name="argument-command"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="backgroundimagefill" level="style" category="graphics" file="pack-box.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-number"/>
            <cd:resolve name="argument-dimension"/>
            <cd:resolve name="argument-dimension"/>
            <cd:resolve name="argument-command"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="overlayimage" level="style" category="graphics" file="pack-box.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-file"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="clippedoverlayimage" level="style" category="graphics" file="pack-box.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-file"/>
        </cd:arguments>
    </cd:command>

</cd:interface>