GOPath

## GOPath GOPath |

## Synopsis

                        GOPath;
    void                (*GOPathClosePathFunc)              (void *closure);
    void                (*GOPathCurveToFunc)                (void *closure,
                                                             GOPathPoint const *point0,
                                                             GOPathPoint const *point1,
                                                             GOPathPoint const *point2);
    void                (*GOPathLineToFunc)                 (void *closure,
                                                             GOPathPoint const *point);
    void                (*GOPathMoveToFunc)                 (void *closure,
                                                             GOPathPoint const *point);
    enum                GOPathDirection;
    enum                GOPathOptions;
                        GOPathPoint;
    GOPath *            go_path_append                      (GOPath *path1,
                                                             GOPath const *path2);
    void                go_path_arc                         (GOPath *path,
                                                             double cx,
                                                             double cy,
                                                             double rx,
                                                             double ry,
                                                             double th0,
                                                             double th1);
    void                go_path_arc_to                      (GOPath *path,
                                                             double cx,
                                                             double cy,
                                                             double rx,
                                                             double ry,
                                                             double th0,
                                                             double th1);
    void                go_path_clear                       (GOPath *path);
    void                go_path_close                       (GOPath *path);
    GOPath *            go_path_copy                        (GOPath const *path);
    GOPath *            go_path_copy_restricted             (GOPath const *path,
                                                             gssize start,
                                                             gssize end);
    void                go_path_curve_to                    (GOPath *path,
                                                             double x0,
                                                             double y0,
                                                             double x1,
                                                             double y1,
                                                             double x2,
                                                             double y2);
    void                go_path_free                        (GOPath *path);
    GOPathOptions       go_path_get_options                 (GOPath const *path);
    void                go_path_interpret                   (GOPath const *path,
                                                             GOPathDirection direction,
                                                             GOPathMoveToFunc move_to,
                                                             GOPathLineToFunc line_to,
                                                             GOPathCurveToFunc curve_to,
                                                             GOPathClosePathFunc close_path,
                                                             void *closure);
    void                go_path_interpret_full              (GOPath const *path,
                                                             gssize start,
                                                             gssize end,
                                                             GOPathDirection direction,
                                                             GOPathMoveToFunc move_to,
                                                             GOPathLineToFunc line_to,
                                                             GOPathCurveToFunc curve_to,
                                                             GOPathClosePathFunc close_path,
                                                             void *closure);
    void                go_path_line_to                     (GOPath *path,
                                                             double x,
                                                             double y);
    void                go_path_move_to                     (GOPath *path,
                                                             double x,
                                                             double y);
    GOPath *            go_path_new                         (void);
    GOPath *            go_path_new_from_odf_enhanced_path  (char const *src,
                                                             GHashTable const *variables);
    GOPath *            go_path_new_from_svg                (char const *src);
    void                go_path_pie_wedge                   (GOPath *path,
                                                             double cx,
                                                             double cy,
                                                             double rx,
                                                             double ry,
                                                             double th0,
                                                             double th1);
    void                go_path_rectangle                   (GOPath *path,
                                                             double x,
                                                             double y,
                                                             double width,
                                                             double height);
    GOPath *            go_path_ref                         (GOPath *path);
    void                go_path_ring_wedge                  (GOPath *path,
                                                             double cx,
                                                             double cy,
                                                             double rx_out,
                                                             double ry_out,
                                                             double rx_in,
                                                             double ry_in,
                                                             double th0,
                                                             double th1);
    void                go_path_set_options                 (GOPath *path,
                                                             GOPathOptions options);
    void                go_path_to_cairo                    (GOPath const *path,
                                                             GOPathDirection direction,
                                                             cairo_t *cr);
    char *              go_path_to_svg                      (GOPath *path);
    GOPath *            go_path_scale                       (GOPath *path,
                                                             double scale_x,
                                                             double scale_y);

## Object Hierarchy

      GBoxed
       +----GOPath

## Description

## Details

### GOPath

    typedef struct _GOPath GOPath;

