diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:29:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:29:01 +0000 |
commit | 35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch) | |
tree | 657d15a03cc46bd099fc2c6546a7a4ad43815d9f /src/actions/actions-extra-data.h | |
parent | Initial commit. (diff) | |
download | inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip |
Adding upstream version 1.0.2.upstream/1.0.2upstream
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 | 64 |
1 files changed, 64 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..e96234e --- /dev/null +++ b/src/actions/actions-extra-data.h @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Extra data associated with actions: Label, Section, Tooltip. + * + * 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 <map> +#include <vector> + +#include <glibmm/ustring.h> + +class InkActionExtraDatum { + public: + InkActionExtraDatum(Glib::ustring& label, Glib::ustring& section, Glib::ustring& tooltip) + : action_label(label) + , action_section(section) + , action_tooltip(tooltip) + { + } + + Glib::ustring get_label() { return action_label; } + Glib::ustring get_section() { return action_section; } + Glib::ustring get_tooltip() { return action_tooltip; } + + private: + Glib::ustring action_label; + Glib::ustring action_section; + Glib::ustring action_tooltip; +}; + +class InkActionExtraData { + + public: + InkActionExtraData() = default; + + void add_data(std::vector<std::vector<Glib::ustring>> &raw_data); + + Glib::ustring get_label_for_action(Glib::ustring& action_name); + Glib::ustring get_section_for_action(Glib::ustring& action_name); + Glib::ustring get_tooltip_for_action(Glib::ustring& action_name); + + 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 : |