Code

moving trunk for module inkscape
[inkscape.git] / src / sp-guide.h
1 #ifndef SP_GUIDE_H
2 #define SP_GUIDE_H
4 /*
5  * SPGuide
6  *
7  * A guideline
8  *
9  * Copyright (C) Lauris Kaplinski 2000
10  *
11  */
13 #include <vector>
15 #include "display/display-forward.h"
16 #include "libnr/nr-point.h"
17 #include "sp-object.h"
18 #include "sp-guide-attachment.h"
20 #define SP_TYPE_GUIDE            (sp_guide_get_type())
21 #define SP_GUIDE(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), SP_TYPE_GUIDE, SPGuide))
22 #define SP_GUIDE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SP_TYPE_GUIDE, SPGuideClass))
23 #define SP_IS_GUIDE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), SP_TYPE_GUIDE))
24 #define SP_IS_GUIDE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SP_TYPE_GUIDE))
26 /* Represents the constraint on p that dot(g.direction, p) == g.position. */
27 struct SPGuide : public SPObject {
28     NR::Point normal;
29     gdouble position;
30     guint32 color;
31     guint32 hicolor;
32     GSList *views;
33     std::vector<SPGuideAttachment> attached_items;
34 };
36 struct SPGuideClass {
37         SPObjectClass parent_class;
38 };
40 GType sp_guide_get_type();
42 void sp_guide_show(SPGuide *guide, SPCanvasGroup *group, GCallback handler);
43 void sp_guide_hide(SPGuide *guide, SPCanvas *canvas);
44 void sp_guide_sensitize(SPGuide *guide, SPCanvas *canvas, gboolean sensitive);
46 double sp_guide_position_from_pt(SPGuide const *guide, NR::Point const &pt);
47 void sp_guide_moveto(SPGuide const &guide, gdouble const position, bool const commit);
48 void sp_guide_remove(SPGuide *guide);
50 char *sp_guide_description(SPGuide const *guide);
53 #endif /* !SP_GUIDE_H */
55 /*
56   Local Variables:
57   mode:c++
58   c-file-style:"stroustrup"
59   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
60   indent-tabs-mode:nil
61   fill-column:99
62   End:
63 */
64 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :