Qt 4.8
Public Functions | Private Functions | Properties | Friends | List of all members
QVNCScreen Class Reference

The QVNCScreen class implements a screen driver for VNC servers. More...

#include <qscreenvnc_qws.h>

Inheritance diagram for QVNCScreen:
QFbScreen QProxyScreen QPlatformScreen QScreen QObject

Public Functions

ucharbase () const
 
bool connect (const QString &displaySpec)
 Reimplemented Function More...
 
QVNCDirtyMapdirtyMap ()
 
void disconnect ()
 Reimplemented Function More...
 
bool initDevice ()
 Reimplemented Function More...
 
int linestep () const
 
 QVNCScreen (int display_id)
 Constructs a QVNCScreen object. More...
 
 QVNCScreen (QRect screenSize, int screenId)
 
void setDirty (const QRect &)
 Reimplemented Function More...
 
void shutdownDevice ()
 Reimplemented Function More...
 
virtual ~QVNCScreen ()
 Destroys this QVNCScreen object. More...
 
- Public Functions inherited from QFbScreen
virtual void addWindow (QFbWindow *surface)
 
virtual int depth () const
 Reimplement in subclass to return current depth of the screen. More...
 
virtual QImage::Format format () const
 Reimplement in subclass to return the image format which corresponds to the screen format. More...
 
virtual QRect geometry () const
 Reimplement in subclass to return the pixel geometry of the screen. More...
 
QImageimage () const
 
virtual void lower (QPlatformWindow *surface)
 
QPaintDevicepaintDevice () const
 
virtual QSize physicalSize () const
 Reimplement this function in subclass to return the physical size of the screen. More...
 
 QFbScreen ()
 
virtual void raise (QPlatformWindow *surface)
 
virtual void removeWindow (QFbWindow *surface)
 
virtual void setDepth (int depth)
 
virtual void setFormat (QImage::Format format)
 
virtual void setGeometry (QRect rect)
 
virtual void setPhysicalSize (QSize size)
 
virtual QWidgettopLevelAt (const QPoint &p) const
 Return the given top level widget for a given position. More...
 
 ~QFbScreen ()
 
- Public Functions inherited from QPlatformScreen
virtual QRect availableGeometry () const
 Reimplement in subclass to return the pixel geometry of the available space This normally is the desktop screen minus the task manager, global menubar etc. More...
 
virtual ~QPlatformScreen ()
 
- 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 Functions inherited from QProxyScreen
void blank (bool on)
 Reimplemented Function More...
 
void blit (const QImage &img, const QPoint &topLeft, const QRegion &region)
 Reimplemented Function More...
 
QWSWindowSurfacecreateSurface (QWidget *widget) const
 Reimplemented Function More...
 
QWSWindowSurfacecreateSurface (const QString &key) const
 Reimplemented Function More...
 
void exposeRegion (QRegion r, int changing)
 Reimplemented Function More...
 
void haltUpdates ()
 
bool isInterlaced () const
 Reimplemented Function More...
 
bool isTransformed () const
 Reimplemented Function More...
 
QSize mapFromDevice (const QSize &s) const
 Reimplemented Function More...
 
QPoint mapFromDevice (const QPoint &, const QSize &) const
 Reimplemented Function More...
 
QRect mapFromDevice (const QRect &, const QSize &) const
 Reimplemented Function More...
 
QRegion mapFromDevice (const QRegion &, const QSize &) const
 Reimplemented Function More...
 
QSize mapToDevice (const QSize &s) const
 Reimplemented Function More...
 
QPoint mapToDevice (const QPoint &, const QSize &) const
 Reimplemented Function More...
 
QRect mapToDevice (const QRect &, const QSize &) const
 Reimplemented Function More...
 
QRegion mapToDevice (const QRegion &, const QSize &) const
 Reimplemented Function More...
 
int memoryNeeded (const QString &)
 
bool onCard (const unsigned char *) const
 Reimplemented Function More...
 
bool onCard (const unsigned char *, ulong &out_offset) const
 Reimplemented Function More...
 
 QProxyScreen (int display_id, ClassId=ProxyClass)
 Constructs a proxy screen with the given displayId and classId. More...
 
QRegion region () const
 Reimplemented Function More...
 
