home *** CD-ROM | disk | FTP | other *** search
- /*
- cmapdecl.h 1/26/88
-
- Character Map handling routines
- by Joe DeSantis.
- recreated by Ted Peck.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 3/18/88 ted made cmap a structure, not just a char **
- 5/09/89 ted Changed Alloc/Free terms to Open/Close.
- */
-
- /* -------------------------------------------------------------------------- */
- /* character map structure */
-
- typedef struct cmap_struct {
- int ncols;
- int nrows;
- int bufsize;
- char *charbuf;
- byte *attrbuf;
- } *cmap_type;
-
- /* -------------------------------------------------------------------------- */
- #define cmap_GetWidth(cmap) ((cmap)->ncols)
- #define cmap_GetHeight(cmap) ((cmap)->nrows)
-
- #define cmap_charbuf(cmap, row, col) \
- (&((cmap)->charbuf[(row) * (cmap)->ncols + (col)]))
-
- #define cmap_attrbuf(cmap, row, col) \
- ((byte *)(cmap_charbuf(cmap) + (cmap)->bufsize))
-
- #define cmap_charattrbuf(cmap, charbuf) \
- ((byte *)((charbuf) + (cmap)->bufsize))
-
- #define cmap_PutStringAttr(cmap, row, col, string, attr, slen) \
- cmap_psa(cmap, row, col, string, attr, 0, slen)
-
- #define cmap_PutString(cmap, row, col, string, color, slen) \
- cmap_psa(cmap, row, col, string, NULL, color, slen)
-
- #define cmap_PutChar(cmap, row, col, c, attr) \
- cmap_psa(cmap, row, col, &(c), NULL, attr, 1)
-
- /* -------------------------------------------------------------------------- */
- /* cmap.c */
- extern cmap_type cmap_Open(_arg2(int nrows, int ncols));
- extern void cmap_Close(_arg1(cmap_type cmap));
- extern unsigned cmap_clipcbox(_arg2(cmap_type cmap, ocbox *cboxp));
- extern unsigned cmap_clippos(_arg3(cmap_type cmap, int *rowp, int *colp));
-
- /* cmapput.c */
- extern char *cmap_psa(_arg7(cmap_type cmap, int row, int col, char *string,
- byte *attrbuf, byte attr, int slen));
-
- extern void cmap_PutBox(_arg4(cmap_type cmap, char *boxchar, ocbox *cboxp, byte attr));
-
- extern void cmap_PutHzLine(_arg6(cmap_type cmap, char *linechar, int row1, int col1, int length, byte attr));
- extern void cmap_PutVtLine(_arg6(cmap_type cmap, char *linechar, int row1, int col1, int length, byte attr));
- extern void cmap_ClearBox(_arg3(cmap_type cmap, ocbox *cboxp, byte attr));
- extern void cmap_ScrollBoxVt(_arg3(cmap_type cmap, ocbox *cboxp, int nlines));
- extern void cmap_ScrollBoxHz(_arg3(cmap_type cmap, ocbox *cboxp, int nlines));
-
- /* cmwin.c - Included here because they use cmap_type */
- #define cmwin_GetCmap(win) ((cmap_type) (cmwin_getxd(win)->cmap))
- #define cmwin_SetCmap(win, cm) (cmwin_getxd(win)->cmap = (VOID *)(cm))
- /* -------------------------------------------------------------------------- */
-
-