Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
select-tool.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef INKSCAPE_UI_TOOLS_SELECT_TOOl_H
3#define INKSCAPE_UI_TOOLS_SELECT_TOOl_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 "rubberband.h"
17#include "ui/tools/tool-base.h"
18
19namespace Inkscape {
20struct ScrollEvent;
21class SelTrans;
22class SelectionDescriber;
23class Selection;
24} // namespace Inkscape
25
26namespace Inkscape::UI::Tools {
27
28class SelectTool : public ToolBase
29{
30public:
32 ~SelectTool() override;
33
34 bool moved = false;
35 unsigned button_press_state = 0;
36
37 std::vector<SPItem *> cycling_items;
38 std::vector<SPItem *> cycling_items_cmp;
40 bool cycling_wrap = true;
41
42 SPItem *item = nullptr;
43 CanvasItem *grabbed = nullptr;
44 SelTrans *_seltrans = nullptr;
46 char *no_selection_msg = nullptr;
47
48 void set(Preferences::Entry const &val) override;
49 bool root_handler(CanvasEvent const &event) override;
50 bool item_handler(SPItem *item, CanvasEvent const &event) override;
51
52 void updateDescriber(Selection *sel);
53
54private:
58 static std::pair<Rubberband::Mode, CanvasItemCtrlType> get_default_rubberband_state();
59
60 bool _alt_on = false;
61 bool _force_dragging = false;
62
63 std::string _default_cursor;
64};
65
66} // namespace Inkscape::UI::Tools
67
68#endif // INKSCAPE_UI_TOOLS_SELECT_TOOl_H
69
70/*
71 Local Variables:
72 mode:c++
73 c-file-style:"stroustrup"
74 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
75 indent-tabs-mode:nil
76 fill-column:99
77 End:
78*/
79// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
Data type representing a typeless value of a preference.
The set of selected SPObjects for a given document and layer model.
Definition selection.h:80
bool root_handler(CanvasEvent const &event) override
static std::pair< Rubberband::Mode, CanvasItemCtrlType > get_default_rubberband_state()
Get the default rubberband state for select tool.
SelectionDescriber * _describer
Definition select-tool.h:45
bool item_handler(SPItem *item, CanvasEvent const &event) override
Handles item specific events.
std::vector< SPItem * > cycling_items
Definition select-tool.h:37
void sp_select_context_cycle_through_items(Selection *selection, ScrollEvent const &scroll_event)
std::vector< SPItem * > cycling_items_cmp
Definition select-tool.h:38
void updateDescriber(Selection *sel)
Update the toolbar description to this selection.
Base class for Event processors.
Definition tool-base.h:95
To do: update description of desktop.
Definition desktop.h:149
Base class for visual SVG elements.
Definition sp-item.h:109
Helper class to stream background task notifications as a series of messages.
Abstract base class for events.
Scroll the item or widget by the provided amount.
SPDesktop * desktop
static gboolean scroll_event(GtkEventControllerScroll *self, double dx, double dy, gpointer user_data)