4 #include <systemd/sd-event.h>
10 #include <json-c/json.h>
13 #include "afb-ws-client.h"
19 AFBClient(const AFBClient& that) = delete;
32 static AFBClient &instance()
38 int init(int port, char const *token);
39 int dispatch(uint64_t timeout);
42 int requestSurface(const char *label);
43 int activateSurface(const char *label);
44 int deactivateSurface(const char *label);
45 int endDraw(const char *label);
47 void set_event_handler(enum EventType et, std::function<void(char const *label)> f);
49 static void onCall(void *closure, const char *api, const char *verb, struct afb_wsj1_msg *msg);
50 static void onEvent(void *closure, const char *event, struct afb_wsj1_msg *msg);
51 static void onHangup(void *closure, struct afb_wsj1 *wsj1);
52 static void onReply(void *closure, struct afb_wsj1_msg *msg);
55 void call(const char *api, const char *verb, const char *object);
56 void event(const char *event, const char *object);
58 struct afb_wsj1 *wsj1;
59 struct afb_wsj1_itf itf;
62 static const char *wmURI;
63 static const char *wmAPI;