gnome-canvas-util

Name

gnome-canvas-util — one line description goes here.

Synopsis


#include <gnome.h>


struct      GnomeCanvasPoints
GnomeCanvasPoints* gnome_canvas_points_new  (int num_points);
void        gnome_canvas_points_free        (GnomeCanvasPoints *points);
int         gnome_canvas_get_miter_points   (double x1,
                                             double y1,
                                             double x2,
                                             double y2,
                                             double x3,
                                             double y3,
                                             double width,
                                             double *mx1,
                                             double *my1,
                                             double *mx2,
                                             double *my2);
void        gnome_canvas_get_butt_points    (double x1,
                                             double y1,
                                             double x2,
                                             double y2,
                                             double width,
                                             int project,
                                             double *bx1,
                                             double *by1,
                                             double *bx2,
                                             double *by2);
double      gnome_canvas_polygon_to_point   (double *poly,
                                             int num_points,
                                             double x,
                                             double y);
void        gnome_canvas_render_svp         (GnomeCanvasBuf *buf,
                                             ArtSVP *svp,
                                             guint32 rgba);
void        gnome_canvas_update_svp         (GnomeCanvas *canvas,
                                             ArtSVP **p_svp,
                                             ArtSVP *new_svp);
void        gnome_canvas_update_svp_clip    (GnomeCanvas *canvas,
                                             ArtSVP **p_svp,
                                             ArtSVP *new_svp,
                                             ArtSVP *clip_svp);
void        gnome_canvas_item_reset_bounds  (GnomeCanvasItem *item);
void        gnome_canvas_item_update_svp    (GnomeCanvasItem *item,
                                             ArtSVP **p_svp,
                                             ArtSVP *new_svp);
void        gnome_canvas_item_update_svp_clip
                                            (GnomeCanvasItem *item,
                                             ArtSVP **p_svp,
                                             ArtSVP *new_svp,
                                             ArtSVP *clip_svp);
void        gnome_canvas_item_request_redraw_svp
                                            (GnomeCanvasItem *item,
                                             const ArtSVP *svp);
void        gnome_canvas_update_bbox        (GnomeCanvasItem *item,
                                             int x1,
                                             int y1,
                                             int x2,
                                             int y2);
void        gnome_canvas_buf_ensure_buf     (GnomeCanvasBuf *buf);
GdkImlibImage* gnome_canvas_load_alpha      (char *file);
void        gnome_canvas_destroy_image      (GdkImlibImage *image);

Description

Details


GnomeCanvasPoints

typedef struct {
	int num_points;
	double *coords;
} GnomeCanvasPoints;


gnome_canvas_points_new()

GnomeCanvasPoints* gnome_canvas_points_new  (int num_points);

num_points : Returns


gnome_canvas_points_free()

void        gnome_canvas_points_free        (GnomeCanvasPoints *points);

points : 


gnome_canvas_get_miter_points()

int         gnome_canvas_get_miter_points   (double x1,
                                             double y1,
                                             double x2,
                                             double y2,
                                             double x3,
                                             double y3,
                                             double width,
                                             double *mx1,
                                             double *my1,
                                             double *mx2,
                                             double *my2);

x1 : y1 : x2 : y2 : x3 : y3 : width : mx1 : my1 : mx2 : my2 : Returns


gnome_canvas_get_butt_points()

void        gnome_canvas_get_butt_points    (double x1,
                                             double y1,
                                             double x2,
                                             double y2,
                                             double width,
                                             int project,
                                             double *bx1,
                                             double *by1,
                                             double *bx2,
                                             double *by2);

x1 : y1 : x2 : y2 : width : project : bx1 : by1 : bx2 : by2 : 


gnome_canvas_polygon_to_point()

double      gnome_canvas_polygon_to_point   (double *poly,
                                             int num_points,
                                             double x,
                                             double y);

poly : num_points : x : y : Returns


gnome_canvas_render_svp()

void        gnome_canvas_render_svp         (GnomeCanvasBuf *buf,
                                             ArtSVP *svp,
                                             guint32 rgba);

