Code

switch to sigc++ signals for "modified" and "release"
[inkscape.git] / src / node-context.h
1 #ifndef __SP_NODE_CONTEXT_H__
2 #define __SP_NODE_CONTEXT_H__
4 /*
5  * Node editing context
6  *
7  * Authors:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *   bulia byak <buliabyak@users.sf.net>
10  *
11  * This code is in public domain
12  */
14 #include <sigc++/sigc++.h>
15 #include "event-context.h"
16 #include "forward.h"
17 #include "nodepath.h"
18 struct SPKnotHolder;
19 namespace Inkscape { class Selection; }
21 #define SP_TYPE_NODE_CONTEXT            (sp_node_context_get_type ())
22 #define SP_NODE_CONTEXT(obj)            (GTK_CHECK_CAST ((obj), SP_TYPE_NODE_CONTEXT, SPNodeContext))
23 #define SP_NODE_CONTEXT_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_NODE_CONTEXT, SPNodeContextClass))
24 #define SP_IS_NODE_CONTEXT(obj)         (GTK_CHECK_TYPE ((obj), SP_TYPE_NODE_CONTEXT))
25 #define SP_IS_NODE_CONTEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_NODE_CONTEXT))
27 class SPNodeContext;
28 class SPNodeContextClass;
30 struct SPNodeContext {
31         SPEventContext event_context;
33         guint drag : 1;
35         Inkscape::NodePath::Path *nodepath;
37         gboolean leftalt;
38         gboolean rightalt;
39         gboolean leftctrl;
40         gboolean rightctrl;
42       /// If true, rubberband was cancelled by esc, so the next button release should not deselect.
43         bool rb_escaped;
45         sigc::connection sel_changed_connection;
47         Inkscape::MessageContext *_node_message_context;
49         double grab_t;
50         Inkscape::NodePath::Node * grab_node;
51         bool hit;
52         NR::Point curvepoint_event; // int coords from event
53         NR::Point curvepoint_doc; // same, in doc coords
54         bool cursor_drag;
56         bool added_node;
57 };
59 struct SPNodeContextClass {
60         SPEventContextClass parent_class;
61 };
63 /* Standard Gtk function */
65 GtkType sp_node_context_get_type (void);
67 void sp_node_context_selection_changed (Inkscape::Selection * selection, gpointer data);
69 #endif