wmi

git clone git://oldgit.suckless.org/wmi/
Log | Files | Refs | LICENSE

actions.h (6937B)


      1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us>
      2 // See LICENSE for license details.
      3 
      4 #ifndef __ACTIONS_H
      5 #define __ACTIONS_H
      6 
      7 #include "singleton.h"
      8 
      9 #include <map>
     10 #include "wmi.h"
     11 
     12 class Action;
     13 
     14 class Bindings;
     15 class Kernel;
     16 class Monitor;
     17 
     18 typedef map<string, Action *, less<string> > MBindings;
     19 
     20 /**
     21  * Actions singleton class which delegates end-user interface to the
     22  * appropriate business logic of WMI.
     23  */
     24 class Actions : public Singleton<Actions>
     25 {
     26 
     27 public:
     28     Actions();
     29     ~Actions();
     30 
     31     void initInternActions(MBindings *actionBindings);
     32 
     33     // new macro record stuff
     34     void beginChainRecord(Action *caller, const char *argument);
     35     void endChainRecord(Action *caller, const char *argument);
     36     void endScriptRecord(Action *caller, const char *argument);
     37     void cancelRecord(Action *caller, const char *argument);
     38 
     39     // intern actions
     40     void quit(Action *caller, const char *argument);
     41     void restart(Action *caller, const char *argument);
     42 
     43     void rehash(Action *caller, const char *argument);
     44 
     45     void circulateWindowsUp(Action *caller, const char *argument);
     46 
     47     void toggleClientMode(Action *caller, const char *argument);
     48     void toggleClientSticky(Action *caller, const char *argument);
     49     void executeTerm(Action *caller, const char *command);
     50 
     51     void growLeft(Action *caller, const char *argument);
     52     void growRight(Action *caller, const char *argument);
     53     void growUp(Action *caller, const char *argument);
     54     void growDown(Action *caller, const char *argument);
     55 
     56     void shrinkLeft(Action *caller, const char *argument);
     57     void shrinkRight(Action *caller, const char *argument);
     58     void shrinkUp(Action *caller, const char *argument);
     59     void shrinkDown(Action *caller, const char *argument);
     60 
     61     void moveClientLeft(Action *caller, const char *argument);
     62     void moveClientRight(Action *caller, const char *argument);
     63     void moveClientUp(Action *caller, const char *argument);
     64     void moveClientDown(Action *caller, const char *argument);
     65 
     66     void showBars(Action *caller, const char *argument);
     67     void hideBars(Action *caller, const char *argument);
     68     void toggleBar(Action *caller, const char *argument);
     69     void toggleBorder(Action *caller, const char *argument);
     70     void showBorders(Action *caller, const char *argument);
     71     void hideBorders(Action *caller, const char *argument);
     72     void toggleStatusBar(Action *caller, const char *argument);
     73     void toggleClientBar(Action *caller, const char *argument);
     74     void inputMode(Action *caller, const char *argument);
     75     void toggleMode(Action *caller, const char *argument);
     76 
     77     void killClient(Action *caller, const char *argument);
     78 
     79     void cycleClientNext(Action *caller, const char *argument);
     80     void cycleWorkspaceNext(Action *caller, const char *argument);
     81     void cycleClientPrev(Action *caller, const char *argument);
     82     void cycleWorkspacePrev(Action *caller, const char *argument);
     83 
     84     void joinFrameLeft(Action *caller, const char *argument);
     85     void joinFrameRight(Action *caller, const char *argument);
     86     void joinFrameUp(Action *caller, const char *argument);
     87     void joinFrameDown(Action *caller, const char *argument);
     88 
     89     void sendClientLeft(Action *caller, const char *argument);
     90     void sendClientRight(Action *caller, const char *argument);
     91     void sendClientUp(Action *caller, const char *argument);
     92     void sendClientDown(Action *caller, const char *argument);
     93 
     94     void splitFrameLeft(Action *caller, const char *argument);
     95     void splitFrameRight(Action *caller, const char *argument);
     96     void splitFrameUp(Action *caller, const char *argument);
     97     void splitFrameDown(Action *caller, const char *argument);
     98 
     99     void attachClient(Action *caller, const char *argument);
    100     void attachLastClient(Action *caller, const char *argument);
    101     void detachClient(Action *caller, const char *argument);
    102     void detachAllClients(Action *caller, const char *argument);
    103     void attachAllClients(Action *caller, const char *argument);
    104 
    105     void createAction(Action *caller, const char *argument);
    106     void createWorkspace(Action *caller, const char *argument);
    107 
    108     void destroyAction(Action *caller, const char *argument);
    109     void destroyFrame(Action *caller, const char *argument);
    110     void destroyWorkspace(Action *caller, const char *argument);
    111 
    112     void bindShortcut(Action *caller, const char *argument);
    113 
    114     void renameWorkspace(Action *caller, const char *argument);
    115     void selectWorkspace(Action *caller, const char *argument);
    116     void selectMonitor(Action *caller, const char *argument);
    117     void selectClient(Action *caller, const char *argument);
    118     void selectClientId(Action *caller, const char *argument);
    119 
    120     void selectFrameLeft(Action *caller, const char *argument);
    121     void selectFrameRight(Action *caller, const char *argument);
    122     void selectFrameUp(Action *caller, const char *argument);
    123     void selectFrameDown(Action *caller, const char *argument);
    124 
    125     void swapFrameLeft(Action *caller, const char *argument);
    126     void swapFrameRight(Action *caller, const char *argument);
    127     void swapFrameUp(Action *caller, const char *argument);
    128     void swapFrameDown(Action *caller, const char *argument);
    129 
    130     void swapClientLeft(Action *caller, const char *argument);
    131     void swapClientRight(Action *caller, const char *argument);
    132     void swapClientUp(Action *caller, const char *argument);
    133     void swapClientDown(Action *caller, const char *argument);
    134 
    135 #ifdef SLOT_SUPPORT
    136     void unslotClient(Action *caller, const char *argument);
    137     void slotClient(Action *caller, const char *argument);
    138     void toggleSlot(Action *caller, const char *argument);
    139     void cycleSlotTabPrev(Action *caller, const char *argument);
    140     void cycleSlotTabNext(Action *caller, const char *argument);
    141     void killSlotClient(Action *caller, const char *argument);
    142 #endif // SLOT_SUPPORT
    143 
    144     void toggleMaximization(Action *caller, const char *argument);
    145     void toggleShortcuts(Action *caller, const char *argument);
    146 
    147     void lower(Action *caller, const char *argument);
    148     void raise(Action *caller, const char *argument);
    149     void saveSettings(Action *caller, const char *argument);
    150 
    151     // extern actions only use execute
    152     void execute(Action *caller, const char *command);
    153 
    154     // map sequences only use sequences
    155     void sequence(Action *caller, const char *command);
    156 
    157     void hookClient(Action *caller, const char *argument);
    158     void unhookClient(Action *caller, const char *argument);
    159     void fitClient(Action *caller, const char *argument);
    160     void banish(Action *caller, const char *argument);
    161     void toggleClientBarMode(Action *caller, const char *argument);
    162     void toggleSloppyMode(Action *caller, const char *argument);
    163     void grabMove(Action *caller, const char *argument);
    164     void toggleTiled(Action *caller, const char *argument);
    165     void zoomClient(Action *caller, const char *argument);
    166 };
    167 
    168 #endif // __ACTIONS_H