#include <xcore.h>
Inherits Singleton< XCore >.
Inheritance diagram for XCore:
Public Member Functions | |
XCore () | |
~XCore () | |
void | setDisplay (Display *display) |
Window | createWindow (Window root, XSetWindowAttributes *attr, int x, int y, unsigned int w, unsigned int h, unsigned long mask) |
void | selectEvents (Window window, long mask) |
void | setInputFocus (Window window) |
void | show (Window window) |
void | showRaised (Window window) |
void | hide (Window window) |
GC | createGC (Window window, unsigned long mask, XGCValues *gcv) |
void | grabKeyboard (Window window) |
void | ungrabKeyboard () |
void | free (void *data) |
void | sync (bool discard=False) |
void | setForeground (GC gc, unsigned long color) |
void | drawLines (Window window, GC gc, XPoint *points, unsigned int num) |
void | drawLine (Window window, GC gc, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2) |
void | drawRectangle (Window window, GC gc, int x, int y, unsigned int w, unsigned int h) |
void | drawRectangle (Window window, GC gc, Rectangle *rect) |
void | clearArea (Window window, Rectangle *rect) |
void | clearArea (Window window, int x, int y, unsigned int w, unsigned int h) |
void | clearWindow (Window window) |
void | fillRectangle (Window window, GC gc, Rectangle *rect) |
void | fillRectangle (Window window, GC gc, int x, int y, unsigned int w, unsigned int h) |
XFontStruct * | loadQueryFont (string name) |
void | drawText (Window window, GC gc, int x, int y, string text) |
int | textWidth (XFontStruct *font, string text) |
string | className (Window window) |
string | instanceName (Window window) |
int | state (Window window) |
void | setState (Window window, int state) |
string | atomValue (Window window, Atom atom) |
void | updateSize (Window window, unsigned int *minW, unsigned int *minH, unsigned int *maxW, unsigned int *maxH, bool *isCentered) |
bool | hasDecoration (Window window) |
Window | transient (Window window) |
int | property (Window window, Atom atom, Atom type, long length, unsigned char **prop) |
void | configure (Window window, XConfigureEvent *event) |
int | protocols (Window window) |
void | sendMessage (Window window, Atom atom, long value) |
void | kill (Window window, int protos) |
void | moveResize (Window window, Rectangle *rect) |
void | destroy (Window window) |
void | raise (Window window) |
void | lower (Window window) |
void | reparent (Window child, Window parent, int x, int y) |
void | grabKey (Window window, unsigned int modMask, KeyCode keycode) |
void | ungrabKey (Window window, unsigned int modMask, KeyCode keycode) |
void | grabButton (Window window, unsigned int modMask, unsigned int button) |
void | ungrabButton (Window window, unsigned int modMask, unsigned int button) |
void | grabServer () |
void | ungrabServer () |
void | grabPointer (Window window, unsigned int mask, Time time, Cursor cursor=None) |
void | ungrabPointer (Time time) |
Atom | internAtom (string atom) |
Cursor | createFontCursor (unsigned int cursor) |
void | setWindowAttributes (Window window, unsigned int mask, XSetWindowAttributes *attr) |
void | windowAttributes (Window window, XWindowAttributes *attr) |
KeyCode | stringToKeyCode (string key) |
string | keyCodeToString (KeyCode keyCode) |
KeySym | keyCodeToKeySym (KeyCode keyCode) |
string | atomName (Atom atom) |
void | nextEvent (XEvent *event) |
bool | checkMaskEvent (long mask, XEvent *event) |
void | translateCoordinates (Window child, Window parent, int srcX, int srcY, int *destX, int *destY) |
bool | allocNamedColor (Colormap colormap, string name, XColor *color) |
void | installColormap (Colormap colormap) |
Colormap | defaultColormap (unsigned int id) |
void | queryTree (Window root, Window **windows, unsigned int *num) |
KeySym | lookupNextKeySym (XKeyEvent *event, int *count, char *buffer) |
bool | textProperty (Window window, Atom atom, string *value) |
void | stringListToTextProperty (string text, XTextProperty *textProperty) |
void | setTextProperty (Display *display, Window window, XTextProperty *textProperty, Atom atom) |
void | configureWindow (Window window, unsigned int mask, XWindowChanges *wc) |
XModifierKeymap * | modifierMapping () |
void | freeModifierMapping (XModifierKeymap *modmap) |
void | addToSaveSet (Window window) |
void | removeFromSaveSet (Window window) |
void | sizeHints (Window window, XSizeHints *sizeHints) |
void | warpPointer (Window window, int x, int y) |
void | freeCursor (Cursor cursor) |
void | maskEvent (unsigned long mask, XEvent *event) |
void | sendEvent (Window window, unsigned long mask, XEvent *event) |
XWMHints * | getWMHints (Window window) |
Static Public Member Functions | |
static int | handleErrors (Display *display, XErrorEvent *e) |
Private Attributes | |
Display * | display_ |
Definition at line 46 of file xcore.h.
void XCore::setDisplay | ( | Display * | display | ) |
Window XCore::createWindow | ( | Window | root, | |
XSetWindowAttributes * | attr, | |||
int | x, | |||
int | y, | |||
unsigned int | w, | |||
unsigned int | h, | |||
unsigned long | mask | |||
) |
void XCore::selectEvents | ( | Window | window, | |
long | mask | |||
) |
void XCore::setInputFocus | ( | Window | window | ) |
void XCore::show | ( | Window | window | ) |
void XCore::showRaised | ( | Window | window | ) |
void XCore::hide | ( | Window | window | ) |
GC XCore::createGC | ( | Window | window, | |
unsigned long | mask, | |||
XGCValues * | gcv | |||
) |
void XCore::grabKeyboard | ( | Window | window | ) |
void XCore::ungrabKeyboard | ( | ) |
void XCore::free | ( | void * | data | ) |
Frees the data by X request.
Definition at line 83 of file xcore.cpp.
Referenced by atomValue(), hasDecoration(), property(), protocols(), state(), and textProperty().
void XCore::sync | ( | bool | discard = False |
) |
void XCore::setForeground | ( | GC | gc, | |
unsigned long | color | |||
) |
void XCore::drawLines | ( | Window | window, | |
GC | gc, | |||
XPoint * | points, | |||
unsigned int | num | |||
) |
void XCore::drawLine | ( | Window | window, | |
GC | gc, | |||
unsigned int | x1, | |||
unsigned int | y1, | |||
unsigned int | x2, | |||
unsigned int | y2 | |||
) |
void XCore::drawRectangle | ( | Window | window, | |
GC | gc, | |||
int | x, | |||
int | y, | |||
unsigned int | w, | |||
unsigned int | h | |||
) |
void XCore::drawRectangle | ( | Window | window, | |
GC | gc, | |||
Rectangle * | rect | |||
) |
Draws rectangle.
Definition at line 111 of file xcore.cpp.
References display_, Rectangle::height(), Rectangle::width(), Rectangle::x(), and Rectangle::y().
Here is the call graph for this function:
void XCore::clearArea | ( | Window | window, | |
Rectangle * | rect | |||
) |
Clears the specific area within specified window.
Definition at line 122 of file xcore.cpp.
References display_, Rectangle::height(), Rectangle::width(), Rectangle::x(), and Rectangle::y().
Here is the call graph for this function:
void XCore::clearArea | ( | Window | window, | |
int | x, | |||
int | y, | |||
unsigned int | w, | |||
unsigned int | h | |||
) |
void XCore::clearWindow | ( | Window | window | ) |
void XCore::fillRectangle | ( | Window | window, | |
GC | gc, | |||
Rectangle * | rect | |||
) |
Fills the specific window with rectangle.
Definition at line 135 of file xcore.cpp.
References display_, Rectangle::height(), Rectangle::width(), Rectangle::x(), and Rectangle::y().
Here is the call graph for this function:
void XCore::fillRectangle | ( | Window | window, | |
GC | gc, | |||
int | x, | |||
int | y, | |||
unsigned int | w, | |||
unsigned int | h | |||
) |
XFontStruct * XCore::loadQueryFont | ( | string | name | ) |
void XCore::drawText | ( | Window | window, | |
GC | gc, | |||
int | x, | |||
int | y, | |||
string | text | |||
) |
int XCore::textWidth | ( | XFontStruct * | font, | |
string | text | |||
) |
string XCore::className | ( | Window | window | ) |
string XCore::instanceName | ( | Window | window | ) |
int XCore::state | ( | Window | window | ) |
Returns state for the specific window.
Definition at line 242 of file xcore.cpp.
References display_, free(), property(), and Atoms::WM_STATE.
Here is the call graph for this function:
void XCore::setState | ( | Window | window, | |
int | state | |||
) |
Sets the state for the specific window.
Definition at line 266 of file xcore.cpp.
References display_, and Atoms::WM_STATE.
string XCore::atomValue | ( | Window | window, | |
Atom | atom | |||
) |
Returns value of the specific atom as string.
Definition at line 277 of file xcore.cpp.
References free(), and property().
Here is the call graph for this function:
void XCore::updateSize | ( | Window | window, | |
unsigned int * | minW, | |||
unsigned int * | minH, | |||
unsigned int * | maxW, | |||
unsigned int * | maxH, | |||
bool * | isCentered | |||
) |
Updates size infos for the specific window.
Definition at line 299 of file xcore.cpp.
References display_, and sizeHints().
Here is the call graph for this function:
bool XCore::hasDecoration | ( | Window | window | ) |
Returns true if the specific window has MWM decoration.
Definition at line 337 of file xcore.cpp.
References free(), Atoms::MWM_HINTS, MWM_HINTS_DECORATIONS, and property().
Here is the call graph for this function:
Window XCore::transient | ( | Window | window | ) |
int XCore::property | ( | Window | window, | |
Atom | atom, | |||
Atom | type, | |||
long | length, | |||
unsigned char ** | prop | |||
) |
Returns property for specific values.
Definition at line 363 of file xcore.cpp.
References display_, and free().
Referenced by atomValue(), handleErrors(), hasDecoration(), protocols(), state(), and textProperty().
Here is the call graph for this function:
void XCore::configure | ( | Window | window, | |
XConfigureEvent * | event | |||
) |
int XCore::protocols | ( | Window | window | ) |
Returns protocols for the specific window.
Definition at line 399 of file xcore.cpp.
References free(), PDELETE, property(), PTAKEFOCUS, Atoms::WM_DELETE, Atoms::WM_PROTOCOLS, and Atoms::WM_TAKE_FOCUS.
Here is the call graph for this function:
void XCore::sendMessage | ( | Window | window, | |
Atom | atom, | |||
long | value | |||
) |
void XCore::kill | ( | Window | window, | |
int | protos | |||
) |
Kills the client with the specific window.
Definition at line 436 of file xcore.cpp.
References display_, PDELETE, sendMessage(), Atoms::WM_DELETE, and Atoms::WM_PROTOCOLS.
Here is the call graph for this function:
void XCore::moveResize | ( | Window | window, | |
Rectangle * | rect | |||
) |
Resizes the specific window.
Definition at line 446 of file xcore.cpp.
References display_, Rectangle::height(), Rectangle::width(), Rectangle::x(), and Rectangle::y().
Here is the call graph for this function:
void XCore::destroy | ( | Window | window | ) |
void XCore::raise | ( | Window | window | ) |
void XCore::lower | ( | Window | window | ) |
void XCore::reparent | ( | Window | child, | |
Window | parent, | |||
int | x, | |||
int | y | |||
) |
void XCore::grabKey | ( | Window | window, | |
unsigned int | modMask, | |||
KeyCode | keycode | |||
) |
void XCore::ungrabKey | ( | Window | window, | |
unsigned int | modMask, | |||
KeyCode | keycode | |||
) |
void XCore::grabButton | ( | Window | window, | |
unsigned int | modMask, | |||
unsigned int | button | |||
) |
void XCore::ungrabButton | ( | Window | window, | |
unsigned int | modMask, | |||
unsigned int | button | |||
) |
void XCore::grabServer | ( | ) |
void XCore::ungrabServer | ( | ) |
void XCore::grabPointer | ( | Window | window, | |
unsigned int | mask, | |||
Time | time, | |||
Cursor | cursor = None | |||
) |
void XCore::ungrabPointer | ( | Time | time | ) |
Atom XCore::internAtom | ( | string | atom | ) |
Cursor XCore::createFontCursor | ( | unsigned int | cursor | ) |
void XCore::setWindowAttributes | ( | Window | window, | |
unsigned int | mask, | |||
XSetWindowAttributes * | attr | |||
) |
void XCore::windowAttributes | ( | Window | window, | |
XWindowAttributes * | attr | |||
) |
KeyCode XCore::stringToKeyCode | ( | string | key | ) |
string XCore::keyCodeToString | ( | KeyCode | keyCode | ) |
KeySym XCore::keyCodeToKeySym | ( | KeyCode | keyCode | ) |
string XCore::atomName | ( | Atom | atom | ) |
void XCore::nextEvent | ( | XEvent * | event | ) |
bool XCore::checkMaskEvent | ( | long | mask, | |
XEvent * | event | |||
) |
void XCore::translateCoordinates | ( | Window | child, | |
Window | parent, | |||
int | srcX, | |||
int | srcY, | |||
int * | destX, | |||
int * | destY | |||
) |
bool XCore::allocNamedColor | ( | Colormap | colormap, | |
string | name, | |||
XColor * | color | |||
) |
void XCore::installColormap | ( | Colormap | colormap | ) |
Colormap XCore::defaultColormap | ( | unsigned int | id | ) |
void XCore::queryTree | ( | Window | root, | |
Window ** | windows, | |||
unsigned int * | num | |||
) |
KeySym XCore::lookupNextKeySym | ( | XKeyEvent * | event, | |
int * | count, | |||
char * | buffer | |||
) |
bool XCore::textProperty | ( | Window | window, | |
Atom | atom, | |||
string * | value | |||
) |
Writes back text property value for window and specified atom.
Definition at line 586 of file xcore.cpp.
References display_, free(), and property().
Here is the call graph for this function:
void XCore::stringListToTextProperty | ( | string | text, | |
XTextProperty * | textProperty | |||
) |
void XCore::setTextProperty | ( | Display * | display, | |
Window | window, | |||
XTextProperty * | textProperty, | |||
Atom | atom | |||
) |
int XCore::handleErrors | ( | Display * | display, | |
XErrorEvent * | e | |||
) | [static] |
Default error handler.
Definition at line 612 of file xcore.cpp.
References Kernel::defaultRootWindow(), Kernel::display(), Logger::error(), Singleton< Kernel >::instance(), Singleton< Logger >::instance(), Atoms::NCWM_STATUSTEXT, property(), Kernel::runlevel(), Kernel::START, and Logger::warning().
Referenced by Kernel::start().
Here is the call graph for this function:
void XCore::configureWindow | ( | Window | window, | |
unsigned int | mask, | |||
XWindowChanges * | wc | |||
) |
XModifierKeymap * XCore::modifierMapping | ( | ) |
void XCore::freeModifierMapping | ( | XModifierKeymap * | modmap | ) |
void XCore::addToSaveSet | ( | Window | window | ) |
void XCore::removeFromSaveSet | ( | Window | window | ) |
void XCore::sizeHints | ( | Window | window, | |
XSizeHints * | sizeHints | |||
) |
Fetches size hints.
Definition at line 293 of file xcore.cpp.
References display_.
Referenced by updateSize().
void XCore::warpPointer | ( | Window | window, | |
int | x, | |||
int | y | |||
) |
void XCore::freeCursor | ( | Cursor | cursor | ) |
void XCore::maskEvent | ( | unsigned long | mask, | |
XEvent * | event | |||
) |
void XCore::sendEvent | ( | Window | window, | |
unsigned long | mask, | |||
XEvent * | event | |||
) |
XWMHints * XCore::getWMHints | ( | Window | window | ) |
Display* XCore::display_ [private] |
Definition at line 325 of file xcore.h.
Referenced by addToSaveSet(), allocNamedColor(), atomName(), checkMaskEvent(), className(), clearArea(), clearWindow(), configure(), configureWindow(), createFontCursor(), createGC(), createWindow(), defaultColormap(), destroy(), drawLine(), drawLines(), drawRectangle(), drawText(), fillRectangle(), freeCursor(), getWMHints(), grabButton(), grabKey(), grabKeyboard(), grabPointer(), grabServer(), hide(), installColormap(), instanceName(), internAtom(), keyCodeToKeySym(), keyCodeToString(), kill(), loadQueryFont(), lower(), maskEvent(), modifierMapping(), moveResize(), nextEvent(), property(), queryTree(), raise(), removeFromSaveSet(), reparent(), selectEvents(), sendEvent(), sendMessage(), setDisplay(), setForeground(), setInputFocus(), setState(), setWindowAttributes(), show(), showRaised(), sizeHints(), state(), stringToKeyCode(), sync(), textProperty(), transient(), translateCoordinates(), ungrabButton(), ungrabKey(), ungrabKeyboard(), ungrabPointer(), ungrabServer(), updateSize(), warpPointer(), and windowAttributes().