home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / source / 32text / vio.doc < prev   
Encoding:
Text File  |  1994-01-19  |  91.4 KB  |  3,329 lines

  1. *
  2. * Title: vio.doc
  3. *
  4. * Function:
  5. *     Workplace OS/2 base video APIs
  6. *
  7. * Copyright:
  8. *     Copyright (C) IBM Corp. 1993
  9. *
  10. * Notes:
  11. *     This is preliminary documentation and subject to change.
  12. *
  13. VioAssociate
  14. ================================================================================
  15. Associate or Disassociate a Vio presentation space with a device context.
  16.  
  17.  
  18. CALL SYNTAX
  19. -----------
  20.  
  21.  #define INCL_VIO
  22.  
  23.  APIRET  VioAssoicate(HDC hdc, HVIO hvio);
  24.  
  25.  
  26. PARAMETERS
  27. ----------
  28.  
  29.   hdc (HDC) - input
  30.      Device context handle.  If this is NULL, a disassociation occurs.
  31.  
  32.   hvio (HVIO) - input
  33.      Vio presentation space handle.  This is returned from VioCreatePS.
  34.  
  35.  
  36. RETURNS
  37. -------
  38.      Return code descriptions are:
  39.  
  40.      0         NO_ERROR
  41.      436       ERROR_VIO_INVALID_HANDLE
  42.      495       ERROR_VIO_NOT_PRES_MGR_SG
  43.      499       ERROR_VIO_ASSOCIATED_DC
  44.  
  45.  
  46. REMARKS
  47. -------
  48.  
  49. Subsequent Vio calls to this Vio presentation space will direct output to
  50. the specified device context.
  51.  
  52. If a null handle is specified for the device context, the presentation space
  53. is disassociated from any device context.
  54.  
  55. An associated presentation space or device context cannot be associated.
  56.  
  57. The screen device context is the only kind of device that can be associated
  58. with a Vio presentation space.
  59.  
  60.  
  61.  
  62. VioCreateLogFont
  63. ================================================================================
  64. Specify a font for use by a Vio session
  65.  
  66.  
  67. CALL SYNTAX
  68. -----------
  69.  
  70.  #define INCL_VIO
  71.  
  72.  APIRET  VioCreateLogFont(PFATTR attrs, ULONG lcid, PSTR8 Name, HVIO, hvio);
  73.  
  74.  
  75. PARAMETERS
  76. ----------
  77.  
  78.   attrs (PFATTR) - input
  79.      Pointer to structure containing the attributes of the font.
  80.  
  81.   lcid (LONG) - input
  82.      Local identifier.  This must be a value in the range 1 to 3.
  83.      It is an error if lcid is already in use.
  84.  
  85.   Name (STR8) - input
  86.      Logical font name.  This string is optional, and is used to
  87.      describe the logical font.
  88.  
  89.   hvio (HVIO) - input
  90.      Vio presentation space handle.  This is either zero to indicate the
  91.      default Vio session, or a value returned by VioCreatePS.
  92.  
  93.  
  94. RETURNS
  95. -------
  96.      Return code descriptions are:
  97.  
  98.      0         NO_ERROR
  99.      421       ERROR_VIO_INVALID_PARMS
  100.      436       ERROR_VIO_INVALID_HANDLE
  101.  
  102. REMARKS
  103. -------
  104.  
  105. The system selects the font most closely matching the specified font from
  106. the set of monospaced fonts which are installed on the system.
  107.  
  108. In OS/2 2.x, hvio cannot be zero.
  109.  
  110.  
  111. VioCreatePS
  112. ================================================================================
  113. Create a Vio presentation space
  114.  
  115.  
  116. CALL SYNTAX
  117. -----------
  118.  
  119.  #define INCL_VIO
  120.  
  121.  APIRET APIENTRY  VioCreatePS(PHVIO phvio, ULONG Rows, ULONG Columns,
  122.                                 ULONG Format, ULONG Bytes, HVIO hvio);
  123.  
  124.  
  125. PARAMETERS
  126. ----------
  127.  
  128.   phvio (PHVIO) - output
  129.      The location to return the newly created presentation space handle.
  130.  
  131.   Rows (ULONG) - input
  132.      The number of rows in the presentation space.  The maximum value
  133.      allowed is 255.
  134.  
  135.   Columns (ULONG) - input
  136.      The number of columns in the presentation space.  The maximum value
  137.      allowed is 255.
  138.  
  139.   Format (ULONG) - input
  140.      The format of the attributes:
  141.      1 = VGA compatible
  142.      3 = MFI compatible
  143.  
  144.   AttrBytes (ULONG) - input
  145.      The number of attribute bytes.  This is used along with the format
  146.      to select the attribute structure.  This field has a value of 1 or 3.
  147.  
  148.   hvio (HVIO) - input
  149.      The value is reserved, and must be zero.
  150.  
  151.  
  152. RETURNS
  153. -------
  154.      Return code descriptions are:
  155.  
  156.      0         NO_ERROR
  157.      421       ERROR_VIO_INVALID_PARMS
  158.      436       ERROR_VIO_INVALID_HANDLE
  159.  
  160.  
  161. REMARKS
  162. -------
  163.  
  164.  
  165.  
  166. VioDeleteSetId
  167. ================================================================================
  168. Make the logical font no longer avaliable via the local id
  169.  
  170.  
  171. CALL SYNTAX
  172. -----------
  173.  
  174.  #define INCL_VIO
  175.  
  176.  APIRET APIENTRY  VioDeleteSetId(ULONG lcid, HVIO hvio);
  177.  
  178.  
  179. PARAMETERS
  180. ----------
  181.  
  182.   lcid (ULONG) - input
  183.      The local identifier for a font
  184.  
  185.   hvio (HVIO) - input
  186.      Vio presentation space handle.  This is either zero to indicate the
  187.      default Vio session, or a value returned by VioCreatePS.
  188.  
  189.  
  190. RETURNS
  191. -------
  192.      Return code descriptions are:
  193.  
  194.      0         NO_ERROR
  195.      421       ERROR_VIO_INVALID_PARMS
  196.      436       ERROR_VIO_INVALID_HANDLE
  197.  
  198.  
  199. REMARKS
  200. -------
  201.  
  202. After this call, the lcid is available for reuse.
  203.  
  204. In OS/2 2.x, hvio cannot be zero.
  205.  
  206.  
  207.  
  208. VioDestroyPS
  209. ================================================================================
  210. Destroy the Vio presentation space
  211.  
  212.  
  213. CALL SYNTAX
  214. -----------
  215.  
  216.  #define INCL_VIO
  217.  
  218.  APIRET APIENTRY  VioDestroyPS(HVIO hvio);
  219.  
  220.  
  221. PARAMETERS
  222. ----------
  223.  
  224.   hvio (HVIO) - input
  225.      Vio presentation space handle.  This is a value returned by VioCreatePS.
  226.  
  227.  
  228. RETURNS
  229. -------
  230.      Return code descriptions are:
  231.  
  232.      0         NO_ERROR
  233.      421       ERROR_VIO_INVALID_PARMS
  234.      436       ERROR_VIO_INVALID_HANDLE
  235.      499       ERROR_VIO_ASSOCIATED_DC
  236.  
  237.  
  238. REMARKS
  239. -------
  240.  
  241. The presentation space must not be associated with a device context when
  242. VioDestroyPS is called.
  243.  
  244. The Vio presentation space handle is invalid after this call
  245.  
  246. After this call, the lcid is available for reuse.
  247.  
  248.  
  249.  
  250. VioEndPopUp
  251. ================================================================================
  252. This call is issued by the application when it no longer requires the temporary
  253. screen obtained through a previous VioPopUp call.
  254.  
  255.  
  256. CALL SYNTAX
  257. -----------
  258.  
  259.  #define INCL_VIO
  260.  
  261.  APIRET  VioEndPopUp(HVIO hvio);
  262.  
  263.  
  264. PARAMETERS
  265. ----------
  266.  
  267.   hvio (HVIO) - input
  268.      Reserved value, must be zero.
  269.  
  270.  
  271. RETURNS
  272. -------
  273.      Return code descriptions are:
  274.  
  275.      0         NO_ERROR
  276.      405       ERROR_VIO_NO_POPUP
  277.      436       ERROR_VIO_INVALID_HANDLE
  278.  
  279.  
  280. REMARKS
  281. -------
  282.  
  283. When the application issues a VioEndPopUp call, all video calls are directed to
  284. the application's normal video buffer.
  285.  
  286. An error is returned if issued with a non-zero handle.
  287.  
  288.  
  289.  
  290. VioGetAnsi
  291. ===============================================================================
  292. This call returns the current ANSI status On/Off state.
  293.  
  294.  
  295.  
  296. CALL SYNTAX
  297. -----------
  298.  
  299.  #define INCL_VIO
  300.  
  301.  APIRET   VioGetAnsi(PULONG Indicator, HVIO hvio);
  302.  
  303.  
  304. PARAMETERS
  305. ----------
  306.  
  307.   Indicator (PULONG) - output
  308.      Address of the current ANSI status. A value of 1 indicates ANSI is active,
  309.      and a value of 0 indicates ANSI is not active.
  310.  
  311.   hvio (HVIO) - input
  312.      This must be zero unless the caller is a Presentation Manager application,
  313.      in which case it must be the value returned by VioGetPs.
  314.  
  315.  
  316. RETURNS
  317. -------
  318.      Return code descriptions are:
  319.  
  320.      0         NO_ERROR
  321.      436       ERROR_VIO_INVALID_HANDLE
  322.      465       ERROR_VIO_DETACHED
  323.  
  324.  
  325.  
  326. VioGetBuf
  327. ================================================================================
  328. This call returns the address of the logical video buffer (LVB).
  329.  
  330.  
  331. CALL SYNTAX
  332. -----------
  333.  
  334.  #define INCL_VIO
  335.  
  336.  APIRET   VioGetBuf(PULONG LVBPtr, PULONG Length, HVIO hvio);
  337.  
  338.  
  339. PARAMETERS
  340. ----------
  341.  
  342.   LVBPtr (PULONG) - output
  343.      Address of the logical video buffer.
  344.  
  345.   Length (PULONG) - output
  346.      Address of the length buffer in bytes.  The length is: number of
  347.      rows * number of columns * size of cell.
  348.  
  349.   hvio (HVIO) - input
  350.      This must be zero unless the caller is a Presentation Manager application,
  351.      in which case it must be the value returned by VioGetPs.
  352.  
  353.  
  354. RETURNS
  355. -------
  356.      Return code descriptions are:
  357.  
  358.      0         NO_ERROR
  359.      355       ERROR_VIO_MODE
  360.      430       ERROR_VIO_ILLEGAL_DURING_POPUP
  361.      436       ERROR_VIO_INVALID_HANDLE
  362.      465       ERROR_VIO_DETACHED
  363.  
  364.  
  365. REMARKS
  366. -------
  367.  
  368. An application using VioGetBuf can prepare a screen in the application's own
  369. logical video buffer (LVB) offline.  When the application is in the foreground,
  370. the physical screen buffer is updated from the LVB when VioShowBuf is issued.
  371. When the application runs in the background, the physical screen buffer is
  372. updated when the application is switched to the foreground.
  373.  
  374. Once VioGetBuf is issued, all VioWrtXX calls issued while the application is
  375. running in the foreground are written to the physical display buffer and LVB.
  376.  
  377. VioGetMode may be used to determine the dimensions of the buffer.
  378.  
  379. If VioSetMode is issued following a VioGetBuf call, the size of the logical
  380. video buffer is changed, and VioGetBuf should be reissued.
  381.  
  382.  
  383.  
  384.  
  385. VioGetConfig
  386. ================================================================================
  387. This call returns the video display configuration.
  388.  
  389.  
  390. CALL SYNTAX
  391. -----------
  392.  
  393.  typedef struct _VIOCONFIGINFO {  /* vioin  */
  394.      ULONG   cb;                    /* Length of this data structure */
  395.      ULONG   adapter;               /* Display adapter type */
  396.      ULONG   display;               /* Display/monitor type */
  397.      ULONG   cbMemory;              /* Bytes of memory on the adapter */
  398.      ULONG   Configuration;         /* Configuration number */
  399.      ULONG   VDHVersion;            /* Reserved */
  400.      ULONG   Flags;
  401.      ULONG   HWBufferSize;          /* Size to save video state */
  402.      ULONG   FullSaveSize;          /* Full save size */
  403.      ULONG   PartSaveSize;          /* Partial save size */
  404.      ULONG   EMAdaptersOFF;         /* Offset to emulated adapter types */
  405.      ULONG   EMDisplaysOFF;         /* Offset to emulated display types */
  406.  } VIOCONFIGINFO;
  407.  
  408.  #define INCL_VIO
  409.  
  410.  APIRET   VioGetConfig(PULONG ConfigID, PVIOCONFIGINFO ConfigData,
  411.                        HVIO hvio);
  412.  
  413.  
  414. PARAMETERS
  415. ----------
  416.  
  417.   ConfigID (ULONG) - input
  418.      Identifies for which display configuration information is being requested:
  419.  
  420.      Value     Definition
  421.      0         Current configuration
  422.      1         Primary configuration
  423.      2         Secondary configuration.
  424.  
  425.  
  426.   ConfigData (PVIOCONFIGINFO) - output
  427.      Address of structure where the display configuration is returned.
  428.  
  429.      length (ULONG)
  430.         Input parameter to VioGetConfig.  The length must be either 4 to
  431.         indicate the actual length should be returned, or at least 48.
  432.  
  433.      adaptertype (ULONG)
  434.         Display adapter type.
  435.  
  436.         Value     Definition
  437.         0-3       Reserved
  438.         3         VGA Display Adapter
  439.         4-6       Reserved
  440.         7         8514/A.
  441.         8         Image Adapter/A
  442.         9         XGA Display Adapter
  443.  
  444.         Values ranging from 0-4095 are reserved for IBM.
  445.  
  446.      displaytype (USHORT)
  447.         Display or monitor type.
  448.  
  449.         Value     Definition
  450.         0-2       Reserved
  451.         3         13" Monochrome Display
  452.         4         13" Color Displays
  453.         5-8       Reserved
  454.         9         16" 1024x768 capable color display
  455.         10        LCD or Plasma display
  456.         11        large monochrome display
  457.         12        14" 1024x768 capable color display
  458.         13        Reserved
  459.  
  460.         Values ranging from 0-4095 are reserved for IBM.
  461.  
  462.      adaptmem (ULONG)
  463.         Amount of memory, in bytes, on the adapter.
  464.  
  465.      Configuration (ULONG)
  466.         Number of the display configuration that this data corresponds to. This
  467.         is assigned by the video subsystem.
  468.  
  469.      VDHVersion (ULONG)
  470.         This field is reserved.
  471.  
  472.      Flag bits (ULONG)
  473.         Are defined as follows:
  474.  
  475.         Bit       Description
  476.         31-1      Reserved
  477.         0         Power up display configuration.
  478.  
  479.      Hardware state buffer size (ULONG)
  480.         Size of the buffer required by the Base Video Handler (BVH) to save the
  481.         full hardware state excluding the physical display buffer.
  482.  
  483.      Max buffer size - full save (ULONG)
  484.         Maximum size buffer required by the BVH to save the full physical
  485.         display buffer.
  486.  
  487.      Max buffer size - partial save (ULONG)
  488.         Maximum size buffer required by the BVH to save the portion of the
  489.         physical display buffer that is overlaid by a pop-up.
  490.  
  491.      Offset to emulated adapter types (ULONG)
  492.         Offset within the configuration data structure to the following
  493.         information describing what other display adapters are emulated by this
  494.         display adapter.
  495.  
  496.         Number of Data words (ULONG)
  497.            Contains a one word field specifying a count of data words to follow.
  498.  
  499.         Data word 1 (ULONG)
  500.            Bits set in the data words identify display adapters emulated.  Data
  501.            word 1 has the following definition:
  502.  
  503.            Bit       Description
  504.            0-2       Reserved
  505.            3         VGA
  506.            4-6       Reserved
  507.            7         8514/A Adapter
  508.            8         Image Adapter/A
  509.            9         XGA Adapter
  510.            10-31     Reserved.
  511.  
  512.      Offset to emulated display types (ULONG)
  513.         Offset within the configuration data structure to the following
  514.         information describing what other displays are emulated by this display.
  515.  
  516.         Number of Data words (ULONG)
  517.            One word field specifying a count of data words to follow.
  518.  
  519.         Data word 1 (ULONG)
  520.            Bits set in the data words identify displays emulated.  Data word 1
  521.            has the following definition:
  522.  
  523.            Bit       Description
  524.            0-2       Reserved
  525.            3         13" Monochrome Display
  526.            4         13" Color Displays
  527.            5-8       Reserved
  528.            9         16" 1024x768 capable color display
  529.            10        LCD or Plasma display
  530.            11        large monochrome display
  531.            12        14" 1024x768 capable color display
  532.            13-31     Reserved
  533.  
  534.   hvio (HVIO) - input
  535.      This must be zero unless the caller is a Presentation Manager application,
  536.      in which case it must be the value returned by VioGetPs.
  537.  
  538.  
  539. RETURNS
  540. -------
  541.      Return code descriptions are:
  542.  
  543.      0         NO_ERROR
  544.      421       ERROR_VIO_INVALID_PARMS
  545.      436       ERROR_VIO_INVALID_HANDLE
  546.      438       ERROR_VIO_INVALID_LENGTH
  547.      465       ERROR_VIO_DETACHED
  548.  
  549.  
  550. REMARKS
  551. -------
  552.  
  553. The values returned may not be correct if the adapter cannot be properly
  554. identified, or if the device is not capable of returning its settings.
  555.  
  556.  
  557.  
  558. VioGetCp
  559. ================================================================================
  560. This call allows a process to query the code page currently used to display text data.
  561.  
  562.  
  563. CALL SYNTAX
  564. -----------
  565.  
  566.  #define INCL_VIO
  567.  
  568.  APIRET   VioGetCp(ULONG Reserved, PUSHORT CodePageID, HVIO hvio);
  569.  
  570.  
  571. PARAMETERS
  572. ----------
  573.  
  574.   Reserved (ULONG) - input
  575.      Reserved value, must be zero.
  576.  
  577.   CodePageID (PUSHORT) - output
  578.      Address of a word in the application's data area.  The current video code
  579.      page is returned in this word.
  580.  
  581.   hvio (HVIO) - input
  582.      This must be zero unless the caller is a Presentation Manager application,
  583.      in which case it must be the value returned by VioGetPs.
  584.  
  585.  
  586. RETURNS
  587. -------
  588.      Return code descriptions are:
  589.  
  590.      0         NO_ERROR
  591.      355       ERROR_VIO_MODE
  592.      436       ERROR_VIO_INVALID_HANDLE
  593.      465       ERROR_VIO_DETACHED
  594.  
  595.  
  596. REMARKS
  597. -------
  598.  
  599. The display code page ID previously set by VioSetCp, or inherited from the
  600. requesting process, is returned to the caller.
  601.  
  602. The code page tag returned is the currently active code page.
  603.  
  604.  
  605.  
  606. VioGetCurPos
  607. ================================================================================
  608. This call returns the coordinates of the cursor.
  609.  
  610.  
  611. CALL SYNTAX
  612. -----------
  613.  
  614.  #define INCL_VIO
  615.  
  616.  APIRET   VioGetCurPos(PULONG Row, PULONG Column, HVIO hvio);
  617.  
  618.  
  619. PARAMETERS
  620. ----------
  621.  
  622.   Row (PULONG) - output
  623.      Address of the current Row position of the cursor where 0 is the top row.
  624.  
  625.   Column (PULONG) - output
  626.      Address of the current column position of the cursor where 0 is the
  627.      leftmost column.
  628.  
  629.   hvio (HVIO) - input
  630.      This must be zero unless the caller is a Presentation Manager application,
  631.      in which case it must be the value returned by VioGetPs.
  632.  
  633.  
  634. RETURNS
  635. -------
  636.      Return code descriptions are:
  637.  
  638.      0         NO_ERROR
  639.      355       ERROR_VIO_MODE
  640.      436       ERROR_VIO_INVALID_HANDLE
  641.      465       ERROR_VIO_DETACHED
  642.  
  643.  
  644.  
  645. VioGetCurType
  646. ================================================================================
  647. This call returns the cursor type.
  648.  
  649.  
  650. CALL SYNTAX
  651. -----------
  652.  
  653.  typedef struct _VIOCURSORINFO {
  654.      USHORT   yStart;               /* cursor start line */
  655.      USHORT   cEnd;                 /* cursor end line */
  656.      USHORT   cx;                   /* cursor width */
  657.      USHORT   attr;                 /* -1=hidden cursor */
  658.  } VIOCURSORINFO;
  659.  
  660.  #define INCL_VIO
  661.  
  662.  APIRET   VioGetCurType(PVIOCURSORINFO CursorData, HVIO hvio);
  663.  
  664. PARAMETERS
  665. ----------
  666.  
  667.   CursorData (PVIOCURSORINFO) - output
  668.      Address of the cursor characteristics structure:
  669.  
  670.      startline (USHORT)
  671.         Horizontal scan line in the character cell that marks the top line of
  672.         the cursor.  If the character cell has n scan lines, 0 is the top scan
  673.         line of the character cell and (n-1) is the bottom scan line.
  674.  
  675.      endline (USHORT)
  676.         Horizontal scan line in the character cell that marks the bottom line of
  677.         the cursor.  Scan lines within a character cell are numbered as defined
  678.         in startline.
  679.  
  680.      cursorwidth (USHORT)
  681.         Width of the cursor.  In text modes, cursorwidth is the number of
  682.         columns.  The maximum number supported by the OS/2 base video subsystem
  683.         is 1. In graphics modes, cursorwidth is the number of pels.
  684.  
  685.      cursorattrib (USHORT)
  686.         A value of -1 denotes a hidden cursor, all other values in text mode
  687.         denote normal cursor and in graphics mode denote color attribute.
  688.  
  689.   hvio (HVIO) - input
  690.      This must be zero unless the caller is a Presentation Manager application,
  691.      in which case it must be the value returned by VioGetPs.
  692.  
  693.  
  694. RETURNS
  695. -------
  696.      Return code descriptions are:
  697.  
  698.      0         NO_ERROR
  699.      355       ERROR_VIO_MODE
  700.      436       ERROR_VIO_INVALID_HANDLE
  701.      465       ERROR_VIO_DETACHED
  702.  
  703.  
  704. REMARKS
  705. -------
  706.  
  707. If CursorStartLine and CursorEndLine were originally specified as percentages on
  708. VioSetCurType (using negative values), the positive values into which they were
  709. translated are returned.  Refer to VioSetCurType for more information on how
  710. percentages can be used to set CursorStartLine and CursorEndLine independent of
  711. the number of scan lines per character cell.
  712.  
  713.  
  714.  
  715. VioGetDeviceCellSize
  716. ================================================================================
  717. Returns the size of the current character cell in pels
  718.  
  719.  
  720. CALL SYNTAX
  721. -----------
  722.  
  723.  #define INCL_VIO
  724.  
  725.  APIRET APIENTRY  VioGetDeviceCellSize(PULONG Height, PULONG Width, HVIO hvio);
  726.  
  727.  
  728. PARAMETERS
  729. ----------
  730.  
  731.   Height (PULONG) - output
  732.      Location to return the height of the character cell in pels
  733.  
  734.   Width (PULONG) - output
  735.      Location to return the width of the character cell in pels
  736.  
  737.   hvio (HVIO) - input
  738.      Vio presentation space handle.  This is either zero to indicate the
  739.      default Vio session, or a value returned by VioCreatePS.
  740.  
  741.  
  742. RETURNS
  743. -------
  744.      Return code descriptions are:
  745.  
  746.      0         NO_ERROR
  747.      436       ERROR_VIO_INVALID_HANDLE
  748.  
  749.  
  750. REMARKS
  751. -------
  752.  
  753. In OS/2 2.x, hvio cannot be zero.
  754.  
  755.  
  756.  
  757.  
  758. VioGetMode
  759. ================================================================================
  760. This call returns the mode of the display.
  761.  
  762.  
  763. CALL SYNTAX
  764. -----------
  765.  
  766.  typedef struct _VIOMODEINFO {
  767.      USHORT cb;                    /* Length of the entire data structure  */
  768.      UCHAR  fbType;                /* Bit mask of mode being set           */
  769.      UCHAR  color;                 /* Number of colors (power of 2)        */
  770.      USHORT col;                   /* Number of text columns               */
  771.      USHORT row;                   /* Number of text rows                  */
  772.      USHORT hres;                  /* Horizontal resolution                */
  773.      USHORT vres;                  /* Vertical resolution                  */
  774.      UCHAR  fmt_ID;                /* Attribute format                     */
  775.      UCHAR  attrib;                /* Number of attributes                 */
  776.      USHORT resv;                  /* Reserved */
  777.      ULONG  buf_addr;              /* Video aperture address               */
  778.      ULONG  buf_length;            /* Video aperture length                */
  779.      ULONG  full_length;           /* Video state full save length         */
  780.      ULONG  partial_length;        /* Video state partial save length      */
  781.      PCH    ext_data_addr;         /* Extra data address                   */
  782.  } VIOMODEINFO;
  783.  typedef VIOMODEINFO far *PVIOMODEINFO;
  784.  
  785.  #define INCL_VIO
  786.  
  787.  APIRET   VioGetMode(ModeData, hvio);
  788.  
  789.  PVIOMODEINFO     ModeData;      /* Mode characteristics */
  790.  HVIO             hvio;     /* Vio handle */
  791.  
  792.  APIRET           rc;            /* return code */
  793.  
  794.  
  795. PARAMETERS
  796. ----------
  797.  
  798.   ModeData (PVIOMODEINFO) - input/output
  799.      Far address of a structure where mode characteristics are returned.
  800.  
  801.      length (USHORT)
  802.         Input parameter to VioGetMode.  Length specifies the length of the data
  803.         structure in bytes including Length itself.  The value specified on
  804.         input controls the amount of mode data returned.  The minimum structure
  805.         size required is 2 bytes.  The length is modified on output.
  806.  
  807.      type (UCHAR)
  808.         Mode characteristics bit mask:
  809.  
  810.         Bit       Description
  811.  
  812.         7-4       Reserved
  813.  
  814.         3         0 = VGA BIOS compatible modes
  815.                   1 = Native mode
  816.  
  817.         2         0 = Enable color burst
  818.                   1 = Disable color burst
  819.  
  820.         1         0 = Text mode
  821.                   1 = Graphics mode
  822.  
  823.         0         0 = Monochrome compatible mode
  824.                   1 = Other
  825.  
  826.      numcolors (UCHAR)
  827.         Number of colors defined as a power of 2. This is equivalent to the
  828.         number of color bits that define the color, for example:
  829.  
  830.         Value     Definition
  831.         0         Monochrome
  832.         1         2 colors
  833.         2         4 colors
  834.         4         16 colors
  835.         8         256 colors
  836.         16        64K colors
  837.         24        16M colors
  838.  
  839.      textcols (USHORT)
  840.         Number of text columns.
  841.  
  842.      textrows (USHORT)
  843.         Number of text rows.
  844.  
  845.      pelcols (USHORT)
  846.         Horizontal resolution, number of pel columns.
  847.  
  848.      pelrows (USHORT)
  849.         Vertical resolution, number of pel rows.
  850.  
  851.      Attribute Format (UCHAR)
  852.         Format of the attributes.
  853.  
  854.      Number of Attributes (UCHAR)
  855.         Number of attributes in a character cell.
  856.  
  857.      Buffer Address (ULONG)
  858.         Physical address of the physical display aperture.  This may be
  859.         zero for emulated video hardware.
  860.  
  861.      Buffer Length (ULONG)
  862.         Length of the physical display aperture.
  863.  
  864.      Full Buffer Size (ULONG)
  865.         Size of the buffer required for a full save of the video state.
  866.  
  867.      Partial Buffer Size (ULONG)
  868.         Size of the buffer required for a partial (pop-up) save of the
  869.         video state.
  870.  
  871.      Extended Data Area Address (PCH)
  872.         Virtual address to an extended mode data structure or zero if none.
  873.         The format of the extended mode data structure is determined by the
  874.         device driver and is unknown to OS/2.
  875.  
  876.   hvio (HVIO) - input
  877.      This must be zero unless the caller is a Presentation Manager application,
  878.      in which case it must be the value returned by VioGetPs.
  879.  
  880.  
  881. RETURNS
  882. -------
  883.      Return code descriptions are:
  884.  
  885.      0         NO_ERROR
  886.      436       ERROR_VIO_INVALID_HANDLE
  887.      438       ERROR_VIO_INVALID_LENGTH
  888.      465       ERROR_VIO_DETACHED
  889.  
  890.  
  891. REMARKS
  892. -------
  893.  
  894.  Refer to VioSetMode for examples.
  895.  
  896.  
  897.  
  898. VioGetOrigin
  899. ================================================================================
  900. Get the position at which the presentation space maps to the window
  901.  
  902.  
  903. CALL SYNTAX
  904. -----------
  905.  
  906.  #define INCL_VIO
  907.  
  908.  APIRET APIENTRY  VioGetOrg(PULONG Row, PULONG Column, HVIO hvio);
  909.  
  910.  
  911. PARAMETERS
  912. ----------
  913.  
  914.   Height (PULONG) - input
  915.      Location to return the topmost row shown in the window
  916.  
  917.   Width (PULONG) - input
  918.      Location to return the leftmost column shown in the window
  919.  
  920.   hvio (HVIO) - input
  921.      Vio presentation space handle.  This is either zero to indicate the
  922.      default Vio session, or a value returned by VioCreatePS.
  923.  
  924.  
  925. RETURNS
  926. -------
  927.      Return code descriptions are:
  928.  
  929.      0         NO_ERROR
  930.      436       ERROR_VIO_INVALID_HANDLE
  931.  
  932.  
  933. REMARKS
  934. -------
  935.  
  936. In OS/2 2.x, hvio cannot be zero.
  937.  
  938.  
  939. VioGetState
  940. ================================================================================
  941. This call returns the current settings of the palette registers, overscan
  942. (border) color, blink/background intensity switch, color registers, underline
  943. location, or target VioSetMode display configuration.
  944.  
  945.  
  946. CALL SYNTAX
  947. -----------
  948.  
  949.  typedef struct _VIOPALSTATE {
  950.      USHORT  cb;                   /* Length of this structure in bytes */
  951.      USHORT  type;                 /* Request type=0 get palette registers */
  952.      USHORT  iFirst;               /* First palette register to return */
  953.      USHORT  acolor[1];            /* Color value palette register */
  954.  } VIOPALSTATE;
  955.  typedef VIOPALSTATE far *PVIOPALSTATE;
  956.  
  957.  typedef struct _VIOOVERSCAN {
  958.      USHORT  cb;                   /* Length of this structure */
  959.      USHORT  type;                 /* Request type=1 get overscan
  960.                                      (border) color */
  961.      USHORT  color;                /* Color value */
  962.  } VIOOVERSCAN;
  963.  typedef VIOOVERSCAN far *PVIOOVERSCAN;
  964.  
  965.  typedef struct _VIOINTENSITY {
  966.      USHORT  cb;                   /* Length of this structure */
  967.      USHORT  type;                 /* Request type=2 get blink/background
  968.                                      intensity switch */
  969.      USHORT  fs;                   /* Value of blink/background switch */
  970.  } VIOINTENSITY;
  971.  typedef VIOINTENSITY far *PVIOINTENSITY;
  972.  
  973.  typedef struct _VIOCOLORREG {
  974.      USHORT  cb;
  975.      USHORT  type;
  976.      USHORT  firstcolorreg;
  977.      USHORT  numcolorregs;
  978.      PCH     colorregaddr;
  979.  } VIOCOLORREG;
  980.  typedef VIOCOLORREG far *PVIOCOLORREG;
  981.  
  982.  typedef struct _VIOSETULINELOC {
  983.      USHORT  cb;
  984.      USHORT  type;
  985.      USHORT  scanline;
  986.  } VIOSETULINELOC;
  987.  typedef VIOSETULINELOC far *PVIOSETULINELOC;
  988.  
  989.  typedef struct _VIOSETTARGET {
  990.      USHORT  cb;
  991.      USHORT  type;
  992.      USHORT  defaultalgorithm;
  993.  } VIOSETTARGET;
  994.  typedef VIOSETTARGET far *PVIOSETTARGET;
  995.  
  996.  #define INCL_VIO
  997.  
  998.  APIRET   VioGetState(PVOID RequestBlock, HVIO hvio);
  999.  
  1000.  
  1001. PARAMETERS
  1002. ----------
  1003.  
  1004.   RequestBlock (PVOID) - input/output
  1005.      Address of the video state structures consisting of six different
  1006.      structures depending on the request type:
  1007.  
  1008.      Type      Definition
  1009.      0         Get palette registers
  1010.      1         Get overscan (border) color
  1011.      2         Get blink/background intensity switch
  1012.      3         Get color registers
  1013.      4         Reserved
  1014.      5         Get the scan line for underlining
  1015.      6         Get target VioSetMode display configuration.
  1016.  
  1017.      The six structures, depending on request type, are:
  1018.  
  1019.      VIOPALSTATE
  1020.         length (USHORT) - input
  1021.            Length of structure, including length.
  1022.  
  1023.            38        Maximum valid value.
  1024.  
  1025.         type (USHORT) - input
  1026.            Request type 0 for palette registers.
  1027.  
  1028.         palette (USHORT) - input
  1029.            First palette register in the palette register sequence; must be
  1030.            specified in the range 0 through 15.  The palette registers are
  1031.            returned in sequential order.  The number returned is based upon
  1032.            length.
  1033.  
  1034.         color (USHORT*(length-6)/2) - output
  1035.            Color value for each palette register.  The maximum number of entries
  1036.            in the color value array is 16.
  1037.  
  1038.      VIOOVERSCAN
  1039.         length (USHORT) - input
  1040.            Length of structure, including length.
  1041.  
  1042.            6         Only valid value.
  1043.  
  1044.         type (USHORT) - input
  1045.            Request type 1 for overscan (border) color.
  1046.  
  1047.         color (USHORT) - input
  1048.            Color value.
  1049.  
  1050.      VIOINTENSITY
  1051.         length (USHORT) - input
  1052.            Length of structure, including length.
  1053.  
  1054.            6         Only valid value.
  1055.  
  1056.         type (USHORT) - input
  1057.            Request type 2 for blink/background intensity switch.
  1058.  
  1059.         switch (USHORT) - output
  1060.            Switch set as:
  1061.  
  1062.            Value     Definition
  1063.            0         Blinking foreground colors enabled.
  1064.            1         High intensity background colors enabled.
  1065.  
  1066.      VIOCOLORREG
  1067.         length (USHORT) - input
  1068.            Length of structure, including length.
  1069.  
  1070.            12        Length in bytes.
  1071.  
  1072.         type (USHORT) - input
  1073.            Request type 3 for color registers.
  1074.  
  1075.         first color (USHORT) - input
  1076.            First color register to get in the color register sequence; must be
  1077.            specified in the range 0 through 255.  The color registers are
  1078.            returned in sequential order.
  1079.  
  1080.         number color (USHORT) - input
  1081.            Number of color registers to get; must be specified in the range 1
  1082.            through 256.
  1083.  
  1084.         datarea (PCH) - input
  1085.            Far address of a data area where the color registers are returned.
  1086.            The size of the data area must be three bytes times the number of
  1087.            color registers to get.  The format of each entry returned is as
  1088.            follows:
  1089.  
  1090.            Byte 1    Red value
  1091.            Byte 2    Green value
  1092.            Byte 3    Blue value
  1093.  
  1094.      VIOSETULINELOC
  1095.         length (USHORT) - input
  1096.            Length of structure, including length.
  1097.  
  1098.            6         Length in bytes.
  1099.  
  1100.         type (USHORT) - input
  1101.            Request type 5 to get the scan line for underlining.
  1102.  
  1103.         scanline (USHORT) - output
  1104.            The value returned is in the range 0 through 31 and is the scan line
  1105.            minus 1. A value of 32 means underlining is disabled.
  1106.  
  1107.      VIOSETTARGET
  1108.  
  1109.         length (USHORT) - input
  1110.            Length of structure, including length.
  1111.  
  1112.            6         Length in bytes.
  1113.  
  1114.         type (USHORT) - input
  1115.            Request type 6 to get display configuration selected to be the target
  1116.            of the next VioSetMode.
  1117.  
  1118.         select (USHORT) - output
  1119.            Configuration:
  1120.  
  1121.            Value     Definition
  1122.            0         Default selection algorithm. See VioSetMode.
  1123.            1         Primary
  1124.            2         Secondary.
  1125.  
  1126.   hvio (HVIO) - input
  1127.      Reserved value, must be zero.
  1128.  
  1129.  
  1130. RETURNS
  1131. -------
  1132.      Return code descriptions are:
  1133.  
  1134.      0         NO_ERROR
  1135.      355       ERROR_VIO_MODE
  1136.      421       ERROR_VIO_INVALID_PARMS
  1137.      436       ERROR_VIO_INVALID_HANDLE
  1138.      438       ERROR_VIO_INVALID_LENGTH
  1139.      465       ERROR_VIO_DETACHED
  1140.  
  1141.  
  1142. REMARKS
  1143. -------
  1144.  
  1145. Note: VioGetState allows access to hardware dependent features.  Not all
  1146. video hardware will honor these settings, or return valid settings.
  1147.  
  1148.  
  1149. VioModeUndo
  1150. ================================================================================
  1151. This call allows one thread within a process to cancel a VioModeWait issued by
  1152. another thread within the same process.
  1153.  
  1154.  
  1155. CALL SYNTAX
  1156. -----------
  1157.  
  1158.  #define INCL_VIO
  1159.  
  1160.  APIRET   VioModeUndo(ULONG OwnerIndic, ULONG KillIndic, ULONG Reserved);
  1161.  
  1162.  
  1163. PARAMETERS
  1164. ----------
  1165.  
  1166.   OwnerIndic (ULONG) - input
  1167.      Indicates whether the thread issuing VioModeUndo wants ownership of
  1168.      VioModeWait to be reserved for its process.
  1169.  
  1170.      Value     Definition
  1171.      0         Reserve ownership
  1172.      1         Give up ownership.
  1173.  
  1174.   KillIndic (ULONG) - input
  1175.      Indicates whether the thread (with the outstanding VioModeWait) should be
  1176.      returned an error code or be terminated.
  1177.  
  1178.      Value     Definition
  1179.      0         Return error code
  1180.      1         Terminate thread.
  1181.  
  1182.   Reserved (ULONG) - input
  1183.      Reserved value, must be zero
  1184.  
  1185.  
  1186. RETURNS
  1187. -------
  1188.      Return code descriptions are:
  1189.  
  1190.      0         NO_ERROR
  1191.      421       ERROR_VIO_INVALID_PARMS
  1192.      422       ERROR_VIO_FUNCTION_OWNED
  1193.      427       ERROR_VIO_NO_MODE_THREAD
  1194.      430       ERROR_VIO_ILLEGAL_DURING_POPUP
  1195.      465       ERROR_VIO_DETACHED
  1196.      486       ERROR_VIO_BAD_RESERVE
  1197.  
  1198.  
  1199. REMARKS
  1200. -------
  1201.  
  1202. VioModeUndo may be issued only by a thread within the process that owns
  1203. VioModeWait.  The thread issuing VioModeUndo can either reserve ownership of the
  1204. VioModeWait function for its process or give up ownership.  The thread whose
  1205. VioModeWait is cancelled is optionally terminated.
  1206.  
  1207.  
  1208.  
  1209. VioModeWait
  1210. ================================================================================
  1211. This call allows a graphics mode application to be notified when it must restore
  1212. its video mode, state, and modified display adapter registers.  The return from
  1213. this function call provides the notification.
  1214.  
  1215.  
  1216. CALL SYNTAX
  1217. -----------
  1218.  #define INCL_VIO
  1219.  
  1220.  APIRET   VioModeWait(ULONG RequestType, ULONG NotifyType, ULONG Reserved);
  1221.  
  1222.  
  1223. PARAMETERS
  1224. ----------
  1225.  
  1226.   RequestType (ULONG) - input
  1227.      Application request event.  RequestType = 0 indicates the application wants
  1228.      to be notified at the end of a pop-up to restore its mode.  RequestType = 0
  1229.      is the only event supported by VioModeWait.
  1230.  
  1231.   NotifyType (PULONG) - output
  1232.      Address of the operation to be performed by the application returning from
  1233.      VioModeWait.  NotifyType = 0, indicating restore mode, is the only type of
  1234.      notification returned.
  1235.  
  1236.   Reserved (ULONG) - input
  1237.      Reserved value, must be zero.
  1238.  
  1239.  
  1240. RETURNS
  1241. -------
  1242.      Return code descriptions are:
  1243.  
  1244.      0         NO_ERROR
  1245.      421       ERROR_VIO_INVALID_PARMS
  1246.      422       ERROR_VIO_FUNCTION_OWNED
  1247.      423       ERROR_VIO_RETURN
  1248.      424       ERROR_SCS_INVALID_FUNCTION
  1249.      428       ERROR_VIO_NO_SAVE_RESTORE_THD
  1250.      430       ERROR_VIO_ILLEGAL_DURING_POPUP
  1251.      465       ERROR_VIO_DETACHED
  1252.  
  1253.  
  1254. REMARKS
  1255. -------
  1256.  
  1257. At the completion of an application or hard error pop-up (reference VioPopUp),
  1258. OS/2 notifies the session that was originally interrupted for the pop-up to
  1259. restore its mode.  The return from this function call provides that
  1260. notification.  The thread that issued the call must perform the restore and then
  1261. immediately re-issue VioModeWait.
  1262.  
  1263. When an application's VioModeWait thread is notified, the thread must restore
  1264. its video mode, state, and modified display adapter registers.  An application's
  1265. VioModeWait thread does not restore the physical display buffer.  OS/2
  1266. saves/restores the physical display buffer over a pop-up.
  1267.  
  1268. Only one process for a session can issue VioModeWait.  The first process that
  1269. issues VioModeWait becomes the owner of this function.  (Refer to VioModeUndo.)
  1270.  
  1271. An application must issue VioModeWait only if it writes directly to the
  1272. registers on the display adapter.  Otherwise, the application can allow OS/2 to
  1273. perform the required restore by not issuing VioModeWait.
  1274.  
  1275. When an application issues VioModeWait, it is also required to issue
  1276. VioSavRedrawWait to be notified at screen switch time to perform a full save or
  1277. restore (reference VioSavRedrawWait.  Two application threads must be dedicated
  1278. to performing these operations.
  1279.  
  1280.  
  1281.  
  1282. VioPopUp
  1283. ================================================================================
  1284. This call is issued by an application process when it requires a temporary
  1285. screen to display a momentary message to the user.
  1286.  
  1287.  
  1288. CALL SYNTAX
  1289. -----------
  1290.  
  1291.  #define INCL_VIO
  1292.  
  1293.  APIRET   VioPopUp(PUSHORT Options, HVIO hvio);
  1294.  
  1295.  
  1296. PARAMETERS
  1297. ----------
  1298.  
  1299.   Options (PULONG) - input
  1300.      Address of the bit flags that indicate which options to the application are
  1301.      being selected.
  1302.  
  1303.      Bit       Description
  1304.  
  1305.      31-2      Reserved, set to zero.
  1306.  
  1307.      1         0 = Non-transparent operation.  The video mode is set to a
  1308.                textmode.  The screen is clreaded, and the cusor is positioned
  1309.                at the upper left corner of the screen.
  1310.  
  1311.                1 = Transparent operation.  If the video mode of the outgoing
  1312.                foreground session is a textmode no mode change occurs.  The
  1313.                screen is not cleared, and the cursor remains at its current
  1314.                position.  If the video mode is not text, or if this session
  1315.                has a VioSaveRedrawWait active, the pop-up is refused.
  1316.  
  1317.                OS/2 is responsible for saving and restoring the physical display
  1318.                buffer of the previous foreground session around a pop-up.  This
  1319.                is true whether transparent or non-transparent operation is
  1320.                selected.
  1321.  
  1322.      0         0 = Return with unique error code ERROR_VIO_EXISTING_POPUP if
  1323.                pop-up is not immediately available.
  1324.  
  1325.                1 = Wait if pop-up is not immediately available.
  1326.  
  1327.   hvio (HVIO) - input
  1328.      Reserved value, must be zero.
  1329.  
  1330.  
  1331. RETURNS
  1332. -------
  1333.      Return code descriptions are:
  1334.  
  1335.      0         NO_ERROR
  1336.      405       ERROR_VIO_NO_POPUP
  1337.      406       ERROR_VIO_EXISTING_POPUP
  1338.      483       ERROR_VIO_TRANSPARENT_POPUP
  1339.  
  1340.  
  1341. REMARKS
  1342. -------
  1343.  
  1344. VioPopUp is normally issued by the application when it is running in the
  1345. background and wishes to immediately display a message to the user without
  1346. waiting to become the active foreground session.
  1347.  
  1348. When an application process issues VioPopUp, it should wait for the return from
  1349. the request.  If the process allows any of its threads to write to the screen
  1350. before VioPopUp returns a successful return code, the screen output may be
  1351. directed to the application's normal video buffer rather than to the pop-up
  1352. screen.  If the process allows any of its threads to issue keyboard or mouse
  1353. calls before VioPopUp returns a successful return code, the input is directed
  1354. from the application's normal session.  Once the process that issued VioPopUp
  1355. receives a successful return code, video and keyboard calls issued by any of the
  1356. threads in the pop-up process are directed to the pop-up screen.  This continues
  1357. until the process issues VioEndPopUp.  At that time video and keyboard calls
  1358. resume being directed to the application's normal video buffer.
  1359.  
  1360. There may be only one pop-up in existence at any time.  If a process requests a
  1361. pop-up and a pop-up already exists, the process has the choice of waiting for
  1362. the prior pop-up to complete or receiving an immediate return with an error
  1363. code.  The error code indicates that the operation failed due to an existing
  1364. pop-up having captured the screen.
  1365.  
  1366. Video pop-ups provide a mechanism for a background application to notify the
  1367. operator of an abnormal event the operator must take some action.  When
  1368. considering the suitability of using pop-ups in a particular situation, the
  1369. possible disruptive effect of pop-ups to the operator should be considered.  If
  1370. the operator were interrupted frequently by pop-ups issued by background
  1371. applications, the operator would not effectively work with the foreground
  1372. application.
  1373.  
  1374. While a video pop-up is in the foreground, the operator cannot use the hot key
  1375. to switch to another application or to the shell . Before the operator can
  1376. switch another application or the shell to the foreground, the pop-up
  1377. application must issue VioEndPopUp.
  1378.  
  1379. While a video pop-up is in effect, all video calls from the previous foreground
  1380. session are blocked until the process that issued VioPopUp issues VioEndPopUp.
  1381.  
  1382. When VioPopUp is issued, only the process within the session that issued
  1383. VioPopUp is brought to the foreground.  Assuming the session was already the
  1384. foreground session, any video calls issued by other processes in that session
  1385. are blocked until the process that issued VioPopUp issues VioEndPopUp.
  1386.  
  1387. DosExecPgm may not be issued by a process during a pop-up.  The following video
  1388. calls are the only calls that may be issued during the pop-up by the process
  1389. that issued VioPopUp:
  1390.  
  1391.   VioEndPopUp         VioScrollLeft
  1392.   VioGetConfig        VioSetCurPos
  1393.   VioGetCp            VioSetCurType
  1394.   VioGetAnsi          VioSetCp
  1395.   VioGetState         VioSetState
  1396.   VioGetCurPos        VioWrtNChar
  1397.   VioGetCurType       VioWrtNAttr
  1398.   VioGetMode          VioWrtNCell
  1399.   VioReadCharStr      VioWrtCharStr
  1400.   VioReadCellStr      VioWrtCharStrAttr
  1401.   VioScrollRight      VioWrtCellStr
  1402.   VioScrollUp         VioWrtTTY
  1403.   VioScrollDown
  1404.  
  1405. This function can be used from within a PM application.  Kbdxxx, Mouxxx, and
  1406. Vioxxx calls with a zero handle are all allowed between VioPopUp and
  1407. VioEndPopUp, and are directed to the pop-up screen.
  1408.  
  1409.  
  1410.  
  1411. VioQueryFonts
  1412. ================================================================================
  1413. Get the position at which the presentation space maps to the window
  1414.  
  1415.  
  1416. CALL SYNTAX
  1417. -----------
  1418.  
  1419.  #define INCL_VIO
  1420.  
  1421.  APIRET APIENTRY  VioQueryFonts(PULONG Remfonts, PFONTMETRICS Metrics,
  1422.                                 ULONG Metlen, PULONG Fonts,
  1423.                                 PSZ Facename, ULONG Options, HVIO hvio);
  1424.  
  1425.  
  1426. PARAMETERS
  1427. ----------
  1428.  
  1429.   Remfonts (ULONG) - output
  1430.      Number of fonts for which information is not returned.
  1431.  
  1432.   Metrics (PFONTMETRICS) - output
  1433.      Font metrics.  Matching font metrics are returned in this buffer.
  1434.  
  1435.   Metlen (ULONG) - input
  1436.      The maximum length of data to be returned for each record.
  1437.  
  1438.   Fonts (PULONG) - input/output
  1439.      Location of the number of fonts to be returned on input.  This is
  1440.      updated with the actual number of fonts returned on output.
  1441.  
  1442.   Facename (PSZ) - input
  1443.      The facename of fonts desired, or NULL to indicate that all
  1444.      applicable fonts should be returned.
  1445.  
  1446.   Options (BIT32) - input
  1447.      This controls which fonts are selected:
  1448.      VQF_PUBLIC  - Return only public fonts
  1449.      VQF_PRIVATE - Return only private fonts
  1450.      VQF_ALL     - Return both public and private fonts
  1451.  
  1452.   hvio (HVIO) - input
  1453.      Vio presentation space handle.  This is either zero to indicate the
  1454.      default Vio session, or a value returned by VioCreatePS.
  1455.  
  1456.  
  1457. RETURNS
  1458. -------
  1459.      Return code descriptions are:
  1460.  
  1461.      0         NO_ERROR
  1462.      436       ERROR_VIO_INVALID_HANDLE
  1463.  
  1464.  
  1465. REMARKS
  1466. -------
  1467.  
  1468. By inspecting the returned font metrics, the application may choose the
  1469. font which best meets its requirements.
  1470.  
  1471. All metrics are returned in pel coordinates.
  1472.  
  1473. In OS/2 2.x, hvio cannot be zero.
  1474.  
  1475.  
  1476. VioQuerySetIds
  1477. ================================================================================
  1478. Query the list of local identifiers
  1479.  
  1480.  
  1481. CALL SYNTAX
  1482. -----------
  1483.  
  1484.  #define INCL_VIO
  1485.  
  1486.  APIRET APIENTRY  VioQuerySetIds(PULONG lcids, PSTR8 Names,
  1487.                                  PULONG Types, ULONG count, HVIO hvio);
  1488.  
  1489.  
  1490. PARAMETERS
  1491. ----------
  1492.  
  1493.   lcids (PULONG) - output
  1494.      An array of local identifiers output
  1495.  
  1496.   Names (PSTR8) - output
  1497.      An array of 8 character names associated with the lcids.
  1498.  
  1499.   Types (ULONG) - output
  1500.      An array of types accociated with each lcid
  1501.  
  1502.   count (PULONG) - input
  1503.      The number of objects to be queried.  The maximum value in use is 3.
  1504.  
  1505.   hvio (HVIO) - input
  1506.      Vio presentation space handle.  This is either zero to indicate the
  1507.      default Vio session, or a value returned by VioCreatePS.
  1508.  
  1509.  
  1510. RETURNS
  1511. -------
  1512.      Return code descriptions are:
  1513.  
  1514.      0         NO_ERROR
  1515.      436       ERROR_VIO_INVALID_HANDLE
  1516.  
  1517.  
  1518. REMARKS
  1519. -------
  1520.  
  1521. In OS/2 2.x, hvio cannot be zero.
  1522.  
  1523.  
  1524.  
  1525. VioReadCellStr
  1526. ================================================================================
  1527. This call reads a string of character-attribute pairs (cells) from the screen,
  1528. starting at the specified location.
  1529.  
  1530.  
  1531. CALL SYNTAX
  1532. -----------
  1533.  
  1534.  #define INCL_VIO
  1535.  
  1536.  APIRET   VioReadCellStr(PCH CellStr, PULONG Length, ULONG Row,
  1537.                          ULONG Column, HVIO hvio);
  1538.  
  1539.  
  1540. PARAMETERS
  1541. ----------
  1542.  
  1543.   CellStr (PCH) - output
  1544.      Address of the buffer where the cell string is returned.
  1545.  
  1546.   Length (PULONG) - input/output
  1547.      Address of the buffer length in bytes.  Length must take into account that
  1548.      each character-attribute(s) entry in the buffer is 2 or 4 bytes.  If the
  1549.      length of the buffer is not sufficient, the last entry is not complete.
  1550.  
  1551.   Row (ULONG) - input
  1552.      Starting row of the field to read, 0 is the top row.
  1553.  
  1554.   Column (ULONG) - input
  1555.      Starting column of the field to read, 0 is the leftmost column.
  1556.  
  1557.   hvio (HVIO) - input
  1558.      This must be zero unless the caller is a Presentation Manager application,
  1559.      in which case it must be the value returned by VioGetPs.
  1560.  
  1561.  
  1562. RETURNS
  1563. -------
  1564.      Return code descriptions are:
  1565.  
  1566.      0         NO_ERROR
  1567.      355       ERROR_VIO_MODE
  1568.      358       ERROR_VIO_ROW
  1569.      359       ERROR_VIO_COL
  1570.      436       ERROR_VIO_INVALID_HANDLE
  1571.      465       ERROR_VIO_DETACHED
  1572.  
  1573.  
  1574. REMARKS
  1575. -------
  1576.  
  1577. If a string read comes to the end of the line and is not complete, the string
  1578. read continues at the beginning of the next line.  If the read comes to the end
  1579. of the screen and is not complete, the read terminates and the length is set to
  1580. the length of the buffer that was filled.
  1581.  
  1582.  
  1583.  
  1584. VioReadCharStr
  1585. ================================================================================
  1586. This call reads a string of characters from the display starting at the
  1587. specified location.
  1588.  
  1589.  
  1590. CALL SYNTAX
  1591. -----------
  1592.  
  1593.  #define INCL_VIO
  1594.  
  1595.  APIRET   VioReadCharStr(PCH CharStr, PULONG Length, ULONG Row, ULONG Column,
  1596.                          HVIO hvio);
  1597.  
  1598.  
  1599. PARAMETERS
  1600. ----------
  1601.  
  1602.   CharStr (PCH) - output
  1603.      Address of the buffer where the character string is returned.
  1604.  
  1605.   Length (PULONG) - input/output
  1606.      Address of the buffer length in bytes.
  1607.  
  1608.   Row (ULONG) - input
  1609.      Starting row of the field to read, 0 is the top row.
  1610.  
  1611.   Column (ULONG) - input
  1612.      Starting column of the field to read, 0 is the leftmost column.
  1613.  
  1614.   hvio (HVIO) - input
  1615.      This must be zero unless the caller is a Presentation Manager application,
  1616.      in which case it must be the value returned by VioGetPs.
  1617.  
  1618.  
  1619. RETURNS
  1620. -------
  1621.      Return code descriptions are:
  1622.  
  1623.      0         NO_ERROR
  1624.      355       ERROR_VIO_MODE
  1625.      358       ERROR_VIO_ROW
  1626.      359       ERROR_VIO_COL
  1627.      436       ERROR_VIO_INVALID_HANDLE
  1628.      465       ERROR_VIO_DETACHED
  1629.  
  1630.  
  1631. REMARKS
  1632. -------
  1633.  
  1634. If a string read comes to the end of the line and is not complete, then the
  1635. string read continues at the beginning of the next line.  If the read comes to
  1636. the end of the screen and is not complete, the read terminates and the length is
  1637. set to the number of characters read.
  1638.  
  1639.  
  1640.  
  1641. VioSavRedrawUndo
  1642. ================================================================================
  1643. This call allows one thread within a process to cancel a VioSavRedrawWait issued
  1644. by another thread within the same process.
  1645.  
  1646.  
  1647. CALL SYNTAX
  1648. -----------
  1649.  
  1650.  #define INCL_VIO
  1651.  
  1652.  APIRET   VioSavRedrawUndo(ULONG OwnerIndic, ULONG KillIndic, HVIO hvio);
  1653.  
  1654.  
  1655. PARAMETERS
  1656. ----------
  1657.  
  1658.   OwnerIndic (ULONG) - input
  1659.      Indicates whether the thread issuing VioSavRedrawUndo wants ownership of
  1660.      VioSavRedrawWait to be reserved for its process.
  1661.  
  1662.      Value     Definition
  1663.      0         Reserve ownership
  1664.      1         Give up ownership.
  1665.  
  1666.   KillIndic (ULONG) - input
  1667.      Indicates whether the thread with the outstanding VioSavRedrawWait should
  1668.      be returned an error code or be terminated.
  1669.  
  1670.      Value     Definition
  1671.      0         Return error code
  1672.      1         Terminate thread.
  1673.  
  1674.   hvio (HVIO) - input
  1675.      Reserved value, must be zero.
  1676.  
  1677.  
  1678. RETURNS
  1679. -------
  1680.      Return code descriptions are:
  1681.  
  1682.      0         NO_ERROR
  1683.      421       ERROR_VIO_INVALID_PARMS
  1684.      422       ERROR_VIO_FUNCTION_OWNED
  1685.      428       ERROR_VIO_NO_SAVE_RESTORE_THD
  1686.      430       ERROR_VIO_ILLEGAL_DURING_POPUP
  1687.      465       ERROR_VIO_DETACHED
  1688.  
  1689.  
  1690. REMARKS
  1691. -------
  1692.  
  1693. The issuing thread can reserve ownership of VioSavRedrawWait for its process or
  1694. give it up.  The thread whose VioSavRedrawWait was cancelled is optionally
  1695. terminated.  VioSavRedrawUndo may be issued only by a thread within the same
  1696. process that owns VioSavRedrawWait.
  1697.  
  1698.  
  1699.  
  1700. VioSavRedrawWait
  1701. ================================================================================
  1702. This call notifies a graphics mode application when it must save or redraw its
  1703. screen image.
  1704.  
  1705.  
  1706. CALL SYNTAX
  1707. -----------
  1708.  
  1709.  #define INCL_VIO
  1710.  
  1711.  APIRET   VioSavRedrawWait(ULONG SavRedrawIndic, ULONG NotifyType, HVIO hvio);
  1712.  
  1713.  
  1714. PARAMETERS
  1715. ----------
  1716.  
  1717.   SavRedrawIndic (ULONG) - input
  1718.      Indicates which events the application is waiting for:
  1719.  
  1720.      Value     Definition
  1721.      0         The session manager notifies the application for both save
  1722.                and redraw operations.
  1723.      1         The session manager notifies the application for redraw
  1724.                 operations only.
  1725.  
  1726.   NotifyType (PULONG) - output
  1727.      Address that specifies the operation to be performed by the application
  1728.      upon return from VioSavRedrawWait:
  1729.  
  1730.      Value     Definition
  1731.      0         Save screen image
  1732.      1         Restore screen image.
  1733.  
  1734.   hvio (HVIO) - input
  1735.      Reserved value, must be zero.
  1736.  
  1737.  
  1738. RETURNS
  1739. -------
  1740.      Return code descriptions are:
  1741.  
  1742.      0         NO_ERROR
  1743.      421       ERROR_VIO_INVALID_PARMS
  1744.      422       ERROR_VIO_FUNCTION_OWNED
  1745.      423       ERROR_VIO_RETURN
  1746.      430       ERROR_VIO_ILLEGAL_DURING_POPUP
  1747.      436       ERROR_VIO_INVALID_HANDLE
  1748.      465       ERROR_VIO_DETACHED
  1749.  
  1750.  
  1751. REMARKS
  1752. -------
  1753.  
  1754. OS/2 uses VioSavRedrawWait to notify a graphics mode application to save or
  1755. restore its screen image at screen switch time.  The application in the outgoing
  1756. foreground session is notified to perform a save.  The application in the
  1757. incoming foreground session is notified to perform a restore.  The application
  1758. must perform the action requested and immediately re-issue VioSavRedrawWait.
  1759. When an application performs a save, it saves its physical display buffer, video
  1760. mode, and any other information the application needs to completely redraw its
  1761. screen at restore time.
  1762.  
  1763. Only one process per session can issue VioSavRedrawWait.  The process that first
  1764. issues VioSavRedrawWait becomes the owner of the function.
  1765.  
  1766. A text mode application must issue VioSavRedrawWait only if the application
  1767. writes directly to the registers on the display adapter.  Assuming
  1768. VioSavRedrawWait is not issued by a text mode application, OS/2 performs the
  1769. required saves and restores.
  1770.  
  1771. An application that issues VioSavRedrawWait may also need to issue VioModeWait.
  1772. This would allow the application to be notified when it must restore its mode at
  1773. the completion of an application or hard error pop-up.  Refer to VioModeWait for
  1774. more information.  Two application threads would be required to perform these
  1775. operations in this case.
  1776.  
  1777. At the time a VioSavRedrawWait thread is notified, the session is in transition
  1778. to/from the background.  Although the session's official status is background,
  1779. any selector to the physical display buffer previously obtained by the
  1780. VioSavRedrawWait process (through VioGetPhysBuf) is valid at this time.  The
  1781. physical display buffer must be accessed without issuing VioScrLock.  Since the
  1782. session's official status is background, any thread waits if it issues
  1783. VioScrLock with the "wait if unsuccessful" option.
  1784.  
  1785. An application containing a VioSavRedrawWait thread should be designed so that
  1786. the process does not cause any hard errors while the VioSavRedrawWait thread is
  1787. running, otherwise a system lockout may occur.
  1788.  
  1789. An application's VioSavRedrawWait thread may be notified to perform a restore
  1790. before it is notified to perform a save.  This happens if the application was
  1791. running in the background the first time it issued VioSavRedrawWait.  The return
  1792. from this function call provides the notification.  The thread that issues the
  1793. call performs the save or redraw and then reissues VioSavRedrawWait to wait
  1794. until its screen image must be saved or redrawn again.
  1795.  
  1796.  
  1797.  
  1798. VioScrLock
  1799. ================================================================================
  1800. This call requests ownership of (locks) the physical display buffer.
  1801.  
  1802.  
  1803. CALL SYNTAX
  1804. -----------
  1805.  
  1806.  #define INCL_VIO
  1807.  
  1808.  APIRET   VioScrLock(ULONG WaitFlag, PUCHAR Status, HVIO hvio);
  1809.  
  1810.  
  1811. PARAMETERS
  1812. ----------
  1813.  
  1814.   WaitFlag (ULONG) - input
  1815.      Indicates whether the process should block until the screen I/O can
  1816.      take place.
  1817.  
  1818.      Value     Definition
  1819.      0         Return if screen I/O not available
  1820.      1         Wait until screen I/O is available.
  1821.  
  1822.   Status (PUCHAR) - output
  1823.      Address of the Indicator of whether the lock is successful, described
  1824.      below.
  1825.  
  1826.      Value     Definition
  1827.      0         Lock successful
  1828.      1         Lock unsuccessful (in the case of no wait).
  1829.  
  1830.                Status is returned only when AX = 0.
  1831.  
  1832.                Status = 1 may be returned only when WaitFlag = 0.
  1833.  
  1834.   hvio (HVIO) - input
  1835.      Reserved value, must be zero.
  1836.  
  1837.  
  1838. RETURNS
  1839. -------
  1840.      Return code descriptions are:
  1841.  
  1842.      0         NO_ERROR
  1843.      366       ERROR_VIO_WAIT_FLAG
  1844.      430       ERROR_VIO_ILLEGAL_DURING_POPUP
  1845.      434       ERROR_VIO_LOCK
  1846.      436       ERROR_VIO_INVALID_HANDLE
  1847.      465       ERROR_VIO_DETACHED
  1848.  
  1849.  
  1850. REMARKS
  1851. -------
  1852.  
  1853. This function call permits a process to determine if I/O to the physical screen
  1854. buffer can take place.  This prevents the process from writing to the physical
  1855. buffer when the process is in the background.  Processes must cooperate with the
  1856. system in coordinating screen accesses.
  1857.  
  1858. Screen switching is disabled while the screen lock is in place.  If a screen
  1859. switch is suspended by a screen lock, and if the application holding the lock
  1860. does not issue VioScrUnLock within a system-defined time limit, the screen
  1861. switch occurs, and the process holding the lock is frozen in the background.  A
  1862. process should yield the screen lock as soon as possible to avoid being frozen
  1863. when running in the background.  The timeout on the lock does not begin until a
  1864. screen switch is requested.
  1865.  
  1866. When the screen lock is in effect and another thread in the same or different
  1867. process (in the same session) issues VioScrLock, the second thread receives an
  1868. error code.  VioScrUnLock must be issued by a thread within the same process
  1869. that issued VioScrLock.
  1870.  
  1871.  
  1872. VioScrollDown
  1873. ================================================================================
  1874. This call scrolls the entire display buffer (or area specified within the
  1875. display buffer) down.
  1876.  
  1877.  
  1878. CALL SYNTAX
  1879. -----------
  1880.  
  1881.  #define INCL_VIO
  1882.  
  1883.  APIRET   VioScrollDown(ULONG TopRow, ULONG LeftCol, ULONG BotRow,
  1884.                         ULONG RightCol, ULONG Lines, PBYTE Cell, HVIO hvio);
  1885.  
  1886.  
  1887. PARAMETERS
  1888. ----------
  1889.  
  1890.   TopRow (ULONG) - input
  1891.      Top row to be scrolled.
  1892.  
  1893.   LeftCol (ULONG) - input
  1894.      Left column to be scrolled.
  1895.  
  1896.   BotRow (ULONG) - input
  1897.      Bottom row to be scrolled.
  1898.  
  1899.   RightCol (ULONG) - input
  1900.      Right column to be scrolled.
  1901.  
  1902.   Lines (ULONG) - input
  1903.      Number of lines to be inserted at the top of the screen area being
  1904.      scrolled.  If 0 is specified, no lines are scrolled.
  1905.  
  1906.   Cell (PBYTE) - input
  1907.      Address of the character-attribute(s) pair (2 or 4 bytes) used as a fill
  1908.      character on inserted lines.
  1909.  
  1910.   hvio (HVIO) - input
  1911.      This must be zero unless the caller is a Presentation Manager application,
  1912.      in which case it must be the value returned by VioGetPs.
  1913.  
  1914.  
  1915. RETURNS
  1916. -------
  1917.      Return code descriptions are:
  1918.  
  1919.      0         NO_ERROR
  1920.      355       ERROR_VIO_MODE
  1921.      358       ERROR_VIO_ROW
  1922.      359       ERROR_VIO_COL
  1923.      436       ERROR_VIO_INVALID_HANDLE
  1924.      465       ERROR_VIO_DETACHED
  1925.  
  1926.  
  1927. REMARKS
  1928. -------
  1929.  
  1930. TopRow = 0 and LeftCol = 0 identifies the top left corner of the screen.
  1931.  
  1932. If a value greater than the maximum value is specified for TopRow, LeftCol,
  1933. BotRow, RightCol, or Lines, the maximum value for that parameter is used.
  1934.  
  1935. If TopRow and LeftCol = 0 and if BotRow, RightCol, and Lines is greater than
  1936. the screen lines, the entire screen is filled with the character-attribute
  1937. pair defined by Cell.
  1938.  
  1939.  
  1940.  
  1941. VioScrollLeft
  1942. ================================================================================
  1943. This call scrolls the entire display buffer (or area specified within the
  1944. display buffer) to the left.
  1945.  
  1946.  
  1947.  
  1948. CALL SYNTAX
  1949. -----------
  1950.  
  1951.  #define INCL_VIO
  1952.  
  1953.  APIRET   VioScrollLeft(ULONG TopRow, ULONG LeftCol, ULONG BotRow,
  1954.                         ULONG RightCol, ULONG Lines, PBYTE Cell, HVIO hvio);
  1955.  
  1956.  
  1957.  
  1958. PARAMETERS
  1959. ----------
  1960.  
  1961.   TopRow (ULONG) - input
  1962.      Top row to be scrolled.
  1963.  
  1964.   LeftCol (ULONG) - input
  1965.      Left column to be scrolled.
  1966.  
  1967.   BotRow (ULONG) - input
  1968.      Bottom row to be scrolled.
  1969.  
  1970.   RightCol (ULONG) - input
  1971.      Right column to be scrolled.
  1972.  
  1973.   Lines (ULONG) - input
  1974.      Number of columns to be inserted at the right of the screen area being
  1975.      scrolled.  If 0 is specified, no lines are scrolled.
  1976.  
  1977.   Cell (PBYTE) - input
  1978.      Address of the character attribute(s) pair (2 or 4 bytes) used as a fill
  1979.      character on inserted columns.
  1980.  
  1981.   hvio (HVIO) - input
  1982.      This must be zero unless the caller is a Presentation Manager application,
  1983.      in which case it must be the value returned by VioGetPs.
  1984.  
  1985.  
  1986. RETURNS
  1987. -------
  1988.      Return code descriptions are:
  1989.  
  1990.      0         NO_ERROR
  1991.      355       ERROR_VIO_MODE
  1992.      358       ERROR_VIO_ROW
  1993.      359       ERROR_VIO_COL
  1994.      436       ERROR_VIO_INVALID_HANDLE
  1995.      465       ERROR_VIO_DETACHED
  1996.  
  1997.  
  1998. REMARKS
  1999. -------
  2000.  
  2001. TopRow = 0 and LeftCol = 0 identifies the top left corner of the screen.
  2002.  
  2003. If a value greater than the maximum value is specified for TopRow, LeftCol,
  2004. BotRow, RightCol, or Lines, the maximum value for that parameter is used.
  2005.  
  2006. If TopRow and LeftCol = 0 and if BotRow, RightCol, and Lines is greater than
  2007. the screen lines, the entire screen is filled with the character-attribute
  2008. pair defined by Cell.
  2009.  
  2010.  
  2011.  
  2012. VioScrollRight
  2013. ================================================================================
  2014. This call scrolls the entire display buffer (or area specified within the
  2015. display buffer) to the right.
  2016.  
  2017.  
  2018. CALL SYNTAX
  2019. -----------
  2020.  
  2021.  #define INCL_VIO
  2022.  
  2023.  APIRET   VioScrollRight(ULONG TopRow, ULONG LeftCol, ULONG BotRow,
  2024.                         ULONG RightCol, ULONG Lines, PBYTE Cell, HVIO hvio);
  2025.  
  2026. PARAMETERS
  2027. ----------
  2028.  
  2029.   TopRow (ULONG) - input
  2030.      Top row to be scrolled.
  2031.  
  2032.   LeftCol (ULONG) - input
  2033.      Left column to be scrolled.
  2034.  
  2035.   BotRow (ULONG) - input
  2036.      Bottom row to be scrolled.
  2037.  
  2038.   RightCol (ULONG) - input
  2039.      Right column to be scrolled.
  2040.  
  2041.   Lines (ULONG) - input
  2042.      Number of columns to be inserted at the left of the screen area being
  2043.      scrolled.  If 0 is specified, no lines are scrolled.
  2044.  
  2045.   Cell (PBYTE) - input
  2046.      Address of the character attribute(s) pair (2 or 4 bytes) used as a fill
  2047.      character on inserted columns.
  2048.  
  2049.   hvio (HVIO) - input
  2050.      This must be zero unless the caller is a Presentation Manager application,
  2051.      in which case it must be the value returned by VioGetPs.
  2052.  
  2053.  
  2054. RETURNS
  2055. -------
  2056.      Return code descriptions are:
  2057.  
  2058.      0         NO_ERROR
  2059.      355       ERROR_VIO_MODE
  2060.      358       ERROR_VIO_ROW
  2061.      359       ERROR_VIO_COL
  2062.      436       ERROR_VIO_INVALID_HANDLE
  2063.      465       ERROR_VIO_DETACHED
  2064.  
  2065.  
  2066. REMARKS
  2067. -------
  2068.  
  2069. TopRow = 0 and LeftCol = 0 identifies the top left corner of the screen.
  2070.  
  2071. If a value greater than the maximum value is specified for TopRow, LeftCol,
  2072. BotRow, RightCol, or Lines, the maximum value for that parameter is used.
  2073.  
  2074. If TopRow and LeftCol = 0 and if BotRow, RightCol, and Lines is larger than the
  2075. screen lines, the entire screen is filled with the character and attribute
  2076. defined by Cell.
  2077.  
  2078.  
  2079.  
  2080. VioScrollUp
  2081. ================================================================================
  2082. This call scrolls the entire display buffer (or area specified within the display buffer) up.
  2083.  
  2084.  
  2085. CALL SYNTAX
  2086. -----------
  2087.  
  2088.  #define INCL_VIO
  2089.  
  2090.  APIRET   VioScrollUp(ULONG TopRow, ULONG LeftCol, ULONG BotRow,
  2091.                         ULONG RightCol, ULONG Lines, PBYTE Cell, HVIO hvio);
  2092.  
  2093.  
  2094. PARAMETERS
  2095. ----------
  2096.  
  2097.   TopRow (ULONG) - input
  2098.      Top row to be scrolled.
  2099.  
  2100.   LeftCol (ULONG) - input
  2101.      Left column to be scrolled.
  2102.  
  2103.   BotRow (ULONG) - input
  2104.      Bottom row to be scrolled.
  2105.  
  2106.   RightCol (ULONG) - input
  2107.      Right column to be scrolled.
  2108.  
  2109.   Lines (ULONG) - input
  2110.      Number of lines to be inserted at the bottom of the screen area being
  2111.      scrolled.  If 0 is specified, no lines are scrolled.
  2112.  
  2113.   Cell (PBYTE) - input
  2114.      Address of the character attribute(s) pair (2 or 4 bytes) used as a fill
  2115.      character on inserted lines.
  2116.  
  2117.   hvio (HVIO) - input
  2118.      This must be zero unless the caller is a Presentation Manager application,
  2119.      in which case it must be the value returned by VioGetPs.
  2120.  
  2121.  
  2122. RETURNS
  2123. -------
  2124.      Return code descriptions are:
  2125.  
  2126.      0         NO_ERROR
  2127.      355       ERROR_VIO_MODE
  2128.      358       ERROR_VIO_ROW
  2129.      359       ERROR_VIO_COL
  2130.      436       ERROR_VIO_INVALID_HANDLE
  2131.      465       ERROR_VIO_DETACHED
  2132.  
  2133.  
  2134. REMARKS
  2135. -------
  2136.  
  2137. TopRow = 0 and LeftCol = 0 identifies the top left corner of the screen.
  2138.  
  2139. If a value greater than the maximum value is specified for TopRow, LeftCol,
  2140. BotRow, RightCol, or Lines, the maximum value for that parameter is used.
  2141.  
  2142. If TopRow and LeftCol = 0 and if BotRow, RightCol, and Lines is larger than the
  2143. screen lines, the entire screen is filled with the character-attribute
  2144. pair defined by Cell.
  2145.  
  2146.  
  2147.  
  2148. VioScrUnLock
  2149. ================================================================================
  2150. This call releases ownership of (unlocks) the physical display buffer.
  2151.  
  2152.  
  2153. CALL SYNTAX
  2154. -----------
  2155.  
  2156.  #define INCL_VIO
  2157.  
  2158.  APIRET   VioScrUnLock(HVIO hvio);
  2159.  
  2160.  
  2161. PARAMETERS
  2162. ----------
  2163.  
  2164.   hvio (HVIO) - input
  2165.      Reserved value, must be zero.
  2166.  
  2167.  
  2168. RETURNS
  2169. -------
  2170.      Return code descriptions are:
  2171.  
  2172.      0         NO_ERROR
  2173.      367       ERROR_VIO_UNLOCK
  2174.      430       ERROR_VIO_ILLEGAL_DURING_POPUP
  2175.      436       ERROR_VIO_INVALID_HANDLE
  2176.      465       ERROR_VIO_DETACHED
  2177.  
  2178.  
  2179. REMARKS
  2180. -------
  2181.  
  2182. This call releases the screen lock that is set by VioScrLock.  The VioScrUnLock
  2183. call must be issued by a thread in the same process as the thread that issued
  2184. VioScrLock.
  2185.  
  2186.  
  2187.  
  2188. VioSetAnsi
  2189. ================================================================================
  2190. This call activates or deactivates ANSI support.
  2191.  
  2192.  
  2193. CALL SYNTAX
  2194. -----------
  2195.  
  2196.  #define INCL_VIO
  2197.  
  2198.  APIRET   VioSetAnsi(ULONG Indicator, HVIO hvio);
  2199.  
  2200.  
  2201. PARAMETERS
  2202. ----------
  2203.  
  2204.   Indicator (ULONG) - input
  2205.      Equals 1 to activate ANSI support or 0 to deactivate ANSI.
  2206.  
  2207.   hvio (HVIO) - input
  2208.      This must be zero unless the caller is a Presentation Manager application,
  2209.      in which case it must be the value returned by VioGetPs.
  2210.  
  2211.  
  2212. RETURNS
  2213. -------
  2214.      Return code descriptions are:
  2215.  
  2216.      0         NO_ERROR
  2217.      355       ERROR_VIO_MODE
  2218.      421       ERROR_VIO_INVALID_PARMS
  2219.      430       ERROR_VIO_ILLEGAL_DURING_POPUP
  2220.      436       ERROR_VIO_INVALID_HANDLE
  2221.      465       ERROR_VIO_DETACHED
  2222.  
  2223.  
  2224. REMARKS
  2225. -------
  2226.  
  2227. For ANSI support, "ON" is the default.
  2228.  
  2229.  
  2230.  
  2231. VioSetCp
  2232. ================================================================================
  2233. This call allows a process to set the code page used to display text data on the
  2234. screen for the specified handle.
  2235.  
  2236.  
  2237. CALL SYNTAX
  2238. -----------
  2239.  #define INCL_VIO
  2240.  
  2241.  APIRET   VioSetCp(ULONG Reserved, USHORT CodePageID, HVIO hvio);
  2242.  
  2243.  
  2244. PARAMETERS
  2245. ----------
  2246.  
  2247.   Reserved (ULONG) - input
  2248.      Reserved value, must be zero.
  2249.  
  2250.   CodePageID (USHORT) - input
  2251.      The CodePageID must be a known codepage.  Note that the values 0, -1,
  2252.      and -2 which are supported by OS/2 2.x will cause an error in
  2253.      Workplace OS/2.
  2254.  
  2255.   hvio (HVIO) - input
  2256.      This must be zero unless the caller is a Presentation Manager application,
  2257.      in which case it must be the value returned by VioGetPs.
  2258.  
  2259.  
  2260. RETURNS
  2261. -------
  2262.      Return code descriptions are:
  2263.  
  2264.      0         NO_ERROR
  2265.      355       ERROR_VIO_MODE
  2266.      436       ERROR_VIO_INVALID_HANDLE
  2267.      465       ERROR_VIO_DETACHED
  2268.      469       ERROR_VIO_BAD_CP
  2269.      470       ERROR_VIO_NO_CP
  2270.      471       ERROR_VIO_NA_CP
  2271.  
  2272.  
  2273. REMARKS
  2274. -------
  2275.  
  2276. The specified codepage applies to all new characters.  How VioSetCp acts
  2277. on characters already in the video buffer is undefined.
  2278.  
  2279.  
  2280.  
  2281. VioSetCurPos
  2282. ================================================================================
  2283. This call sets the cursor's coordinates on the screen.
  2284.  
  2285.  
  2286. CALL SYNTAX
  2287. -----------
  2288.  
  2289.  #define INCL_VIO
  2290.  
  2291.  APIRET   VioSetCurPos(ULONG Row, ULONG Column, HVIO hvio);
  2292.  
  2293.  
  2294. PARAMETERS
  2295. ----------
  2296.  
  2297.   Row (ULONG) - input
  2298.      New cursor row position, 0 is the top row.
  2299.  
  2300.   Column (ULONG) - input
  2301.      New cursor column position, 0 is the leftmost column.
  2302.  
  2303.   hvio (HVIO) - input
  2304.      This must be zero unless the caller is a Presentation Manager application,
  2305.      in which case it must be the value returned by VioGetPs.
  2306.  
  2307.  
  2308. RETURNS
  2309. -------
  2310.      Return code descriptions are:
  2311.  
  2312.      0         NO_ERROR
  2313.      355       ERROR_VIO_MODE
  2314.      358       ERROR_VIO_ROW
  2315.      359       ERROR_VIO_COL
  2316.      436       ERROR_VIO_INVALID_HANDLE
  2317.      465       ERROR_VIO_DETACHED
  2318.  
  2319.  
  2320.  
  2321. VioSetCurType
  2322. ================================================================================
  2323. This call sets the cursor type.
  2324.  
  2325.  
  2326. CALL SYNTAX
  2327. -----------
  2328.  
  2329.  
  2330.  typedef struct _VIOCURSORINFO {  /* vioci */
  2331.      USHORT   yStart;               /* cursor start line */
  2332.      USHORT   cEnd;                 /* cursor end line   */
  2333.      USHORT   cx;                   /* cursor width      */
  2334.      USHORT   attr;                 /* -1=hidden cursor  */
  2335.  } VIOCURSORINFO;
  2336.  
  2337.  #define INCL_VIO
  2338.  
  2339.  APIRET   VioSetCurType(PVIOCURSORINFO CursorData, HVIO hvio);
  2340.  
  2341.  
  2342. PARAMETERS
  2343. ----------
  2344.   CursorData (PVIOCURSORINFO) - input
  2345.      Address of the cursor characteristics structure:
  2346.  
  2347.      startline (USHORT)
  2348.         Horizontal scan line in the character cell that marks the top line of
  2349.         the cursor.  If the character cell has n scan lines, 0 is the top scan
  2350.         line of the character cell and (n - 1) is the bottom scan line.
  2351.  
  2352.      endline (USHORT)
  2353.         Horizontal scan line in the character cell that marks the bottom line of
  2354.         the cursor.  Scan lines within a character cell are numbered as defined
  2355.         in startline.  The maximum value allowed is 31.
  2356.  
  2357.      cursorwidth (USHORT)
  2358.         Width of the cursor.  In text modes, cursorwidth is the number of
  2359.         columns.  The maximum number supported by the OS/2 base video subsystem
  2360.         is 1. In graphics modes, cursorwidth is the number of pels.
  2361.  
  2362.         A value of 0 specifies the default width.  In text modes, this is 1
  2363.         column.  In graphics modes, this is the number of pels equivalent to the
  2364.         width of one character.
  2365.  
  2366.      cursorattrib (USHORT)
  2367.         A value of -1 denotes a hidden cursor, all other values denote a normal
  2368.         cursor.
  2369.  
  2370.   hvio (HVIO) - input
  2371.      This must be zero unless the caller is a Presentation Manager application,
  2372.      in which case it must be the value returned by VioGetPs.
  2373.  
  2374.  
  2375. RETURNS
  2376. -------
  2377.      Return code descriptions are:
  2378.  
  2379.      0         NO_ERROR
  2380.      355       ERROR_VIO_MODE
  2381.      356       ERROR_VIO_WIDTH
  2382.      421       ERROR_VIO_INVALID_PARMS
  2383.      436       ERROR_VIO_INVALID_HANDLE
  2384.      465       ERROR_VIO_DETACHED
  2385.  
  2386.  
  2387. REMARKS
  2388. -------
  2389.  
  2390. To set CursorStartLine and CursorEndLine independent of the number of scan lines
  2391. for each character cell, you may specify these parameters as percentages.  OS/2
  2392. then calculates the physical start and end scan lines, respectively, by
  2393. multiplying the percentage specified for the parameter by the total number of
  2394. scan lines in the character cell and rounding to the nearest scan line.
  2395. Percentages are specified as negative values (or 0) in the range 0 through -100.
  2396. Specifying CursorStartLine = -90 and CursorEndLine = -100 requests a cursor that
  2397. occupies the bottom 10 percent of the character cell.
  2398.  
  2399. The actual appearance of the cursor is hardware dependent.  The video hardware
  2400. may not support the specified parameters.
  2401.  
  2402.  
  2403.  
  2404. VioSetDeviceCellSize
  2405. ================================================================================
  2406. Sets the size of the current character cell in pels
  2407.  
  2408.  
  2409. CALL SYNTAX
  2410. -----------
  2411.  
  2412.  #define INCL_VIO
  2413.  
  2414.  APIRET APIENTRY  VioSetDeviceCellSize(ULONG Height, ULONG Width, HVIO hvio);
  2415.  
  2416.  
  2417. PARAMETERS
  2418. ----------
  2419.  
  2420.   Height (ULONG) - input
  2421.      Height of the character cell in pels
  2422.  
  2423.   Width (ULONG) - input
  2424.      Width of the character cell in pels
  2425.  
  2426.   hvio (HVIO) - input
  2427.      Vio presentation space handle.  This is either zero to indicate the
  2428.      default Vio session, or a value returned by VioCreatePS.
  2429.  
  2430.  
  2431. RETURNS
  2432. -------
  2433.      Return code descriptions are:
  2434.  
  2435.      0         NO_ERROR
  2436.      436       ERROR_VIO_INVALID_HANDLE
  2437.  
  2438.  
  2439. REMARKS
  2440. -------
  2441.  
  2442. If the device does not support the specified cell size, the cell size
  2443. closest to the specified size is used.  VioGetDeviceCellSize can be used
  2444. to find the actual size selected.
  2445.  
  2446. In OS/2 2.x, hvio cannot be zero.
  2447.  
  2448.  
  2449.  
  2450. VioSetMode
  2451. ================================================================================
  2452. This call sets the mode of the display.
  2453.  
  2454.  
  2455. CALL SYNTAX
  2456. -----------
  2457.  
  2458.  typedef struct _VIOMODEINFO {
  2459.      USHORT cb;                    /* Length of the entire data structure  */
  2460.      UCHAR  fbType;                /* Bit mask of mode being set           */
  2461.      UCHAR  color;                 /* Number of colors (power of 2)        */
  2462.      USHORT col;                   /* Number of text columns               */
  2463.      USHORT row;                   /* Number of text rows                  */
  2464.      USHORT hres;                  /* Horizontal resolution                */
  2465.      USHORT vres;                  /* Vertical resolution                  */
  2466.      UCHAR  fmt_ID;                /* Attribute format                     */
  2467.      UCHAR  attrib;                /* Number of attributes                 */
  2468.      ULONG  buf_addr;
  2469.      ULONG  buf_length;
  2470.      ULONG  full_length;
  2471.      ULONG  partial_length;
  2472.      PCH    ext_data_addr;
  2473.  } VIOMODEINFO;
  2474.  typedef VIOMODEINFO far *PVIOMODEINFO;
  2475.  
  2476.  #define INCL_VIO
  2477.  
  2478.  APIRET   VioSetMode(PVIOMODEINFO ModeData, HVIO hvio);
  2479.  
  2480.  
  2481. PARAMETERS
  2482. ----------
  2483.  
  2484.   ModeData (PVIOMODEINFO) - input
  2485.      Address of the mode characteristics structure:
  2486.  
  2487.      length (USHORT)
  2488.         Input parameter to VioSetMode.  Length specifies the length of the data
  2489.         structure in bytes including Length itself.  The minimum structure size
  2490.         required is 3 bytes.  OS/2 sets to the first mode (in the list of modes
  2491.         supported by this display configuration) with a data structure matching
  2492.         the mode data specified.
  2493.  
  2494.      type (UCHAR)
  2495.         Mode characteristics bit mask:
  2496.  
  2497.         Bit       Description
  2498.  
  2499.         7-4       Reserved, set to zero.
  2500.  
  2501.         3         0 = VGA BIOS compatible modes
  2502.                   1 = Native mode.
  2503.  
  2504.         2         0 = Enable color burst
  2505.                   1 = Disable color burst.
  2506.  
  2507.         1         0 = Text mode.
  2508.                   1 = Graphics mode.
  2509.  
  2510.         0         0 = Monochrome compatible mode.
  2511.                   1 = Other.
  2512.  
  2513.      numcolors (UCHAR)
  2514.         Number of colors defined as a power of 2. This is equivalent to the
  2515.         number of color bits that define the color, for example:
  2516.  
  2517.         Value     Definition
  2518.         0         Monochrome
  2519.         1         2 colors.
  2520.         2         4 colors.
  2521.         4         16 colors.
  2522.         8         256 colors.
  2523.         16        64K colors.
  2524.         24        16M colors.
  2525.  
  2526.      textcols (USHORT)
  2527.         Number of text columns.
  2528.  
  2529.      textrows (USHORT)
  2530.         Number of text rows.
  2531.  
  2532.      pelcols (USHORT)
  2533.         Horizontal resolution, number of pel columns.
  2534.  
  2535.      pelrows (USHORT)
  2536.         Vertical resolution, number of pel rows.
  2537.  
  2538.      Attribute Format (UCHAR)
  2539.         Identifies the format of the attributes.
  2540.  
  2541.      Number of Attributes (UCHAR)
  2542.         Identifies the number of attributes in a character cell.
  2543.  
  2544.      Buffer Address (ULONG)
  2545.         Physical address of the physical display aperture.
  2546.  
  2547.      Buffer Length (ULONG)
  2548.         Length of the physical display aperture.
  2549.  
  2550.      Full Buffer Size (ULONG)
  2551.         Size of the buffer required for a full save of the physical display
  2552.         buffer for this mode.
  2553.  
  2554.      Partial Buffer Size (ULONG)
  2555.         Size of the buffer required for a partial (pop-up) save of the physical
  2556.         display buffer for this mode.
  2557.  
  2558.      Extended Data Area Address (PCH)
  2559.         Virtual address to an extended mode data structure or zero if none.
  2560.         The format of the extended mode data structure is determined by the
  2561.         device driver and is unknown to OS/2.
  2562.  
  2563.   hvio (HVIO) - input
  2564.      Reserved value, must be zero.
  2565.  
  2566.  
  2567. RETURNS
  2568. -------
  2569.      Return code descriptions are:
  2570.  
  2571.      0         NO_ERROR
  2572.      355       ERROR_VIO_MODE
  2573.      430       ERROR_VIO_ILLEGAL_DURING_POPUP
  2574.      436       ERROR_VIO_INVALID_HANDLE
  2575.      438       ERROR_VIO_INVALID_LENGTH
  2576.      465       ERROR_VIO_DETACHED
  2577.      467       ERROR_VIO_FONT
  2578.  
  2579.  
  2580. REMARKS
  2581. -------
  2582.  
  2583. VioSetMode initializes the cursor position and type.
  2584.  
  2585. VioSetMode does not clear the screen if the new and old modes are compatible.
  2586. To clear the screen, use one of the VioScrollxx calls.
  2587.  
  2588. Assuming no target display configuration for VioSetMode is selected, the mode is
  2589. set on the primary configuration.  If the primary configuration does not support
  2590. the mode specified, the mode is set on the secondary configuration.
  2591.  
  2592.  
  2593. VioSetOrigin
  2594. ================================================================================
  2595. Set the position at which the presentation space maps to the window
  2596.  
  2597.  
  2598. CALL SYNTAX
  2599. -----------
  2600.  
  2601.  #define INCL_VIO
  2602.  
  2603.  APIRET APIENTRY  VioSetOrigin(ULONG Row, ULONG Column, HVIO hvio);
  2604.  
  2605.  
  2606. PARAMETERS
  2607. ----------
  2608.  
  2609.   Height (ULONG) - input
  2610.      Topmost row shown in the window
  2611.  
  2612.   Width (ULONG) - input
  2613.      Leftmost column shown in the window
  2614.  
  2615.   hvio (HVIO) - input
  2616.      Vio presentation space handle.  This is either zero to indicate the
  2617.      default Vio session, or a value returned by VioCreatePS.
  2618.  
  2619.  
  2620. RETURNS
  2621. -------
  2622.      Return code descriptions are:
  2623.  
  2624.      0         NO_ERROR
  2625.      358       ERROR_VIO_ROW
  2626.      359       ERROR_VIO_COL
  2627.      436       ERROR_VIO_INVALID_HANDLE
  2628.  
  2629.  
  2630. REMARKS
  2631. -------
  2632.  
  2633. This call is used when the presentation space is larger than the window
  2634. size to control which part of the presentation space is displayed.  It
  2635. does not itself cause any output to be displayed.
  2636.  
  2637. In OS/2 2.x, hvio cannot be zero.
  2638.  
  2639.  
  2640.  
  2641.  
  2642. VioSetState
  2643. ================================================================================
  2644. This call performs one of the following functions; set palette registers, sets
  2645. the overscan (border) color, set the blink/background intensity switch, set
  2646. color registers, set the underline location, or set the target VioSetMode
  2647. display configuration.
  2648.  
  2649.  
  2650. CALL SYNTAX
  2651. -----------
  2652.  
  2653.  #define INCL_VIO
  2654.  
  2655.  APIRET   VioSetState(PVOID RequestBlock, HVIO hvio);
  2656.  
  2657.  
  2658. PARAMETERS
  2659. ----------
  2660.  
  2661.   RequestBlock (PVOID) - input
  2662.      Address of the video state structures consisting of six different
  2663.      structures depending on the request type:
  2664.  
  2665.      Type      Definition
  2666.      0         Set palette registers
  2667.      1         Set overscan (border) color
  2668.      2         Set blink/background intensity switch
  2669.      3         Set color registers
  2670.      4         Reserved
  2671.      5         Set underline location
  2672.      6         Set target VioSetMode display configuration
  2673.  
  2674.      The six structures, depending on request type, are:
  2675.  
  2676.      VIOPALSTATE
  2677.         length (USHORT) - input
  2678.            Length of structure, including length.
  2679.  
  2680.            38        Maximum valid value.
  2681.  
  2682.         reqtype (USHORT) - input
  2683.            Request type 0 for palette registers.
  2684.  
  2685.         palette (USHORT) - input
  2686.            First palette register in the palette register sequence; must be
  2687.            specified in the range 0 through 15.  The palette registers are
  2688.            returned in sequential order.  The number returned is based upon
  2689.            length.
  2690.  
  2691.         color (USHORT*(length-6)/2) - input
  2692.            Color value for each palette register.  The maximum number of entries
  2693.            in the color value array is 16.
  2694.  
  2695.      VIOOVERSCAN
  2696.         length (USHORT) - input
  2697.            Length of structure, including length.
  2698.  
  2699.            6         Only valid value.
  2700.  
  2701.         reqtype (USHORT) - input
  2702.            Request type 1 for overscan (border) color.
  2703.  
  2704.         color (USHORT) - input
  2705.            Color value.
  2706.  
  2707.      VIOINTENSITY
  2708.         length (USHORT) - input
  2709.            Length of structure, including length.
  2710.  
  2711.            6         Only valid value.
  2712.  
  2713.         reqtype (USHORT) - input
  2714.            Request type 2 for blink/background intensity switch.
  2715.  
  2716.         switch (USHORT) - input
  2717.            Switch set as:
  2718.  
  2719.            Value     Definition
  2720.            0         Blinking foreground colors enabled.
  2721.            1         High intensity background colors enabled.
  2722.  
  2723.         VIOCOLORREG
  2724.            length (USHORT) - input
  2725.               Length of structure, including length.
  2726.  
  2727.               12        Only valid value.
  2728.  
  2729.            type (USHORT) - input
  2730.               Request type 3 for color registers.
  2731.  
  2732.            first color (USHORT) - input
  2733.               First color register to set in the color register sequence; must
  2734.               be specified in the range 0 through 255.  The color registers are
  2735.               set in sequential order.
  2736.  
  2737.            number color (USHORT) - input
  2738.               Number of color registers to set; must be specified in the range 1
  2739.               through 256.
  2740.  
  2741.            datarea (PCH) - input
  2742.               Far address of a data area containing one three-byte entry for
  2743.               each color register to be set.  The format of each entry is as
  2744.               follows:
  2745.  
  2746.               Byte 1    Red value
  2747.               Byte 2    Green value
  2748.               Byte 3    Blue value.
  2749.  
  2750.         VIOSETULINELOC
  2751.            length (USHORT) - input
  2752.               Length of structure, including length.
  2753.  
  2754.               6         Only valid value.
  2755.  
  2756.            type (USHORT) - input
  2757.               Request type 5 to set the scan line for underlining.  Underlining
  2758.               is enabled only when the foreground color is 1 or 9.
  2759.  
  2760.            scanline (USHORT) - input
  2761.               Scan line minus 1. Values of 0 through 31 are acceptable.  A value
  2762.               of 32 means underlining is disabled.
  2763.  
  2764.         VIOSETTARGET
  2765.            length (USHORT) - input
  2766.               Length of structure, including length.
  2767.               6         Only valid value.
  2768.  
  2769.            type (USHORT) - input
  2770.               Request type 6 to set display configuration to be the target of
  2771.               the next VioSetMode.
  2772.  
  2773.            select (USHORT) - input
  2774.               Configuration:
  2775.  
  2776.               Value     Definition
  2777.               0         Default selection algorithm.  See VioSetMode.
  2778.               1         Primary
  2779.               2         Secondary.
  2780.  
  2781.   hvio (HVIO) - input
  2782.      Reserved value, must be zero.
  2783.  
  2784.  
  2785. RETURNS
  2786. -------
  2787.      Return code descriptions are:
  2788.  
  2789.      0         NO_ERROR
  2790.      355       ERROR_VIO_MODE
  2791.      421       ERROR_VIO_INVALID_PARMS
  2792.      436       ERROR_VIO_INVALID_HANDLE
  2793.      438       ERROR_VIO_INVALID_LENGTH
  2794.      465       ERROR_VIO_DETACHED
  2795.  
  2796.  
  2797. REMARKS
  2798. -------
  2799.  
  2800. Note: VioSetState allows setting of hardware dependent features.  Not all
  2801. video hardware will honor these settings.
  2802.  
  2803.  
  2804.  
  2805. VioShowBuf
  2806. ================================================================================
  2807. This call updates the physical display buffer with the logical video buffer
  2808. (LVB).
  2809.  
  2810.  
  2811. CALL SYNTAX
  2812. -----------
  2813.  
  2814.  #define INCL_VIO
  2815.  
  2816.  APIRET   VioShowBuf(ULONG Offset, ULONG Length, HVIO hvio);
  2817.  
  2818.  
  2819. PARAMETERS
  2820. ----------
  2821.  
  2822.   Offset (ULONG) - input
  2823.      Starting offset within the logical video buffer at which the update to the
  2824.      screen is to start.
  2825.  
  2826.   Length (ULONG) - input
  2827.      Length of the area to be updated to the screen.
  2828.  
  2829.   hvio (HVIO) - input
  2830.      This must be zero unless the caller is a Presentation Manager application,
  2831.      in which case it must be the value returned by VioGetPs.
  2832.  
  2833.  
  2834. RETURNS
  2835. -------
  2836.      Return code descriptions are:
  2837.  
  2838.      0         NO_ERROR
  2839.      355       ERROR_VIO_MODE
  2840.      430       ERROR_VIO_ILLEGAL_DURING_POPUP
  2841.      436       ERROR_VIO_INVALID_HANDLE
  2842.      465       ERROR_VIO_DETACHED
  2843.  
  2844.  
  2845. REMARKS
  2846. -------
  2847.  
  2848. VioShowBuf is ignored unless it is issued by a process that has previously
  2849. called VioGetBuf and that is currently executing in the foreground.
  2850.  
  2851.  
  2852.  
  2853. VioShowPS
  2854. ================================================================================
  2855. Update the disply of the Vio presentation space
  2856.  
  2857.  
  2858. CALL SYNTAX
  2859. -----------
  2860.  
  2861.  #define INCL_VIO
  2862.  
  2863.     APIRET APIENTRY  VioShowPS(ULONG Depth, ULONG Width, ULONG Cell, HVIO hvio);
  2864.  
  2865.  
  2866. PARAMETERS
  2867. ----------
  2868.  
  2869.   Depth (ULONG) - input
  2870.      Depth of the updated rectangle
  2871.  
  2872.   Width (ULONG) - input
  2873.      Width of the updated rectangle
  2874.  
  2875.   Cell (ULONG)
  2876.      Offset to the first updated cell.  The offset of the top, left corner
  2877.      is zero.
  2878.  
  2879.   hvio (HVIO) - input
  2880.      Vio presentation space handle.  This is either zero to indicate the
  2881.      default Vio session, or a value returned by VioCreatePS.
  2882.  
  2883.  
  2884. RETURNS
  2885. -------
  2886.      Return code descriptions are:
  2887.  
  2888.      0         NO_ERROR
  2889.      421       ERROR_VIO_INVALID_PARMS
  2890.      436       ERROR_VIO_INVALID_HANDLE
  2891.  
  2892.  
  2893. REMARKS
  2894. -------
  2895.  
  2896. This call is used to specify that part or all of the presentation space
  2897. logical buffer needs to be redrawn.
  2898.  
  2899. This call has the same function as VioShowBuf, but the area to update is
  2900. specified differently.
  2901.  
  2902.  
  2903. VioWrtCellStr
  2904. ================================================================================
  2905. This call writes a string of character-attribute pairs (cells) to the display.
  2906.  
  2907.  
  2908. CALL SYNTAX
  2909. -----------
  2910.  
  2911.  #define INCL_VIO
  2912.  
  2913.  APIRET   VioWrtCellStr(PCH CellStr, ULONG Length, ULONG Row, ULONG Column,
  2914.                         HVIO hvio);
  2915.  
  2916.  
  2917. PARAMETERS
  2918. ----------
  2919.  
  2920.   CellStr (PCH) - input
  2921.      Address of the string of character-attribute(s) cells to be written.
  2922.  
  2923.   Length (ULONG) - input
  2924.      Length, in bytes, of the string to be written.  Each character-attribute(s)
  2925.      cell is 2 or 4 bytes.
  2926.  
  2927.   Row (ULONG) - input
  2928.      Starting cursor row.
  2929.  
  2930.   Column (ULONG) - input
  2931.      Starting cursor column.
  2932.  
  2933.   hvio (HVIO) - input
  2934.      This must be zero unless the caller is a Presentation Manager application,
  2935.      in which case it must be the value returned by VioGetPs.
  2936.  
  2937.  
  2938. RETURNS
  2939. -------
  2940.      Return code descriptions are:
  2941.  
  2942.      0         NO_ERROR
  2943.      355       ERROR_VIO_MODE
  2944.      358       ERROR_VIO_ROW
  2945.      359       ERROR_VIO_COL
  2946.      436       ERROR_VIO_INVALID_HANDLE
  2947.      465       ERROR_VIO_DETACHED
  2948.  
  2949.  
  2950. REMARKS
  2951. -------
  2952.  
  2953. If a string write gets to the end of the line and is not complete, the string
  2954. write continues at the beginning of the next line.  If the write gets to the end
  2955. of the screen, the write terminates.
  2956.  
  2957.  
  2958. VioWrtCharStr
  2959. ================================================================================
  2960. This call writes a character string to the display.
  2961.  
  2962.  
  2963. CALL SYNTAX
  2964. -----------
  2965.  
  2966.  #define INCL_VIO
  2967.  
  2968.  APIRET   VioWrtCharStr(PCH CharStr, ULONG Length, ULONG Row, ULONG Column,
  2969.                         HVIO hvio);
  2970.  
  2971.  
  2972. PARAMETERS
  2973. ----------
  2974.  
  2975.   CharStr (PCH) - input
  2976.      Address of the character string to be written.
  2977.  
  2978.   Length (ULONG) - input
  2979.      Length, in bytes, of the character string.
  2980.  
  2981.   Row (ULONG) - input
  2982.      Starting cursor row.
  2983.  
  2984.   Column (ULONG) - input
  2985.      Starting cursor column.
  2986.  
  2987.   hvio (HVIO) - input
  2988.      This must be zero unless the caller is a Presentation Manager application,
  2989.      in which case it must be the value returned by VioGetPs.
  2990.  
  2991.  
  2992. RETURNS
  2993. -------
  2994.      Return code descriptions are:
  2995.  
  2996.      0         NO_ERROR
  2997.      355       ERROR_VIO_MODE
  2998.      358       ERROR_VIO_ROW
  2999.      359       ERROR_VIO_COL
  3000.      436       ERROR_VIO_INVALID_HANDLE
  3001.      465       ERROR_VIO_DETACHED
  3002.  
  3003.  
  3004. REMARKS
  3005. -------
  3006.  
  3007. If a string write gets to the end of the line and is not complete, the string
  3008. write continues at the beginning of the next line.  If the write gets to the end
  3009. of the screen, the write terminates.
  3010.  
  3011.  
  3012.  
  3013. VioWrtCharStrAttr
  3014. ================================================================================
  3015. This call writes a character string with repeated attribute to the display.
  3016.  
  3017.  
  3018. CALL SYNTAX
  3019. -----------
  3020.  
  3021.  #define INCL_VIO
  3022.  
  3023.  APIRET   VioWrtCharStrAtt(PCH CharStr, ULONG Length, ULONG Row, ULONG Column,
  3024.                            PBYTE Attr, HVIO hvio);
  3025.  
  3026.  
  3027. PARAMETERS
  3028. ----------
  3029.  
  3030.   CharStr (PCH) - input
  3031.      Address of the character string to be written.
  3032.  
  3033.   Length (ULONG) - input
  3034.      Length, in bytes, of the character string.
  3035.  
  3036.   Row (ULONG) - input
  3037.      Starting cursor row.
  3038.  
  3039.   Column (ULONG) - input
  3040.      Starting cursor column.
  3041.  
  3042.   Attr (PBYTE) - input
  3043.      Address of the attribute(s) (1 or 3 bytes) to be used in the display buffer
  3044.      for each character of the string written.
  3045.  
  3046.   hvio (HVIO) - input
  3047.      This must be zero unless the caller is a Presentation Manager application,
  3048.      in which case it must be the value returned by VioGetPs.
  3049.  
  3050.  
  3051. RETURNS
  3052. -------
  3053.      Return code descriptions are:
  3054.  
  3055.      0         NO_ERROR
  3056.      355       ERROR_VIO_MODE
  3057.      358       ERROR_VIO_ROW
  3058.      359       ERROR_VIO_COL
  3059.      436       ERROR_VIO_INVALID_HANDLE
  3060.      465       ERROR_VIO_DETACHED
  3061.  
  3062.  
  3063. REMARKS
  3064. -------
  3065.  
  3066. If a string write gets to the end of the line and is not complete, the string
  3067. write continues at the beginning of the next line.  If the write gets to the end
  3068. of the screen, the write terminates.
  3069.  
  3070.  
  3071. VioWrtNAttr
  3072. ================================================================================
  3073. This call writes an attribute to the display a specified number of times.
  3074.  
  3075.  
  3076. CALL SYNTAX
  3077. -----------
  3078.  
  3079.  #define INCL_VIO
  3080.  
  3081.  APIRET   VioWrtNAttr(PBYTE Attr, ULONG Times, ULONG Row, ULONG Column,
  3082.                       HVIO hvio);
  3083.  
  3084.  
  3085. PARAMETERS
  3086. ----------
  3087.  
  3088.   Attr (PBYTE) - input
  3089.      Address of the attribute(s) (1 or 3 bytes) to be written.
  3090.  
  3091.   Times (ULONG) - input
  3092.      Number of times to write the attribute.
  3093.  
  3094.   Row (ULONG) - input
  3095.      Starting cursor row.
  3096.  
  3097.   Column (ULONG) - input
  3098.      Starting cursor column.
  3099.  
  3100.   hvio (HVIO) - input
  3101.      This must be zero unless the caller is a Presentation Manager application,
  3102.      in which case it must be the value returned by VioGetPs.
  3103.  
  3104.  
  3105. RETURNS
  3106. -------
  3107.      Return code descriptions are:
  3108.  
  3109.      0         NO_ERROR
  3110.      355       ERROR_VIO_MODE
  3111.      358       ERROR_VIO_ROW
  3112.      359       ERROR_VIO_COL
  3113.      436       ERROR_VIO_INVALID_HANDLE
  3114.      465       ERROR_VIO_DETACHED
  3115.  
  3116.  
  3117. REMARKS
  3118. -------
  3119.  
  3120. If a repeated write gets to the end of the line and is not complete, the write
  3121. continues at the beginning of the next line.  If the write gets to the end of
  3122. the screen, the write terminates.
  3123.  
  3124.  
  3125. VioWrtNCell
  3126. ================================================================================
  3127. This call writes a cell (character-attribute pair) to the display a specified
  3128. number of times.
  3129.  
  3130.  
  3131. CALL SYNTAX
  3132. -----------
  3133.  
  3134.  #define INCL_VIO
  3135.  
  3136.  APIRET   VioWrtNCell(PBYTE Cell, ULONG Times, ULONG Row, ULONG Column,
  3137.                       HVIO hvio);
  3138.  
  3139.  
  3140. PARAMETERS
  3141. ----------
  3142.  
  3143.   Cell (PBYTE) - input
  3144.      Address of the character-attribute(s) cell (2 or 4 bytes) to be written.
  3145.  
  3146.   Times (ULONG) - input
  3147.      Number of times to write the cell.
  3148.  
  3149.   Row (ULONG) - input
  3150.      Starting cursor row.
  3151.  
  3152.   Column (ULONG) - input
  3153.      Starting cursor column.
  3154.  
  3155.   hvio (HVIO) - input
  3156.      This must be zero unless the caller is a Presentation Manager application,
  3157.      in which case it must be the value returned by VioGetPs.
  3158.  
  3159.  
  3160. RETURNS
  3161. -------
  3162.      Return code descriptions are:
  3163.  
  3164.      0         NO_ERROR
  3165.      355       ERROR_VIO_MODE
  3166.      358       ERROR_VIO_ROW
  3167.      359       ERROR_VIO_COL
  3168.      436       ERROR_VIO_INVALID_HANDLE
  3169.      465       ERROR_VIO_DETACHED
  3170.  
  3171.  
  3172. REMARKS
  3173. -------
  3174.  
  3175. If a repeated write gets to the end of the line and is not complete, the write
  3176. continues at the beginning of the next line.  If the write gets to the end of
  3177. the screen, the write terminates.
  3178.  
  3179.  
  3180.  
  3181. VioWrtNChar
  3182. ================================================================================
  3183. VioWrtNChar writes a character to the display a specified number of times.
  3184.  
  3185.  
  3186. CALL SYNTAX
  3187. -----------
  3188.  
  3189.  #define INCL_VIO
  3190.  
  3191.  APIRET   VioWrtNChar(PCH Char, ULONG Times, ULONG Row, ULONG Column,
  3192.                       HVIO hvio);
  3193.  
  3194.  
  3195. PARAMETERS
  3196. ----------
  3197.  
  3198.   Char (PCH) - input
  3199.      Address of the character to be written.
  3200.  
  3201.   Times (ULONG) - input
  3202.      Number of times to write the character.
  3203.  
  3204.   Row (ULONG) - input
  3205.      Starting cursor row.
  3206.  
  3207.   Column (ULONG) - input
  3208.      Starting cursor column.
  3209.  
  3210.   hvio (HVIO) - input
  3211.      This must be zero unless the caller is a Presentation Manager application,
  3212.      in which case it must be the value returned by VioGetPs.
  3213.  
  3214.  
  3215. RETURNS
  3216. -------
  3217.      Return code descriptions are:
  3218.  
  3219.      0         NO_ERROR
  3220.      355       ERROR_VIO_MODE
  3221.      358       ERROR_VIO_ROW
  3222.      359       ERROR_VIO_COL
  3223.      436       ERROR_VIO_INVALID_HANDLE
  3224.      465       ERROR_VIO_DETACHED
  3225.  
  3226.  
  3227. REMARKS
  3228. -------
  3229.  
  3230. If a repeated write gets to the end of the line and is not complete, the write
  3231. continues at the beginning of the next line.  If the write gets to the end of
  3232. the screen, the write terminates.
  3233.  
  3234.  
  3235. VioWrtTTY
  3236. ================================================================================
  3237. This call writes a character string to the display starting at the current
  3238. cursor position.  At the completion of the write, the cursor is positioned at
  3239. the first position beyond the end of the string.
  3240.  
  3241.  
  3242. CALL SYNTAX
  3243. -----------
  3244.  
  3245.  #define INCL_VIO
  3246.  
  3247.  APIRET   VioWrtTTY(PCH CharStr, ULONG Length, HVIO hvio);
  3248.  
  3249.  
  3250. PARAMETERS
  3251. ----------
  3252.  
  3253.   CharStr (PCH) - input
  3254.      Address of the string to be written.
  3255.  
  3256.   Length (ULONG) - input
  3257.      Length of the character string in bytes.
  3258.  
  3259.   hvio (HVIO) - input
  3260.      This must be zero unless the caller is a Presentation Manager application,
  3261.      in which case it must be the value returned by VioGetPs.
  3262.  
  3263.  
  3264. RETURNS
  3265. -------
  3266.      Return code descriptions are:
  3267.  
  3268.      0         NO_ERROR
  3269.      355       ERROR_VIO_MODE
  3270.      436       ERROR_VIO_INVALID_HANDLE
  3271.      465       ERROR_VIO_DETACHED
  3272.  
  3273.  
  3274. REMARKS
  3275. -------
  3276.  
  3277. If a string write gets to the end of the line and is not complete, the string
  3278. write continues at the beginning of the next line.  If the write gets to the end
  3279. of the screen, the screen is scrolled, and the write continues until completed.
  3280.  
  3281. The characters carriage return, line feed, backspace, tab, and bell are treated
  3282. as commands rather than printable characters.  Backspace is a non-destructive
  3283. backspace.  Tabs are expanded to provide standard 8-byte-wide fields.  VioWrtTTY
  3284. is the only video call affected by ANSI.
  3285.  
  3286. Characters are written using the current attribute defined by ANSI or the
  3287. default value 7.
  3288.  
  3289.  
  3290.  
  3291.  
  3292. WinDefAVioWindowProc
  3293. ================================================================================
  3294. This call invodes the default AVIO window procedure.
  3295.  
  3296. CALL SYNTAX
  3297. -----------
  3298.   #define INCL_AVIO
  3299.  
  3300.   MRESULT APIENTRY WinDefAVioWindowProc(HWND hwnd, ULONG msg,
  3301.                                       ULONG mp1, ULONG mp2);
  3302.  
  3303.  
  3304. PARAMETERS
  3305. ----------
  3306.   hwnd (HWND) - input
  3307.      Window handle.
  3308.  
  3309.   msg (ULONG) - input
  3310.      Message identity
  3311.  
  3312.   mp1 (ULONG) - input
  3313.      Parameter 1
  3314.  
  3315.   mp2 (ULONG) - input
  3316.      Parameter 2
  3317.  
  3318. REMARKS:
  3319.   Applications using AVIO must pass all WM_SIZE messages for the window
  3320.   with which the AVIO presentation space is associated to this routine
  3321.   using the same parameters as are received in the WM_SIZE message.
  3322.   This routine maintains the window size data in the presentation space,
  3323.   and must be called before the application accesses the window.
  3324.  
  3325.   This call is not a replacement for WinDefWindowProc which must also be
  3326.   called to process any messages which have not been handled by the
  3327.   application's window procudure.
  3328.  
  3329.