summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libwindowmanager.cpp41
-rw-r--r--src/libwindowmanager.h11
2 files changed, 36 insertions, 16 deletions
diff --git a/src/libwindowmanager.cpp b/src/libwindowmanager.cpp
index 21f7645..d264507 100644
--- a/src/libwindowmanager.cpp
+++ b/src/libwindowmanager.cpp
@@ -63,13 +63,13 @@ class LibWindowmanager::Impl {
const char *kKeyDrawingArea = "drawing_area";
// This is the LibWindowmanager interface impl
- int init(int port, char const *token);
+ int registerMyApplication(int port, char const *token);
// WM API
int requestSurface(json_object *object);
int requestSurfaceXDG(json_object *object);
- int activateSurface(json_object *object);
- int deactivateSurface(json_object *object);
+ int allocateWindowResource(json_object *object);
+ int releaseWindowResource(json_object *object);
int endDraw(json_object *object);
int getDisplayInfo(json_object *object);
@@ -178,7 +178,7 @@ LibWindowmanager::Impl::~Impl() {
sd_event_unref(loop);
}
-int LibWindowmanager::Impl::init(int port, char const *token) {
+int LibWindowmanager::Impl::registerMyApplication(int port, char const *token) {
TRACE();
HMI_DEBUG("libwm", "called");
@@ -335,12 +335,12 @@ int LibWindowmanager::Impl::requestSurfaceXDG(json_object *object) {
return rc;
}
-int LibWindowmanager::Impl::activateSurface(json_object *object) {
+int LibWindowmanager::Impl::allocateWindowResource(json_object *object) {
TRACE();
HMI_DEBUG("libwm", "called");
- return this->api_call("ActivateSurface", object, [](bool ok, json_object *j) {
+ return this->api_call("AllocateWindowResource", object, [](bool ok, json_object *j) {
if (!ok) {
- HMI_ERROR("libwm", "API Call activate_surface() failed: %s",
+ HMI_ERROR("libwm", "API Call allocateWindowResource() failed: %s",
j != nullptr ? json_object_to_json_string_ext(
j, JSON_C_TO_STRING_PRETTY)
: "no-info");
@@ -348,12 +348,12 @@ int LibWindowmanager::Impl::activateSurface(json_object *object) {
});
}
-int LibWindowmanager::Impl::deactivateSurface(json_object *object) {
+int LibWindowmanager::Impl::releaseWindowResource(json_object *object) {
TRACE();
HMI_DEBUG("libwm", "called");
- return this->api_call("DeactivateSurface", object, [](bool ok, json_object *j) {
+ return this->api_call("ReleaseWindowResource", object, [](bool ok, json_object *j) {
if (!ok) {
- HMI_ERROR("libwm", "API Call deactivate_surface() failed: %s",
+ HMI_ERROR("libwm", "API Call releaseWindowResource() failed: %s",
j != nullptr ? json_object_to_json_string_ext(
j, JSON_C_TO_STRING_PRETTY)
: "no-info");
@@ -725,8 +725,13 @@ int LibWindowmanager::Impl::runEventLoop() {
/**
* @class LibWindowmanager
*/
+int LibWindowmanager::registerMyApplication(int port, char const *token) {
+ return this->d->registerMyApplication(port, token);
+}
+
+// This API is old, please use new API.
int LibWindowmanager::init(int port, char const *token) {
- return this->d->init(port, token);
+ return this->registerMyApplication(port, token);
}
int LibWindowmanager::requestSurface(json_object *object) {
@@ -737,12 +742,22 @@ int LibWindowmanager::requestSurfaceXDG(json_object *object) {
return this->d->requestSurfaceXDG(object);
}
+int LibWindowmanager::allocateWindowResource(json_object *object) {
+ return this->d->allocateWindowResource(object);
+}
+
+int LibWindowmanager::releaseWindowResource(json_object *object) {
+ return this->d->releaseWindowResource(object);
+}
+
+// This API is old, please use new API.
int LibWindowmanager::activateSurface(json_object *object) {
- return this->d->activateSurface(object);
+ return this->allocateWindowResource(object);
}
+// This API is old, please use new API.
int LibWindowmanager::deactivateSurface(json_object *object) {
- return this->d->deactivateSurface(object);
+ return this->releaseWindowResource(object);
}
int LibWindowmanager::endDraw(json_object *object) {
diff --git a/src/libwindowmanager.h b/src/libwindowmanager.h
index b2b9496..ba885bb 100644
--- a/src/libwindowmanager.h
+++ b/src/libwindowmanager.h
@@ -54,13 +54,13 @@ public:
Event_FlushDraw,
};
- int init(int port, char const *token);
+ int registerMyApplication(int port, char const *token);
// WM API
int requestSurface(json_object *object);
int requestSurfaceXDG(json_object *object);
- int activateSurface(json_object *object);
- int deactivateSurface(json_object *object);
+ int allocateWindowResource(json_object *object);
+ int releaseWindowResource(json_object *object);
int endDraw(json_object *object);
int getDisplayInfo(json_object *object);
int getAreaInfo(json_object *in_obj, json_object *out_obj);
@@ -71,6 +71,11 @@ public:
struct Impl;
+ // This API is old, please use new API.
+ THIS_FUNCTION_IS_DEPRECATED(int init(int port, char const *token));
+ THIS_FUNCTION_IS_DEPRECATED(int activateSurface(json_object *object));
+ THIS_FUNCTION_IS_DEPRECATED(int deactivateSurface(json_object *object));
+
private:
Impl *const d;
};