#include <binder.h>
Inherits Singleton< Binder >.
Inheritance diagram for Binder:
Public Member Functions | |
Binder () | |
~Binder () | |
void | initKeys (Window window) |
void | handleKey (Window window, XKeyEvent *e) |
void | handleButton (Window window, XButtonEvent *e) |
void | grabShortcut (Shortcut *shortcut, Window window) |
void | ungrabShortcut (Shortcut *shortcut, Window window) |
void | grabButtons (Window window, unsigned long modMask) |
void | ungrabButtons (Window window) |
string | prettyPrintKeyBindings () |
string | queryActionKeysForPattern (string pattern, Sstring *actionKeys) |
string | queryActionKeysWithoutValidationForPattern (string pattern, Sstring *actionKeys) |
string | queryExternChainActionsForPattern (string pattern, Sstring *actionKeys) |
string | queryCommandForPattern (string pattern, Sstring *expands) |
string | queryWorkspacesForPattern (string pattern, Sstring *workspaces) |
string | queryMonitorsForPattern (string pattern, Sstring *monitors) |
string | queryClientsForPattern (string pattern, Sstring *clients) |
string | queryDetachedClientsForPattern (string pattern, Sstring *clients) |
string | queryClientIdsForPattern (string pattern, Sstring *clients) |
string | queryFramesForPattern (string pattern, Sstring *sFrames) |
unsigned int | validModMask () const |
Private Member Functions | |
void | handleShortcut (Window window, unsigned long modMask, KeyCode keyCode, unsigned int button) |
void | handleShortcutChains (Window window, Shortcut *prefix, LAction *grabbedActions) |
void | nextKeystroke (unsigned long *modMask, KeyCode *keyCode) |
void | emulateKeyPress (unsigned long modMask, KeyCode keyCode) |
void | initLockModifiers () |
string | absolutePattern (string pattern, Sstring *names, unsigned int offset) |
void | matchPattern (string digest, string pattern, Sstring *strings, unsigned int patternLength) |
void | initRegex (string) |
Private Attributes | |
MBindings * | actionBindings_ |
unsigned int | numLockMask_ |
unsigned int | scrollLockMask_ |
unsigned int | validModMask_ |
Definition at line 43 of file binder.h.
Binder::Binder | ( | ) |
Constructs a new grab manager instance.
Definition at line 35 of file binder.cpp.
References actionBindings_, initLockModifiers(), and KERNEL.
Here is the call graph for this function:
Binder::~Binder | ( | ) |
Definition at line 44 of file binder.cpp.
void Binder::initKeys | ( | Window | window | ) |
Key initialization for a specific window.
Definition at line 159 of file binder.cpp.
References actionBindings_, grabShortcut(), and LOGDEBUG.
Referenced by Kernel::initKeys().
Here is the call graph for this function:
void Binder::handleKey | ( | Window | window, | |
XKeyEvent * | e | |||
) |
Key event handler, window is for grabbing.
Definition at line 383 of file binder.cpp.
References handleShortcut(), and LOGDEBUG.
Referenced by Kernel::handleKeyPress().
Here is the call graph for this function:
void Binder::handleButton | ( | Window | window, | |
XButtonEvent * | e | |||
) |
Button event handler, window is for grabbing.
Definition at line 213 of file binder.cpp.
References handleShortcut(), and LOGDEBUG.
Referenced by Kernel::handleButtonPress().
Here is the call graph for this function:
void Binder::grabShortcut | ( | Shortcut * | shortcut, | |
Window | window | |||
) |
Grabs the shortcut.
Definition at line 47 of file binder.cpp.
References Shortcut::button(), Shortcut::keyCode(), Shortcut::modMask(), numLockMask_, scrollLockMask_, and XCORE.
Referenced by Kernel::grabShortcutOnAllMonitors(), and initKeys().
Here is the call graph for this function:
void Binder::ungrabShortcut | ( | Shortcut * | shortcut, | |
Window | window | |||
) |
Ungrabs shortcut.
Definition at line 104 of file binder.cpp.
References Shortcut::button(), Shortcut::keyCode(), Shortcut::modMask(), numLockMask_, scrollLockMask_, and XCORE.
Referenced by Kernel::ungrabShortcutOnAllMonitors().
Here is the call graph for this function:
void Binder::grabButtons | ( | Window | window, | |
unsigned long | modMask | |||
) |
Grabs all buttons for the modMask of the specific window.
Definition at line 389 of file binder.cpp.
References XCORE.
Referenced by Workspace::focus().
void Binder::ungrabButtons | ( | Window | window | ) |
Ungrabs all buttons for the specific window.
Definition at line 394 of file binder.cpp.
References XCORE.
Referenced by Workspace::focus().
string Binder::prettyPrintKeyBindings | ( | ) |
Returns pretty print of current key configuration.
Definition at line 172 of file binder.cpp.
References actionBindings_, Shortcut::button(), Shortcut::keyCode(), Shortcut::modMask(), Shortcut::next(), Util::stringForButton(), Util::stringForModMask(), and XCORE.
Here is the call graph for this function:
string Binder::queryActionKeysForPattern | ( | string | pattern, | |
Sstring * | actionKeys | |||
) |
Queries all actions for the given pattern. Returns absolute equal pattern of all entries.
pattern | contains the pattern. | |
set | where to put matching action keys. |
Definition at line 659 of file binder.cpp.
References absolutePattern(), actionBindings_, initRegex(), and matchPattern().
Referenced by Kernel::start().
Here is the call graph for this function:
string Binder::queryActionKeysWithoutValidationForPattern | ( | string | pattern, | |
Sstring * | actionKeys | |||
) |
Similiar to previous, except actions aren't validated.
Definition at line 643 of file binder.cpp.
References absolutePattern(), actionBindings_, initRegex(), and matchPattern().
Referenced by Actions::initInternActions().
Here is the call graph for this function:
string Binder::queryExternChainActionsForPattern | ( | string | pattern, | |
Sstring * | actionKeys | |||
) |
Similiar to previous, except that internal actions are ignored.
Definition at line 622 of file binder.cpp.
References absolutePattern(), actionBindings_, initRegex(), Action::INTERN, matchPattern(), and Action::type().
Referenced by Actions::initInternActions().
Here is the call graph for this function:
string Binder::queryCommandForPattern | ( | string | pattern, | |
Sstring * | expands | |||
) |
Queries all executables for the given pattern. Returns absolute equal pattern of all executables.
pattern | contains the pattern. | |
set | where to put matching executables. |
Definition at line 678 of file binder.cpp.
References absolutePattern(), Expander::expands(), initRegex(), Singleton< Expander >::instance(), matchPattern(), and Expander::queryString().
Referenced by Actions::initInternActions().
Here is the call graph for this function:
string Binder::queryWorkspacesForPattern | ( | string | pattern, | |
Sstring * | workspaces | |||
) |
Queries all workspace names of the focused monitor. Returns absolute equal pattern of all workspaces.
pattern | contains the pattern. | |
set | where to put matching names. |
Definition at line 605 of file binder.cpp.
References absolutePattern(), Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), initRegex(), KERNEL, and matchPattern().
Referenced by Actions::initInternActions().
Here is the call graph for this function:
string Binder::queryMonitorsForPattern | ( | string | pattern, | |
Sstring * | monitors | |||
) |
Queries all monitor names. Returns absolute equal pattern of all monitors.
pattern | contains the pattern. | |
set | where to put matching names. |
Definition at line 593 of file binder.cpp.
References absolutePattern(), Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), initRegex(), KERNEL, and matchPattern().
Referenced by Actions::initInternActions().
Here is the call graph for this function:
string Binder::queryClientsForPattern | ( | string | pattern, | |
Sstring * | clients | |||
) |
Queries all client names of the focused monitor. Returns absolute equal pattern of all clients.
pattern | contains the pattern. | |
set | where to put matching names. |
Definition at line 554 of file binder.cpp.
References absolutePattern(), Monitor::clients(), initRegex(), KERNEL, and matchPattern().
Referenced by Actions::initInternActions().
Here is the call graph for this function:
string Binder::queryDetachedClientsForPattern | ( | string | pattern, | |
Sstring * | clients | |||
) |
Queries all detached client names of the focused monitor. Returns absolute equal pattern of all clients.
pattern | contains the pattern. | |
set | where to put matching names. |
Definition at line 577 of file binder.cpp.
References absolutePattern(), Container< P, LT, LTI, T >::begin(), Monitor::detachedClients(), Container< P, LT, LTI, T >::end(), initRegex(), KERNEL, and matchPattern().
Referenced by Actions::initInternActions().
Here is the call graph for this function:
string Binder::queryClientIdsForPattern | ( | string | pattern, | |
Sstring * | clients | |||
) |
Same as above, except instead of client names, client ids.
Definition at line 531 of file binder.cpp.
References absolutePattern(), Monitor::clients(), initRegex(), KERNEL, and matchPattern().
Referenced by Actions::initInternActions().
Here is the call graph for this function:
string Binder::queryFramesForPattern | ( | string | pattern, | |
Sstring * | sFrames | |||
) |
Queries all frame names of the focused workspace. Returns absolute equal pattern of all frame ids.
pattern | contains the pattern. | |
set | where to put matching names. |
Definition at line 515 of file binder.cpp.
References absolutePattern(), Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), Workspace::frames(), initRegex(), KERNEL, and matchPattern().
Here is the call graph for this function:
unsigned int Binder::validModMask | ( | ) | const |
Definition at line 740 of file binder.cpp.
References validModMask_.
Referenced by Kernel::handleButtonPress(), Kernel::handleButtonRelease(), and Kernel::handleKeyPress().
void Binder::handleShortcut | ( | Window | window, | |
unsigned long | modMask, | |||
KeyCode | keyCode, | |||
unsigned int | button | |||
) | [private] |
Helper handler for handleKey and handleButton action.
Definition at line 219 of file binder.cpp.
References actionBindings_, handleShortcutChains(), KERNEL, and LOGDEBUG.
Referenced by handleButton(), and handleKey().
Here is the call graph for this function:
void Binder::handleShortcutChains | ( | Window | window, | |
Shortcut * | prefix, | |||
LAction * | grabbedActions | |||
) | [private] |
Own key press processing shortcut handler (for postfixed shortcuts).
Definition at line 273 of file binder.cpp.
References emulateKeyPress(), Widget::hide(), Action::id(), Box::illuminate(), KERNEL, Shortcut::keyCode(), Action::listenOn(), LOGDEBUG, Shortcut::modMask(), Shortcut::next(), nextKeystroke(), Action::perform(), Action::promptsCount(), Shortcut::setKeyCode(), Action::setListenOn(), Shortcut::setModMask(), Box::setText(), Widget::show(), Util::stringForModMask(), and XCORE.
Referenced by handleShortcut().
Here is the call graph for this function:
void Binder::nextKeystroke | ( | unsigned long * | modMask, | |
KeyCode * | keyCode | |||
) | [private] |
Helper for handleShortcutChains. Keyboard should be grabbed.
Definition at line 371 of file binder.cpp.
References validModMask_, and XCORE.
Referenced by handleShortcutChains().
void Binder::emulateKeyPress | ( | unsigned long | modMask, | |
KeyCode | keyCode | |||
) | [private] |
Emulates key press for client.
Definition at line 351 of file binder.cpp.
References Client::clientWindow(), Container< P, LT, LTI, T >::focused(), KERNEL, and XCORE.
Referenced by handleShortcutChains().
Here is the call graph for this function:
void Binder::initLockModifiers | ( | ) | [private] |
Inits lock modifier detection (NumLock and ScrollLock).
Definition at line 704 of file binder.cpp.
References NUM_MASKS, numLockMask_, scrollLockMask_, and XCORE.
Referenced by Binder().
string Binder::absolutePattern | ( | string | pattern, | |
Sstring * | names, | |||
unsigned int | offset | |||
) | [private] |
Returns absolute pattern of the given set, at least pattern.
offset | begin of comparisions within set. |
Definition at line 430 of file binder.cpp.
References LOGDEBUG.
Referenced by queryActionKeysForPattern(), queryActionKeysWithoutValidationForPattern(), queryClientIdsForPattern(), queryClientsForPattern(), queryCommandForPattern(), queryDetachedClientsForPattern(), queryExternChainActionsForPattern(), queryFramesForPattern(), queryMonitorsForPattern(), and queryWorkspacesForPattern().
void Binder::matchPattern | ( | string | digest, | |
string | pattern, | |||
Sstring * | strings, | |||
unsigned int | patternLength | |||
) | [private] |
Matches the pattern.
digest | the string to check match. | |
pattern | the pattern to match. | |
strings | the container set to insert matched strings. | |
patternLength | the pattern length. |
Definition at line 492 of file binder.cpp.
Referenced by queryActionKeysForPattern(), queryActionKeysWithoutValidationForPattern(), queryClientIdsForPattern(), queryClientsForPattern(), queryCommandForPattern(), queryDetachedClientsForPattern(), queryExternChainActionsForPattern(), queryFramesForPattern(), queryMonitorsForPattern(), and queryWorkspacesForPattern().
void Binder::initRegex | ( | string | ) | [private] |
Definition at line 509 of file binder.cpp.
References Util::get(), and KERNEL.
Referenced by queryActionKeysForPattern(), queryActionKeysWithoutValidationForPattern(), queryClientIdsForPattern(), queryClientsForPattern(), queryCommandForPattern(), queryDetachedClientsForPattern(), queryExternChainActionsForPattern(), queryFramesForPattern(), queryMonitorsForPattern(), and queryWorkspacesForPattern().
Here is the call graph for this function:
MBindings* Binder::actionBindings_ [private] |
Definition at line 226 of file binder.h.
Referenced by Binder(), handleShortcut(), initKeys(), prettyPrintKeyBindings(), queryActionKeysForPattern(), queryActionKeysWithoutValidationForPattern(), and queryExternChainActionsForPattern().
unsigned int Binder::numLockMask_ [private] |
Definition at line 228 of file binder.h.
Referenced by grabShortcut(), initLockModifiers(), and ungrabShortcut().
unsigned int Binder::scrollLockMask_ [private] |
Definition at line 229 of file binder.h.
Referenced by grabShortcut(), initLockModifiers(), and ungrabShortcut().
unsigned int Binder::validModMask_ [private] |