X11 utility functions.
More...
#include <XWindowsUtil.h>
|
using | KeySyms = std::vector<KeySym> |
|
static bool | getWindowProperty (Display *, Window window, Atom property, std::string *data, Atom *type, int32_t *format, bool deleteProperty) |
| Get property.
|
static bool | setWindowProperty (Display *, Window window, Atom property, const void *data, uint32_t size, Atom type, int32_t format) |
| Set property.
|
static Time | getCurrentTime (Display *, Window) |
| Get X server time.
|
static uint32_t | mapKeySymToKeyID (KeySym) |
| Convert KeySym to KeyID.
|
static uint32_t | getModifierBitForKeySym (KeySym keysym) |
| Convert KeySym to corresponding KeyModifierMask.
|
static std::string | atomToString (Display *, Atom atom) |
| Convert Atom to its string.
|
static std::string | atomsToString (Display *display, const Atom *atom, uint32_t num) |
| Convert several Atoms to a string.
|
static void | convertAtomProperty (std::string &data) |
| Prepare a property of atoms for use.
|
static void | appendAtomData (std::string &data, Atom atom) |
| Append an Atom to property data.
|
static void | replaceAtomData (std::string &data, uint32_t index, Atom atom) |
| Replace an Atom in property data.
|
static void | appendTimeData (std::string &data, Time time) |
| Append an Time to property data.
|
◆ KeySyms
◆ appendAtomData()
void XWindowsUtil::appendAtomData |
( |
std::string & | data, |
|
|
Atom | atom ) |
|
static |
Append an Atom to property data.
Converts atom
to a 32-bit on-the-wire format and appends it to data
.
◆ appendTimeData()
void XWindowsUtil::appendTimeData |
( |
std::string & | data, |
|
|
Time | time ) |
|
static |
Append an Time to property data.
Converts time
to a 32-bit on-the-wire format and appends it to data
.
◆ atomsToString()
std::string XWindowsUtil::atomsToString |
( |
Display * | display, |
|
|
const Atom * | atom, |
|
|
uint32_t | num ) |
|
static |
Convert several Atoms to a string.
Converts each atom in atoms
to its string representation and concatenates the results.
◆ atomToString()
std::string XWindowsUtil::atomToString |
( |
Display * | display, |
|
|
Atom | atom ) |
|
static |
Convert Atom to its string.
Converts atom
to its string representation.
◆ convertAtomProperty()
void XWindowsUtil::convertAtomProperty |
( |
std::string & | data | ) |
|
|
static |
Prepare a property of atoms for use.
64-bit systems may need to modify a property's data if it's a list of Atoms before using it.
◆ getCurrentTime()
Time XWindowsUtil::getCurrentTime |
( |
Display * | display, |
|
|
Window | window ) |
|
static |
Get X server time.
Returns the current X server time.
◆ getModifierBitForKeySym()
uint32_t XWindowsUtil::getModifierBitForKeySym |
( |
KeySym | keysym | ) |
|
|
static |
◆ getWindowProperty()
bool XWindowsUtil::getWindowProperty |
( |
Display * | display, |
|
|
Window | window, |
|
|
Atom | property, |
|
|
std::string * | data, |
|
|
Atom * | type, |
|
|
int32_t * | format, |
|
|
bool | deleteProperty ) |
|
static |
Get property.
Gets property property
on window
. Appends the data to *data
if data
is not nullptr, saves the property type in *type
if type
is not nullptr, and saves the property format in *format
if format
is not nullptr. If deleteProperty
is true then the property is deleted after being read.
◆ mapKeySymToKeyID()
KeyID XWindowsUtil::mapKeySymToKeyID |
( |
KeySym | k | ) |
|
|
static |
Convert KeySym to KeyID.
Converts a KeySym to the equivalent KeyID. Returns kKeyNone if the KeySym cannot be mapped.
◆ replaceAtomData()
void XWindowsUtil::replaceAtomData |
( |
std::string & | data, |
|
|
uint32_t | index, |
|
|
Atom | atom ) |
|
static |
Replace an Atom in property data.
Converts atom
to a 32-bit on-the-wire format and replaces the atom at index index
in data
.
◆ setWindowProperty()
bool XWindowsUtil::setWindowProperty |
( |
Display * | display, |
|
|
Window | window, |
|
|
Atom | property, |
|
|
const void * | data, |
|
|
uint32_t | size, |
|
|
Atom | type, |
|
|
int32_t | format ) |
|
static |
Set property.
Sets property property
on window
to size
bytes of data from data
.
The documentation for this class was generated from the following files: