next up previous contents
Next: Output Primitives Up: Tina View Previous: Tina View   Contents

Installing a Tv on a Tvtool

A Tv is a logical display device. They are created by a call to

Tv *tv_create(char *name)

for example

display_tv = tv_create("Display");

Graphics can now be draw into display_tv by calls like

/* draw a diagonal green line **/
tv_set_color(display_tv, green);
tv_linexy(display_tv, 0, 0, 256, 256);

For those wishing to generate a Tv quickly for image display and manipulation, the simple Tv is provided as a template. The routines

Tv *simple_tv_make(char *name)

Imrect *simple_image_get(Tv *tv)

void simple_image_set(Tv *tv, Imrect *im)
use function calls described later in this chapter to provide a Tv structure which allows an image to be registered for display.

To be useful, a Tv must be installed on a Tvtool or a Display Tool. A Tvtool provides the buttons and menus needed to manage an actual display window on the screen, it is created by a call to

void *tv_tool(int xpos, int ypos)

A Display Tool, which is a cut down version of a TvTool for image or data display without interaction, can be generated by a call to

void *display_tool(int x, int y, int width, int height)
The returned pointers to void hides window system dependent data structures. The display_tv can now be installed on either of these tools by a call to
void    tv_install(Tv * tv, void *tv_screen)
This process is not irreversible, a given Tv can be associated with a Tool as required allowing the display tools to be used a free floating resources. The TvTool has an install button specifically for this process, a Tv can be registered as the next one for installation on any TvTool via a call to
void    tv_set_next(Tv * tv)


next up previous contents
Next: Output Primitives Up: Tina View Previous: Tina View   Contents
root 2017-11-24