diff options
Diffstat (limited to 'swaybg')
-rw-r--r-- | swaybg/CMakeLists.txt | 10 | ||||
-rw-r--r-- | swaybg/main.c | 23 |
2 files changed, 30 insertions, 3 deletions
diff --git a/swaybg/CMakeLists.txt b/swaybg/CMakeLists.txt index 89d8afde..9351441a 100644 --- a/swaybg/CMakeLists.txt +++ b/swaybg/CMakeLists.txt | |||
@@ -9,14 +9,20 @@ WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell "xdg-shell.xml" xdg-shell) | |||
9 | 9 | ||
10 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../bin/") | 10 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../bin/") |
11 | include_directories( | 11 | include_directories( |
12 | ${CMAKE_CURRENT_SOURCE_DIR}/include | 12 | ${CMAKE_CURRENT_SOURCE_DIR}/../include |
13 | ${WAYLAND_CLIENT_INCLUDE_DIR} | 13 | ${WAYLAND_CLIENT_INCLUDE_DIR} |
14 | ${CAIRO_INCLUDE_DIRS} | 14 | ${CAIRO_INCLUDE_DIRS} |
15 | ${PANGO_INCLUDE_DIRS} | 15 | ${PANGO_INCLUDE_DIRS} |
16 | ) | 16 | ) |
17 | 17 | ||
18 | FILE(GLOB sources ${PROJECT_SOURCE_DIR}/*.c) | ||
19 | FILE(GLOB wl_sources ${PROJECT_SOURCE_DIR}/../wayland/*.c) | ||
20 | FILE(GLOB common ${PROJECT_SOURCE_DIR}/../common/*.c) | ||
21 | |||
18 | add_executable(swaybg | 22 | add_executable(swaybg |
19 | main.c | 23 | ${sources} |
24 | ${wl_sources} | ||
25 | ${common} | ||
20 | ) | 26 | ) |
21 | 27 | ||
22 | TARGET_LINK_LIBRARIES(swaybg ${WAYLAND_CLIENT_LIBRARIES} ${CAIRO_LIBRARIES} ${PANGO_LIBRARIES}) | 28 | TARGET_LINK_LIBRARIES(swaybg ${WAYLAND_CLIENT_LIBRARIES} ${CAIRO_LIBRARIES} ${PANGO_LIBRARIES}) |
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 | } |