From 655ff6ee28103ec2373953dc60b75b2db0de0014 Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Tue, 11 Jun 2019 19:51:05 +0900 Subject: change hs to qhs --- app/app.pri | 8 ++++---- app/config.tests/libhomescreen/libhomescreen.cpp | 8 -------- app/config.tests/libhomescreen/libhomescreen.pro | 5 ----- app/config.tests/qlibhomescreen/qlibhomescreen.cpp | 8 ++++++++ app/config.tests/qlibhomescreen/qlibhomescreen.pro | 6 ++++++ app/main.cpp | 15 ++++++++------- 6 files changed, 26 insertions(+), 24 deletions(-) delete mode 100644 app/config.tests/libhomescreen/libhomescreen.cpp delete mode 100644 app/config.tests/libhomescreen/libhomescreen.pro create mode 100644 app/config.tests/qlibhomescreen/qlibhomescreen.cpp create mode 100644 app/config.tests/qlibhomescreen/qlibhomescreen.pro diff --git a/app/app.pri b/app/app.pri index 590c154..88eca22 100644 --- a/app/app.pri +++ b/app/app.pri @@ -2,13 +2,13 @@ TEMPLATE = app load(configure) -qtCompileTest(libhomescreen) +qtCompileTest(qlibhomescreen) qtCompileTest(qlibwindowmanager) -config_libhomescreen { +config_qlibhomescreen { CONFIG += link_pkgconfig - PKGCONFIG += libhomescreen - DEFINES += HAVE_LIBHOMESCREEN + PKGCONFIG += qlibhomescreen + DEFINES += HAVE_QLIBHOMESCREEN } config_qlibwindowmanager { diff --git a/app/config.tests/libhomescreen/libhomescreen.cpp b/app/config.tests/libhomescreen/libhomescreen.cpp deleted file mode 100644 index d698b05..0000000 --- a/app/config.tests/libhomescreen/libhomescreen.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main(int argc,char **argv) -{ - LibHomeScreen libHomeScreen; - return 0; -} - diff --git a/app/config.tests/libhomescreen/libhomescreen.pro b/app/config.tests/libhomescreen/libhomescreen.pro deleted file mode 100644 index 7d43112..0000000 --- a/app/config.tests/libhomescreen/libhomescreen.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = libhomescreen.cpp - -CONFIG -= qt -CONFIG += link_pkgconfig -PKGCONFIG += libhomescreen diff --git a/app/config.tests/qlibhomescreen/qlibhomescreen.cpp b/app/config.tests/qlibhomescreen/qlibhomescreen.cpp new file mode 100644 index 0000000..8e49ff7 --- /dev/null +++ b/app/config.tests/qlibhomescreen/qlibhomescreen.cpp @@ -0,0 +1,8 @@ +#include + +int main(int argc,char **argv) +{ + QLibHomeScreen qlibHomeScreen; + return 0; +} + diff --git a/app/config.tests/qlibhomescreen/qlibhomescreen.pro b/app/config.tests/qlibhomescreen/qlibhomescreen.pro new file mode 100644 index 0000000..a5e6fde --- /dev/null +++ b/app/config.tests/qlibhomescreen/qlibhomescreen.pro @@ -0,0 +1,6 @@ +SOURCES = qlibhomescreen.cpp + +CONFIG += qt +QT += quick +CONFIG += link_pkgconfig +PKGCONFIG += qlibhomescreen diff --git a/app/main.cpp b/app/main.cpp index 162af79..f44dd72 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -24,8 +24,8 @@ #include "translator.h" -#ifdef HAVE_LIBHOMESCREEN -#include +#ifdef HAVE_QLIBHOMESCREEN +#include #endif #ifdef HAVE_QLIBWINDOWMANAGER #include @@ -88,14 +88,14 @@ int main(int argc, char *argv[]) }); #endif -#ifdef HAVE_LIBHOMESCREEN - LibHomeScreen* hs = new LibHomeScreen(); +#ifdef HAVE_QLIBHOMESCREEN + QLibHomeScreen* qhs = new QLibHomeScreen(); // HomeScreen std::string token = secret.toStdString(); - hs->init(port, token.c_str()); + qhs->init(port, token.c_str()); // Set the event handler for Event_TapShortcut which will activate the surface for windowmanager - hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [qwm, myname](json_object *object){ + qhs->set_event_handler(QLibHomeScreen::Event_ShowWindow, [qwm, myname](json_object *object){ qwm->activateSurface(myname); }); #endif @@ -104,7 +104,8 @@ int main(int argc, char *argv[]) QObject *root = engine.rootObjects().first(); QQuickWindow *window = qobject_cast(root); #ifdef HAVE_QLIBWINDOWMANAGER - QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateSurface())); + // QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateSurface())); + qhs->setQuickWindow(window); #else window->resize(1920, 720); window->setVisible(true); -- cgit 1.2.3-korg