-
Notifications
You must be signed in to change notification settings - Fork 0
/
xcbtools.h
40 lines (30 loc) · 1.08 KB
/
xcbtools.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef XCBTOOLS_H
#define XCBTOOLS_H
#ifdef WITH_OCR
#include <QObject>
#include <QPixmap>
#include <QVector>
#include <QRect>
#include <xcb/xcb.h>
#include <xcb/xcb_image.h>
#include <xcb/xfixes.h>
class ZXCBTools : public QObject
{
Q_OBJECT
private:
xcb_connection_t* m_connection;
static xcb_connection_t* connection();
public:
explicit ZXCBTools(QObject *parent = nullptr);
~ZXCBTools() override;
static xcb_window_t appRootWindow();
static QPixmap convertFromNative(xcb_image_t *xcbImage);
static bool getWindowGeometry(xcb_window_t window, int &x, int &y, int &w, int &h);
static QPixmap getWindowPixmap(xcb_window_t window, bool blendPointer);
static QPixmap blendCursorImage(const QPixmap &pixmap, int x, int y, int width, int height);
static void getWindowsRecursive( QVector<QRect> &windows, xcb_window_t w, int rx = 0, int ry = 0, int depth = 0 );
static xcb_window_t findRealWindow( xcb_window_t w, int depth = 0 );
static xcb_window_t windowUnderCursor( bool includeDecorations = true );
};
#endif // OCR
#endif // XCBTOOLS_H