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/actions/actions-extra-data.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/actions/actions-extra-data.h')
-rw-r--r-- | src/actions/actions-extra-data.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/actions/actions-extra-data.h b/src/actions/actions-extra-data.h new file mode 100644 index 0000000..0c7bb6b --- /dev/null +++ b/src/actions/actions-extra-data.h @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Extra data associated with actions: Label, Section, Tooltip. + * + * Extra data is indexed by "detailed action names", that is an action + * with prefix and value (if statefull). For example: + * "win.canvas-display-mode(1)" + * + * Copyright (C) 2020 Tavmjong Bah + * + * The contents of this file may be used under the GNU General Public License Version 2 or later. + * + */ + +#ifndef INK_ACTIONS_EXTRA_DATA_H +#define INK_ACTIONS_EXTRA_DATA_H + +#include <glibmm/ustring.h> +#include <glibmm/varianttype.h> +#include <map> +#include <utility> +#include <vector> + +enum class ParamType +{ + INTEGER, + DOUBLE, + STRING, +}; + +struct InkActionExtraDatum +{ + Glib::ustring label; + Glib::ustring section; + Glib::ustring tooltip; +}; + +class InkActionExtraData +{ +public: + InkActionExtraData() = default; + + std::vector<Glib::ustring> get_actions(); + + void add_data(std::vector<std::vector<Glib::ustring>> const &raw_data); + + Glib::ustring get_label_for_action(Glib::ustring const &action_name, bool translated = true); + Glib::ustring get_section_for_action(Glib::ustring const &action_name); + Glib::ustring get_tooltip_for_action(Glib::ustring const &action_name, bool translated = true, + bool expanded = false); + +private: + std::map<Glib::ustring, InkActionExtraDatum> data; +}; + +#endif // INK_ACTIONS_EXTRA_DATA_H + +/* + 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 : |