4 #include <systemd/sd-event.h>
10 #include <json-c/json.h>
13 #include "afb-ws-client.h"
21 AFBClient(const AFBClient &) = delete;
22 AFBClient &operator=(const AFBClient &) = delete;
34 static AFBClient &instance();
36 int init(int port, char const *token);
37 int dispatch(uint64_t timeout);
40 int requestSurface(const char *label);
41 int activateSurface(const char *label);
42 int deactivateSurface(const char *label);
43 int endDraw(const char *label);
45 void set_event_handler(enum EventType et,
46 std::function<void(char const *label)> f);
49 /// object will be json_object_put
50 int call(const char *verb, json_object *object,
51 std::function<void(bool ok, json_object*)> onReply);
53 struct afb_wsj1 *wsj1;
54 struct afb_wsj1_itf itf;