2
* GooCanvas. Copyright (C) 2005 Damon Chaplin.
3
* Released under the GNU LGPL license. See COPYING for details.
5
* goocanvaspolyline.h - polyline item, with optional arrows.
7
#ifndef __GOO_CANVAS_POLYLINE_H__
8
#define __GOO_CANVAS_POLYLINE_H__
11
#include "goocanvasitemsimple.h"
18
* @coords: the coordinates of the points, in pairs.
19
* @num_points: the number of points.
20
* @ref_count: the reference count of the struct.
22
* #GooCairoPoints represents an array of points.
30
#define GOO_TYPE_CANVAS_POINTS goo_canvas_points_get_type()
31
GType goo_canvas_points_get_type (void);
32
GooCanvasPoints* goo_canvas_points_new (int num_points);
33
GooCanvasPoints* goo_canvas_points_ref (GooCanvasPoints *points);
34
void goo_canvas_points_unref (GooCanvasPoints *points);
37
#define GOO_TYPE_CANVAS_POLYLINE (goo_canvas_polyline_get_type ())
38
#define GOO_CANVAS_POLYLINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolyline))
39
#define GOO_CANVAS_POLYLINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolylineClass))
40
#define GOO_IS_CANVAS_POLYLINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_POLYLINE))
41
#define GOO_IS_CANVAS_POLYLINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_POLYLINE))
42
#define GOO_CANVAS_POLYLINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolylineClass))
44
#define NUM_ARROW_POINTS 5 /* number of points in an arrowhead */
46
typedef struct _GooCanvasPolylineArrowData GooCanvasPolylineArrowData;
47
struct _GooCanvasPolylineArrowData
49
/* These are specified in multiples of the line width, e.g. if arrow_width
50
is 2 the width of the arrow will be twice the width of the line. */
51
gdouble arrow_width, arrow_length, arrow_tip_length;
53
gdouble line_start[2], line_end[2];
54
gdouble start_arrow_coords[NUM_ARROW_POINTS * 2];
55
gdouble end_arrow_coords[NUM_ARROW_POINTS * 2];
59
typedef struct _GooCanvasPolyline GooCanvasPolyline;
60
typedef struct _GooCanvasPolylineClass GooCanvasPolylineClass;
65
* The #GooCanvasPolyline-struct struct contains private data only.
67
struct _GooCanvasPolyline
69
GooCanvasItemSimple parent;
73
GooCanvasPolylineArrowData *arrow_data;
75
guint num_points : 16;
77
guint start_arrow : 1;
79
guint reconfigure_arrows : 1;
82
struct _GooCanvasPolylineClass
84
GooCanvasItemSimpleClass parent_class;
88
GType goo_canvas_polyline_get_type (void) G_GNUC_CONST;
89
GooCanvasItem* goo_canvas_polyline_new (GooCanvasItem *parent,
94
GooCanvasItem* goo_canvas_polyline_new_line (GooCanvasItem *parent,
99
const gchar *first_property,
105
#endif /* __GOO_CANVAS_POLYLINE_H__ */