Code

5479284365f3d03131b2e3ad1ed84d249f62d573
[inkscape.git] / src / sp-shape.h
1 #ifndef __SP_SHAPE_H__
2 #define __SP_SHAPE_H__
4 /*
5  * Base class for shapes, including <path> element
6  *
7  * Author:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *
10  * Copyright (C) 1999-2002 Lauris Kaplinski
11  * Copyright (C) 2000-2001 Ximian, Inc.
12  *
13  * Released under GNU GPL, read the file 'COPYING' for more information
14  */
16 #include "display/display-forward.h"
17 #include "sp-item.h"
18 #include "sp-marker-loc.h"
22 #define SP_TYPE_SHAPE (sp_shape_get_type ())
23 #define SP_SHAPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_SHAPE, SPShape))
24 #define SP_SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_SHAPE, SPShapeClass))
25 #define SP_IS_SHAPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_SHAPE))
26 #define SP_IS_SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_SHAPE))
28 #define SP_SHAPE_WRITE_PATH (1 << 2)
30 struct SPShape : public SPItem {
31         SPCurve *curve;
33       SPObject *marker[SP_MARKER_LOC_QTY];
34       gulong release_connect [SP_MARKER_LOC_QTY];
35       gulong modified_connect [SP_MARKER_LOC_QTY];
36 };
38 struct SPShapeClass {
39         SPItemClass item_class;
41         /* Build bpath from extra shape attributes */
42         void (* set_shape) (SPShape *shape);
43 };
45 GType sp_shape_get_type (void);
47 void sp_shape_set_shape (SPShape *shape);
49 /* Return duplicate of curve or NULL */
50 SPCurve *sp_shape_get_curve (SPShape *shape);
52 void sp_shape_set_curve (SPShape *shape, SPCurve *curve, unsigned int owner);
54 /* NOT FOR GENERAL PUBLIC UNTIL SORTED OUT (Lauris) */
55 void sp_shape_set_curve_insync (SPShape *shape, SPCurve *curve, unsigned int owner);
57 /* PROTECTED */
58 void sp_shape_set_marker (SPObject *object, unsigned int key, const gchar *value);
62 #endif