Qt 4.8
Public Functions | Private Functions | Properties | List of all members
PvrEglScreen Class Reference

#include <pvreglscreen.h>

Inheritance diagram for PvrEglScreen:
QGLScreen QScreen

Public Functions

void blit (const QImage &img, const QPoint &topLeft, const QRegion &region)
 Copies the given region in the given image to the point specified by topLeft using device coordinates. More...
 
bool chooseContext (QGLContext *context, const QGLContext *shareContext)
 Initializes the context and sets up the QGLWindowSurface of the QWidget of context based on the parameters of context and based on its own requirements. More...
 
bool connect (const QString &displaySpec)
 This function is called by every Qt for Embedded Linux application on startup, and must be implemented to map in the framebuffer and the accelerated drivers that the graphics card control registers. More...
 
QWSWindowSurfacecreateSurface (QWidget *widget) const
 [1] More...
 
QWSWindowSurfacecreateSurface (const QString &key) const
 Creates and returns a new window surface matching the given key. More...
 
void disconnect ()
 This function is called by every Qt for Embedded Linux application before exiting, and must be implemented to unmap the framebuffer. More...
 
bool hasOpenGL ()
 
bool initDevice ()
 This function is called by the Qt for Embedded Linux server to initialize the framebuffer. More...
 
 PvrEglScreen (int displayId)
 [0] More...
 
void setMode (int, int, int)
 Implement this function to reset the framebuffer's resolution (width and height) and bit depth. More...
 
void shutdownDevice ()
 This function is called by the Qt for Embedded Linux server before it calls the disconnect() function when exiting. More...
 
void solidFill (const QColor &color, const QRegion &region)
 Fills the given region of the screen with the specified color. More...
 
int transformation () const
 
 ~PvrEglScreen ()
 
- Public Functions inherited from QGLScreen
QGLScreen::Options options () const
 Returns the options associated with this QGLScreen. More...
 
 QGLScreen (int displayId)
 
QGLScreenSurfaceFunctionssurfaceFunctions () const
 Returns the surface functions object for this QGLScreen. More...
 
virtual ~QGLScreen ()
 
- Public Functions inherited from QScreen
virtual int alloc (unsigned int, unsigned int, unsigned int)
 Returns the index in the screen's palette which is the closest match to the given RGB value (red, green, blue). More...
 
ucharbase () const
 Returns a pointer to the beginning of the framebuffer. More...
 
virtual void blank (bool on)
 Prevents the screen driver form displaying any content on the screen. More...
 
void blit (QWSWindow *bs, const QRegion &clip)
 
virtual ucharcache (int)
 
ClassId classId () const
 Returns the class identifier for the screen object. More...
 
QRgbclut ()
 Returns a pointer to the screen's color lookup table (i. More...
 
int colorCount ()
 Returns the number of entries in the screen's color lookup table (i. More...
 
int depth () const
 Returns the depth of the framebuffer, in bits per pixel. More...
 
int deviceHeight () const
 Returns the full height of the framebuffer device in pixels. More...
 
int deviceWidth () const
 Returns the physical width of the framebuffer device in pixels. More...
 
virtual void exposeRegion (QRegion r, int changing)
 This function is called by the Qt for Embedded Linux server whenever a screen update is required. More...
 
QGraphicsSystemgraphicsSystem () const
 
virtual void haltUpdates ()
 
int height () const
 Returns the logical height of the framebuffer in pixels. More...
 
