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