Qt 4.8
Static Public Functions | Static Private Attributes | Friends | List of all members
QDirectFbConvenience Class Reference

#include <qdirectfbconvenience.h>

Static Public Functions

static int colorDepthForSurface (const DFBSurfacePixelFormat format)
 
static IDirectFBDisplayLayer * dfbDisplayLayer (int display=DLID_PRIMARY)
 
static IDirectFB * dfbInterface ()
 
static IDirectFBSurface * dfbSurfaceForPlatformPixmap (QPixmapData *)
 
static QEvent::Type eventType (DFBWindowEventType type)
 
static QImage::Format imageFormatFromSurfaceFormat (const DFBSurfacePixelFormat format, const DFBSurfaceCapabilities caps)
 
static Qt::KeyboardModifiers keyboardModifiers (DFBInputDeviceModifierMask mask)
 
static QDirectFbKeyMapkeyMap ()
 
static Qt::MouseButton mouseButton (DFBInputDeviceButtonIdentifier identifier)
 
static Qt::MouseButtons mouseButtons (DFBInputDeviceButtonMask mask)
 
static bool pixelFomatHasAlpha (const DFBSurfacePixelFormat format)
 

Static Private Attributes

static QDirectFbKeyMapdfbKeymap = 0
 

Friends

class QDirectFbIntegration
 

Detailed Description

Definition at line 64 of file qdirectfbconvenience.h.

Functions

◆ colorDepthForSurface()

int QDirectFbConvenience::colorDepthForSurface ( const DFBSurfacePixelFormat  format)
static

Definition at line 109 of file qdirectfbconvenience.cpp.

Referenced by QDirectFbScreen::QDirectFbScreen().

110 {
111  return ((0x1f << 7) & format) >> 7;
112 }

◆ dfbDisplayLayer()

IDirectFBDisplayLayer * QDirectFbConvenience::dfbDisplayLayer ( int  display = DLID_PRIMARY)
static

Definition at line 66 of file qdirectfbconvenience.cpp.

Referenced by QDirectFbInput::handleMouseEvents().

67 {
68  IDirectFBDisplayLayer *layer;
69  DFBResult result = QDirectFbConvenience::dfbInterface()->GetDisplayLayer(QDirectFbConvenience::dfbInterface(),display,&layer);
70  if (result != DFB_OK)
71  DirectFBErrorFatal("QDirectFbConvenience: "
72  "Unable to get primary display layer!", result);
73  return layer;
74 }
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
static IDirectFB * dfbInterface()

◆ dfbInterface()

IDirectFB * QDirectFbConvenience::dfbInterface ( )
static

Definition at line 53 of file qdirectfbconvenience.cpp.

Referenced by dfbDisplayLayer(), QDirectFbBlitterPlatformPixmap::fromDataBufferDescription(), QDirectFbIntegration::initializeDirectFB(), QDirectFbBlitter::QDirectFbBlitter(), and QDirectFbWindow::setVisible().

54 {
55  static IDirectFB *dfb = 0;
56  if (!dfb) {
57  DFBResult result = DirectFBCreate(&dfb);
58  if (result != DFB_OK) {
59  DirectFBErrorFatal("QDirectFBConvenience: error creating DirectFB interface", result);
60  return 0;
61  }
62  }
63  return dfb;
64 }

◆ dfbSurfaceForPlatformPixmap()

IDirectFBSurface * QDirectFbConvenience::dfbSurfaceForPlatformPixmap ( QPixmapData handle)
static

This is borrowing the reference of the QDirectFbBlitter. You may not store this pointer as a class member but must only use it locally.

Definition at line 118 of file qdirectfbconvenience.cpp.

Referenced by QDirectFBCursor::changeCursor().

119 {
120  QBlittablePixmapData *blittablePmData = static_cast<QBlittablePixmapData *>(handle);
121  if (blittablePmData) {
122  QBlittable *blittable = blittablePmData->blittable();
123  QDirectFbBlitter *dfbBlitter = static_cast<QDirectFbBlitter *>(blittable);
124  return dfbBlitter->m_surface.data();
125  }
126  return 0;
127 }
T * data() const
Returns the value of the pointer referenced by this object.
QBlittable * blittable() const
QDirectFBPointer< IDirectFBSurface > m_surface

◆ eventType()

QEvent::Type QDirectFbConvenience::eventType ( DFBWindowEventType  type)
static

Definition at line 181 of file qdirectfbconvenience.cpp.

Referenced by QDirectFbInput::handleKeyEvents().

182 {
183  switch(type) {
184  case DWET_BUTTONDOWN:
186  case DWET_BUTTONUP:
188  case DWET_MOTION:
189  return QEvent::MouseMove;
190  case DWET_WHEEL:
191  return QEvent::Wheel;
192  case DWET_KEYDOWN:
193  return QEvent::KeyPress;
194  case DWET_KEYUP:
195  return QEvent::KeyRelease;
196  default:
197  return QEvent::None;
198  }
199 }
int type
Definition: qmetatype.cpp:239