virtual bool isInterlaced () const
 Returns true if the display is interlaced (i. More...
 
virtual bool isTransformed () const
 Returns true if the screen is transformed (for instance, rotated 90 degrees); otherwise returns false. More...
 
int linestep () const
 Returns the length of each scanline of the framebuffer in bytes. More...
 
virtual QSize mapFromDevice (const QSize &) const
 Maps the given size from the framebuffer coordinate system to the coordinate space used by the application. More...
 
virtual QPoint mapFromDevice (const QPoint &, const QSize &) const
 Maps the given point from the framebuffer coordinate system to the coordinate space used by the application, passing the device's screenSize as argument. More...
 
virtual QRect mapFromDevice (const QRect &, const QSize &) const
 Maps the given rectangle from the framebuffer coordinate system to the coordinate space used by the application, passing the device's screenSize as argument. More...
 
virtual QImage mapFromDevice (const QImage &) const
 Maps the given image from the framebuffer coordinate system to the coordinate space used by the application. More...
 
virtual QRegion mapFromDevice (const QRegion &, const QSize &) const
 Maps the given region from the framebuffer coordinate system to the coordinate space used by the application, passing the device's screenSize as argument. More...
 
virtual QSize mapToDevice (const QSize &) const
 Maps the given size from the coordinate space used by the application to the framebuffer coordinate system. More...
 
virtual QPoint mapToDevice (const QPoint &, const QSize &) const
 Maps the given point from the coordinate space used by the application to the framebuffer coordinate system, passing the device's screenSize as argument. More...
 
virtual QRect mapToDevice (const QRect &, const QSize &) const
 Maps the given rectangle from the coordinate space used by the application to the framebuffer coordinate system, passing the device's screenSize as argument. More...
 
virtual QImage mapToDevice (const QImage &) const
 Maps the given image from the coordinate space used by the application to the framebuffer coordinate system. More...
 
virtual QRegion mapToDevice (const QRegion &, const QSize &) const
 Maps the given region from the coordinate space used by the application to the framebuffer coordinate system, passing the device's screenSize as argument. More...
 
virtual int memoryNeeded (const QString &)
 
QT_DEPRECATED int numCols ()
 
QPoint offset () const
 Returns the logical offset of the screen, i. More...
 
virtual bool onCard (const unsigned char *) const
 Returns true if the specified buffer is within the graphics card's memory; otherwise returns false (i.e. More...
 
virtual bool onCard (const unsigned char *, ulong &out_offset) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.If the specified buffer is within the graphics card's memory, this function stores the offset from the start of graphics card memory (in bytes), in the location specified by the offset parameter. More...
 
int physicalHeight () const
 Returns the physical height of the screen in millimeters. More...
 
int physicalWidth () const
 Returns the physical width of the screen in millimeters. More...
 
QImage::Format pixelFormat () const
 Returns the pixel format of the screen, or QImage::Format_Invalid if the pixel format is not a supported image format. More...
 
PixelType pixelType () const
 Returns the pixel storage format of the screen. More...
 
QPixmapDataFactorypixmapDataFactory () const
 
virtual int pixmapDepth () const
 Returns the preferred depth for pixmaps, in bits per pixel. More...
 
virtual int pixmapLinestepAlignment ()
 Returns the value (in bits) to which individual scanlines of pixmaps held in the graphics card's memory, should be aligned. More...
 
virtual int pixmapOffsetAlignment ()
 Returns the value (in bits) to which the start address of pixmaps held in the graphics card's memory, should be aligned. More...
 
 QScreen (int display_id, ClassId classId)
 Constructs a new screen driver. More...
 
 QScreen (int display_id)
 Constructs a new screen driver. More...
 
virtual QRegion region () const
 Returns the region covered by this screen driver. More...
 
virtual void restore ()
 Restores the previously saved state of the graphics card. More...
 
virtual void resumeUpdates ()
 
virtual void save ()
 Saves the current state of the graphics card. More...
 
int screenSize () const
 Returns the size of the screen in bytes. More...
 
virtual void set (unsigned int, unsigned int, unsigned int, unsigned int)
 
virtual void setDirty (const QRect &)
 Marks the given rectangle as dirty. More...
 
void setOffset (const QPoint &p)
 
virtual int sharedRamSize (void *)
 
int subScreenIndexAt (const QPoint &p) const
 Returns the index of the subscreen at the given position; returns -1 if no screen is found. More...
 
virtual QList< QScreen * > subScreens () const
 
virtual bool supportsDepth (int) const
 Returns true if the screen supports the specified color depth; otherwise returns false. More...
 
int totalSize () const
 Returns the size of the available graphics card memory (including the screen) in bytes. More...
 
virtual int transformOrientation () const
 Returns the current rotation as an integer value. More...
 
virtual void uncache (uchar *)
 
int width () const
 Returns the logical width of the framebuffer in pixels. More...
 
virtual ~QScreen ()
 Destroys this screen driver. More...
 

Private Functions

void closeTty ()
 
void openTty ()
 
void sync ()
 

Properties

bool doGraphicsMode
 
int fd
 
int oldKdMode
 
const QScreenparent
 
QString ttyDevice
 
int ttyfd
 

Additional Inherited Members

- Public Types inherited from QGLScreen
enum  Option {
  NoOptions = 0, NativeWindows = 1, NativePixmaps = 2, NativeImages = 4,
  Overlays = 8
}
 This enum defines options that can be set on QGLScreen instances. More...
 
- Public Types inherited from QScreen
enum  ClassId {
  LinuxFBClass, TransformedClass, VNCClass, MultiClass,
  VFbClass, DirectFBClass, SvgalibClass, ProxyClass,
  GLClass, IntfbClass, CustomClass = 1024
}
 This enum defines the class identifiers for the known screen subclasses. More...
 
enum  PixelType { NormalPixel, BGRPixel }
 This enum describes the pixel storage format of the screen, i. More...
 
- Static Public Functions inherited from QScreen
static QScreeninstance ()
 Returns a pointer to the application's QScreen instance. More...
 
- Protected Functions inherited from QGLScreen
void setOptions (QGLScreen::Options value)
 Sets the options associated with this QGLScreen to value. More...
 
void setSurfaceFunctions (QGLScreenSurfaceFunctions *functions)
 Sets the surface functions object for this QGLScreen to functions. More...
 
- Protected Functions inherited from QScreen
void setGraphicsSystem (QGraphicsSystem *system)
 
void setPixelFormat (QImage::Format format)
 Sets the screen's pixel format to format. More...
 
void setPixmapDataFactory (QPixmapDataFactory *factory)
 
- Protected Variables inherited from QScreen
int d
 the pixel depth More...
 
uchardata
 points to the first visible pixel in the frame buffer. More...
 
int dh
 the device height More...
 
int displayId
 
int dw
 the device width More...
 
QPoolEntryentries
 
int * entryp
 
bool grayscale
 the gray scale screen mode flag More...
 
int h
 the logical height of the screen. More...
 
unsigned int * lowest
 
int lstep
 the number of bytes representing a line in the frame buffer. More...
 
int mapsize
 the total number of bytes in the frame buffer More...
 
int physHeight
 the physical height of the screen in millimeters. More...
 
int physWidth
 the physical width of the screen in millimeters. More...
 
PixelType pixeltype
 set to BGRPixel More...
 
QRgb screenclut [256]
 the color table More...
 
int screencols
 the number of entries in the color table More...
 
int size
 the number of bytes in the visible region of the frame buffer More...
 
int w
 the logical width of the screen. More...
 
- Static Protected Variables inherited from QScreen
static ClearCacheFunc clearCacheFunc = 0
 

Detailed Description

Definition at line 64 of file pvreglscreen.h.

Constructors and Destructors

◆ PvrEglScreen()

PvrEglScreen::PvrEglScreen ( int  displayId)

[0]

[0]

Definition at line 57 of file pvreglscreen.cpp.

59 {
61  setSupportsBlitInClients(true);
64  fd = -1;
65  ttyfd = -1;
66  doGraphicsMode = true;
67  oldKdMode = KD_TEXT;
68  parent = 0;
69 
70  // Make sure that the EGL layer is initialized and the drivers loaded.
71  EGLDisplay dpy = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY);
72  if (!eglInitialize(dpy, 0, 0))
73  qWarning("Could not initialize EGL display - are the drivers loaded?");
74 
75  // Make sure that screen 0 is initialized.
77 }
bool doGraphicsMode
Definition: pvreglscreen.h:95
const QScreen * parent
Definition: pvreglscreen.h:96
QGLScreen(int displayId)
void setOptions(QGLScreen::Options value)
Sets the options associated with this QGLScreen to value.
Q_CORE_EXPORT void qWarning(const char *,...)
int displayId
Definition: qscreen_qws.h:337
NativeDisplayType EGLNativeDisplayType
Definition: qegl_p.h:118
PvrQwsDrawable * pvrQwsScreenWindow(int screen)
void setSurfaceFunctions(QGLScreenSurfaceFunctions *functions)
Sets the surface functions object for this QGLScreen to functions.

