2012-06-29 14:21:22 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2012 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef SKINSPECTORWIDGET_H_
|
|
|
|
#define SKINSPECTORWIDGET_H_
|
|
|
|
|
2012-07-03 16:05:59 +00:00
|
|
|
#include "SkMatrix.h"
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
#include <QWidget>
|
|
|
|
#include <QTabWidget>
|
|
|
|
#include <QTextEdit>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QLineEdit>
|
2015-01-02 14:35:43 +00:00
|
|
|
#include <QGroupBox>
|
|
|
|
#include <QGridLayout>
|
2012-06-29 14:21:22 +00:00
|
|
|
|
|
|
|
/** \class SkInspectorWidget
|
|
|
|
|
|
|
|
The InspectorWidget contains the overview and details tab. These contain
|
|
|
|
information about the whole picture and details about each draw command.
|
|
|
|
*/
|
|
|
|
class SkInspectorWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2012-08-14 19:34:13 +00:00
|
|
|
enum TabType {
|
|
|
|
kOverview_TabType,
|
|
|
|
kDetail_TabType,
|
2014-05-19 13:53:10 +00:00
|
|
|
kClipStack_TabType,
|
2012-08-14 19:34:13 +00:00
|
|
|
kTotalTabCount,
|
|
|
|
};
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/**
|
|
|
|
Constructs a widget with the specified parent for layout purposes.
|
|
|
|
@param parent The parent container of this widget
|
|
|
|
*/
|
2012-07-31 12:49:52 +00:00
|
|
|
SkInspectorWidget();
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2012-07-03 16:05:59 +00:00
|
|
|
void setDisabled(bool isDisabled) {
|
|
|
|
fMatrixAndClipWidget.setDisabled(isDisabled);
|
|
|
|
}
|
2012-06-29 14:21:22 +00:00
|
|
|
|
|
|
|
/**
|
2012-08-14 19:34:13 +00:00
|
|
|
Sets the text in tab at the specified index.
|
2012-06-29 14:21:22 +00:00
|
|
|
@param text
|
|
|
|
*/
|
2012-08-14 19:34:13 +00:00
|
|
|
void setText(QString text, TabType type);
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2012-07-03 16:05:59 +00:00
|
|
|
/**
|
|
|
|
Sets the text in the current matrix.
|
|
|
|
@param matrixValues
|
|
|
|
*/
|
|
|
|
void setMatrix(const SkMatrix& matrix);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the text in the current clip.
|
|
|
|
@param clipValues
|
|
|
|
*/
|
|
|
|
void setClip(const SkIRect& clip);
|
|
|
|
|
2012-08-14 19:34:13 +00:00
|
|
|
class Tab : public QWidget {
|
|
|
|
QWidget fTab;
|
|
|
|
QHBoxLayout fTabLayout;
|
|
|
|
QTextEdit fTabText;
|
|
|
|
QString fName;
|
|
|
|
|
|
|
|
Tab(const char* name) {
|
|
|
|
fTabText.setReadOnly(true);
|
|
|
|
fTabLayout.addWidget(&fTabText);
|
|
|
|
fTab.setLayout(&fTabLayout);
|
|
|
|
fName = QString(name);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2012-07-03 16:05:59 +00:00
|
|
|
QHBoxLayout fHorizontalLayout;
|
|
|
|
QTabWidget fTabWidget;
|
|
|
|
|
2012-08-14 19:34:13 +00:00
|
|
|
QWidget fTabs[kTotalTabCount];
|
|
|
|
QHBoxLayout fTabLayouts[kTotalTabCount];
|
|
|
|
QTextEdit fTabTexts[kTotalTabCount];
|
2012-07-03 16:05:59 +00:00
|
|
|
|
2015-01-02 14:35:43 +00:00
|
|
|
QFrame fMatrixAndClipWidget;
|
2012-07-03 16:05:59 +00:00
|
|
|
QVBoxLayout fVerticalLayout;
|
|
|
|
|
2015-01-02 14:35:43 +00:00
|
|
|
QGroupBox fMatrixGroup;
|
|
|
|
QGridLayout fMatrixLayout;
|
2012-07-03 16:05:59 +00:00
|
|
|
QLineEdit fMatrixEntry[9];
|
|
|
|
|
2015-01-02 14:35:43 +00:00
|
|
|
QGroupBox fClipGroup;
|
|
|
|
QGridLayout fClipLayout;
|
2012-07-03 16:05:59 +00:00
|
|
|
QLineEdit fClipEntry[4];
|
|
|
|
|
2015-01-02 14:35:43 +00:00
|
|
|
void setupMatrix();
|
|
|
|
void setupClip();
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|