Code

Split SPCanvasItem and SPCanvasGroup to individual .h files. Removed forward header.
[inkscape.git] / src / display / canvas-bpath.h
1 #ifndef SEEN_SP_CANVAS_BPATH_H
2 #define SEEN_SP_CANVAS_BPATH_H
4 /*
5  * Simple bezier bpath CanvasItem for inkscape
6  *
7  * Authors:
8  *   Lauris Kaplinski <lauris@ximian.com>
9  *   Jon A. Cruz <jon@joncruz.org>
10  *
11  * Copyright (C) 2001 Lauris Kaplinski and Ximian, Inc.
12  * Copyright (C) 2010 authors
13  *
14  * Released under GNU GPL
15  *
16  */
18 #include <glib/gtypes.h>
20 #include "sp-canvas-item.h"
22 struct SPCanvasBPath;
23 struct SPCanvasBPathClass;
24 struct SPCanvasGroup;
25 struct SPCurve;
27 #define SP_TYPE_CANVAS_BPATH (sp_canvas_bpath_get_type ())
28 #define SP_CANVAS_BPATH(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CANVAS_BPATH, SPCanvasBPath))
29 #define SP_CANVAS_BPATH_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_CANVAS_BPATH, SPCanvasBPathClass))
30 #define SP_IS_CANVAS_BPATH(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CANVAS_BPATH))
31 #define SP_IS_CANVAS_BPATH_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_CANVAS_BPATH))
33 #define bpath_liv
35 class Shape;
37 /* stroke-linejoin */
39 typedef enum {
40     SP_STROKE_LINEJOIN_MITER,
41     SP_STROKE_LINEJOIN_ROUND,
42     SP_STROKE_LINEJOIN_BEVEL
43 } SPStrokeJoinType;
45 /* stroke-linecap */
47 typedef enum {
48     SP_STROKE_LINECAP_BUTT,
49     SP_STROKE_LINECAP_ROUND,
50     SP_STROKE_LINECAP_SQUARE
51 } SPStrokeCapType;
54 /* fill-rule */
55 /* clip-rule */
57 typedef enum {
58     SP_WIND_RULE_NONZERO,
59     SP_WIND_RULE_INTERSECT,
60     SP_WIND_RULE_EVENODD,
61     SP_WIND_RULE_POSITIVE
62 } SPWindRule;
65 struct SPCanvasBPath {
66     SPCanvasItem item;
68     /* Line def */
69     SPCurve *curve;
70     Geom::Matrix affine;
72     /* Fill attributes */
73     guint32 fill_rgba;
74     SPWindRule fill_rule;
76     /* Line attributes */
77     guint32 stroke_rgba;
78     gdouble stroke_width;
79     gdouble dashes[2];
80     SPStrokeJoinType stroke_linejoin;
81     SPStrokeCapType stroke_linecap;
82     gdouble stroke_miterlimit;
84     /* State */
85     Shape  *fill_shp;
86     Shape  *stroke_shp;
87 };
89 struct SPCanvasBPathClass {
90     SPCanvasItemClass parent_class;
91 };
93 GtkType sp_canvas_bpath_get_type (void);
95 SPCanvasItem *sp_canvas_bpath_new (SPCanvasGroup *parent, SPCurve *curve);
97 void sp_canvas_bpath_set_bpath (SPCanvasBPath *cbp, SPCurve *curve);
98 void sp_canvas_bpath_set_fill (SPCanvasBPath *cbp, guint32 rgba, SPWindRule rule);
99 void sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap, double dash=0, double gap=0);
101 #endif
103 /*
104   Local Variables:
105   mode:c++
106   c-file-style:"stroustrup"
107   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
108   indent-tabs-mode:nil
109   fill-column:99
110   End:
111 */
112 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :