2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2011-06-28 15:51:20 +02:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
#ifndef QMLPROFILERTRACECLIENT_H
|
|
|
|
#define QMLPROFILERTRACECLIENT_H
|
|
|
|
|
2012-04-18 12:06:10 +02:00
|
|
|
#include "qmldebugclient.h"
|
2011-08-05 11:12:27 +02:00
|
|
|
#include "qmlprofilereventtypes.h"
|
2012-01-12 16:36:40 +01:00
|
|
|
#include "qmlprofilereventlocation.h"
|
2012-04-18 12:06:10 +02:00
|
|
|
#include "qmldebug_global.h"
|
2011-08-05 11:12:27 +02:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QStack>
|
|
|
|
#include <QStringList>
|
2011-06-28 15:51:20 +02:00
|
|
|
|
2012-04-18 12:06:10 +02:00
|
|
|
namespace QmlDebug {
|
2011-06-28 15:51:20 +02:00
|
|
|
|
2012-04-18 12:06:10 +02:00
|
|
|
class QMLDEBUG_EXPORT QmlProfilerTraceClient : public QmlDebug::QmlDebugClient
|
2011-06-28 15:51:20 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2011-11-28 16:30:30 +01:00
|
|
|
Q_PROPERTY(bool enabled READ isEnabled NOTIFY enabledChanged)
|
2011-06-28 15:51:20 +02:00
|
|
|
Q_PROPERTY(bool recording READ isRecording WRITE setRecording NOTIFY recordingChanged)
|
|
|
|
|
2011-07-28 10:51:51 +02:00
|
|
|
// don't hide by signal
|
|
|
|
using QObject::event;
|
|
|
|
|
2011-06-28 15:51:20 +02:00
|
|
|
public:
|
2012-04-18 12:06:10 +02:00
|
|
|
QmlProfilerTraceClient(QmlDebugConnection *client);
|
2011-08-05 12:58:43 +02:00
|
|
|
~QmlProfilerTraceClient();
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
enum EventType {
|
|
|
|
FramePaint,
|
|
|
|
Mouse,
|
|
|
|
Key,
|
2011-09-22 16:58:59 +02:00
|
|
|
AnimationFrame,
|
|
|
|
EndTrace,
|
2011-11-02 16:57:31 +01:00
|
|
|
StartTrace,
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
MaximumEventType
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Message {
|
|
|
|
Event,
|
|
|
|
RangeStart,
|
|
|
|
RangeData,
|
|
|
|
RangeLocation,
|
|
|
|
RangeEnd,
|
|
|
|
Complete,
|
2013-08-08 13:28:08 +02:00
|
|
|
PixmapCacheEvent,
|
|
|
|
SceneGraphFrame,
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
MaximumMessage
|
|
|
|
};
|
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
enum PixmapEventType {
|
|
|
|
PixmapSizeKnown,
|
|
|
|
PixmapReferenceCountChanged,
|
|
|
|
PixmapCacheCountChanged,
|
|
|
|
PixmapLoadingStarted,
|
|
|
|
PixmapLoadingFinished,
|
|
|
|
PixmapLoadingError,
|
|
|
|
|
|
|
|
MaximumPixmapEventType
|
|
|
|
};
|
|
|
|
|
2011-11-10 17:08:07 +01:00
|
|
|
bool isEnabled() const;
|
2011-08-05 12:58:43 +02:00
|
|
|
bool isRecording() const;
|
2012-02-24 10:47:17 +01:00
|
|
|
void setRecording(bool);
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
public slots:
|
2011-08-05 12:58:43 +02:00
|
|
|
void clearData();
|
2011-11-15 15:04:25 +01:00
|
|
|
void sendRecordingStatus();
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
signals:
|
2014-04-03 12:33:14 +02:00
|
|
|
void complete(qint64 maximumTime);
|
2011-08-05 12:58:43 +02:00
|
|
|
void gap(qint64 time);
|
2011-06-28 15:51:20 +02:00
|
|
|
void event(int event, qint64 time);
|
2011-09-22 16:58:59 +02:00
|
|
|
void traceFinished( qint64 time );
|
2011-11-02 16:57:31 +01:00
|
|
|
void traceStarted( qint64 time );
|
2013-08-08 13:28:08 +02:00
|
|
|
void rangedEvent(int type, int bindingType, qint64 startTime, qint64 length,
|
|
|
|
const QStringList &data, const QmlDebug::QmlEventLocation &location,
|
|
|
|
qint64 param1, qint64 param2, qint64 param3, qint64 param4, qint64 param5);
|
2011-06-28 15:51:20 +02:00
|
|
|
void recordingChanged(bool arg);
|
|
|
|
|
2011-11-28 16:30:30 +01:00
|
|
|
void enabledChanged();
|
2011-08-05 12:58:43 +02:00
|
|
|
void cleared();
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
protected:
|
2012-05-10 10:29:11 +02:00
|
|
|
virtual void statusChanged(ClientStatus status);
|
2011-06-28 15:51:20 +02:00
|
|
|
virtual void messageReceived(const QByteArray &);
|
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
private:
|
|
|
|
void setRecordingFromServer(bool);
|
|
|
|
|
2011-06-28 15:51:20 +02:00
|
|
|
private:
|
2011-08-05 12:58:43 +02:00
|
|
|
class QmlProfilerTraceClientPrivate *d;
|
2011-06-28 15:51:20 +02:00
|
|
|
};
|
|
|
|
|
2012-04-18 12:06:10 +02:00
|
|
|
} // namespace QmlDebug
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
#endif // QMLPROFILERTRACECLIENT_H
|