Gnome User Interface Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
#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); |
typedef struct { int num_points; double *coords; int ref_count; } GnomeCanvasPoints; |
GnomeCanvasPoints* gnome_canvas_points_new (int num_points); |
Creates a structure that should be used to pass an array of points to items.
void gnome_canvas_points_free (GnomeCanvasPoints *points); |
Decreases the reference count of the specified points structure. If it reaches zero, then the structure is freed.
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); |
Given three points forming an angle, computes the coordinates of the inside and outside points of the mitered corner formed by a line of a given width at that angle.
x1 : | X coordinate of the first point |
y1 : | Y coordinate of the first point |
x2 : | X coordinate of the second (angle) point |
y2 : | Y coordinate of the second (angle) point |
x3 : | X coordinate of the third point |
y3 : | Y coordinate of the third point |
width : | Width of the line |
mx1 : | The X coordinate of the first miter point is returned here. |
my1 : | The Y coordinate of the first miter point is returned here. |
mx2 : | The X coordinate of the second miter point is returned here. |
my2 : | The Y coordinate of the second miter point is returned here. |
Returns : | FALSE if the angle is less than 11 degrees (this is the same threshold as X uses. If this occurs, the return points are not modified. Otherwise, returns TRUE. |
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); |
Computes the butt points of a line segment.
x1 : | X coordinate of first point in the line |
y1 : | Y cooordinate of first point in the line |
x2 : | X coordinate of second point (endpoint) of the line |
y2 : | Y coordinate of second point (endpoint) of the line |
width : | Width of the line |
project : | Whether the butt points should project out by width/2 distance |
bx1 : | X coordinate of first butt point is returned here |
by1 : | Y coordinate of first butt point is returned here |
bx2 : | X coordinate of second butt point is returned here |
by2 : | Y coordinate of second butt point is returned here |
double gnome_canvas_polygon_to_point (double *poly, int num_points, double x, double y); |
Computes the distance between a point and a polygon.
poly : | Vertices of the polygon. X coordinates are in the even indices, and Y coordinates are in the odd indices |
num_points : | Number of points in the polygon |
x : | X coordinate of the point |
y : | Y coordinate of the point |
Returns : | The distance from the point to the polygon, or zero if the point is inside the polygon. |
void gnome_canvas_render_svp (GnomeCanvasBuf *buf, ArtSVP *svp, guint32 rgba); |
Render the svp over the buf.
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.
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.
void gnome_canvas_item_reset_bounds (GnomeCanvasItem *item); |
Resets the bounding box of a canvas item to an empty rectangle.
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.
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.
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.
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.
GdkImlibImage* gnome_canvas_load_alpha (char *file); |
This routine loads a PNG file with full alpha transparency and
file : | filename to load |
Returns : | 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. |