void restore ()
 Reimplemented Function More...
 
void resumeUpdates ()
 
void save ()
 Reimplemented Function More...
 
QScreenscreen () const
 Returns the real screen used by the proxy screen. More...
 
void setMode (int width, int height, int depth)
 Reimplemented Function More...
 
void setScreen (QScreen *screen)
 Sets the real screen to be used by the proxy screen. More...
 
int sharedRamSize (void *)
 
void solidFill (const QColor &color, const QRegion &region)
 Reimplemented Function More...
 
QList< QScreen * > subScreens () const
 Reimplemented Function More...
 
bool supportsDepth (int) const
 Reimplemented Function More...
 
int transformOrientation () const
 Reimplemented Function More...
 
 ~QProxyScreen ()
 Destroys the proxy screen. More...
 
- Public Functions inherited from QScreen
virtual int alloc (unsigned int, unsigned int, unsigned int)
 Returns the index in the screen's palette which is the closest match to the given RGB value (red, green, blue). More...
 
ucharbase () const
 Returns a pointer to the beginning of the framebuffer. More...
 
void blit (QWSWindow *bs, const QRegion &clip)
 
virtual ucharcache (int)
 
ClassId classId () const
 Returns the class identifier for the screen object. More...
 
QRgbclut ()
 Returns a pointer to the screen's color lookup table (i. More...
 
int colorCount ()
 Returns the number of entries in the screen's color lookup table (i. More...
 
int depth () const
 Returns the depth of the framebuffer, in bits per pixel. More...
 
int deviceHeight () const
 Returns the full height of the framebuffer device in pixels. More...
 
int deviceWidth () const
 Returns the physical width of the framebuffer device in pixels. More...
 
QGraphicsSystemgraphicsSystem () const
 
int height () const
 Returns the logical height of the framebuffer in pixels. More...
 
int linestep () const
 Returns the length of each scanline of the framebuffer in bytes. More...
 
virtual QImage mapFromDevice (const QImage &) const
 Maps the given image from the framebuffer coordinate system to the coordinate space used by the application. More...
 
virtual QImage mapToDevice (const QImage &) const
 Maps the given image from the coordinate space used by the application to the framebuffer coordinate system. More...
 
QT_DEPRECATED int numCols ()
 
QPoint offset () const
 Returns the logical offset of the screen, i. More...
 
int physicalHeight () const
 Returns the physical height of the screen in millimeters. More...
 
int physicalWidth () const
 Returns the physical width of the screen in millimeters. More...
 
QImage::Format pixelFormat () const
 Returns the pixel format of the screen, or QImage::Format_Invalid if the pixel format is not a supported image format. More...
 
PixelType pixelType () const
 Returns the pixel storage format of the screen. More...
 
QPixmapDataFactorypixmapDataFactory () const
 
virtual int pixmapDepth () const
 Returns the preferred depth for pixmaps, in bits per pixel. More...
 
virtual int pixmapLinestepAlignment ()
 Returns the value (in bits) to which individual scanlines of pixmaps held in the graphics card's memory, should be aligned. More...
 
virtual int pixmapOffsetAlignment ()
 Returns the value (in bits) to which the start address of pixmaps held in the graphics card's memory, should be aligned. More...
 
 QScreen (int display_id, ClassId classId)
 Constructs a new screen driver. More...
 
 QScreen (int display_id)
 Constructs a new screen driver. More...
 
int screenSize () const
 Returns the size of the screen in bytes. More...
 
virtual void set (unsigned int, unsigned int, unsigned int, unsigned int)
 
void setOffset (const QPoint &p)
 
int subScreenIndexAt (const QPoint &p) const
 Returns the index of the subscreen at the given position; returns -1 if no screen is found. More...
 
int totalSize () const
 Returns the size of the available graphics card memory (including the screen) in bytes. More...
 
virtual void uncache (uchar *)
 
int width () const
 Returns the logical width of the framebuffer in pixels. More...
 
virtual ~QScreen ()
 Destroys this screen driver. More...
 

Private Functions

QRegion doRedraw ()
 
bool swapBytes () const
 

Properties

QVNCScreenPrivated_ptr
 
QVNCServerserver
 

