diff options
Diffstat (limited to 'src/Keys.hh')
-rw-r--r-- | src/Keys.hh | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/src/Keys.hh b/src/Keys.hh index 7fbea6d..843f3a9 100644 --- a/src/Keys.hh +++ b/src/Keys.hh | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: Keys.hh,v 1.13 2002/06/29 10:44:50 fluxgen Exp $ | 22 | // $Id: Keys.hh,v 1.14 2002/07/27 18:03:39 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef KEYS_HH | 24 | #ifndef KEYS_HH |
25 | #define KEYS_HH | 25 | #define KEYS_HH |
@@ -60,13 +60,37 @@ public: | |||
60 | LASTKEYGRAB //mark end of keygrabbs | 60 | LASTKEYGRAB //mark end of keygrabbs |
61 | }; | 61 | }; |
62 | 62 | ||
63 | Keys(Display *display, char *filename=0); | 63 | Keys(Display *display, const char *filename=0); |
64 | /// destructor | ||
64 | ~Keys(); | 65 | ~Keys(); |
65 | bool load(char *filename=0); | 66 | /** |
67 | Load configuration from file | ||
68 | @return true on success, else false | ||
69 | */ | ||
70 | bool load(const char *filename=0); | ||
71 | /** | ||
72 | Determine action from XKeyEvent | ||
73 | @return KeyAction value | ||
74 | */ | ||
66 | KeyAction getAction(XKeyEvent *ke); | 75 | KeyAction getAction(XKeyEvent *ke); |
67 | bool reconfigure(char *filename); | 76 | /** |
77 | Reload configuration from filename | ||
78 | @return true on success, else false | ||
79 | */ | ||
80 | bool reconfigure(const char *filename); | ||
81 | /** | ||
82 | Get string value of the KeyAction enum value | ||
83 | @return string of action | ||
84 | */ | ||
68 | const char *getActionStr(KeyAction action); | 85 | const char *getActionStr(KeyAction action); |
69 | std::string getExecCommand() { return m_execcmdstring; } | 86 | /** |
87 | Get command to execute (key action EXECUTE) | ||
88 | @return string to command | ||
89 | */ | ||
90 | const std::string &getExecCommand() { return m_execcmdstring; } | ||
91 | /** | ||
92 | @return number of parameters | ||
93 | */ | ||
70 | int getParam() const { return m_param; } | 94 | int getParam() const { return m_param; } |
71 | 95 | ||
72 | private: | 96 | private: |
@@ -110,17 +134,23 @@ private: | |||
110 | std::string execcommand; | 134 | std::string execcommand; |
111 | int param; // parameter to comands | 135 | int param; // parameter to comands |
112 | }; | 136 | }; |
113 | 137 | /** | |
138 | merge two linked list | ||
139 | @return true on success, else false | ||
140 | */ | ||
114 | bool mergeTree(t_key *newtree, t_key *basetree=0); | 141 | bool mergeTree(t_key *newtree, t_key *basetree=0); |
115 | #ifdef DEBUG | 142 | #ifdef DEBUG |
116 | //debug functions | 143 | /// debug function |
117 | void showTree(); | 144 | void showTree(); |
145 | /// debug function | ||
118 | void showKeyTree(t_key *key, unsigned int w=0); | 146 | void showKeyTree(t_key *key, unsigned int w=0); |
119 | #endif //DEBUG | 147 | #endif //DEBUG |
148 | |||
120 | struct t_actionstr{ | 149 | struct t_actionstr{ |
121 | const char *string; | 150 | const char *string; |
122 | KeyAction action; | 151 | KeyAction action; |
123 | }; | 152 | }; |
153 | |||
124 | static t_actionstr m_actionlist[]; | 154 | static t_actionstr m_actionlist[]; |
125 | 155 | ||
126 | std::vector<t_key *> m_keylist; | 156 | std::vector<t_key *> m_keylist; |