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