Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / src / sp-line.h
1 #ifndef SEEN_SP_LINE_H
2 #define SEEN_SP_LINE_H
4 /*
5  * SVG <line> implementation
6  *
7  * Authors:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *   Abhishek Sharma
10  *   Jon A. Cruz <jon@joncruz.org>
11  *
12  * Copyright (C) 1999-2002 Lauris Kaplinski
13  *
14  * Released under GNU GPL, read the file 'COPYING' for more information
15  */
17 #include "svg/svg-length.h"
18 #include "sp-shape.h"
22 #define SP_TYPE_LINE            (SPLine::sp_line_get_type())
23 #define SP_LINE(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), SP_TYPE_LINE, SPLine))
24 #define SP_LINE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SP_TYPE_LINE, SPLineClass))
25 #define SP_IS_LINE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), SP_TYPE_LINE))
26 #define SP_IS_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SP_TYPE_LINE))
28 class SPLine;
29 class SPLineClass;
31 class SPLine : public SPShape {
32 public:
33     SVGLength x1;
34     SVGLength y1;
35     SVGLength x2;
36     SVGLength y2;
37     static GType sp_line_get_type(void);
39 private:
40     static void init(SPLine *line);
42     static void build(SPObject * object, SPDocument * document, Inkscape::XML::Node * repr);
43     static void set(SPObject *object, unsigned int key, const gchar *value);
44     static Inkscape::XML::Node *write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
46     static gchar *getDescription(SPItem * item);
47     static Geom::Matrix setTransform(SPItem *item, Geom::Matrix const &xform);
49     static void update(SPObject *object, SPCtx *ctx, guint flags);
50     static void setShape(SPShape *shape);
51     static void convertToGuides(SPItem *item);
53     friend class SPLineClass;
54 };
56 class SPLineClass {
57 public:
58     SPShapeClass parent_class;
60 private:
61     static SPShapeClass *static_parent_class;
62     static void sp_line_class_init(SPLineClass *klass);
63         
64     friend class SPLine;
65 };
68 #endif // SEEN_SP_LINE_H
69 /*
70   Local Variables:
71   mode:c++
72   c-file-style:"stroustrup"
73   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
74   indent-tabs-mode:nil
75   fill-column:99
76   End:
77 */
78 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :