GOffice.Path

Fields

None

Methods

class

new ()

class

new_from_odf_enhanced_path (src, variables)

class

new_from_svg (src)

arc (cx, cy, rx, ry, th0, th1)

arc_to (cx, cy, rx, ry, th0, th1)

clear ()

close ()

copy ()

copy_restricted (start, end)

curve_to (x0, y0, x1, y1, x2, y2)

free ()

get_options ()

interpret (direction, move_to, line_to, curve_to, close_path, closure)

interpret_full (start, end, direction, move_to, line_to, curve_to, close_path, closure)

line_to (x, y)

move_to (x, y)

pie_wedge (cx, cy, rx, ry, th0, th1)

rectangle (x, y, width, height)

ref ()

ring_wedge (cx, cy, rx_out, ry_out, rx_in, ry_in, th0, th1)

scale (scale_x, scale_y)

set_options (options)

to_cairo (direction, cr)

to_svg ()

Details

class GOffice.Path
classmethod new()
Return type:

GOffice.Path

classmethod new_from_odf_enhanced_path(src, variables)
Parameters:
Returns:

the newly allocated GOffice.Path or None on error.

Return type:

GOffice.Path or None

classmethod new_from_svg(src)
Parameters:

src (str or None) – an SVG path.

Returns:

the newly allocated GOffice.Path.

Return type:

GOffice.Path or None

arc(cx, cy, rx, ry, th0, th1)
Parameters:
arc_to(cx, cy, rx, ry, th0, th1)
Parameters:
clear()
close()
copy()
Returns:

a new GOffice.Path identical to self.

Return type:

GOffice.Path or None

copy_restricted(start, end)
Parameters:
  • start (int) – the first action to copy

  • end (int) – the second action to copy

Returns:

a new GOffice.Path.

Return type:

GOffice.Path

Copies actions between start and end will be copied inside a new GOffice.Path. If start or end is negative, it is not taken into account.

New in version 0.10.5.

curve_to(x0, y0, x1, y1, x2, y2)
Parameters:
free()

Decrements references GOffice.count and frees all memory allocated for self if references GOffice.count reaches 0.

get_options()
Return type:

GOffice.PathOptions

interpret(direction, move_to, line_to, curve_to, close_path, closure)
Parameters:

This function can be used to draw a path or for other purposes. To draw using cairo, the closure argument should be a valid cairo.Context.

interpret_full(start, end, direction, move_to, line_to, curve_to, close_path, closure)
Parameters:

This function can be used to draw a portion path or for other purposes. Only actions between start and end will be executed. If start or end is negative, it is not taken into account.

New in version 0.10.5.

line_to(x, y)
Parameters:
move_to(x, y)
Parameters:
pie_wedge(cx, cy, rx, ry, th0, th1)
Parameters:
rectangle(x, y, width, height)
Parameters:
ref()
Returns:

the path with an incremented references GOffice.count.

Return type:

GOffice.Path

Increments references GOffice.count to self.

ring_wedge(cx, cy, rx_out, ry_out, rx_in, ry_in, th0, th1)
Parameters:
scale(scale_x, scale_y)
Parameters:
  • scale_x (float) – horizontal scale.

  • scale_y (float) – vertical scale.

Returns:

the scaled path.

Return type:

GOffice.Path

Builds a scaled.

set_options(options)
Parameters:

options (GOffice.PathOptions) – GOffice.PathOptions

Change the rendering options for self using GOffice.PathOptions.SNAP_COORDINATES GOffice.PathOptions.SNAP_WIDTH GOffice.PathOptions.SHARP

to_cairo(direction, cr)
Parameters:

Renders the path to the cairo context using its current settings.

to_svg()
Returns:

the svg:d string.

Return type:

str

Builds an svg path from self.