]> Dogcows Code - chaz/openbox/commitdiff
add execute command. add string to action class.
authorDana Jansens <danakj@orodu.net>
Sat, 20 Jul 2002 16:26:37 +0000 (16:26 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 20 Jul 2002 16:26:37 +0000 (16:26 +0000)
util/epist/actions.cc
util/epist/actions.hh
util/epist/epist.cc
util/epist/screen.cc

index 493d02154ac5c685588fe7bb7fca7cf2b11e6cc8..35ddbb80976c8a962d35ea11ac233cbbc6a48c6a 100644 (file)
 #include "actions.hh"
 
 Action::Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
-               int num): _type(type), _keycode(keycode),
-                         _modifierMask(modifierMask), _numberParam(num)
+               int num)
+  : _type(type), _keycode(keycode),
+    _modifierMask(modifierMask), _numberParam(num)
+{ }
+
+Action::Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
+               const std::string &str)
+  : _type(type), _keycode(keycode),
+    _modifierMask(modifierMask), _stringParam(str)
 { }
index 6ae4e7ff264d9c5e49b30996495c172edb050c38..81b3920c9a6011509ddd8d47ed249e90d7569a75 100644 (file)
@@ -28,6 +28,7 @@ extern "C" {
 }
 
 #include <list>
+#include <string>
 
 class Action {
 public:
@@ -81,14 +82,18 @@ private:
   const unsigned int _modifierMask;
 
   const int _numberParam;
+  const std::string _stringParam;
 public:
   inline enum ActionType type() const { return _type;}
   inline const KeyCode keycode() const { return _keycode; }
   inline const unsigned int modifierMask() const { return _modifierMask; }
   inline const int number() const { return _numberParam; }
+  inline const std::string &string() const { return _stringParam; }
 
   Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
          int number = 0);
+  Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
+         const std::string &str);
 };
   
 typedef std::list<Action> ActionList;
index b9dac6a842d6cc7c6aa17bdeddd2bb993d72931d..1a4b4c24370f46684adfeb8075b45c8923ddfcc7 100644 (file)
@@ -159,7 +159,7 @@ epist::epist(char **argv, char *dpy_name, char *rc_file)
   _actions.push_back(Action(Action::execute,
                            XKeysymToKeycode(getXDisplay(),
                                              XStringToKeysym("F6")),
-                           Mod1Mask));
+                           Mod1Mask, "aterm"));
   activateGrabs();
 }
 
index 98ad67f276dce330ee51925e31571494fa5e8fb8..ce068122107ef624e6c7221c939e7bca7ede5f6f 100644 (file)
@@ -202,7 +202,7 @@ void screen::handleKeypress(const XEvent &e) {
         return;
 
       case Action::execute:
-        execCommand("aterm");
+        execCommand(it->string());
         return;
       }
 
This page took 0.028373 seconds and 4 git commands to generate.