diff options
author | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-27 12:51:35 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-28 12:30:33 (GMT) |
commit | 76a7f0744cdfeb3ec25c77d4f237e60c74b7b141 (patch) | |
tree | 02a65a9bce2ff05ba363647b0e555531737920f2 /src/3rdparty/phonon/mmf/videooutput.cpp | |
parent | 1a551b57e5c9738ba81200dae6aa33ac8b6d2b96 (diff) | |
download | Qt-76a7f0744cdfeb3ec25c77d4f237e60c74b7b141.zip Qt-76a7f0744cdfeb3ec25c77d4f237e60c74b7b141.tar.gz Qt-76a7f0744cdfeb3ec25c77d4f237e60c74b7b141.tar.bz2 |
Reformatted code to comply with Qt style
Diffstat (limited to 'src/3rdparty/phonon/mmf/videooutput.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/videooutput.cpp | 126 |
1 files changed, 60 insertions, 66 deletions
diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp index 6534b7b..53178cb 100644 --- a/src/3rdparty/phonon/mmf/videooutput.cpp +++ b/src/3rdparty/phonon/mmf/videooutput.cpp @@ -34,24 +34,24 @@ using namespace Phonon::MMF; //----------------------------------------------------------------------------- MMF::VideoOutput::VideoOutput(QWidget* parent) - : QWidget(parent) - , m_observer(NULL) + : QWidget(parent) + , m_observer(NULL) { - TRACE_CONTEXT(VideoOutput::VideoOutput, EVideoInternal); - TRACE_ENTRY("parent 0x%08x", parent); + TRACE_CONTEXT(VideoOutput::VideoOutput, EVideoInternal); + TRACE_ENTRY("parent 0x%08x", parent); #ifndef PHONON_MMF_VIDEOOUTPUT_IS_QWIDGET - setPalette(QPalette(Qt::black)); - //setAttribute(Qt::WA_OpaquePaintEvent, true); - setAttribute(Qt::WA_NoSystemBackground, true); - setAutoFillBackground(false); + setPalette(QPalette(Qt::black)); + //setAttribute(Qt::WA_OpaquePaintEvent, true); + setAttribute(Qt::WA_NoSystemBackground, true); + setAutoFillBackground(false); #endif // PHONON_MMF_VIDEOOUTPUT_IS_QWIDGET - + #ifdef PHONON_MMF_DEBUG_VIDEO_OUTPUT - dump(); + dump(); #endif - - TRACE_EXIT_0(); + + TRACE_EXIT_0(); } #ifdef PHONON_MMF_DEBUG_VIDEO_OUTPUT @@ -59,56 +59,54 @@ void VideoOutput::dump() { TRACE_CONTEXT(VideoOutput::dump, EVideoInternal); TRACE_ENTRY_0(); - + TRACE("dumpObjectInfo this 0x%08x", this); this->dumpObjectInfo(); TRACE_0("Traversing up object tree ..."); QObject* node = this; QObject* root = this; - while(node) - { + while (node) { QWidget* widget = qobject_cast<QWidget*>(node); const bool visible = widget ? widget->isVisible() : false; const QHBufC name(node->objectName()); TRACE("node 0x%08x name %S widget 0x%08x visible %d", node, name.data(), widget, visible); - + root = node; node = node->parent(); } - + TRACE("dumpObjectInfo root 0x%08x", root); root->dumpObjectInfo(); TRACE_0("+ dumpObjectTree"); root->dumpObjectTree(); TRACE_0("- dumpObjectTree"); - + TRACE("isVisible %d", isVisible()); TRACE("pos %d %d", x(), y()); TRACE("size %d %d", size().width(), size().height()); TRACE("maxSize %d %d", maximumWidth(), maximumHeight()); TRACE("sizeHint %d %d", sizeHint().width(), sizeHint().height()); - + QWidget* parentWidget = qobject_cast<QWidget*>(parent()); - if(parentWidget) - { + if (parentWidget) { TRACE("parent.isVisible %d", parentWidget->isVisible()); TRACE("parent.pos %d %d", parentWidget->x(), parentWidget->y()); TRACE("parent.size %d %d", parentWidget->size().width(), parentWidget->size().height()); TRACE("parent.maxSize %d %d", parentWidget->maximumWidth(), parentWidget->maximumHeight()); TRACE("parent.sizeHint %d %d", parentWidget->sizeHint().width(), parentWidget->sizeHint().height()); } - + TRACE_EXIT_0(); } #endif // PHONON_MMF_DEBUG_VIDEO_OUTPUT MMF::VideoOutput::~VideoOutput() { - TRACE_CONTEXT(VideoOutput::~VideoOutput, EVideoInternal); - TRACE_ENTRY_0(); - - TRACE_EXIT_0(); + TRACE_CONTEXT(VideoOutput::~VideoOutput, EVideoInternal); + TRACE_ENTRY_0(); + + TRACE_EXIT_0(); } void MMF::VideoOutput::setFrameSize(const QSize& frameSize) @@ -118,11 +116,10 @@ void MMF::VideoOutput::setFrameSize(const QSize& frameSize) #else TRACE_CONTEXT(VideoOutput::setFrameSize, EVideoInternal); TRACE("oldSize %d %d newSize %d %d", - m_frameSize.width(), m_frameSize.height(), - frameSize.width(), frameSize.height()); - - if(frameSize != m_frameSize) - { + m_frameSize.width(), m_frameSize.height(), + frameSize.width(), frameSize.height()); + + if (frameSize != m_frameSize) { m_frameSize = frameSize; updateGeometry(); } @@ -133,7 +130,7 @@ void MMF::VideoOutput::setObserver(VideoOutputObserver* observer) { TRACE_CONTEXT(VideoOutput::setObserver, EVideoInternal); TRACE("observer 0x%08x", observer); - + m_observer = observer; } @@ -147,35 +144,34 @@ void MMF::VideoOutput::setObserver(VideoOutputObserver* observer) QSize MMF::VideoOutput::sizeHint() const { TRACE_CONTEXT(VideoOutput::sizeHint, EVideoApi); - + // TODO: replace this with a more sensible default QSize result(320, 240); - - if(!m_frameSize.isNull()) - { + + if (!m_frameSize.isNull()) { result = m_frameSize; } - + TRACE(" result %d %d", result.width(), result.height()); return result; } void MMF::VideoOutput::paintEvent(QPaintEvent* event) { - TRACE_CONTEXT(VideoOutput::paintEvent, EVideoInternal); - TRACE("rect %d %d - %d %d", - event->rect().left(), event->rect().top(), - event->rect().right(), event->rect().bottom()); - TRACE("regions %d", event->region().numRects()); - TRACE("type %d", event->type()); - - QWidget::paintEvent(event); + TRACE_CONTEXT(VideoOutput::paintEvent, EVideoInternal); + TRACE("rect %d %d - %d %d", + event->rect().left(), event->rect().top(), + event->rect().right(), event->rect().bottom()); + TRACE("regions %d", event->region().numRects()); + TRACE("type %d", event->type()); + + QWidget::paintEvent(event); } QPaintEngine* MMF::VideoOutput::paintEngine() const { TRACE_CONTEXT(VideoOutput::sizeHint, EVideoApi); - + QPaintEngine* const engine = QWidget::paintEngine(); TRACE_RETURN("0x%08x", engine); @@ -183,30 +179,28 @@ QPaintEngine* MMF::VideoOutput::paintEngine() const void MMF::VideoOutput::resizeEvent(QResizeEvent* event) { - TRACE_CONTEXT(VideoOutput::resizeEvent, EVideoInternal); - TRACE("%d %d -> %d %d", - event->oldSize().width(), event->oldSize().height(), - event->size().width(), event->size().height()); - - QWidget::resizeEvent(event); - - if(m_observer) - { - m_observer->videoOutputRegionChanged(); - } + TRACE_CONTEXT(VideoOutput::resizeEvent, EVideoInternal); + TRACE("%d %d -> %d %d", + event->oldSize().width(), event->oldSize().height(), + event->size().width(), event->size().height()); + + QWidget::resizeEvent(event); + + if (m_observer) { + m_observer->videoOutputRegionChanged(); + } } void MMF::VideoOutput::moveEvent(QMoveEvent* event) { - TRACE_CONTEXT(VideoOutput::moveEvent, EVideoInternal); - TRACE("%d %d -> %d %d", - event->oldPos().x(), event->oldPos().y(), - event->pos().x(), event->pos().y()); - - QWidget::moveEvent(event); - - if(m_observer) - { + TRACE_CONTEXT(VideoOutput::moveEvent, EVideoInternal); + TRACE("%d %d -> %d %d", + event->oldPos().x(), event->oldPos().y(), + event->pos().x(), event->pos().y()); + + QWidget::moveEvent(event); + + if (m_observer) { m_observer->videoOutputRegionChanged(); } } |