1: #include <X/mit-copyright.h>
   2: 
   3: /* Copyright    Massachusetts Institute of Technology    1984, 1985	*/
   4: 
   5: /* $Header: gedit.h,v 10.4 86/02/01 16:19:03 tony Rel $ */
   6: 
   7: #include <stdio.h>
   8: 
   9: #define HELPFILE    "GEDIT"     /* Name of .DEF file for help	*/
  10: 
  11: /* types of things we can edit */
  12: #define SEGMENT 1   /* straight or curved line segments */
  13: #define LABEL   2   /* text */
  14: #define OBJECT  3   /* other files included in this one */
  15: 
  16: typedef union widget *gptr; /* pointer to graphics object */
  17: 
  18: struct segment {
  19:   short type;       /* type of this widget == SEGMENT */
  20:   gptr selink;      /* select link */
  21:   gptr next;        /* next widget */
  22:   struct prototype *parent;  /* our ancestor */
  23:   short x1,y1;      /* starting coord */
  24:   short x2,y2;      /* ending coord */
  25:   short angle;      /* angle subtended by chord, 0 => straight line */
  26:   gptr cache;       /* list of line segments for displaying arc */
  27: };
  28: 
  29: struct label {
  30:   short type;       /* type of this widget == LABEL */
  31:   gptr selink;      /* select link */
  32:   gptr next;        /* next widget */
  33:   struct prototype *parent;  /* our ancestor */
  34:   short x,y;        /* label point */
  35:   short orient;     /* position wrt to point */
  36:   char *string;     /* the label itself */
  37: };
  38: 
  39: struct object {
  40:   short type;       /* type of this widget == OBJECT */
  41:   gptr selink;      /* select link */
  42:   gptr next;        /* next widget */
  43:   struct prototype *parent;  /* our ancestor */
  44:   short x,y;        /* coords of origin */
  45:   short orient;     /* one of eight orientations */
  46:   struct prototype *proto;  /* info about the object itself */
  47:   short mscale,dscale;  /* local scaling parameters */
  48: };
  49: 
  50: union widget {      /* used for pointing at things */
  51:   struct segment s;
  52:   struct label l;
  53:   struct object o;
  54: };
  55: 
  56: #define NORTH   0   /* normal orientations */
  57: #define EAST    1
  58: #define SOUTH   2
  59: #define WEST    3
  60: #define RNORTH  4   /* reflected orientations */
  61: #define REAST   5
  62: #define RSOUTH  6
  63: #define RWEST   7
  64: 
  65: /* label orientations */
  66: #define CC  0
  67: #define TC  1
  68: #define BC  2
  69: #define CL  3
  70: #define TL  4
  71: #define BL  5
  72: #define CR  6
  73: #define TR  7
  74: #define BR  8
  75: 
  76: /* line types */
  77: #define NORMAL  0
  78: #define HIGHLIGHT 1
  79: 
  80: extern char ocomp[8][8];    /* orientation composition matrix */
  81: extern char lcomp[8][9];
  82: 
  83: struct state {
  84:   struct prototype *curobj;  /* current prototype, if any */
  85:   short mscale,dscale;  /* display scale */
  86:   short worgx,worgy;    /* coords of lower left corner of window */
  87:   short wmaxx,wmaxy;    /* coords of upper right corner of window */
  88:   short curx,cury;  /* coords of cursor center */
  89:   short oldx,oldy;  /* coords of cursor last time displayed */
  90:   short csize;      /* size of cursor */
  91:   short grid;       /* <>0 if we should display grid points */
  92:   gptr editee;      /* currently selected object(s) */
  93:   short xoff,yoff;  /* offset from cursor to selected object */
  94:   short lxoff,lyoff;    /* offsets from last select/deselect operation */
  95:   short whichend;   /* indicates which end of a selected line */
  96: };
  97: 
  98: struct prototype {
  99:   struct prototype *next;   /* linked list of prototypes */
 100:   char *name;           /* name */
 101:   gptr body;            /* what's inside the object */
 102:   struct state recent;      /* copy of most recent edit state, if any */
 103:   char modified;        /* <>0 => modified defn not yet saved */
 104: };
 105: 
 106: extern struct state cur_state;
 107: 
 108: extern struct prototype *directory,*read_def();
 109: 
 110: extern short grid;      /* <>0 display grid points */
 111: extern short incol;     /* current text prompt column */
 112: extern char *prompt;        /* what the current user prompt is */
 113: extern char typein[100];    /* user input buffer */
 114: 
 115: typedef int (*fptr)();
 116: extern fptr dispatch[];
 117: 
 118: /* various display parameters */
 119: extern short wminx,wminy,wmaxx,wmaxy;
 120: extern short chrhgt,chrwid;
 121: 
 122: /* command routine return codes */
 123: #define MULTIPLIER  0x01    /* don't reset multipler to 1 */
 124: #define RECENTER    0x02    /* recenter picture about cursor */
 125: #define REDISPLAY   0x04    /* redraw the picture */
 126: #define DONE        0x08    /* all done with current picture */
 127: #define UPDATE      0x10    /* flags for deselect operation */
 128: #define USEOFFSET   0x20

Defined struct's

label defined in line 29; used 6 times
object defined in line 39; used 6 times
prototype defined in line 98; used 35 times
segment defined in line 18; used 10 times
state defined in line 83; used 8 times

Defined union's

widget defined in line 50; used 1 times
  • in line 16

Defined typedef's

gptr defined in line 16; used 42 times

Defined macros

BC defined in line 68; used 9 times
BL defined in line 71; used 8 times
BR defined in line 74; used 9 times
CC defined in line 66; used 13 times
CL defined in line 69; used 9 times
CR defined in line 72; used 9 times
DONE defined in line 126; used 2 times
EAST defined in line 57; used 9 times
HELPFILE defined in line 9; used 2 times
HIGHLIGHT defined in line 78; used 7 times
LABEL defined in line 13; used 3 times
MULTIPLIER defined in line 123; used 2 times
NORMAL defined in line 77; used 6 times
NORTH defined in line 56; used 14 times
OBJECT defined in line 14; used 3 times
REAST defined in line 61; used 8 times
RECENTER defined in line 124; used 10 times
REDISPLAY defined in line 125; used 15 times
RNORTH defined in line 60; used 9 times
RSOUTH defined in line 62; used 8 times
RWEST defined in line 63; used 9 times
SOUTH defined in line 58; used 9 times
TC defined in line 67; used 9 times
TL defined in line 70; used 8 times
TR defined in line 73; used 8 times
UPDATE defined in line 127; used 5 times
USEOFFSET defined in line 128; used 3 times
WEST defined in line 59; used 9 times

Usage of this include

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