Top |
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.
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.
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
.
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.
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
.
winid_t
glk_window_get_root (void
);
Returns the root window. If there are no windows, this returns NULL
.
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.
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.