Code

65ad4aa0053e54876ab8b61382d068457d12b5d2
[inkscape.git] / src / display / canvas-bpath.h
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     Geom::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     gdouble dashes[2];
77     SPStrokeJoinType stroke_linejoin;
78     SPStrokeCapType stroke_linecap;
79     gdouble stroke_miterlimit;
81     /* State */
82     Shape  *fill_shp;
83     Shape  *stroke_shp;
84 };
86 struct SPCanvasBPathClass {
87     SPCanvasItemClass parent_class;
88 };
90 GtkType sp_canvas_bpath_get_type (void);
92 SPCanvasItem *sp_canvas_bpath_new (SPCanvasGroup *parent, SPCurve *curve);
94 void sp_canvas_bpath_set_bpath (SPCanvasBPath *cbp, SPCurve *curve);
95 void sp_canvas_bpath_set_fill (SPCanvasBPath *cbp, guint32 rgba, SPWindRule rule);
96 void sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap, double dash=0, double gap=0);
98 #endif
100 /*
101   Local Variables:
102   mode:c++
103   c-file-style:"stroustrup"
104   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
105   indent-tabs-mode:nil
106   fill-column:99
107   End:
108 */
109 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :