diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:50:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:50:49 +0000 |
commit | c853ffb5b2f75f5a889ed2e3ef89b818a736e87a (patch) | |
tree | 7d13a0883bb7936b84d6ecdd7bc332b41ed04bee /src/live_effects/parameter/scalararray.h | |
parent | Initial commit. (diff) | |
download | inkscape-c853ffb5b2f75f5a889ed2e3ef89b818a736e87a.tar.xz inkscape-c853ffb5b2f75f5a889ed2e3ef89b818a736e87a.zip |
Adding upstream version 1.3+ds.upstream/1.3+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/live_effects/parameter/scalararray.h')
-rw-r--r-- | src/live_effects/parameter/scalararray.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/src/live_effects/parameter/scalararray.h b/src/live_effects/parameter/scalararray.h new file mode 100644 index 0000000..be10b69 --- /dev/null +++ b/src/live_effects/parameter/scalararray.h @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#ifndef INKSCAPE_LIVEPATHEFFECT_PARAMETER_SCALARARRAY_H +#define INKSCAPE_LIVEPATHEFFECT_PARAMETER_SCALARARRAY_H + +/* + * Inkscape::LivePathEffectParameters + * + * Copyright (C) Johan Engelen 2008 <j.b.c.engelen@utwente.nl> + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + + +#include <glib.h> +#include "live_effects/lpeobject.h" +#include "live_effects/effect.h" +#include "live_effects/parameter/array.h" +#include "live_effects/parameter/parameter.h" + +namespace Inkscape { + +namespace LivePathEffect { + +class ScalarArrayParam : public ArrayParam<double> { +public: + ScalarArrayParam( const Glib::ustring& label, + const Glib::ustring& tip, + const Glib::ustring& key, + Inkscape::UI::Widget::Registry* wr, + Effect* effect, + double default_value = 0.0, + bool visible = true, + size_t n = 0); + + ~ScalarArrayParam() override; + + Gtk::Widget *param_newWidget() override; + void param_setActive(size_t index) { + _active_index = index; + param_effect->refresh_widgets = true; + } + Glib::ustring param_getDefaultSVGValue() const override; + void param_set_default() override; + void param_update_default(gdouble default_value); + void param_update_default(const gchar *default_value) override; + void param_make_integer(bool yes = true); + void param_set_range(gdouble min, gdouble max); + void param_set_digits(unsigned digits); + void param_set_increments(double step, double page); + void addSlider(bool add_slider_widget) { add_slider = add_slider_widget; }; + void on_value_changed(Inkscape::UI::Widget::RegisteredScalar *rsu); + double param_get_max() { return max; }; + double param_get_min() { return min; }; + void param_set_undo(bool set_undo); + ParamType paramType() const override { return ParamType::SCALAR_ARRAY; }; +protected: + friend class LPETaperStroke; +private: + size_t _active_index = 0; + gdouble min; + gdouble max; + bool integer; + unsigned digits; + double inc_step; + double inc_page; + bool add_slider; + bool _set_undo; + double defvalue; + ScalarArrayParam(const ScalarArrayParam &) = delete; + ScalarArrayParam &operator=(const ScalarArrayParam &) = delete; +}; + + +} //namespace LivePathEffect + +} //namespace Inkscape + +#endif + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : |