From e58cac52b258e64c2cc88b0044bf9cfbaecedce2 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Tue, 9 Apr 2013 00:23:07 +0200 Subject: Started conversion of SPEventContext tree; added virtual pads to all classes. (bzr r11608.1.89) --- src/ui/tool/node-tool.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/ui/tool/node-tool.h') diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 341faf329..7223b11b3 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -41,8 +41,13 @@ typedef std::auto_ptr SelectorPtr; typedef std::auto_ptr PathSharedDataPtr; typedef boost::ptr_map ShapeEditors; -struct InkNodeTool : public SPEventContext +class CInkNodeTool; + +class InkNodeTool : public SPEventContext { +public: + CInkNodeTool* cinknodetool; + sigc::connection _selection_changed_connection; sigc::connection _mouseover_changed_connection; sigc::connection _selection_modified_connection; @@ -74,6 +79,19 @@ struct InkNodeToolClass { SPEventContextClass parent_class; }; +class CInkNodeTool : public CEventContext { +public: + CInkNodeTool(InkNodeTool* inknodetool); + + virtual void setup(); + virtual void set(Inkscape::Preferences::Entry* val); + virtual gint root_handler(GdkEvent* event); + virtual gint item_handler(SPItem* item, GdkEvent* event); + +private: + InkNodeTool* inknodetool; +}; + GType ink_node_tool_get_type (void); #endif -- cgit v1.2.3 From 1d8f1753cd8cab38d19fcc26a4ad70ba2e794ac8 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Tue, 9 Apr 2013 22:12:07 +0200 Subject: Added constructors to EventContext tree / some missing virtual pads. (bzr r11608.1.90) --- src/ui/tool/node-tool.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ui/tool/node-tool.h') diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 7223b11b3..f997aee11 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -46,6 +46,7 @@ class CInkNodeTool; class InkNodeTool : public SPEventContext { public: + InkNodeTool(); CInkNodeTool* cinknodetool; sigc::connection _selection_changed_connection; -- cgit v1.2.3 From fbb85064cfaaf03cc09bacedb16a8561f61f2b3d Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 13 Apr 2013 00:37:18 +0200 Subject: Added prefPaths to contexts; modified SPFactory (bzr r11608.1.94) --- src/ui/tool/node-tool.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui/tool/node-tool.h') diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index f997aee11..b5ce65513 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -74,6 +74,8 @@ public: unsigned single_node_transform_handles : 1; unsigned edit_clipping_paths : 1; unsigned edit_masks : 1; + + static const std::string prefsPath; }; struct InkNodeToolClass { -- cgit v1.2.3 From fbdc8b84ff670c684dafc7d7d403ed01e7077e70 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 13 Apr 2013 18:13:17 +0200 Subject: Replaced casting macros for EventContext tree; added contructors. (bzr r11608.1.96) --- src/ui/tool/node-tool.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/ui/tool/node-tool.h') diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index b5ce65513..3de68d535 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -17,10 +17,12 @@ #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(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(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)) +#define INK_NODE_TOOL(obj) ((InkNodeTool*)obj) +#define INK_IS_NODE_TOOL(obj) (((SPEventContext*)obj)->types.count(typeid(InkNodeTool))) namespace Inkscape { @@ -91,6 +93,7 @@ public: virtual gint root_handler(GdkEvent* event); virtual gint item_handler(SPItem* item, GdkEvent* event); + virtual const std::string& getPrefsPath(); private: InkNodeTool* inknodetool; }; -- cgit v1.2.3 From 1227ca0189590b281116fcc808bdd8c674b2196c Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 20 Apr 2013 21:16:13 +0200 Subject: Further changes to EventContexts; they work without GObject (bzr r11608.1.97) --- src/ui/tool/node-tool.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/ui/tool/node-tool.h') diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 3de68d535..43c1f3cdf 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -37,10 +37,17 @@ struct PathSharedData; } // namespace UI } // namespace Inkscape -typedef std::auto_ptr MultiPathPtr; -typedef std::auto_ptr CSelPtr; -typedef std::auto_ptr SelectorPtr; -typedef std::auto_ptr PathSharedDataPtr; +//typedef std::auto_ptr MultiPathPtr; +//typedef std::auto_ptr CSelPtr; +//typedef std::auto_ptr SelectorPtr; +//typedef std::auto_ptr PathSharedDataPtr; + + +typedef Inkscape::UI::MultiPathManipulator* MultiPathPtr; +typedef Inkscape::UI::ControlPointSelection* CSelPtr; +typedef Inkscape::UI::Selector* SelectorPtr; +typedef Inkscape::UI::PathSharedData* PathSharedDataPtr; + typedef boost::ptr_map ShapeEditors; class CInkNodeTool; @@ -49,6 +56,7 @@ class InkNodeTool : public SPEventContext { public: InkNodeTool(); + virtual ~InkNodeTool(); CInkNodeTool* cinknodetool; sigc::connection _selection_changed_connection; -- cgit v1.2.3 From 65ba6ad9a82f8f47974eb10665478fd783692bb5 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 20 Apr 2013 23:19:46 +0200 Subject: Merging of EventContext classes complete. (bzr r11608.1.98) --- src/ui/tool/node-tool.h | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'src/ui/tool/node-tool.h') diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 43c1f3cdf..fb2b41663 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -16,13 +16,8 @@ #include #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)) #define INK_NODE_TOOL(obj) ((InkNodeTool*)obj) -#define INK_IS_NODE_TOOL(obj) (((SPEventContext*)obj)->types.count(typeid(InkNodeTool))) +#define INK_IS_NODE_TOOL(obj) (dynamic_cast((const SPEventContext*)obj)) namespace Inkscape { @@ -50,16 +45,13 @@ typedef Inkscape::UI::PathSharedData* PathSharedDataPtr; typedef boost::ptr_map ShapeEditors; -class CInkNodeTool; -class InkNodeTool : public SPEventContext -{ +class InkNodeTool : public SPEventContext { public: InkNodeTool(); virtual ~InkNodeTool(); - CInkNodeTool* cinknodetool; - sigc::connection _selection_changed_connection; + sigc::connection _selection_changed_connection; sigc::connection _mouseover_changed_connection; sigc::connection _selection_modified_connection; sigc::connection _sizeUpdatedConn; @@ -86,15 +78,6 @@ public: unsigned edit_masks : 1; static const std::string prefsPath; -}; - -struct InkNodeToolClass { - SPEventContextClass parent_class; -}; - -class CInkNodeTool : public CEventContext { -public: - CInkNodeTool(InkNodeTool* inknodetool); virtual void setup(); virtual void set(Inkscape::Preferences::Entry* val); @@ -102,12 +85,8 @@ public: virtual gint item_handler(SPItem* item, GdkEvent* event); virtual const std::string& getPrefsPath(); -private: - InkNodeTool* inknodetool; }; -GType ink_node_tool_get_type (void); - #endif /* -- cgit v1.2.3 From 389b871cdea29ace85567863c439eb0537a36f54 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 21 Apr 2013 20:45:27 +0200 Subject: Cleaned up a bit. (bzr r11608.1.102) --- src/ui/tool/node-tool.h | 77 ++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 40 deletions(-) (limited to 'src/ui/tool/node-tool.h') diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index fb2b41663..597f2a347 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -11,7 +11,6 @@ #ifndef SEEN_UI_TOOL_NODE_TOOL_H #define SEEN_UI_TOOL_NODE_TOOL_H -#include #include #include #include "event-context.h" @@ -29,53 +28,20 @@ class MultiPathManipulator; class ControlPointSelection; class Selector; struct PathSharedData; +class ControlPoint; } // namespace UI } // namespace Inkscape -//typedef std::auto_ptr MultiPathPtr; -//typedef std::auto_ptr CSelPtr; -//typedef std::auto_ptr SelectorPtr; -//typedef std::auto_ptr PathSharedDataPtr; - - -typedef Inkscape::UI::MultiPathManipulator* MultiPathPtr; -typedef Inkscape::UI::ControlPointSelection* CSelPtr; -typedef Inkscape::UI::Selector* SelectorPtr; -typedef Inkscape::UI::PathSharedData* PathSharedDataPtr; - -typedef boost::ptr_map ShapeEditors; - - class InkNodeTool : public SPEventContext { public: InkNodeTool(); virtual ~InkNodeTool(); - 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; - 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; + Inkscape::UI::ControlPointSelection* _selected_nodes; + Inkscape::UI::MultiPathManipulator* _multipath; + + bool edit_clipping_paths; + bool edit_masks; static const std::string prefsPath; @@ -85,6 +51,37 @@ public: virtual gint item_handler(SPItem* item, GdkEvent* event); virtual const std::string& getPrefsPath(); + +private: + sigc::connection _selection_changed_connection; + sigc::connection _mouseover_changed_connection; + sigc::connection _sizeUpdatedConn; + + Inkscape::MessageContext *_node_message_context; + SPItem *flashed_item; + Inkscape::Display::TemporaryItem *flash_tempitem; + Inkscape::UI::Selector* _selector; + Inkscape::UI::PathSharedData* _path_data; + SPCanvasGroup *_transform_handle_group; + SPItem *_last_over; + boost::ptr_map _shape_editors; + + 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); + + 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 -- cgit v1.2.3 From bdde74bbab299f2ee448f1c55469c56a66fb01f7 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 21 Apr 2013 23:58:15 +0200 Subject: Removed some unused files; more refactoring in EventContext tree. (bzr r11608.1.104) --- src/ui/tool/node-tool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/tool/node-tool.h') diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 597f2a347..df8b5d782 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -46,7 +46,7 @@ public: static const std::string prefsPath; virtual void setup(); - virtual void set(Inkscape::Preferences::Entry* val); + virtual void set(const Inkscape::Preferences::Entry& val); virtual gint root_handler(GdkEvent* event); virtual gint item_handler(SPItem* item, GdkEvent* event); -- cgit v1.2.3 From b2dd3583e7372d23d18bbc6e861f4f645ec3dc37 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Tue, 30 Jul 2013 23:17:21 +0200 Subject: Further refactoring of EventContexts. (bzr r11608.1.109) --- src/ui/tool/node-tool.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/ui/tool/node-tool.h') diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index df8b5d782..313cc0561 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -15,22 +15,23 @@ #include #include "event-context.h" -#define INK_NODE_TOOL(obj) ((InkNodeTool*)obj) -#define INK_IS_NODE_TOOL(obj) (dynamic_cast((const SPEventContext*)obj)) - namespace Inkscape { + namespace Display { + class TemporaryItem; + } + + namespace UI { + class MultiPathManipulator; + class ControlPointSelection; + class Selector; + class ControlPoint; -namespace Display { -class TemporaryItem; -} // namespace Display -namespace UI { -class MultiPathManipulator; -class ControlPointSelection; -class Selector; -struct PathSharedData; -class ControlPoint; -} // namespace UI -} // namespace Inkscape + struct PathSharedData; + } +} + +#define INK_NODE_TOOL(obj) ((InkNodeTool*)obj) +#define INK_IS_NODE_TOOL(obj) (dynamic_cast((const SPEventContext*)obj)) class InkNodeTool : public SPEventContext { public: @@ -47,8 +48,8 @@ public: virtual void setup(); virtual void set(const Inkscape::Preferences::Entry& val); - virtual gint root_handler(GdkEvent* event); - virtual gint item_handler(SPItem* item, GdkEvent* event); + virtual bool root_handler(GdkEvent* event); + virtual bool item_handler(SPItem* item, GdkEvent* event); virtual const std::string& getPrefsPath(); -- cgit v1.2.3 From 989abbac025a8b3349748d19a613a08586c5fdcd Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Wed, 31 Jul 2013 21:11:20 +0200 Subject: Fixed SPObject ctor and dtor; removed singleton.h; some smaller changes. (bzr r11608.1.110) --- src/ui/tool/node-tool.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/ui/tool/node-tool.h') diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 313cc0561..779cf98e6 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -58,7 +58,6 @@ private: sigc::connection _mouseover_changed_connection; sigc::connection _sizeUpdatedConn; - Inkscape::MessageContext *_node_message_context; SPItem *flashed_item; Inkscape::Display::TemporaryItem *flash_tempitem; Inkscape::UI::Selector* _selector; -- cgit v1.2.3 From 5cf6efefbfd06d723973b6517b442f0ee64416b7 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 15 Sep 2013 02:43:49 +0200 Subject: Added runtime check in SP_-cast macros. (bzr r11608.1.123) --- src/ui/tool/node-tool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/tool/node-tool.h') diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 779cf98e6..ce022cec6 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -30,7 +30,7 @@ namespace Inkscape { } } -#define INK_NODE_TOOL(obj) ((InkNodeTool*)obj) +#define INK_NODE_TOOL(obj) (dynamic_cast((SPEventContext*)obj)) #define INK_IS_NODE_TOOL(obj) (dynamic_cast((const SPEventContext*)obj)) class InkNodeTool : public SPEventContext { -- cgit v1.2.3