aboutsummaryrefslogtreecommitdiff
path: root/src/Keys.hh
diff options
context:
space:
mode:
authorHenrik Kinnunen <fluxgen@fluxbox.org>2008-05-13 15:07:30 (GMT)
committerHenrik Kinnunen <fluxgen@fluxbox.org>2008-05-13 15:07:30 (GMT)
commit7f45bae4629f345906e96c1fcb3a3d1e49c36382 (patch)
treeb09708632d29ac4471c57446eb726e5401c8570f /src/Keys.hh
parent5ecebae4770cbe7e4feea46d2c074a818f1c9662 (diff)
parentd7aa526d9275f7c94f0b1ce27464eaf3dae0d78d (diff)
downloadfluxbox-7f45bae4629f345906e96c1fcb3a3d1e49c36382.zip
fluxbox-7f45bae4629f345906e96c1fcb3a3d1e49c36382.tar.bz2
Merge branch 'master' of fluxbox@git.fluxbox.org:fluxbox
Diffstat (limited to 'src/Keys.hh')
-rw-r--r--src/Keys.hh23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/Keys.hh b/src/Keys.hh
index 7ebb0a7..68ff4ec 100644
--- a/src/Keys.hh
+++ b/src/Keys.hh
@@ -23,6 +23,7 @@
23#define KEYS_HH 23#define KEYS_HH
24 24
25#include "FbTk/NotCopyable.hh" 25#include "FbTk/NotCopyable.hh"
26#include "FbTk/AutoReloadHelper.hh"
26 27
27#include <X11/Xlib.h> 28#include <X11/Xlib.h>
28#include <string> 29#include <string>
@@ -57,17 +58,6 @@ public:
57 /// destructor 58 /// destructor
58 ~Keys(); 59 ~Keys();
59 60
60 /**
61 Load configuration from file
62 @return true on success, else false
63 */
64 bool load(const char *filename = 0);
65 /**
66 Save keybindings to a file
67 Note: the file will be overwritten
68 @return true on success, else false
69 */
70 bool save(const char *filename = 0) const;
71 /// bind a key action from a string 61 /// bind a key action from a string
72 /// @return false on failure 62 /// @return false on failure
73 bool addBinding(const std::string &binding); 63 bool addBinding(const std::string &binding);
@@ -83,12 +73,12 @@ public:
83 /// unregister window 73 /// unregister window
84 void unregisterWindow(Window win); 74 void unregisterWindow(Window win);
85 75
76 const std::string& filename() const { return m_filename; }
86 /** 77 /**
87 Reload configuration from filename 78 Reload configuration from filename
88 @return true on success, else false 79 @return true on success, else false
89 */ 80 */
90 bool reconfigure(const char *filename); 81 void reconfigure();
91 const std::string& filename() const { return m_filename; }
92 void keyMode(const std::string& keyMode); 82 void keyMode(const std::string& keyMode);
93private: 83private:
94 class t_key; // helper class to build a 'keytree' 84 class t_key; // helper class to build a 'keytree'
@@ -104,13 +94,18 @@ private:
104 void ungrabButtons(); 94 void ungrabButtons();
105 void grabWindow(Window win); 95 void grabWindow(Window win);
106 96
107 // Load default keybindings for when there are errors loading the initial one 97 /**
98 Load configuration from file
99 */
100 void reload();
101 // Load default keybindings for when there are errors loading the keys file
108 void loadDefaults(); 102 void loadDefaults();
109 void setKeyMode(t_key *keyMode); 103 void setKeyMode(t_key *keyMode);
110 104
111 105
112 // member variables 106 // member variables
113 std::string m_filename; 107 std::string m_filename;
108 FbTk::AutoReloadHelper m_reloader;
114 t_key *m_keylist; 109 t_key *m_keylist;
115 keyspace_t m_map; 110 keyspace_t m_map;
116 111