1: /***************************************************************************
   2:  * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
   3:  * is provided to you without charge, and with no warranty.  You may give  *
   4:  * away copies of JOVE, including sources, provided that this notice is    *
   5:  * included in all the files.                                              *
   6:  ***************************************************************************/
   7: 
   8: /* Macintosh related things. K. Mitchum 2/88 */
   9: 
  10: 
  11: #define NMENUS 6
  12: #define NMENUITEMS 40   /* This has GOT to be enough! */
  13: 
  14: typedef data_obj *menumap[NMENUITEMS];
  15: #ifndef _mac
  16:     typedef char **MenuHandle;
  17: #endif
  18: struct menu {
  19:     char *Name;
  20:     int menu_id;
  21:     MenuHandle Mn;
  22:     menumap m;
  23: };
  24: 
  25: struct stat {
  26:     int st_dev;     /* volume number */
  27:     long st_ino;        /* file number on volume */
  28:     dev_t st_rdev;
  29:     off_t st_size;      /* logical end of file */
  30:     int st_mode;
  31:     time_t st_mtime;    /* last modified */
  32: };
  33: 
  34: #define S_IFDIR 2
  35: 
  36: typedef char *va_list;
  37: #define va_dcl va_list va_alist;
  38: #define va_start(l) l = (va_list)&va_alist
  39: #define va_arg(l,m) ((m*)(l += sizeof(m)))[-1]
  40: #define va_end(l) l = NULL
  41: 
  42: #ifdef _mac
  43: extern struct menu Menus[NMENUS];
  44: 
  45: static  EventRecord the_Event;
  46: 
  47: /* keycodes (from Inside MacIntosh I-251). because of changes with
  48: the MacPlus, there are some duplicate codes between cursor keys and
  49: keypad keys. these can be deciphered by the corresponding character
  50: codes, which are different. this table simply translates a keycode
  51: into a character code that is appropriate. */
  52: 
  53: #define NOKEY -1
  54: #define RET 0x0D
  55: #define TAB 0x09
  56: #define BACKSP 0x08
  57: #define ENTERL NOKEY    /* left enter key absent on MacPlus */
  58: #define COMMAND NOKEY   /* will be no translation anyway for these */
  59: #define SHIFT NOKEY
  60: #define CAPSLOCK NOKEY
  61: #define OPTION NOKEY
  62: #define PADDOT '.'      /* PAD period */
  63: #define PAD0 '0'
  64: #define PAD1 '1'
  65: #define PAD2 '2'
  66: #define PAD3 '3'
  67: #define PAD4 '4'
  68: #define PAD5 '5'
  69: #define PAD6 '6'
  70: #define PAD7 '7'
  71: #define PAD8 '8'
  72: #define PAD9 '9'
  73: #define LEFTCURS 'B'        /* jove only, make like commands */
  74: #define RIGHTCURS 'F'
  75: #define UPCURS 'P'
  76: #define DOWNCURS 'N'
  77: #define PADENTER RET
  78: #define PADMINUS '-'
  79: #define CLEAR 0
  80: 
  81: static char nsh_keycodes[] = {
  82:     'a','s','d','f','h',                        /* 0 - 4 */
  83:     'g','z','x','c','v',                        /* 5 - 9 */
  84:     NOKEY,'b','q','w','e',                  /* 10 - 14 */
  85:     'r','y','t','1','2',                    /* 15 - 19 */
  86:     '3','4','6','5','=',                    /* 20 - 24 */
  87:     '9','7','-','8','0',                    /* 25 - 29 */
  88:     ']','O','u','[','i',                    /* 30 - 34 */
  89:     'p',RET,'l','j','\'',                   /* 35 - 39 */
  90:     'k',';','\\',',','/',                   /* 40 - 44 */
  91:     'n','m','.',TAB,NOKEY,                  /* 45 - 49 */
  92:     '`',BACKSP,ENTERL,NOKEY,NOKEY,          /* 50 - 54 */
  93:     COMMAND,SHIFT,CAPSLOCK,OPTION, NOKEY,   /* 55 - 59 */
  94:     NOKEY,NOKEY,NOKEY,NOKEY,NOKEY,          /* 60 - 64 */
  95:     PADDOT,RIGHTCURS,NOKEY,NOKEY,NOKEY,     /* 65 - 69 */
  96:     LEFTCURS,CLEAR,DOWNCURS,NOKEY,NOKEY,    /* 70 - 74 */
  97:     NOKEY,PADENTER,UPCURS,PADMINUS,NOKEY,   /* 75 - 79 */
  98:     NOKEY,NOKEY,PAD0,PAD1,PAD2,             /* 80 - 84 */
  99:     PAD3,PAD4,PAD5,PAD6,PAD7,               /* 85 - 89 */
 100:     NOKEY,PAD8,PAD9
 101: };
 102: 
 103: static char sh_keycodes[] = {
 104:     'A','S','D','F','H',                        /* 0 - 4 */
 105:     'G','Z','X','C','V',                        /* 5 - 9 */
 106:     NOKEY,'B','Q','W','E',                  /* 10 - 14 */
 107:     'R','Y','T','!','@',                    /* 15 - 19 */
 108:     '#','$','^','%','+',                    /* 20 - 24 */
 109:     '(','&','_','*',')',                    /* 25 - 29 */
 110:     '}','O','U','{','I',                    /* 30 - 34 */
 111:     'P',RET,'L','J','\'',                   /* 35 - 39 */
 112:     'K',';','|','<','?',                    /* 40 - 44 */
 113:     'N','M','>',TAB,NOKEY,                  /* 45 - 49 */
 114:     '~',BACKSP,ENTERL,NOKEY,NOKEY,          /* 50 - 54 */
 115:     COMMAND,SHIFT,CAPSLOCK,OPTION, NOKEY,   /* 55 - 59 */
 116:     NOKEY,NOKEY,NOKEY,NOKEY,NOKEY,          /* 60 - 64 */
 117:     PADDOT,RIGHTCURS,NOKEY,NOKEY,NOKEY,     /* 65 - 69 */
 118:     LEFTCURS,CLEAR,DOWNCURS,NOKEY,NOKEY,    /* 70 - 74 */
 119:     NOKEY,PADENTER,UPCURS,PADMINUS,NOKEY,   /* 75 - 79 */
 120:     NOKEY,NOKEY,PAD0,PAD1,PAD2,             /* 80 - 84 */
 121:     PAD3,PAD4,PAD5,PAD6,PAD7,               /* 85 - 89 */
 122:     NOKEY,PAD8,PAD9
 123: };
 124: 
 125: 
 126: 
 127: /* tn.h Modified for variable screen size 11/21/87. K. Mitchum */
 128: 
 129: static int tn_rows, tn_cols, tn_top, tn_left, tn_bottom, tn_right;
 130: int MAXROW, MAXCOL;
 131: 
 132: #define SCREENSIZE (tn_rows * ROWSIZE)
 133: #define FONT monaco
 134: #define TEXTSIZE 9
 135: 
 136: #define HEIGHT 11
 137: #define WIDTH 6
 138: #define DESCENT 2
 139: #define TWIDTH tn_cols * WIDTH
 140: #define THEIGHT tn_rows * HEIGHT
 141: 
 142: /* window specs */
 143: 
 144: #define SCROLLWIDTH 16 /* width of scroll bar control in pixels */
 145: #define WINDWIDTH tn_right - tn_left - SCROLLWIDTH - 1/* local coordinates */
 146: #define WINDHEIGHT tn_bottom - tn_top   /* local coordinates */
 147: 
 148: /* for keyboard routines */
 149: #define MCHARS 32   /* must be power of two */
 150: #define NMASK MCHARS -1 /* circular buffer */
 151: 
 152: #endif /* _mac */

