50 #include <QtCore/qtimer.h> 51 #include <QtCore/qregexp.h> 52 #include <QtGui/qwidget.h> 53 #include <QtGui/qpolygon.h> 54 #include <QtGui/qpainter.h> 56 #include <private/qwindowsurface_qws_p.h> 57 #include <private/qwssignalhandler_p.h> 58 #include <private/qwidget_p.h> 59 #include <private/qdrawhelper_p.h> 69 #ifndef QT_NO_QWS_CURSOR 112 for (
int i = 0; i < rects.
size(); ++i)
125 for (
int i = 0; i < rects.
size(); ++i)
160 const quint16 tmp[6] = { htons(0),
165 socket->
write((
char*)tmp,
sizeof(tmp));
167 const quint32 encoding = htonl(-239);
168 socket->
write((
char*)(&encoding),
sizeof(encoding));
178 char *buffer =
new char[n];
179 for (
int i = 0; i < img.height(); ++i) {
181 socket->
write(buffer, n);
189 const int width = (bitmap.
width() + 7) / 8;
190 for (
int i = 0; i < bitmap.
height(); ++i)
194 #endif // QT_NO_QWS_CURSOR 197 : dpiX(72), dpiY(72), doOnScreenSurface(false), refreshRate(25),
198 vncServer(0), q_ptr(parent), noDisablePainting(false)
200 #ifdef QT_BUILD_INTERNAL 203 #ifndef QT_NO_QWS_SIGNALHANDLER 210 #if defined(QT_NO_QWS_MULTIPROCESS) || defined(QT_NO_SHAREDMEMORY) 259 #if !defined(QT_NO_QWS_MULTIPROCESS) && !defined(QT_NO_SHAREDMEMORY) 268 qWarning() <<
"QVNCScreen could not create shared memory:" 271 qWarning() <<
"QVNCScreen could not attach to shared memory:" 276 qWarning() <<
"QVNCScreen could not attach to shared memory:" 290 static const struct {
364 s->
read((
char*)buf, 8);
378 s->
write((
char*)buf, 8);
385 bitsPerPixel = buf[0];
392 while (a) { a >>= 1; redBits++; }
394 a = ntohs(*(
quint16 *)(buf + 6));
396 while (a) { a >>= 1; greenBits++; }
398 a = ntohs(*(
quint16 *)(buf + 8));
400 while (a) { a >>= 1; blueBits++; }
403 greenShift = buf[11];
410 buf[0] = bitsPerPixel;
416 for (
int i = 0; i < redBits; i++) a = (a << 1) | 1;
417 *(
quint16 *)(buf + 4) = htons(a);
420 for (
int i = 0; i < greenBits; i++) a = (a << 1) | 1;
421 *(
quint16 *)(buf + 6) = htons(a);
424 for (
int i = 0; i < blueBits; i++) a = (a << 1) | 1;
425 *(
quint16 *)(buf + 8) = htons(a);
428 buf[11] = greenShift;
437 name =
new char [strlen(n) + 1];
443 s->
read((
char *)&width, 2);
444 width = ntohs(width);
445 s->
read((
char *)&height, 2);
446 height = ntohs(height);
450 s->
read((
char *)&len, 4);
453 name =
new char [len + 1];
461 s->
write((
char *)&t, 2);
463 s->
write((
char *)&t, 2);
467 s->
write((
char *)&len, 4);
478 s->
read((
char *)&count, 2);
479 count = ntohs(count);
489 s->
read(&incremental, 1);
502 s->
read((
char *)&tmp, 2);
505 s->
read((
char *)&key, 4);
523 if (key >=
'a' && key <=
'z')
525 else if (key >=
' ' && key <=
'~')
539 s->
read(&buttonMask, 1);
549 s->
read((
char *)&tmp, 2);
551 s->
read((
char *)&tmp, 2);
564 s->
read((
char *)&length, 4);
565 length = ntohl(length);
573 : qvnc_screen(screen)
603 qDebug(
"QVNCServer created on port %d", port);
607 #ifndef QT_NO_QWS_CURSOR 619 #ifndef QT_NO_QWS_CURSOR 651 const char *proto =
"RFB 003.003\n";
667 qDebug(
"Client protocol version %s", proto);
783 sim.
setName(
"Qt for Embedded Linux VNC Server");
801 qDebug(
"Not supported: FixColourMapEntries");
831 #if Q_BYTE_ORDER == Q_BIG_ENDIAN 838 return screen()->frameBufferLittleEndian();
839 return frameBufferLittleEndian();
849 #ifdef QT_QWS_VNC_DEBUG 850 qDebug(
"Want format: %d %d %d %d %d %d %d %d %d %d",
863 qDebug(
"Can only handle true color clients");
869 #if Q_BYTE_ORDER == Q_BIG_ENDIAN 907 #ifdef QT_QWS_VNC_DEBUG 908 qDebug(
"QVNCServer::setEncodings: %d", enc);
914 #ifdef QT_QWS_VNC_DEBUG 915 qDebug(
"QVNCServer::setEncodings: using raw");
933 #ifdef QT_QWS_DEPTH_8 938 #ifdef QT_QWS_DEPTH_12 943 #ifdef QT_QWS_DEPTH_15 948 #ifdef QT_QWS_DEPTH_16 953 #ifdef QT_QWS_DEPTH_18 958 #ifdef QT_QWS_DEPTH_24 963 #ifdef QT_QWS_DEPTH_32 971 #ifdef QT_QWS_VNC_DEBUG 972 qDebug(
"QVNCServer::setEncodings: using hextile");
980 #ifndef QT_NO_QWS_CURSOR 995 encodingsPending = 0;
1000 #ifdef QT_QWS_VNC_DEBUG 1001 qDebug(
"QVNCServer::setEncodings: fallback using raw");
1072 template <
class SRC>
1074 int width,
int height,
int stride)
1077 if (width % (depth / 8))
1080 static int alwaysFalse =
qgetenv(
"QT_VNC_NOCHECKFILL").
toInt();
1087 if ((data8[0] & 0xf) != (data8[0] >> 4))
1093 if (data8[0] != data8[1])
1101 if (data16[0] != data16[1])
1109 const quint32 first = data32[0];
1110 const int linestep = (stride /
sizeof(
quint32)) - width;
1111 for (
int y = 0; y < height; ++y) {
1112 for (
int x = 0; x < width; ++x) {
1113 if (*(data32++) != first)
1124 SRC color =
reinterpret_cast<const SRC*
>(
data)[0];
1130 template <
class SRC>
1135 const int padding = 3;
1137 buffer[padding] = 2;
1139 reinterpret_cast<char*
>(&
encoder->bg),
1141 socket->
write(buffer.
data() + padding, bpp + 1);
1145 socket->
write(&subenc, 1);
1149 template <
class SRC>
1151 int width,
int height,
int stride)
1153 const SRC *
ptr =
reinterpret_cast<const SRC*
>(
data);
1154 const int linestep = (stride /
sizeof(SRC)) - width;
1166 while (y < height) {
1172 goto found_second_color;
1184 while (y < height) {
1188 }
else if (*ptr == c2) {
1214 bool inRect =
false;
1216 ptr =
reinterpret_cast<const SRC*
>(
data);
1217 for (y = 0; y < height; ++y) {
1218 for (x = 0; x < width; ++x) {
1219 if (inRect && *ptr ==
encoder->bg) {
1221 setWidth(x - lastx());
1224 }
else if (!inRect && *ptr ==
encoder->fg) {
1235 setWidth(width - lastx());
1245 template <
class SRC>
1249 const int padding = 3;
1251 char &subenc = buffer[padding];
1252 int n = padding +
sizeof(subenc);
1269 buffer[n] = numRects;
1270 n +=
sizeof(numRects);
1272 socket->
write(buffer.
data() + padding, n - padding);
1273 socket->
write((
char*)rects, numRects *
sizeof(
Rect));
1276 template <
class SRC>
1279 for (
int r = numRects - 1; r >= 0; --r) {
1280 if (recty(r) == lasty())
1282 if (recty(r) < lasty() - 1)
1284 if (rectx(r) == lastx() && width(r) == width(numRects)) {
1292 template <
class SRC>
1296 (
const char*)&color, 1);
1299 template <
class SRC>
1302 if ((rects.size() + bpp + 2) > maxRectsSize)
1304 rects.resize(rects.size() + bpp + 2);
1308 template <
class SRC>
1311 setHeight(numRects, 1);
1315 template <
class SRC>
1317 int width,
int height,
int stride)
1319 const SRC *
ptr =
reinterpret_cast<const SRC*
>(
data);
1320 const int linestep = (stride /
sizeof(SRC)) - width;
1329 bool inRect =
false;
1334 for (
int y = 0; y < height; ++y) {
1335 for (
int x = 0; x < width; ++x) {
1336 if (inRect && *ptr != color) {
1337 setWidth(numRects, x - rectx(numRects));
1342 if (!inRect && *ptr != bg) {
1354 setWidth(numRects, width - rectx(numRects));
1364 template <
class SRC>
1367 const int padding = 3;
1370 quint8 &subenc = buffer[padding];
1371 int n = padding +
sizeof(
quint8);
1378 reinterpret_cast<const char*>(&
encoder->bg),
1384 buffer[n] = numRects;
1385 n +=
sizeof(numRects);
1387 socket->
write(reinterpret_cast<const char*>(buffer.
data() + padding),
1389 socket->
write(reinterpret_cast<const char*>(rects.constData()),
1398 #if Q_BYTE_ORDER == Q_BIG_ENDIAN 1407 switch (screendepth) {
1438 #if Q_BYTE_ORDER == Q_BIG_ENDIAN 1444 switch (screendepth) {
1446 memcpy(dst, src, count *
sizeof(
quint32));
1453 memcpy(dst, src, count *
sizeof(
quint16));
1458 #if defined(__i386__) // Currently fails on ARM if dst is not 4 byte aligned 1468 result1 = ((s & 0xf8000000) | ((s & 0xe0000000) >> 5)) >> 8;
1469 result2 = ((s & 0x0000f800) | ((s & 0x0000e000) >> 5)) << 8;
1472 result1 |= ((s & 0x07e00000) | ((s & 0x06000000) >> 6)) >> 11;
1473 result2 |= ((s & 0x000007e0) | ((s & 0x00000600) >> 6)) << 5;
1476 result1 |= ((s & 0x001f0000) | ((s & 0x001c0000) >> 5)) >> 13;
1477 result2 |= ((s & 0x0000001f) | ((s & 0x0000001c) >> 5)) << 3;
1495 for (
int i = 0; i < count; ++i) {
1498 switch (screendepth) {
1502 r = ((*src) & 0x0f) << 4;
1520 #ifdef QT_QWS_DEPTH_12 1530 #ifdef QT_QWS_DEPTH_15 1542 #if Q_BYTE_ORDER == Q_BIG_ENDIAN 1544 p = ((p & 0xff) << 8) | ((p & 0xff00) >> 8);
1546 r = (p >> 11) & 0x1f;
1547 g = (p >> 5) & 0x3f;
1555 #ifdef QT_QWS_DEPTH_18 1565 #ifdef QT_QWS_DEPTH_24 1577 r = (p >> 16) & 0xff;
1578 g = (p >> 8) & 0xff;
1585 qDebug(
"QVNCServer: don't support %dbpp display", screendepth);
1590 #if Q_BYTE_ORDER == Q_BIG_ENDIAN 1606 memcpy(dst, &pixel, bytesPerPixel);
1612 if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
1615 pixel = (((pixel & 0x0000ff00) << 8) |
1616 ((pixel & 0x000000ff) << 24));
1619 pixel = (((pixel & 0xff000000) >> 24) |
1620 ((pixel & 0x00ff0000) >> 8) |
1621 ((pixel & 0x0000ff00) << 8) |
1622 ((pixel & 0x000000ff) << 24));
1630 pixel = (((pixel & 0xff000000) >> 8) |
1631 ((pixel & 0x00ff0000) << 8));
1634 pixel = (((pixel & 0xff000000) >> 24) |
1635 ((pixel & 0x00ff0000) >> 8) |
1636 ((pixel & 0x0000ff00) << 8) |
1637 ((pixel & 0x000000ff) << 24));
1640 qDebug(
"Cannot handle %d bpp client",
1645 memcpy(dst, &pixel, bytesPerPixel);
1650 #ifndef QT_NO_QWS_CURSOR 1654 const QRect intersection = (cursorRect & imageRect);
1662 #endif // QT_NO_QWS_CURSOR 1706 static bool alwaysForce =
qgetenv(
"QT_VNC_NO_COMPAREBUFFER").
toInt();
1710 bool changed =
false;
1720 const int tileHeight = (startY + MAP_TILE_SIZE >
bufferHeight ?
1722 const int tileWidth = (startX + MAP_TILE_SIZE >
bufferWidth ?
1740 memcpy(old, scrn,
sizeof(T) * MAP_TILE_SIZE);
1747 if (memcmp(old, scrn,
sizeof(T) * tileWidth)) {
1757 memcpy(old, scrn,
sizeof(T) * tileWidth);
1765 const int mapIndex = tileY *
mapWidth + tileX;
1766 if ((force || changed) && !
map[mapIndex]) {
1772 template <
class SRC>
1775 singleColorHextile(this), dualColorHextile(this), multiColorHextile(this)
1783 template <
class SRC>
1791 const quint32 encoding = htonl(5);
1795 const char tmp[2] = { 0, 0 };
1796 socket->
write(tmp,
sizeof(tmp));
1800 socket->
write((
char *)&count,
sizeof(count));
1814 for (
int y = 0; y < map->
mapHeight; ++y) {
1818 for (
int x = 0; x < map->
mapWidth; ++x) {
1819 if (!map->
dirty(x, y))
1828 socket->
write((
char *)&encoding,
sizeof(encoding));
1831 + rect.
x * screenImage.
depth() / 8;
1834 #ifndef QT_NO_QWS_CURSOR 1840 if (doBlendCursor) {
1841 const QRect tileRect(rect.
x, rect.
y, rect.
w, rect.
h);
1845 tileImage = screenImage.
copy(tileRect);
1848 screendata = tileImage.
bits();
1852 #endif // QT_NO_QWS_CURSOR 1861 const int bufferSize = rect.
w * rect.
h * bytesPerPixel + 1;
1862 const int padding =
sizeof(
quint32) -
sizeof(
char);
1870 for (
int i = 0; i < rect.
h; ++i) {
1872 screendata += linestep;
1878 socket->
write((
char *)&subenc, 1);
1881 for (
int i = 0; i < rect.
h; ++i) {
1882 socket->
write((
const char*)screendata,
1883 rect.
w * bytesPerPixel);
1884 screendata += linestep;
1910 for (
int y = 0; y < map->
mapHeight; ++y) {
1911 for (
int x = 0; x < map->
mapWidth; ++x) {
1912 if (!map->
dirty(x, y))
1915 MAP_TILE_SIZE, MAP_TILE_SIZE);
1926 const char tmp[2] = { 0, 0 };
1927 socket->
write(tmp,
sizeof(tmp));
1931 const quint16 count = htons(rects.size());
1932 socket->
write((
char *)&count,
sizeof(count));
1935 if (rects.size() <= 0) {
1942 for (
int i = 0; i < rects.size(); ++i) {
1943 const QRect tileRect = rects.at(i);
1944 const QRfbRect rect(tileRect.
x(), tileRect.
y(),
1948 const quint32 encoding = htonl(0);
1949 socket->
write((
char *)&encoding,
sizeof(encoding));
1953 + rect.x * screenImage.
depth() / 8;
1955 #ifndef QT_NO_QWS_CURSOR 1961 if (doBlendCursor) {
1965 tileImage = screenImage.
copy(tileRect);
1968 screendata = tileImage.
bits();
1972 #endif // QT_NO_QWS_CURSOR 1982 for (
int i = 0; i < rect.h; ++i) {
1984 screendata += linestep;
1989 for (
int i = 0; i < rect.h; ++i) {
1990 socket->
write((
const char*)screendata, rect.w * bytesPerPixel);
1991 screendata += linestep;
2004 return QImage(qvnc_screen->base(), qvnc_screen->deviceWidth(),
2005 qvnc_screen->deviceHeight(), qvnc_screen->linestep(),
2006 qvnc_screen->pixelFormat());
2015 #ifndef QT_NO_QWS_CURSOR 2017 qvnc_cursor->write();
2019 dirtyCursor =
false;
2024 if (dirtyMap()->numDirty > 0) {
2034 state = Unconnected;
2037 #ifndef QT_NO_QWS_CURSOR 2041 if (!qvnc_screen->screen() && !qvnc_screen->d_ptr->noDisablePainting &&
QWSServer::instance())
2113 if (q_ptr->screen())
2114 q_ptr->screen()->setDirty(rect);
2116 if (!vncServer || !vncServer->isConnected())
2124 dirty->setDirty(x, y, force);
2126 vncServer->setDirty();
2134 return capture.
toInt();
2152 dspec = dspec.
left(dspec.
size() - displayIdSpec.
size());
2174 qFatal(
"QVNCScreen: unsupported screen format");
2177 #if Q_BYTE_ORDER == Q_BIG_ENDIAN 2202 if (args.
indexOf(depthRegexp) != -1)
2203 d = depthRegexp.cap(1).toInt();
2206 if (args.
indexOf(sizeRegexp) != -1) {
2213 if (args.
indexOf(mmWidthRegexp) != -1) {
2214 const int mmWidth = mmWidthRegexp.
cap(1).
toInt();
2219 if (args.
indexOf(mmHeightRegexp) != -1) {
2220 const int mmHeight = mmHeightRegexp.
cap(1).
toInt();
2225 if (args.
indexOf(dpiRegexp) != -1) {
2254 #if !defined(QT_NO_QWS_MULTIPROCESS) && !defined(QT_NO_SHAREDMEMORY) 2267 for (
int idx = 0; idx < 16; idx++, val += 17) {
2275 #ifdef QT_QWS_DEPTH_32 2280 #ifdef QT_QWS_DEPTH_24 2285 #ifdef QT_QWS_DEPTH_18 2290 #ifdef QT_QWS_DEPTH_16 2295 #ifdef QT_QWS_DEPTH_15 2300 #ifdef QT_QWS_DEPTH_12 2305 #ifdef QT_QWS_DEPTH_8 2311 qWarning(
"QVNCScreen::initDevice: No support for screen depth %d",
2319 #ifndef QT_NO_QWS_CURSOR 2344 #endif // QT_NO_QWS_VNC
Q_GUI_EXPORT QScreen * qt_screen
The QPainter class performs low-level painting on widgets and other paint devices.
QScreenCursor * screenCursor() const
Returns the real screen cursor used by the proxy screen cursor.
void setSingleShot(bool singleShot)
int screencols
the number of entries in the color table
static const struct @345 keyMap[]
QString qws_qtePipeFilename()
void convertPixels(char *dst, const char *src, int count) const
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
float toFloat(bool *ok=0) const
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
QString & sprintf(const char *format,...)
Safely builds a formatted string from the format string cformat and an arbitrary list of arguments...
The QProxyScreen class provides a generic interface to QScreen implementations.
int height() const
Returns the logical height of the framebuffer in pixels.
static void sendMouseEvent(const QPoint &pos, int state, int wheel=0)
Send a mouse event.
bool dirty(int x, int y) const
void frameBufferUpdateRequest()
QString cap(int nth=0) const
Returns the text captured by the nth subexpression.
#define QT_END_NAMESPACE
This macro expands to.
void disconnect()
Reimplemented Function
QRfbPixelFormat pixelFormat
void setScreen(QScreen *screen)
Sets the real screen to be used by the proxy screen.
int lastIndexIn(const QString &str, int offset=-1, CaretMode caretMode=CaretAtZero) const
Attempts to find a match backwards in str from position offset.
char * data()
Returns a pointer to the data stored in the byte array.
static QWSServer * instance()
The QRegExp class provides pattern matching using regular expressions.
qint64 bytesAvailable() const
Returns the number of incoming bytes that are waiting to be read.
bool flush()
This function writes as much as possible from the internal write buffer to the underlying network soc...
int toInt(bool *ok=0, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
static void setDefaultMouse(const char *)
Sets the mouse driver that will be used if the QWS_MOUSE_PROTO environment variable is not defined...
void setDirty(const QRect &rect, bool force=false)
bool connect(const QString &displaySpec)
Reimplemented Function
bool isNull() const
Returns true if it is a null image, otherwise returns false.
void setScreenCursor(QScreenCursor *cursor)
Sets the real screen cursor to be used for the proxy screen cursor to the cursor specified.
The QByteArray class provides an array of bytes.
bool detach()
Detaches the process from the shared memory segment.
static Qt::MouseButtons buttons
Qt::KeyboardModifiers keymod
bool hasClientCursor() const
void write(QTcpSocket *socket) const
QRgb screenclut[256]
the color table
bool listen(const QHostAddress &address=QHostAddress::Any, quint16 port=0)
Tells the server to listen for incoming connections on address address and port port.
static int bytesPerPixel(QImage::Format format)
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
int width() const
Returns the width of the rectangle.
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
Q_GUI_EXPORT QScreen * qt_get_screen(int display_id, const char *spec)
int deviceWidth() const
Returns the physical width of the framebuffer device in pixels.
int bytesPerLine() const
Returns the number of bytes per image scanline.
long ASN1_INTEGER_get ASN1_INTEGER * a
QVNCDirtyMap(QScreen *screen)
int physHeight
the physical height of the screen in millimeters.
int height() const
Returns the height of the rectangle.
QString errorString() const
Returns a human readable description of the last error that occurred.
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
int size
the number of bytes in the visible region of the frame buffer
bool doPixelConversion() const
QVNCServer(QVNCScreen *screen)
void set(const QImage &image, int hotx, int hoty)
Reimplemented Function
QRfbHextileEncoder(QVNCServer *s)
int physWidth
the physical width of the screen in millimeters.
static int getDisplayId(const QString &spec)
void addObject(QObject *object)
QImage image() const
Returns the cursor's image.
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
QVNCScreen * screen() const
void setPixelFormat(QImage::Format format)
Sets the screen's pixel format to format.
bool initDevice()
This function is called by the Qt for Embedded Linux server to initialize the framebuffer.
friend class QVNCScreenPrivate
static QWSSignalHandler * instance()
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read...
QTcpServer * serverSocket
void setName(const char *n)
Q_CORE_EXPORT void qDebug(const char *,...)
virtual ~QVNCScreen()
Destroys this QVNCScreen object.
bool isAccelerated() const
Returns true if the cursor is accelerated; otherwise false.
uchar * data
points to the first visible pixel in the frame buffer.
int indexOf(const QRegExp &rx, int from=0) const
Returns the index position of the first exact match of rx in the list, searching forward from index p...
#define QT_BEGIN_NAMESPACE
This macro expands to.
void setRefreshRate(int rate)
PixelType pixelType() const
Returns the pixel storage format of the screen.
virtual int depth() const
Reimplement in subclass to return current depth of the screen.
int linestep() const
Returns the length of each scanline of the framebuffer in bytes.
bool initDevice()
Reimplemented Function
bool pixelConversionNeeded() const
The QVNCScreen class implements a screen driver for VNC servers.
void truncate(int pos)
Truncates the string at the given position index.
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
void enablePainting(bool)
Enables painting onto the screen if enable is true; otherwise painting is disabled.
QVNCCursor(QVNCScreen *s)
virtual QTcpSocket * nextPendingConnection()
Returns the next pending connection as a connected QTcpSocket object.
int size() const
Returns the number of characters in this string.
static void sendKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
Sends the given key event.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool read(const uchar *data, int width, int height, int stride)
The QStringList class provides a list of strings.
bool read(const uchar *data, int width, int height, int stride)
int w
the logical width of the screen.
void show()
Reimplemented Function
Q_CORE_EXPORT void qWarning(const char *,...)
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
QImage createAlphaMask(Qt::ImageConversionFlags flags=Qt::AutoColor) const
Builds and returns a 1-bpp mask from the alpha buffer in this image.
bool read(const uchar *data, int width, int height, int stride)
The QTcpSocket class provides a TCP socket.
void hide()
Reimplemented Function
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
The QRegion class specifies a clip region for a painter.
bool attach(AccessMode mode=ReadWrite)
Attempts to attach the process to the shared memory segment identified by the key that was passed to ...
const T * ptr(const T &t)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
int depth() const
Returns the depth of the image.
static QStringList keys()
Returns the list of valid keys, i.e.
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
static void setDefaultKeyboard(const char *)
Sets the keyboard driver that will be used if the QWS_KEYBOARD environment variable is not defined...
QRgb qt_conv16ToRgb(ushort c)
void qSwap(T &value1, T &value2)
const T & at(int i) const
Returns the item at index position i in the vector.
QSize size() const
Returns the size of the image, i.
const char * constData() const
Returns a pointer to the data stored in the byte array.
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
void write(QTcpSocket *s) const
QString join(const QString &sep) const
Joins all the string list's strings into a single string with each element separated by the given sep...
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
void show()
Reimplemented Function
QVNCClientCursor(QVNCServer *s)
uchar * base() const
Returns a pointer to the beginning of the framebuffer.
uchar * bits()
Returns a pointer to the first pixel data.
Q_CORE_EXPORT void qFatal(const char *,...)
int size() const
Returns the size of the attached shared memory segment.
bool create(int size, AccessMode mode=ReadWrite)
Creates a shared memory segment of size bytes with the key passed to the constructor, set with setKey() or set with setNativeKey(), then attaches to the new shared memory segment with the given access mode and returns true.
int width() const
Returns the width of the image.
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
QTcpSocket * clientSocket() const
QImage::Format pixelFormat() const
Returns the pixel format of the screen, or QImage::Format_Invalid if the pixel format is not a suppor...
int compare(const QString &s) const
int right() const
Returns the x-coordinate of the rectangle's right edge.
void write(QTcpSocket *socket) const
void set(const QImage &image, int hotx, int hoty)
Reimplemented Function
int deviceHeight() const
Returns the full height of the framebuffer device in pixels.
int y() const
Returns the y-coordinate of the rectangle's top edge.
QVNCDirtyMap * dirtyMap() const
void setFrameBufferLittleEndian(bool littleEndian)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
void write(QTcpSocket *s)
int x() const
Returns the x-coordinate of the rectangle's left edge.
QRect boundingRect() const
Returns the cursor's bounding rectangle.
int toInt(bool *ok=0, int base=10) const
Returns the byte array converted to an int using base base, which is 10 by default and must be betwee...
void * data()
Returns a pointer to the contents of the shared memory segment, if one is attached.
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)
QRgb * clut()
Returns a pointer to the screen's color lookup table (i.
The QPoint class defines a point in the plane using integer precision.
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
void write(QTcpSocket *socket) const
void hide()
Reimplemented Function
void resize(int size)
Sets the size of the byte array to size bytes.
The QTcpServer class provides a TCP-based server.
The QRect class defines a rectangle in the plane using integer precision.
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
int height() const
Returns the height of the image.
void setDirty(const QRect &)
Reimplemented Function
int size() const
Returns the number of bytes in this byte array.
int y() const
Returns the y coordinate of this point.
static void blendCursor(QImage &image, const QRect &imageRect)
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
void shutdownDevice()
Reimplemented Function
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
int lstep
the number of bytes representing a line in the frame buffer.
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
void setKey(const QString &key)
Sets the platform independent key for this shared memory object.
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
QImage screenImage() const
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
int x() const
Returns the x coordinate of this point.
QString errorString() const
Returns a text description of the last error that occurred.
int h
the logical height of the screen.
QScreen * screen() const
Returns the real screen used by the proxy screen.
QVNCScreenPrivate(QVNCScreen *parent)
Q_GUI_EXPORT QScreenCursor * qt_screencursor
void shutdownDevice()
Reimplemented Function
The QTimer class provides repetitive and single-shot timers.
void move(int x, int y)
Reimplemented Function
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
void setClean(int x, int y)
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
int mapsize
the total number of bytes in the frame buffer
QRfbSingleColorHextile< SRC > singleColorHextile
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
QRfbMultiColorHextile< SRC > multiColorHextile
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).
QRfbDualColorHextile< SRC > dualColorHextile
int size() const
Returns the number of items in the vector.
QVNCScreenPrivate * d_ptr
void move(int x, int y)
Reimplemented Function
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Q_DECL_CONSTEXPR int qRound(qreal d)
virtual void set(const QImage &image, int hotx, int hoty)
Sets the cursor's image to be the given image.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
SocketState state() const
Returns the state of the socket.
QPoint offset() const
Returns the logical offset of the screen, i.
int depth() const
Returns the depth of the framebuffer, in bits per pixel.
int clientBytesPerPixel() const
void disconnect()
Reimplemented Function
QVNCClientCursor * qvnc_cursor
void setDirty(int x, int y, bool force=false)
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
void set(const QImage &image, int hotx, int hoty)
Reimplemented Function
void removeAt(int i)
Removes the item at index position i.
QVNCScreen(int display_id)
Constructs a QVNCScreen object.