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.
24
typedef struct _GooCanvasPoints GooCanvasPoints;
25
struct _GooCanvasPoints
32
#define GOO_TYPE_CANVAS_POINTS goo_canvas_points_get_type()
33
GType goo_canvas_points_get_type (void);
34
GooCanvasPoints* goo_canvas_points_new (int num_points);
35
GooCanvasPoints* goo_canvas_points_ref (GooCanvasPoints *points);
36
void goo_canvas_points_unref (GooCanvasPoints *points);
39
#define NUM_ARROW_POINTS 5 /* number of points in an arrowhead */
41
typedef struct _GooCanvasPolylineArrowData GooCanvasPolylineArrowData;
42
struct _GooCanvasPolylineArrowData
44
/* These are specified in multiples of the line width, e.g. if arrow_width
45
is 2 the width of the arrow will be twice the width of the line. */
46
gdouble arrow_width, arrow_length, arrow_tip_length;
48
gdouble line_start[2], line_end[2];
49
gdouble start_arrow_coords[NUM_ARROW_POINTS * 2];
50
gdouble end_arrow_coords[NUM_ARROW_POINTS * 2];
54
/* This is the data used by both model and view classes. */
55
typedef struct _GooCanvasPolylineData GooCanvasPolylineData;
56
struct _GooCanvasPolylineData
60
GooCanvasPolylineArrowData *arrow_data;
62
guint num_points : 16;
64
guint start_arrow : 1;
66
guint reconfigure_arrows : 1;
70
#define GOO_TYPE_CANVAS_POLYLINE (goo_canvas_polyline_get_type ())
71
#define GOO_CANVAS_POLYLINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolyline))
72
#define GOO_CANVAS_POLYLINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolylineClass))
73
#define GOO_IS_CANVAS_POLYLINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_POLYLINE))
74
#define GOO_IS_CANVAS_POLYLINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_POLYLINE))
75
#define GOO_CANVAS_POLYLINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolylineClass))
78
typedef struct _GooCanvasPolyline GooCanvasPolyline;
79
typedef struct _GooCanvasPolylineClass GooCanvasPolylineClass;
84
* The #GooCanvasPolyline-struct struct contains private data only.
86
struct _GooCanvasPolyline
88
GooCanvasItemSimple parent;
90
GooCanvasPolylineData *polyline_data;
93
struct _GooCanvasPolylineClass
95
GooCanvasItemSimpleClass parent_class;
99
/* Padding for future expansion */
100
void (*_goo_canvas_reserved1) (void);
101
void (*_goo_canvas_reserved2) (void);
102
void (*_goo_canvas_reserved3) (void);
103
void (*_goo_canvas_reserved4) (void);
107
GType goo_canvas_polyline_get_type (void) G_GNUC_CONST;
109
GooCanvasItem* goo_canvas_polyline_new (GooCanvasItem *parent,
114
GooCanvasItem* goo_canvas_polyline_new_line (GooCanvasItem *parent,
123
#define GOO_TYPE_CANVAS_POLYLINE_MODEL (goo_canvas_polyline_model_get_type ())
124
#define GOO_CANVAS_POLYLINE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModel))
125
#define GOO_CANVAS_POLYLINE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModelClass))
126
#define GOO_IS_CANVAS_POLYLINE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL))
127
#define GOO_IS_CANVAS_POLYLINE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_POLYLINE_MODEL))
128
#define GOO_CANVAS_POLYLINE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModelClass))
131
typedef struct _GooCanvasPolylineModel GooCanvasPolylineModel;
132
typedef struct _GooCanvasPolylineModelClass GooCanvasPolylineModelClass;
135
* GooCanvasPolylineModel
137
* The #GooCanvasPolylineModel-struct struct contains private data only.
139
struct _GooCanvasPolylineModel
141
GooCanvasItemModelSimple parent_object;
143
GooCanvasPolylineData polyline_data;
146
struct _GooCanvasPolylineModelClass
148
GooCanvasItemModelSimpleClass parent_class;
152
/* Padding for future expansion */
153
void (*_goo_canvas_reserved1) (void);
154
void (*_goo_canvas_reserved2) (void);
155
void (*_goo_canvas_reserved3) (void);
156
void (*_goo_canvas_reserved4) (void);
160
GType goo_canvas_polyline_model_get_type (void) G_GNUC_CONST;
162
GooCanvasItemModel* goo_canvas_polyline_model_new (GooCanvasItemModel *parent,
167
GooCanvasItemModel* goo_canvas_polyline_model_new_line (GooCanvasItemModel *parent,
176
#endif /* __GOO_CANVAS_POLYLINE_H__ */