Qt 4.8
Public Functions | Public Variables | Properties | List of all members
QVFbScreenPrivate Class Reference

Public Functions

bool connect (int displayId)
 
int depth () const
 
void disconnect ()
 
QImage::Format format () const
 
 QVFbScreenPrivate ()
 
 QVFbScreenPrivate (int id)
 
QImagescreenImage ()
 
QSize screenSize ()
 
void setDirty (const QRect &r)
 
 ~QVFbScreenPrivate ()
 
 ~QVFbScreenPrivate ()
 

Public Variables

bool blank
 
int brightness
 
QVFbHeaderhdr
 
QWSKeyboardHandlerkeyboard
 
QWSMouseHandlermouse
 
unsigned char * shmrgn
 
bool success
 

Properties

uchardata
 
int displayId
 
QImage img
 
QVFbScreenKeyboardHandlerkeyboardHandler
 
QVFbScreenMouseHandlermouseHandler
 

Detailed Description

Definition at line 69 of file qscreenvfb_qws.cpp.

Constructors and Destructors

◆ QVFbScreenPrivate() [1/2]

QVFbScreenPrivate::QVFbScreenPrivate ( )

Definition at line 86 of file qscreenvfb_qws.cpp.

87  : mouse(0)
88 
89 {
90 #ifndef QT_NO_QWS_KEYBOARD
91  keyboard = 0;
92 #endif
93  brightness = 255;
94  blank = false;
95 }
QWSMouseHandler * mouse
QWSKeyboardHandler * keyboard

◆ ~QVFbScreenPrivate() [1/2]

QVFbScreenPrivate::~QVFbScreenPrivate ( )

Definition at line 97 of file qscreenvfb_qws.cpp.

98 {
99  delete mouse;
100 #ifndef QT_NO_QWS_KEYBOARD
101  delete keyboard;
102 #endif
103 }
QWSMouseHandler * mouse
QWSKeyboardHandler * keyboard

◆ QVFbScreenPrivate() [2/2]

QVFbScreenPrivate::QVFbScreenPrivate ( int  id)
inline

Definition at line 260 of file qvfbintegration.cpp.

261  : shmrgn(0), hdr(0), data(0), mouseHandler(0), keyboardHandler(0)
262  {
263  displayId = id;
265  }
QVFbScreenKeyboardHandler * keyboardHandler
unsigned char * shmrgn
bool connect(int displayId)
QVFbScreenMouseHandler * mouseHandler

◆ ~QVFbScreenPrivate() [2/2]

QVFbScreenPrivate::~QVFbScreenPrivate ( )
inline

Definition at line 267 of file qvfbintegration.cpp.

267 { disconnect(); }

Functions

◆ connect()

bool QVFbScreenPrivate::connect ( int  displayId)

Definition at line 298 of file qvfbintegration.cpp.

299 {
300  qDebug() << "QVFbScreenPrivate::connect" << displayId;
301  key_t key = ftok(QT_VFB_MOUSE_PIPE(displayId).toLatin1(), 'b');
302 
303  if (key == -1)
304  return false;
305 
306 
307  int shmId = shmget(key, 0, 0);
308  if (shmId != -1)
309  shmrgn = (unsigned char *)shmat(shmId, 0, 0);
310  else
311  return false;
312 
313  if ((long)shmrgn == -1 || shmrgn == 0) {
314  qDebug("No shmrgn %ld", (long)shmrgn);
315  return false;
316  }
317 
318  hdr = (QVFbHeader *)shmrgn;
319  data = shmrgn + hdr->dataoffset;
320 
321  int w = hdr->width;
322  int h = hdr->height;
323  int d = hdr->depth;
324  int lstep = hdr->linestep;
325 
327  if (d == 32)
329  else if (d == 16)
330  format = QImage::Format_RGB16;
331 
332 
333  if (format == QImage::Format_Invalid) {
334  img = QImage();
335  return false;
336  }
337 
338  img = QImage(data, w, h, lstep, format);
339 
340  qDebug("connected %dx%d %d bpp", w, h, d);
341 
342 
345  return true;
346 }
double d
Definition: qnumeric_p.h:62
int linestep
Definition: qvfbhdr.h:94
QVFbScreenKeyboardHandler * keyboardHandler
Format
The following image formats are available in Qt.
Definition: qimage.h:91
Q_CORE_EXPORT void qDebug(const char *,...)
unsigned char * shmrgn
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
int width
Definition: qvfbhdr.h:91
#define QT_VFB_MOUSE_PIPE(DISPLAY)
Definition: qvfbhdr.h:76
int dataoffset
Definition: qvfbhdr.h:95
int key
int height
Definition: qvfbhdr.h:92
int depth
Definition: qvfbhdr.h:93
QVFbScreenMouseHandler * mouseHandler

