From 68f9ee7e0b3fdddfa42fa11a15d9ae84460d5e19 Mon Sep 17 00:00:00 2001 From: Rostislav Pehlivanov Date: Sun, 1 Oct 2017 21:16:49 +0100 Subject: wayland_common: rewrite from scratch The wayland code was written more than 4 years ago when wayland wasn't even at version 1.0. This commit rewrites everything in a more modern way, switches to using the new xdg v6 shell interface which solves a lot of bugs and makes mpv tiling-friedly, adds support for drag and drop, adds support for touchscreens, adds support for KDE's server decorations protocol, and finally adds support for the new idle-inhibitor protocol. It does not yet use the frame callback as a main rendering loop driver, this will happen with a later commit. --- waftools/generators/sources.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'waftools/generators') diff --git a/waftools/generators/sources.py b/waftools/generators/sources.py index 96224cf839..b0b423edda 100644 --- a/waftools/generators/sources.py +++ b/waftools/generators/sources.py @@ -9,6 +9,9 @@ def __zshcomp_cmd__(ctx, argument): return '"${{BIN_PERL}}" "{0}/TOOLS/zsh.pl" "{1}" > "${{TGT}}"' \ .format(ctx.srcnode.abspath(), argument) +def __wayland_scanner_cmd__(ctx, mode, dir, src): + return "${{WAYSCAN}} {0} < {1}/{2} > ${{TGT}}".format(mode, dir, src) + def __file2string__(ctx, **kwargs): ctx( rule = __file2string_cmd__(ctx), @@ -51,5 +54,24 @@ def __zshcomp__(ctx, **kwargs): **kwargs ) -BuildContext.file2string = __file2string__ -BuildContext.zshcomp = __zshcomp__ +def __wayland_protocol_code__(ctx, **kwargs): + ctx( + rule = __wayland_scanner_cmd__(ctx, 'code', kwargs['proto_dir'], + kwargs['protocol'] + '.xml'), + name = os.path.basename(kwargs['target']), + **kwargs + ) + +def __wayland_protocol_header__(ctx, **kwargs): + ctx( + rule = __wayland_scanner_cmd__(ctx, 'client-header', kwargs['proto_dir'], + kwargs['protocol'] + '.xml'), + before = ('c',), + name = os.path.basename(kwargs['target']), + **kwargs + ) + +BuildContext.file2string = __file2string__ +BuildContext.wayland_protocol_code = __wayland_protocol_code__ +BuildContext.wayland_protocol_header = __wayland_protocol_header__ +BuildContext.zshcomp = __zshcomp__ -- cgit v1.2.3