Fix compilation on host
[staging/windowmanager.git] / AFBClient.h
1 #ifndef AFBCLIENT_H
2 #define AFBCLIENT_H
3
4 #include <systemd/sd-event.h>
5
6 #ifdef AFB
7 #include <json-c/json.h>
8
9 #include "afb-wsj1.h"
10 #include "afb-ws-client.h"
11 #endif
12
13 class AFBClient
14 {
15 public:
16     AFBClient();
17     bool init();
18     void requestSurface(const char *label);
19     void activateSurface(const char *label);
20     void deactivateSurface(const char *label);
21     void endDraw(const char *label);
22
23 private:
24     void call(const char *api, const char *verb, const char *object);
25     void emitSignalOrCall(const char *api, const char *verb, const char *object);
26     void event(const char *event, const char *object);
27     void onCall(void *closure, struct afb_wsj1 *wsj1);
28     void onEvent(void *closure, const char *event, struct afb_wsj1_msg *msg);
29     void onHangup(void *closure, struct afb_wsj1 *wsj1);
30     void onReply(void *closure, struct afb_wsj1_msg *msg);
31
32     struct afb_wsj1 *wsj1;
33     sd_event *loop;
34     const char *wmURI = "ws://localhost:1700/api?wm";
35     const char *wmAPI = "winman";
36 };
37
38 #endif // AFBCLIENT_H