doxygen comments and const correct fixes

This commit is contained in:
fluxgen 2002-07-27 18:03:39 +00:00
parent f62529b343
commit 378c946d89
2 changed files with 43 additions and 13 deletions

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // 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 #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
@ -131,7 +131,7 @@ Keys::t_actionstr Keys::m_actionlist[] = {
{0, LASTKEYGRAB} {0, LASTKEYGRAB}
}; };
Keys::Keys(Display *display, char *filename): Keys::Keys(Display *display, const char *filename):
m_abortkey(0), m_abortkey(0),
m_display(display) m_display(display)
{ {
@ -175,7 +175,7 @@ void Keys::ungrabKeys() {
// Returns true on success else false // Returns true on success else false
// TODO: error checking // TODO: error checking
//------------------------------------ //------------------------------------
bool Keys::load(char *filename) { bool Keys::load(const char *filename) {
if (!filename) if (!filename)
return false; return false;
@ -501,7 +501,7 @@ Keys::KeyAction Keys::getAction(XKeyEvent *ke) {
// deletes the tree and load configuration // deletes the tree and load configuration
// returns true on success else false // returns true on success else false
//----------------------------------- //-----------------------------------
bool Keys::reconfigure(char *filename) { bool Keys::reconfigure(const char *filename) {
deleteTree(); deleteTree();
return load(filename); return load(filename);
} }

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // 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 #ifndef KEYS_HH
#define KEYS_HH #define KEYS_HH
@ -60,13 +60,37 @@ public:
LASTKEYGRAB //mark end of keygrabbs LASTKEYGRAB //mark end of keygrabbs
}; };
Keys(Display *display, char *filename=0); Keys(Display *display, const char *filename=0);
/// destructor
~Keys(); ~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); 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); 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; } int getParam() const { return m_param; }
private: private:
@ -110,17 +134,23 @@ private:
std::string execcommand; std::string execcommand;
int param; // parameter to comands int param; // parameter to comands
}; };
/**
merge two linked list
@return true on success, else false
*/
bool mergeTree(t_key *newtree, t_key *basetree=0); bool mergeTree(t_key *newtree, t_key *basetree=0);
#ifdef DEBUG #ifdef DEBUG
//debug functions /// debug function
void showTree(); void showTree();
/// debug function
void showKeyTree(t_key *key, unsigned int w=0); void showKeyTree(t_key *key, unsigned int w=0);
#endif //DEBUG #endif //DEBUG
struct t_actionstr{ struct t_actionstr{
const char *string; const char *string;
KeyAction action; KeyAction action;
}; };
static t_actionstr m_actionlist[]; static t_actionstr m_actionlist[];
std::vector<t_key *> m_keylist; std::vector<t_key *> m_keylist;