summaryrefslogtreecommitdiffstats
path: root/src/ui/contextmenu.h
blob: a2ae29b46d414cf281dfd370389f68a1b5ef73c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// 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:
    static void AppendItemFromAction(Glib::RefPtr<Gio::Menu> gmenu, Glib::ustring action,
                                     Glib::ustring label, Glib::ustring icon = "");
    static Glib::RefPtr<Gio::Menu> create_clipboard_actions(bool paste_only = false);
    // 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 :