Qt 4.8
Public Functions | Public Variables | List of all members
QRfbServerInit Class Reference

#include <qscreenvnc_p.h>

Public Functions

 QRfbServerInit ()
 
 QRfbServerInit ()
 
void read (QTcpSocket *s)
 
void read (QTcpSocket *s)
 
void setName (const char *n)
 
void setName (const char *n)
 
int size () const
 
int size () const
 
void write (QTcpSocket *s)
 
void write (QTcpSocket *s)
 
 ~QRfbServerInit ()
 
 ~QRfbServerInit ()
 

Public Variables

QRfbPixelFormat format
 
quint16 height
 
char * name
 
quint16 width
 

Detailed Description

Definition at line 178 of file qscreenvnc_p.h.

Constructors and Destructors

◆ QRfbServerInit() [1/2]

QRfbServerInit::QRfbServerInit ( )
inline

Definition at line 181 of file qscreenvnc_p.h.

181 { name = 0; }

◆ ~QRfbServerInit() [1/2]

QRfbServerInit::~QRfbServerInit ( )
inline

Definition at line 182 of file qscreenvnc_p.h.

182 { delete[] name; }

◆ QRfbServerInit() [2/2]

QRfbServerInit::QRfbServerInit ( )
inline

Definition at line 183 of file qvncserver.h.

183 { name = 0; }

◆ ~QRfbServerInit() [2/2]

QRfbServerInit::~QRfbServerInit ( )
inline

Definition at line 184 of file qvncserver.h.

184 { delete[] name; }

Functions

◆ read() [1/2]

void QRfbServerInit::read ( QTcpSocket s)

Definition at line 441 of file qscreenvnc_qws.cpp.

442 {
443  s->read((char *)&width, 2);
444  width = ntohs(width);
445  s->read((char *)&height, 2);
446  height = ntohs(height);
447  format.read(s);
448 
449  quint32 len;
450  s->read((char *)&len, 4);
451  len = ntohl(len);
452 
453  name = new char [len + 1];
454  s->read(name, len);
455  name[len] = '\0';
456 }
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read...
Definition: qiodevice.cpp:791
unsigned int quint32
Definition: qglobal.h:938

◆ read() [2/2]

void QRfbServerInit::read ( QTcpSocket s)

◆ setName() [1/2]

void QRfbServerInit::setName ( const char *  n)

Definition at line 434 of file qscreenvnc_qws.cpp.

Referenced by QVNCServer::readClient().

435 {
436  delete[] name;
437  name = new char [strlen(n) + 1];
438  strcpy(name, n);
439 }

◆ setName() [2/2]

void QRfbServerInit::setName ( const char *  n)

◆ size() [1/2]

int QRfbServerInit::size ( ) const
inline

Definition at line 184 of file qscreenvnc_p.h.

184 { return QRfbPixelFormat::size() + 8 + strlen(name); }
static int size()
Definition: qscreenvnc_p.h:161

◆ size() [2/2]

int QRfbServerInit::size ( ) const
inline

Definition at line 186 of file qvncserver.h.

186 { return QRfbPixelFormat::size() + 8 + strlen(name); }
static int size()
Definition: qscreenvnc_p.h:161

◆ write() [1/2]

void QRfbServerInit::write ( QTcpSocket s)

Definition at line 458 of file qscreenvnc_qws.cpp.

Referenced by QVNCServer::readClient().

459 {
460  quint16 t = htons(width);
461  s->write((char *)&t, 2);
462  t = htons(height);
463  s->write((char *)&t, 2);
464  format.write(s);
465  quint32 len = strlen(name);
466  len = htonl(len);
467  s->write((char *)&len, 4);
468  s->write(name, strlen(name));
469 }
unsigned short quint16
Definition: qglobal.h:936
unsigned int quint32
Definition: qglobal.h:938
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
Definition: qiodevice.cpp:1342

◆ write() [2/2]

void QRfbServerInit::write ( QTcpSocket s)

Properties

◆ format

QRfbPixelFormat QRfbServerInit::format

Definition at line 192 of file qscreenvnc_p.h.

Referenced by QVNCServer::readClient().

◆ height

quint16 QRfbServerInit::height

Definition at line 191 of file qscreenvnc_p.h.

Referenced by QVNCServer::readClient().

◆ name

char * QRfbServerInit::name

Definition at line 193 of file qscreenvnc_p.h.

◆ width

quint16 QRfbServerInit::width

Definition at line 190 of file qscreenvnc_p.h.

Referenced by QVNCServer::readClient().


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