cdk_draw(3)

NAME
cdk_draw - Cdk Drawing Functions

SYNOPSIS

cc [ flag ... ] file ... -lcdk [ library ... ]

#include <cdk/cdk.h>

void boxWindow (
    WINDOW *window,
    chtype attr);

void attrbox (
    WINDOW *win,
    chtype tlc,
    chtype trc,
    chtype blc,
    chtype brc,
    chtype horz,
    chtype vert,
    chtype attr);

void drawObjBox (
    WINDOW *win,
    CDKOBJS *object);

void drawLine (
    WINDOW *window,
    int startx,
    int starty,
    int endx,
    int endy,
    chtype line);

void drawShadow (
    WINDOW *shadowWin);

void writeBlanks (
    WINDOW *window,
    int xpos,
    int ypos,
    int align,
    int start,
    int end);

void writeChar (
    WINDOW *window,
    int xpos,
    int ypos,
    char *string,
    int align,
    int start,
    int end);

void writeCharAttrib (
    WINDOW *window,
    int xpos,
    int ypos,
    char *string,
    chtype attr,
    int align,
    int start,
    int end);

void writeChtype (
    WINDOW *window,
    int xpos,
    int ypos,
    chtype *string,
    int align,
    int start,
    int end);

void writeChtypeAttrib (
    WINDOW *window,
    int xpos,
    int ypos,
    chtype *string,
    chtype attr,
    int align,
    int start,
    int end);

DESCRIPTION
These functions perform useful drawing and attribute operations.

AVAILABLE FUNCTIONS

boxWindow
    draw a box with on the window win. Like attrbox, this function ORs attr with each character as it draws the box.

attrbox
    draw a box with on the window win letting the caller define each element of the box.

    The parameters tlc, trc, blc, brc are used for the top-left, top-right, bottom-left and bottom-right corners respectively. The parameters horz and vert are used for the horizontal and vertical sides of the box. Any of these parameters may be zero. In that case, the function skips the corresponding element of the box.

    The function ORs attr with each character as it draws the box.

drawObjBox
    Draw a box around the given window win using the object's defined line-drawing characters.

drawLine
    draw a line on the given window.

    The parameters starty, startx are the starting coordinates. The parameters endy, endx are the ending coordinates. The function writes the data in line to each coordinate in that range including the start/end coordinates.

    The function handles lines other than vertical or horizontal, but normally it is used for that, e.g., with line set to ACS_HLINE or ACS_VLINE.

drawShadow
    draw a shadow on the right and bottom edges of a window.

writeBlanks
    write a string of blanks, using writeChar. The parameters are passed to writeChar as is. There is no corresponding writeBlanksAttrib function.

writeChar
    writes out a char * string without adding attributes. The parameters are passed to writeCharAttrib as is.

writeCharAttrib
    writes out a char * string with the given attributes added. The string is written to the given window, using its relative screen coordinates ypos and xpos.

    Compare with writeChtypeAttrib, which writes a chtype * string.

    The function ORs the attribute attr with each item from the string. For instance, it may be A_BOLD. The align parameter controls whether it is written horizontally (HORIZONTAL) or vertically (VERTICAL).

    Finally, only a subset of the string is written. The function starts with the data from the start item of string, and ends before the end item. If start is greater than, or equal to end, no data is written.

writeChtype
    writes out a chtype * string without adding attributes. The parameters are passed to writeChtypeAttrib as is.

writeChtypeAttrib
    writes out a chtype * string with the given attributes added. The string is written to the given window, using its relative screen coordinates ypos and xpos. You would normally construct the string from a char * string using char2Chtype (3).

    The function ORs the attribute attr with each item from the string. For instance, it may be A_BOLD. The align parameter controls whether it is written horizontally (HORIZONTAL) or vertically (VERTICAL).

    Finally, only a subset of the string is written. The function starts with the data from the start item of string, and ends before the end item. If start is greater than, or equal to end, no data is written.

SEE ALSO
cdk(3), cdk_util(3)