directfb: Follow coding standards, add hints of memleaks, remove vars

Use m_ for all member variables, document some classes that appear
to lack proper destruction, remove unused variables from classes.

Change-Id: Icec451149fa5d562d8d5f54cbe9a1aa1518bfc48
Reviewed-on: http://codereview.qt.nokia.com/3667
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
bb10
Holger Hans Peter Freyther 2011-08-25 01:25:19 +08:00 committed by Lars Knoll
parent 688d9f6ec0
commit 30c23971d0
5 changed files with 36 additions and 36 deletions

View File

@ -43,24 +43,26 @@
#include "qdirectfbconvenience.h"
QDirectFBCursor::QDirectFBCursor(QPlatformScreen* screen) :
QPlatformCursor(screen), surface(0)
QDirectFBCursor::QDirectFBCursor(QPlatformScreen *screen)
: QPlatformCursor(screen)
{
QDirectFbConvenience::dfbInterface()->GetDisplayLayer(QDirectFbConvenience::dfbInterface(),DLID_PRIMARY, &m_layer);
image = new QPlatformCursorImage(0, 0, 0, 0, 0, 0);
m_image = new QPlatformCursorImage(0, 0, 0, 0, 0, 0);
}
void QDirectFBCursor::changeCursor(QCursor * cursor, QWindow * window)
#warning "Memory leak?"
void QDirectFBCursor::changeCursor(QCursor *cursor, QWindow *)
{
int xSpot;
int ySpot;
QPixmap map;
if (cursor->shape() != Qt::BitmapCursor) {
image->set(cursor->shape());
xSpot = image->hotspot().x();
ySpot = image->hotspot().y();
QImage *i = image->image();
m_image->set(cursor->shape());
xSpot = m_image->hotspot().x();
ySpot = m_image->hotspot().y();
QImage *i = m_image->image();
map = QPixmap::fromImage(*i);
} else {
QPoint point = cursor->hotSpot();

View File

@ -51,13 +51,11 @@ class QDirectFBCursor : public QPlatformCursor
{
public:
QDirectFBCursor(QPlatformScreen *screem);
void changeCursor(QCursor * cursor, QWindow * window);
void changeCursor(QCursor *cursor, QWindow *window);
private:
IDirectFBDisplayLayer * m_layer;
IDirectFBSurface * surface;
QPlatformCursorImage * image;
QDirectFbBlitter *blitter;
IDirectFBDisplayLayer *m_layer;
QPlatformCursorImage *m_image;
};
#endif // QDIRECTFBCURSOR_H

View File

@ -60,7 +60,7 @@
QT_BEGIN_NAMESPACE
QDirectFbScreen::QDirectFbScreen(int display)
:QPlatformScreen()
: QPlatformScreen()
{
m_layer = QDirectFbConvenience::dfbDisplayLayer(display);
m_layer->SetCooperativeLevel(m_layer,DLSCL_SHARED);
@ -75,18 +75,19 @@ QDirectFbScreen::QDirectFbScreen(int display)
m_depth = QDirectFbConvenience::colorDepthForSurface(config.pixelformat);
m_physicalSize = QSize(qRound(config.width * inch / dpi), qRound(config.height *inch / dpi));
cursor = new QDirectFBCursor(this);
m_cursor = new QDirectFBCursor(this);
}
QDirectFbScreen::~QDirectFbScreen()
{
#warning "Delete the cursor?"
}
QDirectFbIntegration::QDirectFbIntegration()
: mFontDb(new QGenericUnixFontDatabase())
, mEventDispatcher(createUnixEventDispatcher())
: m_fontDb(new QGenericUnixFontDatabase())
, m_eventDispatcher(createUnixEventDispatcher())
{
QGuiApplicationPrivate::instance()->setEventDispatcher(mEventDispatcher);
QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher);
const QStringList args = QCoreApplication::arguments();
int argc = args.size();
@ -107,18 +108,18 @@ QDirectFbIntegration::QDirectFbIntegration()
QDirectFbScreen *primaryScreen = new QDirectFbScreen(0);
screenAdded(primaryScreen);
mInputRunner = new QThread;
mInput = new QDirectFbInput(0);
mInput->moveToThread(mInputRunner);
QObject::connect(mInputRunner,SIGNAL(started()),mInput,SLOT(runInputEventLoop()));
mInputRunner->start();
m_inputRunner = new QThread;
m_input = new QDirectFbInput(0);
m_input->moveToThread(m_inputRunner);
QObject::connect(m_inputRunner,SIGNAL(started()),m_input,SLOT(runInputEventLoop()));
m_inputRunner->start();
}
QDirectFbIntegration::~QDirectFbIntegration()
{
mInput->stopInputEventLoop();
delete mInputRunner;
delete mInput;
m_input->stopInputEventLoop();
delete m_inputRunner;
delete m_input;
}
QPlatformPixmap *QDirectFbIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
@ -131,13 +132,13 @@ QPlatformPixmap *QDirectFbIntegration::createPlatformPixmap(QPlatformPixmap::Pix
QPlatformWindow *QDirectFbIntegration::createPlatformWindow(QWindow *window) const
{
QDirectFbInput *input = const_cast<QDirectFbInput *>(mInput);//gah
QDirectFbInput *input = const_cast<QDirectFbInput *>(m_input);//gah
return new QDirectFbWindow(window,input);
}
QAbstractEventDispatcher *QDirectFbIntegration::guiThreadEventDispatcher() const
{
return mEventDispatcher;
return m_eventDispatcher;
}
QPlatformBackingStore *QDirectFbIntegration::createPlatformBackingStore(QWindow *window) const
@ -147,7 +148,7 @@ QPlatformBackingStore *QDirectFbIntegration::createPlatformBackingStore(QWindow
QPlatformFontDatabase *QDirectFbIntegration::fontDatabase() const
{
return mFontDb;
return m_fontDb;
}
QT_END_NAMESPACE

View File

@ -74,8 +74,7 @@ public:
IDirectFBDisplayLayer *m_layer;
private:
QDirectFBCursor * cursor;
QDirectFBCursor *m_cursor;
};
class QDirectFbIntegration : public QPlatformIntegration
@ -92,10 +91,10 @@ public:
QPlatformFontDatabase *fontDatabase() const;
private:
QDirectFbInput *mInput;
QThread *mInputRunner;
QPlatformFontDatabase *mFontDb;
QAbstractEventDispatcher *mEventDispatcher;
QDirectFbInput *m_input;
QThread *m_inputRunner;
QPlatformFontDatabase *m_fontDb;
QAbstractEventDispatcher *m_eventDispatcher;
};
QT_END_NAMESPACE

View File

@ -47,7 +47,7 @@
#include <directfb.h>
QDirectFbWindow::QDirectFbWindow(QWindow *tlw, QDirectFbInput *inputhandler)
: QPlatformWindow(tlw), m_inputHandler(inputhandler), m_context(0)
: QPlatformWindow(tlw), m_inputHandler(inputhandler)
{
IDirectFBDisplayLayer *layer = QDirectFbConvenience::dfbDisplayLayer();
DFBDisplayLayerConfig layerConfig;