diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-11-12 19:04:01 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-11-12 19:04:01 -0500 |
commit | bfcabe48ef3fc7a0388de007504fc232f826fb84 (patch) | |
tree | 8bef61a10259765dbafed49c9a2a76b4bf9ced2d /swaybg/main.c | |
parent | Merge branch 'master' of github.com:SirCmpwn/sway (diff) | |
download | sway-bfcabe48ef3fc7a0388de007504fc232f826fb84.tar.gz sway-bfcabe48ef3fc7a0388de007504fc232f826fb84.tar.zst sway-bfcabe48ef3fc7a0388de007504fc232f826fb84.zip |
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 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include <stdlib.h> | ||
3 | #include <wayland-client.h> | ||
4 | #include "client.h" | ||
5 | #include "log.h" | ||
6 | |||
7 | struct client_state *state; | ||
8 | |||
9 | void sway_terminate(void) { | ||
10 | client_teardown(state); | ||
11 | exit(1); | ||
12 | } | ||
2 | 13 | ||
3 | int main(int argc, char **argv) { | 14 | int main(int argc, char **argv) { |
4 | printf("Hello world"); | 15 | init_log(L_INFO); |
16 | state = client_setup(); | ||
17 | |||
18 | do { | ||
19 | if (!client_prerender(state)) continue; | ||
20 | cairo_set_source_rgb(state->cairo, 255, 0, 0); | ||
21 | cairo_rectangle(state->cairo, 0, 0, 100, 100); | ||
22 | cairo_fill(state->cairo); | ||
23 | } while (client_render(state)); | ||
24 | |||
25 | client_teardown(state); | ||
5 | return 0; | 26 | return 0; |
6 | } | 27 | } |