Render the svp over the buf.

buf : the canvas buffer to render oversvp : the vector path to renderrgba : the rgba color to render


gnome_canvas_update_svp()

void        gnome_canvas_update_svp         (GnomeCanvas *canvas,
                                             ArtSVP **p_svp,
                                             ArtSVP *new_svp);

Sets the svp to the new value, requesting repaint on what's changed. This function takes responsibility for freeing new_svp.

canvas : the canvas containing the svp that needs updating.p_svp : a pointer to the existing svpnew_svp : the new svp


gnome_canvas_update_svp_clip()

void        gnome_canvas_update_svp_clip    (GnomeCanvas *canvas,
                                             ArtSVP **p_svp,
                                             ArtSVP *new_svp,
                                             ArtSVP *clip_svp);

Sets the svp to the new value, clipping if necessary, and requesting repaint on what's changed. This function takes responsibility for freeing new_svp.

canvas : the canvas containing the svp that needs updating.p_svp : a pointer to the existing svpnew_svp : the new svpclip_svp : a clip path, if non-null


gnome_canvas_item_reset_bounds()

void        gnome_canvas_item_reset_bounds  (GnomeCanvasItem *item);

Sets the svp to the new value, requesting repaint on what's changed. This function takes responsibility for freeing new_svp. This routine also adds the svp's bbox to the item's.

item : the canvas item containing the svp that needs updating.


gnome_canvas_item_update_svp()

void        gnome_canvas_item_update_svp    (GnomeCanvasItem *item,
                                             ArtSVP **p_svp,
                                             ArtSVP *new_svp);

Sets the svp to the new value, requesting repaint on what's changed. This function takes responsibility for freeing new_svp. This routine also adds the svp's bbox to the item's.

item : the canvas item containing the svp that needs updating.p_svp : a pointer to the existing svpnew_svp : the new svp


gnome_canvas_item_update_svp_clip()

void        gnome_canvas_item_update_svp_clip
                                            (GnomeCanvasItem *item,
                                             ArtSVP **p_svp,
                                             ArtSVP *new_svp,
                                             ArtSVP *clip_svp);

Sets the svp to the new value, clipping if necessary, and requesting repaint on what's changed. This function takes responsibility for freeing new_svp.

item : the canvas item containing the svp that needs updating.p_svp : a pointer to the existing svpnew_svp : the new svpclip_svp : a clip path, if non-null


gnome_canvas_item_request_redraw_svp()

void        gnome_canvas_item_request_redraw_svp
                                            (GnomeCanvasItem *item,
                                             const ArtSVP *svp);

Request redraw of the svp if in aa mode, or the entire item in in xlib mode.

item : the item containing the svpsvp : the svp that needs to be redrawn


gnome_canvas_update_bbox()

void        gnome_canvas_update_bbox        (GnomeCanvasItem *item,
                                             int x1,
                                             int y1,
                                             int x2,
                                             int y2);

Sets the bbox to the new value, requesting full repaint.

item : x1 : y1 : x2 : y2 : 


gnome_canvas_buf_ensure_buf()

void        gnome_canvas_buf_ensure_buf     (GnomeCanvasBuf *buf);

buf : 


gnome_canvas_load_alpha()

GdkImlibImage* gnome_canvas_load_alpha      (char *file);

This routine loads a PNG file with full alpha transparency and

file : filename to loadReturns :a (GdkImlibImage *). Note that images created by this routine are not intended to be passed to GdkImlib, we just use this to remain compatible with the GnomeCanvasImage Canvas item. Use this with GdkImlib at your own risk. To release images loaded by gnome_canvas_load_alpha, use gnome_canvas_destroy_image preferably although it works with imlib now, in the future this might not be the case.


gnome_canvas_destroy_image()

void        gnome_canvas_destroy_image      (GdkImlibImage *image);

Do not pass a regular GdkImlibImage to this routine, only pass GdkImlibImage pointer that were created by gnome_canvas_load_alpha

image : A GdkImlibImage allocated by gnome_canvas_load_alpha