◆ imageFormatFromSurfaceFormat()

QImage::Format QDirectFbConvenience::imageFormatFromSurfaceFormat ( const DFBSurfacePixelFormat  format,
const DFBSurfaceCapabilities  caps 
)
static

Definition at line 76 of file qdirectfbconvenience.cpp.

Referenced by QDirectFbBlitter::doLock(), and QDirectFbScreen::QDirectFbScreen().

77 {
78  switch (format) {
79  case DSPF_LUT8:
81  case DSPF_RGB24:
82  return QImage::Format_RGB888;
83  case DSPF_ARGB4444:
85  case DSPF_RGB444:
86  return QImage::Format_RGB444;
87  case DSPF_RGB555:
88  case DSPF_ARGB1555:
89  return QImage::Format_RGB555;
90  case DSPF_RGB16:
91  return QImage::Format_RGB16;
92  case DSPF_ARGB6666:
94  case DSPF_RGB18:
95  return QImage::Format_RGB666;
96  case DSPF_RGB32:
97  return QImage::Format_RGB32;
98  case DSPF_ARGB: {
99  if (caps & DSCAPS_PREMULTIPLIED)
101  else return QImage::Format_ARGB32; }
102  default:
103  break;
104  }
105  return QImage::Format_Invalid;
106 
107 }

◆ keyboardModifiers()

Qt::KeyboardModifiers QDirectFbConvenience::keyboardModifiers ( DFBInputDeviceModifierMask  mask)
static

Definition at line 159 of file qdirectfbconvenience.cpp.

Referenced by QDirectFbInput::handleKeyEvents().

160 {
161  Qt::KeyboardModifiers modifiers = Qt::NoModifier;
162 
163  if (mask & DIMM_SHIFT) {
164  modifiers |= Qt::ShiftModifier;
165  }
166  if (mask & DIMM_ALT) {
167  modifiers |= Qt::AltModifier;
168  }
169  if (mask & DIMM_ALTGR) {
170  modifiers |= Qt::MetaModifier;
171  }
172  if (mask & DIMM_CONTROL) {
173  modifiers |= Qt::ControlModifier;
174  }
175  if (mask & DIMM_META) {
176  modifiers | Qt::MetaModifier;
177  }
178  return modifiers;
179 }

◆ keyMap()

QDirectFbKeyMap * QDirectFbConvenience::keyMap ( )
static

Definition at line 201 of file qdirectfbconvenience.cpp.

Referenced by QDirectFbInput::handleKeyEvents().

202 {
203  if (!dfbKeymap)
204  dfbKeymap = new QDirectFbKeyMap();
205  return dfbKeymap;
206 }
static QDirectFbKeyMap * dfbKeymap

◆ mouseButton()

Qt::MouseButton QDirectFbConvenience::mouseButton ( DFBInputDeviceButtonIdentifier  identifier)
static

Definition at line 129 of file qdirectfbconvenience.cpp.

130 {
131  switch (identifier){
132  case DIBI_LEFT:
133  return Qt::LeftButton;
134  case DIBI_MIDDLE:
135  return Qt::MidButton;
136  case DIBI_RIGHT:
137  return Qt::RightButton;
138  default:
139  return Qt::NoButton;
140  }
141 }

◆ mouseButtons()

Qt::MouseButtons QDirectFbConvenience::mouseButtons ( DFBInputDeviceButtonMask  mask)
static

Definition at line 143 of file qdirectfbconvenience.cpp.

Referenced by QDirectFbInput::handleMouseEvents().

144 {
145  Qt::MouseButtons buttons = Qt::NoButton;
146 
147  if (mask & DIBM_LEFT) {
148  buttons |= Qt::LeftButton;
149  }
150  if (mask & DIBM_MIDDLE) {
151  buttons |= Qt::MidButton;
152  }
153  if (mask & DIBM_RIGHT) {
154  buttons |= Qt::RightButton;
155  }
156  return buttons;
157 }
static Qt::MouseButtons buttons

◆ pixelFomatHasAlpha()

static bool QDirectFbConvenience::pixelFomatHasAlpha ( const DFBSurfacePixelFormat  format)
inlinestatic

Definition at line 68 of file qdirectfbconvenience.h.

68 { return (1 << 16) & format; }

Friends and Related Functions

◆ QDirectFbIntegration

friend class QDirectFbIntegration
friend

Definition at line 86 of file qdirectfbconvenience.h.

Properties

◆ dfbKeymap

QDirectFbKeyMap * QDirectFbConvenience::dfbKeymap = 0
staticprivate

Definition at line 85 of file qdirectfbconvenience.h.

Referenced by eventType(), and keyMap().


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