1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#include <wayland-server.h>
#include "util.h"
static void
wl_output_handle_bind(struct wl_client *client, void *data,
uint32_t version, uint32_t id)
{
// TODO
}
int main(void)
{
struct wl_display *display = wl_display_create();
if (!display) {
plog(PLOG_ERR, "Unable to create wayland display");
return 1;
}
const char *socket = wl_display_add_socket_auto(display);
if (!socket) {
plog(PLOG_ERR, "unbale to add socket to wayland display");
return 1;
}
const struct wl_interface interface = {
.name = "sneed",
.version = 60,
.method_count = 0,
.methods = NULL,
.event_count =0,
.events = NULL,
};
wl_global_create(display, &interface, 51, NULL, wl_output_handle_bind);
wl_global_create(display, &interface, 50, NULL, wl_output_handle_bind);
plog(PLOG_INFO, "Running wayland display on %s", socket);
wl_display_run(display);
wl_display_destroy(display);
return 0;
}
|