Qt 4.8
Classes | Macros | Typedefs | Functions | Variables
qscreen_qws.h File Reference
#include <QtCore/qnamespace.h>
#include <QtCore/qpoint.h>
#include <QtCore/qstringlist.h>
#include <QtGui/qrgb.h>
#include <QtCore/qrect.h>
#include <QtGui/qimage.h>
#include <QtGui/qregion.h>

Go to the source code of this file.

Classes

class  QPoolEntry
 
class  QScreen
 The QScreen class is a base class for screen drivers in Qt for Embedded Linux. More...
 
class  QScreenCursor
 The QScreenCursor class is a base class for screen cursors in Qt for Embedded Linux. More...
 

Macros

#define QT_QWS_DEPTH16_RGB   565
 

Typedefs

typedef void(* ClearCacheFunc) (QScreen *obj, int)
 

Functions

QRgb qt_conv16ToRgb (ushort c)
 
void qt_conv16ToRgb (ushort c, int &r, int &g, int &b)
 
ushort qt_convRgbTo16 (const int r, const int g, const int b)
 
ushort qt_convRgbTo16 (QRgb c)
 
QScreenqt_get_screen (int display_id, const char *spec)
 
const unsigned char * qt_probe_bus ()
 

Variables

static const int qt_bbits = (QT_QWS_DEPTH16_RGB%10)
 
static const int qt_blue_mask = (1<<qt_bbits)-1
 
static const int qt_blue_rounding_shift = qt_bbits - qt_neg_blue_shift
 
static const int qt_gbits = (QT_QWS_DEPTH16_RGB/10%10)
 
static const int qt_green_mask = (1<<(qt_gbits+qt_bbits))-(1<<qt_bbits)
 
static const int qt_green_rounding_shift = qt_green_shift + qt_gbits
 
static const int qt_green_shift = qt_bbits-(8-qt_gbits)
 
static const int qt_neg_blue_shift = 8-qt_bbits
 
static const int qt_rbits = (QT_QWS_DEPTH16_RGB/100)
 
static const int qt_red_mask = (1<<(qt_rbits+qt_gbits+qt_bbits))-(1<<(qt_gbits+qt_bbits))
 
static const int qt_red_rounding_shift = qt_red_shift + qt_rbits
 
static const int qt_red_shift = qt_bbits+qt_gbits-(8-qt_rbits)
 
Q_GUI_EXPORT QScreenqt_screen
 
QScreenCursorqt_screencursor
 
bool qws_sw_cursor
 
const int SourcePixmap =1
 
const int SourceSolid =0
 

Macro Definition Documentation

◆ QT_QWS_DEPTH16_RGB

#define QT_QWS_DEPTH16_RGB   565

Definition at line 69 of file qscreen_qws.h.

Typedef Documentation

◆ ClearCacheFunc

typedef void(* ClearCacheFunc) (QScreen *obj, int)

Definition at line 189 of file qscreen_qws.h.

Function Documentation

◆ qt_conv16ToRgb() [1/2]

QRgb qt_conv16ToRgb ( ushort  c)
inline

Definition at line 104 of file qscreen_qws.h.

Referenced by QVNCServer::convertPixels().

105 {
106  const int r=(c & qt_red_mask);
107  const int g=(c & qt_green_mask);
108  const int b=(c & qt_blue_mask);
109  const int tr = r >> qt_red_shift | r >> qt_red_rounding_shift;
110  const int tg = g >> qt_green_shift | g >> qt_green_rounding_shift;
111  const int tb = b << qt_neg_blue_shift | b >> qt_blue_rounding_shift;
112 
113  return qRgb(tr,tg,tb);
114 }
static const int qt_red_rounding_shift
Definition: qscreen_qws.h:81
unsigned char c[8]
Definition: qnumeric_p.h:62
static const int qt_blue_mask
Definition: qscreen_qws.h:77
static const int qt_red_mask
Definition: qscreen_qws.h:79
static const int qt_green_shift
Definition: qscreen_qws.h:75
static const int qt_green_mask
Definition: qscreen_qws.h:78
QRgb qRgb(int r, int g, int b)
Returns the ARGB quadruplet (255, {r}, {g}, {b}).
Definition: qrgb.h:69
static const int qt_red_shift
Definition: qscreen_qws.h:74
static const int qt_blue_rounding_shift
Definition: qscreen_qws.h:83
static const int qt_green_rounding_shift
Definition: qscreen_qws.h:82

