GooCanvasItemSimple

GooCanvasItemSimple — the base class for the standard canvas items.

Synopsis


#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);

Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasEllipse
         +----GooCanvasImage
         +----GooCanvasPath
         +----GooCanvasPolyline
         +----GooCanvasRect
         +----GooCanvasText

Implemented Interfaces

GooCanvasItemSimple implements GooCanvasItem.

Properties


  "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

Description

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.

Details

GooCanvasItemSimple

typedef struct _GooCanvasItemSimple GooCanvasItemSimple;

The GooCanvasItemSimple struct contains private data only.


goo_canvas_item_simple_set_style ()

void        goo_canvas_item_simple_set_style
                                            (GooCanvasItemSimple *item,
                                             GooCanvasStyle *style);

Sets the style of the item.

item : a GooCanvasItemSimple.
style : a GooCanvasStyle.

goo_canvas_item_simple_set_fill_options ()

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.

goo_canvas_item_simple_set_stroke_options ()

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.

goo_canvas_item_simple_get_path_bounds ()

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.

goo_canvas_item_simple_user_bounds_to_device ()

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.

goo_canvas_item_simple_check_in_path ()

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.

goo_canvas_item_simple_paint_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.

Property Details

The "antialias" property

  "antialias"            GooCairoAntialias     : Read / Write

The antialiasing mode to use.

Default value: CAIRO_ANTIALIAS_DEFAULT


The "fill-color" property

  "fill-color"           gchararray            : Write

The color to use to paint the interior of the item.

Default value: NULL


The "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


The "fill-pattern" property

  "fill-pattern"         GooCairoPattern       : Read / Write

The pattern to use to paint the interior of the item.


The "fill-pixbuf" property

  "fill-pixbuf"          GdkPixbuf             : Write

The pixbuf to use to paint the interior of the item.


The "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


The "line-cap" property

  "line-cap"             GooCairoLineCap       : Read / Write

The line cap style to use.

Default value: CAIRO_LINE_CAP_BUTT


The "line-dash" property

  "line-dash"            GooCairoLineDash      : Read / Write

The dash pattern to use.


The "line-join" property

  "line-join"            GooCairoLineJoin      : Read / Write

The line join style to use.

Default value: CAIRO_LINE_JOIN_MITER


The "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


The "line-width" property

  "line-width"           gdouble               : Read / Write

The line width to use for the item's perimeter.

Allowed values: >= 0

Default value: 0


The "operator" property

  "operator"             GooCairoOperator      : Read / Write

The compositing operator to use.

Default value: CAIRO_OPERATOR_OVER


The "stroke-color" property

  "stroke-color"         gchararray            : Write

The color to use for the item's perimeter.

Default value: NULL


The "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


The "stroke-pattern" property

  "stroke-pattern"       GooCairoPattern       : Read / Write

The pattern to use to paint the perimeter of the item.


The "stroke-pixbuf" property

  "stroke-pixbuf"        GdkPixbuf             : Write

The pixbuf to use to draw the item's perimeter.