1: #include <X/mit-copyright.h>
   2: 
   3: /* $Header: XMenu.h,v 10.18 86/02/01 16:14:03 tony Rel $ */
   4: /* Copyright    Massachusetts Institute of Technology    1985	*/
   5: 
   6: /*
   7:  * XMenu:	MIT Project Athena, X Window system menu package
   8:  *
   9:  *	XMenu.h -	Include file for the MIT Project Athena
  10:  *			XMenu X window system menu package.
  11:  *
  12:  *	Author:		Tony Della Fera, DEC
  13:  *			August, 1984
  14:  */
  15: 
  16: #define FAILURE         -1
  17: #define SUCCESS         1
  18: #define POST_ERROR      -1
  19: #define NO_SELECTION        -1
  20: 
  21: #define XM_FAILURE      -1
  22: #define XM_SUCCESS      1
  23: #define XM_NO_SELECT        2
  24: #define XM_IA_SELECT        3
  25: 
  26: #define XME_CODE_COUNT      17
  27: 
  28: #define XME_NO_ERROR        0
  29: #define XME_NOT_INIT        1
  30: #define XME_ARG_BOUNDS      2
  31: #define XME_P_NOT_FOUND     3
  32: #define XME_S_NOT_FOUND     4
  33: #define XME_STYLE_PARAM     5
  34: #define XME_GRAB_MOUSE      6
  35: #define XME_INTERP_LOC      7
  36: #define XME_CALLOC      8
  37: #define XME_CREATE_ASSOC    9
  38: #define XME_STORE_BITMAP    10
  39: #define XME_MAKE_TILES      11
  40: #define XME_MAKE_PIXMAP     12
  41: #define XME_CREATE_CURSOR   13
  42: #define XME_OPEN_FONT       14
  43: #define XME_CREATE_WINDOW   15
  44: #define XME_CREATE_TRANSP   16
  45: 
  46: /*
  47:  * XMenu error code and error list definitions.>
  48:  */
  49: extern int _XMErrorCode;
  50: extern char *_XMErrorList[];
  51: 
  52: /*
  53:  * Define the XMWindow datatypes.
  54:  *
  55:  * An XMWindow is either an XMPane or an XMSelect.
  56:  *
  57:  * XMWindow is wrapper used to identify the constant window
  58:  * information that makes up XMPane and XMSelect objects.
  59:  *
  60:  * An XMPane is a menu pane made up of one or more XMSelect and a label.
  61:  *
  62:  * An XMSelect is a menu selection object with a label and a data pointer.
  63:  */
  64: typedef enum _xmwintype {PANE, SELECTION, PL_HEADER, SL_HEADER} XMWType;
  65: 
  66: typedef struct _xmwindow {
  67:     struct _xmwindow *next; /* Next obj pointer (for insque). */
  68:     struct _xmwindow *prev; /* Prev obj pointer (for insque). */
  69:     XMWType type;       /* Type of window. */
  70:     Window window;      /* X Window Id. */
  71:     int window_x;       /* Window upper left X coordinate. */
  72:     int window_y;       /* Window upper left y coordinate. */
  73:     int window_w;       /* Window width. */
  74:     int window_h;       /* Window height. */
  75:     int active;         /* Window active? */
  76:     int activated;      /* Window activated? */
  77:     int pad_l1;         /* ---- */
  78:     char *pad_l2;       /* ---- */
  79:     int pad_l3;         /* ---- */
  80:     int pad_l4;         /* ---- */
  81:     int pad_l5;         /* ---- */
  82:     int pad_l6;         /* ---- */
  83:     int pad_l7;         /* ---- */
  84:     int pad_l8;         /* ---- */
  85:     struct _xmwindow *pad_l9;   /* ---- */
  86:     char *pad_l10;      /* ---- */
  87:     struct _xmwindow *pad_l11;  /* ---- */
  88: } XMWindow;
  89: 
  90: typedef struct _xmpane {
  91:     struct _xmpane *next;   /* Next obj pointer (for insque). */
  92:     struct _xmpane *prev;   /* Prev obj pointer (for insque). */
  93:     XMWType type;       /* Type of window. */
  94:     Window window;      /* X Window Id. */
  95:     int window_x;       /* Window upper left X coordinate. */
  96:     int window_y;       /* Window upper left y coordinate. */
  97:     int window_w;       /* Window width. */
  98:     int window_h;       /* Window height. */
  99:     int active;         /* Window active? */
 100:     int activated;      /* Window activated? */
 101:     int serial;         /* -- Pane serial number. */
 102:     char *label;        /* -- Pane label. */
 103:     int label_width;        /* -- Pane label width in pixels. */
 104:     int label_length;       /* -- Pane label length in chars. */
 105:     int label_x;        /* -- Pane label X offset. */
 106:     int label_uy;       /* -- Pane label upper Y offset. */
 107:     int label_ly;       /* -- Pane label lower Y offset. */
 108:     int s_count;        /* -- Selections in this pane. */
 109:     struct _xmselect *s_list;   /* -- Selection  window list. */
 110:     char *pad_l10;      /* ---- */
 111:     struct _xmwindow *pad_l11;  /* ---- */
 112: } XMPane;
 113: 
 114: typedef struct _xmselect {
 115:     struct _xmselect *next; /* Next obj pointer (for insque). */
 116:     struct _xmselect *prev; /* Prev obj pointer (for insque). */
 117:     XMWType type;       /* Type of window. */
 118:     Window window;      /* X Window Id. */
 119:     Window parent;      /* X Window id of parent window. */
 120:     int window_x;       /* Window upper left X coordinate. */
 121:     int window_y;       /* Window upper left y coordinate. */
 122:     int window_w;       /* Window width. */
 123:     int window_h;       /* Window height. */
 124:     int active;         /* Window active? */
 125:     int activated;      /* Window activated? */
 126:     int serial;         /* -- Selection serial number. */
 127:     char *label;        /* -- Selection label. */
 128:     int label_width;        /* -- Selection label width in pixels. */
 129:     int label_length;       /* -- Selection label length in chars. */
 130:     int label_x;        /* -- Selection label X offset. */
 131:     int label_y;        /* -- Selection label Y offset. */
 132:     int pad_l7;         /* ---- */
 133:     int pad_l8;         /* ---- */
 134:     struct _xmwindow *pad_l9;   /* ---- */
 135:     char *data;         /* -- Selection data pointer. */
 136:     struct _xmpane *parent_p;   /* -- Selection parent pane structure. */
 137: } XMSelect;
 138: 
 139: 
 140: /*
 141:  * Define the XMStyle datatype.
 142:  *
 143:  * Menu presentation style information.
 144:  *
 145:  */
 146: typedef enum _xmstyle {
 147:     LEFT,           /* Left oriented obejct. */
 148:     RIGHT,          /* Right oriented obejct. */
 149:     CENTER          /* Center oriented object. */
 150: } XMStyle;
 151: 
 152: 
 153: /*
 154:  * Define the XMMode datatype.
 155:  *
 156:  * Menu presentation mode information.
 157:  *
 158:  */
 159: typedef enum _xmmode {
 160:     BOX,            /* BOXed graphic rendition. */
 161:     INVERT,         /* INVERTed graphic rendition. */
 162: } XMMode;
 163: 
 164: 
 165: /*
 166:  * Define the XMenu datatype.
 167:  *
 168:  * All dimensions are in pixels unless otherwise noted.
 169:  */
 170: typedef struct _xmenu {
 171:     /* -------------------- Menu data -------------------- */
 172:     XMStyle menu_style;     /* Menu display style. */
 173:     XMMode menu_mode;       /* Menu display mode. */
 174:     int freeze;         /* Freeze server. */
 175:     int recompute;      /* Recompute menu dependecies? */
 176:     Window parent;      /* Menu's parent window. */
 177:     int width;          /* Overall menu width. */
 178:     int height;         /* Overall menu height. */
 179:     Cursor mouse_cursor;    /* Mouse cursor raster. */
 180:     XAssocTable *assoc_tab; /* XMWindow association table. */
 181:     XMPane *p_list;     /* List of XMPanes. */
 182:     /* -------------------- Pane window data -------------------- */
 183:     XMStyle p_style;        /* Pane display style. */
 184:     int p_events;       /* Pane window X events. */
 185:     FontInfo *p_fnt_info;   /* Flag font info structure. */
 186:     int p_fnt_pad;      /* Fixed flag font padding in pixels. */
 187:     double p_spread;        /* Pane spread in flag height fractions. */
 188:     int p_bdr_width;        /* Pane border width. */
 189:     int flag_height;        /* Flag height. */
 190:     int p_width;        /* Menu pane width. */
 191:     int p_height;       /* Menu pane height. */
 192:     int p_x_off;        /* Pane window X offset. */
 193:     int p_y_off;        /* Pane window Y offset. */
 194:     int p_count;        /* Number of panes per menu. */
 195:     /* -------------------- Selection window data -------------------- */
 196:     XMStyle s_style;        /* Selection display style. */
 197:     int s_events;       /* Selection window X events. */
 198:     FontInfo *s_fnt_info;   /* Body font info structure. */
 199:     int s_fnt_pad;      /* Fixed body font padding in pixels. */
 200:     double s_spread;        /* Select spread in line height fractions. */
 201:     int s_bdr_width;        /* Select border width. */
 202:     int s_width;        /* Selection window width. */
 203:     int s_height;       /* Selection window height. */
 204:     int s_x_off;        /* Selection window X offset. */
 205:     int s_y_off;        /* Selection window Y offset. */
 206:     int s_count;        /* Maximum number of selections per pane. */
 207:     /* -------------------- Color data -------------------- */
 208:     int p_bdr_color;        /* Color of pane border pixmap. */
 209:     int s_bdr_color;        /* Color of selection border pixmap. */
 210:     int p_frg_color;        /* Color of pane foreground pixmap. */
 211:     int s_frg_color;        /* Color of selection pixmap. */
 212:     int bkgnd_color;        /* Color of menu background pixmap. */
 213:     /* -------------------- Pixmap data -------------------- */
 214:     Pixmap p_bdr_pixmap;    /* Pane border pixmap. */
 215:     Pixmap s_bdr_pixmap;    /* Selection border pixmap. */
 216:     Pixmap p_frg_pixmap;    /* Pane foreground pixmap. */
 217:     Pixmap s_frg_pixmap;    /* Selection foreground pixmap. */
 218:     Pixmap bkgnd_pixmap;    /* Menu background pixmap. */
 219:     Pixmap inact_pixmap;    /* Menu inactive pixmap. */
 220: } XMenu;
 221: 
 222: /*
 223:  * XMenu library routine declarations.
 224:  */
 225: XMenu *XMenuCreate();
 226: int XMenuAddPane();
 227: int XMenuAddSelection();
 228: int XMenuInsertPane();
 229: int XMenuInsertSelection();
 230: int XMenuFindPane();
 231: int XMenuFindSelection();
 232: int XMenuChangePane();
 233: int XMenuChangeSelection();
 234: int XMenuSetPane();
 235: int XMenuSetSelection();
 236: int XMenuRecompute();
 237: int XMenuEventHandler();    /* No value actually returned. */
 238: int XMenuLocate();
 239: int XMenuSetFreeze();       /* No value actually returned. */
 240: int XMenuActivate();
 241: char *XMenuPost();
 242: int XMenuDeletePane();
 243: int XMenuDeleteSelection();
 244: int XMenuDestroy();     /* No value actually returned. */
 245: char *XMenuError();

