Next: , Previous: Text-layout, Up: Class reference



8.3.15 Canvas class

A canvas object. It hosts the root of the VCL node tree, runs painters and handles the cooperation with GTK (events etc.).

It supports the object interface and the container interface.

     struct vcl_canvas * vcl_canvas_new (void)

Just creates a canvas.

     void vcl_canvas_setup (struct vcl_canvas *obj, int flags, real center_x,
                            real center_y, real unit_size)

Sets miscellaneous canvas parameters. center_x and center_y specify the relative center of the canvas – this point is fixed when resizing the canvas and it is the implicit position of mathvcl11. Passing the mathvcl12 values associates the center with the real center. unit_size is a multiplier for units and the flags are these:

VCL_CANVAS_REAL_UNITS
the base unit is a millimeter instead of a pixel.
VCL_CANVAS_FULL_WIDTH
The GTK widget allocates full width for the bounding box of the root node instead of a flexible size.
VCL_CANVAS_FLIP_X
Flip the X axis (instead of X increasing in left-right direction)
VCL_CANVAS_FLIP_Y
Flip the Y axis (instead of Y increasing in the up-down direction)
     void vcl_canvas_set_root (struct vcl_canvas *obj, void * root)

Sets the root node. The same rules as in vcl_enclosure_set_child apply.

     void * vcl_canvas_get_root (struct vcl_canvas *obj)

Returns the root node.