home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / conapi.zip / TAU / INCLUDE / OS2 / bsesub.h < prev   
C/C++ Source or Header  |  2000-02-09  |  27KB  |  753 lines

  1. /***************************************************************************
  2.  *
  3.  * Name:  bsesub.h
  4.  *
  5.  * Function:
  6.  *     OS/2 base include for 32 bit versions of Vio/Kbd/Mou.
  7.  *
  8.  * Copyright:
  9.  *     Copyright (C) IBM Corp. 1987, 1995
  10.  *     Modified slightly for greater legibility by JdeBP.
  11.  *
  12.  * Note:
  13.  *     1. One or more of the following should be defined.
  14.  *          INCL_KBD                KBD
  15.  *          INCL_VIO                VIO
  16.  *          INCL_AVIO               VIO
  17.  *          INCL_MOU                MOU
  18.  *          INCL_SUB                all of the above
  19.  *
  20.  *     2. The Vio calls from pmavio.h were moved here so that all of
  21.  *        the Vio calls are in one place.
  22.  *
  23.  *     3. A number of fields have been increased from 16 bits to 32 bits.
  24.  *        All 32 bit fields are now placed on 4 byte boundaries.
  25.  *
  26.  *
  27.  ****************************************************************************/
  28. #ifdef __IBMC__
  29.    #pragma checkout( suspend )
  30.    #ifndef __CHKHDR__
  31.       #pragma checkout( suspend )
  32.    #endif
  33.    #pragma checkout( resume )
  34. #else
  35.    #ifdef __IBMCPP__
  36.       #pragma info( none )
  37.       #ifndef __CHKHDR__
  38.          #pragma info( none )
  39.       #endif
  40.       #pragma info( restore )
  41.    #endif
  42. #endif
  43. #ifdef __cplusplus
  44.       extern "C" {
  45. #endif
  46.  
  47. #ifndef __BSESUB__
  48. #define __BSESUB__
  49.  
  50. #ifdef INCL_SUB
  51.     #define INCL_KBD
  52.     #define INCL_VIO
  53.     #define INCL_AVIO
  54.     #define INCL_MOU
  55. #endif
  56.  
  57. #ifdef INCL_AVIO
  58.     #define INCL_VIO
  59. #endif
  60.  
  61. /*
  62.  * Keyboard (Kbd) functions
  63.  *
  64.  * Notes:
  65.  *     The keyboard handle is always required to be zero, as there is no longer
  66.  *     an open and close.
  67.  */
  68. #ifdef INCL_KBD
  69.     typedef unsigned long HKBD ;   /* keyboard handle */
  70.     typedef HKBD        * PHKBD ;
  71.  
  72.     /*
  73.      * Flags for KbdCharin, KbdGetConsole, and KbdStringIn
  74.      * (IO_PEEKWAIT not available in OS/2 2.x)
  75.      */
  76.     #define IO_WAIT               0
  77.     #define IO_NOWAIT             1
  78.     #define IO_PEEK               2
  79.     #define IO_PEEKWAIT           3
  80.     #define IO_EXTENDED           4
  81.  
  82.     /*
  83.      * Console Event Kinds (CK_MOUSE, and CK_NOTIFY not in OS/2 2.x)
  84.      */
  85.     #define CK_NONE               0
  86.     #define CK_KEY                1
  87.     #define CK_CHAR               2
  88.     #define CK_MOUSE              3
  89.     #define CK_NOTIFY             4
  90.  
  91.     /*
  92.      * Translation status for KbdCharin and KbdXlate (fbStatus)
  93.      */
  94.     #define KBDTRF_SHIFT_KEY_IN        0x01
  95.     #define KBDTRF_NOT_A_CHAR          0x02
  96.     #define KBDTRF_CONVERSION_REQUEST  0x20
  97.     #define KBDTRF_FINAL_CHAR_IN       0x40
  98.     #define KBDTRF_INTERIM_CHAR_IN     0x80
  99.  
  100.     /*
  101.      * Key structure for KbdCharIn and KbdPeek
  102.      * (Unicode character added, change in lengths)
  103.      */
  104.     typedef  _Packed struct _KBDKEYINFO {
  105.         USHORT   ucUniChar ;       /* Unicode char (added field)     */
  106.         USHORT   chChar ;          /* Char in current codepage       */
  107.         UCHAR    chScan ;          /* Scan code                      */
  108.         UCHAR    fbStatus ;        /* Final/Interim bits             */
  109.         USHORT   fsState ;         /* Shift state                    */
  110.         USHORT   VKey ;            /* Virtual key                    */
  111.         UCHAR    bNlsShift ;       /* Extended shift status          */
  112.         UCHAR    resv ;            /* Reserved                       */
  113.         ULONG    time ;            /* Time stamp                     */
  114.     } KBDKEYINFO ;
  115.     typedef KBDKEYINFO * PKBDKEYINFO ;
  116.  
  117.     /*
  118.      * Definitions for usage of bNlsShift
  119.      */
  120.     #define  NLSS_NLS1    0x01   /* Fullwidth, National layer   */
  121.     #define  NLSS_NLS2    0x02   /* Katakana, JAMO, phonetic    */
  122.     #define  NLSS_NLS3    0x04   /* Hiragana, Hangeul, TsangJye */
  123.     #define  NLSS_APPL    0x10   /* Application bit             */
  124.     #define  NLSS_NLS4    0x40   /* Romanji, HanjaCsr           */
  125.     #define  NLSS_KANJI   0x80   /* Kanji, Hanja                */
  126.  
  127.     /*
  128.      * Length structure for KbdStringIn
  129.      */
  130.     typedef _Packed struct _STRINGINBUF {
  131.         ULONG  cb ;           /* Size of input buffer (was ushort) */
  132.         ULONG  cchIn ;        /* Number of bytes read (was ushort) */
  133.     } STRINGINBUF ;
  134.     typedef STRINGINBUF * PSTRINGINBUF ;
  135.  
  136.     /*
  137.      * Values and layout of hardware ID for KbdGetHWID
  138.      */
  139.     #define KBHWID_UNKNOWN        0x0000
  140.     #define KBHWID_AT             0x0001
  141.     #define KBHWID_ENHANCED       0xab41
  142.     #define KBHWID_SMALL          0xab54
  143.     #define KBHWID_MFIOLD         0xab85
  144.     #define KBHWID_MFI            0xab86
  145.     typedef _Packed struct _KBDHWID {
  146.         USHORT cb ;           /* Size of buffer           */
  147.         USHORT idKbd ;        /* Keyboard ID (KBHWID_)    */
  148.         USHORT idSecond ;     /* Secondary ID             */
  149.     } KBDHWID ;
  150.     typedef KBDHWID  * PKBDHWID ;
  151.  
  152.     /*
  153.      * KBDINFO structure, for KbdSetStatus and KbdGetStatus
  154.      */
  155.     typedef _Packed struct _KBDINFO {
  156.         USHORT cb ;
  157.         USHORT fsMask ;
  158.         USHORT chTurnAround ;
  159.         USHORT fsInterim ;           /* Upper byte is NLS Shift */
  160.         USHORT fsState ;
  161.     } KBDINFO ;
  162.     typedef KBDINFO * PKBDINFO ;
  163.  
  164.     /*
  165.      * Mask bits for KBDINFO in KbdSetStatus and KbdGetStatus (fsMask)
  166.      */
  167.     #define KEYBOARD_ECHO_ON                0x0001
  168.     #define KEYBOARD_ECHO_OFF               0x0002
  169.     #define KEYBOARD_ECHO_SAME              0x0000
  170.  
  171.     #define KEYBOARD_BINARY_MODE            0x0004
  172.     #define KEYBOARD_ASCII_MODE             0x0008
  173.     #define KEYBOARD_TERM_MODE              0x0200
  174.     #define KEYBOARD_SAME_MODE              0x0000
  175.  
  176.     #define KEYBOARD_MODIFY_STATE           0x0010
  177.     #define KEYBOARD_MODIFY_INTERIM         0x0020
  178.     #define KEYBOARD_MODIFY_TURNAROUND      0x0040
  179.     #define KEYBOARD_2B_TURNAROUND          0x0080
  180.  
  181.     #define KEYBOARD_SHIFT_REPORT           0x0100
  182.  
  183.     /*
  184.      * Status bits for KBDINFO in KbdSetStatus and KbdGetStatus (fsState)
  185.      */
  186.     #ifndef INCL_DOSDEVIOCTL           /* Also defined in bsedev.h */
  187.         #define KBDSTF_RIGHTSHIFT           0x0001
  188.         #define KBDSTF_LEFTSHIFT            0x0002
  189.         #define KBDSTF_CONTROL              0x0004
  190.         #define KBDSTF_ALT                  0x0008
  191.         #define KBDSTF_SCROLLLOCK_ON        0x0010
  192.         #define KBDSTF_NUMLOCK_ON           0x0020
  193.         #define KBDSTF_CAPSLOCK_ON          0x0040
  194.         #define KBDSTF_INSERT_ON            0x0080
  195.         #define KBDSTF_LEFTCONTROL          0x0100
  196.         #define KBDSTF_LEFTALT              0x0200
  197.         #define KBDSTF_RIGHTCONTROL         0x0400
  198.         #define KBDSTF_RIGHTALT             0x0800
  199.         #define KBDSTF_SCROLLLOCK           0x1000
  200.         #define KBDSTF_NUMLOCK              0x2000
  201.         #define KBDSTF_CAPSLOCK             0x4000
  202.         #define KBDSTF_SYSREQ               0x8000
  203.     #endif  /* INCL_DOSDEVIOCTL */
  204.  
  205.    /*
  206.     * Keyboard function prototypes
  207.     */
  208.    APIRET APIENTRY  KbdFlushBuffer (HKBD Handle) ;
  209.    APIRET APIENTRY  KbdPeek (KBDKEYINFO * CharData, HKBD Handle) ;
  210.    APIRET APIENTRY  KbdCharIn (KBDKEYINFO * CharData, ULONG Wait, HKBD Handle) ;
  211.    APIRET APIENTRY  KbdGetStatus (KBDINFO * Info, HKBD Handle) ;
  212.    APIRET APIENTRY  KbdSetStatus (KBDINFO * Info, HKBD Handle) ;
  213.    APIRET APIENTRY  KbdGetCp (ULONG Reserved, USHORT * CodePage, HKBD Handle) ;
  214.    APIRET APIENTRY  KbdSetCp (ULONG Reserved, USHORT CodePage, HKBD Handle) ;
  215.  
  216.    APIRET APIENTRY  KbdGetConsole(PVOID Data, PULONG Kind, ULONG Flags, HKBD Handle) ;
  217.  
  218.    APIRET APIENTRY  KbdGetHWID (PKBDHWID pkbdhwid, HKBD Handle) ;
  219.  
  220.    APIRET APIENTRY  KbdGetLayout(PSZ name, HKBD Handle) ;
  221.  
  222.    APIRET APIENTRY  KbdGetLayoutUni(USHORT * name, HKBD Handle) ;
  223.  
  224.    APIRET APIENTRY  KbdSetLayout(PSZ name, HKBD Handle) ;
  225.  
  226.    APIRET APIENTRY  KbdSetLayoutUni(USHORT * name, HKBD Handle) ;
  227.  
  228.    APIRET APIENTRY  KbdSetRate (ULONG rate, ULONG delay, HKBD Handle) ;
  229.  
  230.    APIRET APIENTRY  KbdStringIn (PCH pch, PSTRINGINBUF pchIn, ULONG Flag, HKBD Handle) ;
  231.  
  232.    APIRET APIENTRY  KbdStringInUni (USHORT * pch, PSTRINGINBUF pchIn, ULONG Flag, HKBD Handle) ;
  233.  
  234.    APIRET APIENTRY  KbdXlate (PKBDKEYINFO pkbdtrans, HKBD Handle) ;
  235.  
  236. #ifdef __UNI_REPLACE__
  237.     #define KbdGetLayout KbdGetLayoutUni
  238.     #define KbdSetLayout KbdSetLayoutUni
  239.     #define KbdStringIn  KbdStringInUni
  240. #endif
  241.  
  242. #endif /* INCL_KBD */
  243.  
  244.  
  245. /*
  246.  *  Video Input Output (Vio) functions
  247.  */
  248. #ifdef INCL_VIO
  249.     /*
  250.      * Vio handles
  251.      */
  252.     typedef unsigned long   HVIO ;
  253.     typedef HVIO        *   PHVIO ;
  254.  
  255.     /*
  256.      * VioCreatePS format constants
  257.      */
  258.     #define FORMAT_CGA      0x0001
  259.     #define FORMAT_VGA      0x0001
  260.     #define FORMAT_4BYTE    0x0003
  261.     #define FORMAT_EXTEND   0x0003
  262.     #define FORMAT_UNICODE  0x0002
  263.  
  264.     /*
  265.      * options for VioQueryFonts
  266.      */
  267.     #define VQF_PUBLIC      0x0001L
  268.     #define VQF_PRIVATE     0x0002L
  269.     #define VQF_ALL         0x0003L
  270.  
  271.     /*
  272.      * Cursor structure for VioSetCurType and VioGetCurType()
  273.      */
  274.     typedef _Packed struct _VIOCURSORINFO {
  275.         USHORT   yStart ;
  276.         USHORT   cEnd ;
  277.         USHORT   cx ;
  278.         USHORT   attr ;
  279.     } VIOCURSORINFO ;
  280.     typedef VIOCURSORINFO * PVIOCURSORINFO ;
  281.  
  282.     /*
  283.      * Mode structure for VioSetMode and VioGetMode
  284.      * (field added for 32 bit alignment)
  285.      */
  286.     typedef _Packed struct _VIOMODEINFO     /* viomi */
  287.             {
  288.             USHORT cb ;            /* structure length */
  289.             UCHAR  fbType ;        /* mode type */
  290.             UCHAR  color ;         /* number of colors */
  291.             USHORT col ;           /* number of columns */
  292.             USHORT row ;           /* number of rows */
  293.             USHORT hres ;          /* horizontal size in pels */
  294.             USHORT vres ;          /* vertical size in pels */
  295.             UCHAR  fmt_ID ;        /* format of attributes */
  296.             UCHAR  attrib ;        /* length of attributes */
  297.             USHORT resvd ;         /* Reserved   (added field) */
  298.             ULONG  buf_addr ;
  299.             ULONG  buf_length ;
  300.             ULONG  full_length ;
  301.             ULONG  partial_length ;
  302.             PCH    ext_data_addr ;
  303.             } VIOMODEINFO ;
  304.     typedef VIOMODEINFO *PVIOMODEINFO ;
  305.  
  306.  
  307.     /*
  308.      * VIOMODEINFO.fbType constants
  309.      */
  310.     #define VGMT_OTHER            1
  311.     #define VGMT_COLOR            1
  312.     #define VGMT_GRAPHICS         2
  313.     #define VGMT_DISABLEBURST     4
  314.     #define VGMT_NOTBIOS          8
  315.  
  316.     /*
  317.      * VIOMODEINFO.color constants
  318.      */
  319.     #define COLORS_2              1
  320.     #define COLORS_4              2
  321.     #define COLORS_16             4
  322.     #define COLORS_256            8
  323.     #define COLORS_64K           16
  324.     #define COLORS_16M           24
  325.  
  326.     /*
  327.      * Return types for VioCheckCharType
  328.      */
  329.     #define VCC_SBCSCHAR          0
  330.     #define VCC_DBCSFULLCHAR      1
  331.     #define VCC_DBCS1STHALF       2
  332.     #define VCC_DBCS2NDHALF       3
  333.  
  334.     /*
  335.      * Values for graphics mode screen synchronization
  336.      */
  337.     #define VSRWI_SAVEANDREDRAW   0
  338.     #define VSRWI_REDRAW          1
  339.  
  340.     #define VSRWN_SAVE            0
  341.     #define VSRWN_REDRAW          1
  342.  
  343.     #define UNDOI_GETOWNER        0
  344.     #define UNDOI_RELEASEOWNER    1
  345.  
  346.     #define UNDOK_ERRORCODE       0
  347.     #define UNDOK_TERMINATE       1
  348.  
  349.     #define LOCKIO_NOWAIT         0
  350.     #define LOCKIO_WAIT           1
  351.  
  352.     #define LOCK_SUCCESS          0
  353.     #define LOCK_FAIL             1
  354.  
  355.     /*
  356.      * Values for VioSetAnsi and VioGetAnsi
  357.      */
  358.     #define ANSI_ON               1
  359.     #define ANSI_OFF              0
  360.  
  361.     /*
  362.      * Values for VioPopup
  363.      */
  364.     #define VMWR_POPUP            0
  365.     #define VMWN_POPUP            0
  366.     #define VP_NOWAIT             0
  367.     #define VP_WAIT               1
  368.     #define VP_OPAQUE             0
  369.     #define VP_TRANSPARENT        2
  370.  
  371.     /*
  372.      * VIOCONFIGINFO.adapter constants
  373.      */
  374.     #define DISPLAY_MONOCHROME    0
  375.     #define DISPLAY_CGA           1
  376.     #define DISPLAY_EGA           2
  377.     #define DISPLAY_VGA           3
  378.     #define DISPLAY_8514A         7
  379.     #define DISPLAY_IAA           8
  380.     #define DISPLAY_XGA           9
  381.     #define DISPLAY_SVGA         10
  382.     #define DISPLAY_NONVGA       12
  383.  
  384.     /*
  385.      * VIOCONFIGINFO.display constants
  386.      */
  387.     #define MONITOR_MONOCHROME    0
  388.     #define MONITOR_COLOR         1
  389.     #define MONITOR_ENHANCED      2
  390.     #define MONITOR_8503          3
  391.     #define MONITOR_851X_COLOR    4
  392.     #define MONITOR_8514          9
  393.     #define MONITOR_FLATPANEL    10
  394.     #define MONITOR_LCD640       10
  395.     #define MONITOR_8507_8604    11
  396.     #define MONITOR_8515         12
  397.     #define MONITOR_9515         15
  398.     #define MONITOR_9517         17
  399.     #define MONITOR_9518         18
  400.     #define MONITOR_OEM          19
  401.     #define MONITOR_LCD800       21
  402.     #define MONITOR_LCD1024      22
  403.  
  404.     /*
  405.      * Configuration structure for VioGetConfig
  406.      * (all fields changed to ULONG)
  407.      */
  408.     typedef _Packed struct _VIOCONFIGINFO {
  409.         ULONG   cb ;              /* Size of data      */
  410.         ULONG   adapter ;         /* Adapter type      */
  411.         ULONG   display ;         /* Display type      */
  412.         ULONG   cbMemory ;        /* Adapter memory    */
  413.         ULONG   Configuration ;   /* Which config      */
  414.         ULONG   Version ;         /* Driver version    */
  415.         ULONG   Flags ;           /*                   */
  416.         ULONG   HWBufferSize ;    /* State save size   */
  417.         ULONG   FullSaveSize ;    /* Buffer save size  */
  418.         ULONG   PartSaveSize ;    /* Partial save size */
  419.         ULONG   VideoID ;         /* Adapter ID        */
  420.         ULONG   VideoData ;       /* Adapter user data */
  421.     } VIOCONFIGINFO ;
  422.     typedef VIOCONFIGINFO * PVIOCONFIGINFO ;
  423.  
  424.     #define VIO_CONFIG_CURRENT    0
  425.     #define VIO_CONFIG_PRIMARY    1
  426.     #define VIO_CONFIG_SECONDARY  2
  427.  
  428.     /*
  429.      *  Structures for VioSetState and VioGetState
  430.      */
  431.     typedef _Packed struct _VIOPALSTATE {
  432.         USHORT  cb ;
  433.         USHORT  type ;
  434.         USHORT  iFirst ;
  435.         USHORT  acolor[1] ;
  436.     } VIOPALSTATE ;
  437.     typedef VIOPALSTATE * PVIOPALSTATE ;
  438.  
  439.     typedef _Packed struct _VIOOVERSCAN {
  440.         USHORT  cb ;
  441.         USHORT  type ;
  442.         USHORT  color ;
  443.     } VIOOVERSCAN ;
  444.     typedef VIOOVERSCAN * PVIOOVERSCAN ;
  445.  
  446.     typedef _Packed struct _VIOINTENSITY {
  447.         USHORT  cb ;
  448.         USHORT  type ;
  449.         USHORT  fs ;
  450.     } VIOINTENSITY ;
  451.     typedef VIOINTENSITY * PVIOINTENSITY ;
  452.  
  453.     typedef _Packed struct _VIOCOLORREG {
  454.         USHORT  cb ;
  455.         USHORT  type ;
  456.         USHORT  firstcolorreg ;
  457.         USHORT  numcolorregs ;
  458.         PCH     colorregaddr ;
  459.     } VIOCOLORREG ;
  460.     typedef VIOCOLORREG * PVIOCOLORREG ;
  461.  
  462.     typedef _Packed struct _VIOSETULINELOC {
  463.         USHORT  cb ;
  464.         USHORT  type ;
  465.         USHORT  scanline ;
  466.     } VIOSETULINELOC ;
  467.     typedef VIOSETULINELOC * PVIOSETULINELOC ;
  468.  
  469.     typedef _Packed struct _VIOSETTARGET {
  470.         USHORT  cb ;
  471.         USHORT  type ;
  472.         USHORT  defaultalgorithm ;
  473.     } VIOSETTARGET ;
  474.     typedef VIOSETTARGET * PVIOSETTARGET ;
  475.  
  476.     /*
  477.      * Vio function prototypes
  478.      */
  479.     #define VioScrollDn VioScrollDown
  480.     #define VioScrollLf VioScrollLeft
  481.     #define VioScrollRt VioScrollRight
  482.     #define VioWrtCharStrAtt VioWrtCharStrAttr
  483.     APIRET APIENTRY VioGetAnsi          (ULONG * Ansi, HVIO Handle) ;
  484.     APIRET APIENTRY VioGetCp            (ULONG Reserved, USHORT * IdCodePage, HVIO Handle) ;
  485.     APIRET APIENTRY VioGetCurPos        (ULONG * Row, ULONG * Column, HVIO Handle) ;
  486.     APIRET APIENTRY VioGetCurType       (VIOCURSORINFO * CursorInfo, HVIO Handle) ;
  487.     APIRET APIENTRY VioGetMode          (VIOMODEINFO * ModeInfo, HVIO Handle) ;
  488.     APIRET APIENTRY VioReadCellStr      (char * CellStr, ULONG * Count, ULONG Row, ULONG Column, HVIO Handle) ;
  489.     APIRET APIENTRY VioReadCharStr      (char * CellStr, ULONG * Count, ULONG Row, ULONG Column, HVIO Handle) ;
  490.     APIRET APIENTRY VioScrollDown       (ULONG TopRow, ULONG LeftCol, ULONG BotRow, ULONG RightCol, ULONG Lines, BYTE * Cell, HVIO Handle) ;
  491.     APIRET APIENTRY VioScrollLeft       (ULONG TopRow, ULONG LeftCol, ULONG BotRow, ULONG RightCol, ULONG Columns, BYTE * Cell, HVIO Handle) ;
  492.     APIRET APIENTRY VioScrollRight      (ULONG TopRow, ULONG LeftCol, ULONG BotRow, ULONG RightCol, ULONG Columns, BYTE * Cell, HVIO Handle) ;
  493.     APIRET APIENTRY VioScrollUp         (ULONG TopRow, ULONG LeftCol, ULONG BotRow, ULONG RightCol, ULONG Lines, BYTE * Cell, HVIO Handle) ;
  494.     APIRET APIENTRY VioSetAnsi          (ULONG Ansi, HVIO Handle) ;
  495.     APIRET APIENTRY VioSetCp            (ULONG Reserved, USHORT IdCodePage, HVIO Handle) ;
  496.     APIRET APIENTRY VioSetCurPos        (ULONG Row, ULONG Column, HVIO Handle) ;
  497.     APIRET APIENTRY VioSetCurType       (VIOCURSORINFO * CursorInfo, HVIO Handle) ;
  498.     APIRET APIENTRY VioSetMode          (VIOMODEINFO * ModeInfo, HVIO hvio) ;
  499.     APIRET APIENTRY VioWrtCellStr       (char * CellStr, ULONG Count, ULONG Row, ULONG Column, HVIO Handle) ;
  500.     APIRET APIENTRY VioWrtCharStr       (char * Str, ULONG Count, ULONG Row, ULONG Column, HVIO Handle) ;
  501.     APIRET APIENTRY VioWrtCharStrAttr   (char * Str, ULONG Count, ULONG Row, ULONG Column, PBYTE pAttr, HVIO Handle) ;
  502.     APIRET APIENTRY VioWrtNAttr         (BYTE * Attr, ULONG Count, ULONG Row, ULONG Column, HVIO Handle) ;
  503.     APIRET APIENTRY VioWrtNCell         (BYTE * Cell, ULONG Count, ULONG Row, ULONG Column, HVIO Handle) ;
  504.     APIRET APIENTRY VioWrtNChar         (char * Char, ULONG Count, ULONG Row, ULONG Column, HVIO Handle) ;
  505.     APIRET APIENTRY VioWrtTTY           (char * Str, ULONG Count, HVIO Handle) ;
  506.  
  507.     #define VioSavRedrawUndo VioSaveRedrawUndo
  508.     #define VioSavRedrawWait VioSaveRedrawWait
  509.     APIRET APIENTRY  VioModeUndo (ULONG OwnerInd, ULONG KillInd, ULONG Reserved) ;
  510.     APIRET APIENTRY  VioModeWait (ULONG ReqType, ULONG * NotifyType, ULONG Reserved) ;
  511.     APIRET APIENTRY  VioSaveRedrawUndo (ULONG OwnerInd, ULONG KillInd, ULONG Reserved) ;
  512.     APIRET APIENTRY  VioSaveRedrawWait (ULONG RedrawInd, ULONG * NotifyType, ULONG Reserved) ;
  513.  
  514.     APIRET APIENTRY  VioEndPopUp (HVIO hvio) ;
  515.     APIRET APIENTRY  VioPopUp (ULONG * Wait, HVIO hvio) ;
  516.     APIRET APIENTRY  VioScrLock (ULONG fWait, UCHAR * NotLocked, HVIO hvio) ;
  517.     APIRET APIENTRY  VioScrUnLock (HVIO hvio) ;
  518.  
  519.     #define VioGetOrg VioGetOrigin
  520.     #define VioSetOrg VioSetOrigin
  521.     APIRET APIENTRY  VioCreatePS(HVIO * VioPSHandle, ULONG Rows, ULONG Columns, ULONG Format, ULONG AttrBytes, HVIO VioPSHandle) ;
  522.     APIRET APIENTRY  VioDestroyPS(HVIO VioPSHandle) ;
  523.     APIRET APIENTRY  VioShowPS(ULONG Depth, ULONG Width, ULONG Cell, HVIO VioPSHandle) ;
  524.     APIRET APIENTRY  VioQueryFonts(PULONG Remfonts, PFONTMETRICS Metrics, ULONG MetricsLength, PULONG Fonts, PSZ Facename, ULONG Options, HVIO VioPSHandle) ;
  525.     APIRET APIENTRY  VioQueryFontsUni(PULONG Remfonts, PFONTMETRICS Metrics, ULONG MetricsLength, PULONG Fonts, USHORT * Facename, ULONG Options, HVIO VioPSHandle) ;
  526.     APIRET APIENTRY  VioQuerySetIds(PULONG lcids, PSTR8 Names, PULONG Types, ULONG count, HVIO VioPSHandle) ;
  527.     APIRET APIENTRY  VioAssociate(ULONG hdc, HVIO VioPSHandle) ;
  528.     APIRET APIENTRY  VioCreateLogFont(PFATTRS pfat, ULONG lcid, PSTR8 pstr8Name, HVIO VioPSHandle) ;
  529.     APIRET APIENTRY  VioDeleteSetId(ULONG lcid, HVIO VioPSHandle) ;
  530.     APIRET APIENTRY  VioGetOrigin(ULONG * Row, ULONG * Column, HVIO VioPSHandle) ;
  531.     APIRET APIENTRY  VioSetOrigin(ULONG Row, ULONG Column, HVIO VioPSHandle) ;
  532.     APIRET APIENTRY  VioSetDeviceCellSize(ULONG Height, ULONG Width, HVIO VioPSHandle) ;
  533.     APIRET APIENTRY  VioGetDeviceCellSize(ULONG * Height, ULONG * Width, HVIO VioPSHandle) ;
  534.  
  535.     APIRET APIENTRY  VioGetBuf (PULONG pLVB, PULONG pcbLVB, HVIO hvio) ;
  536.     APIRET APIENTRY  VioShowBuf (ULONG offLVB, ULONG cb, HVIO hvio) ;
  537.  
  538.     APIRET APIENTRY  VioGetState (void * State, HVIO hvio) ;
  539.     APIRET APIENTRY  VioSetState (void * State, HVIO hvio) ;
  540.  
  541.     APIRET APIENTRY  VioCharWidthUni(USHORT uch) ;
  542.  
  543.     APIRET APIENTRY  VioCheckCharType (ULONG * Type, ULONG Row, ULONG Column, HVIO hvio) ;
  544.  
  545.     APIRET APIENTRY  VioGetConfig (ULONG ConfigId, PVIOCONFIGINFO pvioin, HVIO hvio) ;
  546.  
  547.     APIRET APIENTRY  VioPrtSc (HVIO hvio) ;
  548.  
  549.     APIRET APIENTRY  VioPrtScToggle (HVIO hvio) ;
  550.  
  551.     APIRET APIENTRY  VioWrtTTYUni (USHORT * pch, ULONG cb, HVIO hvio) ;
  552.  
  553. #ifdef __UNI_REPLACE__
  554.     #define VioWrtTTY     VioWrtTTYUni
  555.     #define VioQueryFonts VioQueryFontsUni
  556. #endif
  557.  
  558. #endif /* INCL_VIO */
  559.  
  560.  
  561. /*
  562.  * Mouse (Mou) functions
  563.  *
  564.  * Notes:
  565.  *     The mouse handle is always required to be zero, as there is no longer
  566.  *     an open an close.
  567.  */
  568. #ifdef INCL_MOU
  569.  
  570.     typedef unsigned long   HMOU ;
  571.     typedef HMOU        *   PHMOU ;
  572.  
  573.     APIRET APIENTRY  MouFlushQue (HMOU hmou) ;
  574.  
  575.     #define MHK_BUTTON1                0x0001
  576.     #define MHK_BUTTON2                0x0002
  577.     #define MHK_BUTTON3                0x0004
  578.  
  579.     /*
  580.      * Structure for MouGetPtrPos and MouSetPtrPos
  581.      */
  582.     typedef _Packed struct _PTRLOC {
  583.         ULONG  row ;               /* was USHORT */
  584.         ULONG  col ;               /* was USHORT */
  585.     } PTRLOC ;
  586.     typedef PTRLOC * PPTRLOC ;
  587.  
  588.     /*
  589.      * structure for MouRemovePtr
  590.      * (field lengths increased)
  591.      */
  592.     typedef _Packed struct _NOPTRRECT {
  593.         ULONG  row ;
  594.         ULONG  col ;
  595.         ULONG  cRow ;
  596.         ULONG  cCol ;
  597.     } NOPTRRECT ;
  598.     typedef NOPTRRECT * PNOPTRRECT ;
  599.  
  600.     typedef _Packed struct _THRESHOLD {   /* threshold */
  601.         USHORT Length ;            /* Length Field            */
  602.         USHORT Level1 ;            /* First movement level    */
  603.         USHORT Lev1Mult ;          /* First level multiplier  */
  604.         USHORT Level2 ;            /* Second movement level   */
  605.         USHORT lev2Mult ;          /* Second level multiplier */
  606.     } THRESHOLD ;
  607.     typedef THRESHOLD * PTHRESHOLD ;
  608.  
  609.     /*
  610.      * Pointer shape function for MouGetPtrShape and MouSetPtrShape
  611.      */
  612.     typedef _Packed struct _PTRSHAPE {
  613.         USHORT cb ;                /* Structure length */
  614.         USHORT col ;               /* Horizontal size */
  615.         USHORT row ;               /* Vertical size */
  616.         USHORT colHot ;            /* Horizontal hot spot */
  617.         USHORT rowHot ;            /* Vertical hot spot */
  618.     } PTRSHAPE ;
  619.     typedef PTRSHAPE * PPTRSHAPE ;
  620.  
  621.     /*
  622.      * Device status for MouGetDevStatus and MouSetDevStatus
  623.      */
  624.     #define MOUSE_QUEUEBUSY        0x0001
  625.     #define MOUSE_BLOCKREAD        0x0002
  626.     #define MOUSE_FLUSH            0x0004
  627.     #define MOUSE_UNSUPPORTED_MODE 0x0008
  628.     #define MOUSE_DISABLED         0x0100
  629.     #define MOUSE_MICKEYS          0x0200
  630.  
  631.     /*
  632.      * Wait constants for MouReadEventQue
  633.      */
  634.     #define MOU_NOWAIT                      0x0000
  635.     #define MOU_WAIT                        0x0001
  636.  
  637.     /*
  638.      * structure for MouReadEventQue()
  639.      * (all fields lengthened)
  640.      */
  641.     typedef _Packed struct _MOUEVENTINFO {
  642.         ULONG  fs ;                 /* Mouse state (MOUSE_ ) */
  643.         LONG   row ;                /* Horizontal position */
  644.         LONG   col ;                /* Vertical position */
  645.         ULONG  time ;               /* Timestamp */
  646.     } MOUEVENTINFO ;
  647.     typedef MOUEVENTINFO *PMOUEVENTINFO ;
  648.  
  649.     /*
  650.      * structure for MouGetNumQueEl()
  651.      * (all fields lengthened)
  652.      */
  653.     typedef _Packed struct _MOUQUEINFO {
  654.         ULONG  cEvents ;
  655.         ULONG  cmaxEvents ;
  656.     } MOUQUEINFO ;
  657.     typedef MOUQUEINFO *PMOUQUEINFO ;
  658.  
  659.     /*
  660.      * Event mask constants for MouGetEventMask and MouSetEventMask
  661.      */
  662.     #define MOUSE_MOTION                 0x0001
  663.     #define MOUSE_MOTION_WITH_BN1_DOWN   0x0002
  664.     #define MOUSE_BN1_DOWN               0x0004
  665.     #define MOUSE_MOTION_WITH_BN2_DOWN   0x0008
  666.     #define MOUSE_BN2_DOWN               0x0010
  667.     #define MOUSE_MOTION_WITH_BN3_DOWN   0x0020
  668.     #define MOUSE_BN3_DOWN               0x0040
  669.  
  670.     /*
  671.      * Structure for MouGetScaleFact and MouSetScaleFact
  672.      */
  673.     typedef _Packed struct _SCALEFACT {
  674.         ULONG  rowScale ;
  675.         ULONG  colScale ;
  676.     } SCALEFACT ;
  677.     typedef SCALEFACT * PSCALEFACT ;
  678.  
  679.     /*
  680.      * Status for MouSetDevStatus
  681.      */
  682.     #define MOU_NODRAW                 0x0001
  683.     #define MOU_DRAW                   0x0000
  684.     #define MOU_MICKEYS                0x0002
  685.     #define MOU_PELS                   0x0000
  686.  
  687.     /*
  688.      * Mou function prototypes
  689.      */
  690.     APIRET APIENTRY  MouGetNumButtons (ULONG * Buttons, HMOU Handle) ;
  691.  
  692. #define MouClose(x)  0  /* Mouse close is no longer needed */
  693.  
  694.     APIRET APIENTRY  MouDrawPtr (HMOU Handle) ;
  695.  
  696.     APIRET APIENTRY  MouFlushQue (HMOU Handle) ;
  697.  
  698.     APIRET APIENTRY  MouGetDevStatus (PULONG  DevStat, HMOU Handle) ;
  699.  
  700.     APIRET APIENTRY  MouGetEventMask (PULONG  EventMask, HMOU Handle) ;
  701.  
  702.     APIRET APIENTRY  MouGetNumMickeys (PULONG  Mickeys, HMOU Handle) ;
  703.  
  704.     APIRET APIENTRY  MouGetNumQueEl (PMOUQUEINFO QElements, HMOU Handle) ;
  705.  
  706.     APIRET APIENTRY  MouGetPtrPos (PPTRLOC PtrLoc, HMOU Handle) ;
  707.  
  708.     APIRET APIENTRY  MouGetPtrShape (PVOID PtrBuf, PPTRSHAPE PtrInfo, HMOU Handle) ;
  709.  
  710.     APIRET APIENTRY  MouGetScaleFact (PSCALEFACT MouScale, HMOU Handle) ;
  711.  
  712. #define MouOpen(x, y) (*(y)=0)
  713.  
  714.     APIRET APIENTRY  MouReadEventQue (PMOUEVENTINFO EventMask, PULONG Wait,
  715.                                       HMOU Handle) ;
  716.  
  717.     APIRET APIENTRY  MouRemovePtr (PNOPTRRECT MouseRect, HMOU Handle) ;
  718.  
  719.     APIRET APIENTRY  MouSetDevStatus (PULONG  DevStat, HMOU Handle) ;
  720.  
  721.     APIRET APIENTRY  MouSetEventMask (PULONG  EventMask, HMOU Handle) ;
  722.  
  723.     APIRET APIENTRY  MouSetPtrPos (PPTRLOC PtrLoc, HMOU Handle) ;
  724.  
  725.     APIRET APIENTRY  MouSetPtrShape (PBYTE PtrBuf, PPTRSHAPE PtrInfo, HMOU Handle) ;
  726.  
  727.     APIRET APIENTRY  MouSetScaleFact (PSCALEFACT Scale, HMOU Handle) ;
  728.  
  729. #endif /* INCL_MOU */
  730.  
  731. #endif /* __BSESUB__ */
  732.  
  733. #ifdef __cplusplus
  734.         }
  735. #endif
  736.  
  737. #ifdef __IBMC__
  738.    #pragma checkout( suspend )
  739.    #ifndef __CHKHDR__
  740.       #pragma checkout( resume )
  741.    #endif
  742.    #pragma checkout( resume )
  743. #else
  744.    #ifdef __IBMCPP__
  745.       #pragma info( none )
  746.       #ifndef __CHKHDR__
  747.          #pragma info( restore )
  748.       #endif
  749.       #pragma info( restore )
  750.    #endif
  751. #endif
  752. /* INC */
  753.