Class: GOffice::Canvas

Inherits:
Gtk::Layout
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#c2w(x, y, x_, y_) ⇒ nil

Retrieves the position in the widget given the canvas coordinates.

Parameters:

  • x (Float)

    the horizontal position as a canvas coordinate.

  • y (Float)

    the vertical position as a canvas coordinate.

  • x_ (Integer)

    where to store the horizontal position as a widget coordinate.

  • y_ (Integer)

    where to store the vertical position as a widget coordinate.

Returns:

  • (nil)

#cur_eventGdk::Event

Returns The Gdk::Event being processed.

Returns:

  • (Gdk::Event)

    The Gdk::Event being processed.

#directionGOffice::CanvasDirection

Returns the current canvas direction.

Returns:

#direction=(direction) ⇒ nil

Sets the direction used by the canvas.

Parameters:

Returns:

  • (nil)

#documentGOffice::Doc

Returns The #GODoc associated with the Goc::Canvas.

Returns:

  • (GOffice::Doc)

    The #GODoc associated with the Goc::Canvas.

#document=(document) ⇒ nil

Associates the #GODoc with the Goc::Canvas. This is needed to use images when filling styled items (see Goc::StyledItem).

Parameters:

Returns:

  • (nil)

#get_bounds(x0, y0, x1, y1) ⇒ nil

Parameters:

  • x0 (Float)
  • y0 (Float)
  • x1 (Float)
  • y1 (Float)

Returns:

  • (nil)

#get_item_at(x, y) ⇒ GOffice::CanvasItem

Returns the Goc::Item displayed at (x,y) if any.

Parameters:

  • x (Float)

    horizontal position

  • y (Float)

    vertical position

Returns:

#get_scroll_position(x, y) ⇒ nil

Retrieves the origin of the visible region of the canvas.

Parameters:

  • x (Float)

    where to store the horizontal position

  • y (Float)

    where to store the vertical position

Returns:

  • (nil)

#grab_item(item) ⇒ nil

Grabs Goc::Item. All subsequent events will be passed to #GocItem. This function fails if an item is already grabbed.

Parameters:

Returns:

  • (nil)

#grabbed_itemGOffice::CanvasItem

Returns The currently grabbed Goc::Item.

Returns:

#heightInteger

Returns height.

Returns:

  • (Integer)

    height

#height=(height) ⇒ Integer

Parameters:

  • height (Integer)

Returns:

  • (Integer)

    height

  • (Integer)

    height

#invalidate(x0, y0, x1, y1) ⇒ nil

Invalidates a region of the canvas. The canvas will be redrawn only if the invalidated region intersects the visible area.

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

Returns:

  • (nil)

#invalidate_region(item, region) ⇒ nil

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.

Parameters:

  • item (GOffice::CanvasItem)

    the item to redraw

  • region (cairo::Region)

    the region to redraw

Returns:

  • (nil)

#pixels_per_unitFloat

Returns how many pixels are used for each unit when displaying the canvas.

Returns:

  • (Float)

    how many pixels are used for each unit when displaying the canvas.

#pixels_per_unit=(pixels_per_unit) ⇒ nil

Sets the scale as the number of pixels used for each unit when displaying the canvas.

Parameters:

  • pixels_per_unit (Float)

    the new scale

Returns:

  • (nil)

#realizedBoolean

Returns true if the canvas has been realized as a Gtk::Widget.

Returns:

  • (Boolean)

    true if the canvas has been realized as a Gtk::Widget.

#render(cr, x0, y0, x1, y1) ⇒ nil

Parameters:

  • cr (cairo::Context)
  • x0 (Float)
  • y0 (Float)
  • x1 (Float)
  • y1 (Float)

Returns:

  • (nil)

#rootGOffice::CanvasGroup

Returns the top level item of canvas, always a Goc::Group.

Returns:

#scroll_to(x, y) ⇒ nil

Scrolls the canvas so that the origin of the visible region is at (x,y). The origin position depends on the canvas direction (see Goc::Direction).

Parameters:

  • x (Float)

    the horizontal position

  • y (Float)

    the vertical position

Returns:

  • (nil)

#ungrab_itemnil

Ungrabs the currently grabbed Goc::Item. This function fails if no item is grabbed.

Returns:

  • (nil)

#w2c(x, y, x_, y_) ⇒ nil

Retrieves the canvas coordinates given the position in the widget.

Parameters:

  • x (Integer)

    the horizontal position as a widget coordinate.

  • y (Integer)

    the vertical position as a widget coordinate.

  • x_ (Float)

    where to store the horizontal position as a canvas coordinate.

  • y_ (Float)

    where to store the vertical position as a canvas coordinate.

Returns:

  • (nil)

#widthInteger

Returns width.

Returns:

  • (Integer)

    width

#width=(width) ⇒ Integer

Parameters:

  • width (Integer)

Returns:

  • (Integer)

    width

  • (Integer)

    width