GOffice.Canvas¶
| Subclasses: | None | 
|---|
Methods¶
| c2w(x, y, x_, y_) | |
| get_bounds(x0, y0, x1, y1) | |
| get_cur_event() | |
| get_direction() | |
| get_document() | |
| get_grabbed_item() | |
| get_height() | |
| get_item_at(x, y) | |
| get_pixels_per_unit() | |
| get_realized() | |
| get_root() | |
| get_scroll_position(x, y) | |
| get_width() | |
| grab_item(item) | |
| invalidate(x0, y0, x1, y1) | |
| invalidate_region(item, region) | |
| render(cr, x0, y0, x1, y1) | |
| scroll_to(x, y) | |
| set_direction(direction) | |
| set_document(document) | |
| set_pixels_per_unit(pixels_per_unit) | |
| ungrab_item() | |
| w2c(x, y, x_, y_) | 
Virtual Methods¶
| Inherited: | Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Scrollable (1) | 
|---|
Properties¶
| Inherited: | Gtk.Layout (2), Gtk.Container (3), Gtk.Widget (39), Gtk.Scrollable (4) | 
|---|
Child Properties¶
| Inherited: | Gtk.Layout (2) | 
|---|
Style Properties¶
| Inherited: | Gtk.Widget (17) | 
|---|
Signals¶
| Inherited: | Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
Fields¶
| Inherited: | Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| base | Gtk.Layout | r | |
| cur_event | Gdk.Event | r | |
| direction | GOffice.CanvasDirection | r | |
| document | GOffice.Doc | r | |
| grabbed_item | GOffice.CanvasItem | r | |
| height | int | r | |
| last_item | GOffice.CanvasItem | r | |
| pixels_per_unit | float | r | |
| priv | object | r | |
| root | GOffice.CanvasGroup | r | |
| scroll_x1 | float | r | |
| scroll_y1 | float | r | |
| width | int | r | 
Class Details¶
- 
class GOffice.Canvas(**kwargs)¶
- Bases: - Gtk.Layout- Abstract: - No - 
c2w(x, y, x_, y_)¶
- Parameters: - Retrieves the position in the widget given the canvas coordinates. 
 - 
get_direction()¶
- Returns: - the current canvas direction. - Return type: - GOffice.CanvasDirection
 - 
get_document()¶
- Returns: - The - GOffice.Docassociated with the- GOffice.Canvas.- Return type: - GOffice.Doc
 - 
get_grabbed_item()¶
- Returns: - The currently grabbed - GOffice.CanvasItem.- Return type: - GOffice.CanvasItem
 - 
get_item_at(x, y)¶
- Parameters: - Returns: - the - GOffice.CanvasItemdisplayed at (x,`y`) if any.- Return type: 
 - 
get_pixels_per_unit()¶
- Returns: - how many pixels are used for each unit when displaying the canvas. - Return type: - float
 - 
get_realized()¶
- Returns: - Trueif the canvas has been realized as a- Gtk.Widget.- Return type: - bool
 - 
get_root()¶
- Returns: - the top level item of self, always a - GOffice.CanvasGroup.- Return type: - GOffice.CanvasGroup
 - 
get_scroll_position(x, y)¶
- Parameters: - Retrieves the origin of the visible region of the canvas. 
 - 
grab_item(item)¶
- Parameters: - item ( - GOffice.CanvasItem) –- GOffice.CanvasItem- Grabs - GOffice.CanvasItem. All subsequent events will be passed to- GOffice.CanvasItem. This function fails if an item is already grabbed.
 - 
invalidate(x0, y0, x1, y1)¶
- Parameters: - x0 (float) – minimum x coordinate of the invalidated region in canvas coordinates
- y0 (float) – minimum y coordinate of the invalidated region in canvas coordinates
- x1 (float) – maximum x coordinate of the invalidated region in canvas coordinates
- y1 (float) – maximum y coordinate of the invalidated region in canvas coordinates
 - Invalidates a region of the canvas. The canvas will be redrawn only if the invalidated region intersects the visible area. 
- x0 (
 - 
invalidate_region(item, region)¶
- Parameters: - item (GOffice.CanvasItem) – the item to redraw
- region (cairo.Region) – the region to redraw
 - Invalidates a region of the canvas. Only item will be redrawn if the next draw event is called with a cairo contest clipped to region. Used in gnumeric for the walking ants cursor. 
- item (
 - 
render(cr, x0, y0, x1, y1)¶
- Parameters: - cr (cairo.Context) –
- x0 (float) –
- y0 (float) –
- x1 (float) –
- y1 (float) –
 
- cr (
 - 
scroll_to(x, y)¶
- Parameters: - Scrolls the canvas so that the origin of the visible region is at (x,`y`). The origin position depends on the canvas direction (see - GOffice.CanvasDirection).
 - 
set_direction(direction)¶
- Parameters: - direction ( - GOffice.CanvasDirection) –- GOffice.CanvasDirection- Sets the direction used by the canvas. 
 - 
set_document(document)¶
- Parameters: - document ( - GOffice.Doc) –- GOffice.Doc- Associates the - GOffice.Docwith the- GOffice.Canvas. This is needed to use images when filling styled items (see- GOffice.CanvasStyledItem).
 - 
set_pixels_per_unit(pixels_per_unit)¶
- Parameters: - pixels_per_unit ( - float) – the new scale- Sets the scale as the number of pixels used for each unit when displaying the canvas. 
 - 
ungrab_item()¶
- Ungrabs the currently grabbed - GOffice.CanvasItem. This function fails if no item is grabbed.
 - 
w2c(x, y, x_, y_)¶
- Parameters: - Retrieves the canvas coordinates given the position in the widget. 
 
-