AFBClient: TRACE() onReply too!
[staging/windowmanager.git] / AFBClient.h
index d776057..c6da6f7 100644 (file)
@@ -1,16 +1,13 @@
 #ifndef AFBCLIENT_H
 #define AFBCLIENT_H
 
-#include <systemd/sd-event.h>
-
 #include <functional>
 
 extern "C"
 {
-#include <json-c/json.h>
-
-#include "afb-wsj1.h"
-#include "afb-ws-client.h"
+   struct json_object;
+   struct afb_wsj1;
+   struct sd_event;
 }
 
 class AFBClient
@@ -42,14 +39,14 @@ public:
     int deactivateSurface(const char *label);
     int endDraw(const char *label);
 
-    void set_event_handler(enum EventType et, std::function<void(char const *label)> f);
+    void set_event_handler(enum EventType et,
+          std::function<void(char const *label)> f);
 
 private:
-    void call(const char *api, const char *verb, const char *object);
+    int call(const char *verb, json_object *object,
+          std::function<void(bool ok, json_object*)> onReply);
 
     struct afb_wsj1 *wsj1;
-    struct afb_wsj1_itf itf;
-
-    sd_event *loop;
+    struct sd_event *loop;
 };
 #endif // AFBCLIENT_H