📄 cacsys.c
字号:
* ?27 Landscape, extended B private * * (all other parameter values are ignored) * ************************************************************************/VOID dec_pfs(){#ifdef DUMP { oprintf("DEC_PFS \n"); pprint(); /* print the parameter list */ }#endif /* Ignore PFS if beyond bounds, otherwise call the do_pfs utility routine */ if ( (cp_pbuf[0] >= FIRST_PRIVATE_PFS) && (cp_pbuf[0] <= LAST_PRIVATE_PFS) ) { do_pfs(& (decpfstbl[cp_pbuf[0] - FIRST_PRIVATE_PFS])); }}/*********************************************************************** DEC Variable Page Format Select**********************************************************************/VOID dec_vpfs() { PFSBOUNDS vpfs_param; /* VPFS param list made ready for do_pfs */#ifdef DUMP { oprintf("DECVPFS \n"); pprint(); /* print the parameter list */ }#endif /* Note that the order of computation is important, as some parameters are * used to clarify other parameters. The form width and length are highest * priority, followed by the top/bottom/left/right margins. The input * units are determined by SSU and converted to centipoints */ /* Set orientation */ vpfs_param.pfs_or = (cp_pbuf[0] != 2) ? (ORIENT_PORT) : (ORIENT_LAND); /* Length of form = P1 * SSU, left unchanged if param is zero or omitted */ vpfs_param.pfs_plen = (cp_pbuf[1] != 0) ? (cp_pbuf[1] * (LONG)xl_st.sizeunit) : (xl_st.sheet_flen); /* Width of form = P2 * SSU, left unchanged if param is zero or omitted */ vpfs_param.pfs_pwid = (cp_pbuf[2] != 0) ? (cp_pbuf[2] * (LONG)xl_st.sizeunit) : (xl_st.sheet_fwid); /* Left margin = P5 * SSU. * Note that missing P5 is interpreted as zero. */ vpfs_param.pfs_lrm.min = (cp_pbuf[5] != 0) ? ((cp_pbuf[5] - 1) * (LONG)(xl_st.sizeunit)) : (0); /* Right margin, no greater than 1/4 inch from right side of sheet */ vpfs_param.pfs_lrm.max = cp_pbuf[6] * (LONG)xl_st.sizeunit; if ( (vpfs_param.pfs_lrm.max == 0) || (vpfs_param.pfs_lrm.max > vpfs_param.pfs_pwid) ) { vpfs_param.pfs_lrm.max = vpfs_param.pfs_pwid - HALF_INCH_CTPT; } /* Top margin = P3 * SSU. * Note that missing P3 is interpreted as zero. */ vpfs_param.pfs_tbm.min = (cp_pbuf[3] != 0) ? ((cp_pbuf[3] - 1) * (LONG)(xl_st.sizeunit)) : (0); /* Bottom margin, no greater than 1/4 inch from bottom of sheet */ vpfs_param.pfs_tbm.max = cp_pbuf[4] * (LONG)xl_st.sizeunit; if ( (vpfs_param.pfs_tbm.max == 0) || (vpfs_param.pfs_tbm.max > vpfs_param.pfs_plen) ) { vpfs_param.pfs_tbm.max = vpfs_param.pfs_plen - HALF_INCH_CTPT; } /* Line home pos = P9 * SSU, left unchanged if param is zero or omitted */ vpfs_param.pfs_lhe.min = (cp_pbuf[9] != 0) ? ((cp_pbuf[9] - 1) * (LONG)(xl_st.sizeunit)) : (vpfs_param.pfs_lrm.min); /* Line end pos, no further right than the right margin */ vpfs_param.pfs_lhe.max = cp_pbuf[10] * (LONG)xl_st.sizeunit; if ( (vpfs_param.pfs_lhe.max == 0) || (vpfs_param.pfs_lhe.max > vpfs_param.pfs_lrm.max) ) { vpfs_param.pfs_lhe.max = vpfs_param.pfs_lrm.max; } /* Page home pos = P7 * SSU, left unchanged if param is zero or omitted */ vpfs_param.pfs_phe.min = (cp_pbuf[7] != 0) ? ((cp_pbuf[7] - 1) * (LONG)(xl_st.sizeunit)) : (vpfs_param.pfs_tbm.min); /* Page end line, no further down than the bottom margin */ vpfs_param.pfs_phe.max = cp_pbuf[8] * (LONG)xl_st.sizeunit; if ( (vpfs_param.pfs_phe.max == 0) || (vpfs_param.pfs_phe.max > vpfs_param.pfs_tbm.max) ) { vpfs_param.pfs_phe.max = vpfs_param.pfs_tbm.max; } /* If margins or bounds are crossed, then ignore sequence and exit, * otherwise call do_pfs to move the new margins and bounds into * the global pfs bounds table */ if ( (vpfs_param.pfs_lrm.max > vpfs_param.pfs_lrm.min) && (vpfs_param.pfs_tbm.max > vpfs_param.pfs_tbm.min) && (vpfs_param.pfs_lhe.max > vpfs_param.pfs_lhe.min) && (vpfs_param.pfs_phe.max > vpfs_param.pfs_phe.min) ) { do_pfs(& vpfs_param); } }/***** dec_slpp () **************************************************** * * * dec_slpp () - set form length (DECSLPP) * * The max value flen can be set to is 'sheet_flen - origin' * ************************************************************************/VOID dec_slpp() {#ifdef DUMP { oprintf("DECSLPP \n"); pprint(); /* print the parameter list */ }#endif /* If the parameter is = 0, set flen to max */ xl_st.flen = (cp_pbuf[0] != 0) ? (vdist(cp_pbuf[0])) : (xl_st.sheet_flen); /* flen can be no larger than sheet_flen - current origin */ if (xl_st.flen > (xl_st.sheet_flen - xl_st.origin.yval)) { xl_st.flen = xl_st.sheet_flen - xl_st.origin.yval; } /* TM = PH = 0. BM = PE = flen */ xl_st.v_lim_bound.min = xl_st.v_fmt_bound.min = 0; xl_st.v_lim_bound.max = xl_st.v_fmt_bound.max = xl_st.flen; }/***** dec_slrm() ***************************************************** * * * dec_slrm() - Set the left and right margins * ************************************************************************/VOID dec_slrm() { LONG temp_line_home, temp_line_end;#ifdef DUMP { oprintf("DECSLRM \n"); pprint(); /* print the parameter list */ }#endif /* If the left margin is <> 0, set temp line home pos = new value */ temp_line_home = (cp_pbuf[0] != 0) ? (hdist((cp_pbuf[0] - 1))) : (xl_st.h_fmt_bound.min); /* If the right margin is <> 0, set temp line end pos = new value * (if new line end position would be beyond the right printable limit, * set it to the right printable limit */ temp_line_end = (cp_pbuf[1] != 0) ? (hdist(cp_pbuf[1])) : (xl_st.h_fmt_bound.max); if (temp_line_end > (xl_st.sheet_fwid - xl_st.origin.xval)) { temp_line_end = xl_st.sheet_fwid - xl_st.origin.xval; } /* Return without changing anything if the new right margin will * be <= the new left margin */ if (temp_line_end <= temp_line_home) { return; } /* All is ok, empty the justify buf, & set the new left and right margins */ empty_jfy_buf(); xl_st.h_fmt_bound.min = xl_st.h_lim_bound.min = temp_line_home; xl_st.h_fmt_bound.max = xl_st.h_lim_bound.max = temp_line_end; /* If the ahp is < the new left margin, move the ahp */ if (xl_st.curchar.ap.xval < xl_st.h_fmt_bound.min) { hpos_abs(xl_st.h_fmt_bound.min); } /* If the new right margin is > the ahp, clear the right margin flag */ if (xl_st.h_fmt_bound.max > xl_st.curchar.ap.xval) { xl_st.rmf = FALSE; } else { xl_st.rmf = TRUE; update_ahp(xl_st.h_fmt_bound.max,&xl_st.h_lim_bound); } }/***** dec_stbm() ***************************************************** * * * dec_stbm() - Set the top and bottom margins. * ************************************************************************/VOID dec_stbm() { LONG temp_page_home, temp_page_end;#ifdef DUMP { oprintf("DECSTBM \n"); pprint(); /* print the parameter list */ }#endif /* If the top margin is <>0, set temp page home pos = new value */ temp_page_home = (cp_pbuf[0] != 0) ? (vdist((cp_pbuf[0] - 1))) : (xl_st.v_fmt_bound.min); /* If the bottom margin is <>0, set temp page end pos = new value * (if new page end position would be beyond the bottom printable limit, * set it to the bottom printable limit */ temp_page_end = (cp_pbuf[1] != 0) ? (vdist(cp_pbuf[1])) : (xl_st.v_fmt_bound.max); if (temp_page_end > (xl_st.sheet_flen - xl_st.origin.yval)) { temp_page_end = xl_st.sheet_flen - xl_st.origin.yval; } /* Return without changing anything if the new bottom margin will * be <= the new top margin */ if (temp_page_end <= temp_page_home) { return; } /* All is ok, set the new top and bottom margins */ xl_st.v_fmt_bound.min = xl_st.v_lim_bound.min = temp_page_home; xl_st.v_fmt_bound.max = xl_st.v_lim_bound.max = temp_page_end; xl_st.plf = NOPLUPLD; /* If the avp is < the new top margin, move the avp */ if (xl_st.curchar.ap.yval < xl_st.v_fmt_bound.min) { vpos_abs(xl_st.v_fmt_bound.min); xl_st.fcf = TRUE; } }/***** dec_asfc() ***************************************************** * * * dec_asfc() - Automatic sheet feeder control. Handles the * * DEC_ASFC control sequence to select specified paper trays. * ************************************************************************/VOID dec_asfc(){#ifdef DUMP { oprintf("DECASFC \n"); pprint(); /* print the parameter list */ }#endif /* Force a conditional form feed to eject the current page. */ pr_cond_ff(); /* If the parameter is zero, or the same as the current tray setting, return without setting the paper tray. */ if (cp_pbuf [0] == 0 || cp_pbuf [0] == xl_st.paper_tray) return; /* Get the tray number from the parameter list */ xl_st.paper_tray = (WORD)cp_pbuf [0]; /* Output the setpapertray command. */ process_tray_select (xl_st.paper_tray);}/*********************************************************************** Horizontal Page Width Alignment**********************************************************************/VOID dec_hpwa() {#ifdef DUMP { oprintf("DECHPWA \n"); pprint(); /* print the parameter list */ }#endif return; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -