2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-06-28 15:51:20 +02:00
|
|
|
**
|
2013-01-28 17:12:19 +01:00
|
|
|
** Copyright (C) 2013 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,
|
|
|
|
|
|
|
|
|
|
MaximumMessage
|
|
|
|
|
};
|
|
|
|
|
|
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:
|
|
|
|
|
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 );
|
2012-05-02 17:53:50 +02:00
|
|
|
void range(int type, int bindingType, qint64 startTime, qint64 length,
|
2012-04-18 12:06:10 +02:00
|
|
|
const QStringList &data, const QmlDebug::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:
|
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
|