| 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 SKSETTINGSWIDGET_H_ |
| 11 | #define SKSETTINGSWIDGET_H_ |
| 12 | |
| 13 | #include <QWidget> |
| 14 | #include <QHBoxLayout> |
| 15 | #include <QTextEdit> |
| 16 | #include <QFrame> |
| commit-bot@chromium.org | fde1e7c | 2013-08-02 13:59:50 +0000 | [diff] [blame^] | 17 | #include <QGroupBox> |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 18 | #include <QLabel> |
| 19 | #include <QRadioButton> |
| 20 | #include <QCheckBox> |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 21 | #include <QLineEdit> |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 22 | |
| 23 | /** \class SkSettingsWidget |
| 24 | |
| 25 | The SettingsWidget contains multiple checkboxes and toggles for altering |
| 26 | the visibility. |
| 27 | */ |
| 28 | class SkSettingsWidget : public QWidget { |
| 29 | Q_OBJECT |
| 30 | |
| 31 | public: |
| 32 | /** |
| 33 | Constructs a widget with the specified parent for layout purposes. |
| 34 | @param parent The parent container of this widget |
| 35 | */ |
| chudy@google.com | 2d537a1 | 2012-07-31 12:49:52 +0000 | [diff] [blame] | 36 | SkSettingsWidget(); |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 37 | |
| bungeman@google.com | e8cc6e8 | 2013-01-17 16:30:56 +0000 | [diff] [blame] | 38 | /** Sets the displayed user zoom level. A scale of 1.0 represents no zoom. */ |
| 39 | void setZoomText(float scale); |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 40 | |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 41 | QRadioButton* getVisibilityButton(); |
| 42 | |
| robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 43 | #if SK_SUPPORT_GPU |
| commit-bot@chromium.org | fde1e7c | 2013-08-02 13:59:50 +0000 | [diff] [blame^] | 44 | bool isGLActive() { |
| 45 | return fGLCheckBox.isChecked(); |
| chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 46 | } |
| commit-bot@chromium.org | fde1e7c | 2013-08-02 13:59:50 +0000 | [diff] [blame^] | 47 | |
| 48 | int getGLSampleCount() { |
| 49 | if (fGLMSAA4On.isChecked()) { |
| 50 | return 4; |
| 51 | } else if (fGLMSAA16On.isChecked()) { |
| 52 | return 16; |
| 53 | } |
| 54 | return 0; |
| 55 | } |
| 56 | |
| robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 57 | #endif |
| chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 58 | |
| 59 | QCheckBox* getRasterCheckBox() { |
| 60 | return &fRasterCheckBox; |
| 61 | } |
| 62 | |
| robertphillips@google.com | f4741c1 | 2013-02-06 20:13:54 +0000 | [diff] [blame] | 63 | QCheckBox* getOverdrawVizCheckBox() { |
| 64 | return &fOverdrawVizCheckBox; |
| 65 | } |
| 66 | |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 67 | private slots: |
| 68 | void updateCommand(int newCommand); |
| chudy@google.com | e606d6e | 2012-07-12 14:31:25 +0000 | [diff] [blame] | 69 | void updateHit(int newHit); |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 70 | |
| 71 | signals: |
| 72 | void scrollingPreferences(bool isStickyActivate); |
| 73 | void showStyle(bool isSingleCommand); |
| 74 | void visibilityFilter(bool isEnabled); |
| commit-bot@chromium.org | fde1e7c | 2013-08-02 13:59:50 +0000 | [diff] [blame^] | 75 | #if SK_SUPPORT_GPU |
| 76 | void glSettingsChanged(); |
| 77 | #endif |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 78 | |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 79 | private: |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 80 | QVBoxLayout mainFrameLayout; |
| 81 | QFrame mainFrame; |
| 82 | QVBoxLayout fVerticalLayout; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 83 | |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 84 | QLabel fVisibileText; |
| 85 | QFrame fVisibleFrame; |
| 86 | QVBoxLayout fVisibleFrameLayout; |
| 87 | QRadioButton fVisibleOn; |
| 88 | QRadioButton fVisibleOff; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 89 | |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 90 | QLabel fCommandToggle; |
| 91 | QFrame fCommandFrame; |
| 92 | QVBoxLayout fCommandLayout; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 93 | |
| chudy@google.com | 2d537a1 | 2012-07-31 12:49:52 +0000 | [diff] [blame] | 94 | QHBoxLayout fCurrentCommandLayout; |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 95 | QLabel fCurrentCommandLabel; |
| chudy@google.com | e606d6e | 2012-07-12 14:31:25 +0000 | [diff] [blame] | 96 | QLineEdit fCurrentCommandBox; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 97 | |
| chudy@google.com | 2d537a1 | 2012-07-31 12:49:52 +0000 | [diff] [blame] | 98 | QHBoxLayout fCommandHitLayout; |
| chudy@google.com | e606d6e | 2012-07-12 14:31:25 +0000 | [diff] [blame] | 99 | QLabel fCommandHitLabel; |
| 100 | QLineEdit fCommandHitBox; |
| chudy@google.com | e606d6e | 2012-07-12 14:31:25 +0000 | [diff] [blame] | 101 | |
| chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 102 | QFrame fCanvasFrame; |
| 103 | QVBoxLayout fCanvasLayout; |
| chudy@google.com | 2d537a1 | 2012-07-31 12:49:52 +0000 | [diff] [blame] | 104 | QLabel fCanvasToggle; |
| chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 105 | |
| 106 | QHBoxLayout fRasterLayout; |
| 107 | QLabel fRasterLabel; |
| 108 | QCheckBox fRasterCheckBox; |
| 109 | |
| robertphillips@google.com | f4741c1 | 2013-02-06 20:13:54 +0000 | [diff] [blame] | 110 | QHBoxLayout fOverdrawVizLayout; |
| 111 | QLabel fOverdrawVizLabel; |
| 112 | QCheckBox fOverdrawVizCheckBox; |
| 113 | |
| robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 114 | #if SK_SUPPORT_GPU |
| chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 115 | QHBoxLayout fGLLayout; |
| 116 | QLabel fGLLabel; |
| 117 | QCheckBox fGLCheckBox; |
| commit-bot@chromium.org | fde1e7c | 2013-08-02 13:59:50 +0000 | [diff] [blame^] | 118 | QGroupBox fGLMSAAButtonGroup; |
| 119 | QVBoxLayout fGLMSAALayout; |
| 120 | QRadioButton fGLMSAAOff; |
| 121 | QRadioButton fGLMSAA4On; |
| 122 | QRadioButton fGLMSAA16On; |
| robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 123 | #endif |
| chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 124 | |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 125 | QFrame fZoomFrame; |
| chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 126 | QHBoxLayout fZoomLayout; |
| chudy@google.com | 2d537a1 | 2012-07-31 12:49:52 +0000 | [diff] [blame] | 127 | QLabel fZoomSetting; |
| 128 | QLineEdit fZoomBox; |
| chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 129 | }; |
| 130 | |
| 131 | #endif /* SKSETTINGSWIDGET_H_ */ |