### GOPathClosePathFunc ()

    void                (*GOPathClosePathFunc)              (void *closure);

### GOPathCurveToFunc ()

    void                (*GOPathCurveToFunc)                (void *closure,
                                                             GOPathPoint const *point0,
                                                             GOPathPoint const *point1,
                                                             GOPathPoint const *point2);

### GOPathLineToFunc ()

    void                (*GOPathLineToFunc)                 (void *closure,
                                                             GOPathPoint const *point);

### GOPathMoveToFunc ()

    void                (*GOPathMoveToFunc)                 (void *closure,
                                                             GOPathPoint const *point);

### enum GOPathDirection

    typedef enum {
    	GO_PATH_DIRECTION_FORWARD,
    	GO_PATH_DIRECTION_BACKWARD
    } GOPathDirection;

`GO_PATH_DIRECTION_FORWARD` | go through the pass from start to end.
`GO_PATH_DIRECTION_BACKWARD` | go through the pass from end to start.

### enum GOPathOptions

    typedef enum {
    	GO_PATH_OPTIONS_SNAP_COORDINATES 	= 1<<0,
    	GO_PATH_OPTIONS_SNAP_WIDTH		= 1<<1,
    	GO_PATH_OPTIONS_SHARP			= 3
    } GOPathOptions;

`GO_PATH_OPTIONS_SNAP_COORDINATES` | round coordinates to avoid aliasing in pixbufs.
`GO_PATH_OPTIONS_SNAP_WIDTH` | round width so that it correpond to a round pixels number.
`GO_PATH_OPTIONS_SHARP` | use raw coordinates.

### GOPathPoint

    typedef struct {
    	double x;
    	double y;
    } GOPathPoint;

double `x`; | horizontal position.
double `y`; | vertical dimension.

### go_path_append ()

    GOPath *            go_path_append                      (GOPath *path1,
                                                             GOPath const *path2);

Appends `path2` at the end of `path1`.

`path1` : | GOPath
`path2` : | GOPath
Returns : | `path1`

### go_path_arc ()

    void                go_path_arc                         (GOPath *path,
                                                             double cx,
                                                             double cy,
                                                             double rx,
                                                             double ry,
                                                             double th0,
                                                             double th1);

### go_path_arc_to ()

    void                go_path_arc_to                      (GOPath *path,
                                                             double cx,
                                                             double cy,
                                                             double rx,
                                                             double ry,
                                                             double th0,
                                                             double th1);

### go_path_clear ()

    void                go_path_clear                       (GOPath *path);

### go_path_close ()

    void                go_path_close                       (GOPath *path);

### go_path_copy ()

    GOPath *            go_path_copy                        (GOPath const *path);

`path` : | GOPath
Returns : | a new GOPath identical to `path`.

### go_path_copy_restricted ()

    GOPath *            go_path_copy_restricted             (GOPath const *path,
                                                             gssize start,
                                                             gssize end);

Copies actions between start and end will be copied inside a new GOPath.

`path` : | GOPath
`start` : | the first action to copy
`end` : | the second action to copy
Returns : | a new GOPath. If start or end is negative, it is not taken into account.

Since 0.10.5

### go_path_curve_to ()

    void                go_path_curve_to                    (GOPath *path,
                                                             double x0,
                                                             double y0,
                                                             double x1,
                                                             double y1,
                                                             double x2,
                                                             double y2);

### go_path_free ()

    void                go_path_free                        (GOPath *path);

Decrements references count and frees all memory allocated for `path` if references count reaches 0.

`path` : | a GOPath

### go_path_get_options ()

    GOPathOptions       go_path_get_options                 (GOPath const *path);

### go_path_interpret ()

    void                go_path_interpret                   (GOPath const *path,
                                                             GOPathDirection direction,
                                                             GOPathMoveToFunc move_to,
                                                             GOPathLineToFunc line_to,
                                                             GOPathCurveToFunc curve_to,
                                                             GOPathClosePathFunc close_path,
                                                             void *closure);

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_t.

