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 virtual ~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/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(NR::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 :