home *** CD-ROM | disk | FTP | other *** search
- /*
- sledprot.h
-
- % Prototypes and macros for sled row/column protection and marking.
-
- C-scape 3.2
- Copyright (c) 1989, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 6/04/89 gam Created...and there was light!
- 6/07/89 gam made sled_getrowflags a function for Microsoft
- 8/14/89 jmd added arg macros (again!)
- 3/28/90 jmd ansi-fied
- 5/01/90 jmd added UnProtect macros
- 6/13/90 jdc fixed scrolling with protection
- */
-
- /* Bit specification for the special bytes */
- #define SLED_PROTECT_MASK 0x0001
- #define SLED_MARK_MASK 0x0002
-
- /* Function prototypes */
- /* SLEDPROT.C */
- extern void sled_GetMarkAttr(sed_type sed, byte *regular, byte *selected);
- extern void sled_SetMarkAttr(sed_type sed, byte regular, byte selected);
- extern void sled_setrowflags(sed_type sed, int row, boolean torf, int mask);
- extern void sled_setcolflags(sed_type sed, int col, boolean torf, int mask);
-
- /* SLEDWIN.C */
- extern int sled_getrowspecial(sed_type sed, int row);
-
- /* Higher level macros */
- #define sled_IsProtectedRow(sed, row) \
- (sled_getrowflags((sed), (row), SLED_PROTECT_MASK))
-
- #define sled_ProtectRow(sed, row) \
- (sled_setrowflags((sed), (row), TRUE, SLED_PROTECT_MASK))
-
- #define sled_UnProtectRow(sed, row) \
- (sled_setrowflags((sed), (row), FALSE, SLED_PROTECT_MASK))
-
- #define sled_IsProtectedCol(sed, col) \
- (sled_getcolflags((sed), (col), SLED_PROTECT_MASK))
-
- #define sled_ProtectCol(sed, col) \
- (sled_setcolflags((sed), (col), TRUE, SLED_PROTECT_MASK))
-
- #define sled_UnProtectCol(sed, col) \
- (sled_setcolflags((sed), (col), FALSE, SLED_PROTECT_MASK))
-
- #define sled_IsMarkedRow(sed, row) \
- (sled_getrowflags((sed), (row), SLED_MARK_MASK))
-
- #define sled_MarkRow(sed, row) \
- (sled_setrowflags((sed), (row), TRUE, SLED_MARK_MASK))
-
- #define sled_UnMarkRow(sed, row) \
- (sled_setrowflags((sed), (row), FALSE, SLED_MARK_MASK))
-
- #define sled_IsMarkedCol(sed, col) \
- (sled_getcolflags((sed), (col), SLED_MARK_MASK))
-
- #define sled_MarkCol(sed, col) \
- (sled_setcolflags((sed), (col), TRUE, SLED_MARK_MASK))
-
- #define sled_UnMarkCol(sed, col) \
- (sled_setcolflags((sed), (col), FALSE, SLED_MARK_MASK))
-
-
- /* Implementation macros. */
-
- /* Get the column special bytes */
- #define sled_getcflags(sed) ((sled_getxd(sed))->cflags)
- #define sled_setcflags(sed, c) ((sled_getxd(sed))->cflags = (c))
-
- /* Macros to test and set row and column special bits. */
- #define sled_getrowflags(sed,row,mask) \
- ((boolean)sled_getrowspecial(sed, row) & mask)
-
- #define sled_getcolflags(sed,col,mask) \
- ((boolean)ia_Get(sled_getcflags(sed), col) & mask)
-
- #define sled_GetRegAttr(sed) ((sled_getxd(sed))->regattr)
- #define sled_GetSelAttr(sed) ((sled_getxd(sed))->selattr)
-
- #define sled_SetRegAttr(sed, m) ((sled_getxd(sed))->regattr = (m))
- #define sled_SetSelAttr(sed, s) ((sled_getxd(sed))->selattr = (s))
-
-