`path` : | GOPath
`direction` : | GOPathDirection
`move_to` : | the callback for move to. [scope call]
`line_to` : | the callback for drawing a line. [scope call]
`curve_to` : | the callback for drawing a bezier cubic spline. [scope call]
`close_path` : | the callback for closing the path. [scope call]
`closure` : | data to pass as first argument to the callbacks.

### go_path_interpret_full ()

    void                go_path_interpret_full              (GOPath const *path,
                                                             gssize start,
                                                             gssize end,
                                                             GOPathDirection direction,
                                                             GOPathMoveToFunc move_to,
                                                             GOPathLineToFunc line_to,
                                                             GOPathCurveToFunc curve_to,
                                                             GOPathClosePathFunc close_path,
                                                             void *closure);

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.

`path` : | GOPath
`start` : | index of the first action to interpret
`end` : | index of the last action to interpret
`direction` : | GOPathDirection
`move_to` : | the callback for move to. [scope call]
`line_to` : | the callback for drawing a line. [scope call]
`curve_to` : | the callback for drawing a bezier cubic spline. [scope call]
`close_path` : | the callback for closing the path. [scope call]
`closure` : | data to pass as first argument to the callbacks.

Since 0.10.5

### go_path_line_to ()

    void                go_path_line_to                     (GOPath *path,
                                                             double x,
                                                             double y);

### go_path_move_to ()

    void                go_path_move_to                     (GOPath *path,
                                                             double x,
                                                             double y);

### go_path_new ()

    GOPath *            go_path_new                         (void);

### go_path_new_from_odf_enhanced_path ()

    GOPath *            go_path_new_from_odf_enhanced_path  (char const *src,
                                                             GHashTable const *variables);

`src` : | an ODF enhanced path.
Returns : | the newly allocated GOPath or `NULL` on error. [transfer full]

### go_path_new_from_svg ()

    GOPath *            go_path_new_from_svg                (char const *src);

`src` : | an SVG path.
Returns : | the newly allocated GOPath. [transfer full]

### go_path_pie_wedge ()

    void                go_path_pie_wedge                   (GOPath *path,
                                                             double cx,
                                                             double cy,
                                                             double rx,
                                                             double ry,
                                                             double th0,
                                                             double th1);

### go_path_rectangle ()

    void                go_path_rectangle                   (GOPath *path,
                                                             double x,
                                                             double y,
                                                             double width,
                                                             double height);

### go_path_ref ()

    GOPath *            go_path_ref                         (GOPath *path);

Increments references count to `path`.

`path` : | a GOPath
Returns : | the path with an incremented references count.

### go_path_ring_wedge ()

    void                go_path_ring_wedge                  (GOPath *path,
                                                             double cx,
                                                             double cy,
                                                             double rx_out,
                                                             double ry_out,
                                                             double rx_in,
                                                             double ry_in,
                                                             double th0,
                                                             double th1);

### go_path_set_options ()

    void                go_path_set_options                 (GOPath *path,
                                                             GOPathOptions options);

Change the rendering options for `path` using `GO_PATH_OPTIONS_SNAP_COORDINATES` `GO_PATH_OPTIONS_SNAP_WIDTH` `GO_PATH_OPTIONS_SHARP`

`path` : | a GOPath
`options` : | GOPathOptions

### go_path_to_cairo ()

    void                go_path_to_cairo                    (GOPath const *path,
                                                             GOPathDirection direction,
                                                             cairo_t *cr);

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

`path` : | GOPath
`direction` : | GOPathDirection
`cr` : | cairo_t

### go_path_to_svg ()

    char *              go_path_to_svg                      (GOPath *path);

Builds an svg path from `path`.

`path` : | a GOPath
Returns : | the svg:d string. [transfer full]

### go_path_scale ()

    GOPath *            go_path_scale                       (GOPath *path,
                                                             double scale_x,
                                                             double scale_y);

Builds a scaled.

`path` : | GOPath
`scale_x` : | horizontal scale.
`scale_y` : | vertical scale.
Returns : | the scaled path. [transfer full]