WIP: add enddraw() and deacrivate_surface() implementations.
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>
Tue, 29 Aug 2017 11:48:10 +0000 (13:48 +0200)
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>
Thu, 14 Sep 2017 12:04:43 +0000 (14:04 +0200)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
AFBClient.cpp

index 6a57310..283e22c 100644 (file)
@@ -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 */