home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v92.tgz / v92.tar / v92 / src / h / graphics.h < prev    next >
C/C++ Source or Header  |  1996-03-22  |  18KB  |  571 lines

  1. /*
  2.  * graphics.h - macros and types used in Icon's graphics interface.
  3.  */
  4.  
  5. #ifdef MacGraph
  6. #include "::h:macgraph.h"
  7. #endif                    /* MacGraph */
  8.  
  9. #ifdef XWindows
  10. #include "::h:xwin.h"
  11. #endif                    /* XWindows */
  12.  
  13. #ifdef PresentationManager
  14. #include "::h:pmwin.h"
  15. #endif                    /* PresentationManager */
  16.  
  17. #ifdef MSWindows
  18. #include "::h:mswin.h"
  19. #endif                    /* MSWindows */
  20.  
  21. #ifndef MAXXOBJS
  22. #define MAXXOBJS 256
  23. #endif                    /* MAXXOBJS */
  24.  
  25. #ifndef DMAXCOLORS
  26. #define DMAXCOLORS 256
  27. #endif                    /* DMAXCOLORS */
  28.  
  29. #ifndef MAXCOLORNAME
  30. #define MAXCOLORNAME 40
  31. #endif                    /* MAXCOLORNAME */
  32.  
  33. #ifndef MAXFONTWORD
  34. #define MAXFONTWORD 40
  35. #endif                    /* MAXFONTWORD */
  36.  
  37. #define DEFAULTFONTSIZE 14
  38.  
  39. #define FONTATT_SPACING        0x01000000
  40. #define FONTFLAG_MONO        0x00000001
  41. #define FONTFLAG_PROPORTIONAL    0x00000002
  42.  
  43. #define FONTATT_SERIF        0x02000000
  44. #define FONTFLAG_SANS        0x00000004
  45. #define FONTFLAG_SERIF        0x00000008
  46.  
  47. #define FONTATT_SLANT        0x04000000
  48. #define FONTFLAG_ROMAN        0x00000010
  49. #define FONTFLAG_ITALIC        0x00000020
  50. #define FONTFLAG_OBLIQUE    0x00000040
  51.  
  52. #define FONTATT_WEIGHT        0x08000000
  53. #define FONTFLAG_LIGHT        0x00000100
  54. #define FONTFLAG_MEDIUM        0x00000200
  55. #define FONTFLAG_DEMI        0x00000400
  56. #define FONTFLAG_BOLD        0x00000800
  57.  
  58. #define FONTATT_WIDTH        0x10000000
  59. #define FONTFLAG_CONDENSED    0x00001000
  60. #define FONTFLAG_NARROW        0x00002000
  61. #define FONTFLAG_NORMAL        0x00004000
  62. #define FONTFLAG_WIDE        0x00008000
  63. #define FONTFLAG_EXTENDED    0x00010000
  64.  
  65. /*
  66.  * EVENT HANDLING
  67.  *
  68.  * Each window keeps an associated queue of events waiting to be
  69.  * processed.  The queue consists of <eventcode,x,y> triples,
  70.  * where eventcodes are strings for normal keyboard events, and
  71.  * integers for mouse and special keystroke events.
  72.  *
  73.  * The main queue is an icon list.  In addition, there is a queue of
  74.  * old keystrokes maintained for cooked mode operations, maintained
  75.  * in a little circular array of chars.
  76.  */
  77. #define EQ_MOD_CONTROL (1L<<16L)
  78. #define EQ_MOD_META    (1L<<17L)
  79. #define EQ_MOD_SHIFT   (1L<<18L)
  80.  
  81. #define EVQUESUB(w,i) *evquesub(w,i)
  82. #define EQUEUELEN 256
  83.  
  84. /*
  85.  * mode bits for the Icon window context (as opposed to X context)
  86.  */
  87.  
  88. #ifdef XWindows
  89. #define ISZOMBIE(w)     ((w)->window->bits & 1)
  90. #endif                    /* XWindows */
  91. #ifdef PresentationManager
  92. #define ISINITIAL(w)    ((w)->window->bits & 1)
  93. #define ISINITIALW(w)   ((w)->bits & 1)
  94. #endif                    /* PresentationManager */
  95. #define ISCURSORON(w)   ((w)->window->bits & 2)
  96. #ifdef PresentationManager
  97. #define ISCURSORONW(ws) ((ws->bits) & 2)
  98. #endif                    /* PresentationManager */
  99. #define ISMAPPED(w)    ((w)->window->bits & 4)
  100. #define ISREVERSE(w)    ((w)->context->bits & 8)
  101. #define ISXORREVERSE(w)    ((w)->context->bits & 16)
  102. #define ISXORREVERSEW(w) ((w)->bits & 16)
  103. #define ISCLOSED(w)    ((w)->window->bits & 64)
  104. #define ISRESIZABLE(w)    ((w)->window->bits & 128)
  105. #define ISEXPOSED(w)    ((w)->window->bits & 256)
  106. #define ISCEOLON(w)     ((w)->window->bits & 512)
  107. #define ISECHOON(w)     ((w)->window->bits & 1024)
  108. #ifdef PresentationManager
  109. #define ISMINPEND(w)    ((w)->window->bits & 2048)
  110. #define ISMINPENDW(ws)   ((ws)->bits & 2048)
  111. #endif                    /* PresentationManager */
  112. #ifdef MSWindows
  113. #define ISTOBEHIDDEN(ws)  ((ws)->bits & 4096)
  114. #endif                    /* MSWindows */
  115.  
  116. #ifdef XWindows
  117. #define SETZOMBIE(w)    ((w)->window->bits |= 1)
  118. #endif                    /* XWindows */
  119. #ifdef PresentationManager
  120. #define SETINITIAL(w)   ((w)->window->bits |= 1)
  121. #endif                    /* PresentationManager */
  122. #define SETCURSORON(w)  ((w)->window->bits |= 2)
  123. /* 4 is available */
  124. #define SETMAPPED(w)   ((w)->window->bits |= 4)
  125. #define SETREVERSE(w)   ((w)->context->bits |= 8)
  126. #define SETXORREVERSE(w) ((w)->context->bits |= 16)
  127. #define SETCLOSED(w)    ((w)->window->bits |= 64)
  128. #define SETRESIZABLE(w)    ((w)->window->bits |= 128)
  129. #define SETEXPOSED(w)   ((w)->window->bits |= 256)
  130. #define SETCEOLON(w)    ((w)->window->bits |= 512)
  131. #define SETECHOON(w)    ((w)->window->bits |= 1024)
  132. #ifdef PresentationManager
  133. #define SETMINPEND(w)   ((w)->window->bits |= 2048)
  134. #endif                    /* PresentationManager */
  135. #ifdef MSWindows
  136. #define SETTOBEHIDDEN(ws)  ((ws)->bits |= 4096)
  137. #endif                    /* MSWindows */
  138.  
  139. #ifdef XWindows
  140. #define CLRZOMBIE(w)    ((w)->window->bits &= ~1)
  141. #endif                    /* XWindows */
  142. #ifdef PresentationManager
  143. #define CLRINITIAL(w)   ((w)->window->bits &= ~1)
  144. #define CLRINITIALW(w)  ((w)->bits &= ~1)
  145. #endif                    /* PresentationManager */
  146. #define CLRCURSORON(w)  ((w)->window->bits &= ~2)
  147. #define CLRMAPPED(w)    ((w)->window->bits &= ~4)
  148. #define CLRREVERSE(w)   ((w)->context->bits &= ~8)
  149. #define CLRXORREVERSE(w) ((w)->context->bits &= ~16)
  150. #define CLRCLOSED(w)    ((w)->window->bits &= ~64)
  151. #define CLRRESIZABLE(w)    ((w)->window->bits &= ~128)
  152. #define CLREXPOSED(w)   ((w)->window->bits &= ~256)
  153. #define CLRCEOLON(w)    ((w)->window->bits &= ~512)
  154. #define CLRECHOON(w)    ((w)->window->bits &= ~1024)
  155. #ifdef PresentationManager
  156. #define CLRMINPEND(w)   ((w)->window->bits &= ~2048)
  157. #define CLRMINPENDW(w)  ((w)->bits &= ~2048)
  158. #endif                    /* PresentationManager */
  159. #ifdef MSWindows
  160. #define CLRTOBEHIDDEN(ws)  ((ws)->bits &= ~4096)
  161. #endif                    /* MSWindows */
  162.  
  163.  
  164.  
  165. /*
  166.  * Window Resources
  167.  * Icon "Resources" are a layer on top of the window system resources,
  168.  * provided in order to facilitate resource sharing and minimize the
  169.  * number of calls to the window system.  Resources are reference counted.
  170.  * These data structures are simple sets of pointers
  171.  * into internal window system structures.
  172.  */
  173.  
  174.  
  175.  
  176. /*
  177.  * Fonts are allocated within displays.
  178.  */
  179. typedef struct _wfont {
  180.   int        refcount;
  181.   int        serial;            /* serial # */
  182.   struct _wfont *previous, *next;
  183. #ifdef MacGraph
  184.   short     fontNum;
  185.   Style     fontStyle;
  186.   int       fontSize;
  187.   FontInfo  fInfo;              /* I-173 */
  188. #endif                          /* MacGraph */
  189. #ifdef XWindows
  190.   char          *    name;            /* name for WAttrib and fontsearch */
  191.   int        height;            /* font height */
  192.   XFontStruct *    fsp;            /* X font pointer */
  193. #endif                    /* XWindows */
  194. #ifdef PresentationManager
  195. /* XXX replace this HUGE structure with single fields later - when we know
  196.    conclusively which ones we need */
  197.   FONTMETRICS    metrics;        /* more than you ever wanted to know */
  198. #endif                    /* PresentationManager */
  199. #ifdef MSWindows
  200.   char        *name;            /* name for WAttrib and fontsearch */
  201.   HFONT        font;
  202.   LONG        ascent;
  203.   LONG        descent;
  204.   LONG        charwidth;
  205.   LONG        height;
  206. #endif                    /* MSWindows */
  207. } wfont, *wfp;
  208.  
  209. /*
  210.  * These structures and definitions are used for colors and images.
  211.  */
  212. typedef struct {
  213.    long red, green, blue;        /* color components, linear 0 - 65535*/
  214.    } LinearColor;
  215.  
  216. struct palentry {            /* entry for one palette member */
  217.    LinearColor clr;            /* RGB value of color */
  218.    char used;                /* nonzero if char is used */
  219.    char valid;                /* nonzero if entry is valid & opaque */
  220.    char transpt;            /* nonzero if char is transparent */
  221.    };
  222.  
  223. struct imgdata {            /* image loaded from a file */
  224.    int width, height;            /* image dimensions */
  225.    struct palentry *paltbl;        /* pointer to palette table */
  226.    unsigned char *data;            /* pointer to image data */
  227.    };
  228.  
  229. #define TCH1 '~'            /* usual transparent character */
  230. #define TCH2 0377            /* alternate transparent character */
  231. #define PCH1 ' '            /* punctuation character */
  232. #define PCH2 ','            /* punctuation character */
  233.  
  234.  
  235. #ifdef MacGraph 
  236. typedef struct _wctype {
  237.    Pattern bkPat;
  238.    Pattern fillPat;
  239.    Point pnLoc;
  240.    Point pnSize;
  241.    short pnMode;
  242.    Pattern pnPat;
  243.    short txFont;
  244.    Style txFace;
  245.    short txMode;
  246.    short txSize;
  247.    Fixed spExtra;
  248.    RGBColor fgColor;
  249.    RGBColor bgColor;
  250. } ContextType, *ContextPtrType;
  251. #endif   /* MacGraph */
  252.  
  253.  
  254. #ifdef XWindows
  255. /*
  256.  * Displays are maintained in a global list in rwinrsc.r.
  257.  */
  258. typedef struct _wdisplay {
  259.   int        refcount;
  260.   int        serial;            /* serial # */
  261.   char        name[MAXDISPLAYNAME];
  262.   Display *    display;
  263.   GC        icongc;
  264.   Colormap    cmap;
  265.   double    gamma;
  266.   int        screen;
  267.   int        numFonts;
  268.   wfp        fonts;
  269.   int           numColors;        /* allocated color info */
  270.   struct wcolor    colors[DMAXCOLORS];
  271.   Cursor    cursors[NUMCURSORSYMS];
  272.   struct _wdisplay *previous, *next;
  273. } *wdp;
  274. #endif                    /* XWindows */
  275.  
  276. #ifdef PresentationManager
  277. /*
  278.  * Presentation space local id's are used to identify fonts, bitmaps
  279.  * and markers.  Since we have 2 presentation spaces for each window,
  280.  * and contexts can be associated with different windows through bindings,
  281.  * the local identifier map must be identical throughout all ps (since the
  282.  * context can identify a font as ID 2 on one space and that must be valid
  283.  * on each space it is bound to).  This will be handled by a global array
  284.  * of lclIdentifier.
  285.  */
  286. #define MAXLOCALS               255
  287. #define IS_FONT                 1
  288. #define IS_PATTERN              2
  289. #define IS_MARKER               4               /* unused for now */
  290.  
  291. typedef struct _lclIdentifier {
  292.   SHORT idtype;         /* type of the id, either font or pattern */
  293.   SHORT refcount;       /* reference count, when < 1, deleted */
  294.   union {
  295.      wfont font;    /* font info */
  296.      HBITMAP   hpat;    /* pattern bitmap handle */
  297.      } u;
  298.   struct _lclIdentifier *next,          /* dbl linked list */
  299.                         *previous;
  300.   } lclIdentifier;
  301.  
  302. #endif                    /* PresentationManager */
  303.  
  304.  
  305. /*
  306.  * "Context" comprises the graphics context, and the font (i.e. text context).
  307.  * Foreground and background colors (pointers into the display color table)
  308.  * are stored here to reduce the number of window system queries.
  309.  * Contexts are allocated out of a global array in rwinrsrc.c.
  310.  */
  311. typedef struct _wcontext {
  312.   int        refcount;
  313.   int        serial;            /* serial # */
  314.   struct _wcontext *previous, *next;
  315.   int        clipx, clipy, clipw, cliph;
  316.   char        *patternname;
  317.   wfp        font;
  318.   int        dx, dy;
  319.   int        fillstyle;
  320.   int        drawop;
  321.   double    gamma;            /* gamma correction value */
  322.   int        bits;            /* context bits */
  323. #ifdef MacGraph             /* MacGraph */
  324.   ContextPtrType   contextPtr;
  325. #endif                      /* MacGraph */
  326. #ifdef XWindows
  327.   wdp        display;
  328.   GC        gc;            /* X graphics context */
  329.   wclrp        fg, bg;
  330.   int        linestyle;
  331.   int        linewidth;
  332.   int        leading;        /* inter-line leading */
  333. #endif                    /* XWindows */
  334. #ifdef PresentationManager
  335.   /* attribute bundles */
  336.   CHARBUNDLE    charBundle;        /* text attributes */
  337.   LINEBUNDLE    lineBundle;        /* line/arc attributes */
  338.   AREABUNDLE    areaBundle;        /* polygon attributes... */
  339.   IMAGEBUNDLE    imageBundle;        /* attributes use in blit of mono bms */
  340.   LONG         fntLeading;        /* external leading for font - user */
  341.   SHORT        currPattern;        /* id of current pattern */
  342.   LONG        numDeps;        /* number of window dependants */
  343.   LONG        maxDeps;        /* maximum number of deps in current table */
  344.   struct _wstate **depWindows;           /* array of window dependants */
  345. #endif                    /* PresentationManager */
  346. #ifdef MSWindows
  347.   LOGPEN    pen;
  348.   LOGPEN    bgpen;
  349.   LOGBRUSH    brush;
  350.   LOGBRUSH    bgbrush;
  351.   HRGN          cliprgn;
  352.   HBITMAP    pattern;
  353.   SysColor    fg, bg;
  354.   char        *fgname, *bgname;
  355.   int        leading, bkmode;
  356. #endif                    /* MSWindows*/
  357. } wcontext, *wcp;
  358.  
  359. /*
  360.  * "Window state" includes the actual X window and references to a large
  361.  * number of resources allocated on a per-window basis.  Windows are
  362.  * allocated out of a global array in rwinrsrc.c.  Windows remember the
  363.  * first WMAXCOLORS colors they allocate, and deallocate them on clearscreen.
  364.  */
  365. typedef struct _wstate {
  366.   int        refcount;        /* reference count */
  367.   int        serial;            /* serial # */
  368.   struct _wstate *previous, *next;
  369.   int        pixheight;        /* backing pixmap height, in pixels */
  370.   int        pixwidth;        /* pixmap width, in pixels */
  371.   char        *windowlabel;        /* window label */
  372.   char        *iconimage;        /* icon pixmap file name */
  373.   char        *iconlabel;        /* icon label */
  374.   struct imgdata initimage;        /* initial image data */
  375.   struct imgdata initicon;        /* initial icon image data */
  376.   int        y, x;            /* current cursor location, in pixels*/
  377.   int        pointery,pointerx;    /* current mouse location, in pixels */
  378.   int        posy, posx;        /* desired upper lefthand corner */
  379.   unsigned int    height;            /* window height, in pixels */
  380.   unsigned int    width;            /* window width, in pixels */
  381.   int        bits;            /* window bits */
  382.   int        theCursor;        /* index into cursor table */
  383.   word        timestamp;        /* last event time stamp */
  384.   char        eventQueue[EQUEUELEN];  /* queue of cooked-mode keystrokes */
  385.   int        eQfront, eQback;
  386.   struct descrip filep, listp;        /* icon values for this window */
  387. #ifdef MacGraph         /* MacGraph */
  388.   WindowPtr theWindow;      /* pointer to the window */
  389.   PicHandle windowPic;      /* handle to backing pixmap */
  390.   GWorldPtr offScreenGWorld;  /* offscreen graphics world */
  391.   CGrafPtr   origPort;
  392.   GDHandle  origDev;
  393.   PixMapHandle offScreenPMHandle;
  394.   Rect      sourceRect;
  395.   Rect      destRect;
  396.   Rect      GWorldRect;
  397.   Boolean   lockOK;
  398.   Boolean   visible;
  399. #endif                  /* MacGraph */
  400. #ifdef XWindows
  401.   wdp        display;
  402.   Window    win;            /* X window */
  403.   Pixmap    pix;            /* current screen state */
  404.   Pixmap    initialPix;        /* an initial image to display */
  405.   Window        iconwin;        /* icon window */
  406.   Pixmap    iconpix;        /* icon pixmap */
  407.   int        normalx, normaly;    /* pos to remember when maximized */
  408.   int        normalw, normalh;    /* size to remember when maximized */
  409.   int           numColors;        /* allocated color info */
  410.   short        *theColors;        /* indices into display color table */
  411.   int           numiColors;        /* allocated color info for the icon */
  412.   short        *iconColors;        /* indices into display color table */
  413.   int        iconic;            /* window state; icon, window or root*/
  414.   int        iconx, icony;           /* location of icon */
  415.   unsigned int    iconw, iconh;        /* width and height of icon */
  416.   long        wmhintflags;        /* window manager hints */
  417. #endif                    /* XWindows */
  418. #ifdef PresentationManager
  419.   HWND        hwnd;            /* handle to the window (client) */
  420.   HWND        hwndFrame;        /* handle to the frame window */
  421.   HMTX        mutex;            /* window access mutex sem */
  422.   HDC        hdcWin;            /* handle to window device context */
  423.   HPS        hpsWin;            /* pres space for window */
  424.   HPS        hpsBitmap;        /* pres space for the backing bitmap */
  425.   HBITMAP    hBitmap;        /* handle to the backing bitmap */
  426.   HDC        hdcBitmap;        /* handle to the bit, memory DC */
  427.   wcontext    *charContext;        /* context currently loaded in PS's */
  428.   wcontext    *lineContext;        
  429.   wcontext     *areaContext;
  430.   wcontext    *imageContext;
  431.   wcontext    *clipContext;
  432.   LONG         winbg;            /* window background color */
  433.   HBITMAP    hInitialBitmap;        /* the initial image to display */
  434.   HPOINTER    hPointer;        /* handle to window's current pointer*/
  435.   CURSORINFO    cursInfo;        /* cursor information stored on lose focus */
  436.   LONG        numDeps;        /* number of context dependants */
  437.   LONG        maxDeps;
  438.   wcontext      **depContexts;          /* array of context dependants */
  439.   /* XXX I don't like this next line, but it will do for now - until I figure
  440.      out something better.  Following the charContext pointer to find the
  441.      descender value is not enough as it could be NULL */
  442.   SHORT         lastDescender;          /* the font descender value from last wc */
  443.   HRGN        hClipWindow;        /* clipping regions */
  444.   HRGN        hClipBitmap;
  445.   BYTE        winState;               /* window state: icon, window, maximized */
  446.   HBITMAP       hIconBitmap;            /* bitmap to display when iconized */
  447. #endif                    /* PresentationManager */
  448. #ifdef MSWindows
  449.   HWND        win;            /* client window */
  450.   HWND        iconwin;        /* client window when iconic */
  451.   HBITMAP    pix;            /* backing bitmap */
  452.   HBITMAP    iconpix;        /* backing bitmap */
  453.   HBITMAP    initialPix;        /* backing bitmap */
  454.   int        hasCaret;
  455. #endif                    /* MSWindows */
  456. } wstate, *wsp;
  457.  
  458. /*
  459.  * Icon window file variables are actually pointers to "bindings"
  460.  * of a window and a context.  They are allocated out of a global
  461.  * array in rwinrsrc.c.  There is one binding per Icon window value.
  462.  */
  463. typedef struct _wbinding {
  464.   int refcount;
  465.   int serial;
  466.   struct _wbinding *previous, *next;
  467.   wcp context;
  468.   wsp window;
  469. } wbinding, *wbp;
  470.  
  471. #ifdef MacGraph
  472. typedef struct  
  473.    {
  474.    Boolean wasDown; 
  475.    uword when; 
  476.    Point where; 
  477.    int whichButton; 
  478.    int modKey; 
  479.    wsp ws;
  480.    } MouseInfoType;
  481. #endif   /* MacGraph */
  482.  
  483.  
  484.  
  485. typedef struct {
  486.   char *s;
  487.   int i;
  488. } stringint, *siptr;
  489.  
  490. /*
  491.  * Gamma Correction value to compensate for nonlinear monitor color response
  492.  */
  493. #ifndef GammaCorrection
  494. #define GammaCorrection 2.5
  495. #endif                    /* GammaCorrection */
  496.  
  497. /*
  498.  * Attributes
  499.  */
  500.  
  501. #define A_ASCENT    1
  502. #define A_BG        2
  503. #define A_CANVAS    3
  504. #define A_CEOL        4
  505. #define A_CLIPH        5
  506. #define A_CLIPW        6
  507. #define A_CLIPX        7
  508. #define A_CLIPY        8
  509. #define A_COL        9
  510. #define A_COLUMNS    10
  511. #define A_CURSOR    11
  512. #define A_DEPTH        12
  513. #define A_DESCENT    13
  514. #define A_DISPLAY    14
  515. #define A_DISPLAYHEIGHT    15
  516. #define A_DISPLAYWIDTH    16
  517. #define A_DRAWOP    17
  518. #define A_DX        18
  519. #define A_DY        19
  520. #define A_ECHO        20
  521. #define A_FG        21
  522. #define A_FHEIGHT    22
  523. #define A_FILLSTYLE    23
  524. #define A_FONT        24
  525. #define A_FWIDTH    25
  526. #define A_GAMMA        26
  527. #define A_GEOMETRY    27
  528. #define A_HEIGHT    28
  529. #define A_ICONIC    29
  530. #define A_ICONIMAGE     30
  531. #define A_ICONLABEL    31
  532. #define A_ICONPOS    32
  533. #define A_IMAGE        33
  534. #define A_LABEL        34
  535. #define A_LEADING    35
  536. #define A_LINES        36
  537. #define A_LINESTYLE    37
  538. #define A_LINEWIDTH    38
  539. #define A_PATTERN    39
  540. #define A_POINTERCOL    40
  541. #define A_POINTERROW    41
  542. #define A_POINTERX    42
  543. #define A_POINTERY    43
  544. #define A_POINTER    44
  545. #define A_POS        45
  546. #define A_POSX        46
  547. #define A_POSY        47
  548. #define A_RESIZE    48
  549. #define A_REVERSE    49
  550. #define A_ROW        50
  551. #define A_ROWS        51
  552. #define A_SIZE        52
  553. #define A_VISUAL    53
  554. #define A_WIDTH        54
  555. #define A_WINDOWLABEL   55
  556. #define A_X        56
  557. #define A_Y        57
  558.  
  559. #define NUMATTRIBS    57
  560.  
  561. #define XICONSLEEP    20 /* milliseconds */
  562.  
  563. /* 
  564.  * flags for ConsoleFlags
  565.  */
  566. /* I/O redirection flags */
  567. #define StdOutRedirect        1
  568. #define StdErrRedirect        2
  569. #define StdInRedirect         4
  570. #define OutputToBuf           8
  571.