<?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:define name="assignment-setupuserpagenumber">
        <cd:assignments list="yes">
            <cd:parameter name="viewerprefix">
                <cd:constant type="cd:text"/>
            </cd:parameter>
            <cd:parameter name="state">
                <cd:constant type="start"/>
                <cd:constant type="stop"/>
                <cd:constant type="none"/>
                <cd:constant type="keep"/>
                <cd:constant type="empty"/>
            </cd:parameter>
            <cd:parameter name="label">
                <cd:constant type="cd:text"/>
            </cd:parameter>
            <cd:inherit name="setupcounter"/>
        </cd:assignments>
    </cd:define>

    <cd:command name="setuprealpagenumber" level="system" category="counter" keywords="structure" file="strc-pag.mkiv">
        <cd:arguments>
            <cd:assignments list="yes">
                <cd:inherit name="setupcounter"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupuserpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv">
        <cd:arguments>
            <cd:resolve name="assignment-setupuserpagenumber"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupsubpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv">
        <cd:arguments>
            <cd:assignments list="yes">
                <cd:inherit name="setupcounter"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="setuppagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv">
        <cd:arguments>
            <cd:resolve name="assignment-setupuserpagenumber"/>
        </cd:arguments>
    </cd:command>

    <!--

        <cd:command name="resetrealpagenumber" level="system" file="strc-pag.mkiv"/>

    -->

    <cd:command name="resetuserpagenumber" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="resetsubpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="resetpagenumber" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="setuppagenumbering" level="style" category="counter" keywords="structure" file="strc-pag.mkiv">
        <cd:arguments>
            <cd:assignments list="yes">
                <cd:parameter name="alternative">
                    <cd:constant type="singlesided" default="yes"/>
                    <cd:constant type="doublesided"/>
                </cd:parameter>
                <cd:parameter name="page">
                    <cd:inherit name="page"/>
                </cd:parameter>
                <cd:parameter name="strut">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                </cd:parameter>
                <cd:parameter name="command">
                    <cd:constant type="cd:oneargument"/>
                </cd:parameter>
                <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="state">
                    <cd:constant type="start" default="yes"/>
                    <cd:constant type="stop"/>
                </cd:parameter>
                <cd:parameter name="width">
                    <cd:constant type="cd:dimension"/>
                </cd:parameter>
                <cd:parameter name="location">
                    <cd:constant type="header" default="yes"/>
                    <cd:constant type="footer"/>
                    <cd:constant type="left"/>
                    <cd:constant type="middle" default="yes"/>
                    <cd:constant type="right"/>
                    <cd:constant type="inleft"/>
                    <cd:constant type="inright"/>
                    <cd:constant type="margin"/>
                    <cd:constant type="inmargin"/>
                    <cd:constant type="atmargin"/>
                    <cd:constant type="marginedge"/>
                    <cd:constant type="none"/>
                </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="firstrealpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="firstuserpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="firstsubpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="lastrealpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="lastuserpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="lastsubpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="prevrealpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="prevuserpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="prevsubpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="nextrealpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="nextuserpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="nextsubpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="firstrealpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="firstuserpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="firstsubpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="prevrealpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="prevuserpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="prevsubpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="nextrealpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="nextuserpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="nextsubpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="lastrealpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="lastuserpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="lastsubpage" level="system" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="realpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="userpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="subpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="pagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="prefixedpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="incrementpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="incrementsubpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="decrementpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="decrementsubpagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="completepagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

    <cd:command name="placepagenumber" level="style" category="counter" keywords="structure" file="strc-pag.mkiv"/>

</cd:interface>
