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

#include <qxcbintegration.h>

Inheritance diagram for QXcbIntegration:
QPlatformIntegration

Public Functions

QPixmapDatacreatePixmapData (QPixmapData::PixelType type) const
 Factory function for QPixmapData. More...
 
QPlatformWindowcreatePlatformWindow (QWidget *widget, WId winId) const
 Factory function for QPlatformWindow. More...
 
QWindowSurfacecreateWindowSurface (QWidget *widget, WId winId) const
 Factory function for QWindowSurface. More...
 
QPlatformFontDatabasefontDatabase () const
 Accessor for the platform integrations fontdatabase. More...
 
QPixmap grabWindow (WId window, int x, int y, int width, int height) const
 This function is called when Qt needs to be able to grab the content of a window. More...
 
bool hasCapability (Capability cap) const
 
bool isVirtualDesktop ()
 Returns if the current windowing system configuration defines all the screens to be one desktop(virtual desktop), or if each screen is a desktop of its own. More...
 
void moveToScreen (QWidget *window, int screen)
 This function is called when a QWidget is displayed on screen, or the QWidget is to be displayed on a new screen. More...
 
QPlatformNativeInterfacenativeInterface () const
 
 QXcbIntegration ()
 
QList< QPlatformScreen * > screens () const
 Accessor function to a list of all the screens on the current system. More...
 
 ~QXcbIntegration ()
 
- Public Functions inherited from QPlatformIntegration
virtual QPlatformClipboardclipboard () const
 Accessor for the platform integrations clipboard. More...
 
virtual QPlatformEventLoopIntegrationcreateEventLoopIntegration () const
 Factory function for the eventloop integration interface. More...
 
virtual ~QPlatformIntegration ()
 

Private Functions

bool hasOpenGL () const
 

Properties

QXcbConnectionm_connection
 
QPlatformFontDatabasem_fontDatabase
 
QPlatformNativeInterfacem_nativeInterface
 
QList< QPlatformScreen * > m_screens
 

Additional Inherited Members

- Public Types inherited from QPlatformIntegration
enum  Capability { ThreadedPixmaps = 1, OpenGL = 2 }
 

Detailed Description

Definition at line 52 of file qxcbintegration.h.

Constructors and Destructors

◆ QXcbIntegration()

QXcbIntegration::QXcbIntegration ( )

Definition at line 61 of file qxcbintegration.cpp.

63 {
64  foreach (QXcbScreen *screen, m_connection->screens())
65  m_screens << screen;
66 
69 }
QList< QPlatformScreen * > m_screens
QBasicUnixFontDatabase QGenericUnixFontDatabase
QPlatformFontDatabase * m_fontDatabase
QList< QXcbScreen * > screens() const
QPlatformNativeInterface * m_nativeInterface
QXcbConnection * m_connection

◆ ~QXcbIntegration()

QXcbIntegration::~QXcbIntegration ( )

Definition at line 71 of file qxcbintegration.cpp.

72 {
73  delete m_connection;
74 }
QXcbConnection * m_connection

Functions

◆ createPixmapData()

QPixmapData * QXcbIntegration::createPixmapData ( QPixmapData::PixelType  type) const
virtual

Factory function for QPixmapData.

PixelType can be either PixmapType or BitmapType.

See also
QPixmapData

Implements QPlatformIntegration.

Definition at line 85 of file qxcbintegration.cpp.

86 {
87  return new QRasterPixmapData(type);
88 }
int type
Definition: qmetatype.cpp:239

◆ createPlatformWindow()

QPlatformWindow * QXcbIntegration::createPlatformWindow ( QWidget widget,
WId  winId 
) const
virtual

Factory function for QPlatformWindow.

The widget parameter is a pointer to the top level widget(tlw) which the QPlatformWindow is suppose to be created for. The WId handle is actually never used, but there for future reference. Its purpose is if it is going to be possible to create QPlatformWindows on existing WId.

All tlw has to have a QPlatformWindow, and it will be created when the QPlatformWindow is set to be visible for the first time. If the tlw's window flags are changed, or if the tlw's QPlatformWindowFormat is changed, then the tlw's QPlatformWindow is deleted and a new one is created.

See also
QPlatformWindow, QPlatformWindowFormat
createWindowSurface(QWidget *widget, WId winId) const

Implements QPlatformIntegration.

Definition at line 90 of file qxcbintegration.cpp.

91 {
92  Q_UNUSED(winId);
93  return new QXcbWindow(widget);
94 }
#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

◆ createWindowSurface()

QWindowSurface * QXcbIntegration::createWindowSurface ( QWidget widget,
WId  winId 
) const
virtual

Factory function for QWindowSurface.

The QWidget parameter is a pointer to the top level widget(tlw) the window surface is created for. A QPlatformWindow is always created before the QWindowSurface for tlw where the widget also requires a WindowSurface. It is possible to create top level QWidgets without a QWindowSurface by specifying QPlatformWindowFormat::setWindowSurface(false) for the tlw QPlatformWindowFormat.

