1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #ifndef __SP_SELECT_CONTEXT_H__
3 #define __SP_SELECT_CONTEXT_H__
4 
5 /*
6  * Select tool
7  *
8  * Authors:
9  *   Lauris Kaplinski <lauris@kaplinski.com>
10  *
11  * Copyright (C) 1999-2002 authors
12  *
13  * Released under GNU GPL v2+, read the file 'COPYING' for more information.
14  */
15 
16 #include "ui/tools/tool-base.h"
17 
18 #define SP_SELECT_CONTEXT(obj) (dynamic_cast<Inkscape::UI::Tools::SelectTool*>((Inkscape::UI::Tools::ToolBase*)obj))
19 #define SP_IS_SELECT_CONTEXT(obj) (dynamic_cast<const Inkscape::UI::Tools::SelectTool*>((const Inkscape::UI::Tools::ToolBase*)obj) != NULL)
20 
21 namespace Inkscape {
22   class SelTrans;
23   class SelectionDescriber;
24 }
25 
26 namespace Inkscape {
27 namespace UI {
28 namespace Tools {
29 
30 class SelectTool : public ToolBase {
31 public:
32 	SelectTool();
33 	~SelectTool() override;
34 
35 	bool dragging;
36 	bool moved;
37 	guint button_press_state;
38 
39         std::vector<SPItem *> cycling_items;
40         std::vector<SPItem *> cycling_items_cmp;
41         SPItem *cycling_cur_item;
42 	bool cycling_wrap;
43 
44 	SPItem *item;
45         Inkscape::CanvasItem *grabbed = nullptr;
46 	Inkscape::SelTrans *_seltrans;
47 	Inkscape::SelectionDescriber *_describer;
48 	gchar *no_selection_msg = nullptr;
49 
50 	static const std::string prefsPath;
51 
52 	void setup() override;
53 	void set(const Inkscape::Preferences::Entry& val) override;
54 	bool root_handler(GdkEvent* event) override;
55 	bool item_handler(SPItem* item, GdkEvent* event) override;
56 
57 	const std::string& getPrefsPath() override;
58 
59 private:
60 	bool sp_select_context_abort();
61 	void sp_select_context_cycle_through_items(Inkscape::Selection *selection, GdkEventScroll *scroll_event);
62 	void sp_select_context_reset_opacities();
63 
64     Glib::RefPtr<Gdk::Cursor> _cursor_mouseover;
65     Glib::RefPtr<Gdk::Cursor> _cursor_dragging;
66 };
67 
68 }
69 }
70 }
71 
72 #endif
73 
74 /*
75   Local Variables:
76   mode:c++
77   c-file-style:"stroustrup"
78   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
79   indent-tabs-mode:nil
80   fill-column:99
81   End:
82 */
83 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
84