home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume15 / twm / part03 / menus.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-12  |  3.9 KB  |  91 lines

  1. /*****************************************************************************/
  2. /**       Copyright 1988 by Evans & Sutherland Computer Corporation,        **/
  3. /**                          Salt Lake City, Utah                           **/
  4. /**                                                                         **/
  5. /**                           All Rights Reserved                           **/
  6. /**                                                                         **/
  7. /**    Permission to use, copy, modify, and distribute this software and    **/
  8. /**    its documentation  for  any  purpose  and  without  fee is hereby    **/
  9. /**    granted, provided that the above copyright notice appear  in  all    **/
  10. /**    copies and that both  that  copyright  notice  and  this  permis-    **/
  11. /**    sion  notice appear in supporting  documentation,  and  that  the    **/
  12. /**    name  of Evans & Sutherland  not be used in advertising or publi-    **/
  13. /**    city pertaining to distribution  of the software without  specif-    **/
  14. /**    ic, written prior permission.                                        **/
  15. /**                                                                         **/
  16. /**    EVANS  & SUTHERLAND  DISCLAIMS  ALL  WARRANTIES  WITH  REGARD  TO    **/
  17. /**    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILI-    **/
  18. /**    TY AND FITNESS, IN NO EVENT SHALL EVANS &  SUTHERLAND  BE  LIABLE    **/
  19. /**    FOR  ANY  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY  DAM-    **/
  20. /**    AGES  WHATSOEVER RESULTING FROM  LOSS OF USE,  DATA  OR  PROFITS,    **/
  21. /**    WHETHER   IN  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS    **/
  22. /**    ACTION, ARISING OUT OF OR IN  CONNECTION  WITH  THE  USE  OR PER-    **/
  23. /**    FORMANCE OF THIS SOFTWARE.                                           **/
  24. /*****************************************************************************/
  25.  
  26. /***********************************************************************
  27.  *
  28.  * $Header: menus.h,v 1.7 88/04/15 07:09:56 tlastran Exp $
  29.  *
  30.  * twm menus include file
  31.  *
  32.  * 17-Nov-87 Thomas E. LaStrange        File created
  33.  *
  34.  ***********************************************************************/
  35.  
  36. #ifndef _MENUS_
  37. #define _MENUS_
  38.  
  39. #define TWM_ROOT    "blob_goop"    /* my private root menu */
  40.  
  41. #define MAX_FILE_SIZE 4096    /* max chars to read from file for cut */
  42.  
  43. typedef struct MenuItem
  44. {
  45.     struct MenuItem *next;    /* next menu item */
  46.     struct MenuItem *prev;    /* prev menu item */
  47.     struct MenuRoot *sub;    /* MenuRoot of a pull right menu */
  48.     struct MenuRoot *root;    /* back pointer to my MenuRoot */
  49.     char *item;            /* the character string displayed */
  50.     int y;            /* y coordinate for text */
  51.     char *action;        /* action to be performed */
  52.     Window w;            /* the item window */
  53.     Window pull;        /* the pull right window (if any) */
  54.     int func;            /* twm built in function */
  55.     int state;            /* video state, 0 = normal, 1 = reversed */
  56. } MenuItem;
  57.  
  58. typedef struct MenuRoot
  59. {
  60.     struct MenuItem *first;    /* first item in menu */
  61.     struct MenuItem *last;    /* last item in menu */
  62.     struct MenuRoot *prev;    /* previous root menu if pull right */
  63.     struct MenuRoot *next;    /* next in list of root menus */
  64.     char *name;            /* name of root */
  65.     Window w;            /* the window of the menu */
  66.     Window shadow;        /* the shadow window */
  67.     int mapped;            /* has the menu ever been mapped ? */
  68.     int width;            /* width of the menu */
  69.     int items;            /* number of items in the menu */
  70.     int pull;            /* is there a pull right entry ? */
  71.     int active;            /* this menu is active */
  72. } MenuRoot;
  73.  
  74. extern MenuRoot *Menu[];
  75. extern MenuItem *Item[];
  76. extern MenuRoot *MenuList;
  77. extern MenuRoot *LastMenu;
  78. extern MenuRoot *ActiveMenu;
  79. extern MenuItem *ActiveItem;
  80.  
  81. extern void InitMenus();
  82. extern MenuRoot *NewMenuRoot();
  83. extern MenuItem *AddToMenu();
  84. extern void PopUpMenu();
  85. extern MenuRoot *FindMenuRoot();
  86. extern void ExecuteFunction();
  87. extern void Execute();
  88. extern void FocusOnRoot();
  89.  
  90. #endif _MENUS_
  91.