◆ ~PvrEglScreen()

PvrEglScreen::~PvrEglScreen ( )

Definition at line 79 of file pvreglscreen.cpp.

80 {
81  if (fd >= 0)
82  ::close(fd);
83 }

Functions

◆ blit()

void PvrEglScreen::blit ( const QImage image,
const QPoint topLeft,
const QRegion region 
)
virtual

Copies the given region in the given image to the point specified by topLeft using device coordinates.

This function is called from the exposeRegion() function; it is not intended to be called explicitly.

Reimplement this function to make use of Adding an Accelerated Graphics Driver to Qt for Embedded Linux{accelerated hardware}. Note that this function must be reimplemented if the framebuffer format is not supported by Qt for Embedded Linux (See the Qt for Embedded Linux Display Management{Display Management} documentation for more details).

See also
exposeRegion(), solidFill(), blank()

Reimplemented from QScreen.

Definition at line 169 of file pvreglscreen.cpp.

170 {
171  QGLScreen::blit(img, topLeft, region);
172  sync();
173 }
virtual void blit(const QImage &img, const QPoint &topLeft, const QRegion &region)
Copies the given region in the given image to the point specified by topLeft using device coordinates...

◆ chooseContext()

bool PvrEglScreen::chooseContext ( QGLContext context,
const QGLContext shareContext 
)
virtual

