diff options
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/server.c b/server.c new file mode 100644 index 0000000..79b5f75 --- /dev/null +++ b/server.c @@ -0,0 +1,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; +} |