Qt 4.8
Public Functions | Static Public Functions | Properties | List of all members
QOpenKODEIntegration Class Reference

#include <qopenkodeintegration.h>

Inheritance diagram for QOpenKODEIntegration:
QPlatformIntegration

Public Functions

QPlatformEventLoopIntegrationcreateEventLoopIntegration () const
 Factory function for the eventloop integration interface. More...
 
QPixmapDatacreatePixmapData (QPixmapData::PixelType type) const
 Factory function for QPixmapData. More...
 
QPlatformWindowcreatePlatformWindow (QWidget *widget, WId winId=0) 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...
 
bool hasCapability (QPlatformIntegration::Capability cap) const
 
void mainGLContext () const
 
 QOpenKODEIntegration ()
 
virtual QList< QPlatformScreen * > screens () const
 Accessor function to a list of all the screens on the current system. More...
 
void setMainGLContext (QEGLPlatformContext *ctx)
 
 ~QOpenKODEIntegration ()
 
- Public Functions inherited from QPlatformIntegration
virtual QPlatformClipboardclipboard () const
 Accessor for the platform integrations clipboard. More...
 
virtual 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...
 
virtual 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...
 
virtual 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...
 
virtual QPlatformNativeInterfacenativeInterface () const
 
virtual ~QPlatformIntegration ()
 

Static Public Functions

static GLuint blitterProgram ()
 

Properties

QOpenKODEEventLoopIntegrationmEventLoopIntegration
 
QPlatformFontDatabasemFontDb
 
QEGLPlatformContextmMainGlContext
 
QList< QPlatformScreen * > mScreens
 

Additional Inherited Members

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

Detailed Description

Definition at line 87 of file qopenkodeintegration.h.

Constructors and Destructors

◆ QOpenKODEIntegration()

QOpenKODEIntegration::QOpenKODEIntegration ( )

Definition at line 124 of file qopenkodeintegration.cpp.

127  , mMainGlContext(0)
128 {
129  if (kdInitializeNV() == KD_ENOTINITIALIZED) {
130  qFatal("Did not manage to initialize openkode");
131  }
132 
133  KDDisplaySystemNV *kdDisplaySystem = kdCreateDisplaySystemSnapshotNV(this);
134  KDint32 displayCount = 0;
135  kdGetDisplaySystemPropertyivNV(kdDisplaySystem, KD_DISPLAYPROPERTY_COUNT_NV, 0, &displayCount);
136 
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)
142  continue;
143  displayName = new KDchar[displayNameLength];
144  kdGetDisplaySystemPropertycvNV(kdDisplaySystem,KD_DISPLAYPROPERTY_NAME_NV,i,displayName,&displayNameLength);
145 
146  KDDisplayNV *display = kdGetDisplayNV(displayName,this);
147  if (!display || display == (void*)-1) {
148  qErrnoWarning(kdGetError(), "Could not obtain KDDisplayNV pointer");
149  return;
150  }
151  if (displayNameLength)
152  delete displayName;
153 
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);
163  } else {
164  desktopName = KD_DEFAULT_DESKTOP_NV;
165  }
166  } else {
167  desktopName = KD_DEFAULT_DESKTOP_NV;
168  }
169 
170  KDDesktopNV *desktop = kdGetDesktopNV(desktopName,this);
171  if (!desktop || desktop == (void*)-1) {
172  qErrnoWarning(kdGetError(), "Could not obtain KDDesktopNV pointer");
173  kdReleaseDisplayNV(display);
174  return;
175  }
176  if (desktopNameLength)
177  delete desktopName;
178 
179  QOpenKODEScreen *screen = new QOpenKODEScreen(display,desktop);
180  mScreens.append(screen);
181  }
182 }
QEGLPlatformContext * mMainGlContext
QBasicUnixFontDatabase QGenericUnixFontDatabase
Q_CORE_EXPORT void qDebug(const char *,...)
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
QOpenKODEEventLoopIntegration * mEventLoopIntegration
QList< QPlatformScreen * > mScreens
Q_CORE_EXPORT void qFatal(const char *,...)
QPlatformFontDatabase * mFontDb
void qErrnoWarning(const char *msg,...)
Definition: qglobal.cpp:2954

◆ ~QOpenKODEIntegration()

QOpenKODEIntegration::~QOpenKODEIntegration ( )

Definition at line 184 of file qopenkodeintegration.cpp.

185 {
186  delete mEventLoopIntegration;
187  delete mFontDb;
188 }
QOpenKODEEventLoopIntegration * mEventLoopIntegration
QPlatformFontDatabase * mFontDb