Initializes the context and sets up the QGLWindowSurface of the QWidget of context based on the parameters of context and based on its own requirements.

Since
4.3

The format() of context needs to be updated with the actual parameters of the OpenGLES drawable that was set up.

shareContext is used in the same way as for QGLContext. It is the context with which context shares display lists and texture ids etc. The window surface must be set up so that this sharing works.

Returns true in case of success and false if it is not possible to create the necessary OpenGLES drawable/context.

Since 4.4.2, this function will be not be called if options() indicates that a native window or pixmap drawable can be created via the functions in the surfaceFunctions() object.

This function is obsolete in Qt 4.5 and higher. Use surfaceFunctions() instead.

See also
options(), surfaceFunctions()

Reimplemented from QGLScreen.

Definition at line 182 of file pvreglscreen.cpp.

Referenced by solidFill().

183 {
184  // We use PvrEglScreenSurfaceFunctions instead.
185  Q_UNUSED(context);
186  Q_UNUSED(shareContext);
187  return false;
188 }
#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

◆ closeTty()

void PvrEglScreen::closeTty ( )
private

Definition at line 312 of file pvreglscreen.cpp.

Referenced by shutdownDevice().

313 {
314  if (ttyfd == -1)
315  return;
316 
317  if (doGraphicsMode)
318  ioctl(ttyfd, KDSETMODE, oldKdMode);
319 
320  // Blankin' screen, blinkin' cursor!
321  const char termctl[] = "\033[9;15]\033[?33h\033[?25h\033[?0c";
322  ::write(ttyfd, termctl, sizeof(termctl));
323 
324  ::close(ttyfd);
325  ttyfd = -1;
326 }
bool doGraphicsMode
Definition: pvreglscreen.h:95

◆ connect()

bool PvrEglScreen::connect ( const QString displaySpec)
virtual

This function is called by every Qt for Embedded Linux application on startup, and must be implemented to map in the framebuffer and the accelerated drivers that the graphics card control registers.

Note that connect must be called before the initDevice() function.

Ensure that true is returned if a connection to the screen device is made. Otherwise, return false. Upon making the connection, the function should read out the parameters of the framebuffer and use them as required to set this class's protected variables.

The displaySpec argument is passed by the QWS_DISPLAY environment variable or the -display command line parameter, and has the following syntax:

[screen driver][:driver specific options][:display number]

For example, to use the mach64 driver on fb1 as display 2:

Mach64:/dev/fb1:2

See Qt for Embedded Linux Display Management for more details.

See also
disconnect(), initDevice(), {Running Qt for Embedded Linux Applications}

Implements QScreen.

Definition at line 91 of file pvreglscreen.cpp.

