From 4a2c73eca3713fa049c86d021aae27ac66c4e481 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Tue, 29 Aug 2017 13:48:10 +0200 Subject: [PATCH] WIP: add enddraw() and deacrivate_surface() implementations. Signed-off-by: Marcus Fritzsch --- AFBClient.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/AFBClient.cpp b/AFBClient.cpp index 6a57310..283e22c 100644 --- a/AFBClient.cpp +++ b/AFBClient.cpp @@ -67,7 +67,7 @@ int AFBClient::requestSurface(const char *label) bool is_not_set; }; - constexpr struct optional nullopt = {0, true}; + constexpr struct optional const nullopt = {0, true}; auto id = nullopt; /* send the request */ @@ -139,12 +139,20 @@ int AFBClient::dispatch(uint64_t timeout) { void AFBClient::deactivateSurface(const char *label) { - UNUSED(label); + json_object *j = json_object_new_object(); + json_object_object_add(j, "drawing_name", json_object_new_string(label)); + call(AFBClient::wmAPI, "deactivate_surface", json_object_to_json_string(j)); + json_object_put(j); + dispatch(-1); } void AFBClient::endDraw(const char *label) { - UNUSED(label); + json_object *j = json_object_new_object(); + json_object_object_add(j, "drawing_name", json_object_new_string(label)); + call(AFBClient::wmAPI, "enddraw", json_object_to_json_string(j)); + json_object_put(j); + dispatch(-1); } /* called when wsj1 receives a method invocation */ -- 2.16.6