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

#include <qscreenvnc_p.h>

Inheritance diagram for QVNCScreenPrivate:
QObject QObject

Public Functions

void configure ()
 
void configure ()
 
 QVNCScreenPrivate (QVNCScreen *parent)
 
 QVNCScreenPrivate (QVNCScreen *parent, int screenId)
 
void setDirty (const QRect &rect, bool force=false)
 
void setDirty (const QRect &rect, bool force=false)
 
 ~QVNCScreenPrivate ()
 
 ~QVNCScreenPrivate ()
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Public Variables

QVNCDirtyMapdirty
 
bool doOnScreenSurface
 
qreal dpiX
 
qreal dpiY
 
bool noDisablePainting
 
QVNCScreenq_ptr
 
int refreshRate
 
QSharedMemory shm
 
QVNCServervncServer
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Functions inherited from QObject
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 receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 241 of file qscreenvnc_p.h.

Constructors and Destructors

◆ QVNCScreenPrivate() [1/2]

QVNCScreenPrivate::QVNCScreenPrivate ( QVNCScreen parent)

Definition at line 196 of file qscreenvnc_qws.cpp.

197  : dpiX(72), dpiY(72), doOnScreenSurface(false), refreshRate(25),
198  vncServer(0), q_ptr(parent), noDisablePainting(false)
199 {
200 #ifdef QT_BUILD_INTERNAL
201  noDisablePainting = (qgetenv("QT_VNC_NO_DISABLEPAINTING").toInt() > 0);
202 #endif
203 #ifndef QT_NO_QWS_SIGNALHANDLER
205 #endif
206 }
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
QVNCScreen * q_ptr
Definition: qscreenvnc_p.h:261
void addObject(QObject *object)
static QWSSignalHandler * instance()
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...
QVNCServer * vncServer
Definition: qscreenvnc_p.h:255

◆ ~QVNCScreenPrivate() [1/2]

QVNCScreenPrivate::~QVNCScreenPrivate ( )

Definition at line 208 of file qscreenvnc_qws.cpp.

Referenced by QVNCScreenPrivate().

209 {
210 #if defined(QT_NO_QWS_MULTIPROCESS) || defined(QT_NO_SHAREDMEMORY)
211  if (q_ptr->screen())
212  return;
213 
214  delete[] q_ptr->data;
215  q_ptr->data = 0;
216 #else
217  shm.detach();
218 #endif
219 }
QVNCScreen * q_ptr
Definition: qscreenvnc_p.h:261
bool detach()
Detaches the process from the shared memory segment.
uchar * data
points to the first visible pixel in the frame buffer.
Definition: qscreen_qws.h:311
QSharedMemory shm
Definition: qscreenvnc_p.h:258
QScreen * screen() const
Returns the real screen used by the proxy screen.

◆ QVNCScreenPrivate() [2/2]

QVNCScreenPrivate::QVNCScreenPrivate ( QVNCScreen parent,
int  screenId 
)

Definition at line 1888 of file qvncserver.cpp.

1889  : dpiX(72), dpiY(72), doOnScreenSurface(false), refreshRate(25),
1890  vncServer(0), q_ptr(parent)
1891 {
1892 #if 0//ndef QT_NO_QWS_SIGNALHANDLER
1894 #endif
1895 
1896  vncServer = new QVNCServer(q_ptr, screenId);
1898 
1899 
1900  Q_ASSERT(q_ptr->depth() == 32);
1901 
1903 }
QVNCScreen * q_ptr
Definition: qscreenvnc_p.h:261
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void addObject(QObject *object)
static QWSSignalHandler * instance()
void setRefreshRate(int rate)
Definition: qscreenvnc_p.h:442
virtual int depth() const
Reimplement in subclass to return current depth of the screen.
Definition: fb_base.h:163
QVNCDirtyMap * dirty
Definition: qscreenvnc_p.h:253
QVNCServer * vncServer
Definition: qscreenvnc_p.h:255