◆ qt_conv16ToRgb() [2/2]

void qt_conv16ToRgb ( ushort  c,
int &  r,
int &  g,
int &  b 
)
inline

Definition at line 116 of file qscreen_qws.h.

117 {
118  const int tr=(c & qt_red_mask);
119  const int tg=(c & qt_green_mask);
120  const int tb=(c & qt_blue_mask);
121  r = tr >> qt_red_shift | tr >> qt_red_rounding_shift;
122  g = tg >> qt_green_shift | tg >> qt_green_rounding_shift;
123  b = tb << qt_neg_blue_shift | tb >> qt_blue_rounding_shift;
124 }
static const int qt_red_rounding_shift
Definition: qscreen_qws.h:81
unsigned char c[8]
Definition: qnumeric_p.h:62
static const int qt_blue_mask
Definition: qscreen_qws.h:77
static const int qt_red_mask
Definition: qscreen_qws.h:79
static const int qt_green_shift
Definition: qscreen_qws.h:75
static const int qt_green_mask
Definition: qscreen_qws.h:78
static const int qt_red_shift
Definition: qscreen_qws.h:74
static const int qt_blue_rounding_shift
Definition: qscreen_qws.h:83
static const int qt_green_rounding_shift
Definition: qscreen_qws.h:82

◆ qt_convRgbTo16() [1/2]

ushort qt_convRgbTo16 ( const int  r,
const int  g,
const int  b 
)
inline

Definition at line 86 of file qscreen_qws.h.

Referenced by QAhiScreen::solidFill().

87 {
88  const int tr = r << qt_red_shift;
89  const int tg = g << qt_green_shift;
90  const int tb = b >> qt_neg_blue_shift;
91 
92  return (tb & qt_blue_mask) | (tg & qt_green_mask) | (tr & qt_red_mask);
93 }
static const int qt_blue_mask
Definition: qscreen_qws.h:77
static const int qt_red_mask
Definition: qscreen_qws.h:79
static const int qt_green_shift
Definition: qscreen_qws.h:75
static const int qt_green_mask
Definition: qscreen_qws.h:78
static const int qt_neg_blue_shift
Definition: qscreen_qws.h:76
static const int qt_red_shift
Definition: qscreen_qws.h:74

◆ qt_convRgbTo16() [2/2]

ushort qt_convRgbTo16 ( QRgb  c)
inline

Definition at line 95 of file qscreen_qws.h.

96 {
97  const int tr = qRed(c) << qt_red_shift;
98  const int tg = qGreen(c) << qt_green_shift;
99  const int tb = qBlue(c) >> qt_neg_blue_shift;
100 
101  return (tb & qt_blue_mask) | (tg & qt_green_mask) | (tr & qt_red_mask);
102 }
unsigned char c[8]
Definition: qnumeric_p.h:62
static const int qt_blue_mask
Definition: qscreen_qws.h:77
int qRed(QRgb rgb)
Returns the red component of the ARGB quadruplet rgb.
Definition: qrgb.h:57
static const int qt_red_mask
Definition: qscreen_qws.h:79
static const int qt_green_shift
Definition: qscreen_qws.h:75
static const int qt_green_mask
Definition: qscreen_qws.h:78
static const int qt_neg_blue_shift
Definition: qscreen_qws.h:76
static const int qt_red_shift
Definition: qscreen_qws.h:74
int qGreen(QRgb rgb)
Returns the green component of the ARGB quadruplet rgb.
Definition: qrgb.h:60
int qBlue(QRgb rgb)
Returns the blue component of the ARGB quadruplet rgb.
Definition: qrgb.h:63

◆ qt_get_screen()

QScreen* qt_get_screen ( int  display_id,
const char *  spec 
)

Definition at line 2456 of file qscreen_qws.cpp.

Referenced by QVNCScreen::connect(), QMultiScreen::connect(), QTransformedScreen::connect(), QProxyScreen::connect(), QWSDisplay::Data::init(), and QWSDisplay::Data::reinit().

2457 {
2458  QString displaySpec = QString::fromAscii(spec);
2459  QString driver = displaySpec;
2460  int colon = displaySpec.indexOf(QLatin1Char(':'));
2461  if (colon >= 0)
2462  driver.truncate(colon);
2463  driver = driver.trimmed();
2464 
2465  bool foundDriver = false;
2466  QString driverName = driver;
2467 
2468  QStringList driverList;
2469  if (!driver.isEmpty())
2470  driverList << driver;
2471  else
2472  driverList = QScreenDriverFactory::keys();
2473 
2474  for (int i = 0; i < driverList.size(); ++i) {
2475  const QString driverName = driverList.at(i);
2476  qt_screen = QScreenDriverFactory::create(driverName, display_id);
2477  if (qt_screen) {
2478  foundDriver = true;
2479  if (qt_screen->connect(displaySpec)) {
2480  return qt_screen;
2481  } else {
2482  delete qt_screen;
2483  qt_screen = 0;
2484  }
2485  }
2486  }
2487 
2488  if (driver.isNull())
2489  qFatal("No suitable driver found");
2490  else if (foundDriver)
2491  qFatal("%s: driver cannot connect", driver.toLatin1().constData());
2492  else
2493  qFatal("%s: driver not found", driver.toLatin1().constData());
2494 
2495  return 0;
2496 }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
Definition: qstring.cpp:4276
virtual bool connect(const QString &displaySpec)=0
This function is called by every Qt for Embedded Linux application on startup, and must be implemente...
The QString class provides a Unicode character string.
Definition: qstring.h:83
void truncate(int pos)
Truncates the string at the given position index.
Definition: qstring.cpp:4603
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
Definition: qstring.cpp:4506
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:2838
static QScreen * create(const QString &, int)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
static QStringList keys()
Returns the list of valid keys, i.e.
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
bool isNull() const
Returns true if this string is null; otherwise returns false.
Definition: qstring.h:505
Q_CORE_EXPORT void qFatal(const char *,...)
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ qt_probe_bus()

const unsigned char* qt_probe_bus ( )

Variable Documentation

◆ qt_bbits

const int qt_bbits = (QT_QWS_DEPTH16_RGB%10)
static

Definition at line 73 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb().

◆ qt_blue_mask

const int qt_blue_mask = (1<<qt_bbits)-1
static

Definition at line 77 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb(), and qt_convRgbTo16().

◆ qt_blue_rounding_shift

const int qt_blue_rounding_shift = qt_bbits - qt_neg_blue_shift
static

Definition at line 83 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb().

◆ qt_gbits

const int qt_gbits = (QT_QWS_DEPTH16_RGB/10%10)
static

Definition at line 72 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb().

◆ qt_green_mask

const int qt_green_mask = (1<<(qt_gbits+qt_bbits))-(1<<qt_bbits)
static

Definition at line 78 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb(), and qt_convRgbTo16().

◆ qt_green_rounding_shift

const int qt_green_rounding_shift = qt_green_shift + qt_gbits
static

Definition at line 82 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb().

◆ qt_green_shift

const int qt_green_shift = qt_bbits-(8-qt_gbits)
static

Definition at line 75 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb(), and qt_convRgbTo16().

◆ qt_neg_blue_shift

const int qt_neg_blue_shift = 8-qt_bbits
static