◆ depth()

int QVFbScreenPrivate::depth ( ) const
inline

Definition at line 276 of file qvfbintegration.cpp.

276 { return img.depth(); }
int depth() const
Returns the depth of the image.
Definition: qimage.cpp:1620

◆ disconnect()

void QVFbScreenPrivate::disconnect ( )

Definition at line 348 of file qvfbintegration.cpp.

349 {
350  if ((long)shmrgn != -1 && shmrgn) {
351  shmdt((char*)shmrgn);
352  shmrgn = 0;
353  }
354  delete mouseHandler;
355  mouseHandler = 0;
356  delete keyboardHandler;
357  keyboardHandler = 0;
358 }
QVFbScreenKeyboardHandler * keyboardHandler
unsigned char * shmrgn
QVFbScreenMouseHandler * mouseHandler

◆ format()

QImage::Format QVFbScreenPrivate::format ( ) const
inline

Definition at line 277 of file qvfbintegration.cpp.

277 { return img.format(); }
Format format() const
Returns the format of the image.
Definition: qimage.cpp:2305

◆ screenImage()

QImage* QVFbScreenPrivate::screenImage ( )
inline

Definition at line 273 of file qvfbintegration.cpp.

273 { return &img; }

◆ screenSize()

QSize QVFbScreenPrivate::screenSize ( )
inline

Definition at line 274 of file qvfbintegration.cpp.

274 { return img.size(); }
QSize size() const
Returns the size of the image, i.
Definition: qimage.cpp:1587

◆ setDirty()

void QVFbScreenPrivate::setDirty ( const QRect r)

Definition at line 291 of file qvfbintegration.cpp.

292 {
293  hdr->dirty = true;
294  hdr->update = hdr->update.united(r);
295 }
QRect united(const QRect &other) const
Returns the bounding rectangle of this rectangle and the given rectangle.
Definition: qrect.h:491
QRect update
Definition: qvfbhdr.h:96
bool dirty
Definition: qvfbhdr.h:97

Properties

◆ blank

bool QVFbScreenPrivate::blank

Definition at line 78 of file qscreenvfb_qws.cpp.

Referenced by QVFbScreen::blank(), QVFbScreenPrivate(), and QVFbScreen::setDirty().

◆ brightness

int QVFbScreenPrivate::brightness

Definition at line 77 of file qscreenvfb_qws.cpp.

Referenced by QVFbScreen::blank(), QVFbScreenPrivate(), and QVFbScreen::setDirty().

◆ data

uchar* QVFbScreenPrivate::data
private

Definition at line 282 of file qvfbintegration.cpp.

◆ displayId

int QVFbScreenPrivate::displayId
private

Definition at line 285 of file qvfbintegration.cpp.

◆ hdr

QVFbHeader * QVFbScreenPrivate::hdr

◆ img

QImage QVFbScreenPrivate::img
private

Definition at line 287 of file qvfbintegration.cpp.

◆ keyboard

QWSKeyboardHandler* QVFbScreenPrivate::keyboard

◆ keyboardHandler

QVFbScreenKeyboardHandler* QVFbScreenPrivate::keyboardHandler
private

Definition at line 284 of file qvfbintegration.cpp.

◆ mouse

QWSMouseHandler* QVFbScreenPrivate::mouse

Definition at line 80 of file qscreenvfb_qws.cpp.

Referenced by QVFbScreen::initDevice(), and ~QVFbScreenPrivate().

◆ mouseHandler

QVFbScreenMouseHandler* QVFbScreenPrivate::mouseHandler
private

Definition at line 283 of file qvfbintegration.cpp.

◆ shmrgn

unsigned char * QVFbScreenPrivate::shmrgn

◆ success

bool QVFbScreenPrivate::success

Definition at line 75 of file qscreenvfb_qws.cpp.


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