◆ ~QVNCScreenPrivate() [2/2]

QVNCScreenPrivate::~QVNCScreenPrivate ( )

Functions

◆ configure() [1/2]

void QVNCScreenPrivate::configure ( )

Definition at line 221 of file qscreenvnc_qws.cpp.

Referenced by QVNCScreen::connect().

222 {
223  if (q_ptr->screen())
224  return;
225 
226  q_ptr->lstep = q_ptr->dw * ((q_ptr->d + 7) / 8);
227  q_ptr->size = q_ptr->h * q_ptr->lstep;
228  q_ptr->mapsize = q_ptr->size;
229  q_ptr->physWidth = qRound(q_ptr->dw * qreal(25.4) / dpiX);
230  q_ptr->physHeight = qRound(q_ptr->dh * qreal(25.4) / dpiY);
231 
232  switch (q_ptr->d) {
233  case 1:
235  break;
236  case 8:
238  break;
239  case 12:
241  break;
242  case 15:
244  break;
245  case 16:
247  break;
248  case 18:
250  break;
251  case 24:
253  break;
254  case 32:
256  break;
257  }
258 
259 #if !defined(QT_NO_QWS_MULTIPROCESS) && !defined(QT_NO_SHAREDMEMORY)
260  if (q_ptr->size != shm.size()) {
261  shm.detach();
262  const QString key = qws_qtePipeFilename() +
263  QString().sprintf("_vnc_%d_%d",
265  shm.setKey(key);
267  if (!shm.create(q_ptr->size)) {
268  qWarning() << "QVNCScreen could not create shared memory:"
269  << shm.errorString();
270  if (!shm.attach()) {
271  qWarning() << "QVNCScreen could not attach to shared memory:"
272  << shm.errorString();
273  }
274  }
275  } else if (!shm.attach()) {
276  qWarning() << "QVNCScreen could not attach to shared memory:"
277  << shm.errorString();
278  }
279  q_ptr->data = reinterpret_cast<uchar*>(shm.data());
280  }
281 #else
282  if (q_ptr->data)
283  delete[] q_ptr->data;
284  q_ptr->data = new uchar[q_ptr->size];
285 #endif
286 }
QString qws_qtePipeFilename()
QString & sprintf(const char *format,...)
Safely builds a formatted string from the format string cformat and an arbitrary list of arguments...
Definition: qstring.cpp:5567
double qreal
Definition: qglobal.h:1193
int d
the pixel depth
Definition: qscreen_qws.h:327
QVNCScreen * q_ptr
Definition: qscreenvnc_p.h:261
bool detach()
Detaches the process from the shared memory segment.
int physHeight
the physical height of the screen in millimeters.
Definition: qscreen_qws.h:340
The QString class provides a Unicode character string.
Definition: qstring.h:83
int size
the number of bytes in the visible region of the frame buffer
Definition: qscreen_qws.h:334
int physWidth
the physical width of the screen in millimeters.
Definition: qscreen_qws.h:339
void setPixelFormat(QImage::Format format)
Sets the screen&#39;s pixel format to format.
unsigned char uchar
Definition: qglobal.h:994
uchar * data
points to the first visible pixel in the frame buffer.
Definition: qscreen_qws.h:311
Q_CORE_EXPORT void qWarning(const char *,...)
bool attach(AccessMode mode=ReadWrite)
Attempts to attach the process to the shared memory segment identified by the key that was passed to ...
int displayId
Definition: qscreen_qws.h:337
int dw
the device width
Definition: qscreen_qws.h:331
int size() const
Returns the size of the attached shared memory segment.
int dh
the device height
Definition: qscreen_qws.h:332
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.
QSharedMemory shm
Definition: qscreenvnc_p.h:258
void * data()
Returns a pointer to the contents of the shared memory segment, if one is attached.
int key
int lstep
the number of bytes representing a line in the frame buffer.
Definition: qscreen_qws.h:325
void setKey(const QString &key)
Sets the platform independent key for this shared memory object.
QString errorString() const
Returns a text description of the last error that occurred.
int h
the logical height of the screen.
Definition: qscreen_qws.h:326
QScreen * screen() const
Returns the real screen used by the proxy screen.
int mapsize
the total number of bytes in the frame buffer
Definition: qscreen_qws.h:335
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ configure() [2/2]