Definition at line 76 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb(), and qt_convRgbTo16().

◆ qt_rbits

const int qt_rbits = (QT_QWS_DEPTH16_RGB/100)
static

Definition at line 71 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb().

◆ qt_red_mask

const int qt_red_mask = (1<<(qt_rbits+qt_gbits+qt_bbits))-(1<<(qt_gbits+qt_bbits))
static

Definition at line 79 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb(), and qt_convRgbTo16().

◆ qt_red_rounding_shift

const int qt_red_rounding_shift = qt_red_shift + qt_rbits
static

Definition at line 81 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb().

◆ qt_red_shift

const int qt_red_shift = qt_bbits+qt_gbits-(8-qt_rbits)
static

Definition at line 74 of file qscreen_qws.h.

Referenced by qt_conv16ToRgb(), and qt_convRgbTo16().

◆ qt_screen

Q_GUI_EXPORT QScreen* qt_screen

Definition at line 69 of file qscreen_qws.cpp.

Referenced by QWSServerPrivate::_q_clientClosed(), QWSServerPrivate::_q_newConnection(), QWSServerPrivate::_q_screenSaverSleep(), QWSServerPrivate::_q_screenSaverWake(), QWSServer::beginDisplayReconfigure(), QWSServerPrivate::closeDisplay(), QVNCScreen::connect(), QMultiScreen::connect(), QTransformedScreen::connect(), QWSWindow::createSurface(), QWSDisplay::depth(), effectiveState(), QWSServer::endDisplayReconfigure(), QQnxScreen::exposeRegion(), QWSServerPrivate::exposeRegion(), QWSDisplay::Data::fillQueue(), QWSDisplay::frameBuffer(), getScreen(), glScreenForDevice(), QWSTtyKbPrivate::handleConsoleSwitch(), QWSDisplay::height(), QScreenCursor::hide(), QWSDisplay::Data::init(), QScreen::instance(), isServerProcess(), QMultiScreenCursor::move(), QScreenCursor::move(), QWSServerPrivate::newMouseHandler(), QWSServerPrivate::openDisplay(), QWSDisplay::pixmapDepth(), QDirectFBKeyboardHandlerPrivate::QDirectFBKeyboardHandlerPrivate(), QQnxMouseHandler::QQnxMouseHandler(), QScreenCursor::QScreenCursor(), qt_conv16ToRgb(), qt_defaultDpiX(), qt_defaultDpiY(), qt_get_screen(), QApplication::qwsSetCustomColors(), QDirectFBKeyboardHandlerPrivate::readKeyboardData(), QWSLinuxInputMousePrivate::readMouseData(), QWSTslibMouseHandlerPrivate::readMouseData(), QWSLinuxTPMouseHandlerPrivate::readMouseData(), screenForDevice(), QWSPcMouseHandlerPrivate::sendEvent(), QWSServer::sendMouseEvent(), QScreenCursor::set(), QWSServer::setBackground(), QQnxScreen::setDirty(), setMaxWindowRect(), QWSServer::setMaxWindowRect(), QWSOnScreenSurface::setPermanentState(), QWSMouseHandler::setScreen(), QWSServer::setScreenSaverIntervals(), QScreenCursor::show(), QWSDisplay::supportsDepth(), PvrEglScreen::transformation(), QWSKeyboardHandler::transformDirKey(), QETWidget::translateMouseEvent(), QWSServerPrivate::update_regions(), QWSDisplay::width(), and QWSDisplay::Data::~Data().

◆ qt_screencursor

QScreenCursor* qt_screencursor

◆ qws_sw_cursor

bool qws_sw_cursor

Definition at line 132 of file qapplication_qws.cpp.

Referenced by QScreenCursor::enabled(), and qt_init().

◆ SourcePixmap

const int SourcePixmap =1

Definition at line 127 of file qscreen_qws.h.

◆ SourceSolid

const int SourceSolid =0

Definition at line 126 of file qscreen_qws.h.