summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/node-tool.h
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-09-19 22:33:11 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-09-19 22:33:11 +0000
commit4bda89e32e33c7bdff5d3ea3c1ceee1f806de9f7 (patch)
treecaeb924426bcc861badc6fa81318b67460b26d47 /src/ui/tool/node-tool.h
parentUpdate to trunk (diff)
parentupdates for cmake (diff)
downloadinkscape-4bda89e32e33c7bdff5d3ea3c1ceee1f806de9f7.tar.gz
inkscape-4bda89e32e33c7bdff5d3ea3c1ceee1f806de9f7.zip
Update to trunk
(bzr r11950.1.141)
Diffstat (limited to 'src/ui/tool/node-tool.h')
-rw-r--r--src/ui/tool/node-tool.h108
1 files changed, 58 insertions, 50 deletions
diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h
index 341faf329..ce022cec6 100644
--- a/src/ui/tool/node-tool.h
+++ b/src/ui/tool/node-tool.h
@@ -11,70 +11,78 @@
#ifndef SEEN_UI_TOOL_NODE_TOOL_H
#define SEEN_UI_TOOL_NODE_TOOL_H
-#include <memory>
#include <boost/ptr_container/ptr_map.hpp>
#include <glib.h>
#include "event-context.h"
-#define INK_TYPE_NODE_TOOL (ink_node_tool_get_type ())
-#define INK_NODE_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INK_TYPE_NODE_TOOL, InkNodeTool))
-#define INK_NODE_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INK_TYPE_NODE_TOOL, InkNodeToolClass))
-#define INK_IS_NODE_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INK_TYPE_NODE_TOOL))
-#define INK_IS_NODE_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INK_TYPE_NODE_TOOL))
-
namespace Inkscape {
+ namespace Display {
+ class TemporaryItem;
+ }
+
+ namespace UI {
+ class MultiPathManipulator;
+ class ControlPointSelection;
+ class Selector;
+ class ControlPoint;
+
+ struct PathSharedData;
+ }
+}
+
+#define INK_NODE_TOOL(obj) (dynamic_cast<InkNodeTool*>((SPEventContext*)obj))
+#define INK_IS_NODE_TOOL(obj) (dynamic_cast<const InkNodeTool*>((const SPEventContext*)obj))
+
+class InkNodeTool : public SPEventContext {
+public:
+ InkNodeTool();
+ virtual ~InkNodeTool();
+
+ Inkscape::UI::ControlPointSelection* _selected_nodes;
+ Inkscape::UI::MultiPathManipulator* _multipath;
+
+ bool edit_clipping_paths;
+ bool edit_masks;
+
+ static const std::string prefsPath;
-namespace Display {
-class TemporaryItem;
-} // namespace Display
-namespace UI {
-class MultiPathManipulator;
-class ControlPointSelection;
-class Selector;
-struct PathSharedData;
-} // namespace UI
-} // namespace Inkscape
-
-typedef std::auto_ptr<Inkscape::UI::MultiPathManipulator> MultiPathPtr;
-typedef std::auto_ptr<Inkscape::UI::ControlPointSelection> CSelPtr;
-typedef std::auto_ptr<Inkscape::UI::Selector> SelectorPtr;
-typedef std::auto_ptr<Inkscape::UI::PathSharedData> PathSharedDataPtr;
-typedef boost::ptr_map<SPItem*, ShapeEditor> ShapeEditors;
-
-struct InkNodeTool : public SPEventContext
-{
- sigc::connection _selection_changed_connection;
+ virtual void setup();
+ virtual void set(const Inkscape::Preferences::Entry& val);
+ virtual bool root_handler(GdkEvent* event);
+ virtual bool item_handler(SPItem* item, GdkEvent* event);
+
+ virtual const std::string& getPrefsPath();
+
+private:
+ sigc::connection _selection_changed_connection;
sigc::connection _mouseover_changed_connection;
- sigc::connection _selection_modified_connection;
sigc::connection _sizeUpdatedConn;
- Inkscape::MessageContext *_node_message_context;
+
SPItem *flashed_item;
Inkscape::Display::TemporaryItem *flash_tempitem;
- CSelPtr _selected_nodes;
- MultiPathPtr _multipath;
- SelectorPtr _selector;
- PathSharedDataPtr _path_data;
+ Inkscape::UI::Selector* _selector;
+ Inkscape::UI::PathSharedData* _path_data;
SPCanvasGroup *_transform_handle_group;
SPItem *_last_over;
- ShapeEditors _shape_editors;
-
- unsigned cursor_drag : 1;
- unsigned show_handles : 1;
- unsigned show_outline : 1;
- unsigned live_outline : 1;
- unsigned live_objects : 1;
- unsigned show_path_direction : 1;
- unsigned show_transform_handles : 1;
- unsigned single_node_transform_handles : 1;
- unsigned edit_clipping_paths : 1;
- unsigned edit_masks : 1;
-};
+ boost::ptr_map<SPItem*, ShapeEditor> _shape_editors;
-struct InkNodeToolClass {
- SPEventContextClass parent_class;
-};
+ bool cursor_drag;
+ bool show_handles;
+ bool show_outline;
+ bool live_outline;
+ bool live_objects;
+ bool show_path_direction;
+ bool show_transform_handles;
+ bool single_node_transform_handles;
+
+ void selection_changed(Inkscape::Selection *sel);
-GType ink_node_tool_get_type (void);
+ void select_area(Geom::Rect const &sel, GdkEventButton *event);
+ void select_point(Geom::Point const &sel, GdkEventButton *event);
+ void mouseover_changed(Inkscape::UI::ControlPoint *p);
+ void update_tip(GdkEvent *event);
+ void handleControlUiStyleChange();
+};
#endif