blob: 78a834406bdeec1c80b173797ee1e320267a6601 [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 */
chudy@google.com2d537a12012-07-31 12:49:52 +000035 SkInspectorWidget();
chudy@google.com902ebe52012-06-29 14:21:22 +000036
chudy@google.com2f891792012-07-03 16:05:59 +000037 void setDisabled(bool isDisabled) {
38 fMatrixAndClipWidget.setDisabled(isDisabled);
39 }
chudy@google.com902ebe52012-06-29 14:21:22 +000040 /**
41 Sets the text in the detail tab.
42 @param text
43 */
44 void setDetailText(QString text);
45
46 /**
47 Sets the text in the overview tab.
48 @param text
49 */
50 void setOverviewText(QString text);
51
chudy@google.com2f891792012-07-03 16:05:59 +000052 /**
53 Sets the text in the current matrix.
54 @param matrixValues
55 */
56 void setMatrix(const SkMatrix& matrix);
57
58 /**
59 Sets the text in the current clip.
60 @param clipValues
61 */
62 void setClip(const SkIRect& clip);
63
chudy@google.com902ebe52012-06-29 14:21:22 +000064private:
chudy@google.com2f891792012-07-03 16:05:59 +000065 QHBoxLayout fHorizontalLayout;
66 QTabWidget fTabWidget;
chudy@google.com902ebe52012-06-29 14:21:22 +000067
chudy@google.com2f891792012-07-03 16:05:59 +000068 QWidget fOverviewTab;
69 QHBoxLayout fOverviewLayout;
70 QTextEdit fOverviewText;
chudy@google.com902ebe52012-06-29 14:21:22 +000071
chudy@google.com2f891792012-07-03 16:05:59 +000072 QWidget fDetailTab;
73 QHBoxLayout fDetailLayout;
74 QTextEdit fDetailText;
chudy@google.com902ebe52012-06-29 14:21:22 +000075
chudy@google.com2f891792012-07-03 16:05:59 +000076 QWidget fMatrixAndClipWidget;
77 QVBoxLayout fVerticalLayout;
chudy@google.com902ebe52012-06-29 14:21:22 +000078
chudy@google.com2f891792012-07-03 16:05:59 +000079 QLabel fMatrixLabel;
80 QVBoxLayout fMatrixLayout;
81 QHBoxLayout fMatrixRow[3];
82 QLineEdit fMatrixEntry[9];
83
84 QLabel fClipLabel;
85 QVBoxLayout fClipLayout;
86 QHBoxLayout fClipRow[2];
87 QLineEdit fClipEntry[4];
88
89 QVBoxLayout* setupMatrix();
90 QVBoxLayout* setupClip();
chudy@google.com902ebe52012-06-29 14:21:22 +000091};
92
93#endif