home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / mint / mw2 / mwdefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-03  |  3.7 KB  |  122 lines

  1. /* header file with various definitions
  2.  */
  3.  
  4. /* this one should really be in stdio.h ...
  5.  */
  6.  
  7. #ifndef NULL
  8. #define NULL ((char *) 0)
  9. #endif
  10.  
  11. #ifndef TRUE
  12. #define TRUE 1
  13. #define FALSE 0
  14. #endif
  15.  
  16. /* constants
  17.  */
  18.  
  19. #define ALTINDICATOR '\05'
  20. #define MAXSCROLLED 8
  21. #define WI_WITHSLD (SIZER|UPARROW|DNARROW|VSLIDE|LFARROW|RTARROW|HSLIDE)
  22. #define WI_WITHTITLE (NAME|MOVER|CLOSER|FULLER)
  23.  
  24. #define MINMAX(x, y, z) ( x<y ? y : (x>z ? z :x) )
  25.  
  26. #define HASHBITS 9        /* number of bits of hash for character lookup*/
  27.  
  28. #define FM_INVERT 12            /* logic parameter to copy_fm */
  29. #define FM_COPY   3            /* copy source to dest */
  30. #define FM_CLEAR  0            /* zero dest */
  31.  
  32. #define X0 1            /* X border in bits around text in window */
  33. #define Y0 1            /* Y border in bits around text in window */
  34.  
  35. /* emulation FSM states
  36.  */
  37.  
  38. #define S_NORMAL    0
  39. #define S_ESC        1
  40. #define S_ESC1        2
  41. #define S_ESC3        4
  42. #define S_STATUS    5
  43. #define S_NOP        6
  44. #define S_FG        7
  45. #define S_BG        8
  46.  
  47. #define min(a,b) ( a < b ? a : b )
  48. #define max(a,b) ( a > b ? a : b )
  49. /* data types used
  50.  */
  51.  
  52. typedef struct mfdb {
  53.   short *ptr;            /* ptr to memory holding the image */
  54.   short wpix;            /* width in pixels */
  55.   short hpix;            /* height in pixels */
  56.   short wwords;            /* width in words */
  57.   short format;            /* 0 for machine-dependent */
  58.   short planes;            /* 1 for hires screen */
  59. } WIN_MFDB;
  60.  
  61. /*
  62.  * Fonts are all byte-wide, 16 bits high.  Not all of that is actually
  63.  * used, necessarily: when narrower, the less-significant bits are used.
  64.  * When shorter, the top rows are used.  The fonts from UW are 128 chars
  65.  * long, which is a lose for non-USAians.  The built-up system fonts
  66.  * are 256 chars long.
  67.  */
  68.  
  69. typedef struct fnt {
  70.   int inc_x, inc_y;        /* real size of one char */
  71.   int nchars;            /* number of chars in this font */
  72.   char f_data[4096];        /* character data */
  73. } FNT;
  74.  
  75. typedef struct wi_str {
  76.   struct wi_str *prev, *next;    /* list links */
  77.   int fd;            /* the pipe */
  78.   int pid;            /* the PID & PG of the process started here */
  79.   int aes_handle;        /* the AES hande number */
  80.  
  81.   unsigned int    sliders:1,    /* sliders? */
  82.           titles:1,    /* title bar? */
  83.           fulled:1,    /* fulled */
  84.           inverse:1,    /* inverse mode on */
  85.           insmode:1,    /* insert mode on */
  86.           curstate:1,    /* state of the cursor */
  87.         cursor_hidden:1,/* cursor enabled? (set w/ESCw and ESCv) */
  88.         discard:1;    /* wrap vs discard at last column */
  89.   int fgbg[2];            /* text bg and fg (last arg to vrt_cpyfm) */
  90.   int slotno;            /* shrunk slot number in the dock */
  91.   int x, y, w, h;        /* work area on screen */
  92.   int save_x, save_y;        /* saved cursor location for ESC j/k */
  93.   int px, py, pw, ph;        /* previous location of entire window */
  94.   int x_off, y_off;        /* offset for visible part */
  95.   int px_off, py_off;        /* previous offset */
  96.   int m_off;            /* memory offset */
  97.   int wi_w, wi_h;        /* max w,h */
  98.   int cur_x, cur_y;        /* current cursor position */
  99.   int top_y;            /* position of top of circular window buffer */
  100.   int state;            /* state for the emulation FSM */
  101.   short vspos, vssiz;        /* pos & size of vertical slider */
  102.   short hspos, hssiz;        /* ditto horiz (saves unnec. redraws) */
  103.   FNT *font;            /* the font in use */
  104.   WIN_MFDB wi_mf;        /* memory form for this window */
  105.   char name[80];        /* name of this window */
  106.   char nuname[80];        /* new name under construction */
  107.   int nuptr;            /* curr. len of new name */
  108.   int x_chrs, y_chrs;        /* size of terminal emulation */
  109.   int wi_style;            /* style of window (see WI_*SLD) */
  110.   int wi_mainstyle;        /* the style requested originally */
  111. } WI_STR;
  112.  
  113. #ifdef __GNUC__
  114. #include <stdlib.h>
  115. #include <stddef.h>
  116. #include <string.h>
  117. #include <unistd.h>
  118. #include <stdio.h>
  119. #include <memory.h>
  120. #include "proto.h"
  121. #endif /* __GNUC__ */
  122.