Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
rect-tool.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef INKSCAPE_UI_TOOLS_RECT_TOOL_H
3#define INKSCAPE_UI_TOOLS_RECT_TOOL_H
4
5/*
6 * Rectangle drawing context
7 *
8 * Author:
9 * Lauris Kaplinski <lauris@kaplinski.com>
10 * Jon A. Cruz <jon@joncruz.org>
11 *
12 * Copyright (C) 2000 Lauris Kaplinski
13 * Copyright (C) 2000-2001 Ximian, Inc.
14 * Copyright (C) 2002 Lauris Kaplinski
15 *
16 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
17 */
18
19#include <cstddef>
20#include <sigc++/sigc++.h>
21#include <2geom/point.h>
22#include "ui/tools/tool-base.h"
23#include "object/weakptr.h"
24
25class SPRect;
26
27namespace Inkscape { class Selection; }
28
29namespace Inkscape::UI::Tools {
30
31class RectTool : public ToolBase
32{
33public:
35 ~RectTool() override;
36
37 void set(Preferences::Entry const &val) override;
38 bool root_handler(CanvasEvent const &event) override;
39 bool item_handler(SPItem *item, CanvasEvent const &event) override;
40
41private:
44
45 double rx; /* roundness radius (x direction) */
46 double ry; /* roundness radius (y direction) */
47
48 sigc::connection sel_changed_connection;
49
50 void drag(Geom::Point const pt, unsigned state);
51 void finishItem();
52 void cancel();
53 void selection_changed(Selection *selection);
54};
55
56} // namespace Inkscape::UI::Tools
57
58#endif // INKSCAPE_UI_TOOLS_RECT_TOOL_H
59
60/*
61 Local Variables:
62 mode:c++
63 c-file-style:"stroustrup"
64 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
65 indent-tabs-mode:nil
66 fill-column:99
67 End:
68*/
69// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
Cartesian point / 2D vector and related operations.
Two-dimensional point that doubles as a vector.
Definition point.h:66
Data type representing a typeless value of a preference.
A weak pointer to an SPObject: it nulls itself upon the object's destruction.
Definition weakptr.h:14
The set of selected SPObjects for a given document and layer model.
Definition selection.h:80
SPWeakPtr< SPRect > rect
Definition rect-tool.h:42
sigc::connection sel_changed_connection
Definition rect-tool.h:48
void drag(Geom::Point const pt, unsigned state)
void selection_changed(Selection *selection)
Callback that processes the "changed" signal on the selection; destroys old and creates new knotholde...
Definition rect-tool.cpp:98
bool root_handler(CanvasEvent const &event) override
bool item_handler(SPItem *item, CanvasEvent const &event) override
Handles item specific events.
Base class for Event processors.
Definition tool-base.h:107
To do: update description of desktop.
Definition desktop.h:149
Base class for visual SVG elements.
Definition sp-item.h:109
SPItem * item
Helper class to stream background task notifications as a series of messages.
Abstract base class for events.
SPDesktop * desktop