| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkDebuggerGUI.h" | 8 #include "SkDebuggerGUI.h" |
| 9 #include "SkForceLinking.h" | 9 #include "SkForceLinking.h" |
| 10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "BenchSysTimer_mach.h" | 22 #include "BenchSysTimer_mach.h" |
| 23 #elif defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID) | 23 #elif defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID) |
| 24 #include "BenchSysTimer_posix.h" | 24 #include "BenchSysTimer_posix.h" |
| 25 #else | 25 #else |
| 26 #include "BenchSysTimer_c.h" | 26 #include "BenchSysTimer_c.h" |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 | 29 |
| 30 SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : | 30 SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : |
| 31 QMainWindow(parent) | 31 QMainWindow(parent) |
| 32 , fCentralWidget(this) | 32 , fCentralSplitter(this) |
| 33 , fStatusBar(this) | 33 , fStatusBar(this) |
| 34 , fToolBar(this) | 34 , fToolBar(this) |
| 35 , fActionOpen(this) | 35 , fActionOpen(this) |
| 36 , fActionBreakpoint(this) | 36 , fActionBreakpoint(this) |
| 37 , fActionProfile(this) | 37 , fActionProfile(this) |
| 38 , fActionCancel(this) | 38 , fActionCancel(this) |
| 39 , fActionClearBreakpoints(this) | 39 , fActionClearBreakpoints(this) |
| 40 , fActionClearDeletes(this) | 40 , fActionClearDeletes(this) |
| 41 , fActionClose(this) | 41 , fActionClose(this) |
| 42 , fActionCreateBreakpoint(this) | 42 , fActionCreateBreakpoint(this) |
| 43 , fActionDelete(this) | 43 , fActionDelete(this) |
| 44 , fActionDirectory(this) | 44 , fActionDirectory(this) |
| 45 , fActionGoToLine(this) | 45 , fActionGoToLine(this) |
| 46 , fActionInspector(this) | 46 , fActionInspector(this) |
| 47 , fActionSettings(this) | 47 , fActionSettings(this) |
| 48 , fActionPlay(this) | 48 , fActionPlay(this) |
| 49 , fActionPause(this) | 49 , fActionPause(this) |
| 50 , fActionRewind(this) | 50 , fActionRewind(this) |
| 51 , fActionSave(this) | 51 , fActionSave(this) |
| 52 , fActionSaveAs(this) | 52 , fActionSaveAs(this) |
| 53 , fActionShowDeletes(this) | 53 , fActionShowDeletes(this) |
| 54 , fActionStepBack(this) | 54 , fActionStepBack(this) |
| 55 , fActionStepForward(this) | 55 , fActionStepForward(this) |
| 56 , fActionZoomIn(this) | 56 , fActionZoomIn(this) |
| 57 , fActionZoomOut(this) | 57 , fActionZoomOut(this) |
| 58 , fMapper(this) | 58 , fMapper(this) |
| 59 , fListWidget(&fCentralWidget) | 59 , fListWidget(&fCentralSplitter) |
| 60 , fDirectoryWidget(&fCentralWidget) | 60 , fDirectoryWidget(&fCentralSplitter) |
| 61 , fCanvasWidget(this, &fDebugger) | 61 , fCanvasWidget(this, &fDebugger) |
| 62 , fImageWidget(&fDebugger) | 62 , fImageWidget(&fDebugger) |
| 63 , fMenuBar(this) | 63 , fMenuBar(this) |
| 64 , fMenuFile(this) | 64 , fMenuFile(this) |
| 65 , fMenuNavigate(this) | 65 , fMenuNavigate(this) |
| 66 , fMenuView(this) | 66 , fMenuView(this) |
| 67 , fBreakpointsActivated(false) | 67 , fBreakpointsActivated(false) |
| 68 , fDeletesActivated(false) | 68 , fDeletesActivated(false) |
| 69 , fPause(false) | 69 , fPause(false) |
| 70 , fLoading(false) | 70 , fLoading(false) |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 fActionStepForward.setIcon(stepForward); | 794 fActionStepForward.setIcon(stepForward); |
| 795 fActionStepForward.setText("Step Forward"); | 795 fActionStepForward.setText("Step Forward"); |
| 796 | 796 |
| 797 fActionZoomIn.setShortcut(QKeySequence(tr("Ctrl+="))); | 797 fActionZoomIn.setShortcut(QKeySequence(tr("Ctrl+="))); |
| 798 fActionZoomIn.setText("Zoom In"); | 798 fActionZoomIn.setText("Zoom In"); |
| 799 fActionZoomOut.setShortcut(QKeySequence(tr("Ctrl+-"))); | 799 fActionZoomOut.setShortcut(QKeySequence(tr("Ctrl+-"))); |
| 800 fActionZoomOut.setText("Zoom Out"); | 800 fActionZoomOut.setText("Zoom Out"); |
| 801 | 801 |
| 802 fListWidget.setItemDelegate(new SkListWidget(&fListWidget)); | 802 fListWidget.setItemDelegate(new SkListWidget(&fListWidget)); |
| 803 fListWidget.setObjectName(QString::fromUtf8("listWidget")); | 803 fListWidget.setObjectName(QString::fromUtf8("listWidget")); |
| 804 fListWidget.setMaximumWidth(250); | 804 fListWidget.setMinimumWidth(250); |
| 805 | 805 |
| 806 fFilter.addItem("--Filter By Available Commands--"); | 806 fFilter.addItem("--Filter By Available Commands--"); |
| 807 | 807 |
| 808 fDirectoryWidget.setMaximumWidth(250); | 808 fDirectoryWidget.setMinimumWidth(250); |
| 809 fDirectoryWidget.setStyleSheet("QListWidget::Item {padding: 5px;}"); | 809 fDirectoryWidget.setStyleSheet("QListWidget::Item {padding: 5px;}"); |
| 810 | 810 |
| 811 fCanvasWidget.setSizePolicy(QSizePolicy::Expanding, | 811 fCanvasWidget.setSizePolicy(QSizePolicy::Expanding, |
| 812 QSizePolicy::Expanding); | 812 QSizePolicy::Expanding); |
| 813 | 813 |
| 814 fImageWidget.setFixedSize(SkImageWidget::kImageWidgetWidth, | 814 fImageWidget.setFixedSize(SkImageWidget::kImageWidgetWidth, |
| 815 SkImageWidget::kImageWidgetHeight); | 815 SkImageWidget::kImageWidgetHeight); |
| 816 | 816 |
| 817 fInspectorWidget.setSizePolicy(QSizePolicy::Expanding, | 817 fInspectorWidget.setSizePolicy(QSizePolicy::Expanding, |
| 818 QSizePolicy::Expanding); | 818 QSizePolicy::Expanding); |
| 819 fInspectorWidget.setMaximumHeight(300); | 819 fInspectorWidget.setMaximumHeight(300); |
| 820 | 820 |
| 821 fSettingsAndImageLayout.setSpacing(6); | 821 fSettingsAndImageLayout.setSpacing(6); |
| 822 fSettingsAndImageLayout.addWidget(&fSettingsWidget); | 822 fSettingsAndImageLayout.addWidget(&fSettingsWidget); |
| 823 fSettingsAndImageLayout.addWidget(&fImageWidget); | 823 fSettingsAndImageLayout.addWidget(&fImageWidget); |
| 824 | 824 |
| 825 fSettingsWidget.setSizePolicy(QSizePolicy::Expanding, | 825 fSettingsWidget.setSizePolicy(QSizePolicy::Expanding, |
| 826 QSizePolicy::Expanding); | 826 QSizePolicy::Expanding); |
| 827 fSettingsWidget.setMaximumWidth(250); | 827 fSettingsWidget.setMaximumWidth(250); |
| 828 | 828 |
| 829 fLeftColumnLayout.setSpacing(6); | 829 fLeftColumnSplitter.addWidget(&fListWidget); |
| 830 fLeftColumnLayout.addWidget(&fListWidget); | 830 fLeftColumnSplitter.addWidget(&fDirectoryWidget); |
| 831 fLeftColumnLayout.addWidget(&fDirectoryWidget); | 831 fLeftColumnSplitter.setOrientation(Qt::Vertical); |
| 832 | 832 |
| 833 fCanvasSettingsAndImageLayout.setSpacing(6); | 833 fCanvasSettingsAndImageLayout.setSpacing(6); |
| 834 fCanvasSettingsAndImageLayout.addWidget(&fCanvasWidget); | 834 fCanvasSettingsAndImageLayout.addWidget(&fCanvasWidget); |
| 835 fCanvasSettingsAndImageLayout.addLayout(&fSettingsAndImageLayout); | 835 fCanvasSettingsAndImageLayout.addLayout(&fSettingsAndImageLayout); |
| 836 | 836 |
| 837 | |
| 838 fMainAndRightColumnLayout.setSpacing(6); | 837 fMainAndRightColumnLayout.setSpacing(6); |
| 839 fMainAndRightColumnLayout.addLayout(&fCanvasSettingsAndImageLayout); | 838 fMainAndRightColumnLayout.addLayout(&fCanvasSettingsAndImageLayout); |
| 840 fMainAndRightColumnLayout.addWidget(&fInspectorWidget); | 839 fMainAndRightColumnLayout.addWidget(&fInspectorWidget); |
| 840 fMainAndRightColumnWidget.setLayout(&fMainAndRightColumnLayout); |
| 841 | 841 |
| 842 fCentralWidget.setLayout(&fContainerLayout); | 842 fCentralSplitter.addWidget(&fLeftColumnSplitter); |
| 843 fContainerLayout.setSpacing(6); | 843 fCentralSplitter.addWidget(&fMainAndRightColumnWidget); |
| 844 fContainerLayout.setContentsMargins(11, 11, 11, 11); | 844 fCentralSplitter.setStretchFactor(0, 0); |
| 845 fContainerLayout.addLayout(&fLeftColumnLayout); | 845 fCentralSplitter.setStretchFactor(1, 1); |
| 846 fContainerLayout.addLayout(&fMainAndRightColumnLayout); | |
| 847 | 846 |
| 848 SkDebuggerGUI->setCentralWidget(&fCentralWidget); | 847 SkDebuggerGUI->setCentralWidget(&fCentralSplitter); |
| 849 SkDebuggerGUI->setStatusBar(&fStatusBar); | 848 SkDebuggerGUI->setStatusBar(&fStatusBar); |
| 850 | 849 |
| 851 fToolBar.setIconSize(QSize(32, 32)); | 850 fToolBar.setIconSize(QSize(32, 32)); |
| 852 fToolBar.setToolButtonStyle(Qt::ToolButtonTextUnderIcon); | 851 fToolBar.setToolButtonStyle(Qt::ToolButtonTextUnderIcon); |
| 853 SkDebuggerGUI->addToolBar(Qt::TopToolBarArea, &fToolBar); | 852 SkDebuggerGUI->addToolBar(Qt::TopToolBarArea, &fToolBar); |
| 854 | 853 |
| 855 fSpacer.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | 854 fSpacer.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
| 856 | 855 |
| 857 fToolBar.addAction(&fActionRewind); | 856 fToolBar.addAction(&fActionRewind); |
| 858 fToolBar.addAction(&fActionStepBack); | 857 fToolBar.addAction(&fActionStepBack); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 } | 1035 } |
| 1037 | 1036 |
| 1038 // NOTE(chudy): Makes first item unselectable. | 1037 // NOTE(chudy): Makes first item unselectable. |
| 1039 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( | 1038 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( |
| 1040 fFilter.model()); | 1039 fFilter.model()); |
| 1041 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), | 1040 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), |
| 1042 fFilter.rootModelIndex()); | 1041 fFilter.rootModelIndex()); |
| 1043 QStandardItem* firstItem = model->itemFromIndex(firstIndex); | 1042 QStandardItem* firstItem = model->itemFromIndex(firstIndex); |
| 1044 firstItem->setSelectable(false); | 1043 firstItem->setSelectable(false); |
| 1045 } | 1044 } |
| OLD | NEW |