[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

The structures mentioned above are unified along with other information in
Intuition's Screen data structure defined in the include file
<intuition/screens.h>.  Notice that the Screen structure contains
instances of a ViewPort, RastPort and BitMap.


struct Screen
    {
    struct Screen *NextScreen;
    struct Window *FirstWindow;
    WORD LeftEdge, TopEdge, Width, Height;
    WORD MouseY, MouseX;
    UWORD Flags;
    UBYTE *Title, *DefaultTitle;
    BYTE BarHeight, BarVBorder, BarHBorder, MenuVBorder, MenuHBorder;
    BYTE WBorTop, WBorLeft, WBorRight, WBorBottom;
    struct TextAttr *Font;
    struct ViewPort ViewPort;
    struct RastPort RastPort;
    struct BitMap BitMap;
    struct Layer_Info LayerInfo;
    struct Gadget *FirstGadget;
    UBYTE DetailPen, BlockPen;
    UWORD SaveColor0;
    struct Layer *BarLayer;
    UBYTE *ExtData, *UserData;
    };


In general, applications don't need to access the fields in the Screen
structure directly; they use Intuition functions to manipulate the screen
instead.  Likewise, applications do not set up the Screen themselves; they
use one of the OpenScreen() calls.  Here is a description of some of the
more interesting members of the Screen structure (it is not meant to be a
complete description of all the fields).

LeftEdge, TopEdge
    The LeftEdge and TopEdge variables give the position of the screen
    relative to the upper left corner of the monitor's visible display
    (as set by the user in the Overscan preferences editor).  If it is
    positioned down or to the right, the values are positive.  If the
    screen is positioned up or to the left, the values are negative.  The
    values are in screen resolution pixels.  In systems prior to V36,
    LeftEdge positioning is ignored and negative TopEdge positions are
    illegal.

    The screen position may be set when the screen is opened or later by
    calling the MoveScreen() function. Note that the screen's actual
    display position may not exactly equal the coordinates given in the
    LeftEdge and TopEdge fields of the Screen structure.  This can cause
    a window which is opened in the visible part of the screen to be
    incorrectly positioned by a few pixels in each direction.  This
    complication is due to hardware constraints that limit the fineness
    of screen positioning.  For instance, high resolution screens can
    only be positioned in low resolution pixel coordinates, yet the
    values in the LeftEdge and TopEdge use high resolution pixel
    coordinates.  So when the screen is displayed, its position is
    rounded to a position available for the monitor.

MouseX, MouseY
    Position of the mouse with respect to the upper left corner of the
    screen.

ViewPort, RastPort, BitMap, LayerInfo
    Actual instances of the graphics library data structures associated
    with this screen (not pointers to structures).  For normal use of
    custom screens, these structures may be ignored.

BarLayer
    A pointer to the Layer structure for the screen's title bar.

WBorTop, WBorLeft, WBorRight, WBorBottom
    Window border values, see the "Intuition Windows" chapter for
    information on pre-calculating the size of window borders for windows
    that open in this screen.

Font
    The default screen font, this can be used to pre-calculate the size
    of the window borders for windows that open in this screen.

UserData
    Free for application use.

Other Screen structure members provide information on the title bar layer,
and attributes of menus and windows opened in the screen.  Of particular
interest are the values that allow precalculation of window border size.
These variables will be discussed in the chapter "Intuition Windows".