21
21
#define GOO_CANVAS_PATH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_PATH, GooCanvasPathClass))
25
* GooCanvasPathCommandType
26
* @GOO_CANVAS_PATH_MOVE_TO: move to the given point.
27
* @GOO_CANVAS_PATH_CLOSE_PATH: close the current path, drawing a line from the
28
* current position to the start of the path.
29
* @GOO_CANVAS_PATH_LINE_TO: draw a line to the given point.
30
* @GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: draw a horizontal line to the given
32
* @GOO_CANVAS_PATH_VERTICAL_LINE_TO: draw a vertical line to the given y
34
* @GOO_CANVAS_PATH_CURVE_TO: draw a bezier curve using two control
35
* points to the given point.
36
* @GOO_CANVAS_PATH_SMOOTH_CURVE_TO: draw a bezier curve using a reflection
37
* of the last control point of the last curve as the first control point,
38
* and one new control point, to the given point.
39
* @GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: draw a quadratic bezier curve using
40
* a single control point to the given point.
41
* @GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: draw a quadratic bezier curve
42
* using a reflection of the control point from the previous curve as the
43
* control point, to the given point.
44
* @GOO_CANVAS_PATH_ELLIPTICAL_ARC: draw an elliptical arc, using the given
45
* 2 radii, the x axis rotation, and the 2 flags to disambiguate the arc,
48
* GooCanvasPathCommandType specifies the type of each command in the path.
49
* See the path element in the <ulink url="http://www.w3.org/Graphics/SVG/">
50
* Scalable Vector Graphics (SVG) specification</ulink> for more details.
54
/* Simple commands like moveto and lineto: MmZzLlHhVv. */
55
GOO_CANVAS_PATH_MOVE_TO,
56
GOO_CANVAS_PATH_CLOSE_PATH,
57
GOO_CANVAS_PATH_LINE_TO,
58
GOO_CANVAS_PATH_HORIZONTAL_LINE_TO,
59
GOO_CANVAS_PATH_VERTICAL_LINE_TO,
61
/* Bezier curve commands: CcSsQqTt. */
62
GOO_CANVAS_PATH_CURVE_TO,
63
GOO_CANVAS_PATH_SMOOTH_CURVE_TO,
64
GOO_CANVAS_PATH_QUADRATIC_CURVE_TO,
65
GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO,
67
/* The elliptical arc commands: Aa. */
68
GOO_CANVAS_PATH_ELLIPTICAL_ARC
69
} GooCanvasPathCommandType;
72
typedef union _GooCanvasPathCommand GooCanvasPathCommand;
74
/* Note that the command type is always the first element in each struct, so
75
we can always use it whatever type of command it is. */
78
* GooCanvasPathCommand
80
* GooCanvasPathCommand holds the data for each command in the path.
82
* The @relative flag specifies that the coordinates for the command are
83
* relative to the current point. Otherwise they are assumed to be absolute
86
union _GooCanvasPathCommand
88
/* Simple commands like moveto and lineto: MmZzLlHhVv. */
90
guint type : 5; /* GooCanvasPathCommandType */
95
/* Bezier curve commands: CcSsQqTt. */
97
guint type : 5; /* GooCanvasPathCommandType */
99
gdouble x, y, x1, y1, x2, y2;
102
/* The elliptical arc commands: Aa. */
104
guint type : 5; /* GooCanvasPathCommandType */
106
guint large_arc_flag : 1;
107
guint sweep_flag : 1;
108
gdouble rx, ry, x_axis_rotation, x, y;
113
24
typedef struct _GooCanvasPath GooCanvasPath;
114
25
typedef struct _GooCanvasPathClass GooCanvasPathClass;
118
* @commands: an array of #GooCanvasPathCommand holding the specification of
119
* the path. Applications can modify this directly, but must call
120
* goo_canvas_item_simple_emit_changed() afterwards to notify the
121
* views that the #GooCanvasPath has changed.
123
* The #GooCanvasPath-struct contains the list of commands specifying the path.
30
* The #GooCanvasPath-struct struct contains private data only.
125
32
struct _GooCanvasPath
127
34
GooCanvasItemSimple parent;
36
/* An array of GooCanvasPathCommand. */
37
GArray *path_commands;
133
40
struct _GooCanvasPathClass
135
42
GooCanvasItemSimpleClass parent_class;
139
GType goo_canvas_path_get_type (void) G_GNUC_CONST;
140
GooCanvasItem* goo_canvas_path_new (GooCanvasItem *parent,
46
/* Padding for future expansion */
47
void (*_goo_canvas_reserved1) (void);
48
void (*_goo_canvas_reserved2) (void);
49
void (*_goo_canvas_reserved3) (void);
50
void (*_goo_canvas_reserved4) (void);
54
GType goo_canvas_path_get_type (void) G_GNUC_CONST;
56
GooCanvasItem* goo_canvas_path_new (GooCanvasItem *parent,
57
const gchar *path_data,
62
#define GOO_TYPE_CANVAS_PATH_MODEL (goo_canvas_path_model_get_type ())
63
#define GOO_CANVAS_PATH_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_PATH_MODEL, GooCanvasPathModel))
64
#define GOO_CANVAS_PATH_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_PATH_MODEL, GooCanvasPathModelClass))
65
#define GOO_IS_CANVAS_PATH_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_PATH_MODEL))
66
#define GOO_IS_CANVAS_PATH_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_PATH_MODEL))
67
#define GOO_CANVAS_PATH_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_PATH_MODEL, GooCanvasPathModelClass))
70
typedef struct _GooCanvasPathModel GooCanvasPathModel;
71
typedef struct _GooCanvasPathModelClass GooCanvasPathModelClass;
76
* The #GooCanvasPathModel-struct struct contains private data only.
78
struct _GooCanvasPathModel
80
GooCanvasItemModelSimple parent_object;
82
/* An array of GooCanvasPathCommand. */
83
GArray *path_commands;
86
struct _GooCanvasPathModelClass
88
GooCanvasItemModelSimpleClass parent_class;
92
/* Padding for future expansion */
93
void (*_goo_canvas_reserved1) (void);
94
void (*_goo_canvas_reserved2) (void);
95
void (*_goo_canvas_reserved3) (void);
96
void (*_goo_canvas_reserved4) (void);
100
GType goo_canvas_path_model_get_type (void) G_GNUC_CONST;
102
GooCanvasItemModel* goo_canvas_path_model_new (GooCanvasItemModel *parent,
103
const gchar *path_data,