diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5cf202e..6509a3d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1 +1,2 @@ -add_subdirectory(kded) \ No newline at end of file +add_subdirectory(kded) +add_subdirectory(osd) diff --git a/tests/osd/CMakeLists.txt b/tests/osd/CMakeLists.txt new file mode 100644 index 0000000..370205b --- /dev/null +++ b/tests/osd/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories(${CMAKE_SOURCE_DIR}/kcm/src) + +add_executable(osdtest main.cpp osdtest.cpp ../../kded/osd.cpp ../../kded/osdmanager.cpp ../../kcm/src/utils.cpp) +target_link_libraries(osdtest Qt5::Core + Qt5::DBus + Qt5::Quick + Qt5::Qml + KF5::Screen + KF5::PlasmaQuick + KF5::I18n + KF5::Declarative + KF5::IconThemes + KF5::QuickAddons +) + diff --git a/tests/osd/main.cpp b/tests/osd/main.cpp new file mode 100644 index 0000000..d406ab4 --- /dev/null +++ b/tests/osd/main.cpp @@ -0,0 +1,39 @@ +/************************************************************************************* + * Copyright 2014-2016 by Sebastian Kügler * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * + *************************************************************************************/ + +#include "osdtest.h" + +#include +#include + +int main(int argc, char **argv) +{ + QGuiApplication app(argc, argv); + + KScreen::OsdTest osdtest; + + QCommandLineOption config = QCommandLineOption(QStringList() << QStringLiteral("c") << "config", + QStringLiteral("Config file"), "config"); + QCommandLineParser parser; + parser.addHelpOption(); + parser.addOption(config); + parser.process(app); + + osdtest.start(); + return app.exec(); +} diff --git a/tests/osd/osdtest.cpp b/tests/osd/osdtest.cpp new file mode 100644 index 0000000..02c416b --- /dev/null +++ b/tests/osd/osdtest.cpp @@ -0,0 +1,56 @@ +/************************************************************************************* + * Copyright 2016 Sebastian Kügler * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + *************************************************************************************/ + +#include "osdtest.h" +#include "../../kded/osd.h" +#include "../../kded/osdmanager.h" +#include "../../kcm/src/utils.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include + + +Q_LOGGING_CATEGORY(KSCREEN_KDED, "kscreen.kded") + +namespace KScreen { +OsdTest::OsdTest(QObject *parent) + : QObject(parent) +{ +} + +OsdTest::~OsdTest() +{ +} + +void OsdTest::start() +{ + QTimer::singleShot(5500, qApp, &QCoreApplication::quit); + auto osdManager = new KScreen::OsdManager(this); + osdManager->showOutputIdentifiers(); +} + + +} // ns \ No newline at end of file diff --git a/tests/osd/osdtest.h b/tests/osd/osdtest.h new file mode 100644 index 0000000..f44094f --- /dev/null +++ b/tests/osd/osdtest.h @@ -0,0 +1,42 @@ +/************************************************************************************* + * Copyright 2016 Sebastian Kügler * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + *************************************************************************************/ + +#ifndef KSCREEN_OSDTEST_H +#define KSCREEN_OSDTEST_H + +#include + + +namespace KScreen +{ + +class OsdTest : public QObject +{ + Q_OBJECT + +public: + explicit OsdTest(QObject *parent = nullptr); + virtual ~OsdTest(); + + void start(); + +}; + +} // namespace + +#endif // KSCREEN_OSDTEST_H