Debian Codegraph @

gtk/src/cellrendereraccel.hg

raw
1 /* Copyright (C) 2005 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 #include <gtkmm/cellrenderertext.h>
18 #include <gtkmm/accelkey.h>
19
20 _DEFS(gtkmm,gtk)
21 _PINCLUDE(gtkmm/private/cellrenderertext_p.h)
22
23
24 namespace Gtk
25 {
26
27 _WRAP_ENUM(CellRendererAccelMode, GtkCellRendererAccelMode, decl_prefix GTKMM_API)
28
29 /**
30 * Renders a keyboard accelerator in a cell.
31 *
32 * Gtk::CellRendererAccel displays a keyboard accelerator
33 * (i.e. a key combination like <Control>-a).
34 * If the cell renderer is editable, the accelerator can be changed by
35 * simply typing the new combination.
36 *
37 * Key values are the codes which are sent whenever a key is pressed or released.
38 * The complete list of key values can be found in the
39 * <a href="https://gitlab.gnome.org/GNOME/gtk/tree/gtk-3-24/gdk/gdkkeysyms.h">gdk/gdkkeysyms.h</a>
40 * header file. They are prefixed with <tt>GDK_KEY_</tt>.
41 *
42 * @ingroup TreeView
43 * @newin{2,10}
44 */
45 class GTKMM_API CellRendererAccel : public CellRendererText
46 {
47 _CLASS_GTKOBJECT(CellRendererAccel, GtkCellRendererAccel, GTK_CELL_RENDERER_ACCEL, Gtk::CellRendererText, GtkCellRendererText, , , GTKMM_API)
48 public:
49
50 _CTOR_DEFAULT
51
52 #m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
53
54 //TODO: Wrap accel_key and accel_mods in an AccelKey?
55 _WRAP_SIGNAL(void accel_edited(const Glib::ustring& path_string, guint accel_key, Gdk::ModifierType accel_mods, guint hardware_keycode), "accel_edited")
56 _WRAP_SIGNAL(void accel_cleared(const Glib::ustring& path_string), "accel_cleared")
57
58 _WRAP_PROPERTY("accel-key", guint)
59 _WRAP_PROPERTY("accel-mods", Gdk::ModifierType)
60 _WRAP_PROPERTY("keycode", guint)
61 _WRAP_PROPERTY("accel-mode", CellRendererAccelMode)
62
63 Glib::PropertyProxy_Base _property_renderable() override;
64 };
65
66 } //namespace Gtk