forked from external/yambar
wayland: mucho wip: initial sort-of-working wayland backend
Bar is drawn, though only TOP is supported atm. No screen/display/output selection is possible yet. Mouse *click* works, but not setting the cursor. Lots of debug output, crappy code yada yada.
This commit is contained in:
parent
ff88d87ca8
commit
ed8e17c6c9
5 changed files with 658 additions and 10 deletions
|
@ -26,11 +26,14 @@ find_package(PkgConfig REQUIRED)
|
|||
pkg_check_modules(XCB REQUIRED xcb xcb-aux xcb-cursor xcb-event xcb-ewmh
|
||||
xcb-randr xcb-render)
|
||||
pkg_check_modules(XCB_ERRORS xcb-errors)
|
||||
pkg_check_modules(WAYLAND REQUIRED wayland-client wlroots)
|
||||
pkg_check_modules(FONTCONFIG REQUIRED fontconfig)
|
||||
pkg_check_modules(CAIRO REQUIRED cairo cairo-xcb cairo-ft)
|
||||
pkg_check_modules(YAML REQUIRED yaml-0.1)
|
||||
|
||||
add_library(bar-xcb STATIC xcb.c xcb.h bar/xcb.c bar/xcb.h)
|
||||
add_library(xcb-stuff STATIC EXCLUDE_FROM_ALL xcb.c xcb.h)
|
||||
|
||||
add_library(bar-xcb STATIC EXCLUDE_FROM_ALL bar/xcb.c bar/xcb.h)
|
||||
|
||||
target_compile_options(bar-xcb PRIVATE
|
||||
${XCB_CFLAGS_OTHER}
|
||||
|
@ -44,7 +47,49 @@ target_include_directories(bar-xcb PRIVATE
|
|||
${CAIRO_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(bar-xcb ${XCB_LIBRARIES} ${XCB_ERRORS_LIBRARIES})
|
||||
target_link_libraries(bar-xcb xcb-stuff ${XCB_LIBRARIES} ${XCB_ERRORS_LIBRARIES})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT wlr-layer-shell-unstable-v1.c
|
||||
COMMAND wayland-scanner private-code < /home/daniel/AUR/wlroots-git/src/wlroots-git/protocol/wlr-layer-shell-unstable-v1.xml > wlr-layer-shell-unstable-v1.c
|
||||
VERBATIM
|
||||
MAIN_DEPENDENCY /home/daniel/AUR/wlroots-git/src/wlroots-git/protocol/wlr-layer-shell-unstable-v1.xml
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT wlr-layer-shell-unstable-v1-client.h
|
||||
COMMAND wayland-scanner client-header < /home/daniel/AUR/wlroots-git/src/wlroots-git/protocol/wlr-layer-shell-unstable-v1.xml > wlr-layer-shell-unstable-v1-client.h
|
||||
VERBATIM
|
||||
MAIN_DEPENDENCY /home/daniel/AUR/wlroots-git/src/wlroots-git/protocol/wlr-layer-shell-unstable-v1.xml
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT xdg-shell.c
|
||||
COMMAND wayland-scanner private-code < /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml > xdg-shell.c
|
||||
VERBATIM
|
||||
MAIN_DEPENDENCY /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml
|
||||
)
|
||||
|
||||
add_library(wayland-protocols STATIC EXCLUDE_FROM_ALL
|
||||
wlr-layer-shell-unstable-v1-client.h
|
||||
wlr-layer-shell-unstable-v1.c
|
||||
xdg-shell.c
|
||||
)
|
||||
target_include_directories(wayland-protocols PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
add_library(bar-wayland STATIC EXCLUDE_FROM_ALL bar/wayland.c bar/wayland.h)
|
||||
target_compile_definitions(bar-wayland PRIVATE _GNU_SOURCE)
|
||||
target_compile_options(bar-wayland PRIVATE
|
||||
${WAYLAND_CFLAGS_OTHER}
|
||||
${CAIRO_CFLAGS_OTHER}
|
||||
)
|
||||
|
||||
target_include_directories(bar-wayland PRIVATE
|
||||
${CURRENT_BINARY_DIR}
|
||||
${WAYLAND_INCLUDE_DIRS}
|
||||
${CAIRO_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(bar-wayland wayland-protocols ${WAYLAND_LIBRARIES})
|
||||
|
||||
|
||||
add_executable(f00bar
|
||||
config.c config.h
|
||||
|
@ -63,7 +108,7 @@ add_executable(f00bar
|
|||
bar/bar.c bar/private.h bar/backend.h
|
||||
)
|
||||
|
||||
target_link_libraries(f00bar bar-xcb)
|
||||
target_link_libraries(f00bar xcb-stuff bar-xcb bar-wayland)
|
||||
|
||||
# Make global symbols in f00bar visible to dlopen:ed plugins
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue