blob: 3e761043f89acf3ddc9d4d60e0e461de256a87b4 [file] [log] [blame]
chudy@google.com902ebe52012-06-29 14:21:22 +00001
2/*
3 * Copyright 2012 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10#ifndef SKINSPECTORWIDGET_H_
11#define SKINSPECTORWIDGET_H_
12
chudy@google.com2f891792012-07-03 16:05:59 +000013#include "SkMatrix.h"
14
chudy@google.com902ebe52012-06-29 14:21:22 +000015#include <QWidget>
16#include <QTabWidget>
17#include <QTextEdit>
18#include <QHBoxLayout>
19#include <QLabel>
20#include <QLineEdit>
21
22/** \class SkInspectorWidget
23
24 The InspectorWidget contains the overview and details tab. These contain
25 information about the whole picture and details about each draw command.
26 */
27class SkInspectorWidget : public QWidget {
28 Q_OBJECT
29
30public:
31 /**
32 Constructs a widget with the specified parent for layout purposes.
33 @param parent The parent container of this widget
34 */
35 SkInspectorWidget(QWidget *parent = NULL);
36
37 ~SkInspectorWidget();
38
chudy@google.com2f891792012-07-03 16:05:59 +000039 void setDisabled(bool isDisabled) {
40 fMatrixAndClipWidget.setDisabled(isDisabled);
41 }
chudy@google.com902ebe52012-06-29 14:21:22 +000042 /**
43 Sets the text in the detail tab.
44 @param text
45 */
46 void setDetailText(QString text);
47
48 /**
49 Sets the text in the overview tab.
50 @param text
51 */
52 void setOverviewText(QString text);
53
chudy@google.com2f891792012-07-03 16:05:59 +000054 /**
55 Sets the text in the current matrix.
56 @param matrixValues
57 */
58 void setMatrix(const SkMatrix& matrix);
59
60 /**
61 Sets the text in the current clip.
62 @param clipValues
63 */
64 void setClip(const SkIRect& clip);
65
chudy@google.com902ebe52012-06-29 14:21:22 +000066private:
chudy@google.com2f891792012-07-03 16:05:59 +000067 QHBoxLayout fHorizontalLayout;
68 QTabWidget fTabWidget;
chudy@google.com902ebe52012-06-29 14:21:22 +000069
chudy@google.com2f891792012-07-03 16:05:59 +000070 QWidget fOverviewTab;
71 QHBoxLayout fOverviewLayout;
72 QTextEdit fOverviewText;
chudy@google.com902ebe52012-06-29 14:21:22 +000073
chudy@google.com2f891792012-07-03 16:05:59 +000074 QWidget fDetailTab;
75 QHBoxLayout fDetailLayout;
76 QTextEdit fDetailText;
chudy@google.com902ebe52012-06-29 14:21:22 +000077
chudy@google.com2f891792012-07-03 16:05:59 +000078 QWidget fMatrixAndClipWidget;
79 QVBoxLayout fVerticalLayout;
chudy@google.com902ebe52012-06-29 14:21:22 +000080
chudy@google.com2f891792012-07-03 16:05:59 +000081 QLabel fMatrixLabel;
82 QVBoxLayout fMatrixLayout;
83 QHBoxLayout fMatrixRow[3];
84 QLineEdit fMatrixEntry[9];
85
86 QLabel fClipLabel;
87 QVBoxLayout fClipLayout;
88 QHBoxLayout fClipRow[2];
89 QLineEdit fClipEntry[4];
90
91 QVBoxLayout* setupMatrix();
92 QVBoxLayout* setupClip();
chudy@google.com902ebe52012-06-29 14:21:22 +000093};
94
95#endif