2011-06-28 15:51:20 +02:00
|
|
|
/**************************************************************************
|
|
|
|
**
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
2011-11-02 15:59:12 +01:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
|
|
|
**
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
**
|
2011-07-06 15:48:52 +00:00
|
|
|
** 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
|
|
|
**
|
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-07-06 15:48:52 +00:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2011-06-28 15:51:20 +02:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
2011-07-06 15:48:52 +00:00
|
|
|
** Other Usage
|
|
|
|
**
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
**
|
2011-06-28 15:51:20 +02:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-11-02 15:59:12 +01:00
|
|
|
** Nokia at qt-info@nokia.com.
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QMLPROFILERTRACECLIENT_H
|
|
|
|
#define QMLPROFILERTRACECLIENT_H
|
|
|
|
|
2011-08-05 11:12:27 +02:00
|
|
|
#include "qdeclarativedebugclient.h"
|
|
|
|
#include "qmlprofilereventtypes.h"
|
2012-01-12 16:36:40 +01:00
|
|
|
#include "qmlprofilereventlocation.h"
|
2011-08-05 11:12:27 +02:00
|
|
|
#include "qmljsdebugclient_global.h"
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QStack>
|
|
|
|
#include <QStringList>
|
2011-06-28 15:51:20 +02:00
|
|
|
|
2011-08-05 11:12:27 +02:00
|
|
|
namespace QmlJsDebugClient {
|
2011-06-28 15:51:20 +02:00
|
|
|
|
2011-08-05 11:12:27 +02:00
|
|
|
class QMLJSDEBUGCLIENT_EXPORT QmlProfilerTraceClient : public QmlJsDebugClient::QDeclarativeDebugClient
|
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:
|
2011-08-05 12:58:43 +02:00
|
|
|
QmlProfilerTraceClient(QDeclarativeDebugConnection *client);
|
|
|
|
~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,
|
|
|
|
|
|
|
|
MaximumMessage
|
|
|
|
};
|
|
|
|
|
2011-11-10 17:08:07 +01:00
|
|
|
bool isEnabled() const;
|
2011-08-05 12:58:43 +02:00
|
|
|
bool isRecording() const;
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void setRecording(bool);
|
2012-02-13 15:26:57 +01:00
|
|
|
void setRecordingFromServer(bool);
|
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:
|
|
|
|
void complete();
|
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 );
|
2011-07-26 13:56:14 +02:00
|
|
|
void range(int type, qint64 startTime, qint64 length,
|
2012-01-12 16:36:40 +01:00
|
|
|
const QStringList &data, const QmlJsDebugClient::QmlEventLocation &location);
|
2011-12-14 16:44:33 +01:00
|
|
|
void frame(qint64 time, int frameRate, int animationCount);
|
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:
|
|
|
|
virtual void statusChanged(Status);
|
|
|
|
virtual void messageReceived(const QByteArray &);
|
|
|
|
|
|
|
|
private:
|
2011-08-05 12:58:43 +02:00
|
|
|
class QmlProfilerTraceClientPrivate *d;
|
2011-06-28 15:51:20 +02:00
|
|
|
};
|
|
|
|
|
2011-08-05 11:12:27 +02:00
|
|
|
} // namespace QmlJsDebugClient
|
2011-06-28 15:51:20 +02:00
|
|
|
|
|
|
|
#endif // QMLPROFILERTRACECLIENT_H
|