summaryrefslogtreecommitdiffstats
path: root/tools/macdeployqt/macdeployqt.pro
blob: 09ed6989aa516e5dd509f20c54d583f85cc72e04 (plain)
1
2
3
4
5
6
7

mac {

TEMPLATE = subdirs
SUBDIRS = macdeployqt macchangeqt

}
rent()) << ' '; - stream << window->Position().iX << ',' << window->Position().iY << ' '; - stream << '(' << window->AbsPosition().iX << ',' << window->AbsPosition().iY << ") "; - stream << window->Size().iWidth << 'x' << window->Size().iHeight << ' '; + stream << window->Position().iX << ',' << window->Position().iY << ' '; + stream << '(' << window->AbsPosition().iX << ',' << window->AbsPosition().iY << ") "; + stream << window->Size().iWidth << 'x' << window->Size().iHeight << ' '; - const TDisplayMode displayMode = window->DisplayMode(); - stream << "mode " << displayMode << ' '; + const TDisplayMode displayMode = window->DisplayMode(); + stream << "mode " << displayMode << ' '; - stream << "ord " << window->OrdinalPosition(); + stream << "ord " << window->OrdinalPosition(); - stream.flush(); - result.append(array); + stream.flush(); + result.append(array); + } } } -- cgit v0.12 From cc2d8068fea504483b2602128e2169b482feb308 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Mon, 9 Nov 2009 12:10:24 +0100 Subject: Replace mmfphonondebug.lib with #ifndef QT_NO_DEBUG. The debug{} directive in src/plugins/phonon/mmf/plugin/plugin.pro does not have any effect - this can be seen by looking at the generated MMP file, which has a STATICLIBRARY directive which is applied in both UDEB and UREL builds. This is the general problem that .pro files cannot tell distinction between the different targets that one makespec covers. Also remove objectdumpstub; objectdump was originally prepared for QtGui inclusion, but since that never happened, no other platforms than Symbian needs to be covered. Task-number: QTBUG-5466 Reviewed-by: Gareth Stockwell --- .../phonon/mmf/mmfphonondebug/objectdump.cpp | 527 -------------------- .../phonon/mmf/mmfphonondebug/objectdump.h | 166 ------- .../phonon/mmf/mmfphonondebug/objectdump_global.h | 30 -- .../phonon/mmf/mmfphonondebug/objectdump_stub.cpp | 40 -- .../mmf/mmfphonondebug/objectdump_symbian.cpp | 160 ------- .../phonon/mmf/mmfphonondebug/objectdump_symbian.h | 66 --- .../phonon/mmf/mmfphonondebug/objecttree.cpp | 102 ---- .../phonon/mmf/mmfphonondebug/objecttree.h | 117 ----- src/3rdparty/phonon/mmf/objectdump.cpp | 529 +++++++++++++++++++++ src/3rdparty/phonon/mmf/objectdump.h | 166 +++++++ src/3rdparty/phonon/mmf/objectdump_global.h | 30 ++ src/3rdparty/phonon/mmf/objectdump_symbian.cpp | 163 +++++++ src/3rdparty/phonon/mmf/objectdump_symbian.h | 66 +++ src/3rdparty/phonon/mmf/objecttree.cpp | 104 ++++ src/3rdparty/phonon/mmf/objecttree.h | 117 +++++ src/plugins/phonon/mmf/mmf.pro | 103 +++- .../phonon/mmf/mmfphonondebug/mmfphonondebug.pro | 31 -- src/plugins/phonon/mmf/plugin/plugin.pro | 91 ---- 18 files changed, 1275 insertions(+), 1333 deletions(-) delete mode 100644 src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp delete mode 100644 src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h delete mode 100644 src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_global.h delete mode 100644 src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_stub.cpp delete mode 100644 src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp delete mode 100644 src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h delete mode 100644 src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp delete mode 100644 src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h create mode 100644 src/3rdparty/phonon/mmf/objectdump.cpp create mode 100644 src/3rdparty/phonon/mmf/objectdump.h create mode 100644 src/3rdparty/phonon/mmf/objectdump_global.h create mode 100644 src/3rdparty/phonon/mmf/objectdump_symbian.cpp create mode 100644 src/3rdparty/phonon/mmf/objectdump_symbian.h create mode 100644 src/3rdparty/phonon/mmf/objecttree.cpp create mode 100644 src/3rdparty/phonon/mmf/objecttree.h delete mode 100644 src/plugins/phonon/mmf/mmfphonondebug/mmfphonondebug.pro delete mode 100644 src/plugins/phonon/mmf/plugin/plugin.pro diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp deleted file mode 100644 index 9add439..0000000 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp +++ /dev/null @@ -1,527 +0,0 @@ -/* This file is part of the KDE project. - -Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - -This library is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 2.1 or 3 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library. If not, see . - -*/ - -#include -#include -#include -#include -#include - -#include "objectdump.h" -#include "objecttree.h" - -QT_BEGIN_NAMESPACE - -namespace ObjectDump -{ - -//----------------------------------------------------------------------------- -// QObjectAnnotator -//----------------------------------------------------------------------------- - -QAnnotator::~QAnnotator() -{ - -} - - -//----------------------------------------------------------------------------- -// Annotators -//----------------------------------------------------------------------------- - -QList QAnnotatorBasic::annotation(const QObject& object) -{ - QList result; - - QByteArray array; - QTextStream stream(&array); - - stream << '[' << &object << ']'; - stream << ' '; - stream << object.metaObject()->className(); - - if (object.objectName() != "") - stream << " \"" << object.objectName() << '"'; - - if (object.isWidgetType()) - stream << " isWidget"; - - stream.flush(); - result.append(array); - return result; -} - -QList QAnnotatorWidget::annotation(const QObject& object) -{ - QList result; - - const QWidget* widget = qobject_cast(&object); - if (widget) { - - QByteArray array; - QTextStream stream(&array); - - stream << "widget: "; - - if (widget->isVisible()) - stream << "visible "; - else - stream << "invisible "; - - stream << widget->x() << ',' << widget->y() << ' '; - stream << widget->size().width() << 'x'<< widget->size().height() << ' '; - - stream << "hint " << widget->sizeHint().width() << 'x' << widget->sizeHint().height(); - - stream.flush(); - result.append(array); - } - - return result; -} - - -//----------------------------------------------------------------------------- -// Base class for QDumperPrivate, QVisitorPrivate -//----------------------------------------------------------------------------- - -class QDumperBase -{ -public: - QDumperBase(); - ~QDumperBase(); - - void setPrefix(const QString& prefix); - void addAnnotator(QAnnotator* annotator); - -protected: - QByteArray m_prefix; - QList m_annotators; - -}; - -QDumperBase::QDumperBase() -{ - -} - -QDumperBase::~QDumperBase() -{ - QAnnotator* annotator; - foreach(annotator, m_annotators) - delete annotator; -} - -void QDumperBase::setPrefix(const QString& prefix) -{ - m_prefix = prefix.count() - ? (prefix + " ").toAscii() - : prefix.toAscii(); -} - -void QDumperBase::addAnnotator(QAnnotator* annotator) -{ - // Protect against an exception occurring during QList::append - QScopedPointer holder(annotator); - m_annotators.append(annotator); - holder.take(); -} - - -//----------------------------------------------------------------------------- -// QDumper -//----------------------------------------------------------------------------- - -class QDumperPrivate : public QDumperBase -{ -public: - QDumperPrivate(); - ~QDumperPrivate(); - - void dumpObject(const QObject& object); - -}; - - -QDumperPrivate::QDumperPrivate() -{ - -} - -QDumperPrivate::~QDumperPrivate() -{ - -} - -void QDumperPrivate::dumpObject(const QObject& object) -{ - QAnnotator* annotator; - foreach(annotator, m_annotators) { - - const QList annotations = annotator->annotation(object); - QByteArray annotation; - foreach(annotation, annotations) { - QByteArray buffer(m_prefix); - buffer.append(annotation); - qDebug() << buffer.constData(); - } - } -} - - -QDumper::QDumper() - : d_ptr(new QDumperPrivate) -{ - -} - -QDumper::~QDumper() -{ - -} - -void QDumper::setPrefix(const QString& prefix) -{ - d_func()->setPrefix(prefix); -} - -void QDumper::addAnnotator(QAnnotator* annotator) -{ - d_func()->addAnnotator(annotator); -} - -void QDumper::dumpObject(const QObject& object) -{ - d_func()->dumpObject(object); -} - - -//----------------------------------------------------------------------------- -// QVisitor -//----------------------------------------------------------------------------- - -class QVisitorPrivate : public QDumperBase -{ -public: - QVisitorPrivate(); - ~QVisitorPrivate(); - - void setIndent(unsigned indent); - - void visitNode(const QObject& object); - void visitComplete(); - -private: - class Node - { - public: - Node(); - ~Node(); - - QList m_annotation; - QList m_children; - - typedef QList::const_iterator child_iterator; - }; - -private: - Node* findNode(const QObject* object) const; - QByteArray branchBuffer(const QList& branches, bool isNodeLine, bool isLastChild) const; - void dumpRecursive(const Node& node, QList branches, bool isLastChild); - void dumpNode(const Node& node, const QList& branches, bool isLastChild); - -private: - unsigned m_indent; - - QScopedPointer m_root; - - // Hash table used to associate internal nodes with QObjects - typedef QHash Hash; - Hash m_hash; -}; - -static const unsigned DefaultIndent = 2; - -QVisitorPrivate::QVisitorPrivate() - : m_indent(DefaultIndent) -{ - -} - -QVisitorPrivate::~QVisitorPrivate() -{ - -} - -void QVisitorPrivate::setIndent(unsigned indent) -{ - m_indent = indent; -} - -// Builds up a mirror of the object tree, rooted in m_root, with each node -// storing annotations generated by -void QVisitorPrivate::visitNode(const QObject& object) -{ - QObject* const objectParent = object.parent(); - Node* const nodeParent = objectParent ? findNode(objectParent) : 0; - - // Create a new node and store in scoped pointer for exception safety - Node* node = new Node; - QScopedPointer nodePtr(node); - - // Associate node with QObject - m_hash.insert(&object, node); - - // Insert node into internal tree - if (nodeParent) - { - nodeParent->m_children.append(nodePtr.take()); - } - else - { - Q_ASSERT(m_root.isNull()); - m_root.reset(nodePtr.take()); - } - - // Generate and store annotations - QAnnotator* annotator; - foreach(annotator, m_annotators) - node->m_annotation.append( annotator->annotation(object) ); -} - -void QVisitorPrivate::visitComplete() -{ - QList branches; - static const bool isLastChild = true; - dumpRecursive(*m_root, branches, isLastChild); - m_root.reset(0); -} - -QVisitorPrivate::Node* QVisitorPrivate::findNode(const QObject* object) const -{ - Hash::const_iterator i = m_hash.find(object); - return (m_hash.end() == i) ? 0 : *i; -} - -QByteArray QVisitorPrivate::branchBuffer - (const QList& branches, bool isNodeLine, bool isLastChild) const -{ - const int depth = branches.count(); - - const QByteArray indent(m_indent, ' '); - const QByteArray horiz(m_indent, '-'); - - QByteArray buffer; - QTextStream stream(&buffer); - - for (int i=0; i branches, bool isLastChild) -{ - dumpNode(node, branches, isLastChild); - - // Recurse down tree - const Node::child_iterator begin = node.m_children.begin(); - const Node::child_iterator end = node.m_children.end(); - for (Node::child_iterator i = begin; end != i; ++i) { - - isLastChild = (end == i + 1); - - if (begin == i) - branches.push_back(!isLastChild); - else - branches.back() = !isLastChild; - - static const bool isNodeLine = false; - const QByteArray buffer = branchBuffer(branches, isNodeLine, false); - qDebug() << buffer.constData(); - - dumpRecursive(**i, branches, isLastChild); - } -} - -void QVisitorPrivate::dumpNode - (const Node& node, const QList& branches, bool isLastChild) -{ - const QList::const_iterator - begin = node.m_annotation.begin(), end = node.m_annotation.end(); - - if (begin == end) { - // No annotations - just dump the object pointer - const bool isNodeLine = true; - QByteArray buffer = branchBuffer(branches, isNodeLine, isLastChild); - qDebug() << 0; // TODO - } - else { - // Dump annotations - for (QList::const_iterator i = begin; end != i; ++i) { - const bool isNodeLine = (begin == i); - QByteArray buffer = branchBuffer(branches, isNodeLine, isLastChild); - buffer.append(*i); - qDebug() << buffer.constData(); - } - } -} - - -// QVisitorPrivate::Node - -QVisitorPrivate::Node::Node() -{ - -} - -QVisitorPrivate::Node::~Node() -{ - Node* child; - foreach(child, m_children) - delete child; -} - - -// QVisitor - -QVisitor::QVisitor() - : d_ptr(new QVisitorPrivate) -{ - -} - -QVisitor::~QVisitor() -{ - -} - -void QVisitor::setPrefix(const QString& prefix) -{ - d_func()->setPrefix(prefix); -} - -void QVisitor::setIndent(unsigned indent) -{ - d_func()->setIndent(indent); -} - -void QVisitor::addAnnotator(QAnnotator* annotator) -{ - d_func()->addAnnotator(annotator); -} - -void QVisitor::visitPrepare() -{ - // Do nothing -} - -void QVisitor::visitNode(const QObject& object) -{ - d_func()->visitNode(object); -} - -void QVisitor::visitComplete() -{ - d_func()->visitComplete(); -} - - -//----------------------------------------------------------------------------- -// Utility functions -//----------------------------------------------------------------------------- - -void addDefaultAnnotators_sys(QDumper& visitor); -void addDefaultAnnotators_sys(QVisitor& visitor); - -void addDefaultAnnotators(QDumper& dumper) -{ - dumper.addAnnotator(new QAnnotatorBasic); - dumper.addAnnotator(new QAnnotatorWidget); - - // Add platform-specific annotators - addDefaultAnnotators_sys(dumper); -} - -void addDefaultAnnotators(QVisitor& visitor) -{ - visitor.addAnnotator(new QAnnotatorBasic); - visitor.addAnnotator(new QAnnotatorWidget); - - // Add platform-specific annotators - addDefaultAnnotators_sys(visitor); -} - -void dumpTreeFromRoot(const QObject& root, QVisitor& visitor) -{ - // Set up iteration range - ObjectTree::DepthFirstConstIterator begin(root), end; - - // Invoke generic visitor algorithm - ObjectTree::visit(begin, end, visitor); -} - -void dumpTreeFromLeaf(const QObject& leaf, QVisitor& visitor) -{ - // Walk up to root - const QObject* root = &leaf; - while(root->parent()) - { - root = root->parent(); - } - - dumpTreeFromRoot(*root, visitor); -} - -void dumpAncestors(const QObject& leaf, QVisitor& visitor) -{ - // Set up iteration range - ObjectTree::AncestorConstIterator begin(leaf), end; - - // Invoke generic visitor algorithm - ObjectTree::visit(begin, end, visitor); -} - - -} // namespace ObjectDump - -QT_END_NAMESPACE - - - diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h deleted file mode 100644 index e94b3ac..0000000 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h +++ /dev/null @@ -1,166 +0,0 @@ -/* This file is part of the KDE project. - -Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - -This library is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 2.1 or 3 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library. If not, see . - -*/ - -#ifndef OBJECTDUMP_H -#define OBJECTDUMP_H - -#include "objectdump_global.h" - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace ObjectDump -{ - -/** - * Abstract base for annotator classes invoked by QVisitor. - */ -class OBJECTDUMP_EXPORT QAnnotator : public QObject -{ - Q_OBJECT -public: - virtual ~QAnnotator(); - virtual QList annotation(const QObject& object) = 0; -}; - -/** - * Annotator which replicates QObject::dumpObjectTree functionality. - */ -class OBJECTDUMP_EXPORT QAnnotatorBasic : public QAnnotator -{ - Q_OBJECT -public: - QList annotation(const QObject& object); -}; - -/** - * Annotator which returns widget information. - */ -class OBJECTDUMP_EXPORT QAnnotatorWidget : public QAnnotator -{ - Q_OBJECT -public: - QList annotation(const QObject& object); -}; - - -class QDumperPrivate; - -/** - * Class used to dump information about individual QObjects. - */ -class OBJECTDUMP_EXPORT QDumper : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QDumper) - -public: - QDumper(); - ~QDumper(); - - /** - * Specify a prefix, to be printed on each line of output. - */ - void setPrefix(const QString& prefix); - - /** - * Takes ownership of annotator. - */ - void addAnnotator(QAnnotator* annotator); - - /** - * Invoke each annotator on the object and write to debug output. - */ - void dumpObject(const QObject& object); - -private: - QScopedPointer d_ptr; - -}; - - -class QVisitorPrivate; - -/** - * Visitor class which dumps information about nodes in the object tree. - */ -class OBJECTDUMP_EXPORT QVisitor : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QVisitor) - -public: - QVisitor(); - ~QVisitor(); - - /** - * Specify a prefix, to be printed on each line of output. - */ - void setPrefix(const QString& prefix); - - /** - * Set number of spaces by which each level of the tree is indented. - */ - void setIndent(unsigned indent); - - /** - * Called by the visitor algorithm before starting the visit. - */ - void visitPrepare(); - - /** - * Called by the visitor algorithm as each node is visited. - */ - void visitNode(const QObject& object); - - /** - * Called by the visitor algorithm when the visit is complete. - */ - void visitComplete(); - - /** - * Takes ownership of annotator. - */ - void addAnnotator(QAnnotator* annotator); - -private: - QScopedPointer d_ptr; - -}; - - -//----------------------------------------------------------------------------- -// Utility functions -//----------------------------------------------------------------------------- - -void OBJECTDUMP_EXPORT addDefaultAnnotators(QDumper& dumper); -void OBJECTDUMP_EXPORT addDefaultAnnotators(QVisitor& visitor); - -void OBJECTDUMP_EXPORT dumpTreeFromRoot(const QObject& root, QVisitor& visitor); -void OBJECTDUMP_EXPORT dumpTreeFromLeaf(const QObject& leaf, QVisitor& visitor); -void OBJECTDUMP_EXPORT dumpAncestors(const QObject& leaf, QVisitor& visitor); - -} // namespace ObjectDump - -QT_END_NAMESPACE - -#endif diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_global.h b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_global.h deleted file mode 100644 index b8987e0..0000000 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_global.h +++ /dev/null @@ -1,30 +0,0 @@ -/* This file is part of the KDE project. - -Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - -This library is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 2.1 or 3 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library. If not, see . - -*/ - -#ifndef OBJECTDUMP_GLOBAL_H -#define OBJECTDUMP_GLOBAL_H - -#include - -#if defined(OBJECTDUMP_LIBRARY) -# define OBJECTDUMP_EXPORT -#else -# define OBJECTDUMP_EXPORT -#endif - -#endif diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_stub.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_stub.cpp deleted file mode 100644 index 6207dac..0000000 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_stub.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* This file is part of the KDE project. - -Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - -This library is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 2.1 or 3 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library. If not, see . - -*/ - -#include "objectdump.h" - -QT_BEGIN_NAMESPACE - -namespace ObjectDump -{ - -void addDefaultAnnotators_sys(QDumper& /*dumper*/) -{ - -} - -void addDefaultAnnotators_sys(QVisitor& /*visitor*/) -{ - -} - -} // namespace ObjectDump - -QT_END_NAMESPACE - - diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp deleted file mode 100644 index f836109..0000000 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* This file is part of the KDE project. - -Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - -This library is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 2.1 or 3 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library. If not, see . - -*/ - -#include -#include -#include -#include "objectdump_symbian.h" - -#include // to access QWExtra - -QT_BEGIN_NAMESPACE - -namespace ObjectDump -{ -namespace Symbian -{ - -QList QAnnotatorWidget::annotation(const QObject& object) -{ - QList result; - - const QWidget* widget = qobject_cast(&object); - if (widget) { - - const QWExtra* extra = qt_widget_private(const_cast(widget))->extraData(); - - if (extra) { - - QByteArray array; - QTextStream stream(&array); - - stream << "widget (Symbian): "; - stream << "activated " << extra->activated << ' '; - stream << "disableBlit " << extra->disableBlit << ' '; - - stream.flush(); - result.append(array); - } - } - - return result; -} - -QList QAnnotatorControl::annotation(const QObject& object) -{ - QList result; - - const QWidget* widget = qobject_cast(&object); - if (widget) { - - const CCoeControl* control = widget->effectiveWinId(); - if (control) { - - QByteArray array; - QTextStream stream(&array); - - stream << "control: " << control << ' '; - stream << "parent " << control->Parent() << ' '; - - if (control->IsVisible()) - stream << "visible "; - else - stream << "invisible "; - - stream << control->Position().iX << ',' << control->Position().iY << ' '; - stream << control->Size().iWidth << 'x' << control->Size().iHeight; - - if (control->OwnsWindow()) - stream << " ownsWindow "; - - stream.flush(); - result.append(array); - } - } - - return result; -} - -QList QAnnotatorWindow::annotation(const QObject& object) -{ - QList result; - - const QWidget* widget = qobject_cast(&object); - if (widget) { - - const CCoeControl* control = widget->effectiveWinId(); - RDrawableWindow *window = 0; - - if (control && (window = control->DrawableWindow())) { - - QByteArray array; - QTextStream stream(&array); - - stream << "window: "; - - // Server-side address of CWsWindow object - // This is useful for correlation with the window tree dumped by the window - // server (see RWsSession::LogCommand). - // Cast to a void pointer so that log output is in hexadecimal format. - stream << "srv " << reinterpret_cast(window->WsHandle()) << ' '; - - stream << "group " << window->WindowGroupId() << ' '; - - // Client-side handle to the parent window. - // Cast to a void pointer so that log output is in hexadecimal format. - stream << "parent " << reinterpret_cast(window->Parent()) << ' '; - - stream << window->Position().iX << ',' << window->Position().iY << ' '; - stream << '(' << window->AbsPosition().iX << ',' << window->AbsPosition().iY << ") "; - stream << window->Size().iWidth << 'x' << window->Size().iHeight << ' '; - - const TDisplayMode displayMode = window->DisplayMode(); - stream << "mode " << displayMode << ' '; - - stream << "ord " << window->OrdinalPosition(); - - stream.flush(); - result.append(array); - } - } - - return result; -} - -} // namespace Symbian - -void addDefaultAnnotators_sys(QDumper& dumper) -{ - dumper.addAnnotator(new Symbian::QAnnotatorWidget); - dumper.addAnnotator(new Symbian::QAnnotatorControl); - dumper.addAnnotator(new Symbian::QAnnotatorWindow); -} - -void addDefaultAnnotators_sys(QVisitor& visitor) -{ - visitor.addAnnotator(new Symbian::QAnnotatorWidget); - visitor.addAnnotator(new Symbian::QAnnotatorControl); - visitor.addAnnotator(new Symbian::QAnnotatorWindow); -} - -} // namespace ObjectDump - -QT_END_NAMESPACE - - diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h deleted file mode 100644 index 563c862..0000000 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h +++ /dev/null @@ -1,66 +0,0 @@ -/* This file is part of the KDE project. - -Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - -This library is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 2.1 or 3 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library. If not, see . - -*/ - -#ifndef OBJECTDUMP_SYMBIAN_H -#define OBJECTDUMP_SYMBIAN_H - -#include "objectdump.h" - -QT_BEGIN_NAMESPACE - -namespace ObjectDump -{ -namespace Symbian -{ - -/** - * Annotator which returns Symbian-specific widget information - */ -class QAnnotatorWidget : public QAnnotator -{ - Q_OBJECT -public: - QList annotation(const QObject& object); -}; - -/** - * Annotator which returns control information - */ -class QAnnotatorControl : public QAnnotator -{ - Q_OBJECT -public: - QList annotation(const QObject& object); -}; - -/** - * Annotator which returns window information - */ -class QAnnotatorWindow : public QAnnotator -{ - Q_OBJECT -public: - QList annotation(const QObject& object); -}; - -} // namespace Symbian -} // namespace ObjectDump - -QT_END_NAMESPACE - -#endif diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp deleted file mode 100644 index bc61435..0000000 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* This file is part of the KDE project. - -Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - -This library is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 2.1 or 3 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library. If not, see . - -*/ - -#include -#include -#include "objecttree.h" - -QT_BEGIN_NAMESPACE - -namespace ObjectTree -{ - -DepthFirstConstIterator::DepthFirstConstIterator() - : m_pointee(0) -{ - -} - -DepthFirstConstIterator::DepthFirstConstIterator - (const QObject& root) - : m_pointee(&root) -{ - -} - -DepthFirstConstIterator& - DepthFirstConstIterator::operator++() -{ - const QObjectList& children = m_pointee->children(); - - if (children.count() == 0) { - backtrack(); - } - else { - m_history.push(0); - m_pointee = children.first(); - } - - return *this; -} - -void DepthFirstConstIterator::backtrack() -{ - if (m_history.count()) { - const int index = m_history.top(); - m_history.pop(); - - const QObjectList& siblings = m_pointee->parent()->children(); - if (siblings.count() > index + 1) { - m_history.push(index + 1); - m_pointee = siblings[index + 1]; - } - else { - m_pointee = m_pointee->parent(); - backtrack(); - } - } - else { - // Reached end of search - m_pointee = 0; - } -} - - - -AncestorConstIterator::AncestorConstIterator() -{ - -} - -AncestorConstIterator::AncestorConstIterator(const QObject& leaf) -{ - m_ancestors.push(&leaf); - QObject* ancestor = leaf.parent(); - while(ancestor) - { - m_ancestors.push(ancestor); - ancestor = ancestor->parent(); - } -} - -} // namespace ObjectTree - -QT_END_NAMESPACE - - - diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h b/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h deleted file mode 100644 index 98bdf14..0000000 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h +++ /dev/null @@ -1,117 +0,0 @@ -/* This file is part of the KDE project. - -Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - -This library is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 2.1 or 3 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library. If not, see . - -*/ - -#ifndef OBJECTTREE_H -#define OBJECTTREE_H - -#include "objectdump_global.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -namespace ObjectTree -{ - -/** - * Depth-first iterator for QObject tree - */ -class OBJECTDUMP_EXPORT DepthFirstConstIterator -{ -public: - DepthFirstConstIterator(); - DepthFirstConstIterator(const QObject& root); - - DepthFirstConstIterator& operator++(); - - inline bool operator==(const DepthFirstConstIterator& other) const - { return other.m_pointee == m_pointee; } - - inline bool operator!=(const DepthFirstConstIterator& other) const - { return other.m_pointee != m_pointee; } - - inline const QObject* operator->() const { return m_pointee; } - inline const QObject& operator*() const { return *m_pointee; } - -private: - void backtrack(); - -private: - const QObject* m_pointee; - QStack m_history; -}; - -/** - * Ancestor iterator for QObject tree - */ -class OBJECTDUMP_EXPORT AncestorConstIterator -{ -public: - AncestorConstIterator(); - AncestorConstIterator(const QObject& root); - - inline AncestorConstIterator& operator++() - { m_ancestors.pop(); return *this; } - - inline bool operator==(const AncestorConstIterator& other) const - { return other.m_ancestors == m_ancestors; } - - inline bool operator!=(const AncestorConstIterator& other) const - { return other.m_ancestors != m_ancestors; } - - inline const QObject* operator->() const { return m_ancestors.top(); } - inline const QObject& operator*() const { return *m_ancestors.top(); } - -private: - QStack m_ancestors; - -}; - -/** - * Generic algorithm for visiting nodes in an object tree. Nodes in the - * tree are visited in a const context, therefore they are not modified - * by this algorithm. - * - * Visitor must provide functions with the following signatures: - * - * Called before visit begins - * void visitPrepare() - * - * Called on each node visited - * void visitNode(const QObject& object) - * - * Called when visit is complete - * void visitComplete() - */ -template -void visit(Iterator begin, Iterator end, Visitor& visitor) -{ - visitor.visitPrepare(); - - for ( ; begin != end; ++begin) - visitor.visitNode(*begin); - - visitor.visitComplete(); -} - -} // namespace ObjectTree - -QT_END_NAMESPACE - -#endif // OBJECTTREE_H diff --git a/src/3rdparty/phonon/mmf/objectdump.cpp b/src/3rdparty/phonon/mmf/objectdump.cpp new file mode 100644 index 0000000..6b6b71e --- /dev/null +++ b/src/3rdparty/phonon/mmf/objectdump.cpp @@ -0,0 +1,529 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef QT_NO_DEBUG + +#include +#include +#include +#include +#include + +#include "objectdump.h" +#include "objecttree.h" + +QT_BEGIN_NAMESPACE + +namespace ObjectDump +{ + +//----------------------------------------------------------------------------- +// QObjectAnnotator +//----------------------------------------------------------------------------- + +QAnnotator::~QAnnotator() +{ + +} + + +//----------------------------------------------------------------------------- +// Annotators +//----------------------------------------------------------------------------- + +QList QAnnotatorBasic::annotation(const QObject& object) +{ + QList result; + + QByteArray array; + QTextStream stream(&array); + + stream << '[' << &object << ']'; + stream << ' '; + stream << object.metaObject()->className(); + + if (object.objectName() != "") + stream << " \"" << object.objectName() << '"'; + + if (object.isWidgetType()) + stream << " isWidget"; + + stream.flush(); + result.append(array); + return result; +} + +QList QAnnotatorWidget::annotation(const QObject& object) +{ + QList result; + + const QWidget* widget = qobject_cast(&object); + if (widget) { + + QByteArray array; + QTextStream stream(&array); + + stream << "widget: "; + + if (widget->isVisible()) + stream << "visible "; + else + stream << "invisible "; + + stream << widget->x() << ',' << widget->y() << ' '; + stream << widget->size().width() << 'x'<< widget->size().height() << ' '; + + stream << "hint " << widget->sizeHint().width() << 'x' << widget->sizeHint().height(); + + stream.flush(); + result.append(array); + } + + return result; +} + + +//----------------------------------------------------------------------------- +// Base class for QDumperPrivate, QVisitorPrivate +//----------------------------------------------------------------------------- + +class QDumperBase +{ +public: + QDumperBase(); + ~QDumperBase(); + + void setPrefix(const QString& prefix); + void addAnnotator(QAnnotator* annotator); + +protected: + QByteArray m_prefix; + QList m_annotators; + +}; + +QDumperBase::QDumperBase() +{ + +} + +QDumperBase::~QDumperBase() +{ + QAnnotator* annotator; + foreach(annotator, m_annotators) + delete annotator; +} + +void QDumperBase::setPrefix(const QString& prefix) +{ + m_prefix = prefix.count() + ? (prefix + " ").toAscii() + : prefix.toAscii(); +} + +void QDumperBase::addAnnotator(QAnnotator* annotator) +{ + // Protect against an exception occurring during QList::append + QScopedPointer holder(annotator); + m_annotators.append(annotator); + holder.take(); +} + + +//----------------------------------------------------------------------------- +// QDumper +//----------------------------------------------------------------------------- + +class QDumperPrivate : public QDumperBase +{ +public: + QDumperPrivate(); + ~QDumperPrivate(); + + void dumpObject(const QObject& object); + +}; + + +QDumperPrivate::QDumperPrivate() +{ + +} + +QDumperPrivate::~QDumperPrivate() +{ + +} + +void QDumperPrivate::dumpObject(const QObject& object) +{ + QAnnotator* annotator; + foreach(annotator, m_annotators) { + + const QList annotations = annotator->annotation(object); + QByteArray annotation; + foreach(annotation, annotations) { + QByteArray buffer(m_prefix); + buffer.append(annotation); + qDebug() << buffer.constData(); + } + } +} + + +QDumper::QDumper() + : d_ptr(new QDumperPrivate) +{ + +} + +QDumper::~QDumper() +{ + +} + +void QDumper::setPrefix(const QString& prefix) +{ + d_func()->setPrefix(prefix); +} + +void QDumper::addAnnotator(QAnnotator* annotator) +{ + d_func()->addAnnotator(annotator); +} + +void QDumper::dumpObject(const QObject& object) +{ + d_func()->dumpObject(object); +} + + +//----------------------------------------------------------------------------- +// QVisitor +//----------------------------------------------------------------------------- + +class QVisitorPrivate : public QDumperBase +{ +public: + QVisitorPrivate(); + ~QVisitorPrivate(); + + void setIndent(unsigned indent); + + void visitNode(const QObject& object); + void visitComplete(); + +private: + class Node + { + public: + Node(); + ~Node(); + + QList m_annotation; + QList m_children; + + typedef QList::const_iterator child_iterator; + }; + +private: + Node* findNode(const QObject* object) const; + QByteArray branchBuffer(const QList& branches, bool isNodeLine, bool isLastChild) const; + void dumpRecursive(const Node& node, QList branches, bool isLastChild); + void dumpNode(const Node& node, const QList& branches, bool isLastChild); + +private: + unsigned m_indent; + + QScopedPointer m_root; + + // Hash table used to associate internal nodes with QObjects + typedef QHash Hash; + Hash m_hash; +}; + +static const unsigned DefaultIndent = 2; + +QVisitorPrivate::QVisitorPrivate() + : m_indent(DefaultIndent) +{ + +} + +QVisitorPrivate::~QVisitorPrivate() +{ + +} + +void QVisitorPrivate::setIndent(unsigned indent) +{ + m_indent = indent; +} + +// Builds up a mirror of the object tree, rooted in m_root, with each node +// storing annotations generated by +void QVisitorPrivate::visitNode(const QObject& object) +{ + QObject* const objectParent = object.parent(); + Node* const nodeParent = objectParent ? findNode(objectParent) : 0; + + // Create a new node and store in scoped pointer for exception safety + Node* node = new Node; + QScopedPointer nodePtr(node); + + // Associate node with QObject + m_hash.insert(&object, node); + + // Insert node into internal tree + if (nodeParent) + { + nodeParent->m_children.append(nodePtr.take()); + } + else + { + Q_ASSERT(m_root.isNull()); + m_root.reset(nodePtr.take()); + } + + // Generate and store annotations + QAnnotator* annotator; + foreach(annotator, m_annotators) + node->m_annotation.append( annotator->annotation(object) ); +} + +void QVisitorPrivate::visitComplete() +{ + QList branches; + static const bool isLastChild = true; + dumpRecursive(*m_root, branches, isLastChild); + m_root.reset(0); +} + +QVisitorPrivate::Node* QVisitorPrivate::findNode(const QObject* object) const +{ + Hash::const_iterator i = m_hash.find(object); + return (m_hash.end() == i) ? 0 : *i; +} + +QByteArray QVisitorPrivate::branchBuffer + (const QList& branches, bool isNodeLine, bool isLastChild) const +{ + const int depth = branches.count(); + + const QByteArray indent(m_indent, ' '); + const QByteArray horiz(m_indent, '-'); + + QByteArray buffer; + QTextStream stream(&buffer); + + for (int i=0; i branches, bool isLastChild) +{ + dumpNode(node, branches, isLastChild); + + // Recurse down tree + const Node::child_iterator begin = node.m_children.begin(); + const Node::child_iterator end = node.m_children.end(); + for (Node::child_iterator i = begin; end != i; ++i) { + + isLastChild = (end == i + 1); + + if (begin == i) + branches.push_back(!isLastChild); + else + branches.back() = !isLastChild; + + static const bool isNodeLine = false; + const QByteArray buffer = branchBuffer(branches, isNodeLine, false); + qDebug() << buffer.constData(); + + dumpRecursive(**i, branches, isLastChild); + } +} + +void QVisitorPrivate::dumpNode + (const Node& node, const QList& branches, bool isLastChild) +{ + const QList::const_iterator + begin = node.m_annotation.begin(), end = node.m_annotation.end(); + + if (begin == end) { + // No annotations - just dump the object pointer + const bool isNodeLine = true; + QByteArray buffer = branchBuffer(branches, isNodeLine, isLastChild); + qDebug() << 0; // TODO + } + else { + // Dump annotations + for (QList::const_iterator i = begin; end != i; ++i) { + const bool isNodeLine = (begin == i); + QByteArray buffer = branchBuffer(branches, isNodeLine, isLastChild); + buffer.append(*i); + qDebug() << buffer.constData(); + } + } +} + + +// QVisitorPrivate::Node + +QVisitorPrivate::Node::Node() +{ + +} + +QVisitorPrivate::Node::~Node() +{ + Node* child; + foreach(child, m_children) + delete child; +} + + +// QVisitor + +QVisitor::QVisitor() + : d_ptr(new QVisitorPrivate) +{ + +} + +QVisitor::~QVisitor() +{ + +} + +void QVisitor::setPrefix(const QString& prefix) +{ + d_func()->setPrefix(prefix); +} + +void QVisitor::setIndent(unsigned indent) +{ + d_func()->setIndent(indent); +} + +void QVisitor::addAnnotator(QAnnotator* annotator) +{ + d_func()->addAnnotator(annotator); +} + +void QVisitor::visitPrepare() +{ + // Do nothing +} + +void QVisitor::visitNode(const QObject& object) +{ + d_func()->visitNode(object); +} + +void QVisitor::visitComplete() +{ + d_func()->visitComplete(); +} + + +//----------------------------------------------------------------------------- +// Utility functions +//----------------------------------------------------------------------------- + +void addDefaultAnnotators_sys(QDumper& visitor); +void addDefaultAnnotators_sys(QVisitor& visitor); + +void addDefaultAnnotators(QDumper& dumper) +{ + dumper.addAnnotator(new QAnnotatorBasic); + dumper.addAnnotator(new QAnnotatorWidget); + + // Add platform-specific annotators + addDefaultAnnotators_sys(dumper); +} + +void addDefaultAnnotators(QVisitor& visitor) +{ + visitor.addAnnotator(new QAnnotatorBasic); + visitor.addAnnotator(new QAnnotatorWidget); + + // Add platform-specific annotators + addDefaultAnnotators_sys(visitor); +} + +void dumpTreeFromRoot(const QObject& root, QVisitor& visitor) +{ + // Set up iteration range + ObjectTree::DepthFirstConstIterator begin(root), end; + + // Invoke generic visitor algorithm + ObjectTree::visit(begin, end, visitor); +} + +void dumpTreeFromLeaf(const QObject& leaf, QVisitor& visitor) +{ + // Walk up to root + const QObject* root = &leaf; + while(root->parent()) + { + root = root->parent(); + } + + dumpTreeFromRoot(*root, visitor); +} + +void dumpAncestors(const QObject& leaf, QVisitor& visitor) +{ + // Set up iteration range + ObjectTree::AncestorConstIterator begin(leaf), end; + + // Invoke generic visitor algorithm + ObjectTree::visit(begin, end, visitor); +} + + +} // namespace ObjectDump + +QT_END_NAMESPACE + +#endif + diff --git a/src/3rdparty/phonon/mmf/objectdump.h b/src/3rdparty/phonon/mmf/objectdump.h new file mode 100644 index 0000000..e94b3ac --- /dev/null +++ b/src/3rdparty/phonon/mmf/objectdump.h @@ -0,0 +1,166 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef OBJECTDUMP_H +#define OBJECTDUMP_H + +#include "objectdump_global.h" + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace ObjectDump +{ + +/** + * Abstract base for annotator classes invoked by QVisitor. + */ +class OBJECTDUMP_EXPORT QAnnotator : public QObject +{ + Q_OBJECT +public: + virtual ~QAnnotator(); + virtual QList annotation(const QObject& object) = 0; +}; + +/** + * Annotator which replicates QObject::dumpObjectTree functionality. + */ +class OBJECTDUMP_EXPORT QAnnotatorBasic : public QAnnotator +{ + Q_OBJECT +public: + QList annotation(const QObject& object); +}; + +/** + * Annotator which returns widget information. + */ +class OBJECTDUMP_EXPORT QAnnotatorWidget : public QAnnotator +{ + Q_OBJECT +public: + QList annotation(const QObject& object); +}; + + +class QDumperPrivate; + +/** + * Class used to dump information about individual QObjects. + */ +class OBJECTDUMP_EXPORT QDumper : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QDumper) + +public: + QDumper(); + ~QDumper(); + + /** + * Specify a prefix, to be printed on each line of output. + */ + void setPrefix(const QString& prefix); + + /** + * Takes ownership of annotator. + */ + void addAnnotator(QAnnotator* annotator); + + /** + * Invoke each annotator on the object and write to debug output. + */ + void dumpObject(const QObject& object); + +private: + QScopedPointer d_ptr; + +}; + + +class QVisitorPrivate; + +/** + * Visitor class which dumps information about nodes in the object tree. + */ +class OBJECTDUMP_EXPORT QVisitor : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QVisitor) + +public: + QVisitor(); + ~QVisitor(); + + /** + * Specify a prefix, to be printed on each line of output. + */ + void setPrefix(const QString& prefix); + + /** + * Set number of spaces by which each level of the tree is indented. + */ + void setIndent(unsigned indent); + + /** + * Called by the visitor algorithm before starting the visit. + */ + void visitPrepare(); + + /** + * Called by the visitor algorithm as each node is visited. + */ + void visitNode(const QObject& object); + + /** + * Called by the visitor algorithm when the visit is complete. + */ + void visitComplete(); + + /** + * Takes ownership of annotator. + */ + void addAnnotator(QAnnotator* annotator); + +private: + QScopedPointer d_ptr; + +}; + + +//----------------------------------------------------------------------------- +// Utility functions +//----------------------------------------------------------------------------- + +void OBJECTDUMP_EXPORT addDefaultAnnotators(QDumper& dumper); +void OBJECTDUMP_EXPORT addDefaultAnnotators(QVisitor& visitor); + +void OBJECTDUMP_EXPORT dumpTreeFromRoot(const QObject& root, QVisitor& visitor); +void OBJECTDUMP_EXPORT dumpTreeFromLeaf(const QObject& leaf, QVisitor& visitor); +void OBJECTDUMP_EXPORT dumpAncestors(const QObject& leaf, QVisitor& visitor); + +} // namespace ObjectDump + +QT_END_NAMESPACE + +#endif diff --git a/src/3rdparty/phonon/mmf/objectdump_global.h b/src/3rdparty/phonon/mmf/objectdump_global.h new file mode 100644 index 0000000..b8987e0 --- /dev/null +++ b/src/3rdparty/phonon/mmf/objectdump_global.h @@ -0,0 +1,30 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef OBJECTDUMP_GLOBAL_H +#define OBJECTDUMP_GLOBAL_H + +#include + +#if defined(OBJECTDUMP_LIBRARY) +# define OBJECTDUMP_EXPORT +#else +# define OBJECTDUMP_EXPORT +#endif + +#endif diff --git a/src/3rdparty/phonon/mmf/objectdump_symbian.cpp b/src/3rdparty/phonon/mmf/objectdump_symbian.cpp new file mode 100644 index 0000000..19355d9 --- /dev/null +++ b/src/3rdparty/phonon/mmf/objectdump_symbian.cpp @@ -0,0 +1,163 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef QT_NO_DEBUG + +#include +#include +#include +#include "objectdump_symbian.h" + +#include // to access QWExtra + +QT_BEGIN_NAMESPACE + +namespace ObjectDump +{ +namespace Symbian +{ + +QList QAnnotatorWidget::annotation(const QObject& object) +{ + QList result; + + const QWidget* widget = qobject_cast(&object); + if (widget) { + + const QWExtra* extra = qt_widget_private(const_cast(widget))->extraData(); + + if (extra) { + + QByteArray array; + QTextStream stream(&array); + + stream << "widget (Symbian): "; + stream << "activated " << extra->activated << ' '; + stream << "disableBlit " << extra->disableBlit << ' '; + + stream.flush(); + result.append(array); + } + } + + return result; +} + +QList QAnnotatorControl::annotation(const QObject& object) +{ + QList result; + + const QWidget* widget = qobject_cast(&object); + if (widget) { + + const CCoeControl* control = widget->effectiveWinId(); + if (control) { + + QByteArray array; + QTextStream stream(&array); + + stream << "control: " << control << ' '; + stream << "parent " << control->Parent() << ' '; + + if (control->IsVisible()) + stream << "visible "; + else + stream << "invisible "; + + stream << control->Position().iX << ',' << control->Position().iY << ' '; + stream << control->Size().iWidth << 'x' << control->Size().iHeight; + + if (control->OwnsWindow()) + stream << " ownsWindow "; + + stream.flush(); + result.append(array); + } + } + + return result; +} + +QList QAnnotatorWindow::annotation(const QObject& object) +{ + QList result; + + const QWidget* widget = qobject_cast(&object); + if (widget) { + + const CCoeControl* control = widget->effectiveWinId(); + RDrawableWindow *window = 0; + + if (control && (window = control->DrawableWindow())) { + + QByteArray array; + QTextStream stream(&array); + + stream << "window: "; + + // Server-side address of CWsWindow object + // This is useful for correlation with the window tree dumped by the window + // server (see RWsSession::LogCommand). + // Cast to a void pointer so that log output is in hexadecimal format. + stream << "srv " << reinterpret_cast(window->WsHandle()) << ' '; + + stream << "group " << window->WindowGroupId() << ' '; + + // Client-side handle to the parent window. + // Cast to a void pointer so that log output is in hexadecimal format. + stream << "parent " << reinterpret_cast(window->Parent()) << ' '; + + stream << window->Position().iX << ',' << window->Position().iY << ' '; + stream << '(' << window->AbsPosition().iX << ',' << window->AbsPosition().iY << ") "; + stream << window->Size().iWidth << 'x' << window->Size().iHeight << ' '; + + const TDisplayMode displayMode = window->DisplayMode(); + stream << "mode " << displayMode << ' '; + + stream << "ord " << window->OrdinalPosition(); + + stream.flush(); + result.append(array); + } + } + + return result; +} + +} // namespace Symbian + +void addDefaultAnnotators_sys(QDumper& dumper) +{ + dumper.addAnnotator(new Symbian::QAnnotatorWidget); + dumper.addAnnotator(new Symbian::QAnnotatorControl); + dumper.addAnnotator(new Symbian::QAnnotatorWindow); +} + +void addDefaultAnnotators_sys(QVisitor& visitor) +{ + visitor.addAnnotator(new Symbian::QAnnotatorWidget); + visitor.addAnnotator(new Symbian::QAnnotatorControl); + visitor.addAnnotator(new Symbian::QAnnotatorWindow); +} + +} // namespace ObjectDump + +QT_END_NAMESPACE + +#endif + diff --git a/src/3rdparty/phonon/mmf/objectdump_symbian.h b/src/3rdparty/phonon/mmf/objectdump_symbian.h new file mode 100644 index 0000000..563c862 --- /dev/null +++ b/src/3rdparty/phonon/mmf/objectdump_symbian.h @@ -0,0 +1,66 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef OBJECTDUMP_SYMBIAN_H +#define OBJECTDUMP_SYMBIAN_H + +#include "objectdump.h" + +QT_BEGIN_NAMESPACE + +namespace ObjectDump +{ +namespace Symbian +{ + +/** + * Annotator which returns Symbian-specific widget information + */ +class QAnnotatorWidget : public QAnnotator +{ + Q_OBJECT +public: + QList annotation(const QObject& object); +}; + +/** + * Annotator which returns control information + */ +class QAnnotatorControl : public QAnnotator +{ + Q_OBJECT +public: + QList annotation(const QObject& object); +}; + +/** + * Annotator which returns window information + */ +class QAnnotatorWindow : public QAnnotator +{ + Q_OBJECT +public: + QList annotation(const QObject& object); +}; + +} // namespace Symbian +} // namespace ObjectDump + +QT_END_NAMESPACE + +#endif diff --git a/src/3rdparty/phonon/mmf/objecttree.cpp b/src/3rdparty/phonon/mmf/objecttree.cpp new file mode 100644 index 0000000..750db22 --- /dev/null +++ b/src/3rdparty/phonon/mmf/objecttree.cpp @@ -0,0 +1,104 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef QT_NO_DEBUG + +#include +#include +#include "objecttree.h" + +QT_BEGIN_NAMESPACE + +namespace ObjectTree +{ + +DepthFirstConstIterator::DepthFirstConstIterator() + : m_pointee(0) +{ + +} + +DepthFirstConstIterator::DepthFirstConstIterator + (const QObject& root) + : m_pointee(&root) +{ + +} + +DepthFirstConstIterator& + DepthFirstConstIterator::operator++() +{ + const QObjectList& children = m_pointee->children(); + + if (children.count() == 0) { + backtrack(); + } + else { + m_history.push(0); + m_pointee = children.first(); + } + + return *this; +} + +void DepthFirstConstIterator::backtrack() +{ + if (m_history.count()) { + const int index = m_history.top(); + m_history.pop(); + + const QObjectList& siblings = m_pointee->parent()->children(); + if (siblings.count() > index + 1) { + m_history.push(index + 1); + m_pointee = siblings[index + 1]; + } + else { + m_pointee = m_pointee->parent(); + backtrack(); + } + } + else { + // Reached end of search + m_pointee = 0; + } +} + + + +AncestorConstIterator::AncestorConstIterator() +{ + +} + +AncestorConstIterator::AncestorConstIterator(const QObject& leaf) +{ + m_ancestors.push(&leaf); + QObject* ancestor = leaf.parent(); + while(ancestor) + { + m_ancestors.push(ancestor); + ancestor = ancestor->parent(); + } +} + +} // namespace ObjectTree + +QT_END_NAMESPACE + +#endif + diff --git a/src/3rdparty/phonon/mmf/objecttree.h b/src/3rdparty/phonon/mmf/objecttree.h new file mode 100644 index 0000000..98bdf14 --- /dev/null +++ b/src/3rdparty/phonon/mmf/objecttree.h @@ -0,0 +1,117 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef OBJECTTREE_H +#define OBJECTTREE_H + +#include "objectdump_global.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +namespace ObjectTree +{ + +/** + * Depth-first iterator for QObject tree + */ +class OBJECTDUMP_EXPORT DepthFirstConstIterator +{ +public: + DepthFirstConstIterator(); + DepthFirstConstIterator(const QObject& root); + + DepthFirstConstIterator& operator++(); + + inline bool operator==(const DepthFirstConstIterator& other) const + { return other.m_pointee == m_pointee; } + + inline bool operator!=(const DepthFirstConstIterator& other) const + { return other.m_pointee != m_pointee; } + + inline const QObject* operator->() const { return m_pointee; } + inline const QObject& operator*() const { return *m_pointee; } + +private: + void backtrack(); + +private: + const QObject* m_pointee; + QStack m_history; +}; + +/** + * Ancestor iterator for QObject tree + */ +class OBJECTDUMP_EXPORT AncestorConstIterator +{ +public: + AncestorConstIterator(); + AncestorConstIterator(const QObject& root); + + inline AncestorConstIterator& operator++() + { m_ancestors.pop(); return *this; } + + inline bool operator==(const AncestorConstIterator& other) const + { return other.m_ancestors == m_ancestors; } + + inline bool operator!=(const AncestorConstIterator& other) const + { return other.m_ancestors != m_ancestors; } + + inline const QObject* operator->() const { return m_ancestors.top(); } + inline const QObject& operator*() const { return *m_ancestors.top(); } + +private: + QStack m_ancestors; + +}; + +/** + * Generic algorithm for visiting nodes in an object tree. Nodes in the + * tree are visited in a const context, therefore they are not modified + * by this algorithm. + * + * Visitor must provide functions with the following signatures: + * + * Called before visit begins + * void visitPrepare() + * + * Called on each node visited + * void visitNode(const QObject& object) + * + * Called when visit is complete + * void visitComplete() + */ +template +void visit(Iterator begin, Iterator end, Visitor& visitor) +{ + visitor.visitPrepare(); + + for ( ; begin != end; ++begin) + visitor.visitNode(*begin); + + visitor.visitComplete(); +} + +} // namespace ObjectTree + +QT_END_NAMESPACE + +#endif // OBJECTTREE_H diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index ff27ea1..8522c06 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -1,4 +1,101 @@ -TEMPLATE = subdirs -SUBDIRS = mmfphonondebug plugin +# MMF Phonon backend + +QT += phonon +TARGET = phonon_mmf +PHONON_MMF_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf + +# Uncomment the following line in order to use the CDrmPlayerUtility client +# API for audio playback, rather than CMdaAudioPlayerUtility. +#CONFIG += phonon_mmf_audio_drm + +phonon_mmf_audio_drm { + LIBS += -lDrmAudioPlayUtility + DEFINES += QT_PHONON_MMF_AUDIO_DRM +} else { + LIBS += -lmediaclientaudio +} + +# This is necessary because both epoc32/include and Phonon contain videoplayer.h. +# By making /epoc32/include the first SYSTEMINCLUDE, we ensure that +# '#include ' picks up the Symbian header, as intended. +PREPEND_INCLUDEPATH = /epoc32/include + +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + +HEADERS += \ + $$PHONON_MMF_DIR/abstractaudioeffect.h \ + $$PHONON_MMF_DIR/abstractmediaplayer.h \ + $$PHONON_MMF_DIR/abstractplayer.h \ + $$PHONON_MMF_DIR/ancestormovemonitor.h \ + $$PHONON_MMF_DIR/audioequalizer.h \ + $$PHONON_MMF_DIR/audiooutput.h \ + $$PHONON_MMF_DIR/audioplayer.h \ + $$PHONON_MMF_DIR/backend.h \ + $$PHONON_MMF_DIR/bassboost.h \ + $$PHONON_MMF_DIR/defs.h \ + $$PHONON_MMF_DIR/dummyplayer.h \ + $$PHONON_MMF_DIR/effectfactory.h \ + $$PHONON_MMF_DIR/mediaobject.h \ + $$PHONON_MMF_DIR/mmf_medianode.h \ + $$PHONON_MMF_DIR/mmf_videoplayer.h \ + $$PHONON_MMF_DIR/objectdump.h \ + $$PHONON_MMF_DIR/objectdump_global.h \ + $$PHONON_MMF_DIR/objecttree.h \ + $$PHONON_MMF_DIR/utils.h \ + $$PHONON_MMF_DIR/videooutput.h \ + $$PHONON_MMF_DIR/videooutputobserver.h \ + $$PHONON_MMF_DIR/videowidget.h \ + $$PHONON_MMF_DIR/volumeobserver.h + +SOURCES += \ + $$PHONON_MMF_DIR/abstractaudioeffect.cpp \ + $$PHONON_MMF_DIR/abstractmediaplayer.cpp \ + $$PHONON_MMF_DIR/abstractplayer.cpp \ + $$PHONON_MMF_DIR/ancestormovemonitor.cpp \ + $$PHONON_MMF_DIR/audioequalizer.cpp \ + $$PHONON_MMF_DIR/audiooutput.cpp \ + $$PHONON_MMF_DIR/audioplayer.cpp \ + $$PHONON_MMF_DIR/backend.cpp \ + $$PHONON_MMF_DIR/bassboost.cpp \ + $$PHONON_MMF_DIR/dummyplayer.cpp \ + $$PHONON_MMF_DIR/effectfactory.cpp \ + $$PHONON_MMF_DIR/mediaobject.cpp \ + $$PHONON_MMF_DIR/mmf_medianode.cpp \ + $$PHONON_MMF_DIR/mmf_videoplayer.cpp \ + $$PHONON_MMF_DIR/objectdump.cpp \ + $$PHONON_MMF_DIR/objecttree.cpp \ + $$PHONON_MMF_DIR/utils.cpp \ + $$PHONON_MMF_DIR/videooutput.cpp \ + $$PHONON_MMF_DIR/videowidget.cpp + +HEADERS += $$PHONON_MMF_DIR/objectdump_symbian.h +SOURCES += $$PHONON_MMF_DIR/objectdump_symbian.cpp + +LIBS += -lcone +LIBS += -lws32 + +# This is only needed for debug builds, but is always linked against. +LIBS += -lhal + +TARGET.CAPABILITY = all -tcb + +LIBS += -lmediaclientvideo # For CVideoPlayerUtility +LIBS += -lcone # For CCoeEnv +LIBS += -lws32 # For RWindow +LIBS += -lefsrv # For file server +LIBS += -lapgrfx -lapmime # For recognizer +LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry + +# These are for effects. +LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect + +# This is needed for having the .qtplugin file properly created on Symbian. +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend + +target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend +INSTALLS += target + +include(../../qpluginbase.pri) + +TARGET.UID3=0x2001E629 -plugin.depends = mmfphonondebug diff --git a/src/plugins/phonon/mmf/mmfphonondebug/mmfphonondebug.pro b/src/plugins/phonon/mmf/mmfphonondebug/mmfphonondebug.pro deleted file mode 100644 index 2cfec15..0000000 --- a/src/plugins/phonon/mmf/mmfphonondebug/mmfphonondebug.pro +++ /dev/null @@ -1,31 +0,0 @@ -TEMPLATE = lib -TARGET = phonon_mmf_debug -OBJECTDUMP_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf/mmfphonondebug - -CONFIG += staticlib - -DEFINES += OBJECTDUMP_LIBRARY - -HEADERS += \ - $$OBJECTDUMP_DIR/objectdump_global.h \ - $$OBJECTDUMP_DIR/objectdump.h \ - $$OBJECTDUMP_DIR/objecttree.h - -SOURCES += \ - $$OBJECTDUMP_DIR/objectdump.cpp \ - $$OBJECTDUMP_DIR/objecttree.cpp - -symbian { - HEADERS += $$OBJECTDUMP_DIR/objectdump_symbian.h - SOURCES += $$OBJECTDUMP_DIR/objectdump_symbian.cpp - - LIBS += -lcone - LIBS += -lws32 - - TARGET.CAPABILITY = all -tcb - -} else { - SOURCES += $$OBJECTDUMP_DIR/objectdump_stub.cpp -} - -TARGET.UID3=0x2001E62A diff --git a/src/plugins/phonon/mmf/plugin/plugin.pro b/src/plugins/phonon/mmf/plugin/plugin.pro deleted file mode 100644 index 8a7de98..0000000 --- a/src/plugins/phonon/mmf/plugin/plugin.pro +++ /dev/null @@ -1,91 +0,0 @@ -# MMF Phonon backend - -QT += phonon -TARGET = phonon_mmf -PHONON_MMF_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf - -# Uncomment the following line in order to use the CDrmPlayerUtility client -# API for audio playback, rather than CMdaAudioPlayerUtility. -#CONFIG += phonon_mmf_audio_drm - -phonon_mmf_audio_drm { - LIBS += -lDrmAudioPlayUtility - DEFINES += QT_PHONON_MMF_AUDIO_DRM -} else { - LIBS += -lmediaclientaudio -} - -# This is necessary because both epoc32/include and Phonon contain videoplayer.h. -# By making /epoc32/include the first SYSTEMINCLUDE, we ensure that -# '#include ' picks up the Symbian header, as intended. -PREPEND_INCLUDEPATH = /epoc32/include - -INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE - -HEADERS += \ - $$PHONON_MMF_DIR/abstractaudioeffect.h \ - $$PHONON_MMF_DIR/abstractmediaplayer.h \ - $$PHONON_MMF_DIR/abstractplayer.h \ - $$PHONON_MMF_DIR/ancestormovemonitor.h \ - $$PHONON_MMF_DIR/audiooutput.h \ - $$PHONON_MMF_DIR/audioequalizer.h \ - $$PHONON_MMF_DIR/audioplayer.h \ - $$PHONON_MMF_DIR/backend.h \ - $$PHONON_MMF_DIR/bassboost.h \ - $$PHONON_MMF_DIR/defs.h \ - $$PHONON_MMF_DIR/dummyplayer.h \ - $$PHONON_MMF_DIR/effectfactory.h \ - $$PHONON_MMF_DIR/mmf_medianode.h \ - $$PHONON_MMF_DIR/mediaobject.h \ - $$PHONON_MMF_DIR/utils.h \ - $$PHONON_MMF_DIR/videooutput.h \ - $$PHONON_MMF_DIR/videooutputobserver.h \ - $$PHONON_MMF_DIR/mmf_videoplayer.h \ - $$PHONON_MMF_DIR/videowidget.h \ - $$PHONON_MMF_DIR/volumeobserver.h - -SOURCES += \ - $$PHONON_MMF_DIR/abstractaudioeffect.cpp \ - $$PHONON_MMF_DIR/abstractmediaplayer.cpp \ - $$PHONON_MMF_DIR/abstractplayer.cpp \ - $$PHONON_MMF_DIR/ancestormovemonitor.cpp \ - $$PHONON_MMF_DIR/audiooutput.cpp \ - $$PHONON_MMF_DIR/audioequalizer.cpp \ - $$PHONON_MMF_DIR/audioplayer.cpp \ - $$PHONON_MMF_DIR/backend.cpp \ - $$PHONON_MMF_DIR/bassboost.cpp \ - $$PHONON_MMF_DIR/dummyplayer.cpp \ - $$PHONON_MMF_DIR/effectfactory.cpp \ - $$PHONON_MMF_DIR/mmf_medianode.cpp \ - $$PHONON_MMF_DIR/mediaobject.cpp \ - $$PHONON_MMF_DIR/utils.cpp \ - $$PHONON_MMF_DIR/videooutput.cpp \ - $$PHONON_MMF_DIR/mmf_videoplayer.cpp \ - $$PHONON_MMF_DIR/videowidget.cpp - -debug { - INCLUDEPATH += $$PHONON_MMF_DIR/mmfphonondebug - LIBS += -lphonon_mmf_debug.lib - LIBS += -lhal -} - -LIBS += -lmediaclientvideo # For CVideoPlayerUtility -LIBS += -lcone # For CCoeEnv -LIBS += -lws32 # For RWindow -LIBS += -lefsrv # For file server -LIBS += -lapgrfx -lapmime # For recognizer -LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry - -# These are for effects. -LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect - -# This is needed for having the .qtplugin file properly created on Symbian. -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend - -target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend -INSTALLS += target - -include(../../../qpluginbase.pri) - -TARGET.UID3=0x2001E629 - -- cgit v0.12 From 869323e1d6e7524050e2240fdc1bedb7b7639444 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 9 Nov 2009 15:09:07 +0000 Subject: Removed infinite recursion from Phonon::MMF::MediaObject::errorType Reviewed-by: Frans Englich --- src/3rdparty/phonon/mmf/abstractplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/mmf/abstractplayer.cpp b/src/3rdparty/phonon/mmf/abstractplayer.cpp index de2722d..d679e54 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractplayer.cpp @@ -134,7 +134,7 @@ void MMF::AbstractPlayer::setError(Phonon::ErrorType error, Phonon::ErrorType MMF::AbstractPlayer::errorType() const { const Phonon::ErrorType result = (ErrorState == m_state) - ? errorType() : NoError; + ? m_error : NoError; return result; } -- cgit v0.12 From 7c8676c35df44404aa30824ae7856408c3c5a629 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 9 Nov 2009 15:09:58 +0000 Subject: Allowed execution of pause command when backend is in error state When qmediaplayer receives a stateChanged(ErrorState) signal, it first displays a dialog, and then calls pause() on the media object. This change allows that pause command to be executed on the underlying MMF client API. Reviewed-by: Frans Englich --- src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index f2efaa0..4d7bc06 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -109,12 +109,12 @@ void MMF::AbstractMediaPlayer::pause() case GroundState: case LoadingState: case PausedState: - case ErrorState: // Do nothing break; case StoppedState: case PlayingState: + case ErrorState: case BufferingState: doPause(); stopTickTimer(); -- cgit v0.12 From dc939f3cf536838ce51620e3450f9be66cb1e32a Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 9 Nov 2009 15:27:20 +0000 Subject: Mediaplayer now pauses playback before displaying error dialog This change improves the user experience - previously, video playback would continue in the background, while the user read the dialog. Then, when the dialog was dismissed, video playback would pause. Reviewed-by: Frans Englich --- demos/qmediaplayer/mediaplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/qmediaplayer/mediaplayer.cpp b/demos/qmediaplayer/mediaplayer.cpp index 624bab7..8a5420f 100644 --- a/demos/qmediaplayer/mediaplayer.cpp +++ b/demos/qmediaplayer/mediaplayer.cpp @@ -355,13 +355,13 @@ void MediaPlayer::stateChanged(Phonon::State newstate, Phonon::State oldstate) switch (newstate) { case Phonon::ErrorState: - QMessageBox::warning(this, "Phonon Mediaplayer", m_MediaObject.errorString(), QMessageBox::Close); if (m_MediaObject.errorType() == Phonon::FatalError) { playButton->setEnabled(false); rewindButton->setEnabled(false); } else { m_MediaObject.pause(); } + QMessageBox::warning(this, "Phonon Mediaplayer", m_MediaObject.errorString(), QMessageBox::Close); break; case Phonon::PausedState: case Phonon::StoppedState: -- cgit v0.12 From adc9b48e227c218593879ee5adb4095f1abb13b5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 9 Nov 2009 15:55:34 +0100 Subject: remove obsolete SETTINGS dependency on TEXTSTREAM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Jørgen Lind --- src/corelib/global/qfeatures.h | 70 +++++++++++++++++++--------------------- src/corelib/global/qfeatures.txt | 2 +- 2 files changed, 35 insertions(+), 37 deletions(-) diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index 77785e8..1c52d4c 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -217,6 +217,9 @@ // Session Manager //#define QT_NO_SESSIONMANAGER +// QSettings +//#define QT_NO_SETTINGS + // QSharedMemory //#define QT_NO_SHAREDMEMORY @@ -352,6 +355,11 @@ #define QT_NO_IMAGEFORMAT_XPM #endif +// QLibrary +#if !defined(QT_NO_LIBRARY) && (defined(QT_NO_SETTINGS)) +#define QT_NO_LIBRARY +#endif + // QMenu #if !defined(QT_NO_MENU) && (defined(QT_NO_ACTION)) #define QT_NO_MENU @@ -367,6 +375,11 @@ #define QT_NO_PHONON_SEEKSLIDER #endif +// Phonon::AbstractMediaStream +#if !defined(QT_NO_PHONON_SETTINGSGROUP) && (defined(QT_NO_SETTINGS)) +#define QT_NO_PHONON_SETTINGSGROUP +#endif + // Phonon::VideoPlayer #if !defined(QT_NO_PHONON_VIDEOPLAYER) && (defined(QT_NO_PHONON_VIDEO)) #define QT_NO_PHONON_VIDEOPLAYER @@ -422,11 +435,6 @@ #define QT_NO_SCROLLBAR #endif -// QSettings -#if !defined(QT_NO_SETTINGS) && (defined(QT_NO_TEXTSTREAM)) -#define QT_NO_SETTINGS -#endif - // SOCKS5 #if !defined(QT_NO_SOCKS5) && (defined(QT_NO_NETWORKPROXY)) #define QT_NO_SOCKS5 @@ -507,14 +515,14 @@ #define QT_NO_HTTP #endif -// QLibrary -#if !defined(QT_NO_LIBRARY) && (defined(QT_NO_SETTINGS)) -#define QT_NO_LIBRARY +// QInputContext +#if !defined(QT_NO_IM) && (defined(QT_NO_LIBRARY)) +#define QT_NO_IM #endif -// Phonon::AbstractMediaStream -#if !defined(QT_NO_PHONON_SETTINGSGROUP) && (defined(QT_NO_SETTINGS)) -#define QT_NO_PHONON_SETTINGSGROUP +// Phonon::PlatformPlugin +#if !defined(QT_NO_PHONON_PLATFORMPLUGIN) && (defined(QT_NO_LIBRARY)) +#define QT_NO_PHONON_PLATFORMPLUGIN #endif // QScrollArea @@ -562,21 +570,11 @@ #define QT_NO_GRAPHICSVIEW #endif -// QInputContext -#if !defined(QT_NO_IM) && (defined(QT_NO_LIBRARY)) -#define QT_NO_IM -#endif - // QMdiArea #if !defined(QT_NO_MDIAREA) && (defined(QT_NO_SCROLLAREA)) #define QT_NO_MDIAREA #endif -// Phonon::PlatformPlugin -#if !defined(QT_NO_PHONON_PLATFORMPLUGIN) && (defined(QT_NO_LIBRARY)) -#define QT_NO_PHONON_PLATFORMPLUGIN -#endif - // Phonon::VolumeSlider #if !defined(QT_NO_PHONON_VOLUMESLIDER) && (defined(QT_NO_SLIDER) || defined(QT_NO_TOOLBUTTON)) #define QT_NO_PHONON_VOLUMESLIDER @@ -587,6 +585,11 @@ #define QT_NO_PRINTER #endif +// QWSInputMethod +#if !defined(QT_NO_QWS_INPUTMETHODS) && (defined(QT_NO_IM)) +#define QT_NO_QWS_INPUTMETHODS +#endif + // QSpinBox #if !defined(QT_NO_SPINBOX) && (defined(QT_NO_SPINWIDGET) || defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR)) #define QT_NO_SPINBOX @@ -627,6 +630,11 @@ #define QT_NO_TABDIALOG #endif +// QTextCodecPlugin +#if !defined(QT_NO_TEXTCODECPLUGIN) && (defined(QT_NO_TEXTCODEC) || defined(QT_NO_LIBRARY)) +#define QT_NO_TEXTCODECPLUGIN +#endif + // QColorDialog #if !defined(QT_NO_COLORDIALOG) && (defined(QT_NO_SPINBOX)) #define QT_NO_COLORDIALOG @@ -647,11 +655,6 @@ #define QT_NO_MENUBAR #endif -// QWSInputMethod -#if !defined(QT_NO_QWS_INPUTMETHODS) && (defined(QT_NO_IM)) -#define QT_NO_QWS_INPUTMETHODS -#endif - // Sound Server #if !defined(QT_NO_QWS_SOUNDSERVER) && (defined(QT_NO_SOUND) || defined(QT_NO_HOSTINFO) || defined(QT_NO_QWS_MULTIPROCESS)) #define QT_NO_QWS_SOUNDSERVER @@ -672,11 +675,6 @@ #define QT_NO_TABWIDGET #endif -// QTextCodecPlugin -#if !defined(QT_NO_TEXTCODECPLUGIN) && (defined(QT_NO_TEXTCODEC) || defined(QT_NO_LIBRARY)) -#define QT_NO_TEXTCODECPLUGIN -#endif - // QTextEdit #if !defined(QT_NO_TEXTEDIT) && (defined(QT_NO_SCROLLAREA) || defined(QT_NO_PROPERTIES)) #define QT_NO_TEXTEDIT @@ -757,6 +755,11 @@ #define QT_NO_COMPLETER #endif +// Common UNIX Printing System +#if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) +#define QT_NO_CUPS +#endif + // QDataWidgetMapper #if !defined(QT_NO_DATAWIDGETMAPPER) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_PROPERTIES)) #define QT_NO_DATAWIDGETMAPPER @@ -787,11 +790,6 @@ #define QT_NO_TREEWIDGET #endif -// Common UNIX Printing System -#if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) -#define QT_NO_CUPS -#endif - // QDirModel #if !defined(QT_NO_DIRMODEL) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_FILESYSTEMMODEL)) #define QT_NO_DIRMODEL diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index ec4945f..251391e 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -216,7 +216,7 @@ SeeAlso: ??? Feature: SETTINGS Description: Supports persistent application settings. Section: File I/O -Requires: TEXTSTREAM +Requires: Name: QSettings SeeAlso: ??? -- cgit v0.12 From 87c019c75d12c19f5643d55d26f6cbcaf0852082 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 9 Nov 2009 16:38:29 +0100 Subject: don't use qApp->arguments() preparation work for bootstrapping --- tools/linguist/lrelease/main.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/tools/linguist/lrelease/main.cpp b/tools/linguist/lrelease/main.cpp index 742c2e6..c88c909 100644 --- a/tools/linguist/lrelease/main.cpp +++ b/tools/linguist/lrelease/main.cpp @@ -158,7 +158,6 @@ static bool releaseTsFile(const QString& tsFileName, int main(int argc, char **argv) { QCoreApplication app(argc, argv); - QStringList args = app.arguments(); QTranslator translator; if (translator.load(QLatin1String("lrelease_") + QLocale::system().name())) app.installTranslator(&translator); @@ -171,50 +170,50 @@ int main(int argc, char **argv) QString outputFile; for (int i = 1; i < argc; ++i) { - if (args[i] == QLatin1String("-compress")) { + if (!strcmp(argv[i], "-compress")) { cd.m_saveMode = SaveStripped; continue; - } else if (args[i] == QLatin1String("-idbased")) { + } else if (!strcmp(argv[i], "-idbased")) { cd.m_idBased = true; continue; - } else if (args[i] == QLatin1String("-nocompress")) { + } else if (!strcmp(argv[i], "-nocompress")) { cd.m_saveMode = SaveEverything; continue; - } else if (args[i] == QLatin1String("-removeidentical")) { + } else if (!strcmp(argv[i], "-removeidentical")) { removeIdentical = true; continue; - } else if (args[i] == QLatin1String("-nounfinished")) { + } else if (!strcmp(argv[i], "-nounfinished")) { cd.m_ignoreUnfinished = true; continue; - } else if (args[i] == QLatin1String("-markuntranslated")) { + } else if (!strcmp(argv[i], "-markuntranslated")) { if (i == argc - 1) { printUsage(); return 1; } - cd.m_unTrPrefix = args[++i]; - } else if (args[i] == QLatin1String("-silent")) { + cd.m_unTrPrefix = QString::fromLocal8Bit(argv[++i]); + } else if (!strcmp(argv[i], "-silent")) { cd.m_verbose = false; continue; - } else if (args[i] == QLatin1String("-verbose")) { + } else if (!strcmp(argv[i], "-verbose")) { cd.m_verbose = true; continue; - } else if (args[i] == QLatin1String("-version")) { + } else if (!strcmp(argv[i], "-version")) { printOut(QCoreApplication::tr( "lrelease version %1\n").arg(QLatin1String(QT_VERSION_STR)) ); return 0; - } else if (args[i] == QLatin1String("-qm")) { + } else if (!strcmp(argv[i], "-qm")) { if (i == argc - 1) { printUsage(); return 1; } - outputFile = args[++i]; - } else if (args[i] == QLatin1String("-help")) { + outputFile = QString::fromLocal8Bit(argv[++i]); + } else if (!strcmp(argv[i], "-help")) { printUsage(); return 0; - } else if (args[i].startsWith(QLatin1Char('-'))) { + } else if (argv[i][0] == '-') { printUsage(); return 1; } else { - inputFiles << args[i]; + inputFiles << QString::fromLocal8Bit(argv[i]); } } -- cgit v0.12 From 006b41c8dd76d6ee33af5459339742fcae2b680f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 9 Nov 2009 16:57:09 +0100 Subject: build lrelease bootstrapped needed for build-time qm generation in qt itself. the downsides are a) that the other bootstrapped tools grow by ~12kB (on x86) due to qdatastream being pulled in by qbytearray and qstring and b) that lrelease isn't l10n'd itself anymore (the latter could be fixed by building a non-qobject qtranslator). --- configure | 2 +- src/corelib/global/qlibraryinfo.cpp | 12 +++-- src/corelib/io/qdatastream.cpp | 2 +- src/corelib/io/qdatastream.h | 2 +- src/corelib/io/qdatastream_p.h | 2 +- src/corelib/tools/qbytearray.cpp | 4 +- src/corelib/tools/qbytearray.h | 2 +- src/corelib/tools/qstring.cpp | 2 +- src/corelib/tools/qstring.h | 2 +- src/tools/bootstrap/bootstrap.pri | 2 +- src/tools/bootstrap/bootstrap.pro | 8 ++- tools/configure/configureapp.cpp | 3 +- tools/linguist/lrelease/lrelease.pro | 11 +--- tools/linguist/lrelease/main.cpp | 96 +++++++++++++++++++++++++++++++++- tools/linguist/shared/proparserutils.h | 25 +++++++++ tools/linguist/shared/qm.cpp | 2 + tools/linguist/shared/translator.cpp | 10 ++++ tools/linguist/shared/translator.h | 12 +++++ 18 files changed, 170 insertions(+), 29 deletions(-) diff --git a/configure b/configure index aab520e..e5bc013 100755 --- a/configure +++ b/configure @@ -7688,7 +7688,7 @@ for file in .projects .projects.3; do *s60main/s60main.pro) continue ;; *examples/activeqt/*) continue ;; */qmake/qmake.pro) continue ;; - *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*) SPEC=$QMAKESPEC ;; + *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*|*linguist/lrelease*) SPEC=$QMAKESPEC ;; *) SPEC=$XQMAKESPEC ;; esac dir=`dirname "$a" | sed -e "s;$sepath;.;g"` diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 15325ae..77a86bb 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -46,7 +46,11 @@ #include "qlibraryinfo.h" #include "qscopedpointer.h" -#ifdef QT_BUILD_QMAKE +#if defined(QT_BUILD_QMAKE) || defined(QT_BOOTSTRAPPED) +# define BOOTSTRAPPING +#endif + +#ifdef BOOTSTRAPPING QT_BEGIN_NAMESPACE extern QString qmake_libraryInfoFile(); QT_END_NAMESPACE @@ -91,7 +95,7 @@ public: QLibrarySettings::QLibrarySettings() : settings(QLibraryInfoPrivate::findConfiguration()) { -#ifndef QT_BUILD_QMAKE +#ifndef BOOTSTRAPPING qAddPostRoutine(QLibraryInfoPrivate::cleanup); #endif } @@ -99,7 +103,7 @@ QLibrarySettings::QLibrarySettings() QSettings *QLibraryInfoPrivate::findConfiguration() { QString qtconfig = QLatin1String(":/qt/etc/qt.conf"); -#ifdef QT_BUILD_QMAKE +#ifdef BOOTSTRAPPING if(!QFile::exists(qtconfig)) qtconfig = qmake_libraryInfoFile(); #else @@ -425,7 +429,7 @@ QLibraryInfo::location(LibraryLocation loc) if (QDir::isRelativePath(ret)) { if (loc == PrefixPath) { // we make the prefix path absolute to the executable's directory -#ifdef QT_BUILD_QMAKE +#ifdef BOOTSTRAPPING return QFileInfo(qmake_libraryInfoFile()).absolutePath(); #else if (QCoreApplication::instance()) { diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 19e86a6..b10d603 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -42,7 +42,7 @@ #include "qdatastream.h" #include "qdatastream_p.h"