Qt 4.8
Public Types | Public Functions | Protected Functions | Properties | List of all members
QGLScreen Class Referenceabstract

This class encapsulates an OpenGL screen driver. More...

#include <qglscreen_qws.h>

Inheritance diagram for QGLScreen:
QScreen EGLNullWSScreen PvrEglScreen

Public Types

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...
 

Public Functions

virtual 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...
 
virtual bool hasOpenGL ()=0
 
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...
 
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. 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...
 
virtual bool connect (const QString &displaySpec)=0
 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...
 
virtual QWSWindowSurfacecreateSurface (QWidget *widget) const
 Creates and returns a new window surface for the given widget. More...
 
virtual QWSWindowSurfacecreateSurface (const QString &key) const
 Creates and returns a new window surface matching the given key. 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 disconnect ()=0
 This function is called by every Qt for Embedded Linux application before exiting, and must be implemented to unmap the framebuffer. 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 initDevice ()=0
 This function is called by the Qt for Embedded Linux server to initialize the framebuffer. 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...
 
virtual void setMode (int, int, int)=0
 Implement this function to reset the framebuffer's resolution (width and height) and bit depth. More...
 
void setOffset (const QPoint &p)
 
virtual int sharedRamSize (void *)
 
virtual void shutdownDevice ()
 This function is called by the Qt for Embedded Linux server before it calls the disconnect() function when exiting. More...
 
virtual void solidFill (const QColor &color, const QRegion &region)
 Fills the given region of the screen with the specified color. More...
 
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...
 

Protected Functions

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)
 

Properties

QGLScreenPrivated_ptr
 

Additional Inherited Members

- Static Public Functions inherited from QScreen
static QScreeninstance ()
 Returns a pointer to the application's QScreen instance. More...
 
- 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

This class encapsulates an OpenGL screen driver.

Warning
This function is not part of the public interface. This function is under development and subject to change.

Definition at line 89 of file qglscreen_qws.h.

Enumerations

◆ Option

This enum defines options that can be set on QGLScreen instances.

Enumerator
NoOptions 
NativeWindows 
NativePixmaps 
NativeImages 
Overlays 

Definition at line 96 of file qglscreen_qws.h.

Constructors and Destructors

◆ QGLScreen()

QGLScreen::QGLScreen ( int  displayId)

Definition at line 67 of file qglscreen_qws.cpp.

69 {
72 }
QGLScreen::Options options
QGLScreenSurfaceFunctions * functions
int displayId
Definition: qscreen_qws.h:337
QScreen(int display_id, ClassId classId)
Constructs a new screen driver.
The QGLScreenSurfaceFunctions class encapsulates the functions for creating native windows and pixmap...
Definition: qglscreen_qws.h:81
QGLScreenPrivate * d_ptr

◆ ~QGLScreen()

QGLScreen::~QGLScreen ( )
virtual

Definition at line 74 of file qglscreen_qws.cpp.

75 {
76  delete d_ptr->functions;
77  delete d_ptr;
78 }
QGLScreenSurfaceFunctions * functions
QGLScreenPrivate * d_ptr

Functions

◆ chooseContext()

bool QGLScreen::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 in PvrEglScreen.

Definition at line 111 of file qglscreen_qws.cpp.

112 {
113  Q_UNUSED(context);
114  Q_UNUSED(shareContext);
115  return false;
116 }
#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

◆ hasOpenGL()

virtual bool QGLScreen::hasOpenGL ( )
pure virtual

Implemented in PvrEglScreen, and EGLNullWSScreen.

◆ options()

QGLScreen::Options QGLScreen::options ( ) const

Returns the options associated with this QGLScreen.

Since
4.4.2
See also
setOptions()

Definition at line 142 of file qglscreen_qws.cpp.

143 {
144  return d_ptr->options;
145 }
QGLScreen::Options options
QGLScreenPrivate * d_ptr

◆ setOptions()

void QGLScreen::setOptions ( QGLScreen::Options  value)
protected

Sets the options associated with this QGLScreen to value.

Since
4.4.2
See also
options()

Definition at line 157 of file qglscreen_qws.cpp.

Referenced by PvrEglScreen::PvrEglScreen().

158 {
159  d_ptr->options = value;
160 }
QGLScreen::Options options
QGLScreenPrivate * d_ptr

◆ setSurfaceFunctions()

void QGLScreen::setSurfaceFunctions ( QGLScreenSurfaceFunctions functions)
protected

Sets the surface functions object for this QGLScreen to functions.

Since
4.4.2

The QGLScreen will take over ownership of functions and delete it when the QGLScreen is deleted.

See also
setSurfaceFunctions()

Definition at line 189 of file qglscreen_qws.cpp.

Referenced by EGLNullWSScreen::initDevice(), and PvrEglScreen::PvrEglScreen().

190 {
191  if (functions && functions != d_ptr->functions) {
192  delete d_ptr->functions;
193  d_ptr->functions = functions;
194  }
195 }
QGLScreenSurfaceFunctions * functions
QGLScreenPrivate * d_ptr

◆ surfaceFunctions()

QGLScreenSurfaceFunctions * QGLScreen::surfaceFunctions ( ) const

Returns the surface functions object for this QGLScreen.

Since
4.4.2
See also
setSurfaceFunctions()

Definition at line 172 of file qglscreen_qws.cpp.

Referenced by qt_egl_create_surface().

173 {
174  return d_ptr->functions;
175 }
QGLScreenSurfaceFunctions * functions
QGLScreenPrivate * d_ptr

Properties

◆ d_ptr

QGLScreenPrivate* QGLScreen::d_ptr
private

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