46 #include <QtOpenGL/private/qpixmapdata_gl_p.h> 47 #include <QtOpenGL/private/qwindowsurface_gl_p.h> 49 #include <QtGui/private/qpixmap_raster_p.h> 51 #include <QtCore/qdebug.h> 52 #include <QtCore/qthread.h> 53 #include <QtCore/qfile.h> 58 #include <KD/NV_display.h> 59 #include <KD/NV_initialize.h> 63 #include "GLES2/gl2ext.h" 68 : mIsFullScreen(false)
70 qDebug() <<
"QOpenKODEScreen::QOpenKODEIntegrationScreen()";
73 kdSetDisplayPropertybvNV(kdDisplay,
74 KD_DISPLAYPROPERTY_ENABLED_NV,
76 KDboolean power = KD_DISPLAY_POWER_ON;
77 kdSetDisplayPropertyivNV(kdDisplay,
78 KD_DISPLAYPROPERTY_POWER_NV,
81 kdSetDisplayPropertycvNV(kdDisplay,
82 KD_DISPLAYPROPERTY_DESKTOP_NAME_NV,
83 KD_DEFAULT_DESKTOP_NV);
86 if (kdGetDisplayModeNV(kdDisplay, &mode)) {
91 qDebug() <<
" - display mode " << mode.width <<
"x" << mode.height <<
" refresh " << mode.refresh;
93 KDint desktopSize[] = { mode.width, mode.height };
95 if (kdSetDesktopPropertyivNV(kdDesktop, KD_DESKTOPPROPERTY_SIZE_NV, desktopSize)) {
101 kdReleaseDisplayNV(kdDisplay);
102 kdReleaseDesktopNV(kdDesktop);
110 EGLBoolean rvbool = eglInitialize(
mEglDisplay, 0, 0);
125 : mEventLoopIntegration(0)
129 if (kdInitializeNV() == KD_ENOTINITIALIZED) {
130 qFatal(
"Did not manage to initialize openkode");
133 KDDisplaySystemNV *kdDisplaySystem = kdCreateDisplaySystemSnapshotNV(
this);
134 KDint32 displayCount = 0;
135 kdGetDisplaySystemPropertyivNV(kdDisplaySystem, KD_DISPLAYPROPERTY_COUNT_NV, 0, &displayCount);
137 for (
int i = 0; i < displayCount; i++) {
138 KDchar *displayName = 0;
139 KDsize displayNameLength = 0;
140 kdGetDisplaySystemPropertycvNV(kdDisplaySystem,KD_DISPLAYPROPERTY_NAME_NV,i,0,&displayNameLength);
141 if (!displayNameLength)
143 displayName =
new KDchar[displayNameLength];
144 kdGetDisplaySystemPropertycvNV(kdDisplaySystem,KD_DISPLAYPROPERTY_NAME_NV,i,displayName,&displayNameLength);
146 KDDisplayNV *
display = kdGetDisplayNV(displayName,
this);
147 if (!display || display == (
void*)-1) {
148 qErrnoWarning(kdGetError(),
"Could not obtain KDDisplayNV pointer");
151 if (displayNameLength)
154 KDchar *desktopName = 0;
155 KDsize desktopNameLength = 0;
156 bool openkodeImpDoesNotFail =
false;
157 if (openkodeImpDoesNotFail) {
158 qDebug() <<
"printing desktopname";
159 kdGetDisplayPropertycvNV(display,KD_DISPLAYPROPERTY_DESKTOP_NAME_NV,desktopName,&desktopNameLength);
160 if (desktopNameLength) {
161 desktopName =
new KDchar[desktopNameLength];
162 kdGetDisplayPropertycvNV(display,KD_DISPLAYPROPERTY_DESKTOP_NAME_NV,desktopName,&desktopNameLength);
164 desktopName = KD_DEFAULT_DESKTOP_NV;
167 desktopName = KD_DEFAULT_DESKTOP_NV;
170 KDDesktopNV *desktop = kdGetDesktopNV(desktopName,
this);
171 if (!desktop || desktop == (
void*)-1) {
172 qErrnoWarning(kdGetError(),
"Could not obtain KDDesktopNV pointer");
173 kdReleaseDisplayNV(display);
176 if (desktopNameLength)
213 switch (widget->platformWindowFormat().windowApi()) {
229 return returnSurface;
QPlatformWindow * createPlatformWindow(QWidget *widget, WId winId=0) const
Factory function for QPlatformWindow.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
QOpenKODEScreen(KDDisplayNV *kdDisplay, KDDesktopNV *kdDesktop)
QPixmapData * createPixmapData(QPixmapData::PixelType type) const
Factory function for QPixmapData.
Q_CORE_EXPORT void qDebug(const char *,...)
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Q_GUI_EXPORT EGLDisplay display()
QOpenKODEEventLoopIntegration * mEventLoopIntegration
QList< QPlatformScreen * > mScreens
bool hasCapability(QPlatformIntegration::Capability cap) const
The QWindowSurface class provides the drawing area for top-level windows.
Q_CORE_EXPORT void qFatal(const char *,...)
QPlatformFontDatabase * fontDatabase() const
Accessor for the platform integrations fontdatabase.
The QRect class defines a rectangle in the plane using integer precision.
QPlatformEventLoopIntegration * createEventLoopIntegration() const
Factory function for the eventloop integration interface.
QWindowSurface * createWindowSurface(QWidget *widget, WId winId) const
Factory function for QWindowSurface.
QPlatformFontDatabase * mFontDb
void qErrnoWarning(const char *msg,...)