Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
fontbutton.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Authors:
4 *
5 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
6 */
7
8#include "fontbutton.h"
9
10#include <glibmm/i18n.h>
11
12#include "live_effects/effect.h"
13#include "svg/stringstream.h"
14#include "ui/icon-names.h"
16
17
18namespace Inkscape {
19
20namespace LivePathEffect {
21
22FontButtonParam::FontButtonParam( const Glib::ustring& label, const Glib::ustring& tip,
23 const Glib::ustring& key, Inkscape::UI::Widget::Registry* wr,
24 Effect* effect, const Glib::ustring default_value )
25 : Parameter(label, tip, key, wr, effect),
26 value(default_value),
27 defvalue(default_value)
28{
29}
30
31void
36
37void
38FontButtonParam::param_update_default(const gchar * default_value)
39{
40 defvalue = Glib::ustring(default_value);
41}
42
43bool
45{
47 os << strvalue;
48 param_setValue((Glib::ustring)os.str());
49 return true;
50}
51
52Glib::ustring
54{
55 return value.c_str();
56}
57
58Glib::ustring
63
64
65
66Gtk::Widget *
68{
69 auto const fontbuttonwdg = Gtk::make_managed<UI::Widget::RegisteredFontButton>( param_label,
72 *param_wr,
75 Glib::ustring fontspec = param_getSVGValue();
76 fontbuttonwdg->setValue( fontspec);
77 fontbuttonwdg->set_undo_parameters(_("Change font button parameter"), INKSCAPE_ICON("dialog-path-effects"));
78 return fontbuttonwdg;
79}
80
81void
82FontButtonParam::param_setValue(const Glib::ustring newvalue)
83{
84 if (value != newvalue) {
86 }
87 value = newvalue;
88}
89
90
91} /* namespace LivePathEffect */
92
93} /* namespace Inkscape */
94
95/*
96 Local Variables:
97 mode:c++
98 c-file-style:"stroustrup"
99 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
100 indent-tabs-mode:nil
101 fill-column:99
102 End:
103*/
104// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
Inkscape::XML::Node * getRepr()
Definition effect.cpp:1928
bool param_readSVGValue(const gchar *strvalue) override
FontButtonParam(const Glib::ustring &label, const Glib::ustring &tip, const Glib::ustring &key, Inkscape::UI::Widget::Registry *wr, Effect *effect, const Glib::ustring default_value="Sans 10")
Gtk::Widget * param_newWidget() override
Glib::ustring param_getDefaultSVGValue() const override
void param_update_default(const gchar *default_value) override
void param_setValue(Glib::ustring newvalue)
Glib::ustring param_getSVGValue() const override
Inkscape::UI::Widget::Registry * param_wr
Definition parameter.h:99
std::string str() const
Macro for icon names used in Inkscape.
Glib::ustring label
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
TODO: insert short description here.