diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
commit | cca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch) | |
tree | 146f39ded1c938019e1ed42d30923c2ac9e86789 /src/ui/contextmenu.h | |
parent | Initial commit. (diff) | |
download | inkscape-upstream.tar.xz inkscape-upstream.zip |
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/ui/contextmenu.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/ui/contextmenu.h b/src/ui/contextmenu.h new file mode 100644 index 0000000..2b15111 --- /dev/null +++ b/src/ui/contextmenu.h @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#ifndef SEEN_CONTEXTMENU_H +#define SEEN_CONTEXTMENU_H + +/* + * Context menu + * + * Authors: + * Tavmjong Bah + * + * Copyright (C) 2022 Tavmjong Bah + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#include <vector> + +#include <gtkmm/menu.h> +#include <giomm.h> + +class SPDesktop; +class SPDocument; +class SPObject; +class SPItem; + +/** + * Implements the Inkscape context menu. + */ +class ContextMenu : public Gtk::Menu +{ +public: + ContextMenu(SPDesktop *desktop, SPObject *object, bool hide_layers_and_objects_menu_item = false); + ~ContextMenu() override = default; + +private: + void AppendItemFromAction(Glib::RefPtr<Gio::Menu> gmenu, Glib::ustring action, Glib::ustring label, Glib::ustring icon = ""); + + // Used for unlock and unhide actions + Glib::RefPtr<Gio::SimpleActionGroup> action_group; + std::vector<SPItem *> items_under_cursor; + void unhide_or_unlock(SPDocument* document, bool unhide); +}; +#endif // SEEN_CONTEXT_MENU_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:fileencoding=utf-8:textwidth=99 : |