<?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="definefittingpage" file="page-app.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupfittingpage"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupfittingpage" file="page-app.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-list-optional"/>
            <cd:assignments list="yes">
                <cd:parameter name="pagestate">
                    <cd:constant type="start"/>
                    <cd:constant type="stop" default="yes"/>
                </cd:parameter>
                <cd:parameter name="command">
                    <cd:constant type="cd:oneargument"/>
                </cd:parameter>
                <cd:parameter name="margin">
                    <cd:constant type="page"/>
                </cd:parameter>
                <cd:parameter name="scale">
                    <cd:constant type="cd:number"/>
                </cd:parameter>
                <cd:parameter name="paper">
                    <cd:constant type="auto"/>
                    <cd:constant type="defaut" default="yes"/>
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:inherit name="setupframed"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="fittingpage" type="environment" file="page-app.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupfittingpage"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="fittingpage" type="environment" generated="yes" variant="example" file="page-app.mkiv">
        <cd:sequence>
            <cd:variable value="fittingpage"/>
        </cd:sequence>
        <cd:arguments>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupfittingpage"/>
            </cd:assignments>
        </cd:arguments>
        <cd:instances>
            <cd:constant value="TEXpage"/>
            <cd:constant value="MPpage"/>
        </cd:instances>
    </cd:command>

    <cd:command name="TEXpage" type="environment" file="page-app.mkiv">
        <cd:arguments>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupfittingpage"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupTEXpage" file="page-app.mkiv">
        <cd:arguments>
            <cd:assignments list="yes">
                <cd:inherit name="setupfittingpage"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="MPpage" type="environment" file="meta-fig.mkiv">
        <cd:arguments>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupfittingpage"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupMPpage" file="meta-fig.mkiv">
        <cd:arguments>
            <cd:assignments list="yes">
                <cd:inherit name="setupfittingpage"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

</cd:interface>
