Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
star-tool.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef INKSCAPE_UI_TOOLS_STAR_TOOL_H
3#define INKSCAPE_UI_TOOLS_STAR_TOOL_H
4
5/*
6 * Star drawing context
7 *
8 * Authors:
9 * Mitsuru Oka <oka326@parkcity.ne.jp>
10 * Lauris Kaplinski <lauris@kaplinski.com>
11 *
12 * Copyright (C) 1999-2002 Lauris Kaplinski
13 * Copyright (C) 2001-2002 Mitsuru Oka
14 *
15 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
16 */
17
18#include <cstddef>
19#include <sigc++/sigc++.h>
20#include <2geom/point.h>
21#include "ui/tools/tool-base.h"
22#include "object/weakptr.h"
23
24#include "2geom/affine.h"
25
26class SPStar;
27
28namespace Inkscape { class Selection; }
29
30namespace Inkscape::UI::Tools {
31
32class StarTool : public ToolBase
33{
34public:
36 ~StarTool() override;
37
38 void set(Preferences::Entry const &val) override;
39 bool root_handler(CanvasEvent const &event) override;
40
41private:
43
45
46 /* Number of corners */
47 int magnitude = 5;
48
49 /* Outer/inner radius ratio */
50 double proportion = 0.5;
51
52 /* flat sides or not? */
53 bool isflatsided = false;
54
55 /* rounded corners ratio */
56 double rounded = 0.0;
57
58 // randomization
59 double randomized = 0.0;
60
61 // Scale of the new object
63
64 sigc::connection sel_changed_connection;
65
66 void drag(Geom::Point p, unsigned state);
67 void finishItem();
68 void cancel();
69 void selection_changed(Selection *selection);
70};
71
72} // namespace Inkscape::UI::Tools
73
74#endif // INKSCAPE_UI_TOOLS_STAR_TOOL_H
75
76/*
77 Local Variables:
78 mode:c++
79 c-file-style:"stroustrup"
80 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
81 indent-tabs-mode:nil
82 fill-column:99
83 End:
84*/
85// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
Cartesian point / 2D vector and related operations.
3x3 affine transformation matrix.
3x3 matrix representing an affine transformation.
Definition affine.h:70
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
void drag(Geom::Point p, unsigned state)
SPWeakPtr< SPStar > star
Definition star-tool.h:42
bool root_handler(CanvasEvent const &event) override
sigc::connection sel_changed_connection
Definition star-tool.h:64
void selection_changed(Selection *selection)
Callback that processes the "changed" signal on the selection; destroys old and creates new knotholde...
Base class for Event processors.
Definition tool-base.h:107
To do: update description of desktop.
Definition desktop.h:149
Affine identity()
Create an identity matrix.
Definition affine.h:210
Helper class to stream background task notifications as a series of messages.
Abstract base class for events.
SPDesktop * desktop