Code

Merging from trunk
[inkscape.git] / src / conn-avoid-ref.h
1 #ifndef SEEN_CONN_AVOID_REF
2 #define SEEN_CONN_AVOID_REF
4 /** \file
5  * A class for handling shape interaction with libavoid.
6  */
7 /*
8  * Authors:
9  *   Michael Wybrow <mjwybrow@users.sourceforge.net>
10  *
11  * Copyright (C) 2005 Michael Wybrow
12  *
13  * Released under GNU GPL, read the file 'COPYING' for more information
14  */
16 #include <glib/gslist.h>
17 #include <sigc++/connection.h>
19 struct SPDesktop;
20 struct SPItem;
21 namespace Avoid { class ShapeRef; }
23 class SPAvoidRef {
24 public:
25     SPAvoidRef(SPItem *spitem);
26     virtual ~SPAvoidRef();
28     // libavoid's internal representation of the item.
29     Avoid::ShapeRef *shapeRef;
31     void setAvoid(char const *value);
32     void handleSettingChange(void);
33     
34     // Returns a list of SPItems of all connectors/shapes attached to
35     // this object.  Pass one of the following for 'type':
36     //     Avoid::runningTo
37     //     Avoid::runningFrom
38     //     Avoid::runningToAndFrom
39     GSList *getAttachedShapes(const unsigned int type);
40     GSList *getAttachedConnectors(const unsigned int type);
42 private:
43     SPItem *item;
45     // true if avoiding, false if not.
46     bool setting;
47     bool new_setting;
49     // A sigc connection for transformed signal.
50     sigc::connection _transformed_connection;
51 };
53 extern GSList *get_avoided_items(GSList *list, SPObject *from,
54         SPDesktop *desktop, bool initialised = true);
55 extern void avoid_item_move(Geom::Matrix const *mp, SPItem *moved_item);
56 extern void init_avoided_shape_geometry(SPDesktop *desktop);
58 static const double defaultConnSpacing = 3.0;
60 #endif /* !SEEN_CONN_AVOID_REF */
62 /*
63   Local Variables:
64   mode:c++
65   c-file-style:"stroustrup"
66   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
67   indent-tabs-mode:nil
68   fill-column:99
69   End:
70 */
71 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :