47 #include <QtGui/qwsdisplay_qws.h> 48 #include <QtGui/qcolor.h> 49 #include <QtGui/qapplication.h> 50 #include <QtGui/qwindowsystem_qws.h> 51 #include <QtGui/private/qgraphicssystem_qws_p.h> 52 #include <QtGui/private/qwssignalhandler_p.h> 53 #include <QtCore/qvarlengtharray.h> 54 #include <QtCore/qvector.h> 55 #include <QtCore/qrect.h> 57 #ifndef QT_NO_QWS_DIRECTFB 80 #ifdef QT_NO_DIRECTFB_WM 81 IDirectFBSurface *primarySurface;
84 #ifndef QT_NO_DIRECTFB_LAYER 89 #ifndef QT_NO_DIRECTFB_MOUSE 92 #ifndef QT_NO_DIRECTFB_KEYBOARD 95 #if defined QT_DIRECTFB_IMAGEPROVIDER && defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE 96 IDirectFBImageProvider *imageProvider;
111 #ifdef QT_NO_DIRECTFB_WM
114 #ifndef QT_NO_DIRECTFB_LAYER
117 #ifndef QT_NO_DIRECTFB_MOUSE
120 #ifndef QT_NO_DIRECTFB_KEYBOARD
130 #ifndef QT_NO_QWS_SIGNALHANDLER 133 #ifdef QT_DIRECTFB_WM 141 #ifndef QT_NO_DIRECTFB_MOUSE 144 #ifndef QT_NO_DIRECTFB_KEYBOARD 147 #if defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE 149 imageProvider->Release(imageProvider);
156 #ifdef QT_NO_DIRECTFB_WM 158 primarySurface->Release(primarySurface);
161 #ifndef QT_NO_DIRECTFB_LAYER 185 DFBSurfaceDescription description;
186 memset(&description, 0,
sizeof(DFBSurfaceDescription));
187 description.width = image.
width();
188 description.height = image.
height();
189 description.flags = DSDESC_WIDTH|DSDESC_HEIGHT|DSDESC_PIXELFORMAT;
190 initSurfaceDescriptionPixelFormat(&description, format);
191 bool doMemCopy =
true;
192 #ifdef QT_DIRECTFB_PREALLOCATED 193 if (!(options & NoPreallocated)) {
195 description.flags |= DSDESC_PREALLOCATED;
196 description.preallocated[0].data =
const_cast<uchar*
>(image.
bits());
197 description.preallocated[0].pitch = image.
bytesPerLine();
198 description.preallocated[1].data = 0;
199 description.preallocated[1].pitch = 0;
203 IDirectFBSurface *surface = createDFBSurface(description, options, &result);
207 DirectFBError(
"Couldn't create surface createDFBSurface(QImage, QImage::Format, SurfaceCreationOptions)", result);
214 const int height = image.
height();
216 if (bplQt == bplDFB && bplQt == (image.
width() * image.
depth() / 8)) {
219 for (
int i=0; i<height; ++i) {
220 memcpy(mem, image.
scanLine(i), bplQt);
224 surface->Unlock(surface);
227 #ifdef QT_DIRECTFB_PALETTE 229 QDirectFBScreen::setSurfaceColorTable(surface, image);
236 SurfaceCreationOptions options,
242 IDirectFBSurface *surface = createDFBSurface(size, format, options, result);
244 ? DSBLIT_BLEND_ALPHACHANNEL
246 if (flags & DSBLIT_BLEND_ALPHACHANNEL)
247 surface->Clear(surface, 0, 0, 0, 0);
249 surface->SetBlittingFlags(surface, flags);
250 surface->Blit(surface, src, 0, 0, 0);
251 #if (Q_DIRECTFB_VERSION >= 0x010000) 252 surface->ReleaseSource(surface);
259 SurfaceCreationOptions options,
262 DFBSurfaceDescription desc;
263 memset(&desc, 0,
sizeof(DFBSurfaceDescription));
264 desc.flags |= DSDESC_WIDTH|DSDESC_HEIGHT;
267 desc.width = size.
width();
268 desc.height = size.
height();
269 return createDFBSurface(desc, options, result);
275 DFBResult &result = (resultPtr ? *resultPtr : tmp);
277 IDirectFBSurface *newSurface = 0;
280 qWarning(
"QDirectFBScreen::createDFBSurface() - not connected");
284 if (
d_ptr->directFBFlags & VideoOnly
285 && !(desc.flags & DSDESC_PREALLOCATED)
286 && (!(desc.flags & DSDESC_CAPS) || !(desc.caps & DSCAPS_SYSTEMONLY))) {
288 if (!(desc.flags & DSDESC_CAPS)) {
289 desc.caps = DSCAPS_VIDEOONLY;
290 desc.flags |= DSDESC_CAPS;
292 desc.caps |= DSCAPS_VIDEOONLY;
294 result =
d_ptr->dfb->CreateSurface(
d_ptr->dfb, &desc, &newSurface);
297 && (desc.flags & DSDESC_CAPS) && (desc.caps & DSCAPS_PRIMARY)
300 qWarning(
"QDirectFBScreen::createDFBSurface() Failed to create surface in video memory!\n" 301 " Flags %0x Caps %0x width %d height %d pixelformat %0x %d preallocated %p %d\n%s",
302 desc.flags, desc.caps, desc.width, desc.height,
303 desc.pixelformat, DFB_PIXELFORMAT_INDEX(desc.pixelformat),
304 desc.preallocated[0].data, desc.preallocated[0].pitch,
305 DirectFBErrorString(result));
307 desc.caps &= ~DSCAPS_VIDEOONLY;
310 if (
d_ptr->directFBFlags & SystemOnly)
311 desc.caps |= DSCAPS_SYSTEMONLY;
314 result =
d_ptr->dfb->CreateSurface(
d_ptr->dfb, &desc, &newSurface);
316 if (result != DFB_OK) {
317 qWarning(
"QDirectFBScreen::createDFBSurface() Failed!\n" 318 " Flags %0x Caps %0x width %d height %d pixelformat %0x %d preallocated %p %d\n%s",
319 desc.flags, desc.caps, desc.width, desc.height,
320 desc.pixelformat, DFB_PIXELFORMAT_INDEX(desc.pixelformat),
321 desc.preallocated[0].data, desc.preallocated[0].pitch,
322 DirectFBErrorString(result));
328 if (options & TrackSurface) {
329 d_ptr->allocatedSurfaces.insert(newSurface);
335 #ifdef QT_DIRECTFB_SUBSURFACE 336 IDirectFBSurface *QDirectFBScreen::getSubSurface(IDirectFBSurface *surface,
338 SurfaceCreationOptions options,
339 DFBResult *resultPtr)
341 Q_ASSERT(!(options & NoPreallocated));
344 DFBResult &result = (resultPtr ? *resultPtr : res);
345 IDirectFBSurface *subSurface = 0;
347 result = surface->GetSubSurface(surface, 0, &subSurface);
349 const DFBRectangle subRect = { rect.
x(), rect.
y(), rect.
width(), rect.
height() };
350 result = surface->GetSubSurface(surface, &subRect, &subSurface);
352 if (result != DFB_OK) {
353 DirectFBError(
"Can't get sub surface", result);
354 }
else if (options & TrackSurface) {
355 d_ptr->allocatedSurfaces.insert(subSurface);
366 surface->Release(surface);
367 if (!
d_ptr->allocatedSurfaces.remove(surface))
368 qWarning(
"QDirectFBScreen::releaseDFBSurface() - %p not in list", surface);
375 return d_ptr->directFBFlags;
383 #ifdef QT_NO_DIRECTFB_WM 384 IDirectFBSurface *QDirectFBScreen::primarySurface()
386 return d_ptr->primarySurface;
390 #ifndef QT_NO_DIRECTFB_LAYER 393 return d_ptr->dfbLayer;
400 #ifndef QT_NO_DIRECTFB_PALETTE 407 return DSPF_ARGB4444;
408 #if (Q_DIRECTFB_VERSION >= 0x010100) 416 #if (Q_DIRECTFB_VERSION >= 0x010000) 418 return DSPF_ARGB6666;
434 DFBSurfacePixelFormat
format;
435 surface->GetPixelFormat(surface, &format);
444 #if (Q_DIRECTFB_VERSION >= 0x010100) 453 #if (Q_DIRECTFB_VERSION >= 0x010000) 462 DFBSurfaceCapabilities caps;
463 const DFBResult result = surface->GetCapabilities(surface, &caps);
466 return (caps & DSCAPS_PREMULTIPLIED
478 DFBSurfaceDescription description;
479 memset(&description, 0,
sizeof(DFBSurfaceDescription));
481 description.flags = DSDESC_CAPS|DSDESC_WIDTH|DSDESC_HEIGHT|DSDESC_PIXELFORMAT|DSDESC_PREALLOCATED;
482 description.caps = DSCAPS_PREMULTIPLIED;
483 description.width = length;
484 description.height = 1;
485 description.pixelformat = DSPF_ARGB;
486 description.preallocated[0].data = (
void*)buffer;
487 description.preallocated[0].pitch = length *
sizeof(
uint);
488 description.preallocated[1].data = 0;
489 description.preallocated[1].pitch = 0;
493 #ifndef QT_NO_DIRECTFB_PALETTE 494 void QDirectFBScreen::setSurfaceColorTable(IDirectFBSurface *surface,
505 for (
int i = 0; i < numColors; ++i) {
508 colors[i].r =
qRed(c);
510 colors[i].b =
qBlue(c);
513 IDirectFBPalette *palette;
515 result = surface->GetPalette(surface, &palette);
516 if (result != DFB_OK) {
517 DirectFBError(
"QDirectFBScreen::setSurfaceColorTable GetPalette",
521 result = palette->SetEntries(palette, colors.
data(), numColors, 0);
522 if (result != DFB_OK) {
523 DirectFBError(
"QDirectFBScreen::setSurfaceColorTable SetEntries",
526 palette->Release(palette);
529 #endif // QT_NO_DIRECTFB_PALETTE 531 #if defined QT_DIRECTFB_CURSOR 536 virtual void set(
const QImage &image,
int hotx,
int hoty);
537 virtual void move(
int x,
int y);
541 #ifdef QT_DIRECTFB_WINDOW_AS_CURSOR 553 qFatal(
"QDirectFBScreenCursor: DirectFB not initialized");
560 supportsAlpha =
true;
561 #ifdef QT_DIRECTFB_WINDOW_AS_CURSOR 563 DFBResult result = layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE);
564 if (result != DFB_OK) {
565 DirectFBError(
"QDirectFBScreenCursor::hide: " 566 "Unable to set cooperative level", result);
568 result = layer->SetCursorOpacity(layer, 0);
569 if (result != DFB_OK) {
570 DirectFBError(
"QDirectFBScreenCursor::hide: " 571 "Unable to set cursor opacity", result);
574 result = layer->SetCooperativeLevel(layer, DLSCL_SHARED);
575 if (result != DFB_OK) {
576 DirectFBError(
"QDirectFBScreenCursor::hide: " 577 "Unable to set cooperative level", result);
582 #ifdef QT_DIRECTFB_WINDOW_AS_CURSOR 583 QDirectFBScreenCursor::~QDirectFBScreenCursor()
591 bool QDirectFBScreenCursor::createWindow()
595 DFBWindowDescription description;
596 memset(&description, 0,
sizeof(DFBWindowDescription));
597 description.flags = DWDESC_POSX|DWDESC_POSY|DWDESC_WIDTH|DWDESC_HEIGHT|DWDESC_CAPS|DWDESC_PIXELFORMAT|DWDESC_SURFACE_CAPS;
598 description.width = cursor.width();
599 description.height = cursor.height();
600 description.posx = pos.x() - hotspot.x();
601 description.posy = pos.y() - hotspot.y();
602 #if (Q_DIRECTFB_VERSION >= 0x010100) 603 description.flags |= DWDESC_OPTIONS;
604 description.options = DWOP_GHOST|DWOP_ALPHACHANNEL;
606 description.caps = DWCAPS_NODECORATION|DWCAPS_DOUBLEBUFFER;
610 description.surface_caps = DSCAPS_PREMULTIPLIED;
612 DFBResult result = layer->CreateWindow(layer, &description, &
window);
613 if (result != DFB_OK) {
614 DirectFBError(
"QDirectFBScreenCursor::createWindow: Unable to create window", result);
618 if (result != DFB_OK) {
619 DirectFBError(
"QDirectFBScreenCursor::createWindow: Unable to set opacity ", result);
624 if (result != DFB_OK) {
625 DirectFBError(
"QDirectFBScreenCursor::createWindow: Unable to set stacking class ", result);
630 if (result != DFB_OK) {
631 DirectFBError(
"QDirectFBScreenCursor::createWindow: Unable to raise window ", result);
642 #ifdef QT_DIRECTFB_WINDOW_AS_CURSOR 644 const QPoint p = pos - hotspot;
646 if (result != DFB_OK) {
647 DirectFBError(
"QDirectFBScreenCursor::move: Unable to move window", result);
651 layer->WarpCursor(layer, x, y);
660 #ifndef QT_DIRECTFB_WINDOW_AS_CURSOR 661 result = layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE);
662 if (result != DFB_OK) {
663 DirectFBError(
"QDirectFBScreenCursor::hide: " 664 "Unable to set cooperative level", result);
666 result = layer->SetCursorOpacity(layer, 0);
667 if (result != DFB_OK) {
668 DirectFBError(
"QDirectFBScreenCursor::hide: " 669 "Unable to set cursor opacity", result);
671 result = layer->SetCooperativeLevel(layer, DLSCL_SHARED);
672 if (result != DFB_OK) {
673 DirectFBError(
"QDirectFBScreenCursor::hide: " 674 "Unable to set cooperative level", result);
679 if (result != DFB_OK) {
680 DirectFBError(
"QDirectFBScreenCursor::hide: " 681 "Unable to set window opacity", result);
693 result = layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE);
694 if (result != DFB_OK) {
695 DirectFBError(
"QDirectFBScreenCursor::show: " 696 "Unable to set cooperative level", result);
698 result = layer->SetCursorOpacity(layer,
699 #ifdef QT_DIRECTFB_WINDOW_AS_CURSOR
705 if (result != DFB_OK) {
706 DirectFBError(
"QDirectFBScreenCursor::show: " 707 "Unable to set cursor shape", result);
709 result = layer->SetCooperativeLevel(layer, DLSCL_SHARED);
710 if (result != DFB_OK) {
711 DirectFBError(
"QDirectFBScreenCursor::show: " 712 "Unable to set cooperative level", result);
714 #ifdef QT_DIRECTFB_WINDOW_AS_CURSOR 717 if (result != DFB_OK) {
718 DirectFBError(
"QDirectFBScreenCursor::show: " 719 "Unable to set window opacity", result);
737 size = cursor.
size();
738 hotspot =
QPoint(hotx, hoty);
739 DFBResult result = DFB_OK;
743 DirectFBError(
"QDirectFBScreenCursor::set: Unable to create surface", result);
746 #ifndef QT_DIRECTFB_WINDOW_AS_CURSOR 747 result = layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE);
748 if (result != DFB_OK) {
749 DirectFBError(
"QDirectFBScreenCursor::show: " 750 "Unable to set cooperative level", result);
752 result = layer->SetCursorShape(layer, surface, hotx, hoty);
753 if (result != DFB_OK) {
754 DirectFBError(
"QDirectFBScreenCursor::show: " 755 "Unable to set cursor shape", result);
757 result = layer->SetCooperativeLevel(layer, DLSCL_SHARED);
758 if (result != DFB_OK) {
759 DirectFBError(
"QDirectFBScreenCursor::show: " 760 "Unable to set cooperative level", result);
763 if (
window || createWindow()) {
766 if (result != DFB_OK) {
767 DirectFBError(
"QDirectFBScreenCursor::set: " 768 "Unable to get window size", result);
770 result =
window->Resize(
window, size.width(), size.height());
771 if (result != DFB_OK) {
772 DirectFBError(
"QDirectFBScreenCursor::set: Unable to resize window", result);
775 IDirectFBSurface *windowSurface;
777 if (result != DFB_OK) {
778 DirectFBError(
"QDirectFBScreenCursor::set: Unable to get window surface", result);
780 result = windowSurface->Clear(windowSurface, 0, 0, 0, 0);
781 if (result != DFB_OK) {
782 DirectFBError(
"QDirectFBScreenCursor::set: Unable to clear surface", result);
785 result = windowSurface->Blit(windowSurface, surface, 0, 0, 0);
786 if (result != DFB_OK) {
787 DirectFBError(
"QDirectFBScreenCursor::set: Unable to blit to surface", result);
790 result = windowSurface->Flip(windowSurface, 0, DSFLIP_NONE);
791 if (result != DFB_OK) {
792 DirectFBError(
"QDirectFBScreenCursor::set: Unable to flip window", result);
795 windowSurface->Release(windowSurface);
798 surface->Release(surface);
803 #endif // QT_DIRECTFB_CURSOR 808 QDirectFBScreenPrivate::instance =
this;
813 if (QDirectFBScreenPrivate::instance ==
this)
814 QDirectFBScreenPrivate::instance = 0;
837 #if (Q_DIRECTFB_VERSION >= 0x010100) 841 #if (Q_DIRECTFB_VERSION >= 0x010100) 871 case QImage::NImageFormats:
909 flipFlags = DSFLIP_NONE;
910 foreach(
const QString &flip, flips) {
912 flipFlags |= DSFLIP_WAIT;
914 flipFlags |= DSFLIP_BLIT;
916 flipFlags |= DSFLIP_ONSYNC;
918 flipFlags |= DSFLIP_PIPELINE;
920 qWarning(
"QDirectFBScreen: Unknown flip argument: %s",
924 flipFlags = DSFLIP_BLIT|DSFLIP_ONSYNC;
928 #ifdef QT_DIRECTFB_WM 948 #if (Q_DIRECTFB_VERSION >= 0x000923) 950 struct FlagDescription;
951 static const FlagDescription *accelerationDescriptions = 0;
952 static const FlagDescription *blitDescriptions = 0;
953 static const FlagDescription *drawDescriptions = 0;
955 struct FlagDescription {
960 static const FlagDescription accelerationDescriptions[] = {
961 {
"DFXL_NONE", DFXL_NONE },
962 {
"DFXL_FILLRECTANGLE", DFXL_FILLRECTANGLE },
963 {
"DFXL_DRAWRECTANGLE", DFXL_DRAWRECTANGLE },
964 {
"DFXL_DRAWLINE", DFXL_DRAWLINE },
965 {
"DFXL_FILLTRIANGLE", DFXL_FILLTRIANGLE },
966 {
"DFXL_BLIT", DFXL_BLIT },
967 {
"DFXL_STRETCHBLIT", DFXL_STRETCHBLIT },
968 {
"DFXL_TEXTRIANGLES", DFXL_TEXTRIANGLES },
969 {
"DFXL_DRAWSTRING", DFXL_DRAWSTRING },
973 static const FlagDescription blitDescriptions[] = {
974 {
"DSBLIT_NOFX", DSBLIT_NOFX },
975 {
"DSBLIT_BLEND_ALPHACHANNEL", DSBLIT_BLEND_ALPHACHANNEL },
976 {
"DSBLIT_BLEND_COLORALPHA", DSBLIT_BLEND_COLORALPHA },
977 {
"DSBLIT_COLORIZE", DSBLIT_COLORIZE },
978 {
"DSBLIT_SRC_COLORKEY", DSBLIT_SRC_COLORKEY },
979 {
"DSBLIT_DST_COLORKEY", DSBLIT_DST_COLORKEY },
980 {
"DSBLIT_SRC_PREMULTIPLY", DSBLIT_SRC_PREMULTIPLY },
981 {
"DSBLIT_DST_PREMULTIPLY", DSBLIT_DST_PREMULTIPLY },
982 {
"DSBLIT_DEMULTIPLY", DSBLIT_DEMULTIPLY },
983 {
"DSBLIT_DEINTERLACE", DSBLIT_DEINTERLACE },
984 #if (Q_DIRECTFB_VERSION >= 0x000923) 985 {
"DSBLIT_SRC_PREMULTCOLOR", DSBLIT_SRC_PREMULTCOLOR },
986 {
"DSBLIT_XOR", DSBLIT_XOR },
988 #if (Q_DIRECTFB_VERSION >= 0x010000) 989 {
"DSBLIT_INDEX_TRANSLATION", DSBLIT_INDEX_TRANSLATION },
994 static const FlagDescription drawDescriptions[] = {
995 {
"DSDRAW_NOFX", DSDRAW_NOFX },
996 {
"DSDRAW_BLEND", DSDRAW_BLEND },
997 {
"DSDRAW_DST_COLORKEY", DSDRAW_DST_COLORKEY },
998 {
"DSDRAW_SRC_PREMULTIPLY", DSDRAW_SRC_PREMULTIPLY },
999 {
"DSDRAW_DST_PREMULTIPLY", DSDRAW_DST_PREMULTIPLY },
1000 {
"DSDRAW_DEMULTIPLY", DSDRAW_DEMULTIPLY },
1001 {
"DSDRAW_XOR", DSDRAW_XOR },
1014 return flags[0].name;
1017 for (
int i=1; flags[i].name; ++i) {
1018 if (mask & flags[i].flag) {
1026 static void printDirectFBInfo(IDirectFB *fb, IDirectFBSurface *primarySurface)
1029 DFBGraphicsDeviceDescription dev;
1031 result = fb->GetDeviceDescription(fb, &dev);
1032 if (result != DFB_OK) {
1033 DirectFBError(
"Error reading graphics device description", result);
1038 primarySurface->GetPixelFormat(primarySurface, &pixelFormat);
1040 qDebug(
"Device: %s (%s), Driver: %s v%i.%i (%s) Pixelformat: %d (%d)\n" 1041 "acceleration: 0x%x%s\nblit: 0x%x%s\ndraw: 0x%0x%s\nvideo: %iKB\n",
1042 dev.name, dev.vendor, dev.driver.name, dev.driver.major,
1043 dev.driver.minor, dev.driver.vendor, DFB_PIXELFORMAT_INDEX(pixelFormat),
1045 flagDescriptions(dev.acceleration_mask, accelerationDescriptions).constData(),
1046 dev.blitting_flags,
flagDescriptions(dev.blitting_flags, blitDescriptions).constData(),
1047 dev.drawing_flags,
flagDescriptions(dev.drawing_flags, drawDescriptions).constData(),
1048 (dev.video_memory >> 10));
1057 if (arguments.
indexOf(rx) != -1) {
1066 QRegExp rx(
QLatin1String(
"#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])"));
1072 for (i=0; i<4; ++i) {
1074 ints[i] = rx.
cap(i + 1).
toUInt(&ok, 16);
1075 if (!ok || ints[i] > 255)
1079 return QColor(ints[0], ints[1], ints[2], ints[3]);
1086 DFBResult result = DFB_OK;
1090 int argc = args.
size();
1091 char **argv =
new char*[argc];
1093 for (
int i = 0; i < argc; ++i)
1096 result = DirectFBInit(&argc, &argv);
1097 if (result != DFB_OK) {
1098 DirectFBError(
"QDirectFBScreen: error initializing DirectFB",
1109 result = DirectFBCreate(&
d_ptr->
dfb);
1110 if (result != DFB_OK) {
1111 DirectFBError(
"QDirectFBScreen: error creating DirectFB interface",
1121 qWarning(
"QDirectFBScreen: error. videoonly and systemonly are mutually exclusive");
1133 #ifdef QT_DIRECTFB_IMAGECACHE 1134 int imageCacheSize = 4 * 1024 * 1024;
1139 #ifndef QT_NO_DIRECTFB_WM 1146 DFBSurfaceDescription description;
1147 memset(&description, 0,
sizeof(DFBSurfaceDescription));
1148 IDirectFBSurface *surface;
1150 #ifdef QT_NO_DIRECTFB_WM 1151 description.flags = DSDESC_CAPS;
1153 description.flags |= DSDESC_WIDTH;
1155 description.flags |= DSDESC_HEIGHT;
1157 description.caps = DSCAPS_PRIMARY|DSCAPS_DOUBLE;
1160 const DFBSurfaceCapabilities cap;
1161 }
const capabilities[] = {
1162 {
"static_alloc", DSCAPS_STATIC_ALLOC },
1163 {
"triplebuffer", DSCAPS_TRIPLE },
1164 {
"interlaced", DSCAPS_INTERLACED },
1165 {
"separated", DSCAPS_SEPARATED },
1169 for (
int i=0; capabilities[i].name; ++i) {
1171 description.caps |= capabilities[i].cap;
1174 if (forcePremultiplied) {
1175 description.caps |= DSCAPS_PREMULTIPLIED;
1180 if (!
d_ptr->primarySurface) {
1181 DirectFBError(
"QDirectFBScreen: error creating primary surface",
1186 surface =
d_ptr->primarySurface;
1188 description.flags = DSDESC_WIDTH|DSDESC_HEIGHT;
1189 description.width = description.height = 1;
1192 DirectFBError(
"QDirectFBScreen: error creating surface", result);
1200 switch (pixelFormat) {
1212 qWarning(
"QDirectFBScreen::connect(). Qt/DirectFB does not work with the LUT8 pixelformat.");
1214 case QImage::NImageFormats:
1224 if (forcePremultiplied)
1240 if (result != DFB_OK) {
1241 DirectFBError(
"QDirectFBScreen::connect: " 1242 "Unable to get screen!", result);
1249 qWarning(
"QDirectFBScreen::connect: Can't parse QWS_SIZE=\"%s\"",
qPrintable(qws_size));
1251 int *ints[2] = { &
w, &
h };
1252 for (
int i=0; i<2; ++i) {
1254 if (*ints[i] <= 0) {
1255 qWarning(
"QDirectFBScreen::connect: %s is not a positive integer",
1267 #ifndef QT_NO_DIRECTFB_LAYER 1268 int layerId = DLID_PRIMARY;
1271 result =
d_ptr->
dfb->GetDisplayLayer(
d_ptr->
dfb, static_cast<DFBDisplayLayerID>(layerId),
1273 if (result != DFB_OK) {
1274 DirectFBError(
"QDirectFBScreen::connect: " 1275 "Unable to get display layer!", result);
1283 if (
w <= 0 ||
h <= 0) {
1284 #ifdef QT_NO_DIRECTFB_WM 1285 result =
d_ptr->primarySurface->GetSize(
d_ptr->primarySurface, &
w, &
h);
1286 #elif (Q_DIRECTFB_VERSION >= 0x010000) 1287 IDirectFBSurface *layerSurface;
1289 result = layerSurface->GetSize(layerSurface, &
w, &
h);
1290 layerSurface->Release(layerSurface);
1292 if (
w <= 0 ||
h <= 0) {
1296 qWarning(
"QDirectFBScreen::connect: DirectFB versions prior to 1.0 do not offer a way\n" 1297 "query the size of the primary surface in windowed mode. You have to specify\n" 1298 "the size of the display using QWS_SIZE=[0-9]x[0-9] or\n" 1299 "QWS_DISPLAY=directfb:width=[0-9]:height=[0-9]");
1302 if (result != DFB_OK) {
1303 DirectFBError(
"QDirectFBScreen::connect: " 1304 "Unable to get screen size!", result);
1326 #if (Q_DIRECTFB_VERSION >= 0x000923) 1328 printDirectFBInfo(
d_ptr->
dfb, surface);
1330 #ifdef QT_DIRECTFB_WM 1331 surface->Release(surface);
1339 if (displayArgs.
indexOf(backgroundColorRegExp) != -1) {
1342 #ifdef QT_NO_DIRECTFB_WM 1343 if (!backgroundColor.
isValid())
1345 d_ptr->primarySurface->Clear(
d_ptr->primarySurface, backgroundColor.
red(),
1346 backgroundColor.
green(), backgroundColor.
blue(),
1347 backgroundColor.
alpha());
1350 if (backgroundColor.
isValid()) {
1352 if (result != DFB_OK) {
1353 DirectFBError(
"QDirectFBScreen::connect " 1354 "Unable to set cooperative level", result);
1357 backgroundColor.
blue(), backgroundColor.
alpha());
1358 if (result != DFB_OK) {
1359 DirectFBError(
"QDirectFBScreenCursor::connect: " 1360 "Unable to set background color", result);
1364 if (result != DFB_OK) {
1365 DirectFBError(
"QDirectFBScreenCursor::connect: " 1366 "Unable to set background mode", result);
1370 if (result != DFB_OK) {
1371 DirectFBError(
"QDirectFBScreen::connect " 1372 "Unable to set cooperative level", result);
1383 #if defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE 1384 if (
d_ptr->imageProvider)
1385 d_ptr->imageProvider->Release(
d_ptr->imageProvider);
1387 #ifdef QT_NO_DIRECTFB_WM 1388 d_ptr->primarySurface->Release(
d_ptr->primarySurface);
1389 d_ptr->primarySurface = 0;
1393 surf->Release(surf);
1396 #ifndef QT_NO_DIRECTFB_LAYER 1410 #ifndef QT_NO_DIRECTFB_MOUSE 1416 #ifndef QT_NO_DIRECTFB_KEYBOARD 1423 #ifdef QT_DIRECTFB_CURSOR 1425 #elif !defined QT_NO_QWS_CURSOR 1433 #ifndef QT_NO_DIRECTFB_MOUSE 1437 #ifndef QT_NO_DIRECTFB_KEYBOARD 1442 #ifndef QT_NO_QWS_CURSOR 1456 (on ? DSPM_ON : DSPM_SUSPEND));
1461 #ifdef QT_NO_DIRECTFB_WM 1480 #if defined QT_NO_DIRECTFB_WM 1481 struct PaintCommand {
1482 PaintCommand() : dfbSurface(0), windowOpacity(255), blittingFlags(DSBLIT_NOFX) {}
1483 IDirectFBSurface *dfbSurface;
1488 DFBSurfaceBlittingFlags blittingFlags;
1491 static inline void initParameters(DFBRectangle &source,
const QRect &sourceGlobal,
const QPoint &pos)
1493 source.x = sourceGlobal.
x() - pos.
x();
1494 source.y = sourceGlobal.
y() - pos.
y();
1495 source.w = sourceGlobal.
width();
1496 source.h = sourceGlobal.
height();
1503 #if defined QT_NO_DIRECTFB_WM 1511 IDirectFBSurface *primary =
d_ptr->primarySurface;
1516 for (
int i=0; i<windows.
size(); ++i) {
1522 const QRegion intersection = region & windowGeometry;
1527 PaintCommand &cmd = commands[idx];
1533 if (!cmd.dfbSurface) {
1537 cmd.image = surface->
image();
1538 if (cmd.image.isNull()) {
1544 cmd.windowPosition = windowGeometry.topLeft();
1545 cmd.source = intersection;
1547 region -= intersection;
1551 cmd.windowOpacity = windows.
at(i)->
opacity();
1552 cmd.blittingFlags = cmd.windowOpacity == 255
1553 ? DSBLIT_BLEND_ALPHACHANNEL
1554 : (DSBLIT_BLEND_ALPHACHANNEL|DSBLIT_BLEND_COLORALPHA);
1561 const PaintCommand &cmd = commands[--idx];
1562 Q_ASSERT(cmd.dfbSurface || !cmd.image.isNull());
1563 IDirectFBSurface *surface;
1564 if (cmd.dfbSurface) {
1565 surface = cmd.dfbSurface;
1570 Q_ASSERT((result != DFB_OK) == !surface);
1571 if (result != DFB_OK) {
1572 DirectFBError(
"QDirectFBScreen::exposeRegion: Can't create surface from image", result);
1577 primary->SetBlittingFlags(primary, cmd.blittingFlags);
1578 if (cmd.blittingFlags & DSBLIT_BLEND_COLORALPHA) {
1579 primary->SetColor(primary, 0xff, 0xff, 0xff, cmd.windowOpacity);
1581 const QRegion ®ion = cmd.source;
1582 const int rectCount = region.
rectCount();
1583 DFBRectangle source;
1584 if (rectCount == 1) {
1585 ::initParameters(source, region.
boundingRect(), cmd.windowPosition);
1586 primary->Blit(primary, surface, &source, cmd.windowPosition.x() + source.x, cmd.windowPosition.y() + source.y);
1589 for (
int i=0; i<rectCount; ++i) {
1590 ::initParameters(source, rects.
at(i), cmd.windowPosition);
1591 primary->Blit(primary, surface, &source, cmd.windowPosition.x() + source.x, cmd.windowPosition.y() + source.y);
1594 if (surface != cmd.dfbSurface) {
1595 surface->Release(surface);
1599 primary->SetColor(primary, 0xff, 0xff, 0xff, 0xff);
1601 #if defined QT_NO_DIRECTFB_CURSOR and !defined QT_NO_QWS_CURSOR 1603 const QRect cursorRectangle = cursor->boundingRect();
1604 if (cursor->isVisible() && !cursor->isAccelerated() && r.
intersects(cursorRectangle)) {
1605 const QImage image = cursor->image();
1615 primary->SetBlittingFlags(primary, DSBLIT_BLEND_ALPHACHANNEL);
1621 primary->SetBlittingFlags(primary, DSBLIT_NOFX);
1627 #ifdef QT_DIRECTFB_WM 1640 surface->SetClip(surface, ®ion);
1641 surface->Clear(surface, color.
red(), color.
green(), color.
blue(), color.
alpha());
1654 for (
int i=0; i<n; ++i) {
1658 surface->SetClip(surface, 0);
1670 if (pixelformat == DSPF_UNKNOWN)
1672 description->flags |= DSDESC_PIXELFORMAT;
1673 description->pixelformat = pixelformat;
1675 if (!(description->flags & DSDESC_CAPS)) {
1676 description->caps = DSCAPS_PREMULTIPLIED;
1677 description->flags |= DSDESC_CAPS;
1679 description->caps |= DSCAPS_PREMULTIPLIED;
1688 const DFBResult result = surface->Lock(surface, flags, &mem, bpl);
1689 if (result != DFB_OK) {
1690 DirectFBError(
"QDirectFBScreen::lockSurface()", result);
1693 return reinterpret_cast<uchar*
>(mem);
1712 surface->Flip(surface, 0, flipFlags);
1716 const DFBSurfaceFlipFlags nonWaitFlags = flipFlags & ~DSFLIP_WAIT;
1717 for (
int i=0; i<rects.
size(); ++i) {
1719 const DFBRegion dfbReg = { r.
x() + offset.
x(), r.
y() + offset.
y(),
1722 surface->Flip(surface, &dfbReg, i + 1 < rects.
size() ? nonWaitFlags : flipFlags);
1726 const DFBRegion dfbReg = { r.
x() + offset.
x(), r.
y() + offset.
y(),
1729 surface->Flip(surface, &dfbReg, flipFlags);
1734 #if defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE 1735 void QDirectFBScreen::setDirectFBImageProvider(IDirectFBImageProvider *provider)
1738 if (
d_ptr->imageProvider)
1739 d_ptr->imageProvider->Release(
d_ptr->imageProvider);
1740 d_ptr->imageProvider = provider;
1749 #ifdef QT_DIRECTFB_WM 1775 #ifdef QT_DIRECTFB_SUBSURFACE 1781 IDirectFBSurface *subSurface = 0;
1786 const DFBRectangle subRect = { rect.
x(), rect.
y(), rect.
width(), rect.
height() };
1787 const DFBResult result = surface->GetSubSurface(surface, &subRect, &subSurface);
1788 if (result != DFB_OK) {
1789 DirectFBError(
"QDirectFBScreen::subSurface(): Can't get sub surface", result);
1801 #ifdef QT_DIRECTFB_SUBSURFACE 1807 #ifdef QT_DIRECTFB_WM 1817 #include "qdirectfbscreen.moc" 1818 #endif // QT_NO_QWS_DIRECTFB The QColor class provides colors based on RGB, HSV or CMYK values.
The QScreenCursor class is a base class for screen cursors in Qt for Embedded Linux.
QImage::Format alphaPixmapFormat
QRect geometry() const
Returns the currently allocated area on the screen.
The QWSWindowSurface class provides the drawing area for top-level windows in Qt for Embedded Linux...
static DFBSurfaceDescription getSurfaceDescription(const uint *buffer, int length)
Format
The following image formats are available in Qt.
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
int height() const
Returns the logical height of the framebuffer in pixels.
IDirectFBSurface * createDFBSurface(const QImage &image, QImage::Format format, SurfaceCreationOptions options, DFBResult *result=0)
QPixmapData * createPixmapData(QPixmapData::PixelType type) const
QString cap(int nth=0) const
Returns the text captured by the nth subexpression.
#define QT_END_NAMESPACE
This macro expands to.
IDirectFBSurface * directFBSurface() const
static bool isFullUpdate(IDirectFBSurface *surface, const QRegion ®ion, const QPoint &offset)
Q_CORE_EXPORT QTextStream & ws(QTextStream &s)
QPointer< QWidget > widget
static bool hasAlphaChannel(DFBSurfacePixelFormat format)
static QWSServer * instance()
static QDirectFBScreen * instance
The QRegExp class provides pattern matching using regular expressions.
DirectFBFlags directFBFlags() const
virtual void set(const QImage &image, int hotx, int hoty)
Sets the cursor's image to be the given image.
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 ...
static void initImageCache(int size)
#define it(className, varName)
static void setDefaultMouse(const char *)
Sets the mouse driver that will be used if the QWS_MOUSE_PROTO environment variable is not defined...
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
static bool isPremultiplied(QImage::Format format)
bool connect(const QString &displaySpec)
This function is called by every Qt for Embedded Linux application on startup, and must be implemente...
void onWindowEvent(QWSWindow *window, QWSServer::WindowEvent event)
void releaseDFBSurface(IDirectFBSurface *surface)
bool isNull() const
Returns true if it is a null image, otherwise returns false.
QDirectFBScreen::DirectFBFlags directFBFlags
The QByteArray class provides an array of bytes.
IDirectFBScreen * dfbScreen
IDirectFBDisplayLayer * dfbDisplayLayer()
int left() const
Returns the x-coordinate of the rectangle's left edge.
int byteCount() const
Returns the number of bytes occupied by the image data.
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...
int width() const
Returns the width of the rectangle.
virtual void show()
Shows the mouse cursor.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int bytesPerLine() const
Returns the number of bytes per image scanline.
QRect boundingRect() const
Returns the bounding rectangle of this region.
int physHeight
the physical height of the screen in millimeters.
ushort red
Returns the red color component of this color.
int height() const
Returns the height of the rectangle.
QImage::Format alphaPixmapFormat() const
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
int size
the number of bytes in the visible region of the frame buffer
The QObject class is the base class of all Qt objects.
virtual void move(int x, int y)
Moves the mouse cursor to the given position, i.e., (x, y).
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
static void initSoftwareCursor()
Initializes the screen cursor.
int rectCount() const
Returns the number of rectangles that will be returned in rects().
Format format() const
Returns the format of the image.
int physWidth
the physical width of the screen in millimeters.
void addObject(QObject *object)
void setFlipFlags(const QStringList &args)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
void setPixelFormat(QImage::Format format)
Sets the screen's pixel format to format.
static QWSSignalHandler * instance()
static QColor colorFromName(const QString &name)
Q_CORE_EXPORT void qDebug(const char *,...)
The QWSWindow class encapsulates a top-level window in Qt for Embedded Linux.
virtual QRegion region() const
Returns the region covered by this screen driver.
int width() const
Returns the logical width of the framebuffer in pixels.
int width() const
Returns the width.
uchar * data
points to the first visible pixel in the frame buffer.
void append(const T &t)
Inserts value at the end of the list.
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...
#define QT_BEGIN_NAMESPACE
This macro expands to.
IDirectFBSurface * surfaceForWidget(const QWidget *widget, QRect *rect) const
static void clearRect(IDirectFBSurface *surface, const QColor &color, const QRect &rect)
static bool isEmpty(const char *str)
QDirectFBKeyboardHandler * keyboard
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 rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void disconnect()
This function is called by every Qt for Embedded Linux application before exiting, and must be implemented to unmap the framebuffer.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
virtual QPixmapData * createPixmapData(QPixmapData::PixelType type) const
IDirectFBWindow * windowForWidget(const QWidget *widget) const
Q_GUI_EXPORT IDirectFBSurface * qt_directfb_surface_for_widget(const QWidget *widget, QRect *rect)
QSize size() const
Returns the size of the rectangle.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
int w
the logical width of the screen.
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
void setGraphicsSystem(QGraphicsSystem *system)
QDirectFBScreenPrivate * d_ptr
Q_CORE_EXPORT void qWarning(const char *,...)
The QImage class provides a hardware-independent image representation that allows direct access to th...
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
bool initDevice()
This function is called by the Qt for Embedded Linux server to initialize the framebuffer.
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
IDirectFBDisplayLayer * layer
The QRegion class specifies a clip region for a painter.
static DFBSurfacePixelFormat getSurfacePixelFormat(QImage::Format format)
int depth() const
Returns the depth of the image.
static QImage::Format getImageFormat(IDirectFBSurface *surface)
Q_GUI_EXPORT IDirectFBWindow * qt_directfb_window_for_widget(const QWidget *widget)
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
QSet< IDirectFBSurface * > allocatedSurfaces
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
QWSWindowSurface * createSurface(QWidget *widget) const
Creates and returns a new window surface for the given widget.
static void setDefaultKeyboard(const char *)
Sets the keyboard driver that will be used if the QWS_KEYBOARD environment variable is not defined...
const T & at(int i) const
Returns the item at index position i in the vector.
uint opacity() const
Returns the window's alpha channel value.
QSize size() const
Returns the size of the image, i.
virtual QWSWindowSurface * createSurface(QWidget *widget) const
Creates and returns a new window surface for the given widget.
const char * constData() const
Returns a pointer to the data stored in the byte array.
QString join(const QString &sep) const
Joins all the string list's strings into a single string with each element separated by the given sep...
void solidFill(const QColor &color, const QRegion ®ion)
Fills the given region of the screen with the specified color.
uchar * bits()
Returns a pointer to the first pixel data.
Q_CORE_EXPORT void qFatal(const char *,...)
int top() const
Returns the y-coordinate of the rectangle's top edge.
int width() const
Returns the width of the image.
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
virtual QString key() const =0
Implement this function to return a string that uniquely identifies the class of this surface...
QImage::Format pixelFormat() const
Returns the pixel format of the screen, or QImage::Format_Invalid if the pixel format is not a suppor...
ushort blue
Returns the blue color component of this color.
WindowEvent
This enum specifies the various events that can occur in a top-level window.
int right() const
Returns the x-coordinate of the rectangle's right edge.
ushort alpha
Returns the alpha color component of this color.
int y() const
Returns the y-coordinate of the rectangle's top edge.
int colorCount() const
Returns the size of the color table for the image.
Q_CORE_EXPORT char * qstrdup(const char *)
int captureCount() const
Returns the number of captures contained in the regular expression.
static bool initSurfaceDescriptionPixelFormat(DFBSurfaceDescription *description, QImage::Format format)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
int x() const
Returns the x-coordinate of the rectangle's left edge.
~QDirectFBScreenPrivate()
The QPoint class defines a point in the plane using integer precision.
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
int size() const
Returns the number of items in the list.
void setMode(int width, int height, int depth)
Implement this function to reset the framebuffer's resolution (width and height) and bit depth...
#define QT_DIRECTFB_IMAGEPROVIDER
int & rheight()
Returns a reference to the height.
uint toUInt(bool *ok=0, int base=10) const
Returns the string converted to an unsigned int using base base, which is 10 by default and must be b...
int height() const
Returns the height.
if(void) toggleToolbarShown
The QRect class defines a rectangle in the plane using integer precision.
QWSWindowSurface * windowSurface() const
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
int height() const
Returns the height of the image.
QDirectFBMouseHandler * mouse
IDirectFBSurface * copyDFBSurface(IDirectFBSurface *src, QImage::Format format, SurfaceCreationOptions options, DFBResult *result=0)
int y() const
Returns the y coordinate of this point.
static bool setIntOption(const QStringList &arguments, const QString &variable, int *value)
bool intersects(const QRegion &r) const
Returns true if this region intersects with region, otherwise returns false.
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
bool exactMatch(const QString &str) const
Returns true if str is matched exactly by this regular expression; otherwise returns false...
QScopedPointer< QObjectData > d_ptr
static uchar * lockSurface(IDirectFBSurface *surface, DFBSurfaceLockFlags flags, int *bpl=0)
int lstep
the number of bytes representing a line in the frame buffer.
bool isNull() const
Returns true if both the width and height is 0; otherwise returns false.
bool hasAlphaChannel() const
The QSize class defines the size of a two-dimensional object using integer point precision.
void setCaseSensitivity(Qt::CaseSensitivity cs)
Sets case sensitive matching to cs.
IDirectFBDisplayLayer * dfbLayer
static QDirectFBScreen * instance()
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...
static QStringList arguments()
Returns the list of command-line arguments.
int x() const
Returns the x coordinate of this point.
QDirectFBScreen(int display_id)
int h
the logical height of the screen.
bool isValid() const
Returns true if the color is valid; otherwise returns false.
Q_GUI_EXPORT QScreenCursor * qt_screencursor
void flipSurface(IDirectFBSurface *surface, DFBSurfaceFlipFlags flipFlags, const QRegion ®ion, const QPoint &offset)
bool isOpaque() const
Returns true if the window is opaque, i.
IDirectFBSurface * cursorSurface
virtual void hide()
Hides the cursor from the screen.
void exposeRegion(QRegion r, int changing)
This function is called by the Qt for Embedded Linux server whenever a screen update is required...
virtual QImage image() const =0
Implement this function to return an image of the top-level window.
#define qPrintable(string)
static Type type()
Returns the type of application (Tty , GuiClient, or GuiServer).
static QScreenCursor * instance()
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
ushort green
Returns the green color component of this color.
int size() const
Returns the number of items in the vector.
void blank(bool on)
Prevents the screen driver form displaying any content on the screen.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
void shutdownDevice()
This function is called by the Qt for Embedded Linux server before it calls the disconnect() function...
QRgb color(int i) const
Returns the color in the color table at index i.
QDirectFBScreenPrivate(QDirectFBScreen *qptr)
Q_DECL_CONSTEXPR int qRound(qreal d)
qint64 cacheKey() const
Returns a number that identifies the contents of this QImage object.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
int & rwidth()
Returns a reference to the width.
QPoint offset() const
Returns the logical offset of the screen, i.
int depth() const
Returns the depth of the framebuffer, in bits per pixel.
const QList< QWSWindow * > & clientWindows()
Returns the list of current top-level windows.
The QList class is a template class that provides lists.
static int area(const QSize &s)
DFBSurfaceFlipFlags flipFlags