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
25
class
SPRect
;
26
27
namespace
Inkscape
{
class
Selection; }
28
29
namespace
Inkscape::UI::Tools
{
30
31
class
RectTool
:
public
ToolBase
32
{
33
public
:
34
RectTool
(
SPDesktop
*
desktop
);
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
41
private
:
42
SPWeakPtr<SPRect>
rect
;
43
Geom::Point
center
;
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 :
point.h
Cartesian point / 2D vector and related operations.
set
bool set
Definition
actions-canvas-snapping.cpp:86
Geom::Point
Two-dimensional point that doubles as a vector.
Definition
point.h:66
Inkscape::Preferences::Entry
Data type representing a typeless value of a preference.
Definition
preferences.h:157
Inkscape::SPWeakPtr
A weak pointer to an SPObject: it nulls itself upon the object's destruction.
Definition
weakptr.h:14
Inkscape::Selection
The set of selected SPObjects for a given document and layer model.
Definition
selection.h:80
Inkscape::UI::Tools::RectTool
Definition
rect-tool.h:32
Inkscape::UI::Tools::RectTool::cancel
void cancel()
Definition
rect-tool.cpp:409
Inkscape::UI::Tools::RectTool::~RectTool
~RectTool() override
Definition
rect-tool.cpp:77
Inkscape::UI::Tools::RectTool::center
Geom::Point center
Definition
rect-tool.h:43
Inkscape::UI::Tools::RectTool::rect
SPWeakPtr< SPRect > rect
Definition
rect-tool.h:42
Inkscape::UI::Tools::RectTool::sel_changed_connection
sigc::connection sel_changed_connection
Definition
rect-tool.h:48
Inkscape::UI::Tools::RectTool::finishItem
void finishItem()
Definition
rect-tool.cpp:388
Inkscape::UI::Tools::RectTool::drag
void drag(Geom::Point const pt, unsigned state)
Definition
rect-tool.cpp:301
Inkscape::UI::Tools::RectTool::selection_changed
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
Inkscape::UI::Tools::RectTool::rx
double rx
Definition
rect-tool.h:45
Inkscape::UI::Tools::RectTool::root_handler
bool root_handler(CanvasEvent const &event) override
Definition
rect-tool.cpp:129
Inkscape::UI::Tools::RectTool::item_handler
bool item_handler(SPItem *item, CanvasEvent const &event) override
Handles item specific events.
Definition
rect-tool.cpp:115
Inkscape::UI::Tools::RectTool::ry
double ry
Definition
rect-tool.h:46
Inkscape::UI::Tools::ToolBase
Base class for Event processors.
Definition
tool-base.h:107
SPDesktop
To do: update description of desktop.
Definition
desktop.h:149
SPItem
Base class for visual SVG elements.
Definition
sp-item.h:109
SPRect
Definition
sp-rect.h:29
item
SPItem * item
Definition
imagemagick.cpp:43
Inkscape::UI::Tools
Definition
desktop.h:121
Inkscape
Helper class to stream background task notifications as a series of messages.
Definition
actions-canvas-snapping.h:27
Inkscape::CanvasEvent
Abstract base class for events.
Definition
canvas-event.h:64
desktop
SPDesktop * desktop
Definition
tabs-widget.cpp:70
tool-base.h
weakptr.h
src
ui
tools
rect-tool.h
Generated on Sun Jun 8 2025 04:02:07 for Inkscape by
1.9.8