wmi

git clone git://oldgit.suckless.org/wmi/
Log | Files | Refs | LICENSE

shortcut.h (895B)


      1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us>
      2 // See LICENSE for license details.
      3 
      4 #ifndef __SHORTCUT_H
      5 #define __SHORTCUT_H
      6 
      7 extern "C" {
      8 #include <X11/Xlib.h>
      9 }
     10 
     11 #include <string>
     12 #include "wmi.h"
     13 
     14 /**
     15  * Represents a shortcut. If this shortcut has a postdecessor the next
     16  * pointer may point to it.
     17  */
     18 class Shortcut {
     19 
     20 public:
     21 
     22     Shortcut(unsigned long modMask, KeyCode keyCode, Shortcut *next,
     23              unsigned int button = 0);
     24     ~Shortcut();
     25 
     26     KeyCode keyCode();
     27     void setKeyCode(KeyCode keyCode);
     28 
     29     unsigned long modMask() const;
     30     void setModMask(unsigned long modMask);
     31 
     32     unsigned int button() const;
     33 
     34     Shortcut *next() const;
     35 
     36     void setNext(Shortcut *next);
     37 
     38     static Shortcut *shortcut(string keys);
     39 
     40 private:
     41 
     42     Shortcut *next_;
     43     KeyCode keyCode_;
     44     unsigned long modMask_;
     45     unsigned int button_;
     46 };
     47 
     48 #endif // __SHORTCUT_H