GocGroup

## GocGroup GocGroup — Group item |

## Synopsis

                        GocGroup;
    struct              GocGroupClass;
    void                goc_group_add_child                 (GocGroup *parent,
                                                             GocItem *item);
    void                goc_group_adjust_bounds             (GocGroup const *group,
                                                             double *x0,
                                                             double *y0,
                                                             double *x1,
                                                             double *y1);
    void                goc_group_adjust_coords             (GocGroup const *group,
                                                             double *x,
                                                             double *y);
    void                goc_group_cairo_transform           (GocGroup const *group,
                                                             cairo_t *cr,
                                                             double x,
                                                             double y);
    void                goc_group_clear                     (GocGroup *group);
    GocGroup *          goc_group_new                       (GocGroup *parent);
    void                goc_group_remove_child              (GocGroup *parent,
                                                             GocItem *item);
    void                goc_group_set_clip_path             (GocGroup *group,
                                                             GOPath *clip_path,
                                                             cairo_fill_rule_t clip_rule);

## Object Hierarchy

      GObject
       +----GocItem
             +----GocGroup

## Properties

      "x"                        gdouble               : Read / Write
      "y"                        gdouble               : Read / Write

## Description

A GocGroup is a GocItem which just contains other items.

The contents of the canvas are stored as a tree where GocGroup items are branches and other items are leafs.

## Details

### GocGroup

    typedef struct _GocGroup GocGroup;

### struct GocGroupClass

    struct GocGroupClass {
    	GocItemClass base;
    };

GocItemClass `base`; | base class.

### goc_group_add_child ()

    void                goc_group_add_child                 (GocGroup *parent,
                                                             GocItem *item);

Adds `item` as a new child to `parent`.

`parent` : | GocGroup
`item` : | GocItem

### goc_group_adjust_bounds ()

    void                goc_group_adjust_bounds             (GocGroup const *group,
                                                             double *x0,
                                                             double *y0,
                                                             double *x1,
                                                             double *y1);

Adds `group` horizontal offset to `x0` and `x1`, and vertical offset to `y0` and `y1`. This function is called recursively so that when returning `x0`, `y0`, `x1`, and `y1` are absolute coordinates in canvas space,

`group` : | GocGroup
`x0` : | first horizontal coordinate
`y0` : | first vertical coordinate
`x1` : | last horizontal coordinate
`y1` : | last vertical coordinate

### goc_group_adjust_coords ()

    void                goc_group_adjust_coords             (GocGroup const *group,
                                                             double *x,
                                                             double *y);

Adds `group` horizontal offset to `x0`, and vertical offset to `y0`. This function is called recursively so that when returning `x0` and `y0` are absolute coordinates in canvas space,

`group` : | GocGroup
`x` : | horizontal coordinate
`y` : | vertical coordinate

### goc_group_cairo_transform ()

    void                goc_group_cairo_transform           (GocGroup const *group,
                                                             cairo_t *cr,
                                                             double x,
                                                             double y);

Translates `cr` current context so that operations start at (`x`,`y`), which are `group` relative coordinates, and is scaled according to the containing GocCanvas current scale (see `goc_canvas_get_pixels_per_unit()`). The translation takes all `group` ancestors into account.

This function does not call `cairo_save()`.

`group` : | GocGroup
`cr` : | cairo_t
`x` : | horizontal coordinate
`y` : | vertical coordinate

### goc_group_clear ()

    void                goc_group_clear                     (GocGroup *group);

Destroys all `group` children.

`group` : | GocGroup

### goc_group_new ()

    GocGroup *          goc_group_new                       (GocGroup *parent);

Creates a new GocGroup as a child of `parent`.

`parent` : | GocGroup
Returns : | the newly created GocGroup. [transfer none]

### goc_group_remove_child ()

    void                goc_group_remove_child              (GocGroup *parent,
                                                             GocItem *item);

Removes `item` from `parent`. This function will fail if `item` is not a child of `parent`.

`parent` : | GocGroup
`item` : | GocItem

### goc_group_set_clip_path ()

    void                goc_group_set_clip_path             (GocGroup *group,
                                                             GOPath *clip_path,
                                                             cairo_fill_rule_t clip_rule);

Clips the drawing inside `path`.

`group` : | GocGroup
`clip_path` : | GOPath
`clip_rule` : | cairo_fill_rule_t

## Property Details

### The `"x"` property

      "x"                        gdouble               : Read / Write

The group horizontal offset.

Default value: 0

### The `"y"` property

      "y"                        gdouble               : Read / Write

The group vertical offset.

Default value: 0