


      WINDOWS(3X)                (Bull-SPS9)                WINDOWS(3X)



      NAME
           windows - window function library

      SYNTAX
           #include <sys/graf.h>
           #include <sys/winctrl.h>

           int GetWindowNumber (fileDesc)
           int fileDesc;

           int GetCurrentWindow ()

           int GetNextWindow (wID)
           int wID;

           char *GetWindowName (wID)
           int wID;

           GetWindowFrame (wID, frame)
           int wID;
           struct Rectangle *frame;

           SetWindowFrame (wID, frame)
           int wID;
           struct Rectangle *frame;

           int FindWindow (at)
           struct Point *at;

           char *GetTitle (wID)
           int wID;

           SetTitle (wID, name)
           int wID;
           char *name;

           int GetWFlags (wID)
           int wID;

           SetWFlags (wID, flags)
           int wID;
           int flags;

           ShowWindow (wID)
           int wID;

           EraseWindow (wID)
           int wID;

           SelectWindow (wID)
           int wID;




      Page 1                                         (73 A2 02MTA REV1)






      WINDOWS(3X)                (Bull-SPS9)                WINDOWS(3X)



           UnderWindow (wID)
           int wID;

           SetCtrlWindow (wID)
           int wID;

           KillWindow (wID)
           int wID;

           int DefineFont (name)
           char *name;

           char *GetFontName (fontID)
           int fontID;

           int GetFontID (wID)
           int wID;

           SetFont (wID, fontID)
           int wID;
           int fontID;

           GetWCharSize (wID, charSize)
           int wID;
           struct Point *charSize;

           char *GetTextLine (wID, row)
           int wID;
           int row;

           SetCursorLocation (wID, at)
           int wID;
           struct Point *at;

           int PopupMenu (text, button)
           char *text;
           int button;

           CompFrame (frame)
           struct Rectangle *frame;

           HighlightText (wID, start, end)
           int wID;
           struct Point *start;
           struct Point *end;

      DESCRIPTION
           The windows subroutine library allows access to the various
           window attributes and operations supported by the Bull-SPS9
           display management software.  These functions perform the
           appropriate ioctl(2) call for each operation, using file
           descriptor 2 (stderr) which should be bound to a window on



      Page 2                                         (73 A2 02MTA REV1)






      WINDOWS(3X)                (Bull-SPS9)                WINDOWS(3X)



           the Bull-SPS9 display.  Functions that return an integer use
           the value -1 to indicate an error.

           GetWindowNumber returns the window ID of the window
           associated with the open file descriptor fileDesc.  Each
           window is assigned a window ID when it is created; this
           integer is used to identify the window in all subsequent
           control operations applied to it.  A value of -1 indicates
           that the file descriptor is not associated with a window on
           the display.  GetCurrentWindow returns the window ID of the
           currently selected active input window, which is always at
           the front of the depth-sorted window list.  GetNextWindow
           returns the window ID of the window which is next on the
           window list behind wID.  The value -1 is returned if there
           are no more windows farther back in the list.

           GetWindowName returns a pointer to a static area containing
           a null-terminated string, which should be copied elsewhere
           by the caller.  This string is the window part of the
           pathname that was used to create the window identified by
           wID.

           GetWindowFrame returns the current location and size of the
           rectangular frame for wID, while SetWindowFrame allows the
           location to be moved on the screen, or the size to be
           changed.  The frame argument is defined as a pointer to a
           Rectangle structure, whose origin is the upper left corner,
           and extent is the width and height.  The Point structure is
           a two-dimensional location specified in terms of display
           device coordinates.  The <sys/graf.h> header file contains
           these definitions:

                struct Point {
                        int x;
                        int y;
                };

                struct Rectangle {
                        struct Point origin;
                        struct Point extent;
                };

           FindWindow returns the window ID of the frontmost window
           that contains the point at, which is specified using display
           device coordinates.  If a window can be found that contains
           the point either within its frame or title tab, then its
           window ID is returned; otherwise, the value -1 is returned.

           GetTitle returns a pointer to a static area containing a
           null-terminated string, which should be copied elsewhere by
           the caller.  This string is used as the text for displaying
           the title tab for the window wID, and is initialized to the



      Page 3                                         (73 A2 02MTA REV1)






      WINDOWS(3X)                (Bull-SPS9)                WINDOWS(3X)



           window part of the pathname that was used to create the
           window.  SetTitle changes the title string of the window wID
           to the null-terminated string pointed to by name.  Changing
           the title string does not change the name the window is
           accessed by; the pathname of the window remains the same as
           when it was created.  Changing a title to the null string
           will cause the title tab to disappear.

           GetWFlags returns the window flags associated with the
           window wID, while SetWFlags sets the window flags for wID to
           the bit values specified in flags.  The flag bits control
           various attributes of the window, as defined in the
           <sys/winctrl.h> header file:

                WFMode           mode bit field
                WFASCII          ASCII mode
                WFANSIX3_64      ANSI X3.64 (VT-100) mode
                WFTek4014        Tektronix 4014 mode
                WFAwake          window is "awake" allowing I/O
                WFCurson         text input cursor is shown
                WFRetainGraf     window retains graphics

                EMQueueKB        queue keyboard events
                EMSigIOKB        signal I/O from keyboard
                EMQueueLoc       queue locator (mouse) events
                EMLocCoords      window or screen relative locator coords
                EMLocMotion      only button changes, or any motion
                EMButtonMask     button bits
                EMRightButton    right button
                EMMiddleButton   middle button
                EMLeftButton     left button
                EMOtherButtons   other buttons
                EMSigIOLoc       signal I/O from locator

           ShowWindow causes the window identified by wID to be redrawn
           on the screen, while EraseWindow causes the window wID to be
           erased by repainting its area and title tab using the gray
           background pattern.  These two functions are not normally
           used since window updates are performed automatically by the
           display management software when windows are created,
           modified, or destroyed.

           SelectWindow causes the window identified by wID to become
           the currently active input window, moving it to the front of
           the depth-sorted window list.  The selected window is
           displayed in front of all other windows, and its title tab
           is highlighted.  All keyboard and mouse input events are
           directed to the currently selected window.  UnderWindow
           moves the window wID behind all awake windows in the depth-
           sorted window list.  This causes the new frontmost window in
           the list to become the currently selected window.




      Page 4                                         (73 A2 02MTA REV1)






      WINDOWS(3X)                (Bull-SPS9)                WINDOWS(3X)



           SetCtrlWindow changes the window which acts as the control
           terminal for the calling process to become wID.  The control
           window for a process is inherited from its parent process
           when it is created.  The signal SIGHUP is sent to all
           processes which have wID as their control window by the
           function KillWindow.

           DefineFont makes the font file specified as the full
           pathname name known to the display management software.  The
           value returned is a font ID that is used in further
           operations on that font; the value -1 is returned if the
           file cannot be read, or if it does not contain valid font
           information.  GetFontName returns a pointer to a null-
           terminated string that is the pathname corresponding to
           fontID.  The string is placed in a static area which should
           be copied to another area by the caller.

           GetFontID returns the current font ID associated with the
           window wID, while SetFont sets the window font for wID to
           the font specified as fontID.  GetWCharSize returns the size
           of a single character in the current bit-matrix font
           associated with window wID.  The size is returned in the
           Point structure pointed to by charSize, and is measured in
           pixels.  This may be used to calculate the number of lines
           and columns of text that can be displayed based on the
           window's size.

           GetTextLine returns a pointer to a static area containing a
           null-terminated string, which should be copied elsewhere by
           the caller.  This string is the line of text found at row
           (counting from zero at the top) in the window wID.  The
           length of the string is determined by the number of columns
           of text in the window, including all leading and trailing
           blanks.

           SetCursorLocation sets the current cursor location relative
           to the window wID.  The coordinate system used for the X,Y
           position pointed to by at depends on the emulation mode of
           the window, and its event mode bits in the flags word.

           If the EMLocCoords bit is set, then display device
           coordinates are used, and the location can be set to any
           value.  If the EMLocCoords bit is not set, then the
           coordinate system is translated relative to the location of
           the window on the display surface, and may be scaled
           depending on the current mode of the window.

           If the window is emulating a Tektronix 4014 terminal, then
           the X coordinates range from 0 to 1024, and the Y
           coordinates range from 0 to 780, with the origin in the
           lower left corner of the window.  The display device
           coordinates of the cursor are appropriately scaled based on



      Page 5                                         (73 A2 02MTA REV1)






      WINDOWS(3X)                (Bull-SPS9)                WINDOWS(3X)



           the size of the window.

           If the window is not in Tektronix 4014 mode, then display
           device coordinates are used, but are first translated
           relative to the origin of the window.  The X coordinates
           range from 0 to one less than the width of the window, and
           the Y coordinates range from 0 to one less than the height
           of the window, with the origin in the upper left corner of
           the window.

           PopupMenu invokes a pop-up menu at the current location of
           the cursor.  The null-terminated string of text pointed to
           by text contains several short lines separated by Newline
           characters.  The button parameter contains a bit mask in the
           lowest three bits, with the least significant bit
           representing the right button, the middle bit the middle
           button, and the most significant bit the left button.  The
           text is shown on the screen, and selection is allowed, while
           a button is depressed which has the corresponding bit set to
           1.  When the button is released, the selected line's index
           (counting from zero) is returned.  If the button is released
           outside of the menu, the value -1 is returned.

           CompFrame outlines the Rectangle pointed to by frame,
           drawing the outline once using the complement of the
           background, updating the screen, and then drawing the
           outline again using the complement, effectively restoring
           the original bitmap.  The non-destructive outline is
           typically used repeatedly to draw a rectangle that tracks
           the cursor.  The location and size are specified using
           display device coordinates.

           HighlightText is used to "highlight" a range of text using
           video inverse within a window in ANSI X3.64 mode.  At most,
           one window on the display may have highlighting applied; so
           each new invocation causes the previous hightlighting to be
           removed first.  Highlighting is also automatically removed
           whenever any output or other window changes occur.  The
           arguments to HighlightText are the window wID and a range of
           text bounded by the character positions indicated by start
           and end, where the x field refers to the column number
           (counting from zero at the left), and the y field refers to
           the row number (counting from zero at the top).  The range
           of text, including any intermediate lines, is highlighted.
           If the character positions are out of range for a given
           window, then any current highlighting is removed.

      FILES
           /usr/lib/libwindows.a

      SEE ALSO
           Bull-SPS9 Multi-Window Display Management Guide



      Page 6                                         (73 A2 02MTA REV1)






      WINDOWS(3X)                (Bull-SPS9)                WINDOWS(3X)



           setfont(1), settek(1), setx3.64(1), wgraf(3X), font(4),
           disp(7), mouse(7)





















































      Page 7                                         (73 A2 02MTA REV1)



