| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 1 | |
| 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.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame^] | 13 | #include "SkMatrix.h" |
| 14 | |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 15 | #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 | */ |
| 27 | class SkInspectorWidget : public QWidget { |
| 28 | Q_OBJECT |
| 29 | |
| 30 | public: |
| 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.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame^] | 39 | void setDisabled(bool isDisabled) { |
| 40 | fMatrixAndClipWidget.setDisabled(isDisabled); |
| 41 | } |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 42 | /** |
| 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.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame^] | 54 | /** |
| 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.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 66 | private: |
| chudy@google.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame^] | 67 | QHBoxLayout fHorizontalLayout; |
| 68 | QTabWidget fTabWidget; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 69 | |
| chudy@google.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame^] | 70 | QWidget fOverviewTab; |
| 71 | QHBoxLayout fOverviewLayout; |
| 72 | QTextEdit fOverviewText; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 73 | |
| chudy@google.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame^] | 74 | QWidget fDetailTab; |
| 75 | QHBoxLayout fDetailLayout; |
| 76 | QTextEdit fDetailText; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 77 | |
| chudy@google.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame^] | 78 | QWidget fMatrixAndClipWidget; |
| 79 | QVBoxLayout fVerticalLayout; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 80 | |
| chudy@google.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame^] | 81 | 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.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 93 | }; |
| 94 | |
| 95 | #endif |