summaryrefslogtreecommitdiffstats
path: root/src/qlibwindowmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qlibwindowmanager.cpp')
-rw-r--r--src/qlibwindowmanager.cpp36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/qlibwindowmanager.cpp b/src/qlibwindowmanager.cpp
index 4a6419e..b264c94 100644
--- a/src/qlibwindowmanager.cpp
+++ b/src/qlibwindowmanager.cpp
@@ -51,30 +51,45 @@ int QLibWindowmanager::requestSurface(const QString &label) {
}
}
-int QLibWindowmanager::activateSurface(const QString &label) {
+int QLibWindowmanager::activateWindow(const QString &label) {
json_object *obj = json_object_new_object();
string clabel = label.toStdString();
// Request default drawing area "normal.full"
string cdrawing_area = wm->kStrLayoutNormal + "." + wm->kStrAreaFull;
json_object_object_add(obj, wm->kKeyDrawingName, json_object_new_string(clabel.c_str()));
json_object_object_add(obj, wm->kKeyDrawingArea, json_object_new_string(cdrawing_area.c_str()));
- return this->wm->activateSurface(obj);
+ return this->wm->activateWindow(obj);
}
-int QLibWindowmanager::activateSurface(const QString &label, const QString &drawing_area) {
+int QLibWindowmanager::activateWindow(const QString &label, const QString &drawing_area) {
json_object *obj = json_object_new_object();
string clabel = label.toStdString();
string cdrawing_area = drawing_area.toStdString();
json_object_object_add(obj, wm->kKeyDrawingName, json_object_new_string(clabel.c_str()));
json_object_object_add(obj, wm->kKeyDrawingArea, json_object_new_string(cdrawing_area.c_str()));
- return this->wm->activateSurface(obj);
+ return this->wm->activateWindow(obj);
}
-int QLibWindowmanager::deactivateSurface(const QString &label) {
+int QLibWindowmanager::deactivateWindow(const QString &label) {
json_object *obj = json_object_new_object();
string clabel = label.toStdString();
json_object_object_add(obj, wm->kKeyDrawingName, json_object_new_string(clabel.c_str()));
- return this->wm->deactivateSurface(obj);
+ return this->wm->deactivateWindow(obj);
+}
+
+// This API is deprecated, please use new API
+int QLibWindowmanager::activateSurface(const QString &label) {
+ return this->activateWindow(label);
+}
+
+// This API is deprecated, please use new API
+int QLibWindowmanager::activateSurface(const QString &label, const QString &drawing_area) {
+ return this->activateWindow(label, drawing_area);
+}
+
+// This API is deprecated, please use new API
+int QLibWindowmanager::deactivateSurface(const QString &label) {
+ return this->deactivateWindow(label);
}
int QLibWindowmanager::endDraw(const QString &label) {
@@ -90,15 +105,20 @@ void QLibWindowmanager::set_event_handler(enum QEventType et,
return this->wm->set_event_handler(wet, std::move(f));
}
-void QLibWindowmanager::slotActivateSurface(){
+void QLibWindowmanager::slotActivateWindow(){
// This is needed for first rendering when the app is launched
if(!isActive){
qDebug("Let's show %s", qPrintable(applabel));
isActive = true;
- this->activateSurface(applabel);
+ this->activateWindow(applabel);
}
}
+// This API is deprecated, please use new API
+void QLibWindowmanager::slotActivateSurface(){
+ this->slotActivateWindow();
+}
+
QLibWindowmanager::QLibWindowmanager(QObject *parent)
:QObject(parent), isActive(false)
{