Functions

◆ blitterProgram()

static GLuint QOpenKODEIntegration::blitterProgram ( )
static

◆ createEventLoopIntegration()

QPlatformEventLoopIntegration * QOpenKODEIntegration::createEventLoopIntegration ( ) const
virtual

Factory function for the eventloop integration interface.

Default implementation returns 0, which causes the eventloop to run in a single thread mode.

See also
QPlatformEventLoopIntegration

Reimplemented from QPlatformIntegration.

Definition at line 232 of file qopenkodeintegration.cpp.

◆ createPixmapData()

QPixmapData * QOpenKODEIntegration::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 200 of file qopenkodeintegration.cpp.

201 {
202  return new QGLPixmapData(type);
203 }
int type
Definition: qmetatype.cpp:239

◆ createPlatformWindow()

QPlatformWindow * QOpenKODEIntegration::createPlatformWindow ( QWidget widget,
WId  winId = 0 
) 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 205 of file qopenkodeintegration.cpp.

206 {
207  return new QOpenKODEWindow(tlw);
208 }

◆ createWindowSurface()

QWindowSurface * QOpenKODEIntegration::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 210 of file qopenkodeintegration.cpp.

211 {
212  QWindowSurface *returnSurface = 0;
213  switch (widget->platformWindowFormat().windowApi()) {
214 
217  returnSurface = new QGLWindowSurface(widget);
218  break;
219 
221 // returnSurface = new QVGWindowSurface(widget);
222 // break;
223 
224  default:
225  returnSurface = new QGLWindowSurface(widget);
226  break;
227  }
228 
229  return returnSurface;
230 }
The QWindowSurface class provides the drawing area for top-level windows.

◆ fontDatabase()

QPlatformFontDatabase * QOpenKODEIntegration::fontDatabase ( ) const
virtual

Accessor for the platform integrations fontdatabase.

Default implementation returns a default QPlatformFontDatabase.

See also
QPlatformFontDatabase

Reimplemented from QPlatformIntegration.

Definition at line 241 of file qopenkodeintegration.cpp.

242 {
243  return mFontDb;
244 }
QPlatformFontDatabase * mFontDb

◆ hasCapability()

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

Reimplemented from QPlatformIntegration.

Definition at line 191 of file qopenkodeintegration.cpp.

192 {
193  switch (cap) {
194  case ThreadedPixmaps: return true;
195  case OpenGL: return true;
196  default: return QPlatformIntegration::hasCapability(cap);
197  }
198 }
virtual bool hasCapability(Capability cap) const

◆ mainGLContext()

void QOpenKODEIntegration::mainGLContext ( ) const
inline

Definition at line 108 of file qopenkodeintegration.h.

Referenced by QOpenKODEWindow::QOpenKODEWindow().

108 { return mMainGlContext; }
QEGLPlatformContext * mMainGlContext

◆ screens()

virtual QList<QPlatformScreen *> QOpenKODEIntegration::screens ( ) const
inlinevirtual

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 103 of file qopenkodeintegration.h.

103 { return mScreens; }
QList< QPlatformScreen * > mScreens

◆ setMainGLContext()

void QOpenKODEIntegration::setMainGLContext ( QEGLPlatformContext ctx)
inline

Definition at line 107 of file qopenkodeintegration.h.

Referenced by QOpenKODEWindow::QOpenKODEWindow().

107 { mMainGlContext = ctx; }
QEGLPlatformContext * mMainGlContext
#define ctx
Definition: qgl.cpp:6094

Properties

◆ mEventLoopIntegration

QOpenKODEEventLoopIntegration* QOpenKODEIntegration::mEventLoopIntegration
private

Definition at line 112 of file qopenkodeintegration.h.

Referenced by createEventLoopIntegration(), and ~QOpenKODEIntegration().

◆ mFontDb

QPlatformFontDatabase* QOpenKODEIntegration::mFontDb
private

Definition at line 113 of file qopenkodeintegration.h.

Referenced by fontDatabase(), and ~QOpenKODEIntegration().

◆ mMainGlContext

QEGLPlatformContext* QOpenKODEIntegration::mMainGlContext
private

Definition at line 114 of file qopenkodeintegration.h.

◆ mScreens

QList<QPlatformScreen *> QOpenKODEIntegration::mScreens
private

Definition at line 111 of file qopenkodeintegration.h.

Referenced by QOpenKODEIntegration().


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