Qt 4.8
Public Types | Public Functions | Static Private Functions | List of all members
QXlibNativeInterface Class Reference

#include <qxlibnativeinterface.h>

Inheritance diagram for QXlibNativeInterface:
QPlatformNativeInterface

Public Types

enum  ResourceType {
  Display, EglDisplay, Connection, Screen,
  GraphicsDevice, EglContext
}
 

Public Functions

void * connectionForWidget (QWidget *widget)
 
void * displayForWidget (QWidget *widget)
 
void * eglContextForWidget (QWidget *widget)
 
void * eglDisplayForWidget (QWidget *widget)
 
void * graphicsDeviceForWidget (QWidget *widget)
 
void * nativeResourceForWidget (const QByteArray &resourceString, QWidget *widget)
 
void * screenForWidget (QWidget *widget)
 

Static Private Functions

static QXlibScreenqPlatformScreenForWidget (QWidget *widget)
 

Detailed Description

Definition at line 49 of file qxlibnativeinterface.h.

Enumerations

◆ ResourceType

Functions

◆ connectionForWidget()

void* QXlibNativeInterface::connectionForWidget ( QWidget widget)

◆ displayForWidget()

void * QXlibNativeInterface::displayForWidget ( QWidget widget)

Definition at line 95 of file qxlibnativeinterface.cpp.

96 {
97  return qPlatformScreenForWidget(widget)->display()->nativeDisplay();
98 }
static QXlibScreen * qPlatformScreenForWidget(QWidget *widget)
Display * nativeDisplay() const
QXlibDisplay * display() const

◆ eglContextForWidget()

void * QXlibNativeInterface::eglContextForWidget ( QWidget widget)

Definition at line 118 of file qxlibnativeinterface.cpp.

119 {
120  Q_UNUSED(widget);
121  return 0;
122 }
#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

◆ eglDisplayForWidget()

void * QXlibNativeInterface::eglDisplayForWidget ( QWidget widget)

Definition at line 100 of file qxlibnativeinterface.cpp.

101 {
102  Q_UNUSED(widget);
103  return 0;
104 }
#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

◆ graphicsDeviceForWidget()

void * QXlibNativeInterface::graphicsDeviceForWidget ( QWidget widget)

Definition at line 112 of file qxlibnativeinterface.cpp.

113 {
114  Q_UNUSED(widget);
115  return 0;
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

◆ nativeResourceForWidget()

void * QXlibNativeInterface::nativeResourceForWidget ( const QByteArray resourceString,
QWidget widget 
)
virtual

Reimplemented from QPlatformNativeInterface.

Definition at line 65 of file qxlibnativeinterface.cpp.

66 {
67  QByteArray lowerCaseResource = resourceString.toLower();
68  ResourceType resource = qXlibResourceMap()->value(lowerCaseResource);
69  void *result = 0;
70  switch(resource) {
71  case Display:
72  result = displayForWidget(widget);
73  break;
74  case EglDisplay:
75  result = eglDisplayForWidget(widget);
76  break;
77  case Connection:
78  result = connectionForWidget(widget);
79  break;
80  case Screen:
81  result = reinterpret_cast<void *>(qPlatformScreenForWidget(widget)->xScreenNumber());
82  break;
83  case GraphicsDevice:
84  result = graphicsDeviceForWidget(widget);
85  break;
86  case EglContext:
87  result = eglContextForWidget(widget);
88  break;
89  default:
90  result = 0;
91  }
92  return result;
93 }
static QXlibScreen * qPlatformScreenForWidget(QWidget *widget)
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QByteArray toLower() const
Returns a lowercase copy of the byte array.
void * eglDisplayForWidget(QWidget *widget)
void * connectionForWidget(QWidget *widget)
void * displayForWidget(QWidget *widget)
int xScreenNumber() const
void * eglContextForWidget(QWidget *widget)
void * graphicsDeviceForWidget(QWidget *widget)

◆ qPlatformScreenForWidget()

QXlibScreen * QXlibNativeInterface::qPlatformScreenForWidget ( QWidget widget)
staticprivate

Definition at line 124 of file qxlibnativeinterface.cpp.

125 {
126  QXlibScreen *screen;
127  if (widget) {
128  screen = static_cast<QXlibScreen *>(QPlatformScreen::platformScreenForWidget(widget));
129  }else {
130  screen = static_cast<QXlibScreen *>(QApplicationPrivate::platformIntegration()->screens()[0]);
131  }
132  return screen;
133 }
static QPlatformScreen * platformScreenForWidget(const QWidget *widget)

◆ screenForWidget()

void * QXlibNativeInterface::screenForWidget ( QWidget widget)

Definition at line 106 of file qxlibnativeinterface.cpp.

107 {
108  Q_UNUSED(widget);
109  return 0;
110 }
#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

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