diff options
author | Drew DeVault <[email protected]> | 2015-11-12 19:04:01 -0500 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2015-11-12 19:04:01 -0500 |
commit | bfcabe48ef3fc7a0388de007504fc232f826fb84 (patch) | |
tree | 8bef61a10259765dbafed49c9a2a76b4bf9ced2d /swaybg/main.c | |
parent | 5c4e98aa4ec9d7b8d0423d33734f7899fb548122 (diff) |
Start fleshing out wayland client implementation
This introduces a basic shared framework for making wayland clients
within sway itself.
Diffstat (limited to 'swaybg/main.c')
-rw-r--r-- | swaybg/main.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/swaybg/main.c b/swaybg/main.c index 4a8ef522..1b4af550 100644 --- a/swaybg/main.c +++ b/swaybg/main.c @@ -1,6 +1,27 @@ #include <stdio.h> +#include <stdlib.h> +#include <wayland-client.h> +#include "client.h" +#include "log.h" + +struct client_state *state; + +void sway_terminate(void) { + client_teardown(state); + exit(1); +} int main(int argc, char **argv) { - printf("Hello world"); + init_log(L_INFO); + state = client_setup(); + + do { + if (!client_prerender(state)) continue; + cairo_set_source_rgb(state->cairo, 255, 0, 0); + cairo_rectangle(state->cairo, 0, 0, 100, 100); + cairo_fill(state->cairo); + } while (client_render(state)); + + client_teardown(state); return 0; } |