Other Window Functions

Other Window Functions — Miscellaneous functions for windows

Functions

Includes

#include <libchimara/glk.h>

Description

This section contains functions for windows that don't fit anywhere else.

Functions

glk_window_iterate ()

winid_t
glk_window_iterate (winid_t win,
                    glui32 *rockptr);

This function can be used to iterate through the list of all open windows (including pair windows.) See Iterating Through Opaque Objects.

As that section describes, the order in which windows are returned is arbitrary. The root window is not necessarily first, nor is it necessarily last.

Parameters

win

A window, or NULL.

 

rockptr

Return location for the next window's rock, or NULL.

 

Returns

the next window, or NULL if there are no more.


glk_window_get_rock ()

glui32
glk_window_get_rock (winid_t win);

Returns win 's rock value. Pair windows always have rock 0; all other windows return whatever rock value you created them with.

Parameters

win

A window.

 

Returns

A rock value.


glk_window_get_type ()

glui32
glk_window_get_type (winid_t win);

Returns win 's type, one of wintype_Blank, wintype_Pair, wintype_TextBuffer, wintype_TextGrid, or wintype_Graphics.

Parameters

win

A window.

 

Returns

The window's type.


glk_window_get_parent ()

winid_t
glk_window_get_parent (winid_t win);

Returns the window which is the parent of win . If win is the root window, this returns NULL, since the root window has no parent. Remember that the parent of every window is a pair window; other window types are always childless.

Parameters

win

A window.

 

Returns

A window, or NULL.


glk_window_get_sibling ()

winid_t
glk_window_get_sibling (winid_t win);

Returns the other child of win 's parent. If win is the root window, this returns NULL.

Parameters

win

A window.

 

Returns

A window, or NULL.


glk_window_get_root ()

winid_t
glk_window_get_root (void);

Returns the root window. If there are no windows, this returns NULL.

Returns

A window, or NULL.


glk_window_clear ()

void
glk_window_clear (winid_t win);

Erases win . The meaning of this depends on the window type.

Text buffer

This may do any number of things, such as delete all text in the window, or print enough blank lines to scroll all text beyond visibility, or insert a page-break marker which is treated specially by the display part of the library.

Text grid

This will clear the window, filling all positions with blanks (in the normal style). The window cursor is moved to the top left corner (position 0,0).

Graphics

Clears the entire window to its current background color. See Graphics Windows.

Other window types

No effect.

It is illegal to erase a window which has line input pending.

Parameters

win

A window.

 

glk_window_get_stream ()

strid_t
glk_window_get_stream (winid_t win);

Returns the stream which is associated with win . (See Window Streams.) Every window has a stream which can be printed to, but this may not be useful, depending on the window type.

For example, printing to a blank window's stream has no effect.

Parameters

win

A window.

 

Returns

A window stream.


glk_set_window ()

void
glk_set_window (winid_t win);

Sets the current stream to win 's window stream. If win is NULL, it is equivalent to

1
glk_stream_set_current(NULL);

If win is not NULL, it is equivalent to

1
glk_stream_set_current(glk_window_get_stream(win));

See Streams.

Parameters

win

A window, or NULL.