home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / c / WNDWC21.ZIP / WNDWREF.DOC < prev   
Encoding:
Text File  |  1989-08-01  |  98.5 KB  |  2,057 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                            MULTI-LEVEL VIRTUAL WINDOWS
  22.                                   USER'S GUIDE
  23.  
  24.                                    Version 2.1
  25.                                  August 1, 1989
  26.  
  27.  
  28.                      Conversion to Turbo C / Microsoft C by
  29.                        Jordan Gallagher / Wisdom Research
  30.  
  31.  
  32.                   Copyright (C) 1989 Eagle Performance Software
  33.                               All Rights Reserved.
  34.  
  35.  
  36.  
  37.                                _______
  38.                           ____|__     |               (tm)
  39.                        --|       |    |-------------------
  40.                          |   ____|__  |  Association of
  41.                          |  |       |_|  Shareware
  42.                          |__|   o   |    Professionals
  43.                        -----|   |   |---------------------
  44.                             |___|___|    MEMBER
  45.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  46.  
  47.  
  48.  
  49.                        T A B L E   O F   C O N T E N T S
  50.  
  51.         1. INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . 4
  52.              Purpose . . . . . . . . . . . . . . . . . . . . . . . 4
  53.              Common Parameters . . . . . . . . . . . . . . . . . . 4
  54.              Attributes  . . . . . . . . . . . . . . . . . . . . . 5
  55.  
  56.         2. FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . . 6
  57.              accesswindow  . . . . . . . . . . . . . . . . . . . . 6
  58.              changeborder  . . . . . . . . . . . . . . . . . . . . 6
  59.              getlevelindex . . . . . . . . . . . . . . . . . . . . 6
  60.              heapok  . . . . . . . . . . . . . . . . . . . . . . . 7
  61.              hidewindow  . . . . . . . . . . . . . . . . . . . . . 7
  62.              initwindow  . . . . . . . . . . . . . . . . . . . . . 7
  63.              locatecursor  . . . . . . . . . . . . . . . . . . . . 7
  64.              makewindow  . . . . . . . . . . . . . . . . . . . . . 8
  65.              move16  . . . . . . . . . . . . . . . . . . . . . . . 8
  66.              movewindow  . . . . . . . . . . . . . . . . . . . . . 8
  67.              movewords . . . . . . . . . . . . . . . . . . . . . . 9
  68.              removewindow  . . . . . . . . . . . . . . . . . . . . 9
  69.              restoreborder . . . . . . . . . . . . . . . . . . . . 9
  70.              restoretcwindow . . . . . . . . . . . . . . . . . . . 10
  71.              setcursordefault  . . . . . . . . . . . . . . . . . . 10
  72.              setvirtualsize  . . . . . . . . . . . . . . . . . . . 10
  73.              setwindowmodes  . . . . . . . . . . . . . . . . . . . 11
  74.              showwindow  . . . . . . . . . . . . . . . . . . . . . 11
  75.              titlewindow . . . . . . . . . . . . . . . . . . . . . 12
  76.              vresizewindow . . . . . . . . . . . . . . . . . . . . 12
  77.              vscrollview . . . . . . . . . . . . . . . . . . . . . 12
  78.              vupdatecursor . . . . . . . . . . . . . . . . . . . . 12
  79.              vupdaterows . . . . . . . . . . . . . . . . . . . . . 13
  80.              vupdatetitles . . . . . . . . . . . . . . . . . . . . 13
  81.              vupdateview . . . . . . . . . . . . . . . . . . . . . 13
  82.              vupdatewindow . . . . . . . . . . . . . . . . . . . . 13
  83.              vviewrc . . . . . . . . . . . . . . . . . . . . . . . 14
  84.              vviewrcrel  . . . . . . . . . . . . . . . . . . . . . 14
  85.              vzoomwindow . . . . . . . . . . . . . . . . . . . . . 14
  86.              weosc . . . . . . . . . . . . . . . . . . . . . . . . 14
  87.              weosln  . . . . . . . . . . . . . . . . . . . . . . . 15
  88.              weostorc  . . . . . . . . . . . . . . . . . . . . . . 15
  89.              weosr . . . . . . . . . . . . . . . . . . . . . . . . 15
  90.              wbrdrh  . . . . . . . . . . . . . . . . . . . . . . . 15
  91.              wbrdrpart . . . . . . . . . . . . . . . . . . . . . . 16
  92.              wbrdrv  . . . . . . . . . . . . . . . . . . . . . . . 16
  93.              wclreol . . . . . . . . . . . . . . . . . . . . . . . 16
  94.              wclreos . . . . . . . . . . . . . . . . . . . . . . . 17
  95.              wclrfield . . . . . . . . . . . . . . . . . . . . . . 17
  96.              wclrfieldeos  . . . . . . . . . . . . . . . . . . . . 17
  97.              wclrline  . . . . . . . . . . . . . . . . . . . . . . 17
  98.              wclrscr . . . . . . . . . . . . . . . . . . . . . . . 18
  99.              wclrtitle . . . . . . . . . . . . . . . . . . . . . . 18
  100.              wdelline  . . . . . . . . . . . . . . . . . . . . . . 18
  101.              wgotoeos  . . . . . . . . . . . . . . . . . . . . . . 18
  102.              wgotorc . . . . . . . . . . . . . . . . . . . . . . . 19
  103.  
  104.  
  105.                                        2
  106.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  107.  
  108.  
  109.              winsline  . . . . . . . . . . . . . . . . . . . . . . 19
  110.              wlineh  . . . . . . . . . . . . . . . . . . . . . . . 19
  111.              wlinepart . . . . . . . . . . . . . . . . . . . . . . 20
  112.              wlinev  . . . . . . . . . . . . . . . . . . . . . . . 20
  113.              writeandviewpage  . . . . . . . . . . . . . . . . . . 20
  114.              writetocrt  . . . . . . . . . . . . . . . . . . . . . 21
  115.              writetohidden . . . . . . . . . . . . . . . . . . . . 21
  116.              writetopage . . . . . . . . . . . . . . . . . . . . . 21
  117.              writetovirtual  . . . . . . . . . . . . . . . . . . . 21
  118.              wscrolldown . . . . . . . . . . . . . . . . . . . . . 22
  119.              wscrollup . . . . . . . . . . . . . . . . . . . . . . 22
  120.              wwherec . . . . . . . . . . . . . . . . . . . . . . . 22
  121.              wwherer . . . . . . . . . . . . . . . . . . . . . . . 22
  122.              wwrite  . . . . . . . . . . . . . . . . . . . . . . . 23
  123.              wwritec . . . . . . . . . . . . . . . . . . . . . . . 23
  124.              wwrite_sub  . . . . . . . . . . . . . . . . . . . . . 24
  125.  
  126.         3. DATA STRUCTURE  . . . . . . . . . . . . . . . . . . . . 25
  127.              Basic Types . . . . . . . . . . . . . . . . . . . . . 25
  128.              Macros  . . . . . . . . . . . . . . . . . . . . . . . 27
  129.              Static Variables  . . . . . . . . . . . . . . . . . . 28
  130.              Dynamic Variables . . . . . . . . . . . . . . . . . . 31
  131.  
  132.         APPENDIX A:  MEMORY ALLOCATION . . . . . . . . . . . . . . 32
  133.              Global Memory . . . . . . . . . . . . . . . . . . . . 32
  134.              Dynamic Memory  . . . . . . . . . . . . . . . . . . . 32
  135.              Code Size . . . . . . . . . . . . . . . . . . . . . . 33
  136.  
  137.         APPENDIX B:  ERROR MESSAGES  . . . . . . . . . . . . . . . 34
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.                                        3
  167.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  168.  
  169.  
  170.    1.  I N T R O D U C T I O N
  171.  
  172.  
  173.    PURPOSE
  174.  
  175.    This document is a technical reference manual describing each routine and
  176.    variable in detail in a format similar to the TC manual.  The routines are
  177.    described in alphabetical order.  Since this manual is on disk, you can
  178.    find your interest easily with any search utility.
  179.  
  180.    Application - Because WNDWC uses QWIKC, all routines will perform in the
  181.    following applications:
  182.  
  183.      . All video text modes - 0, 1, 2, 3 and 7.
  184.      . Any column mode - 40, 80, or variable.
  185.      . For IBM PC, XT, AT, PCjr, PC convertible, all PS/2 models, 3270 PC, and
  186.        compatibles.
  187.      . With MDA, CGA, EGA, MCGA, VGA, 8214/A, all Hercules video cards.
  188.      . Perform routines in both absolute and window-relative coordinates.
  189.  
  190.  
  191.    COMMON PARAMETERS
  192.  
  193.    Common Parameters - Most procedures use the same parameters.  Rather than
  194.    repeating them for each routine, detailed descriptions for those parameters
  195.    are listed below.
  196.  
  197.    Window Coordinates - Unless otherwise stated, all WNDWC routines work in
  198.    window-relative coordinates.  For simplicity, virtual routines check for
  199.    bounds to keep routines confined to the windows and screen.  However, to be
  200.    fast, some other routines indicated in this document do not check for
  201.    bounds in the windows or on the screen, so be sure to stay in range.  The
  202.    upper left column in a window is row 1, column 1, which is also called a
  203.    1-based coordinate system.
  204.  
  205.    row/col - row and col were chosen in lieu of the X/Y scheme used in TC.
  206.    Since WNDWC is for only text modes, the screen is treated like a word
  207.    processor with rows and columns.  It is more intuitive to use the X/Y
  208.    scheme in graphics and the row/col scheme for text.
  209.  
  210.    rows/cols - Using rows/cols is much easier than row2/col2 to describe the
  211.    height and width of a block such as:
  212.  
  213.       void makewindow( row, col, rows, cols, wattr, battr, border, name );
  214.  
  215.    Should you decide to move the window, only row and col need to be changed,
  216.    and therefore rows and cols don't need to be mentally recalculated and
  217.    altered.  Please keep cols limited to one row.
  218.  
  219.    numofrows/numofcols - These parameters indicate a relative shift from a
  220.    given point that can be positive or negative.
  221.  
  222.    astr - The window-relative writing routines wwrite and wwritec actually use
  223.    QWIKC to write this string.
  224.  
  225.  
  226.  
  227.    Chapter 1, Introduction                                             Page 4
  228.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  229.  
  230.  
  231.  
  232.    ATTRIBUTES
  233.  
  234.    *attr - Use the convenient attribute macros for the foreground and
  235.    background colors supplied in the QWIKC unit rather than having to use TC
  236.    functions or procedures to get a desired color, for example:
  237.  
  238.      makewindow( 1, 1, 8, 8, WHITE+BLUE_BG, YELLOW+BLUE_BG, SINGLE_BORDER,
  239.                  AWINDOW );
  240.  
  241.    will make a window with a white on blue window and yellow on blue border.
  242.    All subsequent routines will use these attributes for writing.  Turbo C's
  243.    textattr function is called, setting the attribute to the window attribute
  244.    in case TC's screen functions are used.  The foreground macros in QWIKC are
  245.    duplicates of those in TC's conio.h and are repeated here for convenience:
  246.  
  247.      BLACK         0x00       DARKGRAY      0x08
  248.      BLUE          0x01       LIGHTBLUE     0x09
  249.      GREEN         0x02       LIGHTGREEN    0x0A
  250.      CYAN          0x03       LIGHTCYAN     0x0B
  251.      RED           0x04       LIGHTRED      0x0C
  252.      MAGENTA       0x05       LIGHTMAGENTA  0x0D
  253.      BROWN         0x06       YELLOW        0x0E
  254.      LIGHTGRAY     0x07       WHITE         0x0F
  255.      BLINK         0x80
  256.  
  257.    In addition, the QWIKC background color constants were included to take
  258.    advantage of macro addition.
  259.  
  260.      BLACK_BG     0x00
  261.      BLUE_BG      0x10
  262.      GREEN_BG     0x20
  263.      CYAN_BG      0x30
  264.      RED_BG       0x40
  265.      MAGENTA_BG   0x50
  266.      BROWN_BG     0x60
  267.      LIGHTGRAY_BG 0x70
  268.      SAMEATTR     -1
  269.  
  270.    SAMEATTR - A powerful and unique feature of all WNDWC routines is the use
  271.    of the macro SAMEATTR.  If SAMEATTR, or a negative value, is used as an
  272.    attribute, the routine will suppress any changes to the attributes and use
  273.    what is currently on the screen.
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.    Chapter 1, Introduction                                             Page 5
  289.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  290.  
  291.  
  292.    2.  F U N C T I O N S
  293.  
  294.    In this section, a detailed description is provided for each function.
  295.  
  296.  
  297.    ---------------------------------------------------------------------------
  298.    accesswindow                                                          WNDWC
  299.    ---------------------------------------------------------------------------
  300.    Function       Randomly accesses a covered window and places it on the top.
  301.                   If the window is hidden, it uses showwindow to put it on
  302.                   top.
  303.    Syntax         void accesswindow( int windowname );
  304.    Remarks        All underlays are properly updated in the heap with a high
  305.                   speed technique.  If NOACCESSMODE has been set for this
  306.                   window or an invalid window name is used, the function is
  307.                   simply ignored.  Virtual windows are updated after being
  308.                   shown.  Zoom effect is optional.  The wndwstat array is
  309.                   shuffled to match the new levels.
  310.    Return value   None.
  311.    Screens        All video pages.
  312.    EOS            Restored to new window.
  313.    Restrictions   Shadows are permitted, but exposed corners on lower level
  314.                   windows with shadows will not be updated until moved.  For
  315.                   human factors, shadows are only recommended for the top
  316.                   window anyway.
  317.    Heap           Temporarily uses (underlay size * 1.5).
  318.    Upon return    Forced to write to CRT.
  319.    See also       hidewindow, showwindow
  320.  
  321.    ---------------------------------------------------------------------------
  322.    changeborder                                                          WNDWC
  323.    ---------------------------------------------------------------------------
  324.    Function       Changes the border to a new border style.
  325.    Syntax         void changeborder( int newbrdr );
  326.    Remarks        The original border style is already saved in viewbrdr.  The
  327.                   current border is changed by searching for a match of wsbrdr
  328.                   for each border part with the current attribute.  If a match
  329.                   is found, it is replaced with newbrdr.  Tees as well as
  330.                   virtual borders are also replaced.  The original border can
  331.                   later be restored with restoreborder.
  332.    Return value   None.
  333.    Screens        All video pages.
  334.    EOS            Restored to CRT.
  335.    Restrictions   NO_BORDER is ignored as either the original or new border.
  336.    Upon return    Forced to write to CRT.
  337.    See also       restoreborder
  338.  
  339.    ---------------------------------------------------------------------------
  340.    getlevelindex                                                         WNDWC
  341.    ---------------------------------------------------------------------------
  342.    Function       Returns the wndwstat index given the windowname.
  343.    Syntax         int getlevelindex( int windowname );
  344.    Remarks        This routine scans for the first matching windowname.  It
  345.                   scans from the top level index (li) first and then down.
  346.                   Hidden windows from the hidden level index (hli) up are
  347.  
  348.  
  349.    Chapter 2, Procedures and Functions                                 Page 6
  350.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  351.  
  352.  
  353.                   scanned last.  If no match is found, the result is
  354.                   >MAXWINDOW.
  355.    Return value   None.
  356.  
  357.    ---------------------------------------------------------------------------
  358.    heapok                                                                WNDWC
  359.    ---------------------------------------------------------------------------
  360.    Function       Returns 1 if enough far heap space is available for
  361.                   allocation using farmalloc or farcalloc.
  362.    Syntax         void heapok( int numofbytes );
  363.    Remarks        If there is insufficient heap, the program terminates by
  364.                   calling showgoof.  The error window will display coreleft
  365.                   and farcoreleft.  All WNDWC functions that use the heap call
  366.                   this routine.
  367.    Return value   Returns 1 on success, calls showgoof on failure.
  368.  
  369.    ---------------------------------------------------------------------------
  370.    hidewindow                                                            WNDWC
  371.    ---------------------------------------------------------------------------
  372.    Function       Hides the current top window on the CRT.
  373.    Syntax         void hidewindow(void);
  374.    Remarks        The window is saved in RAM and the underlay is restored on
  375.                   the screen showing the new top window.  If NOHIDEMODE has
  376.                   been set for this window, the procedure is ignored.  The
  377.                   windows are saved with the border, but without any shadow.
  378.    Return value   None.
  379.    Screens        All video pages.
  380.    EOS            Altered to (wrow,wcol) before hiding, then restored to the
  381.                   new top window.
  382.    Heap           Temporarily uses (underlay size * 1.5).
  383.    Upon return    Forced to write to CRT.
  384.    See also       showwindow
  385.  
  386.    ---------------------------------------------------------------------------
  387.    initwindow                                                            WNDWC
  388.    ---------------------------------------------------------------------------
  389.    Function       Initializes static data for WNDWC routines.  In brief, it
  390.                   sets the defaults for wndwstat, indexes and margins for each
  391.                   video page, and calls qinit.
  392.    Syntax         void initwindow( int wattr, int clearscr, char cursorok );
  393.    Remarks        This is the first routine required to be called early in the
  394.                   main program and only needs to be done once.  wattr is the
  395.                   attribute for the full screen (WINDOW0) for all video pages.
  396.                   If clearscr is 1, then all video pages are cleared with
  397.                   wattr.  Over 50 variables are initialized with this
  398.                   function.  qinit is also called.  See initwindow source code
  399.                   for details.
  400.    Return value   None.
  401.    EOS            Set to (1,1).
  402.    Heap           Allocates virtualstat and pagestat pointers as required.
  403.    See also       setcursordefault, WNDWC21.DOC and Data Structure section.
  404.  
  405.    ---------------------------------------------------------------------------
  406.    locatecursor                                                          WNDWC
  407.    ---------------------------------------------------------------------------
  408.  
  409.  
  410.    Chapter 2, Procedures and Functions                                 Page 7
  411.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  412.  
  413.  
  414.    Function       Locates the cursor within the window.
  415.    Syntax         void locatecursor(void);
  416.    Remarks        This routine, a subroutine of restoretcwindow, locates the
  417.                   cursor as set in the wndwstat for fixed or virtual windows.
  418.                   It is usually handled automatically, but is available for
  419.                   handling exceptions.  vupdatecursor is called by
  420.                   locatecursor.
  421.    Return value   None.
  422.    Screens        All video pages.
  423.    See also       restoretcwindow, vupdatecursor
  424.  
  425.    ---------------------------------------------------------------------------
  426.    makewindow                                                            WNDWC
  427.    ---------------------------------------------------------------------------
  428.    Function       Makes a window.
  429.    Syntax         void makewindow( unsigned char row, unsigned char col,
  430.                                    unsigned char rows, unsigned char cols,
  431.                                    int wattr, int battr, int brdrsel,
  432.                                    int windowname );
  433.    Remarks        This is the main routine to create windows.  row, col, rows,
  434.                   and cols are the absolute coordinates for the window
  435.                   inclusive of any border.  For RELMODE, (row,col) is window
  436.                   relative.  wattr and battr are the window and border
  437.                   attributes, respectively (SAMEATTR is permitted).  brdrsel
  438.                   is the selection of one of 15 different borders.  windowname
  439.                   is a unique window name required for random access.  EOS set
  440.                   to (1,1).
  441.    Return value   None.
  442.    Screens        All video pages.
  443.    Restrictions   Minimum size - (1x1) without borders, (3x3) with borders.
  444.    Heap           Allocates underlay size until removed.
  445.    See also       setwindowmodes, removewindow
  446.  
  447.    ---------------------------------------------------------------------------
  448.    move16                                                                WNDWC
  449.    ---------------------------------------------------------------------------
  450.    Function       Copies a specified number of contiguous bytes from a source
  451.                   range to a destination range.
  452.    Syntax         void move16( void far *source, void far *dest,
  453.                                int numofbytes );
  454.    Remarks        move16 is a suitable replacement for memcpy, and is faster
  455.                   since it uses 16-bit transfers.  Overlap of data space is
  456.                   allowed.
  457.    Return value   None.
  458.    See also       movewords
  459.  
  460.    ---------------------------------------------------------------------------
  461.    movewindow                                                            WNDWC
  462.    ---------------------------------------------------------------------------
  463.    Function       Moves the current top window on the CRT a relative number of
  464.                   rows and columns.
  465.    Syntax         void movewindow( int numofrows, int numofcols );
  466.    Remarks        If NOMOVEMODE or PERMMODE has been set for this window, the
  467.                   function does nothing.  Shadows are fully supported.
  468.                   Margins are respected.
  469.  
  470.  
  471.    Chapter 2, Procedures and Functions                                 Page 8
  472.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  473.  
  474.  
  475.    Return value   None.
  476.    Screens        All video pages.
  477.    EOS            Moved relatively to the same place.
  478.    Heap           Maximum requirement is full screen size plus the underlay
  479.                   size.
  480.    Upon return    Forced to write to CRT.
  481.    See also       showwindow
  482.  
  483.    ---------------------------------------------------------------------------
  484.    movewords                                                             WNDWC
  485.    ---------------------------------------------------------------------------
  486.    Function       Copies a specified number of contiguous bytes from a source
  487.                   range to a destination range.
  488.    Syntax         void movewords( int far *source, int far *dest,
  489.                                   int numofwords );
  490.    Remarks        Even faster than move16.
  491.    Return value   None.
  492.    Restrictions   source[0] and dest must not overlap.
  493.    See also       move16
  494.  
  495.    ---------------------------------------------------------------------------
  496.    removewindow                                                          WNDWC
  497.    ---------------------------------------------------------------------------
  498.    Function       Removes the current top window on the CRT.
  499.    Syntax         void removewindow(void);
  500.    Remarks        Basically, the top window is removed, restoring the
  501.                   underlay, and then erased from memory.  Depending on the
  502.                   window mode, removewindow responds differently:
  503.  
  504.                     RELMODE     - The window-relative stats are simply
  505.                                   replaced with the parent window stats.
  506.                     PERMMODE    - The stats are simply dropped from the stack.
  507.                     VIRTUALMODE - The virtual screen is additionally removed
  508.                                   from the heap.
  509.  
  510.    Return value   None.
  511.    Screens        All video pages.
  512.    EOS            Restored to the new top window.
  513.    Heap           Deallocates the underlay.
  514.    Upon return    Forced to write to CRT.
  515.    See also       makewindow
  516.  
  517.    ---------------------------------------------------------------------------
  518.    restoreborder                                                         WNDWC
  519.    ---------------------------------------------------------------------------
  520.    Function       Restores the border to the original border style.
  521.    Syntax         void restoreborder(void);
  522.    Remarks        Reverses the effect of changeborder by replacing the current
  523.                   border style back to the original.
  524.    Return value   None.
  525.    Screens        All video pages.
  526.    EOS            Restored to CRT.
  527.    Upon return    Forced to write to CRT.
  528.    See also       changeborder
  529.  
  530.  
  531.  
  532.    Chapter 2, Procedures and Functions                                 Page 9
  533.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  534.  
  535.  
  536.    ---------------------------------------------------------------------------
  537.    restoretcwindow                                                       WNDWC
  538.    ---------------------------------------------------------------------------
  539.    Function       Restores attributes, cursor, and EOS marker for the current
  540.                   window.
  541.    Syntax         void restoretcwindow(void);
  542.    Remarks        Usually this procedure is handled automatically.  If there
  543.                   is some exception in handling, then this procedure can be
  544.                   used.  It does the following:
  545.  
  546.                     . Resets TC's textattr and QWIKC's scroll_attr to
  547.                       tws.origattr
  548.                     . Restores TC's text window
  549.                     . Resets EOS marker to last saved location
  550.                     . Resets cursor mode
  551.                     . Locates cursor with locatecursor
  552.  
  553.    Return value   None.
  554.    Screens        All video pages.
  555.    EOS            Restored.
  556.    See also       locatecursor
  557.  
  558.    ---------------------------------------------------------------------------
  559.    setcursordefault                                                      WNDWC
  560.    ---------------------------------------------------------------------------
  561.    Function       Sets the default cursor mode to be used by makewindow.
  562.    Syntax         void setcursordefault( int cursormode );
  563.    Remarks        This routine simply assigns a value to the global variable
  564.                   cursordefault.  This value is already assigned by initwindow
  565.                   to the current cursor mode.  If a specific cursor mode is
  566.                   required for the initial window as well, use setcursor
  567.                   instead before initwindow.
  568.    Return value   None.
  569.    See also       initwindow, makewindow, setcursor (QWIKC)
  570.  
  571.    ---------------------------------------------------------------------------
  572.    setvirtualsize                                                        WNDWC
  573.    ---------------------------------------------------------------------------
  574.    Function       Sets the dimensions for the virtual screen of virtual
  575.                   windows.
  576.    Syntax         void setvirtualsize( unsigned char rows,
  577.                                        unsigned char cols );
  578.    Remarks        This optional function sets the rows-by-columns dimensions
  579.                   for a virtual screen.  Keep in mind that two additional rows
  580.                   will be internally added for titles if borders are used.
  581.                   The default at startup is the CRT screen size.
  582.    Return value   None.
  583.    Restrictions   Maximum buffer size is 64k.
  584.    See also       makewindow
  585.    Example        To set the size for a virtual screen with 80 columns and a
  586.                   maximum number of rows:
  587.  
  588.                     setvirtualsize( 253, 80 );
  589.  
  590.                   The resulting size would be (253+2)*80*2 = 40,800 bytes
  591.  
  592.  
  593.    Chapter 2, Procedures and Functions                                 Page 10
  594.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  595.  
  596.  
  597.                   which is under 64k.  Rows 254 and 255 would be reserved for
  598.                   top and bottom titles on the border.
  599.  
  600.    ---------------------------------------------------------------------------
  601.    setwindowmodes                                                        WNDWC
  602.    ---------------------------------------------------------------------------
  603.    Function       Sets the window modes to be used by makewindow.
  604.    Syntax         void setwindowmodes( int sumofallmodes );
  605.    Remarks        There are several different modes that can be used:
  606.  
  607.       RELMODE       - Window-relative frame of reference, no underlay
  608.       PERMMODE      - Can't be moved or removed, no underlay
  609.       SHADOWLEFT    - Shadow on the left side
  610.       SHADOWRIGHT   - Shadow on the right side
  611.       ZOOMMODE      - Zoom effect on make, show and accesswindow
  612.       HIDDENMODE    - Create window as hidden
  613.       VIRTUALMODE   - Create virtual screen as well
  614.       CURSOROFFMODE - Leaves cursor off for window
  615.       SEETHRUMODE   - Doesn't clear area inside window
  616.       NOHIDEMODE    - Ignores request to hide window
  617.       NOACCESSMODE  - Ignores request to access window
  618.       NOMOVEMODE    - Ignores request to move/resize window
  619.  
  620.                   The startup mode is equivalent to zero while the base window
  621.                   is PERMMODE.  The modes should be summed logically, but can
  622.                   also be done arithmetically with care.  All PERMMODE windows
  623.                   must be created first.
  624.    Return value   None.
  625.    See also       makewindow
  626.    Example        Set the modes for the next window to have a right shadow,
  627.                   zoom effect, cursor off, and a virtual screen:
  628.  
  629.                     setwindowmodes( SHADOWRIGHT | ZOOMMODE | CURSOROFFMODE
  630.                                     | VIRTUALMODE );
  631.  
  632.    Example        Set the modes back to defaults:
  633.  
  634.                     setwindowmodes( 0 );
  635.  
  636.    ---------------------------------------------------------------------------
  637.    showwindow                                                            WNDWC
  638.    ---------------------------------------------------------------------------
  639.    Function       Shows a hidden window to become the current top window on
  640.                   the CRT.
  641.    Syntax         void showwindow( int windowname );
  642.    Remarks        The underlay is saved from the screen and the window is
  643.                   restored from RAM to become the new top window.  Invalid
  644.                   window names are simply ignored.  Virtual windows are
  645.                   updated before being shown.  Zoom effect is optional.
  646.    Return value   None.
  647.    Screens        All video pages.
  648.    EOS            Set to (1,1).
  649.    Heap           Temporarily uses (underlay size * 1.5).
  650.    Upon return    Forced to write to CRT.
  651.    See also       hidewindow, accesswindow
  652.  
  653.  
  654.    Chapter 2, Procedures and Functions                                 Page 11
  655.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  656.  
  657.  
  658.  
  659.    ---------------------------------------------------------------------------
  660.    titlewindow                                                           WNDWC
  661.    ---------------------------------------------------------------------------
  662.    Function       Places a title on the current window.
  663.    Syntax         void titlewindow( int toporbottom, int justify,
  664.                                     int titleattr, char *title );
  665.    Remarks        There are six positions where the title can be placed in any
  666.                   combination of TOP or BOTTOM, and LEFT, CENTER, or RIGHT.
  667.                   titleattr is the title attribute (SAMEATTR is permitted).
  668.                   The titles can be written to hidden windows or virtual
  669.                   screens as well.  titleofs can be adjusted for
  670.                   justification.
  671.    Return value   None.
  672.    Screens        All video pages.
  673.    EOS            Unaltered.
  674.    See also       titleofs in Data Structure section.
  675.  
  676.    ---------------------------------------------------------------------------
  677.    vresizewindow                                                         WNDWC
  678.    ---------------------------------------------------------------------------
  679.    Function       Resizes the current top virtual window.
  680.    Syntax         void vresizewindow( int numofrows, int numofcols );
  681.    Remarks        The top window is resized by moving the right and/or bottom
  682.                   border.  If NOMOVEMODE or PERMMODE has been set for this
  683.                   window, the function does nothing.  Shadows are fully
  684.                   supported.  Margins are respected.
  685.    Return value   None.
  686.    Restrictions   None.
  687.    Heap           Maximum requirement is full screen size plus the underlay
  688.                   size.
  689.    Upon return    Forced to write to CRT.
  690.    See also       vzoomwindow
  691.  
  692.    ---------------------------------------------------------------------------
  693.    vscrollview                                                           WNDWC
  694.    ---------------------------------------------------------------------------
  695.    Function       Alters the upper left viewing reference point of the current
  696.                   virtual screen by a relative number of rows and columns.
  697.                   The view window is also updated no matter where its location
  698.                   even if hidden or overlapped.
  699.    Syntax         void vscrollview( int numofrows, int numofcols );
  700.    Remarks        The reference point may be adjusted to keep the viewing
  701.                   window within the virtual window limits.  Works in any
  702.                   "writeto" mode.
  703.    Return value   None.
  704.    Restrictions   None.
  705.    Heap           If covered, wsrows * wcols * 5 bytes is temporarily used.
  706.    See also       vviewrc, vviewrcrel
  707.  
  708.    ---------------------------------------------------------------------------
  709.    vupdatecursor                                                         WNDWC
  710.    ---------------------------------------------------------------------------
  711.    Function       Updates the current virtual window cursor if it is the top
  712.                   window on the CRT.
  713.  
  714.  
  715.    Chapter 2, Procedures and Functions                                 Page 12
  716.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  717.  
  718.  
  719.    Syntax         void vupdatecursor(void);
  720.    Remarks        When the cursor is moved on the virtual screen, the cursor
  721.                   may or may not be seen in the view.  This routine updates
  722.                   the location.  Works in any "writeto" mode.
  723.    Return value   None.
  724.    See also       vupdatetitles, vupdateview, vupdatewindow
  725.  
  726.    ---------------------------------------------------------------------------
  727.    vupdaterows                                                           WNDWC
  728.    ---------------------------------------------------------------------------
  729.    Function       Updates certain rows in the current virtual window view only
  730.                   on the top window.
  731.    Syntax         void vupdaterows( unsigned char row, unsigned char rows );
  732.    Remarks        This routine is primarily used for fast response for spot
  733.                   updates for data entry or the like where the fastest speed
  734.                   is desirable.  If the window is not the top window, the
  735.                   entire view is updated.
  736.    Return value   None.
  737.    See also       vupdateview, vupdatewindow
  738.  
  739.    ---------------------------------------------------------------------------
  740.    vupdatetitles                                                         WNDWC
  741.    ---------------------------------------------------------------------------
  742.    Function       Updates the current virtual window titles.  It is also
  743.                   updated no matter where its location even if hidden or
  744.                   overlapped.
  745.    Syntax         void vupdatetitles(void);
  746.    Remarks        This routine updates the titles to the window and truncates
  747.                   them to fit in the current view.  Works in any "writeto"
  748.                   mode.
  749.    Return value   None.
  750.    Heap           If covered, wsrows * wcols * 5 bytes is temporarily used.
  751.    See also       vupdatecursor, vupdateview, vupdatewindow
  752.  
  753.    ---------------------------------------------------------------------------
  754.    vupdateview                                                           WNDWC
  755.    ---------------------------------------------------------------------------
  756.    Function       Updates the current virtual window view.  It is also updated
  757.                   no matter where its location even if hidden or overlapped.
  758.    Syntax         void vupdateview(void);
  759.    Remarks        This routine updates the full view of the window.  Works in
  760.                   any "writeto" mode.
  761.    Return value   None.
  762.    Heap           If covered, wsrows * wcols * 5 bytes is temporarily used.
  763.    See also       vupdaterows, vupdatetitles, vupdatewindow
  764.  
  765.    ---------------------------------------------------------------------------
  766.    vupdatewindow                                                         WNDWC
  767.    ---------------------------------------------------------------------------
  768.    Function       Updates the current virtual window including the view,
  769.                   titles and the cursor.  It is also updated no matter where
  770.                   its location even if hidden or overlapped.
  771.    Syntax         void vupdatewindow(void);
  772.    Remarks        This is the main routine to update virtual windows.  This
  773.                   routine simply executes three procedures: vupdatecursor,
  774.  
  775.  
  776.    Chapter 2, Procedures and Functions                                 Page 13
  777.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  778.  
  779.  
  780.                   vupdateview, and vupdatetitles.  Works in any "writeto"
  781.                   mode.
  782.    Return value   None.
  783.    Heap           If covered, wsrows * wcols * 5 bytes is temporarily used.
  784.    See also       vupdatecursor, vupdaterows, vupdatetitles, vupdateview
  785.  
  786.    ---------------------------------------------------------------------------
  787.    vviewrc                                                               WNDWC
  788.    ---------------------------------------------------------------------------
  789.    Function       Alters the upper left viewing reference point of the current
  790.                   virtual window.
  791.    Syntax         void vviewrc( unsigned char row, unsigned char col );
  792.    Remarks        The reference point may be adjusted to keep the viewing
  793.                   window within the virtual window limits.  Works in any
  794.                   "writeto" mode.  It does not update the viewing window.
  795.    Return value   None.
  796.    Restrictions   None.
  797.    See also       vviewrcrel, vscrollview
  798.  
  799.    ---------------------------------------------------------------------------
  800.    vviewrcrel                                                            WNDWC
  801.    ---------------------------------------------------------------------------
  802.    Function       Alters the upper left viewing reference point of the current
  803.                   virtual window by a relative number of rows and columns.
  804.    Syntax         void vviewrcrel( int numofrows, int numofcols );
  805.    Remarks        The reference point may be adjusted to keep the viewing
  806.                   window within the virtual window limits.  Works in any
  807.                   "writeto" mode.  It does not update the viewing window.
  808.    Return value   None.
  809.    Restrictions   None.
  810.    See also       vviewrc, vscrollview
  811.  
  812.    ---------------------------------------------------------------------------
  813.    vzoomwindow                                                           WNDWC
  814.    ---------------------------------------------------------------------------
  815.    Function       Toggles top virtual window between full screen size and
  816.                   original size.
  817.    Syntax         void vzoomwindow(void);
  818.    Remarks        If the window is less than full size, the window is zoomed
  819.                   to full size and centered if necessary.  Executing the
  820.                   function again will restore the size and location of this
  821.                   window.  If NOMOVEMODE or PERMMODE has been set for this
  822.                   window, the function does nothing.  Shadows are fully
  823.                   supported.  Margins are respected.
  824.    Return value   None.
  825.    Heap           Maximum requirement is full screen size plus the underlay
  826.                   size.
  827.    Upon return    Forced to write to CRT.
  828.    See also       vresizewindow
  829.  
  830.    ---------------------------------------------------------------------------
  831.    weosc                                                                 WNDWC
  832.    ---------------------------------------------------------------------------
  833.    Function       Returns the window-relative column of the EOS marker.
  834.    Syntax         unsigned char weosc(void);
  835.  
  836.  
  837.    Chapter 2, Procedures and Functions                                 Page 14
  838.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  839.  
  840.  
  841.    Remarks        Operates on the currently written screen.  The upper left
  842.                   corner of the window is (1,1).
  843.    Return value   weosc returns an unsigned char between 1 and 255.
  844.    Screens        All video pages and virtual screens.
  845.    See also       weosr, weostorc, weosln, wgotoeos
  846.  
  847.    ---------------------------------------------------------------------------
  848.    weosln                                                                WNDWC
  849.    ---------------------------------------------------------------------------
  850.    Function       Moves the EOS marker to column 1 of the next window-relative
  851.                   row with a possible scroll up.
  852.    Syntax         void weosln(void);
  853.    Remarks        Operates on the currently written window.  If weosr becomes
  854.                   greater than the number of window rows, then the window will
  855.                   scroll up.  The new blank row will have the attribute set by
  856.                   wndwattr which is the window attribute.
  857.    Return value   None.
  858.    Screens        All video pages and virtual screens.
  859.    EOS            Updated to first cleared column of the cleared row.
  860.    See also       weosr, weosc, weostorc, wgotoeos
  861.  
  862.    ---------------------------------------------------------------------------
  863.    weostorc                                                              WNDWC
  864.    ---------------------------------------------------------------------------
  865.    Function       Positions the EOS marker relative to the current window.
  866.    Syntax         void weostorc( unsigned char row, unsigned char col );
  867.    Remarks        Use this function to manually locate the EOS marker.  All
  868.                   EOS functions will write where this marker is located on the
  869.                   currently written screen.
  870.    Return value   None.
  871.    Screens        All video pages and virtual screens.
  872.    EOS            Updated.
  873.    Restrictions   Stay within the window limits.
  874.    See also       QWIKC, weosr, weosc, weosln, wgotoeos
  875.  
  876.    ---------------------------------------------------------------------------
  877.    weosr                                                                 WNDWC
  878.    ---------------------------------------------------------------------------
  879.    Function       Returns the window-relative row of the EOS marker.
  880.    Syntax         unsigned char weosr(void);
  881.    Remarks        Operates on the currently written screen.  The upper left
  882.                   corner of the window is (1,1).
  883.    Return value   weosr returns an unsigned char between 1 and 255.
  884.    Screens        All video pages and virtual screens.
  885.    See also       weosc, weostorc, weosln, wgotoeos
  886.  
  887.    ---------------------------------------------------------------------------
  888.    wbrdrh                                                                WNDWC
  889.    ---------------------------------------------------------------------------
  890.    Function       Places a horizontal partition of the same type as the window
  891.                   border from edge to edge of the border.
  892.    Syntax         void wbrdrh( unsigned char row );
  893.    Remarks        This routine divides a window using wsbrdr and brdrattr from
  894.                   the top window record.  It provides a horizontal line
  895.                   complete with a tee on each end using parts BRDR_HL,
  896.  
  897.  
  898.    Chapter 2, Procedures and Functions                                 Page 15
  899.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  900.  
  901.  
  902.                   BRDR_LT, and BRDR_RT.  If brdrattr is set to SAMEATTR, then
  903.                   the attributes will remain the same on the screen.  If there
  904.                   is no border, the function does nothing.
  905.    Return value   None.
  906.    Screens        All video pages and virtual screens.
  907.    EOS            Unaltered.
  908.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  909.    See also       wbrdrpart, wbrdrv, wlineh, wlinepart, wlinev
  910.  
  911.    ---------------------------------------------------------------------------
  912.    wbrdrpart                                                             WNDWC
  913.    ---------------------------------------------------------------------------
  914.    Function       Places a single border part of the same type as the window
  915.                   border at a window-relative location.
  916.    Syntax         void wbrdrpart( unsigned char row, unsigned char col,
  917.                                   int part )
  918.    Remarks        This routine places the part using wsbrdr and brdrattr from
  919.                   the top window record.  It is usually used for crosses or
  920.                   tees, but there are 15 different parts that can be used.  If
  921.                   brdrattr is set to SAMEATTR, then the attributes will remain
  922.                   the same on the screen.  If there is no border, the function
  923.                   does nothing.
  924.    Return value   None.
  925.    Screens        All video pages and virtual screens.
  926.    EOS            Unaltered.
  927.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  928.    See also       wbrdrh, wbrdrpart, wlineh, wlinev, wlinepart
  929.  
  930.    ---------------------------------------------------------------------------
  931.    wbrdrv                                                                WNDWC
  932.    ---------------------------------------------------------------------------
  933.    Function       Places a vertical partition of the same type as the window
  934.                   border from edge to edge of the border.
  935.    Syntax         void wbrdrv( unsigned char row );
  936.    Remarks        This routine divides a window using wsbrdr and brdrattr from
  937.                   the top window record.  It provides a vertical line complete
  938.                   with a tee on each end using parts BRDR_VL, BRDR_TT, and
  939.                   BRDR_BT.  If brdrattr is set to SAMEATTR, then the
  940.                   attributes will remain the same on the screen.  If there is
  941.                   no border, the function does nothing.
  942.    Return value   None.
  943.    Screens        All video pages and virtual screens.
  944.    EOS            Unaltered.
  945.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  946.    See also       wbrdrh, wbrdrpart, wlineh, wlinev, wlinepart
  947.  
  948.    ---------------------------------------------------------------------------
  949.    wclreol                                                               WNDWC
  950.    ---------------------------------------------------------------------------
  951.    Function       Clears a row to End-Of-Line (EOL).
  952.    Syntax         void wclreol( unsigned char row, unsigned char col,
  953.                                 int attr );
  954.    Remarks        The row is cleared using the attribute attr (SAMEATTR is
  955.                   permitted).  To clear using the window attribute, pass attr
  956.                   as tws.wndwattr.
  957.  
  958.  
  959.    Chapter 2, Procedures and Functions                                 Page 16
  960.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  961.  
  962.  
  963.    Return value   None.
  964.    Screens        All video pages and virtual screens.
  965.    EOS            Set to (row,col).
  966.    Restrictions   Stay within window limits.
  967.    See also       wdelline, wclrline, wclreos
  968.  
  969.    ---------------------------------------------------------------------------
  970.    wclreos                                                               WNDWC
  971.    ---------------------------------------------------------------------------
  972.    Function       Clears a row from EOS to End-Of-Line.
  973.    Syntax         void wclreos( int attr );
  974.    Remarks        The row is cleared starting at the EOS marker using the
  975.                   attribute attr (SAMEATTR is permitted).  To clear using the
  976.                   window attribute, pass attr as tws.wndwattr.
  977.    Return value   None.
  978.    Screens        All video pages and virtual screens.
  979.    EOS            Unaltered.
  980.    Restrictions   Stay within window limits.
  981.    See also       wdelline, wclrline, wclreos
  982.  
  983.    ---------------------------------------------------------------------------
  984.    wclrfield                                                             WNDWC
  985.    ---------------------------------------------------------------------------
  986.    Function       Clears a field.
  987.    Syntax         void wclrfield( unsigned char row, unsigned char col,
  988.                                   unsigned char cols, int attr );
  989.    Remarks        The field is cleared starting at (row,col) using the
  990.                   attribute attr (SAMEATTR is permitted).  To clear using the
  991.                   window attribute, pass attr as tws.wndwattr.
  992.    Return value   None.
  993.    Screens        All video pages and virtual screens.
  994.    EOS            Set to (row,col).
  995.    Restrictions   Stay within window limits.
  996.    See also       wclreol, wclreos, wclrfieldeos
  997.  
  998.    ---------------------------------------------------------------------------
  999.    wclrfieldeos                                                          WNDWC
  1000.    ---------------------------------------------------------------------------
  1001.    Function       Clears a field starting at EOS.
  1002.    Syntax         void wclrfieldeos( unsigned char cols, int attr );
  1003.    Screens        All video pages and virtual screens.
  1004.    Remarks        The field is cleared starting at EOS using the attribute
  1005.                   attr (SAMEATTR is permitted).  To clear using the window
  1006.                   attribute, pass attr as tws.wndwattr.
  1007.    Return value   None.
  1008.    EOS            Unaltered.
  1009.    Restrictions   Stay within window limits.
  1010.    See also       wclreol, wclreos, wclrfield
  1011.  
  1012.    ---------------------------------------------------------------------------
  1013.    wclrline                                                              WNDWC
  1014.    ---------------------------------------------------------------------------
  1015.    Function       Clears a specified row.
  1016.    Syntax         void wclrline( unsigned char row );
  1017.    Remarks        The row is cleared using the window attribute tws.wndwattr
  1018.  
  1019.  
  1020.    Chapter 2, Procedures and Functions                                 Page 17
  1021.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1022.  
  1023.  
  1024.                   (SAMEATTR is permitted).
  1025.    Return value   None.
  1026.    Screens        All video pages and virtual screens.
  1027.    EOS            Set to (row,1).
  1028.    Restrictions   Stay within window limits.
  1029.    See also       wdelline, wclreol, wclreos
  1030.  
  1031.    ---------------------------------------------------------------------------
  1032.    wclrscr                                                               WNDWC
  1033.    ---------------------------------------------------------------------------
  1034.    Function       Clears the entire window.
  1035.    Syntax         void wclrscr(void);
  1036.    Remarks        Clears the screen using the window attribute tws.wndwattr
  1037.                   (SAMEATTR is permitted).
  1038.    Return value   None.
  1039.    Screens        All video pages and virtual screens.
  1040.    EOS            Set to (1,1).
  1041.    See also       wclrline, wdelline, winsline
  1042.  
  1043.    ---------------------------------------------------------------------------
  1044.    wclrtitle                                                             WNDWC
  1045.    ---------------------------------------------------------------------------
  1046.    Function       Clears the titles from the specified row.
  1047.    Syntax         void wclrtitle( int toporbottom );
  1048.    Remarks        Clears the top or bottom border where the titles are located
  1049.                   and restores the original border if any.  If wsbrdr is
  1050.                   NO_BORDER, the row is simply cleared.  Works on both fixed
  1051.                   and virtual titles.
  1052.    Return value   None.
  1053.    Screens        All video pages and virtual screens.
  1054.    EOS            Unaltered.
  1055.    See also       titlewindow, vupdatetitle
  1056.  
  1057.    ---------------------------------------------------------------------------
  1058.    wdelline                                                              WNDWC
  1059.    ---------------------------------------------------------------------------
  1060.    Function       Deletes a line at a specified row, scrolls up the remaining
  1061.                   part of the window and clears the bottom row.
  1062.    Syntax         void winsline( unsigned char row );
  1063.    Remarks        Similar to Turbo C's delline, the indicated row of the
  1064.                   window will be deleted.  The bottom row is cleared with
  1065.                   tws.wndwattr (SAMEATTR is permitted).  The cursor is not
  1066.                   moved, but is ready to be moved with wgotoeos as EOS is set
  1067.                   to the first column of the cleared row.
  1068.    Return value   None.
  1069.    Screens        All video pages and virtual screens.
  1070.    EOS            Updated to first cleared column of the cleared row.
  1071.    Restrictions   Stay within window limits.
  1072.    See also       winsline, wscrollup, wgotoeos
  1073.  
  1074.    ---------------------------------------------------------------------------
  1075.    wgotoeos                                                              WNDWC
  1076.    ---------------------------------------------------------------------------
  1077.    Function       Positions the cursor to match the EOS marker on both fixed
  1078.                   or virtual windows.
  1079.  
  1080.  
  1081.    Chapter 2, Procedures and Functions                                 Page 18
  1082.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1083.  
  1084.  
  1085.    Syntax         void wgotoeos(void);
  1086.    Remarks        The cursor is simply moved to match the position of the EOS
  1087.                   marker of the currently written video page.  tws.wswherer
  1088.                   and tws.wswherec are also updated.  For virtual windows,
  1089.                   this routine also calls vupdatecursor.
  1090.    Return value   None.
  1091.    Screens        All video pages and virtual screens.
  1092.    EOS            Unaltered.
  1093.    See also       weosr, weosc, weostorc, weosln, wgotorc, vupdatecursor
  1094.    Restrictions   EOS should be within window limits.
  1095.    Example        Center a string in a window and place the cursor at the end
  1096.                   of the string:
  1097.  
  1098.                     wwritec( 1, "Correct (Y/N)? " );
  1099.                     wgotoeos();
  1100.  
  1101.    ---------------------------------------------------------------------------
  1102.    wgotorc                                                               WNDWC
  1103.    ---------------------------------------------------------------------------
  1104.    Function       Positions the cursor relative to the window.
  1105.    Syntax         void wgotorc( unsigned char row, unsigned char col );
  1106.    Remarks        The cursor is positioned to the currently written window.
  1107.                   For virtual windows, this routine also calls vupdatecursor.
  1108.    Return value   None.
  1109.    Screens        All video pages and virtual screens.
  1110.    EOS            Unaltered.
  1111.    Restrictions   Stay within the window limits.
  1112.    See also       wgotoeos, wwherer, wwherec
  1113.  
  1114.    ---------------------------------------------------------------------------
  1115.    winsline                                                              WNDWC
  1116.    ---------------------------------------------------------------------------
  1117.    Function       Inserts a blank line at a specified row using the window
  1118.                   attribute tws.wndwattr scrolling down the remaining part.
  1119.    Syntax         void winsline( unsigned char row );
  1120.    Remarks        Similar to Turbo C's insline, the indicated row of the
  1121.                   window is scrolled down and then cleared (SAMEATTR is
  1122.                   permitted).  The cursor is not moved, but is ready to be
  1123.                   moved with wgotoeos as EOS is set to the first column of the
  1124.                   cleared row.
  1125.    Return value   None.
  1126.    Screens        All video pages and virtual screens.
  1127.    EOS            Updated to first cleared column of the cleared row.
  1128.    Restrictions   Stay within window limits.
  1129.    See also       wdelline, wscrolldown, wgotoeos
  1130.  
  1131.    ---------------------------------------------------------------------------
  1132.    wlineh                                                                WNDWC
  1133.    ---------------------------------------------------------------------------
  1134.    Function       Places a horizontal line in the window using the window line
  1135.                   set.
  1136.    Syntax         void wlineh( unsigned char row, unsigned char col,
  1137.                                unsigned char cols );
  1138.    Remarks        This routine divides a window using wsline and wndwattr from
  1139.                   the top window record.  It provides just a horizontal line
  1140.  
  1141.  
  1142.    Chapter 2, Procedures and Functions                                 Page 19
  1143.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1144.  
  1145.  
  1146.                   using part BRDR_HL.  If wndwattr is set to SAMEATTR, then
  1147.                   the attributes will remain the same on the screen.  If
  1148.                   wsline=nobrdr, then the function does nothing.
  1149.    Return value   None.
  1150.    Screens        All video pages and virtual screens.
  1151.    EOS            Updated.
  1152.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  1153.    See also       wbrdrh, wbrdrpart, wbrdrv, wlinepart, wlinev
  1154.  
  1155.    ---------------------------------------------------------------------------
  1156.    wlinepart                                                             WNDWC
  1157.    ---------------------------------------------------------------------------
  1158.    Function       Places a single line part of the same type as the window
  1159.                   line set at a window-relative location.
  1160.    Syntax         void wlinepart( unsigned char row, unsigned char col,
  1161.                                   int part );
  1162.    Remarks        This routine places the part using wsline and wndwattr from
  1163.                   the top window record.  It is usually used for crosses or
  1164.                   tees, but there are 15 different parts that can be used.  If
  1165.                   SAMEATTR is used for wndwattr, then the attributes will
  1166.                   remain the same on the screen.  If wsline=NO_BORDER, the
  1167.                   function is ignored.
  1168.    Return value   None.
  1169.    Screens        All video pages and virtual screens.
  1170.    EOS            Updated.
  1171.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  1172.    See also       wbrdrh, wbrdrpart, wbrdrv, wlineh, wlinev
  1173.  
  1174.    ---------------------------------------------------------------------------
  1175.    wlinev                                                                WNDWC
  1176.    ---------------------------------------------------------------------------
  1177.    Function       Places a vertical line in the window using the window line
  1178.                   set.
  1179.    Syntax         void wlinev( unsigned char row, unsigned char col,
  1180.                                char rows );
  1181.    Remarks        This routine divides a window using wsline and wndwattr from
  1182.                   the top window record.  It provides just a vertical line
  1183.                   using part BRDR_VL.  If wndwattr is set to SAMEATTR, then
  1184.                   the attributes will remain the same on the screen.  If
  1185.                   wsline=NO_BORDER, then the function does nothing.
  1186.    Return value   None.
  1187.    Screens        All video pages and virtual screens.
  1188.    EOS            Updated.
  1189.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  1190.    See also       wbrdrh, wbrdrpart, wbrdrv, wlineh, wlinepart
  1191.  
  1192.    ---------------------------------------------------------------------------
  1193.    writeandviewpage                                                      WNDWC
  1194.    ---------------------------------------------------------------------------
  1195.    Function       Changes the video page to be both viewed and written on the
  1196.                   CRT.
  1197.    Syntax         void writeandviewpage( char pagenum );
  1198.    Remarks        If another video page is available, this routine will switch
  1199.                   to both view and write to that page.  It does nothing if
  1200.                   pagenum is already the currently written video page
  1201.  
  1202.  
  1203.    Chapter 2, Procedures and Functions                                 Page 20
  1204.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1205.  
  1206.  
  1207.                   (qvideo_page) and viewed page (videopage), or if pagenum is
  1208.                   invalid.  All wndwstats are swapped to exact same conditions
  1209.                   as before.
  1210.    Return value   None.
  1211.    Screens        All video pages.
  1212.    EOS            Restored to new page.
  1213.    See also       writetopage, QWIKC
  1214.  
  1215.    ---------------------------------------------------------------------------
  1216.    writetocrt                                                           WNDWC
  1217.    ---------------------------------------------------------------------------
  1218.    Function       Prepares QWIKC and WNDWC to write to the top window on the
  1219.                   CRT and restores TC's window.
  1220.    Syntax         void writetocrt(void);
  1221.    Remarks        This function switches back to writing to the top window on
  1222.                   the CRT after writing to a hidden window or virtual screen.
  1223.    Return value   None.
  1224.    Screens        Back to any video page.
  1225.    EOS            Restored to top window.
  1226.    See also       writetohidden, writetovirtual
  1227.  
  1228.    ---------------------------------------------------------------------------
  1229.    writetohidden                                                         WNDWC
  1230.    ---------------------------------------------------------------------------
  1231.    Function       Prepares QWIKC and WNDWC to write to a hidden window.
  1232.    Syntax         void writetohidden( int windowname );
  1233.    Remarks        This function switches to writing to a hidden window.  The
  1234.                   window must be a valid window name, otherwise the program is
  1235.                   terminated with an error message.
  1236.    Return value   None.
  1237.    EOS            Restored to hidden window.
  1238.    See also       writetocrt, writetovirtual
  1239.  
  1240.    ---------------------------------------------------------------------------
  1241.    writetopage                                                           WNDWC
  1242.    ---------------------------------------------------------------------------
  1243.    Function       Changes the video page on which the WNDWC routines write
  1244.                   without changing the viewed page.
  1245.    Syntax         void writetopage( char pagenum );
  1246.    Remarks        If another video page is available, this routine will switch
  1247.                   to write to that page.  It does nothing if pagenum is
  1248.                   already the currently written video page (qvideo_page) or if
  1249.                   the page is invalid.  All wndwstats are swapped to exact
  1250.                   same conditions as before.
  1251.    Return value   None.
  1252.    Screens        All video pages.
  1253.    EOS            Restored to new page.
  1254.    See also       writeandviewpage, QWIKC
  1255.  
  1256.    ---------------------------------------------------------------------------
  1257.    writetovirtual                                                        WNDWC
  1258.    ---------------------------------------------------------------------------
  1259.    Function       Prepares QWIKC and WNDWC to write to a virtual screen.
  1260.    Syntax         void writetovirtual( int windowname );
  1261.    Remarks        This function switches to writing to a virtual screen.  The
  1262.  
  1263.  
  1264.    Chapter 2, Procedures and Functions                                 Page 21
  1265.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1266.  
  1267.  
  1268.                   window must be a valid window name, otherwise, the program
  1269.                   is terminated with an error message.
  1270.    Return value   None.
  1271.    EOS            Restored to virtual screen.
  1272.    See also       writetocrt, writetohidden
  1273.  
  1274.    ---------------------------------------------------------------------------
  1275.    wscrolldown                                                           WNDWC
  1276.    ---------------------------------------------------------------------------
  1277.    Function       Scrolls the current window down and clears the top row with
  1278.                   the window attribute wndwattr.
  1279.    Syntax         void wscrolldown(void);
  1280.    Remarks        The last row of the window will be scrolled out and lost
  1281.                   while the first row will be cleared (SAMEATTR is permitted).
  1282.                   The cursor is not moved, but is ready to be moved with
  1283.                   wgotoeos as EOS is set to the first column of the cleared
  1284.                   row.
  1285.    Return value   None.
  1286.    Screens        All video pages and virtual screens.
  1287.    EOS            Updated to first cleared column of the cleared row.
  1288.    Restrictions   None.
  1289.    See also       wscrollup, wgotoeos
  1290.  
  1291.    ---------------------------------------------------------------------------
  1292.    wscrollup                                                             WNDWC
  1293.    ---------------------------------------------------------------------------
  1294.    Function       Scrolls the current window up and clears the bottom row with
  1295.                   the window attribute wndwattr.
  1296.    Syntax         void wscrollup(void);
  1297.    Remarks        The first row of the window will be scrolled out and lost
  1298.                   while the last row will be cleared (SAMEATTR is permitted).
  1299.                   The cursor is not moved, but is ready to be moved with
  1300.                   wgotoeos as EOS is set to the first column of the cleared
  1301.                   row.
  1302.    Return value   None.
  1303.    Screens        All video pages and virtual screens.
  1304.    EOS            Updated to first cleared column of the cleared row.
  1305.    Restrictions   None.
  1306.    See also       wscrolldown, wgotoeos
  1307.  
  1308.    ---------------------------------------------------------------------------
  1309.    wwherec                                                               WNDWC
  1310.    ---------------------------------------------------------------------------
  1311.    Function       Returns the window-relative column of the cursor on the
  1312.                   currently written video page.
  1313.    Syntax         unsigned char wwherec(void);
  1314.    Remarks        Operates on the currently written video page.  The upper
  1315.                   left corner of the screen is (1,1).
  1316.    Return value   wwherec returns an unsigned char from 1 to 255.
  1317.    Screens        All video pages only.
  1318.    See also       wgotorc, wwherer
  1319.  
  1320.    ---------------------------------------------------------------------------
  1321.    wwherer                                                               WNDWC
  1322.    ---------------------------------------------------------------------------
  1323.  
  1324.  
  1325.    Chapter 2, Procedures and Functions                                 Page 22
  1326.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1327.  
  1328.  
  1329.    Function       Returns the window-relative row of the cursor on the
  1330.                   currently written video page.
  1331.    Syntax         void wwherer(void);
  1332.    Remarks        Operates on the currently written video page.  The upper
  1333.                   left corner of the screen is (1,1).
  1334.    Return value   wwherer returns an unsigned char from 1 to 255.
  1335.    Screens        All video pages only.
  1336.    See also       wgotorc, wwherec
  1337.  
  1338.    ---------------------------------------------------------------------------
  1339.    wwrite                                                                WNDWC
  1340.    ---------------------------------------------------------------------------
  1341.    Function       Writes a string relative to the current window using the
  1342.                   window attribute.
  1343.    Syntax         void wwrite( unsigned char row, unsigned char col,
  1344.                                char *astr );
  1345.    Remarks        This routine writes the string astr at window-relative
  1346.                   (row,col) with the attribute wndwattr from the window
  1347.                   record.  If SAMEATTR is used for wndwattr, then the
  1348.                   attributes will remain the same on the screen.
  1349.    Return value   None.
  1350.    Screens        All video pages and virtual screens.
  1351.    EOS            Updated.
  1352.    Restrictions   Stay within the window limits.  Long strings will not wrap
  1353.                   around to column 1.
  1354.    See also       wwritec, wwritea
  1355.    Example        Write the string "Enter" at (2,1) with the current window
  1356.                   attribute:
  1357.  
  1358.                     wwrite( 2, 1, "Enter" );
  1359.  
  1360.    Example        Write the string "Answer" at (2,1) with the attribute of
  1361.                   flashing white on red and then restore the current window
  1362.                   attribute:
  1363.  
  1364.                     tws.wndwattr = BLINK+WHITE+RED_BG;
  1365.                     wwrite( 2, 1, "Answer" );
  1366.                     tws.wndwattr = tws.origattr;
  1367.  
  1368.    ---------------------------------------------------------------------------
  1369.    wwritec                                                               WNDWC
  1370.    ---------------------------------------------------------------------------
  1371.    Function       Writes a string centered column-wise to the current window
  1372.                   using the window attribute.
  1373.    Syntax         void wwritec( unsigned char row, char *astr );
  1374.    Remarks        This routine writes the string astr centered between the
  1375.                   left and right columns of the window.  The attribute used is
  1376.                   wndwattr from the window structure.  If SAMEATTR is used for
  1377.                   wndwattr, then the attributes will remain the same on the
  1378.                   screen.
  1379.    Return value   None.
  1380.    Screens        All video pages and virtual screens.
  1381.    EOS            Updated.
  1382.    Restrictions   Stay within the window limits.  Long strings will not wrap
  1383.                   around to column 1.
  1384.  
  1385.  
  1386.    Chapter 2, Procedures and Functions                                 Page 23
  1387.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1388.  
  1389.  
  1390.    See also       wwrite, wwritea
  1391.    Example        Write a message centered in a window on row 5:
  1392.  
  1393.                     wwritec( 5, "My message" );
  1394.  
  1395.    ---------------------------------------------------------------------------
  1396.    wwrite_sub                                                            WNDWC
  1397.    ---------------------------------------------------------------------------
  1398.    Function       Writes a substring with a specified length relative to the
  1399.                   current window using the window attribute.
  1400.    Syntax         void wwrite_sub( unsigned char row, unsigned char col,
  1401.                                    int length, char far *astr );
  1402.    Remarks        This routine writes length characters of the string astr at
  1403.                   window-relative (row,col) for the number of columns
  1404.                   specified by length.  This enables you to write substrings.
  1405.                   The attribute used is wndwattr from the window record.  If
  1406.                   wndwattr is set to SAMEATTR, then the attributes will remain
  1407.                   the same on the screen.
  1408.    Return value   None.
  1409.    Screens        All video pages and virtual screens.
  1410.    EOS            Updated.
  1411.    Restrictions   Stay within the window limits.  Long strings will not wrap
  1412.                   around to column 1.
  1413.    See also       wwrite, wwritec
  1414.    Example        The following will write "Testing out this line."  with the
  1415.                   current window attribute:
  1416.  
  1417.                     strcpy( mystring, "Step B: Testing out this line." );
  1418.                     wwrite_sub( 1, 1, 22, &mystring[8] );
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.    Chapter 2, Procedures and Functions                                 Page 24
  1448.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1449.  
  1450.  
  1451.    3.  D A T A   S T R U C T U R E
  1452.  
  1453.    This section will help describe the data structure of WNDWC and how it can
  1454.    be adjusted.  The variables in WC21VAR.C are allocated according to the
  1455.    values of the macros set near the beginning of WNDWC21.H.  There are
  1456.    several basic variables, but if desired, there are additional variables for
  1457.    virtual windows and multiple video pages.  Please refer to the source code
  1458.    in WC21VAR.C and WNDWC21.H for the exact listing.
  1459.  
  1460.  
  1461.    BASIC TYPES
  1462.  
  1463.    Basic Types - These types are used for all windows and modes to define the
  1464.    data structure.  This will describe the purpose of each type.
  1465.  
  1466.      Type          Description
  1467.      ------------  -----------------------------------------------------------
  1468.      borders       This enumerated type gives a name for 15 different border
  1469.                    styles each having 15 different parts already assigned in
  1470.                    the static array brdr.  The name NO_BORDER is reserved.
  1471.  
  1472.                      NO_BORDER           - No border at all.  Just the text
  1473.                                            area.
  1474.                      BLANK_BORDER        - Blank character on all sides.
  1475.                      SINGLE_BORDER       - Single lines on all sides.
  1476.                      DOUBLE_BORDER       - Double lines on all sides.
  1477.                      HDOUBLE_BORDER      - Horizontal double lines.  Single
  1478.                                            vertical lines.
  1479.                      VDOUBLE_BORDER      - Vertical double lines.  Single
  1480.                                            horizontal lines.
  1481.                      SOLID_BORDER        - Solid box character on all sides.
  1482.                      EVEN_SOLID_BORDER   - Vertical solid box.  Horizontal
  1483.                                            half box.
  1484.                      THIN_SOLID_BORDER_1 - Half box on all sides.  Squeezed
  1485.                                            horizontally.
  1486.                      THIN_SOLID_BORDER_2 - Half box on all sides.  Squeezed
  1487.                                            vertically.
  1488.                      LHATCH_BORDER       - Light hatch character on all sides.
  1489.                      MHATCH_BORDER       - Medium hatch character on all
  1490.                                            sides.
  1491.                      HHATCH_BORDER       - Heavy hatch character on all sides.
  1492.                      USER_BORDER_1       - User defined border.
  1493.                      USER_BORDER_2       - User defined border.
  1494.  
  1495.      brdrparts     Each border has 15 different parts.  This enumerated type
  1496.                    identifies each part by name.  Using acronyms, the relative
  1497.                    position can be easily identified.  For example, BRDR_TL
  1498.                    means the Top Left border part.  The order corresponds with
  1499.                    the brdr_t type:
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.    Chapter 3, Data Structure                                           Page 25
  1509.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1510.  
  1511.  
  1512.                      Relative Position      The first letter means:
  1513.                      ------------------        T = Top         B = Bottom
  1514.                      TL  TH  TT  TH  TR        V = Vertical    H = Horizontal
  1515.                      LV      VL      RV        L = Left        R = Right
  1516.                      LT  HL  CL  HL  RT        C = Cross
  1517.                      LV      VL      RV     Second letter exceptions:
  1518.                      BL  BH  BT  BH  BR        T = Tee         L = Line
  1519.  
  1520.      brdr_t        This type provides the array for storing a border.  All 15
  1521.                    different border parts can be accessed by merely indexing
  1522.                    the array.
  1523.  
  1524.      dir_t         This enumerated type identifies various directions.  They
  1525.                    can be extended.
  1526.  
  1527.      margin_t      Groups the margins used for moving or resizing windows.
  1528.  
  1529.      windownames   This enumerated type gives a name or handle for each window
  1530.                    to uniquely identify a window structure for random access.
  1531.                    Any additional name can be used, but three are reserved:
  1532.  
  1533.                      Name       Description
  1534.                      ---------- ---------------------------------------------
  1535.                      WINDOW0    Identifies the initial base screen and must be
  1536.                                 first in the list.
  1537.                      FREEWINDOW Identifies virtual screen records that are
  1538.                                 free to be overwritten.
  1539.                      AWINDOW    A generic name to be used when the window does
  1540.                                 not need to be unique.  It is usually used for
  1541.                                 temporary windows like error messages.
  1542.  
  1543.  
  1544.      wndwstat_t    This type sets up the window structure.  Each field in the
  1545.                    structure is worth describing.  The "ws" prefix is an
  1546.                    acronym meaning wndwstat.  There are 50 bytes per
  1547.                    structure.
  1548.  
  1549.                      wsrow .. wscol2 - These variables identify the location
  1550.                      and size of the window INCLUDING the border if any.  The
  1551.                      "2" suffix means the right column or bottom row location.
  1552.  
  1553.                      wrow .. wcol2 - These variables identify the location and
  1554.                      size of the window EXCLUDING the border if any.  The "2"
  1555.                      suffix means the right column or bottom row location.
  1556.  
  1557.                      wndwattr/brdrattr/origattr - These the attributes for the
  1558.                      window and border respectively.  They can even be set to
  1559.                      SAMEATTR.  origattr is a second copy of wndwattr used to
  1560.                      restore wndwattr to its original value.
  1561.  
  1562.                      wsbrdr/wsline - The former is the current border style
  1563.                      while the latter is a line set that can be used within
  1564.                      the window.  When a window is made, these two values are
  1565.                      the same, but wsline is available to be changed to the
  1566.                      needed line set.
  1567.  
  1568.  
  1569.    Chapter 3, Data Structure                                           Page 26
  1570.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1571.  
  1572.  
  1573.  
  1574.                      wsname - The unique name assigned to the window
  1575.                      structure.
  1576.  
  1577.                      wswherer/wswherec - These variables save the window-
  1578.                      relative row and column of the cursor.
  1579.  
  1580.                      wsmodes - Saves all the modes that created the window
  1581.                      including the current status.
  1582.  
  1583.                      wscursor - Save the cursor mode used with this window.
  1584.  
  1585.                      ulcol .. ulbytes - Saves the location and size of the
  1586.                      underlay of a window including the border and shadow if
  1587.                      any.
  1588.  
  1589.                      ulptr - Points to the saved underlay in the heap.
  1590.  
  1591.                      vscr - Holds the QWIKC screen data for this window.
  1592.  
  1593.                      refrow/refcol - These two scratch coordinates are used
  1594.                      for two cases.  It saves the absolute row/col where a
  1595.                      window is positioned before it is hidden.  For virtual
  1596.                      screen stats, it saves the view reference point.
  1597.  
  1598.                      viewbrdr - Saves the border style originally created with
  1599.                      the window.  wsbrdr differs from viewbrdr in that wsbrdr
  1600.                      contains the current border.  For virtual screens, wsbrdr
  1601.                      is always set to NO_BORDER even though the view on the
  1602.                      CRT may be a different style.
  1603.  
  1604.                      vi - Virtual screen index for its associated virtual
  1605.                      window stat if any.
  1606.  
  1607.  
  1608.    MACROS
  1609.  
  1610.    Macros - These macros are used to control the data structure size or to
  1611.    conveniently set window mode bits.
  1612.  
  1613.      Macro             Value  Description
  1614.      --------------    -----  ------------------------------------------------
  1615.      MAXWINDOW         1-254  Set by the user, this value determines the
  1616.                               maximum number of windows that can be on the CRT
  1617.                               on any video page.  This sets the amount of
  1618.                               static data to be used.
  1619.  
  1620.      MAXVIRTUALWINDOW  0-254  Set by the user, this value determines the total
  1621.                               number of virtual screens minus one that will be
  1622.                               maintained at any one time.  If no virtual
  1623.                               windows are wanted, undefine the macro
  1624.                               ADDVIRTUAL.
  1625.  
  1626.      MAXPAGEUSED       0 - 7  Set by the user, this value determines the
  1627.                               highest page number to be managed in a multi-
  1628.  
  1629.  
  1630.    Chapter 3, Data Structure                                           Page 27
  1631.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1632.  
  1633.  
  1634.                               page program.  If only page 0 is going to be
  1635.                               used (which is usually the case), then undefine
  1636.                               the directive MULTIPAGE.  This will reduce the
  1637.                               static data by a significant amount.
  1638.  
  1639.    Window Modes - There are several window modes and combinations of modes
  1640.    that can be set using setwindowmodes and saved in the variable windowmodes.
  1641.    This is a list of those modes, values and descriptions.  After the window
  1642.    is created, the modes are saved in wsmodes as well as the "to" modes which
  1643.    indicate the status of the window.
  1644.  
  1645.      Macro           Value   Description
  1646.      --------------  ------  -------------------------------------------------
  1647.      RELMODE         0x0001  (Bit 0) Simply overwrites the screen relative to
  1648.                              the current window.  The row/col coordinate is
  1649.                              window relative.  Works and stays in the current
  1650.                              writeto mode.  This is usually used for flexible
  1651.                              screen design.  The stats are only temporary and
  1652.                              lost after changing windows.  To get back to the
  1653.                              parent window, use removewindow.
  1654.      PERMMODE        0x0002  (Bit 1) Makes the window permanent on the screen.
  1655.                              This means that no underlay is saved.  These
  1656.                              windows must be the first ones created.  They can
  1657.                              be accessed, but be sure no other window is
  1658.                              covering it (wi<=pli) before writing to the
  1659.                              screen, because they are not necessarily the top
  1660.                              window.
  1661.      SHADOWLEFT      0x0004  (Bit 2) Places a shadow on the left side.
  1662.      SHADOWRIGHT     0x0008  (Bit 3) Places a shadow on the right side.
  1663.      ZOOMMODE        0x0010  (Bit 4) Creates a zoom effect with makewindow,
  1664.                              showwindow, and accesswindow.
  1665.      HIDDENMODE      0x0020  (Bit 5) Creates the window as hidden.
  1666.      VIRTUALMODE     0x0040  (Bit 6) Creates a virtual window with a virtual
  1667.                              screen.
  1668.      CURSOROFFMODE   0x0080  (Bit 7) Always leaves cursor off.
  1669.      SEETHRUMODE     0x0100  (Bit 8) Doesn't clear screen inside the border
  1670.                              and ignores ZOOMMODE.
  1671.      NOHIDEMODE      0x0200  (Bit 9) Ignores request to hide window.
  1672.      NOACCESSMODE    0x0400  (Bit 10) Ignores request to access window.
  1673.      NOMOVEMODE      0x0800  (Bit 11) Ignores request to move/resize window.
  1674.      TOCRTMODE       0x1000  (Bit 12) Indicates writing to CRT.
  1675.      TOHIDDENMODE    0x2000  (Bit 13) Indicates writing to hidden window.
  1676.      TOVIRTUALMODE   0x4000  (Bit 14) Indicates writing to virtual screen.
  1677.  
  1678.  
  1679.    STATIC VARIABLES
  1680.  
  1681.    Static Variables - Finally, the variables used in WNDWC can be described in
  1682.    detail and can be accessed by the user.
  1683.  
  1684.    Window Flags - While writing to a window, it is difficult to try to analyze
  1685.    the bits in wsmodes to figure out its modes.  So, each mode has been given
  1686.    a corresponding flag.  These flags are set for the current window.  Though
  1687.    rather intuitive, each of the flag variables is listed below with its
  1688.    corresponding mode:
  1689.  
  1690.  
  1691.    Chapter 3, Data Structure                                           Page 28
  1692.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1693.  
  1694.  
  1695.  
  1696.      Flag            Mode
  1697.      --------------  --------------
  1698.      relflag         RELMODE
  1699.      permflag        PERMMODE
  1700.      zoomflag        ZOOMMODE
  1701.      hiddenflag      HIDDENMODE
  1702.      virtualflag     VIRTUALMODE
  1703.      cursoroffflag   CURSOROFFMODE
  1704.      seethruflag     SEETHRUMODE
  1705.      nohideflag      NOHIDEMODE
  1706.      noaccessflag    NOACCESSMODE
  1707.      nomoveflag      NOMOVEMODE
  1708.      tocrtflag       TOCRTMODE
  1709.      tohiddenflag    TOHIDDENMODE
  1710.      tovirtualflag   TOVIRTUALMODE
  1711.  
  1712.    Single Page Variables - The following variables are grouped together
  1713.    because they are specific to the current video page being used.  If you do
  1714.    use more than one page, these variables will be swapped with another page.
  1715.  
  1716.      Variable        Description
  1717.      --------------  ---------------------------------------------------------
  1718.      wndwstat        (Type: wndwstats_t)  This is the array for the maximum
  1719.                      number of windows both hidden and shown at one time.
  1720.                      Each structure only uses 52 bytes of static data.
  1721.                      wndwstat[0] is always the record for the initial window.
  1722.  
  1723.      topwndwstat     (Type: macro)  This structure makes it easy to always
  1724.                      access the data for the current window and is always up
  1725.                      to date.  This data will be saved in the correct wndwstat
  1726.                      before accessing another window.  topwndwstat is a macro
  1727.                      defined as tws.
  1728.  
  1729.      tws             (Type: wndwstat_t)  tws is used to actually store the
  1730.                      data, whereas topwndwstat is simply a more elaborate way
  1731.                      of coding it.
  1732.  
  1733.      topvirtualstat  (type: macro)  For virtual windows, in addition to tws,
  1734.                      there is the topvirtualstat for the associated virtual
  1735.                      screen which has its own structure.
  1736.  
  1737.      tvs             (Type: wndwstat_t)  tvs is used to actually store the
  1738.                      data, whereas topvirtualstat is simply a more elaborate
  1739.                      way of coding it.  Keep in mind that when writing direct
  1740.                      to the virtual screen (writetovirtual), tws and tvs are
  1741.                      reversed.  It would then be helpful to think of tvs as
  1742.                      the top VIEW stat, since the view is on the CRT.
  1743.  
  1744.      li              (Type: int)  This is the top Level Index for the top
  1745.                      window currently shown on the CRT.  Windows shown on the
  1746.                      CRT are sequentially stacked from index 0 upward.
  1747.  
  1748.      hli             (Type: int)  This is the Hidden Level Index.  Hidden
  1749.                      windows are stacked from index MAXWINDOW downward.  If
  1750.  
  1751.  
  1752.    Chapter 3, Data Structure                                           Page 29
  1753.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1754.  
  1755.  
  1756.                      there are no hidden windows, hli=MAXWINDOW+1.
  1757.  
  1758.      wi              (Type: int)  For the current Window Index, the program
  1759.                      saves and retrieves the wndwstat from this index whether
  1760.                      it is hidden or shown.  It ranges from 0 to MAXWINDOW.
  1761.                      For hidden windows, wi can range from hli to MAXWINDOW.
  1762.                      For the top window on the CRT, wi=li.  For PERMMODE
  1763.                      windows, it  can be <=li.
  1764.  
  1765.      pli             (Type: char)  This Permanent Level Index keeps track of
  1766.                      the order of the permanent windows on the CRT.  They must
  1767.                      be stacked contiguously as the first ones on the CRT or
  1768.                      else an error message will be displayed.  This value is
  1769.                      <=li.
  1770.  
  1771.      cursordefault   (Type: int)  This is the value saved by setcursordefault
  1772.                      for the cursor mode.  It is just as easy to set it
  1773.                      directly.  When makewindow is used, this is the value
  1774.                      saved for that window.
  1775.  
  1776.      margins         (Type: margin_t)  These margins limit the moving or
  1777.                      resizing of windows for each video page.  This prevents
  1778.                      windows from covering status lines or the like.
  1779.  
  1780.      windowmodes     (Type: int)  This is the value saved by setwindowmodes.
  1781.                      It is best to use the function for this value since it
  1782.                      filters out incompatible modes.
  1783.  
  1784.  
  1785.    Universal Variables - These variables are not specific to any window or
  1786.    video page and are used universally in the program.
  1787.  
  1788.      Variable        Description
  1789.      --------------  ---------------------------------------------------------
  1790.      brdr            (Type: brdr_t array) Contains 14 different border styles
  1791.                      each with 15 border parts.  The data structure enables
  1792.                      you to access parts by index name:
  1793.  
  1794.                        mypart = brdr[ SINGLE_BORDER ][ BRDR_TL ];
  1795.  
  1796.      prefer_multitask  (Type: char) This boolean defaults to 0 so that would
  1797.                      ignore any multi-tasking environment.  When set to 1 just
  1798.                      before initwindow, WNDWC will then use the higher speed
  1799.                      video buffer (MTVB) if available.
  1800.  
  1801.      shadowchar      (Type: char) This is the character used to produce a
  1802.                      shadow.  It is set to a space.  This may not be desirable
  1803.                      for monochrome monitors which may look better with hatch
  1804.                      characters.
  1805.  
  1806.      shadowcolor     (Type: int) This is the attribute used to produce a
  1807.                      shadow.  It is initially set to BLACK on BLACK.  Any
  1808.                      attribute can be used.
  1809.  
  1810.      titleofs        (Type: int) When writing titles, this offset is used to
  1811.  
  1812.  
  1813.    Chapter 3, Data Structure                                           Page 30
  1814.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1815.  
  1816.  
  1817.                      adjust where the title starts writing.  Left justified
  1818.                      titles start at wcol+titleofs while those right justified
  1819.                      end at wcol2-titleofs.  Center justified titles are not
  1820.                      affected.  The default value is 1.
  1821.  
  1822.      virtualrows     (Type: unsigned char)  This is the row height saved from
  1823.                      setvirtualsize setting the number of rows used in the
  1824.                      virtual screen.  The default value is crt_rows.
  1825.  
  1826.      virtualcols     (Type: unsigned char)  This is the column width saved
  1827.                      from setvirtualsize setting the number of columns used in
  1828.                      the  virtual screen.  The default value is crt_cols.
  1829.  
  1830.      virtualsize     (Type: int)  This is the size in bytes to be reserved for
  1831.                      the virtual screen.  The size is virtualcols *
  1832.                      (virtualrows+2) * 2.  Remember the last two rows are
  1833.                      added for the virtual titles.
  1834.  
  1835.      maxvalidpage    (Type: char)  The program can reserve enough data for all
  1836.                      video pages being addressed with MAXPAGEUSED.  However,
  1837.                      the machine that runs the program must have those pages
  1838.                      available.  This variable additionally limits the pages
  1839.                      that can be addressed.  It is set to the lesser of
  1840.                      max_page or MAXPAGEUSED.
  1841.  
  1842.      zoomdelay       (Type: char)  This value is set by initwindow to control
  1843.                      the zoom rate on non-snowing video cards.  This value is
  1844.                      set according to the cpuid that QWIKC detected.
  1845.  
  1846.  
  1847.    DYNAMIC VARIABLES
  1848.  
  1849.    Dynamic Variables - These variables are allocated to the heap to leave more
  1850.    room for global variables.  The far heap is always used, therefore the Tiny
  1851.    Model is not supported.  The allocations are done in initwindow.
  1852.  
  1853.      Pointer         Description
  1854.      --------------  ---------------------------------------------------------
  1855.      virtualstat     (Type: wndwstat_t far *)  This array of window structures
  1856.                      is for the virtual screens associated with the virtual
  1857.                      windows.  All routines use this data when writing to
  1858.                      virtual screens by copying it to tws.  The index for this
  1859.                      record is obtain from tws.vi.  Since this array is filled
  1860.                      at random, vi does not correspond to wi.  When a virtual
  1861.                      window is removed, these stats are "freed" by setting
  1862.                      wsname to FREEWINDOW - they are not freed by calling
  1863.                      free().  All video pages use this one array.
  1864.  
  1865.      pagestat        (Type: wndwstat_t far *)  If your program uses multiple
  1866.                      video pages, a complete structure containing all the
  1867.                      window records and indexes is saved for each video page.
  1868.                      Any pagestat can be swapped with the top page variables
  1869.                      (the first 10 listed under "Single Page Variables" above)
  1870.                      to work on the current video page.  The writetopage
  1871.                      function handles this operation.
  1872.  
  1873.  
  1874.    Chapter 3, Data Structure                                           Page 31
  1875.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1876.  
  1877.  
  1878.    A P P E N D I X  A :   M E M O R Y   A L L O C A T I O N
  1879.  
  1880.    This section covers the memory requirements for static data in the data
  1881.    segment and dynamic data in the heap.  This will give you the figures on
  1882.    how to calculate the memory needed for your program.
  1883.  
  1884.  
  1885.    GLOBAL MEMORY
  1886.  
  1887.    Global Memory - WNDWC is very frugal with global data.  Here is the
  1888.    breakdown on the fixed amount of data required:
  1889.  
  1890.      Variables                       Bytes
  1891.      ------------------------------- -----
  1892.      Border array                      210
  1893.      Basic windows                     142
  1894.      Additional for virtual windows     69
  1895.      Additional for multi-page video     4
  1896.                                      -----
  1897.      Fixed allocation                  425
  1898.  
  1899.    The additional data space for virtual windows and multi-page video, if not
  1900.    used, can be excluded by undefining the macros.  This is the allocation for
  1901.    MAXWINDOW=0.  For each additional window structure, add 52 bytes.  So, for
  1902.    MAXWINDOW=10, the allocation would be (52*10)+425=945 bytes.
  1903.  
  1904.  
  1905.    DYNAMIC MEMORY
  1906.  
  1907.    Dynamic Variables - To alleviate using global data, dynamic variables are
  1908.    used for permanent and temporary use.  The allocation for virtual screen
  1909.    records and video page records are permanent throughout the program.  Many
  1910.    other procedures such as movewindow temporarily use the heap to perform
  1911.    operations.
  1912.  
  1913.    Permanent Variables - If the macros have been defined, the following
  1914.    allocation can be calculated:
  1915.  
  1916.      Variables       Bytes
  1917.      --------------- -------------------------------
  1918.      virtualstat     52 per virtual window
  1919.      pagestat        (sizeof(pagestat_t)) per video page
  1920.      Virtual screen  virtualsize
  1921.  
  1922.    Virtual screens are kept in memory until removewindow is called.
  1923.  
  1924.    Temporary Variables - For functions that temporarily use the heap, the size
  1925.    of allocation is listed along with each function in section 2 above.
  1926.    Generally, you should allow about the same size as 3 CRT screens of
  1927.    available heap for those functions.  For a video mode with 25 rows and 80
  1928.    columns, this is (80*25*2)*3=12000 bytes, in addition to the random
  1929.    allocation.
  1930.  
  1931.    Random Allocation - Because of the nature of random access to windows and
  1932.    underlays, the program does far allocation.  This means that there are
  1933.  
  1934.  
  1935.    Appendix A: Memory Allocation                                       Page 32
  1936.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1937.  
  1938.  
  1939.    going to be gaps of free memory in the heap.  To account for this, you
  1940.    should more than double the amount of data expected for underlays and
  1941.    virtual screens.  It is up to you to judge just how much of the heap is
  1942.    going to be truly random.  In the case of simple serial-access to windows,
  1943.    the heap will be contiguous and doubling of the heap is unnecessary.
  1944.  
  1945.  
  1946.    CODE SIZE
  1947.  
  1948.    Code Size - WNDWC is also very frugal with code.  Here is the breakdown for
  1949.    code usage in the Small model (this may vary slightly):
  1950.  
  1951.      Code Description                Bytes
  1952.      ------------------------------- -----
  1953.      Basic windows                    9385
  1954.      Additional for virtual windows    742
  1955.      Additional for multi-page video  4049
  1956.                                      -----
  1957.      Total code                      14176
  1958.  
  1959.    Of course the linker will optimize the code leaving out unused functions.
  1960.    But this gives you a good idea of how small the code really is!
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.    Appendix A: Memory Allocation                                       Page 33
  1997.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.1
  1998.  
  1999.  
  2000.    A P P E N D I X  B :   E R R O R   M E S S A G E S
  2001.  
  2002.    Because WNDWC is so powerful, it writes to screen in memory as well as the
  2003.    CRT.  Should you make a mistake in programming, it may not show up on the
  2004.    CRT screen.  So, to prevent the errors before they happen, programs written
  2005.    with errors will terminate with an error message window on the CRT to
  2006.    reveal the problem.  The program terminates through the GOOF module, which
  2007.    can be freely edited.
  2008.  
  2009.    "Not enough heap space" - There is not enough far heap space.  Too much
  2010.    memory is being taken.  When running under the Turbo C environment in the
  2011.    Small or Medium models, you may get this error if you set your near heap
  2012.    size (_heaplen) to anything very large.  This will cause the near heap to
  2013.    take a greater portion of available memory, leaving a smaller amount for
  2014.    the far heap.  This is disastrous since WNDWC does all allocating on the
  2015.    far heap.
  2016.  
  2017.    "Too many windows" - Tried to create more windows than MAXWINDOW allows.
  2018.    Either remove windows or increase MAXWINDOW.
  2019.  
  2020.    "Too many virtual windows" - Tried to create more virtual windows than
  2021.    MAXVIRTUALWINDOW allows.  Either remove windows or increase
  2022.    MAXVIRTUALWINDOW.
  2023.  
  2024.    "Perm window out of order" - Tried to create a PERMMODE window while a
  2025.    normal window is the top window.  Remove or hide window before making a
  2026.    permanent window.  Routinely, all PERMMODE windows are created first.
  2027.  
  2028.    "No window to remove" - Tried to remove the initial window WINDOW0 which is
  2029.    permanent.
  2030.  
  2031.    "Hidden window not found" - Tried to write to a hidden window that does not
  2032.    exist.  Check for the correct name.
  2033.  
  2034.    "Virtual screen not found" - Tried to write to a virtual screen that does
  2035.    not exist.  Check for the correct name.
  2036.  
  2037.    "Video page not available" - Tried to write to a video page that has not
  2038.    been allocated or does not exist for the hardware as expected.  Be sure to
  2039.    use maxvalidpage.
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.    Appendix B: Error Messages                                          Page 34
  2058.  
  2059.