Inkscape
Vector Graphics Editor
point.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Authors:
4 * Johan Engelen <j.b.c.engelen@utwente.nl>
5 * Carl Hetherington <inkscape@carlh.net>
6 * Derek P. Moore <derekm@hackunix.org>
7 * Bryce Harrington <bryce@bryceharrington.org>
8 *
9 * Copyright (C) 2007 Authors
10 * Copyright (C) 2004 Authors
11 *
12 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
13 */
14
15#ifndef INKSCAPE_UI_WIDGET_POINT_H
16#define INKSCAPE_UI_WIDGET_POINT_H
17
18#include <2geom/point.h>
19
20#include "ui/widget/labelled.h"
21#include "ui/widget/scalar.h"
22
23namespace Gtk {
24class Adjustment;
25} // namespace Gtk
26
27namespace Inkscape::UI::Widget {
28
33class Point : public Labelled
34{
35public:
46 Point(Glib::ustring const &label,
47 Glib::ustring const &tooltip,
48 Glib::ustring const &icon = {},
49 bool mnemonic = true);
50
62 Point(Glib::ustring const &label,
63 Glib::ustring const &tooltip,
64 unsigned digits,
65 Glib::ustring const &icon = {},
66 bool mnemonic = true);
67
80 Point(Glib::ustring const &label,
81 Glib::ustring const &tooltip,
82 Glib::RefPtr<Gtk::Adjustment> const &adjust,
83 unsigned digits = 0,
84 Glib::ustring const &icon = {},
85 bool mnemonic = true);
86
90 unsigned getDigits() const;
91
95 double getStep() const;
96
100 double getPage() const;
101
105 double getRangeMin() const;
106
110 double getRangeMax() const;
111
112 bool getSnapToTicks() const;
113
117 double getXValue() const;
118
119 double getYValue() const;
120
121 Geom::Point getValue() const;
122
126 int getXValueAsInt() const;
127
128 int getYValueAsInt() const;
129
133 void setDigits(unsigned digits);
134
138 void setIncrements(double step, double page);
139
143 void setRange(double min, double max);
144
148 void setValue(Geom::Point const & p);
149
153 void update();
154
158 Glib::SignalProxy<void()> signal_x_value_changed();
159 Glib::SignalProxy<void()> signal_y_value_changed();
160
166 bool setProgrammatically();
168
169protected:
172
173private:
175};
176
177} // namespace Inkscape::UI::Widget
178
179#endif // INKSCAPE_UI_WIDGET_POINT_H
180
181/*
182 Local Variables:
183 mode:c++
184 c-file-style:"stroustrup"
185 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
186 indent-tabs-mode:nil
187 fill-column:99
188 End:
189*/
190// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
Cartesian point / 2D vector and related operations.
uint64_t page
Definition: canvas.cpp:172
Two-dimensional point that doubles as a vector.
Definition: point.h:66
Adds a label with optional icon to another widget.
Definition: labelled.h:31
A labelled text box, with spin buttons and optional icon, for entering arbitrary coordinate values.
Definition: point.h:34
Glib::SignalProxy< void()> signal_y_value_changed()
Definition: point.cpp:149
Point(Glib::ustring const &label, Glib::ustring const &tooltip, Glib::ustring const &icon={}, bool mnemonic=true)
Construct a Point Widget.
Definition: point.cpp:24
int getYValueAsInt() const
Definition: point.cpp:98
Geom::Point getValue() const
Definition: point.cpp:88
void setDigits(unsigned digits)
Sets the precision to be displayed by the spin button.
Definition: point.cpp:103
double getYValue() const
Definition: point.cpp:83
unsigned getDigits() const
Fetches the precision of the spin button.
Definition: point.cpp:53
Glib::SignalProxy< void()> signal_x_value_changed()
Signal raised when the spin button's value changes.
Definition: point.cpp:144
void setRange(double min, double max)
Sets the minimum and maximum range allowed for the spin button.
Definition: point.cpp:115
void setValue(Geom::Point const &p)
Sets the value of the spin button.
Definition: point.cpp:121
int getXValueAsInt() const
Get the value spin_button represented as an integer.
Definition: point.cpp:93
bool setProgrammatically()
Check 'setProgrammatically' of both scalar widgets.
Definition: point.cpp:133
double getXValue() const
Get the value in the spin_button.
Definition: point.cpp:78
void setIncrements(double step, double page)
Sets the step and page increments for the spin button.
Definition: point.cpp:109
double getRangeMin() const
Gets the minimum range value allowed for the spin button.
Definition: point.cpp:68
void update()
Manually forces an update of the spin button.
Definition: point.cpp:127
double getPage() const
Gets the current page increment used by the spin button.
Definition: point.cpp:63
double getStep() const
Gets the current step increment used by the spin button.
Definition: point.cpp:58
double getRangeMax() const
Gets the maximum range value allowed for the spin button.
Definition: point.cpp:73
A labelled text box, with spin buttons and optional icon, for entering arbitrary number values.
Definition: scalar.h:34
MultiDegree< n > max(MultiDegree< n > const &p, MultiDegree< n > const &q)
Returns the maximal degree appearing in the two arguments for each variables.
Definition: sbasisN.h:158
Piecewise< SBasis > min(SBasis const &f, SBasis const &g)
Return the more negative of the two functions pointwise.
Definition: desktop.h:51
Custom widgets.
Definition: desktop.h:127