Class: GOffice::GraphRenderer

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

Instance Method Summary collapse

Constructor Details

#initialize(graph) ⇒ GOffice::GraphRenderer

Returns a new Gog::Renderer which can render into a pixbuf, and sets graph as its model.

Parameters:

Instance Method Details

#cairo_surfacecairo::Surface

Returns:

  • (cairo::Surface)

#draw_circle(x, y, r) ⇒ nil

Parameters:

  • x (Float)
  • y (Float)
  • r (Float)

Returns:

  • (nil)

#draw_color_map(map, discrete, horizontal, rect) ⇒ nil

Parameters:

Returns:

  • (nil)

#draw_data_label(elt, pos, anchor, legend_style) ⇒ nil

Parameters:

Returns:

  • (nil)

#draw_gostring(str, pos, anchor, justification, width) ⇒ nil

Have rend draw layout in the at pos.x,y anchored by the anchor corner. If pos.w or pos.h are >= 0 then clip the results to less than that size.

Parameters:

  • str (GOffice::String)

    the #GOString to draw

  • pos (GOffice::GraphViewAllocation)

    Gog::ViewAllocation

  • anchor (GOffice::AnchorType)

    GOAnchor::Type how to draw relative to pos

  • justification (GOffice::Justification)

    Go::Justification for multiline string.

  • width (Float)

    if positive, the maximum width to get a multiline string if needed.

Returns:

  • (nil)

#draw_grip(x, y) ⇒ nil

Draw a grip, used for moving/resizing of objects.

Parameters:

  • x (Float)

    x position of grip

  • y (Float)

    y position of grip

Returns:

  • (nil)

#draw_marker(x, y) ⇒ nil

Parameters:

  • x (Float)

    X-coordinate

  • y (Float)

    Y-coordinate

Returns:

  • (nil)

#draw_rectangle(rect) ⇒ nil

A utility routine to build a closed rectangle vpath.

Parameters:

  • rect (GOffice::GraphViewAllocation)

    position and extent of rectangle

Returns:

  • (nil)

#draw_rotated_rectangle(rect, rotate_bg) ⇒ nil

Parameters:

  • rect (GOffice::GraphViewAllocation)
  • rotate_bg (Boolean)

Returns:

  • (nil)

#draw_selection_rectangle(rectangle) ⇒ nil

Parameters:

  • rectangle (GOffice::GraphViewAllocation)

Returns:

  • (nil)

#draw_shape(path) ⇒ nil

Parameters:

  • path (GOffice::Path)

Returns:

  • (nil)

#draw_text(text, pos, anchor, use_markup, justification, width) ⇒ nil

Have rend draw text in the at pos.x,y anchored by the anchor corner. If pos.w or pos.h are >= 0 then clip the results to less than that size.

Parameters:

  • text (String)

    the string to draw

  • pos (GOffice::GraphViewAllocation)

    Gog::ViewAllocation

  • anchor (GOffice::AnchorType)

    GOAnchor::Type how to draw relative to pos

  • use_markup (Boolean)

    wether to use pango markup

  • justification (GOffice::Justification)

    Go::Justification for multiline text.

  • width (Float)

    if positive, the maximum width to get a multiline text if needed.

Returns:

  • (nil)

#export_image(format, output, x_dpi, y_dpi) ⇒ Boolean

Exports an image of graph in given format, writing results in a Gsf::Output stream. If export format type is a bitmap one, it computes image size with x_dpi, y_dpi and graph size (see gog_graph_get_size()).

Parameters:

  • format (GOffice::ImageFormat)

    image format for export

  • output (Gsf::Output)

    a Gsf::Output stream

  • x_dpi (Float)

    x resolution of exported graph

  • y_dpi (Float)

    y resolution of exported graph

Returns:

  • (Boolean)

    true if export succeed.

#fill_circle(x, y, r) ⇒ nil

Parameters:

  • x (Float)
  • y (Float)
  • r (Float)

Returns:

  • (nil)

#fill_rectangle(rect) ⇒ nil

Parameters:

  • rect (GOffice::GraphViewAllocation)

Returns:

  • (nil)

#fill_serie(path, close_path) ⇒ nil

Parameters:

  • path (GOffice::Path)
  • close_path (GOffice::Path)

Returns:

  • (nil)

#fill_shape(path) ⇒ nil

Parameters:

  • path (GOffice::Path)

Returns:

  • (nil)

#get_gostring_AABR(str, aabr, max_width) ⇒ nil