92 {
93  if (!pvrQwsDisplayOpen())
94  return false;
95 
96  // Initialize the QScreen properties.
101  dw = w;
102  dh = h;
103  size = h * lstep;
104  mapsize = size;
105  switch (pvrQwsDisplay.screens[0].pixelFormat) {
106  case PVR2D_RGB565:
107  d = 16;
109  break;
110  case PVR2D_ARGB4444:
111  d = 16;
113  break;
114  case PVR2D_ARGB8888:
115  d = 32;
117  break;
118  default:
120  qWarning("PvrEglScreen::connect: unsupported pixel format %d", (int)(pvrQwsDisplay.screens[0].pixelFormat));
121  return false;
122  }
123 
124  // Handle display physical size spec.
125  QStringList displayArgs = displaySpec.split(QLatin1Char(':'));
126  QRegExp mmWidthRx(QLatin1String("mmWidth=?(\\d+)"));
127  int dimIdxW = displayArgs.indexOf(mmWidthRx);
128  QRegExp mmHeightRx(QLatin1String("mmHeight=?(\\d+)"));
129  int dimIdxH = displayArgs.indexOf(mmHeightRx);
130  if (dimIdxW >= 0) {
131  mmWidthRx.exactMatch(displayArgs.at(dimIdxW));
132  physWidth = mmWidthRx.cap(1).toInt();
133  if (dimIdxH < 0)
135  }
136  if (dimIdxH >= 0) {
137  mmHeightRx.exactMatch(displayArgs.at(dimIdxH));
138  physHeight = mmHeightRx.cap(1).toInt();
139  if (dimIdxW < 0)
141  }
142  if (dimIdxW < 0 && dimIdxH < 0) {
143  const int dpi = 72;
144  physWidth = qRound(dw * 25.4 / dpi);
145  physHeight = qRound(dh * 25.4 / dpi);
146  }
147 
148  // Find the name of the tty device to use.
149  QRegExp ttyRegExp(QLatin1String("tty=(.*)"));
150  if (displayArgs.indexOf(ttyRegExp) != -1)
151  ttyDevice = ttyRegExp.cap(1);
152  if (displayArgs.contains(QLatin1String("nographicsmodeswitch")))
153  doGraphicsMode = false;
154 
155  // The screen is ready.
156  return true;
157 }
bool doGraphicsMode
Definition: pvreglscreen.h:95
int d
the pixel depth
Definition: qscreen_qws.h:327
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
PvrQwsDisplay pvrQwsDisplay
PvrQwsRect screenRect
int physHeight
the physical height of the screen in millimeters.
Definition: qscreen_qws.h:340
int size
the number of bytes in the visible region of the frame buffer
Definition: qscreen_qws.h:334
int pvrQwsDisplayOpen(void)
int physWidth
the physical width of the screen in millimeters.
Definition: qscreen_qws.h:339
void setPixelFormat(QImage::Format format)
Sets the screen&#39;s pixel format to format.
unsigned char uchar
Definition: qglobal.h:994
uchar * data
points to the first visible pixel in the frame buffer.
Definition: qscreen_qws.h:311
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
QString ttyDevice
Definition: pvreglscreen.h:94
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
int w
the logical width of the screen.
Definition: qscreen_qws.h:324
Q_CORE_EXPORT void qWarning(const char *,...)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
int dw
the device width
Definition: qscreen_qws.h:331
int dh
the device height
Definition: qscreen_qws.h:332
PVR2DFORMAT pixelFormat
int lstep
the number of bytes representing a line in the frame buffer.
Definition: qscreen_qws.h:325
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...
Definition: qstring.cpp:6526
PvrQwsScreenInfo screens[PVRQWS_MAX_SCREENS]
int h
the logical height of the screen.
Definition: qscreen_qws.h:326
int mapsize
the total number of bytes in the frame buffer
Definition: qscreen_qws.h:335
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203
void pvrQwsDisplayClose(void)

◆ createSurface() [1/2]

QWSWindowSurface * PvrEglScreen::createSurface ( QWidget widget) const
virtual

[1]

Reimplemented from QScreen.

Definition at line 196 of file pvreglscreen.cpp.

197 {
198  if (qobject_cast<QGLWidget*>(widget))
199  return new PvrEglWindowSurface(widget, (PvrEglScreen *)this, displayId);
200 
201  return QScreen::createSurface(widget);
202 }
int displayId
Definition: qscreen_qws.h:337
virtual QWSWindowSurface * createSurface(QWidget *widget) const
Creates and returns a new window surface for the given widget.

