| Goffice Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | ||||
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_);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkLayout +----GocCanvas
typedef enum {
GOC_DIRECTION_LTR,
GOC_DIRECTION_RTL,
GOC_DIRECTION_MAX
} GocDirection;
int goc_canvas_get_width (GocCanvas *canvas);
|
GocCanvas |
Returns : |
the width of the widget visible region. |
int goc_canvas_get_height (GocCanvas *canvas);
|
GocCanvas |
Returns : |
the height of the widget visible region. |
void goc_canvas_scroll_to (GocCanvas *canvas,double x,double y);
Scrolls the canvas so that the origin of the visible region is at (x,y).
The origin position depends on the canvas direction (see GocDirection).
|
GocCanvas |
|
the horizontal position |
|
the vertical position |
void goc_canvas_get_scroll_position (GocCanvas *canvas,double *x,double *y);
Retrieves the origin of the visible region of the canvas.
|
GocCanvas |
|
where to store the horizontal position |
|
where to store the vertical position |
void goc_canvas_set_pixels_per_unit (GocCanvas *canvas,double pixels_per_unit);
Sets the scale as the number of pixels used for each unit when displaying the canvas.
|
GocCanvas |
|
the new scale |
double goc_canvas_get_pixels_per_unit (GocCanvas *canvas);
|
GocCanvas |
Returns : |
how many pixels are used for each unit when displaying the canvas. |
void goc_canvas_invalidate (GocCanvas *canvas,double x0,double y0,double x1,double y1);
Invalidates a region of the canvas. The canvas will be redrawn only if the invalidated region intersects the visible area.
|
GocCanvas |
|
minimum x coordinate of the invalidated region in canvas coordinates |
|
minimum y coordinate of the invalidated region in canvas coordinates |
|
maximum x coordinate of the invalidated region in canvas coordinates |
|
maximum y coordinate of the invalidated region in canvas coordinates |
void goc_canvas_grab_item (GocCanvas *canvas,GocItem *item);
Grabs GocItem. All subsequent events will be passed to GocItem. This function fails if an item is already grabbed.
void goc_canvas_ungrab_item (GocCanvas *canvas);
Ungrabs the currently grabbed GocItem. This function fails if no item is grabbed.
|
GocCanvas |
void goc_canvas_set_document (GocCanvas *canvas,GODoc *document);
Associates the GODoc with the GocCanvas. This is needed to use images when filling styled items (see GocStyledItem).
void goc_canvas_set_direction (GocCanvas *canvas,GocDirection direction);
GocDirection goc_canvas_get_direction (GocCanvas *canvas);
|
GocCanvas |
Returns : |
the current canvas direction. |
void goc_canvas_w2c (GocCanvas *canvas,int x,int y,double *x_,double *y_);
Retrieves the canvas coordinates given the position in the widget.
|
GocCanvas |
|
the horizontal position as a widget coordinate. |
|
the vertical position as a widget coordinate. |
|
where to store the horizontal position as a canvas coordinate. |
|
where to store the vertical position as a canvas coordinate. |
void goc_canvas_c2w (GocCanvas *canvas,double x,double y,int *x_,int *y_);
Retrieves the position in the widget given the canvas coordinates.
|
GocCanvas |
|
the horizontal position as a canvas coordinate. |
|
the vertical position as a canvas coordinate. |
|
where to store the horizontal position as a widget coordinate. |
|
where to store the vertical position as a widget coordinate. |