AntiMicroX
Data Structures | Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | Private Member Functions | Private Attributes
X11Extras Class Reference

#include <x11extras.h>

Inheritance diagram for X11Extras:
[legend]
Collaboration diagram for X11Extras:
[legend]

Data Structures

struct  ptrInformation
 

Public Slots

QPoint getPos ()
 

Public Member Functions

 ~X11Extras ()
 Close display connection if one exists. More...
 
unsigned long appRootWindow (int screen=-1)
 Return root window for a given X display. More...
 
Display * display ()
 Get display instance. More...
 
bool hasValidDisplay ()
 
QString getDisplayString (QString xcodestring)
 Get appropriate alias for a known KeySym string that might be blank or contain invalid characters when returned from X. More...
 
int getApplicationPid (Window window)
 Check window and any parents for the window property "_NET_WM_PID". More...
 
QString getApplicationLocation (int pid)
 Find the application file location for a given PID. More...
 
Window findClientWindow (Window window)
 Find the proper client window within a hierarchy. This check is needed in some environments where the window that has been selected is actually a child to a transparent parent window which was the one that was actually grabbed. More...
 
Window findParentClient (Window window)
 
void closeDisplay ()
 CURRENTLY NOT USED. More...
 
QString getWindowTitle (Window window)
 
QString getWindowClass (Window window)
 
unsigned long getWindowInFocus ()
 
int getGroup1KeySym (int virtualkey)
 
void x11ResetMouseAccelerationChange ()
 
void x11ResetMouseAccelerationChange (QString pointerName)
 
struct ptrInformation getPointInformation ()
 
struct ptrInformation getPointInformation (QString pointerName)
 
const char * getEnvVariable (const char *var) const
 
const QHash< QString, QString > & getKnownAliases ()
 

Static Public Member Functions

static QString getXDisplayString ()
 Get QString representation of currently utilized X display. More...
 
static void setCustomDisplay (QString displayString)
 
static X11ExtrasgetInstance ()
 
static void deleteInstance ()
 

Protected Member Functions

 X11Extras (QObject *parent=nullptr)
 
void populateKnownAliases ()
 
bool windowHasProperty (Display *display, Window window, Atom atom)
 
bool windowIsViewable (Display *display, Window window)
 
bool isWindowRelevant (Display *display, Window window)
 Go through a window's properties and search for an Atom from a defined list. If an Atom is found in a window's properties, that window should be considered relevant and one that should be grabbed. More...
 

Static Protected Attributes

static X11Extras_instance = nullptr
 

Private Member Functions

void checkPropertyOnWin (bool windowCorrected, Window &window, Window &parent, Window &finalwindow, Window &root, Window *children, Display *display, unsigned int &num_children)
 
void freeDisplay ()
 
void checkFeedback (XFeedbackState *temp, int &num_feedbacks, int &feedback_id)
 
void findVirtualPtr (int num_devices, XIDeviceInfo *current_devices, XIDeviceInfo *mouse_device, XIDeviceInfo *all_devices, QString pointerName)
 

Private Attributes

QHash< QString, QString > knownAliases
 
Display * _display
 

Constructor & Destructor Documentation

◆ ~X11Extras()

X11Extras::~X11Extras ( )

Close display connection if one exists.

Here is the call graph for this function:

◆ X11Extras()

X11Extras::X11Extras ( QObject *  parent = nullptr)
explicitprotected
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ appRootWindow()

unsigned long X11Extras::appRootWindow ( int  screen = -1)

Return root window for a given X display.

Parameters
Screennumber. If no value is passed, uses screen 1.
Returns
XID of the window
Here is the call graph for this function:

◆ checkFeedback()

void X11Extras::checkFeedback ( XFeedbackState *  temp,
int &  num_feedbacks,
int &  feedback_id 
)
private
Here is the caller graph for this function:

◆ checkPropertyOnWin()

