![]() |
![]() |
![]() |
GooCanvas Reference Manual | ![]() |
---|---|---|---|---|
#include <goocanvas.h> GooCanvasItemSimple; void goo_canvas_item_simple_set_style (GooCanvasItemSimple *item, GooCanvasStyle *style); void goo_canvas_item_simple_set_fill_options (GooCanvasItemSimple *item, cairo_t *cr); void goo_canvas_item_simple_set_stroke_options (GooCanvasItemSimple *item, cairo_t *cr); void goo_canvas_item_simple_get_path_bounds (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); void goo_canvas_item_simple_user_bounds_to_device (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); gboolean goo_canvas_item_simple_check_in_path (GooCanvasItemSimple *item, gdouble x, gdouble y, cairo_t *cr, GooCanvasPointerEvents pointer_events); void goo_canvas_item_simple_paint_path (GooCanvasItemSimple *item, cairo_t *cr);
GObject +----GooCanvasItemSimple +----GooCanvasEllipse +----GooCanvasImage +----GooCanvasPath +----GooCanvasPolyline +----GooCanvasRect +----GooCanvasText
"antialias" GooCairoAntialias : Read / Write "fill-color" gchararray : Write "fill-color-rgba" guint : Write "fill-pattern" GooCairoPattern : Read / Write "fill-pixbuf" GdkPixbuf : Write "fill-rule" GooCairoFillRule : Read / Write "line-cap" GooCairoLineCap : Read / Write "line-dash" GooCairoLineDash : Read / Write "line-join" GooCairoLineJoin : Read / Write "line-join-miter-limit" gdouble : Read / Write "line-width" gdouble : Read / Write "operator" GooCairoOperator : Read / Write "stroke-color" gchararray : Write "stroke-color-rgba" guint : Write "stroke-pattern" GooCairoPattern : Read / Write "stroke-pixbuf" GdkPixbuf : Write
GooCanvasItemSimple is used as a base class for the standard canvas items.
It supports a number of style properties, such as "stroke-color", "fill-color" and "line-width".
It also provides a number of utility functions that subclasses can use.
typedef struct _GooCanvasItemSimple GooCanvasItemSimple;
The GooCanvasItemSimple struct contains private data only.
void goo_canvas_item_simple_set_style (GooCanvasItemSimple *item, GooCanvasStyle *style);
Sets the style of the item.
item : |
a GooCanvasItemSimple. |
style : |
a GooCanvasStyle. |
void goo_canvas_item_simple_set_fill_options (GooCanvasItemSimple *item, cairo_t *cr);
Sets the fill options of the cairo context, according to the item's style settings.
item : |
a GooCanvasItemSimple. |
cr : |
a cairo context. |
void goo_canvas_item_simple_set_stroke_options (GooCanvasItemSimple *item, cairo_t *cr);
Sets the stroke options of the cairo context, according to the item's style settings.
item : |
a GooCanvasItemSimple. |
cr : |
a cairo context. |
void goo_canvas_item_simple_get_path_bounds (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds);
Calculates the bounds of the current path in device space, storing the results in the given GooCanvasBounds struct.
item : |
a GooCanvasItemSimple. |
cr : |
a cairo context. |
bounds : |
the GooCanvasBounds struct to store the resulting bounding box. |
void goo_canvas_item_simple_user_bounds_to_device (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds);
Converts the item's bounds to a bounding box in device space.
item : |
a GooCanvasItemSimple. |
cr : |
a cairo context. |
bounds : |
the bounds of the item, in the item's coordinate space. |
gboolean goo_canvas_item_simple_check_in_path (GooCanvasItemSimple *item, gdouble x, gdouble y, cairo_t *cr, GooCanvasPointerEvents pointer_events);
Checks if the given point is in the current path.
item : |
a GooCanvasItemSimple. |
x : |
the x coordinate of the point. |
y : |
the y coordinate of the point. |
cr : |
a cairo context. |
pointer_events : |
specifies which parts of the path to check. |
Returns : | TRUE if the given point is in the current path.
|
void goo_canvas_item_simple_paint_path (GooCanvasItemSimple *item, cairo_t *cr);
Paints the current path, using the item's style settings.
item : |
a GooCanvasItemSimple. |
cr : |
a cairo context. |
antialias
" property"antialias" GooCairoAntialias : Read / Write
The antialiasing mode to use.
Default value: CAIRO_ANTIALIAS_DEFAULT
fill-color
" property"fill-color" gchararray : Write
The color to use to paint the interior of the item.
Default value: NULL
fill-color-rgba
" property"fill-color-rgba" guint : Write
The color to use to paint the interior of the item, specified as a 32-bit integer value.
Default value: 0
fill-pattern
" property"fill-pattern" GooCairoPattern : Read / Write
The pattern to use to paint the interior of the item.
fill-pixbuf
" property"fill-pixbuf" GdkPixbuf : Write
The pixbuf to use to paint the interior of the item.
fill-rule
" property"fill-rule" GooCairoFillRule : Read / Write
The fill rule used to determine which parts of the item are filled.
Default value: CAIRO_FILL_RULE_WINDING
line-cap
" property"line-cap" GooCairoLineCap : Read / Write
The line cap style to use.
Default value: CAIRO_LINE_CAP_BUTT
line-join
" property"line-join" GooCairoLineJoin : Read / Write
The line join style to use.
Default value: CAIRO_LINE_JOIN_MITER
line-join-miter-limit
" property"line-join-miter-limit" gdouble : Read / Write
The smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limit.
Allowed values: >= 0
Default value: 10
line-width
" property"line-width" gdouble : Read / Write
The line width to use for the item's perimeter.
Allowed values: >= 0
Default value: 0
operator
" property"operator" GooCairoOperator : Read / Write
The compositing operator to use.
Default value: CAIRO_OPERATOR_OVER
stroke-color
" property"stroke-color" gchararray : Write
The color to use for the item's perimeter.
Default value: NULL
stroke-color-rgba
" property"stroke-color-rgba" guint : Write
The color to use for the item's perimeter, specified as a 32-bit integer value.
Default value: 0
stroke-pattern
" property"stroke-pattern" GooCairoPattern : Read / Write
The pattern to use to paint the perimeter of the item.