Qt 4.8
Classes | Functions
qdirectfbscreen.cpp File Reference
#include "qdirectfbscreen.h"
#include "qdirectfbwindowsurface.h"
#include "qdirectfbpixmap.h"
#include "qdirectfbmouse.h"
#include "qdirectfbkeyboard.h"
#include <QtGui/qwsdisplay_qws.h>
#include <QtGui/qcolor.h>
#include <QtGui/qapplication.h>
#include <QtGui/qwindowsystem_qws.h>
#include <QtGui/private/qgraphicssystem_qws_p.h>
#include <QtGui/private/qwssignalhandler_p.h>
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qvector.h>
#include <QtCore/qrect.h>
#include "qdirectfbscreen.moc"

Go to the source code of this file.

Classes

class  QDirectFBScreenCursor
 
class  QDirectFBScreenPrivate
 

Functions

static void clearRect (IDirectFBSurface *surface, const QColor &color, const QRect &rect)
 
static QColor colorFromName (const QString &name)
 
static bool isFullUpdate (IDirectFBSurface *surface, const QRegion &region, const QPoint &offset)
 
Q_GUI_EXPORT IDirectFBSurface * qt_directfb_surface_for_widget (const QWidget *widget, QRect *rect)
 
Q_GUI_EXPORT IDirectFBWindow * qt_directfb_window_for_widget (const QWidget *widget)
 
static bool setIntOption (const QStringList &arguments, const QString &variable, int *value)
 

Function Documentation

◆ clearRect()

static void clearRect ( IDirectFBSurface *  surface,
const QColor color,
const QRect rect 
)
inlinestatic

Definition at line 1635 of file qdirectfbscreen.cpp.

Referenced by QDirectFBScreen::solidFill(), and QVGPaintEngine::supportsTransformations().

1636 {
1637  Q_ASSERT(surface);
1638  const DFBRegion region = { rect.left(), rect.top(), rect.right(), rect.bottom() };
1639  // could just reinterpret_cast this to a DFBRegion
1640  surface->SetClip(surface, &region);
1641  surface->Clear(surface, color.red(), color.green(), color.blue(), color.alpha());
1642 }
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
ushort red
Returns the red color component of this color.
Definition: qcolor.h:243
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
ushort blue
Returns the blue color component of this color.
Definition: qcolor.h:245
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
ushort alpha
Returns the alpha color component of this color.
Definition: qcolor.h:242
ushort green
Returns the green color component of this color.
Definition: qcolor.h:244

◆ colorFromName()

static QColor colorFromName ( const QString name)
inlinestatic

Definition at line 1064 of file qdirectfbscreen.cpp.

Referenced by QDirectFBScreen::connect().

1065 {
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);
1068  if (rx.exactMatch(name)) {
1069  Q_ASSERT(rx.captureCount() == 4);
1070  int ints[4];
1071  int i;
1072  for (i=0; i<4; ++i) {
1073  bool ok;
1074  ints[i] = rx.cap(i + 1).toUInt(&ok, 16);
1075  if (!ok || ints[i] > 255)
1076  break;
1077  }
1078  if (i == 4)
1079  return QColor(ints[0], ints[1], ints[2], ints[3]);
1080  }
1081  return QColor(name);
1082 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

◆ isFullUpdate()

static bool isFullUpdate ( IDirectFBSurface *  surface,
const QRegion region,
const QPoint offset 
)
inlinestatic

Definition at line 1696 of file qdirectfbscreen.cpp.

Referenced by QDirectFBScreen::flipSurface().

1697 {
1698  if (offset == QPoint(0, 0) && region.rectCount() == 1) {
1699  QSize size;
1700  surface->GetSize(surface, &size.rwidth(), &size.rheight());
1701  if (region.boundingRect().size() == size)
1702  return true;
1703  }
1704  return false;
1705 }
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
int rectCount() const
Returns the number of rectangles that will be returned in rects().
Definition: qregion.cpp:4461
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int & rheight()
Returns a reference to the height.
Definition: qsize.h:144
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
int & rwidth()
Returns a reference to the width.
Definition: qsize.h:141

◆ qt_directfb_surface_for_widget()

Q_GUI_EXPORT IDirectFBSurface* qt_directfb_surface_for_widget ( const QWidget widget,
QRect rect 
)

Definition at line 1797 of file qdirectfbscreen.cpp.

1798 {
1800 }
IDirectFBSurface * surfaceForWidget(const QWidget *widget, QRect *rect) const
static QDirectFBScreen * instance()

◆ qt_directfb_window_for_widget()

Q_GUI_EXPORT IDirectFBWindow* qt_directfb_window_for_widget ( const QWidget widget)

Definition at line 1808 of file qdirectfbscreen.cpp.

1809 {
1811 }
IDirectFBWindow * windowForWidget(const QWidget *widget) const
static QDirectFBScreen * instance()

◆ setIntOption()

static bool setIntOption ( const QStringList arguments,
const QString variable,
int *  value 
)
inlinestatic

Definition at line 1052 of file qdirectfbscreen.cpp.

Referenced by QDirectFBScreen::connect().

1053 {
1054  Q_ASSERT(value);
1055  QRegExp rx(QString::fromLatin1("%1=?(\\d+)").arg(variable));
1056  rx.setCaseSensitivity(Qt::CaseInsensitive);
1057  if (arguments.indexOf(rx) != -1) {
1058  *value = rx.cap(1).toInt();
1059  return true;
1060  }
1061  return false;
1062 }
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
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...
Definition: qstringlist.h:195
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