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: tcxlhlp.h 552.3 05 May 1991 16:50:20 $
- |
- | $Log: tcxlhlp.h $
- *-D--------------------------------------------------------------------*
- | <TCXLhlp.h> : External prototypes for TCXL Help-system (User level).
- *-N-----------------------[ Notes and Caveats ]------------------------*
- | 1) The TCXL Help-system is discrete from the other User-level TCXL
- | systems and is semaphored to prevent recursive entry.
- | 2) Once Help is defined by calling HlpDef(), HlpGet() will be invoked
- | by the defined hot-key, unless the hot-key is explicitly defined as
- | 0x0000. HlpKey() can also be called to undefine the hot-key.
- | 3) HlpAdd(), HlpClr(), HlpCur(), HlpDrop(), HlpOff(), HlpPop(),
- | HlpPush() and HlpSet() will return 1 (NOT an error) if help is not
- | defined and the global _HlpFlg help-active flag is FALSE. A caller
- | expecting help to be active MUST verify that any of these functions
- | return 0 (ERR_NUL) when called before proceeding under the
- | assumption that help is defined. The HlpAct() macro is used to test
- | _HlpFlg.
- | 4) If no hot-key is defined, HlpGet() can be still be called directly
- | once help is defined by HlpDef().
- | 5) The HdfXxx access macros REQUIRE a local pointer to the global
- | help-definition object declared and initialized as:
- | HdfP h = HctlDef.
- | 6) Only the global help-active flag, _HlpFlg, and help-control object
- | pointer, _HlpCtl, are valid if help is not defined. _HlpCtl will
- | be NULL and _HlpFlg will be FALSE if help is not active. HlpDef.C
- | declares these global data objects.
- | 7) Data objects and functions marked internal are not intended for
- | user access.
- | 8) To increase the maximum number of cross-references/page from the
- | default (currently 32), modify the HLP_MAX define here and
- | re-compile ALL of the help-system source files. The only useful
- | values for HLP_MAX are 48 and 64. The MakHlp help-file compiler
- | must also be advised of the change via the '-m48' or '-m64' option
- | so that it will use a limit other than the default.
- *======================================================================*/
- #ifndef _TCXLhlp_
- # define _TCXLhlp_ 1 /* Only once! */
- # ifndef FILE
- # include <stdio.h> /* we need compiler's file here! */
- # endif
- # ifndef _TCXLwin_
- # include <TCXLwin.h> /* Window definitions */
- # endif
- # ifndef _TCXLeng_
- # include <TCXLeng.h> /* Page Selection Engine */
- # endif
-
- #define HLP_STK 16 /* Default help-stack depth */
- #define HLP_MAX 32 /* Maximum xrefs per screen */
- #define HLP_LEN 26 /* Significant length of xref */
- #define HLP_BFR 80 /* Input line-buffer size */
- /*- Internal HdfFlg control bits ---------*/
- #define HDF_BSY 0x80 /* Help busy */
- #define HDF_XRF 0x01 /* Help-xrefs present */
- #define HDF_VER 0x02 /* Vertical help-xrefs */
- #define HDF_HOR 0x04 /* Horizontal help-xrefs */
- #define HDF_QUT 0x08 /* [Quit] on bottom help bar */
-
- /*--------------[ Internal data objects and access macros ]-------------*/
-
- TYP struct _Hctl HctlT, *HctlP; /* Object, pointer types */
- TYP struct _Hdf HdfT, *HdfP;
- TYP struct _Hfh HfhT;
-
- struct _Hctl /*-[ Help-control object ]----------------*/
- { HdfP hdef; /* 00|00 : HctlDef : Definition object */
- IntT hptr; /* 02|04 : HctlPtr : Help stack pointer */
- TagT hstk[HLP_STK]; /* 04|06 : HctlStk : Help stack */
- }; /* 24|26 ]--------------------------------*/
-
- GBL HctlP CDC _HlpCtl; /*- global help-control pointer ----------*/
- #define HctlDef (_HlpCtl->hdef) /* Definition object */
- #define HctlPtr (_HlpCtl->hptr) /* Stack-pointer */
- #define HctlStk(i) (_HlpCtl->hstk[i]) /* Stack-element[i] */
-
- struct _Hfh /*-[ Help-file header-object ]------------*/
- { TagT htag; /* 00 : HdrTag : Help-tag */
- char hcat[HLP_LEN]; /* 02 : HdrCat : Help-category */
- PosT hofs; /* 1C : HdrOfs : File-offset */
- }; /* 20 ]-----------------------------------*/
-
- struct _Hdf /*-[ Help-definition object ]-------------*/
- { ChrP hnam; /* 00|00 : HdfNam : Help file pathname */
- VfvCP hopn; /* 02|04 : HdfOpn : User "open" function */
- FILE *hfil; /* 04|08 : HdfFil : File-descriptor */
- ChrP hbfr; /* 06|0C : HdfBfr : Input line-buffer */
- ElstP heng; /* 08|10 : HdfEng : Selection Engine */
- ChrI hstr; /* 0A|14 : HdfStr : Xref String Array */
- PosT hoff[0x10]; /* 0C|18 : HdfOff : Alt-F1 Save Offsets */
- IntT hndx; /* 4C|58 : HdfNdx : Alt-F1 Save Index */
- TtlT httl; /* 4E|5A : HdfTtl : Title */
- HfhT hhdr; /* 52|60 : HdfHdr : File-header buffer */
- VposT hbeg; /* 72|80 : HdfBeg : Window start pos */
- VposT hend; /* 74|82 : HdfEnd : Window end pos */
- BoxT hfrm; /* 76|84 : HdfFrm : Window frame */
- AtrT hwat; /* 78|86 : HdfWat : Window attribute */
- AtrT htat; /* 79|87 : HdfTat : Text attribute */
- AtrT hxat; /* 7A|88 : HdfXat : Xref attribute */
- AtrT hbat; /* 7B|89 : HdfBat : Bar attribute */
- BytT hflg; /* 7C|8A : HdfFlg : Control flag bits */
- BytT hfut; /* 7D|8B : HdfFut : Reserved for future */
- }; /* 7E|8C ]--------------------------------*/
-
- #define HdfNam (h->hnam) /* Pathname */
- #define HdfOpn (h->hopn) /* User "open" function */
- #define HdfFil (h->hfil) /* File-descriptor */
- #define HdfBfr (h->hbfr) /* Input line-buffer */
- #define EndHlp (*HdfBfr=='*'&&*(HdfBfr+1)=='E') /* End mark */
- #define IniHlp (*HdfBfr=='*'&&*(HdfBfr+1)=='I') /* Init mark */
- #define PagHlp (*HdfBfr=='*'&&*(HdfBfr+1)=='P') /* Page mark */
- #define HdfEng (h->heng) /* page selection engine*/
- #define HdfStr (h->hstr) /* Xref string array */
- #define HdfOff (h->hoff) /* Xref Save Offsets */
- #define HdfNdx (h->hndx) /* Xref Save Index */
- #define HdfTtl (h->httl) /* Title */
- #define HdfTtlS (TtlStr(HdfTtl)) /* String */
- #define HdfTtlP (TtlPos(HdfTtl)) /* Position */
- #define HdfTtlA (TtlAtr(HdfTtl)) /* Attribute */
- #define HdfHdr (h->hhdr) /* Header-buffer */
- #define HdfTag (h->hhdr.htag) /* Header-tag */
- #define HdfCat (h->hhdr.hcat) /* Header-category */
- #define HdfOfs (h->hhdr.hofs) /* Header-offset */
- #define HdfBeg (h->hbeg) /* Window start pos */
- #define HdfBegW (VposW(HdfBeg)) /* Word */
- #define HdfBegR (VposR(HdfBeg)) /* Row */
- #define HdfBegC (VposC(HdfBeg)) /* Col */
- #define HdfEnd (h->hend) /* Window end pos */
- #define HdfEndW (VposW(HdfEnd)) /* Word */
- #define HdfEndR (VposR(HdfEnd)) /* Row */
- #define HdfEndC (VposC(HdfEnd)) /* Col */
- #define HdfFrm (h->hfrm) /* Window frame */
- #define HdfFrmT (BoxTyp(HdfFrm)) /* Type */
- #define HdfFrmA (BoxAtr(HdfFrm)) /* Attr */
- #define HdfWat (h->hwat) /* Window attr */
- #define HdfTat (h->htat) /* Text attr */
- #define HdfXat (h->hxat) /* Xref attr */
- #define HdfBat (h->hbat) /* Bar attr */
- #define HdfFlg (h->hflg) /* Flag bits */
- #define HdfBsy (0 != (HdfFlg & HDF_BSY)) /* Help-busy */
- #define HdfXrf (0 != (HdfFlg & HDF_XRF)) /* Xrefs present */
- #define HdfVer (0 != (HdfFlg & HDF_VER)) /* Vertical */
- #define HdfHor (0 != (HdfFlg & HDF_HOR)) /* Horizontal */
- #define HdfQut (0 != (HdfFlg & HDF_QUT)) /* Quit on Bottom Bar*/
-
- GBL FlgT CDC _HlpFlg; /*- global help-active flag --------------*/
-
- /*------------------------[ Function prototypes ]-----------------------*/
-
- #ifdef __cplusplus /* No mangling, please */
- extern "C" {
- #endif
- FlgT HlpAct(NOARG); /* Test for help-active */
- IntT CTYP HlpAdd(TagT ht); /* Push current, set help-tag */
- IntT CTYP HlpClr(NOARG); /* Clear help-stack */
- IntT CTYP HlpCur(NOARG); /* Push current help-tag */
- IntT CTYP HlpDef(ChrP fn, KeyT kc, /* Define help-system, set file, */
- AtrT wa, AtrT fa, AtrT ta, AtrT xa, /* hot-key, colors, frame, */
- AtrT ba, BytT ft, VfvCP fo); /* user "open" function */
- IntT CTYP HlpDrop(NOARG); /* Drop last pushed help-tag */
- VOID CTYP HlpGet(NOARG); /* Interactive help-handler */
- IntT CTYP HlpKey(KeyT kc); /* Define/undefine help-key */
- IntT CTYP HlpOff(NOARG); /* Undefine help */
- IntT CTYP HlpPop(NOARG); /* Pop help tag off stack */
- IntT CTYP HlpPush(TagT ct); /* Push help tag onto stack */
- IntT CTYP HlpSet(TagT ct); /* Set help category by help-tag */
- IntT CTYP HlpTtl(ChrP ts, BytT tp, /* Define new title string, */
- AtrT ta); /* position, attribute */
- IntT CTYP HlpWind(IntT sr, IntT sc, /* Re-define help window, */
- IntT er, IntT ec, BytT ft); /* frame-type */
-
- IntT HlpQutOn(NOARG); /* [Quit] on bottom border */
- IntT HlpQutOff(NOARG); /* remove [Quit] message */
-
- /*- Internals ----------------------------*/
- VOID CTYP _HlpErr(ChrP s);
- VOID CTYP _HlpPag(NOARG);
- /*- Implementation macros ----------------*/
- #define HlpAct() (_HlpFlg)
- #define HlpQutOn() (HctlDef->hflg |= HDF_QUT)
- #define HlpQutOff() (HctlDef->hflg &= ~HDF_QUT)
-
- #ifdef __cplusplus
- }
- #endif
- #endif /*- _TCXLhlp_ : End of TCXLhlp.h ------------------------------*/