## GocCanvas

GocCanvas — The canvas widget

## Synopsis

    enum                GocDirection;
                        GocCanvas;
    typedef             GocCanvasClass;
    GocGroup*           goc_canvas_get_root                 (GocCanvas *canvas);
    int                 goc_canvas_get_width                (GocCanvas *canvas);
    int                 goc_canvas_get_height               (GocCanvas *canvas);
    void                goc_canvas_scroll_to                (GocCanvas *canvas,
                                                             double x,
                                                             double y);
    void                goc_canvas_get_scroll_position      (GocCanvas *canvas,
                                                             double *x,
                                                             double *y);
    void                goc_canvas_set_pixels_per_unit      (GocCanvas *canvas,
                                                             double pixels_per_unit);
    double              goc_canvas_get_pixels_per_unit      (GocCanvas *canvas);
    void                goc_canvas_invalidate               (GocCanvas *canvas,
                                                             double x0,
                                                             double y0,
                                                             double x1,
                                                             double y1);
    GocItem*            goc_canvas_get_item_at              (GocCanvas *canvas,
                                                             double x,
                                                             double y);
    void                goc_canvas_grab_item                (GocCanvas *canvas,
                                                             GocItem *item);
    void                goc_canvas_ungrab_item              (GocCanvas *canvas);
    GocItem*            goc_canvas_get_grabbed_item         (GocCanvas *canvas);
    void                goc_canvas_set_document             (GocCanvas *canvas,
                                                             GODoc *document);
    GODoc*              goc_canvas_get_document             (GocCanvas *canvas);
    GdkEvent*           goc_canvas_get_cur_event            (GocCanvas *canvas);
    void                goc_canvas_set_direction            (GocCanvas *canvas,
                                                             GocDirection direction);
    GocDirection        goc_canvas_get_direction            (GocCanvas *canvas);
    void                goc_canvas_w2c                      (GocCanvas *canvas,
                                                             int x,
                                                             int y,
                                                             double *x_,
                                                             double *y_);
    void                goc_canvas_c2w                      (GocCanvas *canvas,
                                                             double x,
                                                             double y,
                                                             int *x_,
                                                             int *y_);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkContainer
                               +----GtkLayout
                                     +----GocCanvas

## Implemented Interfaces

GocCanvas implements AtkImplementorIface and GtkBuildable.

## Description

The canvas widget used in gnumeric.

## Details

### enum GocDirection

    typedef enum {
    	GOC_DIRECTION_LTR,
    	GOC_DIRECTION_RTL,
    	GOC_DIRECTION_MAX
    } GocDirection;

### GocCanvas

    typedef struct _GocCanvas GocCanvas;

### GocCanvasClass

    typedef GtkLayoutClass GocCanvasClass;

### goc_canvas_get_root ()

    GocGroup*           goc_canvas_get_root                 (GocCanvas *canvas);

`canvas` : | GocCanvas
Returns : | the top level item of `canvas`, always a GocGroup.

### goc_canvas_get_width ()

    int                 goc_canvas_get_width                (GocCanvas *canvas);

`canvas` : |
Returns : |

### goc_canvas_get_height ()

    int                 goc_canvas_get_height               (GocCanvas *canvas);

`canvas` : |
Returns : |

### goc_canvas_scroll_to ()

    void                goc_canvas_scroll_to                (GocCanvas *canvas,
                                                             double x,
                                                             double y);

`canvas` : |
`x` : |
`y` : |

### goc_canvas_get_scroll_position ()

    void                goc_canvas_get_scroll_position      (GocCanvas *canvas,
                                                             double *x,
                                                             double *y);

`canvas` : |
`x` : |
`y` : |

### goc_canvas_set_pixels_per_unit ()

    void                goc_canvas_set_pixels_per_unit      (GocCanvas *canvas,
                                                             double pixels_per_unit);

`canvas` : |
`pixels_per_unit` : |

### goc_canvas_get_pixels_per_unit ()

    double              goc_canvas_get_pixels_per_unit      (GocCanvas *canvas);

`canvas` : |
Returns : |

### goc_canvas_invalidate ()

    void                goc_canvas_invalidate               (GocCanvas *canvas,
                                                             double x0,
                                                             double y0,
                                                             double x1,
                                                             double y1);

`canvas` : |
`x0` : |
`y0` : |
`x1` : |
`y1` : |

### goc_canvas_get_item_at ()

    GocItem*            goc_canvas_get_item_at              (GocCanvas *canvas,
                                                             double x,
                                                             double y);

`canvas` : |
`x` : |
`y` : |
Returns : |

### goc_canvas_grab_item ()

    void                goc_canvas_grab_item                (GocCanvas *canvas,
                                                             GocItem *item);

`canvas` : |
`item` : |

### goc_canvas_ungrab_item ()

    void                goc_canvas_ungrab_item              (GocCanvas *canvas);

`canvas` : |

### goc_canvas_get_grabbed_item ()

    GocItem*            goc_canvas_get_grabbed_item         (GocCanvas *canvas);

`canvas` : |
Returns : |

### goc_canvas_set_document ()

    void                goc_canvas_set_document             (GocCanvas *canvas,
                                                             GODoc *document);

`canvas` : |
`document` : |

### goc_canvas_get_document ()

    GODoc*              goc_canvas_get_document             (GocCanvas *canvas);

`canvas` : |
Returns : |

### goc_canvas_get_cur_event ()

    GdkEvent*           goc_canvas_get_cur_event            (GocCanvas *canvas);

`canvas` : |
Returns : |

### goc_canvas_set_direction ()

    void                goc_canvas_set_direction            (GocCanvas *canvas,
                                                             GocDirection direction);

`canvas` : |
`direction` : |

### goc_canvas_get_direction ()

    GocDirection        goc_canvas_get_direction            (GocCanvas *canvas);

`canvas` : |
Returns : |

### goc_canvas_w2c ()

    void                goc_canvas_w2c                      (GocCanvas *canvas,
                                                             int x,
                                                             int y,
                                                             double *x_,
                                                             double *y_);

`canvas` : |
`x` : |
`y` : |
`x_` : |
`y_` : |

### goc_canvas_c2w ()

    void                goc_canvas_c2w                      (GocCanvas *canvas,
                                                             double x,
                                                             double y,
                                                             int *x_,
                                                             int *y_);

`canvas` : |
`x` : |
`y` : |
`x_` : |
`y_` : |