| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2018 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtSCriptTools module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General |
| 28 | ** Public license version 3 or any later version approved by the KDE Free |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
| 31 | ** included in the packaging of this file. Please review the following |
| 32 | ** information to ensure the GNU General Public License requirements will |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
| 35 | ** |
| 36 | ** $QT_END_LICENSE$ |
| 37 | ** |
| 38 | ****************************************************************************/ |
| 39 | |
| 40 | #include "qscriptdebugoutputwidget_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebugoutputwidget_p.h`/ |
| 41 | #include "qscriptdebugoutputwidgetinterface_p_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebugoutputwidgetinterface_p_p.h`/ |
| 42 | |
| 43 | #include <QtCore/qdebug.h> |
| 44 | #include <QtWidgets/qboxlayout.h> |
| 45 | #include <QtWidgets/qplaintextedit.h> |
| 46 | #include <QtWidgets/qscrollbar.h> |
| 47 | |
| 48 | QT_BEGIN_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:148:10`! |
| 49 | |
| 50 | namespacecxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebugoutputwidget.cpp`/ { |
| 51 | |
| 52 | class QScriptDebugOutputWidgetOutputEditcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebugoutputwidget.cpp`/QScriptDebugOutputWidgetOutputEdit# : public QPlainTextEditcxx . . $ QPlainTextEdit# |
| 53 | { |
| 54 | public: |
| 55 | QScriptDebugOutputWidgetOutputEditcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebugoutputwidget.cpp`/QScriptDebugOutputWidgetOutputEdit#QScriptDebugOutputWidgetOutputEdit(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent = 0) |
| 56 | : QPlainTextEditcxx . . $ QPlainTextEdit#(parent) |
| 57 | { |
| 58 | setReadOnlycxx . . $ QPlainTextEdit#setReadOnly(b45ddcbc8423892c).(true); |
| 59 | // setFocusPolicy(Qt::NoFocus); |
| 60 | setMaximumBlockCountcxx . . $ QPlainTextEdit#setMaximumBlockCount(d4f767463ce0a6b3).(2500); |
| 61 | } |
| 62 | |
| 63 | void scrollToBottomcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebugoutputwidget.cpp`/QScriptDebugOutputWidgetOutputEdit#scrollToBottom(49f6e7a06ebc5aa8).() |
| 64 | { |
| 65 | QScrollBarcxx . . $ QScrollBar# *bar = verticalScrollBarcxx . . $ QAbstractScrollArea#verticalScrollBar(49d9510c6adf8c19).(); |
| 66 | bar->setValuecxx . . $ QAbstractSlider#setValue(d4f767463ce0a6b3).(bar->maximumcxx . . $ QAbstractSlider#maximum(455f465bc33b4cdf).()); |
| 67 | } |
| 68 | |
| 69 | int charactersPerLinecxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebugoutputwidget.cpp`/QScriptDebugOutputWidgetOutputEdit#charactersPerLine(455f465bc33b4cdf).() const |
| 70 | { |
| 71 | QFontMetricscxx . . $ QFontMetrics# fm(fontcxx . . $ QWidget#font(c5040538afc47120).()); |
| 72 | return widthcxx . . $ QWidget#width(455f465bc33b4cdf).() /cxx . . $ `operator/`(68a6fbfab4d187bc). fm.maxWidthcxx . . $ QFontMetrics#maxWidth(455f465bc33b4cdf).(); |
| 73 | } |
| 74 | }; |
| 75 | |
| 76 | } // namespace |
| 77 | |
| 78 | class QScriptDebugOutputWidgetPrivatecxx . . $ QScriptDebugOutputWidgetPrivate# |
| 79 | : public QScriptDebugOutputWidgetInterfacePrivatecxx . . $ QScriptDebugOutputWidgetInterfacePrivate# |
| 80 | { |
| 81 | Q_DECLARE_PUBLICcxx . . $ `<external>/15045578679651060896/qglobal.h:1172:9`!(QScriptDebugOutputWidget) |
| 82 | public: |
| 83 | QScriptDebugOutputWidgetPrivatecxx . . $ QScriptDebugOutputWidgetPrivate#QScriptDebugOutputWidgetPrivate(49f6e7a06ebc5aa8).(); |
| 84 | ~cxx . . $ QScriptDebugOutputWidgetPrivate#`~QScriptDebugOutputWidgetPrivate`(ced63f7c635d850d).QScriptDebugOutputWidgetPrivatecxx . . $ QScriptDebugOutputWidgetPrivate#(); |
| 85 | |
| 86 | QScriptDebugOutputWidgetOutputEditcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebugoutputwidget.cpp`/QScriptDebugOutputWidgetOutputEdit# *outputEditcxx . . $ QScriptDebugOutputWidgetPrivate#outputEdit.; |
| 87 | }; |
| 88 | |
| 89 | QScriptDebugOutputWidgetPrivatecxx . . $ QScriptDebugOutputWidgetPrivate#::QScriptDebugOutputWidgetPrivatecxx . . $ QScriptDebugOutputWidgetPrivate#QScriptDebugOutputWidgetPrivate(49f6e7a06ebc5aa8).() |
| 90 | { |
| 91 | } |
| 92 | |
| 93 | QScriptDebugOutputWidgetPrivatecxx . . $ QScriptDebugOutputWidgetPrivate#::~cxx . . $ QScriptDebugOutputWidgetPrivate#`~QScriptDebugOutputWidgetPrivate`(ced63f7c635d850d).QScriptDebugOutputWidgetPrivatecxx . . $ QScriptDebugOutputWidgetPrivate#() |
| 94 | { |
| 95 | } |
| 96 | |
| 97 | QScriptDebugOutputWidgetcxx . . $ QScriptDebugOutputWidget#::QScriptDebugOutputWidgetcxx . . $ QScriptDebugOutputWidget#QScriptDebugOutputWidget(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent) |
| 98 | : QScriptDebugOutputWidgetInterfacecxx . . $ QScriptDebugOutputWidgetInterface#(*new QScriptDebugOutputWidgetPrivatecxx . . $ QScriptDebugOutputWidgetPrivate#QScriptDebugOutputWidgetPrivate(49f6e7a06ebc5aa8)., parent, {}) |
| 99 | { |
| 100 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptDebugOutputWidget); |
| 101 | d->outputEditcxx . . $ QScriptDebugOutputWidgetPrivate#outputEdit. = new QScriptDebugOutputWidgetOutputEditcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebugoutputwidget.cpp`/QScriptDebugOutputWidgetOutputEdit#(); |
| 102 | QVBoxLayoutcxx . . $ QVBoxLayout# *vbox = new QVBoxLayout(this); |
| 103 | vbox->setContentsMarginscxx . . $ QLayout#setContentsMargins(748afa4755bc9595).(0, 0, 0, 0); |
| 104 | vbox->setSpacingcxx . . $ QBoxLayout#setSpacing(d4f767463ce0a6b3).(0); |
| 105 | vbox->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(d->outputEditcxx . . $ QScriptDebugOutputWidgetPrivate#outputEdit.); |
| 106 | |
| 107 | #ifndef QT_NO_STYLE_STYLESHEET |
| 108 | QStringcxx . . $ QString# sheet = QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).("font-size: 14px; font-family: \"Monospace\";"); |
| 109 | setStyleSheetcxx . . $ QWidget#setStyleSheet(3520e46b33348bf6).(sheet); |
| 110 | #endif |
| 111 | } |
| 112 | |
| 113 | QScriptDebugOutputWidgetcxx . . $ QScriptDebugOutputWidget#::~cxx . . $ QScriptDebugOutputWidget#`~QScriptDebugOutputWidget`(ced63f7c635d850d).QScriptDebugOutputWidgetcxx . . $ QScriptDebugOutputWidget#() |
| 114 | { |
| 115 | } |
| 116 | |
| 117 | void QScriptDebugOutputWidgetcxx . . $ QScriptDebugOutputWidget#::messagecxx . . $ QScriptDebugOutputWidget#message(2525eba6d4edee60).( |
| 118 | QtMsgTypecxx . . $ QtMsgType# type, const QStringcxx . . $ QString# &text, const QStringcxx . . $ QString# &fileName, |
| 119 | int lineNumber, int columnNumber, const QVariantcxx . . $ QVariant# &/*data*/) |
| 120 | { |
| 121 | // ### unify with QScriptDebuggerConsoleWidget::message() |
| 122 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptDebugOutputWidget); |
| 123 | QStringcxx . . $ QString# msgcxx . . $ QString#QString(ced63f7c635d850d).; |
| 124 | if (!fileName.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() || (lineNumber != -1)) { |
| 125 | if (!fileName.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 126 | msg.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(fileName); |
| 127 | else |
| 128 | msg.appendcxx . . $ QString#append(10913c921d46e09a).(QLatin1Stringcxx . . $ QLatin1String#QLatin1String(aac1607cfe1c1740).("<noname>")); |
| 129 | if (lineNumber != -1) { |
| 130 | msg.appendcxx . . $ QString#append(3a2ffbdf8ecc25e2).(QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).(':')); |
| 131 | msg.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(lineNumber)); |
| 132 | if (columnNumber != -1) { |
| 133 | msg.appendcxx . . $ QString#append(3a2ffbdf8ecc25e2).(QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).(':')); |
| 134 | msg.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(columnNumber)); |
| 135 | } |
| 136 | } |
| 137 | msg.appendcxx . . $ QString#append(10913c921d46e09a).(QLatin1Stringcxx . . $ QLatin1String#QLatin1String(aac1607cfe1c1740).(": ")); |
| 138 | } |
| 139 | msg.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(text); |
| 140 | QTextCharFormatcxx . . $ QTextCharFormat# oldFmt = d->outputEditcxx . . $ QScriptDebugOutputWidgetPrivate#outputEdit.->currentCharFormatcxx . . $ QPlainTextEdit#currentCharFormat(268dbcd0ed66b30c).(); |
| 141 | QTextCharFormatcxx . . $ QTextCharFormat# fmt(oldFmt); |
| 142 | if (type == QtCriticalMsgcxx . . $ QtCriticalMsg.) { |
| 143 | fmt.setForegroundcxx . . $ QTextFormat#setForeground(ffc9f5d0bda78261).(Qtcxx . . $ Qt/::redcxx . . $ Qt/red.); |
| 144 | d->outputEditcxx . . $ QScriptDebugOutputWidgetPrivate#outputEdit.->setCurrentCharFormatcxx . . $ QPlainTextEdit#setCurrentCharFormat(dd8d5568386b23bd).(fmt); |
| 145 | } |
| 146 | d->outputEditcxx . . $ QScriptDebugOutputWidgetPrivate#outputEdit.->appendPlainTextcxx . . $ QPlainTextEdit#appendPlainText(3520e46b33348bf6).(msg); |
| 147 | d->outputEditcxx . . $ QScriptDebugOutputWidgetPrivate#outputEdit.->setCurrentCharFormatcxx . . $ QPlainTextEdit#setCurrentCharFormat(dd8d5568386b23bd).(oldFmt); |
| 148 | d->outputEditcxx . . $ QScriptDebugOutputWidgetPrivate#outputEdit.->scrollToBottomcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebugoutputwidget.cpp`/QScriptDebugOutputWidgetOutputEdit#scrollToBottom(49f6e7a06ebc5aa8).(); |
| 149 | } |
| 150 | |
| 151 | void QScriptDebugOutputWidgetcxx . . $ QScriptDebugOutputWidget#::clearcxx . . $ QScriptDebugOutputWidget#clear(49f6e7a06ebc5aa8).() |
| 152 | { |
| 153 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptDebugOutputWidget); |
| 154 | d->outputEditcxx . . $ QScriptDebugOutputWidgetPrivate#outputEdit.->clearcxx . . $ QPlainTextEdit#clear(49f6e7a06ebc5aa8).(); |
| 155 | } |
| 156 | |
| 157 | QT_END_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:149:10`! |