src/coord.c
void calc_page_coordinates(args_t *arg, int page, mcoord_t *mcoord){
    if (args->duplex){
        if (args->twocols){
            switch (page%4){
            case 1:
                // odd page, left side
                twocols_oddpage_leftside(arg, mcoord);
                break;
            case 2:
                // odd page, right side
                twocols_oddpage_rightside(arg, mcoord);
                break;
            case 3:
                // even page left side
                twocols_evenpage_leftside(arg, mcoord);
                break;
            case 0:
                // even page right side
                twocols_evenpage_rightside(arg, mcoord);
                break;
            } // switch (page%4)
        } else {
            // one side per page
            if (page%2){
                // odd page
                onecol_oddpage(arg, mcoord);
            } else {
                // even page
                onecol_evenpage(arg, mcoord);
            } // if (page %2)
            // mcoord->bwidth = mcoord->body_right - mcoord->body_left;
        } // if (args->twocols) else
    } else {
        if (args->twocols){
	    if (page%2){
	        // odd page only, left side
                twocols_oddpage_leftside(arg, mcoord);
  	    } else {
                // odd page only, right side
                twocols_oddpage_rightside(arg, mcoord);
 	    }
	} else {
	    // odd page only
            onecol_oddpage(arg, mcoord);
	}
    }   
}
// calcurate coordinates depend on each page
calcurate coordinates depend on each page
calcurate coordinates depend on each page
void calc_page_coordinates(args_t *arg, int page, mcoord_t *mcoord){
    if (args->duplex){
        if (args->twocols){
            switch (page%4){
            case 1:
                twocols_oddpage_leftside(arg, mcoord);
                break;
            case 2:
                twocols_oddpage_rightside(arg, mcoord);
                break;
            case 3:
                twocols_evenpage_leftside(arg, mcoord);
                break;
            case 0:
                twocols_evenpage_rightside(arg, mcoord);
                break;
            } 
        } else {
            if (page%2){
                onecol_oddpage(arg, mcoord);
            } else {
                onecol_evenpage(arg, mcoord);
            } 
        } 
    } else {
        if (args->twocols){
	    if (page%2){
	         only, left side
                twocols_oddpage_leftside(arg, mcoord);
  	    } else {
                 only, right side
                twocols_oddpage_rightside(arg, mcoord);
 	    }
	} else {
	     only
            onecol_oddpage(arg, mcoord);
	}
    }   
}
void calc_page_coordinates ( args_t * arg , int page , mcoord_t * mcoord ) { if ( args -> duplex ) { if ( args -> twocols ) { switch ( page % 4 ) { case 1 : twocols_oddpage_leftside ( arg , mcoord ) ; break ; case 2 : twocols_oddpage_rightside ( arg , mcoord ) ; break ; case 3 : twocols_evenpage_leftside ( arg , mcoord ) ; break ; case 0 : twocols_evenpage_rightside ( arg , mcoord ) ; break ; } } else { if ( page % 2 ) { onecol_oddpage ( arg , mcoord ) ; } else { onecol_evenpage ( arg , mcoord ) ; } } } else { if ( args -> twocols ) { if ( page % 2 ) { twocols_oddpage_leftside ( arg , mcoord ) ; } else { twocols_oddpage_rightside ( arg , mcoord ) ; } } else { onecol_oddpage ( arg , mcoord ) ; } } }
calcurate coordinates depend on each page
calcurate coordinates depend on each page
// odd page, left side // odd page, right side // even page left side // even page right side // switch (page%4) // one side per page // odd page // even page // if (page %2) // mcoord->bwidth = mcoord->body_right - mcoord->body_left; // if (args->twocols) else // odd page only, left side // odd page only, right side // odd page only