Friends

class QVNCClientCursor
 
class QVNCCursor
 
class QVNCIntegration
 
class QVNCScreenPrivate
 
class QVNCServer
 

Additional Inherited Members

- Public Types inherited from QScreen
enum  ClassId {
  LinuxFBClass, TransformedClass, VNCClass, MultiClass,
  VFbClass, DirectFBClass, SvgalibClass, ProxyClass,
  GLClass, IntfbClass, CustomClass = 1024
}
 This enum defines the class identifiers for the known screen subclasses. More...
 
enum  PixelType { NormalPixel, BGRPixel }
 This enum describes the pixel storage format of the screen, i. More...
 
- 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 QPlatformScreen
static QPlatformScreenplatformScreenForWidget (const QWidget *widget)
 
- 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 Functions inherited from QScreen
static QScreeninstance ()
 Returns a pointer to the application's QScreen instance. More...
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Slots inherited from QFbScreen
- 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 Functions inherited from QScreen
void setGraphicsSystem (QGraphicsSystem *system)
 
void setPixelFormat (QImage::Format format)
 Sets the screen's pixel format to format. More...
 
void setPixmapDataFactory (QPixmapDataFactory *factory)
 
- Protected Variables inherited from QFbScreen
QPlatformSoftwareCursorcursor
 
int mDepth
 
QImage::Format mFormat
 
QRect mGeometry
 
QSize mPhysicalSize
 
QImagemScreenImage
 
QTimer redrawTimer
 
QRegion repaintRegion
 
QList< QFbWindow * > windowStack
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Protected Variables inherited from QScreen
int d
 the pixel depth More...
 
uchardata
 points to the first visible pixel in the frame buffer. More...
 
int dh
 the device height More...
 
int displayId
 
int dw
 the device width More...
 
QPoolEntryentries
 
int * entryp
 
bool grayscale
 the gray scale screen mode flag More...
 
int h
 the logical height of the screen. More...
 
unsigned int * lowest
 
int lstep
 the number of bytes representing a line in the frame buffer. More...
 
int mapsize
 the total number of bytes in the frame buffer More...
 
int physHeight
 the physical height of the screen in millimeters. More...
 
int physWidth
 the physical width of the screen in millimeters. More...
 
PixelType pixeltype
 set to BGRPixel More...
 
QRgb screenclut [256]
 the color table More...
 
int screencols
 the number of entries in the color table More...
 
int size
 the number of bytes in the visible region of the frame buffer More...
 
int w
 the logical width of the screen. More...
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 
- Static Protected Variables inherited from QScreen
static ClearCacheFunc clearCacheFunc = 0
 

Detailed Description

The QVNCScreen class implements a screen driver for VNC servers.

Warning
This function is not part of the public interface.

Note that this class is only available in Qt for Embedded Linux. Custom screen drivers can be added by subclassing the QScreen class, using the QScreenDriverFactory class to dynamically load the driver into the application.

The VNC protocol allows you to view and interact with the computer's display from anywhere on the network. See the The VNC Protocol and Qt for Embedded Linux{VNC protocol} documentation for more details.

The default implementation of QVNCScreen inherits QLinuxFbScreen, but any QScreen subclass, or QScreen itself, can serve as its base class. This is easily achieved by manipulating the VNCSCREEN_BASE definition in the header file.

See also
QScreen, {Running Applications}

Definition at line 57 of file qscreenvnc_qws.h.

Constructors and Destructors

◆ QVNCScreen() [1/2]

QVNCScreen::QVNCScreen ( int  displayId)
explicit

Constructs a QVNCScreen object.

The displayId argument identifies the Qt for Embedded Linux server to connect to.

Definition at line 2086 of file qscreenvnc_qws.cpp.

2087  : QProxyScreen(display_id, VNCClass)
2088 {
2089  d_ptr = new QVNCScreenPrivate(this);
2090 }
QProxyScreen(int display_id, ClassId=ProxyClass)
Constructs a proxy screen with the given displayId and classId.
friend class QVNCScreenPrivate
QVNCScreenPrivate * d_ptr

◆ ~QVNCScreen()

QVNCScreen::~QVNCScreen ( )
virtual

Destroys this QVNCScreen object.

