wayland backend init commit
This commit is contained in:
parent
9831c033fb
commit
843cc74c4c
12 changed files with 581 additions and 3 deletions
|
|
@ -1,4 +1,9 @@
|
|||
# $Id$
|
||||
use_backend("x11");
|
||||
|
||||
if(system("wayland-scanner -v >/dev/null 2>&1") == 0){
|
||||
use_backend("wayland", "x11");
|
||||
} else {
|
||||
use_backend("x11");
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
13
pl/rules.pl
13
pl/rules.pl
|
|
@ -27,6 +27,19 @@ if (grep(/^gdi$/, @backends)) {
|
|||
$gl_libs = "-lopengl32 -lglu32";
|
||||
}
|
||||
|
||||
if (grep(/^wayland$/, @backends)) {
|
||||
add_cflags("-DUSE_WAYLAND");
|
||||
new_object("src/backend/wayland.c");
|
||||
add_libs("-lwayland-client -lxkbcommon");
|
||||
|
||||
scan_wayland_protocol("stable", "xdg-shell","");
|
||||
scan_wayland_protocol("stable", "tablet","-v2");
|
||||
scan_wayland_protocol("staging", "cursor-shape","-v1");
|
||||
scan_wayland_protocol("unstable", "xdg-decoration","-unstable-v1");
|
||||
|
||||
$gl_libs = "-lGL -lGLU";
|
||||
}
|
||||
|
||||
if (param_get("stb-image")) {
|
||||
add_cflags("-DUSE_STB_IMAGE");
|
||||
}
|
||||
|
|
|
|||
17
pl/utils.pl
17
pl/utils.pl
|
|
@ -55,6 +55,23 @@ sub use_backend {
|
|||
}
|
||||
}
|
||||
|
||||
sub scan_wayland_protocol {
|
||||
my $tier = $_[0];
|
||||
my $proto = $_[1];
|
||||
my $ver = $_[2];
|
||||
|
||||
my $proto_c = "src/backend/wayland-${proto}-protocol.c";
|
||||
|
||||
if(system("wayland-scanner private-code /usr/share/wayland-protocols/${tier}/${proto}/${proto}${ver}.xml ${proto_c}") != 0) {
|
||||
print("^ Error on getting private code for /usr/share/wayland-protocols/${tier}/${proto}/${proto}${ver}.xml\n");
|
||||
} else {
|
||||
new_object($proto_c);
|
||||
};
|
||||
if(system("wayland-scanner client-header /usr/share/wayland-protocols/${tier}/${proto}/${proto}${ver}.xml include/Mw/LowLevel/Wayland/${proto}-client-protocol.h")) {
|
||||
print("^ Error on getting client header for /usr/share/wayland-protocols/${tier}/${proto}/${proto}${ver}.xml\n");
|
||||
};
|
||||
}
|
||||
|
||||
our %params = ();
|
||||
|
||||
sub param_set {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue