X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Factions.cc;h=afe33e3575e1ce230f29822419448a5edabc330f;hb=0ca8cd6f68ac114124923d172ec7904fb3c14e47;hp=d4beaacb7df62aa9d53ca866ae8a2330c0093e94;hpb=be77122bee3300e982ff257929ce1d1224f45803;p=chaz%2Fopenbox diff --git a/util/epist/actions.cc b/util/epist/actions.cc index d4beaacb..afe33e35 100644 --- a/util/epist/actions.cc +++ b/util/epist/actions.cc @@ -22,6 +22,30 @@ #include "actions.hh" -Action::Action(enum ActionType type, KeyCode keycode, int modifierMask): - _type(type), _keycode(keycode), _modifierMask(modifierMask) -{ } +Action::Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask, + const std::string &str) + : _type(type), _keycode(keycode), _modifierMask(modifierMask) +{ + // These are the action types that take string arguments. This + // should probably be moved to a static member + ActionType str_types[] = { + execute, + nextWindowOfClass, + prevWindowOfClass, + nextWindowOfClassOnAllWorkspaces, + prevWindowOfClassOnAllWorkspaces, + noaction + }; + + for (int i = 0; str_types[i] != noaction; ++i) { + if (type == str_types[i]) { + _stringParam = str; + return; + } + } + + _numberParam = atoi( str.c_str() ); + + if (type == changeWorkspace) // workspace 1 to the user is workspace 0 to us + _numberParam--; +}