home *** CD-ROM | disk | FTP | other *** search
- /*=====[ The TesSeRact(TM) CXL User Interface Development System ]======*
- | Copyright (c) 1987-1991, Innovative Data Concepts, Inc.
- | All Rights Reserved.
- |
- | This Library is part of IDC's TesSeRact Development Tools product
- | line. For information about other IDC products, call 1-215-443-9705.
- *-V--------------------------------------------------------------------*
- | $Header: tcxlcur.h 552.0 17 Mar 1991 18:26:32 $
- |
- | $Log: tcxlcur.h $
- *-D--------------------------------------------------------------------*
- | <TCXLcur.h> : Public definitions and prototypes for TCXL Cursor
- | subsystem.
- *-N-----------------------[ Notes and Caveats ]------------------------*
- | 1) User code should call the Cursor subsystem to control the display
- | and mouse cursors, NOT the display and mouse systems. The User
- | level TCXL systems also make use of these functions.
- | 2) CurPush() saves the current cursor-state on a 16-level stack and
- | updates the hidden/shown state, size and position as follows:
- | a) Update hidden/shown state to <h> (CUR_HID or CUR_SHO) unless <h>
- | is -1.
- | b) Update size to <s> (CUR_NOR, CUR_MID or CUR_BLK), unless <s> is
- | -1.
- | c) Update position to screen position <r, c>, unless <r> is -1.
- | The CurSave() macro saves the current cursor-state without change.
- | 3) CurHide() and CurShow() explicitly hide or show the cursor.
- | 4) CurSize() explicitly sets the size of the cursor.
- | 5) The Display system functions VcurGet(), VcurHid(), VcurPut() and
- | VcurSet() maintain the _CurPos, _CurSiz and _CurHid globals for use
- | by the Cursor subsystem and update them whenever changed.
- | 6) The _CurCtl object is internal and NOT intended for user access.
- | 7) All mouse positions are in text rows and columns.
- | 8) Mouse-support is defined by MouPush(), which saves the active
- | mouse-state, consisting of the support level and cursor position,
- | and sets a new support level. Up to 15 states can be saved. If a
- | mouse is detected at startup, it must be activated via an initial
- | MouPush() call. Four support levels are available:
- | a) MOU_NONE - cursor invisible, buttons not active (initial state,
- | mouse inactive).
- | b) MOU_KEYS - cursor invisible, movement emulates cursor arrow
- | keys, buttons active.
- | c) MOU_CURS - cursor visible and free-moving, buttons active.
- | d) MOU_FULL - full mouse support.
- | MouPop() restores the mouse-state last saved by MouPush(). The
- | MOU_??? constants are defined in <TCXLmou.h>, along with the rest
- | of the Mouse system.
- *======================================================================*/
- #ifndef _TCXLcur_
- # define _TCXLcur_ 1
- # ifndef _TCXLvid_
- # include <TCXLvid.h> /* video definitions */
- # endif
- # ifndef _TCXLmou_
- # include <TCXLmou.h> /* video definitions */
- # endif
- /*- Cursor sizes for CurSize() --*/
- #define CUR_NOR 0 /* Normal (underline) */
- #define CUR_MID 1 /* Half-block */
- #define CUR_BLK 2 /* Full-block */
- /*- Cursor states for CurPush() -*/
- #define CUR_HID 0 /* Hidden */
- #define CUR_SHO 1 /* Shown */
- #define CUR_MAX 16 /*- Max stack levels ------------*/
-
- /*------------------[ Data objects and access macros ]------------------*/
-
- TYP struct _Cur _CurT;
-
- struct _Cur /*-[ Cursor-control object ]--------------*/
- { VposT cpos; /* 00 : _CurPos : Current position */
- BytT csiz; /* 02 : _CurSiz : Current size */
- FlgT chid; /* 03 : _CurHid : Current hidden state */
- IntT clvl; /* 04 : _CurLvl : Stack level */
- struct _s_ /* 06 : _CurStk : 16-level stack */
- { BytT sta; /* : : State */
- VposT pos; /* : : Position */
- } cstk[CUR_MAX]; /* : : */
- }; /* 36 ]-----------------------------------*/
-
- GBL _CurT CDC _CurCtl; /*- Global cursor-control object ---------*/
- #define _CurPos (_CurCtl.cpos)
- #define _CurPosW (VposW(_CurPos))
- #define _CurPosR (VposR(_CurPos))
- #define _CurPosC (VposC(_CurPos))
- #define _CurSiz (_CurCtl.csiz)
- #define _CurHid (_CurCtl.chid)
- #define _CurLvl (_CurCtl.clvl)
- #define _CurStk(i) (_CurCtl.cstk[i])
-
- /*------------------------[ Function prototypes ]-----------------------*/
-
- #ifdef __cplusplus /* no mangling, please */
- extern "C" {
- #endif
- /*- Video cursor -------------------------*/
- VOID CTYP CurHide(NOARG); /* Hide cursor */
- VOID CTYP CurPush(IntT h, IntT s, /* Preserve cursor state, with */
- IntT r, IntT c); /* optional update */
- VOID CTYP CurPop(NOARG); /* Restore cursor state */
- VOID CTYP CurShow(NOARG); /* Show cursor */
- VOID CurSave(NOARG); /* Preserve cursor state */
- VOID CTYP CurSize(IntT s); /* Size cursor */
- /*- Mouse cursor -------------------------*/
- VOID PAS MouHide(NOARG); /* Hide mouse-cursor if shown */
- VOID CTYP MouHome(NOARG); /* Home the mouse */
- VOID CTYP MouPop(NOARG); /* Restore state */
- VOID CTYP MouPush(BytT s); /* Save state, set level <s> */
- VOID PAS MouShow(NOARG); /* Show mouse-cursor if hidden */
- /*- Other user-callable mouse functions --*/
- VOID MSpop(NOARG); /* 5.51 alias ... */
- VOID MSpush(BytT s); /* 5.51 alias ... */
- /*- Implementation macros ----------------*/
- #define CurSave() (CurPush(-1, -1, -1, -1))
- #define MSpop() (MouPop())
- #define MSpush(s) (MouPush(s))
- #define MShide() (MouHide())
- #define MSshow() (MouShow())
- #ifdef __cplusplus
- }
- #endif
- #endif /* _TCXLcur_ : End of TCXLcur.h -------------------------------*/