Definition at line 2095 of file qscreenvnc_qws.cpp.

2096 {
2097  delete d_ptr;
2098 }
QVNCScreenPrivate * d_ptr

◆ QVNCScreen() [2/2]

QVNCScreen::QVNCScreen ( QRect  screenSize,
int  screenId 
)

Definition at line 54 of file qvncintegration.cpp.

56 {
57  setGeometry(screenSize);
58  setDepth(32);
60  setPhysicalSize((geometry().size()*254)/720);
61 
62 
63  d_ptr = new QVNCScreenPrivate(this, screenId);
64 
65  cursor = new QVNCCursor(d_ptr->vncServer, this);
66  d_ptr->vncServer->setCursor(static_cast<QVNCCursor *>(cursor));
67 }
void setCursor(QVNCCursor *c)
Definition: qvncserver.h:476
virtual void setFormat(QImage::Format format)
Definition: fb_base.cpp:172
int size
the number of bytes in the visible region of the frame buffer
Definition: qscreen_qws.h:334
friend class QVNCScreenPrivate
friend class QVNCCursor
QPlatformSoftwareCursor * cursor
Definition: fb_base.h:186
virtual void setPhysicalSize(QSize size)
Definition: fb_base.cpp:167
virtual void setDepth(int depth)
Definition: fb_base.cpp:162
virtual QRect geometry() const
Reimplement in subclass to return the pixel geometry of the screen.
Definition: fb_base.h:162
QVNCScreenPrivate * d_ptr
virtual void setGeometry(QRect rect)
Definition: fb_base.cpp:152
QVNCServer * vncServer
Definition: qscreenvnc_p.h:255

Functions

◆ base()

uchar* QVNCScreen::base ( ) const
inline

Definition at line 64 of file qvncintegration.h.

Referenced by QVNCDirtyMap::QVNCDirtyMap().

64 { return image() ? image()->bits() : 0; }
QImage * image() const
Definition: fb_base.h:180
uchar * bits()
Returns a pointer to the first pixel data.
Definition: qimage.cpp:1946

◆ connect()

bool QVNCScreen::connect ( const QString displaySpec)
virtual

Reimplemented Function

Reimplemented from QProxyScreen.

Definition at line 2142 of file qscreenvnc_qws.cpp.