See also
QWindowSurface
createPlatformWindow(QWidget *widget, WId winId = 0) const

Implements QPlatformIntegration.

Definition at line 96 of file qxcbintegration.cpp.

97 {
98  Q_UNUSED(winId);
99  return new QXcbWindowSurface(widget);
100 }
#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

◆ fontDatabase()

QPlatformFontDatabase * QXcbIntegration::fontDatabase ( ) const
virtual

Accessor for the platform integrations fontdatabase.

Default implementation returns a default QPlatformFontDatabase.

See also
QPlatformFontDatabase

Reimplemented from QPlatformIntegration.

Definition at line 118 of file qxcbintegration.cpp.

119 {
120  return m_fontDatabase;
121 }
QPlatformFontDatabase * m_fontDatabase

◆ grabWindow()

QPixmap QXcbIntegration::grabWindow ( WId  window,
int  x,
int  y,
int  width,
int  height 
) const
virtual

This function is called when Qt needs to be able to grab the content of a window.

Returnes the content of the window specified with the WId handle within the boundaries of QRect(x,y,width,height).

Reimplemented from QPlatformIntegration.

Definition at line 123 of file qxcbintegration.cpp.

124 {
125  Q_UNUSED(window);
126  Q_UNUSED(x);
127  Q_UNUSED(y);
128  Q_UNUSED(width);
129  Q_UNUSED(height);
130  return QPixmap();
131 }
NSWindow * window
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
#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

◆ hasCapability()

bool QXcbIntegration::hasCapability ( QPlatformIntegration::Capability  cap) const
virtual

Reimplemented from QPlatformIntegration.

Definition at line 76 of file qxcbintegration.cpp.

77 {
78  switch (cap) {
79  case ThreadedPixmaps: return true;
80  case OpenGL: return hasOpenGL();
81  default: return QPlatformIntegration::hasCapability(cap);
82  }
83 }
virtual bool hasCapability(Capability cap) const
bool hasOpenGL() const

◆ hasOpenGL()

bool QXcbIntegration::hasOpenGL ( ) const
private

Definition at line 134 of file qxcbintegration.cpp.

Referenced by hasCapability().

135 {
136 #if defined(XCB_USE_GLX)
137  return true;
138 #elif defined(XCB_USE_EGL)
139  return m_connection->hasEgl();
140 #elif defined(XCB_USE_DRI2)
141  if (m_connection->hasSupportForDri2()) {
142  return true;
143  }
144 #endif
145  return false;
146 }
QXcbConnection * m_connection

◆ isVirtualDesktop()

bool QXcbIntegration::isVirtualDesktop ( )
virtual

Returns if the current windowing system configuration defines all the screens to be one desktop(virtual desktop), or if each screen is a desktop of its own.

Default implementation returns false.

Reimplemented from QPlatformIntegration.

Definition at line 113 of file qxcbintegration.cpp.

114 {
115  return false;
116 }

◆ moveToScreen()

void QXcbIntegration::moveToScreen ( QWidget window,
int  screen 
)
virtual

This function is called when a QWidget is displayed on screen, or the QWidget is to be displayed on a new screen.

The QWidget parameter is a pointer to the top level widget and the int parameter is the index to the screen in QList<QPlatformScreen *> screens() const.

Default implementation does nothing.

See also
screens() const

Reimplemented from QPlatformIntegration.

Definition at line 107 of file qxcbintegration.cpp.

108 {
109  Q_UNUSED(window);
110  Q_UNUSED(screen);
111 }
#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

◆ nativeInterface()

QPlatformNativeInterface * QXcbIntegration::nativeInterface ( ) const
virtual

Reimplemented from QPlatformIntegration.

Definition at line 148 of file qxcbintegration.cpp.

149 {
150  return m_nativeInterface;
151 }
QPlatformNativeInterface * m_nativeInterface

◆ screens()

QList< QPlatformScreen * > QXcbIntegration::screens ( ) const
virtual

Accessor function to a list of all the screens on the current system.

The screen with the index == 0 is the default/main screen.

Implements QPlatformIntegration.

Definition at line 102 of file qxcbintegration.cpp.

103 {
104  return m_screens;
105 }
QList< QPlatformScreen * > m_screens

Properties

◆ m_connection

QXcbConnection* QXcbIntegration::m_connection
private

Definition at line 75 of file qxcbintegration.h.

Referenced by hasOpenGL(), QXcbIntegration(), and ~QXcbIntegration().

◆ m_fontDatabase

QPlatformFontDatabase* QXcbIntegration::m_fontDatabase
private

Definition at line 77 of file qxcbintegration.h.

Referenced by fontDatabase(), and QXcbIntegration().

◆ m_nativeInterface

QPlatformNativeInterface* QXcbIntegration::m_nativeInterface
private

Definition at line 78 of file qxcbintegration.h.

Referenced by nativeInterface(), and QXcbIntegration().

◆ m_screens

QList<QPlatformScreen *> QXcbIntegration::m_screens
private

Definition at line 74 of file qxcbintegration.h.

Referenced by QXcbIntegration(), and screens().


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