Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
DisplayXLib.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef CDISPLAYPXLIB_H
4#define CDISPLAYPXLIB_H
5
6#pragma once
7
8#include "Display.h"
9#include <X11/Xlib.h>
10#include <X11/Xutil.h>
11
12class CDisplayXLib : public CDisplay
13{
14public:
15 explicit CDisplayXLib();
16 virtual ~CDisplayXLib() override;
17
18 virtual int Width() override;
19 virtual int Height() override;
20 virtual int GetScreenCount() override;
21 virtual QImage::Format GetFormat() override;
22 virtual QImage GetDisplay(int x, int y, int width, int height) override;
23 virtual QImage GetDisplay() override;
24 virtual QImage GetCursor(QPoint &pos, QPoint &posHot) override;
25 virtual QPoint GetCursorPosition() override;
26
27protected:
28 virtual int Open() override;
29 virtual int Close() override;
30
31private:
32 Display* m_pDisplay;
33 Window m_RootWindow;
34 QImage::Format m_Format;
35 XImage *m_pImage;
36 QImage m_Desktop;
37
38 QImage::Format GetFormat(XImage* pImage);
39 static void DestroyImage(void *pImage);
40};
41
42#endif // CDISPLAYPXLIB_H