summaryrefslogtreecommitdiffstats
path: root/src/shape-editor.h
blob: df0dbfa3ab27b52c8e8dd9bebbcccdc83c7ef438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef SEEN_SHAPE_EDITOR_H
#define SEEN_SHAPE_EDITOR_H

/*
 * Inkscape::ShapeEditor
 *
 * This is a container class which contains a knotholder for shapes.
 * It is attached to a single item.
 *
 * Authors:
 *   bulia byak <buliabyak@users.sf.net>
 *
 */

#include <glib.h>

namespace Inkscape { namespace XML { class Node; } }

class KnotHolder;
class LivePathEffectObject;
class SPDesktop;
class SPItem;

class ShapeEditor {
public:

    ShapeEditor(SPDesktop *desktop);
    ~ShapeEditor();

    void set_item(SPItem *item, bool keep_knotholder = false);
    void unset_item(bool keep_knotholder = false);

    void update_knotholder(); //((deprecated))

    bool has_local_change();
    void decrement_local_change();

    bool knot_mouseover() const;
    
    static void blockSetItem(bool b) { _blockSetItem = b; } // kludge?

    static void event_attr_changed(Inkscape::XML::Node * /*repr*/, gchar const *name, gchar const * /*old_value*/,
                                   gchar const * /*new_value*/, bool /*is_interactive*/, void *data);
private:
    bool has_knotholder();
    void reset_item (bool keep_knotholder = true);
    const SPItem *get_item();

    static bool _blockSetItem;

    SPDesktop *desktop;
    KnotHolder *knotholder;
    Inkscape::XML::Node *knotholder_listener_attached_for;
};

#endif // SEEN_SHAPE_EDITOR_H


/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :