From 378c946d89569afcfe61fcafcf90fa0247673da9 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sat, 27 Jul 2002 18:03:39 +0000 Subject: doxygen comments and const correct fixes --- src/Keys.cc | 8 ++++---- src/Keys.hh | 48 +++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/src/Keys.cc b/src/Keys.cc index 00d6532..128ccf4 100644 --- a/src/Keys.cc +++ b/src/Keys.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -//$Id: Keys.cc,v 1.16 2002/05/02 07:10:03 fluxgen Exp $ +//$Id: Keys.cc,v 1.17 2002/07/27 18:03:39 fluxgen Exp $ #ifdef HAVE_CONFIG_H #include "config.h" @@ -131,7 +131,7 @@ Keys::t_actionstr Keys::m_actionlist[] = { {0, LASTKEYGRAB} }; -Keys::Keys(Display *display, char *filename): +Keys::Keys(Display *display, const char *filename): m_abortkey(0), m_display(display) { @@ -175,7 +175,7 @@ void Keys::ungrabKeys() { // Returns true on success else false // TODO: error checking //------------------------------------ -bool Keys::load(char *filename) { +bool Keys::load(const char *filename) { if (!filename) return false; @@ -501,7 +501,7 @@ Keys::KeyAction Keys::getAction(XKeyEvent *ke) { // deletes the tree and load configuration // returns true on success else false //----------------------------------- -bool Keys::reconfigure(char *filename) { +bool Keys::reconfigure(const char *filename) { deleteTree(); return load(filename); } 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Keys.hh,v 1.13 2002/06/29 10:44:50 fluxgen Exp $ +// $Id: Keys.hh,v 1.14 2002/07/27 18:03:39 fluxgen Exp $ #ifndef KEYS_HH #define KEYS_HH @@ -60,13 +60,37 @@ public: LASTKEYGRAB //mark end of keygrabbs }; - Keys(Display *display, char *filename=0); + Keys(Display *display, const char *filename=0); + /// destructor ~Keys(); - bool load(char *filename=0); + /** + Load configuration from file + @return true on success, else false + */ + bool load(const char *filename=0); + /** + Determine action from XKeyEvent + @return KeyAction value + */ KeyAction getAction(XKeyEvent *ke); - bool reconfigure(char *filename); + /** + Reload configuration from filename + @return true on success, else false + */ + bool reconfigure(const char *filename); + /** + Get string value of the KeyAction enum value + @return string of action + */ const char *getActionStr(KeyAction action); - std::string getExecCommand() { return m_execcmdstring; } + /** + Get command to execute (key action EXECUTE) + @return string to command + */ + const std::string &getExecCommand() { return m_execcmdstring; } + /** + @return number of parameters + */ int getParam() const { return m_param; } private: @@ -110,17 +134,23 @@ private: std::string execcommand; int param; // parameter to comands }; - + /** + merge two linked list + @return true on success, else false + */ bool mergeTree(t_key *newtree, t_key *basetree=0); - #ifdef DEBUG - //debug functions +#ifdef DEBUG + /// debug function void showTree(); + /// debug function void showKeyTree(t_key *key, unsigned int w=0); - #endif //DEBUG +#endif //DEBUG + struct t_actionstr{ const char *string; KeyAction action; }; + static t_actionstr m_actionlist[]; std::vector m_keylist; -- cgit v0.11.2