◆ createSurface() [2/2]

QWSWindowSurface * PvrEglScreen::createSurface ( const QString key) const
virtual

Creates and returns a new window surface matching the given key.

Since
4.2

The server application will call this function whenever it needs to create a server side representation of a window, e.g. when copying the content of memory to the screen using the screen driver.

Note that this function must be reimplemented when adding an accelerated graphics driver. See the Adding an Accelerated Graphics Driver to Qt for Embedded Linux {Adding an Accelerated Graphics Driver} documentation for details.

See also
{Qt for Embedded Linux Architecture}

Reimplemented from QScreen.

Definition at line 204 of file pvreglscreen.cpp.

205 {
206  if (key == QLatin1String("PvrEgl"))
207  return new PvrEglWindowSurface();
208 
209  return QScreen::createSurface(key);
210 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
virtual QWSWindowSurface * createSurface(QWidget *widget) const
Creates and returns a new window surface for the given widget.

◆ disconnect()

void PvrEglScreen::disconnect ( )
virtual

This function is called by every Qt for Embedded Linux application before exiting, and must be implemented to unmap the framebuffer.

Note that a server application will call the shutdownDevice() function prior to this function.

See also
connect(), shutdownDevice(), {Running Qt for Embedded Linux Applications}

Implements QScreen.

Definition at line 159 of file pvreglscreen.cpp.

160 {
162 }
void pvrQwsDisplayClose(void)

◆ hasOpenGL()

bool PvrEglScreen::hasOpenGL ( )
virtual

Implements QGLScreen.

Definition at line 190 of file pvreglscreen.cpp.

191 {
192  return true;
193 }

◆ initDevice()

bool PvrEglScreen::initDevice ( )
virtual

This function is called by the Qt for Embedded Linux server to initialize the framebuffer.

Note that a server application will call the connect() function prior to this function.

Implement this function to make accelerated drivers set up the graphics card. Return true to indicate success and false to indicate failure.

See also
shutdownDevice(), connect()

Implements QScreen.

Definition at line 85 of file pvreglscreen.cpp.

86 {
87  openTty();
88  return true;
89 }

◆ openTty()

void PvrEglScreen::openTty ( )
private

Definition at line 279 of file pvreglscreen.cpp.

Referenced by initDevice().

280 {
281  const char *const devs[] = {"/dev/tty0", "/dev/tty", "/dev/console", 0};
282 
283  if (ttyDevice.isEmpty()) {
284  for (const char * const *dev = devs; *dev; ++dev) {
285  ttyfd = ::open(*dev, O_RDWR);
286  if (ttyfd != -1)
287  break;
288  }
289  } else {
291  }
292 
293  if (ttyfd == -1)
294  return;
295 
296  ::fcntl(ttyfd, F_SETFD, FD_CLOEXEC);
297 
298  if (doGraphicsMode) {
299  ioctl(ttyfd, KDGETMODE, &oldKdMode);
300  if (oldKdMode != KD_GRAPHICS) {
301  int ret = ioctl(ttyfd, KDSETMODE, KD_GRAPHICS);
302  if (ret == -1)
303  doGraphicsMode = false;
304  }
305  }
306 
307  // No blankin' screen, no blinkin' cursor!, no cursor!
308  const char termctl[] = "\033[9;0]\033[?33l\033[?25l\033[?1c";
309  ::write(ttyfd, termctl, sizeof(termctl));
310 }
bool doGraphicsMode
Definition: pvreglscreen.h:95
QString ttyDevice
Definition: pvreglscreen.h:94
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
int fcntl(int, int,...)
QByteArray toAscii() const Q_REQUIRED_RESULT
Returns an 8-bit representation of the string as a QByteArray.
Definition: qstring.cpp:4014
#define O_RDWR
int open(const char *, int,...)

◆ setMode()

void PvrEglScreen::setMode ( int  width,
int  height,
int  depth 
)
inlinevirtual

Implement this function to reset the framebuffer's resolution (width and height) and bit depth.

After the resolution has been set, existing paint engines will be invalid and the framebuffer should be completely redrawn. In a multiple-process situation, all other applications must be notified to reset their mode and update themselves accordingly.

Implements QScreen.

Definition at line 74 of file pvreglscreen.h.

74 {}

◆ shutdownDevice()

void PvrEglScreen::shutdownDevice ( )
virtual

This function is called by the Qt for Embedded Linux server before it calls the disconnect() function when exiting.

Note that the default implementation only hides the mouse cursor; reimplement this function to do the necessary graphics card specific cleanup.

See also
initDevice(), disconnect()

Reimplemented from QScreen.

Definition at line 164 of file pvreglscreen.cpp.

165 {
166  closeTty();
167 }

◆ solidFill()

void PvrEglScreen::solidFill ( const QColor color,
const QRegion region 
)
virtual

Fills the given region of the screen with the specified color.

This function is called from the exposeRegion() function; it is not intended to be called explicitly.

Reimplement this function to make use of Adding an Accelerated Graphics Driver to Qt for Embedded Linux{accelerated hardware}. Note that this function must be reimplemented if the framebuffer format is not supported by Qt for Embedded Linux (See the Qt for Embedded Linux Display Management{Display Management} documentation for more details).

See also
exposeRegion(), blit(), blank()

Reimplemented from QScreen.

Definition at line 175 of file pvreglscreen.cpp.

Referenced by PvrEglWindowSurface::setDirectRegion().

176 {
177  QGLScreen::solidFill(color, region);
178  sync();
179 }
virtual void solidFill(const QColor &color, const QRegion &region)
Fills the given region of the screen with the specified color.

◆ sync()

void PvrEglScreen::sync ( )
private

Definition at line 274 of file pvreglscreen.cpp.

Referenced by blit(), and solidFill().

275 {
276  // Put code here to synchronize 2D and 3D operations if necessary.
277 }

◆ transformation()

int PvrEglScreen::transformation ( ) const

Definition at line 249 of file pvreglscreen.cpp.

Referenced by PvrEglWindowSurface::move(), PvrEglWindowSurface::PvrEglWindowSurface(), PvrEglWindowSurface::setDirectRegion(), PvrEglWindowSurface::setGeometry(), and PvrEglWindowSurface::transformRects().

250 {
251  // We need to search for our parent screen, which is assumed to be
252  // "Transformed". If it isn't, then there is no transformation.
253  // There is no direct method to get the parent screen so we need
254  // to search every screen until we find ourselves.
255  if (!parent && qt_screen != this)
256  parent = parentScreen(qt_screen, this);
257  if (!parent)
258  return 0;
260  return 0;
261  return 90 * static_cast<const QTransformedScreen *>(parent)
263 }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
const QScreen * parent
Definition: pvreglscreen.h:96
static const QScreen * parentScreen(const QScreen *current, const QScreen *lookingFor)
[1]
virtual int transformOrientation() const
Returns the current rotation as an integer value.
ClassId classId() const
Returns the class identifier for the screen object.
The QTransformedScreen class implements a screen driver for a transformed screen. ...

Properties

◆ doGraphicsMode

bool PvrEglScreen::doGraphicsMode
private

Definition at line 95 of file pvreglscreen.h.

Referenced by closeTty(), connect(), openTty(), and PvrEglScreen().

◆ fd

int PvrEglScreen::fd
private

Definition at line 92 of file pvreglscreen.h.

Referenced by PvrEglScreen(), and ~PvrEglScreen().

◆ oldKdMode

int PvrEglScreen::oldKdMode
private

Definition at line 93 of file pvreglscreen.h.

Referenced by closeTty(), openTty(), and PvrEglScreen().

◆ parent

const QScreen* PvrEglScreen::parent
mutableprivate

Definition at line 96 of file pvreglscreen.h.

Referenced by parentScreen(), PvrEglScreen(), and transformation().

◆ ttyDevice

QString PvrEglScreen::ttyDevice
private

Definition at line 94 of file pvreglscreen.h.

Referenced by connect(), and openTty().

◆ ttyfd

int PvrEglScreen::ttyfd
private

Definition at line 93 of file pvreglscreen.h.

Referenced by closeTty(), openTty(), and PvrEglScreen().


The documentation for this class was generated from the following files: