home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume4 / curses-widgets / widget.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-03  |  2.7 KB  |  117 lines

  1. /*****************************************************************************
  2. /*  FILE:        widget.h
  3. /*  DATE:        August 1988.
  4. /*  AUTHOR:        Richard A. Culshaw.
  5. /*  DESCRIPTION:    Contains the definitions of the widget structures.
  6. /*            It should be included by all programs that want to
  7. /*            use the widget library.
  8. /* DISCLAIMER:        This file is deemed to be public-domain, on the simple
  9. /*            provisos that this section remains in this file and
  10. /*            that code using it do not do so for monetary gain.
  11. /*            Neither the author, nor the authors employees at the
  12. /*            time of developing this code, accept any liability or
  13. /*            responsibility for the use, abuse or misuse of this
  14. /*            code.
  15. /*****************************************************************************/
  16.  
  17. #include <curses.h>
  18.  
  19. /* definition for command widget entry in linked list */
  20. struct    cmdwid{
  21.             WINDOW        *widget;
  22.             int        id;
  23.             char        msg[100];
  24.             char        acpt;
  25.             int        (*func)();
  26.             int        length;    
  27.             int        x,y;
  28.         int        active;
  29.             struct cmdwid    *next;
  30.         } *cmdlist;
  31.  
  32. /* definition for label widget entry in linked list */
  33. struct    lblwid{
  34.             WINDOW        *widget;
  35.             int        id;
  36.             char        msg[100];
  37.             char        pos;
  38.             int        length;    
  39.         int        difference;
  40.             int        x,y;
  41.             struct lblwid    *next;
  42.         } *lbllist;
  43.  
  44. /* definition for togle widget entry in linked list */
  45. struct     tglwid{
  46.             WINDOW        *widget;
  47.             int        id;
  48.             char        msg[100];
  49.             char        tgl[10][20];
  50.             char        toggle;
  51.             int        cur;
  52.          int         total;
  53.             int        length;
  54.             int         xtgl;
  55.             int        x,y;
  56.         int        active;
  57.             struct tglwid    *next;
  58.         } *tgllist;
  59.  
  60. /* definition for input widget entry in linked list */
  61. struct inpwid{
  62.             WINDOW        *widget;
  63.             int         id;
  64.         char        msg[100];
  65.             char        acpt;
  66.             char        *input;
  67.         int        sofi;
  68.         int        exec;
  69.             int        lofs;
  70.             int        length;
  71.             int        x,y;
  72.         int        active;
  73.             struct inpwid    *next;
  74.         } *inplist;
  75.     
  76. /* linked list of characters used for activating widgets */    
  77. struct chentry {
  78.             char          ch;
  79.             int           type;
  80.             int          id;
  81.         struct chentry    *next;
  82.         } *actlist;
  83.  
  84. /* null entries in the various linked list */
  85. #define NULLCMD        (struct cmdwid *)NULL
  86. #define NULLLBL     (struct lblwid *)NULL
  87. #define NULLTGL     (struct tglwid *)NULL
  88. #define NULLINP     (struct inpwid *)NULL
  89. #define NULLCH         (struct chentry *)NULL
  90.  
  91. /* part of the specifications for label widgets */
  92. #define CENTRE        1
  93. #define    LEFTJUST    2
  94. #define RIGHTJUST    4
  95. #define NOHIGH        8
  96.  
  97. /* the types of the widgets */
  98. #define CMD        1
  99. #define TGL        2
  100. #define LBL        3
  101. #define INP        4
  102.  
  103. #define BLANK        1
  104. #define NOBLANK        0
  105.  
  106. #define NULLWIDGET    0
  107.  
  108. #define EXEC        1
  109. #define NOEXEC        0
  110.  
  111. #define VERTICAL    1
  112. #define HORIZONTAL    2
  113.  
  114. typedef int WIDGET;
  115. typedef int WIDGETTYPE;
  116.  
  117.