home *** CD-ROM | disk | FTP | other *** search
- /***( box.c )*******************************************************************
- * *
- * Written: Brent Faulkner - June 15, 1989 *
- * Updated: Brent Faulkner - June 15, 1989 *
- * *
- ********************************************************************************
- * *
- * Contents: box_p() - draw a box in the page buffer *
- * underln_p() - horizontal line with T'ed ends *
- * upperln_p() - vertical line with T'ed ends *
- * *
- *******************************************************************************/
- /* include files */
- #include <stdio.h>
- #include <bench.h>
- #include "prt.h"
-
- int boxset_p;
-
- /*
- * draw a box in the page buffer
- */
- void box_p(line, col, attr, height, width)
- int line;
- int col;
- int attr;
- int height;
- int width;
- {
- int lline = line + height - 1;
- int lcol = col + width - 1;
-
- attr |= P_BOX;
-
- poke_p(line, col, attr, BOX_TOP_LFT(boxset_p));
- rephoriz_p(line, col + 1, attr, width - 2, BOX_HORIZ(boxset_p));
- poke_p(line, lcol, attr, BOX_TOP_RT(boxset_p));
-
- poke_p(lline, col, attr, BOX_BOT_LFT(boxset_p));
- rephoriz_p(lline, col + 1, attr, width - 2, BOX_HORIZ(boxset_p));
- poke_p(lline, lcol, attr, BOX_BOT_RT(boxset_p));
-
- repvert_p(line + 1, col, attr, height - 2, BOX_VERT(boxset_p));
- repvert_p(line + 1, lcol, attr, height - 2, BOX_VERT(boxset_p));
- }
-
- /*
- * horizontal line with T'ed ends
- */
- void underln_p(line, col, attr, width)
- int line;
- int col;
- int attr;
- int width;
- {
- attr |= P_BOX;
-
- poke_p(line, col, attr, BOX_LFT_TEE(boxset_p));
- rephoriz_p(line, col + 1, attr, width - 2, BOX_HORIZ(boxset_p));
- poke_p(line, col + width - 1, attr, BOX_RT_TEE(boxset_p));
- }
-
- /*
- * vertical line with T'ed ends
- */
- void upperln_p(line, col, attr, height)
- int line;
- int col;
- int attr;
- int height;
- {
- attr |= P_BOX;
-
- poke_p(line, col, attr, BOX_TOP_TEE(boxset_p));
- repvert_p(line + 1, col, attr, height - 2, BOX_VERT(boxset_p));
- poke_p(line + height - 1, col, attr, BOX_BOT_TEE(boxset_p));
- }
-
- /*
- * fill in an area
- */
- void fill_p(line, col, attr, height, width, fill_ch)
- int line;
- int col;
- int attr;
- int height;
- int width;
- int fill_ch;
- {
- int row;
- for (row = 0; row < height; row++)
- rephoriz_p(row + line, col, attr, width, fill_ch);
- }
-
-