2143 {
2144  QString dspec = displaySpec;
2145  if (dspec.startsWith(QLatin1String("vnc:"), Qt::CaseInsensitive))
2146  dspec = dspec.mid(QString::fromLatin1("vnc:").size());
2147  else if (dspec.compare(QLatin1String("vnc"), Qt::CaseInsensitive) == 0)
2148  dspec = QString();
2149 
2150  const QString displayIdSpec = QString::fromLatin1(" :%1").arg(displayId);
2151  if (dspec.endsWith(displayIdSpec))
2152  dspec = dspec.left(dspec.size() - displayIdSpec.size());
2153 
2154  QStringList args = dspec.split(QLatin1Char(':'),
2156  QRegExp refreshRegexp(QLatin1String("^refreshrate=(\\d+)$"));
2157  int index = args.indexOf(refreshRegexp);
2158  if (index >= 0) {
2159  d_ptr->refreshRate = refreshRegexp.cap(1).toInt();
2160  args.removeAt(index);
2161  dspec = args.join(QLatin1String(":"));
2162  }
2163 
2164  QString driver = dspec;
2165  int colon = driver.indexOf(QLatin1Char(':'));
2166  if (colon >= 0)
2167  driver.truncate(colon);
2168 
2169  if (QScreenDriverFactory::keys().contains(driver, Qt::CaseInsensitive)) {
2170  const int id = getDisplayId(dspec);
2171  QScreen *s = qt_get_screen(id, dspec.toLatin1().constData());
2173  || s->pixelFormat() == QImage::Format_Invalid && s->depth() == 8)
2174  qFatal("QVNCScreen: unsupported screen format");
2175  setScreen(s);
2176  } else { // create virtual screen
2177 #if Q_BYTE_ORDER == Q_BIG_ENDIAN
2179 #endif
2180 
2181  d = qgetenv("QWS_DEPTH").toInt();
2182  if (!d)
2183  d = 16;
2184 
2185  QByteArray str = qgetenv("QWS_SIZE");
2186  if(!str.isEmpty()) {
2187  sscanf(str.constData(), "%dx%d", &w, &h);
2188  dw = w;
2189  dh = h;
2190  } else {
2191  dw = w = 640;
2192  dh = h = 480;
2193  }
2194 
2195  const QStringList args = displaySpec.split(QLatin1Char(':'),
2197 
2198  if (args.contains(QLatin1String("paintonscreen"), Qt::CaseInsensitive))
2199  d_ptr->doOnScreenSurface = true;
2200 
2201  QRegExp depthRegexp(QLatin1String("^depth=(\\d+)$"));
2202  if (args.indexOf(depthRegexp) != -1)
2203  d = depthRegexp.cap(1).toInt();
2204 
2205  QRegExp sizeRegexp(QLatin1String("^size=(\\d+)x(\\d+)$"));
2206  if (args.indexOf(sizeRegexp) != -1) {
2207  dw = w = sizeRegexp.cap(1).toInt();
2208  dh = h = sizeRegexp.cap(2).toInt();
2209  }
2210 
2211  // Handle display physical size spec.
2212  QRegExp mmWidthRegexp(QLatin1String("^mmWidth=?(\\d+)$"));
2213  if (args.indexOf(mmWidthRegexp) != -1) {
2214  const int mmWidth = mmWidthRegexp.cap(1).toInt();
2215  if (mmWidth > 0)
2216  d_ptr->dpiX = dw * 25.4 / mmWidth;
2217  }
2218  QRegExp mmHeightRegexp(QLatin1String("^mmHeight=?(\\d+)$"));
2219  if (args.indexOf(mmHeightRegexp) != -1) {
2220  const int mmHeight = mmHeightRegexp.cap(1).toInt();
2221  if (mmHeight > 0)
2222  d_ptr->dpiY = dh * 25.4 / mmHeight;
2223  }
2224  QRegExp dpiRegexp(QLatin1String("^dpi=(\\d+)(?:,(\\d+))?$"));
2225  if (args.indexOf(dpiRegexp) != -1) {
2226  const qreal dpiX = dpiRegexp.cap(1).toFloat();
2227  const qreal dpiY = dpiRegexp.cap(2).toFloat();
2228  if (dpiX > 0)
2229  d_ptr->dpiX = dpiX;
2230  d_ptr->dpiY = (dpiY > 0 ? dpiY : dpiX);
2231  }
2232 
2233  if (args.contains(QLatin1String("noDisablePainting")))
2234  d_ptr->noDisablePainting = true;
2235 
2238 
2239  d_ptr->configure();
2240  }
2241 
2242  // XXX
2243  qt_screen = this;
2244 
2245  return true;
2246 }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
double qreal
Definition: qglobal.h:1193
void setScreen(QScreen *screen)
Sets the real screen to be used by the proxy screen.
int d
the pixel depth
Definition: qscreen_qws.h:327
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
static void setDefaultMouse(const char *)
Sets the mouse driver that will be used if the QWS_MOUSE_PROTO environment variable is not defined...
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
Q_GUI_EXPORT QScreen * qt_get_screen(int display_id, const char *spec)
The QString class provides a Unicode character string.
Definition: qstring.h:83
static int getDisplayId(const QString &spec)
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...
Definition: qstringlist.h:195
void truncate(int pos)
Truncates the string at the given position index.
Definition: qstring.cpp:4603
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
Definition: qstring.cpp:3664
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
int w
the logical width of the screen.
Definition: qscreen_qws.h:324
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:2838
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
int displayId
Definition: qscreen_qws.h:337
static QStringList keys()
Returns the list of valid keys, i.e.
static void setDefaultKeyboard(const char *)
Sets the keyboard driver that will be used if the QWS_KEYBOARD environment variable is not defined...
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
QString join(const QString &sep) const
Joins all the string list&#39;s strings into a single string with each element separated by the given sep...
Definition: qstringlist.h:162
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...
Definition: qstring.cpp:3706
int dw
the device width
Definition: qscreen_qws.h:331
Q_CORE_EXPORT void qFatal(const char *,...)
int dh
the device height
Definition: qscreen_qws.h:332
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
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
Definition: qstring.cpp:5037
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...
Definition: qstring.cpp:4188
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...
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
quint16 index
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
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...
Definition: qstring.cpp:6526
int h
the logical height of the screen.
Definition: qscreen_qws.h:326
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
Definition: qstring.cpp:3796
QVNCScreenPrivate * d_ptr
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
int depth() const
Returns the depth of the framebuffer, in bits per pixel.
Definition: qscreen_qws.h:229
void removeAt(int i)
Removes the item at index position i.
Definition: qlist.h:480

◆ dirtyMap()

QVNCDirtyMap * QVNCScreen::dirtyMap ( )

Definition at line 69 of file qvncintegration.cpp.

Referenced by base().

70 {
71  return d_ptr->dirty;
72 }
QVNCDirtyMap * dirty
Definition: qscreenvnc_p.h:253
QVNCScreenPrivate * d_ptr

◆ disconnect()

void QVNCScreen::disconnect ( )
virtual

Reimplemented Function

Reimplemented from QProxyScreen.

Definition at line 2251 of file qscreenvnc_qws.cpp.

2252 {
2254 #if !defined(QT_NO_QWS_MULTIPROCESS) && !defined(QT_NO_SHAREDMEMORY)
2255  d_ptr->shm.detach();
2256 #endif
2257 }
void disconnect()
Reimplemented Function
bool detach()
Detaches the process from the shared memory segment.
QSharedMemory shm
Definition: qscreenvnc_p.h:258
QVNCScreenPrivate * d_ptr

◆ doRedraw()

QRegion QVNCScreen::doRedraw ( )
privatevirtual

Reimplemented from QFbScreen.

Definition at line 74 of file qvncintegration.cpp.

75 {
76  QRegion touched;
77  touched = QFbScreen::doRedraw();
78 
79  QVector<QRect> rects = touched.rects();
80  for (int i = 0; i < rects.size(); i++)
81  d_ptr->setDirty(rects[i]);
82  return touched;
83 }
virtual QRegion doRedraw()
Definition: fb_base.cpp:229
void setDirty(const QRect &rect, bool force=false)
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
Definition: qregion.cpp:4412
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137
QVNCScreenPrivate * d_ptr

◆ initDevice()

bool QVNCScreen::initDevice ( )
virtual

Reimplemented Function

Reimplemented from QProxyScreen.

Definition at line 2262 of file qscreenvnc_qws.cpp.

2263 {
2264  if (!QProxyScreen::screen() && d == 4) {
2265  screencols = 16;
2266  int val = 0;
2267  for (int idx = 0; idx < 16; idx++, val += 17) {
2268  screenclut[idx] = qRgb(val, val, val);
2269  }
2270  }
2271  d_ptr->vncServer = new QVNCServer(this, displayId);
2273 
2274  switch (depth()) {
2275 #ifdef QT_QWS_DEPTH_32
2276  case 32:
2278  break;
2279 #endif
2280 #ifdef QT_QWS_DEPTH_24
2281  case 24:
2283  break;
2284 #endif
2285 #ifdef QT_QWS_DEPTH_18
2286  case 18:
2288  break;
2289 #endif
2290 #ifdef QT_QWS_DEPTH_16
2291  case 16:
2293  break;
2294 #endif
2295 #ifdef QT_QWS_DEPTH_15
2296  case 15:
2298  break;
2299 #endif
2300 #ifdef QT_QWS_DEPTH_12
2301  case 12:
2303  break;
2304 #endif
2305 #ifdef QT_QWS_DEPTH_8
2306  case 8:
2308  break;
2309 #endif
2310  default:
2311  qWarning("QVNCScreen::initDevice: No support for screen depth %d",
2312  depth());
2313  d_ptr->dirty = 0;
2314  return false;
2315  }
2316 
2317 
2318  const bool ok = QProxyScreen::initDevice();
2319 #ifndef QT_NO_QWS_CURSOR
2320  qt_screencursor = new QVNCCursor(this);
2321 #endif
2322  if (QProxyScreen::screen())
2323  return ok;
2324 
2325  // Disable painting if there is only 1 display and nothing is attached to the VNC server
2326  if (!d_ptr->noDisablePainting)
2328 
2329  return true;
2330 }
int screencols
the number of entries in the color table
Definition: qscreen_qws.h:309
static QWSServer * instance()
int d
the pixel depth
Definition: qscreen_qws.h:327
QRgb screenclut[256]
the color table
Definition: qscreen_qws.h:308
bool initDevice()
This function is called by the Qt for Embedded Linux server to initialize the framebuffer.
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
void enablePainting(bool)
Enables painting onto the screen if enable is true; otherwise painting is disabled.
Q_CORE_EXPORT void qWarning(const char *,...)
int displayId
Definition: qscreen_qws.h:337
friend class QVNCCursor
friend class QVNCServer
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)
Definition: qrgb.h:69
QScreen * screen() const
Returns the real screen used by the proxy screen.
Q_GUI_EXPORT QScreenCursor * qt_screencursor
Definition: qscreen_qws.cpp:67
QVNCDirtyMap * dirty
Definition: qscreenvnc_p.h:253
QVNCScreenPrivate * d_ptr
QVNCServer * vncServer
Definition: qscreenvnc_p.h:255

