guit  0.1
 All Classes Functions Variables Typedefs Enumerations Friends
ghotkey.hpp
1 
2 //
3 // CSS Properties
4 // Guit GUI Toolkit
5 // Copyright © 2019/2020 Eric Lecolinet. All rights reserved.
6 // http://www.telecom-paris.fr/~elc
7 //
8 #ifndef Guit_Hotkey_hpp
9 #define Guit_Hotkey_hpp
10 #include <gprop.hpp>
11 namespace guit {
12 
14 class GHotkey : public GProp {
15 public:
16  GHotkey(GString const& hotkey_code = "");
17  GHotkey* clone(bool copy_value) const override;
18 
20  static GType& Type();
21  GType& type() const override {return Type();}
22 
23  void apply(Gadget*, GRender&, Specif) override;
24  void onRemove(Gadget*) override;
25 
28  GString text_;
29  // NOTE: GKeyCode and GEventState must not exceed 32 bits.
30  union {
31  uint64_t mapcode_;
32  struct {
33  GEventState modifiers;
34  GKeyCode key;
35  } value_;
36  };
38 };
39 
40 }
41 #endif