| 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 | */ |
| chudy@google.com | 2d537a1 | 2012-07-31 12:49:52 +0000 | [diff] [blame] | 35 | SkInspectorWidget(); |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 36 | |
| chudy@google.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame] | 37 | void setDisabled(bool isDisabled) { |
| 38 | fMatrixAndClipWidget.setDisabled(isDisabled); |
| 39 | } |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 40 | /** |
| 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.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame] | 52 | /** |
| 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.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 64 | private: |
| chudy@google.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame] | 65 | QHBoxLayout fHorizontalLayout; |
| 66 | QTabWidget fTabWidget; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 67 | |
| chudy@google.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame] | 68 | QWidget fOverviewTab; |
| 69 | QHBoxLayout fOverviewLayout; |
| 70 | QTextEdit fOverviewText; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 71 | |
| chudy@google.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame] | 72 | QWidget fDetailTab; |
| 73 | QHBoxLayout fDetailLayout; |
| 74 | QTextEdit fDetailText; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 75 | |
| chudy@google.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame] | 76 | QWidget fMatrixAndClipWidget; |
| 77 | QVBoxLayout fVerticalLayout; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 78 | |
| chudy@google.com | 2f89179 | 2012-07-03 16:05:59 +0000 | [diff] [blame] | 79 | 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.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 91 | }; |
| 92 | |
| 93 | #endif |