◆ linestep()

int QVNCScreen::linestep ( ) const
inline

Definition at line 63 of file qvncintegration.h.

Referenced by QVNCDirtyMap::QVNCDirtyMap().

63 { return image() ? image()->bytesPerLine() : 0; }
int bytesPerLine() const
Returns the number of bytes per image scanline.
Definition: qimage.cpp:1812
QImage * image() const
Definition: fb_base.h:180

◆ setDirty()

void QVNCScreen::setDirty ( const QRect rect)
virtual

Reimplemented Function

Reimplemented from QProxyScreen.

Definition at line 2103 of file qscreenvnc_qws.cpp.

Referenced by QVNCIntegration::QVNCIntegration().

2104 {
2105  d_ptr->setDirty(rect);
2106 }
void setDirty(const QRect &rect, bool force=false)
QVNCScreenPrivate * d_ptr

◆ shutdownDevice()

void QVNCScreen::shutdownDevice ( )
virtual

Reimplemented Function

Reimplemented from QProxyScreen.

Definition at line 2335 of file qscreenvnc_qws.cpp.

2336 {
2338  delete d_ptr->vncServer;
2339  delete d_ptr->dirty;
2340 }
void shutdownDevice()
Reimplemented Function
QVNCDirtyMap * dirty
Definition: qscreenvnc_p.h:253
QVNCScreenPrivate * d_ptr
QVNCServer * vncServer
Definition: qscreenvnc_p.h:255

