Scroll to navigation

TICKIT_PEN_NEW(3) Library Functions Manual TICKIT_PEN_NEW(3)

NAME

tickit_pen_new - create a new pen instance

SYNOPSIS

#include <tickit.h>

TickitPen *tickit_pen_new(void);
TickitPen *tickit_pen_new_attrs(...);
TickitPen *tickit_pen_clone(const TickitPen *orig);

Link with -ltickit.

DESCRIPTION

tickit_pen_new() creates a new TickitPen instance. It initially has no attributes set.

tickit_pen_new_attrs() creates a new TickitPen instance and populates it with a given list of attribute values. The attributes are given as pairs; first a TickitPenAttr then an integer giving its value, terminated by a final 0 or -1.

Two additional attribute types are recognised here, TICKIT_PEN_FG_DESC and TICKIT_PEN_BG_DESC. These will expect to receive a string argument value, which will be parsed as for tickit_pen_set_colour_attr_desc(3).

tickit_pen_clone() creates a new TickitPen instance. It initially has the same attributes values set as the one given by orig.

The reference count of a newly-constructed pen instance will be one. This can be incremented or decremented using tickit_pen_ref(3) and tickit_pen_unref(3). When its reference count reaches zero it is destroyed.

RETURN VALUE

If successful, tickit_pen_new(), tickit_pen_new_attrs() and tickit_pen_clone() return a pointer to the new instance. On failure, NULL is returned with errno set to indicate the failure.

SEE ALSO

tickit_pen_ref(3), tickit_pen_unref(3), tickit_pen_bind_event(3), tickit_pen(7), tickit(7)