source: trunk/src/3rdparty/phonon/mmf/objectdump_symbian.cpp

Last change on this file was 561, checked in by Dmitry A. Kuminov, 16 years ago

trunk: Merged in qt 4.6.1 sources.

  • Property svn:eol-style set to native
File size: 4.7 KB
Line 
1/* This file is part of the KDE project.
2
3Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4
5This library is free software: you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation, either version 2.1 or 3 of the License.
8
9This library is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU Lesser General Public License for more details.
13
14You should have received a copy of the GNU Lesser General Public License
15along with this library. If not, see <http://www.gnu.org/licenses/>.
16
17*/
18
19#include <QTextStream>
20#include <QWidget>
21#include <coecntrl.h>
22#include "objectdump_symbian.h"
23
24#include <QtGui/private/qwidget_p.h> // to access QWExtra
25
26QT_BEGIN_NAMESPACE
27
28namespace ObjectDump
29{
30namespace Symbian
31{
32
33QList<QByteArray> QAnnotatorWidget::annotation(const QObject& object)
34{
35 QList<QByteArray> result;
36
37 const QWidget* widget = qobject_cast<const QWidget*>(&object);
38 if (widget) {
39
40 const QWExtra* extra = qt_widget_private(const_cast<QWidget *>(widget))->extraData();
41
42 if (extra) {
43
44 QByteArray array;
45 QTextStream stream(&array);
46
47 stream << "widget (Symbian): ";
48 stream << "activated " << extra->activated << ' ';
49 stream << "nativePaintMode " << extra->nativePaintMode << ' ';
50
51 stream.flush();
52 result.append(array);
53 }
54 }
55
56 return result;
57}
58
59QList<QByteArray> QAnnotatorControl::annotation(const QObject& object)
60{
61 QList<QByteArray> result;
62
63 const QWidget* widget = qobject_cast<const QWidget*>(&object);
64 if (widget) {
65
66 const CCoeControl* control = widget->effectiveWinId();
67 if (control) {
68
69 QByteArray array;
70 QTextStream stream(&array);
71
72 stream << "control: " << control << ' ';
73 stream << "parent " << control->Parent() << ' ';
74
75 if (control->IsVisible())
76 stream << "visible ";
77 else
78 stream << "invisible ";
79
80 stream << control->Position().iX << ',' << control->Position().iY << ' ';
81 stream << control->Size().iWidth << 'x' << control->Size().iHeight;
82
83 if (control->OwnsWindow())
84 stream << " ownsWindow ";
85
86 stream.flush();
87 result.append(array);
88 }
89 }
90
91 return result;
92}
93
94QList<QByteArray> QAnnotatorWindow::annotation(const QObject& object)
95{
96 QList<QByteArray> result;
97
98 const QWidget* widget = qobject_cast<const QWidget*>(&object);
99 if (widget) {
100
101 const CCoeControl* control = widget->effectiveWinId();
102
103 if (control) {
104 RDrawableWindow *const window = control->DrawableWindow();
105 if(window) {
106 QByteArray array;
107 QTextStream stream(&array);
108
109 stream << "window: ";
110
111 // Server-side address of CWsWindow object
112 // This is useful for correlation with the window tree dumped by the window
113 // server (see RWsSession::LogCommand).
114 // Cast to a void pointer so that log output is in hexadecimal format.
115 stream << "srv " << reinterpret_cast<const void*>(window->WsHandle()) << ' ';
116
117 stream << "group " << window->WindowGroupId() << ' ';
118
119 // Client-side handle to the parent window.
120 // Cast to a void pointer so that log output is in hexadecimal format.
121 stream << "parent " << reinterpret_cast<const void*>(window->Parent()) << ' ';
122
123 stream << window->Position().iX << ',' << window->Position().iY << ' ';
124 stream << '(' << window->AbsPosition().iX << ',' << window->AbsPosition().iY << ") ";
125 stream << window->Size().iWidth << 'x' << window->Size().iHeight << ' ';
126
127 const TDisplayMode displayMode = window->DisplayMode();
128 stream << "mode " << displayMode << ' ';
129
130 stream << "ord " << window->OrdinalPosition();
131
132 stream.flush();
133 result.append(array);
134 }
135 }
136 }
137
138 return result;
139}
140
141} // namespace Symbian
142
143void addDefaultAnnotators_sys(QDumper& dumper)
144{
145 dumper.addAnnotator(new Symbian::QAnnotatorWidget);
146 dumper.addAnnotator(new Symbian::QAnnotatorControl);
147 dumper.addAnnotator(new Symbian::QAnnotatorWindow);
148}
149
150void addDefaultAnnotators_sys(QVisitor& visitor)
151{
152 visitor.addAnnotator(new Symbian::QAnnotatorWidget);
153 visitor.addAnnotator(new Symbian::QAnnotatorControl);
154 visitor.addAnnotator(new Symbian::QAnnotatorWindow);
155}
156
157} // namespace ObjectDump
158
159QT_END_NAMESPACE
160
Note: See TracBrowser for help on using the repository browser.