Parameters:

  • str (GOffice::String)

    the string to draw

  • aabr (GOffice::GeometryAABR)

    GOGeometry::AABR to store the Axis Aligned Bounding Rectangle of text.

  • max_width (Float)

    maximum width or -1 for unrestricted

Returns:

  • (nil)

#get_gostring_OBR(str, obr, max_width) ⇒ nil

Parameters:

  • str (GOffice::String)

    the string to draw

  • obr (GOffice::GeometryOBR)

    GOGeometry::OBR to store the Object Bounding Rectangle of text.

  • max_width (Float)

    maximum width or -1 for unrestricted

Returns:

  • (nil)

#get_text_AABR(text, use_markup, aabr, max_width) ⇒ nil

Parameters:

  • text (String)

    the string to draw

  • use_markup (Boolean)

    whether to use pango markup

  • aabr (GOffice::GeometryAABR)

    GOGeometry::AABR to store the Axis Aligned Bounding Rectangle of text.

  • max_width (Float)

    maximum width or -1 for unrestricted

Returns:

  • (nil)

#get_text_OBR(text, use_markup, obr, max_width) ⇒ nil

Parameters:

  • text (String)

    the string to draw

  • use_markup (Boolean)

    wether to use pango markup

  • obr (GOffice::GeometryOBR)

    GOGeometry::OBR to store the Object Bounding Rectangle of text.

  • max_width (Float)

    maximum width or -1 for unrestricted

Returns:

  • (nil)

#hairline_width_ptsFloat

Returns the hairline width in pts.

Returns:

  • (Float)

    the hairline width in pts.

#line_size(width) ⇒ Float

Parameters:

  • width (Float)

Returns:

  • (Float)

#modelGOffice::GraphGraph

Returns model.

Returns:

#model=(model) ⇒ GOffice::GraphGraph

Parameters:

Returns:

#pixbufGdkPixbuf::Pixbuf

Returns current pixbuf buffer from a renderer that can render into a pixbuf. or nil on error.

Returns:

  • (GdkPixbuf::Pixbuf)

    current pixbuf buffer from a renderer that can render into a pixbuf. or nil on error.

#pop_clipnil

End the current clipping.

Returns:

  • (nil)

#pop_stylenil

Returns:

  • (nil)

#pt2r(d) ⇒ Float

Parameters:

  • d (Float)

Returns:

  • (Float)

#pt2r_x(d) ⇒ Float

Parameters:

  • d (Float)

Returns:

  • (Float)

#pt2r_y(d) ⇒ Float

Parameters:

  • d (Float)

Returns:

  • (Float)

#push_clip(path) ⇒ nil

Defines the current clipping region.

Parameters:

  • path (GOffice::Path)

    a #GOPath

Returns:

  • (nil)

#push_clip_rectangle(x, y, w, h) ⇒ nil

Defines a rectangular clipping region. For efficient screen rendering, this function takes care to round the coordinates.

Parameters:

  • x (Float)

    left coordinate

  • y (Float)

    top coordinate

  • w (Float)

    width of clipping rectangle

  • h (Float)

    height of clipping rectangle

Returns:

  • (nil)

#push_style(style) ⇒ nil

Parameters:

Returns:

  • (nil)

#render_to_cairo(cairo, width, height) ⇒ Boolean

Parameters:

  • cairo (cairo::Context)
  • width (Float)
  • height (Float)

Returns:

  • (Boolean)

#request_updatenil

Returns:

  • (nil)

#scaleFloat

Returns:

  • (Float)

#stroke_circle(x, y, r) ⇒ nil

Parameters:

  • x (Float)
  • y (Float)
  • r (Float)

Returns:

  • (nil)

#stroke_rectangle(rect) ⇒ nil

Parameters:

  • rect (GOffice::GraphViewAllocation)

Returns:

  • (nil)

#stroke_serie(path) ⇒ nil

Parameters:

  • path (GOffice::Path)

Returns:

  • (nil)

#stroke_shape(path) ⇒ nil

Parameters:

  • path (GOffice::Path)

Returns:

  • (nil)

#update(w, h) ⇒ Boolean

Requests a renderer update, only useful for pixbuf based renderer.

Parameters:

  • w (Float)

    requested width

  • h (Float)

    requested height

Returns:

  • (Boolean)

    true if a redraw is necessary.

#viewGOffice::GraphView

Returns view.

Returns:

#view=(view) ⇒ GOffice::GraphView

Parameters:

Returns: