2015-11-12 14:31:47 +01:00
|
|
|
#include <stdio.h>
|
2015-11-13 01:04:01 +01:00
|
|
|
#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);
|
|
|
|
}
|
2015-11-12 14:31:47 +01:00
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
2015-11-13 01:04:01 +01:00
|
|
|
init_log(L_INFO);
|
|
|
|
state = client_setup();
|
|
|
|
|
2015-11-13 01:35:39 +01:00
|
|
|
uint8_t r = 0, g = 0, b = 0;
|
|
|
|
|
|
|
|
int rs;
|
2015-11-13 01:04:01 +01:00
|
|
|
do {
|
|
|
|
if (!client_prerender(state)) continue;
|
2015-11-13 01:35:39 +01:00
|
|
|
cairo_set_source_rgb(state->cairo, r, g, b);
|
2015-11-13 01:04:01 +01:00
|
|
|
cairo_rectangle(state->cairo, 0, 0, 100, 100);
|
|
|
|
cairo_fill(state->cairo);
|
2015-11-13 01:35:39 +01:00
|
|
|
|
|
|
|
rs = client_render(state);
|
|
|
|
|
|
|
|
if (rs == 1) {
|
|
|
|
sway_log(L_INFO, "rendering %d %d %d", r, g, b);
|
|
|
|
r++; g++; b++;
|
|
|
|
}
|
|
|
|
} while (rs);
|
2015-11-13 01:04:01 +01:00
|
|
|
|
|
|
|
client_teardown(state);
|
2015-11-12 14:31:47 +01:00
|
|
|
return 0;
|
|
|
|
}
|