home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / OS2DECL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-08  |  3.8 KB  |  119 lines

  1. /*
  2.     os2decl.h
  3.  
  4.     % Declarations for OS2 driver
  5.  
  6.     11/11/88  by Ted.
  7.  
  8.     OWL
  9.     Copyright (c) 1988, 1989 by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.     12/12/88 ted    Merged CheckKey and CheckMouse into CheckEvent.
  15.      2/07/89 ted    Added timeout wait arg to hCheckEvent function.
  16.      4/09/89 ted    Converted for static digdata.
  17.      5/09/89 ted    Renamed from os2disp.h
  18. */
  19. /* -------------------------------------------------------------------------- */
  20. #define THREADSTACKSIZE            512
  21.  
  22. typedef struct {
  23.     dispinfo_struct info;
  24.     struct pmap_struct dmspace;            /* pointed to by info->dispmap */
  25.     byte            attrmap[256];        /* attribute map table */
  26.  
  27.     VIOMODEINFO     oldmode;            /* pre-init video mode to restore from */
  28.     unsigned         oldcursx;            /* pre-init cursor position */
  29.     unsigned         oldcursy;
  30.     cursortype        curctype;            /* current hardware cursor type */
  31.     opcoord            fontlines;
  32.  
  33.     boolean               dosbox;
  34.  
  35.     /* os2 mouse event vars (more are in the os2minfo struct below) */
  36.     int                mousehide;            /* hide/show nesting level counter */
  37.  
  38.     int                pnest;                /* re-entrancy protection semaphore */
  39.     TID                ptid;                /* re-entrancy protection thread id */
  40.  
  41.     HVIO            hvio;
  42.     HKBD            hkbd;
  43.  
  44.     unsigned         key;
  45.     unsigned        evstash;
  46.  
  47.     DEFINEMUXSEMLIST(kmsemlist, 2)
  48.     byte            kstack[THREADSTACKSIZE];    /* Stack for thread */
  49.  
  50.     pchdata_struct *h;            /* non-display hardware dig data for dosbox events */
  51. } os2data_struct;
  52.  
  53. extern os2data_struct os2datastruc;
  54. #define os2data     (&os2datastruc)
  55.  
  56. extern pchdata_struct os2hdatastruc;
  57. #define os2hdata     (&(os2hdatastruc))
  58.  
  59. typedef struct os2minfo_struct {
  60.     HMOU            hmou;
  61.     moupos_struct    moupos;
  62.     moupos_struct    oldpos;
  63.     byte            mstack[THREADSTACKSIZE];    /* Stack for thread */
  64.  
  65.     boolean            hide;
  66.     NOPTRRECT         mouserect;
  67.     byte            hstack[THREADSTACKSIZE];    /* Stack for thread */
  68.  
  69. } *os2minfo_type;
  70.  
  71. typedef unsigned long RAMSEM;
  72.  
  73. /* -------------------------------------------------------------------------- */
  74. /* DISPLAY MODE FUNCTIONS */
  75. /* os2vio.c */
  76. extern dmode_func (os2_ModeText);
  77. /* -------------------------------------------------------------------------- */
  78.  
  79. /* os2open.c */
  80. extern boolean        DIGPRIV os2_OpenDIG(_arg2(dig_struct *digp, VIOMODEINFO *mode));
  81. extern dig_CloseDIG_func (os2_CloseDIG);
  82. extern void            DIGPRIV os2_vsetcursortype(_arg1(cursortype));
  83.  
  84. /* os2hard.c */
  85. extern void            DIGPRIV os2_hOpen(_arg1(dig_struct *digp));
  86.  
  87. extern void            DIGPRIV os2_dohide(_arg1(void));
  88. extern void            DIGPRIV os2_doshow(_arg1(void));
  89. /* -------------------------------------------------------------------------- */
  90. #define os2_inuse()                    (os2data->info.devname[0] != '\0')
  91.  
  92. #define os2_initmode()                os2_vsetcursortype(CURSOR_NONE)
  93.  
  94. #define os2_attrfg4bit(attr)        (os2data->attrmap[attr] & 0x0F)
  95. #define os2_attrbg4bit(attr)        (os2data->attrmap[attr] >> 4)
  96. /* -------------------------------------------------------------------------- */
  97. #define os2_vidseg()                (os2data->info.dispmap->onboard)
  98. #define os2_bwidth()                (os2data->info.dispmap->bytewidth)
  99. #define os2_pixbits()                (os2data->info.dispmap->pixbits)
  100. #define os2_nplanes()                (os2data->info.dispmap->nplanes)
  101. #define os2_dispmap()                (os2data->info.dispmap)
  102. #define os2_ileave()                (os2data->info.ileave)
  103. #define os2_ilsize()                (os2data->info.ilsize)
  104.  
  105. #define os2_setmouse(ismous)        (os2data->ismouse = ismous)
  106. #define os2_mouse()                    (os2data->ismouse)
  107. #define os2_setmouseleft(left)        (os2data->mouseleft = left)
  108. #define os2_mouseleft()                (os2data->mouseleft)
  109. #define os2_setmousetop(top)        (os2data->mousetop = top)
  110. #define os2_mousetop()                (os2data->mousetop)
  111.  
  112. #define OS2_ATTRSIZE                sizeof(byte)
  113.  
  114. #define VIO_MONOADDR    0x000B8000L
  115. #define VIO_CGAADDR        0x000B0000L
  116. #define VIO_EGAADDR        0x000A0000L
  117. /* -------------------------------------------------------------------------- */
  118.  
  119.