Defined variables

MAXCOL defined in line 130; used 6 times
MAXROW defined in line 130; used 10 times
nsh_keycodes defined in line 81; never used
sh_keycodes defined in line 103; never used
tn_bottom defined in line 129; used 1 times
tn_cols defined in line 129; used 1 times
tn_left defined in line 129; used 1 times
tn_right defined in line 129; used 1 times
tn_rows defined in line 129; used 2 times
tn_top defined in line 129; used 1 times

Defined struct's

menu defined in line 18; used 6 times
stat defined in line 25; used 2 times

Defined typedef's

MenuHandle defined in line 16; used 3 times
va_list defined in line 36; used 2 times

Defined macros

BACKSP defined in line 56; used 2 times
CAPSLOCK defined in line 60; used 2 times
CLEAR defined in line 79; used 2 times
COMMAND defined in line 58; used 2 times
DESCENT defined in line 138; used 1 times
DOWNCURS defined in line 76; used 2 times
ENTERL defined in line 57; used 2 times
FONT defined in line 133; used 2 times
HEIGHT defined in line 136; used 11 times
LEFTCURS defined in line 73; used 2 times
MCHARS defined in line 149; used 3 times
NMASK defined in line 150; used 3 times
NMENUITEMS defined in line 12; used 9 times
NMENUS defined in line 11; used 11 times
NOKEY defined in line 53; used 45 times
OPTION defined in line 61; used 2 times
PAD0 defined in line 63; used 2 times
PAD1 defined in line 64; used 2 times
PAD2 defined in line 65; used 2 times
PAD3 defined in line 66; used 2 times
PAD4 defined in line 67; used 2 times
PAD5 defined in line 68; used 2 times
PAD6 defined in line 69; used 2 times
PAD7 defined in line 70; used 2 times
PAD8 defined in line 71; used 2 times
PAD9 defined in line 72; used 2 times
PADDOT defined in line 62; used 2 times
PADENTER defined in line 77; used 2 times
PADMINUS defined in line 78; used 2 times
RET defined in line 54; used 3 times
RIGHTCURS defined in line 74; used 2 times
SCREENSIZE defined in line 132; never used
SCROLLWIDTH defined in line 144; used 8 times
SHIFT defined in line 59; used 2 times
S_IFDIR defined in line 34; used 1 times
TAB defined in line 55; used 2 times
TEXTSIZE defined in line 134; used 2 times
THEIGHT defined in line 140; used 1 times
TWIDTH defined in line 139; used 1 times
UPCURS defined in line 75; used 2 times
WIDTH defined in line 137; used 5 times
WINDHEIGHT defined in line 146; used 1 times
WINDWIDTH defined in line 145; used 5 times
va_arg defined in line 39; never used
va_dcl defined in line 37; never used
va_end defined in line 40; never used
va_start defined in line 38; never used

Usage of this include

Last modified: 1988-03-15
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3172
Valid CSS Valid XHTML 1.0 Strict