Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
Screen.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef CSCREEN_H
4#define CSCREEN_H
5
6#include <QObject>
7#include "service_export.h"
8#include <QImage>
9
13class SERVICE_EXPORT CScreen : public QObject
14{
15 Q_OBJECT
16public:
17 CScreen(QObject* parent = nullptr) : QObject(parent),
18 m_Format(QImage::Format_Invalid),
19 m_bCursor(true),
20 m_nNumber(-1)
21 {}
22
23 static CScreen* Instance();
24
25 virtual int Width() = 0;
26 virtual int Height() = 0;
27
28 virtual int VirtualTop() = 0;
29 virtual int VirtualLeft() = 0;
30 virtual int VirtualWidth() = 0;
31 virtual int VirtualHeight() = 0;
32
33 // Windows contain both visible and invisible pseudo-monitors
34 // that are associated with mirroring drivers.
35 // The function returns only visible monitor count.
36 virtual int VisibleMonitorCount() = 0;
37
38 virtual QImage GetScreen(int index = 0) = 0;
39 virtual QImage::Format GetFormat(int index = 0)
40 {
41 return m_Format;
42 }
43 virtual int SetFormat(QImage::Format f = QImage::Format_ARGB32)
44 {
45 m_Format = f;
46 return 0;
47 }
48
49 bool HasCursor(){return m_bCursor;}
50 void SetHasCursor(bool bHas){m_bCursor = bHas;}
51
52Q_SIGNALS:
53 void sigUpdate(QImage screen);
54
55protected:
56 QImage m_Screen;
57 QImage::Format m_Format;
58 bool m_bCursor;
59 int m_nNumber;
60};
61
62#endif // CSCREEN_H
The CScreen class.
Definition Screen.h:14