|
NAMETickitPen - store a collection of terminal rendering attributesSYNOPSIS#include <tickit.h> typedef struct TickitPen; DESCRIPTIONA TickitPen instance stores a collection of terminal rendering attributes. For each known attribute, a pen instance may store a value for this attribute. A pen instance is used in the tickit_term_chpen(3) and tickit_term_setpen(3) functions.FUNCTIONSA new TickitPen instance is created using the tickit_pen_new(3) function. A pen instance stores a reference count to make it easier for applications to manage the lifetime of pens. A new pen starts with a count of one, and it can be adjusted using tickit_pen_ref(3) and tickit_pen_unref(3). When the count reaches zero the instance is destroyed.ATTRIBUTESThe TickitPenAttr enumeration lists the attributes known by a pen. Each attribute has a type, as given by the TickitPenAttrType enumeration. The tickit_pen_attrtype(3) function gives the type of a given attribute. The tickit_pen_attrname(3) function gives the name of a given attribute, which is also given below in parentheses. The tickit_pen_lookup_attr(3) function looks up an attribute constant from a string containing the name.
These colour attributes also support a secondary RGB8 (24-bit) specification, which some terminal drivers may prefer over the indexed version.
FUNCTIONSThe values of attributes are set or queried on a pen instance by using functions depending on the type of the attribute. Boolean attributes use tickit_pen_set_bool_attr(3) and tickit_pen_get_bool_attr(3). Integer attributes use tickit_pen_set_int_attr(3) and tickit_pen_get_int_attr(3). Colour attributes use tickit_pen_set_colour_attr(3), tickit_pen_set_colour_attr_desc(3) and tickit_pen_get_colour_attr(3). The RGB8 secondary field for colours can be set with tickit_pen_set_colour_attr_rgb8(3), and queried with tickit_pen_has_colour_attr_rgb8(3) and tickit_pen_get_colour_attr_rgb8(3).To test if an attribute has a value set, use tickit_pen_has_attr(3), and to remove the attribute entirely use tickit_pen_clear_attr(3). To test if a pen has any attributes set at all, use tickit_pen_is_nonempty(3), and to test if it has any attributes set to a non-default value use tickit_pen_is_nondefault(3). To remove all the attributes use tickit_pen_clear(3). To copy the value of one attribute from a pen into another pen use tickit_pen_copy_attr(3), to copy the entire pen use tickit_pen_copy(3), and to compare two pens for equality use tickit_pen_equiv_attr(3). EVENTSA pen 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_pen_bind_event(3) and removed using tickit_pen_unbind_event_id(3).The event types recognised are:
Visit the GSP FreeBSD Man Page Interface. |