|
NAMETickitWindow - a window for drawing operations and inputSYNOPSIS#include <tickit.h> typedef struct TickitWindow; DESCRIPTIONA TickitWindow instance represents a rectangular region of the screen. Windows are constructed as sub-divisions of existing windows, ultimately coming from a special "root window" is that represents the entire area of the terminal. Each window allows drawing to its region of the screen by responding to an event that signifies damage to that area that needs to be repainted, and has other events that represent user input.A window occupies a given size and position within its parent (apart from the root window, which occupies the entire terminal). Conceptually a window can be placed outside of the bounds of its parent, though any drawing output is clipped to the parent (and its parent, hierarchially, all the way to the root). A window may be hidden, at which point none of its output affects the screen, nor will it receive input events. The child windows of a given parent form an ordered list, the order of which can be modified. Drawing operations on a window only take effect if there are no higher siblings that would obscure it. The stacking order also affects the way that windows receive mouse events, with higher-level window shielding lower ones from receiving an event at a given cell. Each window tracks whether a single child window has the "input focus"; this is the child window that will be informed of keyboard input events. The innermost window following the focus chain gets the first chance to react to the event, followed by successively outer ones if it remains unhandled. Newly-exposed areas of windows are tracked by the root window, ready to be rendered by expose events. The root window itself will expose new areas caused by terminal resizes, and the entire root window is entirely exposed initially, to allow the application to run its initial rendering on startup. Each window stores a TickitPen instance that can be used to apply a default style to any rendering operations that take place within it or its children. FUNCTIONSA new top-level TickitWindow instance to represent the entire terminal is created by calling tickit_get_rootwin(3) on the toplevel Tickit instance, further sub-divided into regions using tickit_window_new(3). A window instance stores a reference count to make it easier for applications to manage the lifetime of windows. A new window starts with a count of one, and it can be adjusted using tickit_window_ref(3) and tickit_window_unref(3). When the count reaches zero the instance is destroyed. A window can also be immediately removed from its parent with tickit_window_close(3).The ancestry of a window can be queried using tickit_window_parent(3) and tickit_window_root(3). The stored child windows can be queried by using tickit_window_children(3) and tickit_window_get_children(3). The backing terminal can be queried with tickit_window_get_term(3). The stacking order of a window among its siblings can be controlled using tickit_window_raise(3), tickit_window_raise_to_front(3), tickit_window_lower(3) and tickit_window_lower_to_back(3). Its visibility can be controlled using tickit_window_show(3) and tickit_window_hide(3), and queried using tickit_window_is_visible(3). The position of a window within its parent can be queried using tickit_window_get_geometry(3) and within the terminal as a whole using tickit_window_get_abs_geometry(3). It can be resized using tickit_window_resize(3), moved using tickit_window_reposition(3), or both using tickit_window_set_geometry(3). A window can be given the input focus using tickit_window_take_focus(3), and can be queried to see if it has the focus using tickit_window_is_focused(3). Windows normally only invoke focus events about themselves, but can be made to invoke events about children windows as well by using tickit_window_set_focus_child_notify(3). When a window has the input focus, the properties of the terminal cursor can be set using tickit_window_set_cursor_position(3), tickit_window_set_cursor_visible(3) and tickit_window_set_cursor_shape(3). The TickitPen instance associated with each window for drawing purposes can be obtained using tickit_window_get_pen(3), and replaced using tickit_window_set_pen(3). This pen is used during expose events, which can be requested using tickit_window_expose(3). Pending expose events and other activity are performed by calling tickit_window_flush(3) on the root window instance. While most drawing operations are performed in a deferred manner using expose events, scrolling of the terminal content can be directly requested using tickit_window_scrollrect(3), tickit_window_scroll(3) or tickit_window_scroll_with_children(3). EVENTSA window instance stores a list of event handlers. Each event handler is associated with one event type and stores a function pointer, and an arbitrary pointer containing user data. Event handlers may be installed using tickit_window_bind_event(3) and removed using tickit_window_unbind_event_id(3).The event types recognised are:
CONTROLSA window instance has a number of runtime-configuration control options that affect its behaviour. These can be set using tickit_window_setctl_int(3), and queried using tickit_window_getctl_int(3). The individual controls have human-readable string names that can be obtained by tickit_window_ctlname(3) and searched by name using tickit_window_lookup_ctl(3). The type of a control option can be queried using tickit_window_ctltype(3).The options are given in an enumeration called
TickitWindowCtl. The following control values are recognised:
SEE ALSOtickit(7), tickit_term(7), tickit_renderbuffer(7), tickit_rect(7) Visit the GSP FreeBSD Man Page Interface. |