#include <kernel.h>
Inherits Singleton< Kernel >.
Inheritance diagram for Kernel:
Public Types | |
enum | Runlevel { START, RUN, STOP, RESTART } |
Public Member Functions | |
Kernel () | |
~Kernel () | |
MSettings * | themeSettings () |
MSettings * | commonSettings () |
MSettings * | actionSettings () |
MSettings * | sessionSettings () |
Display * | display () const |
Monitor * | focusedMonitor () const |
bool | isInputMode () |
Client * | focusedClient () |
void | killClient (Client *client) |
Window | rootWindow () |
Window | defaultRootWindow () |
Runlevel | runlevel () const |
int | start (char *argv[], Display *display, MSettings *themeSettings, MSettings *commonSettings, MSettings *actionSettings, MSettings *sessionSettings, bool isFirstRun=false) |
void | stop () |
void | restart () |
void | updateBars () |
void | saveSettings () |
MBindings * | actionBindings () const |
bool | isRootWindow (Window window) |
Bar * | barWindow (Window window) |
Box * | boxWindow (Window window) |
Menu * | menuWindow (Window window) |
Thing * | thingWindow (Window window) |
bool | isNCWMWindow (Window window) |
Client * | clientForWindow (Window window) |
void | bindShortcut (string argument) |
void | installCursor (Cursor cursor, Window window) |
void | addClient (Client *client) |
int | run () |
void | runResizeMode (Thing *thing, XButtonEvent *buttonEvent, Direction dir, bool resize=false) |
bool | isRecording () const |
LAction * | recordedActions () |
void | beginRecording () |
void | endChainRecording (string name) |
void | endScriptRecording (string name) |
void | cancelRecording () |
unsigned int | borderWidth () const |
void | cleanup () |
Prompt * | defaultPrompt () const |
void | setMenuMode (bool isMenuMode) |
void | toggleSloppyMode () |
bool | isStackedTabbing () const |
void | toggleShortcuts () |
CMonitor * | monitors () const |
void | selectMonitor (string displayString) |
void | grabMove () |
Private Member Functions | |
void | handleButtonPress (XButtonEvent *event) |
void | handleButtonRelease (XButtonEvent *event) |
void | handleConfigureRequest (XConfigureRequestEvent *event) |
void | handleClientMessage (XClientMessageEvent *event) |
void | handleCreateNotify (XCreateWindowEvent *event) |
void | handleDestroyNotify (XDestroyWindowEvent *event) |
void | handleExpose (XExposeEvent *event) |
void | handleKeyPress (XKeyEvent *event) |
void | handleMapRequest (XMapRequestEvent *event) |
void | handleMotionNotify (XMotionEvent *event) |
void | handlePropertyNotify (XPropertyEvent *event) |
void | handleUnmapNotify (XUnmapEvent *event) |
void | initAtoms () |
void | initMonitors () |
void | initWindows () |
void | initActionBindings () |
void | initKeys () |
void | grabShortcutOnAllMonitors (Shortcut *shortcut) |
void | ungrabShortcutOnAllMonitors (Shortcut *shortcut) |
void | serialize () |
Private Attributes | |
bool | isSloppyMode_ |
bool | isRecording_ |
LAction | recordedActions_ |
Display * | display_ |
CMonitor * | monitors_ |
unsigned int | borderWidth_ |
bool | isMenuMode_ |
bool | isStackedTabbing_ |
MSettings * | themeSettings_ |
MSettings * | commonSettings_ |
MSettings * | actionSettings_ |
MSettings * | sessionSettings_ |
MBindings * | actionBindings_ |
Runlevel | runlevel_ |
Prompt * | defaultPrompt_ |
Definition at line 51 of file kernel.h.
enum Kernel::Runlevel |
Kernel::Kernel | ( | ) |
Constructs a new window manager instance.
Definition at line 49 of file kernel.cpp.
Kernel::~Kernel | ( | ) |
Definition at line 142 of file kernel.cpp.
MSettings * Kernel::themeSettings | ( | ) |
MSettings * Kernel::commonSettings | ( | ) |
MSettings * Kernel::actionSettings | ( | ) |
MSettings * Kernel::sessionSettings | ( | ) |
Display * Kernel::display | ( | ) | const |
Returns the display.
Definition at line 1206 of file kernel.cpp.
References display_.
Referenced by XCore::handleErrors().
Monitor * Kernel::focusedMonitor | ( | ) | const |
Returns the currently focused monitor.
Definition at line 1210 of file kernel.cpp.
References Container< P, LT, LTI, T >::focused(), and monitors_.
Referenced by addClient(), Launcher::exec(), focusedClient(), handleKeyPress(), handleMapRequest(), handleMotionNotify(), handlePropertyNotify(), isInputMode(), and rootWindow().
Here is the call graph for this function:
bool Kernel::isInputMode | ( | ) |
Returns wether input mode is active.
Definition at line 444 of file kernel.cpp.
References focusedMonitor(), Monitor::inputBar(), and Widget::isVisible().
Referenced by handleKeyPress().
Here is the call graph for this function:
Client * Kernel::focusedClient | ( | ) |
Returns focused client.
Definition at line 157 of file kernel.cpp.
References Container< P, LT, LTI, T >::focused(), focusedMonitor(), and Workspace::topClient().
Referenced by grabMove().
Here is the call graph for this function:
void Kernel::killClient | ( | Client * | client | ) |
Definition at line 166 of file kernel.cpp.
References Client::clientWindow(), Client::protocols(), and XCORE.
Here is the call graph for this function:
Window Kernel::rootWindow | ( | ) |
Returns the root window.
Definition at line 153 of file kernel.cpp.
References focusedMonitor(), and Monitor::rootWindow().
Referenced by runResizeMode().
Here is the call graph for this function:
Window Kernel::defaultRootWindow | ( | ) |
Returns the default root window (of deafault monitor).
Definition at line 149 of file kernel.cpp.
References display_.
Referenced by XCore::handleErrors(), and handlePropertyNotify().
Kernel::Runlevel Kernel::runlevel | ( | ) | const |
Definition at line 1214 of file kernel.cpp.
References runlevel_.
Referenced by XCore::handleErrors().
int Kernel::start | ( | char * | argv[], | |
Display * | display, | |||
MSettings * | themeSettings, | |||
MSettings * | commonSettings, | |||
MSettings * | actionSettings, | |||
MSettings * | sessionSettings, | |||
bool | isFirstRun = false | |||
) |
Start method.
Definition at line 62 of file kernel.cpp.
References actionBindings_, actionSettings_, borderWidth_, cleanup(), commonSettings_, defaultPrompt_, display_, Launcher::exec(), Actions::executeTerm(), Util::get(), XCore::handleErrors(), initActionBindings(), Atoms::initAtoms(), Cursors::initCursors(), Actions::initInternActions(), initKeys(), initMonitors(), initWindows(), Singleton< Expander >::instance(), Singleton< Launcher >::instance(), Singleton< Actions >::instance(), Validators::isAlwaysPossible(), isMenuMode_, isRecording_, isSloppyMode_, isStackedTabbing_, LOGDEBUG, LOGERROR, monitors_, Action::perform(), Binder::queryActionKeysForPattern(), RESTART, run(), RUN, runlevel_, saveSettings(), Action::SEQUENCE, Actions::sequence(), serialize(), sessionSettings_, START, Util::strToUInt(), themeSettings_, and XCORE.
Referenced by main().
Here is the call graph for this function:
void Kernel::stop | ( | ) |
void Kernel::restart | ( | ) |
void Kernel::updateBars | ( | ) |
Updates all bars.
Definition at line 172 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), and monitors_.
Referenced by handleKeyPress().
Here is the call graph for this function:
void Kernel::saveSettings | ( | ) |
Saves session settings.
Definition at line 582 of file kernel.cpp.
References actionSettings_, Loader::saveSettings(), and sessionSettings_.
Referenced by main(), and start().
Here is the call graph for this function:
MBindings * Kernel::actionBindings | ( | ) | const |
bool Kernel::isRootWindow | ( | Window | window | ) |
Returns true
if window is a root window.
Definition at line 334 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), Container< P, LT, LTI, T >::focus(), and monitors_.
Referenced by handleMotionNotify(), handlePropertyNotify(), and isNCWMWindow().
Here is the call graph for this function:
Bar * Kernel::barWindow | ( | Window | window | ) |
Returns bar if window is a barwindow.
Definition at line 413 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), Container< P, LT, LTI, T >::focus(), and monitors_.
Referenced by handleButtonPress(), handleButtonRelease(), handleExpose(), handleMotionNotify(), and isNCWMWindow().
Here is the call graph for this function:
Box * Kernel::boxWindow | ( | Window | window | ) |
Returns box if window is a boxwindow.
Definition at line 399 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), monitors_, and Widget::window().
Referenced by isNCWMWindow().
Here is the call graph for this function:
Menu * Kernel::menuWindow | ( | Window | window | ) |
Returns menu if window is a menu window.
Definition at line 349 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), Container< P, LT, LTI, T >::focus(), and monitors_.
Referenced by handleButtonPress(), handleMotionNotify(), and isNCWMWindow().
Here is the call graph for this function:
Thing * Kernel::thingWindow | ( | Window | window | ) |
Returns frame if window is a frame window.
Definition at line 383 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), Container< P, LT, LTI, T >::focus(), and monitors_.
Referenced by handleButtonPress(), handleButtonRelease(), handleExpose(), handleMotionNotify(), and isNCWMWindow().
Here is the call graph for this function:
bool Kernel::isNCWMWindow | ( | Window | window | ) |
Returns true
if window is a NCWM window.
Definition at line 322 of file kernel.cpp.
References barWindow(), boxWindow(), isRootWindow(), menuWindow(), and thingWindow().
Referenced by handleMapRequest().
Here is the call graph for this function:
Client * Kernel::clientForWindow | ( | Window | window | ) |
Returns client for this window.
Definition at line 429 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), Container< P, LT, LTI, T >::focus(), and monitors_.
Referenced by handleButtonPress(), handleClientMessage(), handleConfigureRequest(), handleDestroyNotify(), handleMapRequest(), handlePropertyNotify(), and handleUnmapNotify().
Here is the call graph for this function:
void Kernel::bindShortcut | ( | string | argument | ) |
Binds the shortcut for the given <action id>="">=<key> pair.
Definition at line 496 of file kernel.cpp.
References actionBindings_, actionSettings_, Shortcut::button(), Action::EXTERN, Util::get(), grabShortcutOnAllMonitors(), Action::INTERN, Shortcut::keyCode(), Action::listenOn(), Shortcut::modMask(), Util::remove(), Action::SEQUENCE, Action::setShortcut(), Shortcut::shortcut(), Action::shortcut(), Action::type(), ungrabShortcutOnAllMonitors(), and Action::UNKNOWN.
Here is the call graph for this function:
void Kernel::installCursor | ( | Cursor | cursor, | |
Window | window | |||
) |
void Kernel::addClient | ( | Client * | client | ) |
Adds client.
Definition at line 577 of file kernel.cpp.
References Monitor::addClient(), and focusedMonitor().
Here is the call graph for this function:
int Kernel::run | ( | ) |
Main event loop.
Definition at line 898 of file kernel.cpp.
References handleButtonPress(), handleButtonRelease(), handleClientMessage(), handleConfigureRequest(), handleDestroyNotify(), handleExpose(), handleKeyPress(), handleMapRequest(), handleMotionNotify(), handlePropertyNotify(), handleUnmapNotify(), LOGDEBUG, RUN, runlevel_, and XCORE.
Referenced by start().
Here is the call graph for this function:
void Kernel::runResizeMode | ( | Thing * | thing, | |
XButtonEvent * | buttonEvent, | |||
Direction | dir, | |||
bool | resize = false | |||
) |
Resize event loop.
Definition at line 957 of file kernel.cpp.
References Thing::CLIENT, DOWN, Thing::FRAME, Rectangle::height(), Monitor::illuminateTransRect(), LEFT, Thing::monitor(), Float::move(), Float::resize(), Split::resize(), RIGHT, Workspace::root(), Monitor::rootWindow(), rootWindow(), Rectangle::setHeight(), Rectangle::setWidth(), Rectangle::setX(), Rectangle::setY(), Thing::type(), UP, Rectangle::width(), Thing::window(), Rectangle::x(), XCORE, and Rectangle::y().
Referenced by grabMove(), and Frame::handleButtonPress().
Here is the call graph for this function:
bool Kernel::isRecording | ( | ) | const |
LAction * Kernel::recordedActions | ( | ) |
void Kernel::beginRecording | ( | ) |
void Kernel::endChainRecording | ( | string | name | ) |
Definition at line 1099 of file kernel.cpp.
References Action::getIsValid(), Validators::isAlwaysPossible(), isRecording_, recordedActions_, Action::SEQUENCE, and Actions::sequence().
Here is the call graph for this function:
void Kernel::endScriptRecording | ( | string | name | ) |
Definition at line 1158 of file kernel.cpp.
References isRecording_, recordedActions_, and Loader::saveFile().
Here is the call graph for this function:
void Kernel::cancelRecording | ( | ) |
unsigned int Kernel::borderWidth | ( | ) | const |
void Kernel::cleanup | ( | ) |
Definition at line 594 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Cursors::cleanup(), display_, Container< P, LT, LTI, T >::end(), monitors_, and XCORE.
Referenced by start().
Here is the call graph for this function:
Prompt * Kernel::defaultPrompt | ( | ) | const |
void Kernel::setMenuMode | ( | bool | isMenuMode | ) |
void Kernel::toggleSloppyMode | ( | ) |
bool Kernel::isStackedTabbing | ( | ) | const |
void Kernel::toggleShortcuts | ( | ) |
Definition at line 472 of file kernel.cpp.
References actionBindings_, grabShortcutOnAllMonitors(), Actions::inputMode(), Actions::toggleShortcuts(), and ungrabShortcutOnAllMonitors().
Here is the call graph for this function:
CMonitor * Kernel::monitors | ( | ) | const |
void Kernel::selectMonitor | ( | string | displayString | ) |
Definition at line 1259 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), Workspace::focus(), Container< P, LT, LTI, T >::focus(), Container< P, LT, LTI, T >::focused(), monitors_, Workspace::topClient(), and XCORE.
Here is the call graph for this function:
void Kernel::grabMove | ( | ) |
Enters runResizeMode for moving focussed clients with a faked XButtonEvent.
Definition at line 1279 of file kernel.cpp.
References focusedClient(), Client::frame(), Rectangle::height(), LEFT, runResizeMode(), Rectangle::width(), Client::window(), and XCORE.
Here is the call graph for this function:
void Kernel::handleButtonPress | ( | XButtonEvent * | event | ) | [private] |
event handler.
Definition at line 627 of file kernel.cpp.
References barWindow(), clientForWindow(), Binder::handleButton(), Client::handleButtonPress(), Thing::handleButtonPress(), Bar::handleButtonPress(), Menu::handleButtonPress(), Singleton< Binder >::instance(), menuWindow(), thingWindow(), and Binder::validModMask().
Referenced by run().
Here is the call graph for this function:
void Kernel::handleButtonRelease | ( | XButtonEvent * | event | ) | [private] |
Definition at line 611 of file kernel.cpp.
References barWindow(), Thing::handleButtonRelease(), Bar::handleButtonRelease(), Singleton< Binder >::instance(), thingWindow(), and Binder::validModMask().
Referenced by run().
Here is the call graph for this function:
void Kernel::handleConfigureRequest | ( | XConfigureRequestEvent * | event | ) | [private] |
Definition at line 669 of file kernel.cpp.
References clientForWindow(), Client::handleConfigureRequest(), and XCORE.
Referenced by run().
Here is the call graph for this function:
void Kernel::handleClientMessage | ( | XClientMessageEvent * | event | ) | [private] |
Definition at line 883 of file kernel.cpp.
References clientForWindow(), Monitor::detachClient(), LOGDEBUG, Thing::monitor(), and Atoms::WM_CHANGE_STATE.
Referenced by run().
Here is the call graph for this function:
void Kernel::handleCreateNotify | ( | XCreateWindowEvent * | event | ) | [private] |
void Kernel::handleDestroyNotify | ( | XDestroyWindowEvent * | event | ) | [private] |
Definition at line 693 of file kernel.cpp.
References clientForWindow(), Client::clientWindow(), Thing::monitor(), Monitor::removeClient(), and Client::setDestroyed().
Referenced by run().
Here is the call graph for this function:
void Kernel::handleExpose | ( | XExposeEvent * | event | ) | [private] |
Definition at line 706 of file kernel.cpp.
References barWindow(), Thing::illuminate(), Bar::illuminate(), and thingWindow().
Referenced by run().
Here is the call graph for this function:
void Kernel::handleKeyPress | ( | XKeyEvent * | event | ) | [private] |
Definition at line 728 of file kernel.cpp.
References focusedMonitor(), InputBar::handleInput(), Binder::handleKey(), Monitor::inputBar(), Singleton< Binder >::instance(), isInputMode(), updateBars(), and Binder::validModMask().
Referenced by run().
Here is the call graph for this function:
void Kernel::handleMapRequest | ( | XMapRequestEvent * | event | ) | [private] |
Definition at line 741 of file kernel.cpp.
References Monitor::addClient(), Monitor::attachClient(), Client::attached(), clientForWindow(), focusedMonitor(), Rectangle::height(), isNCWMWindow(), LOGDEBUG, Workspace::setRequestsFocus(), Client::setRequestsFocus(), Rectangle::width(), Rectangle::x(), XCORE, and Rectangle::y().
Referenced by run().
Here is the call graph for this function:
void Kernel::handleMotionNotify | ( | XMotionEvent * | event | ) | [private] |
Definition at line 778 of file kernel.cpp.
References barWindow(), Container< P, LT, LTI, T >::focused(), focusedMonitor(), Thing::handleMotionNotify(), Bar::handleMotionNotify(), Menu::handleMotionNotify(), Thing::isFocused(), isRootWindow(), isSloppyMode_, menuWindow(), and thingWindow().
Referenced by run().
Here is the call graph for this function:
void Kernel::handlePropertyNotify | ( | XPropertyEvent * | event | ) | [private] |
Definition at line 804 of file kernel.cpp.
References actionBindings_, clientForWindow(), defaultRootWindow(), display_, focusedMonitor(), Util::get(), Client::handlePropertyNotify(), Monitor::inputBar(), Singleton< Binder >::instance(), isRootWindow(), LOGDEBUG, Atoms::NCWM_ACTIONCMD, Atoms::NCWM_METERTEXT, Atoms::NCWM_PRETTYPRINT_REQUEST, Atoms::NCWM_PRETTYPRINT_RESPONSE, Atoms::NCWM_STATUSTEXT, InputBar::runArgument(), Action::setArgument(), Monitor::updateBars(), and XCORE.
Referenced by run().
Here is the call graph for this function:
void Kernel::handleUnmapNotify | ( | XUnmapEvent * | event | ) | [private] |
Definition at line 873 of file kernel.cpp.
References clientForWindow(), Client::handleUnmapNotify(), and LOGDEBUG.
Referenced by run().
Here is the call graph for this function:
void Kernel::initAtoms | ( | ) | [private] |
Atom initialization.
void Kernel::initMonitors | ( | ) | [private] |
Inits all monitors.
Definition at line 52 of file kernel.cpp.
References Container< P, LT, LTI, T >::attach(), display_, and monitors_.
Referenced by start().
Here is the call graph for this function:
void Kernel::initWindows | ( | ) | [private] |
Inits all existing windows.
Definition at line 183 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), and monitors_.
Referenced by start().
Here is the call graph for this function:
void Kernel::initActionBindings | ( | ) | [private] |
Inits the bind map for all actions.
Definition at line 206 of file kernel.cpp.
References actionBindings_, actionSettings_, Actions::execute(), Action::EXTERN, Util::get(), Action::getIsValid(), Action::INTERN, Validators::isAlwaysPossible(), Validators::isWorkspaceFocused(), LOGDEBUG, Util::nthToken(), Actions::sequence(), Action::SEQUENCE, Action::setShortcut(), Shortcut::shortcut(), and Action::UNKNOWN.
Referenced by start().
Here is the call graph for this function:
void Kernel::initKeys | ( | ) | [private] |
Inits keys on all monitors.
Definition at line 193 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), Binder::initKeys(), Singleton< Binder >::instance(), monitors_, and XCORE.
Referenced by start().
Here is the call graph for this function:
void Kernel::grabShortcutOnAllMonitors | ( | Shortcut * | shortcut | ) | [private] |
Grabs shortcut on all monitors.
Definition at line 460 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), Binder::grabShortcut(), Singleton< Binder >::instance(), and monitors_.
Referenced by bindShortcut(), and toggleShortcuts().
Here is the call graph for this function:
void Kernel::ungrabShortcutOnAllMonitors | ( | Shortcut * | shortcut | ) | [private] |
Ungrabs shortcut on all monitors.
Definition at line 448 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), Singleton< Binder >::instance(), monitors_, and Binder::ungrabShortcut().
Referenced by bindShortcut(), and toggleShortcuts().
Here is the call graph for this function:
void Kernel::serialize | ( | ) | [private] |
Serializes and updates all settings.
Definition at line 560 of file kernel.cpp.
References Container< P, LT, LTI, T >::begin(), Container< P, LT, LTI, T >::end(), and monitors_.
Referenced by start().
Here is the call graph for this function:
bool Kernel::isSloppyMode_ [private] |
Definition at line 229 of file kernel.h.
Referenced by handleMotionNotify(), start(), and toggleSloppyMode().
bool Kernel::isRecording_ [private] |
Definition at line 230 of file kernel.h.
Referenced by beginRecording(), cancelRecording(), endChainRecording(), endScriptRecording(), isRecording(), and start().
LAction Kernel::recordedActions_ [private] |
Definition at line 231 of file kernel.h.
Referenced by beginRecording(), cancelRecording(), endChainRecording(), endScriptRecording(), and recordedActions().
Display* Kernel::display_ [private] |
Definition at line 232 of file kernel.h.
Referenced by cleanup(), defaultRootWindow(), display(), handlePropertyNotify(), initMonitors(), and start().
CMonitor* Kernel::monitors_ [private] |
Definition at line 233 of file kernel.h.
Referenced by barWindow(), boxWindow(), cleanup(), clientForWindow(), focusedMonitor(), grabShortcutOnAllMonitors(), initKeys(), initMonitors(), initWindows(), isRootWindow(), menuWindow(), monitors(), selectMonitor(), serialize(), start(), thingWindow(), ungrabShortcutOnAllMonitors(), and updateBars().
unsigned int Kernel::borderWidth_ [private] |
bool Kernel::isMenuMode_ [private] |
bool Kernel::isStackedTabbing_ [private] |
MSettings* Kernel::themeSettings_ [private] |
MSettings* Kernel::commonSettings_ [private] |
MSettings* Kernel::actionSettings_ [private] |
Definition at line 242 of file kernel.h.
Referenced by actionSettings(), bindShortcut(), initActionBindings(), saveSettings(), and start().
MSettings* Kernel::sessionSettings_ [private] |
Definition at line 243 of file kernel.h.
Referenced by saveSettings(), sessionSettings(), and start().
MBindings* Kernel::actionBindings_ [private] |
Definition at line 246 of file kernel.h.
Referenced by actionBindings(), bindShortcut(), handlePropertyNotify(), initActionBindings(), start(), and toggleShortcuts().
Runlevel Kernel::runlevel_ [private] |
Prompt* Kernel::defaultPrompt_ [private] |