Skip to content

Commit

Permalink
wip: devdraw: wayland support
Browse files Browse the repository at this point in the history
Absolutum obsoletum

Signed-off-by: Hank Donnay <[email protected]>
  • Loading branch information
hdonnay committed Apr 18, 2022
1 parent bab7b73 commit 0216ef3
Show file tree
Hide file tree
Showing 21 changed files with 4,998 additions and 1 deletion.
5 changes: 5 additions & 0 deletions bin/9l
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ then
fi
libsl="$libsl -lX11"
fi

if [ "x$needwayland" = xtrue -a "x$WSYSTYPE" != xnowsys ]
then
libsl="$(echo $libsl | sed 's/wayland/wayland-client -lwayland-cursor -lrt/')"
fi
fi
if $doautoframework
then
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/devdraw/mkfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ HFILES=\

<$PLAN9/src/mkone

<mkwayland

$O.drawclient: drawclient.$O
$LD -o $target $prereq

Expand Down
19 changes: 19 additions & 0 deletions src/cmd/devdraw/mkwayland
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
way_proto=/usr/share/wayland-protocols

xdg-shell-protocol.c: $way_proto/stable/xdg-shell/xdg-shell.xml
wayland-scanner private-code < $prereq > $target

xdg-shell-client-protocol.h: $way_proto/stable/xdg-shell/xdg-shell.xml
wayland-scanner client-header < $prereq > $target

xdg-decoration-protocol.c: $way_proto/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
wayland-scanner private-code < $prereq > $target

xdg-decoration-client-protocol.h: $way_proto/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
wayland-scanner client-header < $prereq > $target

pointer-constraints-client-protocol.h: $way_proto/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
wayland-scanner client-header < $prereq > $target

pointer-constraints-protocol.c: $way_proto/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
wayland-scanner private-code < $prereq > $target
9 changes: 9 additions & 0 deletions src/cmd/devdraw/mkwsysrules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ if [ "x$WSYSTYPE" = "x" ]; then
exit 1
fi
WSYSTYPE=mac
elif command -v wayland-scanner >/dev/null 2>&1; then
WSYSTYPE=wayland
elif [ -d "$X11" ]; then
WSYSTYPE=x11
else
Expand All @@ -54,6 +56,13 @@ if [ $WSYSTYPE = x11 ]; then
XO=`ls x11-*.c 2>/dev/null | sed 's/\.c$/.o/'`
echo 'WSYSOFILES=$WSYSOFILES '$XO
echo 'WSYSHFILES=x11-inc.h x11-keysym2ucs.h x11-memdraw.h'
elif [ $WSYSTYPE = wayland ]; then
protos='pointer-constraints xdg-decoration xdg-shell'
PROTOO=$(for p in $protos; do printf '%s-protocol.o ' $p; done; printf '\n'; )
PROTOH=$(for p in $protos; do printf '%s-client-protocol.h ' $p; done; printf '\n'; )
WAYO=`ls wayland-*.c 2>/dev/null | sed 's/\.c$/.o/' | paste -s -d ' '`
echo "WSYSOFILES=\$WSYSOFILES $WAYO $PROTOO"
echo "WSYSHFILES=wayland-inc.h $PROTOH"
elif [ $WSYSTYPE = mac ]; then
echo 'WSYSOFILES=$WSYSOFILES mac-draw.o mac-screen.o'
echo 'WSYSHFILES='
Expand Down
Loading

0 comments on commit 0216ef3

Please sign in to comment.