diff --git a/src/abstract_output.cpp b/src/abstract_output.cpp index 7c688a34d0..4c17f9b455 100644 --- a/src/abstract_output.cpp +++ b/src/abstract_output.cpp @@ -53,6 +53,27 @@ const uint16_t *GammaRamp::blue() const return m_table.data() + 2 * m_size; } +QDebug operator<<(QDebug debug, const AbstractOutput *output) +{ + QDebugStateSaver saver(debug); + debug.nospace(); + if (output) { + debug << output->metaObject()->className() << '(' << static_cast(output); + debug << ", name=" << output->name(); + debug << ", geometry=" << output->geometry(); + debug << ", scale=" << output->scale(); + if (debug.verbosity() > 2) { + debug << ", manufacturer=" << output->manufacturer(); + debug << ", model=" << output->model(); + debug << ", serialNumber=" << output->serialNumber(); + } + debug << ')'; + } else { + debug << "AbstractOutput(0x0)"; + } + return debug; +} + AbstractOutput::AbstractOutput(QObject *parent) : QObject(parent) { diff --git a/src/abstract_output.h b/src/abstract_output.h index 26a9a5957d..e0c9b3ac58 100644 --- a/src/abstract_output.h +++ b/src/abstract_output.h @@ -11,6 +11,7 @@ #include +#include #include #include #include @@ -210,6 +211,8 @@ private: int m_directScanoutCount = 0; }; +KWIN_EXPORT QDebug operator<<(QDebug debug, const AbstractOutput *output); + } // namespace KWin #endif