1 #ifndef __SP_CANVAS_BPATH_H__
2 #define __SP_CANVAS_BPATH_H__
4 /*
5 * Simple bezier bpath CanvasItem for inkscape
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@ximian.com>
9 *
10 * Copyright (C) 2001 Lauris Kaplinski and Ximian, Inc.
11 *
12 * Released under GNU GPL
13 *
14 */
16 #include <glib/gtypes.h>
18 #include <display/sp-canvas.h>
20 struct SPCanvasBPath;
21 struct SPCanvasBPathClass;
22 struct SPCurve;
24 #define SP_TYPE_CANVAS_BPATH (sp_canvas_bpath_get_type ())
25 #define SP_CANVAS_BPATH(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CANVAS_BPATH, SPCanvasBPath))
26 #define SP_CANVAS_BPATH_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_CANVAS_BPATH, SPCanvasBPathClass))
27 #define SP_IS_CANVAS_BPATH(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CANVAS_BPATH))
28 #define SP_IS_CANVAS_BPATH_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_CANVAS_BPATH))
30 #define bpath_liv
32 class Shape;
34 /* stroke-linejoin */
36 typedef enum {
37 SP_STROKE_LINEJOIN_MITER,
38 SP_STROKE_LINEJOIN_ROUND,
39 SP_STROKE_LINEJOIN_BEVEL
40 } SPStrokeJoinType;
42 /* stroke-linecap */
44 typedef enum {
45 SP_STROKE_LINECAP_BUTT,
46 SP_STROKE_LINECAP_ROUND,
47 SP_STROKE_LINECAP_SQUARE
48 } SPStrokeCapType;
51 /* fill-rule */
52 /* clip-rule */
54 typedef enum {
55 SP_WIND_RULE_NONZERO,
56 SP_WIND_RULE_INTERSECT,
57 SP_WIND_RULE_EVENODD,
58 SP_WIND_RULE_POSITIVE
59 } SPWindRule;
62 struct SPCanvasBPath {
63 SPCanvasItem item;
65 /* Line def */
66 SPCurve *curve;
67 NR::Matrix affine;
69 /* Fill attributes */
70 guint32 fill_rgba;
71 SPWindRule fill_rule;
73 /* Line attributes */
74 guint32 stroke_rgba;
75 gdouble stroke_width;
76 SPStrokeJoinType stroke_linejoin;
77 SPStrokeCapType stroke_linecap;
78 gdouble stroke_miterlimit;
80 /* State */
81 Shape *fill_shp;
82 Shape *stroke_shp;
83 };
85 struct SPCanvasBPathClass {
86 SPCanvasItemClass parent_class;
87 };
89 GtkType sp_canvas_bpath_get_type (void);
91 SPCanvasItem *sp_canvas_bpath_new (SPCanvasGroup *parent, SPCurve *curve);
93 void sp_canvas_bpath_set_bpath (SPCanvasBPath *cbp, SPCurve *curve);
94 void sp_canvas_bpath_set_fill (SPCanvasBPath *cbp, guint32 rgba, SPWindRule rule);
95 void sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap);
99 #endif