home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / textmode.zip / vio.doc < prev   
Text File  |  1995-07-10  |  96KB  |  3,432 lines

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