english
version "1.0"
identify "xyz"

#: Copyright (c) 1997 by Wayne C. Gramlich.
#, All rights reserved.
#,
#, Permission to use, copy, modify, distribute, and sell this software
#, for any purpose is hereby granted without fee provided that the above
#, copyright notice and this permission are retained.  The author makes
#, no representations about the suitability of this software for any purpose.
#, It is provided "as is" without express or implied warranty.

module xlib_screen

#: This module implements a screen object.  It is basically equivalent
#, to a ({Display}, {screen_num}) pair in Xlib.

import
    logical
    out_stream
    string
    unsigned
    vector
    xlib_display
    xlib_icon_size
    xlib_pixel
    xlib_window

define xlib_screen
    external


procedure address_get@xlib_screen
    takes
	screen xlib_screen
    returns unsigned
    external xlib_screen__address_get

    #: This procedure will return the address of the {screen} object.


procedure black_pixel_get@xlib_screen
    takes
	screen xlib_screen
    returns xlib_pixel
    external xlib_screen__black_pixel_get

    #: This procedure will return the black pixel associated with {screen}.


procedure close@xlib_screen
    takes
	screen xlib_screen
    returns_nothing
    external xlib_screen__close

    #: This procedure will make {screen} no longer usable.


procedure closed_get@xlib_screen
    takes
	screen xlib_screen
    returns logical
    external xlib_screen__closed_get

    #: This procedure will return {true} if the {screen} has been
    #, closed and {false} otherwise.


procedure default_open@xlib_screen
    takes
	display xlib_display    
    returns xlib_screen
    external xlib_screen__default_open

    #: This procedure will return an {xlib_screen} object
    #, that is associated with the default screen on {display}.


procedure depth_get@xlib_screen
    takes
	display xlib_screen
    returns unsigned
    external xlib_screen__depth_get

    #: This procedure will return the depth of {display}.


procedure depths_get@xlib_screen
    takes
	screen xlib_screen
    returns vector[unsigned]
    external xlib_screen__depths_get

    #: This procedure will return the various allowed pixel depths
    #, allowed with {screen}.


procedure display_get@xlib_screen
    takes
	screen xlib_screen
    returns xlib_display
    external xlib_screen__display_get

    #: This procedure will return the {xlib_display} object associated
    #, with {screen}.


procedure height_get@xlib_screen
    takes
	screen xlib_screen
    returns unsigned
    external xlib_screen__height_get

    #: This procedure will return the height of {screen} in pixels.

    
procedure icon_sizes@xlib_screen
    takes
	screen xlib_screen
    returns vector[xlib_icon_size]
    external xlib_screen__icon_sizes_get

    #: This procedure will return the list of prefered icon sizes
    #, associated with {screen}.


procedure identical@xlib_screen
    takes
	screen1 xlib_screen
	screen2 xlib_screen
    returns logical

    #: This procedure will return {true} if {screen1} is identical to
    #, {screen2} and {false} otherwise.

    return screen1.address = screen2.address


procedure number_get@xlib_screen
    takes
	screen xlib_screen
    returns unsigned
    external xlib_screen__number_get

    #: This procedure will return the screen number assocaiated with
    #, {screen}.


procedure print@xlib_screen
    takes
	screen xlib_screen
	out_stream out_stream
    returns_nothing

    #: This procedure will output {screen} to {out_stream}.

    if screen == ??
	put@("??@xlib_screen", out_stream)
    else
	put@('[xlib_display=', out_stream)
	print@(screen.xlib_display, out_stream)
	put@(', number=', out_stream)
	print@(screen.number, out_stream)
	put@(', root_window=', out_stream)
	print@(screen.root_window, out_stream)
	put@(']', out_stream)


procedure root_window_get@xlib_screen
    takes
	screen xlib_screen
    returns xlib_window
    external xlib_screen__root_window_get

    #: This procedure will return the {root_window} associated with
    #, {screen}.  The {root_window}'s parent window is itself.


procedure width_get@xlib_screen
    takes
	screen xlib_screen
    returns unsigned
    external xlib_screen__width_get

    #: This procedure will return the width of {screen} in pixels.

    
procedure xlib_display_get@xlib_screen
    takes
	screen xlib_screen
    returns xlib_display
    external xlib_screen__xlib_display_get

    #: This procedure will return the {xlib_display} object associated
    #, with {screen}.


procedure white_pixel_get@xlib_screen
    takes
	screen xlib_screen
    returns xlib_pixel
    external xlib_screen__white_pixel_get

    #: This procedure will return the white pixel associated with {screen}.


