Qt 4.8
qscreentransformed_qws.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qscreentransformed_qws.h"
43 
44 #ifndef QT_NO_QWS_TRANSFORMED
46 #include <qvector.h>
47 #include <private/qpainter_p.h>
48 #include <private/qmemrotate_p.h>
49 #include <qmatrix.h>
50 
51 #include <unistd.h>
52 #include <sys/ioctl.h>
53 #include <sys/types.h>
54 #include <sys/stat.h>
55 #include <sys/mman.h>
56 #include <fcntl.h>
57 #include <errno.h>
58 
59 #include <qwindowsystem_qws.h>
60 #include <qwsdisplay_qws.h>
61 
63 
64 //#define QT_REGION_DEBUG
65 
66 #ifdef QT_REGION_DEBUG
67 #include <QDebug>
68 #endif
69 
71 {
72 public:
74 
75  void configure();
76 
78 #ifdef QT_QWS_DEPTH_GENERIC
79  bool doGenericColors;
80 #endif
82 };
83 
86 #ifdef QT_QWS_DEPTH_GENERIC
87  doGenericColors(false),
88 #endif
89  q(parent)
90 {
91 }
92 
93 extern "C"
94 #ifndef QT_BUILD_GUI_LIB
96 #endif
98 {
99  QTransformedScreen *tscreen = static_cast<QTransformedScreen*>(that);
101 }
102 
103 // ---------------------------------------------------------------------------
104 // Transformed Screen
105 // ---------------------------------------------------------------------------
106 
162  : QProxyScreen(displayId, QScreen::TransformedClass)
163 {
164  d_ptr = new QTransformedScreenPrivate(this);
166 
167 #ifdef QT_REGION_DEBUG
168  qDebug() << "QTransformedScreen::QTransformedScreen";
169 #endif
170 }
171 
173 {
174  // ###: works because setTransformation recalculates unconditionally
175  q->setTransformation(transformation);
176 }
177 
182 {
183  delete d_ptr;
184 }
185 
186 static int getDisplayId(const QString &spec)
187 {
188  QRegExp regexp(QLatin1String(":(\\d+)\\b"));
189  if (regexp.lastIndexIn(spec) != -1) {
190  const QString capture = regexp.cap(1);
191  return capture.toInt();
192  }
193  return 0;
194 }
195 
197 {
198  QRegExp regexp(QLatin1String("\\bRot(\\d+):?\\b"), Qt::CaseInsensitive);
199  if (regexp.indexIn(spec) == -1)
201 
202  const int degrees = regexp.cap(1).toInt();
203  spec.remove(regexp.pos(0), regexp.matchedLength());
204 
205  return static_cast<QTransformedScreen::Transformation>(degrees / 90);
206 }
207 
211 bool QTransformedScreen::connect(const QString &displaySpec)
212 {
213  QString dspec = displaySpec.trimmed();
214  if (dspec.startsWith(QLatin1String("Transformed:"), Qt::CaseInsensitive))
215  dspec = dspec.mid(QString::fromLatin1("Transformed:").size());
216  else if (!dspec.compare(QLatin1String("Transformed"), Qt::CaseInsensitive))
217  dspec = QString();
218 
219  const QString displayIdSpec = QString::fromLatin1(" :%1").arg(displayId);
220  if (dspec.endsWith(displayIdSpec))
221  dspec = dspec.left(dspec.size() - displayIdSpec.size());
222 
224 
225  QString driver = dspec;
226  int colon = driver.indexOf(QLatin1Char(':'));
227  if (colon >= 0)
228  driver.truncate(colon);
229 
230  if (!QScreenDriverFactory::keys().contains(driver, Qt::CaseInsensitive))
231  if (!dspec.isEmpty())
232  dspec.prepend(QLatin1Char(':'));
233 
234  const int id = getDisplayId(dspec);
235  QScreen *s = qt_get_screen(id, dspec.toLatin1().constData());
236  setScreen(s);
237 
238 #ifdef QT_QWS_DEPTH_GENERIC
239  d_ptr->doGenericColors = dspec.contains(QLatin1String("genericcolors"));
240 #endif
241 
242  d_ptr->configure();
243 
244  // XXX
245  qt_screen = this;
246 
247  return true;
248 }
249 
256 {
257  return d_ptr->transformation;
258 }
259 
264 {
265  return (int)d_ptr->transformation;
266 }
267 
272 {
273  if (!data || d_ptr->transformation == None) {
274  QProxyScreen::exposeRegion(region, changing);
275  return;
276  }
277  QScreen::exposeRegion(region, changing);
278 }
279 
286 {
289  w = size.width();
290  h = size.height();
291 
292  const QScreen *s = screen();
293  size = mapFromDevice(QSize(s->physicalWidth(), s->physicalHeight()));
294  physWidth = size.width();
295  physHeight = size.height();
296 
297 #ifdef QT_REGION_DEBUG
298  qDebug() << "QTransformedScreen::setTransformation" << transformation
299  << "size" << w << h << "dev size" << dw << dh;
300 #endif
301 
302 }
303 
304 static inline QRect correctNormalized(const QRect &r) {
305  const int x1 = qMin(r.left(), r.right());
306  const int x2 = qMax(r.left(), r.right());
307  const int y1 = qMin(r.top(), r.bottom());
308  const int y2 = qMax(r.top(), r.bottom());
309 
310  return QRect( QPoint(x1,y1), QPoint(x2,y2) );
311 }
312 
313 template <class DST, class SRC>
314 static inline void blit90(QScreen *screen, const QImage &image,
315  const QRect &rect, const QPoint &topLeft)
316 {
317  const SRC *src = (const SRC*)(image.scanLine(rect.top())) + rect.left();
318  DST *dest = (DST*)(screen->base() + topLeft.y() * screen->linestep())
319  + topLeft.x();
320  qt_memrotate90(src, rect.width(), rect.height(), image.bytesPerLine(),
321  dest, screen->linestep());
322 }
323 
324 template <class DST, class SRC>
325 static inline void blit180(QScreen *screen, const QImage &image,
326  const QRect &rect, const QPoint &topLeft)
327 {
328  const SRC *src = (const SRC*)(image.scanLine(rect.top())) + rect.left();
329  DST *dest = (DST*)(screen->base() + topLeft.y() * screen->linestep())
330  + topLeft.x();
331  qt_memrotate180(src, rect.width(), rect.height(), image.bytesPerLine(),
332  dest, screen->linestep());
333 }
334 
335 template <class DST, class SRC>
336 static inline void blit270(QScreen *screen, const QImage &image,
337  const QRect &rect, const QPoint &topLeft)
338 {
339  const SRC *src = (const SRC *)(image.scanLine(rect.top())) + rect.left();
340  DST *dest = (DST*)(screen->base() + topLeft.y() * screen->linestep())
341  + topLeft.x();
342  qt_memrotate270(src, rect.width(), rect.height(), image.bytesPerLine(),
343  dest, screen->linestep());
344 }
345 
346 typedef void (*BlitFunc)(QScreen *, const QImage &, const QRect &, const QPoint &);
347 
348 #define SET_BLIT_FUNC(dst, src, rotation, func) \
349 do { \
350  switch (rotation) { \
351  case Rot90: \
352  func = blit90<dst, src>; \
353  break; \
354  case Rot180: \
355  func = blit180<dst, src>; \
356  break; \
357  case Rot270: \
358  func = blit270<dst, src>; \
359  break; \
360  default: \
361  break; \
362  } \
363 } while (0)
364 
368 void QTransformedScreen::blit(const QImage &image, const QPoint &topLeft,
369  const QRegion &region)
370 {
371  const Transformation trans = d_ptr->transformation;
372  if (trans == None) {
373  QProxyScreen::blit(image, topLeft, region);
374  return;
375  }
376 
377  const QVector<QRect> rects = region.rects();
378  const QRect bound = QRect(0, 0, QScreen::w, QScreen::h)
379  & QRect(topLeft, image.size());
380 
381  BlitFunc func = 0;
382 #ifdef QT_QWS_DEPTH_GENERIC
383  if (d_ptr->doGenericColors && depth() == 16) {
384  if (image.depth() == 16)
385  SET_BLIT_FUNC(qrgb_generic16, quint16, trans, func);
386  else
387  SET_BLIT_FUNC(qrgb_generic16, quint32, trans, func);
388  } else
389 #endif
390  switch (depth()) {
391 #ifdef QT_QWS_DEPTH_32
392  case 32:
393 #ifdef QT_QWS_DEPTH_16
394  if (image.depth() == 16)
395  SET_BLIT_FUNC(quint32, quint16, trans, func);
396  else
397 #endif
398  SET_BLIT_FUNC(quint32, quint32, trans, func);
399  break;
400 #endif
401 #if defined(QT_QWS_DEPTH_24) || defined(QT_QWS_DEPTH18)
402  case 24:
403  case 18:
404  SET_BLIT_FUNC(quint24, quint24, trans, func);
405  break;
406 #endif
407 #if defined(QT_QWS_DEPTH_16) || defined(QT_QWS_DEPTH_15) || defined(QT_QWS_DEPTH_12)
408  case 16:
409 #if defined QT_QWS_ROTATE_BGR
410  if (pixelType() == BGRPixel && image.depth() == 16) {
411  SET_BLIT_FUNC(qbgr565, quint16, trans, func);
412  break;
413  } //fall-through here!!!
414 #endif
415  case 15:
416 #if defined QT_QWS_ROTATE_BGR
417  if (pixelType() == BGRPixel && image.format() == QImage::Format_RGB555) {
418  SET_BLIT_FUNC(qbgr555, qrgb555, trans, func);
419  break;
420  } //fall-through here!!!
421 #endif
422  case 12:
423  if (image.depth() == 16)
424  SET_BLIT_FUNC(quint16, quint16, trans, func);
425  else
426  SET_BLIT_FUNC(quint16, quint32, trans, func);
427  break;
428 #endif
429 #ifdef QT_QWS_DEPTH_8
430  case 8:
431  if (image.format() == QImage::Format_RGB444)
432  SET_BLIT_FUNC(quint8, qrgb444, trans, func);
433  else if (image.depth() == 16)
434  SET_BLIT_FUNC(quint8, quint16, trans, func);
435  else
436  SET_BLIT_FUNC(quint8, quint32, trans, func);
437  break;
438 #endif
439  default:
440  return;
441  }
442  if (!func)
443  return;
444 
446  for (int i = 0; i < rects.size(); ++i) {
447  const QRect r = rects.at(i) & bound;
448 
449  QPoint dst;
450  switch (trans) {
451  case Rot90:
452  dst = mapToDevice(r.topRight(), QSize(w, h));
453  break;
454  case Rot180:
455  dst = mapToDevice(r.bottomRight(), QSize(w, h));
456  break;
457  case Rot270:
458  dst = mapToDevice(r.bottomLeft(), QSize(w, h));
459  break;
460  default:
461  break;
462  }
463  func(this, image, r.translated(-topLeft), dst);
464  }
466 
467 }
468 
473 {
474  const QRegion tr = mapToDevice(region, QSize(w,h));
475 
476  Q_ASSERT(tr.boundingRect() == mapToDevice(region.boundingRect(), QSize(w,h)));
477 
478 #ifdef QT_REGION_DEBUG
479  qDebug() << "QTransformedScreen::solidFill region" << region << "transformed" << tr;
480 #endif
481  QProxyScreen::solidFill(color, tr);
482 }
483 
488 {
489  switch (d_ptr->transformation) {
490  case None:
491  case Rot180:
492  break;
493  case Rot90:
494  case Rot270:
495  return QSize(s.height(), s.width());
496  break;
497  }
498  return s;
499 }
500 
505 {
506  switch (d_ptr->transformation) {
507  case None:
508  case Rot180:
509  break;
510  case Rot90:
511  case Rot270:
512  return QSize(s.height(), s.width());
513  break;
514  }
515  return s;
516 }
517 
522 {
523  QPoint rp(p);
524 
525  switch (d_ptr->transformation) {
526  case None:
527  break;
528  case Rot90:
529  rp.setX(p.y());
530  rp.setY(s.width() - p.x() - 1);
531  break;
532  case Rot180:
533  rp.setX(s.width() - p.x() - 1);
534  rp.setY(s.height() - p.y() - 1);
535  break;
536  case Rot270:
537  rp.setX(s.height() - p.y() - 1);
538  rp.setY(p.x());
539  break;
540  }
541 
542  return rp;
543 }
544 
549 {
550  QPoint rp(p);
551 
552  switch (d_ptr->transformation) {
553  case None:
554  break;
555  case Rot90:
556  rp.setX(s.height() - p.y() - 1);
557  rp.setY(p.x());
558  break;
559  case Rot180:
560  rp.setX(s.width() - p.x() - 1);
561  rp.setY(s.height() - p.y() - 1);
562  break;
563  case Rot270:
564  rp.setX(p.y());
565  rp.setY(s.width() - p.x() - 1);
566  break;
567  }
568 
569  return rp;
570 }
571 
576 {
577  if (r.isNull())
578  return QRect();
579 
580  QRect tr;
581  switch (d_ptr->transformation) {
582  case None:
583  tr = r;
584  break;
585  case Rot90:
586  tr.setCoords(r.y(), s.width() - r.x() - 1,
587  r.bottom(), s.width() - r.right() - 1);
588  break;
589  case Rot180:
590  tr.setCoords(s.width() - r.x() - 1, s.height() - r.y() - 1,
591  s.width() - r.right() - 1, s.height() - r.bottom() - 1);
592  break;
593  case Rot270:
594  tr.setCoords(s.height() - r.y() - 1, r.x(),
595  s.height() - r.bottom() - 1, r.right());
596  break;
597  }
598 
599  return correctNormalized(tr);
600 }
601 
606 {
607  if (r.isNull())
608  return QRect();
609 
610  QRect tr;
611  switch (d_ptr->transformation) {
612  case None:
613  tr = r;
614  break;
615  case Rot90:
616  tr.setCoords(s.height() - r.y() - 1, r.x(),
617  s.height() - r.bottom() - 1, r.right());
618  break;
619  case Rot180:
620  tr.setCoords(s.width() - r.x() - 1, s.height() - r.y() - 1,
621  s.width() - r.right() - 1, s.height() - r.bottom() - 1);
622  break;
623  case Rot270:
624  tr.setCoords(r.y(), s.width() - r.x() - 1,
625  r.bottom(), s.width() - r.right() - 1);
626  break;
627  }
628 
629  return correctNormalized(tr);
630 }
631 
636 {
637  if (d_ptr->transformation == None)
638  return QProxyScreen::mapToDevice(rgn, s);
639 
640 #ifdef QT_REGION_DEBUG
641  qDebug() << "mapToDevice size" << s << "rgn: " << rgn;
642 #endif
643  QRect tr;
644  QRegion trgn;
645  QVector<QRect> a = rgn.rects();
646  const QRect *r = a.data();
647 
648  int w = s.width();
649  int h = s.height();
650  int size = a.size();
651 
652  switch (d_ptr->transformation) {
653  case None:
654  break;
655  case Rot90:
656  for (int i = 0; i < size; i++, r++) {
657  tr.setCoords(r->y(), w - r->x() - 1,
658  r->bottom(), w - r->right() - 1);
659  trgn |= correctNormalized(tr);
660  }
661  break;
662  case Rot180:
663  for (int i = 0; i < size; i++, r++) {
664  tr.setCoords(w - r->x() - 1, h - r->y() - 1,
665  w - r->right() - 1, h - r->bottom() - 1);
666  trgn |= correctNormalized(tr);
667  }
668  break;
669  case Rot270:
670  for (int i = 0; i < size; i++, r++) {
671  tr.setCoords(h - r->y() - 1, r->x(),
672  h - r->bottom() - 1, r->right());
673  trgn |= correctNormalized(tr);
674  }
675  break;
676  }
677 #ifdef QT_REGION_DEBUG
678  qDebug() << "mapToDevice trgn: " << trgn;
679 #endif
680  return trgn;
681 }
682 
687 {
688  if (d_ptr->transformation == None)
689  return QProxyScreen::mapFromDevice(rgn, s);
690 
691 #ifdef QT_REGION_DEBUG
692  qDebug() << "fromDevice: realRegion count: " << rgn.rects().size() << " isEmpty? " << rgn.isEmpty() << " bounds:" << rgn.boundingRect();
693 #endif
694  QRect tr;
695  QRegion trgn;
696  QVector<QRect> a = rgn.rects();
697  const QRect *r = a.data();
698 
699  int w = s.width();
700  int h = s.height();
701  int size = a.size();
702 
703  switch (d_ptr->transformation) {
704  case None:
705  break;
706  case Rot90:
707  for (int i = 0; i < size; i++, r++) {
708  tr.setCoords(h - r->y() - 1, r->x(),
709  h - r->bottom() - 1, r->right());
710  trgn |= correctNormalized(tr);
711  }
712  break;
713  case Rot180:
714  for (int i = 0; i < size; i++, r++) {
715  tr.setCoords(w - r->x() - 1, h - r->y() - 1,
716  w - r->right() - 1, h - r->bottom() - 1);
717  trgn |= correctNormalized(tr);
718  }
719  break;
720  case Rot270:
721  for (int i = 0; i < size; i++, r++) {
722  tr.setCoords(r->y(), w - r->x() - 1,
723  r->bottom(), w - r->right() - 1);
724  trgn |= correctNormalized(tr);
725  }
726  break;
727  }
728 #ifdef QT_REGION_DEBUG
729  qDebug() << "fromDevice: transRegion count: " << trgn.rects().size() << " isEmpty? " << trgn.isEmpty() << " bounds:" << trgn.boundingRect();
730 #endif
731  return trgn;
732 }
733 
738 {
739  const QRect r = mapToDevice(rect, QSize(width(), height()));
741 }
742 
747 {
748  QRegion deviceRegion = QProxyScreen::region();
749  return mapFromDevice(deviceRegion, QSize(deviceWidth(), deviceHeight()));
750 }
751 
753 
754 #endif // QT_NO_QWS_TRANSFORMED
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.h:904
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
~QTransformedScreen()
Destroys the QTransformedScreen object.
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
Definition: qrect.h:231
void setDirty(const QRect &)
Reimplemented Function
The QProxyScreen class provides a generic interface to QScreen implementations.
bool connect(const QString &displaySpec)
Reimplemented Function
int height() const
Returns the logical height of the framebuffer in pixels.
Definition: qscreen_qws.h:228
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QString cap(int nth=0) const
Returns the text captured by the nth subexpression.
Definition: qregexp.cpp:4310
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
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.
Definition: qregexp.cpp:4167
int physicalHeight() const
Returns the physical height of the screen in millimeters.
Definition: qscreen_qws.h:291
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
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 ...
Definition: qstring.cpp:6090
Q_DECL_EXPORT void qws_setScreenTransformation(QScreen *that, int t)
QString & prepend(QChar c)
Definition: qstring.h:261
static void blit270(QScreen *screen, const QImage &image, const QRect &rect, const QPoint &topLeft)
Transformation
This enum describes the various rotations a transformed screen can have.
void blit(const QImage &img, const QPoint &topLeft, const QRegion &region)
Reimplemented Function
int pos(int nth=0) const
Returns the position of the nth captured text in the searched string.
Definition: qregexp.cpp:4337
int matchedLength() const
Returns the length of the last matched string, or -1 if there was no match.
Definition: qregexp.cpp:4193
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
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
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
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
QRegion region() const
Reimplemented Function
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.
Definition: qscreen_qws.h:233
int bytesPerLine() const
Returns the number of bytes per image scanline.
Definition: qimage.cpp:1812
long ASN1_INTEGER_get ASN1_INTEGER * a
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
unsigned char quint8
Definition: qglobal.h:934
int physHeight
the physical height of the screen in millimeters.
Definition: qscreen_qws.h:340
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QRect correctNormalized(const QRect &r)
int size
the number of bytes in the visible region of the frame buffer
Definition: qscreen_qws.h:334
void Q_GUI_QWS_EXPORT qt_memrotate180(const quint32 *, int, int, int, quint32 *, int)
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void Q_GUI_EXPORT qt_memrotate90(const quint32 *, int, int, int, quint32 *, int)
void setTransformation(Transformation t)
Rotates this screen object according to the specified transformation.
QTransformedScreenPrivate * d_ptr
void exposeRegion(QRegion region, int changing)
Reimplemented Function
Format format() const
Returns the format of the image.
Definition: qimage.cpp:2305
int physWidth
the physical width of the screen in millimeters.
Definition: qscreen_qws.h:339
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
Q_CORE_EXPORT void qDebug(const char *,...)
int width() const
Returns the logical width of the framebuffer in pixels.
Definition: qscreen_qws.h:227
int width() const
Returns the width.
Definition: qsize.h:126
uchar * data
points to the first visible pixel in the frame buffer.
Definition: qscreen_qws.h:311
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
PixelType pixelType() const
Returns the pixel storage format of the screen.
Definition: qscreen_qws.h:231
int linestep() const
Returns the length of each scanline of the framebuffer in bytes.
Definition: qscreen_qws.h:232
QTransformedScreen(int display_id)
Constructs a QTransformedScreen object.
QPoint bottomRight() const
Returns the position of the rectangle&#39;s bottom-right corner.
Definition: qrect.h:291
void truncate(int pos)
Truncates the string at the given position index.
Definition: qstring.cpp:4603
int indexIn(const QString &str, int offset=0, CaretMode caretMode=CaretAtZero) const
Attempts to find a match in str from position offset (0 by default).
Definition: qregexp.cpp:4136
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
Definition: qstring.cpp:3664
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
Definition: qstring.cpp:4506
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Definition: qregion.cpp:4098
void exposeRegion(QRegion r, int changing)
Reimplemented Function
int w
the logical width of the screen.
Definition: qscreen_qws.h:324
#define Q_DECL_EXPORT
This macro marks a symbol for shared library export (see sharedlibrary.
Definition: qglobal.h:1288
unsigned short quint16
Definition: qglobal.h:936
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
void setDirty(const QRect &)
Reimplemented Function
QSize mapToDevice(const QSize &s) const
Reimplemented Function
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
static void blit90(QScreen *screen, const QImage &image, const QRect &rect, const QPoint &topLeft)
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
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
int depth() const
Returns the depth of the image.
Definition: qimage.cpp:1620
static QStringList keys()
Returns the list of valid keys, i.e.
static void grab()
void setCoords(int x1, int y1, int x2, int y2)
Sets the coordinates of the rectangle&#39;s top-left corner to (x1, y1), and the coordinates of its botto...
Definition: qrect.h:416
QSize mapFromDevice(const QSize &s) const
Reimplemented Function
#define None
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
QSize size() const
Returns the size of the image, i.
Definition: qimage.cpp:1587
QPoint topRight() const
Returns the position of the rectangle&#39;s top-right corner.
Definition: qrect.h:294
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
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
uchar * base() const
Returns a pointer to the beginning of the framebuffer.
Definition: qscreen_qws.h:235
int dw
the device width
Definition: qscreen_qws.h:331
void setY(int y)
Sets the y coordinate of this point to the given y coordinate.
Definition: qpoint.h:137
int dh
the device height
Definition: qscreen_qws.h:332
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
void blit(const QImage &img, const QPoint &topLeft, const QRegion &region)
Reimplemented Function
int compare(const QString &s) const
Definition: qstring.cpp:5037
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
QPoint bottomLeft() const
Returns the position of the rectangle&#39;s bottom-left corner.
Definition: qrect.h:297
int deviceHeight() const
Returns the full height of the framebuffer device in pixels.
Definition: qscreen_qws.h:234
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
void Q_GUI_QWS_EXPORT qt_memrotate270(const quint32 *, int, int, int, quint32 *, int)
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
void solidFill(const QColor &color, const QRegion &region)
Reimplemented Function
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
QTransformedScreen::Transformation transformation
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
Definition: qregion.cpp:4412
unsigned int quint32
Definition: qglobal.h:938
int height() const
Returns the height.
Definition: qsize.h:129
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
static int getDisplayId(const QString &spec)
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
QSize mapToDevice(const QSize &s) const
Reimplemented Function
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
T * data()
Returns a pointer to the data stored in the vector.
Definition: qvector.h:152
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
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.
static void ungrab()
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
Definition: qstring.cpp:1867
virtual void exposeRegion(QRegion r, int changing)
This function is called by the Qt for Embedded Linux server whenever a screen update is required...
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
static QTransformedScreen::Transformation filterTransformation(QString &spec)
int physicalWidth() const
Returns the physical width of the screen in millimeters.
Definition: qscreen_qws.h:290
void setX(int x)
Sets the x coordinate of this point to the given x coordinate.
Definition: qpoint.h:134
QRegion region() const
Reimplemented Function
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
QSize mapFromDevice(const QSize &s) const
Reimplemented Function
int transformOrientation() const
Reimplemented Function
Transformation transformation() const
Returns the currently set rotation.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
Definition: qimage.cpp:1886
int depth() const
Returns the depth of the framebuffer, in bits per pixel.
Definition: qscreen_qws.h:229
void(* BlitFunc)(QScreen *, const QImage &, const QRect &, const QPoint &)
#define SET_BLIT_FUNC(dst, src, rotation, func)
The QTransformedScreen class implements a screen driver for a transformed screen. ...
static void blit180(QScreen *screen, const QImage &image, const QRect &rect, const QPoint &topLeft)
QTransformedScreenPrivate(QTransformedScreen *parent)
void solidFill(const QColor &color, const QRegion &region)
Reimplemented Function
friend class QTransformedScreenPrivate