diff options
author | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-11-29 18:35:14 +0900 |
---|---|---|
committer | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-12-07 20:20:17 +0900 |
commit | 3ff07151af5040842dd1e56d8312ee39cc50f533 (patch) | |
tree | eec526931acf47143e1e7c478bd66cb55f2ef249 | |
parent | d186c2c096756469d7a917e67b49dc9eef68a625 (diff) |
Inherit LibWindowmanagerHEADjellyfish_9.99.4jellyfish_9.99.3jellyfish_9.99.2jellyfish_9.99.1jellyfish/9.99.4jellyfish/9.99.3jellyfish/9.99.2jellyfish/9.99.1icefish_8.99.5icefish_8.99.4icefish_8.99.3icefish_8.99.2icefish_8.99.1icefish/8.99.5icefish/8.99.4icefish/8.99.3icefish/8.99.2icefish/8.99.1halibut_8.0.6halibut_8.0.5halibut_8.0.4halibut_8.0.3halibut_8.0.2halibut_8.0.1halibut_8.0.0halibut_7.99.3halibut_7.99.2halibut_7.99.1halibut_7.90.0halibut/8.0.6halibut/8.0.5halibut/8.0.4halibut/8.0.3halibut/8.0.2halibut/8.0.1halibut/8.0.0halibut/7.99.3halibut/7.99.2halibut/7.99.1halibut/7.90.0guppy_6.99.4guppy_6.99.3guppy/6.99.4guppy/6.99.39.99.49.99.39.99.29.99.18.99.58.99.48.99.38.99.28.99.18.0.68.0.58.0.48.0.38.0.28.0.18.0.07.99.37.99.27.99.17.90.06.99.46.99.3masterhalibut
Inherit LibWindowmanager to provide libwindowmanger function.
Qt application can also use LibWindowmanager functions.
Change-Id: Ifda50b84ea7b4a743867c02e8c6bc18f5a03d674
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
-rw-r--r-- | src/qlibwindowmanager.cpp | 18 | ||||
-rw-r--r-- | src/qlibwindowmanager.h | 3 |
2 files changed, 9 insertions, 12 deletions
diff --git a/src/qlibwindowmanager.cpp b/src/qlibwindowmanager.cpp index fff99c4..032ef8d 100644 --- a/src/qlibwindowmanager.cpp +++ b/src/qlibwindowmanager.cpp @@ -24,12 +24,12 @@ using namespace std; int QLibWindowmanager::init(int port, const QString &token) { string ctoken = token.toStdString(); - int ret_init = this->wm->init(port, ctoken); + int ret_init = LibWindowmanager::init(port, ctoken); this->screen_info = new AGLScreenInfoPrivate; if(ret_init == 0) { - struct Screen scrn = this->wm->getScreenInfo(); + struct Screen scrn = LibWindowmanager::getScreenInfo(); this->screen_info->set_width_dp(scrn.width_dp); this->screen_info->set_height_dp(scrn.height_dp); this->screen_info->set_width_mm(scrn.width_mm); @@ -42,7 +42,7 @@ int QLibWindowmanager::init(int port, const QString &token) { int QLibWindowmanager::requestSurface(const QString &role) { this->graphic_role = role.toStdString(); - int surface_id = this->wm->requestSurface(this->graphic_role.c_str()); + int surface_id = LibWindowmanager::requestSurface(this->graphic_role.c_str()); if(surface_id < 0){ qDebug("failed to get surfaceID"); return -1; @@ -59,18 +59,18 @@ int QLibWindowmanager::requestSurface(const QString &role) { int QLibWindowmanager::activateWindow(const QString &role) { string srole = role.toStdString(); // Request default drawing area "normal.full" in libwindowmanager - return this->wm->activateWindow(srole.c_str()); + return LibWindowmanager::activateWindow(srole.c_str()); } int QLibWindowmanager::activateWindow(const QString &role, const QString &area) { string srole = role.toStdString(); string sarea = area.toStdString(); - return this->wm->activateWindow(srole.c_str(), sarea.c_str()); + return LibWindowmanager::activateWindow(srole.c_str(), sarea.c_str()); } int QLibWindowmanager::deactivateWindow(const QString &role) { string srole = role.toStdString(); - return this->wm->deactivateWindow(srole.c_str()); + return LibWindowmanager::deactivateWindow(srole.c_str()); } // This API is deprecated, please use new API @@ -90,13 +90,13 @@ int QLibWindowmanager::deactivateSurface(const QString &role) { int QLibWindowmanager::endDraw(const QString &role) { string srole = role.toStdString(); - return this->wm->endDraw(srole.c_str()); + return LibWindowmanager::endDraw(srole.c_str()); } void QLibWindowmanager::set_event_handler(enum QEventType et, handler_fun f) { LibWindowmanager::EventType wet = (LibWindowmanager::EventType)et; - return this->wm->set_event_handler(wet, std::move(f)); + return LibWindowmanager::set_event_handler(wet, std::move(f)); } void QLibWindowmanager::slotActivateWindow(){ @@ -116,11 +116,9 @@ void QLibWindowmanager::slotActivateSurface(){ QLibWindowmanager::QLibWindowmanager(QObject *parent) :QObject(parent), isActive(false), screen_info(nullptr) { - wm = new LibWindowmanager(); } QLibWindowmanager::~QLibWindowmanager() { - delete wm; delete screen_info; }
\ No newline at end of file diff --git a/src/qlibwindowmanager.h b/src/qlibwindowmanager.h index e60f04f..6433463 100644 --- a/src/qlibwindowmanager.h +++ b/src/qlibwindowmanager.h @@ -57,7 +57,7 @@ class AGLScreenInfoPrivate double _scale = 1.0; }; -class QLibWindowmanager : public QObject{ +class QLibWindowmanager : public QObject, public LibWindowmanager{ Q_OBJECT public: explicit QLibWindowmanager(QObject *parent = nullptr); @@ -111,7 +111,6 @@ public slots: THIS_FUNCTION_IS_DEPRECATED(void slotActivateSurface()); private: - LibWindowmanager* wm; std::string graphic_role; bool isActive; AGLScreenInfoPrivate* screen_info; |