◆ swapBytes()

bool QVNCScreen::swapBytes ( ) const
private

Definition at line 832 of file qscreenvnc_qws.cpp.

Referenced by QVNCServer::pixelConversionNeeded(), and QVNCServer::setPixelFormat().

833 {
834  if (depth() != 16)
835  return false;
836 
837  if (screen())
838  return screen()->frameBufferLittleEndian();
839  return frameBufferLittleEndian();
840 }
bool frameBufferLittleEndian() const
virtual int depth() const
Reimplement in subclass to return current depth of the screen.
Definition: fb_base.h:163
QScreen * screen() const
Returns the real screen used by the proxy screen.

Friends and Related Functions

◆ QVNCClientCursor

friend class QVNCClientCursor
friend

Definition at line 72 of file qscreenvnc_qws.h.

◆ QVNCCursor

friend class QVNCCursor
friend

Definition at line 71 of file qscreenvnc_qws.h.

Referenced by initDevice(), and QVNCScreen().

◆ QVNCIntegration

friend class QVNCIntegration
friend

Definition at line 73 of file qvncintegration.h.

◆ QVNCScreenPrivate

friend class QVNCScreenPrivate
friend

Definition at line 74 of file qscreenvnc_qws.h.

Referenced by QVNCScreen().

◆ QVNCServer

friend class QVNCServer
friend

Definition at line 73 of file qscreenvnc_qws.h.

Referenced by initDevice().

Properties

◆ d_ptr

QVNCScreenPrivate * QVNCScreen::d_ptr
private

◆ server

QVNCServer* QVNCScreen::server
private

Definition at line 71 of file qvncintegration.h.


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