Qt 4.8
Classes | Functions
qdirectpainter_qws.cpp File Reference
#include "qdirectpainter_qws.h"
#include "qscreen_qws.h"
#include "private/qobject_p.h"
#include "private/qapplication_p.h"
#include "qwsdisplay_qws.h"
#include "qwidget.h"
#include "qimage.h"
#include <qwsevent_qws.h>
#include <private/qwindowsurface_qws_p.h>
#include <private/qwsdisplay_qws_p.h>

Go to the source code of this file.

Classes

class  QDirectPainterPrivate
 

Functions

static QSize devS ()
 
static QScreengetPrimaryScreen ()
 
void qt_directpainter_embedevent (QDirectPainter *dp, const QWSEmbedEvent *event)
 
void qt_directpainter_region (QDirectPainter *dp, const QRegion &alloc, int type)
 
static QSize screenS ()
 

Function Documentation

◆ devS()

static QSize devS ( )
inlinestatic

Definition at line 190 of file qdirectpainter_qws.cpp.

191 {
192  QScreen *screen = getPrimaryScreen();
193  if (!screen)
194  return QSize();
195  return QSize(screen->deviceWidth(), screen->deviceHeight());
196 }
int deviceWidth() const
Returns the physical width of the framebuffer device in pixels.
Definition: qscreen_qws.h:233
static QScreen * getPrimaryScreen()
int deviceHeight() const
Returns the full height of the framebuffer device in pixels.
Definition: qscreen_qws.h:234
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ getPrimaryScreen()

static QScreen* getPrimaryScreen ( )
inlinestatic

Definition at line 170 of file qdirectpainter_qws.cpp.

Referenced by devS(), QDirectPainter::frameBuffer(), QDirectPainter::linestep(), QDirectPainter::screenDepth(), QDirectPainter::screenHeight(), screenS(), and QDirectPainter::screenWidth().

171 {
172  QScreen *screen = QScreen::instance();
173  if (!screen->base()) {
174  QList<QScreen*> subScreens = screen->subScreens();
175  if (subScreens.size() < 1)
176  return 0;
177  screen = subScreens.at(0);
178  }
179  return screen;
180 }
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static QScreen * instance()
Returns a pointer to the application&#39;s QScreen instance.
Definition: qscreen_qws.h:201
uchar * base() const
Returns a pointer to the beginning of the framebuffer.
Definition: qscreen_qws.h:235
virtual QList< QScreen * > subScreens() const
Definition: qscreen_qws.h:283
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ qt_directpainter_embedevent()

void qt_directpainter_embedevent ( QDirectPainter dp,
const QWSEmbedEvent event 
)

Definition at line 244 of file qdirectpainter_qws.cpp.

Referenced by QApplication::qwsProcessEvent(), and QDirectPainter::region().

245 {
246  if (event->type | QWSEmbedEvent::Region) {
247  QScreen *screen = dp->d_func()->surface->screen();
248  QRegion r = event->region;
249  if (screen->isTransformed()) {
250  const QSize screenSize(screen->width(), screen->height());
251  r = screen->mapToDevice(r, screenSize);
252  }
253  dp->setRegion(r);
254  }
255 }
int height() const
Returns the logical height of the framebuffer in pixels.
Definition: qscreen_qws.h:228
virtual QSize mapToDevice(const QSize &) const
Maps the given size from the coordinate space used by the application to the framebuffer coordinate s...
int width() const
Returns the logical width of the framebuffer in pixels.
Definition: qscreen_qws.h:227
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
virtual bool isTransformed() const
Returns true if the screen is transformed (for instance, rotated 90 degrees); otherwise returns false...
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
void setRegion(const QRegion &)
Requests to reserve the given region of the framebuffer.
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ qt_directpainter_region()

void qt_directpainter_region ( QDirectPainter dp,
const QRegion alloc,
int  type 
)

Definition at line 223 of file qdirectpainter_qws.cpp.

Referenced by QApplication::qwsProcessEvent(), and QDirectPainter::region().

224 {
225  QDirectPainterPrivate *d = dp->d_func();
226 
227  QRegion r = alloc;
228  QScreen *screen = d->surface->screen();
229  if (screen->isTransformed()) {
230  const QSize screenSize(screen->width(), screen->height());
231  r = screen->mapToDevice(r, screenSize);
232  }
234  d->surface->setClipRegion(alloc);
235  d->seenRegion = true;
237  if (!d->surface->flushingRegionEvents) // recursion guard
238  dp->regionChanged(r);
239  }
240  }
241 }
QWSDirectPainterSurface * surface
double d
Definition: qnumeric_p.h:62
int type
Definition: qmetatype.cpp:239
int height() const
Returns the logical height of the framebuffer in pixels.
Definition: qscreen_qws.h:228
virtual QSize mapToDevice(const QSize &) const
Maps the given size from the coordinate space used by the application to the framebuffer coordinate s...
int width() const
Returns the logical width of the framebuffer in pixels.
Definition: qscreen_qws.h:227
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
virtual void regionChanged(const QRegion &exposedRegion)
This function is called when the allocated region changes.
void setClipRegion(const QRegion &)
Sets the region currently visible on the screen to be the given clip region.
virtual bool isTransformed() const
Returns true if the screen is transformed (for instance, rotated 90 degrees); otherwise returns false...
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
static QDirectPainter * staticPainter

◆ screenS()

static QSize screenS ( )
inlinestatic

Definition at line 182 of file qdirectpainter_qws.cpp.

183 {
184  QScreen *screen = getPrimaryScreen();
185  if (!screen)
186  return QSize();
187  return QSize(screen->width(), screen->height());
188 }
int height() const
Returns the logical height of the framebuffer in pixels.
Definition: qscreen_qws.h:228
static QScreen * getPrimaryScreen()
int width() const
Returns the logical width of the framebuffer in pixels.
Definition: qscreen_qws.h:227
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53