all repos — fluxbox @ 378c946d89569afcfe61fcafcf90fa0247673da9

custom fork of the fluxbox windowmanager

doxygen comments and const correct fixes
fluxgen fluxgen
commit

378c946d89569afcfe61fcafcf90fa0247673da9

parent

f62529b343890795d5eb75abc745e0ea7fe6479c

2 files changed, 43 insertions(+), 13 deletions(-)

jump to
M src/Keys.ccsrc/Keys.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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 @@ {"RootMenu", ROOTMENU},

{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 @@ // Load and grab keys

// 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 @@ //--------- reconfigure -------------

// 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); }
M src/Keys.hhsrc/Keys.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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 @@ ROOTMENU, // pop up rootmenu

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 @@ std::vector<t_key *> keylist;

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<t_key *> m_keylist;