1 #ifndef __SP_GUIDELINE_H__
2 #define __SP_GUIDELINE_H__
4 /*
5 * The visual representation of SPGuide.
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 * Johan Engelen
10 *
11 * Copyright (C) 2000-2002 Lauris Kaplinski
12 * Copyright (C) 2007 Johan Engelen
13 *
14 * Released under GNU GPL, read the file 'COPYING' for more information
15 */
17 #include "sp-canvas.h"
18 #include <2geom/point.h>
20 #define SP_TYPE_GUIDELINE (sp_guideline_get_type())
21 #define SP_GUIDELINE(o) (GTK_CHECK_CAST((o), SP_TYPE_GUIDELINE, SPGuideLine))
22 #define SP_IS_GUIDELINE(o) (GTK_CHECK_TYPE((o), SP_TYPE_GUIDELINE))
24 class SPCtrlPoint;
26 struct SPGuideLine {
27 SPCanvasItem item;
28 SPCtrlPoint *origin; // unlike 'item', this is only held locally
30 guint32 rgba;
32 Geom::Point normal_to_line;
33 Geom::Point point_on_line;
34 double angle;
36 unsigned int sensitive : 1;
38 inline bool is_horizontal() const { return (normal_to_line[Geom::X] == 0.); };
39 inline bool is_vertical() const { return (normal_to_line[Geom::Y] == 0.); };
40 };
42 struct SPGuideLineClass {
43 SPCanvasItemClass parent_class;
44 };
46 GType sp_guideline_get_type();
48 SPCanvasItem *sp_guideline_new(SPCanvasGroup *parent, Geom::Point point_on_line, Geom::Point normal);
50 void sp_guideline_set_position(SPGuideLine *gl, Geom::Point point_on_line);
51 void sp_guideline_set_normal(SPGuideLine *gl, Geom::Point normal_to_line);
52 void sp_guideline_set_color(SPGuideLine *gl, unsigned int rgba);
53 void sp_guideline_set_sensitive(SPGuideLine *gl, int sensitive);
54 void sp_guideline_delete(SPGuideLine *gl);
56 #endif
58 /*
59 Local Variables:
60 mode:c++
61 c-file-style:"stroustrup"
62 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
63 indent-tabs-mode:nil
64 fill-column:99
65 End:
66 */
67 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :