src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 7 3f74d0d4af4c
equal deleted inserted replaced
3:41300fa6a67c 4:3b1da2848fc7
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the plugins of the Qt Toolkit.
     7 ** This file is part of the plugins of the Qt Toolkit.
     8 **
     8 **
  1061     return false;
  1061     return false;
  1062 }
  1062 }
  1063 
  1063 
  1064 static inline QColor colorFromName(const QString &name)
  1064 static inline QColor colorFromName(const QString &name)
  1065 {
  1065 {
  1066     QRegExp rx("#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])");
  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])"));
  1067     rx.setCaseSensitivity(Qt::CaseInsensitive);
  1067     rx.setCaseSensitivity(Qt::CaseInsensitive);
  1068     if (rx.exactMatch(name)) {
  1068     if (rx.exactMatch(name)) {
  1069         Q_ASSERT(rx.captureCount() == 4);
  1069         Q_ASSERT(rx.captureCount() == 4);
  1070         int ints[4];
  1070         int ints[4];
  1071         int i;
  1071         int i;
  1276 
  1276 
  1277     if (w <= 0 || h <= 0) {
  1277     if (w <= 0 || h <= 0) {
  1278 #ifdef QT_NO_DIRECTFB_WM
  1278 #ifdef QT_NO_DIRECTFB_WM
  1279         result = d_ptr->primarySurface->GetSize(d_ptr->primarySurface, &w, &h);
  1279         result = d_ptr->primarySurface->GetSize(d_ptr->primarySurface, &w, &h);
  1280 #elif (Q_DIRECTFB_VERSION >= 0x010000)
  1280 #elif (Q_DIRECTFB_VERSION >= 0x010000)
  1281         result = d_ptr->dfbScreen->GetSize(d_ptr->dfbScreen, &w, &h);
  1281         IDirectFBSurface *layerSurface;
       
  1282         if (d_ptr->dfbLayer->GetSurface(d_ptr->dfbLayer, &layerSurface) != DFB_OK) {
       
  1283             result = layerSurface->GetSize(layerSurface, &w, &h);
       
  1284             layerSurface->Release(layerSurface);
       
  1285         }
       
  1286         if (w <= 0 || h <= 0) {
       
  1287             result = d_ptr->dfbScreen->GetSize(d_ptr->dfbScreen, &w, &h);
       
  1288         }
  1282 #else
  1289 #else
  1283         qWarning("QDirectFBScreen::connect: DirectFB versions prior to 1.0 do not offer a way\n"
  1290         qWarning("QDirectFBScreen::connect: DirectFB versions prior to 1.0 do not offer a way\n"
  1284                  "query the size of the primary surface in windowed mode. You have to specify\n"
  1291                  "query the size of the primary surface in windowed mode. You have to specify\n"
  1285                  "the size of the display using QWS_SIZE=[0-9]x[0-9] or\n"
  1292                  "the size of the display using QWS_SIZE=[0-9]x[0-9] or\n"
  1286                  "QWS_DISPLAY=directfb:width=[0-9]:height=[0-9]");
  1293                  "QWS_DISPLAY=directfb:width=[0-9]:height=[0-9]");