void QVNCScreenPrivate::configure ( )

◆ setDirty() [1/2]

void QVNCScreenPrivate::setDirty ( const QRect rect,
bool  force = false 
)

Definition at line 2108 of file qscreenvnc_qws.cpp.

Referenced by QVNCScreen::doRedraw(), QVNCServer::frameBufferUpdateRequest(), QVNCScreenPrivate(), QVNCScreen::setDirty(), and QVNCCursor::setDirty().

2109 {
2110  if (rect.isEmpty())
2111  return;
2112 
2113  if (q_ptr->screen())
2114  q_ptr->screen()->setDirty(rect);
2115 
2116  if (!vncServer || !vncServer->isConnected())
2117  return;
2118 
2119  const QRect r = rect.translated(-q_ptr->offset());
2120  const int x1 = r.x() / MAP_TILE_SIZE;
2121  int y = r.y() / MAP_TILE_SIZE;
2122  for (; (y <= r.bottom() / MAP_TILE_SIZE) && y < dirty->mapHeight; y++)
2123  for (int x = x1; (x <= r.right() / MAP_TILE_SIZE) && x < dirty->mapWidth; x++)
2124  dirty->setDirty(x, y, force);
2125 
2126  vncServer->setDirty();
2127 }
bool isConnected() const
Definition: qscreenvnc_p.h:441
QVNCScreen * q_ptr
Definition: qscreenvnc_p.h:261
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...
Definition: qrect.h:328
#define MAP_TILE_SIZE
Definition: qscreenvnc_p.h:100
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
virtual void setDirty(const QRect &)
Marks the given rectangle as dirty.
virtual void setDirty(int x, int y, bool force=false)=0
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
Definition: qrect.h:234
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QScreen * screen() const
Returns the real screen used by the proxy screen.
QVNCDirtyMap * dirty
Definition: qscreenvnc_p.h:253
QPoint offset() const
Returns the logical offset of the screen, i.
QVNCServer * vncServer
Definition: qscreenvnc_p.h:255

◆ setDirty() [2/2]

void QVNCScreenPrivate::setDirty ( const QRect rect,
bool  force = false 
)

Properties

◆ dirty

QVNCDirtyMap * QVNCScreenPrivate::dirty

◆ doOnScreenSurface

bool QVNCScreenPrivate::doOnScreenSurface

Definition at line 252 of file qscreenvnc_p.h.

Referenced by QVNCScreen::connect().

◆ dpiX

qreal QVNCScreenPrivate::dpiX

Definition at line 250 of file qscreenvnc_p.h.

Referenced by configure(), and QVNCScreen::connect().

◆ dpiY

qreal QVNCScreenPrivate::dpiY

Definition at line 251 of file qscreenvnc_p.h.

Referenced by configure(), and QVNCScreen::connect().

◆ noDisablePainting

bool QVNCScreenPrivate::noDisablePainting

◆ q_ptr

QVNCScreen * QVNCScreenPrivate::q_ptr

Definition at line 261 of file qscreenvnc_p.h.

Referenced by configure(), QVNCScreenPrivate(), and ~QVNCScreenPrivate().

◆ refreshRate

int QVNCScreenPrivate::refreshRate

Definition at line 254 of file qscreenvnc_p.h.

Referenced by QVNCScreen::connect(), QVNCScreen::initDevice(), and QVNCScreenPrivate().

◆ shm

QSharedMemory QVNCScreenPrivate::shm

Definition at line 258 of file qscreenvnc_p.h.

Referenced by configure(), QVNCScreen::disconnect(), and ~QVNCScreenPrivate().

◆ vncServer

QVNCServer * QVNCScreenPrivate::vncServer

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