void X11Extras::checkPropertyOnWin ( bool  windowCorrected,
Window &  window,
Window &  parent,
Window &  finalwindow,
Window &  root,
Window *  children,
Display *  display,
unsigned int &  num_children 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ closeDisplay()

void X11Extras::closeDisplay ( )

CURRENTLY NOT USED.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteInstance()

void X11Extras::deleteInstance ( )
static

◆ display()

Display * X11Extras::display ( )

Get display instance.

Returns
Display struct
Here is the caller graph for this function:

◆ findClientWindow()

Window X11Extras::findClientWindow ( Window  window)

Find the proper client window within a hierarchy. This check is needed in some environments where the window that has been selected is actually a child to a transparent parent window which was the one that was actually grabbed.

Parameters
Topwindow to check
Returns
Client window XID or 0 if no appropriate window was found
Here is the call graph for this function:

◆ findParentClient()

Window X11Extras::findParentClient ( Window  window)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findVirtualPtr()

void X11Extras::findVirtualPtr ( int  num_devices,
XIDeviceInfo *  current_devices,
XIDeviceInfo *  mouse_device,
XIDeviceInfo *  all_devices,
QString  pointerName 
)
private
Here is the caller graph for this function:

◆ freeDisplay()

void X11Extras::freeDisplay ( )
private
Here is the caller graph for this function:

◆ getApplicationLocation()

QString X11Extras::getApplicationLocation ( int  pid)

Find the application file location for a given PID.

Parameters
PIDof window
Returns
File location of application
Here is the caller graph for this function:

◆ getApplicationPid()

int X11Extras::getApplicationPid ( Window  window)

Check window and any parents for the window property "_NET_WM_PID".

Parameters
WindowXID for window of interest
Returns
PID of the application instance corresponding to the window
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDisplayString()

QString X11Extras::getDisplayString ( QString  xcodestring)

Get appropriate alias for a known KeySym string that might be blank or contain invalid characters when returned from X.

Parameters
QStringrepresentation of a KeySym string
Returns
Alias string or a blank QString if no alias was found
Here is the caller graph for this function:

◆ getEnvVariable()

const char * X11Extras::getEnvVariable ( const char *  var) const

◆ getGroup1KeySym()

int X11Extras::getGroup1KeySym ( int  virtualkey)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInstance()

X11Extras * X11Extras::getInstance ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getKnownAliases()

const QHash< QString, QString > & X11Extras::getKnownAliases ( )

◆ getPointInformation() [1/2]

struct X11Extras::ptrInformation X11Extras::getPointInformation ( )
Here is the caller graph for this function:

◆ getPointInformation() [2/2]

struct X11Extras::ptrInformation X11Extras::getPointInformation ( QString  pointerName)
Here is the call graph for this function:

◆ getPos

QPoint X11Extras::getPos ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWindowClass()

QString X11Extras::getWindowClass ( Window  window)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWindowInFocus()

unsigned long X11Extras::getWindowInFocus ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWindowTitle()

QString X11Extras::getWindowTitle ( Window  window)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getXDisplayString()

QString X11Extras::getXDisplayString ( )
static

Get QString representation of currently utilized X display.

Returns
Here is the caller graph for this function:

◆ hasValidDisplay()

bool X11Extras::hasValidDisplay ( )

◆ isWindowRelevant()

bool X11Extras::isWindowRelevant ( Display *  display,
Window  window 
)
protected

Go through a window's properties and search for an Atom from a defined list. If an Atom is found in a window's properties, that window should be considered relevant and one that should be grabbed.

Parameters
Display*
Window
Returns
If a window has a relevant Atom in its properties.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ populateKnownAliases()

void X11Extras::populateKnownAliases ( )
protected
Here is the caller graph for this function:

◆ setCustomDisplay()

void X11Extras::setCustomDisplay ( QString  displayString)
static

◆ windowHasProperty()

bool X11Extras::windowHasProperty ( Display *  display,
Window  window,
Atom  atom 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ windowIsViewable()

bool X11Extras::windowIsViewable ( Display *  display,
Window  window 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11ResetMouseAccelerationChange() [1/2]

void X11Extras::x11ResetMouseAccelerationChange ( )
Here is the caller graph for this function:

◆ x11ResetMouseAccelerationChange() [2/2]

void X11Extras::x11ResetMouseAccelerationChange ( QString  pointerName)
Here is the call graph for this function:

Field Documentation

◆ _display

Display* X11Extras::_display
private

◆ _instance

X11Extras * X11Extras::_instance = nullptr
staticprotected

◆ knownAliases

QHash<QString, QString> X11Extras::knownAliases
private

The documentation for this class was generated from the following files: