X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Factions.cc;h=e37ff2470602338e445b40ed65d9dac5510e61cc;hb=6ca5c5891a58c616b32b733c99fe373aa58bc360;hp=d4beaacb7df62aa9d53ca866ae8a2330c0093e94;hpb=be77122bee3300e982ff257929ce1d1224f45803;p=chaz%2Fopenbox diff --git a/util/epist/actions.cc b/util/epist/actions.cc index d4beaacb..e37ff247 100644 --- a/util/epist/actions.cc +++ b/util/epist/actions.cc @@ -1,5 +1,5 @@ // -*- mode: C++; indent-tabs-mode: nil; -*- -// actions.cc for Epistophy - a key handler for NETWM/EWMH window managers. +// actions.cc for Epistrophy - a key handler for NETWM/EWMH window managers. // Copyright (c) 2002 - 2002 Ben Jansens // // Permission is hereby granted, free of charge, to any person obtaining a @@ -22,6 +22,31 @@ #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() ); + + // workspace 1 to the user is workspace 0 to us + if (type == changeWorkspace || type == sendToWorkspace) + _numberParam--; +}