Defined struct's

_xmenu defined in line 170; never used
_xmpane defined in line 90; used 6 times
_xmselect defined in line 114; used 5 times
_xmwindow defined in line 66; used 12 times

Defined enum's

_xmmode defined in line 159; never used
_xmstyle defined in line 146; never used
_xmwintype defined in line 64; never used

Defined typedef's

XMMode defined in line 162; used 2 times
XMStyle defined in line 150; used 6 times
XMWType defined in line 64; used 3 times
XMWindow defined in line 88; used 3 times

Defined macros

FAILURE defined in line 16; never used
NO_SELECTION defined in line 19; used 2 times
POST_ERROR defined in line 18; used 1 times
SUCCESS defined in line 17; never used
XME_CREATE_ASSOC defined in line 37; used 1 times
XME_CREATE_CURSOR defined in line 41; used 1 times
XME_CREATE_TRANSP defined in line 44; used 1 times
XME_CREATE_WINDOW defined in line 43; used 1 times
XME_GRAB_MOUSE defined in line 34; used 1 times
XME_INTERP_LOC defined in line 35; used 1 times
XME_MAKE_PIXMAP defined in line 40; used 1 times
XME_MAKE_TILES defined in line 39; used 1 times
XME_OPEN_FONT defined in line 42; used 2 times
XME_STORE_BITMAP defined in line 38; used 1 times

Usage of this include

Last modified: 1986-02-01
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1551
Valid CSS Valid XHTML 1.0 Strict