Qt 4.8
qscreenahi_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 plugins 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 "qscreenahi_qws.h"
43 
44 #ifndef QT_NO_QWS_AHI
45 
46 #include <QtGui/qcolor.h>
47 #include <QtGui/qapplication.h>
48 #include <QtCore/qvector.h>
49 #include <QtCore/qvarlengtharray.h>
50 #include <private/qwssignalhandler_p.h>
51 
52 #include <ahi.h>
53 
54 //#define QAHISCREEN_DEBUG
55 
56 static int depthForPixelFormat(const AhiPixelFormat_t format)
57 {
58  switch (format) {
59  case AhiPix1bpp:
60  return 1;
61  case AhiPix2bpp:
62  return 2;
63  case AhiPix4bpp:
64  return 4;
65  case AhiPix8bpp_332RGB:
66  case AhiPix8bpp:
67  return 8;
68  case AhiPix16bpp_444RGB:
69  return 12;
70  case AhiPix16bpp_555RGB:
71  return 15;
72  case AhiPix16bpp_565RGB:
73  return 16;
74  case AhiPix32bpp_8888ARGB:
75  case AhiPix32bpp_8888BGRA:
76  return 32;
77  default:
78  return 0;
79  }
80 }
81 
82 static AhiPixelFormat_t pixelFormatForImageFormat(const QImage::Format format)
83 {
84  switch (format) {
87  return AhiPix1bpp;
89  return AhiPix8bpp;
93  return AhiPix32bpp_8888ARGB;
95  return AhiPix16bpp_565RGB;
97  return AhiPix16bpp_555RGB;
100  return AhiPix16bpp_444RGB;
101  default:
102  return AhiPixelFormatMax;
103  }
104 }
105 
107 {
108 public:
109  QAhiScreenCursor(QScreen *screen, AhiDevCtx_t context);
110 
111  void set(const QImage &image, int hotx, int hoty);
112  void move(int x, int y);
113  void show();
114  void hide();
115 
116 private:
118  AhiDevCtx_t context;
119 };
120 
122  : QScreenCursor(), screen(s), context(c)
123 {
124  hwaccel = true;
125  supportsAlpha = true;
126 
127  if (enable)
128  show();
129  else
130  hide();
131 }
132 
133 void QAhiScreenCursor::set(const QImage &image, int hotx, int hoty)
134 {
135  if (image.isNull()) {
136  QScreenCursor::set(image, hotx, hoty);
137  return;
138  }
139 
140  if (image.format() != QImage::Format_MonoLSB) {
141  set(image.convertToFormat(QImage::Format_MonoLSB), hotx, hoty);
142  return;
143  }
144 
145  AhiPixelFormat_t pixFmt = pixelFormatForImageFormat(image.format());
146 
147  if (pixFmt >= AhiPixelFormatMax) { // generic fallback
148  QImage::Format toFormat = screen->pixelFormat();
149  if (toFormat == QImage::Format_Invalid)
150  toFormat = QImage::Format_ARGB32;
151  set(image.convertToFormat(toFormat), hotx, hoty);
152  return;
153  }
154 
155  AhiPoint_t hotSpot = { hotx, hoty };
156  AhiSize_t bitmapSize = { image.width(), image.height() };
157  AhiBitmap_t bitmap = { bitmapSize, (void*)(image.bits()),
158  image.bytesPerLine(), pixFmt };
159 
160  AhiSts_t status;
161  status = AhiDispCursorSet(context, AhiCursor1, &bitmap, &hotSpot,
162  image.serialNumber(), 0);
163  if (status != AhiStsOk)
164  qWarning("QAhiScreenCursor::set(): AhiDispCursorSet failed: %x",
165  status);
166 
167  QScreenCursor::set(image, hotx, hoty);
168 }
169 
170 void QAhiScreenCursor::move(int x, int y)
171 {
172  AhiPoint_t pos = { x, y };
173  AhiSts_t status = AhiDispCursorPos(context, AhiCursor1, &pos, 0);
174  if (status != AhiStsOk)
175  qWarning("QAhiScreenCursor::move(): error setting mouse position: %x",
176  status);
177  QScreenCursor::move(x, y);
178 }
179 
181 {
182  AhiSts_t status;
183  status = AhiDispCursorState(context, AhiCursor1, AhiCursorStateOn, 0);
184  if (status != AhiStsOk)
185  qWarning("QAhiScreenCursor::show(): error setting state: %x", status);
187 }
188 
190 {
191  AhiDispCursorState(context, AhiCursor1, AhiCursorStateOff, 0);
193 }
194 
196 {
197 public:
200 
201  bool setMode(AhiDispMode_t mode);
202 
203  AhiDevCtx_t context;
204  AhiSurf_t surface;
206 };
207 
209 
211  : context(0), surface(0), cursor(0)
212 {
213 #ifndef QT_NO_QWS_SIGNALHANDLER
215 #endif
216 }
217 
219 {
220  delete cursor;
221 
222  if (surface) {
223  AhiSurfFree(context, surface);
224  surface = 0;
225  }
226  if (context) {
227  AhiDevClose(context);
228  context = 0;
229  }
230  AhiTerm();
231 }
232 
233 bool QAhiScreenPrivate::setMode(AhiDispMode_t mode)
234 {
235  AhiSts_t status;
236 
237  status = AhiDispModeSet(context, &mode, 0);
238  if (status != AhiStsOk) {
239  qCritical("QAhiScreenPrivate::setMode(): AhiDispModeSet failed: %x",
240  status);
241  return false;
242  }
243 
244  if (surface) {
245  AhiSurfFree(context, surface);
246  surface = 0;
247  }
248  status = AhiSurfAlloc(context, &surface, &mode.size, mode.pixFmt,
249  AHIFLAG_SURFFIXED);
250  if (status != AhiStsOk) {
251  qCritical("QAhiScreenPrivate::setMode(): AhisurfAlloc failed: %x",
252  status);
253  return false;
254  }
255 
256  status = AhiDispSurfSet(context, surface, 0);
257  if (status != AhiStsOk) {
258  qCritical("QAhiScreenPrivate::setMode(): AhiDispSurfSet failed: %x",
259  status);
260  return false;
261  }
262 
263  return true;
264 }
265 
267  : QScreen(displayId), d_ptr(new QAhiScreenPrivate)
268 {
269 }
270 
272 {
273  delete d_ptr;
274 }
275 
277 {
278  AhiSurfInfo_t surfaceInfo;
279  AhiSts_t status;
280 
281  status = AhiSurfInfo(d_ptr->context, d_ptr->surface, &surfaceInfo);
282  if (status != AhiStsOk) {
283  qCritical("QAhiScreen::configure(): AhiSurfInfo failed: %x", status);
284  return false;
285  }
286 
287  QScreen::data = 0;
288  QScreen::w = QScreen::dw = surfaceInfo.size.cx;
289  QScreen::h = QScreen::dh = surfaceInfo.size.cy;
290  QScreen::lstep = surfaceInfo.stride;
291  QScreen::size = surfaceInfo.sizeInBytes;
292 
293  switch (surfaceInfo.pixFmt) {
294  case AhiPix1bpp:
296  QScreen::d = 1;
297  break;
298  case AhiPix4bpp:
299  QScreen::d = 4;
300  break;
301  case AhiPix8bpp_332RGB:
302  case AhiPix8bpp:
303  QScreen::d = 8;
304  break;
305  case AhiPix16bpp_444RGB:
307  QScreen::d = 12;
308  break;
309  case AhiPix16bpp_555RGB:
311  QScreen::d = 15;
312  break;
313  case AhiPix16bpp_565RGB:
315  QScreen::d = 16;
316  break;
317  case AhiPix2bpp:
318  QScreen::d = 2;
319  break;
320  case AhiPix32bpp_8888ARGB:
322  // fallthrough
323  case AhiPix32bpp_8888BGRA:
324  QScreen::d = 32;
325  break;
326  default:
327  qCritical("QAhiScreen::configure(): Unknown pixel format: %x",
328  surfaceInfo.pixFmt);
329  return false;
330  }
331 
332  const int dpi = 72;
333  QScreen::physWidth = qRound(QScreen::dw * 25.4 / dpi);
334  QScreen::physHeight = qRound(QScreen::dh * 25.4 / dpi);
335 
336  return true;
337 }
338 
339 bool QAhiScreen::connect(const QString &displaySpec)
340 {
341  Q_UNUSED(displaySpec);
342 
343  AhiSts_t status;
344 
345  status = AhiInit(0);
346  if (status != AhiStsOk) {
347  qCritical("QAhiScreen::connect(): AhiInit failed: %x", status);
348  return false;
349  }
350 
351  AhiDev_t device;
352  AhiDevInfo_t info;
353 
354  status = AhiDevEnum(&device, &info, 0);
355  if (status != AhiStsOk) {
356  qCritical("QAhiScreen::connect(): AhiDevEnum failed: %x", status);
357  return false;
358  }
359 #ifdef QAHISCREEN_DEBUG
360  {
361  int displayNo = 0;
362  AhiDevInfo_t dispInfo = info;
363  qDebug("AHI supported devices:");
364  do {
365  qDebug(" %2i: %s, sw version: %s (rev %u)\n"
366  " chip: 0x%x (rev %u), mem: %i (%i/%i), bus: 0x%x",
367  displayNo, dispInfo.name,
368  dispInfo.swVersion, uint(dispInfo.swRevision),
369  uint(dispInfo.chipId), uint(dispInfo.revisionId),
370  uint(dispInfo.totalMemory),
371  uint(dispInfo.internalMemSize),
372  uint(dispInfo.externalMemSize),
373  uint(dispInfo.cpuBusInterfaceMode));
374  status = AhiDevEnum(&device, &info, ++displayNo);
375  } while (status == AhiStsOk);
376  }
377 #endif
378 
379  status = AhiDevOpen(&d_ptr->context, device, "qscreenahi",
380  AHIFLAG_USERLEVEL);
381  if (status != AhiStsOk) {
382  qCritical("QAhiScreen::connect(): AhiDevOpen failed: %x", status);
383  return false;
384  }
385 
386  AhiDispMode_t mode;
387 
388  status = AhiDispModeEnum(d_ptr->context, &mode, 0);
389  if (status != AhiStsOk) {
390  qCritical("QAhiScreen::connect(): AhiDispModeEnum failed: %x", status);
391  return false;
392  }
393 
394 #ifdef QAHISCREEN_DEBUG
395  {
396  int modeNo = 0;
397  AhiDispMode_t modeInfo = mode;
398  qDebug("AHI supported modes:");
399  do {
400  qDebug(" %2i: %ux%u, fmt: %i, %u Hz, rot: %i, mirror: %i",
401  modeNo, uint(modeInfo.size.cx), uint(modeInfo.size.cy),
402  modeInfo.pixFmt, uint(modeInfo.frequency),
403  modeInfo.rotation, modeInfo.mirror);
404  status = AhiDispModeEnum(d_ptr->context, &modeInfo, ++modeNo);
405  } while (status == AhiStsOk);
406  }
407 #endif
408 
410  if (!d_ptr->setMode(mode))
411  return false;
412  } else {
413  status = AhiDispSurfGet(d_ptr->context, &d_ptr->surface);
414  if (status != AhiStsOk) {
415  qCritical("QAhiScreen::connect(): AhiDispSurfGet failed: %x",
416  status);
417  return false;
418  }
419 
420  status = AhiDispModeGet(d_ptr->context, &mode);
421  if (status != AhiStsOk) {
422  qCritical("QAhiScreen::context(): AhiDispModeGet failed: %x",
423  status);
424  return false;
425  }
426  }
427 
428  return configure();
429 }
430 
432 {
433  AhiSurfFree(d_ptr->context, d_ptr->surface);
434  d_ptr->surface = 0;
435  AhiDevClose(d_ptr->context);
436  d_ptr->context = 0;
437  AhiTerm();
438 }
439 
441 {
443 
444  AhiSts_t status = AhiDispState(d_ptr->context, AhiDispStateOn, 0);
445  if (status != AhiStsOk) {
446  qCritical("QAhiScreen::connect(): AhiDispState failed: %x", status);
447  return false;
448  }
449 
450  return true;
451 }
452 
454 {
455  AhiDispState(d_ptr->context, AhiDispStateOff, 0);
456 }
457 
459 {
460  int modeNo = 0;
461  AhiDispMode_t mode;
462  AhiSts_t status = AhiStsOk;
463 
464  while (status == AhiStsOk) {
465  status = AhiDispModeEnum(d_ptr->context, &mode, modeNo);
466  if (mode.size.cx == uint(width) &&
467  mode.size.cy == uint(height) &&
468  depthForPixelFormat(mode.pixFmt) == depth)
469  {
470  d_ptr->setMode(mode);
471  configure();
472  return;
473  }
474  }
475 }
476 
477 void QAhiScreen::blit(const QImage &image, const QPoint &topLeft,
478  const QRegion &reg)
479 {
480  AhiPixelFormat_t pixFmt = pixelFormatForImageFormat(image.format());
481 
482  if (pixFmt >= AhiPixelFormatMax) { // generic fallback
483  QImage::Format toFormat = pixelFormat();
484  if (toFormat == QImage::Format_Invalid)
485  toFormat = QImage::Format_ARGB32;
486  blit(image.convertToFormat(toFormat), topLeft, reg);
487  return;
488  }
489 
490  AhiSts_t status;
491 
492  status = AhiDrawSurfDstSet(d_ptr->context, d_ptr->surface, 0);
493  if (status != AhiStsOk) {
494  qWarning("QAhiScreen::blit(): AhiDrawSurfDstSet failed: %x", status);
495  return;
496  }
497 
498  const QVector<QRect> rects = (reg & region()).rects();
499  const int numRects = rects.size();
500  QVarLengthArray<AhiPoint_t, 8> src(numRects);
501  QVarLengthArray<AhiRect_t, 8> dest(numRects);
502 
503  for (int i = 0; i < numRects; ++i) {
504  const QRect rect = rects.at(i);
505 
506  src[i].x = rect.x() - topLeft.x();
507  src[i].y = rect.y() - topLeft.y();
508  dest[i].left = rect.left();
509  dest[i].top = rect.top();
510  dest[i].right = rect.x() + rect.width();
511  dest[i].bottom = rect.y() + rect.height();
512  }
513 
514  AhiSize_t bitmapSize = { image.width(), image.height() };
515  AhiBitmap_t bitmap = { bitmapSize, (void*)(image.bits()),
516  image.bytesPerLine(), pixFmt };
517 
518  status = AhiDrawRopSet(d_ptr->context, AHIMAKEROP3(AHIROPSRCCOPY));
519  if (status != AhiStsOk) {
520  qWarning("QAhiScreen::blit(): AhiDrawRopSet failed: %x", status);
521  return;
522  }
523 
524  for (int i = 0; i < numRects; ++i) {
525  status = AhiDrawBitmapBlt(d_ptr->context, &dest[i], &src[i],
526  &bitmap, 0, 0);
527  if (status != AhiStsOk) {
528  qWarning("QAhiScreen::blit(): AhiDrawBitmapBlt failed: %x",
529  status);
530  break;
531  }
532  }
533 }
534 
535 void QAhiScreen::solidFill(const QColor &color, const QRegion &reg)
536 {
537  AhiSts_t status = AhiStsOk;
538 
539  switch (pixelFormat()) {
543  status = AhiDrawBrushFgColorSet(d_ptr->context, color.rgba());
544  break;
546  status = AhiDrawBrushFgColorSet(d_ptr->context, qt_convRgbTo16(color.rgb()));
547  break;
548  default:
549  qFatal("QAhiScreen::solidFill(): Not implemented for pixel format %d",
550  int(pixelFormat()));
551  break;
552  }
553 
554  if (status != AhiStsOk) {
555  qWarning("QAhiScreen::solidFill(): AhiDrawBrushFgColorSet failed: %x",
556  status);
557  return;
558  }
559 
560  status = AhiDrawBrushSet(d_ptr->context, 0, 0, 0, AHIFLAG_BRUSHSOLID);
561  if (status != AhiStsOk) {
562  qWarning("QAhiScreen::solidFill(): AhiDrawBrushSet failed: %x",
563  status);
564  return;
565  }
566 
567  status = AhiDrawRopSet(d_ptr->context, AHIMAKEROP3(AHIROPPATCOPY));
568  if (status != AhiStsOk) {
569  qWarning("QAhiScreen::solidFill(): AhiDrawRopSet failed: %x", status);
570  return;
571  }
572 
573  status = AhiDrawSurfDstSet(d_ptr->context, d_ptr->surface, 0);
574  if (status != AhiStsOk) {
575  qWarning("QAhiScreen::solidFill(): AhiDrawSurfDst failed: %x", status);
576  return;
577  }
578 
579  const QVector<QRect> rects = (reg & region()).rects();
580  QVarLengthArray<AhiRect_t> ahiRects(rects.size());
581 
582  for (int i = 0; i < rects.size(); ++i) {
583  const QRect rect = rects.at(i);
584  ahiRects[i].left = rect.left();
585  ahiRects[i].top = rect.top();
586  ahiRects[i].right = rect.x() + rect.width();
587  ahiRects[i].bottom = rect.y() + rect.height();
588  }
589 
590  status = AhiDrawBitBltMulti(d_ptr->context, ahiRects.data(),
591  0, ahiRects.size());
592  if (status != AhiStsOk)
593  qWarning("QAhiScreen::solidFill(): AhiDrawBitBlt failed: %x", status);
594 }
595 
597 
598 #endif // QT_NO_QWS_AHI
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
The QScreenCursor class is a base class for screen cursors in Qt for Embedded Linux.
Definition: qscreen_qws.h:135
static int depthForPixelFormat(const AhiPixelFormat_t format)
virtual void move(int x, int y)
Moves the mouse cursor to the given position, i.e., (x, y).
Format
The following image formats are available in Qt.
Definition: qimage.h:91
void set(const QImage &image, int hotx, int hoty)
Sets the cursor&#39;s image to be the given image.
int height() const
Returns the logical height of the framebuffer in pixels.
Definition: qscreen_qws.h:228
static mach_timebase_info_data_t info
unsigned char c[8]
Definition: qnumeric_p.h:62
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
int d
the pixel depth
Definition: qscreen_qws.h:327
void move(int x, int y)
Moves the mouse cursor to the given position, i.e., (x, y).
void shutdownDevice()
This function is called by the Qt for Embedded Linux server before it calls the disconnect() function...
QAhiScreenCursor(QScreen *screen, AhiDevCtx_t context)
bool isNull() const
Returns true if it is a null image, otherwise returns false.
Definition: qimage.cpp:1542
bool setMode(AhiDispMode_t mode)
bool connect(const QString &displaySpec)
This function is called by every Qt for Embedded Linux application on startup, and must be implemente...
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
static LibLoadStatus status
Definition: qlocale_icu.cpp:69
int bytesPerLine() const
Returns the number of bytes per image scanline.
Definition: qimage.cpp:1812
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
ushort qt_convRgbTo16(const int r, const int g, const int b)
Definition: qscreen_qws.h:86
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
void setMode(int width, int height, int depth)
Implement this function to reset the framebuffer&#39;s resolution (width and height) and bit depth...
void hide()
Hides the cursor from the screen.
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
static void initSoftwareCursor()
Initializes the screen cursor.
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
void addObject(QObject *object)
QImage image() const
Returns the cursor&#39;s image.
Definition: qscreen_qws.h:151
void setPixelFormat(QImage::Format format)
Sets the screen&#39;s pixel format to format.
static QWSSignalHandler * instance()
Q_CORE_EXPORT void qDebug(const char *,...)
virtual QRegion region() const
Returns the region covered by this screen driver.
Definition: qscreen_qws.h:284
int width() const
Returns the logical width of the framebuffer in pixels.
Definition: qscreen_qws.h:227
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
static AhiPixelFormat_t pixelFormatForImageFormat(const QImage::Format format)
void show()
Shows the mouse cursor.
int w
the logical width of the screen.
Definition: qscreen_qws.h:324
Q_CORE_EXPORT void qWarning(const char *,...)
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
QAhiScreenPrivate * d_ptr
unsigned int uint
Definition: qglobal.h:996
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
virtual void hide()
Hides the cursor from the screen.
uchar * bits()
Returns a pointer to the first pixel data.
Definition: qimage.cpp:1946
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
int serialNumber() const
Returns a number that identifies the contents of this QImage object.
Definition: qimage.cpp:6267
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
int width() const
Returns the width of the image.
Definition: qimage.cpp:1557
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
Definition: qimage.cpp:3966
QImage::Format pixelFormat() const
Returns the pixel format of the screen, or QImage::Format_Invalid if the pixel format is not a suppor...
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
void blit(const QImage &image, const QPoint &topLeft, const QRegion &region)
Copies the given region in the given image to the point specified by topLeft using device coordinates...
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
void solidFill(const QColor &color, const QRegion &region)
Fills the given region of the screen with the specified color.
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void disconnect()
This function is called by every Qt for Embedded Linux application before exiting, and must be implemented to unmap the framebuffer.
int height() const
Returns the height of the image.
Definition: qimage.cpp:1572
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
bool initDevice()
This function is called by the Qt for Embedded Linux server to initialize the framebuffer.
QScopedPointer< QObjectData > d_ptr
Definition: qobject.h:320
int lstep
the number of bytes representing a line in the frame buffer.
Definition: qscreen_qws.h:325
uint supportsAlpha
Definition: qscreen_qws.h:166
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
QAhiScreen(int displayId)
QRgb rgba() const
Returns the RGB value of the color, including its alpha.
Definition: qcolor.cpp:1019
QAhiScreenCursor * cursor
virtual void show()
Shows the mouse cursor.
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137
QRgb rgb() const
Returns the RGB value of the color.
Definition: qcolor.cpp:1051
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203
virtual void set(const QImage &image, int hotx, int hoty)
Sets the cursor&#39;s image to be the given image.
Q_CORE_EXPORT void qCritical(const char *,...)
int depth() const
Returns the depth of the framebuffer, in bits per pixel.
Definition: qscreen_qws.h:229