commit c703366

hovercats  ·  2024-08-18 11:54:42 +0000 UTC
parent 61fb779
import desktop set and friends
174 files changed,  +16049, -0
+111, -0
  1@@ -147,3 +147,114 @@
  2 [submodule "pkg/smu/src"]
  3 	path = pkg/smu/src
  4 	url = https://github.com/gottox/smu
  5+[submodule "pkg/libinput/src"]
  6+	path = pkg/libinput/src
  7+	url = https://github.com/oasislinux/libinput
  8+[submodule "pkg/mtdev/src"]
  9+	path = pkg/mtdev/src
 10+	url = http://bitmath.org/git/mtdev.git
 11+	ignore = all
 12+[submodule "pkg/libevdev/src"]
 13+	path = pkg/libevdev/src
 14+	url = https://gitlab.freedesktop.org/libevdev/libevdev.git
 15+	ignore = all
 16+[submodule "pkg/pixman/src"]
 17+	path = pkg/pixman/src
 18+	url = https://gitlab.freedesktop.org/pixman/pixman.git
 19+	ignore = all
 20+[submodule "pkg/dmenu/src"]
 21+	path = pkg/dmenu/src
 22+	url = git://git.suckless.org/dmenu
 23+	ignore = all
 24+[submodule "pkg/xkeyboard-config/src"]
 25+	path = pkg/xkeyboard-config/src
 26+	url = https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config.git
 27+[submodule "pkg/wld/src"]
 28+	path = pkg/wld/src
 29+	url = https://github.com/michaelforney/wld
 30+[submodule "pkg/wayland-protocols/src"]
 31+	path = pkg/wayland-protocols/src
 32+	url = https://gitlab.freedesktop.org/wayland/wayland-protocols.git
 33+[submodule "pkg/wayland/src"]
 34+	path = pkg/wayland/src
 35+	url = https://gitlab.freedesktop.org/wayland/wayland.git
 36+	ignore = all
 37+[submodule "pkg/velox/src"]
 38+	path = pkg/velox/src
 39+	url = https://github.com/michaelforney/velox
 40+[submodule "pkg/swc/src"]
 41+	path = pkg/swc/src
 42+	url = https://github.com/michaelforney/swc
 43+[submodule "pkg/utf8proc/src"]
 44+	path = pkg/utf8proc/src
 45+	url = https://github.com/JuliaLang/utf8proc
 46+[submodule "pkg/st/src"]
 47+	path = pkg/st/src
 48+	url = git://git.suckless.org/st
 49+	ignore = all
 50+[submodule "pkg/freetype/src"]
 51+	path = pkg/freetype/src
 52+	url = git://git.sv.nongnu.org/freetype/freetype2.git
 53+[submodule "pkg/jbig2dec/src"]
 54+	path = pkg/jbig2dec/src
 55+	url = git://git.ghostscript.com/jbig2dec.git
 56+[submodule "pkg/libffi/src"]
 57+	path = pkg/libffi/src
 58+	url = https://github.com/libffi/libffi
 59+	ignore = all
 60+[submodule "pkg/libpng/src"]
 61+	path = pkg/libpng/src
 62+	url = https://github.com/glennrp/libpng
 63+[submodule "pkg/mupdf/src"]
 64+	path = pkg/mupdf/src
 65+	url = https://github.com/oasislinux/mupdf.git
 66+[submodule "pkg/expat/src"]
 67+	path = pkg/expat/src
 68+	url = https://github.com/libexpat/libexpat
 69+[submodule "pkg/libxkbcommon/src"]
 70+	path = pkg/libxkbcommon/src
 71+	url = https://github.com/xkbcommon/libxkbcommon.git
 72+	ignore = all
 73+[submodule "pkg/libdrm/src"]
 74+	path = pkg/libdrm/src
 75+	url = https://anongit.freedesktop.org/git/mesa/drm.git
 76+[submodule "pkg/libjpeg-turbo/src"]
 77+	path = pkg/libjpeg-turbo/src
 78+	url = https://github.com/libjpeg-turbo/libjpeg-turbo
 79+[submodule "pkg/netsurf/src"]
 80+	path = pkg/netsurf/src
 81+	url = https://github.com/oasislinux/netsurf
 82+[submodule "pkg/netsurf/libcss/src"]
 83+	path = pkg/netsurf/libcss/src
 84+	url = git://git.netsurf-browser.org/libcss.git
 85+	ignore = all
 86+[submodule "pkg/netsurf/libdom/src"]
 87+	path = pkg/netsurf/libdom/src
 88+	url = git://git.netsurf-browser.org/libdom.git
 89+	ignore = all
 90+[submodule "pkg/netsurf/libhubbub/src"]
 91+	path = pkg/netsurf/libhubbub/src
 92+	url = git://git.netsurf-browser.org/libhubbub.git
 93+[submodule "pkg/netsurf/libnsbmp/src"]
 94+	path = pkg/netsurf/libnsbmp/src
 95+	url = git://git.netsurf-browser.org/libnsbmp.git
 96+[submodule "pkg/netsurf/libnsgif/src"]
 97+	path = pkg/netsurf/libnsgif/src
 98+	url = git://git.netsurf-browser.org/libnsgif.git
 99+[submodule "pkg/netsurf/libnsutils/src"]
100+	path = pkg/netsurf/libnsutils/src
101+	url = git://git.netsurf-browser.org/libnsutils.git
102+[submodule "pkg/netsurf/libparserutils/src"]
103+	path = pkg/netsurf/libparserutils/src
104+	url = git://git.netsurf-browser.org/libparserutils.git
105+[submodule "pkg/netsurf/libsvgtiny/src"]
106+	path = pkg/netsurf/libsvgtiny/src
107+	url = git://git.netsurf-browser.org/libsvgtiny.git
108+	ignore = all
109+[submodule "pkg/netsurf/libwapcaplet/src"]
110+	path = pkg/netsurf/libwapcaplet/src
111+	url = git://git.netsurf-browser.org/libwapcaplet.git
112+	ignore = all
113+[submodule "pkg/hotplugd/src"]
114+	path = pkg/hotplugd/src
115+	url = https://github.com/oasislinux/hotplugd.git
+23, -0
 1@@ -0,0 +1,23 @@
 2+/* See LICENSE file for copyright and license details. */
 3+/* Default settings; can be overriden by command line. */
 4+
 5+static int topbar = 1;                      /* -b  option; if 0, dmenu appears at bottom     */
 6+/* -fn option overrides fonts[0]; default X11 font or font set */
 7+static const char *fonts[] = {
 8+	"Terminus:pixelsize=14"
 9+};
10+static const char *prompt      = NULL;      /* -p  option; prompt to the left of input field */
11+static const char *colors[SchemeLast][2] = {
12+	/*     fg         bg       */
13+	[SchemeNorm] = { "#999999", "#1a1a1a" },
14+	[SchemeSel] = { "#ffffff", "#338833" },
15+	[SchemeOut] = { "#000000", "#aaffaa" },
16+};
17+/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
18+static unsigned int lines      = 0;
19+
20+/*
21+ * Characters not considered part of a word while deleting words
22+ * for example: " /?\"&[]"
23+ */
24+static const char worddelimiters[] = " ";
+43, -0
 1@@ -0,0 +1,43 @@
 2+cflags{
 3+	'-std=c99', '-Wall', '-Wpedantic', '-Wno-maybe-uninitialized',
 4+	'-D _POSIX_C_SOURCE=200809L',
 5+	[[-D 'VERSION="4.6"']],
 6+	'-I $dir',
 7+	'-isystem $builddir/pkg/fontconfig/include',
 8+	'-isystem $builddir/pkg/libxkbcommon/include',
 9+	'-isystem $builddir/pkg/pixman/include',
10+	'-isystem $builddir/pkg/swc/include',
11+	'-isystem $builddir/pkg/wayland/include',
12+	'-isystem $builddir/pkg/wld/include',
13+}
14+
15+pkg.deps = {
16+	'pkg/fontconfig/headers',
17+	'pkg/libxkbcommon/headers',
18+	'pkg/pixman/headers',
19+	'pkg/swc/headers',
20+	'pkg/wayland/headers',
21+	'pkg/wld/headers',
22+}
23+
24+exe('dmenu', [[
25+	dmenu.c drw.c util.c
26+	$builddir/pkg/(
27+		swc/swc-protocol.c.o
28+		libxkbcommon/libxkbcommon.a
29+		wld/libwld.a.d
30+		fontconfig/libfontconfig.a.d
31+		wayland/libwayland-client.a.d
32+	)
33+]])
34+file('bin/dmenu', '755', '$outdir/dmenu')
35+man{'dmenu.1'}
36+
37+exe('stest', {'stest.c'})
38+file('bin/stest', '755', '$outdir/stest')
39+man{'stest.1'}
40+
41+file('bin/dmenu_path', '755', '$srcdir/dmenu_path')
42+file('bin/dmenu_run', '755', '$srcdir/dmenu_run')
43+
44+fetch 'git'
+1285, -0
   1@@ -0,0 +1,1285 @@
   2+From d186aa8891ca777615b8138416c95565c05e0a09 Mon Sep 17 00:00:00 2001
   3+From: Michael Forney <mforney@mforney.org>
   4+Date: Thu, 27 Oct 2016 21:04:23 -0700
   5+Subject: [PATCH] Port to wayland using wld and swc panels
   6+
   7+---
   8+ Makefile  |  16 +-
   9+ config.mk |  20 +-
  10+ dmenu.c   | 566 ++++++++++++++++++++++++++++--------------------------
  11+ drw.c     | 130 ++++++-------
  12+ drw.h     |  26 ++-
  13+ 5 files changed, 381 insertions(+), 377 deletions(-)
  14+
  15+diff --git a/Makefile b/Makefile
  16+index a03a95c..4046899 100644
  17+--- a/Makefile
  18++++ b/Makefile
  19+@@ -3,7 +3,7 @@
  20+ 
  21+ include config.mk
  22+ 
  23+-SRC = drw.c dmenu.c stest.c util.c
  24++SRC = drw.c dmenu.c stest.c panel-protocol.c util.c
  25+ OBJ = $(SRC:.c=.o)
  26+ 
  27+ all: options dmenu stest
  28+@@ -20,10 +20,18 @@ options:
  29+ config.h:
  30+ 	cp config.def.h $@
  31+ 
  32+-$(OBJ): arg.h config.h config.mk drw.h
  33++swc-protocol.c: $(SWCPROTO)
  34++	@echo GEN $@
  35++	@wayland-scanner code < $< > $@
  36+ 
  37+-dmenu: dmenu.o drw.o util.o
  38+-	$(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS)
  39++swc-client-protocol.h: $(SWCPROTO)
  40++	@echo GEN $@
  41++	@wayland-scanner client-header < $< > $@
  42++
  43++$(OBJ): arg.h config.h config.mk drw.h swc-client-protocol.h
  44++
  45++dmenu: dmenu.o drw.o swc-protocol.o util.o
  46++	$(CC) -o $@ dmenu.o drw.o swc-protocol.o util.o $(LDFLAGS)
  47+ 
  48+ stest: stest.o
  49+ 	$(CC) -o $@ stest.o $(LDFLAGS)
  50+diff --git a/config.mk b/config.mk
  51+index 0929b4a..7e747ff 100644
  52+--- a/config.mk
  53++++ b/config.mk
  54+@@ -5,25 +5,15 @@ VERSION = 4.9
  55+ PREFIX = /usr/local
  56+ MANPREFIX = $(PREFIX)/share/man
  57+ 
  58+-X11INC = /usr/X11R6/include
  59+-X11LIB = /usr/X11R6/lib
  60+-
  61+-# Xinerama, comment if you don't want it
  62+-XINERAMALIBS  = -lXinerama
  63+-XINERAMAFLAGS = -DXINERAMA
  64+-
  65+-# freetype
  66+-FREETYPELIBS = -lfontconfig -lXft
  67+-FREETYPEINC = /usr/include/freetype2
  68+-# OpenBSD (uncomment)
  69+-#FREETYPEINC = $(X11INC)/freetype2
  70++PIXMANINC = /usr/include/pixman-1
  71++SWCPROTO = /usr/share/swc/swc.xml
  72+ 
  73+ # includes and libs
  74+-INCS = -I$(X11INC) -I$(FREETYPEINC)
  75+-LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS)
  76++INCS = -I$(PIXMANINC)
  77++LIBS = -lwayland-client -lxkbcommon -lwld
  78+ 
  79+ # flags
  80+-CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS)
  81++CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\"
  82+ CFLAGS   = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS)
  83+ LDFLAGS  = $(LIBS)
  84+ 
  85+diff --git a/dmenu.c b/dmenu.c
  86+index 6b8f51b..877c459 100644
  87+--- a/dmenu.c
  88++++ b/dmenu.c
  89+@@ -5,19 +5,18 @@
  90+ #include <stdlib.h>
  91+ #include <string.h>
  92+ #include <strings.h>
  93++#include <sys/mman.h>
  94+ #include <time.h>
  95+ #include <unistd.h>
  96+ 
  97+-#include <X11/Xlib.h>
  98+-#include <X11/Xatom.h>
  99+-#include <X11/Xutil.h>
 100+-#ifdef XINERAMA
 101+-#include <X11/extensions/Xinerama.h>
 102+-#endif
 103+-#include <X11/Xft/Xft.h>
 104++#include <wayland-client.h>
 105++#include <wld/wayland.h>
 106++#include <wld/wld.h>
 107++#include <xkbcommon/xkbcommon.h>
 108+ 
 109+ #include "drw.h"
 110+ #include "util.h"
 111++#include "swc-client-protocol.h"
 112+ 
 113+ /* macros */
 114+ #define INTERSECT(x,y,w,h,r)  (MAX(0, MIN((x)+(w),(r).x_org+(r).width)  - MAX((x),(r).x_org)) \
 115+@@ -34,8 +33,16 @@ struct item {
 116+ 	int out;
 117+ };
 118+ 
 119++struct xkb {
 120++	struct xkb_context *context;
 121++	struct xkb_state *state;
 122++	struct xkb_keymap *keymap;
 123++	xkb_mod_index_t ctrl, alt, shift;
 124++};
 125++
 126++static void paste(void);
 127++
 128+ static char text[BUFSIZ] = "";
 129+-static char *embed;
 130+ static int bh, mw, mh;
 131+ static int inputw = 0, promptw;
 132+ static int lrpad; /* sum of left and right padding */
 133+@@ -43,12 +50,21 @@ static size_t cursor;
 134+ static struct item *items = NULL;
 135+ static struct item *matches, *matchend;
 136+ static struct item *prev, *curr, *next, *sel;
 137+-static int mon = -1, screen;
 138+-
 139+-static Atom clip, utf8;
 140+-static Display *dpy;
 141+-static Window root, parentwin, win;
 142+-static XIC xic;
 143++static int mon = -1;
 144++
 145++static struct wl_display *dpy;
 146++static struct wl_compositor *compositor;
 147++static struct wl_keyboard *kbd;
 148++static struct wl_seat *seat;
 149++static struct wl_shell *shell;
 150++static struct wl_surface *surface;
 151++static struct wl_data_device_manager *datadevman;
 152++static struct wl_data_device *datadev;
 153++static struct wl_data_offer *seloffer;
 154++static struct swc_screen *screen;
 155++static struct swc_panel_manager *panelman;
 156++static struct swc_panel *panel;
 157++static struct xkb xkb;
 158+ 
 159+ static Drw *drw;
 160+ static Clr *scheme[SchemeLast];
 161+@@ -94,12 +110,10 @@ cleanup(void)
 162+ {
 163+ 	size_t i;
 164+ 
 165+-	XUngrabKey(dpy, AnyKey, AnyModifier, root);
 166+ 	for (i = 0; i < SchemeLast; i++)
 167+ 		free(scheme[i]);
 168+ 	drw_free(drw);
 169+-	XSync(dpy, False);
 170+-	XCloseDisplay(dpy);
 171++	wl_display_disconnect(dpy);
 172+ }
 173+ 
 174+ static char *
 175+@@ -133,6 +147,7 @@ drawmenu(void)
 176+ 	struct item *item;
 177+ 	int x = 0, y = 0, w;
 178+ 
 179++	wld_set_target_surface(drw->renderer, drw->surface);
 180+ 	drw_setscheme(drw, scheme[SchemeNorm]);
 181+ 	drw_rect(drw, 0, 0, mw, mh, 1, 1);
 182+ 
 183+@@ -172,42 +187,7 @@ drawmenu(void)
 184+ 			drw_text(drw, mw - w, 0, w, bh, lrpad / 2, ">", 0);
 185+ 		}
 186+ 	}
 187+-	drw_map(drw, win, 0, 0, mw, mh);
 188+-}
 189+-
 190+-static void
 191+-grabfocus(void)
 192+-{
 193+-	struct timespec ts = { .tv_sec = 0, .tv_nsec = 10000000  };
 194+-	Window focuswin;
 195+-	int i, revertwin;
 196+-
 197+-	for (i = 0; i < 100; ++i) {
 198+-		XGetInputFocus(dpy, &focuswin, &revertwin);
 199+-		if (focuswin == win)
 200+-			return;
 201+-		XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
 202+-		nanosleep(&ts, NULL);
 203+-	}
 204+-	die("cannot grab focus");
 205+-}
 206+-
 207+-static void
 208+-grabkeyboard(void)
 209+-{
 210+-	struct timespec ts = { .tv_sec = 0, .tv_nsec = 1000000  };
 211+-	int i;
 212+-
 213+-	if (embed)
 214+-		return;
 215+-	/* try to grab keyboard, we may have to wait for another process to ungrab */
 216+-	for (i = 0; i < 1000; i++) {
 217+-		if (XGrabKeyboard(dpy, DefaultRootWindow(dpy), True, GrabModeAsync,
 218+-		                  GrabModeAsync, CurrentTime) == GrabSuccess)
 219+-			return;
 220+-		nanosleep(&ts, NULL);
 221+-	}
 222+-	die("cannot grab keyboard");
 223++	drw_map(drw, surface, 0, 0, mw, mh);
 224+ }
 225+ 
 226+ static void
 227+@@ -305,111 +285,105 @@ movewordedge(int dir)
 228+ }
 229+ 
 230+ static void
 231+-keypress(XKeyEvent *ev)
 232++kbdkey(void *d, struct wl_keyboard *kbd, uint32_t serial, uint32_t time,
 233++       uint32_t key, uint32_t state)
 234+ {
 235+ 	char buf[32];
 236+ 	int len;
 237+-	KeySym ksym;
 238+-	Status status;
 239++	xkb_keysym_t ksym = XKB_KEY_NoSymbol;
 240++	int ctrl = xkb_state_mod_index_is_active(xkb.state, xkb.ctrl, XKB_STATE_MODS_EFFECTIVE);
 241++	int shift = xkb_state_mod_index_is_active(xkb.state, xkb.shift, XKB_STATE_MODS_EFFECTIVE);
 242++	int alt = xkb_state_mod_index_is_active(xkb.state, xkb.alt, XKB_STATE_MODS_EFFECTIVE);
 243+ 
 244+-	len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status);
 245+-	switch (status) {
 246+-	default: /* XLookupNone, XBufferOverflow */
 247+-		return;
 248+-	case XLookupChars:
 249+-		goto insert;
 250+-	case XLookupKeySym:
 251+-	case XLookupBoth:
 252+-		break;
 253+-	}
 254++	if (state == WL_KEYBOARD_KEY_STATE_RELEASED)
 255++		goto update_state;
 256+ 
 257+-	if (ev->state & ControlMask) {
 258++	ksym = xkb_state_key_get_one_sym(xkb.state, key + 8);
 259++	if (ctrl) {
 260+ 		switch(ksym) {
 261+-		case XK_a: ksym = XK_Home;      break;
 262+-		case XK_b: ksym = XK_Left;      break;
 263+-		case XK_c: ksym = XK_Escape;    break;
 264+-		case XK_d: ksym = XK_Delete;    break;
 265+-		case XK_e: ksym = XK_End;       break;
 266+-		case XK_f: ksym = XK_Right;     break;
 267+-		case XK_g: ksym = XK_Escape;    break;
 268+-		case XK_h: ksym = XK_BackSpace; break;
 269+-		case XK_i: ksym = XK_Tab;       break;
 270+-		case XK_j: /* fallthrough */
 271+-		case XK_J: /* fallthrough */
 272+-		case XK_m: /* fallthrough */
 273+-		case XK_M: ksym = XK_Return; ev->state &= ~ControlMask; break;
 274+-		case XK_n: ksym = XK_Down;      break;
 275+-		case XK_p: ksym = XK_Up;        break;
 276+-
 277+-		case XK_k: /* delete right */
 278++		case XKB_KEY_a: ksym = XKB_KEY_Home;      break;
 279++		case XKB_KEY_b: ksym = XKB_KEY_Left;      break;
 280++		case XKB_KEY_c: ksym = XKB_KEY_Escape;    break;
 281++		case XKB_KEY_d: ksym = XKB_KEY_Delete;    break;
 282++		case XKB_KEY_e: ksym = XKB_KEY_End;       break;
 283++		case XKB_KEY_f: ksym = XKB_KEY_Right;     break;
 284++		case XKB_KEY_g: ksym = XKB_KEY_Escape;    break;
 285++		case XKB_KEY_h: ksym = XKB_KEY_BackSpace; break;
 286++		case XKB_KEY_i: ksym = XKB_KEY_Tab;       break;
 287++		case XKB_KEY_j: /* fallthrough */
 288++		case XKB_KEY_J: /* fallthrough */
 289++		case XKB_KEY_m: /* fallthrough */
 290++		case XKB_KEY_M: ksym = XKB_KEY_Return; ctrl = 0; break;
 291++		case XKB_KEY_n: ksym = XKB_KEY_Down;      break;
 292++		case XKB_KEY_p: ksym = XKB_KEY_Up;        break;
 293++
 294++		case XKB_KEY_k: /* delete right */
 295+ 			text[cursor] = '\0';
 296+ 			match();
 297+ 			break;
 298+-		case XK_u: /* delete left */
 299++		case XKB_KEY_u: /* delete left */
 300+ 			insert(NULL, 0 - cursor);
 301+ 			break;
 302+-		case XK_w: /* delete word */
 303++		case XKB_KEY_w: /* delete word */
 304+ 			while (cursor > 0 && strchr(worddelimiters, text[nextrune(-1)]))
 305+ 				insert(NULL, nextrune(-1) - cursor);
 306+ 			while (cursor > 0 && !strchr(worddelimiters, text[nextrune(-1)]))
 307+ 				insert(NULL, nextrune(-1) - cursor);
 308+ 			break;
 309+-		case XK_y: /* paste selection */
 310+-		case XK_Y:
 311+-			XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY,
 312+-			                  utf8, utf8, win, CurrentTime);
 313++		case XKB_KEY_y: /* paste selection */
 314++		case XKB_KEY_Y:
 315++			paste();
 316+ 			return;
 317+-		case XK_Left:
 318++		case XKB_KEY_Left:
 319+ 			movewordedge(-1);
 320+ 			goto draw;
 321+-		case XK_Right:
 322++		case XKB_KEY_Right:
 323+ 			movewordedge(+1);
 324+ 			goto draw;
 325+-		case XK_Return:
 326+-		case XK_KP_Enter:
 327++		case XKB_KEY_Return:
 328++		case XKB_KEY_KP_Enter:
 329+ 			break;
 330+-		case XK_bracketleft:
 331++		case XKB_KEY_bracketleft:
 332+ 			cleanup();
 333+ 			exit(1);
 334+ 		default:
 335+ 			return;
 336+ 		}
 337+-	} else if (ev->state & Mod1Mask) {
 338++	} else if (alt) {
 339+ 		switch(ksym) {
 340+-		case XK_b:
 341++		case XKB_KEY_b:
 342+ 			movewordedge(-1);
 343+ 			goto draw;
 344+-		case XK_f:
 345++		case XKB_KEY_f:
 346+ 			movewordedge(+1);
 347+ 			goto draw;
 348+-		case XK_g: ksym = XK_Home;  break;
 349+-		case XK_G: ksym = XK_End;   break;
 350+-		case XK_h: ksym = XK_Up;    break;
 351+-		case XK_j: ksym = XK_Next;  break;
 352+-		case XK_k: ksym = XK_Prior; break;
 353+-		case XK_l: ksym = XK_Down;  break;
 354++		case XKB_KEY_g: ksym = XKB_KEY_Home;  break;
 355++		case XKB_KEY_G: ksym = XKB_KEY_End;   break;
 356++		case XKB_KEY_h: ksym = XKB_KEY_Up;    break;
 357++		case XKB_KEY_j: ksym = XKB_KEY_Next;  break;
 358++		case XKB_KEY_k: ksym = XKB_KEY_Prior; break;
 359++		case XKB_KEY_l: ksym = XKB_KEY_Down;  break;
 360+ 		default:
 361+ 			return;
 362+ 		}
 363+ 	}
 364+-
 365+-	switch(ksym) {
 366++	switch (ksym) {
 367+ 	default:
 368+-insert:
 369++		len = xkb_state_key_get_utf8(xkb.state, key + 8, buf, sizeof(buf));
 370+ 		if (!iscntrl(*buf))
 371+ 			insert(buf, len);
 372+ 		break;
 373+-	case XK_Delete:
 374++	case XKB_KEY_Delete:
 375+ 		if (text[cursor] == '\0')
 376+ 			return;
 377+ 		cursor = nextrune(+1);
 378+ 		/* fallthrough */
 379+-	case XK_BackSpace:
 380++	case XKB_KEY_BackSpace:
 381+ 		if (cursor == 0)
 382+ 			return;
 383+ 		insert(NULL, nextrune(-1) - cursor);
 384+ 		break;
 385+-	case XK_End:
 386++	case XKB_KEY_End:
 387+ 		if (text[cursor] != '\0') {
 388+ 			cursor = strlen(text);
 389+ 			break;
 390+@@ -425,10 +399,10 @@ insert:
 391+ 		}
 392+ 		sel = matchend;
 393+ 		break;
 394+-	case XK_Escape:
 395++	case XKB_KEY_Escape:
 396+ 		cleanup();
 397+ 		exit(1);
 398+-	case XK_Home:
 399++	case XKB_KEY_Home:
 400+ 		if (sel == matches) {
 401+ 			cursor = 0;
 402+ 			break;
 403+@@ -436,7 +410,7 @@ insert:
 404+ 		sel = curr = matches;
 405+ 		calcoffsets();
 406+ 		break;
 407+-	case XK_Left:
 408++	case XKB_KEY_Left:
 409+ 		if (cursor > 0 && (!sel || !sel->left || lines > 0)) {
 410+ 			cursor = nextrune(-1);
 411+ 			break;
 412+@@ -444,35 +418,35 @@ insert:
 413+ 		if (lines > 0)
 414+ 			return;
 415+ 		/* fallthrough */
 416+-	case XK_Up:
 417++	case XKB_KEY_Up:
 418+ 		if (sel && sel->left && (sel = sel->left)->right == curr) {
 419+ 			curr = prev;
 420+ 			calcoffsets();
 421+ 		}
 422+ 		break;
 423+-	case XK_Next:
 424++	case XKB_KEY_Next:
 425+ 		if (!next)
 426+ 			return;
 427+ 		sel = curr = next;
 428+ 		calcoffsets();
 429+ 		break;
 430+-	case XK_Prior:
 431++	case XKB_KEY_Prior:
 432+ 		if (!prev)
 433+ 			return;
 434+ 		sel = curr = prev;
 435+ 		calcoffsets();
 436+ 		break;
 437+-	case XK_Return:
 438+-	case XK_KP_Enter:
 439+-		puts((sel && !(ev->state & ShiftMask)) ? sel->text : text);
 440+-		if (!(ev->state & ControlMask)) {
 441++	case XKB_KEY_Return:
 442++	case XKB_KEY_KP_Enter:
 443++		puts((sel && !shift) ? sel->text : text);
 444++		if (!ctrl) {
 445+ 			cleanup();
 446+ 			exit(0);
 447+ 		}
 448+-		if (sel)
 449++		if(sel)
 450+ 			sel->out = 1;
 451+ 		break;
 452+-	case XK_Right:
 453++	case XKB_KEY_Right:
 454+ 		if (text[cursor] != '\0') {
 455+ 			cursor = nextrune(+1);
 456+ 			break;
 457+@@ -480,13 +454,13 @@ insert:
 458+ 		if (lines > 0)
 459+ 			return;
 460+ 		/* fallthrough */
 461+-	case XK_Down:
 462++	case XKB_KEY_Down:
 463+ 		if (sel && sel->right && (sel = sel->right) == next) {
 464+ 			curr = next;
 465+ 			calcoffsets();
 466+ 		}
 467+ 		break;
 468+-	case XK_Tab:
 469++	case XKB_KEY_Tab:
 470+ 		if (!sel)
 471+ 			return;
 472+ 		strncpy(text, sel->text, sizeof text - 1);
 473+@@ -498,24 +472,28 @@ insert:
 474+ 
 475+ draw:
 476+ 	drawmenu();
 477++
 478++update_state:
 479++	xkb_state_update_key(xkb.state, key + 8,
 480++			     state == WL_KEYBOARD_KEY_STATE_PRESSED ? XKB_KEY_DOWN : XKB_KEY_UP);
 481+ }
 482+ 
 483+ static void
 484+ paste(void)
 485+ {
 486+-	char *p, *q;
 487+-	int di;
 488+-	unsigned long dl;
 489+-	Atom da;
 490+-
 491+-	/* we have been given the current selection, now insert it into input */
 492+-	if (XGetWindowProperty(dpy, win, utf8, 0, (sizeof text / 4) + 1, False,
 493+-	                   utf8, &da, &di, &dl, &dl, (unsigned char **)&p)
 494+-	    == Success && p) {
 495+-		insert(p, (q = strchr(p, '\n')) ? q - p : (ssize_t)strlen(p));
 496+-		XFree(p);
 497++	int fds[2], len;
 498++	char buf[BUFSIZ], *nl;
 499++
 500++	if (seloffer) {
 501++		pipe(fds);
 502++		wl_data_offer_receive(seloffer, "text/plain", fds[1]);
 503++		wl_display_flush(dpy);
 504++		close(fds[1]);
 505++		while((len = read(fds[0], buf, sizeof buf)) > 0)
 506++			insert(buf, (nl = strchr(buf, '\n')) ? nl - buf : len);
 507++		close(fds[0]);
 508++		drawmenu();
 509+ 	}
 510+-	drawmenu();
 511+ }
 512+ 
 513+ static void
 514+@@ -550,148 +528,207 @@ readstdin(void)
 515+ static void
 516+ run(void)
 517+ {
 518+-	XEvent ev;
 519++	while (wl_display_dispatch(dpy) != -1)
 520++		;
 521++}
 522+ 
 523+-	while (!XNextEvent(dpy, &ev)) {
 524+-		if (XFilterEvent(&ev, None))
 525+-			continue;
 526+-		switch(ev.type) {
 527+-		case Expose:
 528+-			if (ev.xexpose.count == 0)
 529+-				drw_map(drw, win, 0, 0, mw, mh);
 530+-			break;
 531+-		case FocusIn:
 532+-			/* regrab focus from parent window */
 533+-			if (ev.xfocus.window != win)
 534+-				grabfocus();
 535+-			break;
 536+-		case KeyPress:
 537+-			keypress(&ev.xkey);
 538+-			break;
 539+-		case SelectionNotify:
 540+-			if (ev.xselection.property == utf8)
 541+-				paste();
 542+-			break;
 543+-		case VisibilityNotify:
 544+-			if (ev.xvisibility.state != VisibilityUnobscured)
 545+-				XRaiseWindow(dpy, win);
 546+-			break;
 547+-		}
 548++/* wayland event handlers */
 549++static void
 550++regglobal(void *d, struct wl_registry *r, uint32_t name, const char *interface, uint32_t version)
 551++{
 552++	if(strcmp(interface, "wl_compositor") == 0)
 553++		compositor = wl_registry_bind(r, name, &wl_compositor_interface, 1);
 554++	else if(strcmp(interface, "wl_shell") == 0)
 555++		shell = wl_registry_bind(r, name, &wl_shell_interface, 1);
 556++	else if(strcmp(interface, "wl_seat") == 0)
 557++		seat = wl_registry_bind(r, name, &wl_seat_interface, 1);
 558++	else if(strcmp(interface, "wl_data_device_manager") == 0)
 559++		datadevman = wl_registry_bind(r, name, &wl_data_device_manager_interface, 1);
 560++	else if(strcmp(interface, "swc_panel_manager") == 0)
 561++		panelman = wl_registry_bind(r, name, &swc_panel_manager_interface, 1);
 562++	else if (strcmp(interface, "swc_screen") == 0) {
 563++		if (mon != -1 && mon-- == 0)
 564++			screen = wl_registry_bind(r, name, &swc_screen_interface, 1);
 565+ 	}
 566+ }
 567+ 
 568++static void
 569++regglobalremove(void *d, struct wl_registry *reg, uint32_t name)
 570++{
 571++}
 572++
 573++static const struct wl_registry_listener reglistener = { regglobal, regglobalremove };
 574++
 575++static void
 576++kbdenter(void *data, struct wl_keyboard *kbd, uint32_t serial,
 577++         struct wl_surface *surface, struct wl_array *keys)
 578++{
 579++}
 580++
 581++static void
 582++kbdleave(void *d, struct wl_keyboard *kbd, uint32_t serial,
 583++         struct wl_surface *surface)
 584++{
 585++	/* XXX: swc doesn't handle refocusing panels, so just exit for now */
 586++	cleanup();
 587++	exit(1);
 588++}
 589++
 590++/* kbdkey is defined above to reduce merge conflicts */
 591++
 592++static void
 593++kbdkeymap(void *d, struct wl_keyboard *kbd, uint32_t format, int32_t fd, uint32_t size)
 594++{
 595++	char *string;
 596++
 597++	if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
 598++		close(fd);
 599++		return;
 600++	}
 601++
 602++	string = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
 603++
 604++	if (string == MAP_FAILED) {
 605++		close(fd);
 606++		return;
 607++	}
 608++
 609++	xkb.keymap = xkb_keymap_new_from_string(xkb.context, string,
 610++						XKB_KEYMAP_FORMAT_TEXT_V1, 0);
 611++	munmap(string, size);
 612++	close(fd);
 613++	xkb.state = xkb_state_new(xkb.keymap);
 614++
 615++	xkb.ctrl = xkb_keymap_mod_get_index(xkb.keymap, XKB_MOD_NAME_CTRL);
 616++	xkb.alt = xkb_keymap_mod_get_index(xkb.keymap, XKB_MOD_NAME_ALT);
 617++	xkb.shift = xkb_keymap_mod_get_index(xkb.keymap, XKB_MOD_NAME_SHIFT);
 618++}
 619++
 620++static void
 621++kbdmodifiers(void *d, struct wl_keyboard *kbd, uint32_t serial, uint32_t dep,
 622++             uint32_t lat, uint32_t lck, uint32_t grp)
 623++{
 624++	xkb_state_update_mask(xkb.state, dep, lat, lck, grp, 0, 0);
 625++}
 626++
 627++static const struct wl_keyboard_listener kbdlistener = {
 628++	kbdkeymap, kbdenter, kbdleave, kbdkey, kbdmodifiers,
 629++};
 630++
 631++static void
 632++dataofferoffer(void *d, struct wl_data_offer *offer, const char *mimetype)
 633++{
 634++	if (strncmp(mimetype, "text/plain", 10) == 0)
 635++		wl_data_offer_set_user_data(offer, (void *)(uintptr_t) 1);
 636++}
 637++
 638++static const struct wl_data_offer_listener dataofferlistener = { dataofferoffer };
 639++
 640++static void
 641++datadevoffer(void *d, struct wl_data_device *datadev, struct wl_data_offer *offer)
 642++{
 643++	wl_data_offer_add_listener(offer, &dataofferlistener, NULL);
 644++}
 645++
 646++static void
 647++datadeventer(void *d, struct wl_data_device *datadev, uint32_t serial,
 648++             struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y,
 649++             struct wl_data_offer *offer)
 650++{
 651++}
 652++
 653++static void
 654++datadevleave(void *d, struct wl_data_device *datadev)
 655++{
 656++}
 657++
 658++static void
 659++datadevmotion(void *d, struct wl_data_device *datadev, uint32_t time,
 660++              wl_fixed_t x, wl_fixed_t y)
 661++{
 662++}
 663++
 664++static void
 665++datadevdrop(void *d, struct wl_data_device *datadev)
 666++{
 667++}
 668++
 669++static void
 670++datadevselection(void *d, struct wl_data_device *datadev, struct wl_data_offer *offer)
 671++{
 672++	if (offer && (uintptr_t) wl_data_offer_get_user_data(offer) == 1)
 673++		seloffer = offer;
 674++}
 675++
 676++static const struct wl_data_device_listener datadevlistener = {
 677++	datadevoffer, datadeventer, datadevleave, datadevmotion, datadevdrop,
 678++	datadevselection,
 679++};
 680++
 681++static void
 682++paneldocked(void *d, struct swc_panel *panel, uint32_t length)
 683++{
 684++	mw = length;
 685++}
 686++
 687++static const struct swc_panel_listener panellistener = { paneldocked };
 688++
 689+ static void
 690+ setup(void)
 691+ {
 692+-	int x, y, i, j;
 693+-	unsigned int du;
 694+-	XSetWindowAttributes swa;
 695+-	XIM xim;
 696+-	Window w, dw, *dws;
 697+-	XWindowAttributes wa;
 698+-	XClassHint ch = {"dmenu", "dmenu"};
 699+-#ifdef XINERAMA
 700+-	XineramaScreenInfo *info;
 701+-	Window pw;
 702+-	int a, di, n, area = 0;
 703+-#endif
 704++	int j;
 705++
 706++	if (!compositor || !seat || !panelman)
 707++		exit(1);
 708++
 709++	kbd = wl_seat_get_keyboard(seat);
 710++	wl_keyboard_add_listener(kbd, &kbdlistener, NULL);
 711++	datadev = wl_data_device_manager_get_data_device(datadevman, seat);
 712++	wl_data_device_add_listener(datadev, &datadevlistener, NULL);
 713++
 714++	xkb.context = xkb_context_new(0);
 715++
 716+ 	/* init appearance */
 717+ 	for (j = 0; j < SchemeLast; j++)
 718+ 		scheme[j] = drw_scm_create(drw, colors[j], 2);
 719+ 
 720+-	clip = XInternAtom(dpy, "CLIPBOARD",   False);
 721+-	utf8 = XInternAtom(dpy, "UTF8_STRING", False);
 722+-
 723+ 	/* calculate menu geometry */
 724+-	bh = drw->fonts->h + 2;
 725++	bh = drw->fonts->wld->height + 2;
 726+ 	lines = MAX(lines, 0);
 727+ 	mh = (lines + 1) * bh;
 728+-#ifdef XINERAMA
 729+-	i = 0;
 730+-	if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
 731+-		XGetInputFocus(dpy, &w, &di);
 732+-		if (mon >= 0 && mon < n)
 733+-			i = mon;
 734+-		else if (w != root && w != PointerRoot && w != None) {
 735+-			/* find top-level window containing current input focus */
 736+-			do {
 737+-				if (XQueryTree(dpy, (pw = w), &dw, &w, &dws, &du) && dws)
 738+-					XFree(dws);
 739+-			} while (w != root && w != pw);
 740+-			/* find xinerama screen with which the window intersects most */
 741+-			if (XGetWindowAttributes(dpy, pw, &wa))
 742+-				for (j = 0; j < n; j++)
 743+-					if ((a = INTERSECT(wa.x, wa.y, wa.width, wa.height, info[j])) > area) {
 744+-						area = a;
 745+-						i = j;
 746+-					}
 747+-		}
 748+-		/* no focused window is on screen, so use pointer location instead */
 749+-		if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, &y, &di, &di, &du))
 750+-			for (i = 0; i < n; i++)
 751+-				if (INTERSECT(x, y, 1, 1, info[i]))
 752+-					break;
 753+-
 754+-		x = info[i].x_org;
 755+-		y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
 756+-		mw = info[i].width;
 757+-		XFree(info);
 758+-	} else
 759+-#endif
 760+-	{
 761+-		if (!XGetWindowAttributes(dpy, parentwin, &wa))
 762+-			die("could not get embedding window attributes: 0x%lx",
 763+-			    parentwin);
 764+-		x = 0;
 765+-		y = topbar ? 0 : wa.height - mh;
 766+-		mw = wa.width;
 767+-	}
 768++
 769++	/* create menu surface */
 770++	surface = wl_compositor_create_surface(compositor);
 771++
 772++	panel = swc_panel_manager_create_panel(panelman, surface);
 773++	swc_panel_add_listener(panel, &panellistener, NULL);
 774++	swc_panel_dock(panel, topbar ? SWC_PANEL_EDGE_TOP : SWC_PANEL_EDGE_BOTTOM, screen, 1);
 775++
 776++	wl_display_roundtrip(dpy);
 777++	if (!mw)
 778++		exit(1);
 779++
 780+ 	promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
 781+ 	inputw = MIN(inputw, mw/3);
 782+ 	match();
 783+ 
 784+-	/* create menu window */
 785+-	swa.override_redirect = True;
 786+-	swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
 787+-	swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
 788+-	win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0,
 789+-	                    CopyFromParent, CopyFromParent, CopyFromParent,
 790+-	                    CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
 791+-	XSetClassHint(dpy, win, &ch);
 792+-
 793+-	/* open input methods */
 794+-	xim = XOpenIM(dpy, NULL, NULL, NULL);
 795+-	xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
 796+-	                XNClientWindow, win, XNFocusWindow, win, NULL);
 797+-
 798+-	XMapRaised(dpy, win);
 799+-	XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
 800+-	if (embed) {
 801+-		XSelectInput(dpy, parentwin, FocusChangeMask);
 802+-		if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
 803+-			for (i = 0; i < du && dws[i] != win; ++i)
 804+-				XSelectInput(dpy, dws[i], FocusChangeMask);
 805+-			XFree(dws);
 806+-		}
 807+-		grabfocus();
 808+-	}
 809+-	drw_resize(drw, mw, mh);
 810++	drw_resize(drw, surface, mw, mh);
 811+ 	drawmenu();
 812+ }
 813+ 
 814+ static void
 815+ usage(void)
 816+ {
 817+-	fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
 818+-	      "             [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr);
 819++	fputs("usage: dmenu [-biv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
 820++	      "             [-nb color] [-nf color] [-sb color] [-sf color]\n", stderr);
 821+ 	exit(1);
 822+ }
 823+ 
 824+ int
 825+ main(int argc, char *argv[])
 826+ {
 827+-	XWindowAttributes wa;
 828+-	int i, fast = 0;
 829++	struct wl_registry *reg;
 830++	int i;
 831+ 
 832+ 	for (i = 1; i < argc; i++)
 833+ 		/* these options take no arguments */
 834+@@ -700,8 +737,6 @@ main(int argc, char *argv[])
 835+ 			exit(0);
 836+ 		} else if (!strcmp(argv[i], "-b")) /* appears at the bottom of the screen */
 837+ 			topbar = 0;
 838+-		else if (!strcmp(argv[i], "-f"))   /* grabs keyboard before reading stdin */
 839+-			fast = 1;
 840+ 		else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
 841+ 			fstrncmp = strncasecmp;
 842+ 			fstrstr = cistrstr;
 843+@@ -724,41 +759,28 @@ main(int argc, char *argv[])
 844+ 			colors[SchemeSel][ColBg] = argv[++i];
 845+ 		else if (!strcmp(argv[i], "-sf"))  /* selected foreground color */
 846+ 			colors[SchemeSel][ColFg] = argv[++i];
 847+-		else if (!strcmp(argv[i], "-w"))   /* embedding window id */
 848+-			embed = argv[++i];
 849+ 		else
 850+ 			usage();
 851+ 
 852+-	if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
 853++	if (!setlocale(LC_CTYPE, ""))
 854+ 		fputs("warning: no locale support\n", stderr);
 855+-	if (!XSetLocaleModifiers(""))
 856+-		fputs("warning: no locale modifiers support\n", stderr);
 857+-	if (!(dpy = XOpenDisplay(NULL)))
 858++	if (!(dpy = wl_display_connect(NULL)))
 859+ 		die("cannot open display");
 860+-	screen = DefaultScreen(dpy);
 861+-	root = RootWindow(dpy, screen);
 862+-	if (!embed || !(parentwin = strtol(embed, NULL, 0)))
 863+-		parentwin = root;
 864+-	if (!XGetWindowAttributes(dpy, parentwin, &wa))
 865+-		die("could not get embedding window attributes: 0x%lx",
 866+-		    parentwin);
 867+-	drw = drw_create(dpy, screen, root, wa.width, wa.height);
 868++	if (!(reg = wl_display_get_registry(dpy)))
 869++		die("cannot get registry");
 870++	wl_registry_add_listener(reg, &reglistener, NULL);
 871++	wl_display_roundtrip(dpy);
 872++	drw = drw_create(dpy);
 873+ 	if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
 874+ 		die("no fonts could be loaded.");
 875+-	lrpad = drw->fonts->h;
 876++	lrpad = drw->fonts->wld->height;
 877+ 
 878+ #ifdef __OpenBSD__
 879+ 	if (pledge("stdio rpath", NULL) == -1)
 880+ 		die("pledge");
 881+ #endif
 882+ 
 883+-	if (fast && !isatty(0)) {
 884+-		grabkeyboard();
 885+-		readstdin();
 886+-	} else {
 887+-		readstdin();
 888+-		grabkeyboard();
 889+-	}
 890++	readstdin();
 891+ 	setup();
 892+ 	run();
 893+ 
 894+diff --git a/drw.c b/drw.c
 895+index 8fd1ca4..e4995a6 100644
 896+--- a/drw.c
 897++++ b/drw.c
 898+@@ -2,8 +2,9 @@
 899+ #include <stdio.h>
 900+ #include <stdlib.h>
 901+ #include <string.h>
 902+-#include <X11/Xlib.h>
 903+-#include <X11/Xft/Xft.h>
 904++#include <wayland-client.h>
 905++#include <wld/wld.h>
 906++#include <wld/wayland.h>
 907+ 
 908+ #include "drw.h"
 909+ #include "util.h"
 910+@@ -61,40 +62,33 @@ utf8decode(const char *c, long *u, size_t clen)
 911+ }
 912+ 
 913+ Drw *
 914+-drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)
 915++drw_create(struct wl_display *dpy)
 916+ {
 917+ 	Drw *drw = ecalloc(1, sizeof(Drw));
 918+ 
 919+ 	drw->dpy = dpy;
 920+-	drw->screen = screen;
 921+-	drw->root = root;
 922+-	drw->w = w;
 923+-	drw->h = h;
 924+-	drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
 925+-	drw->gc = XCreateGC(dpy, root, 0, NULL);
 926+-	XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
 927++	drw->ctx = wld_wayland_create_context(dpy, WLD_ANY);
 928++	drw->renderer = wld_create_renderer(drw->ctx);
 929++	drw->fontctx = wld_font_create_context();
 930+ 
 931+ 	return drw;
 932+ }
 933+ 
 934+ void
 935+-drw_resize(Drw *drw, unsigned int w, unsigned int h)
 936++drw_resize(Drw *drw, struct wl_surface *surface, unsigned int w, unsigned int h)
 937+ {
 938+-	if (!drw)
 939+-		return;
 940+-
 941+-	drw->w = w;
 942+-	drw->h = h;
 943+-	if (drw->drawable)
 944+-		XFreePixmap(drw->dpy, drw->drawable);
 945+-	drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen));
 946++	if (drw->surface)
 947++		wld_destroy_surface(drw->surface);
 948++	drw->surface = wld_wayland_create_surface(drw->ctx, w, h, WLD_FORMAT_XRGB8888, 0, surface);
 949+ }
 950+ 
 951+ void
 952+ drw_free(Drw *drw)
 953+ {
 954+-	XFreePixmap(drw->dpy, drw->drawable);
 955+-	XFreeGC(drw->dpy, drw->gc);
 956++	wld_destroy_surface(drw->surface);
 957++	wld_destroy_renderer(drw->renderer);
 958++	wld_destroy_context(drw->ctx);
 959++	wld_font_destroy_context(drw->fontctx);
 960+ 	free(drw);
 961+ }
 962+ 
 963+@@ -102,11 +96,10 @@ drw_free(Drw *drw)
 964+  * drw_fontset_create instead.
 965+  */
 966+ static Fnt *
 967+-xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
 968++wldfont_create(Drw *drw, const char *fontname, FcPattern *pattern)
 969+ {
 970+ 	Fnt *font;
 971+-	XftFont *xfont = NULL;
 972+-	FcPattern *pattern = NULL;
 973++	struct wld_font *wld = NULL;
 974+ 
 975+ 	if (fontname) {
 976+ 		/* Using the pattern found at font->xfont->pattern does not yield the
 977+@@ -114,17 +107,17 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
 978+ 		 * FcNameParse; using the latter results in the desired fallback
 979+ 		 * behaviour whereas the former just results in missing-character
 980+ 		 * rectangles being drawn, at least with some fonts. */
 981+-		if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) {
 982++		if (!(wld = wld_font_open_name(drw->fontctx, fontname))) {
 983+ 			fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname);
 984+ 			return NULL;
 985+ 		}
 986+ 		if (!(pattern = FcNameParse((FcChar8 *) fontname))) {
 987+ 			fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname);
 988+-			XftFontClose(drw->dpy, xfont);
 989++			wld_font_close(wld);
 990+ 			return NULL;
 991+ 		}
 992+-	} else if (fontpattern) {
 993+-		if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) {
 994++	} else if (pattern) {
 995++		if (!(wld = wld_font_open_pattern(drw->fontctx, pattern))) {
 996+ 			fprintf(stderr, "error, cannot load font from pattern.\n");
 997+ 			return NULL;
 998+ 		}
 999+@@ -140,28 +133,26 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
1000+ 	 * and lots more all over the internet.
1001+ 	 */
1002+ 	FcBool iscol;
1003+-	if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
1004+-		XftFontClose(drw->dpy, xfont);
1005++	if(FcPatternGetBool(pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
1006++		wld_font_close(wld);
1007+ 		return NULL;
1008+ 	}
1009+ 
1010+ 	font = ecalloc(1, sizeof(Fnt));
1011+-	font->xfont = xfont;
1012++	font->wld = wld;
1013+ 	font->pattern = pattern;
1014+-	font->h = xfont->ascent + xfont->descent;
1015+-	font->dpy = drw->dpy;
1016+ 
1017+ 	return font;
1018+ }
1019+ 
1020+ static void
1021+-xfont_free(Fnt *font)
1022++wldfont_free(Fnt *font)
1023+ {
1024+ 	if (!font)
1025+ 		return;
1026+ 	if (font->pattern)
1027+ 		FcPatternDestroy(font->pattern);
1028+-	XftFontClose(font->dpy, font->xfont);
1029++	wld_font_close(font->wld);
1030+ 	free(font);
1031+ }
1032+ 
1033+@@ -175,7 +166,7 @@ drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount)
1034+ 		return NULL;
1035+ 
1036+ 	for (i = 1; i <= fontcount; i++) {
1037+-		if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) {
1038++		if ((cur = wldfont_create(drw, fonts[fontcount - i], NULL))) {
1039+ 			cur->next = ret;
1040+ 			ret = cur;
1041+ 		}
1042+@@ -188,7 +179,7 @@ drw_fontset_free(Fnt *font)
1043+ {
1044+ 	if (font) {
1045+ 		drw_fontset_free(font->next);
1046+-		xfont_free(font);
1047++		wldfont_free(font);
1048+ 	}
1049+ }
1050+ 
1051+@@ -197,10 +188,7 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
1052+ {
1053+ 	if (!drw || !dest || !clrname)
1054+ 		return;
1055+-
1056+-	if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
1057+-	                       DefaultColormap(drw->dpy, drw->screen),
1058+-	                       clrname, dest))
1059++	if (!(wld_lookup_named_color(clrname, dest)))
1060+ 		die("error, cannot allocate color '%s'", clrname);
1061+ }
1062+ 
1063+@@ -213,7 +201,7 @@ drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
1064+ 	Clr *ret;
1065+ 
1066+ 	/* need at least two colors for a scheme */
1067+-	if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor))))
1068++	if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(*ret))))
1069+ 		return NULL;
1070+ 
1071+ 	for (i = 0; i < clrcount; i++)
1072+@@ -240,11 +228,15 @@ drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int
1073+ {
1074+ 	if (!drw || !drw->scheme)
1075+ 		return;
1076+-	XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel);
1077++	Clr color = invert ? drw->scheme[ColBg] : drw->scheme[ColFg];
1078+ 	if (filled)
1079+-		XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
1080+-	else
1081+-		XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1);
1082++		wld_fill_rectangle(drw->renderer, color, x, y, w, h);
1083++	else {
1084++		wld_fill_rectangle(drw->renderer, color, x, y, w, 1);
1085++		wld_fill_rectangle(drw->renderer, color, x + w - 1, y + 1, 1, h - 2);
1086++		wld_fill_rectangle(drw->renderer, color, x, y + 1, 1, h - 2);
1087++		wld_fill_rectangle(drw->renderer, color, x, y + h - 1, w, 1);
1088++	}
1089+ }
1090+ 
1091+ int
1092+@@ -253,7 +245,6 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
1093+ 	char buf[1024];
1094+ 	int ty;
1095+ 	unsigned int ew;
1096+-	XftDraw *d = NULL;
1097+ 	Fnt *usedfont, *curfont, *nextfont;
1098+ 	size_t i, len;
1099+ 	int utf8strlen, utf8charlen, render = x || y || w || h;
1100+@@ -262,7 +253,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
1101+ 	FcCharSet *fccharset;
1102+ 	FcPattern *fcpattern;
1103+ 	FcPattern *match;
1104+-	XftResult result;
1105++	FcResult result;
1106+ 	int charexists = 0;
1107+ 
1108+ 	if (!drw || (render && !drw->scheme) || !text || !drw->fonts)
1109+@@ -271,11 +262,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
1110+ 	if (!render) {
1111+ 		w = ~w;
1112+ 	} else {
1113+-		XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
1114+-		XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
1115+-		d = XftDrawCreate(drw->dpy, drw->drawable,
1116+-		                  DefaultVisual(drw->dpy, drw->screen),
1117+-		                  DefaultColormap(drw->dpy, drw->screen));
1118++		wld_fill_rectangle(drw->renderer, drw->scheme[invert ? ColFg : ColBg], x, y, w, h);
1119+ 		x += lpad;
1120+ 		w -= lpad;
1121+ 	}
1122+@@ -288,7 +275,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
1123+ 		while (*text) {
1124+ 			utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ);
1125+ 			for (curfont = drw->fonts; curfont; curfont = curfont->next) {
1126+-				charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint);
1127++				charexists = charexists || wld_font_ensure_char(curfont->wld,  utf8codepoint);
1128+ 				if (charexists) {
1129+ 					if (curfont == usedfont) {
1130+ 						utf8strlen += utf8charlen;
1131+@@ -320,9 +307,9 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
1132+ 						; /* NOP */
1133+ 
1134+ 				if (render) {
1135+-					ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent;
1136+-					XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg],
1137+-					                  usedfont->xfont, x, ty, (XftChar8 *)buf, len);
1138++					ty = y + (h - usedfont->wld->height) / 2 + usedfont->wld->ascent;
1139++					wld_draw_text(drw->renderer, usedfont->wld, drw->scheme[invert ? ColBg : ColFg],
1140++					              x, ty, buf, len, NULL);
1141+ 				}
1142+ 				x += ew;
1143+ 				w -= ew;
1144+@@ -343,7 +330,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
1145+ 			FcCharSetAddChar(fccharset, utf8codepoint);
1146+ 
1147+ 			if (!drw->fonts->pattern) {
1148+-				/* Refer to the comment in xfont_create for more information. */
1149++				/* Refer to the comment in wldfont_create for more information. */
1150+ 				die("the first font in the cache must be loaded from a font string.");
1151+ 			}
1152+ 
1153+@@ -354,38 +341,37 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
1154+ 
1155+ 			FcConfigSubstitute(NULL, fcpattern, FcMatchPattern);
1156+ 			FcDefaultSubstitute(fcpattern);
1157+-			match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result);
1158++			match = FcFontMatch(NULL, fcpattern, &result);
1159+ 
1160+ 			FcCharSetDestroy(fccharset);
1161+ 			FcPatternDestroy(fcpattern);
1162+ 
1163+ 			if (match) {
1164+-				usedfont = xfont_create(drw, NULL, match);
1165+-				if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) {
1166++				usedfont = wldfont_create(drw, NULL, match);
1167++				if (usedfont && wld_font_ensure_char(usedfont->wld, utf8codepoint)) {
1168+ 					for (curfont = drw->fonts; curfont->next; curfont = curfont->next)
1169+ 						; /* NOP */
1170+ 					curfont->next = usedfont;
1171+ 				} else {
1172+-					xfont_free(usedfont);
1173++					wldfont_free(usedfont);
1174+ 					usedfont = drw->fonts;
1175+ 				}
1176+ 			}
1177+ 		}
1178+ 	}
1179+-	if (d)
1180+-		XftDrawDestroy(d);
1181+ 
1182+ 	return x + (render ? w : 0);
1183+ }
1184+ 
1185+ void
1186+-drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
1187++drw_map(Drw *drw, struct wl_surface *surface, int x, int y, unsigned int w, unsigned int h)
1188+ {
1189+ 	if (!drw)
1190+ 		return;
1191+ 
1192+-	XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y);
1193+-	XSync(drw->dpy, False);
1194++	wl_surface_damage(surface, x, y, w, h);
1195++	wld_flush(drw->renderer);
1196++	wld_swap(drw->surface);
1197+ }
1198+ 
1199+ unsigned int
1200+@@ -399,18 +385,19 @@ drw_fontset_getwidth(Drw *drw, const char *text)
1201+ void
1202+ drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h)
1203+ {
1204+-	XGlyphInfo ext;
1205++	struct wld_extents ext;
1206+ 
1207+ 	if (!font || !text)
1208+ 		return;
1209+ 
1210+-	XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext);
1211++	wld_font_text_extents_n(font->wld, text, len, &ext);
1212+ 	if (w)
1213+-		*w = ext.xOff;
1214++		*w = ext.advance;
1215+ 	if (h)
1216+-		*h = font->h;
1217++		*h = font->wld->height;
1218+ }
1219+ 
1220++#if 0
1221+ Cur *
1222+ drw_cur_create(Drw *drw, int shape)
1223+ {
1224+@@ -433,3 +420,4 @@ drw_cur_free(Drw *drw, Cur *cursor)
1225+ 	XFreeCursor(drw->dpy, cursor->cursor);
1226+ 	free(cursor);
1227+ }
1228++#endif
1229+diff --git a/drw.h b/drw.h
1230+index 4c67419..1f1967e 100644
1231+--- a/drw.h
1232++++ b/drw.h
1233+@@ -1,34 +1,30 @@
1234+ /* See LICENSE file for copyright and license details. */
1235+ 
1236+-typedef struct {
1237+-	Cursor cursor;
1238+-} Cur;
1239++typedef void Cur;
1240+ 
1241+ typedef struct Fnt {
1242+-	Display *dpy;
1243+-	unsigned int h;
1244+-	XftFont *xfont;
1245++	struct wld_font *wld;
1246+ 	FcPattern *pattern;
1247+ 	struct Fnt *next;
1248+ } Fnt;
1249+ 
1250+ enum { ColFg, ColBg }; /* Clr scheme index */
1251+-typedef XftColor Clr;
1252++typedef uint32_t Clr;
1253+ 
1254+ typedef struct {
1255+ 	unsigned int w, h;
1256+-	Display *dpy;
1257+-	int screen;
1258+-	Window root;
1259+-	Drawable drawable;
1260+-	GC gc;
1261++	struct wl_display *dpy;
1262++	struct wld_context *ctx;
1263++	struct wld_renderer *renderer;
1264++	struct wld_surface *surface;
1265++	struct wld_font_context *fontctx;
1266+ 	Clr *scheme;
1267+ 	Fnt *fonts;
1268+ } Drw;
1269+ 
1270+ /* Drawable abstraction */
1271+-Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
1272+-void drw_resize(Drw *drw, unsigned int w, unsigned int h);
1273++Drw *drw_create(struct wl_display *dpy);
1274++void drw_resize(Drw *drw, struct wl_surface *surface, unsigned int w, unsigned int h);
1275+ void drw_free(Drw *drw);
1276+ 
1277+ /* Fnt abstraction */
1278+@@ -54,4 +50,4 @@ void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled
1279+ int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert);
1280+ 
1281+ /* Map functions */
1282+-void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h);
1283++void drw_map(Drw *drw, struct wl_surface *surface, int x, int y, unsigned int w, unsigned int h);
1284+-- 
1285+2.30.1
1286+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 65be875f5adf31e9c4762ac8a8d74b1dfdd78584
+1, -0
1@@ -0,0 +1 @@
2+4.9 r4
+9, -0
 1@@ -0,0 +1,9 @@
 2+# expat
 3+
 4+## config.h
 5+Generated with
 6+
 7+	./configure \
 8+		CPPFLAGS=-I/src/oasis/pkg/openbsd/include \
 9+		LDFLAGS='-L/src/oasis/pkg/openbsd' \
10+		LIBS='-lbsd'
+50, -0
 1@@ -0,0 +1,50 @@
 2+/* #undef AC_APPLE_UNIVERSAL_BUILD */
 3+#define BYTEORDER 1234
 4+/* #undef HAVE_ARC4RANDOM */
 5+#define HAVE_ARC4RANDOM_BUF 1
 6+#define HAVE_CXX11 1
 7+#define HAVE_DLFCN_H 1
 8+#define HAVE_FCNTL_H 1
 9+#define HAVE_GETPAGESIZE 1
10+#define HAVE_GETRANDOM 1
11+#define HAVE_INTTYPES_H 1
12+/* #undef HAVE_LIBBSD */
13+#define HAVE_MMAP 1
14+#define HAVE_STDINT_H 1
15+#define HAVE_STDIO_H 1
16+#define HAVE_STDLIB_H 1
17+#define HAVE_STRINGS_H 1
18+#define HAVE_STRING_H 1
19+#define HAVE_SYSCALL_GETRANDOM 1
20+#define HAVE_SYS_PARAM_H 1
21+#define HAVE_SYS_STAT_H 1
22+#define HAVE_SYS_TYPES_H 1
23+#define HAVE_UNISTD_H 1
24+#define LT_OBJDIR ".libs/"
25+#define PACKAGE "expat"
26+#define PACKAGE_BUGREPORT "https://github.com/libexpat/libexpat/issues"
27+#define PACKAGE_NAME "expat"
28+#define PACKAGE_STRING "expat 2.6.2"
29+#define PACKAGE_TARNAME "expat"
30+#define PACKAGE_URL ""
31+#define PACKAGE_VERSION "2.6.2"
32+#define STDC_HEADERS 1
33+#define VERSION "2.6.2"
34+#if defined AC_APPLE_UNIVERSAL_BUILD
35+# if defined __BIG_ENDIAN__
36+#  define WORDS_BIGENDIAN 1
37+# endif
38+#else
39+# ifndef WORDS_BIGENDIAN
40+/* #  undef WORDS_BIGENDIAN */
41+# endif
42+#endif
43+/* #undef XML_ATTR_INFO */
44+#define XML_CONTEXT_BYTES 1024
45+#define XML_DEV_URANDOM 1
46+#define XML_DTD 1
47+#define XML_GE 1
48+#define XML_NS 1
49+/* #undef const */
50+/* #undef off_t */
51+/* #undef size_t */
+18, -0
 1@@ -0,0 +1,18 @@
 2+cflags{
 3+	'-std=c99', '-Wall',
 4+	'-D HAVE_EXPAT_CONFIG_H',
 5+	'-I $dir',
 6+	'-I $basedir/pkg/openbsd/include',
 7+}
 8+
 9+lib('libexpat.a', [[
10+	expat/lib/(xmlparse.c xmltok.c xmlrole.c)
11+	$builddir/pkg/openbsd/libbsd.a.d
12+]])
13+
14+pkg.hdrs = copy('$outdir/include', '$srcdir/expat/lib', {
15+	'expat.h',
16+	'expat_external.h',
17+})
18+
19+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit fa75b96546c069d17b8f80d91e0f4ef0cde3790d
+1, -0
1@@ -0,0 +1 @@
2+2.6.2 r0
+2, -0
1@@ -0,0 +1,2 @@
2+/fontconfig-2.13.1.tar.gz
3+/src
+18, -0
 1@@ -0,0 +1,18 @@
 2+# fontconfig
 3+
 4+fontconfig is used by only dmenu, st, velox, and wld. It should be removed after
 5+updating those programs to just open font files directly.
 6+
 7+## config.h
 8+
 9+Generated with
10+
11+	./configure \
12+		--disable-nls \
13+		--with-default-fonts=/share/fonts \
14+		FREETYPE_CFLAGS=-I/src/oasis/out/pkg/freetype/include \
15+		FREETYPE_LIBS=/src/oasis/out/pkg/freetype/libfreetype.a \
16+		UUID_CFLAGS=-I/src/oasis/out/pkg/util-linux/include \
17+		UUID_LIBS=/src/oasis/out/pkg/util-linux/libuuid.a \
18+		EXPAT_CFLAGS=-I/src/oasis/out/pkg/expat/include \
19+		EXPAT_LIBS='/src/oasis/out/pkg/expat/libexpat.a /src/oasis/out/pkg/openbsd/libbsd.a'
+143, -0
  1@@ -0,0 +1,143 @@
  2+#define FC_CACHEDIR "/var/cache/fontconfig"
  3+#define FC_NO_MT /* we don't use fontconfig in multi-threaded programs */
  4+#define FC_TEMPLATEDIR "/share/fontconfig/conf.avail"
  5+#define FONTCONFIG_PATH "/etc/fonts"
  6+
  7+/* #undef AC_APPLE_UNIVERSAL_BUILD */
  8+#define ALIGNOF_DOUBLE 8
  9+#define ALIGNOF_VOID_P 8
 10+/* #undef ENABLE_LIBXML2 */
 11+/* #undef ENABLE_NLS */
 12+#define FC_ADD_FONTS "yes"
 13+/* #undef FC_ARCHITECTURE */
 14+#define FC_DEFAULT_FONTS "/share/fonts"
 15+#define FC_GPERF_SIZE_T size_t
 16+#define FLEXIBLE_ARRAY_MEMBER /**/
 17+#define GETTEXT_PACKAGE "fontconfig"
 18+/* #undef HAVE_CFLOCALECOPYCURRENT */
 19+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
 20+/* #undef HAVE_DCGETTEXT */
 21+#define HAVE_DIRENT_H 1
 22+#define HAVE_DLFCN_H 1
 23+/* #undef HAVE_DOPRNT */
 24+#define HAVE_FCNTL_H 1
 25+#define HAVE_FSTATFS 1
 26+#define HAVE_FSTATVFS 1
 27+#define HAVE_FT_DONE_MM_VAR 1
 28+#define HAVE_FT_GET_BDF_PROPERTY 1
 29+#define HAVE_FT_GET_PS_FONT_INFO 1
 30+#define HAVE_FT_GET_X11_FONT_FORMAT 1
 31+#define HAVE_FT_HAS_PS_GLYPH_NAMES 1
 32+/* #undef HAVE_GETEXECNAME */
 33+#define HAVE_GETOPT 1
 34+#define HAVE_GETOPT_LONG 1
 35+#define HAVE_GETPAGESIZE 1
 36+/* #undef HAVE_GETPROGNAME */
 37+/* #undef HAVE_GETTEXT */
 38+/* #undef HAVE_ICONV */
 39+#define HAVE_INTEL_ATOMIC_PRIMITIVES 1
 40+#define HAVE_INTTYPES_H 1
 41+#define HAVE_LINK 1
 42+#define HAVE_LRAND48 1
 43+#define HAVE_LSTAT 1
 44+#define HAVE_MEMORY_H 1
 45+#define HAVE_MKDTEMP 1
 46+#define HAVE_MKOSTEMP 1
 47+#define HAVE_MKSTEMP 1
 48+#define HAVE_MMAP 1
 49+/* #undef HAVE_NDIR_H */
 50+#define HAVE_POSIX_FADVISE 1
 51+#define HAVE_PTHREAD 1
 52+#define HAVE_PTHREAD_PRIO_INHERIT 1
 53+#define HAVE_RAND 1
 54+#define HAVE_RANDOM 1
 55+/* #undef HAVE_RANDOM_R */
 56+#define HAVE_RAND_R 1
 57+#define HAVE_READLINK 1
 58+/* #undef HAVE_SCHED_H */
 59+/* #undef HAVE_SCHED_YIELD */
 60+/* #undef HAVE_SOLARIS_ATOMIC_OPS */
 61+#define HAVE_STDINT_H 1
 62+#define HAVE_STDLIB_H 1
 63+#define HAVE_STRERROR 1
 64+#define HAVE_STRERROR_R 1
 65+#define HAVE_STRINGS_H 1
 66+#define HAVE_STRING_H 1
 67+#define HAVE_STRUCT_DIRENT_D_TYPE 1
 68+#define HAVE_STRUCT_STATFS_F_FLAGS 1
 69+/* #undef HAVE_STRUCT_STATFS_F_FSTYPENAME */
 70+/* #undef HAVE_STRUCT_STATVFS_F_BASETYPE */
 71+/* #undef HAVE_STRUCT_STATVFS_F_FSTYPENAME */
 72+#define HAVE_STRUCT_STAT_ST_MTIM 1
 73+/* #undef HAVE_SYS_DIR_H */
 74+#define HAVE_SYS_MOUNT_H 1
 75+/* #undef HAVE_SYS_NDIR_H */
 76+#define HAVE_SYS_PARAM_H 1
 77+#define HAVE_SYS_STATFS_H 1
 78+#define HAVE_SYS_STATVFS_H 1
 79+#define HAVE_SYS_STAT_H 1
 80+#define HAVE_SYS_TYPES_H 1
 81+#define HAVE_SYS_VFS_H 1
 82+#define HAVE_UNISTD_H 1
 83+#define HAVE_VPRINTF 1
 84+/* Can use #warning in C files */
 85+#define HAVE_WARNING_CPP_DIRECTIVE 1
 86+/* #undef HAVE_XMLPARSE_H */
 87+#define HAVE_XML_SETDOCTYPEDECLHANDLER 1
 88+/* #undef HAVE__MKTEMP_S */
 89+#define LT_OBJDIR ".libs/"
 90+#define PACKAGE "fontconfig"
 91+#define PACKAGE_BUGREPORT "https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/new"
 92+#define PACKAGE_NAME "fontconfig"
 93+#define PACKAGE_STRING "fontconfig 2.13.1"
 94+#define PACKAGE_TARNAME "fontconfig"
 95+#define PACKAGE_URL ""
 96+#define PACKAGE_VERSION "2.13.1"
 97+/* #undef PTHREAD_CREATE_JOINABLE */
 98+/* #undef SIZEOF_CHAR */
 99+/* #undef SIZEOF_INT */
100+/* #undef SIZEOF_LONG */
101+/* #undef SIZEOF_SHORT */
102+/* #undef SIZEOF_VOIDP */
103+#define SIZEOF_VOID_P 8
104+#define STDC_HEADERS 1
105+#define USE_ICONV 0
106+#ifndef _ALL_SOURCE
107+# define _ALL_SOURCE 1
108+#endif
109+#ifndef _GNU_SOURCE
110+# define _GNU_SOURCE 1
111+#endif
112+#ifndef _POSIX_PTHREAD_SEMANTICS
113+# define _POSIX_PTHREAD_SEMANTICS 1
114+#endif
115+#ifndef _TANDEM_SOURCE
116+# define _TANDEM_SOURCE 1
117+#endif
118+#ifndef __EXTENSIONS__
119+# define __EXTENSIONS__ 1
120+#endif
121+#define VERSION "2.13.1"
122+#if defined AC_APPLE_UNIVERSAL_BUILD
123+# if defined __BIG_ENDIAN__
124+#  define WORDS_BIGENDIAN 1
125+# endif
126+#else
127+# ifndef WORDS_BIGENDIAN
128+/* #  undef WORDS_BIGENDIAN */
129+# endif
130+#endif
131+#ifndef _DARWIN_USE_64_BIT_INODE
132+# define _DARWIN_USE_64_BIT_INODE 1
133+#endif
134+/* #undef _FILE_OFFSET_BITS */
135+/* #undef _LARGE_FILES */
136+/* #undef _MINIX */
137+/* #undef _POSIX_1_SOURCE */
138+/* #undef _POSIX_SOURCE */
139+/* #undef const */
140+#ifndef __cplusplus
141+/* #undef inline */
142+#endif
143+/* #undef pid_t */
144+#include "config-fixups.h"
+332, -0
  1@@ -0,0 +1,332 @@
  2+/* ANSI-C code produced by gperf version 3.1 */
  3+/* Command-line: gperf --pic -m 100 fcobjshash.gperf  */
  4+/* Computed positions: -k'2-3' */
  5+
  6+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
  7+      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
  8+      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
  9+      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
 10+      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
 11+      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
 12+      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
 13+      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
 14+      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
 15+      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
 16+      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
 17+      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
 18+      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
 19+      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
 20+      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
 21+      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
 22+      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
 23+      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
 24+      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
 25+      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
 26+      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
 27+      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
 28+      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
 29+/* The character set is not based on ISO-646.  */
 30+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
 31+#endif
 32+
 33+#line 1 "fcobjshash.gperf"
 34+
 35+#line 13 "fcobjshash.gperf"
 36+struct FcObjectTypeInfo {
 37+int name;
 38+int id;
 39+};
 40+#include <string.h>
 41+/* maximum key range = 65, duplicates = 0 */
 42+
 43+#ifdef __GNUC__
 44+__inline
 45+#else
 46+#ifdef __cplusplus
 47+inline
 48+#endif
 49+#endif
 50+static unsigned int
 51+FcObjectTypeHash (register const char *str, register size_t len)
 52+{
 53+  static const unsigned char asso_values[] =
 54+    {
 55+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 56+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 57+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 58+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 59+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 60+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 61+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 62+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 63+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 64+      69, 69, 69, 69, 69, 69, 69,  9, 21, 18,
 65+      33, 21, 69,  6, 36,  0, 69, 69,  0, 24,
 66+       9,  0, 21, 69, 33, 15, 18,  0, 69, 69,
 67+       0, 21,  6, 69, 69, 69, 69, 69, 69, 69,
 68+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 69+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 70+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 71+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 72+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 73+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 74+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 75+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 76+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 77+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 78+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 79+      69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
 80+      69, 69, 69, 69, 69, 69
 81+    };
 82+  return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[1]];
 83+}
 84+
 85+struct FcObjectTypeNamePool_t
 86+  {
 87+    char FcObjectTypeNamePool_str4[sizeof("file")];
 88+    char FcObjectTypeNamePool_str5[sizeof("color")];
 89+    char FcObjectTypeNamePool_str7[sizeof("foundry")];
 90+    char FcObjectTypeNamePool_str8[sizeof("fullname")];
 91+    char FcObjectTypeNamePool_str9[sizeof("pixelsize")];
 92+    char FcObjectTypeNamePool_str10[sizeof("size")];
 93+    char FcObjectTypeNamePool_str12[sizeof("fullnamelang")];
 94+    char FcObjectTypeNamePool_str13[sizeof("globaladvance")];
 95+    char FcObjectTypeNamePool_str14[sizeof("slant")];
 96+    char FcObjectTypeNamePool_str16[sizeof("hinting")];
 97+    char FcObjectTypeNamePool_str17[sizeof("minspace")];
 98+    char FcObjectTypeNamePool_str18[sizeof("hintstyle")];
 99+    char FcObjectTypeNamePool_str19[sizeof("fontformat")];
100+    char FcObjectTypeNamePool_str20[sizeof("fontversion")];
101+    char FcObjectTypeNamePool_str21[sizeof("fontfeatures")];
102+    char FcObjectTypeNamePool_str22[sizeof("lang")];
103+    char FcObjectTypeNamePool_str23[sizeof("fontvariations")];
104+    char FcObjectTypeNamePool_str24[sizeof("dpi")];
105+    char FcObjectTypeNamePool_str25[sizeof("outline")];
106+    char FcObjectTypeNamePool_str26[sizeof("autohint")];
107+    char FcObjectTypeNamePool_str27[sizeof("weight")];
108+    char FcObjectTypeNamePool_str28[sizeof("hash")];
109+    char FcObjectTypeNamePool_str29[sizeof("postscriptname")];
110+    char FcObjectTypeNamePool_str31[sizeof("rgba")];
111+    char FcObjectTypeNamePool_str32[sizeof("scale")];
112+    char FcObjectTypeNamePool_str33[sizeof("matrix")];
113+    char FcObjectTypeNamePool_str34[sizeof("rasterizer")];
114+    char FcObjectTypeNamePool_str35[sizeof("scalable")];
115+    char FcObjectTypeNamePool_str36[sizeof("antialias")];
116+    char FcObjectTypeNamePool_str37[sizeof("spacing")];
117+    char FcObjectTypeNamePool_str38[sizeof("width")];
118+    char FcObjectTypeNamePool_str39[sizeof("family")];
119+    char FcObjectTypeNamePool_str40[sizeof("capability")];
120+    char FcObjectTypeNamePool_str41[sizeof("namelang")];
121+    char FcObjectTypeNamePool_str42[sizeof("aspect")];
122+    char FcObjectTypeNamePool_str43[sizeof("familylang")];
123+    char FcObjectTypeNamePool_str44[sizeof("style")];
124+    char FcObjectTypeNamePool_str46[sizeof("prgname")];
125+    char FcObjectTypeNamePool_str47[sizeof("index")];
126+    char FcObjectTypeNamePool_str48[sizeof("stylelang")];
127+    char FcObjectTypeNamePool_str49[sizeof("decorative")];
128+    char FcObjectTypeNamePool_str50[sizeof("variable")];
129+    char FcObjectTypeNamePool_str51[sizeof("symbol")];
130+    char FcObjectTypeNamePool_str52[sizeof("charset")];
131+    char FcObjectTypeNamePool_str53[sizeof("embolden")];
132+    char FcObjectTypeNamePool_str54[sizeof("charwidth")];
133+    char FcObjectTypeNamePool_str55[sizeof("charheight")];
134+    char FcObjectTypeNamePool_str59[sizeof("embeddedbitmap")];
135+    char FcObjectTypeNamePool_str60[sizeof("lcdfilter")];
136+    char FcObjectTypeNamePool_str68[sizeof("verticallayout")];
137+  };
138+static const struct FcObjectTypeNamePool_t FcObjectTypeNamePool_contents =
139+  {
140+    "file",
141+    "color",
142+    "foundry",
143+    "fullname",
144+    "pixelsize",
145+    "size",
146+    "fullnamelang",
147+    "globaladvance",
148+    "slant",
149+    "hinting",
150+    "minspace",
151+    "hintstyle",
152+    "fontformat",
153+    "fontversion",
154+    "fontfeatures",
155+    "lang",
156+    "fontvariations",
157+    "dpi",
158+    "outline",
159+    "autohint",
160+    "weight",
161+    "hash",
162+    "postscriptname",
163+    "rgba",
164+    "scale",
165+    "matrix",
166+    "rasterizer",
167+    "scalable",
168+    "antialias",
169+    "spacing",
170+    "width",
171+    "family",
172+    "capability",
173+    "namelang",
174+    "aspect",
175+    "familylang",
176+    "style",
177+    "prgname",
178+    "index",
179+    "stylelang",
180+    "decorative",
181+    "variable",
182+    "symbol",
183+    "charset",
184+    "embolden",
185+    "charwidth",
186+    "charheight",
187+    "embeddedbitmap",
188+    "lcdfilter",
189+    "verticallayout"
190+  };
191+#define FcObjectTypeNamePool ((const char *) &FcObjectTypeNamePool_contents)
192+const struct FcObjectTypeInfo *
193+FcObjectTypeLookup (register const char *str, register size_t len)
194+{
195+  enum
196+    {
197+      TOTAL_KEYWORDS = 50,
198+      MIN_WORD_LENGTH = 3,
199+      MAX_WORD_LENGTH = 14,
200+      MIN_HASH_VALUE = 4,
201+      MAX_HASH_VALUE = 68
202+    };
203+
204+  static const struct FcObjectTypeInfo wordlist[] =
205+    {
206+      {-1}, {-1}, {-1}, {-1},
207+#line 38 "fcobjshash.gperf"
208+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str4,FC_FILE_OBJECT},
209+#line 64 "fcobjshash.gperf"
210+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str5,FC_COLOR_OBJECT},
211+      {-1},
212+#line 31 "fcobjshash.gperf"
213+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str7,FC_FOUNDRY_OBJECT},
214+#line 22 "fcobjshash.gperf"
215+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str8,FC_FULLNAME_OBJECT},
216+#line 29 "fcobjshash.gperf"
217+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str9,FC_PIXEL_SIZE_OBJECT},
218+#line 27 "fcobjshash.gperf"
219+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str10,FC_SIZE_OBJECT},
220+      {-1},
221+#line 23 "fcobjshash.gperf"
222+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str12,FC_FULLNAMELANG_OBJECT},
223+#line 37 "fcobjshash.gperf"
224+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str13,FC_GLOBAL_ADVANCE_OBJECT},
225+#line 24 "fcobjshash.gperf"
226+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str14,FC_SLANT_OBJECT},
227+      {-1},
228+#line 34 "fcobjshash.gperf"
229+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str16,FC_HINTING_OBJECT},
230+#line 46 "fcobjshash.gperf"
231+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str17,FC_MINSPACE_OBJECT},
232+#line 33 "fcobjshash.gperf"
233+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str18,FC_HINT_STYLE_OBJECT},
234+#line 54 "fcobjshash.gperf"
235+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str19,FC_FONTFORMAT_OBJECT},
236+#line 52 "fcobjshash.gperf"
237+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str20,FC_FONTVERSION_OBJECT},
238+#line 60 "fcobjshash.gperf"
239+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str21,FC_FONT_FEATURES_OBJECT},
240+#line 51 "fcobjshash.gperf"
241+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str22,FC_LANG_OBJECT},
242+#line 66 "fcobjshash.gperf"
243+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str23,FC_FONT_VARIATIONS_OBJECT},
244+#line 43 "fcobjshash.gperf"
245+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str24,FC_DPI_OBJECT},
246+#line 41 "fcobjshash.gperf"
247+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str25,FC_OUTLINE_OBJECT},
248+#line 36 "fcobjshash.gperf"
249+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str26,FC_AUTOHINT_OBJECT},
250+#line 25 "fcobjshash.gperf"
251+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str27,FC_WEIGHT_OBJECT},
252+#line 62 "fcobjshash.gperf"
253+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str28,FC_HASH_OBJECT},
254+#line 63 "fcobjshash.gperf"
255+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str29,FC_POSTSCRIPT_NAME_OBJECT},
256+      {-1},
257+#line 44 "fcobjshash.gperf"
258+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str31,FC_RGBA_OBJECT},
259+#line 45 "fcobjshash.gperf"
260+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str32,FC_SCALE_OBJECT},
261+#line 49 "fcobjshash.gperf"
262+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str33,FC_MATRIX_OBJECT},
263+#line 40 "fcobjshash.gperf"
264+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str34,FC_RASTERIZER_OBJECT},
265+#line 42 "fcobjshash.gperf"
266+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str35,FC_SCALABLE_OBJECT},
267+#line 32 "fcobjshash.gperf"
268+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str36,FC_ANTIALIAS_OBJECT},
269+#line 30 "fcobjshash.gperf"
270+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str37,FC_SPACING_OBJECT},
271+#line 26 "fcobjshash.gperf"
272+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str38,FC_WIDTH_OBJECT},
273+#line 18 "fcobjshash.gperf"
274+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str39,FC_FAMILY_OBJECT},
275+#line 53 "fcobjshash.gperf"
276+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str40,FC_CAPABILITY_OBJECT},
277+#line 59 "fcobjshash.gperf"
278+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str41,FC_NAMELANG_OBJECT},
279+#line 28 "fcobjshash.gperf"
280+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str42,FC_ASPECT_OBJECT},
281+#line 19 "fcobjshash.gperf"
282+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str43,FC_FAMILYLANG_OBJECT},
283+#line 20 "fcobjshash.gperf"
284+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str44,FC_STYLE_OBJECT},
285+      {-1},
286+#line 61 "fcobjshash.gperf"
287+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str46,FC_PRGNAME_OBJECT},
288+#line 39 "fcobjshash.gperf"
289+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str47,FC_INDEX_OBJECT},
290+#line 21 "fcobjshash.gperf"
291+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str48,FC_STYLELANG_OBJECT},
292+#line 57 "fcobjshash.gperf"
293+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str49,FC_DECORATIVE_OBJECT},
294+#line 67 "fcobjshash.gperf"
295+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str50,FC_VARIABLE_OBJECT},
296+#line 65 "fcobjshash.gperf"
297+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str51,FC_SYMBOL_OBJECT},
298+#line 50 "fcobjshash.gperf"
299+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str52,FC_CHARSET_OBJECT},
300+#line 55 "fcobjshash.gperf"
301+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str53,FC_EMBOLDEN_OBJECT},
302+#line 47 "fcobjshash.gperf"
303+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str54,FC_CHARWIDTH_OBJECT},
304+#line 48 "fcobjshash.gperf"
305+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str55,FC_CHAR_HEIGHT_OBJECT},
306+      {-1}, {-1}, {-1},
307+#line 56 "fcobjshash.gperf"
308+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str59,FC_EMBEDDED_BITMAP_OBJECT},
309+#line 58 "fcobjshash.gperf"
310+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str60,FC_LCD_FILTER_OBJECT},
311+      {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
312+#line 35 "fcobjshash.gperf"
313+      {(int)(size_t)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str68,FC_VERTICAL_LAYOUT_OBJECT}
314+    };
315+
316+  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
317+    {
318+      register unsigned int key = FcObjectTypeHash (str, len);
319+
320+      if (key <= MAX_HASH_VALUE)
321+        {
322+          register int o = wordlist[key].name;
323+          if (o >= 0)
324+            {
325+              register const char *s = o + FcObjectTypeNamePool;
326+
327+              if (*str == *s && !strcmp (str + 1, s + 1))
328+                return &wordlist[key];
329+            }
330+        }
331+    }
332+  return 0;
333+}
+71, -0
 1@@ -0,0 +1,71 @@
 2+cflags{
 3+	'-D HAVE_CONFIG_H',
 4+	'-I $dir',
 5+	'-I $outdir',
 6+	'-I $srcdir',
 7+	'-isystem $builddir/pkg/freetype/include',
 8+	'-isystem $builddir/pkg/expat/include',
 9+	'-isystem $builddir/pkg/util-linux/include',
10+}
11+
12+pkg.hdrs = copy('$outdir/include/fontconfig', '$srcdir/fontconfig', {
13+	'fontconfig.h',
14+	'fcfreetype.h',
15+})
16+pkg.deps = {
17+	'pkg/expat/headers',
18+	'pkg/freetype/headers',
19+	'pkg/util-linux/headers',
20+}
21+
22+rule('makealias', '$srcdir/src/makealias $srcdir/src $out $in')
23+local function makealias(name, srcs)
24+	local outs = {'$outdir/'..name..'.h', '$outdir/'..name..'tail.h'}
25+	table.insert(pkg.deps, outs)
26+	build('makealias', outs, {expand{'$srcdir/', srcs}, '|', '$srcdir/src/makealias'})
27+end
28+
29+makealias('fcalias', {
30+	'fontconfig/fontconfig.h',
31+	'fontconfig/fcprivate.h',
32+	'src/fcdeprecate.h',
33+})
34+makealias('fcftalias', 'fontconfig/fcfreetype.h')
35+
36+lib('libfontconfig.a', [[
37+	src/(
38+		fcatomic.c
39+		fccache.c
40+		fccfg.c
41+		fccharset.c
42+		fccompat.c
43+		fcdbg.c
44+		fcdefault.c
45+		fcdir.c
46+		fcformat.c
47+		fcfreetype.c
48+		fcfs.c
49+		fcptrlist.c
50+		fchash.c
51+		fcinit.c
52+		fclang.c
53+		fclist.c
54+		fcmatch.c
55+		fcmatrix.c
56+		fcname.c
57+		fcobjs.c
58+		fcpat.c
59+		fcrange.c
60+		fcserialize.c
61+		fcstat.c
62+		fcstr.c
63+		fcweight.c
64+		fcxml.c
65+		ftglue.c
66+	)
67+	$builddir/pkg/expat/libexpat.a.d
68+	$builddir/pkg/freetype/libfreetype.a.d
69+	$builddir/pkg/util-linux/libuuid.a.d
70+]])
71+
72+fetch 'curl'
+66, -0
 1@@ -0,0 +1,66 @@
 2+From e74cd485038256cb170a102413d76ecaac61cf5b Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Mon, 6 Sep 2021 18:29:49 -0700
 5+Subject: [PATCH] Remove unnecessary use of long double constants
 6+
 7+These constants are immediately converted to double so there is no
 8+reason to make them long double.
 9+---
10+ src/fcdefault.c  | 2 +-
11+ src/fcfreetype.c | 4 ++--
12+ src/fcxml.c      | 4 ++--
13+ 3 files changed, 5 insertions(+), 5 deletions(-)
14+
15+diff --git a/src/fcdefault.c b/src/fcdefault.c
16+index f3addca..be00c48 100644
17+--- a/src/fcdefault.c
18++++ b/src/fcdefault.c
19+@@ -263,7 +263,7 @@ FcDefaultSubstitute (FcPattern *pattern)
20+ 	if (FcPatternObjectGetRange (pattern, FC_SIZE_OBJECT, 0, &r) == FcResultMatch && FcRangeGetDouble (r, &b, &e))
21+ 	    size = (b + e) * .5;
22+ 	else
23+-	    size = 12.0L;
24++	    size = 12.0;
25+     }
26+     if (FcPatternObjectGetDouble (pattern, FC_SCALE_OBJECT, 0, &scale) != FcResultMatch)
27+ 	scale = 1.0;
28+diff --git a/src/fcfreetype.c b/src/fcfreetype.c
29+index 07978cf..0845232 100644
30+--- a/src/fcfreetype.c
31++++ b/src/fcfreetype.c
32+@@ -1811,8 +1811,8 @@ FcFreeTypeQueryFaceInternal (const FT_Face  face,
33+ 	FcRange *r;
34+ 
35+ 	/* usLowerPointSize and usUpperPointSize is actually twips */
36+-	lower_size = os2->usLowerOpticalPointSize / 20.0L;
37+-	upper_size = os2->usUpperOpticalPointSize / 20.0L;
38++	lower_size = os2->usLowerOpticalPointSize / 20.0;
39++	upper_size = os2->usUpperOpticalPointSize / 20.0;
40+ 
41+ 	if (lower_size == upper_size)
42+ 	{
43+diff --git a/src/fcxml.c b/src/fcxml.c
44+index 7797502..f6516ae 100644
45+--- a/src/fcxml.c
46++++ b/src/fcxml.c
47+@@ -1493,7 +1493,7 @@ FcParseRange (FcConfigParse *parse)
48+     FcRange	*r;
49+     FcChar32	n[2] = {0, 0};
50+     int		count = 1;
51+-    double	d[2] = {0.0L, 0.0L};
52++    double	d[2] = {0.0, 0.0};
53+     FcBool	dflag = FcFalse;
54+ 
55+     while ((vstack = FcVStackPeek (parse)))
56+@@ -1519,7 +1519,7 @@ FcParseRange (FcConfigParse *parse)
57+ 	default:
58+ 	    FcConfigMessage (parse, FcSevereError, "invalid element in range");
59+ 	    if (dflag)
60+-		d[count] = 0.0L;
61++		d[count] = 0.0;
62+ 	    else
63+ 		n[count] = 0;
64+ 	    break;
65+-- 
66+2.32.0
67+
+1, -0
1@@ -0,0 +1 @@
2+9f0d852b39d75fc655f9f53850eb32555394f36104a044bb2b2fc9e66dbbfa7f  fontconfig-2.13.1.tar.gz
+1, -0
1@@ -0,0 +1 @@
2+url = "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.1.tar.gz"
+1, -0
1@@ -0,0 +1 @@
2+2.13.1 r1
+93, -0
 1@@ -0,0 +1,93 @@
 2+cflags{
 3+	'-std=c99', '-Wall', '-Wpedantic',
 4+	'-D FT2_BUILD_LIBRARY',
 5+	'-D FT_CONFIG_OPTION_SYSTEM_ZLIB',
 6+	'-D HAVE_FCNTL_H',
 7+	'-D HAVE_UNISTD_H',
 8+	'-I $srcdir/builds/unix',
 9+	'-I $srcdir/include/freetype/config',
10+	'-I $srcdir/include',
11+	'-isystem $builddir/pkg/zlib/include',
12+}
13+
14+pkg.hdrs = copy('$outdir/include', '$srcdir/include', paths[[
15+	ft2build.h
16+	freetype/(
17+		freetype.h
18+		ftadvanc.h
19+		ftbdf.h
20+		ftbitmap.h
21+		ftcache.h
22+		ftcolor.h
23+		fterrdef.h
24+		fterrors.h
25+		ftfntfmt.h
26+		ftglyph.h
27+		ftimage.h
28+		ftmm.h
29+		ftmodapi.h
30+		ftmoderr.h
31+		ftoutln.h
32+		ftparams.h
33+		ftsizes.h
34+		ftsnames.h
35+		ftstroke.h
36+		ftsynth.h
37+		ftsystem.h
38+		fttrigon.h
39+		fttypes.h
40+		t1tables.h
41+		ttnameid.h
42+		tttables.h
43+		tttags.h
44+		config/(
45+			ftconfig.h
46+			ftheader.h
47+			ftoption.h
48+			ftstdlib.h
49+			integer-types.h
50+			mac-support.h
51+			public-macros.h
52+		)
53+	)
54+]])
55+
56+cc('src/gzip/ftgzip.c', {'pkg/zlib/headers'})
57+lib('libfreetype.a', [[
58+	builds/unix/ftsystem.c
59+	src/(
60+		base/(
61+			ftdebug.c ftinit.c ftbase.c
62+			ftbbox.c ftbdf.c ftbitmap.c ftcid.c ftfstype.c ftgasp.c
63+			ftglyph.c ftgxval.c ftmm.c ftotval.c ftpatent.c ftpfr.c
64+			ftstroke.c ftsynth.c fttype1.c ftwinfnt.c
65+		)
66+		truetype/truetype.c
67+		type1/type1.c
68+		cff/cff.c
69+		cid/type1cid.c
70+		pfr/pfr.c
71+		type42/type42.c
72+		winfonts/winfnt.c
73+		pcf/pcf.c
74+		bdf/bdf.c
75+		sfnt/sfnt.c
76+
77+		autofit/autofit.c
78+		pshinter/pshinter.c
79+
80+		smooth/smooth.c
81+		raster/raster.c
82+		sdf/sdf.c
83+
84+		cache/ftcache.c
85+		gzip/ftgzip.c.o
86+		lzw/ftlzw.c
87+		bzip2/ftbzip2.c
88+		psaux/psaux.c
89+		psnames/psnames.c
90+	)
91+	$builddir/pkg/zlib/libz.a
92+]])
93+
94+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 801cd842e27c85cb1d5000f6397f382ffe295daa
+1, -0
1@@ -0,0 +1 @@
2+2.11.0 r0
+27, -0
 1@@ -9,38 +9,56 @@ subgen 'cacert'
 2 subgen 'catgirl'
 3 subgen 'cproc'
 4 subgen 'curl'
 5+subgen 'dmenu'
 6 subgen 'dosfstools'
 7 subgen 'e2fsprogs'
 8 subgen 'elftoolchain'
 9+subgen 'expat'
10 subgen 'file'
11 subgen 'flex'
12+subgen 'fontconfig'
13+subgen 'freetype'
14 subgen 'fspec-sync'
15 subgen 'git'
16+subgen 'hotplugd'
17 subgen 'iproute2'
18+subgen 'jbig2dec'
19 subgen 'kiss'
20 subgen 'less'
21 subgen 'libcbor'
22+subgen 'libdrm'
23+subgen 'liberation-fonts'
24+subgen 'libevdev'
25 subgen 'libevent'
26+subgen 'libffi'
27 subgen 'libfido2'
28+subgen 'libinput'
29+subgen 'libjpeg-turbo'
30 subgen 'libnl'
31+subgen 'libpng'
32 subgen 'libtermkey'
33 subgen 'libtls-bearssl'
34 subgen 'libutp'
35+subgen 'libxkbcommon'
36 subgen 'linux-headers'
37 subgen 'lpeg'
38 subgen 'lua'
39 subgen 'make'
40 subgen 'man-pages-posix'
41 subgen 'mandoc'
42+subgen 'mtdev'
43+subgen 'mupdf'
44 subgen 'musl'
45 subgen 'nasm'
46 subgen 'netbsd-curses'
47+subgen 'netsurf'
48 subgen 'oksh'
49 subgen 'openbsd'
50 subgen 'openntpd'
51 subgen 'openssh'
52 subgen 'pcre'
53 subgen 'pigz'
54+subgen 'pixman'
55 subgen 'qbe'
56 subgen 'quark'
57 subgen 'rc'
58@@ -51,16 +69,25 @@ subgen 'sbase'
59 subgen 'sdhcp'
60 subgen 'skeleton'
61 subgen 'smu'
62+subgen 'st'
63 subgen 'strace'
64+subgen 'swc'
65+subgen 'tamzen-font'
66 subgen 'the_silver_searcher'
67 subgen 'tinyalsa'
68 subgen 'transmission'
69 subgen 'tz'
70 subgen 'ubase'
71 subgen 'unzip'
72+subgen 'utf8proc'
73 subgen 'util-linux'
74+subgen 'velox'
75 subgen 'vis'
76+subgen 'wayland'
77+subgen 'wayland-protocols'
78+subgen 'wld'
79 subgen 'wpa_supplicant'
80+subgen 'xkeyboard-config'
81 subgen 'xz'
82 subgen 'zlib'
83 subgen 'zstd'
+13, -0
 1@@ -0,0 +1,13 @@
 2+cflags{
 3+	'-std=c11', '-Wall', '-Wextra', '-Wpedantic',
 4+	([[-D 'PREFIX="%s"']]):format(config.prefix),
 5+	'-isystem $builddir/pkg/linux-headers/include',
 6+}
 7+
 8+pkg.deps = {'pkg/linux-headers/headers'}
 9+
10+file('bin/hotplugd',             '755', exe('hotplugd', {'hotplugd.c'}))
11+file('libexec/hotplugd/ata_id',  '755', exe('ata_id',   {'ata_id.c'}))
12+file('libexec/hotplugd/trigger', '755', exe('trigger',  {'trigger.c'}))
13+
14+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit c15eea9bdeb974f828b6eda37f5f24a2420bd7e1
+1, -0
1@@ -0,0 +1 @@
2+c15eea9bde r0
+16, -0
 1@@ -0,0 +1,16 @@
 2+cflags{
 3+	'-Wall',
 4+	'-D HAVE_STDINT_H',
 5+	'-D HAVE_GETOPT_H',
 6+}
 7+
 8+pkg.hdrs = copy('$outdir/include', '$srcdir', {'jbig2.h'})
 9+
10+lib('libjbig2dec.a', [[
11+	jbig2_arith.c jbig2_arith_int.c jbig2_arith_iaid.c
12+	jbig2_huffman.c jbig2_hufftab.c jbig2_segment.c jbig2_page.c
13+	jbig2_symbol_dict.c jbig2_text.c jbig2_halftone.c jbig2_generic.c
14+	jbig2_refinement.c jbig2_mmr.c jbig2_image.c jbig2.c
15+]])
16+
17+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 1c336b8ab44524dc56ea837e2211ff4207704cdd
+1, -0
1@@ -0,0 +1 @@
2+0.19 r0
+9, -0
 1@@ -0,0 +1,9 @@
 2+# libdrm
 3+
 4+# `config.h`
 5+Generated with
 6+
 7+	meson build -Dintel=disabled -Dnouveau=disabled -Dradeon=disabled -Dvmwgfx=disabled
 8+
 9+`HAVE_INTEL` and `HAVE_NOUVEAU` were removed since they get defined
10+in `gen.lua` based on the keys in `config.video_drivers`.
+17, -0
 1@@ -0,0 +1,17 @@
 2+#define HAVE_ALLOCA_H 1
 3+#define HAVE_CAIRO 0
 4+#define HAVE_EXYNOS 0
 5+#define HAVE_FREEDRENO_KGSL 0
 6+#define HAVE_LIBDRM_ATOMIC_PRIMITIVES 1
 7+#define HAVE_LIB_ATOMIC_OPS 0
 8+#define HAVE_OPEN_MEMSTREAM 1
 9+#define HAVE_RADEON 0
10+#define HAVE_SYS_SELECT_H 1
11+#define HAVE_SYS_SYSCTL_H 0
12+#define HAVE_VALGRIND 0
13+#define HAVE_VC4 0
14+#define HAVE_VISIBILITY 1
15+#define HAVE_VMWGFX 0
16+#define MAJOR_IN_SYSMACROS 1
17+#define UDEV 0
18+#define _GNU_SOURCE 1
+44, -0
 1@@ -0,0 +1,44 @@
 2+io.write[[
 3+/* AUTOMATICALLY GENERATED by fourcc.lua. You should modify
 4+   that script instead of adding here entries manually! */
 5+static const struct drmFormatModifierInfo drm_format_modifier_table[] = {
 6+    { DRM_MODIFIER_INVALID(NONE, INVALID) },
 7+    { DRM_MODIFIER_LINEAR(NONE, LINEAR) },
 8+]]
 9+
10+local vendors = {
11+	ARM=true,
12+	SAMSUNG=true,
13+	QCOM=true,
14+	VIVANTE=true,
15+	NVIDIA=true,
16+	BROADCOM=true,
17+	ALLWINNER=true,
18+}
19+for line in io.lines() do
20+	local mod = line:match('^#define I915_FORMAT_MOD_([%w_]+)')
21+	if mod then
22+		io.write(string.format('    { DRM_MODIFIER_INTEL(%s, %s) },\n', mod, mod))
23+	end
24+	local vendor, mod = line:match('^#define DRM_FORMAT_MOD_(%w+)_([%w_]+)%s')
25+	if vendors[vendor] then
26+		if vendor ~= 'ARM' or not mod:match('^TYPE_') then
27+			io.write(string.format('    { DRM_MODIFIER(%s, %s, %s) },\n', vendor, mod, mod))
28+		end
29+	end
30+	local vendor = line:match('^#define DRM_FORMAT_MOD_VENDOR_([%w_]+)')
31+	if vendor then
32+		table.insert(vendors, vendor)
33+	end
34+end
35+
36+io.write[[
37+};
38+static const struct drmFormatModifierVendorInfo drm_format_modifier_vendor_table[] = {
39+]]
40+for _, vendor in ipairs(vendors) do
41+	io.write(string.format('    { DRM_FORMAT_MOD_VENDOR_%s, "%s" },\n', vendor, vendor))
42+end
43+io.write[[
44+};
45+]]
+90, -0
 1@@ -0,0 +1,90 @@
 2+local function havedriver(name)
 3+	local enabled = config.video_drivers and config.video_drivers[name]
 4+	return '-D HAVE_'..name:upper()..'='..(enabled and '1' or '0')
 5+end
 6+
 7+cflags{
 8+	'-include $dir/config.h',
 9+	havedriver('intel'),
10+	havedriver('nouveau'),
11+	havedriver('amdgpu'),
12+	'-I $dir',
13+	'-I $outdir',
14+	'-I $srcdir',
15+	'-I $srcdir/include/drm',
16+	'-isystem $builddir/pkg/linux-headers/include',
17+}
18+
19+pkg.hdrs = {
20+	copy('$outdir/include', '$srcdir', {'xf86drm.h', 'xf86drmMode.h'}),
21+	copy('$outdir/include', '$srcdir/amdgpu', {'amdgpu.h'}),
22+	copy('$outdir/include', '$srcdir/include/drm', {
23+		'drm.h',
24+		'drm_fourcc.h',
25+		'drm_mode.h',
26+		'drm_sarea.h',
27+		'i915_drm.h',
28+		'amdgpu_drm.h',
29+	}),
30+}
31+
32+pkg.deps = {
33+	'$outdir/generated_static_table_fourcc.h',
34+	'pkg/linux-headers/headers',
35+}
36+
37+rule('fourcc', 'lua $dir/fourcc.lua <$in >$out')
38+build('fourcc', '$outdir/generated_static_table_fourcc.h', {'$srcdir/include/drm/drm_fourcc.h', '|', '$dir/fourcc.lua'})
39+
40+lib('libdrm.a', {
41+	'xf86drm.c',
42+	'xf86drmHash.c',
43+	'xf86drmRandom.c',
44+	'xf86drmSL.c',
45+	'xf86drmMode.c',
46+})
47+
48+if config.video_drivers and config.video_drivers['intel'] then
49+	cflags{'-isystem $builddir/pkg/libpciaccess/include'}
50+	table.insert(pkg.deps, 'pkg/libpciaccess/headers')
51+	lib('libdrm_intel.a', [[
52+		intel/(
53+			intel_bufmgr.c
54+			intel_bufmgr_fake.c
55+			intel_bufmgr_gem.c
56+			intel_decode.c
57+			mm.c
58+		)
59+		$builddir/pkg/libpciaccess/libpciaccess.a
60+	]])
61+end
62+
63+if config.video_drivers and config.video_drivers['nouveau'] then
64+	lib('libdrm_nouveau.a', [[
65+		nouveau/(
66+			nouveau.c
67+			pushbuf.c
68+			bufctx.c
69+			abi16.c
70+		)
71+	]])
72+end
73+
74+if config.video_drivers and config.video_drivers['amdgpu'] then
75+	cflags{string.format([[-D 'AMDGPU_ASIC_ID_TABLE="%s/share/libdrm/amdgpu.ids"']], config.prefix)}
76+	lib('libdrm_amdgpu.a', [[
77+		amdgpu/(
78+			amdgpu_asic_id.c
79+			amdgpu_bo.c
80+			amdgpu_cs.c
81+			amdgpu_device.c
82+			amdgpu_gpu_info.c
83+			amdgpu_vamgr.c
84+			amdgpu_vm.c
85+			handle_table.c
86+		)
87+	]])
88+	file('share/libdrm/amdgpu.ids', '644', '$srcdir/data/amdgpu.ids')
89+end
90+
91+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 75254bf2390c10644ffb35a90fc8f18f196f9f0c
+1, -0
1@@ -0,0 +1 @@
2+2.4.120 r0
+2, -0
1@@ -0,0 +1,2 @@
2+/liberation-fonts-ttf-2.1.5.tar.gz
3+/src
+22, -0
 1@@ -0,0 +1,22 @@
 2+local fonts = {
 3+	'LiberationMono-Bold',
 4+	'LiberationMono-BoldItalic',
 5+	'LiberationMono-Italic',
 6+	'LiberationMono-Regular',
 7+	'LiberationSans-Bold',
 8+	'LiberationSans-BoldItalic',
 9+	'LiberationSans-Italic',
10+	'LiberationSans-Regular',
11+	'LiberationSerif-Bold',
12+	'LiberationSerif-BoldItalic',
13+	'LiberationSerif-Italic',
14+	'LiberationSerif-Regular',
15+}
16+
17+for _, font in ipairs(fonts) do
18+	local path = ('share/fonts/%s.ttf'):format(font)
19+	local src = ('$srcdir/%s.ttf'):format(font)
20+	file(path, '644', src)
21+end
22+
23+fetch 'curl'
+1, -0
1@@ -0,0 +1 @@
2+7191c669bf38899f73a2094ed00f7b800553364f90e2637010a69c0e268f25d0  liberation-fonts-ttf-2.1.5.tar.gz
+1, -0
1@@ -0,0 +1 @@
2+url ="https://github.com/liberationfonts/liberation-fonts/files/7261482/liberation-fonts-ttf-2.1.5.tar.gz"
+1, -0
1@@ -0,0 +1 @@
2+2.1.5 r0
+1, -0
1@@ -0,0 +1 @@
2+#define _GNU_SOURCE 1
+181, -0
  1@@ -0,0 +1,181 @@
  2+local duplicates = {
  3+	EV_VERSION=true,
  4+	BTN_MISC=true,
  5+	BTN_MOUSE=true,
  6+	BTN_JOYSTICK=true,
  7+	BTN_GAMEPAD=true,
  8+	BTN_DIGI=true,
  9+	BTN_WHEEL=true,
 10+	BTN_TRIGGER_HAPPY=true,
 11+	SW_MAX=true,
 12+	REP_MAX=true,
 13+	FF_STATUS_MAX=true,
 14+}
 15+
 16+local skip = {
 17+	BTN=true,
 18+	EV=true,
 19+	INPUT_PROP=true,
 20+	MT_TOOL=true,
 21+}
 22+
 23+local prefixes = {
 24+	'EV',
 25+	'REL',
 26+	'ABS',
 27+	'KEY',
 28+	'BTN',
 29+	'LED',
 30+	'SND',
 31+	'MSC',
 32+	'SW',
 33+	'FF',
 34+	'SYN',
 35+	'REP',
 36+	'INPUT_PROP',
 37+	'MT_TOOL',
 38+}
 39+
 40+local bits = {}
 41+for _, prefix in ipairs(prefixes) do
 42+	bits[prefix] = {}
 43+end
 44+bits.EV.map = {}
 45+
 46+local function lookuptable(prefix)
 47+	local entries = {}
 48+	for _, name in ipairs(bits[prefix]) do
 49+		table.insert(entries, name)
 50+	end
 51+	local max = prefix..'_MAX'
 52+	if duplicates[max] then
 53+		table.insert(entries, max)
 54+	end
 55+	table.sort(entries)
 56+	for _, name in ipairs(entries) do
 57+		io.write(string.format('    { .name = "%s", .value = %s },\n', name, name))
 58+	end
 59+end
 60+
 61+for i = 1, #arg do
 62+	for line in io.lines(arg[i]) do
 63+		local name, value = line:match('^#define%s+([%w_]+)%s+(%dx?%x*)')
 64+		value = tonumber(value)
 65+		if name and not duplicates[name] then
 66+			for prefix, b in pairs(bits) do
 67+				if name:sub(1, #prefix + 1) == prefix..'_' then
 68+					if b.map then
 69+						b.map[value] = name
 70+						b.map[name] = value
 71+					end
 72+					table.insert(b, name)
 73+				end
 74+			end
 75+		end
 76+	end
 77+end
 78+
 79+io.write[[
 80+/* THIS FILE IS GENERATED, DO NOT EDIT */
 81+
 82+#ifndef EVENT_NAMES_H
 83+#define EVENT_NAMES_H
 84+
 85+]]
 86+for _, prefix in ipairs(prefixes) do
 87+	if prefix ~= 'BTN' then
 88+		io.write(string.format('static const char * const %s_map[%s_MAX + 1] = {\n', prefix:lower(), prefix))
 89+		for _, name in ipairs(bits[prefix]) do
 90+			io.write(string.format('    [%s] = "%s",\n', name, name))
 91+		end
 92+		if prefix == 'KEY' then
 93+			for _, name in ipairs(bits.BTN) do
 94+				io.write(string.format('    [%s] = "%s",\n', name, name))
 95+			end
 96+		end
 97+		io.write[[
 98+};
 99+
100+]]
101+	end
102+end
103+for _, name in ipairs{'BTN_A', 'BTN_B', 'BTN_X', 'BTN_Y'} do
104+	table.insert(bits.BTN, name)
105+end
106+io.write[[
107+static const char * const * const event_type_map[EV_MAX + 1] = {
108+]]
109+for _, prefix in ipairs(prefixes) do
110+	if not skip[prefix] then
111+		print(string.format('    [EV_%s] = %s_map,', prefix, prefix:lower()))
112+	end
113+end
114+io.write[[
115+};
116+
117+#if __clang__
118+#pragma clang diagnostic push
119+#pragma clang diagnostic ignored "-Winitializer-overrides"
120+#elif __GNUC__
121+#pragma GCC diagnostic push
122+#pragma GCC diagnostic ignored "-Woverride-init"
123+#endif
124+static const int ev_max[EV_MAX + 1] = {
125+]]
126+for i = 0, bits.EV.map.EV_MAX do
127+	local name = bits.EV.map[i]
128+	if name and bits[name:sub(4)] then
129+		io.write(string.format('    %s_MAX,\n', name:sub(4)))
130+	else
131+		io.write('    -1,\n')
132+	end
133+end
134+io.write[[
135+};
136+#if __clang__
137+#pragma clang diagnostic pop /* "-Winitializer-overrides" */
138+#elif __GNUC__
139+#pragma GCC diagnostic pop /* "-Woverride-init" */
140+#endif
141+
142+struct name_entry {
143+    const char *name;
144+    unsigned int value;
145+};
146+
147+static const struct name_entry tool_type_names[] = {
148+]]
149+lookuptable('MT_TOOL')
150+io.write[[
151+};
152+
153+static const struct name_entry ev_names[] = {
154+]]
155+lookuptable('EV')
156+io.write[[
157+};
158+
159+static const struct name_entry code_names[] = {
160+]]
161+lookuptable('ABS')
162+lookuptable('BTN')
163+lookuptable('FF')
164+lookuptable('KEY')
165+lookuptable('LED')
166+lookuptable('MSC')
167+lookuptable('REL')
168+lookuptable('REP')
169+lookuptable('SND')
170+lookuptable('SW')
171+lookuptable('SYN')
172+io.write[[
173+};
174+
175+static const struct name_entry prop_names[] = {
176+]]
177+lookuptable('INPUT_PROP')
178+io.write[[
179+};
180+
181+#endif /* EVENT_NAMES_H */
182+]]
+28, -0
 1@@ -0,0 +1,28 @@
 2+cflags{
 3+	'-I $dir',
 4+	'-I $outdir',
 5+	'-I $srcdir',
 6+	'-I $srcdir/include',
 7+	'-isystem $builddir/pkg/linux-headers/include',
 8+}
 9+
10+pkg.hdrs = copy('$outdir/include/libevdev', '$srcdir/libevdev', {'libevdev.h'})
11+pkg.hdrs.install = true
12+
13+pkg.deps = {
14+	'pkg/linux-headers/headers',
15+}
16+
17+rule('eventnames', 'lua $dir/eventnames.lua $in >$out')
18+build('eventnames', '$outdir/event-names.h', {
19+	'$srcdir/include/linux/linux/input.h',
20+	'$srcdir/include/linux/linux/input-event-codes.h',
21+	'|', '$dir/eventnames.lua',
22+})
23+lib('libevdev.a', {'libevdev/libevdev.c', 'libevdev/libevdev-names.c'}, {'$outdir/event-names.h'})
24+file('lib/libevdev.a', '644', '$outdir/libevdev.a')
25+
26+exe('libevdev-events', {'tools/libevdev-events.c', 'libevdev.a'})
27+file('bin/libevdev-events', '755', '$outdir/libevdev-events')
28+
29+fetch 'git'
+273, -0
  1@@ -0,0 +1,273 @@
  2+From 20dd0f459d92805cdd33a7622382f118acf3c07d Mon Sep 17 00:00:00 2001
  3+From: Michael Forney <mforney@mforney.org>
  4+Date: Tue, 3 Mar 2020 14:17:37 -0800
  5+Subject: [PATCH libevdev] Revert switch to VLAs for multitouch state
  6+
  7+Signed-off-by: Michael Forney <mforney@mforney.org>
  8+---
  9+ libevdev/libevdev-int.h | 28 +++++++++++++
 10+ libevdev/libevdev.c     | 87 +++++++++++++++++++----------------------
 11+ 2 files changed, 68 insertions(+), 47 deletions(-)
 12+
 13+diff --git a/libevdev/libevdev-int.h b/libevdev/libevdev-int.h
 14+index 8e2518e..bc291ea 100644
 15+--- a/libevdev/libevdev-int.h
 16++++ b/libevdev/libevdev-int.h
 17+@@ -7,6 +7,7 @@
 18+ #define LIBEVDEV_INT_H
 19+ 
 20+ #include "config.h"
 21++#include <stdint.h>
 22+ #include <stdio.h>
 23+ #include <stdlib.h>
 24+ #include <stdbool.h>
 25+@@ -38,6 +39,26 @@ enum SyncState {
 26+ 	SYNC_IN_PROGRESS,
 27+ };
 28+ 
 29++struct mt_sync_state {
 30++	uint32_t code;
 31++	int32_t val[];
 32++};
 33++
 34++/* Keeps a record of touches during SYN_DROPPED  */
 35++enum touch_state {
 36++	TOUCH_OFF,
 37++	TOUCH_STARTED, /* Started during SYN_DROPPED */
 38++	TOUCH_STOPPED, /* Stopped during SYN_DROPPED */
 39++	TOUCH_ONGOING, /* Existed before, still have same tracking ID */
 40++	TOUCH_CHANGED, /* Existed before but have new tracking ID now, so
 41++			  stopped + started in that slot */
 42++};
 43++
 44++struct slot_change_state {
 45++	enum touch_state state;
 46++	unsigned long axes[NLONGS(ABS_CNT)]; /* bitmask for updated axes */
 47++};
 48++
 49+ /**
 50+  * Internal only: log data used to send messages to the respective log
 51+  * handler. We re-use the same struct for a global and inside
 52+@@ -90,6 +111,13 @@ struct libevdev {
 53+ 
 54+ 	struct timeval last_event_time;
 55+ 
 56++	struct {
 57++		struct mt_sync_state *mt_state;
 58++		size_t mt_state_sz;		 /* in bytes */
 59++		struct slot_change_state *changes;
 60++		size_t changes_sz;		 /* in bytes */
 61++	} mt_sync;
 62++
 63+ 	struct logdata log;
 64+ };
 65+ 
 66+diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c
 67+index b941cfb..1cc912c 100644
 68+--- a/libevdev/libevdev.c
 69++++ b/libevdev/libevdev.c
 70+@@ -28,23 +28,7 @@ enum event_filter_status {
 71+ 	EVENT_FILTER_DISCARD,	/**< Discard current event */
 72+ };
 73+ 
 74+-/* Keeps a record of touches during SYN_DROPPED  */
 75+-enum touch_state {
 76+-	TOUCH_OFF,
 77+-	TOUCH_STARTED, /* Started during SYN_DROPPED */
 78+-	TOUCH_STOPPED, /* Stopped during SYN_DROPPED */
 79+-	TOUCH_ONGOING, /* Existed before, still have same tracking ID */
 80+-	TOUCH_CHANGED, /* Existed before but have new tracking ID now, so
 81+-			  stopped + started in that slot */
 82+-};
 83+-
 84+-struct slot_change_state {
 85+-	enum touch_state state;
 86+-	unsigned long axes[NLONGS(ABS_CNT)]; /* bitmask for updated axes */
 87+-};
 88+-
 89+-static int sync_mt_state(struct libevdev *dev,
 90+-			 struct slot_change_state *changes_out);
 91++static int sync_mt_state(struct libevdev *dev);
 92+ static int
 93+ update_key_state(struct libevdev *dev, const struct input_event *e);
 94+ 
 95+@@ -203,6 +187,8 @@ libevdev_reset(struct libevdev *dev)
 96+ 	free(dev->phys);
 97+ 	free(dev->uniq);
 98+ 	free(dev->mt_slot_vals);
 99++	free(dev->mt_sync.mt_state);
100++	free(dev->mt_sync.changes);
101+ 	memset(dev, 0, sizeof(*dev));
102+ 	dev->fd = -1;
103+ 	dev->initialized = false;
104+@@ -331,7 +317,11 @@ free_slots(struct libevdev *dev)
105+ {
106+ 	dev->num_slots = -1;
107+ 	free(dev->mt_slot_vals);
108++	free(dev->mt_sync.changes);
109++	free(dev->mt_sync.mt_state);
110+ 	dev->mt_slot_vals = NULL;
111++	dev->mt_sync.changes = NULL;
112++	dev->mt_sync.mt_state = NULL;
113+ }
114+ 
115+ static int
116+@@ -341,7 +331,11 @@ init_slots(struct libevdev *dev)
117+ 	int rc = 0;
118+ 
119+ 	free(dev->mt_slot_vals);
120++	free(dev->mt_sync.changes);
121++	free(dev->mt_sync.mt_state);
122+ 	dev->mt_slot_vals = NULL;
123++	dev->mt_sync.changes = NULL;
124++	dev->mt_sync.mt_state = NULL;
125+ 
126+ 	/* devices with ABS_RESERVED aren't MT devices,
127+ 	   see the documentation for multitouch-related
128+@@ -365,6 +359,19 @@ init_slots(struct libevdev *dev)
129+ 	}
130+ 	dev->current_slot = abs_info->value;
131+ 
132++	dev->mt_sync.mt_state_sz = sizeof(*dev->mt_sync.mt_state) +
133++				   dev->num_slots * sizeof(int32_t);
134++	dev->mt_sync.mt_state = calloc(1, dev->mt_sync.mt_state_sz);
135++
136++	dev->mt_sync.changes_sz = dev->num_slots *
137++				  sizeof(dev->mt_sync.changes[0]);
138++	dev->mt_sync.changes = malloc(dev->mt_sync.changes_sz);
139++
140++	if (!dev->mt_sync.changes || !dev->mt_sync.mt_state) {
141++		rc = -ENOMEM;
142++		goto out;
143++	}
144++
145+ 	reset_tracking_ids(dev);
146+ out:
147+ 	return rc;
148+@@ -523,10 +530,8 @@ libevdev_set_fd(struct libevdev* dev, int fd)
149+ 	if (rc != 0)
150+ 		goto out;
151+ 
152+-	if (dev->num_slots != -1) {
153+-		struct slot_change_state unused[dev->num_slots];
154+-		sync_mt_state(dev, unused);
155+-	}
156++	if (dev->num_slots != -1)
157++		sync_mt_state(dev);
158+ 
159+ 	rc = init_event_queue(dev);
160+ 	if (rc < 0) {
161+@@ -661,33 +666,27 @@ out:
162+ }
163+ 
164+ static int
165+-sync_mt_state(struct libevdev *dev,
166+-	      struct slot_change_state changes_out[dev->num_slots])
167++sync_mt_state(struct libevdev *dev)
168+ {
169+-#define MAX_SLOTS 256
170+ 	int rc = 0;
171+-	struct slot_change_state changes[MAX_SLOTS] = {0};
172+-	unsigned int nslots = min(MAX_SLOTS, dev->num_slots);
173++	struct mt_sync_state *mt_state = dev->mt_sync.mt_state;
174++	struct slot_change_state *changes = dev->mt_sync.changes;
175+ 
176+-	for (int axis = ABS_MT_MIN; axis <= ABS_MT_MAX; axis++) {
177+-		/* EVIOCGMTSLOTS required format */
178+-		struct mt_sync_state {
179+-			uint32_t code;
180+-			int32_t val[MAX_SLOTS];
181+-		} mt_state;
182++	memset(dev->mt_sync.changes, 0, dev->mt_sync.changes_sz);
183+ 
184++	for (int axis = ABS_MT_MIN; axis <= ABS_MT_MAX; axis++) {
185+ 		if (axis == ABS_MT_SLOT ||
186+ 		    !libevdev_has_event_code(dev, EV_ABS, axis))
187+ 			continue;
188+ 
189+-		mt_state.code = axis;
190+-		rc = ioctl(dev->fd, EVIOCGMTSLOTS(sizeof(mt_state)), &mt_state);
191++		mt_state->code = axis;
192++		rc = ioctl(dev->fd, EVIOCGMTSLOTS(dev->mt_sync.mt_state_sz), mt_state);
193+ 		if (rc < 0)
194+ 			goto out;
195+ 
196+-		for (unsigned int slot = 0; slot < nslots; slot++) {
197++		for (int slot = 0; slot < dev->num_slots; slot++) {
198+ 			int val_before = *slot_value(dev, slot, axis),
199+-			    val_after = mt_state.val[slot];
200++			    val_after = mt_state->val[slot];
201+ 
202+ 			if (axis == ABS_MT_TRACKING_ID) {
203+ 				if (val_before == -1 && val_after != -1) {
204+@@ -716,17 +715,12 @@ sync_mt_state(struct libevdev *dev,
205+ 		}
206+ 	}
207+ 
208+-	if (dev->num_slots > MAX_SLOTS)
209+-		memset(changes_out, 0, sizeof(*changes) * dev->num_slots);
210+-
211+-	memcpy(changes_out, changes, sizeof(*changes) * nslots);
212+ out:
213+ 	return rc;
214+ }
215+ 
216+ static void
217+ terminate_slots(struct libevdev *dev,
218+-		const struct slot_change_state changes[dev->num_slots],
219+ 		int *last_reported_slot)
220+ {
221+ 	const unsigned int map[] = {BTN_TOOL_FINGER, BTN_TOOL_DOUBLETAP,
222+@@ -734,6 +728,7 @@ terminate_slots(struct libevdev *dev,
223+ 				    BTN_TOOL_QUINTTAP};
224+ 	bool touches_stopped = false;
225+ 	int ntouches_before = 0, ntouches_after = 0;
226++	struct slot_change_state *changes = dev->mt_sync.changes;
227+ 
228+ 	/* For BTN_TOOL_* emulation, we need to know how many touches we had
229+ 	 * before and how many we have left once we terminate all the ones
230+@@ -797,10 +792,10 @@ terminate_slots(struct libevdev *dev,
231+ 
232+ static int
233+ push_mt_sync_events(struct libevdev *dev,
234+-		    const struct slot_change_state changes[dev->num_slots],
235+ 		    int last_reported_slot)
236+ {
237+ 	struct input_absinfo abs_info;
238++	struct slot_change_state *changes = dev->mt_sync.changes;
239+ 	int rc;
240+ 
241+ 	for (int slot = 0; slot < dev->num_slots;  slot++) {
242+@@ -909,8 +904,6 @@ sync_state(struct libevdev *dev)
243+ 	int rc = 0;
244+ 	bool want_mt_sync = false;
245+ 	int last_reported_slot = 0;
246+-	struct slot_change_state changes[dev->num_slots > 0 ? dev->num_slots : 1];
247+-		memset(changes, 0, sizeof(changes));
248+ 
249+ 	 /* see section "Discarding events before synchronizing" in
250+ 	  * libevdev/libevdev.h */
251+@@ -928,9 +921,9 @@ sync_state(struct libevdev *dev)
252+ 	if (dev->num_slots > -1 &&
253+ 	    libevdev_has_event_code(dev, EV_ABS, ABS_MT_SLOT)) {
254+ 		want_mt_sync = true;
255+-		rc = sync_mt_state(dev, changes);
256++		rc = sync_mt_state(dev);
257+ 		if (rc == 0)
258+-			terminate_slots(dev, changes, &last_reported_slot);
259++			terminate_slots(dev, &last_reported_slot);
260+ 		else
261+ 			want_mt_sync = false;
262+ 	}
263+@@ -944,7 +937,7 @@ sync_state(struct libevdev *dev)
264+ 	if (rc == 0 && libevdev_has_event_type(dev, EV_ABS))
265+ 		rc = sync_abs_state(dev);
266+ 	if (rc == 0 && want_mt_sync)
267+-		push_mt_sync_events(dev, changes, last_reported_slot);
268++		push_mt_sync_events(dev, last_reported_slot);
269+ 
270+ 	dev->queue_nsync = queue_num_elements(dev);
271+ 
272+-- 
273+2.30.0
274+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 69403a63ed29a1ee62edb8d0885fa770dd9a53cf
+1, -0
1@@ -0,0 +1 @@
2+1.12.0 r0
+85, -0
 1@@ -0,0 +1,85 @@
 2+/* #undef AC_APPLE_UNIVERSAL_BUILD */
 3+/* #undef CRAY_STACKSEG_END */
 4+/* #undef C_ALLOCA */
 5+#define EH_FRAME_FLAGS "a"
 6+/* #undef FFI_DEBUG */
 7+/* #undef FFI_EXEC_TRAMPOLINE_TABLE */
 8+/* #undef FFI_MMAP_EXEC_EMUTRAMP_PAX */
 9+/* #undef FFI_MMAP_EXEC_WRIT */
10+/* #undef FFI_NO_RAW_API */
11+/* #undef FFI_NO_STRUCTS */
12+#define HAVE_ALLOCA 1
13+#define HAVE_ALLOCA_H 1
14+#define HAVE_AS_CFI_PSEUDO_OP 1
15+/* #undef HAVE_AS_REGISTER_PSEUDO_OP */
16+/* #undef HAVE_AS_S390_ZARCH */
17+/* #undef HAVE_AS_SPARC_UA_PCREL */
18+#ifdef __x86_64__
19+#define HAVE_AS_X86_64_UNWIND_SECTION_TYPE 1
20+#define HAVE_AS_X86_PCREL 1
21+#endif
22+#define HAVE_DLFCN_H 1
23+#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1
24+#define HAVE_INTTYPES_H 1
25+#define HAVE_LONG_DOUBLE 1
26+/* #undef HAVE_LONG_DOUBLE_VARIANT */
27+#define HAVE_MEMCPY 1
28+#define HAVE_MEMORY_H 1
29+#define HAVE_MKOSTEMP 1
30+#define HAVE_MMAP 1
31+#define HAVE_MMAP_ANON 1
32+#define HAVE_MMAP_DEV_ZERO 1
33+#define HAVE_MMAP_FILE 1
34+#define HAVE_RO_EH_FRAME 1
35+#define HAVE_STDINT_H 1
36+#define HAVE_STDLIB_H 1
37+#define HAVE_STRINGS_H 1
38+#define HAVE_STRING_H 1
39+#define HAVE_SYS_MMAN_H 1
40+#define HAVE_SYS_STAT_H 1
41+#define HAVE_SYS_TYPES_H 1
42+#define HAVE_UNISTD_H 1
43+#define LIBFFI_GNU_SYMBOL_VERSIONING 1
44+#define LT_OBJDIR ".libs/"
45+#define PACKAGE "libffi"
46+#define PACKAGE_BUGREPORT "http://github.com/libffi/libffi/issues"
47+#define PACKAGE_NAME "libffi"
48+#define PACKAGE_STRING "libffi 3.3"
49+#define PACKAGE_TARNAME "libffi"
50+#define PACKAGE_URL ""
51+#define PACKAGE_VERSION "3.3"
52+#define SIZEOF_DOUBLE 8
53+#define SIZEOF_LONG_DOUBLE 16
54+#define SIZEOF_SIZE_T 8
55+/* #undef STACK_DIRECTION */
56+#define STDC_HEADERS 1
57+/* #undef SYMBOL_UNDERSCORE */
58+/* #undef USING_PURIFY */
59+#define VERSION "3.3"
60+#if defined AC_APPLE_UNIVERSAL_BUILD
61+# if defined __BIG_ENDIAN__
62+#  define WORDS_BIGENDIAN 1
63+# endif
64+#else
65+# ifndef WORDS_BIGENDIAN
66+/* #  undef WORDS_BIGENDIAN */
67+# endif
68+#endif
69+/* #undef size_t */
70+#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
71+#ifdef LIBFFI_ASM
72+#ifdef __APPLE__
73+#define FFI_HIDDEN(name) .private_extern name
74+#else
75+#define FFI_HIDDEN(name) .hidden name
76+#endif
77+#else
78+#define FFI_HIDDEN __attribute__ ((visibility ("hidden")))
79+#endif
80+#else
81+#ifdef LIBFFI_ASM
82+#define FFI_HIDDEN(name)
83+#else
84+#define FFI_HIDDEN
85+#endif
86+#endif
+38, -0
 1@@ -0,0 +1,38 @@
 2+local arch = config.target.platform:match('[^-]*')
 3+cflags{
 4+	'-Wall', '-Wno-deprecated-declarations',
 5+	'-I $dir',
 6+	'-I $outdir/include',
 7+	'-I $srcdir/include',
 8+}
 9+
10+build('sed', '$outdir/include/ffi.h', '$srcdir/include/ffi.h.in', {
11+	expr={
12+		'-e s,@VERSION@,3.3,',
13+		string.format('-e s,@TARGET@,%s,', arch:upper()),
14+		'-e s,@HAVE_LONG_DOUBLE@,1,',
15+		'-e s,@HAVE_LONG_DOUBLE_VARIANT@,0,',
16+		'-e s,@FFI_EXEC_TRAMPOLINE_TABLE@,0,',
17+	},
18+})
19+
20+pkg.hdrs = {
21+	copy('$outdir/include', '$srcdir/src/'..({x86_64='x86', aarch64='aarch64'})[arch], {'ffitarget.h'}),
22+	'$outdir/include/ffi.h',
23+	install=true,
24+}
25+
26+pkg.deps = {
27+	'$gendir/headers',
28+}
29+
30+lib('libffi.a', [[
31+	src/(
32+		prep_cif.c types.c raw_api.c java_raw_api.c closures.c
33+		@aarch64 aarch64/(ffi.c sysv.S)
34+		@x86_64 x86/(ffi64.c unix64.S ffiw64.c win64.S)
35+	)
36+]])
37+file('lib/libffi.a', '644', '$outdir/libffi.a')
38+
39+fetch 'git'
+36, -0
 1@@ -0,0 +1,36 @@
 2+From a53acabb2bade1d1934cc3a44f0174689255cf8a Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Tue, 13 Aug 2019 22:20:39 +0000
 5+Subject: [PATCH] Use fixed-type integer types when available
 6+
 7+This avoids the use of gcc attributes to select the integer width.
 8+---
 9+ include/ffi_common.h | 12 +++++++++++-
10+ 1 file changed, 11 insertions(+), 1 deletion(-)
11+
12+diff --git a/include/ffi_common.h b/include/ffi_common.h
13+index 76b9dd6..cfec340 100644
14+--- a/include/ffi_common.h
15++++ b/include/ffi_common.h
16+@@ -112,7 +112,17 @@ typedef struct
17+ } extended_cif;
18+ 
19+ /* Terse sized type definitions.  */
20+-#if defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C)
21++#if __STDC_VERSION__ >= 199901L
22++# include <inttypes.h>
23++typedef uint8_t UINT8;
24++typedef int8_t SINT8;
25++typedef uint16_t UINT16;
26++typedef int16_t SINT16;
27++typedef uint32_t UINT32;
28++typedef int32_t SINT32;
29++typedef uint64_t UINT64;
30++typedef int64_t SINT64;
31++#elif defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C)
32+ typedef unsigned char UINT8;
33+ typedef signed char   SINT8;
34+ typedef unsigned short UINT16;
35+-- 
36+2.24.0
37+
+41, -0
 1@@ -0,0 +1,41 @@
 2+From 68b09c2e546bb3ea3ad43904e5b499729ee3bee8 Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Tue, 13 Aug 2019 22:27:49 +0000
 5+Subject: [PATCH] Use generic padding instead of 128-bit integers
 6+
 7+---
 8+ src/x86/ffi64.c | 14 +-------------
 9+ 1 file changed, 1 insertion(+), 13 deletions(-)
10+
11+diff --git a/src/x86/ffi64.c b/src/x86/ffi64.c
12+index dec331c..a48c74d 100644
13+--- a/src/x86/ffi64.c
14++++ b/src/x86/ffi64.c
15+@@ -40,23 +40,11 @@
16+ #define MAX_GPR_REGS 6
17+ #define MAX_SSE_REGS 8
18+ 
19+-#if defined(__INTEL_COMPILER)
20+-#include "xmmintrin.h"
21+-#define UINT128 __m128
22+-#else
23+-#if defined(__SUNPRO_C)
24+-#include <sunmedia_types.h>
25+-#define UINT128 __m128i
26+-#else
27+-#define UINT128 __int128_t
28+-#endif
29+-#endif
30+-
31+ union big_int_union
32+ {
33+   UINT32 i32;
34+   UINT64 i64;
35+-  UINT128 i128;
36++  char pad[16];
37+ };
38+ 
39+ struct register_args
40+-- 
41+2.24.0
42+
+25, -0
 1@@ -0,0 +1,25 @@
 2+From 160695fc15e589d08843b07b9f9950be574f3aee Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Tue, 13 Aug 2019 22:28:49 +0000
 5+Subject: [PATCH] Don't use complex types if they are not supported
 6+
 7+---
 8+ src/x86/ffitarget.h | 2 +-
 9+ 1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+diff --git a/src/x86/ffitarget.h b/src/x86/ffitarget.h
12+index 85ccedf..d4f384c 100644
13+--- a/src/x86/ffitarget.h
14++++ b/src/x86/ffitarget.h
15+@@ -50,7 +50,7 @@
16+ #endif
17+ 
18+ #define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION
19+-#ifndef _MSC_VER
20++#if !defined(_MSC_VER) && !defined(__STDC_NO_COMPLEX__)
21+ #define FFI_TARGET_HAS_COMPLEX_TYPE
22+ #endif
23+ 
24+-- 
25+2.24.0
26+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 5dcb741f1544c5e18c9dbf96aeb8b61cc556a616
+1, -0
1@@ -0,0 +1 @@
2+3.3 r0
+6, -0
1@@ -0,0 +1,6 @@
2+#define HAVE_LIBWACOM 0
3+#define HAVE_VERSIONSORT 1
4+#define HTTP_DOC_LINK "https://wayland.freedesktop.org/libinput/doc/1.19.3/"
5+#define LIBINPUT_QUIRKS_DIR "/share/libinput"
6+#define LIBINPUT_QUIRKS_OVERRIDE_FILE "/etc/libinput/local-overrides.quirks"
7+#define _GNU_SOURCE 1
+105, -0
  1@@ -0,0 +1,105 @@
  2+cflags{
  3+	'-std=c11', '-Wall',
  4+	'-I $dir',
  5+	'-I $srcdir/include',
  6+	'-isystem $builddir/pkg/libevdev/include',
  7+	'-isystem $builddir/pkg/linux-headers/include',
  8+	'-isystem $builddir/pkg/mtdev/include',
  9+}
 10+
 11+pkg.hdrs = copy('$outdir/include', '$srcdir/src', {'libinput.h'})
 12+pkg.deps = {
 13+	'pkg/libevdev/headers',
 14+	'pkg/linux-headers/headers',
 15+	'pkg/mtdev/headers',
 16+}
 17+
 18+lib('libinput.a', [[
 19+	src/(
 20+		libinput.c
 21+		evdev.c
 22+		evdev-debounce.c
 23+		evdev-fallback.c
 24+		evdev-totem.c
 25+		evdev-middle-button.c
 26+		evdev-mt-touchpad.c
 27+		evdev-mt-touchpad-tap.c
 28+		evdev-mt-touchpad-thumb.c
 29+		evdev-mt-touchpad-buttons.c
 30+		evdev-mt-touchpad-edge-scroll.c
 31+		evdev-mt-touchpad-gestures.c
 32+		evdev-tablet.c
 33+		evdev-tablet-pad.c
 34+		evdev-tablet-pad-leds.c
 35+		filter.c
 36+		filter-flat.c
 37+		filter-low-dpi.c
 38+		filter-mouse.c
 39+		filter-touchpad.c
 40+		filter-touchpad-flat.c
 41+		filter-touchpad-x230.c
 42+		filter-tablet.c
 43+		filter-trackpoint.c
 44+		netlink-seat.c
 45+		path-seat.c
 46+		quirks.c
 47+		timer.c
 48+
 49+		util-list.c
 50+		util-ratelimit.c
 51+		util-strings.c
 52+		util-prop-parsers.c
 53+	)
 54+	$builddir/pkg/libevdev/libevdev.a
 55+	$builddir/pkg/mtdev/libmtdev.a
 56+]])
 57+
 58+local quirks = {
 59+	-- <cd src/quirks && printf "\t'%s',\n" *.quirks
 60+	'10-generic-keyboard.quirks',
 61+	'10-generic-lid.quirks',
 62+	'10-generic-mouse.quirks',
 63+	'10-generic-trackball.quirks',
 64+	'30-vendor-a4tech.quirks',
 65+	'30-vendor-aiptek.quirks',
 66+	'30-vendor-alps.quirks',
 67+	'30-vendor-contour.quirks',
 68+	'30-vendor-cypress.quirks',
 69+	'30-vendor-elantech.quirks',
 70+	'30-vendor-ibm.quirks',
 71+	'30-vendor-kensington.quirks',
 72+	'30-vendor-logitech.quirks',
 73+	'30-vendor-madcatz.quirks',
 74+	'30-vendor-microsoft.quirks',
 75+	'30-vendor-razer.quirks',
 76+	'30-vendor-starlabs.quirks',
 77+	'30-vendor-synaptics.quirks',
 78+	'30-vendor-trust.quirks',
 79+	'30-vendor-vmware.quirks',
 80+	'30-vendor-wacom.quirks',
 81+	'50-framework.quirks',
 82+	'50-system-acer.quirks',
 83+	'50-system-apple.quirks',
 84+	'50-system-asus.quirks',
 85+	'50-system-chicony.quirks',
 86+	'50-system-chuwi.quirks',
 87+	'50-system-cyborg.quirks',
 88+	'50-system-dell.quirks',
 89+	'50-system-gigabyte.quirks',
 90+	'50-system-google.quirks',
 91+	'50-system-gpd.quirks',
 92+	'50-system-hp.quirks',
 93+	'50-system-huawei.quirks',
 94+	'50-system-lenovo.quirks',
 95+	'50-system-pine64.quirks',
 96+	'50-system-prestigio.quirks',
 97+	'50-system-purism.quirks',
 98+	'50-system-sony.quirks',
 99+	'50-system-system76.quirks',
100+	'50-system-toshiba.quirks',
101+}
102+for _, quirk in ipairs(quirks) do
103+	file('share/libinput/'..quirk, '644', '$srcdir/quirks/'..quirk)
104+end
105+
106+fetch 'git'
+32, -0
 1@@ -0,0 +1,32 @@
 2+/*
 3+ * Copyright © 2013 Jonas Ådahl
 4+ *
 5+ * Permission is hereby granted, free of charge, to any person obtaining a
 6+ * copy of this software and associated documentation files (the "Software"),
 7+ * to deal in the Software without restriction, including without limitation
 8+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 9+ * and/or sell copies of the Software, and to permit persons to whom the
10+ * Software is furnished to do so, subject to the following conditions:
11+ *
12+ * The above copyright notice and this permission notice (including the next
13+ * paragraph) shall be included in all copies or substantial portions of the
14+ * Software.
15+ *
16+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22+ * DEALINGS IN THE SOFTWARE.
23+ */
24+
25+#ifndef LIBINPUT_VERSION_H
26+#define LIBINPUT_VERSION_H
27+
28+#define LIBINPUT_VERSION_MAJOR 1
29+#define LIBINPUT_VERSION_MINOR 19
30+#define LIBINPUT_VERSION_MICRO 3
31+#define LIBINPUT_VERSION "1.19.3"
32+
33+#endif
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 702610db1c4c1e14c87dbd30380f89b48c50b841
+1, -0
1@@ -0,0 +1 @@
2+1.19.3 r0
+6, -0
1@@ -0,0 +1,6 @@
2+# libjpeg-turbo
3+
4+# `jconfig.h` and `jconfigint.h`
5+Generated with
6+
7+	cmake -DENABLE_SHARED=0 -DWITH_SIMD=0 -DWITH_JPEG8=1 ..
+34, -0
 1@@ -0,0 +1,34 @@
 2+cflags{
 3+	'-I $outdir',
 4+	'-I $outdir/include',
 5+}
 6+
 7+build('cat', '$outdir/jconfigint.h', {
 8+	'$builddir/probe/HAVE__THREAD_LOCAL',
 9+	'$builddir/probe/HAVE___BUILTIN_CTZL',
10+	'$dir/jconfigint.h',
11+})
12+
13+pkg.deps = {
14+	'$gendir/headers',
15+	'$outdir/jconfigint.h',
16+}
17+
18+lib('libjpeg-turbo.a', [[
19+	jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
20+	jcicc.c jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c
21+	jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c
22+	jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c
23+	jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c
24+	jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c
25+	jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
26+
27+	jaricom.c jcarith.c jdarith.c jsimd_none.c
28+]])
29+
30+pkg.hdrs = {
31+	copy('$outdir/include', '$srcdir', {'jmorecfg.h', 'jpeglib.h'}),
32+	copy('$outdir/include', '$dir', {'jconfig.h'}),
33+}
34+
35+fetch 'git'
+22, -0
 1@@ -0,0 +1,22 @@
 2+#define JPEG_LIB_VERSION  80
 3+#define LIBJPEG_TURBO_VERSION  2.0.6
 4+#define LIBJPEG_TURBO_VERSION_NUMBER  2000006
 5+#define C_ARITH_CODING_SUPPORTED 1
 6+#define D_ARITH_CODING_SUPPORTED 1
 7+/* #undef MEM_SRCDST_SUPPORTED */
 8+/* #undef WITH_SIMD */
 9+#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
10+#define HAVE_LOCALE_H 1
11+#define HAVE_STDDEF_H 1
12+#define HAVE_STDLIB_H 1
13+#define NEED_SYS_TYPES_H 1
14+/* #undef NEED_BSD_STRINGS */
15+#define HAVE_UNSIGNED_CHAR 1
16+#define HAVE_UNSIGNED_SHORT 1
17+/* #undef INCOMPLETE_TYPES_BROKEN */
18+/* #undef RIGHT_SHIFT_IS_UNSIGNED */
19+#ifndef __CHAR_UNSIGNED__
20+/* #undef __CHAR_UNSIGNED__ */
21+#endif
22+/* #undef const */
23+/* #undef size_t */
+20, -0
 1@@ -0,0 +1,20 @@
 2+#define BUILD  "20201116"
 3+#undef inline
 4+#define INLINE  __inline__ __attribute__((always_inline))
 5+#ifdef HAVE__THREAD_LOCAL
 6+#define THREAD_LOCAL  _Thread_local
 7+#endif
 8+#define PACKAGE_NAME  "libjpeg-turbo"
 9+#define VERSION  "2.0.6"
10+#define SIZEOF_SIZE_T  8
11+#ifdef HAVE___BUILTIN_CTZL
12+#define HAVE_BUILTIN_CTZL
13+#endif
14+/* #undef HAVE_INTRIN_H */
15+#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)
16+#if (SIZEOF_SIZE_T == 8)
17+#define HAVE_BITSCANFORWARD64
18+#elif (SIZEOF_SIZE_T == 4)
19+#define HAVE_BITSCANFORWARD
20+#endif
21+#endif
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 10ba6ed3365615ed5c2995fe2d240cb2d5000173
+1, -0
1@@ -0,0 +1 @@
2+2.0.6 r0
+44, -0
 1@@ -0,0 +1,44 @@
 2+#define HAVE_DLFCN_H 1
 3+/* #undef HAVE_FEENABLEEXCEPT */
 4+#define HAVE_INTTYPES_H 1
 5+/* #undef HAVE_LIBM */
 6+#define HAVE_LIBZ 1
 7+#define HAVE_POW 1
 8+#define HAVE_STDINT_H 1
 9+#define HAVE_STDIO_H 1
10+#define HAVE_STDLIB_H 1
11+#define HAVE_STRINGS_H 1
12+#define HAVE_STRING_H 1
13+#define HAVE_SYS_STAT_H 1
14+#define HAVE_SYS_TYPES_H 1
15+#define HAVE_UNISTD_H 1
16+#define LT_OBJDIR ".libs/"
17+#define PACKAGE "libpng"
18+#define PACKAGE_BUGREPORT "png-mng-implement@lists.sourceforge.net"
19+#define PACKAGE_NAME "libpng"
20+#define PACKAGE_STRING "libpng 1.6.43"
21+#define PACKAGE_TARNAME "libpng"
22+#define PACKAGE_URL ""
23+#define PACKAGE_VERSION "1.6.43"
24+/* #undef PNG_ARM_NEON_API_SUPPORTED */
25+/* #undef PNG_ARM_NEON_CHECK_SUPPORTED */
26+/* #undef PNG_ARM_NEON_OPT */
27+/* #undef PNG_INTEL_SSE_OPT */
28+/* #undef PNG_LOONGARCH_LSX_OPT */
29+/* #undef PNG_MIPS_MMI_API_SUPPORTED */
30+/* #undef PNG_MIPS_MMI_CHECK_SUPPORTED */
31+/* #undef PNG_MIPS_MMI_OPT */
32+/* #undef PNG_MIPS_MSA_API_SUPPORTED */
33+/* #undef PNG_MIPS_MSA_CHECK_SUPPORTED */
34+/* #undef PNG_MIPS_MSA_OPT */
35+/* #undef PNG_POWERPC_VSX_API_SUPPORTED */
36+/* #undef PNG_POWERPC_VSX_CHECK_SUPPORTED */
37+/* #undef PNG_POWERPC_VSX_OPT */
38+#define STDC_HEADERS 1
39+/* #undef TM_IN_SYS_TIME */
40+#define VERSION "1.6.43"
41+#define restrict __restrict__
42+#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
43+# define _Restrict
44+# define __restrict__
45+#endif
+39, -0
 1@@ -0,0 +1,39 @@
 2+cflags{
 3+	'-D HAVE_CONFIG_H',
 4+	'-I $dir',
 5+	'-I $outdir/include',
 6+	'-isystem $builddir/pkg/zlib/include',
 7+}
 8+
 9+build('awk', '$outdir/pnglibconf.tf4', {
10+	'$srcdir/pngconf.h',
11+	'$srcdir/scripts/pnglibconf.dfa',
12+	'$srcdir/pngusr.dfa',
13+	'|', '$srcdir/scripts/options.awk',
14+}, {expr='-f $srcdir/scripts/options.awk out=/dev/stdout version=search'})
15+build('awk', '$outdir/pnglibconf.c', '$outdir/pnglibconf.tf4', {
16+	expr='-f $srcdir/scripts/options.awk out=/dev/stdout',
17+})
18+build('cpp', '$outdir/pnglibconf.tf1', {'$outdir/pnglibconf.c', '||', 'pkg/zlib/headers'})
19+build('awk', '$outdir/include/pnglibconf.h', '$outdir/pnglibconf.tf1', {
20+	expr='-f $srcdir/scripts/dfn.awk out=/dev/stdout',
21+})
22+
23+pkg.hdrs = {
24+	copy('$outdir/include', '$srcdir', {'png.h', 'pngconf.h'}),
25+	'$outdir/include/pnglibconf.h',
26+	install=true,
27+}
28+pkg.deps = {'$outdir/include/pnglibconf.h', 'pkg/zlib/headers'}
29+
30+lib('libpng.a', [[
31+	png.c pngerror.c
32+	pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c
33+	pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c
34+	@aarch64 arm/(arm_init.c filter_neon.S filter_neon_intrinsics.c palette_neon_intrinsics.c)
35+	@x86_64 intel/(intel_init.c filter_sse2_intrinsics.c)
36+	$builddir/pkg/zlib/libz.a
37+]])
38+file('lib/libpng.a', '644', '$outdir/libpng.a')
39+
40+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit ed217e3e601d8e462f7fd1e04bed43ac42212429
+1, -0
1@@ -0,0 +1 @@
2+1.6.43 r0
+13, -0
 1@@ -0,0 +1,13 @@
 2+# libxkbcommon
 3+
 4+## config.h
 5+Generated with
 6+
 7+	meson \
 8+		--prefix=/ \
 9+		-Dxkb-config-root=/share/xkb \
10+		-Dx-locale-root=/share/xlocale \
11+		-Denable-x11=false \
12+		-Denable-wayland=false \
13+		-Denable-docs=false \
14+		build
+20, -0
 1@@ -0,0 +1,20 @@
 2+#define DEFAULT_XKB_LAYOUT "us"
 3+#define DEFAULT_XKB_MODEL "pc105"
 4+#define DEFAULT_XKB_OPTIONS NULL
 5+#define DEFAULT_XKB_RULES "evdev"
 6+#define DEFAULT_XKB_VARIANT NULL
 7+#define DFLT_XKB_CONFIG_EXTRA_PATH "/etc/xkb"
 8+#define DFLT_XKB_CONFIG_ROOT "/share/xkb"
 9+#define EXIT_INVALID_USAGE 2
10+#define HAVE_ASPRINTF 1
11+#define HAVE_EACCESS 1
12+#define HAVE_EUIDACCESS 1
13+#define HAVE_MKOSTEMP 1
14+#define HAVE_MMAP 1
15+#define HAVE_POSIX_FALLOCATE 1
16+#define HAVE_SECURE_GETENV 1
17+#define HAVE_STRNDUP 1
18+#define HAVE_UNISTD_H 1
19+#define HAVE___BUILTIN_EXPECT 1
20+#define XLOCALEDIR "/share/xlocale"
21+#define _GNU_SOURCE 1
+48, -0
 1@@ -0,0 +1,48 @@
 2+cflags{
 3+	'-I $dir',
 4+	'-I $srcdir/include',
 5+	'-I $srcdir/src',
 6+}
 7+
 8+pkg.hdrs = copy('$outdir/include/xkbcommon', '$srcdir/include/xkbcommon', {
 9+	'xkbcommon.h',
10+	'xkbcommon-compat.h',
11+	'xkbcommon-keysyms.h',
12+	'xkbcommon-names.h',
13+})
14+
15+lib('libxkbcommon.a', [[src/(
16+	compose/parser.c
17+	compose/paths.c
18+	compose/state.c
19+	compose/table.c
20+	xkbcomp/action.c
21+	xkbcomp/ast-build.c
22+	xkbcomp/compat.c
23+	xkbcomp/expr.c
24+	xkbcomp/include.c
25+	xkbcomp/keycodes.c
26+	xkbcomp/keymap.c
27+	xkbcomp/keymap-dump.c
28+	xkbcomp/keywords.c
29+	xkbcomp/parser.c
30+	xkbcomp/rules.c
31+	xkbcomp/scanner.c
32+	xkbcomp/symbols.c
33+	xkbcomp/types.c
34+	xkbcomp/vmod.c
35+	xkbcomp/xkbcomp.c
36+	atom.c
37+	context.c
38+	context-priv.c
39+	keysym.c
40+	keysym-utf.c
41+	keymap.c
42+	keymap-priv.c
43+	state.c
44+	text.c
45+	utf8.c
46+	utils.c
47+)]])
48+
49+fetch 'git'
+3459, -0
   1@@ -0,0 +1,3459 @@
   2+From 9c7c0b8c9b850c15b519be769f81f7a53e6299d7 Mon Sep 17 00:00:00 2001
   3+From: Michael Forney <mforney@mforney.org>
   4+Date: Sat, 26 Oct 2019 02:05:31 -0700
   5+Subject: [PATCH] Track generated xkbcomp parser
   6+
   7+Generated with
   8+
   9+	bison -o parser.c -H -p _xkbcommon_ parser.y
  10+---
  11+ src/xkbcomp/parser.c | 3258 ++++++++++++++++++++++++++++++++++++++++++
  12+ src/xkbcomp/parser.h |  171 +++
  13+ 2 files changed, 3429 insertions(+)
  14+ create mode 100644 src/xkbcomp/parser.c
  15+ create mode 100644 src/xkbcomp/parser.h
  16+
  17+diff --git a/src/xkbcomp/parser.c b/src/xkbcomp/parser.c
  18+new file mode 100644
  19+index 0000000..e9d5a8f
  20+--- /dev/null
  21++++ b/src/xkbcomp/parser.c
  22+@@ -0,0 +1,3258 @@
  23++/* A Bison parser, made by GNU Bison 3.8.2.  */
  24++
  25++/* Bison implementation for Yacc-like parsers in C
  26++
  27++   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
  28++   Inc.
  29++
  30++   This program is free software: you can redistribute it and/or modify
  31++   it under the terms of the GNU General Public License as published by
  32++   the Free Software Foundation, either version 3 of the License, or
  33++   (at your option) any later version.
  34++
  35++   This program is distributed in the hope that it will be useful,
  36++   but WITHOUT ANY WARRANTY; without even the implied warranty of
  37++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  38++   GNU General Public License for more details.
  39++
  40++   You should have received a copy of the GNU General Public License
  41++   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
  42++
  43++/* As a special exception, you may create a larger work that contains
  44++   part or all of the Bison parser skeleton and distribute that work
  45++   under terms of your choice, so long as that work isn't itself a
  46++   parser generator using the skeleton or a modified version thereof
  47++   as a parser skeleton.  Alternatively, if you modify or redistribute
  48++   the parser skeleton itself, you may (at your option) remove this
  49++   special exception, which will cause the skeleton and the resulting
  50++   Bison output files to be licensed under the GNU General Public
  51++   License without this special exception.
  52++
  53++   This special exception was added by the Free Software Foundation in
  54++   version 2.2 of Bison.  */
  55++
  56++/* C LALR(1) parser skeleton written by Richard Stallman, by
  57++   simplifying the original so-called "semantic" parser.  */
  58++
  59++/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
  60++   especially those whose name start with YY_ or yy_.  They are
  61++   private implementation details that can be changed or removed.  */
  62++
  63++/* All symbols defined below should begin with yy or YY, to avoid
  64++   infringing on user name space.  This should be done even for local
  65++   variables, as they might otherwise be expanded by user macros.
  66++   There are some unavoidable exceptions within include files to
  67++   define necessary library symbols; they are noted "INFRINGES ON
  68++   USER NAME SPACE" below.  */
  69++
  70++/* Identify Bison output, and Bison version.  */
  71++#define YYBISON 30802
  72++
  73++/* Bison version string.  */
  74++#define YYBISON_VERSION "3.8.2"
  75++
  76++/* Skeleton name.  */
  77++#define YYSKELETON_NAME "yacc.c"
  78++
  79++/* Pure parsers.  */
  80++#define YYPURE 1
  81++
  82++/* Push parsers.  */
  83++#define YYPUSH 0
  84++
  85++/* Pull parsers.  */
  86++#define YYPULL 1
  87++
  88++
  89++/* Substitute the variable and function names.  */
  90++#define yyparse         _xkbcommon_parse
  91++#define yylex           _xkbcommon_lex
  92++#define yyerror         _xkbcommon_error
  93++#define yydebug         _xkbcommon_debug
  94++#define yynerrs         _xkbcommon_nerrs
  95++
  96++/* First part of user prologue.  */
  97++#line 33 "parser.y"
  98++
  99++#include "config.h"
 100++
 101++#include "xkbcomp/xkbcomp-priv.h"
 102++#include "xkbcomp/ast-build.h"
 103++#include "xkbcomp/parser-priv.h"
 104++#include "scanner-utils.h"
 105++
 106++struct parser_param {
 107++    struct xkb_context *ctx;
 108++    struct scanner *scanner;
 109++    XkbFile *rtrn;
 110++    bool more_maps;
 111++};
 112++
 113++#define parser_err(param, fmt, ...) \
 114++    scanner_err((param)->scanner, fmt, ##__VA_ARGS__)
 115++
 116++#define parser_warn(param, fmt, ...) \
 117++    scanner_warn((param)->scanner, fmt, ##__VA_ARGS__)
 118++
 119++static void
 120++_xkbcommon_error(struct parser_param *param, const char *msg)
 121++{
 122++    parser_err(param, "%s", msg);
 123++}
 124++
 125++static bool
 126++resolve_keysym(const char *name, xkb_keysym_t *sym_rtrn)
 127++{
 128++    xkb_keysym_t sym;
 129++
 130++    if (!name || istreq(name, "any") || istreq(name, "nosymbol")) {
 131++        *sym_rtrn = XKB_KEY_NoSymbol;
 132++        return true;
 133++    }
 134++
 135++    if (istreq(name, "none") || istreq(name, "voidsymbol")) {
 136++        *sym_rtrn = XKB_KEY_VoidSymbol;
 137++        return true;
 138++    }
 139++
 140++    sym = xkb_keysym_from_name(name, XKB_KEYSYM_NO_FLAGS);
 141++    if (sym != XKB_KEY_NoSymbol) {
 142++        *sym_rtrn = sym;
 143++        return true;
 144++    }
 145++
 146++    return false;
 147++}
 148++
 149++#define param_scanner param->scanner
 150++
 151++#line 130 "parser.c"
 152++
 153++# ifndef YY_CAST
 154++#  ifdef __cplusplus
 155++#   define YY_CAST(Type, Val) static_cast<Type> (Val)
 156++#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
 157++#  else
 158++#   define YY_CAST(Type, Val) ((Type) (Val))
 159++#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
 160++#  endif
 161++# endif
 162++# ifndef YY_NULLPTR
 163++#  if defined __cplusplus
 164++#   if 201103L <= __cplusplus
 165++#    define YY_NULLPTR nullptr
 166++#   else
 167++#    define YY_NULLPTR 0
 168++#   endif
 169++#  else
 170++#   define YY_NULLPTR ((void*)0)
 171++#  endif
 172++# endif
 173++
 174++#include "parser.h"
 175++/* Symbol kind.  */
 176++enum yysymbol_kind_t
 177++{
 178++  YYSYMBOL_YYEMPTY = -2,
 179++  YYSYMBOL_YYEOF = 0,                      /* END_OF_FILE  */
 180++  YYSYMBOL_YYerror = 1,                    /* error  */
 181++  YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
 182++  YYSYMBOL_ERROR_TOK = 3,                  /* ERROR_TOK  */
 183++  YYSYMBOL_XKB_KEYMAP = 4,                 /* XKB_KEYMAP  */
 184++  YYSYMBOL_XKB_KEYCODES = 5,               /* XKB_KEYCODES  */
 185++  YYSYMBOL_XKB_TYPES = 6,                  /* XKB_TYPES  */
 186++  YYSYMBOL_XKB_SYMBOLS = 7,                /* XKB_SYMBOLS  */
 187++  YYSYMBOL_XKB_COMPATMAP = 8,              /* XKB_COMPATMAP  */
 188++  YYSYMBOL_XKB_GEOMETRY = 9,               /* XKB_GEOMETRY  */
 189++  YYSYMBOL_XKB_SEMANTICS = 10,             /* XKB_SEMANTICS  */
 190++  YYSYMBOL_XKB_LAYOUT = 11,                /* XKB_LAYOUT  */
 191++  YYSYMBOL_INCLUDE = 12,                   /* INCLUDE  */
 192++  YYSYMBOL_OVERRIDE = 13,                  /* OVERRIDE  */
 193++  YYSYMBOL_AUGMENT = 14,                   /* AUGMENT  */
 194++  YYSYMBOL_REPLACE = 15,                   /* REPLACE  */
 195++  YYSYMBOL_ALTERNATE = 16,                 /* ALTERNATE  */
 196++  YYSYMBOL_VIRTUAL_MODS = 17,              /* VIRTUAL_MODS  */
 197++  YYSYMBOL_TYPE = 18,                      /* TYPE  */
 198++  YYSYMBOL_INTERPRET = 19,                 /* INTERPRET  */
 199++  YYSYMBOL_ACTION_TOK = 20,                /* ACTION_TOK  */
 200++  YYSYMBOL_KEY = 21,                       /* KEY  */
 201++  YYSYMBOL_ALIAS = 22,                     /* ALIAS  */
 202++  YYSYMBOL_GROUP = 23,                     /* GROUP  */
 203++  YYSYMBOL_MODIFIER_MAP = 24,              /* MODIFIER_MAP  */
 204++  YYSYMBOL_INDICATOR = 25,                 /* INDICATOR  */
 205++  YYSYMBOL_SHAPE = 26,                     /* SHAPE  */
 206++  YYSYMBOL_KEYS = 27,                      /* KEYS  */
 207++  YYSYMBOL_ROW = 28,                       /* ROW  */
 208++  YYSYMBOL_SECTION = 29,                   /* SECTION  */
 209++  YYSYMBOL_OVERLAY = 30,                   /* OVERLAY  */
 210++  YYSYMBOL_TEXT = 31,                      /* TEXT  */
 211++  YYSYMBOL_OUTLINE = 32,                   /* OUTLINE  */
 212++  YYSYMBOL_SOLID = 33,                     /* SOLID  */
 213++  YYSYMBOL_LOGO = 34,                      /* LOGO  */
 214++  YYSYMBOL_VIRTUAL = 35,                   /* VIRTUAL  */
 215++  YYSYMBOL_EQUALS = 36,                    /* EQUALS  */
 216++  YYSYMBOL_PLUS = 37,                      /* PLUS  */
 217++  YYSYMBOL_MINUS = 38,                     /* MINUS  */
 218++  YYSYMBOL_DIVIDE = 39,                    /* DIVIDE  */
 219++  YYSYMBOL_TIMES = 40,                     /* TIMES  */
 220++  YYSYMBOL_OBRACE = 41,                    /* OBRACE  */
 221++  YYSYMBOL_CBRACE = 42,                    /* CBRACE  */
 222++  YYSYMBOL_OPAREN = 43,                    /* OPAREN  */
 223++  YYSYMBOL_CPAREN = 44,                    /* CPAREN  */
 224++  YYSYMBOL_OBRACKET = 45,                  /* OBRACKET  */
 225++  YYSYMBOL_CBRACKET = 46,                  /* CBRACKET  */
 226++  YYSYMBOL_DOT = 47,                       /* DOT  */
 227++  YYSYMBOL_COMMA = 48,                     /* COMMA  */
 228++  YYSYMBOL_SEMI = 49,                      /* SEMI  */
 229++  YYSYMBOL_EXCLAM = 50,                    /* EXCLAM  */
 230++  YYSYMBOL_INVERT = 51,                    /* INVERT  */
 231++  YYSYMBOL_STRING = 52,                    /* STRING  */
 232++  YYSYMBOL_INTEGER = 53,                   /* INTEGER  */
 233++  YYSYMBOL_FLOAT = 54,                     /* FLOAT  */
 234++  YYSYMBOL_IDENT = 55,                     /* IDENT  */
 235++  YYSYMBOL_KEYNAME = 56,                   /* KEYNAME  */
 236++  YYSYMBOL_PARTIAL = 57,                   /* PARTIAL  */
 237++  YYSYMBOL_DEFAULT = 58,                   /* DEFAULT  */
 238++  YYSYMBOL_HIDDEN = 59,                    /* HIDDEN  */
 239++  YYSYMBOL_ALPHANUMERIC_KEYS = 60,         /* ALPHANUMERIC_KEYS  */
 240++  YYSYMBOL_MODIFIER_KEYS = 61,             /* MODIFIER_KEYS  */
 241++  YYSYMBOL_KEYPAD_KEYS = 62,               /* KEYPAD_KEYS  */
 242++  YYSYMBOL_FUNCTION_KEYS = 63,             /* FUNCTION_KEYS  */
 243++  YYSYMBOL_ALTERNATE_GROUP = 64,           /* ALTERNATE_GROUP  */
 244++  YYSYMBOL_YYACCEPT = 65,                  /* $accept  */
 245++  YYSYMBOL_XkbFile = 66,                   /* XkbFile  */
 246++  YYSYMBOL_XkbCompositeMap = 67,           /* XkbCompositeMap  */
 247++  YYSYMBOL_XkbCompositeType = 68,          /* XkbCompositeType  */
 248++  YYSYMBOL_XkbMapConfigList = 69,          /* XkbMapConfigList  */
 249++  YYSYMBOL_XkbMapConfig = 70,              /* XkbMapConfig  */
 250++  YYSYMBOL_FileType = 71,                  /* FileType  */
 251++  YYSYMBOL_OptFlags = 72,                  /* OptFlags  */
 252++  YYSYMBOL_Flags = 73,                     /* Flags  */
 253++  YYSYMBOL_Flag = 74,                      /* Flag  */
 254++  YYSYMBOL_DeclList = 75,                  /* DeclList  */
 255++  YYSYMBOL_Decl = 76,                      /* Decl  */
 256++  YYSYMBOL_VarDecl = 77,                   /* VarDecl  */
 257++  YYSYMBOL_KeyNameDecl = 78,               /* KeyNameDecl  */
 258++  YYSYMBOL_KeyAliasDecl = 79,              /* KeyAliasDecl  */
 259++  YYSYMBOL_VModDecl = 80,                  /* VModDecl  */
 260++  YYSYMBOL_VModDefList = 81,               /* VModDefList  */
 261++  YYSYMBOL_VModDef = 82,                   /* VModDef  */
 262++  YYSYMBOL_InterpretDecl = 83,             /* InterpretDecl  */
 263++  YYSYMBOL_InterpretMatch = 84,            /* InterpretMatch  */
 264++  YYSYMBOL_VarDeclList = 85,               /* VarDeclList  */
 265++  YYSYMBOL_KeyTypeDecl = 86,               /* KeyTypeDecl  */
 266++  YYSYMBOL_SymbolsDecl = 87,               /* SymbolsDecl  */
 267++  YYSYMBOL_SymbolsBody = 88,               /* SymbolsBody  */
 268++  YYSYMBOL_SymbolsVarDecl = 89,            /* SymbolsVarDecl  */
 269++  YYSYMBOL_ArrayInit = 90,                 /* ArrayInit  */
 270++  YYSYMBOL_GroupCompatDecl = 91,           /* GroupCompatDecl  */
 271++  YYSYMBOL_ModMapDecl = 92,                /* ModMapDecl  */
 272++  YYSYMBOL_LedMapDecl = 93,                /* LedMapDecl  */
 273++  YYSYMBOL_LedNameDecl = 94,               /* LedNameDecl  */
 274++  YYSYMBOL_ShapeDecl = 95,                 /* ShapeDecl  */
 275++  YYSYMBOL_SectionDecl = 96,               /* SectionDecl  */
 276++  YYSYMBOL_SectionBody = 97,               /* SectionBody  */
 277++  YYSYMBOL_SectionBodyItem = 98,           /* SectionBodyItem  */
 278++  YYSYMBOL_RowBody = 99,                   /* RowBody  */
 279++  YYSYMBOL_RowBodyItem = 100,              /* RowBodyItem  */
 280++  YYSYMBOL_Keys = 101,                     /* Keys  */
 281++  YYSYMBOL_Key = 102,                      /* Key  */
 282++  YYSYMBOL_OverlayDecl = 103,              /* OverlayDecl  */
 283++  YYSYMBOL_OverlayKeyList = 104,           /* OverlayKeyList  */
 284++  YYSYMBOL_OverlayKey = 105,               /* OverlayKey  */
 285++  YYSYMBOL_OutlineList = 106,              /* OutlineList  */
 286++  YYSYMBOL_OutlineInList = 107,            /* OutlineInList  */
 287++  YYSYMBOL_CoordList = 108,                /* CoordList  */
 288++  YYSYMBOL_Coord = 109,                    /* Coord  */
 289++  YYSYMBOL_DoodadDecl = 110,               /* DoodadDecl  */
 290++  YYSYMBOL_DoodadType = 111,               /* DoodadType  */
 291++  YYSYMBOL_FieldSpec = 112,                /* FieldSpec  */
 292++  YYSYMBOL_Element = 113,                  /* Element  */
 293++  YYSYMBOL_OptMergeMode = 114,             /* OptMergeMode  */
 294++  YYSYMBOL_MergeMode = 115,                /* MergeMode  */
 295++  YYSYMBOL_OptExprList = 116,              /* OptExprList  */
 296++  YYSYMBOL_ExprList = 117,                 /* ExprList  */
 297++  YYSYMBOL_Expr = 118,                     /* Expr  */
 298++  YYSYMBOL_Term = 119,                     /* Term  */
 299++  YYSYMBOL_ActionList = 120,               /* ActionList  */
 300++  YYSYMBOL_Action = 121,                   /* Action  */
 301++  YYSYMBOL_Lhs = 122,                      /* Lhs  */
 302++  YYSYMBOL_Terminal = 123,                 /* Terminal  */
 303++  YYSYMBOL_OptKeySymList = 124,            /* OptKeySymList  */
 304++  YYSYMBOL_KeySymList = 125,               /* KeySymList  */
 305++  YYSYMBOL_KeySyms = 126,                  /* KeySyms  */
 306++  YYSYMBOL_KeySym = 127,                   /* KeySym  */
 307++  YYSYMBOL_SignedNumber = 128,             /* SignedNumber  */
 308++  YYSYMBOL_Number = 129,                   /* Number  */
 309++  YYSYMBOL_Float = 130,                    /* Float  */
 310++  YYSYMBOL_Integer = 131,                  /* Integer  */
 311++  YYSYMBOL_KeyCode = 132,                  /* KeyCode  */
 312++  YYSYMBOL_Ident = 133,                    /* Ident  */
 313++  YYSYMBOL_String = 134,                   /* String  */
 314++  YYSYMBOL_OptMapName = 135,               /* OptMapName  */
 315++  YYSYMBOL_MapName = 136                   /* MapName  */
 316++};
 317++typedef enum yysymbol_kind_t yysymbol_kind_t;
 318++
 319++
 320++
 321++
 322++#ifdef short
 323++# undef short
 324++#endif
 325++
 326++/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
 327++   <limits.h> and (if available) <stdint.h> are included
 328++   so that the code can choose integer types of a good width.  */
 329++
 330++#ifndef __PTRDIFF_MAX__
 331++# include <limits.h> /* INFRINGES ON USER NAME SPACE */
 332++# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
 333++#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
 334++#  define YY_STDINT_H
 335++# endif
 336++#endif
 337++
 338++/* Narrow types that promote to a signed type and that can represent a
 339++   signed or unsigned integer of at least N bits.  In tables they can
 340++   save space and decrease cache pressure.  Promoting to a signed type
 341++   helps avoid bugs in integer arithmetic.  */
 342++
 343++#ifdef __INT_LEAST8_MAX__
 344++typedef __INT_LEAST8_TYPE__ yytype_int8;
 345++#elif defined YY_STDINT_H
 346++typedef int_least8_t yytype_int8;
 347++#else
 348++typedef signed char yytype_int8;
 349++#endif
 350++
 351++#ifdef __INT_LEAST16_MAX__
 352++typedef __INT_LEAST16_TYPE__ yytype_int16;
 353++#elif defined YY_STDINT_H
 354++typedef int_least16_t yytype_int16;
 355++#else
 356++typedef short yytype_int16;
 357++#endif
 358++
 359++/* Work around bug in HP-UX 11.23, which defines these macros
 360++   incorrectly for preprocessor constants.  This workaround can likely
 361++   be removed in 2023, as HPE has promised support for HP-UX 11.23
 362++   (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
 363++   <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
 364++#ifdef __hpux
 365++# undef UINT_LEAST8_MAX
 366++# undef UINT_LEAST16_MAX
 367++# define UINT_LEAST8_MAX 255
 368++# define UINT_LEAST16_MAX 65535
 369++#endif
 370++
 371++#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
 372++typedef __UINT_LEAST8_TYPE__ yytype_uint8;
 373++#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
 374++       && UINT_LEAST8_MAX <= INT_MAX)
 375++typedef uint_least8_t yytype_uint8;
 376++#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
 377++typedef unsigned char yytype_uint8;
 378++#else
 379++typedef short yytype_uint8;
 380++#endif
 381++
 382++#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
 383++typedef __UINT_LEAST16_TYPE__ yytype_uint16;
 384++#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
 385++       && UINT_LEAST16_MAX <= INT_MAX)
 386++typedef uint_least16_t yytype_uint16;
 387++#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
 388++typedef unsigned short yytype_uint16;
 389++#else
 390++typedef int yytype_uint16;
 391++#endif
 392++
 393++#ifndef YYPTRDIFF_T
 394++# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
 395++#  define YYPTRDIFF_T __PTRDIFF_TYPE__
 396++#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
 397++# elif defined PTRDIFF_MAX
 398++#  ifndef ptrdiff_t
 399++#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 400++#  endif
 401++#  define YYPTRDIFF_T ptrdiff_t
 402++#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
 403++# else
 404++#  define YYPTRDIFF_T long
 405++#  define YYPTRDIFF_MAXIMUM LONG_MAX
 406++# endif
 407++#endif
 408++
 409++#ifndef YYSIZE_T
 410++# ifdef __SIZE_TYPE__
 411++#  define YYSIZE_T __SIZE_TYPE__
 412++# elif defined size_t
 413++#  define YYSIZE_T size_t
 414++# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
 415++#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 416++#  define YYSIZE_T size_t
 417++# else
 418++#  define YYSIZE_T unsigned
 419++# endif
 420++#endif
 421++
 422++#define YYSIZE_MAXIMUM                                  \
 423++  YY_CAST (YYPTRDIFF_T,                                 \
 424++           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
 425++            ? YYPTRDIFF_MAXIMUM                         \
 426++            : YY_CAST (YYSIZE_T, -1)))
 427++
 428++#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
 429++
 430++
 431++/* Stored state numbers (used for stacks). */
 432++typedef yytype_int16 yy_state_t;
 433++
 434++/* State numbers in computations.  */
 435++typedef int yy_state_fast_t;
 436++
 437++#ifndef YY_
 438++# if defined YYENABLE_NLS && YYENABLE_NLS
 439++#  if ENABLE_NLS
 440++#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 441++#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
 442++#  endif
 443++# endif
 444++# ifndef YY_
 445++#  define YY_(Msgid) Msgid
 446++# endif
 447++#endif
 448++
 449++
 450++#ifndef YY_ATTRIBUTE_PURE
 451++# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
 452++#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
 453++# else
 454++#  define YY_ATTRIBUTE_PURE
 455++# endif
 456++#endif
 457++
 458++#ifndef YY_ATTRIBUTE_UNUSED
 459++# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
 460++#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
 461++# else
 462++#  define YY_ATTRIBUTE_UNUSED
 463++# endif
 464++#endif
 465++
 466++/* Suppress unused-variable warnings by "using" E.  */
 467++#if ! defined lint || defined __GNUC__
 468++# define YY_USE(E) ((void) (E))
 469++#else
 470++# define YY_USE(E) /* empty */
 471++#endif
 472++
 473++/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
 474++#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
 475++# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
 476++#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
 477++    _Pragma ("GCC diagnostic push")                                     \
 478++    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
 479++# else
 480++#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
 481++    _Pragma ("GCC diagnostic push")                                     \
 482++    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
 483++    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
 484++# endif
 485++# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
 486++    _Pragma ("GCC diagnostic pop")
 487++#else
 488++# define YY_INITIAL_VALUE(Value) Value
 489++#endif
 490++#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 491++# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 492++# define YY_IGNORE_MAYBE_UNINITIALIZED_END
 493++#endif
 494++#ifndef YY_INITIAL_VALUE
 495++# define YY_INITIAL_VALUE(Value) /* Nothing. */
 496++#endif
 497++
 498++#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
 499++# define YY_IGNORE_USELESS_CAST_BEGIN                          \
 500++    _Pragma ("GCC diagnostic push")                            \
 501++    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
 502++# define YY_IGNORE_USELESS_CAST_END            \
 503++    _Pragma ("GCC diagnostic pop")
 504++#endif
 505++#ifndef YY_IGNORE_USELESS_CAST_BEGIN
 506++# define YY_IGNORE_USELESS_CAST_BEGIN
 507++# define YY_IGNORE_USELESS_CAST_END
 508++#endif
 509++
 510++
 511++#define YY_ASSERT(E) ((void) (0 && (E)))
 512++
 513++#if !defined yyoverflow
 514++
 515++/* The parser invokes alloca or malloc; define the necessary symbols.  */
 516++
 517++# ifdef YYSTACK_USE_ALLOCA
 518++#  if YYSTACK_USE_ALLOCA
 519++#   ifdef __GNUC__
 520++#    define YYSTACK_ALLOC __builtin_alloca
 521++#   elif defined __BUILTIN_VA_ARG_INCR
 522++#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
 523++#   elif defined _AIX
 524++#    define YYSTACK_ALLOC __alloca
 525++#   elif defined _MSC_VER
 526++#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
 527++#    define alloca _alloca
 528++#   else
 529++#    define YYSTACK_ALLOC alloca
 530++#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
 531++#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 532++      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
 533++#     ifndef EXIT_SUCCESS
 534++#      define EXIT_SUCCESS 0
 535++#     endif
 536++#    endif
 537++#   endif
 538++#  endif
 539++# endif
 540++
 541++# ifdef YYSTACK_ALLOC
 542++   /* Pacify GCC's 'empty if-body' warning.  */
 543++#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
 544++#  ifndef YYSTACK_ALLOC_MAXIMUM
 545++    /* The OS might guarantee only one guard page at the bottom of the stack,
 546++       and a page size can be as small as 4096 bytes.  So we cannot safely
 547++       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
 548++       to allow for a few compiler-allocated temporary stack slots.  */
 549++#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
 550++#  endif
 551++# else
 552++#  define YYSTACK_ALLOC YYMALLOC
 553++#  define YYSTACK_FREE YYFREE
 554++#  ifndef YYSTACK_ALLOC_MAXIMUM
 555++#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 556++#  endif
 557++#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
 558++       && ! ((defined YYMALLOC || defined malloc) \
 559++             && (defined YYFREE || defined free)))
 560++#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 561++#   ifndef EXIT_SUCCESS
 562++#    define EXIT_SUCCESS 0
 563++#   endif
 564++#  endif
 565++#  ifndef YYMALLOC
 566++#   define YYMALLOC malloc
 567++#   if ! defined malloc && ! defined EXIT_SUCCESS
 568++void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 569++#   endif
 570++#  endif
 571++#  ifndef YYFREE
 572++#   define YYFREE free
 573++#   if ! defined free && ! defined EXIT_SUCCESS
 574++void free (void *); /* INFRINGES ON USER NAME SPACE */
 575++#   endif
 576++#  endif
 577++# endif
 578++#endif /* !defined yyoverflow */
 579++
 580++#if (! defined yyoverflow \
 581++     && (! defined __cplusplus \
 582++         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 583++
 584++/* A type that is properly aligned for any stack member.  */
 585++union yyalloc
 586++{
 587++  yy_state_t yyss_alloc;
 588++  YYSTYPE yyvs_alloc;
 589++};
 590++
 591++/* The size of the maximum gap between one aligned stack and the next.  */
 592++# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
 593++
 594++/* The size of an array large to enough to hold all stacks, each with
 595++   N elements.  */
 596++# define YYSTACK_BYTES(N) \
 597++     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
 598++      + YYSTACK_GAP_MAXIMUM)
 599++
 600++# define YYCOPY_NEEDED 1
 601++
 602++/* Relocate STACK from its old location to the new one.  The
 603++   local variables YYSIZE and YYSTACKSIZE give the old and new number of
 604++   elements in the stack, and YYPTR gives the new location of the
 605++   stack.  Advance YYPTR to a properly aligned location for the next
 606++   stack.  */
 607++# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
 608++    do                                                                  \
 609++      {                                                                 \
 610++        YYPTRDIFF_T yynewbytes;                                         \
 611++        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
 612++        Stack = &yyptr->Stack_alloc;                                    \
 613++        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
 614++        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
 615++      }                                                                 \
 616++    while (0)
 617++
 618++#endif
 619++
 620++#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
 621++/* Copy COUNT objects from SRC to DST.  The source and destination do
 622++   not overlap.  */
 623++# ifndef YYCOPY
 624++#  if defined __GNUC__ && 1 < __GNUC__
 625++#   define YYCOPY(Dst, Src, Count) \
 626++      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
 627++#  else
 628++#   define YYCOPY(Dst, Src, Count)              \
 629++      do                                        \
 630++        {                                       \
 631++          YYPTRDIFF_T yyi;                      \
 632++          for (yyi = 0; yyi < (Count); yyi++)   \
 633++            (Dst)[yyi] = (Src)[yyi];            \
 634++        }                                       \
 635++      while (0)
 636++#  endif
 637++# endif
 638++#endif /* !YYCOPY_NEEDED */
 639++
 640++/* YYFINAL -- State number of the termination state.  */
 641++#define YYFINAL  16
 642++/* YYLAST -- Last index in YYTABLE.  */
 643++#define YYLAST   735
 644++
 645++/* YYNTOKENS -- Number of terminals.  */
 646++#define YYNTOKENS  65
 647++/* YYNNTS -- Number of nonterminals.  */
 648++#define YYNNTS  72
 649++/* YYNRULES -- Number of rules.  */
 650++#define YYNRULES  184
 651++/* YYNSTATES -- Number of states.  */
 652++#define YYNSTATES  334
 653++
 654++/* YYMAXUTOK -- Last valid token kind.  */
 655++#define YYMAXUTOK   257
 656++
 657++
 658++/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
 659++   as returned by yylex, with out-of-bounds checking.  */
 660++#define YYTRANSLATE(YYX)                                \
 661++  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
 662++   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
 663++   : YYSYMBOL_YYUNDEF)
 664++
 665++/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
 666++   as returned by yylex.  */
 667++static const yytype_int8 yytranslate[] =
 668++{
 669++       0,     4,     5,     6,     7,     8,     9,    10,    11,     2,
 670++      12,    13,    14,    15,    16,     2,     2,     2,     2,     2,
 671++      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
 672++      27,    28,    29,    30,    31,    32,    33,    34,    35,     2,
 673++      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
 674++      46,    47,    48,    49,    50,    51,     2,     2,     2,     2,
 675++      52,    53,    54,    55,    56,     2,     2,     2,     2,     2,
 676++      57,    58,    59,    60,    61,    62,    63,    64,     2,     2,
 677++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 678++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 679++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 680++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 681++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 682++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 683++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 684++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 685++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 686++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 687++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 688++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 689++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 690++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 691++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 692++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 693++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 694++       2,     2,     2,     2,     2,     3,     1,     2
 695++};
 696++
 697++#if YYDEBUG
 698++/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 699++static const yytype_int16 yyrline[] =
 700++{
 701++       0,   254,   254,   256,   258,   262,   268,   269,   270,   273,
 702++     275,   279,   287,   288,   289,   290,   291,   294,   295,   298,
 703++     299,   302,   303,   304,   305,   306,   307,   308,   309,   312,
 704++     327,   337,   340,   346,   351,   356,   361,   366,   371,   376,
 705++     381,   386,   391,   392,   393,   394,   401,   403,   405,   409,
 706++     413,   417,   421,   423,   427,   429,   433,   439,   441,   445,
 707++     447,   451,   457,   463,   465,   467,   470,   471,   472,   473,
 708++     474,   477,   479,   483,   487,   491,   495,   497,   501,   503,
 709++     507,   511,   512,   515,   517,   519,   521,   523,   527,   528,
 710++     531,   532,   536,   537,   540,   542,   546,   550,   551,   554,
 711++     557,   559,   563,   565,   567,   571,   573,   577,   581,   585,
 712++     586,   587,   588,   591,   592,   595,   597,   599,   601,   603,
 713++     605,   607,   609,   611,   613,   615,   619,   620,   623,   624,
 714++     625,   626,   627,   637,   638,   641,   643,   647,   649,   651,
 715++     653,   655,   657,   661,   663,   665,   667,   669,   671,   673,
 716++     675,   679,   681,   685,   689,   691,   693,   695,   699,   701,
 717++     703,   705,   709,   710,   713,   715,   717,   719,   723,   727,
 718++     735,   736,   756,   757,   760,   761,   764,   767,   770,   773,
 719++     774,   777,   780,   781,   784
 720++};
 721++#endif
 722++
 723++/** Accessing symbol of state STATE.  */
 724++#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
 725++
 726++#if YYDEBUG || 0
 727++/* The user-facing name of the symbol whose (internal) number is
 728++   YYSYMBOL.  No bounds checking.  */
 729++static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
 730++
 731++/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
 732++   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 733++static const char *const yytname[] =
 734++{
 735++  "END_OF_FILE", "error", "\"invalid token\"", "ERROR_TOK", "XKB_KEYMAP",
 736++  "XKB_KEYCODES", "XKB_TYPES", "XKB_SYMBOLS", "XKB_COMPATMAP",
 737++  "XKB_GEOMETRY", "XKB_SEMANTICS", "XKB_LAYOUT", "INCLUDE", "OVERRIDE",
 738++  "AUGMENT", "REPLACE", "ALTERNATE", "VIRTUAL_MODS", "TYPE", "INTERPRET",
 739++  "ACTION_TOK", "KEY", "ALIAS", "GROUP", "MODIFIER_MAP", "INDICATOR",
 740++  "SHAPE", "KEYS", "ROW", "SECTION", "OVERLAY", "TEXT", "OUTLINE", "SOLID",
 741++  "LOGO", "VIRTUAL", "EQUALS", "PLUS", "MINUS", "DIVIDE", "TIMES",
 742++  "OBRACE", "CBRACE", "OPAREN", "CPAREN", "OBRACKET", "CBRACKET", "DOT",
 743++  "COMMA", "SEMI", "EXCLAM", "INVERT", "STRING", "INTEGER", "FLOAT",
 744++  "IDENT", "KEYNAME", "PARTIAL", "DEFAULT", "HIDDEN", "ALPHANUMERIC_KEYS",
 745++  "MODIFIER_KEYS", "KEYPAD_KEYS", "FUNCTION_KEYS", "ALTERNATE_GROUP",
 746++  "$accept", "XkbFile", "XkbCompositeMap", "XkbCompositeType",
 747++  "XkbMapConfigList", "XkbMapConfig", "FileType", "OptFlags", "Flags",
 748++  "Flag", "DeclList", "Decl", "VarDecl", "KeyNameDecl", "KeyAliasDecl",
 749++  "VModDecl", "VModDefList", "VModDef", "InterpretDecl", "InterpretMatch",
 750++  "VarDeclList", "KeyTypeDecl", "SymbolsDecl", "SymbolsBody",
 751++  "SymbolsVarDecl", "ArrayInit", "GroupCompatDecl", "ModMapDecl",
 752++  "LedMapDecl", "LedNameDecl", "ShapeDecl", "SectionDecl", "SectionBody",
 753++  "SectionBodyItem", "RowBody", "RowBodyItem", "Keys", "Key",
 754++  "OverlayDecl", "OverlayKeyList", "OverlayKey", "OutlineList",
 755++  "OutlineInList", "CoordList", "Coord", "DoodadDecl", "DoodadType",
 756++  "FieldSpec", "Element", "OptMergeMode", "MergeMode", "OptExprList",
 757++  "ExprList", "Expr", "Term", "ActionList", "Action", "Lhs", "Terminal",
 758++  "OptKeySymList", "KeySymList", "KeySyms", "KeySym", "SignedNumber",
 759++  "Number", "Float", "Integer", "KeyCode", "Ident", "String", "OptMapName",
 760++  "MapName", YY_NULLPTR
 761++};
 762++
 763++static const char *
 764++yysymbol_name (yysymbol_kind_t yysymbol)
 765++{
 766++  return yytname[yysymbol];
 767++}
 768++#endif
 769++
 770++#define YYPACT_NINF (-182)
 771++
 772++#define yypact_value_is_default(Yyn) \
 773++  ((Yyn) == YYPACT_NINF)
 774++
 775++#define YYTABLE_NINF (-180)
 776++
 777++#define yytable_value_is_error(Yyn) \
 778++  0
 779++
 780++/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
 781++   STATE-NUM.  */
 782++static const yytype_int16 yypact[] =
 783++{
 784++     176,  -182,  -182,  -182,  -182,  -182,  -182,  -182,  -182,  -182,
 785++       6,  -182,  -182,   271,   227,  -182,  -182,  -182,  -182,  -182,
 786++    -182,  -182,  -182,  -182,  -182,   -38,   -38,  -182,  -182,   -24,
 787++    -182,    33,   227,  -182,   210,  -182,   353,    44,     5,  -182,
 788++    -182,  -182,  -182,  -182,  -182,    32,  -182,    13,    41,  -182,
 789++    -182,   -48,    55,    11,  -182,    79,    87,    58,   -48,    -2,
 790++      55,  -182,    55,    72,  -182,  -182,  -182,   107,   -48,  -182,
 791++     110,  -182,  -182,  -182,  -182,  -182,  -182,  -182,  -182,  -182,
 792++    -182,  -182,  -182,  -182,  -182,  -182,    55,   -18,  -182,   127,
 793++     121,  -182,    66,  -182,   138,  -182,   136,  -182,  -182,  -182,
 794++     144,   147,  -182,   152,   180,   182,   178,   184,   187,   188,
 795++     190,    58,   198,   201,   214,   367,   677,   367,  -182,   -48,
 796++    -182,   367,   663,   663,   367,   494,   200,   367,   367,   367,
 797++     663,    68,   449,   223,  -182,  -182,   212,   663,  -182,  -182,
 798++    -182,  -182,  -182,  -182,  -182,  -182,  -182,   367,   367,   367,
 799++     367,   367,  -182,  -182,    57,   157,  -182,   224,  -182,  -182,
 800++    -182,  -182,  -182,   218,    91,  -182,   333,  -182,   509,   537,
 801++     333,   552,   -48,     1,  -182,  -182,   228,    40,   216,   143,
 802++      70,   333,   150,   593,   247,   -30,    97,  -182,   105,  -182,
 803++     261,    55,   259,    55,  -182,  -182,   408,  -182,  -182,  -182,
 804++     367,  -182,   608,  -182,  -182,  -182,   287,  -182,  -182,   367,
 805++     367,   367,   367,   367,  -182,   367,   367,  -182,   252,  -182,
 806++     253,   264,    24,   269,   272,   163,  -182,   273,   270,  -182,
 807++    -182,  -182,   280,   494,   285,  -182,  -182,   283,   367,  -182,
 808++     284,   112,     8,  -182,  -182,   294,  -182,   299,   -36,   304,
 809++     247,   326,   649,   279,   307,  -182,   204,   316,  -182,   322,
 810++     320,   111,   111,  -182,  -182,   333,   211,  -182,  -182,   116,
 811++     367,  -182,   677,  -182,    24,  -182,  -182,  -182,   333,  -182,
 812++     333,  -182,  -182,  -182,   -30,  -182,  -182,  -182,  -182,   247,
 813++     333,   334,  -182,   466,  -182,   318,  -182,  -182,  -182,  -182,
 814++    -182,  -182,   339,  -182,  -182,  -182,   343,   120,    14,   345,
 815++    -182,   361,   124,  -182,  -182,  -182,  -182,   367,  -182,   131,
 816++    -182,  -182,   344,   350,   318,   166,   352,    14,  -182,  -182,
 817++    -182,  -182,  -182,  -182
 818++};
 819++
 820++/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
 821++   Performed when YYTABLE does not specify something else to do.  Zero
 822++   means the default is an error.  */
 823++static const yytype_uint8 yydefact[] =
 824++{
 825++      18,     4,    21,    22,    23,    24,    25,    26,    27,    28,
 826++       0,     2,     3,     0,    17,    20,     1,     6,    12,    13,
 827++      15,    14,    16,     7,     8,   183,   183,    19,   184,     0,
 828++     182,     0,    18,    31,    18,    10,     0,   127,     0,     9,
 829++     128,   130,   129,   131,   132,     0,    29,     0,   126,     5,
 830++      11,     0,   117,   116,   115,   118,     0,   119,   120,   121,
 831++     122,   123,   124,   125,   110,   111,   112,     0,     0,   179,
 832++       0,   180,    32,    34,    35,    30,    33,    36,    37,    39,
 833++      38,    40,    41,    42,    43,    44,     0,   154,   114,     0,
 834++     113,    45,     0,    53,    54,   181,     0,   170,   177,   169,
 835++       0,    58,   171,     0,     0,     0,     0,     0,     0,     0,
 836++       0,     0,     0,     0,     0,     0,     0,     0,    47,     0,
 837++      51,     0,     0,     0,     0,    65,     0,     0,     0,     0,
 838++       0,     0,     0,     0,    48,   178,     0,     0,   117,   116,
 839++     118,   119,   120,   121,   122,   124,   125,     0,     0,     0,
 840++       0,     0,   176,   161,   154,     0,   142,   147,   149,   160,
 841++     159,   113,   158,   155,     0,    52,    55,    60,     0,     0,
 842++      57,   163,     0,     0,    64,    70,     0,   113,     0,     0,
 843++       0,   136,     0,     0,     0,     0,     0,   101,     0,   106,
 844++       0,   121,   123,     0,    84,    86,     0,    82,    87,    85,
 845++       0,    49,     0,   144,   147,   143,     0,   145,   146,   134,
 846++       0,     0,     0,     0,   156,     0,     0,    46,     0,    59,
 847++       0,   170,     0,   169,     0,     0,   152,     0,   162,   167,
 848++     166,    69,     0,     0,     0,    50,    73,     0,     0,    76,
 849++       0,     0,     0,   175,   174,     0,   173,     0,     0,     0,
 850++       0,     0,     0,     0,     0,    81,     0,     0,   150,     0,
 851++     133,   138,   139,   137,   140,   141,     0,    61,    56,     0,
 852++     134,    72,     0,    71,     0,    62,    63,    67,    66,    74,
 853++     135,    75,   102,   172,     0,    78,   100,    79,   105,     0,
 854++     104,     0,    91,     0,    89,     0,    80,    77,   108,   148,
 855++     157,   168,     0,   151,   165,   164,     0,     0,     0,     0,
 856++      88,     0,     0,    98,   153,   107,   103,     0,    94,     0,
 857++      93,    83,     0,     0,     0,     0,     0,     0,    99,    96,
 858++      97,    95,    90,    92
 859++};
 860++
 861++/* YYPGOTO[NTERM-NUM].  */
 862++static const yytype_int16 yypgoto[] =
 863++{
 864++    -182,  -182,  -182,  -182,  -182,   181,  -182,   402,  -182,   389,
 865++    -182,  -182,   -35,  -182,  -182,  -182,  -182,   288,  -182,  -182,
 866++     -50,  -182,  -182,  -182,   173,   174,  -182,  -182,   362,  -182,
 867++    -182,  -182,  -182,   215,  -182,   119,  -182,    86,  -182,  -182,
 868++      90,  -182,   167,  -181,   185,   369,  -182,   -27,  -182,  -182,
 869++    -182,   154,  -126,    83,    76,  -182,   158,   -31,  -182,  -182,
 870++     221,   170,   -52,   161,   205,  -182,   -44,  -182,   -47,   -34,
 871++     420,  -182
 872++};
 873++
 874++/* YYDEFGOTO[NTERM-NUM].  */
 875++static const yytype_int16 yydefgoto[] =
 876++{
 877++       0,    10,    11,    25,    34,    12,    26,    36,    14,    15,
 878++      37,    46,   167,    73,    74,    75,    92,    93,    76,   100,
 879++     168,    77,    78,   173,   174,   175,    79,    80,   195,    82,
 880++      83,    84,   196,   197,   293,   294,   319,   320,   198,   312,
 881++     313,   186,   187,   188,   189,   199,    86,   154,    88,    47,
 882++      48,   259,   260,   181,   156,   225,   226,   157,   158,   227,
 883++     228,   229,   230,   245,   246,   159,   160,   136,   161,   162,
 884++      29,    30
 885++};
 886++
 887++/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
 888++   positive, shift that token.  If negative, reduce the rule whose
 889++   number is the opposite.  If YYTABLE_NINF, syntax error.  */
 890++static const yytype_int16 yytable[] =
 891++{
 892++      90,   101,   180,   241,    94,   184,    16,    69,   242,   102,
 893++      71,   106,    72,   105,    28,   107,    89,    32,    96,    69,
 894++      87,   112,    71,   243,   244,   108,   109,   115,   110,   116,
 895++      51,    52,    53,    54,    55,    56,    57,    58,    59,    60,
 896++      97,    61,    62,   232,    63,    64,    65,    66,    67,   233,
 897++      95,    98,   114,    97,    49,   317,    40,    41,    42,    43,
 898++      44,   243,   244,    68,    98,   222,    99,   133,    69,    70,
 899++     318,    71,    94,   169,    33,    90,    90,    98,   177,    99,
 900++     183,    50,   -68,    90,   190,    90,    45,   202,   -68,   163,
 901++      90,    89,    89,    91,   176,    87,    87,   194,    87,    89,
 902++     209,    89,   115,    87,   116,    87,    89,    95,   307,   184,
 903++      87,    98,   237,   185,   119,   120,   204,   204,   238,   204,
 904++     204,    90,    90,    69,  -109,   231,    71,   102,   210,   211,
 905++     212,   213,   111,   219,   219,   103,    90,    89,    89,   247,
 906++     217,    87,    87,   104,   224,   248,   113,   249,   219,    90,
 907++     212,   213,    89,   250,   282,    90,    87,   108,   301,   253,
 908++     250,   194,   316,   117,   274,    89,   323,   219,   250,    87,
 909++     118,    89,   324,   326,   121,    87,     1,   122,   102,   327,
 910++     210,   211,   212,   213,   124,   123,   177,   210,   211,   212,
 911++     213,   325,   236,   125,   210,   211,   212,   213,   155,   239,
 912++     164,   190,   176,   214,   166,    90,    87,   170,   331,   271,
 913++     179,   272,   182,    35,   238,    39,   126,   292,   127,   128,
 914++     129,    89,   305,   203,   205,    87,   207,   208,   130,   131,
 915++     102,   132,   206,     2,     3,     4,     5,     6,     7,     8,
 916++       9,   210,   211,   212,   213,   224,    90,   134,   210,   211,
 917++     212,   213,    38,   297,   135,   137,   178,   300,   292,   200,
 918++     215,   201,    89,   216,   234,   235,    87,     2,     3,     4,
 919++       5,     6,     7,     8,     9,    17,    18,    19,    20,    21,
 920++      22,    23,    24,   256,     2,     3,     4,     5,     6,     7,
 921++       8,     9,   185,   261,   262,   263,   264,   251,   265,   266,
 922++     252,   267,   268,   138,   139,    54,   140,  -124,   141,   142,
 923++     143,   144,  -179,    61,   145,   270,   146,   278,   274,   273,
 924++     295,   280,   147,   148,   210,   211,   212,   213,   149,   275,
 925++     171,   258,   279,   281,   290,   150,   151,    95,    98,   152,
 926++      69,   153,   284,    71,   138,   139,    54,   140,   285,   141,
 927++     142,   143,   144,   287,    61,   145,   296,   146,    18,    19,
 928++      20,    21,    22,   147,   148,   298,   299,   289,   238,   149,
 929++     210,   211,   212,   213,   311,   308,   150,   151,    95,    98,
 930++     152,    69,   153,   314,    71,   138,   139,    54,   140,   315,
 931++     141,   142,   143,   144,   321,    61,   145,   322,   146,   329,
 932++     328,   332,    13,    27,   147,   148,   276,   165,   277,    81,
 933++     149,   255,   310,   333,   330,   286,    85,   150,   151,    95,
 934++      98,   152,    69,   153,   302,    71,   138,   139,    54,   140,
 935++     303,   141,   142,   191,   144,   288,   192,   145,   193,    63,
 936++      64,    65,    66,   269,   304,   306,    31,   283,     0,     0,
 937++     254,     0,     0,     0,     0,     0,     0,     0,    68,     0,
 938++       0,     0,     0,    69,     0,     0,    71,   138,   139,    54,
 939++     140,     0,   141,   142,   191,   144,     0,   192,   145,   193,
 940++      63,    64,    65,    66,   138,   139,    54,   140,     0,   141,
 941++     142,   143,   144,   291,    61,   145,     0,   146,     0,    68,
 942++       0,     0,     0,     0,    69,     0,     0,    71,   309,     0,
 943++       0,     0,   138,   139,    54,   140,    68,   141,   142,   143,
 944++     144,    69,    61,   145,    71,   146,     0,   138,   139,    54,
 945++     140,     0,   141,   142,   143,   144,     0,    61,   145,   171,
 946++     146,     0,     0,     0,   172,     0,     0,     0,     0,    69,
 947++       0,   218,    71,     0,     0,   138,   139,    54,   140,    68,
 948++     141,   142,   143,   144,    69,    61,   145,    71,   146,     0,
 949++     138,   139,    54,   140,     0,   141,   142,   143,   144,   220,
 950++      61,   221,     0,   146,     0,     0,     0,    68,     0,     0,
 951++       0,     0,    69,   222,     0,    71,     0,     0,     0,     0,
 952++       0,     0,     0,     0,     0,    98,     0,   223,     0,     0,
 953++      71,   138,   139,    54,   140,     0,   141,   142,   143,   144,
 954++       0,    61,   145,     0,   146,     0,   138,   139,    54,   140,
 955++       0,   141,   142,   143,   144,   240,    61,   145,     0,   146,
 956++       0,     0,     0,    68,     0,     0,     0,     0,    69,     0,
 957++     257,    71,     0,     0,     0,     0,     0,     0,    68,     0,
 958++       0,     0,     0,    69,     0,     0,    71,   138,   139,    54,
 959++     140,     0,   141,   142,   143,   144,   291,    61,   145,     0,
 960++     146,   138,   139,    54,   140,     0,   141,   142,   143,   144,
 961++       0,    61,   145,     0,   146,   138,   139,    54,   140,    68,
 962++     141,   142,   143,   144,    69,    61,   145,    71,   146,     0,
 963++       0,     0,     0,    68,     0,     0,     0,     0,    69,     0,
 964++       0,    71,     0,     0,     0,     0,     0,     0,     0,     0,
 965++       0,     0,    69,     0,     0,    71
 966++};
 967++
 968++static const yytype_int16 yycheck[] =
 969++{
 970++      47,    53,   128,   184,    51,    41,     0,    55,    38,    53,
 971++      58,    58,    47,    57,    52,    59,    47,    41,    52,    55,
 972++      47,    68,    58,    53,    54,    59,    60,    45,    62,    47,
 973++      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
 974++      29,    28,    29,    42,    31,    32,    33,    34,    35,    48,
 975++      52,    53,    86,    29,    49,    41,    12,    13,    14,    15,
 976++      16,    53,    54,    50,    53,    41,    55,   111,    55,    56,
 977++      56,    58,   119,   123,    41,   122,   123,    53,   125,    55,
 978++     130,    49,    42,   130,   131,   132,    42,   137,    48,   116,
 979++     137,   122,   123,    52,   125,   122,   123,   132,   125,   130,
 980++      43,   132,    45,   130,    47,   132,   137,    52,   289,    41,
 981++     137,    53,    42,    45,    48,    49,   147,   148,    48,   150,
 982++     151,   168,   169,    55,    52,   172,    58,   171,    37,    38,
 983++      39,    40,    25,   168,   169,    56,   183,   168,   169,    42,
 984++      49,   168,   169,    56,   171,    48,    36,    42,   183,   196,
 985++      39,    40,   183,    48,    42,   202,   183,   191,    42,   193,
 986++      48,   196,    42,    36,    48,   196,    42,   202,    48,   196,
 987++      49,   202,    48,    42,    36,   202,     0,    41,   222,    48,
 988++      37,    38,    39,    40,    37,    41,   233,    37,    38,    39,
 989++      40,   317,    49,    41,    37,    38,    39,    40,   115,    49,
 990++     117,   248,   233,    46,   121,   252,   233,   124,    42,    46,
 991++     127,    48,   129,    32,    48,    34,    36,   252,    36,    41,
 992++      36,   252,   274,   147,   148,   252,   150,   151,    41,    41,
 993++     274,    41,   149,    57,    58,    59,    60,    61,    62,    63,
 994++      64,    37,    38,    39,    40,   272,   293,    49,    37,    38,
 995++      39,    40,    42,    49,    53,    41,    56,    46,   293,    36,
 996++      36,    49,   293,    45,    36,    49,   293,    57,    58,    59,
 997++      60,    61,    62,    63,    64,     4,     5,     6,     7,     8,
 998++       9,    10,    11,   200,    57,    58,    59,    60,    61,    62,
 999++      63,    64,    45,   210,   211,   212,   213,    36,   215,   216,
1000++      41,    49,    49,    18,    19,    20,    21,    43,    23,    24,
1001++      25,    26,    43,    28,    29,    43,    31,   234,    48,    46,
1002++      41,   238,    37,    38,    37,    38,    39,    40,    43,    49,
1003++      45,    44,    49,    49,   251,    50,    51,    52,    53,    54,
1004++      55,    56,    48,    58,    18,    19,    20,    21,    49,    23,
1005++      24,    25,    26,    49,    28,    29,    49,    31,     5,     6,
1006++       7,     8,     9,    37,    38,    49,    44,    41,    48,    43,
1007++      37,    38,    39,    40,    56,    41,    50,    51,    52,    53,
1008++      54,    55,    56,    44,    58,    18,    19,    20,    21,    46,
1009++      23,    24,    25,    26,    49,    28,    29,    36,    31,    49,
1010++      56,    49,     0,    14,    37,    38,   233,   119,   234,    47,
1011++      43,   196,   293,   327,   324,   248,    47,    50,    51,    52,
1012++      53,    54,    55,    56,   270,    58,    18,    19,    20,    21,
1013++     272,    23,    24,    25,    26,   250,    28,    29,    30,    31,
1014++      32,    33,    34,   222,   274,   284,    26,   242,    -1,    -1,
1015++      42,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    50,    -1,
1016++      -1,    -1,    -1,    55,    -1,    -1,    58,    18,    19,    20,
1017++      21,    -1,    23,    24,    25,    26,    -1,    28,    29,    30,
1018++      31,    32,    33,    34,    18,    19,    20,    21,    -1,    23,
1019++      24,    25,    26,    27,    28,    29,    -1,    31,    -1,    50,
1020++      -1,    -1,    -1,    -1,    55,    -1,    -1,    58,    42,    -1,
1021++      -1,    -1,    18,    19,    20,    21,    50,    23,    24,    25,
1022++      26,    55,    28,    29,    58,    31,    -1,    18,    19,    20,
1023++      21,    -1,    23,    24,    25,    26,    -1,    28,    29,    45,
1024++      31,    -1,    -1,    -1,    50,    -1,    -1,    -1,    -1,    55,
1025++      -1,    42,    58,    -1,    -1,    18,    19,    20,    21,    50,
1026++      23,    24,    25,    26,    55,    28,    29,    58,    31,    -1,
1027++      18,    19,    20,    21,    -1,    23,    24,    25,    26,    42,
1028++      28,    29,    -1,    31,    -1,    -1,    -1,    50,    -1,    -1,
1029++      -1,    -1,    55,    41,    -1,    58,    -1,    -1,    -1,    -1,
1030++      -1,    -1,    -1,    -1,    -1,    53,    -1,    55,    -1,    -1,
1031++      58,    18,    19,    20,    21,    -1,    23,    24,    25,    26,
1032++      -1,    28,    29,    -1,    31,    -1,    18,    19,    20,    21,
1033++      -1,    23,    24,    25,    26,    42,    28,    29,    -1,    31,
1034++      -1,    -1,    -1,    50,    -1,    -1,    -1,    -1,    55,    -1,
1035++      42,    58,    -1,    -1,    -1,    -1,    -1,    -1,    50,    -1,
1036++      -1,    -1,    -1,    55,    -1,    -1,    58,    18,    19,    20,
1037++      21,    -1,    23,    24,    25,    26,    27,    28,    29,    -1,
1038++      31,    18,    19,    20,    21,    -1,    23,    24,    25,    26,
1039++      -1,    28,    29,    -1,    31,    18,    19,    20,    21,    50,
1040++      23,    24,    25,    26,    55,    28,    29,    58,    31,    -1,
1041++      -1,    -1,    -1,    50,    -1,    -1,    -1,    -1,    55,    -1,
1042++      -1,    58,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1043++      -1,    -1,    55,    -1,    -1,    58
1044++};
1045++
1046++/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1047++   state STATE-NUM.  */
1048++static const yytype_uint8 yystos[] =
1049++{
1050++       0,     0,    57,    58,    59,    60,    61,    62,    63,    64,
1051++      66,    67,    70,    72,    73,    74,     0,     4,     5,     6,
1052++       7,     8,     9,    10,    11,    68,    71,    74,    52,   135,
1053++     136,   135,    41,    41,    69,    70,    72,    75,    42,    70,
1054++      12,    13,    14,    15,    16,    42,    76,   114,   115,    49,
1055++      49,    17,    18,    19,    20,    21,    22,    23,    24,    25,
1056++      26,    28,    29,    31,    32,    33,    34,    35,    50,    55,
1057++      56,    58,    77,    78,    79,    80,    83,    86,    87,    91,
1058++      92,    93,    94,    95,    96,   110,   111,   112,   113,   122,
1059++     133,    52,    81,    82,   133,    52,   134,    29,    53,    55,
1060++      84,   127,   131,    56,    56,   131,   133,   131,   134,   134,
1061++     134,    25,   133,    36,   134,    45,    47,    36,    49,    48,
1062++      49,    36,    41,    41,    37,    41,    36,    36,    41,    36,
1063++      41,    41,    41,   131,    49,    53,   132,    41,    18,    19,
1064++      21,    23,    24,    25,    26,    29,    31,    37,    38,    43,
1065++      50,    51,    54,    56,   112,   118,   119,   122,   123,   130,
1066++     131,   133,   134,   112,   118,    82,   118,    77,    85,    85,
1067++     118,    45,    50,    88,    89,    90,   122,   133,    56,   118,
1068++     117,   118,   118,    85,    41,    45,   106,   107,   108,   109,
1069++     133,    25,    28,    30,    77,    93,    97,    98,   103,   110,
1070++      36,    49,    85,   119,   122,   119,   118,   119,   119,    43,
1071++      37,    38,    39,    40,    46,    36,    45,    49,    42,    77,
1072++      42,    29,    41,    55,   112,   120,   121,   124,   125,   126,
1073++     127,   133,    42,    48,    36,    49,    49,    42,    48,    49,
1074++      42,   108,    38,    53,    54,   128,   129,    42,    48,    42,
1075++      48,    36,    41,   134,    42,    98,   118,    42,    44,   116,
1076++     117,   118,   118,   118,   118,   118,   118,    49,    49,   125,
1077++      43,    46,    48,    46,    48,    49,    89,    90,   118,    49,
1078++     118,    49,    42,   129,    48,    49,   107,    49,   109,    41,
1079++     118,    27,    77,    99,   100,    41,    49,    49,    49,    44,
1080++      46,    42,   116,   121,   126,   127,   128,   108,    41,    42,
1081++     100,    56,   104,   105,    44,    46,    42,    41,    56,   101,
1082++     102,    49,    36,    42,    48,   117,    42,    48,    56,    49,
1083++     105,    42,    49,   102
1084++};
1085++
1086++/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
1087++static const yytype_uint8 yyr1[] =
1088++{
1089++       0,    65,    66,    66,    66,    67,    68,    68,    68,    69,
1090++      69,    70,    71,    71,    71,    71,    71,    72,    72,    73,
1091++      73,    74,    74,    74,    74,    74,    74,    74,    74,    75,
1092++      75,    75,    76,    76,    76,    76,    76,    76,    76,    76,
1093++      76,    76,    76,    76,    76,    76,    77,    77,    77,    78,
1094++      79,    80,    81,    81,    82,    82,    83,    84,    84,    85,
1095++      85,    86,    87,    88,    88,    88,    89,    89,    89,    89,
1096++      89,    90,    90,    91,    92,    93,    94,    94,    95,    95,
1097++      96,    97,    97,    98,    98,    98,    98,    98,    99,    99,
1098++     100,   100,   101,   101,   102,   102,   103,   104,   104,   105,
1099++     106,   106,   107,   107,   107,   108,   108,   109,   110,   111,
1100++     111,   111,   111,   112,   112,   113,   113,   113,   113,   113,
1101++     113,   113,   113,   113,   113,   113,   114,   114,   115,   115,
1102++     115,   115,   115,   116,   116,   117,   117,   118,   118,   118,
1103++     118,   118,   118,   119,   119,   119,   119,   119,   119,   119,
1104++     119,   120,   120,   121,   122,   122,   122,   122,   123,   123,
1105++     123,   123,   124,   124,   125,   125,   125,   125,   126,   127,
1106++     127,   127,   128,   128,   129,   129,   130,   131,   132,   133,
1107++     133,   134,   135,   135,   136
1108++};
1109++
1110++/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
1111++static const yytype_int8 yyr2[] =
1112++{
1113++       0,     2,     1,     1,     1,     7,     1,     1,     1,     2,
1114++       1,     7,     1,     1,     1,     1,     1,     1,     0,     2,
1115++       1,     1,     1,     1,     1,     1,     1,     1,     1,     2,
1116++       3,     0,     2,     2,     2,     2,     2,     2,     2,     2,
1117++       2,     2,     2,     2,     2,     2,     4,     2,     3,     4,
1118++       5,     3,     3,     1,     1,     3,     6,     3,     1,     2,
1119++       1,     6,     6,     3,     1,     0,     3,     3,     1,     2,
1120++       1,     3,     3,     5,     6,     6,     5,     6,     6,     6,
1121++       6,     2,     1,     5,     1,     1,     1,     1,     2,     1,
1122++       5,     1,     3,     1,     1,     3,     6,     3,     1,     3,
1123++       3,     1,     3,     5,     3,     3,     1,     5,     6,     1,
1124++       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1125++       1,     1,     1,     1,     1,     1,     1,     0,     1,     1,
1126++       1,     1,     1,     1,     0,     3,     1,     3,     3,     3,
1127++       3,     3,     1,     2,     2,     2,     2,     1,     4,     1,
1128++       3,     3,     1,     4,     1,     3,     4,     6,     1,     1,
1129++       1,     1,     1,     0,     3,     3,     1,     1,     3,     1,
1130++       1,     1,     2,     1,     1,     1,     1,     1,     1,     1,
1131++       1,     1,     1,     0,     1
1132++};
1133++
1134++
1135++enum { YYENOMEM = -2 };
1136++
1137++#define yyerrok         (yyerrstatus = 0)
1138++#define yyclearin       (yychar = YYEMPTY)
1139++
1140++#define YYACCEPT        goto yyacceptlab
1141++#define YYABORT         goto yyabortlab
1142++#define YYERROR         goto yyerrorlab
1143++#define YYNOMEM         goto yyexhaustedlab
1144++
1145++
1146++#define YYRECOVERING()  (!!yyerrstatus)
1147++
1148++#define YYBACKUP(Token, Value)                                    \
1149++  do                                                              \
1150++    if (yychar == YYEMPTY)                                        \
1151++      {                                                           \
1152++        yychar = (Token);                                         \
1153++        yylval = (Value);                                         \
1154++        YYPOPSTACK (yylen);                                       \
1155++        yystate = *yyssp;                                         \
1156++        goto yybackup;                                            \
1157++      }                                                           \
1158++    else                                                          \
1159++      {                                                           \
1160++        yyerror (param, YY_("syntax error: cannot back up")); \
1161++        YYERROR;                                                  \
1162++      }                                                           \
1163++  while (0)
1164++
1165++/* Backward compatibility with an undocumented macro.
1166++   Use YYerror or YYUNDEF. */
1167++#define YYERRCODE YYUNDEF
1168++
1169++
1170++/* Enable debugging if requested.  */
1171++#if YYDEBUG
1172++
1173++# ifndef YYFPRINTF
1174++#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1175++#  define YYFPRINTF fprintf
1176++# endif
1177++
1178++# define YYDPRINTF(Args)                        \
1179++do {                                            \
1180++  if (yydebug)                                  \
1181++    YYFPRINTF Args;                             \
1182++} while (0)
1183++
1184++
1185++
1186++
1187++# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
1188++do {                                                                      \
1189++  if (yydebug)                                                            \
1190++    {                                                                     \
1191++      YYFPRINTF (stderr, "%s ", Title);                                   \
1192++      yy_symbol_print (stderr,                                            \
1193++                  Kind, Value, param); \
1194++      YYFPRINTF (stderr, "\n");                                           \
1195++    }                                                                     \
1196++} while (0)
1197++
1198++
1199++/*-----------------------------------.
1200++| Print this symbol's value on YYO.  |
1201++`-----------------------------------*/
1202++
1203++static void
1204++yy_symbol_value_print (FILE *yyo,
1205++                       yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, struct parser_param *param)
1206++{
1207++  FILE *yyoutput = yyo;
1208++  YY_USE (yyoutput);
1209++  YY_USE (param);
1210++  if (!yyvaluep)
1211++    return;
1212++  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1213++  YY_USE (yykind);
1214++  YY_IGNORE_MAYBE_UNINITIALIZED_END
1215++}
1216++
1217++
1218++/*---------------------------.
1219++| Print this symbol on YYO.  |
1220++`---------------------------*/
1221++
1222++static void
1223++yy_symbol_print (FILE *yyo,
1224++                 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, struct parser_param *param)
1225++{
1226++  YYFPRINTF (yyo, "%s %s (",
1227++             yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1228++
1229++  yy_symbol_value_print (yyo, yykind, yyvaluep, param);
1230++  YYFPRINTF (yyo, ")");
1231++}
1232++
1233++/*------------------------------------------------------------------.
1234++| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1235++| TOP (included).                                                   |
1236++`------------------------------------------------------------------*/
1237++
1238++static void
1239++yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1240++{
1241++  YYFPRINTF (stderr, "Stack now");
1242++  for (; yybottom <= yytop; yybottom++)
1243++    {
1244++      int yybot = *yybottom;
1245++      YYFPRINTF (stderr, " %d", yybot);
1246++    }
1247++  YYFPRINTF (stderr, "\n");
1248++}
1249++
1250++# define YY_STACK_PRINT(Bottom, Top)                            \
1251++do {                                                            \
1252++  if (yydebug)                                                  \
1253++    yy_stack_print ((Bottom), (Top));                           \
1254++} while (0)
1255++
1256++
1257++/*------------------------------------------------.
1258++| Report that the YYRULE is going to be reduced.  |
1259++`------------------------------------------------*/
1260++
1261++static void
1262++yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1263++                 int yyrule, struct parser_param *param)
1264++{
1265++  int yylno = yyrline[yyrule];
1266++  int yynrhs = yyr2[yyrule];
1267++  int yyi;
1268++  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1269++             yyrule - 1, yylno);
1270++  /* The symbols being reduced.  */
1271++  for (yyi = 0; yyi < yynrhs; yyi++)
1272++    {
1273++      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1274++      yy_symbol_print (stderr,
1275++                       YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1276++                       &yyvsp[(yyi + 1) - (yynrhs)], param);
1277++      YYFPRINTF (stderr, "\n");
1278++    }
1279++}
1280++
1281++# define YY_REDUCE_PRINT(Rule)          \
1282++do {                                    \
1283++  if (yydebug)                          \
1284++    yy_reduce_print (yyssp, yyvsp, Rule, param); \
1285++} while (0)
1286++
1287++/* Nonzero means print parse trace.  It is left uninitialized so that
1288++   multiple parsers can coexist.  */
1289++int yydebug;
1290++#else /* !YYDEBUG */
1291++# define YYDPRINTF(Args) ((void) 0)
1292++# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1293++# define YY_STACK_PRINT(Bottom, Top)
1294++# define YY_REDUCE_PRINT(Rule)
1295++#endif /* !YYDEBUG */
1296++
1297++
1298++/* YYINITDEPTH -- initial size of the parser's stacks.  */
1299++#ifndef YYINITDEPTH
1300++# define YYINITDEPTH 200
1301++#endif
1302++
1303++/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1304++   if the built-in stack extension method is used).
1305++
1306++   Do not make this value too large; the results are undefined if
1307++   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1308++   evaluated with infinite-precision integer arithmetic.  */
1309++
1310++#ifndef YYMAXDEPTH
1311++# define YYMAXDEPTH 10000
1312++#endif
1313++
1314++
1315++
1316++
1317++
1318++
1319++/*-----------------------------------------------.
1320++| Release the memory associated to this symbol.  |
1321++`-----------------------------------------------*/
1322++
1323++static void
1324++yydestruct (const char *yymsg,
1325++            yysymbol_kind_t yykind, YYSTYPE *yyvaluep, struct parser_param *param)
1326++{
1327++  YY_USE (yyvaluep);
1328++  YY_USE (param);
1329++  if (!yymsg)
1330++    yymsg = "Deleting";
1331++  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1332++
1333++  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1334++  switch (yykind)
1335++    {
1336++    case YYSYMBOL_STRING: /* STRING  */
1337++#line 238 "parser.y"
1338++            { free(((*yyvaluep).str)); }
1339++#line 1318 "parser.c"
1340++        break;
1341++
1342++    case YYSYMBOL_IDENT: /* IDENT  */
1343++#line 238 "parser.y"
1344++            { free(((*yyvaluep).str)); }
1345++#line 1324 "parser.c"
1346++        break;
1347++
1348++    case YYSYMBOL_XkbFile: /* XkbFile  */
1349++#line 236 "parser.y"
1350++            { if (!param->rtrn) FreeXkbFile(((*yyvaluep).file)); }
1351++#line 1330 "parser.c"
1352++        break;
1353++
1354++    case YYSYMBOL_XkbCompositeMap: /* XkbCompositeMap  */
1355++#line 236 "parser.y"
1356++            { if (!param->rtrn) FreeXkbFile(((*yyvaluep).file)); }
1357++#line 1336 "parser.c"
1358++        break;
1359++
1360++    case YYSYMBOL_XkbMapConfigList: /* XkbMapConfigList  */
1361++#line 237 "parser.y"
1362++            { FreeXkbFile(((*yyvaluep).fileList).head); }
1363++#line 1342 "parser.c"
1364++        break;
1365++
1366++    case YYSYMBOL_XkbMapConfig: /* XkbMapConfig  */
1367++#line 236 "parser.y"
1368++            { if (!param->rtrn) FreeXkbFile(((*yyvaluep).file)); }
1369++#line 1348 "parser.c"
1370++        break;
1371++
1372++    case YYSYMBOL_DeclList: /* DeclList  */
1373++#line 232 "parser.y"
1374++            { FreeStmt((ParseCommon *) ((*yyvaluep).anyList).head); }
1375++#line 1354 "parser.c"
1376++        break;
1377++
1378++    case YYSYMBOL_Decl: /* Decl  */
1379++#line 229 "parser.y"
1380++            { FreeStmt((ParseCommon *) ((*yyvaluep).any)); }
1381++#line 1360 "parser.c"
1382++        break;
1383++
1384++    case YYSYMBOL_VarDecl: /* VarDecl  */
1385++#line 229 "parser.y"
1386++            { FreeStmt((ParseCommon *) ((*yyvaluep).var)); }
1387++#line 1366 "parser.c"
1388++        break;
1389++
1390++    case YYSYMBOL_KeyNameDecl: /* KeyNameDecl  */
1391++#line 229 "parser.y"
1392++            { FreeStmt((ParseCommon *) ((*yyvaluep).keyCode)); }
1393++#line 1372 "parser.c"
1394++        break;
1395++
1396++    case YYSYMBOL_KeyAliasDecl: /* KeyAliasDecl  */
1397++#line 229 "parser.y"
1398++            { FreeStmt((ParseCommon *) ((*yyvaluep).keyAlias)); }
1399++#line 1378 "parser.c"
1400++        break;
1401++
1402++    case YYSYMBOL_VModDecl: /* VModDecl  */
1403++#line 232 "parser.y"
1404++            { FreeStmt((ParseCommon *) ((*yyvaluep).vmodList).head); }
1405++#line 1384 "parser.c"
1406++        break;
1407++
1408++    case YYSYMBOL_VModDefList: /* VModDefList  */
1409++#line 232 "parser.y"
1410++            { FreeStmt((ParseCommon *) ((*yyvaluep).vmodList).head); }
1411++#line 1390 "parser.c"
1412++        break;
1413++
1414++    case YYSYMBOL_VModDef: /* VModDef  */
1415++#line 229 "parser.y"
1416++            { FreeStmt((ParseCommon *) ((*yyvaluep).vmod)); }
1417++#line 1396 "parser.c"
1418++        break;
1419++
1420++    case YYSYMBOL_InterpretDecl: /* InterpretDecl  */
1421++#line 229 "parser.y"
1422++            { FreeStmt((ParseCommon *) ((*yyvaluep).interp)); }
1423++#line 1402 "parser.c"
1424++        break;
1425++
1426++    case YYSYMBOL_InterpretMatch: /* InterpretMatch  */
1427++#line 229 "parser.y"
1428++            { FreeStmt((ParseCommon *) ((*yyvaluep).interp)); }
1429++#line 1408 "parser.c"
1430++        break;
1431++
1432++    case YYSYMBOL_VarDeclList: /* VarDeclList  */
1433++#line 232 "parser.y"
1434++            { FreeStmt((ParseCommon *) ((*yyvaluep).varList).head); }
1435++#line 1414 "parser.c"
1436++        break;
1437++
1438++    case YYSYMBOL_KeyTypeDecl: /* KeyTypeDecl  */
1439++#line 229 "parser.y"
1440++            { FreeStmt((ParseCommon *) ((*yyvaluep).keyType)); }
1441++#line 1420 "parser.c"
1442++        break;
1443++
1444++    case YYSYMBOL_SymbolsDecl: /* SymbolsDecl  */
1445++#line 229 "parser.y"
1446++            { FreeStmt((ParseCommon *) ((*yyvaluep).syms)); }
1447++#line 1426 "parser.c"
1448++        break;
1449++
1450++    case YYSYMBOL_SymbolsBody: /* SymbolsBody  */
1451++#line 232 "parser.y"
1452++            { FreeStmt((ParseCommon *) ((*yyvaluep).varList).head); }
1453++#line 1432 "parser.c"
1454++        break;
1455++
1456++    case YYSYMBOL_SymbolsVarDecl: /* SymbolsVarDecl  */
1457++#line 229 "parser.y"
1458++            { FreeStmt((ParseCommon *) ((*yyvaluep).var)); }
1459++#line 1438 "parser.c"
1460++        break;
1461++
1462++    case YYSYMBOL_ArrayInit: /* ArrayInit  */
1463++#line 229 "parser.y"
1464++            { FreeStmt((ParseCommon *) ((*yyvaluep).expr)); }
1465++#line 1444 "parser.c"
1466++        break;
1467++
1468++    case YYSYMBOL_GroupCompatDecl: /* GroupCompatDecl  */
1469++#line 229 "parser.y"
1470++            { FreeStmt((ParseCommon *) ((*yyvaluep).groupCompat)); }
1471++#line 1450 "parser.c"
1472++        break;
1473++
1474++    case YYSYMBOL_ModMapDecl: /* ModMapDecl  */
1475++#line 229 "parser.y"
1476++            { FreeStmt((ParseCommon *) ((*yyvaluep).modMask)); }
1477++#line 1456 "parser.c"
1478++        break;
1479++
1480++    case YYSYMBOL_LedMapDecl: /* LedMapDecl  */
1481++#line 229 "parser.y"
1482++            { FreeStmt((ParseCommon *) ((*yyvaluep).ledMap)); }
1483++#line 1462 "parser.c"
1484++        break;
1485++
1486++    case YYSYMBOL_LedNameDecl: /* LedNameDecl  */
1487++#line 229 "parser.y"
1488++            { FreeStmt((ParseCommon *) ((*yyvaluep).ledName)); }
1489++#line 1468 "parser.c"
1490++        break;
1491++
1492++    case YYSYMBOL_CoordList: /* CoordList  */
1493++#line 229 "parser.y"
1494++            { FreeStmt((ParseCommon *) ((*yyvaluep).expr)); }
1495++#line 1474 "parser.c"
1496++        break;
1497++
1498++    case YYSYMBOL_Coord: /* Coord  */
1499++#line 229 "parser.y"
1500++            { FreeStmt((ParseCommon *) ((*yyvaluep).expr)); }
1501++#line 1480 "parser.c"
1502++        break;
1503++
1504++    case YYSYMBOL_OptExprList: /* OptExprList  */
1505++#line 232 "parser.y"
1506++            { FreeStmt((ParseCommon *) ((*yyvaluep).exprList).head); }
1507++#line 1486 "parser.c"
1508++        break;
1509++
1510++    case YYSYMBOL_ExprList: /* ExprList  */
1511++#line 232 "parser.y"
1512++            { FreeStmt((ParseCommon *) ((*yyvaluep).exprList).head); }
1513++#line 1492 "parser.c"
1514++        break;
1515++
1516++    case YYSYMBOL_Expr: /* Expr  */
1517++#line 229 "parser.y"
1518++            { FreeStmt((ParseCommon *) ((*yyvaluep).expr)); }
1519++#line 1498 "parser.c"
1520++        break;
1521++
1522++    case YYSYMBOL_Term: /* Term  */
1523++#line 229 "parser.y"
1524++            { FreeStmt((ParseCommon *) ((*yyvaluep).expr)); }
1525++#line 1504 "parser.c"
1526++        break;
1527++
1528++    case YYSYMBOL_ActionList: /* ActionList  */
1529++#line 232 "parser.y"
1530++            { FreeStmt((ParseCommon *) ((*yyvaluep).exprList).head); }
1531++#line 1510 "parser.c"
1532++        break;
1533++
1534++    case YYSYMBOL_Action: /* Action  */
1535++#line 229 "parser.y"
1536++            { FreeStmt((ParseCommon *) ((*yyvaluep).expr)); }
1537++#line 1516 "parser.c"
1538++        break;
1539++
1540++    case YYSYMBOL_Lhs: /* Lhs  */
1541++#line 229 "parser.y"
1542++            { FreeStmt((ParseCommon *) ((*yyvaluep).expr)); }
1543++#line 1522 "parser.c"
1544++        break;
1545++
1546++    case YYSYMBOL_Terminal: /* Terminal  */
1547++#line 229 "parser.y"
1548++            { FreeStmt((ParseCommon *) ((*yyvaluep).expr)); }
1549++#line 1528 "parser.c"
1550++        break;
1551++
1552++    case YYSYMBOL_OptKeySymList: /* OptKeySymList  */
1553++#line 229 "parser.y"
1554++            { FreeStmt((ParseCommon *) ((*yyvaluep).expr)); }
1555++#line 1534 "parser.c"
1556++        break;
1557++
1558++    case YYSYMBOL_KeySymList: /* KeySymList  */
1559++#line 229 "parser.y"
1560++            { FreeStmt((ParseCommon *) ((*yyvaluep).expr)); }
1561++#line 1540 "parser.c"
1562++        break;
1563++
1564++    case YYSYMBOL_KeySyms: /* KeySyms  */
1565++#line 229 "parser.y"
1566++            { FreeStmt((ParseCommon *) ((*yyvaluep).expr)); }
1567++#line 1546 "parser.c"
1568++        break;
1569++
1570++    case YYSYMBOL_OptMapName: /* OptMapName  */
1571++#line 238 "parser.y"
1572++            { free(((*yyvaluep).str)); }
1573++#line 1552 "parser.c"
1574++        break;
1575++
1576++    case YYSYMBOL_MapName: /* MapName  */
1577++#line 238 "parser.y"
1578++            { free(((*yyvaluep).str)); }
1579++#line 1558 "parser.c"
1580++        break;
1581++
1582++      default:
1583++        break;
1584++    }
1585++  YY_IGNORE_MAYBE_UNINITIALIZED_END
1586++}
1587++
1588++
1589++
1590++
1591++
1592++
1593++/*----------.
1594++| yyparse.  |
1595++`----------*/
1596++
1597++int
1598++yyparse (struct parser_param *param)
1599++{
1600++/* Lookahead token kind.  */
1601++int yychar;
1602++
1603++
1604++/* The semantic value of the lookahead symbol.  */
1605++/* Default value used for initialization, for pacifying older GCCs
1606++   or non-GCC compilers.  */
1607++YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1608++YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1609++
1610++    /* Number of syntax errors so far.  */
1611++    int yynerrs = 0;
1612++
1613++    yy_state_fast_t yystate = 0;
1614++    /* Number of tokens to shift before error messages enabled.  */
1615++    int yyerrstatus = 0;
1616++
1617++    /* Refer to the stacks through separate pointers, to allow yyoverflow
1618++       to reallocate them elsewhere.  */
1619++
1620++    /* Their size.  */
1621++    YYPTRDIFF_T yystacksize = YYINITDEPTH;
1622++
1623++    /* The state stack: array, bottom, top.  */
1624++    yy_state_t yyssa[YYINITDEPTH];
1625++    yy_state_t *yyss = yyssa;
1626++    yy_state_t *yyssp = yyss;
1627++
1628++    /* The semantic value stack: array, bottom, top.  */
1629++    YYSTYPE yyvsa[YYINITDEPTH];
1630++    YYSTYPE *yyvs = yyvsa;
1631++    YYSTYPE *yyvsp = yyvs;
1632++
1633++  int yyn;
1634++  /* The return value of yyparse.  */
1635++  int yyresult;
1636++  /* Lookahead symbol kind.  */
1637++  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1638++  /* The variables used to return semantic value and location from the
1639++     action routines.  */
1640++  YYSTYPE yyval;
1641++
1642++
1643++
1644++#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1645++
1646++  /* The number of symbols on the RHS of the reduced rule.
1647++     Keep to zero when no symbol should be popped.  */
1648++  int yylen = 0;
1649++
1650++  YYDPRINTF ((stderr, "Starting parse\n"));
1651++
1652++  yychar = YYEMPTY; /* Cause a token to be read.  */
1653++
1654++  goto yysetstate;
1655++
1656++
1657++/*------------------------------------------------------------.
1658++| yynewstate -- push a new state, which is found in yystate.  |
1659++`------------------------------------------------------------*/
1660++yynewstate:
1661++  /* In all cases, when you get here, the value and location stacks
1662++     have just been pushed.  So pushing a state here evens the stacks.  */
1663++  yyssp++;
1664++
1665++
1666++/*--------------------------------------------------------------------.
1667++| yysetstate -- set current state (the top of the stack) to yystate.  |
1668++`--------------------------------------------------------------------*/
1669++yysetstate:
1670++  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1671++  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1672++  YY_IGNORE_USELESS_CAST_BEGIN
1673++  *yyssp = YY_CAST (yy_state_t, yystate);
1674++  YY_IGNORE_USELESS_CAST_END
1675++  YY_STACK_PRINT (yyss, yyssp);
1676++
1677++  if (yyss + yystacksize - 1 <= yyssp)
1678++#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1679++    YYNOMEM;
1680++#else
1681++    {
1682++      /* Get the current used size of the three stacks, in elements.  */
1683++      YYPTRDIFF_T yysize = yyssp - yyss + 1;
1684++
1685++# if defined yyoverflow
1686++      {
1687++        /* Give user a chance to reallocate the stack.  Use copies of
1688++           these so that the &'s don't force the real ones into
1689++           memory.  */
1690++        yy_state_t *yyss1 = yyss;
1691++        YYSTYPE *yyvs1 = yyvs;
1692++
1693++        /* Each stack pointer address is followed by the size of the
1694++           data in use in that stack, in bytes.  This used to be a
1695++           conditional around just the two extra args, but that might
1696++           be undefined if yyoverflow is a macro.  */
1697++        yyoverflow (YY_("memory exhausted"),
1698++                    &yyss1, yysize * YYSIZEOF (*yyssp),
1699++                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
1700++                    &yystacksize);
1701++        yyss = yyss1;
1702++        yyvs = yyvs1;
1703++      }
1704++# else /* defined YYSTACK_RELOCATE */
1705++      /* Extend the stack our own way.  */
1706++      if (YYMAXDEPTH <= yystacksize)
1707++        YYNOMEM;
1708++      yystacksize *= 2;
1709++      if (YYMAXDEPTH < yystacksize)
1710++        yystacksize = YYMAXDEPTH;
1711++
1712++      {
1713++        yy_state_t *yyss1 = yyss;
1714++        union yyalloc *yyptr =
1715++          YY_CAST (union yyalloc *,
1716++                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1717++        if (! yyptr)
1718++          YYNOMEM;
1719++        YYSTACK_RELOCATE (yyss_alloc, yyss);
1720++        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1721++#  undef YYSTACK_RELOCATE
1722++        if (yyss1 != yyssa)
1723++          YYSTACK_FREE (yyss1);
1724++      }
1725++# endif
1726++
1727++      yyssp = yyss + yysize - 1;
1728++      yyvsp = yyvs + yysize - 1;
1729++
1730++      YY_IGNORE_USELESS_CAST_BEGIN
1731++      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1732++                  YY_CAST (long, yystacksize)));
1733++      YY_IGNORE_USELESS_CAST_END
1734++
1735++      if (yyss + yystacksize - 1 <= yyssp)
1736++        YYABORT;
1737++    }
1738++#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1739++
1740++
1741++  if (yystate == YYFINAL)
1742++    YYACCEPT;
1743++
1744++  goto yybackup;
1745++
1746++
1747++/*-----------.
1748++| yybackup.  |
1749++`-----------*/
1750++yybackup:
1751++  /* Do appropriate processing given the current state.  Read a
1752++     lookahead token if we need one and don't already have one.  */
1753++
1754++  /* First try to decide what to do without reference to lookahead token.  */
1755++  yyn = yypact[yystate];
1756++  if (yypact_value_is_default (yyn))
1757++    goto yydefault;
1758++
1759++  /* Not known => get a lookahead token if don't already have one.  */
1760++
1761++  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
1762++  if (yychar == YYEMPTY)
1763++    {
1764++      YYDPRINTF ((stderr, "Reading a token\n"));
1765++      yychar = yylex (&yylval, param_scanner);
1766++    }
1767++
1768++  if (yychar <= END_OF_FILE)
1769++    {
1770++      yychar = END_OF_FILE;
1771++      yytoken = YYSYMBOL_YYEOF;
1772++      YYDPRINTF ((stderr, "Now at end of input.\n"));
1773++    }
1774++  else if (yychar == YYerror)
1775++    {
1776++      /* The scanner already issued an error message, process directly
1777++         to error recovery.  But do not keep the error token as
1778++         lookahead, it is too special and may lead us to an endless
1779++         loop in error recovery. */
1780++      yychar = YYUNDEF;
1781++      yytoken = YYSYMBOL_YYerror;
1782++      goto yyerrlab1;
1783++    }
1784++  else
1785++    {
1786++      yytoken = YYTRANSLATE (yychar);
1787++      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1788++    }
1789++
1790++  /* If the proper action on seeing token YYTOKEN is to reduce or to
1791++     detect an error, take that action.  */
1792++  yyn += yytoken;
1793++  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1794++    goto yydefault;
1795++  yyn = yytable[yyn];
1796++  if (yyn <= 0)
1797++    {
1798++      if (yytable_value_is_error (yyn))
1799++        goto yyerrlab;
1800++      yyn = -yyn;
1801++      goto yyreduce;
1802++    }
1803++
1804++  /* Count tokens shifted since error; after three, turn off error
1805++     status.  */
1806++  if (yyerrstatus)
1807++    yyerrstatus--;
1808++
1809++  /* Shift the lookahead token.  */
1810++  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1811++  yystate = yyn;
1812++  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1813++  *++yyvsp = yylval;
1814++  YY_IGNORE_MAYBE_UNINITIALIZED_END
1815++
1816++  /* Discard the shifted token.  */
1817++  yychar = YYEMPTY;
1818++  goto yynewstate;
1819++
1820++
1821++/*-----------------------------------------------------------.
1822++| yydefault -- do the default action for the current state.  |
1823++`-----------------------------------------------------------*/
1824++yydefault:
1825++  yyn = yydefact[yystate];
1826++  if (yyn == 0)
1827++    goto yyerrlab;
1828++  goto yyreduce;
1829++
1830++
1831++/*-----------------------------.
1832++| yyreduce -- do a reduction.  |
1833++`-----------------------------*/
1834++yyreduce:
1835++  /* yyn is the number of a rule to reduce with.  */
1836++  yylen = yyr2[yyn];
1837++
1838++  /* If YYLEN is nonzero, implement the default value of the action:
1839++     '$$ = $1'.
1840++
1841++     Otherwise, the following line sets YYVAL to garbage.
1842++     This behavior is undocumented and Bison
1843++     users should not rely upon it.  Assigning to YYVAL
1844++     unconditionally makes the parser a bit smaller, and it avoids a
1845++     GCC warning that YYVAL may be used uninitialized.  */
1846++  yyval = yyvsp[1-yylen];
1847++
1848++
1849++  YY_REDUCE_PRINT (yyn);
1850++  switch (yyn)
1851++    {
1852++  case 2: /* XkbFile: XkbCompositeMap  */
1853++#line 255 "parser.y"
1854++                        { (yyval.file) = param->rtrn = (yyvsp[0].file); param->more_maps = !!param->rtrn; }
1855++#line 1834 "parser.c"
1856++    break;
1857++
1858++  case 3: /* XkbFile: XkbMapConfig  */
1859++#line 257 "parser.y"
1860++                        { (yyval.file) = param->rtrn = (yyvsp[0].file); param->more_maps = !!param->rtrn; YYACCEPT; }
1861++#line 1840 "parser.c"
1862++    break;
1863++
1864++  case 4: /* XkbFile: END_OF_FILE  */
1865++#line 259 "parser.y"
1866++                        { (yyval.file) = param->rtrn = NULL; param->more_maps = false; }
1867++#line 1846 "parser.c"
1868++    break;
1869++
1870++  case 5: /* XkbCompositeMap: OptFlags XkbCompositeType OptMapName OBRACE XkbMapConfigList CBRACE SEMI  */
1871++#line 265 "parser.y"
1872++                        { (yyval.file) = XkbFileCreate((yyvsp[-5].file_type), (yyvsp[-4].str), (ParseCommon *) (yyvsp[-2].fileList).head, (yyvsp[-6].mapFlags)); }
1873++#line 1852 "parser.c"
1874++    break;
1875++
1876++  case 6: /* XkbCompositeType: XKB_KEYMAP  */
1877++#line 268 "parser.y"
1878++                                        { (yyval.file_type) = FILE_TYPE_KEYMAP; }
1879++#line 1858 "parser.c"
1880++    break;
1881++
1882++  case 7: /* XkbCompositeType: XKB_SEMANTICS  */
1883++#line 269 "parser.y"
1884++                                        { (yyval.file_type) = FILE_TYPE_KEYMAP; }
1885++#line 1864 "parser.c"
1886++    break;
1887++
1888++  case 8: /* XkbCompositeType: XKB_LAYOUT  */
1889++#line 270 "parser.y"
1890++                                        { (yyval.file_type) = FILE_TYPE_KEYMAP; }
1891++#line 1870 "parser.c"
1892++    break;
1893++
1894++  case 9: /* XkbMapConfigList: XkbMapConfigList XkbMapConfig  */
1895++#line 274 "parser.y"
1896++                        { (yyval.fileList).head = (yyvsp[-1].fileList).head; (yyval.fileList).last->common.next = &(yyvsp[0].file)->common; (yyval.fileList).last = (yyvsp[0].file); }
1897++#line 1876 "parser.c"
1898++    break;
1899++
1900++  case 10: /* XkbMapConfigList: XkbMapConfig  */
1901++#line 276 "parser.y"
1902++                        { (yyval.fileList).head = (yyval.fileList).last = (yyvsp[0].file); }
1903++#line 1882 "parser.c"
1904++    break;
1905++
1906++  case 11: /* XkbMapConfig: OptFlags FileType OptMapName OBRACE DeclList CBRACE SEMI  */
1907++#line 282 "parser.y"
1908++                        {
1909++                            (yyval.file) = XkbFileCreate((yyvsp[-5].file_type), (yyvsp[-4].str), (yyvsp[-2].anyList).head, (yyvsp[-6].mapFlags));
1910++                        }
1911++#line 1890 "parser.c"
1912++    break;
1913++
1914++  case 12: /* FileType: XKB_KEYCODES  */
1915++#line 287 "parser.y"
1916++                                                { (yyval.file_type) = FILE_TYPE_KEYCODES; }
1917++#line 1896 "parser.c"
1918++    break;
1919++
1920++  case 13: /* FileType: XKB_TYPES  */
1921++#line 288 "parser.y"
1922++                                                { (yyval.file_type) = FILE_TYPE_TYPES; }
1923++#line 1902 "parser.c"
1924++    break;
1925++
1926++  case 14: /* FileType: XKB_COMPATMAP  */
1927++#line 289 "parser.y"
1928++                                                { (yyval.file_type) = FILE_TYPE_COMPAT; }
1929++#line 1908 "parser.c"
1930++    break;
1931++
1932++  case 15: /* FileType: XKB_SYMBOLS  */
1933++#line 290 "parser.y"
1934++                                                { (yyval.file_type) = FILE_TYPE_SYMBOLS; }
1935++#line 1914 "parser.c"
1936++    break;
1937++
1938++  case 16: /* FileType: XKB_GEOMETRY  */
1939++#line 291 "parser.y"
1940++                                                { (yyval.file_type) = FILE_TYPE_GEOMETRY; }
1941++#line 1920 "parser.c"
1942++    break;
1943++
1944++  case 17: /* OptFlags: Flags  */
1945++#line 294 "parser.y"
1946++                                                { (yyval.mapFlags) = (yyvsp[0].mapFlags); }
1947++#line 1926 "parser.c"
1948++    break;
1949++
1950++  case 18: /* OptFlags: %empty  */
1951++#line 295 "parser.y"
1952++                                                { (yyval.mapFlags) = 0; }
1953++#line 1932 "parser.c"
1954++    break;
1955++
1956++  case 19: /* Flags: Flags Flag  */
1957++#line 298 "parser.y"
1958++                                                { (yyval.mapFlags) = ((yyvsp[-1].mapFlags) | (yyvsp[0].mapFlags)); }
1959++#line 1938 "parser.c"
1960++    break;
1961++
1962++  case 20: /* Flags: Flag  */
1963++#line 299 "parser.y"
1964++                                                { (yyval.mapFlags) = (yyvsp[0].mapFlags); }
1965++#line 1944 "parser.c"
1966++    break;
1967++
1968++  case 21: /* Flag: PARTIAL  */
1969++#line 302 "parser.y"
1970++                                                { (yyval.mapFlags) = MAP_IS_PARTIAL; }
1971++#line 1950 "parser.c"
1972++    break;
1973++
1974++  case 22: /* Flag: DEFAULT  */
1975++#line 303 "parser.y"
1976++                                                { (yyval.mapFlags) = MAP_IS_DEFAULT; }
1977++#line 1956 "parser.c"
1978++    break;
1979++
1980++  case 23: /* Flag: HIDDEN  */
1981++#line 304 "parser.y"
1982++                                                { (yyval.mapFlags) = MAP_IS_HIDDEN; }
1983++#line 1962 "parser.c"
1984++    break;
1985++
1986++  case 24: /* Flag: ALPHANUMERIC_KEYS  */
1987++#line 305 "parser.y"
1988++                                                { (yyval.mapFlags) = MAP_HAS_ALPHANUMERIC; }
1989++#line 1968 "parser.c"
1990++    break;
1991++
1992++  case 25: /* Flag: MODIFIER_KEYS  */
1993++#line 306 "parser.y"
1994++                                                { (yyval.mapFlags) = MAP_HAS_MODIFIER; }
1995++#line 1974 "parser.c"
1996++    break;
1997++
1998++  case 26: /* Flag: KEYPAD_KEYS  */
1999++#line 307 "parser.y"
2000++                                                { (yyval.mapFlags) = MAP_HAS_KEYPAD; }
2001++#line 1980 "parser.c"
2002++    break;
2003++
2004++  case 27: /* Flag: FUNCTION_KEYS  */
2005++#line 308 "parser.y"
2006++                                                { (yyval.mapFlags) = MAP_HAS_FN; }
2007++#line 1986 "parser.c"
2008++    break;
2009++
2010++  case 28: /* Flag: ALTERNATE_GROUP  */
2011++#line 309 "parser.y"
2012++                                                { (yyval.mapFlags) = MAP_IS_ALTGR; }
2013++#line 1992 "parser.c"
2014++    break;
2015++
2016++  case 29: /* DeclList: DeclList Decl  */
2017++#line 313 "parser.y"
2018++                        {
2019++                            if ((yyvsp[0].any)) {
2020++                                if ((yyvsp[-1].anyList).head) {
2021++                                    (yyval.anyList).head = (yyvsp[-1].anyList).head; (yyvsp[-1].anyList).last->next = (yyvsp[0].any); (yyval.anyList).last = (yyvsp[0].any);
2022++                                } else {
2023++                                    (yyval.anyList).head = (yyval.anyList).last = (yyvsp[0].any);
2024++                                }
2025++                            }
2026++                        }
2027++#line 2006 "parser.c"
2028++    break;
2029++
2030++  case 30: /* DeclList: DeclList OptMergeMode VModDecl  */
2031++#line 328 "parser.y"
2032++                        {
2033++                            for (VModDef *vmod = (yyvsp[0].vmodList).head; vmod; vmod = (VModDef *) vmod->common.next)
2034++                                vmod->merge = (yyvsp[-1].merge);
2035++                            if ((yyvsp[-2].anyList).head) {
2036++                                (yyval.anyList).head = (yyvsp[-2].anyList).head; (yyvsp[-2].anyList).last->next = &(yyvsp[0].vmodList).head->common; (yyval.anyList).last = &(yyvsp[0].vmodList).last->common;
2037++                            } else {
2038++                                (yyval.anyList).head = &(yyvsp[0].vmodList).head->common; (yyval.anyList).last = &(yyvsp[0].vmodList).last->common;
2039++                            }
2040++                        }
2041++#line 2020 "parser.c"
2042++    break;
2043++
2044++  case 31: /* DeclList: %empty  */
2045++#line 337 "parser.y"
2046++                        { (yyval.anyList).head = (yyval.anyList).last = NULL; }
2047++#line 2026 "parser.c"
2048++    break;
2049++
2050++  case 32: /* Decl: OptMergeMode VarDecl  */
2051++#line 341 "parser.y"
2052++                        {
2053++                            (yyvsp[0].var)->merge = (yyvsp[-1].merge);
2054++                            (yyval.any) = (ParseCommon *) (yyvsp[0].var);
2055++                        }
2056++#line 2035 "parser.c"
2057++    break;
2058++
2059++  case 33: /* Decl: OptMergeMode InterpretDecl  */
2060++#line 347 "parser.y"
2061++                        {
2062++                            (yyvsp[0].interp)->merge = (yyvsp[-1].merge);
2063++                            (yyval.any) = (ParseCommon *) (yyvsp[0].interp);
2064++                        }
2065++#line 2044 "parser.c"
2066++    break;
2067++
2068++  case 34: /* Decl: OptMergeMode KeyNameDecl  */
2069++#line 352 "parser.y"
2070++                        {
2071++                            (yyvsp[0].keyCode)->merge = (yyvsp[-1].merge);
2072++                            (yyval.any) = (ParseCommon *) (yyvsp[0].keyCode);
2073++                        }
2074++#line 2053 "parser.c"
2075++    break;
2076++
2077++  case 35: /* Decl: OptMergeMode KeyAliasDecl  */
2078++#line 357 "parser.y"
2079++                        {
2080++                            (yyvsp[0].keyAlias)->merge = (yyvsp[-1].merge);
2081++                            (yyval.any) = (ParseCommon *) (yyvsp[0].keyAlias);
2082++                        }
2083++#line 2062 "parser.c"
2084++    break;
2085++
2086++  case 36: /* Decl: OptMergeMode KeyTypeDecl  */
2087++#line 362 "parser.y"
2088++                        {
2089++                            (yyvsp[0].keyType)->merge = (yyvsp[-1].merge);
2090++                            (yyval.any) = (ParseCommon *) (yyvsp[0].keyType);
2091++                        }
2092++#line 2071 "parser.c"
2093++    break;
2094++
2095++  case 37: /* Decl: OptMergeMode SymbolsDecl  */
2096++#line 367 "parser.y"
2097++                        {
2098++                            (yyvsp[0].syms)->merge = (yyvsp[-1].merge);
2099++                            (yyval.any) = (ParseCommon *) (yyvsp[0].syms);
2100++                        }
2101++#line 2080 "parser.c"
2102++    break;
2103++
2104++  case 38: /* Decl: OptMergeMode ModMapDecl  */
2105++#line 372 "parser.y"
2106++                        {
2107++                            (yyvsp[0].modMask)->merge = (yyvsp[-1].merge);
2108++                            (yyval.any) = (ParseCommon *) (yyvsp[0].modMask);
2109++                        }
2110++#line 2089 "parser.c"
2111++    break;
2112++
2113++  case 39: /* Decl: OptMergeMode GroupCompatDecl  */
2114++#line 377 "parser.y"
2115++                        {
2116++                            (yyvsp[0].groupCompat)->merge = (yyvsp[-1].merge);
2117++                            (yyval.any) = (ParseCommon *) (yyvsp[0].groupCompat);
2118++                        }
2119++#line 2098 "parser.c"
2120++    break;
2121++
2122++  case 40: /* Decl: OptMergeMode LedMapDecl  */
2123++#line 382 "parser.y"
2124++                        {
2125++                            (yyvsp[0].ledMap)->merge = (yyvsp[-1].merge);
2126++                            (yyval.any) = (ParseCommon *) (yyvsp[0].ledMap);
2127++                        }
2128++#line 2107 "parser.c"
2129++    break;
2130++
2131++  case 41: /* Decl: OptMergeMode LedNameDecl  */
2132++#line 387 "parser.y"
2133++                        {
2134++                            (yyvsp[0].ledName)->merge = (yyvsp[-1].merge);
2135++                            (yyval.any) = (ParseCommon *) (yyvsp[0].ledName);
2136++                        }
2137++#line 2116 "parser.c"
2138++    break;
2139++
2140++  case 42: /* Decl: OptMergeMode ShapeDecl  */
2141++#line 391 "parser.y"
2142++                                                        { (yyval.any) = NULL; }
2143++#line 2122 "parser.c"
2144++    break;
2145++
2146++  case 43: /* Decl: OptMergeMode SectionDecl  */
2147++#line 392 "parser.y"
2148++                                                        { (yyval.any) = NULL; }
2149++#line 2128 "parser.c"
2150++    break;
2151++
2152++  case 44: /* Decl: OptMergeMode DoodadDecl  */
2153++#line 393 "parser.y"
2154++                                                        { (yyval.any) = NULL; }
2155++#line 2134 "parser.c"
2156++    break;
2157++
2158++  case 45: /* Decl: MergeMode STRING  */
2159++#line 395 "parser.y"
2160++                        {
2161++                            (yyval.any) = (ParseCommon *) IncludeCreate(param->ctx, (yyvsp[0].str), (yyvsp[-1].merge));
2162++                            free((yyvsp[0].str));
2163++                        }
2164++#line 2143 "parser.c"
2165++    break;
2166++
2167++  case 46: /* VarDecl: Lhs EQUALS Expr SEMI  */
2168++#line 402 "parser.y"
2169++                        { (yyval.var) = VarCreate((yyvsp[-3].expr), (yyvsp[-1].expr)); }
2170++#line 2149 "parser.c"
2171++    break;
2172++
2173++  case 47: /* VarDecl: Ident SEMI  */
2174++#line 404 "parser.y"
2175++                        { (yyval.var) = BoolVarCreate((yyvsp[-1].atom), true); }
2176++#line 2155 "parser.c"
2177++    break;
2178++
2179++  case 48: /* VarDecl: EXCLAM Ident SEMI  */
2180++#line 406 "parser.y"
2181++                        { (yyval.var) = BoolVarCreate((yyvsp[-1].atom), false); }
2182++#line 2161 "parser.c"
2183++    break;
2184++
2185++  case 49: /* KeyNameDecl: KEYNAME EQUALS KeyCode SEMI  */
2186++#line 410 "parser.y"
2187++                        { (yyval.keyCode) = KeycodeCreate((yyvsp[-3].atom), (yyvsp[-1].num)); }
2188++#line 2167 "parser.c"
2189++    break;
2190++
2191++  case 50: /* KeyAliasDecl: ALIAS KEYNAME EQUALS KEYNAME SEMI  */
2192++#line 414 "parser.y"
2193++                        { (yyval.keyAlias) = KeyAliasCreate((yyvsp[-3].atom), (yyvsp[-1].atom)); }
2194++#line 2173 "parser.c"
2195++    break;
2196++
2197++  case 51: /* VModDecl: VIRTUAL_MODS VModDefList SEMI  */
2198++#line 418 "parser.y"
2199++                        { (yyval.vmodList) = (yyvsp[-1].vmodList); }
2200++#line 2179 "parser.c"
2201++    break;
2202++
2203++  case 52: /* VModDefList: VModDefList COMMA VModDef  */
2204++#line 422 "parser.y"
2205++                        { (yyval.vmodList).head = (yyvsp[-2].vmodList).head; (yyval.vmodList).last->common.next = &(yyvsp[0].vmod)->common; (yyval.vmodList).last = (yyvsp[0].vmod); }
2206++#line 2185 "parser.c"
2207++    break;
2208++
2209++  case 53: /* VModDefList: VModDef  */
2210++#line 424 "parser.y"
2211++                        { (yyval.vmodList).head = (yyval.vmodList).last = (yyvsp[0].vmod); }
2212++#line 2191 "parser.c"
2213++    break;
2214++
2215++  case 54: /* VModDef: Ident  */
2216++#line 428 "parser.y"
2217++                        { (yyval.vmod) = VModCreate((yyvsp[0].atom), NULL); }
2218++#line 2197 "parser.c"
2219++    break;
2220++
2221++  case 55: /* VModDef: Ident EQUALS Expr  */
2222++#line 430 "parser.y"
2223++                        { (yyval.vmod) = VModCreate((yyvsp[-2].atom), (yyvsp[0].expr)); }
2224++#line 2203 "parser.c"
2225++    break;
2226++
2227++  case 56: /* InterpretDecl: INTERPRET InterpretMatch OBRACE VarDeclList CBRACE SEMI  */
2228++#line 436 "parser.y"
2229++                        { (yyvsp[-4].interp)->def = (yyvsp[-2].varList).head; (yyval.interp) = (yyvsp[-4].interp); }
2230++#line 2209 "parser.c"
2231++    break;
2232++
2233++  case 57: /* InterpretMatch: KeySym PLUS Expr  */
2234++#line 440 "parser.y"
2235++                        { (yyval.interp) = InterpCreate((yyvsp[-2].keysym), (yyvsp[0].expr)); }
2236++#line 2215 "parser.c"
2237++    break;
2238++
2239++  case 58: /* InterpretMatch: KeySym  */
2240++#line 442 "parser.y"
2241++                        { (yyval.interp) = InterpCreate((yyvsp[0].keysym), NULL); }
2242++#line 2221 "parser.c"
2243++    break;
2244++
2245++  case 59: /* VarDeclList: VarDeclList VarDecl  */
2246++#line 446 "parser.y"
2247++                        { (yyval.varList).head = (yyvsp[-1].varList).head; (yyval.varList).last->common.next = &(yyvsp[0].var)->common; (yyval.varList).last = (yyvsp[0].var); }
2248++#line 2227 "parser.c"
2249++    break;
2250++
2251++  case 60: /* VarDeclList: VarDecl  */
2252++#line 448 "parser.y"
2253++                        { (yyval.varList).head = (yyval.varList).last = (yyvsp[0].var); }
2254++#line 2233 "parser.c"
2255++    break;
2256++
2257++  case 61: /* KeyTypeDecl: TYPE String OBRACE VarDeclList CBRACE SEMI  */
2258++#line 454 "parser.y"
2259++                        { (yyval.keyType) = KeyTypeCreate((yyvsp[-4].atom), (yyvsp[-2].varList).head); }
2260++#line 2239 "parser.c"
2261++    break;
2262++
2263++  case 62: /* SymbolsDecl: KEY KEYNAME OBRACE SymbolsBody CBRACE SEMI  */
2264++#line 460 "parser.y"
2265++                        { (yyval.syms) = SymbolsCreate((yyvsp[-4].atom), (yyvsp[-2].varList).head); }
2266++#line 2245 "parser.c"
2267++    break;
2268++
2269++  case 63: /* SymbolsBody: SymbolsBody COMMA SymbolsVarDecl  */
2270++#line 464 "parser.y"
2271++                        { (yyval.varList).head = (yyvsp[-2].varList).head; (yyval.varList).last->common.next = &(yyvsp[0].var)->common; (yyval.varList).last = (yyvsp[0].var); }
2272++#line 2251 "parser.c"
2273++    break;
2274++
2275++  case 64: /* SymbolsBody: SymbolsVarDecl  */
2276++#line 466 "parser.y"
2277++                        { (yyval.varList).head = (yyval.varList).last = (yyvsp[0].var); }
2278++#line 2257 "parser.c"
2279++    break;
2280++
2281++  case 65: /* SymbolsBody: %empty  */
2282++#line 467 "parser.y"
2283++                        { (yyval.varList).head = (yyval.varList).last = NULL; }
2284++#line 2263 "parser.c"
2285++    break;
2286++
2287++  case 66: /* SymbolsVarDecl: Lhs EQUALS Expr  */
2288++#line 470 "parser.y"
2289++                                                { (yyval.var) = VarCreate((yyvsp[-2].expr), (yyvsp[0].expr)); }
2290++#line 2269 "parser.c"
2291++    break;
2292++
2293++  case 67: /* SymbolsVarDecl: Lhs EQUALS ArrayInit  */
2294++#line 471 "parser.y"
2295++                                                { (yyval.var) = VarCreate((yyvsp[-2].expr), (yyvsp[0].expr)); }
2296++#line 2275 "parser.c"
2297++    break;
2298++
2299++  case 68: /* SymbolsVarDecl: Ident  */
2300++#line 472 "parser.y"
2301++                                                { (yyval.var) = BoolVarCreate((yyvsp[0].atom), true); }
2302++#line 2281 "parser.c"
2303++    break;
2304++
2305++  case 69: /* SymbolsVarDecl: EXCLAM Ident  */
2306++#line 473 "parser.y"
2307++                                                { (yyval.var) = BoolVarCreate((yyvsp[0].atom), false); }
2308++#line 2287 "parser.c"
2309++    break;
2310++
2311++  case 70: /* SymbolsVarDecl: ArrayInit  */
2312++#line 474 "parser.y"
2313++                                                { (yyval.var) = VarCreate(NULL, (yyvsp[0].expr)); }
2314++#line 2293 "parser.c"
2315++    break;
2316++
2317++  case 71: /* ArrayInit: OBRACKET OptKeySymList CBRACKET  */
2318++#line 478 "parser.y"
2319++                        { (yyval.expr) = (yyvsp[-1].expr); }
2320++#line 2299 "parser.c"
2321++    break;
2322++
2323++  case 72: /* ArrayInit: OBRACKET ActionList CBRACKET  */
2324++#line 480 "parser.y"
2325++                        { (yyval.expr) = ExprCreateActionList((yyvsp[-1].exprList).head); }
2326++#line 2305 "parser.c"
2327++    break;
2328++
2329++  case 73: /* GroupCompatDecl: GROUP Integer EQUALS Expr SEMI  */
2330++#line 484 "parser.y"
2331++                        { (yyval.groupCompat) = GroupCompatCreate((yyvsp[-3].num), (yyvsp[-1].expr)); }
2332++#line 2311 "parser.c"
2333++    break;
2334++
2335++  case 74: /* ModMapDecl: MODIFIER_MAP Ident OBRACE ExprList CBRACE SEMI  */
2336++#line 488 "parser.y"
2337++                        { (yyval.modMask) = ModMapCreate((yyvsp[-4].atom), (yyvsp[-2].exprList).head); }
2338++#line 2317 "parser.c"
2339++    break;
2340++
2341++  case 75: /* LedMapDecl: INDICATOR String OBRACE VarDeclList CBRACE SEMI  */
2342++#line 492 "parser.y"
2343++                        { (yyval.ledMap) = LedMapCreate((yyvsp[-4].atom), (yyvsp[-2].varList).head); }
2344++#line 2323 "parser.c"
2345++    break;
2346++
2347++  case 76: /* LedNameDecl: INDICATOR Integer EQUALS Expr SEMI  */
2348++#line 496 "parser.y"
2349++                        { (yyval.ledName) = LedNameCreate((yyvsp[-3].num), (yyvsp[-1].expr), false); }
2350++#line 2329 "parser.c"
2351++    break;
2352++
2353++  case 77: /* LedNameDecl: VIRTUAL INDICATOR Integer EQUALS Expr SEMI  */
2354++#line 498 "parser.y"
2355++                        { (yyval.ledName) = LedNameCreate((yyvsp[-3].num), (yyvsp[-1].expr), true); }
2356++#line 2335 "parser.c"
2357++    break;
2358++
2359++  case 78: /* ShapeDecl: SHAPE String OBRACE OutlineList CBRACE SEMI  */
2360++#line 502 "parser.y"
2361++                        { (yyval.geom) = NULL; }
2362++#line 2341 "parser.c"
2363++    break;
2364++
2365++  case 79: /* ShapeDecl: SHAPE String OBRACE CoordList CBRACE SEMI  */
2366++#line 504 "parser.y"
2367++                        { (void) (yyvsp[-2].expr); (yyval.geom) = NULL; }
2368++#line 2347 "parser.c"
2369++    break;
2370++
2371++  case 80: /* SectionDecl: SECTION String OBRACE SectionBody CBRACE SEMI  */
2372++#line 508 "parser.y"
2373++                        { (yyval.geom) = NULL; }
2374++#line 2353 "parser.c"
2375++    break;
2376++
2377++  case 81: /* SectionBody: SectionBody SectionBodyItem  */
2378++#line 511 "parser.y"
2379++                                                        { (yyval.geom) = NULL;}
2380++#line 2359 "parser.c"
2381++    break;
2382++
2383++  case 82: /* SectionBody: SectionBodyItem  */
2384++#line 512 "parser.y"
2385++                                                        { (yyval.geom) = NULL; }
2386++#line 2365 "parser.c"
2387++    break;
2388++
2389++  case 83: /* SectionBodyItem: ROW OBRACE RowBody CBRACE SEMI  */
2390++#line 516 "parser.y"
2391++                        { (yyval.geom) = NULL; }
2392++#line 2371 "parser.c"
2393++    break;
2394++
2395++  case 84: /* SectionBodyItem: VarDecl  */
2396++#line 518 "parser.y"
2397++                        { FreeStmt((ParseCommon *) (yyvsp[0].var)); (yyval.geom) = NULL; }
2398++#line 2377 "parser.c"
2399++    break;
2400++
2401++  case 85: /* SectionBodyItem: DoodadDecl  */
2402++#line 520 "parser.y"
2403++                        { (yyval.geom) = NULL; }
2404++#line 2383 "parser.c"
2405++    break;
2406++
2407++  case 86: /* SectionBodyItem: LedMapDecl  */
2408++#line 522 "parser.y"
2409++                        { FreeStmt((ParseCommon *) (yyvsp[0].ledMap)); (yyval.geom) = NULL; }
2410++#line 2389 "parser.c"
2411++    break;
2412++
2413++  case 87: /* SectionBodyItem: OverlayDecl  */
2414++#line 524 "parser.y"
2415++                        { (yyval.geom) = NULL; }
2416++#line 2395 "parser.c"
2417++    break;
2418++
2419++  case 88: /* RowBody: RowBody RowBodyItem  */
2420++#line 527 "parser.y"
2421++                                                { (yyval.geom) = NULL;}
2422++#line 2401 "parser.c"
2423++    break;
2424++
2425++  case 89: /* RowBody: RowBodyItem  */
2426++#line 528 "parser.y"
2427++                                                { (yyval.geom) = NULL; }
2428++#line 2407 "parser.c"
2429++    break;
2430++
2431++  case 90: /* RowBodyItem: KEYS OBRACE Keys CBRACE SEMI  */
2432++#line 531 "parser.y"
2433++                                                     { (yyval.geom) = NULL; }
2434++#line 2413 "parser.c"
2435++    break;
2436++
2437++  case 91: /* RowBodyItem: VarDecl  */
2438++#line 533 "parser.y"
2439++                        { FreeStmt((ParseCommon *) (yyvsp[0].var)); (yyval.geom) = NULL; }
2440++#line 2419 "parser.c"
2441++    break;
2442++
2443++  case 92: /* Keys: Keys COMMA Key  */
2444++#line 536 "parser.y"
2445++                                                { (yyval.geom) = NULL; }
2446++#line 2425 "parser.c"
2447++    break;
2448++
2449++  case 93: /* Keys: Key  */
2450++#line 537 "parser.y"
2451++                                                { (yyval.geom) = NULL; }
2452++#line 2431 "parser.c"
2453++    break;
2454++
2455++  case 94: /* Key: KEYNAME  */
2456++#line 541 "parser.y"
2457++                        { (yyval.geom) = NULL; }
2458++#line 2437 "parser.c"
2459++    break;
2460++
2461++  case 95: /* Key: OBRACE ExprList CBRACE  */
2462++#line 543 "parser.y"
2463++                        { FreeStmt((ParseCommon *) (yyvsp[-1].exprList).head); (yyval.geom) = NULL; }
2464++#line 2443 "parser.c"
2465++    break;
2466++
2467++  case 96: /* OverlayDecl: OVERLAY String OBRACE OverlayKeyList CBRACE SEMI  */
2468++#line 547 "parser.y"
2469++                        { (yyval.geom) = NULL; }
2470++#line 2449 "parser.c"
2471++    break;
2472++
2473++  case 97: /* OverlayKeyList: OverlayKeyList COMMA OverlayKey  */
2474++#line 550 "parser.y"
2475++                                                        { (yyval.geom) = NULL; }
2476++#line 2455 "parser.c"
2477++    break;
2478++
2479++  case 98: /* OverlayKeyList: OverlayKey  */
2480++#line 551 "parser.y"
2481++                                                        { (yyval.geom) = NULL; }
2482++#line 2461 "parser.c"
2483++    break;
2484++
2485++  case 99: /* OverlayKey: KEYNAME EQUALS KEYNAME  */
2486++#line 554 "parser.y"
2487++                                                        { (yyval.geom) = NULL; }
2488++#line 2467 "parser.c"
2489++    break;
2490++
2491++  case 100: /* OutlineList: OutlineList COMMA OutlineInList  */
2492++#line 558 "parser.y"
2493++                        { (yyval.geom) = NULL;}
2494++#line 2473 "parser.c"
2495++    break;
2496++
2497++  case 101: /* OutlineList: OutlineInList  */
2498++#line 560 "parser.y"
2499++                        { (yyval.geom) = NULL; }
2500++#line 2479 "parser.c"
2501++    break;
2502++
2503++  case 102: /* OutlineInList: OBRACE CoordList CBRACE  */
2504++#line 564 "parser.y"
2505++                        { (void) (yyvsp[-1].expr); (yyval.geom) = NULL; }
2506++#line 2485 "parser.c"
2507++    break;
2508++
2509++  case 103: /* OutlineInList: Ident EQUALS OBRACE CoordList CBRACE  */
2510++#line 566 "parser.y"
2511++                        { (void) (yyvsp[-1].expr); (yyval.geom) = NULL; }
2512++#line 2491 "parser.c"
2513++    break;
2514++
2515++  case 104: /* OutlineInList: Ident EQUALS Expr  */
2516++#line 568 "parser.y"
2517++                        { FreeStmt((ParseCommon *) (yyvsp[0].expr)); (yyval.geom) = NULL; }
2518++#line 2497 "parser.c"
2519++    break;
2520++
2521++  case 105: /* CoordList: CoordList COMMA Coord  */
2522++#line 572 "parser.y"
2523++                        { (void) (yyvsp[-2].expr); (void) (yyvsp[0].expr); (yyval.expr) = NULL; }
2524++#line 2503 "parser.c"
2525++    break;
2526++
2527++  case 106: /* CoordList: Coord  */
2528++#line 574 "parser.y"
2529++                        { (void) (yyvsp[0].expr); (yyval.expr) = NULL; }
2530++#line 2509 "parser.c"
2531++    break;
2532++
2533++  case 107: /* Coord: OBRACKET SignedNumber COMMA SignedNumber CBRACKET  */
2534++#line 578 "parser.y"
2535++                        { (yyval.expr) = NULL; }
2536++#line 2515 "parser.c"
2537++    break;
2538++
2539++  case 108: /* DoodadDecl: DoodadType String OBRACE VarDeclList CBRACE SEMI  */
2540++#line 582 "parser.y"
2541++                        { FreeStmt((ParseCommon *) (yyvsp[-2].varList).head); (yyval.geom) = NULL; }
2542++#line 2521 "parser.c"
2543++    break;
2544++
2545++  case 109: /* DoodadType: TEXT  */
2546++#line 585 "parser.y"
2547++                                { (yyval.num) = 0; }
2548++#line 2527 "parser.c"
2549++    break;
2550++
2551++  case 110: /* DoodadType: OUTLINE  */
2552++#line 586 "parser.y"
2553++                                { (yyval.num) = 0; }
2554++#line 2533 "parser.c"
2555++    break;
2556++
2557++  case 111: /* DoodadType: SOLID  */
2558++#line 587 "parser.y"
2559++                                { (yyval.num) = 0; }
2560++#line 2539 "parser.c"
2561++    break;
2562++
2563++  case 112: /* DoodadType: LOGO  */
2564++#line 588 "parser.y"
2565++                                { (yyval.num) = 0; }
2566++#line 2545 "parser.c"
2567++    break;
2568++
2569++  case 113: /* FieldSpec: Ident  */
2570++#line 591 "parser.y"
2571++                                { (yyval.atom) = (yyvsp[0].atom); }
2572++#line 2551 "parser.c"
2573++    break;
2574++
2575++  case 114: /* FieldSpec: Element  */
2576++#line 592 "parser.y"
2577++                                { (yyval.atom) = (yyvsp[0].atom); }
2578++#line 2557 "parser.c"
2579++    break;
2580++
2581++  case 115: /* Element: ACTION_TOK  */
2582++#line 596 "parser.y"
2583++                        { (yyval.atom) = xkb_atom_intern_literal(param->ctx, "action"); }
2584++#line 2563 "parser.c"
2585++    break;
2586++
2587++  case 116: /* Element: INTERPRET  */
2588++#line 598 "parser.y"
2589++                        { (yyval.atom) = xkb_atom_intern_literal(param->ctx, "interpret"); }
2590++#line 2569 "parser.c"
2591++    break;
2592++
2593++  case 117: /* Element: TYPE  */
2594++#line 600 "parser.y"
2595++                        { (yyval.atom) = xkb_atom_intern_literal(param->ctx, "type"); }
2596++#line 2575 "parser.c"
2597++    break;
2598++
2599++  case 118: /* Element: KEY  */
2600++#line 602 "parser.y"
2601++                        { (yyval.atom) = xkb_atom_intern_literal(param->ctx, "key"); }
2602++#line 2581 "parser.c"
2603++    break;
2604++
2605++  case 119: /* Element: GROUP  */
2606++#line 604 "parser.y"
2607++                        { (yyval.atom) = xkb_atom_intern_literal(param->ctx, "group"); }
2608++#line 2587 "parser.c"
2609++    break;
2610++
2611++  case 120: /* Element: MODIFIER_MAP  */
2612++#line 606 "parser.y"
2613++                        {(yyval.atom) = xkb_atom_intern_literal(param->ctx, "modifier_map");}
2614++#line 2593 "parser.c"
2615++    break;
2616++
2617++  case 121: /* Element: INDICATOR  */
2618++#line 608 "parser.y"
2619++                        { (yyval.atom) = xkb_atom_intern_literal(param->ctx, "indicator"); }
2620++#line 2599 "parser.c"
2621++    break;
2622++
2623++  case 122: /* Element: SHAPE  */
2624++#line 610 "parser.y"
2625++                        { (yyval.atom) = xkb_atom_intern_literal(param->ctx, "shape"); }
2626++#line 2605 "parser.c"
2627++    break;
2628++
2629++  case 123: /* Element: ROW  */
2630++#line 612 "parser.y"
2631++                        { (yyval.atom) = xkb_atom_intern_literal(param->ctx, "row"); }
2632++#line 2611 "parser.c"
2633++    break;
2634++
2635++  case 124: /* Element: SECTION  */
2636++#line 614 "parser.y"
2637++                        { (yyval.atom) = xkb_atom_intern_literal(param->ctx, "section"); }
2638++#line 2617 "parser.c"
2639++    break;
2640++
2641++  case 125: /* Element: TEXT  */
2642++#line 616 "parser.y"
2643++                        { (yyval.atom) = xkb_atom_intern_literal(param->ctx, "text"); }
2644++#line 2623 "parser.c"
2645++    break;
2646++
2647++  case 126: /* OptMergeMode: MergeMode  */
2648++#line 619 "parser.y"
2649++                                        { (yyval.merge) = (yyvsp[0].merge); }
2650++#line 2629 "parser.c"
2651++    break;
2652++
2653++  case 127: /* OptMergeMode: %empty  */
2654++#line 620 "parser.y"
2655++                                        { (yyval.merge) = MERGE_DEFAULT; }
2656++#line 2635 "parser.c"
2657++    break;
2658++
2659++  case 128: /* MergeMode: INCLUDE  */
2660++#line 623 "parser.y"
2661++                                        { (yyval.merge) = MERGE_DEFAULT; }
2662++#line 2641 "parser.c"
2663++    break;
2664++
2665++  case 129: /* MergeMode: AUGMENT  */
2666++#line 624 "parser.y"
2667++                                        { (yyval.merge) = MERGE_AUGMENT; }
2668++#line 2647 "parser.c"
2669++    break;
2670++
2671++  case 130: /* MergeMode: OVERRIDE  */
2672++#line 625 "parser.y"
2673++                                        { (yyval.merge) = MERGE_OVERRIDE; }
2674++#line 2653 "parser.c"
2675++    break;
2676++
2677++  case 131: /* MergeMode: REPLACE  */
2678++#line 626 "parser.y"
2679++                                        { (yyval.merge) = MERGE_REPLACE; }
2680++#line 2659 "parser.c"
2681++    break;
2682++
2683++  case 132: /* MergeMode: ALTERNATE  */
2684++#line 628 "parser.y"
2685++                {
2686++                    /*
2687++                     * This used to be MERGE_ALT_FORM. This functionality was
2688++                     * unused and has been removed.
2689++                     */
2690++                    (yyval.merge) = MERGE_DEFAULT;
2691++                }
2692++#line 2671 "parser.c"
2693++    break;
2694++
2695++  case 133: /* OptExprList: ExprList  */
2696++#line 637 "parser.y"
2697++                                        { (yyval.exprList) = (yyvsp[0].exprList); }
2698++#line 2677 "parser.c"
2699++    break;
2700++
2701++  case 134: /* OptExprList: %empty  */
2702++#line 638 "parser.y"
2703++                                        { (yyval.exprList).head = (yyval.exprList).last = NULL; }
2704++#line 2683 "parser.c"
2705++    break;
2706++
2707++  case 135: /* ExprList: ExprList COMMA Expr  */
2708++#line 642 "parser.y"
2709++                        { (yyval.exprList).head = (yyvsp[-2].exprList).head; (yyval.exprList).last->common.next = &(yyvsp[0].expr)->common; (yyval.exprList).last = (yyvsp[0].expr); }
2710++#line 2689 "parser.c"
2711++    break;
2712++
2713++  case 136: /* ExprList: Expr  */
2714++#line 644 "parser.y"
2715++                        { (yyval.exprList).head = (yyval.exprList).last = (yyvsp[0].expr); }
2716++#line 2695 "parser.c"
2717++    break;
2718++
2719++  case 137: /* Expr: Expr DIVIDE Expr  */
2720++#line 648 "parser.y"
2721++                        { (yyval.expr) = ExprCreateBinary(EXPR_DIVIDE, (yyvsp[-2].expr), (yyvsp[0].expr)); }
2722++#line 2701 "parser.c"
2723++    break;
2724++
2725++  case 138: /* Expr: Expr PLUS Expr  */
2726++#line 650 "parser.y"
2727++                        { (yyval.expr) = ExprCreateBinary(EXPR_ADD, (yyvsp[-2].expr), (yyvsp[0].expr)); }
2728++#line 2707 "parser.c"
2729++    break;
2730++
2731++  case 139: /* Expr: Expr MINUS Expr  */
2732++#line 652 "parser.y"
2733++                        { (yyval.expr) = ExprCreateBinary(EXPR_SUBTRACT, (yyvsp[-2].expr), (yyvsp[0].expr)); }
2734++#line 2713 "parser.c"
2735++    break;
2736++
2737++  case 140: /* Expr: Expr TIMES Expr  */
2738++#line 654 "parser.y"
2739++                        { (yyval.expr) = ExprCreateBinary(EXPR_MULTIPLY, (yyvsp[-2].expr), (yyvsp[0].expr)); }
2740++#line 2719 "parser.c"
2741++    break;
2742++
2743++  case 141: /* Expr: Lhs EQUALS Expr  */
2744++#line 656 "parser.y"
2745++                        { (yyval.expr) = ExprCreateBinary(EXPR_ASSIGN, (yyvsp[-2].expr), (yyvsp[0].expr)); }
2746++#line 2725 "parser.c"
2747++    break;
2748++
2749++  case 142: /* Expr: Term  */
2750++#line 658 "parser.y"
2751++                        { (yyval.expr) = (yyvsp[0].expr); }
2752++#line 2731 "parser.c"
2753++    break;
2754++
2755++  case 143: /* Term: MINUS Term  */
2756++#line 662 "parser.y"
2757++                        { (yyval.expr) = ExprCreateUnary(EXPR_NEGATE, (yyvsp[0].expr)->expr.value_type, (yyvsp[0].expr)); }
2758++#line 2737 "parser.c"
2759++    break;
2760++
2761++  case 144: /* Term: PLUS Term  */
2762++#line 664 "parser.y"
2763++                        { (yyval.expr) = ExprCreateUnary(EXPR_UNARY_PLUS, (yyvsp[0].expr)->expr.value_type, (yyvsp[0].expr)); }
2764++#line 2743 "parser.c"
2765++    break;
2766++
2767++  case 145: /* Term: EXCLAM Term  */
2768++#line 666 "parser.y"
2769++                        { (yyval.expr) = ExprCreateUnary(EXPR_NOT, EXPR_TYPE_BOOLEAN, (yyvsp[0].expr)); }
2770++#line 2749 "parser.c"
2771++    break;
2772++
2773++  case 146: /* Term: INVERT Term  */
2774++#line 668 "parser.y"
2775++                        { (yyval.expr) = ExprCreateUnary(EXPR_INVERT, (yyvsp[0].expr)->expr.value_type, (yyvsp[0].expr)); }
2776++#line 2755 "parser.c"
2777++    break;
2778++
2779++  case 147: /* Term: Lhs  */
2780++#line 670 "parser.y"
2781++                        { (yyval.expr) = (yyvsp[0].expr);  }
2782++#line 2761 "parser.c"
2783++    break;
2784++
2785++  case 148: /* Term: FieldSpec OPAREN OptExprList CPAREN  */
2786++#line 672 "parser.y"
2787++                        { (yyval.expr) = ExprCreateAction((yyvsp[-3].atom), (yyvsp[-1].exprList).head); }
2788++#line 2767 "parser.c"
2789++    break;
2790++
2791++  case 149: /* Term: Terminal  */
2792++#line 674 "parser.y"
2793++                        { (yyval.expr) = (yyvsp[0].expr);  }
2794++#line 2773 "parser.c"
2795++    break;
2796++
2797++  case 150: /* Term: OPAREN Expr CPAREN  */
2798++#line 676 "parser.y"
2799++                        { (yyval.expr) = (yyvsp[-1].expr);  }
2800++#line 2779 "parser.c"
2801++    break;
2802++
2803++  case 151: /* ActionList: ActionList COMMA Action  */
2804++#line 680 "parser.y"
2805++                        { (yyval.exprList).head = (yyvsp[-2].exprList).head; (yyval.exprList).last->common.next = &(yyvsp[0].expr)->common; (yyval.exprList).last = (yyvsp[0].expr); }
2806++#line 2785 "parser.c"
2807++    break;
2808++
2809++  case 152: /* ActionList: Action  */
2810++#line 682 "parser.y"
2811++                        { (yyval.exprList).head = (yyval.exprList).last = (yyvsp[0].expr); }
2812++#line 2791 "parser.c"
2813++    break;
2814++
2815++  case 153: /* Action: FieldSpec OPAREN OptExprList CPAREN  */
2816++#line 686 "parser.y"
2817++                        { (yyval.expr) = ExprCreateAction((yyvsp[-3].atom), (yyvsp[-1].exprList).head); }
2818++#line 2797 "parser.c"
2819++    break;
2820++
2821++  case 154: /* Lhs: FieldSpec  */
2822++#line 690 "parser.y"
2823++                        { (yyval.expr) = ExprCreateIdent((yyvsp[0].atom)); }
2824++#line 2803 "parser.c"
2825++    break;
2826++
2827++  case 155: /* Lhs: FieldSpec DOT FieldSpec  */
2828++#line 692 "parser.y"
2829++                        { (yyval.expr) = ExprCreateFieldRef((yyvsp[-2].atom), (yyvsp[0].atom)); }
2830++#line 2809 "parser.c"
2831++    break;
2832++
2833++  case 156: /* Lhs: FieldSpec OBRACKET Expr CBRACKET  */
2834++#line 694 "parser.y"
2835++                        { (yyval.expr) = ExprCreateArrayRef(XKB_ATOM_NONE, (yyvsp[-3].atom), (yyvsp[-1].expr)); }
2836++#line 2815 "parser.c"
2837++    break;
2838++
2839++  case 157: /* Lhs: FieldSpec DOT FieldSpec OBRACKET Expr CBRACKET  */
2840++#line 696 "parser.y"
2841++                        { (yyval.expr) = ExprCreateArrayRef((yyvsp[-5].atom), (yyvsp[-3].atom), (yyvsp[-1].expr)); }
2842++#line 2821 "parser.c"
2843++    break;
2844++
2845++  case 158: /* Terminal: String  */
2846++#line 700 "parser.y"
2847++                        { (yyval.expr) = ExprCreateString((yyvsp[0].atom)); }
2848++#line 2827 "parser.c"
2849++    break;
2850++
2851++  case 159: /* Terminal: Integer  */
2852++#line 702 "parser.y"
2853++                        { (yyval.expr) = ExprCreateInteger((yyvsp[0].num)); }
2854++#line 2833 "parser.c"
2855++    break;
2856++
2857++  case 160: /* Terminal: Float  */
2858++#line 704 "parser.y"
2859++                        { (yyval.expr) = ExprCreateFloat(/* Discard $1 */); }
2860++#line 2839 "parser.c"
2861++    break;
2862++
2863++  case 161: /* Terminal: KEYNAME  */
2864++#line 706 "parser.y"
2865++                        { (yyval.expr) = ExprCreateKeyName((yyvsp[0].atom)); }
2866++#line 2845 "parser.c"
2867++    break;
2868++
2869++  case 162: /* OptKeySymList: KeySymList  */
2870++#line 709 "parser.y"
2871++                                        { (yyval.expr) = (yyvsp[0].expr); }
2872++#line 2851 "parser.c"
2873++    break;
2874++
2875++  case 163: /* OptKeySymList: %empty  */
2876++#line 710 "parser.y"
2877++                                        { (yyval.expr) = NULL; }
2878++#line 2857 "parser.c"
2879++    break;
2880++
2881++  case 164: /* KeySymList: KeySymList COMMA KeySym  */
2882++#line 714 "parser.y"
2883++                        { (yyval.expr) = ExprAppendKeysymList((yyvsp[-2].expr), (yyvsp[0].keysym)); }
2884++#line 2863 "parser.c"
2885++    break;
2886++
2887++  case 165: /* KeySymList: KeySymList COMMA KeySyms  */
2888++#line 716 "parser.y"
2889++                        { (yyval.expr) = ExprAppendMultiKeysymList((yyvsp[-2].expr), (yyvsp[0].expr)); }
2890++#line 2869 "parser.c"
2891++    break;
2892++
2893++  case 166: /* KeySymList: KeySym  */
2894++#line 718 "parser.y"
2895++                        { (yyval.expr) = ExprCreateKeysymList((yyvsp[0].keysym)); }
2896++#line 2875 "parser.c"
2897++    break;
2898++
2899++  case 167: /* KeySymList: KeySyms  */
2900++#line 720 "parser.y"
2901++                        { (yyval.expr) = ExprCreateMultiKeysymList((yyvsp[0].expr)); }
2902++#line 2881 "parser.c"
2903++    break;
2904++
2905++  case 168: /* KeySyms: OBRACE KeySymList CBRACE  */
2906++#line 724 "parser.y"
2907++                        { (yyval.expr) = (yyvsp[-1].expr); }
2908++#line 2887 "parser.c"
2909++    break;
2910++
2911++  case 169: /* KeySym: IDENT  */
2912++#line 728 "parser.y"
2913++                        {
2914++                            if (!resolve_keysym((yyvsp[0].str), &(yyval.keysym))) {
2915++                                parser_warn(param, "unrecognized keysym \"%s\"", (yyvsp[0].str));
2916++                                (yyval.keysym) = XKB_KEY_NoSymbol;
2917++                            }
2918++                            free((yyvsp[0].str));
2919++                        }
2920++#line 2899 "parser.c"
2921++    break;
2922++
2923++  case 170: /* KeySym: SECTION  */
2924++#line 735 "parser.y"
2925++                                { (yyval.keysym) = XKB_KEY_section; }
2926++#line 2905 "parser.c"
2927++    break;
2928++
2929++  case 171: /* KeySym: Integer  */
2930++#line 737 "parser.y"
2931++                        {
2932++                            if ((yyvsp[0].num) < 0) {
2933++                                parser_warn(param, "unrecognized keysym \"%"PRId64"\"", (yyvsp[0].num));
2934++                                (yyval.keysym) = XKB_KEY_NoSymbol;
2935++                            }
2936++                            else if ((yyvsp[0].num) < 10) {      /* XKB_KEY_0 .. XKB_KEY_9 */
2937++                                (yyval.keysym) = XKB_KEY_0 + (xkb_keysym_t) (yyvsp[0].num);
2938++                            }
2939++                            else {
2940++                                char buf[32];
2941++                                snprintf(buf, sizeof(buf), "0x%"PRIx64, (yyvsp[0].num));
2942++                                if (!resolve_keysym(buf, &(yyval.keysym))) {
2943++                                    parser_warn(param, "unrecognized keysym \"%s\"", buf);
2944++                                    (yyval.keysym) = XKB_KEY_NoSymbol;
2945++                                }
2946++                            }
2947++                        }
2948++#line 2927 "parser.c"
2949++    break;
2950++
2951++  case 172: /* SignedNumber: MINUS Number  */
2952++#line 756 "parser.y"
2953++                                        { (yyval.num) = -(yyvsp[0].num); }
2954++#line 2933 "parser.c"
2955++    break;
2956++
2957++  case 173: /* SignedNumber: Number  */
2958++#line 757 "parser.y"
2959++                                        { (yyval.num) = (yyvsp[0].num); }
2960++#line 2939 "parser.c"
2961++    break;
2962++
2963++  case 174: /* Number: FLOAT  */
2964++#line 760 "parser.y"
2965++                                { (yyval.num) = (yyvsp[0].num); }
2966++#line 2945 "parser.c"
2967++    break;
2968++
2969++  case 175: /* Number: INTEGER  */
2970++#line 761 "parser.y"
2971++                                { (yyval.num) = (yyvsp[0].num); }
2972++#line 2951 "parser.c"
2973++    break;
2974++
2975++  case 176: /* Float: FLOAT  */
2976++#line 764 "parser.y"
2977++                                { (yyval.num) = 0; }
2978++#line 2957 "parser.c"
2979++    break;
2980++
2981++  case 177: /* Integer: INTEGER  */
2982++#line 767 "parser.y"
2983++                                { (yyval.num) = (yyvsp[0].num); }
2984++#line 2963 "parser.c"
2985++    break;
2986++
2987++  case 178: /* KeyCode: INTEGER  */
2988++#line 770 "parser.y"
2989++                                { (yyval.num) = (yyvsp[0].num); }
2990++#line 2969 "parser.c"
2991++    break;
2992++
2993++  case 179: /* Ident: IDENT  */
2994++#line 773 "parser.y"
2995++                                { (yyval.atom) = xkb_atom_intern(param->ctx, (yyvsp[0].str), strlen((yyvsp[0].str))); free((yyvsp[0].str)); }
2996++#line 2975 "parser.c"
2997++    break;
2998++
2999++  case 180: /* Ident: DEFAULT  */
3000++#line 774 "parser.y"
3001++                                { (yyval.atom) = xkb_atom_intern_literal(param->ctx, "default"); }
3002++#line 2981 "parser.c"
3003++    break;
3004++
3005++  case 181: /* String: STRING  */
3006++#line 777 "parser.y"
3007++                                { (yyval.atom) = xkb_atom_intern(param->ctx, (yyvsp[0].str), strlen((yyvsp[0].str))); free((yyvsp[0].str)); }
3008++#line 2987 "parser.c"
3009++    break;
3010++
3011++  case 182: /* OptMapName: MapName  */
3012++#line 780 "parser.y"
3013++                                { (yyval.str) = (yyvsp[0].str); }
3014++#line 2993 "parser.c"
3015++    break;
3016++
3017++  case 183: /* OptMapName: %empty  */
3018++#line 781 "parser.y"
3019++                                { (yyval.str) = NULL; }
3020++#line 2999 "parser.c"
3021++    break;
3022++
3023++  case 184: /* MapName: STRING  */
3024++#line 784 "parser.y"
3025++                                { (yyval.str) = (yyvsp[0].str); }
3026++#line 3005 "parser.c"
3027++    break;
3028++
3029++
3030++#line 3009 "parser.c"
3031++
3032++      default: break;
3033++    }
3034++  /* User semantic actions sometimes alter yychar, and that requires
3035++     that yytoken be updated with the new translation.  We take the
3036++     approach of translating immediately before every use of yytoken.
3037++     One alternative is translating here after every semantic action,
3038++     but that translation would be missed if the semantic action invokes
3039++     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3040++     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
3041++     incorrect destructor might then be invoked immediately.  In the
3042++     case of YYERROR or YYBACKUP, subsequent parser actions might lead
3043++     to an incorrect destructor call or verbose syntax error message
3044++     before the lookahead is translated.  */
3045++  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
3046++
3047++  YYPOPSTACK (yylen);
3048++  yylen = 0;
3049++
3050++  *++yyvsp = yyval;
3051++
3052++  /* Now 'shift' the result of the reduction.  Determine what state
3053++     that goes to, based on the state we popped back to and the rule
3054++     number reduced by.  */
3055++  {
3056++    const int yylhs = yyr1[yyn] - YYNTOKENS;
3057++    const int yyi = yypgoto[yylhs] + *yyssp;
3058++    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
3059++               ? yytable[yyi]
3060++               : yydefgoto[yylhs]);
3061++  }
3062++
3063++  goto yynewstate;
3064++
3065++
3066++/*--------------------------------------.
3067++| yyerrlab -- here on detecting error.  |
3068++`--------------------------------------*/
3069++yyerrlab:
3070++  /* Make sure we have latest lookahead translation.  See comments at
3071++     user semantic actions for why this is necessary.  */
3072++  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
3073++  /* If not already recovering from an error, report this error.  */
3074++  if (!yyerrstatus)
3075++    {
3076++      ++yynerrs;
3077++      yyerror (param, YY_("syntax error"));
3078++    }
3079++
3080++  if (yyerrstatus == 3)
3081++    {
3082++      /* If just tried and failed to reuse lookahead token after an
3083++         error, discard it.  */
3084++
3085++      if (yychar <= END_OF_FILE)
3086++        {
3087++          /* Return failure if at end of input.  */
3088++          if (yychar == END_OF_FILE)
3089++            YYABORT;
3090++        }
3091++      else
3092++        {
3093++          yydestruct ("Error: discarding",
3094++                      yytoken, &yylval, param);
3095++          yychar = YYEMPTY;
3096++        }
3097++    }
3098++
3099++  /* Else will try to reuse lookahead token after shifting the error
3100++     token.  */
3101++  goto yyerrlab1;
3102++
3103++
3104++/*---------------------------------------------------.
3105++| yyerrorlab -- error raised explicitly by YYERROR.  |
3106++`---------------------------------------------------*/
3107++yyerrorlab:
3108++  /* Pacify compilers when the user code never invokes YYERROR and the
3109++     label yyerrorlab therefore never appears in user code.  */
3110++  if (0)
3111++    YYERROR;
3112++  ++yynerrs;
3113++
3114++  /* Do not reclaim the symbols of the rule whose action triggered
3115++     this YYERROR.  */
3116++  YYPOPSTACK (yylen);
3117++  yylen = 0;
3118++  YY_STACK_PRINT (yyss, yyssp);
3119++  yystate = *yyssp;
3120++  goto yyerrlab1;
3121++
3122++
3123++/*-------------------------------------------------------------.
3124++| yyerrlab1 -- common code for both syntax error and YYERROR.  |
3125++`-------------------------------------------------------------*/
3126++yyerrlab1:
3127++  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
3128++
3129++  /* Pop stack until we find a state that shifts the error token.  */
3130++  for (;;)
3131++    {
3132++      yyn = yypact[yystate];
3133++      if (!yypact_value_is_default (yyn))
3134++        {
3135++          yyn += YYSYMBOL_YYerror;
3136++          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
3137++            {
3138++              yyn = yytable[yyn];
3139++              if (0 < yyn)
3140++                break;
3141++            }
3142++        }
3143++
3144++      /* Pop the current state because it cannot handle the error token.  */
3145++      if (yyssp == yyss)
3146++        YYABORT;
3147++
3148++
3149++      yydestruct ("Error: popping",
3150++                  YY_ACCESSING_SYMBOL (yystate), yyvsp, param);
3151++      YYPOPSTACK (1);
3152++      yystate = *yyssp;
3153++      YY_STACK_PRINT (yyss, yyssp);
3154++    }
3155++
3156++  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3157++  *++yyvsp = yylval;
3158++  YY_IGNORE_MAYBE_UNINITIALIZED_END
3159++
3160++
3161++  /* Shift the error token.  */
3162++  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
3163++
3164++  yystate = yyn;
3165++  goto yynewstate;
3166++
3167++
3168++/*-------------------------------------.
3169++| yyacceptlab -- YYACCEPT comes here.  |
3170++`-------------------------------------*/
3171++yyacceptlab:
3172++  yyresult = 0;
3173++  goto yyreturnlab;
3174++
3175++
3176++/*-----------------------------------.
3177++| yyabortlab -- YYABORT comes here.  |
3178++`-----------------------------------*/
3179++yyabortlab:
3180++  yyresult = 1;
3181++  goto yyreturnlab;
3182++
3183++
3184++/*-----------------------------------------------------------.
3185++| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
3186++`-----------------------------------------------------------*/
3187++yyexhaustedlab:
3188++  yyerror (param, YY_("memory exhausted"));
3189++  yyresult = 2;
3190++  goto yyreturnlab;
3191++
3192++
3193++/*----------------------------------------------------------.
3194++| yyreturnlab -- parsing is finished, clean up and return.  |
3195++`----------------------------------------------------------*/
3196++yyreturnlab:
3197++  if (yychar != YYEMPTY)
3198++    {
3199++      /* Make sure we have latest lookahead translation.  See comments at
3200++         user semantic actions for why this is necessary.  */
3201++      yytoken = YYTRANSLATE (yychar);
3202++      yydestruct ("Cleanup: discarding lookahead",
3203++                  yytoken, &yylval, param);
3204++    }
3205++  /* Do not reclaim the symbols of the rule whose action triggered
3206++     this YYABORT or YYACCEPT.  */
3207++  YYPOPSTACK (yylen);
3208++  YY_STACK_PRINT (yyss, yyssp);
3209++  while (yyssp != yyss)
3210++    {
3211++      yydestruct ("Cleanup: popping",
3212++                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, param);
3213++      YYPOPSTACK (1);
3214++    }
3215++#ifndef yyoverflow
3216++  if (yyss != yyssa)
3217++    YYSTACK_FREE (yyss);
3218++#endif
3219++
3220++  return yyresult;
3221++}
3222++
3223++#line 787 "parser.y"
3224++
3225++
3226++XkbFile *
3227++parse(struct xkb_context *ctx, struct scanner *scanner, const char *map)
3228++{
3229++    int ret;
3230++    XkbFile *first = NULL;
3231++    struct parser_param param = {
3232++        .scanner = scanner,
3233++        .ctx = ctx,
3234++        .rtrn = NULL,
3235++        .more_maps = false,
3236++    };
3237++
3238++    /*
3239++     * If we got a specific map, we look for it exclusively and return
3240++     * immediately upon finding it. Otherwise, we need to get the
3241++     * default map. If we find a map marked as default, we return it
3242++     * immediately. If there are no maps marked as default, we return
3243++     * the first map in the file.
3244++     */
3245++
3246++    while ((ret = yyparse(&param)) == 0 && param.more_maps) {
3247++        if (map) {
3248++            if (streq_not_null(map, param.rtrn->name))
3249++                return param.rtrn;
3250++            else
3251++                FreeXkbFile(param.rtrn);
3252++        }
3253++        else {
3254++            if (param.rtrn->flags & MAP_IS_DEFAULT) {
3255++                FreeXkbFile(first);
3256++                return param.rtrn;
3257++            }
3258++            else if (!first) {
3259++                first = param.rtrn;
3260++            }
3261++            else {
3262++                FreeXkbFile(param.rtrn);
3263++            }
3264++        }
3265++        param.rtrn = NULL;
3266++    }
3267++
3268++    if (ret != 0) {
3269++        FreeXkbFile(first);
3270++        return NULL;
3271++    }
3272++
3273++    if (first)
3274++        log_vrb(ctx, 5,
3275++                "No map in include statement, but \"%s\" contains several; "
3276++                "Using first defined map, \"%s\"\n",
3277++                scanner->file_name, first->name);
3278++
3279++    return first;
3280++}
3281+diff --git a/src/xkbcomp/parser.h b/src/xkbcomp/parser.h
3282+new file mode 100644
3283+index 0000000..f788bdc
3284+--- /dev/null
3285++++ b/src/xkbcomp/parser.h
3286+@@ -0,0 +1,171 @@
3287++/* A Bison parser, made by GNU Bison 3.8.2.  */
3288++
3289++/* Bison interface for Yacc-like parsers in C
3290++
3291++   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
3292++   Inc.
3293++
3294++   This program is free software: you can redistribute it and/or modify
3295++   it under the terms of the GNU General Public License as published by
3296++   the Free Software Foundation, either version 3 of the License, or
3297++   (at your option) any later version.
3298++
3299++   This program is distributed in the hope that it will be useful,
3300++   but WITHOUT ANY WARRANTY; without even the implied warranty of
3301++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3302++   GNU General Public License for more details.
3303++
3304++   You should have received a copy of the GNU General Public License
3305++   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
3306++
3307++/* As a special exception, you may create a larger work that contains
3308++   part or all of the Bison parser skeleton and distribute that work
3309++   under terms of your choice, so long as that work isn't itself a
3310++   parser generator using the skeleton or a modified version thereof
3311++   as a parser skeleton.  Alternatively, if you modify or redistribute
3312++   the parser skeleton itself, you may (at your option) remove this
3313++   special exception, which will cause the skeleton and the resulting
3314++   Bison output files to be licensed under the GNU General Public
3315++   License without this special exception.
3316++
3317++   This special exception was added by the Free Software Foundation in
3318++   version 2.2 of Bison.  */
3319++
3320++/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
3321++   especially those whose name start with YY_ or yy_.  They are
3322++   private implementation details that can be changed or removed.  */
3323++
3324++#ifndef YY__XKBCOMMON_PARSER_H_INCLUDED
3325++# define YY__XKBCOMMON_PARSER_H_INCLUDED
3326++/* Debug traces.  */
3327++#ifndef YYDEBUG
3328++# define YYDEBUG 0
3329++#endif
3330++#if YYDEBUG
3331++extern int _xkbcommon_debug;
3332++#endif
3333++
3334++/* Token kinds.  */
3335++#ifndef YYTOKENTYPE
3336++# define YYTOKENTYPE
3337++  enum yytokentype
3338++  {
3339++    YYEMPTY = -2,
3340++    END_OF_FILE = 0,               /* END_OF_FILE  */
3341++    YYerror = 256,                 /* error  */
3342++    YYUNDEF = 257,                 /* "invalid token"  */
3343++    ERROR_TOK = 255,               /* ERROR_TOK  */
3344++    XKB_KEYMAP = 1,                /* XKB_KEYMAP  */
3345++    XKB_KEYCODES = 2,              /* XKB_KEYCODES  */
3346++    XKB_TYPES = 3,                 /* XKB_TYPES  */
3347++    XKB_SYMBOLS = 4,               /* XKB_SYMBOLS  */
3348++    XKB_COMPATMAP = 5,             /* XKB_COMPATMAP  */
3349++    XKB_GEOMETRY = 6,              /* XKB_GEOMETRY  */
3350++    XKB_SEMANTICS = 7,             /* XKB_SEMANTICS  */
3351++    XKB_LAYOUT = 8,                /* XKB_LAYOUT  */
3352++    INCLUDE = 10,                  /* INCLUDE  */
3353++    OVERRIDE = 11,                 /* OVERRIDE  */
3354++    AUGMENT = 12,                  /* AUGMENT  */
3355++    REPLACE = 13,                  /* REPLACE  */
3356++    ALTERNATE = 14,                /* ALTERNATE  */
3357++    VIRTUAL_MODS = 20,             /* VIRTUAL_MODS  */
3358++    TYPE = 21,                     /* TYPE  */
3359++    INTERPRET = 22,                /* INTERPRET  */
3360++    ACTION_TOK = 23,               /* ACTION_TOK  */
3361++    KEY = 24,                      /* KEY  */
3362++    ALIAS = 25,                    /* ALIAS  */
3363++    GROUP = 26,                    /* GROUP  */
3364++    MODIFIER_MAP = 27,             /* MODIFIER_MAP  */
3365++    INDICATOR = 28,                /* INDICATOR  */
3366++    SHAPE = 29,                    /* SHAPE  */
3367++    KEYS = 30,                     /* KEYS  */
3368++    ROW = 31,                      /* ROW  */
3369++    SECTION = 32,                  /* SECTION  */
3370++    OVERLAY = 33,                  /* OVERLAY  */
3371++    TEXT = 34,                     /* TEXT  */
3372++    OUTLINE = 35,                  /* OUTLINE  */
3373++    SOLID = 36,                    /* SOLID  */
3374++    LOGO = 37,                     /* LOGO  */
3375++    VIRTUAL = 38,                  /* VIRTUAL  */
3376++    EQUALS = 40,                   /* EQUALS  */
3377++    PLUS = 41,                     /* PLUS  */
3378++    MINUS = 42,                    /* MINUS  */
3379++    DIVIDE = 43,                   /* DIVIDE  */
3380++    TIMES = 44,                    /* TIMES  */
3381++    OBRACE = 45,                   /* OBRACE  */
3382++    CBRACE = 46,                   /* CBRACE  */
3383++    OPAREN = 47,                   /* OPAREN  */
3384++    CPAREN = 48,                   /* CPAREN  */
3385++    OBRACKET = 49,                 /* OBRACKET  */
3386++    CBRACKET = 50,                 /* CBRACKET  */
3387++    DOT = 51,                      /* DOT  */
3388++    COMMA = 52,                    /* COMMA  */
3389++    SEMI = 53,                     /* SEMI  */
3390++    EXCLAM = 54,                   /* EXCLAM  */
3391++    INVERT = 55,                   /* INVERT  */
3392++    STRING = 60,                   /* STRING  */
3393++    INTEGER = 61,                  /* INTEGER  */
3394++    FLOAT = 62,                    /* FLOAT  */
3395++    IDENT = 63,                    /* IDENT  */
3396++    KEYNAME = 64,                  /* KEYNAME  */
3397++    PARTIAL = 70,                  /* PARTIAL  */
3398++    DEFAULT = 71,                  /* DEFAULT  */
3399++    HIDDEN = 72,                   /* HIDDEN  */
3400++    ALPHANUMERIC_KEYS = 73,        /* ALPHANUMERIC_KEYS  */
3401++    MODIFIER_KEYS = 74,            /* MODIFIER_KEYS  */
3402++    KEYPAD_KEYS = 75,              /* KEYPAD_KEYS  */
3403++    FUNCTION_KEYS = 76,            /* FUNCTION_KEYS  */
3404++    ALTERNATE_GROUP = 77           /* ALTERNATE_GROUP  */
3405++  };
3406++  typedef enum yytokentype yytoken_kind_t;
3407++#endif
3408++
3409++/* Value type.  */
3410++#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
3411++union YYSTYPE
3412++{
3413++#line 164 "parser.y"
3414++
3415++        int64_t          num;
3416++        enum xkb_file_type file_type;
3417++        char            *str;
3418++        xkb_atom_t      atom;
3419++        enum merge_mode merge;
3420++        enum xkb_map_flags mapFlags;
3421++        xkb_keysym_t    keysym;
3422++        ParseCommon     *any;
3423++        struct { ParseCommon *head; ParseCommon *last; } anyList;
3424++        ExprDef         *expr;
3425++        struct { ExprDef *head; ExprDef *last; } exprList;
3426++        VarDef          *var;
3427++        struct { VarDef *head; VarDef *last; } varList;
3428++        VModDef         *vmod;
3429++        struct { VModDef *head; VModDef *last; } vmodList;
3430++        InterpDef       *interp;
3431++        KeyTypeDef      *keyType;
3432++        SymbolsDef      *syms;
3433++        ModMapDef       *modMask;
3434++        GroupCompatDef  *groupCompat;
3435++        LedMapDef       *ledMap;
3436++        LedNameDef      *ledName;
3437++        KeycodeDef      *keyCode;
3438++        KeyAliasDef     *keyAlias;
3439++        void            *geom;
3440++        XkbFile         *file;
3441++        struct { XkbFile *head; XkbFile *last; } fileList;
3442++
3443++#line 158 "parser.h"
3444++
3445++};
3446++typedef union YYSTYPE YYSTYPE;
3447++# define YYSTYPE_IS_TRIVIAL 1
3448++# define YYSTYPE_IS_DECLARED 1
3449++#endif
3450++
3451++
3452++
3453++
3454++int _xkbcommon_parse (struct parser_param *param);
3455++
3456++
3457++#endif /* !YY__XKBCOMMON_PARSER_H_INCLUDED  */
3458+-- 
3459+2.34.0
3460+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 88222c8d40543c29af781f7d7e25d202ff40e4b7
+1, -0
1@@ -0,0 +1 @@
2+1.3.1 r0
+22, -0
 1@@ -0,0 +1,22 @@
 2+cflags{
 3+	'-I $srcdir/include',
 4+	'-isystem $builddir/pkg/linux-headers/include',
 5+}
 6+
 7+pkg.hdrs = copy('$outdir/include', '$srcdir/include', {
 8+	'mtdev.h',
 9+	'mtdev-plumbing.h',
10+})
11+pkg.deps = {
12+	'pkg/linux-headers/headers',
13+}
14+
15+lib('libmtdev.a', {
16+	'src/caps.c',
17+	'src/core.c',
18+	'src/iobuf.c',
19+	'src/match.c',
20+	'src/match_four.c',
21+})
22+
23+fetch 'git'
+44, -0
 1@@ -0,0 +1,44 @@
 2+From 09e21bb5d6714687705dc8f2d00a09b3ff3b2436 Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Fri, 7 Jun 2019 11:55:26 -0700
 5+Subject: [PATCH] Avoid __builtin_ffs
 6+
 7+---
 8+ src/common.h | 5 +----
 9+ src/core.c   | 2 +-
10+ 2 files changed, 2 insertions(+), 5 deletions(-)
11+
12+diff --git a/src/common.h b/src/common.h
13+index 80a3d6e..3c77f48 100644
14+--- a/src/common.h
15++++ b/src/common.h
16+@@ -77,12 +77,9 @@ static inline int bitcount(unsigned v)
17+ 	return (((v + (v>>4)) & 0xF0F0F0F) * 0x1010101) >> 24;
18+ }
19+ 
20+-/* Return index of first bit [0-31], -1 on zero */
21+-#define firstbit(v) (__builtin_ffs(v) - 1)
22+-
23+ /* boost-style foreach bit */
24+ #define foreach_bit(i, m)						\
25+-	for (i = firstbit(m); i >= 0; i = firstbit((m) & (~0U << (i + 1))))
26++	for (i = -1; (m) & ~0U << (i + 1);) if ((m) & 1U << ++i)
27+ 
28+ /* robust system ioctl calls */
29+ #define SYSCALL(call) while (((call) == -1) && (errno == EINTR))
30+diff --git a/src/core.c b/src/core.c
31+index 0d91c0b..20ce0c6 100644
32+--- a/src/core.c
33++++ b/src/core.c
34+@@ -304,7 +304,7 @@ static void apply_typeA_changes(struct mtdev_state *state,
35+ 			break;
36+ 		}
37+ 		if (id != MT_ID_NULL) {
38+-			slot = firstbit(unused);
39++			foreach_bit(slot, unused) break;
40+ 			push_slot_changes(state, &data[i], prop[i], slot, syn);
41+ 			SETBIT(used, slot);
42+ 			CLEARBIT(unused, slot);
43+-- 
44+2.25.0
45+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 25d541d2b0b526eba58fee99ceac202acca6d4a2
+1, -0
1@@ -0,0 +1 @@
2+1.1.6 r0
+1, -0
1@@ -0,0 +1 @@
2+/tools.ninja
+149, -0
  1@@ -0,0 +1,149 @@
  2+# 2,<cd src/resources/fonts && ls noto/*.otf noto/*.ttf urw/*.cff
  3+noto/NotoEmoji-Regular.ttf
  4+noto/NotoKufiArabic-Regular.ttf
  5+noto/NotoMusic-Regular.otf
  6+noto/NotoNaskhArabic-Regular.ttf
  7+noto/NotoNastaliqUrdu-Regular.otf
  8+noto/NotoSans-Regular.otf
  9+noto/NotoSansAdlam-Regular.otf
 10+noto/NotoSansAnatolianHieroglyphs-Regular.otf
 11+noto/NotoSansArabic-Regular.otf
 12+noto/NotoSansAvestan-Regular.otf
 13+noto/NotoSansBamum-Regular.otf
 14+noto/NotoSansBassaVah-Regular.otf
 15+noto/NotoSansBatak-Regular.otf
 16+noto/NotoSansBhaiksuki-Regular.otf
 17+noto/NotoSansBrahmi-Regular.otf
 18+noto/NotoSansBuginese-Regular.otf
 19+noto/NotoSansBuhid-Regular.otf
 20+noto/NotoSansCanadianAboriginal-Regular.otf
 21+noto/NotoSansCarian-Regular.otf
 22+noto/NotoSansCaucasianAlbanian-Regular.otf
 23+noto/NotoSansChakma-Regular.otf
 24+noto/NotoSansCham-Regular.otf
 25+noto/NotoSansCherokee-Regular.otf
 26+noto/NotoSansCoptic-Regular.otf
 27+noto/NotoSansCuneiform-Regular.otf
 28+noto/NotoSansCypriot-Regular.otf
 29+noto/NotoSansDeseret-Regular.otf
 30+noto/NotoSansDuployan-Regular.otf
 31+noto/NotoSansEgyptianHieroglyphs-Regular.otf
 32+noto/NotoSansElbasan-Regular.otf
 33+noto/NotoSansGlagolitic-Regular.otf
 34+noto/NotoSansGothic-Regular.otf
 35+noto/NotoSansGrantha-Regular.otf
 36+noto/NotoSansHanunoo-Regular.otf
 37+noto/NotoSansHatran-Regular.otf
 38+noto/NotoSansImperialAramaic-Regular.otf
 39+noto/NotoSansInscriptionalPahlavi-Regular.otf
 40+noto/NotoSansInscriptionalParthian-Regular.otf
 41+noto/NotoSansJavanese-Regular.otf
 42+noto/NotoSansKaithi-Regular.otf
 43+noto/NotoSansKayahLi-Regular.otf
 44+noto/NotoSansKharoshthi-Regular.otf
 45+noto/NotoSansKhojki-Regular.otf
 46+noto/NotoSansKhudawadi-Regular.otf
 47+noto/NotoSansLepcha-Regular.otf
 48+noto/NotoSansLimbu-Regular.otf
 49+noto/NotoSansLinearA-Regular.otf
 50+noto/NotoSansLinearB-Regular.otf
 51+noto/NotoSansLisu-Regular.otf
 52+noto/NotoSansLycian-Regular.otf
 53+noto/NotoSansLydian-Regular.otf
 54+noto/NotoSansMahajani-Regular.otf
 55+noto/NotoSansMandaic-Regular.otf
 56+noto/NotoSansManichaean-Regular.otf
 57+noto/NotoSansMarchen-Regular.otf
 58+noto/NotoSansMath-Regular.otf
 59+noto/NotoSansMeeteiMayek-Regular.otf
 60+noto/NotoSansMendeKikakui-Regular.otf
 61+noto/NotoSansMeroitic-Regular.otf
 62+noto/NotoSansMiao-Regular.otf
 63+noto/NotoSansModi-Regular.otf
 64+noto/NotoSansMongolian-Regular.otf
 65+noto/NotoSansMro-Regular.otf
 66+noto/NotoSansMultani-Regular.otf
 67+noto/NotoSansNKo-Regular.otf
 68+noto/NotoSansNabataean-Regular.otf
 69+noto/NotoSansNewTaiLue-Regular.otf
 70+noto/NotoSansNewa-Regular.otf
 71+noto/NotoSansOgham-Regular.otf
 72+noto/NotoSansOlChiki-Regular.otf
 73+noto/NotoSansOldHungarian-Regular.otf
 74+noto/NotoSansOldItalic-Regular.otf
 75+noto/NotoSansOldNorthArabian-Regular.otf
 76+noto/NotoSansOldPermic-Regular.otf
 77+noto/NotoSansOldPersian-Regular.otf
 78+noto/NotoSansOldSouthArabian-Regular.otf
 79+noto/NotoSansOldTurkic-Regular.otf
 80+noto/NotoSansOriya-Regular.ttf
 81+noto/NotoSansOsage-Regular.otf
 82+noto/NotoSansOsmanya-Regular.otf
 83+noto/NotoSansPahawhHmong-Regular.otf
 84+noto/NotoSansPalmyrene-Regular.otf
 85+noto/NotoSansPauCinHau-Regular.otf
 86+noto/NotoSansPhagsPa-Regular.otf
 87+noto/NotoSansPhoenician-Regular.otf
 88+noto/NotoSansPsalterPahlavi-Regular.otf
 89+noto/NotoSansRejang-Regular.otf
 90+noto/NotoSansRunic-Regular.otf
 91+noto/NotoSansSamaritan-Regular.otf
 92+noto/NotoSansSaurashtra-Regular.otf
 93+noto/NotoSansSharada-Regular.otf
 94+noto/NotoSansShavian-Regular.otf
 95+noto/NotoSansSiddham-Regular.otf
 96+noto/NotoSansSoraSompeng-Regular.otf
 97+noto/NotoSansSundanese-Regular.otf
 98+noto/NotoSansSylotiNagri-Regular.otf
 99+noto/NotoSansSymbols-Regular.otf
100+noto/NotoSansSymbols2-Regular.otf
101+noto/NotoSansSyriac-Regular.otf
102+noto/NotoSansTagalog-Regular.otf
103+noto/NotoSansTagbanwa-Regular.otf
104+noto/NotoSansTaiLe-Regular.otf
105+noto/NotoSansTaiTham-Regular.ttf
106+noto/NotoSansTaiViet-Regular.otf
107+noto/NotoSansTakri-Regular.otf
108+noto/NotoSansThaana-Regular.otf
109+noto/NotoSansTifinagh-Regular.otf
110+noto/NotoSansTirhuta-Regular.otf
111+noto/NotoSansUgaritic-Regular.otf
112+noto/NotoSansVai-Regular.otf
113+noto/NotoSansWarangCiti-Regular.otf
114+noto/NotoSansYi-Regular.otf
115+noto/NotoSerif-Regular.otf
116+noto/NotoSerifAhom-Regular.otf
117+noto/NotoSerifArmenian-Regular.otf
118+noto/NotoSerifBalinese-Regular.otf
119+noto/NotoSerifBengali-Regular.ttf
120+noto/NotoSerifDevanagari-Regular.ttf
121+noto/NotoSerifEthiopic-Regular.otf
122+noto/NotoSerifGeorgian-Regular.otf
123+noto/NotoSerifGujarati-Regular.otf
124+noto/NotoSerifGurmukhi-Regular.otf
125+noto/NotoSerifHebrew-Regular.otf
126+noto/NotoSerifKannada-Regular.otf
127+noto/NotoSerifKhmer-Regular.otf
128+noto/NotoSerifLao-Regular.otf
129+noto/NotoSerifMalayalam-Regular.ttf
130+noto/NotoSerifMyanmar-Regular.otf
131+noto/NotoSerifSinhala-Regular.otf
132+noto/NotoSerifTamil-Regular.otf
133+noto/NotoSerifTangut-Regular.otf
134+noto/NotoSerifTelugu-Regular.ttf
135+noto/NotoSerifThai-Regular.otf
136+noto/NotoSerifTibetan-Regular.otf
137+urw/Dingbats.cff
138+urw/NimbusMonoPS-Bold.cff
139+urw/NimbusMonoPS-BoldItalic.cff
140+urw/NimbusMonoPS-Italic.cff
141+urw/NimbusMonoPS-Regular.cff
142+urw/NimbusRoman-Bold.cff
143+urw/NimbusRoman-BoldItalic.cff
144+urw/NimbusRoman-Italic.cff
145+urw/NimbusRoman-Regular.cff
146+urw/NimbusSans-Bold.cff
147+urw/NimbusSans-BoldItalic.cff
148+urw/NimbusSans-Italic.cff
149+urw/NimbusSans-Regular.cff
150+urw/StandardSymbolsPS.cff
+102, -0
  1@@ -0,0 +1,102 @@
  2+cflags{
  3+	'-D NDEBUG',
  4+	'-Wall', '-Wno-maybe-uninitialized', '-Wno-stringop-overflow', '-Wno-format-overflow',
  5+	'-D FZ_ENABLE_JS=0',
  6+	-- HTML and EPUB require harfbuzz
  7+	'-D FZ_ENABLE_HTML=0',
  8+	'-D FZ_ENABLE_EPUB=0',
  9+	-- ICS requires lcms2
 10+	'-D FZ_ENABLE_ICC=0',
 11+	-- JPX requires openjpeg
 12+	'-D FZ_ENABLE_JPX=0',
 13+	'-D HAVE_PTHREAD',
 14+	'-D NOTO_SMALL',
 15+	'-D NO_CJK',
 16+	'-D NO_ICC',
 17+	'-D SHARE_JPEG',
 18+	'-I $srcdir/include',
 19+	'-I $outdir',
 20+	'-isystem $builddir/pkg/freetype/include',
 21+	'-isystem $builddir/pkg/jbig2dec/include',
 22+	'-isystem $builddir/pkg/libjpeg-turbo/include',
 23+	'-isystem $builddir/pkg/zlib/include',
 24+}
 25+
 26+sub('tools.ninja', function()
 27+	toolchain(config.host)
 28+	cflags{'-Wall'}
 29+	exe('hexdump', {'scripts/hexdump.c'})
 30+end)
 31+
 32+rule('hexdump', '$outdir/hexdump -s $out $in')
 33+local fonts = lines('fonts.txt')
 34+for _, font in ipairs(fonts) do
 35+	build('hexdump', '$outdir/'..font..'.c', {'$srcdir/resources/fonts/'..font, '|', '$outdir/hexdump'})
 36+end
 37+
 38+pkg.deps = {
 39+	'pkg/freetype/headers',
 40+	'pkg/jbig2dec/headers',
 41+	'pkg/libjpeg-turbo/headers',
 42+	'pkg/zlib/headers',
 43+}
 44+
 45+lib('libmupdf.a', {
 46+	expand{'source/', lines('sources.txt')},
 47+	expand{'$outdir/', fonts, '.c'},
 48+	'$builddir/pkg/freetype/libfreetype.a.d',
 49+	'$builddir/pkg/jbig2dec/libjbig2dec.a',
 50+	'$builddir/pkg/libjpeg-turbo/libjpeg-turbo.a',
 51+	'$builddir/pkg/zlib/libz.a',
 52+})
 53+lib('libmupdf-threads.a', {
 54+	'source/helpers/mu-threads/mu-threads.c',
 55+})
 56+lib('libmupdf-pkcs7.a', {
 57+	'source/helpers/pkcs7/pkcs7-check.c',
 58+	'source/helpers/pkcs7/pkcs7-openssl.c',
 59+})
 60+
 61+exe('bin/mutool', [[
 62+	source/tools/(
 63+		mutool.c muconvert.c mudraw.c murun.c mutrace.c cmapdump.c
 64+		pdfclean.c pdfcreate.c pdfextract.c pdfinfo.c pdfmerge.c pdfpages.c
 65+		pdfposter.c pdfshow.c pdfsign.c
 66+	)
 67+	libmupdf.a.d
 68+	libmupdf-pkcs7.a
 69+	libmupdf-threads.a
 70+]])
 71+file('bin/mutool', '755', '$outdir/bin/mutool')
 72+
 73+cc('platform/x11/wl_main.c', {
 74+	'$gendir/deps',
 75+	'pkg/libxkbcommon/headers',
 76+	'pkg/pixman/headers',
 77+	'pkg/wayland/headers',
 78+	'pkg/wayland-protocols/headers',
 79+}, {cflags={
 80+	'$cflags',
 81+	'-isystem $builddir/pkg/libxkbcommon/include',
 82+	'-isystem $builddir/pkg/pixman/include',
 83+	'-isystem $builddir/pkg/wayland/include',
 84+	'-isystem $builddir/pkg/wayland-protocols/include',
 85+}})
 86+exe('bin/mupdf', [[
 87+	platform/x11/(pdfapp.c wl_main.c.o)
 88+	libmupdf.a.d
 89+	libmupdf-pkcs7.a
 90+	$builddir/pkg/(
 91+		jbig2dec/libjbig2dec.a
 92+		libxkbcommon/libxkbcommon.a
 93+		pixman/libpixman.a
 94+		wayland-protocols/xdg-shell-protocol.c.o
 95+		wayland/libwayland-client.a.d
 96+		wayland/libwayland-cursor.a
 97+	)
 98+]])
 99+file('bin/mupdf', '755', '$outdir/bin/mupdf')
100+
101+man{'docs/man/mutool.1', 'docs/man/mupdf.1'}
102+
103+fetch 'git'
+180, -0
  1@@ -0,0 +1,180 @@
  2+# 2,<cd src/source && ls fitz/*.c pdf/*.c xps/*.c svg/*.c cbz/*.c | grep -v fitz/harfbuzz.c
  3+cbz/mucbz.c
  4+cbz/muimg.c
  5+fitz/archive.c
  6+fitz/bbox-device.c
  7+fitz/bidi-std.c
  8+fitz/bidi.c
  9+fitz/bitmap.c
 10+fitz/buffer.c
 11+fitz/color-fast.c
 12+fitz/color-icc-create.c
 13+fitz/color-lcms.c
 14+fitz/colorspace.c
 15+fitz/compress.c
 16+fitz/compressed-buffer.c
 17+fitz/context.c
 18+fitz/crypt-aes.c
 19+fitz/crypt-arc4.c
 20+fitz/crypt-md5.c
 21+fitz/crypt-sha2.c
 22+fitz/device.c
 23+fitz/directory.c
 24+fitz/document-all.c
 25+fitz/document.c
 26+fitz/draw-affine.c
 27+fitz/draw-blend.c
 28+fitz/draw-device.c
 29+fitz/draw-edge.c
 30+fitz/draw-edgebuffer.c
 31+fitz/draw-glyph.c
 32+fitz/draw-mesh.c
 33+fitz/draw-paint.c
 34+fitz/draw-path.c
 35+fitz/draw-rasterize.c
 36+fitz/draw-scale-simple.c
 37+fitz/draw-unpack.c
 38+fitz/encode-basic.c
 39+fitz/encode-fax.c
 40+fitz/encodings.c
 41+fitz/error.c
 42+fitz/filter-basic.c
 43+fitz/filter-dct.c
 44+fitz/filter-fax.c
 45+fitz/filter-flate.c
 46+fitz/filter-jbig2.c
 47+fitz/filter-leech.c
 48+fitz/filter-lzw.c
 49+fitz/filter-predict.c
 50+fitz/filter-sgi.c
 51+fitz/filter-thunder.c
 52+fitz/font.c
 53+fitz/ftoa.c
 54+fitz/geometry.c
 55+fitz/getopt.c
 56+fitz/glyph.c
 57+fitz/halftone.c
 58+fitz/hash.c
 59+fitz/image.c
 60+fitz/jmemcust.c
 61+fitz/link.c
 62+fitz/list-device.c
 63+fitz/load-bmp.c
 64+fitz/load-gif.c
 65+fitz/load-jbig2.c
 66+fitz/load-jpeg.c
 67+fitz/load-jpx.c
 68+fitz/load-jxr.c
 69+fitz/load-png.c
 70+fitz/load-pnm.c
 71+fitz/load-tiff.c
 72+fitz/log.c
 73+fitz/memento.c
 74+fitz/memory.c
 75+fitz/noto.c
 76+fitz/ocr-device.c
 77+fitz/outline.c
 78+fitz/output-cbz.c
 79+fitz/output-pcl.c
 80+fitz/output-pclm.c
 81+fitz/output-pdfocr.c
 82+fitz/output-png.c
 83+fitz/output-pnm.c
 84+fitz/output-ps.c
 85+fitz/output-psd.c
 86+fitz/output-pwg.c
 87+fitz/output-svg.c
 88+fitz/output.c
 89+fitz/path.c
 90+fitz/pixmap.c
 91+fitz/pool.c
 92+fitz/printf.c
 93+fitz/random.c
 94+fitz/separation.c
 95+fitz/shade.c
 96+fitz/stext-device.c
 97+fitz/stext-output.c
 98+fitz/stext-search.c
 99+fitz/store.c
100+fitz/stream-open.c
101+fitz/stream-read.c
102+fitz/string.c
103+fitz/strtof.c
104+fitz/svg-device.c
105+fitz/test-device.c
106+fitz/text.c
107+fitz/time.c
108+fitz/trace-device.c
109+fitz/track-usage.c
110+fitz/transition.c
111+fitz/tree.c
112+fitz/ucdn.c
113+fitz/untar.c
114+fitz/unzip.c
115+fitz/util.c
116+fitz/warp.c
117+fitz/writer.c
118+fitz/xml.c
119+fitz/xmltext-device.c
120+fitz/zip.c
121+pdf/pdf-annot.c
122+pdf/pdf-appearance.c
123+pdf/pdf-clean-file.c
124+pdf/pdf-clean.c
125+pdf/pdf-cmap-load.c
126+pdf/pdf-cmap-parse.c
127+pdf/pdf-cmap.c
128+pdf/pdf-colorspace.c
129+pdf/pdf-crypt.c
130+pdf/pdf-device.c
131+pdf/pdf-event.c
132+pdf/pdf-font-add.c
133+pdf/pdf-font.c
134+pdf/pdf-form.c
135+pdf/pdf-function.c
136+pdf/pdf-graft.c
137+pdf/pdf-image.c
138+pdf/pdf-interpret.c
139+pdf/pdf-js.c
140+pdf/pdf-layer.c
141+pdf/pdf-lex.c
142+pdf/pdf-link.c
143+pdf/pdf-metrics.c
144+pdf/pdf-nametree.c
145+pdf/pdf-object.c
146+pdf/pdf-op-buffer.c
147+pdf/pdf-op-filter.c
148+pdf/pdf-op-run.c
149+pdf/pdf-outline.c
150+pdf/pdf-page.c
151+pdf/pdf-parse.c
152+pdf/pdf-pattern.c
153+pdf/pdf-repair.c
154+pdf/pdf-resources.c
155+pdf/pdf-run.c
156+pdf/pdf-shade.c
157+pdf/pdf-signature.c
158+pdf/pdf-store.c
159+pdf/pdf-stream.c
160+pdf/pdf-type3.c
161+pdf/pdf-unicode.c
162+pdf/pdf-util.c
163+pdf/pdf-write.c
164+pdf/pdf-xobject.c
165+pdf/pdf-xref.c
166+svg/svg-color.c
167+svg/svg-doc.c
168+svg/svg-parse.c
169+svg/svg-run.c
170+xps/xps-common.c
171+xps/xps-doc.c
172+xps/xps-glyphs.c
173+xps/xps-gradient.c
174+xps/xps-image.c
175+xps/xps-link.c
176+xps/xps-outline.c
177+xps/xps-path.c
178+xps/xps-resource.c
179+xps/xps-tile.c
180+xps/xps-util.c
181+xps/xps-zip.c
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 90fd87f204511be0b290a1b54a33443a20630d5f
+1, -0
1@@ -0,0 +1 @@
2+1.18.0 r1
+1, -0
1@@ -0,0 +1 @@
2+/tools.ninja
+26, -0
 1@@ -0,0 +1,26 @@
 2+#define nstiny
 3+#define NETSURF_BUILTIN_LOG_FILTER "level:WARNING"
 4+#define NETSURF_BUILTIN_VERBOSE_FILTER "level:DEBUG"
 5+#define NETSURF_HOMEPAGE "https://lite.duckduckgo.com/lite"
 6+#define TINY_RESPATH "/share/netsurf:/share/fonts"
 7+
 8+#define TINY_FONT_SANS_SERIF "SourceSans3-Regular.otf"
 9+#define TINY_FONT_SANS_SERIF_BOLD "SourceSans3-Bold.otf"
10+#define TINY_FONT_SANS_SERIF_ITALIC "SourceSans3-It.otf"
11+#define TINY_FONT_SANS_SERIF_ITALIC_BOLD "SourceSans3-BoldIt.otf"
12+#define TINY_FONT_SERIF "SourceSerif4-Regular.otf"
13+#define TINY_FONT_SERIF_BOLD "SourceSerif4-Bold.otf"
14+#define TINY_FONT_MONOSPACE "SourceCodePro-Regular.otf"
15+#define TINY_FONT_MONOSPACE_BOLD "SourceCodePro-Bold.otf"
16+#define TINY_FONT_CURSIVE TINY_FONT_SANS_SERIF
17+#define TINY_FONT_FANTASY TINY_FONT_SANS_SERIF
18+#define TINY_DPI 96
19+
20+#define DUK_OPT_HAVE_CUSTOM_H 1
21+
22+#define WITH_BMP 1
23+#define WITH_CURL 1
24+#define WITH_GIF 1
25+#define WITH_JPEG 1
26+#define WITH_PNG 1
27+#define WITH_NS_SVG 1
+213, -0
  1@@ -0,0 +1,213 @@
  2+cflags{'-D NDEBUG'}
  3+
  4+subgen 'libcss'
  5+subgen 'libdom'
  6+subgen 'libhubbub'
  7+subgen 'libnsbmp'
  8+subgen 'libnsgif'
  9+subgen 'libnsutils'
 10+subgen 'libparserutils'
 11+subgen 'libsvgtiny'
 12+subgen 'libwapcaplet'
 13+
 14+sub('tools.ninja', function()
 15+	toolchain(config.host)
 16+	exe('convert_image', {'frontends/framebuffer/convert_image.c'}, {'pkg/libpng/headers'}, {
 17+		ldlibs='-lpng -lz',
 18+	})
 19+end)
 20+
 21+-- netsurf
 22+cflags{
 23+	'-include $dir/config.h',
 24+	'-I $dir',
 25+	'-I $srcdir',
 26+	'-I $srcdir/include',
 27+	'-I $srcdir/frontends',
 28+	'-I $srcdir/content/handlers',
 29+	'-I $outdir',
 30+	'-I $outdir/libdom/include',
 31+	'-I $dir/libcss/src/include',
 32+	'-I $dir/libdom/src/include',
 33+	'-I $dir/libhubbub/src/include',
 34+	'-I $dir/libnsbmp/src/include',
 35+	'-I $dir/libnsgif/src/include',
 36+	'-I $dir/libnsutils/src/include',
 37+	'-I $dir/libparserutils/src/include',
 38+	'-I $dir/libsvgtiny/src/include',
 39+	'-I $dir/libwapcaplet/src/include',
 40+	'-isystem $builddir/pkg/curl/include',
 41+	'-isystem $builddir/pkg/freetype/include',
 42+	'-isystem $builddir/pkg/libjpeg-turbo/include',
 43+	'-isystem $builddir/pkg/libpng/include',
 44+	'-isystem $builddir/pkg/libxkbcommon/include',
 45+	'-isystem $builddir/pkg/linux-headers/include',
 46+	'-isystem $builddir/pkg/pixman/include',
 47+	'-isystem $builddir/pkg/wayland/include',
 48+	'-isystem $builddir/pkg/utf8proc/include',
 49+	'-isystem $builddir/pkg/wayland-protocols/include',
 50+	'-isystem $builddir/pkg/zlib/include',
 51+	'-isystem $basedir/pkg/openbsd/include',
 52+}
 53+
 54+pkg.deps = {
 55+	'$dir/libcss/fetch',
 56+	'$dir/libdom/fetch',
 57+	'$gendir/libdom/headers',
 58+	'$dir/libhubbub/fetch',
 59+	'$dir/libnsbmp/fetch',
 60+	'$dir/libnsgif/fetch',
 61+	'$dir/libnsutils/fetch',
 62+	'$dir/libparserutils/fetch',
 63+	'$dir/libsvgtiny/fetch',
 64+	'$dir/libwapcaplet/fetch',
 65+	'pkg/curl/headers',
 66+	'pkg/freetype/headers',
 67+	'pkg/libjpeg-turbo/headers',
 68+	'pkg/libpng/headers',
 69+	'pkg/libxkbcommon/headers',
 70+	'pkg/linux-headers/headers',
 71+	'pkg/pixman/headers',
 72+	'pkg/utf8proc/headers',
 73+	'pkg/wayland/headers',
 74+	'pkg/wayland-protocols/headers',
 75+	'pkg/zlib/headers',
 76+}
 77+
 78+exe('netsurf', [[
 79+	desktop/(
 80+		cookie_manager.c knockout.c hotlist.c mouse.c
 81+		plot_style.c print.c search.c searchweb.c scrollbar.c
 82+		textarea.c version.c system_colour.c
 83+		local_history.c global_history.c treeview.c page-info.c
 84+
 85+		browser.c browser_window.c browser_history.c
 86+		download.c frames.c netsurf.c cw_helper.c
 87+		save_complete.c save_text.c selection.c textinput.c gui_factory.c
 88+		save_pdf.c font_haru.c
 89+	)
 90+	frontends/tiny/(download.c fetch.c icons.c gui.c render.c schedule.c ui.c wl.c)
 91+	content/(
 92+		content.c
 93+		content_factory.c
 94+		dirlist.c
 95+		fetch.c
 96+		hlcache.c
 97+		llcache.c
 98+		mimesniff.c
 99+		textsearch.c
100+		urldb.c
101+		no_backing_store.c
102+		fetchers/(curl.c data.c file.c about.c resource.c)
103+		handlers/(
104+			image/(image.c image_cache.c bmp.c gif.c ico.c jpeg.c png.c svg.c)
105+			css/(css.c dump.c internal.c hints.c select.c utils.c)
106+			javascript/(fetcher.c none/none.c)
107+			html/(
108+				box_construct.c
109+				box_inspect.c
110+				box_manipulate.c
111+				box_normalise.c
112+				box_special.c
113+				box_textarea.c
114+				css.c
115+				css_fetcher.c
116+				dom_event.c
117+				font.c
118+				form.c
119+				forms.c
120+				html.c
121+				imagemap.c
122+				interaction.c
123+				layout.c
124+				object.c
125+				redraw.c
126+				redraw_border.c
127+				script.c
128+				table.c
129+				textselection.c
130+			)
131+			text/textplain.c
132+		)
133+	)
134+	utils/(
135+		bloom.c
136+		corestrings.c
137+		file.c
138+		filename.c
139+		filepath.c
140+		hashmap.c
141+		hashtable.c
142+		idna.c
143+		libdom.c
144+		log.c
145+		messages.c
146+		nscolour.c
147+		nsoption.c
148+		punycode.c
149+		ssl_certs.c
150+		talloc.c
151+		time.c
152+		url.c
153+		useragent.c
154+		utf8.c
155+		utils.c
156+		http/(
157+			challenge.c generics.c primitives.c parameter.c
158+			cache-control.c content-disposition.c content-type.c
159+			strict-transport-security.c www-authenticate.c
160+		)
161+		nsurl/(
162+			nsurl.c
163+			parse.c
164+		)
165+	)
166+	$outdir/(
167+		libcss/libcss.a.d
168+		libdom/libdom.a.d
169+		libnsbmp/libnsbmp.a
170+		libnsgif/libnsgif.a
171+		libnsutils/libnsutils.a
172+		libsvgtiny/libsvgtiny.a.d
173+	)
174+	$builddir/pkg/(
175+		curl/libcurl.a.d
176+		freetype/libfreetype.a.d
177+		libjpeg-turbo/libjpeg-turbo.a
178+		libpng/libpng.a
179+		libxkbcommon/libxkbcommon.a
180+		pixman/libpixman.a
181+		utf8proc/libutf8proc.a
182+		wayland/(libwayland-client.a.d libwayland-cursor.a)
183+		zlib/libz.a
184+
185+		wayland-protocols/xdg-shell-protocol.c.o
186+	)
187+]])
188+file('bin/netsurf', '755', '$outdir/netsurf')
189+
190+build('sed', '$outdir/netsurf.1', '$srcdir/docs/netsurf-fb.1', {
191+	expr='s,netsurf-fb,netsurf,g',
192+})
193+man{'$outdir/netsurf.1'}
194+
195+build('awk', '$outdir/Messages', {'$srcdir/resources/FatMessages', '|', '$dir/messages.awk'}, {
196+	expr='-f $dir/messages.awk -v lang=en -v filter=any',
197+})
198+file('share/netsurf/Messages', '644', '$outdir/Messages')
199+
200+file('share/netsurf/SearchEngines', '644', '$srcdir/resources/SearchEngines')
201+file('share/netsurf/adblock.css', '644', '$srcdir/resources/adblock.css')
202+file('share/netsurf/credits.html', '644', '$srcdir/resources/en/credits.html')
203+file('share/netsurf/default.css', '644', '$srcdir/resources/default.css')
204+file('share/netsurf/favicon.png', '644', '$srcdir/resources/favicon.png')
205+file('share/netsurf/internal.css', '644', '$srcdir/resources/internal.css')
206+file('share/netsurf/licence.html', '644', '$srcdir/resources/en/licence.html')
207+file('share/netsurf/netsurf.png', '644', '$srcdir/resources/netsurf.png')
208+file('share/netsurf/quirks.css', '644', '$srcdir/resources/quirks.css')
209+file('share/netsurf/welcome.html', '644', '$srcdir/resources/en/welcome.html')
210+for icon in iterpaths[[back forward add remove home reload stop close up down]] do
211+	file('share/netsurf/icons/'..icon..'.ff', '644', '$srcdir/frontends/tiny/res/icons/'..icon..'.ff')
212+end
213+
214+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+/tools.ninja
+204, -0
  1@@ -0,0 +1,204 @@
  2+cflags{
  3+	[[-D '_ALIGNED=__attribute__((aligned))']],
  4+	'-I $srcdir/include',
  5+	'-I $srcdir/src',
  6+	'-I $basedir/pkg/netsurf/libparserutils/src/include',
  7+	'-I $basedir/pkg/netsurf/libwapcaplet/src/include',
  8+}
  9+
 10+sub('tools.ninja', function()
 11+	toolchain(config.host)
 12+	exe('gen_prop_parser', {'src/parse/properties/css_property_parser_gen.c'})
 13+end)
 14+
 15+build('awk', '$outdir/prop_parsers.c', {
 16+	'$srcdir/src/parse/properties/properties.gen',
 17+	'|', '$dir/prop_parsers.awk', '$outdir/gen_prop_parser',
 18+}, {expr='-f $dir/prop_parsers.awk gen_prop_parser=$outdir/gen_prop_parser'})
 19+
 20+pkg.deps = {
 21+	'pkg/netsurf/libparserutils/fetch',
 22+	'pkg/netsurf/libwapcaplet/fetch',
 23+}
 24+
 25+lib('libcss.a', [[src/(
 26+	stylesheet.c
 27+	charset/detect.c
 28+	lex/lex.c
 29+	parse/(
 30+		parse.c language.c important.c propstrings.c font_face.c mq.c
 31+		properties/(
 32+			azimuth.c
 33+			background.c
 34+			background_position.c
 35+			border.c
 36+			border_color.c
 37+			border_spacing.c
 38+			border_style.c
 39+			border_width.c
 40+			clip.c
 41+			columns.c
 42+			column_rule.c
 43+			content.c
 44+			cue.c
 45+			cursor.c
 46+			elevation.c
 47+			flex.c
 48+			flex_flow.c
 49+			font.c
 50+			font_family.c
 51+			font_weight.c
 52+			list_style.c
 53+			list_style_type.c
 54+			margin.c
 55+			opacity.c
 56+			outline.c
 57+			overflow.c
 58+			padding.c
 59+			pause.c
 60+			play_during.c
 61+			properties.c
 62+			quotes.c
 63+			text_decoration.c
 64+			utils.c
 65+			voice_family.c
 66+		)
 67+	)
 68+	select/(
 69+		arena.c computed.c dispatch.c hash.c select.c font_face.c
 70+		properties/(
 71+			helpers.c
 72+			align_content.c
 73+			align_items.c
 74+			align_self.c
 75+			azimuth.c
 76+			background_attachment.c
 77+			background_color.c
 78+			background_image.c
 79+			background_position.c
 80+			background_repeat.c
 81+			border_bottom_color.c
 82+			border_bottom_style.c
 83+			border_bottom_width.c
 84+			border_collapse.c
 85+			border_left_color.c
 86+			border_left_style.c
 87+			border_left_width.c
 88+			border_right_color.c
 89+			border_right_style.c
 90+			border_right_width.c
 91+			border_spacing.c
 92+			border_top_color.c
 93+			border_top_style.c
 94+			border_top_width.c
 95+			bottom.c
 96+			box_sizing.c
 97+			break_after.c
 98+			break_before.c
 99+			break_inside.c
100+			caption_side.c
101+			clear.c
102+			clip.c
103+			color.c
104+			column_count.c
105+			column_fill.c
106+			column_gap.c
107+			column_rule_color.c
108+			column_rule_style.c
109+			column_rule_width.c
110+			column_span.c
111+			column_width.c
112+			content.c
113+			counter_increment.c
114+			counter_reset.c
115+			cue_after.c
116+			cue_before.c
117+			cursor.c
118+			direction.c
119+			display.c
120+			elevation.c
121+			empty_cells.c
122+			flex_basis.c
123+			flex_direction.c
124+			flex_grow.c
125+			flex_shrink.c
126+			flex_wrap.c
127+			float.c
128+			font_family.c
129+			font_size.c
130+			font_style.c
131+			font_variant.c
132+			font_weight.c
133+			height.c
134+			justify_content.c
135+			left.c
136+			letter_spacing.c
137+			line_height.c
138+			list_style_image.c
139+			list_style_position.c
140+			list_style_type.c
141+			margin_bottom.c
142+			margin_left.c
143+			margin_right.c
144+			margin_top.c
145+			max_height.c
146+			max_width.c
147+			min_height.c
148+			min_width.c
149+			opacity.c
150+			order.c
151+			orphans.c
152+			outline_color.c
153+			outline_style.c
154+			outline_width.c
155+			overflow_x.c
156+			overflow_y.c
157+			padding_bottom.c
158+			padding_left.c
159+			padding_right.c
160+			padding_top.c
161+			page_break_after.c
162+			page_break_before.c
163+			page_break_inside.c
164+			pause_after.c
165+			pause_before.c
166+			pitch.c
167+			pitch_range.c
168+			play_during.c
169+			position.c
170+			quotes.c
171+			richness.c
172+			right.c
173+			speech_rate.c
174+			speak.c
175+			speak_header.c
176+			speak_numeral.c
177+			speak_punctuation.c
178+			stress.c
179+			table_layout.c
180+			text_align.c
181+			text_decoration.c
182+			text_indent.c
183+			text_transform.c
184+			top.c
185+			unicode_bidi.c
186+			vertical_align.c
187+			visibility.c
188+			voice_family.c
189+			volume.c
190+			white_space.c
191+			widows.c
192+			width.c
193+			word_spacing.c
194+			writing_mode.c
195+			z_index.c
196+		)
197+	)
198+	utils/(errors.c utils.c)
199+) $builddir/pkg/netsurf/(
200+	libcss/prop_parsers.c
201+	libparserutils/libparserutils.a
202+	libwapcaplet/libwapcaplet.a
203+)]])
204+
205+fetch 'git'
+27, -0
 1@@ -0,0 +1,27 @@
 2+From a76e4659fb5218330832821ba84c651b743d423f Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Thu, 28 Oct 2021 11:03:15 -0700
 5+Subject: [PATCH] Remove unnecessary alignment attribute
 6+
 7+This was added just to silence a gcc warning. css_rules are always
 8+embedded into outer structs, so the cast is perfectly fine.
 9+---
10+ src/stylesheet.h | 2 +-
11+ 1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+diff --git a/src/stylesheet.h b/src/stylesheet.h
14+index a71fca6..24be8bf 100644
15+--- a/src/stylesheet.h
16++++ b/src/stylesheet.h
17+@@ -121,7 +121,7 @@ struct css_rule {
18+ 	uint16_t items; /**< number of items (selectors) in rule */
19+ 	uint8_t type;   /**< css_rule_type */
20+ 	uint8_t ptype;  /**< css_rule_parent_type */
21+-} _ALIGNED;
22++};
23+ 
24+ typedef struct css_rule_selector {
25+ 	css_rule base;
26+-- 
27+2.32.0
28+
+10, -0
 1@@ -0,0 +1,10 @@
 2+BEGIN {
 3+	FS=":"
 4+}
 5+
 6+/^#/ { next }
 7+/^$/ { next }
 8+
 9+{
10+	system(gen_prop_parser " '" $0 "'")
11+}
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 385769d6554d2d3a9c2c35a04cf5dde706cefb6b
+1, -0
1@@ -0,0 +1 @@
2+0.9.1 r1
+108, -0
  1@@ -0,0 +1,108 @@
  2+cflags{
  3+	'-I $srcdir/include',
  4+	'-I $srcdir/src',
  5+	'-I $basedir/pkg/netsurf/libhubbub/src/include',
  6+	'-I $basedir/pkg/netsurf/libparserutils/src/include',
  7+	'-I $basedir/pkg/netsurf/libwapcaplet/src/include',
  8+	'-isystem $builddir/pkg/expat/include',
  9+}
 10+
 11+pkg.hdrs = copy('$outdir/include/dom', '$srcdir', {
 12+	'bindings/hubbub/errors.h',
 13+	'bindings/hubbub/parser.h',
 14+	'bindings/xml/xmlerror.h',
 15+	'bindings/xml/xmlparser.h',
 16+})
 17+pkg.deps = {
 18+	'pkg/expat/headers',
 19+	'pkg/netsurf/libhubbub/fetch',
 20+	'pkg/netsurf/libparserutils/fetch',
 21+	'pkg/netsurf/libwapcaplet/fetch',
 22+}
 23+
 24+lib('libdom.a', [[
 25+	src/(
 26+		core/(
 27+			string.c node.c
 28+			attr.c characterdata.c element.c
 29+			implementation.c
 30+			text.c typeinfo.c comment.c
 31+			namednodemap.c nodelist.c
 32+			cdatasection.c document_type.c entity_ref.c pi.c
 33+			doc_fragment.c document.c
 34+		)
 35+		events/(
 36+			event.c dispatch.c event_target.c document_event.c
 37+			custom_event.c keyboard_event.c mouse_wheel_event.c
 38+			text_event.c event_listener.c mouse_event.c mutation_event.c
 39+			ui_event.c mouse_multi_wheel_event.c mutation_name_event.c
 40+		)
 41+		html/(
 42+			html_applet_element.c
 43+			html_area_element.c
 44+			html_anchor_element.c
 45+			html_basefont_element.c
 46+			html_base_element.c
 47+			html_body_element.c
 48+			html_button_element.c
 49+			html_canvas_element.c
 50+			html_collection.c
 51+			html_document.c
 52+			html_element.c
 53+			html_dlist_element.c
 54+			html_directory_element.c
 55+			html_options_collection.c
 56+			html_html_element.c
 57+			html_head_element.c
 58+			html_link_element.c
 59+			html_title_element.c
 60+			html_meta_element.c
 61+			html_style_element.c
 62+			html_form_element.c
 63+			html_select_element.c
 64+			html_input_element.c
 65+			html_text_area_element.c
 66+			html_opt_group_element.c
 67+			html_option_element.c
 68+			html_hr_element.c
 69+			html_menu_element.c
 70+			html_fieldset_element.c
 71+			html_legend_element.c
 72+			html_div_element.c
 73+			html_paragraph_element.c
 74+			html_heading_element.c
 75+			html_quote_element.c
 76+			html_pre_element.c
 77+			html_br_element.c
 78+			html_label_element.c
 79+			html_ulist_element.c
 80+			html_olist_element.c
 81+			html_li_element.c
 82+			html_font_element.c
 83+			html_mod_element.c
 84+			html_image_element.c
 85+			html_object_element.c
 86+			html_param_element.c
 87+			html_map_element.c
 88+			html_script_element.c
 89+			html_tablecaption_element.c
 90+			html_tablecell_element.c
 91+			html_tablecol_element.c
 92+			html_tablesection_element.c
 93+			html_table_element.c
 94+			html_tablerow_element.c
 95+			html_frameset_element.c
 96+			html_frame_element.c
 97+			html_iframe_element.c
 98+			html_isindex_element.c
 99+		)
100+		utils/(namespace.c hashtable.c character_valid.c validate.c)
101+	)
102+	bindings/hubbub/parser.c
103+	bindings/xml/expat_xmlparser.c
104+	$builddir/pkg/expat/libexpat.a.d
105+	$builddir/pkg/netsurf/libhubbub/libhubbub.a.d
106+	$builddir/pkg/netsurf/libwapcaplet/libwapcaplet.a
107+]])
108+
109+fetch 'git'
+726, -0
  1@@ -0,0 +1,726 @@
  2+From 64cefc96a96ea5cade24179ee17bc3dfb3c90187 Mon Sep 17 00:00:00 2001
  3+From: Michael Forney <mforney@mforney.org>
  4+Date: Mon, 1 Jul 2019 22:57:10 -0700
  5+Subject: [PATCH] Remove empty top-level declarations
  6+
  7+---
  8+ src/html/html_anchor_element.c       | 22 +++++++++++-----------
  9+ src/html/html_applet_element.c       | 18 +++++++++---------
 10+ src/html/html_area_element.c         | 12 ++++++------
 11+ src/html/html_base_element.c         |  4 ++--
 12+ src/html/html_basefont_element.c     |  4 ++--
 13+ src/html/html_br_element.c           |  2 +-
 14+ src/html/html_button_element.c       |  8 ++++----
 15+ src/html/html_div_element.c          |  2 +-
 16+ src/html/html_font_element.c         |  6 +++---
 17+ src/html/html_frame_element.c        | 14 +++++++-------
 18+ src/html/html_frameset_element.c     |  4 ++--
 19+ src/html/html_heading_element.c      |  2 +-
 20+ src/html/html_hr_element.c           |  6 +++---
 21+ src/html/html_iframe_element.c       | 20 ++++++++++----------
 22+ src/html/html_image_element.c        | 14 +++++++-------
 23+ src/html/html_input_element.c        | 18 +++++++++---------
 24+ src/html/html_isindex_element.c      |  2 +-
 25+ src/html/html_label_element.c        |  4 ++--
 26+ src/html/html_legend_element.c       |  4 ++--
 27+ src/html/html_li_element.c           |  2 +-
 28+ src/html/html_map_element.c          |  2 +-
 29+ src/html/html_mod_element.c          |  4 ++--
 30+ src/html/html_object_element.c       | 26 +++++++++++++-------------
 31+ src/html/html_olist_element.c        |  2 +-
 32+ src/html/html_opt_group_element.c    |  2 +-
 33+ src/html/html_paragraph_element.c    |  2 +-
 34+ src/html/html_param_element.c        |  8 ++++----
 35+ src/html/html_quote_element.c        |  2 +-
 36+ src/html/html_script_element.c       | 10 +++++-----
 37+ src/html/html_style_element.c        |  4 ++--
 38+ src/html/html_table_element.c        | 18 +++++++++---------
 39+ src/html/html_tablecaption_element.c |  2 +-
 40+ src/html/html_tablecell_element.c    | 22 +++++++++++-----------
 41+ src/html/html_tablecol_element.c     | 10 +++++-----
 42+ src/html/html_tablerow_element.c     | 10 +++++-----
 43+ src/html/html_tablesection_element.c |  8 ++++----
 44+ src/html/html_text_area_element.c    |  4 ++--
 45+ src/html/html_ulist_element.c        |  2 +-
 46+ 38 files changed, 153 insertions(+), 153 deletions(-)
 47+
 48+diff --git a/src/html/html_anchor_element.c b/src/html/html_anchor_element.c
 49+index 8d64c2b..8aa6a79 100644
 50+--- a/src/html/html_anchor_element.c
 51++++ b/src/html/html_anchor_element.c
 52+@@ -185,17 +185,17 @@ dom_exception dom_html_anchor_element_set_##attr(			\
 53+ 
 54+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
 55+ 
 56+-SIMPLE_GET_SET(access_key);
 57+-SIMPLE_GET_SET(charset);
 58+-SIMPLE_GET_SET(coords);
 59+-SIMPLE_GET_SET(href);
 60+-SIMPLE_GET_SET(hreflang);
 61+-SIMPLE_GET_SET(name);
 62+-SIMPLE_GET_SET(rel);
 63+-SIMPLE_GET_SET(rev);
 64+-SIMPLE_GET_SET(shape);
 65+-SIMPLE_GET_SET(target);
 66+-SIMPLE_GET_SET(type);
 67++SIMPLE_GET_SET(access_key)
 68++SIMPLE_GET_SET(charset)
 69++SIMPLE_GET_SET(coords)
 70++SIMPLE_GET_SET(href)
 71++SIMPLE_GET_SET(hreflang)
 72++SIMPLE_GET_SET(name)
 73++SIMPLE_GET_SET(rel)
 74++SIMPLE_GET_SET(rev)
 75++SIMPLE_GET_SET(shape)
 76++SIMPLE_GET_SET(target)
 77++SIMPLE_GET_SET(type)
 78+ 
 79+ dom_exception dom_html_anchor_element_get_tab_index(
 80+ 	dom_html_anchor_element *anchor, int32_t *tab_index)
 81+diff --git a/src/html/html_applet_element.c b/src/html/html_applet_element.c
 82+index 93ea1b5..9451810 100644
 83+--- a/src/html/html_applet_element.c
 84++++ b/src/html/html_applet_element.c
 85+@@ -185,15 +185,15 @@ dom_exception _dom_html_applet_element_copy_internal(
 86+ 
 87+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
 88+ 
 89+-SIMPLE_GET_SET(align);
 90+-SIMPLE_GET_SET(alt);
 91+-SIMPLE_GET_SET(archive);
 92+-SIMPLE_GET_SET(code);
 93+-SIMPLE_GET_SET(code_base);
 94+-SIMPLE_GET_SET(height);
 95+-SIMPLE_GET_SET(name);
 96+-SIMPLE_GET_SET(object);
 97+-SIMPLE_GET_SET(width);
 98++SIMPLE_GET_SET(align)
 99++SIMPLE_GET_SET(alt)
100++SIMPLE_GET_SET(archive)
101++SIMPLE_GET_SET(code)
102++SIMPLE_GET_SET(code_base)
103++SIMPLE_GET_SET(height)
104++SIMPLE_GET_SET(name)
105++SIMPLE_GET_SET(object)
106++SIMPLE_GET_SET(width)
107+ 
108+ dom_exception dom_html_applet_element_get_hspace(
109+ 		dom_html_applet_element *applet, int32_t *hspace)
110+diff --git a/src/html/html_area_element.c b/src/html/html_area_element.c
111+index 828b073..967fba5 100644
112+--- a/src/html/html_area_element.c
113++++ b/src/html/html_area_element.c
114+@@ -240,10 +240,10 @@ dom_exception dom_html_area_element_set_##attr(			\
115+ 
116+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
117+ 
118+-SIMPLE_GET_SET(access_key);
119+-SIMPLE_GET_SET(alt);
120+-SIMPLE_GET_SET(coords);
121+-SIMPLE_GET_SET(href);
122+-SIMPLE_GET_SET(shape);
123+-SIMPLE_GET_SET(target);
124++SIMPLE_GET_SET(access_key)
125++SIMPLE_GET_SET(alt)
126++SIMPLE_GET_SET(coords)
127++SIMPLE_GET_SET(href)
128++SIMPLE_GET_SET(shape)
129++SIMPLE_GET_SET(target)
130+ 
131+diff --git a/src/html/html_base_element.c b/src/html/html_base_element.c
132+index 0034f7c..6aac094 100644
133+--- a/src/html/html_base_element.c
134++++ b/src/html/html_base_element.c
135+@@ -180,5 +180,5 @@ dom_exception dom_html_base_element_set_##attr(			\
136+ 
137+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
138+ 
139+-SIMPLE_GET_SET(href);
140+-SIMPLE_GET_SET(target);
141++SIMPLE_GET_SET(href)
142++SIMPLE_GET_SET(target)
143+diff --git a/src/html/html_basefont_element.c b/src/html/html_basefont_element.c
144+index ac1183d..ff4a6d7 100644
145+--- a/src/html/html_basefont_element.c
146++++ b/src/html/html_basefont_element.c
147+@@ -207,5 +207,5 @@ dom_exception _dom_html_base_font_element_copy_internal(
148+ 			}
149+ 
150+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
151+-SIMPLE_GET_SET(color);
152+-SIMPLE_GET_SET(face);
153++SIMPLE_GET_SET(color)
154++SIMPLE_GET_SET(face)
155+diff --git a/src/html/html_br_element.c b/src/html/html_br_element.c
156+index 74e3ea8..c2eb8e5 100644
157+--- a/src/html/html_br_element.c
158++++ b/src/html/html_br_element.c
159+@@ -185,5 +185,5 @@ dom_exception dom_html_br_element_set_##attr(			\
160+ 
161+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
162+ 
163+-SIMPLE_GET_SET(clear);
164++SIMPLE_GET_SET(clear)
165+ 
166+diff --git a/src/html/html_button_element.c b/src/html/html_button_element.c
167+index 04a17dd..e7b429d 100644
168+--- a/src/html/html_button_element.c
169++++ b/src/html/html_button_element.c
170+@@ -221,10 +221,10 @@ dom_exception dom_html_button_element_set_##attr(			\
171+ 
172+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
173+ 
174+-SIMPLE_GET_SET(access_key);
175+-SIMPLE_GET_SET(name);
176+-SIMPLE_GET(type);
177+-SIMPLE_GET_SET(value);
178++SIMPLE_GET_SET(access_key)
179++SIMPLE_GET_SET(name)
180++SIMPLE_GET(type)
181++SIMPLE_GET_SET(value)
182+ 
183+ dom_exception dom_html_button_element_get_tab_index(
184+ 	dom_html_button_element *button, int32_t *tab_index)
185+diff --git a/src/html/html_div_element.c b/src/html/html_div_element.c
186+index b061246..2516a8e 100644
187+--- a/src/html/html_div_element.c
188++++ b/src/html/html_div_element.c
189+@@ -184,5 +184,5 @@ dom_exception dom_html_div_element_set_##attr(			\
190+ 
191+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
192+ 
193+-SIMPLE_GET_SET(align);
194++SIMPLE_GET_SET(align)
195+ 
196+diff --git a/src/html/html_font_element.c b/src/html/html_font_element.c
197+index ecedfb0..ad90642 100644
198+--- a/src/html/html_font_element.c
199++++ b/src/html/html_font_element.c
200+@@ -185,7 +185,7 @@ dom_exception dom_html_font_element_set_##attr(			\
201+ 
202+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
203+ 
204+-SIMPLE_GET_SET(color);
205+-SIMPLE_GET_SET(face);
206+-SIMPLE_GET_SET(size);
207++SIMPLE_GET_SET(color)
208++SIMPLE_GET_SET(face)
209++SIMPLE_GET_SET(size)
210+ 
211+diff --git a/src/html/html_frame_element.c b/src/html/html_frame_element.c
212+index fe6859c..c659cea 100644
213+--- a/src/html/html_frame_element.c
214++++ b/src/html/html_frame_element.c
215+@@ -212,13 +212,13 @@ dom_exception dom_html_frame_element_set_##attr(			\
216+ 
217+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
218+ 
219+-SIMPLE_GET_SET(long_desc);
220+-SIMPLE_GET_SET(name);
221+-SIMPLE_GET_SET(src);
222+-SIMPLE_GET_SET(frame_border);
223+-SIMPLE_GET_SET(margin_width);
224+-SIMPLE_GET_SET(margin_height);
225+-SIMPLE_GET_SET(scrolling);
226++SIMPLE_GET_SET(long_desc)
227++SIMPLE_GET_SET(name)
228++SIMPLE_GET_SET(src)
229++SIMPLE_GET_SET(frame_border)
230++SIMPLE_GET_SET(margin_width)
231++SIMPLE_GET_SET(margin_height)
232++SIMPLE_GET_SET(scrolling)
233+ 
234+ dom_exception dom_html_frame_element_get_content_document(
235+ 		dom_html_frame_element *ele,
236+diff --git a/src/html/html_frameset_element.c b/src/html/html_frameset_element.c
237+index be44d5d..38bb9c8 100644
238+--- a/src/html/html_frameset_element.c
239++++ b/src/html/html_frameset_element.c
240+@@ -184,6 +184,6 @@ dom_exception dom_html_frame_set_element_set_##attr(			\
241+ 
242+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
243+ 
244+-SIMPLE_GET_SET (rows);
245+-SIMPLE_GET_SET (cols);
246++SIMPLE_GET_SET (rows)
247++SIMPLE_GET_SET (cols)
248+ 
249+diff --git a/src/html/html_heading_element.c b/src/html/html_heading_element.c
250+index 8ab2c5a..0a4b515 100644
251+--- a/src/html/html_heading_element.c
252++++ b/src/html/html_heading_element.c
253+@@ -184,5 +184,5 @@ dom_exception dom_html_heading_element_set_##attr(			\
254+ 
255+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
256+ 
257+-SIMPLE_GET_SET(align);
258++SIMPLE_GET_SET(align)
259+ 
260+diff --git a/src/html/html_hr_element.c b/src/html/html_hr_element.c
261+index e6086f5..aed04d7 100644
262+--- a/src/html/html_hr_element.c
263++++ b/src/html/html_hr_element.c
264+@@ -212,7 +212,7 @@ dom_exception dom_html_hr_element_set_##attr(			\
265+ 
266+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
267+ 
268+-SIMPLE_GET_SET(size);
269+-SIMPLE_GET_SET(align);
270+-SIMPLE_GET_SET(width);
271++SIMPLE_GET_SET(size)
272++SIMPLE_GET_SET(align)
273++SIMPLE_GET_SET(width)
274+ 
275+diff --git a/src/html/html_iframe_element.c b/src/html/html_iframe_element.c
276+index 4d7272b..884385b 100644
277+--- a/src/html/html_iframe_element.c
278++++ b/src/html/html_iframe_element.c
279+@@ -184,16 +184,16 @@ dom_exception dom_html_iframe_element_set_##attr(			\
280+ 
281+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
282+ 
283+-SIMPLE_GET_SET(long_desc);
284+-SIMPLE_GET_SET(align);
285+-SIMPLE_GET_SET(name);
286+-SIMPLE_GET_SET(src);
287+-SIMPLE_GET_SET(margin_width);
288+-SIMPLE_GET_SET(margin_height);
289+-SIMPLE_GET_SET(scrolling);
290+-SIMPLE_GET_SET(frame_border);
291+-SIMPLE_GET_SET(width);
292+-SIMPLE_GET_SET(height);
293++SIMPLE_GET_SET(long_desc)
294++SIMPLE_GET_SET(align)
295++SIMPLE_GET_SET(name)
296++SIMPLE_GET_SET(src)
297++SIMPLE_GET_SET(margin_width)
298++SIMPLE_GET_SET(margin_height)
299++SIMPLE_GET_SET(scrolling)
300++SIMPLE_GET_SET(frame_border)
301++SIMPLE_GET_SET(width)
302++SIMPLE_GET_SET(height)
303+ 
304+ 
305+ /**
306+diff --git a/src/html/html_image_element.c b/src/html/html_image_element.c
307+index 3cdd15f..95b2875 100644
308+--- a/src/html/html_image_element.c
309++++ b/src/html/html_image_element.c
310+@@ -185,13 +185,13 @@ dom_exception dom_html_image_element_set_##attr(			\
311+ 
312+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
313+ 
314+-SIMPLE_GET_SET(name);
315+-SIMPLE_GET_SET(align);
316+-SIMPLE_GET_SET(alt);
317+-SIMPLE_GET_SET(border);
318+-SIMPLE_GET_SET(long_desc);
319+-SIMPLE_GET_SET(src);
320+-SIMPLE_GET_SET(use_map);
321++SIMPLE_GET_SET(name)
322++SIMPLE_GET_SET(align)
323++SIMPLE_GET_SET(alt)
324++SIMPLE_GET_SET(border)
325++SIMPLE_GET_SET(long_desc)
326++SIMPLE_GET_SET(src)
327++SIMPLE_GET_SET(use_map)
328+ 
329+ dom_exception dom_html_image_element_get_height(
330+ 	dom_html_image_element *image, dom_ulong *height)
331+diff --git a/src/html/html_input_element.c b/src/html/html_input_element.c
332+index 079b55e..22e1e63 100644
333+--- a/src/html/html_input_element.c
334++++ b/src/html/html_input_element.c
335+@@ -390,15 +390,15 @@ dom_exception dom_html_input_element_set_##attr(			\
336+ 
337+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
338+ 
339+-SIMPLE_GET_SET(accept);
340+-SIMPLE_GET_SET(access_key);
341+-SIMPLE_GET_SET(align);
342+-SIMPLE_GET_SET(alt);
343+-SIMPLE_GET_SET(name);
344+-SIMPLE_GET_SET(src);
345+-SIMPLE_GET(type);
346+-SIMPLE_GET_SET(use_map);
347+-SIMPLE_GET_SET(value);
348++SIMPLE_GET_SET(accept)
349++SIMPLE_GET_SET(access_key)
350++SIMPLE_GET_SET(align)
351++SIMPLE_GET_SET(alt)
352++SIMPLE_GET_SET(name)
353++SIMPLE_GET_SET(src)
354++SIMPLE_GET(type)
355++SIMPLE_GET_SET(use_map)
356++SIMPLE_GET_SET(value)
357+ 
358+ dom_exception dom_html_input_element_get_size(
359+ 	dom_html_input_element *input, dom_ulong *size)
360+diff --git a/src/html/html_isindex_element.c b/src/html/html_isindex_element.c
361+index 40cb99c..216f7b8 100644
362+--- a/src/html/html_isindex_element.c
363++++ b/src/html/html_isindex_element.c
364+@@ -181,7 +181,7 @@ dom_exception dom_html_isindex_element_set_##attr(			\
365+ 	}
366+ 
367+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
368+-SIMPLE_GET_SET(prompt);
369++SIMPLE_GET_SET(prompt)
370+ /*-----------------------------------------------------------------------*/
371+ /* Public APIs */
372+ 
373+diff --git a/src/html/html_label_element.c b/src/html/html_label_element.c
374+index 777144a..9b69c55 100644
375+--- a/src/html/html_label_element.c
376++++ b/src/html/html_label_element.c
377+@@ -214,6 +214,6 @@ dom_exception dom_html_label_element_set_##attr(			\
378+ 	}
379+ 
380+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
381+-SIMPLE_GET_SET(access_key);
382+-SIMPLE_GET_SET(html_for);
383++SIMPLE_GET_SET(access_key)
384++SIMPLE_GET_SET(html_for)
385+ 
386+diff --git a/src/html/html_legend_element.c b/src/html/html_legend_element.c
387+index efb712b..e558be3 100644
388+--- a/src/html/html_legend_element.c
389++++ b/src/html/html_legend_element.c
390+@@ -219,8 +219,8 @@ dom_exception dom_html_legend_element_set_##attr(			\
391+ 
392+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
393+ 
394+-SIMPLE_GET_SET(access_key);
395+-SIMPLE_SET(align);
396++SIMPLE_GET_SET(access_key)
397++SIMPLE_SET(align)
398+ 
399+ dom_exception dom_html_legend_element_get_align(
400+         dom_html_legend_element *legend, dom_string **align)
401+diff --git a/src/html/html_li_element.c b/src/html/html_li_element.c
402+index 84becf9..1207a5c 100644
403+--- a/src/html/html_li_element.c
404++++ b/src/html/html_li_element.c
405+@@ -208,4 +208,4 @@ dom_exception _dom_html_li_element_copy_internal(
406+ 
407+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
408+ 
409+-SIMPLE_GET_SET(type);
410++SIMPLE_GET_SET(type)
411+diff --git a/src/html/html_map_element.c b/src/html/html_map_element.c
412+index 3b10222..206e649 100644
413+--- a/src/html/html_map_element.c
414++++ b/src/html/html_map_element.c
415+@@ -187,7 +187,7 @@ dom_exception dom_html_map_element_set_##attr(			\
416+ 
417+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
418+ 
419+-SIMPLE_GET_SET(name);
420++SIMPLE_GET_SET(name)
421+ 
422+ /* The callback function for  _dom_html_collection_create*/
423+ static bool callback(struct dom_node_internal *node, void *ctx)
424+diff --git a/src/html/html_mod_element.c b/src/html/html_mod_element.c
425+index 20cb042..7b9b90f 100644
426+--- a/src/html/html_mod_element.c
427++++ b/src/html/html_mod_element.c
428+@@ -185,6 +185,6 @@ dom_exception dom_html_mod_element_set_##attr(			\
429+ 
430+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
431+ 
432+-SIMPLE_GET_SET(cite);
433+-SIMPLE_GET_SET(date_time);
434++SIMPLE_GET_SET(cite)
435++SIMPLE_GET_SET(date_time)
436+ 
437+diff --git a/src/html/html_object_element.c b/src/html/html_object_element.c
438+index b51e3a0..e9f02cb 100644
439+--- a/src/html/html_object_element.c
440++++ b/src/html/html_object_element.c
441+@@ -187,19 +187,19 @@ dom_exception _dom_html_object_element_copy_internal(
442+ 
443+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
444+ 
445+-SIMPLE_GET_SET(code);
446+-SIMPLE_GET_SET(align);
447+-SIMPLE_GET_SET(archive);
448+-SIMPLE_GET_SET(border);
449+-SIMPLE_GET_SET(code_base);
450+-SIMPLE_GET_SET(code_type);
451+-SIMPLE_GET_SET(data);
452+-SIMPLE_GET_SET(height);
453+-SIMPLE_GET_SET(name);
454+-SIMPLE_GET_SET(standby);
455+-SIMPLE_GET_SET(type);
456+-SIMPLE_GET_SET(use_map);
457+-SIMPLE_GET_SET(width);
458++SIMPLE_GET_SET(code)
459++SIMPLE_GET_SET(align)
460++SIMPLE_GET_SET(archive)
461++SIMPLE_GET_SET(border)
462++SIMPLE_GET_SET(code_base)
463++SIMPLE_GET_SET(code_type)
464++SIMPLE_GET_SET(data)
465++SIMPLE_GET_SET(height)
466++SIMPLE_GET_SET(name)
467++SIMPLE_GET_SET(standby)
468++SIMPLE_GET_SET(type)
469++SIMPLE_GET_SET(use_map)
470++SIMPLE_GET_SET(width)
471+ 
472+ dom_exception dom_html_object_element_get_hspace(
473+ 		dom_html_object_element *object, int32_t *hspace)
474+diff --git a/src/html/html_olist_element.c b/src/html/html_olist_element.c
475+index c89d11f..17d7317 100644
476+--- a/src/html/html_olist_element.c
477++++ b/src/html/html_olist_element.c
478+@@ -232,4 +232,4 @@ dom_exception _dom_html_olist_element_copy_internal(
479+ 
480+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
481+ 
482+-SIMPLE_GET_SET(type);
483++SIMPLE_GET_SET(type)
484+diff --git a/src/html/html_opt_group_element.c b/src/html/html_opt_group_element.c
485+index 6af0a29..3c20d1c 100644
486+--- a/src/html/html_opt_group_element.c
487++++ b/src/html/html_opt_group_element.c
488+@@ -215,4 +215,4 @@ dom_exception dom_html_opt_group_element_set_##attr(			\
489+ 
490+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
491+ 
492+-SIMPLE_GET_SET(label);
493++SIMPLE_GET_SET(label)
494+diff --git a/src/html/html_paragraph_element.c b/src/html/html_paragraph_element.c
495+index 2b2f420..4f75528 100644
496+--- a/src/html/html_paragraph_element.c
497++++ b/src/html/html_paragraph_element.c
498+@@ -184,5 +184,5 @@ dom_exception dom_html_paragraph_element_set_##attr(			\
499+ 
500+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
501+ 
502+-SIMPLE_GET_SET(align);
503++SIMPLE_GET_SET(align)
504+ 
505+diff --git a/src/html/html_param_element.c b/src/html/html_param_element.c
506+index c75e1ce..b2ba7aa 100644
507+--- a/src/html/html_param_element.c
508++++ b/src/html/html_param_element.c
509+@@ -183,7 +183,7 @@ dom_exception _dom_html_param_element_copy_internal(
510+ 			}
511+ 
512+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
513+-SIMPLE_GET_SET(name);
514+-SIMPLE_GET_SET(type);
515+-SIMPLE_GET_SET(value);
516+-SIMPLE_GET_SET(value_type);
517++SIMPLE_GET_SET(name)
518++SIMPLE_GET_SET(type)
519++SIMPLE_GET_SET(value)
520++SIMPLE_GET_SET(value_type)
521+diff --git a/src/html/html_quote_element.c b/src/html/html_quote_element.c
522+index cf3e0c5..e42d153 100644
523+--- a/src/html/html_quote_element.c
524++++ b/src/html/html_quote_element.c
525+@@ -184,5 +184,5 @@ dom_exception dom_html_quote_element_set_##attr(			\
526+ 
527+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
528+ 
529+-SIMPLE_GET_SET(cite);
530++SIMPLE_GET_SET(cite)
531+ 
532+diff --git a/src/html/html_script_element.c b/src/html/html_script_element.c
533+index e8dfb1d..369cb2a 100644
534+--- a/src/html/html_script_element.c
535++++ b/src/html/html_script_element.c
536+@@ -186,11 +186,11 @@ dom_exception dom_html_script_element_set_##attr(			\
537+ 
538+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
539+ 
540+-SIMPLE_GET_SET(html_for);
541+-SIMPLE_GET_SET(event);
542+-SIMPLE_GET_SET(charset);
543+-SIMPLE_GET_SET(src);
544+-SIMPLE_GET_SET(type);
545++SIMPLE_GET_SET(html_for)
546++SIMPLE_GET_SET(event)
547++SIMPLE_GET_SET(charset)
548++SIMPLE_GET_SET(src)
549++SIMPLE_GET_SET(type)
550+ 
551+ /**
552+  * Get the defer property
553+diff --git a/src/html/html_style_element.c b/src/html/html_style_element.c
554+index ae845be..6d4ecf6 100644
555+--- a/src/html/html_style_element.c
556++++ b/src/html/html_style_element.c
557+@@ -180,8 +180,8 @@ dom_exception dom_html_style_element_set_##attr(			\
558+ 	}
559+ 
560+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
561+-SIMPLE_GET_SET(type);
562+-SIMPLE_GET_SET(media);
563++SIMPLE_GET_SET(type)
564++SIMPLE_GET_SET(media)
565+ 
566+ /**
567+  * Get the disabled property
568+diff --git a/src/html/html_table_element.c b/src/html/html_table_element.c
569+index f197d07..a96717a 100644
570+--- a/src/html/html_table_element.c
571++++ b/src/html/html_table_element.c
572+@@ -187,15 +187,15 @@ dom_exception _dom_html_table_element_copy_internal(
573+ }
574+ 
575+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
576+-SIMPLE_GET_SET(align);
577+-SIMPLE_GET_SET(bg_color);
578+-SIMPLE_GET_SET(border);
579+-SIMPLE_GET_SET(cell_padding);
580+-SIMPLE_GET_SET(cell_spacing);
581+-SIMPLE_GET_SET(frame);
582+-SIMPLE_GET_SET(rules);
583+-SIMPLE_GET_SET(summary);
584+-SIMPLE_GET_SET(width);
585++SIMPLE_GET_SET(align)
586++SIMPLE_GET_SET(bg_color)
587++SIMPLE_GET_SET(border)
588++SIMPLE_GET_SET(cell_padding)
589++SIMPLE_GET_SET(cell_spacing)
590++SIMPLE_GET_SET(frame)
591++SIMPLE_GET_SET(rules)
592++SIMPLE_GET_SET(summary)
593++SIMPLE_GET_SET(width)
594+ 
595+ /**
596+  * Get the caption Attribute
597+diff --git a/src/html/html_tablecaption_element.c b/src/html/html_tablecaption_element.c
598+index cae229c..fa41525 100644
599+--- a/src/html/html_tablecaption_element.c
600++++ b/src/html/html_tablecaption_element.c
601+@@ -183,5 +183,5 @@ dom_exception _dom_html_table_caption_element_copy_internal(
602+ 			}
603+ 
604+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
605+-SIMPLE_GET_SET(align);
606++SIMPLE_GET_SET(align)
607+ 
608+diff --git a/src/html/html_tablecell_element.c b/src/html/html_tablecell_element.c
609+index 7a1f968..a3b3095 100644
610+--- a/src/html/html_tablecell_element.c
611++++ b/src/html/html_tablecell_element.c
612+@@ -185,17 +185,17 @@ dom_exception _dom_html_table_cell_element_copy_internal(
613+ 
614+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
615+ 
616+-SIMPLE_GET_SET(abbr);
617+-SIMPLE_GET_SET(align);
618+-SIMPLE_GET_SET(axis);
619+-SIMPLE_GET_SET(bg_color);
620+-SIMPLE_GET_SET(ch);
621+-SIMPLE_GET_SET(ch_off);
622+-SIMPLE_GET_SET(headers);
623+-SIMPLE_GET_SET(height);
624+-SIMPLE_GET_SET(scope);
625+-SIMPLE_GET_SET(v_align);
626+-SIMPLE_GET_SET(width);
627++SIMPLE_GET_SET(abbr)
628++SIMPLE_GET_SET(align)
629++SIMPLE_GET_SET(axis)
630++SIMPLE_GET_SET(bg_color)
631++SIMPLE_GET_SET(ch)
632++SIMPLE_GET_SET(ch_off)
633++SIMPLE_GET_SET(headers)
634++SIMPLE_GET_SET(height)
635++SIMPLE_GET_SET(scope)
636++SIMPLE_GET_SET(v_align)
637++SIMPLE_GET_SET(width)
638+ 
639+ /**
640+  * Get the cell_index property
641+diff --git a/src/html/html_tablecol_element.c b/src/html/html_tablecol_element.c
642+index 74169be..33be3e5 100644
643+--- a/src/html/html_tablecol_element.c
644++++ b/src/html/html_tablecol_element.c
645+@@ -207,9 +207,9 @@ dom_exception _dom_html_table_col_element_copy_internal(
646+ 			}
647+ 
648+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
649+-SIMPLE_GET_SET(align);
650+-SIMPLE_GET_SET(ch);
651+-SIMPLE_GET_SET(ch_off);
652+-SIMPLE_GET_SET(v_align);
653+-SIMPLE_GET_SET(width);
654++SIMPLE_GET_SET(align)
655++SIMPLE_GET_SET(ch)
656++SIMPLE_GET_SET(ch_off)
657++SIMPLE_GET_SET(v_align)
658++SIMPLE_GET_SET(width)
659+ 
660+diff --git a/src/html/html_tablerow_element.c b/src/html/html_tablerow_element.c
661+index fe7d929..b1ac520 100644
662+--- a/src/html/html_tablerow_element.c
663++++ b/src/html/html_tablerow_element.c
664+@@ -187,11 +187,11 @@ dom_exception _dom_html_table_row_element_copy_internal(
665+ 
666+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
667+ 
668+-SIMPLE_GET_SET(align);
669+-SIMPLE_GET_SET(bg_color);
670+-SIMPLE_GET_SET(ch);
671+-SIMPLE_GET_SET(ch_off);
672+-SIMPLE_GET_SET(v_align);
673++SIMPLE_GET_SET(align)
674++SIMPLE_GET_SET(bg_color)
675++SIMPLE_GET_SET(ch)
676++SIMPLE_GET_SET(ch_off)
677++SIMPLE_GET_SET(v_align)
678+ 
679+ /**
680+  * Get the index of the Row in logical order
681+diff --git a/src/html/html_tablesection_element.c b/src/html/html_tablesection_element.c
682+index f839758..7bb5289 100644
683+--- a/src/html/html_tablesection_element.c
684++++ b/src/html/html_tablesection_element.c
685+@@ -187,10 +187,10 @@ dom_exception _dom_html_table_section_element_copy_internal(
686+ }
687+ 
688+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
689+-SIMPLE_GET_SET(align);
690+-SIMPLE_GET_SET(ch);
691+-SIMPLE_GET_SET(ch_off);
692+-SIMPLE_GET_SET(v_align);
693++SIMPLE_GET_SET(align)
694++SIMPLE_GET_SET(ch)
695++SIMPLE_GET_SET(ch_off)
696++SIMPLE_GET_SET(v_align)
697+ 
698+ /* The callback function for  _dom_html_collection_create*/
699+ static bool table_section_callback(struct dom_node_internal *node, void *ctx)
700+diff --git a/src/html/html_text_area_element.c b/src/html/html_text_area_element.c
701+index 6117e83..b031360 100644
702+--- a/src/html/html_text_area_element.c
703++++ b/src/html/html_text_area_element.c
704+@@ -385,8 +385,8 @@ dom_exception dom_html_text_area_element_set_##attr(			\
705+ 
706+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
707+ 
708+-SIMPLE_GET_SET(access_key);
709+-SIMPLE_GET_SET(name);
710++SIMPLE_GET_SET(access_key)
711++SIMPLE_GET_SET(name)
712+ 
713+ dom_exception dom_html_text_area_element_get_type(
714+ 	dom_html_text_area_element *text_area, dom_string **type)
715+diff --git a/src/html/html_ulist_element.c b/src/html/html_ulist_element.c
716+index f2b87fb..11ecdfb 100644
717+--- a/src/html/html_ulist_element.c
718++++ b/src/html/html_ulist_element.c
719+@@ -208,4 +208,4 @@ dom_exception _dom_html_u_list_element_copy_internal(
720+ 
721+ #define SIMPLE_GET_SET(attr) SIMPLE_GET(attr) SIMPLE_SET(attr)
722+ 
723+-SIMPLE_GET_SET(type);
724++SIMPLE_GET_SET(type)
725+-- 
726+2.22.0
727+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 93b8a9bba18fc3166dd158484188b1730afdd382
+1, -0
1@@ -0,0 +1 @@
2+0.4.1 r0
+55, -0
 1@@ -0,0 +1,55 @@
 2+BEGIN {
 3+	for (i = 32; i <= 126; ++i)
 4+		ord[sprintf("%c", i)] = i
 5+	n = -1
 6+}
 7+
 8+function makenode(c) {
 9+	++n
10+	splits[n] = c
11+	left[n] = -1
12+	equal[n] = -1
13+	right[n] = -1
14+	values[n] = 0
15+}
16+
17+function insert(nodes, id, c) {
18+	nextid = nodes[id]
19+	if (nextid != -1)
20+		return nextid
21+	makenode(c)
22+	nodes[id] = n
23+	return n
24+}
25+
26+/^(#|$)/ {next}
27+
28+{
29+	id = 0
30+	c = ord[substr($1, 1, 1)]
31+	if (n < 0)
32+		makenode(c)
33+	for (i = 1; i <= length($1) + 1;) {
34+		if (c < splits[id]) {
35+			id = insert(left, id, c)
36+		} else if (c == splits[id]) {
37+			if (i >= length($1))
38+				values[id] = $2
39+			if (c == 0)
40+				break
41+			++i
42+			c = i <= length($1) ? ord[substr($1, i, 1)] : 0
43+			id = insert(equal, id, c)
44+		} else {
45+			id = insert(right, id, c)
46+		}
47+	}
48+}
49+
50+END {
51+	print "static hubbub_entity_node dict[] = {"
52+	for (i = 0; i <= n; ++i)
53+		print "\t{ "splits[i]", "left[i]", "equal[i]", "right[i]", "values[i]" },"
54+	print "};"
55+	print "static int32_t dict_root = 0;"
56+}
+39, -0
 1@@ -0,0 +1,39 @@
 2+cflags{
 3+	'-D NDEBUG',
 4+	'-I $outdir',
 5+	'-I $srcdir/src',
 6+	'-I $srcdir/include',
 7+	'-I $basedir/pkg/netsurf/libdom/src/include',
 8+	'-I $basedir/pkg/netsurf/libparserutils/src/include',
 9+	'-I $basedir/pkg/netsurf/libwapcaplet/src/include',
10+}
11+
12+build('awk', '$outdir/entities.inc', {'$srcdir/build/Entities', '|', '$dir/entities.awk'}, {
13+	expr='-f $dir/entities.awk',
14+})
15+
16+pkg.deps = {
17+	'$outdir/entities.inc',
18+	'pkg/netsurf/libdom/fetch',
19+	'pkg/netsurf/libparserutils/fetch',
20+	'pkg/netsurf/libwapcaplet/fetch',
21+}
22+
23+lib('libhubbub.a', [[src/(
24+	parser.c
25+	charset/detect.c
26+	tokeniser/(entities.c tokeniser.c)
27+	treebuilder/(
28+		treebuilder.c
29+		initial.c before_html.c before_head.c in_head.c
30+		in_head_noscript.c after_head.c in_body.c in_table.c
31+		in_caption.c in_column_group.c in_table_body.c in_row.c
32+		in_cell.c in_select.c in_select_in_table.c
33+		in_foreign_content.c after_body.c in_frameset.c
34+		after_frameset.c after_after_body.c after_after_frameset.c
35+		generic_rcdata.c
36+	)
37+	utils/(errors.c string.c)
38+) $builddir/pkg/netsurf/libparserutils/libparserutils.a]])
39+
40+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 41b3e0e617cfce96de85d4d031c4d131e3dc4cf4
+1, -0
1@@ -0,0 +1 @@
2+0.3.7 r0
+3, -0
1@@ -0,0 +1,3 @@
2+cflags{'-I $srcdir/include'}
3+lib('libnsbmp.a', {'src/libnsbmp.c'})
4+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 3155a7e9db2d7d7c2349a12bc892fa9ff68c2338
+1, -0
1@@ -0,0 +1 @@
2+0.1.6
+3, -0
1@@ -0,0 +1,3 @@
2+cflags{'-I $srcdir/include'}
3+lib('libnsgif.a', {'src/libnsgif.c', 'src/lzw.c'})
4+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit a937d161f6787ecc1c1bef9bad6039925ff13d72
+1, -0
1@@ -0,0 +1 @@
2+0.2.1
+8, -0
1@@ -0,0 +1,8 @@
2+cflags{'-I $srcdir/include'}
3+lib('libnsutils.a', {
4+	'src/base64.c',
5+	'src/time.c',
6+	'src/unistd.c',
7+})
8+
9+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 142a7945fb9fe477324f8df5e9645ef161042483
+1, -0
1@@ -0,0 +1 @@
2+0.1.0
+46, -0
 1@@ -0,0 +1,46 @@
 2+BEGIN {
 3+	print "static parserutils_charset_aliases_canon canonical_charset_names[] = {"
 4+	n = 0
 5+}
 6+
 7+/^(#|$)/ {next}
 8+
 9+function addalias(s) {
10+	s = tolower(s)
11+	gsub("[^a-z0-9]", "", s)
12+	if (!(s in aliases))
13+		++num_aliases
14+	aliases[s] = n
15+}
16+
17+
18+{
19+	print "\t{ "$2", "length($1)", \""$1"\" },"
20+	addalias($1)
21+	for (i = 3; i <= NF; ++i)
22+		addalias($i)
23+	if ($1 ~ /^ISO-10646-UCS-[24]$/ || $1 ~ /^UTF-(8$|16|32)/)
24+		isunicode = (isunicode ? (isunicode" || ") : "") "((x) == "$2")"
25+	++n
26+}
27+END {
28+	print "};"
29+
30+	print "static const uint16_t charset_aliases_canon_count = "n";"
31+
32+	print "typedef struct {"
33+	print "\tuint16_t name_len;"
34+	print "\tconst char *name;"
35+	print "\tparserutils_charset_aliases_canon *canon;"
36+	print "} parserutils_charset_aliases_alias;"
37+
38+	print "static parserutils_charset_aliases_alias charset_aliases[] = {"
39+	for (alias in aliases) {
40+		i = aliases[alias]
41+		print "\t{ "length(alias)", \""alias"\", &canonical_charset_names["i"] }," | "sort -t '\"' -k 2"
42+	}
43+	close("sort -t '\"' -k 2")
44+	print "};"
45+	print "static const uint16_t charset_aliases_count = "num_aliases";"
46+	print "#define MIBENUM_IS_UNICODE(x) ("isunicode")"
47+}
+20, -0
 1@@ -0,0 +1,20 @@
 2+cflags{
 3+	'-I $srcdir/include',
 4+	'-I $srcdir/src',
 5+}
 6+
 7+build('awk', '$outdir/aliases.inc', {'$srcdir/build/Aliases', '|', '$dir/aliases.awk'}, {
 8+	expr='-f $dir/aliases.awk',
 9+})
10+
11+cc('src/charset/aliases.c', {'$outdir/aliases.inc'}, {cflags='$cflags -I $outdir'})
12+lib('libparserutils.a', [[src/(
13+	charset/(
14+		aliases.c.o codec.c
15+		encodings/(utf8.c utf16.c)
16+	)
17+	input/(filter.c inputstream.c)
18+	utils/(buffer.c errors.c stack.c vector.c)
19+)]])
20+
21+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 269b0047aa506be93637e93d109a34f4bd7cefc4
+1, -0
1@@ -0,0 +1 @@
2+0.2.4
+892, -0
  1@@ -0,0 +1,892 @@
  2+/* ANSI-C code produced by gperf version 3.0.4 */
  3+/* Command-line: gperf --output-file=autogenerated_colors.c colors.gperf  */
  4+/* Computed positions: -k'1,3,6-8,12-13' */
  5+
  6+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
  7+      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
  8+      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
  9+      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
 10+      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
 11+      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
 12+      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
 13+      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
 14+      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
 15+      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
 16+      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
 17+      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
 18+      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
 19+      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
 20+      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
 21+      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
 22+      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
 23+      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
 24+      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
 25+      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
 26+      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
 27+      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
 28+      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
 29+/* The character set is not based on ISO-646.  */
 30+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
 31+#endif
 32+
 33+#line 15 "colors.gperf"
 34+
 35+#include <string.h>
 36+#include "svgtiny.h"
 37+#include "svgtiny_internal.h"
 38+
 39+#line 22 "colors.gperf"
 40+struct svgtiny_named_color;
 41+
 42+#define TOTAL_KEYWORDS 147
 43+#define MIN_WORD_LENGTH 3
 44+#define MAX_WORD_LENGTH 20
 45+#define MIN_HASH_VALUE 4
 46+#define MAX_HASH_VALUE 565
 47+/* maximum key range = 562, duplicates = 0 */
 48+
 49+#ifdef __GNUC__
 50+__inline
 51+#else
 52+#ifdef __cplusplus
 53+inline
 54+#endif
 55+#endif
 56+static unsigned int
 57+svgtiny_color_hash (register const char *str, register unsigned int len)
 58+{
 59+  static const unsigned short asso_values[] =
 60+    {
 61+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 62+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 63+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 64+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 65+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 66+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 67+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 68+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 69+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 70+      566, 566, 566, 566, 566, 566, 566,   5,  55,   0,
 71+       35,   0,  75,  10,   5,   0, 566, 250,  10,  40,
 72+       85,  60,  70, 144,   0,  20,  45,  10,  30, 185,
 73+       95, 195, 566,   0, 566, 566, 566, 566, 566, 566,
 74+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 75+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 76+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 77+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 78+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 79+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 80+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 81+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 82+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 83+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 84+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 85+      566, 566, 566, 566, 566, 566, 566, 566, 566, 566,
 86+      566, 566, 566, 566, 566, 566, 566, 566
 87+    };
 88+  register int hval = len;
 89+
 90+  switch (hval)
 91+    {
 92+      default:
 93+        hval += asso_values[(unsigned char)str[12]];
 94+      /*FALLTHROUGH*/
 95+      case 12:
 96+        hval += asso_values[(unsigned char)str[11]];
 97+      /*FALLTHROUGH*/
 98+      case 11:
 99+      case 10:
100+      case 9:
101+      case 8:
102+        hval += asso_values[(unsigned char)str[7]];
103+      /*FALLTHROUGH*/
104+      case 7:
105+        hval += asso_values[(unsigned char)str[6]];
106+      /*FALLTHROUGH*/
107+      case 6:
108+        hval += asso_values[(unsigned char)str[5]];
109+      /*FALLTHROUGH*/
110+      case 5:
111+      case 4:
112+      case 3:
113+        hval += asso_values[(unsigned char)str[2]+2];
114+      /*FALLTHROUGH*/
115+      case 2:
116+      case 1:
117+        hval += asso_values[(unsigned char)str[0]];
118+        break;
119+    }
120+  return hval;
121+}
122+
123+#ifdef __GNUC__
124+__inline
125+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
126+__attribute__ ((__gnu_inline__))
127+#endif
128+#endif
129+const struct svgtiny_named_color *
130+svgtiny_color_lookup (register const char *str, register unsigned int len)
131+{
132+  static const struct svgtiny_named_color wordlist[] =
133+    {
134+#line 44 "colors.gperf"
135+      {"cyan",		svgtiny_RGB(  0, 255, 255)},
136+#line 77 "colors.gperf"
137+      {"gray",		svgtiny_RGB(128, 128, 128)},
138+#line 38 "colors.gperf"
139+      {"chartreuse",	svgtiny_RGB(127, 255,   0)},
140+#line 78 "colors.gperf"
141+      {"grey",		svgtiny_RGB(128, 128, 128)},
142+#line 79 "colors.gperf"
143+      {"green",		svgtiny_RGB(  0, 128,   0)},
144+#line 97 "colors.gperf"
145+      {"lightgrey",	svgtiny_RGB(211, 211, 211)},
146+#line 96 "colors.gperf"
147+      {"lightgreen",	svgtiny_RGB(144, 238, 144)},
148+#line 95 "colors.gperf"
149+      {"lightgray",	svgtiny_RGB(211, 211, 211)},
150+#line 153 "colors.gperf"
151+      {"skyblue",	svgtiny_RGB(135, 206, 235)},
152+#line 156 "colors.gperf"
153+      {"slategrey",	svgtiny_RGB(112, 128, 144)},
154+#line 151 "colors.gperf"
155+      {"sienna",		svgtiny_RGB(160,  82,  45)},
156+#line 155 "colors.gperf"
157+      {"slategray",	svgtiny_RGB(112, 128, 144)},
158+#line 150 "colors.gperf"
159+      {"seashell",	svgtiny_RGB(255, 245, 238)},
160+#line 161 "colors.gperf"
161+      {"teal",		svgtiny_RGB(  0, 128, 128)},
162+#line 40 "colors.gperf"
163+      {"coral",		svgtiny_RGB(255, 127,  80)},
164+#line 99 "colors.gperf"
165+      {"lightsalmon",	svgtiny_RGB(255, 160, 122)},
166+#line 103 "colors.gperf"
167+      {"lightslategrey",	svgtiny_RGB(119, 136, 153)},
168+#line 31 "colors.gperf"
169+      {"black",		svgtiny_RGB(  0,   0,   0)},
170+#line 102 "colors.gperf"
171+      {"lightslategray",	svgtiny_RGB(119, 136, 153)},
172+#line 129 "colors.gperf"
173+      {"orange",		svgtiny_RGB(255, 165,   0)},
174+#line 130 "colors.gperf"
175+      {"orangered",	svgtiny_RGB(255,  69,   0)},
176+#line 30 "colors.gperf"
177+      {"bisque",		svgtiny_RGB(255, 228, 196)},
178+#line 106 "colors.gperf"
179+      {"lime",		svgtiny_RGB(  0, 255,   0)},
180+#line 143 "colors.gperf"
181+      {"red",		svgtiny_RGB(255,   0,   0)},
182+#line 107 "colors.gperf"
183+      {"limegreen",	svgtiny_RGB( 50, 205,  50)},
184+#line 92 "colors.gperf"
185+      {"lightcoral",	svgtiny_RGB(240, 128, 128)},
186+#line 145 "colors.gperf"
187+      {"royalblue",	svgtiny_RGB( 65, 105, 225)},
188+#line 108 "colors.gperf"
189+      {"linen",		svgtiny_RGB(250, 240, 230)},
190+#line 72 "colors.gperf"
191+      {"fuchsia",	svgtiny_RGB(255,   0, 255)},
192+#line 49 "colors.gperf"
193+      {"darkgreen",	svgtiny_RGB(  0, 100,   0)},
194+#line 91 "colors.gperf"
195+      {"lightblue",	svgtiny_RGB(173, 216, 230)},
196+#line 55 "colors.gperf"
197+      {"darkorchid",	svgtiny_RGB(153,  50, 204)},
198+#line 158 "colors.gperf"
199+      {"springgreen",	svgtiny_RGB(  0, 255, 127)},
200+#line 109 "colors.gperf"
201+      {"magenta",	svgtiny_RGB(255,   0, 255)},
202+#line 75 "colors.gperf"
203+      {"gold",		svgtiny_RGB(255, 215,   0)},
204+#line 131 "colors.gperf"
205+      {"orchid",		svgtiny_RGB(218, 112, 214)},
206+#line 154 "colors.gperf"
207+      {"slateblue",	svgtiny_RGB(106,  90, 205)},
208+#line 52 "colors.gperf"
209+      {"darkmagenta",	svgtiny_RGB(139, 0,   139)},
210+#line 45 "colors.gperf"
211+      {"darkblue",	svgtiny_RGB(  0,   0, 139)},
212+#line 104 "colors.gperf"
213+      {"lightsteelblue",	svgtiny_RGB(176, 196, 222)},
214+#line 152 "colors.gperf"
215+      {"silver",		svgtiny_RGB(192, 192, 192)},
216+#line 149 "colors.gperf"
217+      {"seagreen",	svgtiny_RGB( 46, 139,  87)},
218+#line 159 "colors.gperf"
219+      {"steelblue",	svgtiny_RGB( 70, 130, 180)},
220+#line 160 "colors.gperf"
221+      {"tan",		svgtiny_RGB(210, 180, 140)},
222+#line 138 "colors.gperf"
223+      {"peru",		svgtiny_RGB(205, 133,  63)},
224+#line 142 "colors.gperf"
225+      {"purple",		svgtiny_RGB(128,   0, 128)},
226+#line 56 "colors.gperf"
227+      {"darkred",	svgtiny_RGB(139,   0,   0)},
228+#line 121 "colors.gperf"
229+      {"mintcream",	svgtiny_RGB(245, 255, 250)},
230+#line 69 "colors.gperf"
231+      {"firebrick",	svgtiny_RGB(178,  34,  34)},
232+#line 100 "colors.gperf"
233+      {"lightseagreen",	svgtiny_RGB( 32, 178, 170)},
234+#line 53 "colors.gperf"
235+      {"darkolivegreen",	svgtiny_RGB( 85, 107,  47)},
236+#line 122 "colors.gperf"
237+      {"mistyrose",	svgtiny_RGB(255, 228, 225)},
238+#line 84 "colors.gperf"
239+      {"indigo",		svgtiny_RGB( 75,   0, 130)},
240+#line 126 "colors.gperf"
241+      {"oldlace",	svgtiny_RGB(253, 245, 230)},
242+#line 139 "colors.gperf"
243+      {"pink",		svgtiny_RGB(255, 192, 203)},
244+#line 57 "colors.gperf"
245+      {"darksalmon",	svgtiny_RGB(233, 150, 122)},
246+#line 87 "colors.gperf"
247+      {"lavender",	svgtiny_RGB(230, 230, 250)},
248+#line 85 "colors.gperf"
249+      {"ivory",		svgtiny_RGB(255, 255, 240)},
250+#line 123 "colors.gperf"
251+      {"moccasin",	svgtiny_RGB(255, 228, 181)},
252+#line 37 "colors.gperf"
253+      {"cadetblue",	svgtiny_RGB( 95, 158, 160)},
254+#line 63 "colors.gperf"
255+      {"darkviolet",	svgtiny_RGB(148,   0, 211)},
256+#line 146 "colors.gperf"
257+      {"saddlebrown",	svgtiny_RGB(139,  69,  19)},
258+#line 59 "colors.gperf"
259+      {"darkslateblue",	svgtiny_RGB( 72,  61, 139)},
260+#line 133 "colors.gperf"
261+      {"palegreen",	svgtiny_RGB(152, 251, 152)},
262+#line 157 "colors.gperf"
263+      {"snow",		svgtiny_RGB(255, 250, 250)},
264+#line 83 "colors.gperf"
265+      {"indianred",	svgtiny_RGB(205,  92,  92)},
266+#line 94 "colors.gperf"
267+      {"lightgoldenrodyellow",	svgtiny_RGB(250, 250, 210)},
268+#line 163 "colors.gperf"
269+      {"tomato",		svgtiny_RGB(255,  99,  71)},
270+#line 90 "colors.gperf"
271+      {"lemonchiffon",	svgtiny_RGB(255, 250, 205)},
272+#line 98 "colors.gperf"
273+      {"lightpink",	svgtiny_RGB(255, 182, 193)},
274+#line 110 "colors.gperf"
275+      {"maroon",		svgtiny_RGB(128,   0,   0)},
276+#line 88 "colors.gperf"
277+      {"lavenderblush",	svgtiny_RGB(255, 240, 245)},
278+#line 164 "colors.gperf"
279+      {"turquoise",	svgtiny_RGB( 64, 224, 208)},
280+#line 54 "colors.gperf"
281+      {"darkorange",	svgtiny_RGB(255, 140,   0)},
282+#line 125 "colors.gperf"
283+      {"navy",		svgtiny_RGB(  0,   0, 128)},
284+#line 68 "colors.gperf"
285+      {"dodgerblue",	svgtiny_RGB( 30, 144, 255)},
286+#line 71 "colors.gperf"
287+      {"forestgreen",	svgtiny_RGB( 34, 139,  34)},
288+#line 120 "colors.gperf"
289+      {"midnightblue",	svgtiny_RGB( 25,  25, 112)},
290+#line 115 "colors.gperf"
291+      {"mediumseagreen",	svgtiny_RGB( 60, 179, 113)},
292+#line 58 "colors.gperf"
293+      {"darkseagreen",	svgtiny_RGB(143, 188, 143)},
294+#line 26 "colors.gperf"
295+      {"aqua",		svgtiny_RGB(  0, 255, 255)},
296+#line 28 "colors.gperf"
297+      {"azure",		svgtiny_RGB(240, 255, 255)},
298+#line 147 "colors.gperf"
299+      {"salmon",		svgtiny_RGB(250, 128, 114)},
300+#line 166 "colors.gperf"
301+      {"wheat",		svgtiny_RGB(245, 222, 179)},
302+#line 35 "colors.gperf"
303+      {"brown",		svgtiny_RGB(165,  42,  42)},
304+#line 27 "colors.gperf"
305+      {"aquamarine",	svgtiny_RGB(127, 255, 212)},
306+#line 39 "colors.gperf"
307+      {"chocolate",	svgtiny_RGB(210, 105,  30)},
308+#line 89 "colors.gperf"
309+      {"lawngreen",	svgtiny_RGB(124, 252,   0)},
310+#line 148 "colors.gperf"
311+      {"sandybrown",	svgtiny_RGB(244, 164,  96)},
312+#line 93 "colors.gperf"
313+      {"lightcyan",	svgtiny_RGB(224, 255, 255)},
314+#line 165 "colors.gperf"
315+      {"violet",		svgtiny_RGB(238, 130, 238)},
316+#line 105 "colors.gperf"
317+      {"lightyellow",	svgtiny_RGB(255, 255, 224)},
318+#line 112 "colors.gperf"
319+      {"mediumblue",	svgtiny_RGB(  0,   0, 205)},
320+#line 137 "colors.gperf"
321+      {"peachpuff",	svgtiny_RGB(255, 218, 185)},
322+#line 80 "colors.gperf"
323+      {"greenyellow",	svgtiny_RGB(173, 255,  47)},
324+#line 25 "colors.gperf"
325+      {"antiquewhite",	svgtiny_RGB(250, 235, 215)},
326+#line 33 "colors.gperf"
327+      {"blue",		svgtiny_RGB(  0,   0, 255)},
328+#line 119 "colors.gperf"
329+      {"mediumvioletred",	svgtiny_RGB(199,  21, 133)},
330+#line 114 "colors.gperf"
331+      {"mediumpurple",	svgtiny_RGB(147, 112, 219)},
332+#line 76 "colors.gperf"
333+      {"goldenrod",	svgtiny_RGB(218, 165,  32)},
334+#line 32 "colors.gperf"
335+      {"blanchedalmond",	svgtiny_RGB(255, 235, 205)},
336+#line 86 "colors.gperf"
337+      {"khaki",		svgtiny_RGB(240, 230, 140)},
338+#line 140 "colors.gperf"
339+      {"plum",		svgtiny_RGB(221, 160, 221)},
340+#line 113 "colors.gperf"
341+      {"mediumorchid",	svgtiny_RGB(186,  85, 211)},
342+#line 144 "colors.gperf"
343+      {"rosybrown",	svgtiny_RGB(188, 143, 143)},
344+#line 116 "colors.gperf"
345+      {"mediumslateblue",	svgtiny_RGB(123, 104, 238)},
346+#line 62 "colors.gperf"
347+      {"darkturquoise",	svgtiny_RGB(  0, 206, 209)},
348+#line 135 "colors.gperf"
349+      {"palevioletred",	svgtiny_RGB(219, 112, 147)},
350+#line 136 "colors.gperf"
351+      {"papayawhip",	svgtiny_RGB(255, 239, 213)},
352+#line 117 "colors.gperf"
353+      {"mediumspringgreen",	svgtiny_RGB(  0, 250, 154)},
354+#line 50 "colors.gperf"
355+      {"darkgrey",	svgtiny_RGB(169, 169, 169)},
356+#line 118 "colors.gperf"
357+      {"mediumturquoise",	svgtiny_RGB( 72, 209, 204)},
358+#line 48 "colors.gperf"
359+      {"darkgray",	svgtiny_RGB(169, 169, 169)},
360+#line 47 "colors.gperf"
361+      {"darkgoldenrod",	svgtiny_RGB(184, 134,  11)},
362+#line 67 "colors.gperf"
363+      {"dimgrey",	svgtiny_RGB(105, 105, 105)},
364+#line 66 "colors.gperf"
365+      {"dimgray",	svgtiny_RGB(105, 105, 105)},
366+#line 81 "colors.gperf"
367+      {"honeydew",	svgtiny_RGB(240, 255, 240)},
368+#line 29 "colors.gperf"
369+      {"beige",		svgtiny_RGB(245, 245, 220)},
370+#line 162 "colors.gperf"
371+      {"thistle",	svgtiny_RGB(216, 191, 216)},
372+#line 42 "colors.gperf"
373+      {"cornsilk",	svgtiny_RGB(255, 248, 220)},
374+#line 127 "colors.gperf"
375+      {"olive",		svgtiny_RGB(128, 128,   0)},
376+#line 34 "colors.gperf"
377+      {"blueviolet",	svgtiny_RGB(138,  43, 226)},
378+#line 111 "colors.gperf"
379+      {"mediumaquamarine",	svgtiny_RGB(102, 205, 170)},
380+#line 41 "colors.gperf"
381+      {"cornflowerblue",	svgtiny_RGB(100, 149, 237)},
382+#line 24 "colors.gperf"
383+      {"aliceblue",	svgtiny_RGB(240, 248, 255)},
384+#line 141 "colors.gperf"
385+      {"powderblue",	svgtiny_RGB(176, 224, 230)},
386+#line 134 "colors.gperf"
387+      {"paleturquoise",	svgtiny_RGB(175, 238, 238)},
388+#line 61 "colors.gperf"
389+      {"darkslategrey",	svgtiny_RGB( 47,  79,  79)},
390+#line 51 "colors.gperf"
391+      {"darkkhaki",	svgtiny_RGB(189, 183, 107)},
392+#line 60 "colors.gperf"
393+      {"darkslategray",	svgtiny_RGB( 47,  79,  79)},
394+#line 74 "colors.gperf"
395+      {"ghostwhite",	svgtiny_RGB(248, 248, 255)},
396+#line 128 "colors.gperf"
397+      {"olivedrab",	svgtiny_RGB(107, 142,  35)},
398+#line 132 "colors.gperf"
399+      {"palegoldenrod",	svgtiny_RGB(238, 232, 170)},
400+#line 46 "colors.gperf"
401+      {"darkcyan",	svgtiny_RGB(  0, 139, 139)},
402+#line 82 "colors.gperf"
403+      {"hotpink",	svgtiny_RGB(255, 105, 180)},
404+#line 73 "colors.gperf"
405+      {"gainsboro",	svgtiny_RGB(220, 220, 220)},
406+#line 64 "colors.gperf"
407+      {"deeppink",	svgtiny_RGB(255,  20, 147)},
408+#line 43 "colors.gperf"
409+      {"crimson",	svgtiny_RGB(220,  20,  60)},
410+#line 36 "colors.gperf"
411+      {"burlywood",	svgtiny_RGB(222, 184, 135)},
412+#line 70 "colors.gperf"
413+      {"floralwhite",	svgtiny_RGB(255, 250, 240)},
414+#line 167 "colors.gperf"
415+      {"white",		svgtiny_RGB(255, 255, 255)},
416+#line 124 "colors.gperf"
417+      {"navajowhite",	svgtiny_RGB(255, 222, 173)},
418+#line 169 "colors.gperf"
419+      {"yellow",		svgtiny_RGB(255, 255,   0)},
420+#line 170 "colors.gperf"
421+      {"yellowgreen",	svgtiny_RGB(154, 205,  50)},
422+#line 101 "colors.gperf"
423+      {"lightskyblue",	svgtiny_RGB(135, 206, 250)},
424+#line 65 "colors.gperf"
425+      {"deepskyblue",	svgtiny_RGB(  0, 191, 255)},
426+#line 168 "colors.gperf"
427+      {"whitesmoke",	svgtiny_RGB(245, 245, 245)}
428+    };
429+
430+  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
431+    {
432+      register int key = svgtiny_color_hash (str, len);
433+
434+      if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
435+        {
436+          register const struct svgtiny_named_color *resword;
437+
438+          switch (key - 4)
439+            {
440+              case 0:
441+                resword = &wordlist[0];
442+                goto compare;
443+              case 10:
444+                resword = &wordlist[1];
445+                goto compare;
446+              case 16:
447+                resword = &wordlist[2];
448+                goto compare;
449+              case 20:
450+                resword = &wordlist[3];
451+                goto compare;
452+              case 21:
453+                resword = &wordlist[4];
454+                goto compare;
455+              case 25:
456+                resword = &wordlist[5];
457+                goto compare;
458+              case 26:
459+                resword = &wordlist[6];
460+                goto compare;
461+              case 30:
462+                resword = &wordlist[7];
463+                goto compare;
464+              case 33:
465+                resword = &wordlist[8];
466+                goto compare;
467+              case 35:
468+                resword = &wordlist[9];
469+                goto compare;
470+              case 37:
471+                resword = &wordlist[10];
472+                goto compare;
473+              case 40:
474+                resword = &wordlist[11];
475+                goto compare;
476+              case 44:
477+                resword = &wordlist[12];
478+                goto compare;
479+              case 45:
480+                resword = &wordlist[13];
481+                goto compare;
482+              case 46:
483+                resword = &wordlist[14];
484+                goto compare;
485+              case 52:
486+                resword = &wordlist[15];
487+                goto compare;
488+              case 55:
489+                resword = &wordlist[16];
490+                goto compare;
491+              case 56:
492+                resword = &wordlist[17];
493+                goto compare;
494+              case 60:
495+                resword = &wordlist[18];
496+                goto compare;
497+              case 62:
498+                resword = &wordlist[19];
499+                goto compare;
500+              case 65:
501+                resword = &wordlist[20];
502+                goto compare;
503+              case 67:
504+                resword = &wordlist[21];
505+                goto compare;
506+              case 70:
507+                resword = &wordlist[22];
508+                goto compare;
509+              case 74:
510+                resword = &wordlist[23];
511+                goto compare;
512+              case 75:
513+                resword = &wordlist[24];
514+                goto compare;
515+              case 76:
516+                resword = &wordlist[25];
517+                goto compare;
518+              case 80:
519+                resword = &wordlist[26];
520+                goto compare;
521+              case 81:
522+                resword = &wordlist[27];
523+                goto compare;
524+              case 83:
525+                resword = &wordlist[28];
526+                goto compare;
527+              case 85:
528+                resword = &wordlist[29];
529+                goto compare;
530+              case 90:
531+                resword = &wordlist[30];
532+                goto compare;
533+              case 91:
534+                resword = &wordlist[31];
535+                goto compare;
536+              case 92:
537+                resword = &wordlist[32];
538+                goto compare;
539+              case 93:
540+                resword = &wordlist[33];
541+                goto compare;
542+              case 95:
543+                resword = &wordlist[34];
544+                goto compare;
545+              case 97:
546+                resword = &wordlist[35];
547+                goto compare;
548+              case 100:
549+                resword = &wordlist[36];
550+                goto compare;
551+              case 102:
552+                resword = &wordlist[37];
553+                goto compare;
554+              case 104:
555+                resword = &wordlist[38];
556+                goto compare;
557+              case 105:
558+                resword = &wordlist[39];
559+                goto compare;
560+              case 107:
561+                resword = &wordlist[40];
562+                goto compare;
563+              case 109:
564+                resword = &wordlist[41];
565+                goto compare;
566+              case 110:
567+                resword = &wordlist[42];
568+                goto compare;
569+              case 114:
570+                resword = &wordlist[43];
571+                goto compare;
572+              case 115:
573+                resword = &wordlist[44];
574+                goto compare;
575+              case 117:
576+                resword = &wordlist[45];
577+                goto compare;
578+              case 118:
579+                resword = &wordlist[46];
580+                goto compare;
581+              case 120:
582+                resword = &wordlist[47];
583+                goto compare;
584+              case 125:
585+                resword = &wordlist[48];
586+                goto compare;
587+              case 129:
588+                resword = &wordlist[49];
589+                goto compare;
590+              case 130:
591+                resword = &wordlist[50];
592+                goto compare;
593+              case 135:
594+                resword = &wordlist[51];
595+                goto compare;
596+              case 137:
597+                resword = &wordlist[52];
598+                goto compare;
599+              case 138:
600+                resword = &wordlist[53];
601+                goto compare;
602+              case 140:
603+                resword = &wordlist[54];
604+                goto compare;
605+              case 141:
606+                resword = &wordlist[55];
607+                goto compare;
608+              case 144:
609+                resword = &wordlist[56];
610+                goto compare;
611+              case 145:
612+                resword = &wordlist[57];
613+                goto compare;
614+              case 149:
615+                resword = &wordlist[58];
616+                goto compare;
617+              case 155:
618+                resword = &wordlist[59];
619+                goto compare;
620+              case 156:
621+                resword = &wordlist[60];
622+                goto compare;
623+              case 157:
624+                resword = &wordlist[61];
625+                goto compare;
626+              case 159:
627+                resword = &wordlist[62];
628+                goto compare;
629+              case 160:
630+                resword = &wordlist[63];
631+                goto compare;
632+              case 164:
633+                resword = &wordlist[64];
634+                goto compare;
635+              case 165:
636+                resword = &wordlist[65];
637+                goto compare;
638+              case 166:
639+                resword = &wordlist[66];
640+                goto compare;
641+              case 167:
642+                resword = &wordlist[67];
643+                goto compare;
644+              case 168:
645+                resword = &wordlist[68];
646+                goto compare;
647+              case 170:
648+                resword = &wordlist[69];
649+                goto compare;
650+              case 172:
651+                resword = &wordlist[70];
652+                goto compare;
653+              case 174:
654+                resword = &wordlist[71];
655+                goto compare;
656+              case 175:
657+                resword = &wordlist[72];
658+                goto compare;
659+              case 176:
660+                resword = &wordlist[73];
661+                goto compare;
662+              case 180:
663+                resword = &wordlist[74];
664+                goto compare;
665+              case 181:
666+                resword = &wordlist[75];
667+                goto compare;
668+              case 182:
669+                resword = &wordlist[76];
670+                goto compare;
671+              case 183:
672+                resword = &wordlist[77];
673+                goto compare;
674+              case 185:
675+                resword = &wordlist[78];
676+                goto compare;
677+              case 188:
678+                resword = &wordlist[79];
679+                goto compare;
680+              case 190:
681+                resword = &wordlist[80];
682+                goto compare;
683+              case 191:
684+                resword = &wordlist[81];
685+                goto compare;
686+              case 192:
687+                resword = &wordlist[82];
688+                goto compare;
689+              case 196:
690+                resword = &wordlist[83];
691+                goto compare;
692+              case 200:
693+                resword = &wordlist[84];
694+                goto compare;
695+              case 201:
696+                resword = &wordlist[85];
697+                goto compare;
698+              case 209:
699+                resword = &wordlist[86];
700+                goto compare;
701+              case 210:
702+                resword = &wordlist[87];
703+                goto compare;
704+              case 211:
705+                resword = &wordlist[88];
706+                goto compare;
707+              case 215:
708+                resword = &wordlist[89];
709+                goto compare;
710+              case 221:
711+                resword = &wordlist[90];
712+                goto compare;
713+              case 222:
714+                resword = &wordlist[91];
715+                goto compare;
716+              case 226:
717+                resword = &wordlist[92];
718+                goto compare;
719+              case 230:
720+                resword = &wordlist[93];
721+                goto compare;
722+              case 232:
723+                resword = &wordlist[94];
724+                goto compare;
725+              case 238:
726+                resword = &wordlist[95];
727+                goto compare;
728+              case 240:
729+                resword = &wordlist[96];
730+                goto compare;
731+              case 241:
732+                resword = &wordlist[97];
733+                goto compare;
734+              case 243:
735+                resword = &wordlist[98];
736+                goto compare;
737+              case 245:
738+                resword = &wordlist[99];
739+                goto compare;
740+              case 250:
741+                resword = &wordlist[100];
742+                goto compare;
743+              case 251:
744+                resword = &wordlist[101];
745+                goto compare;
746+              case 255:
747+                resword = &wordlist[102];
748+                goto compare;
749+              case 258:
750+                resword = &wordlist[103];
751+                goto compare;
752+              case 260:
753+                resword = &wordlist[104];
754+                goto compare;
755+              case 261:
756+                resword = &wordlist[105];
757+                goto compare;
758+              case 263:
759+                resword = &wordlist[106];
760+                goto compare;
761+              case 269:
762+                resword = &wordlist[107];
763+                goto compare;
764+              case 271:
765+                resword = &wordlist[108];
766+                goto compare;
767+              case 278:
768+                resword = &wordlist[109];
769+                goto compare;
770+              case 279:
771+                resword = &wordlist[110];
772+                goto compare;
773+              case 281:
774+                resword = &wordlist[111];
775+                goto compare;
776+              case 284:
777+                resword = &wordlist[112];
778+                goto compare;
779+              case 289:
780+                resword = &wordlist[113];
781+                goto compare;
782+              case 293:
783+                resword = &wordlist[114];
784+                goto compare;
785+              case 298:
786+                resword = &wordlist[115];
787+                goto compare;
788+              case 299:
789+                resword = &wordlist[116];
790+                goto compare;
791+              case 306:
792+                resword = &wordlist[117];
793+                goto compare;
794+              case 308:
795+                resword = &wordlist[118];
796+                goto compare;
797+              case 309:
798+                resword = &wordlist[119];
799+                goto compare;
800+              case 311:
801+                resword = &wordlist[120];
802+                goto compare;
803+              case 316:
804+                resword = &wordlist[121];
805+                goto compare;
806+              case 321:
807+                resword = &wordlist[122];
808+                goto compare;
809+              case 330:
810+                resword = &wordlist[123];
811+                goto compare;
812+              case 335:
813+                resword = &wordlist[124];
814+                goto compare;
815+              case 336:
816+                resword = &wordlist[125];
817+                goto compare;
818+              case 338:
819+                resword = &wordlist[126];
820+                goto compare;
821+              case 344:
822+                resword = &wordlist[127];
823+                goto compare;
824+              case 345:
825+                resword = &wordlist[128];
826+                goto compare;
827+              case 349:
828+                resword = &wordlist[129];
829+                goto compare;
830+              case 350:
831+                resword = &wordlist[130];
832+                goto compare;
833+              case 355:
834+                resword = &wordlist[131];
835+                goto compare;
836+              case 364:
837+                resword = &wordlist[132];
838+                goto compare;
839+              case 369:
840+                resword = &wordlist[133];
841+                goto compare;
842+              case 373:
843+                resword = &wordlist[134];
844+                goto compare;
845+              case 380:
846+                resword = &wordlist[135];
847+                goto compare;
848+              case 384:
849+                resword = &wordlist[136];
850+                goto compare;
851+              case 398:
852+                resword = &wordlist[137];
853+                goto compare;
854+              case 410:
855+                resword = &wordlist[138];
856+                goto compare;
857+              case 426:
858+                resword = &wordlist[139];
859+                goto compare;
860+              case 436:
861+                resword = &wordlist[140];
862+                goto compare;
863+              case 437:
864+                resword = &wordlist[141];
865+                goto compare;
866+              case 467:
867+                resword = &wordlist[142];
868+                goto compare;
869+              case 482:
870+                resword = &wordlist[143];
871+                goto compare;
872+              case 483:
873+                resword = &wordlist[144];
874+                goto compare;
875+              case 552:
876+                resword = &wordlist[145];
877+                goto compare;
878+              case 561:
879+                resword = &wordlist[146];
880+                goto compare;
881+            }
882+          return 0;
883+        compare:
884+          {
885+            register const char *s = resword->name;
886+
887+            if (*str == *s && !strcmp (str + 1, s + 1))
888+              return resword;
889+          }
890+        }
891+    }
892+  return 0;
893+}
+21, -0
 1@@ -0,0 +1,21 @@
 2+cflags{
 3+	'-I $dir',
 4+	'-I $srcdir/include',
 5+	'-I $srcdir/src',
 6+	'-I $basedir/pkg/netsurf/libdom/src/include',
 7+	'-I $basedir/pkg/netsurf/libwapcaplet/src/include',
 8+	'-I $builddir/pkg/netsurf/libdom/include',
 9+}
10+
11+pkg.deps = {
12+	'pkg/netsurf/libdom/fetch',
13+	'pkg/netsurf/libdom/headers',
14+	'pkg/netsurf/libwapcaplet/fetch',
15+}
16+
17+lib('libsvgtiny.a', [[
18+	src/(svgtiny.c svgtiny_gradient.c svgtiny_list.c)
19+	$builddir/pkg/netsurf/libdom/libdom.a.d
20+]])
21+
22+fetch 'git'
+54, -0
 1@@ -0,0 +1,54 @@
 2+From 70be0635bf09e67202181de17b0ed4e6bafcd9b8 Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Mon, 12 Jun 2017 02:42:32 -0700
 5+Subject: [PATCH] Make stroke_width a float
 6+
 7+---
 8+ include/svgtiny.h      | 2 +-
 9+ src/svgtiny.c          | 3 +--
10+ src/svgtiny_internal.h | 2 +-
11+ 3 files changed, 3 insertions(+), 4 deletions(-)
12+
13+diff --git a/include/svgtiny.h b/include/svgtiny.h
14+index 85f146f..6acf42e 100644
15+--- a/include/svgtiny.h
16++++ b/include/svgtiny.h
17+@@ -29,7 +29,7 @@ struct svgtiny_shape {
18+ 	float text_x, text_y;
19+ 	svgtiny_colour fill;
20+ 	svgtiny_colour stroke;
21+-	int stroke_width;
22++	float stroke_width;
23+ };
24+ 
25+ struct svgtiny_diagram {
26+diff --git a/src/svgtiny.c b/src/svgtiny.c
27+index 8831b92..838e149 100644
28+--- a/src/svgtiny.c
29++++ b/src/svgtiny.c
30+@@ -1698,8 +1698,7 @@ struct svgtiny_shape *svgtiny_add_shape(struct svgtiny_parse_state *state)
31+ 	shape->text = 0;
32+ 	shape->fill = state->fill;
33+ 	shape->stroke = state->stroke;
34+-	shape->stroke_width = lroundf((float) state->stroke_width *
35+-			(state->ctm.a + state->ctm.d) / 2.0);
36++	shape->stroke_width = state->stroke_width * (state->ctm.a + state->ctm.d) / 2.0;
37+ 	if (0 < state->stroke_width && shape->stroke_width == 0)
38+ 		shape->stroke_width = 1;
39+ 
40+diff --git a/src/svgtiny_internal.h b/src/svgtiny_internal.h
41+index 6bf5d64..c0ef754 100644
42+--- a/src/svgtiny_internal.h
43++++ b/src/svgtiny_internal.h
44+@@ -51,7 +51,7 @@ struct svgtiny_parse_state {
45+ 	/* paint attributes */
46+ 	svgtiny_colour fill;
47+ 	svgtiny_colour stroke;
48+-	int stroke_width;
49++	float stroke_width;
50+ 
51+ 	/* gradients */
52+ 	struct svgtiny_parse_state_gradient fill_grad;
53+-- 
54+2.18.0
55+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit e31a20a97c6cd957ac4d858318f5819b90d97f77
+1, -0
1@@ -0,0 +1 @@
2+0.1.7
+3, -0
1@@ -0,0 +1,3 @@
2+cflags{'-I $srcdir/include'}
3+lib('libwapcaplet.a', {'src/libwapcaplet.c'})
4+fetch 'git'
+186, -0
  1@@ -0,0 +1,186 @@
  2+From f0f43a3ad6ee46d6e6378325fc03b1adadd35c41 Mon Sep 17 00:00:00 2001
  3+From: Michael Forney <mforney@mforney.org>
  4+Date: Mon, 1 Jul 2019 23:13:26 -0700
  5+Subject: [PATCH] Use static inline functions instead of macros
  6+
  7+---
  8+ include/libwapcaplet/libwapcaplet.h | 102 +++++++++++-----------------
  9+ 1 file changed, 39 insertions(+), 63 deletions(-)
 10+
 11+diff --git a/include/libwapcaplet/libwapcaplet.h b/include/libwapcaplet/libwapcaplet.h
 12+index 57e2e48..96dd7aa 100644
 13+--- a/include/libwapcaplet/libwapcaplet.h
 14++++ b/include/libwapcaplet/libwapcaplet.h
 15+@@ -133,17 +133,21 @@ extern lwc_error lwc_string_tolower(lwc_string *str, lwc_string **ret);
 16+  * @note Use this if copying the string and intending both sides to retain
 17+  * ownership.
 18+  */
 19+-#if defined(STMTEXPR)
 20+-#define lwc_string_ref(str) ({lwc_string *__lwc_s = (str); assert(__lwc_s != NULL); __lwc_s->refcnt++; __lwc_s;})
 21+-#else
 22+-static inline lwc_string *
 23+-lwc_string_ref(lwc_string *str)
 24++static inline lwc_string *lwc_string_ref(lwc_string *str)
 25+ {
 26+ 	assert(str != NULL);
 27+ 	str->refcnt++;
 28+ 	return str;
 29+ }
 30+-#endif
 31++
 32++/**
 33++ * Destroy an unreffed lwc_string.
 34++ *
 35++ * This destroys an lwc_string whose reference count indicates that it should be.
 36++ *
 37++ * @param str The string to unref.
 38++ */
 39++extern void lwc_string_destroy(lwc_string *str);
 40+ 
 41+ /**
 42+  * Release a reference on an lwc_string.
 43+@@ -156,23 +160,14 @@ lwc_string_ref(lwc_string *str)
 44+  *       freed. (Ref count of 1 where string is its own insensitve match
 45+  *       will also result in the string being freed.)
 46+  */
 47+-#define lwc_string_unref(str) {						\
 48+-		lwc_string *__lwc_s = (str);				\
 49+-		assert(__lwc_s != NULL);				\
 50+-		__lwc_s->refcnt--;						\
 51+-		if ((__lwc_s->refcnt == 0) ||					\
 52+-		    ((__lwc_s->refcnt == 1) && (__lwc_s->insensitive == __lwc_s)))	\
 53+-			lwc_string_destroy(__lwc_s);				\
 54+-	}
 55+-	
 56+-/**
 57+- * Destroy an unreffed lwc_string.
 58+- *
 59+- * This destroys an lwc_string whose reference count indicates that it should be.
 60+- *
 61+- * @param str The string to unref.
 62+- */
 63+-extern void lwc_string_destroy(lwc_string *str);
 64++static inline void lwc_string_unref(lwc_string *str)
 65++{
 66++	assert(str != NULL);
 67++	str->refcnt--;
 68++	if ((str->refcnt == 0) ||
 69++	    ((str->refcnt == 1) && (str->insensitive == str)))
 70++		lwc_string_destroy(str);
 71++}
 72+ 
 73+ /**
 74+  * Check if two interned strings are equal.
 75+@@ -183,8 +178,12 @@ extern void lwc_string_destroy(lwc_string *str);
 76+  * @return     Result of operation, if not ok then value pointed to
 77+  *	       by \a ret will not be valid.
 78+  */
 79+-#define lwc_string_isequal(str1, str2, ret) \
 80+-	((*(ret) = ((str1) == (str2))), lwc_error_ok)
 81++static inline lwc_error lwc_string_isequal(
 82++	lwc_string *str1, lwc_string *str2, bool *ret)
 83++{
 84++	*ret = (str1 == str2);
 85++	return lwc_error_ok;
 86++}
 87+ 
 88+ /**
 89+  * Intern a caseless copy of the passed string.
 90+@@ -200,7 +199,6 @@ extern void lwc_string_destroy(lwc_string *str);
 91+ extern lwc_error
 92+ lwc__intern_caseless_string(lwc_string *str);
 93+ 
 94+-#if defined(STMTEXPR)
 95+ /**
 96+  * Check if two interned strings are case-insensitively equal.
 97+  *
 98+@@ -210,33 +208,6 @@ lwc__intern_caseless_string(lwc_string *str);
 99+  * @return Result of operation, if not ok then value pointed to by \a ret will
100+  *	    not be valid.
101+  */
102+-#define lwc_string_caseless_isequal(_str1,_str2,_ret) ({                \
103+-            lwc_error __lwc_err = lwc_error_ok;                         \
104+-            lwc_string *__lwc_str1 = (_str1);                           \
105+-            lwc_string *__lwc_str2 = (_str2);                           \
106+-            bool *__lwc_ret = (_ret);                                   \
107+-                                                                        \
108+-            if (__lwc_str1->insensitive == NULL) {                      \
109+-                __lwc_err = lwc__intern_caseless_string(__lwc_str1);    \
110+-            }                                                           \
111+-            if (__lwc_err == lwc_error_ok && __lwc_str2->insensitive == NULL) { \
112+-                __lwc_err = lwc__intern_caseless_string(__lwc_str2);    \
113+-            }                                                           \
114+-            if (__lwc_err == lwc_error_ok)                              \
115+-                *__lwc_ret = (__lwc_str1->insensitive == __lwc_str2->insensitive); \
116+-            __lwc_err;                                                  \
117+-        })
118+-	
119+-#else
120+-/**
121+- * Check if two interned strings are case-insensitively equal.
122+- *
123+- * @param str1 The first string in the comparison.
124+- * @param str2 The second string in the comparison.
125+- * @param ret  A pointer to a boolean to be filled out with the result.
126+- * @return Result of operation, if not ok then value pointed to by \a ret will
127+- *         not be valid.
128+- */
129+ static inline lwc_error
130+ lwc_string_caseless_isequal(lwc_string *str1, lwc_string *str2, bool *ret)
131+ {
132+@@ -251,13 +222,6 @@ lwc_string_caseless_isequal(lwc_string *str1, lwc_string *str2, bool *ret)
133+            *ret = (str1->insensitive == str2->insensitive);
134+        return err;
135+ }
136+-#endif
137+-
138+-#if defined(STMTEXPR)
139+-#define lwc__assert_and_expr(str, expr) ({assert(str != NULL); expr;})
140+-#else
141+-#define lwc__assert_and_expr(str, expr) (expr)
142+-#endif
143+ 	
144+ /**
145+  * Retrieve the data pointer for an interned string.
146+@@ -271,7 +235,11 @@ lwc_string_caseless_isequal(lwc_string *str1, lwc_string *str2, bool *ret)
147+  *	 in future.  Any code relying on it currently should be
148+  *	 modified to use ::lwc_string_length if possible.
149+  */
150+-#define lwc_string_data(str) lwc__assert_and_expr(str, (const char *)((str)+1))
151++static inline const char *lwc_string_data(lwc_string *str)
152++{
153++	assert(str != NULL);
154++	return (const char *)(str + 1);
155++}
156+ 
157+ /**
158+  * Retrieve the data length for an interned string.
159+@@ -279,7 +247,11 @@ lwc_string_caseless_isequal(lwc_string *str1, lwc_string *str2, bool *ret)
160+  * @param str The string to retrieve the length of.
161+  * @return    The length of \a str.
162+  */
163+-#define lwc_string_length(str) lwc__assert_and_expr(str, (str)->len)
164++static inline size_t lwc_string_length(lwc_string *str)
165++{
166++	assert(str != NULL);
167++	return str->len;
168++}
169+ 
170+ /**
171+  * Retrieve (or compute if unavailable) a hash value for the content of the string.
172+@@ -293,7 +265,11 @@ lwc_string_caseless_isequal(lwc_string *str1, lwc_string *str2, bool *ret)
173+  *	 to be stable between invocations of the program. Never use the hash
174+  *	 value as a way to directly identify the value of the string.
175+  */
176+-#define lwc_string_hash_value(str) lwc__assert_and_expr(str, (str)->hash)
177++static inline lwc_hash lwc_string_hash_value(lwc_string *str)
178++{
179++	assert(str != NULL);
180++	return str->hash;
181++}
182+ 
183+ /**
184+  * Retrieve a hash value for the caseless content of the string.
185+-- 
186+2.26.2
187+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit b5e42b12211a92339b0b62cb90f1a86a397e146e
+1, -0
1@@ -0,0 +1 @@
2+0.4.3 r0
+9, -0
 1@@ -0,0 +1,9 @@
 2+/^(#|$)/ {next}
 3+{
 4+	i = index($0, ":")
 5+	if (!i)
 6+		next
 7+	split(substr($0, 1, i - 1), key, ".")
 8+	if (lang == key[1] && (filter == "any" || key[2] == "all" || key[3] == filter))
 9+		print key[3] substr($0, i)
10+}
+1, -0
1@@ -0,0 +1 @@
2+fdde93ab180222bda8e2135dbb52d7cc1b63c66eaa5da74782f1ce6d894df8b1  netsurf-all-3.6.tar.gz
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 72bd341d6ecf67bb5582fd48e0006b9c2631b4c7
+8, -0
1@@ -0,0 +1,8 @@
2+#ifndef NETSURF_REVISION_TESTAMENT
3+#define NETSURF_REVISION_TESTAMENT 1
4+
5+#define WT_NO_GIT 1
6+#define WT_MODIFIED 0
7+#define WT_MODIFICATIONS {{NULL, NULL}}
8+
9+#endif
+1, -0
1@@ -0,0 +1 @@
2+3.10 r6
+75, -0
 1@@ -0,0 +1,75 @@
 2+/* #undef AC_APPLE_UNIVERSAL_BUILD */
 3+#define HAVE_ALARM 1
 4+#ifdef HAVE___BUILTIN_CLZ
 5+# define HAVE_BUILTIN_CLZ /**/
 6+#endif
 7+#define HAVE_DLFCN_H 1
 8+#define HAVE_FEDIVBYZERO 1
 9+/* #undef HAVE_FEENABLEEXCEPT */
10+#define HAVE_FENV_H 1
11+#define HAVE_FLOAT128 /**/
12+#define HAVE_GCC_VECTOR_EXTENSIONS /**/
13+/* #undef HAVE_GETISAX */
14+#define HAVE_GETPAGESIZE 1
15+#define HAVE_GETTIMEOFDAY 1
16+#define HAVE_INTTYPES_H 1
17+/* #undef HAVE_LIBPIXMAN_1 */
18+/* #undef HAVE_LIBPNG */
19+#define HAVE_MEMORY_H 1
20+#define HAVE_MMAP 1
21+#define HAVE_MPROTECT 1
22+#define HAVE_POSIX_MEMALIGN 1
23+#define HAVE_PTHREADS /**/
24+#define HAVE_SIGACTION 1
25+#define HAVE_STDINT_H 1
26+#define HAVE_STDLIB_H 1
27+#define HAVE_STRINGS_H 1
28+#define HAVE_STRING_H 1
29+#define HAVE_SYS_MMAN_H 1
30+#define HAVE_SYS_STAT_H 1
31+#define HAVE_SYS_TYPES_H 1
32+#define HAVE_UNISTD_H 1
33+#define LT_OBJDIR ".libs/"
34+#define PACKAGE "pixman"
35+#define PACKAGE_BUGREPORT "pixman@lists.freedesktop.org"
36+#define PACKAGE_NAME "pixman"
37+#define PACKAGE_STRING "pixman 0.40.0"
38+#define PACKAGE_TARNAME "pixman"
39+#define PACKAGE_URL ""
40+#define PACKAGE_VERSION "0.40.0"
41+/* #undef PIXMAN_GNUPLOT */
42+/* #undef PIXMAN_TIMERS */
43+#define SIZEOF_LONG 8
44+#define STDC_HEADERS 1
45+#ifdef HAVE__THREAD_LOCAL
46+# define TLS _Thread_local
47+#endif
48+#define TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR /**/
49+/* #undef USE_ARM_IWMMXT */
50+/* #undef USE_ARM_NEON */
51+/* #undef USE_ARM_SIMD */
52+#define USE_GCC_INLINE_ASM 1
53+/* #undef USE_LOONGSON_MMI */
54+/* #undef USE_MIPS_DSPR2 */
55+/* #undef USE_OPENMP */
56+/* #undef USE_VMX */
57+#define VERSION "0.40.0"
58+#if defined AC_APPLE_UNIVERSAL_BUILD
59+# if defined __BIG_ENDIAN__
60+#  define WORDS_BIGENDIAN 1
61+# endif
62+#else
63+# ifndef WORDS_BIGENDIAN
64+/* #  undef WORDS_BIGENDIAN */
65+# endif
66+#endif
67+#ifndef __cplusplus
68+/* #undef inline */
69+#endif
70+/* #undef sqrtf */
71+
72+#ifdef __x86_64__
73+# define USE_SSE2 1
74+# define USE_SSE3 1
75+# define USE_X86_MMX 1
76+#endif
+71, -0
 1@@ -0,0 +1,71 @@
 2+cflags{
 3+	'-D HAVE_CONFIG_H',
 4+	'-I $outdir',
 5+	'-I $outdir/include',
 6+}
 7+
 8+build('cat', '$outdir/config.h', {
 9+	'$builddir/probe/HAVE__THREAD_LOCAL',
10+	'$builddir/probe/HAVE___BUILTIN_CLZ',
11+	'$dir/config.h',
12+})
13+
14+build('sed', '$outdir/include/pixman-version.h', '$srcdir/pixman/pixman-version.h.in', {
15+	expr={
16+		'-e s,@PIXMAN_VERSION_MAJOR@,0,',
17+		'-e s,@PIXMAN_VERSION_MINOR@,40,',
18+		'-e s,@PIXMAN_VERSION_MICRO@,0,',
19+	},
20+})
21+
22+pkg.hdrs = {
23+	copy('$outdir/include', '$srcdir/pixman', {'pixman.h'}),
24+	'$outdir/include/pixman-version.h',
25+}
26+pkg.deps = {
27+	'$gendir/headers',
28+	'$outdir/config.h',
29+}
30+
31+-- x86_64
32+cc('pixman/pixman-mmx.c', nil, {cflags='$cflags -mmmx -Winline'})
33+cc('pixman/pixman-sse2.c', nil, {cflags='$cflags -msse2 -Winline'})
34+cc('pixman/pixman-ssse3.c', nil, {cflags='$cflags -mssse3 -Winline'})
35+
36+lib('libpixman.a', [[
37+	pixman/(
38+		pixman.c
39+		pixman-access.c
40+		pixman-access-accessors.c
41+		pixman-bits-image.c
42+		pixman-combine32.c
43+		pixman-combine-float.c
44+		pixman-conical-gradient.c
45+		pixman-filter.c
46+		pixman-x86.c
47+		pixman-mips.c
48+		pixman-arm.c
49+		pixman-ppc.c
50+		pixman-edge.c
51+		pixman-edge-accessors.c
52+		pixman-fast-path.c
53+		pixman-glyph.c
54+		pixman-general.c
55+		pixman-gradient-walker.c
56+		pixman-image.c
57+		pixman-implementation.c
58+		pixman-linear-gradient.c
59+		pixman-matrix.c
60+		pixman-noop.c
61+		pixman-radial-gradient.c
62+		pixman-region16.c
63+		pixman-region32.c
64+		pixman-solid-fill.c
65+		pixman-timer.c
66+		pixman-trap.c
67+		pixman-utils.c
68+		@x86_64(pixman-mmx.c.o pixman-sse2.c.o pixman-ssse3.c.o)
69+	)
70+]])
71+
72+fetch 'git'
+60, -0
 1@@ -0,0 +1,60 @@
 2+From 76c1b0d85878fb3eb6cba54b5a67ad3df095bad7 Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Thu, 11 Jul 2019 00:12:19 -0700
 5+Subject: [PATCH] Prevent empty top-level declaration
 6+Upstream: https://lists.freedesktop.org/archives/pixman/2019-November/004896.html
 7+
 8+The expansion of PIXMAN_DEFINE_THREAD_LOCAL(...) may end in a
 9+function definition, so the following semicolon is considered an
10+empty top-level declaration, which is not allowed in ISO C.
11+---
12+ pixman/pixman-compiler.h       | 6 +++---
13+ pixman/pixman-implementation.c | 2 +-
14+ 2 files changed, 4 insertions(+), 4 deletions(-)
15+
16+diff --git a/pixman/pixman-compiler.h b/pixman/pixman-compiler.h
17+index a02aa49..6394156 100644
18+--- a/pixman/pixman-compiler.h
19++++ b/pixman/pixman-compiler.h
20+@@ -109,14 +109,14 @@
21+ #if defined(PIXMAN_NO_TLS)
22+ 
23+ #   define PIXMAN_DEFINE_THREAD_LOCAL(type, name)			\
24+-    static type name
25++    static type name;
26+ #   define PIXMAN_GET_THREAD_LOCAL(name)				\
27+     (&name)
28+ 
29+ #elif defined(TLS)
30+ 
31+ #   define PIXMAN_DEFINE_THREAD_LOCAL(type, name)			\
32+-    static TLS type name
33++    static TLS type name;
34+ #   define PIXMAN_GET_THREAD_LOCAL(name)				\
35+     (&name)
36+ 
37+@@ -176,7 +176,7 @@
38+ #elif defined(_MSC_VER)
39+ 
40+ #   define PIXMAN_DEFINE_THREAD_LOCAL(type, name)			\
41+-    static __declspec(thread) type name
42++    static __declspec(thread) type name;
43+ #   define PIXMAN_GET_THREAD_LOCAL(name)				\
44+     (&name)
45+ 
46+diff --git a/pixman/pixman-implementation.c b/pixman/pixman-implementation.c
47+index 2c7de4c..5a2cbfe 100644
48+--- a/pixman/pixman-implementation.c
49++++ b/pixman/pixman-implementation.c
50+@@ -63,7 +63,7 @@ typedef struct
51+     } cache [N_CACHED_FAST_PATHS];
52+ } cache_t;
53+ 
54+-PIXMAN_DEFINE_THREAD_LOCAL (cache_t, fast_path_cache);
55++PIXMAN_DEFINE_THREAD_LOCAL (cache_t, fast_path_cache)
56+ 
57+ static void
58+ dummy_composite_rect (pixman_implementation_t *imp,
59+-- 
60+2.26.2
61+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit e8df10eea9609609568bf4cbc05796594c1b978d
+1, -0
1@@ -0,0 +1 @@
2+0.40.0 r0
+473, -0
  1@@ -0,0 +1,473 @@
  2+/* See LICENSE file for copyright and license details. */
  3+
  4+/*
  5+ * appearance
  6+ *
  7+ * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
  8+ */
  9+static char font[] = "Tamzen:pixelsize=14";
 10+static int borderpx = 2;
 11+
 12+/*
 13+ * What program is execed by st depends of these precedence rules:
 14+ * 1: program passed with -e
 15+ * 2: utmp option
 16+ * 3: SHELL environment variable
 17+ * 4: value of shell in /etc/passwd
 18+ * 5: value of shell in config.h
 19+ */
 20+static char shell[] = "/bin/sh";
 21+static char *utmp = NULL;
 22+static char stty_args[] = "stty raw pass8 nl -echo -iexten -cstopb 38400";
 23+
 24+/* identification sequence returned in DA and DECID */
 25+static char vtiden[] = "\033[?6c";
 26+
 27+/* Kerning / character bounding-box multipliers */
 28+static float cwscale = 1.0;
 29+static float chscale = 1.0;
 30+
 31+/*
 32+ * word delimiter string
 33+ *
 34+ * More advanced example: " `'\"()[]{}"
 35+ */
 36+static char worddelimiters[] = " ";
 37+
 38+/* selection timeouts (in milliseconds) */
 39+static unsigned int doubleclicktimeout = 300;
 40+static unsigned int tripleclicktimeout = 600;
 41+
 42+/* key repeat timeouts (in milliseconds) */
 43+static unsigned int keyrepeatdelay = 500;
 44+static unsigned int keyrepeatinterval = 25;
 45+
 46+/* alt screens */
 47+static int allowaltscreen = 1;
 48+
 49+/*
 50+ * blinking timeout (set to 0 to disable blinking) for the terminal blinking
 51+ * attribute.
 52+ */
 53+static unsigned int blinktimeout = 800;
 54+
 55+/*
 56+ * thickness of underline and bar cursors
 57+ */
 58+static unsigned int cursorthickness = 2;
 59+
 60+/*
 61+ * bell volume. It must be a value between -100 and 100. Use 0 for disabling
 62+ * it
 63+ */
 64+/* XXX: Wayland does not have a bell.
 65+ * static int bellvolume = 0;
 66+ */
 67+
 68+/* default TERM value */
 69+static char termname[] = "st-256color";
 70+
 71+/*
 72+ * spaces per tab
 73+ *
 74+ * When you are changing this value, don't forget to adapt the »it« value in
 75+ * the st.info and appropriately install the st.info in the environment where
 76+ * you use this st version.
 77+ *
 78+ *	it#$tabspaces,
 79+ *
 80+ * Secondly make sure your kernel is not expanding tabs. When running `stty
 81+ * -a` »tab0« should appear. You can tell the terminal to not expand tabs by
 82+ *  running following command:
 83+ *
 84+ *	stty tabs
 85+ */
 86+static unsigned int tabspaces = 8;
 87+
 88+/* Terminal colors (16 first used in escape sequence) */
 89+static const char *colorname[] = {
 90+	/* 8 normal colors */
 91+	"#000000",
 92+	"#a40000",
 93+	"#4e9a06",
 94+	"#c4a000",
 95+	"#204a87",
 96+	"#ce5c00",
 97+	"#038e82",
 98+	"#eaede6",
 99+
100+	/* 8 bright colors */
101+	"#555753",
102+	"#cc0000",
103+	"#73d216",
104+	"#edd400",
105+	"#3465a4",
106+	"#f57900",
107+	"#05d2c1",
108+	"#ffffff",
109+
110+	[255] = 0,
111+
112+	/* more colors can be added after 255 to use with DefaultXX */
113+	"#cccccc",
114+	"#555555",
115+
116+	/* background */
117+	"#000000",
118+
119+	/* foreground */
120+	"#babdb6"
121+};
122+
123+
124+/*
125+ * Default colors (colorname index)
126+ * foreground, background, cursor, reverse cursor
127+ */
128+static unsigned int defaultfg = 259;
129+static unsigned int defaultbg = 258;
130+static unsigned int defaultcs = 256;
131+static unsigned int defaultrcs = 257;
132+
133+/*
134+ * Default shape of cursor
135+ * 2: Block ("â–ˆ")
136+ * 4: Underline ("_")
137+ * 6: Bar ("|")
138+ * 7: Snowman ("☃")
139+ */
140+static unsigned int cursorshape = 2;
141+
142+/*
143+ * Default columns and rows numbers
144+ */
145+
146+static unsigned int cols = 80;
147+static unsigned int rows = 24;
148+
149+/*
150+ * Default shape of the mouse cursor
151+ */
152+static char mouseshape[] = "xterm";
153+
154+/*
155+ * Color used to display font attributes when fontconfig selected a font which
156+ * doesn't match the ones requested.
157+ */
158+static unsigned int defaultattr = 11;
159+
160+/*
161+ * Internal mouse shortcuts.
162+ * Beware that overloading Button1 will disable the selection.
163+ */
164+static MouseShortcut mshortcuts[] = {
165+	/* button               mask            string */
166+	{ -1,                   MOD_MASK_NONE,  "" }
167+};
168+
169+static Axiskey ashortcuts[] = {
170+	/* axis		    direction	mask		string */
171+	{ AXIS_VERTICAL,    +1,		MOD_MASK_ANY,	"\031"},
172+	{ AXIS_VERTICAL,    -1,		MOD_MASK_ANY,	"\005"},
173+};
174+
175+/* Internal keyboard shortcuts. */
176+#define MODKEY MOD_MASK_ALT
177+
178+static Shortcut shortcuts[] = {
179+	/* modifier                     key                     function        argument */
180+	{ MOD_MASK_ANY,                 XKB_KEY_Break,          sendbreak,      {.i =  0} },
181+	{ MOD_MASK_CTRL,                XKB_KEY_Print,          toggleprinter,  {.i =  0} },
182+	{ MOD_MASK_SHIFT,               XKB_KEY_Print,          printscreen,    {.i =  0} },
183+	{ MOD_MASK_ANY,                 XKB_KEY_Print,          printsel,       {.i =  0} },
184+	{ MODKEY|MOD_MASK_SHIFT,        XKB_KEY_Prior,          wlzoom,         {.f = +1} },
185+	{ MODKEY|MOD_MASK_SHIFT,        XKB_KEY_Next,           wlzoom,         {.f = -1} },
186+	{ MODKEY|MOD_MASK_SHIFT,        XKB_KEY_Home,           wlzoomreset,    {.f =  0} },
187+	{ MOD_MASK_SHIFT,               XKB_KEY_Insert,         selpaste,       {.i =  0} },
188+	{ MODKEY,                       XKB_KEY_Num_Lock,       numlock,        {.i =  0} },
189+	{ MODKEY,                       XKB_KEY_Control_L,      iso14755,       {.i =  0} },
190+};
191+
192+/*
193+ * Special keys (change & recompile st.info accordingly)
194+ *
195+ * Mask value:
196+ * * Use MOD_MASK_ANY to match the key no matter modifiers state
197+ * * Use MOD_MASK_NONE to match the key alone (no modifiers)
198+ * appkey value:
199+ * * 0: no value
200+ * * > 0: keypad application mode enabled
201+ * *   = 2: term.numlock = 1
202+ * * < 0: keypad application mode disabled
203+ * appcursor value:
204+ * * 0: no value
205+ * * > 0: cursor application mode enabled
206+ * * < 0: cursor application mode disabled
207+ * crlf value
208+ * * 0: no value
209+ * * > 0: crlf mode is enabled
210+ * * < 0: crlf mode is disabled
211+ *
212+ * Be careful with the order of the definitions because st searches in
213+ * this table sequentially, so any MOD_MASK_ANY must be in the last
214+ * position for a key.
215+ */
216+
217+/*
218+ * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
219+ * to be mapped below, add them to this array.
220+ */
221+static xkb_keysym_t mappedkeys[] = { -1 };
222+
223+/* State bits to ignore when matching key or button events. */
224+static uint ignoremod = 0;
225+
226+/*
227+ * Override mouse-select while mask is active (when MODE_MOUSE is set).
228+ * Note that if you want to use MOD_MASK_SHIFT with selmasks, set this to an
229+ * other modifier, set to 0 to not use it.
230+ */
231+static uint forceselmod = MOD_MASK_SHIFT;
232+
233+/*
234+ * This is the huge key array which defines all compatibility to the Linux
235+ * world. Please decide about changes wisely.
236+ */
237+static Key key[] = {
238+	/* keysym                mask             string      appkey appcursor crlf */
239+	{ XKB_KEY_KP_Home,       MOD_MASK_SHIFT,  "\033[2J",       0,   -1,    0},
240+	{ XKB_KEY_KP_Home,       MOD_MASK_SHIFT,  "\033[1;2H",     0,   +1,    0},
241+	{ XKB_KEY_KP_Home,       MOD_MASK_ANY,    "\033[H",        0,   -1,    0},
242+	{ XKB_KEY_KP_Home,       MOD_MASK_ANY,    "\033[1~",       0,   +1,    0},
243+	{ XKB_KEY_KP_Up,         MOD_MASK_ANY,    "\033Ox",       +1,    0,    0},
244+	{ XKB_KEY_KP_Up,         MOD_MASK_ANY,    "\033[A",        0,   -1,    0},
245+	{ XKB_KEY_KP_Up,         MOD_MASK_ANY,    "\033OA",        0,   +1,    0},
246+	{ XKB_KEY_KP_Down,       MOD_MASK_ANY,    "\033Or",       +1,    0,    0},
247+	{ XKB_KEY_KP_Down,       MOD_MASK_ANY,    "\033[B",        0,   -1,    0},
248+	{ XKB_KEY_KP_Down,       MOD_MASK_ANY,    "\033OB",        0,   +1,    0},
249+	{ XKB_KEY_KP_Left,       MOD_MASK_ANY,    "\033Ot",       +1,    0,    0},
250+	{ XKB_KEY_KP_Left,       MOD_MASK_ANY,    "\033[D",        0,   -1,    0},
251+	{ XKB_KEY_KP_Left,       MOD_MASK_ANY,    "\033OD",        0,   +1,    0},
252+	{ XKB_KEY_KP_Right,      MOD_MASK_ANY,    "\033Ov",       +1,    0,    0},
253+	{ XKB_KEY_KP_Right,      MOD_MASK_ANY,    "\033[C",        0,   -1,    0},
254+	{ XKB_KEY_KP_Right,      MOD_MASK_ANY,    "\033OC",        0,   +1,    0},
255+	{ XKB_KEY_KP_Prior,      MOD_MASK_SHIFT,  "\033[5;2~",     0,    0,    0},
256+	{ XKB_KEY_KP_Prior,      MOD_MASK_ANY,    "\033[5~",       0,    0,    0},
257+	{ XKB_KEY_KP_Begin,      MOD_MASK_ANY,    "\033[E",        0,    0,    0},
258+	{ XKB_KEY_KP_End,        MOD_MASK_CTRL,   "\033[J",       -1,    0,    0},
259+	{ XKB_KEY_KP_End,        MOD_MASK_CTRL,   "\033[1;5F",    +1,    0,    0},
260+	{ XKB_KEY_KP_End,        MOD_MASK_SHIFT,  "\033[K",       -1,    0,    0},
261+	{ XKB_KEY_KP_End,        MOD_MASK_SHIFT,  "\033[1;2F",    +1,    0,    0},
262+	{ XKB_KEY_KP_End,        MOD_MASK_ANY,    "\033[4~",       0,    0,    0},
263+	{ XKB_KEY_KP_Next,       MOD_MASK_SHIFT,  "\033[6;2~",     0,    0,    0},
264+	{ XKB_KEY_KP_Next,       MOD_MASK_ANY,    "\033[6~",       0,    0,    0},
265+	{ XKB_KEY_KP_Insert,     MOD_MASK_SHIFT,  "\033[2;2~",    +1,    0,    0},
266+	{ XKB_KEY_KP_Insert,     MOD_MASK_SHIFT,  "\033[4l",      -1,    0,    0},
267+	{ XKB_KEY_KP_Insert,     MOD_MASK_CTRL,   "\033[L",       -1,    0,    0},
268+	{ XKB_KEY_KP_Insert,     MOD_MASK_CTRL,   "\033[2;5~",    +1,    0,    0},
269+	{ XKB_KEY_KP_Insert,     MOD_MASK_ANY,    "\033[4h",      -1,    0,    0},
270+	{ XKB_KEY_KP_Insert,     MOD_MASK_ANY,    "\033[2~",      +1,    0,    0},
271+	{ XKB_KEY_KP_Delete,     MOD_MASK_CTRL,   "\033[M",       -1,    0,    0},
272+	{ XKB_KEY_KP_Delete,     MOD_MASK_CTRL,   "\033[3;5~",    +1,    0,    0},
273+	{ XKB_KEY_KP_Delete,     MOD_MASK_SHIFT,  "\033[2K",      -1,    0,    0},
274+	{ XKB_KEY_KP_Delete,     MOD_MASK_SHIFT,  "\033[3;2~",    +1,    0,    0},
275+	{ XKB_KEY_KP_Delete,     MOD_MASK_ANY,    "\033[P",       -1,    0,    0},
276+	{ XKB_KEY_KP_Delete,     MOD_MASK_ANY,    "\033[3~",      +1,    0,    0},
277+	{ XKB_KEY_KP_Multiply,   MOD_MASK_ANY,    "\033Oj",       +2,    0,    0},
278+	{ XKB_KEY_KP_Add,        MOD_MASK_ANY,    "\033Ok",       +2,    0,    0},
279+	{ XKB_KEY_KP_Enter,      MOD_MASK_ANY,    "\033OM",       +2,    0,    0},
280+	{ XKB_KEY_KP_Enter,      MOD_MASK_ANY,    "\r",           -1,    0,   -1},
281+	{ XKB_KEY_KP_Enter,      MOD_MASK_ANY,    "\r\n",         -1,    0,   +1},
282+	{ XKB_KEY_KP_Subtract,   MOD_MASK_ANY,    "\033Om",       +2,    0,    0},
283+	{ XKB_KEY_KP_Decimal,    MOD_MASK_ANY,    "\033On",       +2,    0,    0},
284+	{ XKB_KEY_KP_Divide,     MOD_MASK_ANY,    "\033Oo",       +2,    0,    0},
285+	{ XKB_KEY_KP_0,          MOD_MASK_ANY,    "\033Op",       +2,    0,    0},
286+	{ XKB_KEY_KP_1,          MOD_MASK_ANY,    "\033Oq",       +2,    0,    0},
287+	{ XKB_KEY_KP_2,          MOD_MASK_ANY,    "\033Or",       +2,    0,    0},
288+	{ XKB_KEY_KP_3,          MOD_MASK_ANY,    "\033Os",       +2,    0,    0},
289+	{ XKB_KEY_KP_4,          MOD_MASK_ANY,    "\033Ot",       +2,    0,    0},
290+	{ XKB_KEY_KP_5,          MOD_MASK_ANY,    "\033Ou",       +2,    0,    0},
291+	{ XKB_KEY_KP_6,          MOD_MASK_ANY,    "\033Ov",       +2,    0,    0},
292+	{ XKB_KEY_KP_7,          MOD_MASK_ANY,    "\033Ow",       +2,    0,    0},
293+	{ XKB_KEY_KP_8,          MOD_MASK_ANY,    "\033Ox",       +2,    0,    0},
294+	{ XKB_KEY_KP_9,          MOD_MASK_ANY,    "\033Oy",       +2,    0,    0},
295+	{ XKB_KEY_Up,            MOD_MASK_SHIFT,  "\033[1;2A",     0,    0,    0},
296+	{ XKB_KEY_Up,            MOD_MASK_ALT,    "\033[1;3A",     0,    0,    0},
297+	{ XKB_KEY_Up, MOD_MASK_SHIFT|MOD_MASK_ALT,"\033[1;4A",     0,    0,    0},
298+	{ XKB_KEY_Up,            MOD_MASK_CTRL,   "\033[1;5A",     0,    0,    0},
299+	{ XKB_KEY_Up,MOD_MASK_SHIFT|MOD_MASK_CTRL,"\033[1;6A",     0,    0,    0},
300+	{ XKB_KEY_Up,  MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;7A",     0,    0,    0},
301+	{ XKB_KEY_Up,MOD_MASK_SHIFT|MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;8A",0,0,0},
302+	{ XKB_KEY_Up,            MOD_MASK_ANY,    "\033[A",        0,   -1,    0},
303+	{ XKB_KEY_Up,            MOD_MASK_ANY,    "\033OA",        0,   +1,    0},
304+	{ XKB_KEY_Down,          MOD_MASK_SHIFT,  "\033[1;2B",     0,    0,    0},
305+	{ XKB_KEY_Down,          MOD_MASK_ALT,    "\033[1;3B",     0,    0,    0},
306+	{ XKB_KEY_Down,MOD_MASK_SHIFT|MOD_MASK_ALT,"\033[1;4B",    0,    0,    0},
307+	{ XKB_KEY_Down,         MOD_MASK_CTRL,    "\033[1;5B",     0,    0,    0},
308+	{ XKB_KEY_Down,MOD_MASK_SHIFT|MOD_MASK_CTRL,"\033[1;6B",   0,    0,    0},
309+	{ XKB_KEY_Down,MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;7B",     0,    0,    0},
310+	{ XKB_KEY_Down,MOD_MASK_SHIFT|MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;8B",0,0,0},
311+	{ XKB_KEY_Down,          MOD_MASK_ANY,    "\033[B",        0,   -1,    0},
312+	{ XKB_KEY_Down,          MOD_MASK_ANY,    "\033OB",        0,   +1,    0},
313+	{ XKB_KEY_Left,          MOD_MASK_SHIFT,  "\033[1;2D",     0,    0,    0},
314+	{ XKB_KEY_Left,          MOD_MASK_ALT,    "\033[1;3D",     0,    0,    0},
315+	{ XKB_KEY_Left,MOD_MASK_SHIFT|MOD_MASK_ALT,"\033[1;4D",    0,    0,    0},
316+	{ XKB_KEY_Left,          MOD_MASK_CTRL,   "\033[1;5D",     0,    0,    0},
317+	{ XKB_KEY_Left,MOD_MASK_SHIFT|MOD_MASK_CTRL,"\033[1;6D",   0,    0,    0},
318+	{ XKB_KEY_Left,MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;7D",     0,    0,    0},
319+	{ XKB_KEY_Left,MOD_MASK_SHIFT|MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;8D",0,0,0},
320+	{ XKB_KEY_Left,          MOD_MASK_ANY,    "\033[D",        0,   -1,    0},
321+	{ XKB_KEY_Left,          MOD_MASK_ANY,    "\033OD",        0,   +1,    0},
322+	{ XKB_KEY_Right,         MOD_MASK_SHIFT,  "\033[1;2C",     0,    0,    0},
323+	{ XKB_KEY_Right,         MOD_MASK_ALT,    "\033[1;3C",     0,    0,    0},
324+	{ XKB_KEY_Right,MOD_MASK_SHIFT|MOD_MASK_ALT,"\033[1;4C",   0,    0,    0},
325+	{ XKB_KEY_Right,         MOD_MASK_CTRL,   "\033[1;5C",     0,    0,    0},
326+	{ XKB_KEY_Right,MOD_MASK_SHIFT|MOD_MASK_CTRL,"\033[1;6C",  0,    0,    0},
327+	{ XKB_KEY_Right,MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;7C",    0,    0,    0},
328+	{ XKB_KEY_Right,MOD_MASK_SHIFT|MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;8C",0,0,0},
329+	{ XKB_KEY_Right,         MOD_MASK_ANY,    "\033[C",        0,   -1,    0},
330+	{ XKB_KEY_Right,         MOD_MASK_ANY,    "\033OC",        0,   +1,    0},
331+	{ XKB_KEY_ISO_Left_Tab,  MOD_MASK_SHIFT,  "\033[Z",        0,    0,    0},
332+	{ XKB_KEY_Return,        MOD_MASK_ALT,    "\033\r",        0,    0,   -1},
333+	{ XKB_KEY_Return,        MOD_MASK_ALT,    "\033\r\n",      0,    0,   +1},
334+	{ XKB_KEY_Return,        MOD_MASK_ANY,    "\r",            0,    0,   -1},
335+	{ XKB_KEY_Return,        MOD_MASK_ANY,    "\r\n",          0,    0,   +1},
336+	{ XKB_KEY_Insert,        MOD_MASK_SHIFT,  "\033[4l",      -1,    0,    0},
337+	{ XKB_KEY_Insert,        MOD_MASK_SHIFT,  "\033[2;2~",    +1,    0,    0},
338+	{ XKB_KEY_Insert,        MOD_MASK_CTRL,   "\033[L",       -1,    0,    0},
339+	{ XKB_KEY_Insert,        MOD_MASK_CTRL,   "\033[2;5~",    +1,    0,    0},
340+	{ XKB_KEY_Insert,        MOD_MASK_ANY,    "\033[4h",      -1,    0,    0},
341+	{ XKB_KEY_Insert,        MOD_MASK_ANY,    "\033[2~",      +1,    0,    0},
342+	{ XKB_KEY_Delete,        MOD_MASK_CTRL,   "\033[M",       -1,    0,    0},
343+	{ XKB_KEY_Delete,        MOD_MASK_CTRL,   "\033[3;5~",    +1,    0,    0},
344+	{ XKB_KEY_Delete,        MOD_MASK_SHIFT,  "\033[2K",      -1,    0,    0},
345+	{ XKB_KEY_Delete,        MOD_MASK_SHIFT,  "\033[3;2~",    +1,    0,    0},
346+	{ XKB_KEY_Delete,        MOD_MASK_ANY,    "\033[P",       -1,    0,    0},
347+	{ XKB_KEY_Delete,        MOD_MASK_ANY,    "\033[3~",      +1,    0,    0},
348+	{ XKB_KEY_BackSpace,     MOD_MASK_NONE,   "\177",          0,    0,    0},
349+	{ XKB_KEY_BackSpace,     MOD_MASK_CTRL,   "\033\177",      0,    0,    0},
350+	{ XKB_KEY_Home,          MOD_MASK_SHIFT,  "\033[2J",       0,   -1,    0},
351+	{ XKB_KEY_Home,          MOD_MASK_SHIFT,  "\033[1;2H",     0,   +1,    0},
352+	{ XKB_KEY_Home,          MOD_MASK_ANY,    "\033[H",        0,   -1,    0},
353+	{ XKB_KEY_Home,          MOD_MASK_ANY,    "\033[1~",       0,   +1,    0},
354+	{ XKB_KEY_End,           MOD_MASK_CTRL,   "\033[J",       -1,    0,    0},
355+	{ XKB_KEY_End,           MOD_MASK_CTRL,   "\033[1;5F",    +1,    0,    0},
356+	{ XKB_KEY_End,           MOD_MASK_SHIFT,  "\033[K",       -1,    0,    0},
357+	{ XKB_KEY_End,           MOD_MASK_SHIFT,  "\033[1;2F",    +1,    0,    0},
358+	{ XKB_KEY_End,           MOD_MASK_ANY,    "\033[4~",       0,    0,    0},
359+	{ XKB_KEY_Prior,         MOD_MASK_CTRL,   "\033[5;5~",     0,    0,    0},
360+	{ XKB_KEY_Prior,         MOD_MASK_SHIFT,  "\033[5;2~",     0,    0,    0},
361+	{ XKB_KEY_Prior,         MOD_MASK_ANY,    "\033[5~",       0,    0,    0},
362+	{ XKB_KEY_Next,          MOD_MASK_CTRL,   "\033[6;5~",     0,    0,    0},
363+	{ XKB_KEY_Next,          MOD_MASK_SHIFT,  "\033[6;2~",     0,    0,    0},
364+	{ XKB_KEY_Next,          MOD_MASK_ANY,    "\033[6~",       0,    0,    0},
365+	{ XKB_KEY_F1,            MOD_MASK_NONE,   "\033OP" ,       0,    0,    0},
366+	{ XKB_KEY_F1, /* F13 */  MOD_MASK_SHIFT,  "\033[1;2P",     0,    0,    0},
367+	{ XKB_KEY_F1, /* F25 */  MOD_MASK_CTRL,   "\033[1;5P",     0,    0,    0},
368+	{ XKB_KEY_F1, /* F37 */  MOD_MASK_LOGO,   "\033[1;6P",     0,    0,    0},
369+	{ XKB_KEY_F1, /* F49 */  MOD_MASK_ALT,    "\033[1;3P",     0,    0,    0},
370+	{ XKB_KEY_F2,            MOD_MASK_NONE,   "\033OQ" ,       0,    0,    0},
371+	{ XKB_KEY_F2, /* F14 */  MOD_MASK_SHIFT,  "\033[1;2Q",     0,    0,    0},
372+	{ XKB_KEY_F2, /* F26 */  MOD_MASK_CTRL,   "\033[1;5Q",     0,    0,    0},
373+	{ XKB_KEY_F2, /* F38 */  MOD_MASK_LOGO,   "\033[1;6Q",     0,    0,    0},
374+	{ XKB_KEY_F2, /* F50 */  MOD_MASK_ALT,    "\033[1;3Q",     0,    0,    0},
375+	{ XKB_KEY_F3,            MOD_MASK_NONE,   "\033OR" ,       0,    0,    0},
376+	{ XKB_KEY_F3, /* F15 */  MOD_MASK_SHIFT,  "\033[1;2R",     0,    0,    0},
377+	{ XKB_KEY_F3, /* F27 */  MOD_MASK_CTRL,   "\033[1;5R",     0,    0,    0},
378+	{ XKB_KEY_F3, /* F39 */  MOD_MASK_LOGO,   "\033[1;6R",     0,    0,    0},
379+	{ XKB_KEY_F3, /* F51 */  MOD_MASK_ALT,    "\033[1;3R",     0,    0,    0},
380+	{ XKB_KEY_F4,            MOD_MASK_NONE,   "\033OS" ,       0,    0,    0},
381+	{ XKB_KEY_F4, /* F16 */  MOD_MASK_SHIFT,  "\033[1;2S",     0,    0,    0},
382+	{ XKB_KEY_F4, /* F28 */  MOD_MASK_CTRL,   "\033[1;5S",     0,    0,    0},
383+	{ XKB_KEY_F4, /* F40 */  MOD_MASK_LOGO,   "\033[1;6S",     0,    0,    0},
384+	{ XKB_KEY_F4, /* F52 */  MOD_MASK_ALT,    "\033[1;3S",     0,    0,    0},
385+	{ XKB_KEY_F5,            MOD_MASK_NONE,   "\033[15~",      0,    0,    0},
386+	{ XKB_KEY_F5, /* F17 */  MOD_MASK_SHIFT,  "\033[15;2~",    0,    0,    0},
387+	{ XKB_KEY_F5, /* F29 */  MOD_MASK_CTRL,   "\033[15;5~",    0,    0,    0},
388+	{ XKB_KEY_F5, /* F41 */  MOD_MASK_LOGO,   "\033[15;6~",    0,    0,    0},
389+	{ XKB_KEY_F5, /* F53 */  MOD_MASK_ALT,    "\033[15;3~",    0,    0,    0},
390+	{ XKB_KEY_F6,            MOD_MASK_NONE,   "\033[17~",      0,    0,    0},
391+	{ XKB_KEY_F6, /* F18 */  MOD_MASK_SHIFT,  "\033[17;2~",    0,    0,    0},
392+	{ XKB_KEY_F6, /* F30 */  MOD_MASK_CTRL,   "\033[17;5~",    0,    0,    0},
393+	{ XKB_KEY_F6, /* F42 */  MOD_MASK_LOGO,   "\033[17;6~",    0,    0,    0},
394+	{ XKB_KEY_F6, /* F54 */  MOD_MASK_ALT,    "\033[17;3~",    0,    0,    0},
395+	{ XKB_KEY_F7,            MOD_MASK_NONE,   "\033[18~",      0,    0,    0},
396+	{ XKB_KEY_F7, /* F19 */  MOD_MASK_SHIFT,  "\033[18;2~",    0,    0,    0},
397+	{ XKB_KEY_F7, /* F31 */  MOD_MASK_CTRL,   "\033[18;5~",    0,    0,    0},
398+	{ XKB_KEY_F7, /* F43 */  MOD_MASK_LOGO,   "\033[18;6~",    0,    0,    0},
399+	{ XKB_KEY_F7, /* F55 */  MOD_MASK_ALT,    "\033[18;3~",    0,    0,    0},
400+	{ XKB_KEY_F8,            MOD_MASK_NONE,   "\033[19~",      0,    0,    0},
401+	{ XKB_KEY_F8, /* F20 */  MOD_MASK_SHIFT,  "\033[19;2~",    0,    0,    0},
402+	{ XKB_KEY_F8, /* F32 */  MOD_MASK_CTRL,   "\033[19;5~",    0,    0,    0},
403+	{ XKB_KEY_F8, /* F44 */  MOD_MASK_LOGO,   "\033[19;6~",    0,    0,    0},
404+	{ XKB_KEY_F8, /* F56 */  MOD_MASK_ALT,    "\033[19;3~",    0,    0,    0},
405+	{ XKB_KEY_F9,            MOD_MASK_NONE,   "\033[20~",      0,    0,    0},
406+	{ XKB_KEY_F9, /* F21 */  MOD_MASK_SHIFT,  "\033[20;2~",    0,    0,    0},
407+	{ XKB_KEY_F9, /* F33 */  MOD_MASK_CTRL,   "\033[20;5~",    0,    0,    0},
408+	{ XKB_KEY_F9, /* F45 */  MOD_MASK_LOGO,   "\033[20;6~",    0,    0,    0},
409+	{ XKB_KEY_F9, /* F57 */  MOD_MASK_ALT,    "\033[20;3~",    0,    0,    0},
410+	{ XKB_KEY_F10,           MOD_MASK_NONE,   "\033[21~",      0,    0,    0},
411+	{ XKB_KEY_F10, /* F22 */ MOD_MASK_SHIFT,  "\033[21;2~",    0,    0,    0},
412+	{ XKB_KEY_F10, /* F34 */ MOD_MASK_CTRL,   "\033[21;5~",    0,    0,    0},
413+	{ XKB_KEY_F10, /* F46 */ MOD_MASK_LOGO,   "\033[21;6~",    0,    0,    0},
414+	{ XKB_KEY_F10, /* F58 */ MOD_MASK_ALT,    "\033[21;3~",    0,    0,    0},
415+	{ XKB_KEY_F11,           MOD_MASK_NONE,   "\033[23~",      0,    0,    0},
416+	{ XKB_KEY_F11, /* F23 */ MOD_MASK_SHIFT,  "\033[23;2~",    0,    0,    0},
417+	{ XKB_KEY_F11, /* F35 */ MOD_MASK_CTRL,   "\033[23;5~",    0,    0,    0},
418+	{ XKB_KEY_F11, /* F47 */ MOD_MASK_LOGO,   "\033[23;6~",    0,    0,    0},
419+	{ XKB_KEY_F11, /* F59 */ MOD_MASK_ALT,    "\033[23;3~",    0,    0,    0},
420+	{ XKB_KEY_F12,           MOD_MASK_NONE,   "\033[24~",      0,    0,    0},
421+	{ XKB_KEY_F12, /* F24 */ MOD_MASK_SHIFT,  "\033[24;2~",    0,    0,    0},
422+	{ XKB_KEY_F12, /* F36 */ MOD_MASK_CTRL,   "\033[24;5~",    0,    0,    0},
423+	{ XKB_KEY_F12, /* F48 */ MOD_MASK_LOGO,   "\033[24;6~",    0,    0,    0},
424+	{ XKB_KEY_F12, /* F60 */ MOD_MASK_ALT,    "\033[24;3~",    0,    0,    0},
425+	{ XKB_KEY_F13,           MOD_MASK_NONE,   "\033[1;2P",     0,    0,    0},
426+	{ XKB_KEY_F14,           MOD_MASK_NONE,   "\033[1;2Q",     0,    0,    0},
427+	{ XKB_KEY_F15,           MOD_MASK_NONE,   "\033[1;2R",     0,    0,    0},
428+	{ XKB_KEY_F16,           MOD_MASK_NONE,   "\033[1;2S",     0,    0,    0},
429+	{ XKB_KEY_F17,           MOD_MASK_NONE,   "\033[15;2~",    0,    0,    0},
430+	{ XKB_KEY_F18,           MOD_MASK_NONE,   "\033[17;2~",    0,    0,    0},
431+	{ XKB_KEY_F19,           MOD_MASK_NONE,   "\033[18;2~",    0,    0,    0},
432+	{ XKB_KEY_F20,           MOD_MASK_NONE,   "\033[19;2~",    0,    0,    0},
433+	{ XKB_KEY_F21,           MOD_MASK_NONE,   "\033[20;2~",    0,    0,    0},
434+	{ XKB_KEY_F22,           MOD_MASK_NONE,   "\033[21;2~",    0,    0,    0},
435+	{ XKB_KEY_F23,           MOD_MASK_NONE,   "\033[23;2~",    0,    0,    0},
436+	{ XKB_KEY_F24,           MOD_MASK_NONE,   "\033[24;2~",    0,    0,    0},
437+	{ XKB_KEY_F25,           MOD_MASK_NONE,   "\033[1;5P",     0,    0,    0},
438+	{ XKB_KEY_F26,           MOD_MASK_NONE,   "\033[1;5Q",     0,    0,    0},
439+	{ XKB_KEY_F27,           MOD_MASK_NONE,   "\033[1;5R",     0,    0,    0},
440+	{ XKB_KEY_F28,           MOD_MASK_NONE,   "\033[1;5S",     0,    0,    0},
441+	{ XKB_KEY_F29,           MOD_MASK_NONE,   "\033[15;5~",    0,    0,    0},
442+	{ XKB_KEY_F30,           MOD_MASK_NONE,   "\033[17;5~",    0,    0,    0},
443+	{ XKB_KEY_F31,           MOD_MASK_NONE,   "\033[18;5~",    0,    0,    0},
444+	{ XKB_KEY_F32,           MOD_MASK_NONE,   "\033[19;5~",    0,    0,    0},
445+	{ XKB_KEY_F33,           MOD_MASK_NONE,   "\033[20;5~",    0,    0,    0},
446+	{ XKB_KEY_F34,           MOD_MASK_NONE,   "\033[21;5~",    0,    0,    0},
447+	{ XKB_KEY_F35,           MOD_MASK_NONE,   "\033[23;5~",    0,    0,    0},
448+};
449+
450+/*
451+ * Selection types' masks.
452+ * Use the same masks as usual.
453+ * Button1Mask is always unset, to make masks match between ButtonPress.
454+ * ButtonRelease and MotionNotify.
455+ * If no match is found, regular selection is used.
456+ */
457+static uint selmasks[] = {
458+	[SEL_RECTANGULAR] = MOD_MASK_ALT,
459+};
460+
461+/*
462+ * Printable characters in ASCII, used to estimate the advance width
463+ * of single wide characters.
464+ */
465+static char ascii_printable[] =
466+	" !\"#$%&'()*+,-./0123456789:;<=>?"
467+	"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
468+	"`abcdefghijklmnopqrstuvwxyz{|}~";
469+
470+/*
471+ * plumb_cmd is run on mouse button 3 click, with first NULL set to
472+ * current selection and with cwd set to the cwd of the active shell
473+ */
474+static char *plumb_cmd[] = {"plumb", NULL, NULL};
+33, -0
 1@@ -0,0 +1,33 @@
 2+cflags{
 3+	[[-D 'VERSION="0.7"']],
 4+	'-I $dir',
 5+	'-isystem $builddir/pkg/fontconfig/include',
 6+	'-isystem $builddir/pkg/libxkbcommon/include',
 7+	'-isystem $builddir/pkg/linux-headers/include',
 8+	'-isystem $builddir/pkg/pixman/include',
 9+	'-isystem $builddir/pkg/wayland/include',
10+	'-isystem $builddir/pkg/wayland-protocols/include',
11+	'-isystem $builddir/pkg/wld/include',
12+}
13+
14+pkg.deps = {
15+	'pkg/fontconfig/headers',
16+	'pkg/libxkbcommon/headers',
17+	'pkg/linux-headers/headers',
18+	'pkg/pixman/headers',
19+	'pkg/wayland/headers',
20+	'pkg/wayland-protocols/headers',
21+	'pkg/wld/headers',
22+}
23+
24+exe('st', [[st.c $builddir/pkg/(
25+	libxkbcommon/libxkbcommon.a
26+	wayland/libwayland-client.a.d
27+	wayland/libwayland-cursor.a.d
28+	wayland-protocols/xdg-shell-protocol.c.o
29+	wld/libwld.a.d
30+)]])
31+file('bin/st', '755', '$outdir/st')
32+man{'st.1'}
33+
34+fetch 'git'
+3934, -0
   1@@ -0,0 +1,3934 @@
   2+From 86283aea345fd72e4889eee233daefc41615d979 Mon Sep 17 00:00:00 2001
   3+From: Michael Forney <mforney@mforney.org>
   4+Date: Sun, 30 Oct 2016 23:54:56 -0700
   5+Subject: [PATCH] Port to wayland using wld
   6+
   7+---
   8+ Makefile     |   12 +-
   9+ config.def.h |  500 ++++++-----
  10+ config.mk    |   12 +-
  11+ st.c         | 2366 +++++++++++++++++++++++++-------------------------
  12+ 4 files changed, 1463 insertions(+), 1427 deletions(-)
  13+
  14+diff --git a/Makefile b/Makefile
  15+index fb026c4..053d3e0 100644
  16+--- a/Makefile
  17++++ b/Makefile
  18+@@ -3,7 +3,7 @@
  19+ 
  20+ include config.mk
  21+ 
  22+-SRC = st.c
  23++SRC = st.c xdg-shell-unstable-v5-protocol.c
  24+ OBJ = ${SRC:.c=.o}
  25+ 
  26+ all: options st
  27+@@ -17,6 +17,16 @@ options:
  28+ config.h:
  29+ 	cp config.def.h config.h
  30+ 
  31++xdg-shell-unstable-v5-protocol.c:
  32++	@echo GEN $@
  33++	@wayland-scanner code ${XDG_SHELL_PROTO} $@
  34++
  35++xdg-shell-unstable-v5-client-protocol.h:
  36++	@echo GEN $@
  37++	@wayland-scanner client-header ${XDG_SHELL_PROTO} $@
  38++
  39++st.o: xdg-shell-unstable-v5-client-protocol.h
  40++
  41+ .c.o:
  42+ 	@echo CC $<
  43+ 	@${CC} -c ${CFLAGS} $<
  44+diff --git a/config.def.h b/config.def.h
  45+index a719e36..49ca50b 100644
  46+--- a/config.def.h
  47++++ b/config.def.h
  48+@@ -38,13 +38,13 @@ static char worddelimiters[] = " ";
  49+ static unsigned int doubleclicktimeout = 300;
  50+ static unsigned int tripleclicktimeout = 600;
  51+ 
  52++/* key repeat timeouts (in milliseconds) */
  53++static unsigned int keyrepeatdelay = 500;
  54++static unsigned int keyrepeatinterval = 25;
  55++
  56+ /* alt screens */
  57+ static int allowaltscreen = 1;
  58+ 
  59+-/* frames per second st should at maximum draw to the screen */
  60+-static unsigned int xfps = 120;
  61+-static unsigned int actionfps = 30;
  62+-
  63+ /*
  64+  * blinking timeout (set to 0 to disable blinking) for the terminal blinking
  65+  * attribute.
  66+@@ -60,7 +60,9 @@ static unsigned int cursorthickness = 2;
  67+  * bell volume. It must be a value between -100 and 100. Use 0 for disabling
  68+  * it
  69+  */
  70+-static int bellvolume = 0;
  71++/* XXX: Wayland does not have a bell.
  72++ * static int bellvolume = 0;
  73++ */
  74+ 
  75+ /* default TERM value */
  76+ static char termname[] = "st-256color";
  77+@@ -138,11 +140,9 @@ static unsigned int cols = 80;
  78+ static unsigned int rows = 24;
  79+ 
  80+ /*
  81+- * Default colour and shape of the mouse cursor
  82++ * Default shape of the mouse cursor
  83+  */
  84+-static unsigned int mouseshape = XC_xterm;
  85+-static unsigned int mousefg = 7;
  86+-static unsigned int mousebg = 0;
  87++static char mouseshape[] = "xterm";
  88+ 
  89+ /*
  90+  * Color used to display font attributes when fontconfig selected a font which
  91+@@ -156,36 +156,38 @@ static unsigned int defaultattr = 11;
  92+  */
  93+ static MouseShortcut mshortcuts[] = {
  94+ 	/* button               mask            string */
  95+-	{ Button4,              XK_ANY_MOD,     "\031" },
  96+-	{ Button5,              XK_ANY_MOD,     "\005" },
  97++	{ -1,                   MOD_MASK_NONE,  "" }
  98++};
  99++
 100++static Axiskey ashortcuts[] = {
 101++	/* axis		    direction	mask		string */
 102++	{ AXIS_VERTICAL,    +1,		MOD_MASK_ANY,	"\031"},
 103++	{ AXIS_VERTICAL,    -1,		MOD_MASK_ANY,	"\005"},
 104+ };
 105+ 
 106+ /* Internal keyboard shortcuts. */
 107+-#define MODKEY Mod1Mask
 108++#define MODKEY MOD_MASK_ALT
 109+ 
 110+ static Shortcut shortcuts[] = {
 111+-	/* mask                 keysym          function        argument */
 112+-	{ XK_ANY_MOD,           XK_Break,       sendbreak,      {.i =  0} },
 113+-	{ ControlMask,          XK_Print,       toggleprinter,  {.i =  0} },
 114+-	{ ShiftMask,            XK_Print,       printscreen,    {.i =  0} },
 115+-	{ XK_ANY_MOD,           XK_Print,       printsel,       {.i =  0} },
 116+-	{ MODKEY|ShiftMask,     XK_Prior,       xzoom,          {.f = +1} },
 117+-	{ MODKEY|ShiftMask,     XK_Next,        xzoom,          {.f = -1} },
 118+-	{ MODKEY|ShiftMask,     XK_Home,        xzoomreset,     {.f =  0} },
 119+-	{ ShiftMask,            XK_Insert,      selpaste,       {.i =  0} },
 120+-	{ MODKEY|ShiftMask,     XK_Insert,      clippaste,      {.i =  0} },
 121+-	{ MODKEY|ShiftMask,     XK_C,           clipcopy,       {.i =  0} },
 122+-	{ MODKEY|ShiftMask,     XK_V,           clippaste,      {.i =  0} },
 123+-	{ MODKEY,               XK_Num_Lock,    numlock,        {.i =  0} },
 124+-	{ MODKEY,               XK_Control_L,   iso14755,       {.i =  0} },
 125++	/* modifier                     key                     function        argument */
 126++	{ MOD_MASK_ANY,                 XKB_KEY_Break,          sendbreak,      {.i =  0} },
 127++	{ MOD_MASK_CTRL,                XKB_KEY_Print,          toggleprinter,  {.i =  0} },
 128++	{ MOD_MASK_SHIFT,               XKB_KEY_Print,          printscreen,    {.i =  0} },
 129++	{ MOD_MASK_ANY,                 XKB_KEY_Print,          printsel,       {.i =  0} },
 130++	{ MODKEY|MOD_MASK_SHIFT,        XKB_KEY_Prior,          wlzoom,         {.f = +1} },
 131++	{ MODKEY|MOD_MASK_SHIFT,        XKB_KEY_Next,           wlzoom,         {.f = -1} },
 132++	{ MODKEY|MOD_MASK_SHIFT,        XKB_KEY_Home,           wlzoomreset,    {.f =  0} },
 133++	{ MOD_MASK_SHIFT,               XKB_KEY_Insert,         selpaste,       {.i =  0} },
 134++	{ MODKEY,                       XKB_KEY_Num_Lock,       numlock,        {.i =  0} },
 135++	{ MODKEY,                       XKB_KEY_Control_L,      iso14755,       {.i =  0} },
 136+ };
 137+ 
 138+ /*
 139+  * Special keys (change & recompile st.info accordingly)
 140+  *
 141+  * Mask value:
 142+- * * Use XK_ANY_MOD to match the key no matter modifiers state
 143+- * * Use XK_NO_MOD to match the key alone (no modifiers)
 144++ * * Use MOD_MASK_ANY to match the key no matter modifiers state
 145++ * * Use MOD_MASK_NONE to match the key alone (no modifiers)
 146+  * appkey value:
 147+  * * 0: no value
 148+  * * > 0: keypad application mode enabled
 149+@@ -201,7 +203,7 @@ static Shortcut shortcuts[] = {
 150+  * * < 0: crlf mode is disabled
 151+  *
 152+  * Be careful with the order of the definitions because st searches in
 153+- * this table sequentially, so any XK_ANY_MOD must be in the last
 154++ * this table sequentially, so any MOD_MASK_ANY must be in the last
 155+  * position for a key.
 156+  */
 157+ 
 158+@@ -209,239 +211,233 @@ static Shortcut shortcuts[] = {
 159+  * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
 160+  * to be mapped below, add them to this array.
 161+  */
 162+-static KeySym mappedkeys[] = { -1 };
 163++static xkb_keysym_t mappedkeys[] = { -1 };
 164+ 
 165+-/*
 166+- * State bits to ignore when matching key or button events.  By default,
 167+- * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
 168+- */
 169+-static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
 170++/* State bits to ignore when matching key or button events. */
 171++static uint ignoremod = 0;
 172+ 
 173+ /*
 174+  * Override mouse-select while mask is active (when MODE_MOUSE is set).
 175+- * Note that if you want to use ShiftMask with selmasks, set this to an other
 176+- * modifier, set to 0 to not use it.
 177++ * Note that if you want to use MOD_MASK_SHIFT with selmasks, set this to an
 178++ * other modifier, set to 0 to not use it.
 179+  */
 180+-static uint forceselmod = ShiftMask;
 181++static uint forceselmod = MOD_MASK_SHIFT;
 182+ 
 183+ /*
 184+  * This is the huge key array which defines all compatibility to the Linux
 185+  * world. Please decide about changes wisely.
 186+  */
 187+ static Key key[] = {
 188+-	/* keysym           mask            string      appkey appcursor crlf */
 189+-	{ XK_KP_Home,       ShiftMask,      "\033[2J",       0,   -1,    0},
 190+-	{ XK_KP_Home,       ShiftMask,      "\033[1;2H",     0,   +1,    0},
 191+-	{ XK_KP_Home,       XK_ANY_MOD,     "\033[H",        0,   -1,    0},
 192+-	{ XK_KP_Home,       XK_ANY_MOD,     "\033[1~",       0,   +1,    0},
 193+-	{ XK_KP_Up,         XK_ANY_MOD,     "\033Ox",       +1,    0,    0},
 194+-	{ XK_KP_Up,         XK_ANY_MOD,     "\033[A",        0,   -1,    0},
 195+-	{ XK_KP_Up,         XK_ANY_MOD,     "\033OA",        0,   +1,    0},
 196+-	{ XK_KP_Down,       XK_ANY_MOD,     "\033Or",       +1,    0,    0},
 197+-	{ XK_KP_Down,       XK_ANY_MOD,     "\033[B",        0,   -1,    0},
 198+-	{ XK_KP_Down,       XK_ANY_MOD,     "\033OB",        0,   +1,    0},
 199+-	{ XK_KP_Left,       XK_ANY_MOD,     "\033Ot",       +1,    0,    0},
 200+-	{ XK_KP_Left,       XK_ANY_MOD,     "\033[D",        0,   -1,    0},
 201+-	{ XK_KP_Left,       XK_ANY_MOD,     "\033OD",        0,   +1,    0},
 202+-	{ XK_KP_Right,      XK_ANY_MOD,     "\033Ov",       +1,    0,    0},
 203+-	{ XK_KP_Right,      XK_ANY_MOD,     "\033[C",        0,   -1,    0},
 204+-	{ XK_KP_Right,      XK_ANY_MOD,     "\033OC",        0,   +1,    0},
 205+-	{ XK_KP_Prior,      ShiftMask,      "\033[5;2~",     0,    0,    0},
 206+-	{ XK_KP_Prior,      XK_ANY_MOD,     "\033[5~",       0,    0,    0},
 207+-	{ XK_KP_Begin,      XK_ANY_MOD,     "\033[E",        0,    0,    0},
 208+-	{ XK_KP_End,        ControlMask,    "\033[J",       -1,    0,    0},
 209+-	{ XK_KP_End,        ControlMask,    "\033[1;5F",    +1,    0,    0},
 210+-	{ XK_KP_End,        ShiftMask,      "\033[K",       -1,    0,    0},
 211+-	{ XK_KP_End,        ShiftMask,      "\033[1;2F",    +1,    0,    0},
 212+-	{ XK_KP_End,        XK_ANY_MOD,     "\033[4~",       0,    0,    0},
 213+-	{ XK_KP_Next,       ShiftMask,      "\033[6;2~",     0,    0,    0},
 214+-	{ XK_KP_Next,       XK_ANY_MOD,     "\033[6~",       0,    0,    0},
 215+-	{ XK_KP_Insert,     ShiftMask,      "\033[2;2~",    +1,    0,    0},
 216+-	{ XK_KP_Insert,     ShiftMask,      "\033[4l",      -1,    0,    0},
 217+-	{ XK_KP_Insert,     ControlMask,    "\033[L",       -1,    0,    0},
 218+-	{ XK_KP_Insert,     ControlMask,    "\033[2;5~",    +1,    0,    0},
 219+-	{ XK_KP_Insert,     XK_ANY_MOD,     "\033[4h",      -1,    0,    0},
 220+-	{ XK_KP_Insert,     XK_ANY_MOD,     "\033[2~",      +1,    0,    0},
 221+-	{ XK_KP_Delete,     ControlMask,    "\033[M",       -1,    0,    0},
 222+-	{ XK_KP_Delete,     ControlMask,    "\033[3;5~",    +1,    0,    0},
 223+-	{ XK_KP_Delete,     ShiftMask,      "\033[2K",      -1,    0,    0},
 224+-	{ XK_KP_Delete,     ShiftMask,      "\033[3;2~",    +1,    0,    0},
 225+-	{ XK_KP_Delete,     XK_ANY_MOD,     "\033[P",       -1,    0,    0},
 226+-	{ XK_KP_Delete,     XK_ANY_MOD,     "\033[3~",      +1,    0,    0},
 227+-	{ XK_KP_Multiply,   XK_ANY_MOD,     "\033Oj",       +2,    0,    0},
 228+-	{ XK_KP_Add,        XK_ANY_MOD,     "\033Ok",       +2,    0,    0},
 229+-	{ XK_KP_Enter,      XK_ANY_MOD,     "\033OM",       +2,    0,    0},
 230+-	{ XK_KP_Enter,      XK_ANY_MOD,     "\r",           -1,    0,   -1},
 231+-	{ XK_KP_Enter,      XK_ANY_MOD,     "\r\n",         -1,    0,   +1},
 232+-	{ XK_KP_Subtract,   XK_ANY_MOD,     "\033Om",       +2,    0,    0},
 233+-	{ XK_KP_Decimal,    XK_ANY_MOD,     "\033On",       +2,    0,    0},
 234+-	{ XK_KP_Divide,     XK_ANY_MOD,     "\033Oo",       +2,    0,    0},
 235+-	{ XK_KP_0,          XK_ANY_MOD,     "\033Op",       +2,    0,    0},
 236+-	{ XK_KP_1,          XK_ANY_MOD,     "\033Oq",       +2,    0,    0},
 237+-	{ XK_KP_2,          XK_ANY_MOD,     "\033Or",       +2,    0,    0},
 238+-	{ XK_KP_3,          XK_ANY_MOD,     "\033Os",       +2,    0,    0},
 239+-	{ XK_KP_4,          XK_ANY_MOD,     "\033Ot",       +2,    0,    0},
 240+-	{ XK_KP_5,          XK_ANY_MOD,     "\033Ou",       +2,    0,    0},
 241+-	{ XK_KP_6,          XK_ANY_MOD,     "\033Ov",       +2,    0,    0},
 242+-	{ XK_KP_7,          XK_ANY_MOD,     "\033Ow",       +2,    0,    0},
 243+-	{ XK_KP_8,          XK_ANY_MOD,     "\033Ox",       +2,    0,    0},
 244+-	{ XK_KP_9,          XK_ANY_MOD,     "\033Oy",       +2,    0,    0},
 245+-	{ XK_Up,            ShiftMask,      "\033[1;2A",     0,    0,    0},
 246+-	{ XK_Up,            Mod1Mask,       "\033[1;3A",     0,    0,    0},
 247+-	{ XK_Up,         ShiftMask|Mod1Mask,"\033[1;4A",     0,    0,    0},
 248+-	{ XK_Up,            ControlMask,    "\033[1;5A",     0,    0,    0},
 249+-	{ XK_Up,      ShiftMask|ControlMask,"\033[1;6A",     0,    0,    0},
 250+-	{ XK_Up,       ControlMask|Mod1Mask,"\033[1;7A",     0,    0,    0},
 251+-	{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A",  0,    0,    0},
 252+-	{ XK_Up,            XK_ANY_MOD,     "\033[A",        0,   -1,    0},
 253+-	{ XK_Up,            XK_ANY_MOD,     "\033OA",        0,   +1,    0},
 254+-	{ XK_Down,          ShiftMask,      "\033[1;2B",     0,    0,    0},
 255+-	{ XK_Down,          Mod1Mask,       "\033[1;3B",     0,    0,    0},
 256+-	{ XK_Down,       ShiftMask|Mod1Mask,"\033[1;4B",     0,    0,    0},
 257+-	{ XK_Down,          ControlMask,    "\033[1;5B",     0,    0,    0},
 258+-	{ XK_Down,    ShiftMask|ControlMask,"\033[1;6B",     0,    0,    0},
 259+-	{ XK_Down,     ControlMask|Mod1Mask,"\033[1;7B",     0,    0,    0},
 260+-	{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0,    0,    0},
 261+-	{ XK_Down,          XK_ANY_MOD,     "\033[B",        0,   -1,    0},
 262+-	{ XK_Down,          XK_ANY_MOD,     "\033OB",        0,   +1,    0},
 263+-	{ XK_Left,          ShiftMask,      "\033[1;2D",     0,    0,    0},
 264+-	{ XK_Left,          Mod1Mask,       "\033[1;3D",     0,    0,    0},
 265+-	{ XK_Left,       ShiftMask|Mod1Mask,"\033[1;4D",     0,    0,    0},
 266+-	{ XK_Left,          ControlMask,    "\033[1;5D",     0,    0,    0},
 267+-	{ XK_Left,    ShiftMask|ControlMask,"\033[1;6D",     0,    0,    0},
 268+-	{ XK_Left,     ControlMask|Mod1Mask,"\033[1;7D",     0,    0,    0},
 269+-	{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0,    0,    0},
 270+-	{ XK_Left,          XK_ANY_MOD,     "\033[D",        0,   -1,    0},
 271+-	{ XK_Left,          XK_ANY_MOD,     "\033OD",        0,   +1,    0},
 272+-	{ XK_Right,         ShiftMask,      "\033[1;2C",     0,    0,    0},
 273+-	{ XK_Right,         Mod1Mask,       "\033[1;3C",     0,    0,    0},
 274+-	{ XK_Right,      ShiftMask|Mod1Mask,"\033[1;4C",     0,    0,    0},
 275+-	{ XK_Right,         ControlMask,    "\033[1;5C",     0,    0,    0},
 276+-	{ XK_Right,   ShiftMask|ControlMask,"\033[1;6C",     0,    0,    0},
 277+-	{ XK_Right,    ControlMask|Mod1Mask,"\033[1;7C",     0,    0,    0},
 278+-	{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0,   0,    0},
 279+-	{ XK_Right,         XK_ANY_MOD,     "\033[C",        0,   -1,    0},
 280+-	{ XK_Right,         XK_ANY_MOD,     "\033OC",        0,   +1,    0},
 281+-	{ XK_ISO_Left_Tab,  ShiftMask,      "\033[Z",        0,    0,    0},
 282+-	{ XK_Return,        Mod1Mask,       "\033\r",        0,    0,   -1},
 283+-	{ XK_Return,        Mod1Mask,       "\033\r\n",      0,    0,   +1},
 284+-	{ XK_Return,        XK_ANY_MOD,     "\r",            0,    0,   -1},
 285+-	{ XK_Return,        XK_ANY_MOD,     "\r\n",          0,    0,   +1},
 286+-	{ XK_Insert,        ShiftMask,      "\033[4l",      -1,    0,    0},
 287+-	{ XK_Insert,        ShiftMask,      "\033[2;2~",    +1,    0,    0},
 288+-	{ XK_Insert,        ControlMask,    "\033[L",       -1,    0,    0},
 289+-	{ XK_Insert,        ControlMask,    "\033[2;5~",    +1,    0,    0},
 290+-	{ XK_Insert,        XK_ANY_MOD,     "\033[4h",      -1,    0,    0},
 291+-	{ XK_Insert,        XK_ANY_MOD,     "\033[2~",      +1,    0,    0},
 292+-	{ XK_Delete,        ControlMask,    "\033[M",       -1,    0,    0},
 293+-	{ XK_Delete,        ControlMask,    "\033[3;5~",    +1,    0,    0},
 294+-	{ XK_Delete,        ShiftMask,      "\033[2K",      -1,    0,    0},
 295+-	{ XK_Delete,        ShiftMask,      "\033[3;2~",    +1,    0,    0},
 296+-	{ XK_Delete,        XK_ANY_MOD,     "\033[P",       -1,    0,    0},
 297+-	{ XK_Delete,        XK_ANY_MOD,     "\033[3~",      +1,    0,    0},
 298+-	{ XK_BackSpace,     XK_NO_MOD,      "\177",          0,    0,    0},
 299+-	{ XK_BackSpace,     Mod1Mask,       "\033\177",      0,    0,    0},
 300+-	{ XK_Home,          ShiftMask,      "\033[2J",       0,   -1,    0},
 301+-	{ XK_Home,          ShiftMask,      "\033[1;2H",     0,   +1,    0},
 302+-	{ XK_Home,          XK_ANY_MOD,     "\033[H",        0,   -1,    0},
 303+-	{ XK_Home,          XK_ANY_MOD,     "\033[1~",       0,   +1,    0},
 304+-	{ XK_End,           ControlMask,    "\033[J",       -1,    0,    0},
 305+-	{ XK_End,           ControlMask,    "\033[1;5F",    +1,    0,    0},
 306+-	{ XK_End,           ShiftMask,      "\033[K",       -1,    0,    0},
 307+-	{ XK_End,           ShiftMask,      "\033[1;2F",    +1,    0,    0},
 308+-	{ XK_End,           XK_ANY_MOD,     "\033[4~",       0,    0,    0},
 309+-	{ XK_Prior,         ControlMask,    "\033[5;5~",     0,    0,    0},
 310+-	{ XK_Prior,         ShiftMask,      "\033[5;2~",     0,    0,    0},
 311+-	{ XK_Prior,         XK_ANY_MOD,     "\033[5~",       0,    0,    0},
 312+-	{ XK_Next,          ControlMask,    "\033[6;5~",     0,    0,    0},
 313+-	{ XK_Next,          ShiftMask,      "\033[6;2~",     0,    0,    0},
 314+-	{ XK_Next,          XK_ANY_MOD,     "\033[6~",       0,    0,    0},
 315+-	{ XK_F1,            XK_NO_MOD,      "\033OP" ,       0,    0,    0},
 316+-	{ XK_F1, /* F13 */  ShiftMask,      "\033[1;2P",     0,    0,    0},
 317+-	{ XK_F1, /* F25 */  ControlMask,    "\033[1;5P",     0,    0,    0},
 318+-	{ XK_F1, /* F37 */  Mod4Mask,       "\033[1;6P",     0,    0,    0},
 319+-	{ XK_F1, /* F49 */  Mod1Mask,       "\033[1;3P",     0,    0,    0},
 320+-	{ XK_F1, /* F61 */  Mod3Mask,       "\033[1;4P",     0,    0,    0},
 321+-	{ XK_F2,            XK_NO_MOD,      "\033OQ" ,       0,    0,    0},
 322+-	{ XK_F2, /* F14 */  ShiftMask,      "\033[1;2Q",     0,    0,    0},
 323+-	{ XK_F2, /* F26 */  ControlMask,    "\033[1;5Q",     0,    0,    0},
 324+-	{ XK_F2, /* F38 */  Mod4Mask,       "\033[1;6Q",     0,    0,    0},
 325+-	{ XK_F2, /* F50 */  Mod1Mask,       "\033[1;3Q",     0,    0,    0},
 326+-	{ XK_F2, /* F62 */  Mod3Mask,       "\033[1;4Q",     0,    0,    0},
 327+-	{ XK_F3,            XK_NO_MOD,      "\033OR" ,       0,    0,    0},
 328+-	{ XK_F3, /* F15 */  ShiftMask,      "\033[1;2R",     0,    0,    0},
 329+-	{ XK_F3, /* F27 */  ControlMask,    "\033[1;5R",     0,    0,    0},
 330+-	{ XK_F3, /* F39 */  Mod4Mask,       "\033[1;6R",     0,    0,    0},
 331+-	{ XK_F3, /* F51 */  Mod1Mask,       "\033[1;3R",     0,    0,    0},
 332+-	{ XK_F3, /* F63 */  Mod3Mask,       "\033[1;4R",     0,    0,    0},
 333+-	{ XK_F4,            XK_NO_MOD,      "\033OS" ,       0,    0,    0},
 334+-	{ XK_F4, /* F16 */  ShiftMask,      "\033[1;2S",     0,    0,    0},
 335+-	{ XK_F4, /* F28 */  ControlMask,    "\033[1;5S",     0,    0,    0},
 336+-	{ XK_F4, /* F40 */  Mod4Mask,       "\033[1;6S",     0,    0,    0},
 337+-	{ XK_F4, /* F52 */  Mod1Mask,       "\033[1;3S",     0,    0,    0},
 338+-	{ XK_F5,            XK_NO_MOD,      "\033[15~",      0,    0,    0},
 339+-	{ XK_F5, /* F17 */  ShiftMask,      "\033[15;2~",    0,    0,    0},
 340+-	{ XK_F5, /* F29 */  ControlMask,    "\033[15;5~",    0,    0,    0},
 341+-	{ XK_F5, /* F41 */  Mod4Mask,       "\033[15;6~",    0,    0,    0},
 342+-	{ XK_F5, /* F53 */  Mod1Mask,       "\033[15;3~",    0,    0,    0},
 343+-	{ XK_F6,            XK_NO_MOD,      "\033[17~",      0,    0,    0},
 344+-	{ XK_F6, /* F18 */  ShiftMask,      "\033[17;2~",    0,    0,    0},
 345+-	{ XK_F6, /* F30 */  ControlMask,    "\033[17;5~",    0,    0,    0},
 346+-	{ XK_F6, /* F42 */  Mod4Mask,       "\033[17;6~",    0,    0,    0},
 347+-	{ XK_F6, /* F54 */  Mod1Mask,       "\033[17;3~",    0,    0,    0},
 348+-	{ XK_F7,            XK_NO_MOD,      "\033[18~",      0,    0,    0},
 349+-	{ XK_F7, /* F19 */  ShiftMask,      "\033[18;2~",    0,    0,    0},
 350+-	{ XK_F7, /* F31 */  ControlMask,    "\033[18;5~",    0,    0,    0},
 351+-	{ XK_F7, /* F43 */  Mod4Mask,       "\033[18;6~",    0,    0,    0},
 352+-	{ XK_F7, /* F55 */  Mod1Mask,       "\033[18;3~",    0,    0,    0},
 353+-	{ XK_F8,            XK_NO_MOD,      "\033[19~",      0,    0,    0},
 354+-	{ XK_F8, /* F20 */  ShiftMask,      "\033[19;2~",    0,    0,    0},
 355+-	{ XK_F8, /* F32 */  ControlMask,    "\033[19;5~",    0,    0,    0},
 356+-	{ XK_F8, /* F44 */  Mod4Mask,       "\033[19;6~",    0,    0,    0},
 357+-	{ XK_F8, /* F56 */  Mod1Mask,       "\033[19;3~",    0,    0,    0},
 358+-	{ XK_F9,            XK_NO_MOD,      "\033[20~",      0,    0,    0},
 359+-	{ XK_F9, /* F21 */  ShiftMask,      "\033[20;2~",    0,    0,    0},
 360+-	{ XK_F9, /* F33 */  ControlMask,    "\033[20;5~",    0,    0,    0},
 361+-	{ XK_F9, /* F45 */  Mod4Mask,       "\033[20;6~",    0,    0,    0},
 362+-	{ XK_F9, /* F57 */  Mod1Mask,       "\033[20;3~",    0,    0,    0},
 363+-	{ XK_F10,           XK_NO_MOD,      "\033[21~",      0,    0,    0},
 364+-	{ XK_F10, /* F22 */ ShiftMask,      "\033[21;2~",    0,    0,    0},
 365+-	{ XK_F10, /* F34 */ ControlMask,    "\033[21;5~",    0,    0,    0},
 366+-	{ XK_F10, /* F46 */ Mod4Mask,       "\033[21;6~",    0,    0,    0},
 367+-	{ XK_F10, /* F58 */ Mod1Mask,       "\033[21;3~",    0,    0,    0},
 368+-	{ XK_F11,           XK_NO_MOD,      "\033[23~",      0,    0,    0},
 369+-	{ XK_F11, /* F23 */ ShiftMask,      "\033[23;2~",    0,    0,    0},
 370+-	{ XK_F11, /* F35 */ ControlMask,    "\033[23;5~",    0,    0,    0},
 371+-	{ XK_F11, /* F47 */ Mod4Mask,       "\033[23;6~",    0,    0,    0},
 372+-	{ XK_F11, /* F59 */ Mod1Mask,       "\033[23;3~",    0,    0,    0},
 373+-	{ XK_F12,           XK_NO_MOD,      "\033[24~",      0,    0,    0},
 374+-	{ XK_F12, /* F24 */ ShiftMask,      "\033[24;2~",    0,    0,    0},
 375+-	{ XK_F12, /* F36 */ ControlMask,    "\033[24;5~",    0,    0,    0},
 376+-	{ XK_F12, /* F48 */ Mod4Mask,       "\033[24;6~",    0,    0,    0},
 377+-	{ XK_F12, /* F60 */ Mod1Mask,       "\033[24;3~",    0,    0,    0},
 378+-	{ XK_F13,           XK_NO_MOD,      "\033[1;2P",     0,    0,    0},
 379+-	{ XK_F14,           XK_NO_MOD,      "\033[1;2Q",     0,    0,    0},
 380+-	{ XK_F15,           XK_NO_MOD,      "\033[1;2R",     0,    0,    0},
 381+-	{ XK_F16,           XK_NO_MOD,      "\033[1;2S",     0,    0,    0},
 382+-	{ XK_F17,           XK_NO_MOD,      "\033[15;2~",    0,    0,    0},
 383+-	{ XK_F18,           XK_NO_MOD,      "\033[17;2~",    0,    0,    0},
 384+-	{ XK_F19,           XK_NO_MOD,      "\033[18;2~",    0,    0,    0},
 385+-	{ XK_F20,           XK_NO_MOD,      "\033[19;2~",    0,    0,    0},
 386+-	{ XK_F21,           XK_NO_MOD,      "\033[20;2~",    0,    0,    0},
 387+-	{ XK_F22,           XK_NO_MOD,      "\033[21;2~",    0,    0,    0},
 388+-	{ XK_F23,           XK_NO_MOD,      "\033[23;2~",    0,    0,    0},
 389+-	{ XK_F24,           XK_NO_MOD,      "\033[24;2~",    0,    0,    0},
 390+-	{ XK_F25,           XK_NO_MOD,      "\033[1;5P",     0,    0,    0},
 391+-	{ XK_F26,           XK_NO_MOD,      "\033[1;5Q",     0,    0,    0},
 392+-	{ XK_F27,           XK_NO_MOD,      "\033[1;5R",     0,    0,    0},
 393+-	{ XK_F28,           XK_NO_MOD,      "\033[1;5S",     0,    0,    0},
 394+-	{ XK_F29,           XK_NO_MOD,      "\033[15;5~",    0,    0,    0},
 395+-	{ XK_F30,           XK_NO_MOD,      "\033[17;5~",    0,    0,    0},
 396+-	{ XK_F31,           XK_NO_MOD,      "\033[18;5~",    0,    0,    0},
 397+-	{ XK_F32,           XK_NO_MOD,      "\033[19;5~",    0,    0,    0},
 398+-	{ XK_F33,           XK_NO_MOD,      "\033[20;5~",    0,    0,    0},
 399+-	{ XK_F34,           XK_NO_MOD,      "\033[21;5~",    0,    0,    0},
 400+-	{ XK_F35,           XK_NO_MOD,      "\033[23;5~",    0,    0,    0},
 401++	/* keysym                mask             string      appkey appcursor crlf */
 402++	{ XKB_KEY_KP_Home,       MOD_MASK_SHIFT,  "\033[2J",       0,   -1,    0},
 403++	{ XKB_KEY_KP_Home,       MOD_MASK_SHIFT,  "\033[1;2H",     0,   +1,    0},
 404++	{ XKB_KEY_KP_Home,       MOD_MASK_ANY,    "\033[H",        0,   -1,    0},
 405++	{ XKB_KEY_KP_Home,       MOD_MASK_ANY,    "\033[1~",       0,   +1,    0},
 406++	{ XKB_KEY_KP_Up,         MOD_MASK_ANY,    "\033Ox",       +1,    0,    0},
 407++	{ XKB_KEY_KP_Up,         MOD_MASK_ANY,    "\033[A",        0,   -1,    0},
 408++	{ XKB_KEY_KP_Up,         MOD_MASK_ANY,    "\033OA",        0,   +1,    0},
 409++	{ XKB_KEY_KP_Down,       MOD_MASK_ANY,    "\033Or",       +1,    0,    0},
 410++	{ XKB_KEY_KP_Down,       MOD_MASK_ANY,    "\033[B",        0,   -1,    0},
 411++	{ XKB_KEY_KP_Down,       MOD_MASK_ANY,    "\033OB",        0,   +1,    0},
 412++	{ XKB_KEY_KP_Left,       MOD_MASK_ANY,    "\033Ot",       +1,    0,    0},
 413++	{ XKB_KEY_KP_Left,       MOD_MASK_ANY,    "\033[D",        0,   -1,    0},
 414++	{ XKB_KEY_KP_Left,       MOD_MASK_ANY,    "\033OD",        0,   +1,    0},
 415++	{ XKB_KEY_KP_Right,      MOD_MASK_ANY,    "\033Ov",       +1,    0,    0},
 416++	{ XKB_KEY_KP_Right,      MOD_MASK_ANY,    "\033[C",        0,   -1,    0},
 417++	{ XKB_KEY_KP_Right,      MOD_MASK_ANY,    "\033OC",        0,   +1,    0},
 418++	{ XKB_KEY_KP_Prior,      MOD_MASK_SHIFT,  "\033[5;2~",     0,    0,    0},
 419++	{ XKB_KEY_KP_Prior,      MOD_MASK_ANY,    "\033[5~",       0,    0,    0},
 420++	{ XKB_KEY_KP_Begin,      MOD_MASK_ANY,    "\033[E",        0,    0,    0},
 421++	{ XKB_KEY_KP_End,        MOD_MASK_CTRL,   "\033[J",       -1,    0,    0},
 422++	{ XKB_KEY_KP_End,        MOD_MASK_CTRL,   "\033[1;5F",    +1,    0,    0},
 423++	{ XKB_KEY_KP_End,        MOD_MASK_SHIFT,  "\033[K",       -1,    0,    0},
 424++	{ XKB_KEY_KP_End,        MOD_MASK_SHIFT,  "\033[1;2F",    +1,    0,    0},
 425++	{ XKB_KEY_KP_End,        MOD_MASK_ANY,    "\033[4~",       0,    0,    0},
 426++	{ XKB_KEY_KP_Next,       MOD_MASK_SHIFT,  "\033[6;2~",     0,    0,    0},
 427++	{ XKB_KEY_KP_Next,       MOD_MASK_ANY,    "\033[6~",       0,    0,    0},
 428++	{ XKB_KEY_KP_Insert,     MOD_MASK_SHIFT,  "\033[2;2~",    +1,    0,    0},
 429++	{ XKB_KEY_KP_Insert,     MOD_MASK_SHIFT,  "\033[4l",      -1,    0,    0},
 430++	{ XKB_KEY_KP_Insert,     MOD_MASK_CTRL,   "\033[L",       -1,    0,    0},
 431++	{ XKB_KEY_KP_Insert,     MOD_MASK_CTRL,   "\033[2;5~",    +1,    0,    0},
 432++	{ XKB_KEY_KP_Insert,     MOD_MASK_ANY,    "\033[4h",      -1,    0,    0},
 433++	{ XKB_KEY_KP_Insert,     MOD_MASK_ANY,    "\033[2~",      +1,    0,    0},
 434++	{ XKB_KEY_KP_Delete,     MOD_MASK_CTRL,   "\033[M",       -1,    0,    0},
 435++	{ XKB_KEY_KP_Delete,     MOD_MASK_CTRL,   "\033[3;5~",    +1,    0,    0},
 436++	{ XKB_KEY_KP_Delete,     MOD_MASK_SHIFT,  "\033[2K",      -1,    0,    0},
 437++	{ XKB_KEY_KP_Delete,     MOD_MASK_SHIFT,  "\033[3;2~",    +1,    0,    0},
 438++	{ XKB_KEY_KP_Delete,     MOD_MASK_ANY,    "\033[P",       -1,    0,    0},
 439++	{ XKB_KEY_KP_Delete,     MOD_MASK_ANY,    "\033[3~",      +1,    0,    0},
 440++	{ XKB_KEY_KP_Multiply,   MOD_MASK_ANY,    "\033Oj",       +2,    0,    0},
 441++	{ XKB_KEY_KP_Add,        MOD_MASK_ANY,    "\033Ok",       +2,    0,    0},
 442++	{ XKB_KEY_KP_Enter,      MOD_MASK_ANY,    "\033OM",       +2,    0,    0},
 443++	{ XKB_KEY_KP_Enter,      MOD_MASK_ANY,    "\r",           -1,    0,   -1},
 444++	{ XKB_KEY_KP_Enter,      MOD_MASK_ANY,    "\r\n",         -1,    0,   +1},
 445++	{ XKB_KEY_KP_Subtract,   MOD_MASK_ANY,    "\033Om",       +2,    0,    0},
 446++	{ XKB_KEY_KP_Decimal,    MOD_MASK_ANY,    "\033On",       +2,    0,    0},
 447++	{ XKB_KEY_KP_Divide,     MOD_MASK_ANY,    "\033Oo",       +2,    0,    0},
 448++	{ XKB_KEY_KP_0,          MOD_MASK_ANY,    "\033Op",       +2,    0,    0},
 449++	{ XKB_KEY_KP_1,          MOD_MASK_ANY,    "\033Oq",       +2,    0,    0},
 450++	{ XKB_KEY_KP_2,          MOD_MASK_ANY,    "\033Or",       +2,    0,    0},
 451++	{ XKB_KEY_KP_3,          MOD_MASK_ANY,    "\033Os",       +2,    0,    0},
 452++	{ XKB_KEY_KP_4,          MOD_MASK_ANY,    "\033Ot",       +2,    0,    0},
 453++	{ XKB_KEY_KP_5,          MOD_MASK_ANY,    "\033Ou",       +2,    0,    0},
 454++	{ XKB_KEY_KP_6,          MOD_MASK_ANY,    "\033Ov",       +2,    0,    0},
 455++	{ XKB_KEY_KP_7,          MOD_MASK_ANY,    "\033Ow",       +2,    0,    0},
 456++	{ XKB_KEY_KP_8,          MOD_MASK_ANY,    "\033Ox",       +2,    0,    0},
 457++	{ XKB_KEY_KP_9,          MOD_MASK_ANY,    "\033Oy",       +2,    0,    0},
 458++	{ XKB_KEY_Up,            MOD_MASK_SHIFT,  "\033[1;2A",     0,    0,    0},
 459++	{ XKB_KEY_Up,            MOD_MASK_ALT,    "\033[1;3A",     0,    0,    0},
 460++	{ XKB_KEY_Up, MOD_MASK_SHIFT|MOD_MASK_ALT,"\033[1;4A",     0,    0,    0},
 461++	{ XKB_KEY_Up,            MOD_MASK_CTRL,   "\033[1;5A",     0,    0,    0},
 462++	{ XKB_KEY_Up,MOD_MASK_SHIFT|MOD_MASK_CTRL,"\033[1;6A",     0,    0,    0},
 463++	{ XKB_KEY_Up,  MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;7A",     0,    0,    0},
 464++	{ XKB_KEY_Up,MOD_MASK_SHIFT|MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;8A",0,0,0},
 465++	{ XKB_KEY_Up,            MOD_MASK_ANY,    "\033[A",        0,   -1,    0},
 466++	{ XKB_KEY_Up,            MOD_MASK_ANY,    "\033OA",        0,   +1,    0},
 467++	{ XKB_KEY_Down,          MOD_MASK_SHIFT,  "\033[1;2B",     0,    0,    0},
 468++	{ XKB_KEY_Down,          MOD_MASK_ALT,    "\033[1;3B",     0,    0,    0},
 469++	{ XKB_KEY_Down,MOD_MASK_SHIFT|MOD_MASK_ALT,"\033[1;4B",    0,    0,    0},
 470++	{ XKB_KEY_Down,         MOD_MASK_CTRL,    "\033[1;5B",     0,    0,    0},
 471++	{ XKB_KEY_Down,MOD_MASK_SHIFT|MOD_MASK_CTRL,"\033[1;6B",   0,    0,    0},
 472++	{ XKB_KEY_Down,MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;7B",     0,    0,    0},
 473++	{ XKB_KEY_Down,MOD_MASK_SHIFT|MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;8B",0,0,0},
 474++	{ XKB_KEY_Down,          MOD_MASK_ANY,    "\033[B",        0,   -1,    0},
 475++	{ XKB_KEY_Down,          MOD_MASK_ANY,    "\033OB",        0,   +1,    0},
 476++	{ XKB_KEY_Left,          MOD_MASK_SHIFT,  "\033[1;2D",     0,    0,    0},
 477++	{ XKB_KEY_Left,          MOD_MASK_ALT,    "\033[1;3D",     0,    0,    0},
 478++	{ XKB_KEY_Left,MOD_MASK_SHIFT|MOD_MASK_ALT,"\033[1;4D",    0,    0,    0},
 479++	{ XKB_KEY_Left,          MOD_MASK_CTRL,   "\033[1;5D",     0,    0,    0},
 480++	{ XKB_KEY_Left,MOD_MASK_SHIFT|MOD_MASK_CTRL,"\033[1;6D",   0,    0,    0},
 481++	{ XKB_KEY_Left,MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;7D",     0,    0,    0},
 482++	{ XKB_KEY_Left,MOD_MASK_SHIFT|MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;8D",0,0,0},
 483++	{ XKB_KEY_Left,          MOD_MASK_ANY,    "\033[D",        0,   -1,    0},
 484++	{ XKB_KEY_Left,          MOD_MASK_ANY,    "\033OD",        0,   +1,    0},
 485++	{ XKB_KEY_Right,         MOD_MASK_SHIFT,  "\033[1;2C",     0,    0,    0},
 486++	{ XKB_KEY_Right,         MOD_MASK_ALT,    "\033[1;3C",     0,    0,    0},
 487++	{ XKB_KEY_Right,MOD_MASK_SHIFT|MOD_MASK_ALT,"\033[1;4C",   0,    0,    0},
 488++	{ XKB_KEY_Right,         MOD_MASK_CTRL,   "\033[1;5C",     0,    0,    0},
 489++	{ XKB_KEY_Right,MOD_MASK_SHIFT|MOD_MASK_CTRL,"\033[1;6C",  0,    0,    0},
 490++	{ XKB_KEY_Right,MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;7C",    0,    0,    0},
 491++	{ XKB_KEY_Right,MOD_MASK_SHIFT|MOD_MASK_CTRL|MOD_MASK_ALT,"\033[1;8C",0,0,0},
 492++	{ XKB_KEY_Right,         MOD_MASK_ANY,    "\033[C",        0,   -1,    0},
 493++	{ XKB_KEY_Right,         MOD_MASK_ANY,    "\033OC",        0,   +1,    0},
 494++	{ XKB_KEY_ISO_Left_Tab,  MOD_MASK_SHIFT,  "\033[Z",        0,    0,    0},
 495++	{ XKB_KEY_Return,        MOD_MASK_ALT,    "\033\r",        0,    0,   -1},
 496++	{ XKB_KEY_Return,        MOD_MASK_ALT,    "\033\r\n",      0,    0,   +1},
 497++	{ XKB_KEY_Return,        MOD_MASK_ANY,    "\r",            0,    0,   -1},
 498++	{ XKB_KEY_Return,        MOD_MASK_ANY,    "\r\n",          0,    0,   +1},
 499++	{ XKB_KEY_Insert,        MOD_MASK_SHIFT,  "\033[4l",      -1,    0,    0},
 500++	{ XKB_KEY_Insert,        MOD_MASK_SHIFT,  "\033[2;2~",    +1,    0,    0},
 501++	{ XKB_KEY_Insert,        MOD_MASK_CTRL,   "\033[L",       -1,    0,    0},
 502++	{ XKB_KEY_Insert,        MOD_MASK_CTRL,   "\033[2;5~",    +1,    0,    0},
 503++	{ XKB_KEY_Insert,        MOD_MASK_ANY,    "\033[4h",      -1,    0,    0},
 504++	{ XKB_KEY_Insert,        MOD_MASK_ANY,    "\033[2~",      +1,    0,    0},
 505++	{ XKB_KEY_Delete,        MOD_MASK_CTRL,   "\033[M",       -1,    0,    0},
 506++	{ XKB_KEY_Delete,        MOD_MASK_CTRL,   "\033[3;5~",    +1,    0,    0},
 507++	{ XKB_KEY_Delete,        MOD_MASK_SHIFT,  "\033[2K",      -1,    0,    0},
 508++	{ XKB_KEY_Delete,        MOD_MASK_SHIFT,  "\033[3;2~",    +1,    0,    0},
 509++	{ XKB_KEY_Delete,        MOD_MASK_ANY,    "\033[P",       -1,    0,    0},
 510++	{ XKB_KEY_Delete,        MOD_MASK_ANY,    "\033[3~",      +1,    0,    0},
 511++	{ XKB_KEY_BackSpace,     MOD_MASK_NONE,   "\177",          0,    0,    0},
 512++	{ XKB_KEY_BackSpace,     MOD_MASK_CTRL,   "\033\177",      0,    0,    0},
 513++	{ XKB_KEY_Home,          MOD_MASK_SHIFT,  "\033[2J",       0,   -1,    0},
 514++	{ XKB_KEY_Home,          MOD_MASK_SHIFT,  "\033[1;2H",     0,   +1,    0},
 515++	{ XKB_KEY_Home,          MOD_MASK_ANY,    "\033[H",        0,   -1,    0},
 516++	{ XKB_KEY_Home,          MOD_MASK_ANY,    "\033[1~",       0,   +1,    0},
 517++	{ XKB_KEY_End,           MOD_MASK_CTRL,   "\033[J",       -1,    0,    0},
 518++	{ XKB_KEY_End,           MOD_MASK_CTRL,   "\033[1;5F",    +1,    0,    0},
 519++	{ XKB_KEY_End,           MOD_MASK_SHIFT,  "\033[K",       -1,    0,    0},
 520++	{ XKB_KEY_End,           MOD_MASK_SHIFT,  "\033[1;2F",    +1,    0,    0},
 521++	{ XKB_KEY_End,           MOD_MASK_ANY,    "\033[4~",       0,    0,    0},
 522++	{ XKB_KEY_Prior,         MOD_MASK_CTRL,   "\033[5;5~",     0,    0,    0},
 523++	{ XKB_KEY_Prior,         MOD_MASK_SHIFT,  "\033[5;2~",     0,    0,    0},
 524++	{ XKB_KEY_Prior,         MOD_MASK_ANY,    "\033[5~",       0,    0,    0},
 525++	{ XKB_KEY_Next,          MOD_MASK_CTRL,   "\033[6;5~",     0,    0,    0},
 526++	{ XKB_KEY_Next,          MOD_MASK_SHIFT,  "\033[6;2~",     0,    0,    0},
 527++	{ XKB_KEY_Next,          MOD_MASK_ANY,    "\033[6~",       0,    0,    0},
 528++	{ XKB_KEY_F1,            MOD_MASK_NONE,   "\033OP" ,       0,    0,    0},
 529++	{ XKB_KEY_F1, /* F13 */  MOD_MASK_SHIFT,  "\033[1;2P",     0,    0,    0},
 530++	{ XKB_KEY_F1, /* F25 */  MOD_MASK_CTRL,   "\033[1;5P",     0,    0,    0},
 531++	{ XKB_KEY_F1, /* F37 */  MOD_MASK_LOGO,   "\033[1;6P",     0,    0,    0},
 532++	{ XKB_KEY_F1, /* F49 */  MOD_MASK_ALT,    "\033[1;3P",     0,    0,    0},
 533++	{ XKB_KEY_F2,            MOD_MASK_NONE,   "\033OQ" ,       0,    0,    0},
 534++	{ XKB_KEY_F2, /* F14 */  MOD_MASK_SHIFT,  "\033[1;2Q",     0,    0,    0},
 535++	{ XKB_KEY_F2, /* F26 */  MOD_MASK_CTRL,   "\033[1;5Q",     0,    0,    0},
 536++	{ XKB_KEY_F2, /* F38 */  MOD_MASK_LOGO,   "\033[1;6Q",     0,    0,    0},
 537++	{ XKB_KEY_F2, /* F50 */  MOD_MASK_ALT,    "\033[1;3Q",     0,    0,    0},
 538++	{ XKB_KEY_F3,            MOD_MASK_NONE,   "\033OR" ,       0,    0,    0},
 539++	{ XKB_KEY_F3, /* F15 */  MOD_MASK_SHIFT,  "\033[1;2R",     0,    0,    0},
 540++	{ XKB_KEY_F3, /* F27 */  MOD_MASK_CTRL,   "\033[1;5R",     0,    0,    0},
 541++	{ XKB_KEY_F3, /* F39 */  MOD_MASK_LOGO,   "\033[1;6R",     0,    0,    0},
 542++	{ XKB_KEY_F3, /* F51 */  MOD_MASK_ALT,    "\033[1;3R",     0,    0,    0},
 543++	{ XKB_KEY_F4,            MOD_MASK_NONE,   "\033OS" ,       0,    0,    0},
 544++	{ XKB_KEY_F4, /* F16 */  MOD_MASK_SHIFT,  "\033[1;2S",     0,    0,    0},
 545++	{ XKB_KEY_F4, /* F28 */  MOD_MASK_CTRL,   "\033[1;5S",     0,    0,    0},
 546++	{ XKB_KEY_F4, /* F40 */  MOD_MASK_LOGO,   "\033[1;6S",     0,    0,    0},
 547++	{ XKB_KEY_F4, /* F52 */  MOD_MASK_ALT,    "\033[1;3S",     0,    0,    0},
 548++	{ XKB_KEY_F5,            MOD_MASK_NONE,   "\033[15~",      0,    0,    0},
 549++	{ XKB_KEY_F5, /* F17 */  MOD_MASK_SHIFT,  "\033[15;2~",    0,    0,    0},
 550++	{ XKB_KEY_F5, /* F29 */  MOD_MASK_CTRL,   "\033[15;5~",    0,    0,    0},
 551++	{ XKB_KEY_F5, /* F41 */  MOD_MASK_LOGO,   "\033[15;6~",    0,    0,    0},
 552++	{ XKB_KEY_F5, /* F53 */  MOD_MASK_ALT,    "\033[15;3~",    0,    0,    0},
 553++	{ XKB_KEY_F6,            MOD_MASK_NONE,   "\033[17~",      0,    0,    0},
 554++	{ XKB_KEY_F6, /* F18 */  MOD_MASK_SHIFT,  "\033[17;2~",    0,    0,    0},
 555++	{ XKB_KEY_F6, /* F30 */  MOD_MASK_CTRL,   "\033[17;5~",    0,    0,    0},
 556++	{ XKB_KEY_F6, /* F42 */  MOD_MASK_LOGO,   "\033[17;6~",    0,    0,    0},
 557++	{ XKB_KEY_F6, /* F54 */  MOD_MASK_ALT,    "\033[17;3~",    0,    0,    0},
 558++	{ XKB_KEY_F7,            MOD_MASK_NONE,   "\033[18~",      0,    0,    0},
 559++	{ XKB_KEY_F7, /* F19 */  MOD_MASK_SHIFT,  "\033[18;2~",    0,    0,    0},
 560++	{ XKB_KEY_F7, /* F31 */  MOD_MASK_CTRL,   "\033[18;5~",    0,    0,    0},
 561++	{ XKB_KEY_F7, /* F43 */  MOD_MASK_LOGO,   "\033[18;6~",    0,    0,    0},
 562++	{ XKB_KEY_F7, /* F55 */  MOD_MASK_ALT,    "\033[18;3~",    0,    0,    0},
 563++	{ XKB_KEY_F8,            MOD_MASK_NONE,   "\033[19~",      0,    0,    0},
 564++	{ XKB_KEY_F8, /* F20 */  MOD_MASK_SHIFT,  "\033[19;2~",    0,    0,    0},
 565++	{ XKB_KEY_F8, /* F32 */  MOD_MASK_CTRL,   "\033[19;5~",    0,    0,    0},
 566++	{ XKB_KEY_F8, /* F44 */  MOD_MASK_LOGO,   "\033[19;6~",    0,    0,    0},
 567++	{ XKB_KEY_F8, /* F56 */  MOD_MASK_ALT,    "\033[19;3~",    0,    0,    0},
 568++	{ XKB_KEY_F9,            MOD_MASK_NONE,   "\033[20~",      0,    0,    0},
 569++	{ XKB_KEY_F9, /* F21 */  MOD_MASK_SHIFT,  "\033[20;2~",    0,    0,    0},
 570++	{ XKB_KEY_F9, /* F33 */  MOD_MASK_CTRL,   "\033[20;5~",    0,    0,    0},
 571++	{ XKB_KEY_F9, /* F45 */  MOD_MASK_LOGO,   "\033[20;6~",    0,    0,    0},
 572++	{ XKB_KEY_F9, /* F57 */  MOD_MASK_ALT,    "\033[20;3~",    0,    0,    0},
 573++	{ XKB_KEY_F10,           MOD_MASK_NONE,   "\033[21~",      0,    0,    0},
 574++	{ XKB_KEY_F10, /* F22 */ MOD_MASK_SHIFT,  "\033[21;2~",    0,    0,    0},
 575++	{ XKB_KEY_F10, /* F34 */ MOD_MASK_CTRL,   "\033[21;5~",    0,    0,    0},
 576++	{ XKB_KEY_F10, /* F46 */ MOD_MASK_LOGO,   "\033[21;6~",    0,    0,    0},
 577++	{ XKB_KEY_F10, /* F58 */ MOD_MASK_ALT,    "\033[21;3~",    0,    0,    0},
 578++	{ XKB_KEY_F11,           MOD_MASK_NONE,   "\033[23~",      0,    0,    0},
 579++	{ XKB_KEY_F11, /* F23 */ MOD_MASK_SHIFT,  "\033[23;2~",    0,    0,    0},
 580++	{ XKB_KEY_F11, /* F35 */ MOD_MASK_CTRL,   "\033[23;5~",    0,    0,    0},
 581++	{ XKB_KEY_F11, /* F47 */ MOD_MASK_LOGO,   "\033[23;6~",    0,    0,    0},
 582++	{ XKB_KEY_F11, /* F59 */ MOD_MASK_ALT,    "\033[23;3~",    0,    0,    0},
 583++	{ XKB_KEY_F12,           MOD_MASK_NONE,   "\033[24~",      0,    0,    0},
 584++	{ XKB_KEY_F12, /* F24 */ MOD_MASK_SHIFT,  "\033[24;2~",    0,    0,    0},
 585++	{ XKB_KEY_F12, /* F36 */ MOD_MASK_CTRL,   "\033[24;5~",    0,    0,    0},
 586++	{ XKB_KEY_F12, /* F48 */ MOD_MASK_LOGO,   "\033[24;6~",    0,    0,    0},
 587++	{ XKB_KEY_F12, /* F60 */ MOD_MASK_ALT,    "\033[24;3~",    0,    0,    0},
 588++	{ XKB_KEY_F13,           MOD_MASK_NONE,   "\033[1;2P",     0,    0,    0},
 589++	{ XKB_KEY_F14,           MOD_MASK_NONE,   "\033[1;2Q",     0,    0,    0},
 590++	{ XKB_KEY_F15,           MOD_MASK_NONE,   "\033[1;2R",     0,    0,    0},
 591++	{ XKB_KEY_F16,           MOD_MASK_NONE,   "\033[1;2S",     0,    0,    0},
 592++	{ XKB_KEY_F17,           MOD_MASK_NONE,   "\033[15;2~",    0,    0,    0},
 593++	{ XKB_KEY_F18,           MOD_MASK_NONE,   "\033[17;2~",    0,    0,    0},
 594++	{ XKB_KEY_F19,           MOD_MASK_NONE,   "\033[18;2~",    0,    0,    0},
 595++	{ XKB_KEY_F20,           MOD_MASK_NONE,   "\033[19;2~",    0,    0,    0},
 596++	{ XKB_KEY_F21,           MOD_MASK_NONE,   "\033[20;2~",    0,    0,    0},
 597++	{ XKB_KEY_F22,           MOD_MASK_NONE,   "\033[21;2~",    0,    0,    0},
 598++	{ XKB_KEY_F23,           MOD_MASK_NONE,   "\033[23;2~",    0,    0,    0},
 599++	{ XKB_KEY_F24,           MOD_MASK_NONE,   "\033[24;2~",    0,    0,    0},
 600++	{ XKB_KEY_F25,           MOD_MASK_NONE,   "\033[1;5P",     0,    0,    0},
 601++	{ XKB_KEY_F26,           MOD_MASK_NONE,   "\033[1;5Q",     0,    0,    0},
 602++	{ XKB_KEY_F27,           MOD_MASK_NONE,   "\033[1;5R",     0,    0,    0},
 603++	{ XKB_KEY_F28,           MOD_MASK_NONE,   "\033[1;5S",     0,    0,    0},
 604++	{ XKB_KEY_F29,           MOD_MASK_NONE,   "\033[15;5~",    0,    0,    0},
 605++	{ XKB_KEY_F30,           MOD_MASK_NONE,   "\033[17;5~",    0,    0,    0},
 606++	{ XKB_KEY_F31,           MOD_MASK_NONE,   "\033[18;5~",    0,    0,    0},
 607++	{ XKB_KEY_F32,           MOD_MASK_NONE,   "\033[19;5~",    0,    0,    0},
 608++	{ XKB_KEY_F33,           MOD_MASK_NONE,   "\033[20;5~",    0,    0,    0},
 609++	{ XKB_KEY_F34,           MOD_MASK_NONE,   "\033[21;5~",    0,    0,    0},
 610++	{ XKB_KEY_F35,           MOD_MASK_NONE,   "\033[23;5~",    0,    0,    0},
 611+ };
 612+ 
 613+ /*
 614+@@ -452,7 +448,7 @@ static Key key[] = {
 615+  * If no match is found, regular selection is used.
 616+  */
 617+ static uint selmasks[] = {
 618+-	[SEL_RECTANGULAR] = Mod1Mask,
 619++	[SEL_RECTANGULAR] = MOD_MASK_ALT,
 620+ };
 621+ 
 622+ /*
 623+diff --git a/config.mk b/config.mk
 624+index c84c5ee..7da06f1 100644
 625+--- a/config.mk
 626++++ b/config.mk
 627+@@ -7,16 +7,12 @@ VERSION = 0.7
 628+ PREFIX = /usr/local
 629+ MANPREFIX = ${PREFIX}/share/man
 630+ 
 631+-X11INC = /usr/X11R6/include
 632+-X11LIB = /usr/X11R6/lib
 633++PKGCFG = fontconfig wayland-client wayland-cursor xkbcommon wld
 634++XDG_SHELL_PROTO = `pkg-config --variable=pkgdatadir wayland-protocols`/unstable/xdg-shell/xdg-shell-unstable-v5.xml
 635+ 
 636+ # includes and libs
 637+-INCS = -I. -I/usr/include -I${X11INC} \
 638+-       `pkg-config --cflags fontconfig` \
 639+-       `pkg-config --cflags freetype2`
 640+-LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft \
 641+-       `pkg-config --libs fontconfig`  \
 642+-       `pkg-config --libs freetype2`
 643++INCS = -I. -I/usr/include `pkg-config --cflags ${PKGCFG}`
 644++LIBS = -L/usr/lib -lc -lm -lrt -lutil `pkg-config --libs ${PKGCFG}`
 645+ 
 646+ # flags
 647+ CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600
 648+diff --git a/st.c b/st.c
 649+index fbcd9e0..9ead681 100644
 650+--- a/st.c
 651++++ b/st.c
 652+@@ -3,6 +3,8 @@
 653+ #include <errno.h>
 654+ #include <fcntl.h>
 655+ #include <limits.h>
 656++/* for BTN_* definitions */
 657++#include <linux/input.h>
 658+ #include <locale.h>
 659+ #include <pwd.h>
 660+ #include <stdarg.h>
 661+@@ -12,6 +14,7 @@
 662+ #include <signal.h>
 663+ #include <stdint.h>
 664+ #include <sys/ioctl.h>
 665++#include <sys/mman.h>
 666+ #include <sys/select.h>
 667+ #include <sys/stat.h>
 668+ #include <sys/time.h>
 669+@@ -21,23 +24,19 @@
 670+ #include <time.h>
 671+ #include <unistd.h>
 672+ #include <libgen.h>
 673+-#include <X11/Xatom.h>
 674+-#include <X11/Xlib.h>
 675+-#include <X11/Xutil.h>
 676+-#include <X11/cursorfont.h>
 677+-#include <X11/keysym.h>
 678+-#include <X11/Xft/Xft.h>
 679+-#include <X11/XKBlib.h>
 680++#include <wayland-client.h>
 681++#include <wayland-cursor.h>
 682++#include <xkbcommon/xkbcommon.h>
 683++#include <wld/wld.h>
 684++#include <wld/wayland.h>
 685+ #include <fontconfig/fontconfig.h>
 686+ #include <wchar.h>
 687+ 
 688+ #include "arg.h"
 689++#include "xdg-shell-client-protocol.h"
 690+ 
 691+ char *argv0;
 692+ 
 693+-#define Glyph Glyph_
 694+-#define Font Font_
 695+-
 696+ #if   defined(__linux)
 697+  #include <pty.h>
 698+ #elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
 699+@@ -47,10 +46,6 @@ char *argv0;
 700+ #endif
 701+ 
 702+ 
 703+-/* XEMBED messages */
 704+-#define XEMBED_FOCUS_IN  4
 705+-#define XEMBED_FOCUS_OUT 5
 706+-
 707+ /* Arbitrary sizes */
 708+ #define UTF_INVALID   0xFFFD
 709+ #define UTF_SIZ       4
 710+@@ -58,15 +53,25 @@ char *argv0;
 711+ #define ESC_ARG_SIZ   16
 712+ #define STR_BUF_SIZ   ESC_BUF_SIZ
 713+ #define STR_ARG_SIZ   ESC_ARG_SIZ
 714++#define DRAW_BUF_SIZ  20*1024
 715+ #define XK_ANY_MOD    UINT_MAX
 716+ #define XK_NO_MOD     0
 717+ #define XK_SWITCH_MOD (1<<13)
 718+ 
 719++#define MOD_MASK_ANY	UINT_MAX
 720++#define MOD_MASK_NONE	0
 721++#define MOD_MASK_CTRL	(1<<0)
 722++#define MOD_MASK_ALT	(1<<1)
 723++#define MOD_MASK_SHIFT	(1<<2)
 724++#define MOD_MASK_LOGO	(1<<3)
 725++
 726++#define AXIS_VERTICAL	WL_POINTER_AXIS_VERTICAL_SCROLL
 727++#define AXIS_HORIZONTAL	WL_POINTER_AXIS_HORIZONTAL_SCROLL
 728++
 729+ /* macros */
 730+ #define MIN(a, b)		((a) < (b) ? (a) : (b))
 731+ #define MAX(a, b)		((a) < (b) ? (b) : (a))
 732+ #define LEN(a)			(sizeof(a) / sizeof(a)[0])
 733+-#define NUMMAXLEN(x)		((int)(sizeof(x) * 2.56 + 0.5) + 1)
 734+ #define DEFAULT(a, b)		(a) = (a) ? (a) : (b)
 735+ #define BETWEEN(x, a, b)	((a) <= (x) && (x) <= (b))
 736+ #define DIVCEIL(n, d)		(((n) + ((d) - 1)) / (d))
 737+@@ -89,7 +94,7 @@ char *argv0;
 738+ #define TRUEBLUE(x)		(((x) & 0xff) << 8)
 739+ 
 740+ /* constants */
 741+-#define ISO14755CMD		"dmenu -w %lu -p codepoint: </dev/null"
 742++#define ISO14755CMD		"dmenu -p codepoint: </dev/null"
 743+ 
 744+ enum glyph_attribute {
 745+ 	ATTR_NULL       = 0,
 746+@@ -195,9 +200,6 @@ typedef unsigned short ushort;
 747+ 
 748+ typedef uint_least32_t Rune;
 749+ 
 750+-typedef XftDraw *Draw;
 751+-typedef XftColor Color;
 752+-
 753+ typedef struct {
 754+ 	Rune u;           /* character code */
 755+ 	ushort mode;      /* attribute flags */
 756+@@ -242,7 +244,6 @@ typedef struct {
 757+ 	Line *line;   /* screen */
 758+ 	Line *alt;    /* alternate screen */
 759+ 	int *dirty;  /* dirtyness of lines */
 760+-	XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */
 761+ 	TCursor c;    /* cursor */
 762+ 	int top;      /* top    scroll limit */
 763+ 	int bot;      /* bottom scroll limit */
 764+@@ -255,29 +256,54 @@ typedef struct {
 765+ 	int *tabs;
 766+ } Term;
 767+ 
 768+-/* Purely graphic info */
 769+ typedef struct {
 770+-	Display *dpy;
 771+-	Colormap cmap;
 772+-	Window win;
 773+-	Drawable buf;
 774+-	Atom xembed, wmdeletewin, netwmname, netwmpid;
 775+-	XIM xim;
 776+-	XIC xic;
 777+-	Draw draw;
 778+-	Visual *vis;
 779+-	XSetWindowAttributes attrs;
 780+-	int scr;
 781+-	int isfixed; /* is fixed geometry? */
 782+-	int l, t; /* left and top offset */
 783+-	int gm; /* geometry mask */
 784++	struct xkb_context *ctx;
 785++	struct xkb_keymap *keymap;
 786++	struct xkb_state *state;
 787++	xkb_mod_index_t ctrl, alt, shift, logo;
 788++	unsigned int mods;
 789++} XKB;
 790++
 791++typedef struct {
 792++	struct wl_display *dpy;
 793++	struct wl_compositor *cmp;
 794++	struct wl_shm *shm;
 795++	struct wl_seat *seat;
 796++	struct wl_keyboard *keyboard;
 797++	struct wl_pointer *pointer;
 798++	struct wl_data_device_manager *datadevmanager;
 799++	struct wl_data_device *datadev;
 800++	struct wl_data_offer *seloffer;
 801++	struct wl_surface *surface;
 802++	struct wl_buffer *buffer;
 803++	struct xdg_wm_base *wm;
 804++	struct xdg_surface *xdgsurface;
 805++	struct xdg_toplevel *toplevel;
 806++	XKB xkb;
 807++	bool configured;
 808++	int px, py; /* pointer x and y */
 809+ 	int tw, th; /* tty width and height */
 810+ 	int w, h; /* window width and height */
 811+ 	int ch; /* char height */
 812+ 	int cw; /* char width  */
 813++	int vis;
 814+ 	char state; /* focus, redraw, visible */
 815+ 	int cursor; /* cursor style */
 816+-} XWindow;
 817++	struct wl_callback * framecb;
 818++} Wayland;
 819++
 820++typedef struct {
 821++	struct wld_context *ctx;
 822++	struct wld_font_context *fontctx;
 823++	struct wld_renderer *renderer;
 824++	struct wld_buffer *buffer, *oldbuffer;
 825++} WLD;
 826++
 827++typedef struct {
 828++	struct wl_cursor_theme *theme;
 829++	struct wl_cursor *cursor;
 830++	struct wl_surface *surface;
 831++} Cursor;
 832+ 
 833+ typedef struct {
 834+ 	uint b;
 835+@@ -286,7 +312,14 @@ typedef struct {
 836+ } MouseShortcut;
 837+ 
 838+ typedef struct {
 839+-	KeySym k;
 840++	int axis;
 841++	int dir;
 842++	uint mask;
 843++	char s[ESC_BUF_SIZ];
 844++} Axiskey;
 845++
 846++typedef struct {
 847++	xkb_keysym_t k;
 848+ 	uint mask;
 849+ 	char *s;
 850+ 	/* three valued logic variables: 0 indifferent, 1 on, -1 off */
 851+@@ -310,11 +343,10 @@ typedef struct {
 852+ 		int x, y;
 853+ 	} nb, ne, ob, oe;
 854+ 
 855+-	char *primary, *clipboard;
 856+-	Atom xtarget;
 857++	char *primary;
 858++	struct wl_data_source *source;
 859+ 	int alt;
 860+-	struct timespec tclick1;
 861+-	struct timespec tclick2;
 862++	uint32_t tclick1, tclick2;
 863+ } Selection;
 864+ 
 865+ typedef union {
 866+@@ -326,19 +358,25 @@ typedef union {
 867+ 
 868+ typedef struct {
 869+ 	uint mod;
 870+-	KeySym keysym;
 871++	xkb_keysym_t keysym;
 872+ 	void (*func)(const Arg *);
 873+ 	const Arg arg;
 874+ } Shortcut;
 875+ 
 876++typedef struct {
 877++	char str[32];
 878++	uint32_t key;
 879++	int len;
 880++	bool started;
 881++	struct timespec last;
 882++} Repeat;
 883++
 884+ /* function definitions used in config.h */
 885+-static void clipcopy(const Arg *);
 886+-static void clippaste(const Arg *);
 887+ static void numlock(const Arg *);
 888+ static void selpaste(const Arg *);
 889+-static void xzoom(const Arg *);
 890+-static void xzoomabs(const Arg *);
 891+-static void xzoomreset(const Arg *);
 892++static void wlzoom(const Arg *);
 893++static void wlzoomabs(const Arg *);
 894++static void wlzoomreset(const Arg *);
 895+ static void printsel(const Arg *);
 896+ static void printscreen(const Arg *) ;
 897+ static void iso14755(const Arg *);
 898+@@ -358,16 +396,15 @@ typedef struct {
 899+ 	int badweight;
 900+ 	short lbearing;
 901+ 	short rbearing;
 902+-	XftFont *match;
 903++	struct wld_font *match;
 904+ 	FcFontSet *set;
 905+ 	FcPattern *pattern;
 906+ } Font;
 907+ 
 908+ /* Drawing Context */
 909+ typedef struct {
 910+-	Color col[MAX(LEN(colorname), 256)];
 911++	uint32_t col[MAX(LEN(colorname), 256)];
 912+ 	Font font, bfont, ifont, ibfont;
 913+-	GC gc;
 914+ } DC;
 915+ 
 916+ static void die(const char *, ...);
 917+@@ -378,6 +415,7 @@ static void execsh(void);
 918+ static void stty(void);
 919+ static void sigchld(int);
 920+ static void run(void);
 921++static void cresize(int, int);
 922+ 
 923+ static void csidump(void);
 924+ static void csihandle(void);
 925+@@ -433,56 +471,80 @@ static void ttysend(char *, size_t);
 926+ static void ttywrite(const char *, size_t);
 927+ static void tstrsequence(uchar);
 928+ 
 929+-static inline ushort sixd_to_16bit(int);
 930+-static int xmakeglyphfontspecs(XftGlyphFontSpec *, const Glyph *, int, int, int);
 931+-static void xdrawglyphfontspecs(const XftGlyphFontSpec *, Glyph, int, int, int);
 932+-static void xdrawglyph(Glyph, int, int);
 933+-static void xhints(void);
 934+-static void xclear(int, int, int, int);
 935+-static void xdrawcursor(void);
 936+-static void xinit(void);
 937+-static void xloadcols(void);
 938+-static int xsetcolorname(int, const char *);
 939+-static int xgeommasktogravity(int);
 940+-static int xloadfont(Font *, FcPattern *);
 941+-static void xloadfonts(char *, double);
 942+-static void xsettitle(char *);
 943+-static void xresettitle(void);
 944+-static void xsetpointermotion(int);
 945+-static void xseturgency(int);
 946+-static void xsetsel(char *, Time);
 947+-static void xunloadfont(Font *);
 948+-static void xunloadfonts(void);
 949+-static void xresize(int, int);
 950+-
 951+-static void expose(XEvent *);
 952+-static void visibility(XEvent *);
 953+-static void unmap(XEvent *);
 954+-static char *kmap(KeySym, uint);
 955+-static void kpress(XEvent *);
 956+-static void cmessage(XEvent *);
 957+-static void cresize(int, int);
 958+-static void resize(XEvent *);
 959+-static void focus(XEvent *);
 960+-static void brelease(XEvent *);
 961+-static void bpress(XEvent *);
 962+-static void bmotion(XEvent *);
 963+-static void propnotify(XEvent *);
 964+-static void selnotify(XEvent *);
 965+-static void selclear(XEvent *);
 966+-static void selrequest(XEvent *);
 967++static inline uchar sixd_to_8bit(int);
 968++static void wldraws(char *, Glyph, int, int, int, int);
 969++static void wldrawglyph(Glyph, int, int);
 970++static void wlclear(int, int, int, int);
 971++static void wldrawcursor(void);
 972++static void wlinit(void);
 973++static void wlloadcols(void);
 974++static int wlsetcolorname(int, const char *);
 975++static void wlloadcursor(void);
 976++static int wlloadfont(Font *, FcPattern *);
 977++static void wlloadfonts(char *, double);
 978++static void wlsettitle(char *);
 979++static void wlresettitle(void);
 980++static void wlseturgency(int);
 981++static void wlsetsel(char*, uint32_t);
 982++static void wlunloadfont(Font *f);
 983++static void wlunloadfonts(void);
 984++static void wlresize(int, int);
 985++
 986++static void regglobal(void *, struct wl_registry *, uint32_t, const char *,
 987++		uint32_t);
 988++static void regglobalremove(void *, struct wl_registry *, uint32_t);
 989++static void surfenter(void *, struct wl_surface *, struct wl_output *);
 990++static void surfleave(void *, struct wl_surface *, struct wl_output *);
 991++static void framedone(void *, struct wl_callback *, uint32_t);
 992++static void kbdkeymap(void *, struct wl_keyboard *, uint32_t, int32_t, uint32_t);
 993++static void kbdenter(void *, struct wl_keyboard *, uint32_t,
 994++		struct wl_surface *, struct wl_array *);
 995++static void kbdleave(void *, struct wl_keyboard *, uint32_t,
 996++		struct wl_surface *);
 997++static void kbdkey(void *, struct wl_keyboard *, uint32_t, uint32_t, uint32_t,
 998++		uint32_t);
 999++static void kbdmodifiers(void *, struct wl_keyboard *, uint32_t, uint32_t,
1000++		uint32_t, uint32_t, uint32_t);
1001++static void kbdrepeatinfo(void *, struct wl_keyboard *, int32_t, int32_t);
1002++static void ptrenter(void *, struct wl_pointer *, uint32_t, struct wl_surface *,
1003++		wl_fixed_t, wl_fixed_t);
1004++static void ptrleave(void *, struct wl_pointer *, uint32_t,
1005++		struct wl_surface *);
1006++static void ptrmotion(void *, struct wl_pointer *, uint32_t,
1007++		wl_fixed_t, wl_fixed_t);
1008++static void ptrbutton(void *, struct wl_pointer *, uint32_t, uint32_t,
1009++		uint32_t, uint32_t);
1010++static void ptraxis(void *, struct wl_pointer *, uint32_t, uint32_t,
1011++		wl_fixed_t);
1012++static void wmping(void *, struct xdg_wm_base *, uint32_t);
1013++static void xdgsurfconfigure(void *, struct xdg_surface *, uint32_t);
1014++static void toplevelconfigure(void *, struct xdg_toplevel *,
1015++		int32_t, int32_t, struct wl_array *);
1016++static void toplevelclose(void *, struct xdg_toplevel *);
1017++static void datadevoffer(void *, struct wl_data_device *,
1018++		struct wl_data_offer *);
1019++static void datadeventer(void *, struct wl_data_device *, uint32_t,
1020++		struct wl_surface *, wl_fixed_t, wl_fixed_t, struct wl_data_offer *);
1021++static void datadevleave(void *, struct wl_data_device *);
1022++static void datadevmotion(void *, struct wl_data_device *, uint32_t,
1023++		wl_fixed_t x, wl_fixed_t y);
1024++static void datadevdrop(void *, struct wl_data_device *);
1025++static void datadevselection(void *, struct wl_data_device *,
1026++		struct wl_data_offer *);
1027++static void dataofferoffer(void *, struct wl_data_offer *, const char *);
1028++static void datasrctarget(void *, struct wl_data_source *, const char *);
1029++static void datasrcsend(void *, struct wl_data_source *, const char *, int32_t);
1030++static void datasrccancelled(void *, struct wl_data_source *);
1031+ 
1032+ static void selinit(void);
1033+ static void selnormalize(void);
1034+ static inline int selected(int, int);
1035+ static char *getsel(void);
1036+-static void selcopy(Time);
1037++static void selcopy(uint32_t);
1038+ static void selscroll(int, int);
1039+ static void selsnap(int *, int *, int);
1040+ static int x2col(int);
1041+ static int y2row(int);
1042+-static void getbuttoninfo(XEvent *);
1043+-static void mousereport(XEvent *);
1044+ 
1045+ static size_t utf8decode(char *, Rune *, size_t);
1046+ static Rune utf8decodebyte(char, size_t *);
1047+@@ -498,41 +560,37 @@ static char *xstrdup(char *);
1048+ 
1049+ static void usage(void);
1050+ 
1051+-static void (*handler[LASTEvent])(XEvent *) = {
1052+-	[KeyPress] = kpress,
1053+-	[ClientMessage] = cmessage,
1054+-	[ConfigureNotify] = resize,
1055+-	[VisibilityNotify] = visibility,
1056+-	[UnmapNotify] = unmap,
1057+-	[Expose] = expose,
1058+-	[FocusIn] = focus,
1059+-	[FocusOut] = focus,
1060+-	[MotionNotify] = bmotion,
1061+-	[ButtonPress] = bpress,
1062+-	[ButtonRelease] = brelease,
1063+-/*
1064+- * Uncomment if you want the selection to disappear when you select something
1065+- * different in another window.
1066+- */
1067+-/*	[SelectionClear] = selclear, */
1068+-	[SelectionNotify] = selnotify,
1069+-/*
1070+- * PropertyNotify is only turned on when there is some INCR transfer happening
1071+- * for the selection retrieval.
1072+- */
1073+-	[PropertyNotify] = propnotify,
1074+-	[SelectionRequest] = selrequest,
1075+-};
1076++static struct wl_registry_listener reglistener = { regglobal, regglobalremove };
1077++static struct wl_surface_listener surflistener = { surfenter, surfleave };
1078++static struct wl_callback_listener framelistener = { framedone };
1079++static struct wl_keyboard_listener kbdlistener =
1080++	{ kbdkeymap, kbdenter, kbdleave, kbdkey, kbdmodifiers, kbdrepeatinfo };
1081++static struct wl_pointer_listener ptrlistener =
1082++	{ ptrenter, ptrleave, ptrmotion, ptrbutton, ptraxis };
1083++static struct xdg_wm_base_listener wmlistener = { wmping };
1084++static struct xdg_surface_listener xdgsurflistener = { xdgsurfconfigure };
1085++static struct xdg_toplevel_listener toplevellistener =
1086++	{ toplevelconfigure, toplevelclose };
1087++static struct wl_data_device_listener datadevlistener =
1088++	{ datadevoffer, datadeventer, datadevleave, datadevmotion, datadevdrop,
1089++	  datadevselection };
1090++static struct wl_data_offer_listener dataofferlistener = { dataofferoffer };
1091++static struct wl_data_source_listener datasrclistener =
1092++	{ datasrctarget, datasrcsend, datasrccancelled };
1093+ 
1094+ /* Globals */
1095+ static DC dc;
1096+-static XWindow xw;
1097++static Wayland wl;
1098++static WLD wld;
1099++static Cursor cursor;
1100+ static Term term;
1101+ static CSIEscape csiescseq;
1102+ static STREscape strescseq;
1103+ static int cmdfd;
1104+ static pid_t pid;
1105+ static Selection sel;
1106++static Repeat repeat;
1107++static bool needdraw = true;
1108+ static int iofd = 1;
1109+ static char **opt_cmd  = NULL;
1110+ static char *opt_class = NULL;
1111+@@ -543,6 +601,7 @@ static char *opt_line  = NULL;
1112+ static char *opt_name  = NULL;
1113+ static char *opt_title = NULL;
1114+ static int oldbutton   = 3; /* button event on startup: 3 = release */
1115++static int oldx, oldy;
1116+ 
1117+ static char *usedfont = NULL;
1118+ static double usedfontsize = 0;
1119+@@ -562,7 +621,7 @@ enum {
1120+ };
1121+ 
1122+ typedef struct {
1123+-	XftFont *font;
1124++	struct wld_font *font;
1125+ 	int flags;
1126+ 	Rune unicodep;
1127+ } Fontcache;
1128+@@ -707,23 +766,20 @@ utf8validate(Rune *u, size_t i)
1129+ void
1130+ selinit(void)
1131+ {
1132+-	clock_gettime(CLOCK_MONOTONIC, &sel.tclick1);
1133+-	clock_gettime(CLOCK_MONOTONIC, &sel.tclick2);
1134++	sel.tclick1 = 0;
1135++	sel.tclick2 = 0;
1136+ 	sel.mode = SEL_IDLE;
1137+ 	sel.snap = 0;
1138+ 	sel.ob.x = -1;
1139+ 	sel.primary = NULL;
1140+-	sel.clipboard = NULL;
1141+-	sel.xtarget = XInternAtom(xw.dpy, "UTF8_STRING", 0);
1142+-	if (sel.xtarget == None)
1143+-		sel.xtarget = XA_STRING;
1144++	sel.source = NULL;
1145+ }
1146+ 
1147+ int
1148+ x2col(int x)
1149+ {
1150+ 	x -= borderpx;
1151+-	x /= xw.cw;
1152++	x /= wl.cw;
1153+ 
1154+ 	return LIMIT(x, 0, term.col-1);
1155+ }
1156+@@ -732,7 +788,7 @@ int
1157+ y2row(int y)
1158+ {
1159+ 	y -= borderpx;
1160+-	y /= xw.ch;
1161++	y /= wl.ch;
1162+ 
1163+ 	return LIMIT(y, 0, term.row-1);
1164+ }
1165+@@ -868,15 +924,15 @@ selsnap(int *x, int *y, int direction)
1166+ }
1167+ 
1168+ void
1169+-getbuttoninfo(XEvent *e)
1170++getbuttoninfo(void)
1171+ {
1172+ 	int type;
1173+-	uint state = e->xbutton.state & ~(Button1Mask | forceselmod);
1174++	uint state = wl.xkb.mods & ~forceselmod;
1175+ 
1176+ 	sel.alt = IS_SET(MODE_ALTSCREEN);
1177+ 
1178+-	sel.oe.x = x2col(e->xbutton.x);
1179+-	sel.oe.y = y2row(e->xbutton.y);
1180++	sel.oe.x = x2col(wl.px);
1181++	sel.oe.y = y2row(wl.py);
1182+ 	selnormalize();
1183+ 
1184+ 	sel.type = SEL_REGULAR;
1185+@@ -889,59 +945,20 @@ getbuttoninfo(XEvent *e)
1186+ }
1187+ 
1188+ void
1189+-mousereport(XEvent *e)
1190++wlmousereport(int button, bool release, int x, int y)
1191+ {
1192+-	int x = x2col(e->xbutton.x), y = y2row(e->xbutton.y),
1193+-	    button = e->xbutton.button, state = e->xbutton.state,
1194+-	    len;
1195++	int len;
1196+ 	char buf[40];
1197+-	static int ox, oy;
1198+-
1199+-	/* from urxvt */
1200+-	if (e->xbutton.type == MotionNotify) {
1201+-		if (x == ox && y == oy)
1202+-			return;
1203+-		if (!IS_SET(MODE_MOUSEMOTION) && !IS_SET(MODE_MOUSEMANY))
1204+-			return;
1205+-		/* MOUSE_MOTION: no reporting if no button is pressed */
1206+-		if (IS_SET(MODE_MOUSEMOTION) && oldbutton == 3)
1207+-			return;
1208+-
1209+-		button = oldbutton + 32;
1210+-		ox = x;
1211+-		oy = y;
1212+-	} else {
1213+-		if (!IS_SET(MODE_MOUSESGR) && e->xbutton.type == ButtonRelease) {
1214+-			button = 3;
1215+-		} else {
1216+-			button -= Button1;
1217+-			if (button >= 3)
1218+-				button += 64 - 3;
1219+-		}
1220+-		if (e->xbutton.type == ButtonPress) {
1221+-			oldbutton = button;
1222+-			ox = x;
1223+-			oy = y;
1224+-		} else if (e->xbutton.type == ButtonRelease) {
1225+-			oldbutton = 3;
1226+-			/* MODE_MOUSEX10: no button release reporting */
1227+-			if (IS_SET(MODE_MOUSEX10))
1228+-				return;
1229+-			if (button == 64 || button == 65)
1230+-				return;
1231+-		}
1232+-	}
1233+ 
1234+ 	if (!IS_SET(MODE_MOUSEX10)) {
1235+-		button += ((state & ShiftMask  ) ? 4  : 0)
1236+-			+ ((state & Mod4Mask   ) ? 8  : 0)
1237+-			+ ((state & ControlMask) ? 16 : 0);
1238++		button += ((wl.xkb.mods & MOD_MASK_SHIFT) ? 4  : 0)
1239++			+ ((wl.xkb.mods & MOD_MASK_LOGO ) ? 8  : 0)
1240++			+ ((wl.xkb.mods & MOD_MASK_CTRL ) ? 16 : 0);
1241+ 	}
1242+ 
1243+ 	if (IS_SET(MODE_MOUSESGR)) {
1244+ 		len = snprintf(buf, sizeof(buf), "\033[<%d;%d;%d%c",
1245+-				button, x+1, y+1,
1246+-				e->xbutton.type == ButtonRelease ? 'm' : 'M');
1247++				button, x+1, y+1, release ? 'm' : 'M');
1248+ 	} else if (x < 223 && y < 223) {
1249+ 		len = snprintf(buf, sizeof(buf), "\033[M%c%c%c",
1250+ 				32+button, 32+x+1, 32+y+1);
1251+@@ -953,53 +970,59 @@ mousereport(XEvent *e)
1252+ }
1253+ 
1254+ void
1255+-bpress(XEvent *e)
1256++wlmousereportbutton(uint32_t button, uint32_t state)
1257+ {
1258+-	struct timespec now;
1259+-	MouseShortcut *ms;
1260++	bool release = state == WL_POINTER_BUTTON_STATE_RELEASED;
1261+ 
1262+-	if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
1263+-		mousereport(e);
1264+-		return;
1265++	if (!IS_SET(MODE_MOUSESGR) && release) {
1266++		button = 3;
1267++	} else {
1268++		switch (button) {
1269++		case BTN_LEFT:
1270++			button = 0;
1271++			break;
1272++		case BTN_MIDDLE:
1273++			button = 1;
1274++			break;
1275++		case BTN_RIGHT:
1276++			button = 2;
1277++			break;
1278++		}
1279+ 	}
1280+ 
1281+-	for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
1282+-		if (e->xbutton.button == ms->b
1283+-				&& match(ms->mask, e->xbutton.state)) {
1284+-			ttysend(ms->s, strlen(ms->s));
1285+-			return;
1286+-		}
1287++	oldbutton = release ? 3 : button;
1288++
1289++	/* don't report release events when in X10 mode */
1290++	if (IS_SET(MODE_MOUSEX10) && release) {
1291++		return;
1292+ 	}
1293+ 
1294+-	if (e->xbutton.button == Button1) {
1295+-		clock_gettime(CLOCK_MONOTONIC, &now);
1296++	wlmousereport(button, release, oldx, oldy);
1297++}
1298+ 
1299+-		/* Clear previous selection, logically and visually. */
1300+-		selclear(NULL);
1301+-		sel.mode = SEL_EMPTY;
1302+-		sel.type = SEL_REGULAR;
1303+-		sel.oe.x = sel.ob.x = x2col(e->xbutton.x);
1304+-		sel.oe.y = sel.ob.y = y2row(e->xbutton.y);
1305++void
1306++wlmousereportmotion(wl_fixed_t fx, wl_fixed_t fy)
1307++{
1308++	int x = x2col(wl_fixed_to_int(fx)), y = y2row(wl_fixed_to_int(fy));
1309+ 
1310+-		/*
1311+-		 * If the user clicks below predefined timeouts specific
1312+-		 * snapping behaviour is exposed.
1313+-		 */
1314+-		if (TIMEDIFF(now, sel.tclick2) <= tripleclicktimeout) {
1315+-			sel.snap = SNAP_LINE;
1316+-		} else if (TIMEDIFF(now, sel.tclick1) <= doubleclicktimeout) {
1317+-			sel.snap = SNAP_WORD;
1318+-		} else {
1319+-			sel.snap = 0;
1320+-		}
1321+-		selnormalize();
1322++	if (x == oldx && y == oldy)
1323++		return;
1324++	if (!IS_SET(MODE_MOUSEMOTION) && !IS_SET(MODE_MOUSEMANY))
1325++		return;
1326++	/* MOUSE_MOTION: no reporting if no button is pressed */
1327++	if (IS_SET(MODE_MOUSEMOTION) && oldbutton == 3)
1328++		return;
1329+ 
1330+-		if (sel.snap != 0)
1331+-			sel.mode = SEL_READY;
1332+-		tsetdirt(sel.nb.y, sel.ne.y);
1333+-		sel.tclick2 = sel.tclick1;
1334+-		sel.tclick1 = now;
1335+-	}
1336++	oldx = x;
1337++	oldy = y;
1338++	wlmousereport(oldbutton + 32, false, x, y);
1339++}
1340++
1341++void
1342++wlmousereportaxis(uint32_t axis, wl_fixed_t amount)
1343++{
1344++	wlmousereport(64 + (axis == AXIS_VERTICAL ? 4 : 6)
1345++		+ (amount > 0 ? 1 : 0), false, oldx, oldy);
1346+ }
1347+ 
1348+ char *
1349+@@ -1057,148 +1080,67 @@ getsel(void)
1350+ }
1351+ 
1352+ void
1353+-selcopy(Time t)
1354+-{
1355+-	xsetsel(getsel(), t);
1356+-}
1357+-
1358+-void
1359+-propnotify(XEvent *e)
1360++selcopy(uint32_t serial)
1361+ {
1362+-	XPropertyEvent *xpev;
1363+-	Atom clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
1364+-
1365+-	xpev = &e->xproperty;
1366+-	if (xpev->state == PropertyNewValue &&
1367+-			(xpev->atom == XA_PRIMARY ||
1368+-			 xpev->atom == clipboard)) {
1369+-		selnotify(e);
1370+-	}
1371++	wlsetsel(getsel(), serial);
1372+ }
1373+ 
1374+-void
1375+-selnotify(XEvent *e)
1376++static inline void
1377++selwritebuf(char *buf, int len)
1378+ {
1379+-	ulong nitems, ofs, rem;
1380+-	int format;
1381+-	uchar *data, *last, *repl;
1382+-	Atom type, incratom, property;
1383+-
1384+-	incratom = XInternAtom(xw.dpy, "INCR", 0);
1385+-
1386+-	ofs = 0;
1387+-	if (e->type == SelectionNotify) {
1388+-		property = e->xselection.property;
1389+-	} else if(e->type == PropertyNotify) {
1390+-		property = e->xproperty.atom;
1391+-	} else {
1392+-		return;
1393+-	}
1394+-	if (property == None)
1395+-		return;
1396+-
1397+-	do {
1398+-		if (XGetWindowProperty(xw.dpy, xw.win, property, ofs,
1399+-					BUFSIZ/4, False, AnyPropertyType,
1400+-					&type, &format, &nitems, &rem,
1401+-					&data)) {
1402+-			fprintf(stderr, "Clipboard allocation failed\n");
1403+-			return;
1404+-		}
1405+-
1406+-		if (e->type == PropertyNotify && nitems == 0 && rem == 0) {
1407+-			/*
1408+-			 * If there is some PropertyNotify with no data, then
1409+-			 * this is the signal of the selection owner that all
1410+-			 * data has been transferred. We won't need to receive
1411+-			 * PropertyNotify events anymore.
1412+-			 */
1413+-			MODBIT(xw.attrs.event_mask, 0, PropertyChangeMask);
1414+-			XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask,
1415+-					&xw.attrs);
1416+-		}
1417+-
1418+-		if (type == incratom) {
1419+-			/*
1420+-			 * Activate the PropertyNotify events so we receive
1421+-			 * when the selection owner does send us the next
1422+-			 * chunk of data.
1423+-			 */
1424+-			MODBIT(xw.attrs.event_mask, 1, PropertyChangeMask);
1425+-			XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask,
1426+-					&xw.attrs);
1427+-
1428+-			/*
1429+-			 * Deleting the property is the transfer start signal.
1430+-			 */
1431+-			XDeleteProperty(xw.dpy, xw.win, (int)property);
1432+-			continue;
1433+-		}
1434+-
1435+-		/*
1436+-		 * As seen in getsel:
1437+-		 * Line endings are inconsistent in the terminal and GUI world
1438+-		 * copy and pasting. When receiving some selection data,
1439+-		 * replace all '\n' with '\r'.
1440+-		 * FIXME: Fix the computer world.
1441+-		 */
1442+-		repl = data;
1443+-		last = data + nitems * format / 8;
1444+-		while ((repl = memchr(repl, '\n', last - repl))) {
1445+-			*repl++ = '\r';
1446+-		}
1447+-
1448+-		if (IS_SET(MODE_BRCKTPASTE) && ofs == 0)
1449+-			ttywrite("\033[200~", 6);
1450+-		ttysend((char *)data, nitems * format / 8);
1451+-		if (IS_SET(MODE_BRCKTPASTE) && rem == 0)
1452+-			ttywrite("\033[201~", 6);
1453+-		XFree(data);
1454+-		/* number of 32-bit chunks returned */
1455+-		ofs += nitems * format / 32;
1456+-	} while (rem > 0);
1457++	char *repl = buf;
1458+ 
1459+ 	/*
1460+-	 * Deleting the property again tells the selection owner to send the
1461+-	 * next data chunk in the property.
1462++	 * As seen in getsel:
1463++	 * Line endings are inconsistent in the terminal and GUI world
1464++	 * copy and pasting. When receiving some selection data,
1465++	 * replace all '\n' with '\r'.
1466++	 * FIXME: Fix the computer world.
1467+ 	 */
1468+-	XDeleteProperty(xw.dpy, xw.win, (int)property);
1469+-}
1470++	while ((repl = memchr(repl, '\n', len))) {
1471++		*repl++ = '\r';
1472++	}
1473+ 
1474+-void
1475+-selpaste(const Arg *dummy)
1476+-{
1477+-	XConvertSelection(xw.dpy, XA_PRIMARY, sel.xtarget, XA_PRIMARY,
1478+-			xw.win, CurrentTime);
1479++	ttysend(buf, len);
1480+ }
1481+ 
1482+ void
1483+-clipcopy(const Arg *dummy)
1484++selpaste(const Arg *dummy)
1485+ {
1486+-	Atom clipboard;
1487++	int fds[2], len, left;
1488++	char buf[BUFSIZ], *str;
1489+ 
1490+-	if (sel.clipboard != NULL)
1491+-		free(sel.clipboard);
1492+-
1493+-	if (sel.primary != NULL) {
1494+-		sel.clipboard = xstrdup(sel.primary);
1495+-		clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
1496+-		XSetSelectionOwner(xw.dpy, clipboard, xw.win, CurrentTime);
1497++	if (wl.seloffer) {
1498++		if (IS_SET(MODE_BRCKTPASTE))
1499++			ttywrite("\033[200~", 6);
1500++		/* check if we are pasting from ourselves */
1501++		if (sel.source) {
1502++			str = sel.primary;
1503++			left = strlen(sel.primary);
1504++			while (left > 0) {
1505++				len = MIN(sizeof buf, left);
1506++				memcpy(buf, str, len);
1507++				selwritebuf(buf, len);
1508++				left -= len;
1509++				str += len;
1510++			}
1511++		} else {
1512++			pipe(fds);
1513++			wl_data_offer_receive(wl.seloffer, "text/plain", fds[1]);
1514++			close(fds[1]);
1515++			wl_display_flush(wl.dpy);
1516++			while ((len = read(fds[0], buf, sizeof buf)) > 0) {
1517++				selwritebuf(buf, len);
1518++			}
1519++			close(fds[0]);
1520++		}
1521++		if (IS_SET(MODE_BRCKTPASTE))
1522++			ttywrite("\033[201~", 6);
1523+ 	}
1524+ }
1525+ 
1526+ void
1527+-clippaste(const Arg *dummy)
1528+-{
1529+-	Atom clipboard;
1530+-
1531+-	clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
1532+-	XConvertSelection(xw.dpy, clipboard, sel.xtarget, clipboard,
1533+-			xw.win, CurrentTime);
1534+-}
1535+-
1536+-void
1537+-selclear(XEvent *e)
1538++selclear(void)
1539+ {
1540+ 	if (sel.ob.x == -1)
1541+ 		return;
1542+@@ -1208,117 +1150,19 @@ selclear(XEvent *e)
1543+ }
1544+ 
1545+ void
1546+-selrequest(XEvent *e)
1547+-{
1548+-	XSelectionRequestEvent *xsre;
1549+-	XSelectionEvent xev;
1550+-	Atom xa_targets, string, clipboard;
1551+-	char *seltext;
1552+-
1553+-	xsre = (XSelectionRequestEvent *) e;
1554+-	xev.type = SelectionNotify;
1555+-	xev.requestor = xsre->requestor;
1556+-	xev.selection = xsre->selection;
1557+-	xev.target = xsre->target;
1558+-	xev.time = xsre->time;
1559+-	if (xsre->property == None)
1560+-		xsre->property = xsre->target;
1561+-
1562+-	/* reject */
1563+-	xev.property = None;
1564+-
1565+-	xa_targets = XInternAtom(xw.dpy, "TARGETS", 0);
1566+-	if (xsre->target == xa_targets) {
1567+-		/* respond with the supported type */
1568+-		string = sel.xtarget;
1569+-		XChangeProperty(xsre->display, xsre->requestor, xsre->property,
1570+-				XA_ATOM, 32, PropModeReplace,
1571+-				(uchar *) &string, 1);
1572+-		xev.property = xsre->property;
1573+-	} else if (xsre->target == sel.xtarget || xsre->target == XA_STRING) {
1574+-		/*
1575+-		 * xith XA_STRING non ascii characters may be incorrect in the
1576+-		 * requestor. It is not our problem, use utf8.
1577+-		 */
1578+-		clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
1579+-		if (xsre->selection == XA_PRIMARY) {
1580+-			seltext = sel.primary;
1581+-		} else if (xsre->selection == clipboard) {
1582+-			seltext = sel.clipboard;
1583+-		} else {
1584+-			fprintf(stderr,
1585+-				"Unhandled clipboard selection 0x%lx\n",
1586+-				xsre->selection);
1587+-			return;
1588+-		}
1589+-		if (seltext != NULL) {
1590+-			XChangeProperty(xsre->display, xsre->requestor,
1591+-					xsre->property, xsre->target,
1592+-					8, PropModeReplace,
1593+-					(uchar *)seltext, strlen(seltext));
1594+-			xev.property = xsre->property;
1595+-		}
1596+-	}
1597+-
1598+-	/* all done, send a notification to the listener */
1599+-	if (!XSendEvent(xsre->display, xsre->requestor, 1, 0, (XEvent *) &xev))
1600+-		fprintf(stderr, "Error sending SelectionNotify event\n");
1601+-}
1602+-
1603+-void
1604+-xsetsel(char *str, Time t)
1605++wlsetsel(char *str, uint32_t serial)
1606+ {
1607+ 	free(sel.primary);
1608+ 	sel.primary = str;
1609+ 
1610+-	XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
1611+-	if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
1612+-		selclear(0);
1613+-}
1614+-
1615+-void
1616+-brelease(XEvent *e)
1617+-{
1618+-	if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
1619+-		mousereport(e);
1620+-		return;
1621+-	}
1622+-
1623+-	if (e->xbutton.button == Button2) {
1624+-		selpaste(NULL);
1625+-	} else if (e->xbutton.button == Button1) {
1626+-		if (sel.mode == SEL_READY) {
1627+-			getbuttoninfo(e);
1628+-			selcopy(e->xbutton.time);
1629+-		} else
1630+-			selclear(NULL);
1631+-		sel.mode = SEL_IDLE;
1632+-		tsetdirt(sel.nb.y, sel.ne.y);
1633+-	}
1634+-}
1635+-
1636+-void
1637+-bmotion(XEvent *e)
1638+-{
1639+-	int oldey, oldex, oldsby, oldsey;
1640+-
1641+-	if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
1642+-		mousereport(e);
1643+-		return;
1644++	if (str) {
1645++		sel.source = wl_data_device_manager_create_data_source(wl.datadevmanager);
1646++		wl_data_source_add_listener(sel.source, &datasrclistener, NULL);
1647++		wl_data_source_offer(sel.source, "text/plain;charset=utf-8");
1648++	} else {
1649++		sel.source = NULL;
1650+ 	}
1651+-
1652+-	if (!sel.mode)
1653+-		return;
1654+-
1655+-	sel.mode = SEL_READY;
1656+-	oldey = sel.oe.y;
1657+-	oldex = sel.oe.x;
1658+-	oldsby = sel.nb.y;
1659+-	oldsey = sel.ne.y;
1660+-	getbuttoninfo(e);
1661+-
1662+-	if (oldey != sel.oe.y || oldex != sel.oe.x)
1663+-		tsetdirt(MIN(sel.nb.y, oldsby), MAX(sel.ne.y, oldsey));
1664++	wl_data_device_set_selection(wl.datadev, sel.source, serial);
1665+ }
1666+ 
1667+ void
1668+@@ -1337,7 +1181,6 @@ execsh(void)
1669+ {
1670+ 	char **args, *sh, *prog;
1671+ 	const struct passwd *pw;
1672+-	char buf[sizeof(long) * 8 + 1];
1673+ 
1674+ 	errno = 0;
1675+ 	if ((pw = getpwuid(getuid())) == NULL) {
1676+@@ -1358,8 +1201,6 @@ execsh(void)
1677+ 		prog = sh;
1678+ 	args = (opt_cmd) ? opt_cmd : (char *[]) {prog, NULL};
1679+ 
1680+-	snprintf(buf, sizeof(buf), "%lu", xw.win);
1681+-
1682+ 	unsetenv("COLUMNS");
1683+ 	unsetenv("LINES");
1684+ 	unsetenv("TERMCAP");
1685+@@ -1368,7 +1209,6 @@ execsh(void)
1686+ 	setenv("SHELL", sh, 1);
1687+ 	setenv("HOME", pw->pw_dir, 1);
1688+ 	setenv("TERM", termname, 1);
1689+-	setenv("WINDOWID", buf, 1);
1690+ 
1691+ 	signal(SIGCHLD, SIG_DFL);
1692+ 	signal(SIGHUP, SIG_DFL);
1693+@@ -1513,6 +1353,7 @@ ttyread(void)
1694+ 	if (buflen > 0)
1695+ 		memmove(buf, ptr, buflen);
1696+ 
1697++	needdraw = true;
1698+ 	return ret;
1699+ }
1700+ 
1701+@@ -1606,8 +1447,8 @@ ttyresize(void)
1702+ 
1703+ 	w.ws_row = term.row;
1704+ 	w.ws_col = term.col;
1705+-	w.ws_xpixel = xw.tw;
1706+-	w.ws_ypixel = xw.th;
1707++	w.ws_xpixel = wl.tw;
1708++	w.ws_ypixel = wl.th;
1709+ 	if (ioctl(cmdfd, TIOCSWINSZ, &w) < 0)
1710+ 		fprintf(stderr, "Couldn't set window size: %s\n", strerror(errno));
1711+ }
1712+@@ -1637,6 +1478,8 @@ tsetdirt(int top, int bot)
1713+ 
1714+ 	for (i = top; i <= bot; i++)
1715+ 		term.dirty[i] = 1;
1716++
1717++	needdraw = true;
1718+ }
1719+ 
1720+ void
1721+@@ -1771,7 +1614,7 @@ selscroll(int orig, int n)
1722+ 
1723+ 	if (BETWEEN(sel.ob.y, orig, term.bot) || BETWEEN(sel.oe.y, orig, term.bot)) {
1724+ 		if ((sel.ob.y += n) > term.bot || (sel.oe.y += n) < term.top) {
1725+-			selclear(NULL);
1726++			selclear();
1727+ 			return;
1728+ 		}
1729+ 		if (sel.type == SEL_RECTANGULAR) {
1730+@@ -1917,7 +1760,7 @@ tclearregion(int x1, int y1, int x2, int y2)
1731+ 		for (x = x1; x <= x2; x++) {
1732+ 			gp = &term.line[y][x];
1733+ 			if (selected(x, y))
1734+-				selclear(NULL);
1735++				selclear();
1736+ 			gp->fg = term.c.attr.fg;
1737+ 			gp->bg = term.c.attr.bg;
1738+ 			gp->mode = 0;
1739+@@ -2180,22 +2023,18 @@ tsetmode(int priv, int set, int *args, int narg)
1740+ 				MODBIT(term.mode, !set, MODE_HIDE);
1741+ 				break;
1742+ 			case 9:    /* X10 mouse compatibility mode */
1743+-				xsetpointermotion(0);
1744+ 				MODBIT(term.mode, 0, MODE_MOUSE);
1745+ 				MODBIT(term.mode, set, MODE_MOUSEX10);
1746+ 				break;
1747+ 			case 1000: /* 1000: report button press */
1748+-				xsetpointermotion(0);
1749+ 				MODBIT(term.mode, 0, MODE_MOUSE);
1750+ 				MODBIT(term.mode, set, MODE_MOUSEBTN);
1751+ 				break;
1752+ 			case 1002: /* 1002: report motion on button press */
1753+-				xsetpointermotion(0);
1754+ 				MODBIT(term.mode, 0, MODE_MOUSE);
1755+ 				MODBIT(term.mode, set, MODE_MOUSEMOTION);
1756+ 				break;
1757+ 			case 1003: /* 1003: enable all mouse motions */
1758+-				xsetpointermotion(set);
1759+ 				MODBIT(term.mode, 0, MODE_MOUSE);
1760+ 				MODBIT(term.mode, set, MODE_MOUSEMANY);
1761+ 				break;
1762+@@ -2368,7 +2207,7 @@ csihandle(void)
1763+ 		tputtab(csiescseq.arg[0]);
1764+ 		break;
1765+ 	case 'J': /* ED -- Clear screen */
1766+-		selclear(NULL);
1767++		selclear();
1768+ 		switch (csiescseq.arg[0]) {
1769+ 		case 0: /* below */
1770+ 			tclearregion(term.c.x, term.c.y, term.col-1, term.c.y);
1771+@@ -2475,7 +2314,7 @@ csihandle(void)
1772+ 			if (!BETWEEN(csiescseq.arg[0], 0, 6)) {
1773+ 				goto unknown;
1774+ 			}
1775+-			xw.cursor = csiescseq.arg[0];
1776++			wl.cursor = csiescseq.arg[0];
1777+ 			break;
1778+ 		default:
1779+ 			goto unknown;
1780+@@ -2531,7 +2370,7 @@ strhandle(void)
1781+ 		case 1:
1782+ 		case 2:
1783+ 			if (narg > 1)
1784+-				xsettitle(strescseq.args[1]);
1785++				wlsettitle(strescseq.args[1]);
1786+ 			return;
1787+ 		case 4: /* color set */
1788+ 			if (narg < 3)
1789+@@ -2540,7 +2379,7 @@ strhandle(void)
1790+ 			/* FALLTHROUGH */
1791+ 		case 104: /* color reset, here p = NULL */
1792+ 			j = (narg > 1) ? atoi(strescseq.args[1]) : -1;
1793+-			if (xsetcolorname(j, p)) {
1794++			if (wlsetcolorname(j, p)) {
1795+ 				fprintf(stderr, "erresc: invalid color %s\n", p);
1796+ 			} else {
1797+ 				/*
1798+@@ -2553,7 +2392,7 @@ strhandle(void)
1799+ 		}
1800+ 		break;
1801+ 	case 'k': /* old title set compatibility */
1802+-		xsettitle(strescseq.args[0]);
1803++		wlsettitle(strescseq.args[0]);
1804+ 		return;
1805+ 	case 'P': /* DCS -- Device Control String */
1806+ 		term.mode |= ESC_DCS;
1807+@@ -2642,13 +2481,11 @@ tprinter(char *s, size_t len)
1808+ void
1809+ iso14755(const Arg *arg)
1810+ {
1811+-	char cmd[sizeof(ISO14755CMD) + NUMMAXLEN(xw.win)];
1812+ 	FILE *p;
1813+ 	char *us, *e, codepoint[9], uc[UTF_SIZ];
1814+ 	unsigned long utf32;
1815+ 
1816+-	snprintf(cmd, sizeof(cmd), ISO14755CMD, xw.win);
1817+-	if (!(p = popen(cmd, "r")))
1818++	if (!(p = popen(ISO14755CMD, "r")))
1819+ 		return;
1820+ 
1821+ 	us = fgets(codepoint, sizeof(codepoint), p);
1822+@@ -2747,6 +2584,7 @@ techo(Rune u)
1823+ 		}
1824+ 	}
1825+ 	tputc(u);
1826++	needdraw = true;
1827+ }
1828+ 
1829+ void
1830+@@ -2833,10 +2671,12 @@ tcontrolcode(uchar ascii)
1831+ 			/* backwards compatibility to xterm */
1832+ 			strhandle();
1833+ 		} else {
1834+-			if (!(xw.state & WIN_FOCUSED))
1835+-				xseturgency(1);
1836+-			if (bellvolume)
1837+-				XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL);
1838++			if (!(wl.state & WIN_FOCUSED))
1839++				wlseturgency(1);
1840++			/* XXX: No bell on wayland
1841++			 * if (bellvolume)
1842++			 *     XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL);
1843++			 */
1844+ 		}
1845+ 		break;
1846+ 	case '\033': /* ESC */
1847+@@ -2968,8 +2808,8 @@ eschandle(uchar ascii)
1848+ 		break;
1849+ 	case 'c': /* RIS -- Reset to inital state */
1850+ 		treset();
1851+-		xresettitle();
1852+-		xloadcols();
1853++		wlresettitle();
1854++		wlloadcols();
1855+ 		break;
1856+ 	case '=': /* DECPAM -- Application keypad */
1857+ 		term.mode |= MODE_APPKEYPAD;
1858+@@ -3026,7 +2866,7 @@ tputc(Rune u)
1859+ 	 */
1860+ 	if (term.esc & ESC_STR) {
1861+ 		if (u == '\a' || u == 030 || u == 032 || u == 033 ||
1862+-		   ISCONTROLC1(u)) {
1863++		    ISCONTROLC1(u)) {
1864+ 			term.esc &= ~(ESC_START|ESC_STR|ESC_DCS);
1865+ 			if (IS_SET(MODE_SIXEL)) {
1866+ 				/* TODO: render sixel */;
1867+@@ -3109,7 +2949,7 @@ check_control_code:
1868+ 		return;
1869+ 	}
1870+ 	if (sel.ob.x != -1 && BETWEEN(term.c.y, sel.ob.y, sel.oe.y))
1871+-		selclear(NULL);
1872++		selclear();
1873+ 
1874+ 	gp = &term.line[term.c.y][term.c.x];
1875+ 	if (IS_SET(MODE_WRAP) && (term.c.state & CURSOR_WRAPNEXT)) {
1876+@@ -3176,9 +3016,6 @@ tresize(int col, int row)
1877+ 		free(term.alt[i]);
1878+ 	}
1879+ 
1880+-	/* resize to new width */
1881+-	term.specbuf = xrealloc(term.specbuf, col * sizeof(XftGlyphFontSpec));
1882+-
1883+ 	/* resize to new height */
1884+ 	term.line = xrealloc(term.line, row * sizeof(Line));
1885+ 	term.alt  = xrealloc(term.alt,  row * sizeof(Line));
1886+@@ -3228,155 +3065,107 @@ tresize(int col, int row)
1887+ }
1888+ 
1889+ void
1890+-xresize(int col, int row)
1891++wlresize(int col, int row)
1892+ {
1893+-	xw.tw = MAX(1, col * xw.cw);
1894+-	xw.th = MAX(1, row * xw.ch);
1895++	union wld_object object;
1896++
1897++	wl.tw = MAX(1, col * wl.cw);
1898++	wl.th = MAX(1, row * wl.ch);
1899+ 
1900+-	XFreePixmap(xw.dpy, xw.buf);
1901+-	xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
1902+-			DefaultDepth(xw.dpy, xw.scr));
1903+-	XftDrawChange(xw.draw, xw.buf);
1904+-	xclear(0, 0, xw.w, xw.h);
1905++	wld.oldbuffer = wld.buffer;
1906++	wld.buffer = wld_create_buffer(wld.ctx, wl.w, wl.h,
1907++			WLD_FORMAT_XRGB8888, 0);
1908++	wld_export(wld.buffer, WLD_WAYLAND_OBJECT_BUFFER, &object);
1909++	wl.buffer = object.ptr;
1910+ }
1911+ 
1912+-ushort
1913+-sixd_to_16bit(int x)
1914++uchar
1915++sixd_to_8bit(int x)
1916+ {
1917+-	return x == 0 ? 0 : 0x3737 + 0x2828 * x;
1918++	return x == 0 ? 0 : 0x37 + 0x28 * x;
1919+ }
1920+ 
1921+ int
1922+-xloadcolor(int i, const char *name, Color *ncolor)
1923++wlloadcolor(int i, const char *name, uint32_t *color)
1924+ {
1925+-	XRenderColor color = { .alpha = 0xffff };
1926+-
1927+ 	if (!name) {
1928+ 		if (BETWEEN(i, 16, 255)) { /* 256 color */
1929+ 			if (i < 6*6*6+16) { /* same colors as xterm */
1930+-				color.red   = sixd_to_16bit( ((i-16)/36)%6 );
1931+-				color.green = sixd_to_16bit( ((i-16)/6) %6 );
1932+-				color.blue  = sixd_to_16bit( ((i-16)/1) %6 );
1933++				*color = 0xff << 24 | sixd_to_8bit(((i-16)/36)%6) << 16
1934++					| sixd_to_8bit(((i-16)/6)%6) << 8
1935++					| sixd_to_8bit(((i-16)/1)%6);
1936+ 			} else { /* greyscale */
1937+-				color.red = 0x0808 + 0x0a0a * (i - (6*6*6+16));
1938+-				color.green = color.blue = color.red;
1939++				*color = 0xff << 24 | (0x8 + 0xa * (i-(6*6*6+16))) * 0x10101;
1940+ 			}
1941+-			return XftColorAllocValue(xw.dpy, xw.vis,
1942+-			                          xw.cmap, &color, ncolor);
1943++			return true;
1944+ 		} else
1945+ 			name = colorname[i];
1946+ 	}
1947+ 
1948+-	return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor);
1949++	return wld_lookup_named_color(name, color);
1950+ }
1951+ 
1952+ void
1953+-xloadcols(void)
1954++wlloadcols(void)
1955+ {
1956+ 	int i;
1957+-	static int loaded;
1958+-	Color *cp;
1959+-
1960+-	if (loaded) {
1961+-		for (cp = dc.col; cp < &dc.col[LEN(dc.col)]; ++cp)
1962+-			XftColorFree(xw.dpy, xw.vis, xw.cmap, cp);
1963+-	}
1964+ 
1965+ 	for (i = 0; i < LEN(dc.col); i++)
1966+-		if (!xloadcolor(i, NULL, &dc.col[i])) {
1967++		if (!wlloadcolor(i, NULL, &dc.col[i])) {
1968+ 			if (colorname[i])
1969+ 				die("Could not allocate color '%s'\n", colorname[i]);
1970+ 			else
1971+ 				die("Could not allocate color %d\n", i);
1972+ 		}
1973+-	loaded = 1;
1974+ }
1975+ 
1976+ int
1977+-xsetcolorname(int x, const char *name)
1978++wlsetcolorname(int x, const char *name)
1979+ {
1980+-	Color ncolor;
1981++	uint32_t color;
1982+ 
1983+ 	if (!BETWEEN(x, 0, LEN(dc.col)))
1984+ 		return 1;
1985+ 
1986+-
1987+-	if (!xloadcolor(x, name, &ncolor))
1988++	if (!wlloadcolor(x, name, &color))
1989+ 		return 1;
1990+ 
1991+-	XftColorFree(xw.dpy, xw.vis, xw.cmap, &dc.col[x]);
1992+-	dc.col[x] = ncolor;
1993++	dc.col[x] = color;
1994+ 
1995+ 	return 0;
1996+ }
1997+ 
1998+-/*
1999+- * Absolute coordinates.
2000+- */
2001+-void
2002+-xclear(int x1, int y1, int x2, int y2)
2003++static void wlloadcursor(void)
2004+ {
2005+-	XftDrawRect(xw.draw,
2006+-			&dc.col[IS_SET(MODE_REVERSE)? defaultfg : defaultbg],
2007+-			x1, y1, x2-x1, y2-y1);
2008+-}
2009++	char *names[] = { mouseshape, "xterm", "ibeam", "text" };
2010++	int i;
2011+ 
2012+-void
2013+-xhints(void)
2014+-{
2015+-	XClassHint class = {opt_name ? opt_name : termname,
2016+-	                    opt_class ? opt_class : termname};
2017+-	XWMHints wm = {.flags = InputHint, .input = 1};
2018+-	XSizeHints *sizeh = NULL;
2019+-
2020+-	sizeh = XAllocSizeHints();
2021+-
2022+-	sizeh->flags = PSize | PResizeInc | PBaseSize;
2023+-	sizeh->height = xw.h;
2024+-	sizeh->width = xw.w;
2025+-	sizeh->height_inc = xw.ch;
2026+-	sizeh->width_inc = xw.cw;
2027+-	sizeh->base_height = 2 * borderpx;
2028+-	sizeh->base_width = 2 * borderpx;
2029+-	if (xw.isfixed) {
2030+-		sizeh->flags |= PMaxSize | PMinSize;
2031+-		sizeh->min_width = sizeh->max_width = xw.w;
2032+-		sizeh->min_height = sizeh->max_height = xw.h;
2033+-	}
2034+-	if (xw.gm & (XValue|YValue)) {
2035+-		sizeh->flags |= USPosition | PWinGravity;
2036+-		sizeh->x = xw.l;
2037+-		sizeh->y = xw.t;
2038+-		sizeh->win_gravity = xgeommasktogravity(xw.gm);
2039+-	}
2040++	cursor.theme = wl_cursor_theme_load(NULL, 32, wl.shm);
2041++
2042++	for (i = 0; !cursor.cursor && i < LEN(names); i++)
2043++		cursor.cursor = wl_cursor_theme_get_cursor(cursor.theme, names[i]);
2044+ 
2045+-	XSetWMProperties(xw.dpy, xw.win, NULL, NULL, NULL, 0, sizeh, &wm,
2046+-			&class);
2047+-	XFree(sizeh);
2048++	cursor.surface = wl_compositor_create_surface(wl.cmp);
2049+ }
2050+ 
2051+-int
2052+-xgeommasktogravity(int mask)
2053++/*
2054++ * Absolute coordinates.
2055++ */
2056++void
2057++wlclear(int x1, int y1, int x2, int y2)
2058+ {
2059+-	switch (mask & (XNegative|YNegative)) {
2060+-	case 0:
2061+-		return NorthWestGravity;
2062+-	case XNegative:
2063+-		return NorthEastGravity;
2064+-	case YNegative:
2065+-		return SouthWestGravity;
2066+-	}
2067++	uint32_t color = dc.col[IS_SET(MODE_REVERSE) ? defaultfg : defaultbg];
2068+ 
2069+-	return SouthEastGravity;
2070++	wld_fill_rectangle(wld.renderer, color, x1, y1, x2 - x1, y2 - y1);
2071+ }
2072+ 
2073+ int
2074+-xloadfont(Font *f, FcPattern *pattern)
2075++wlloadfont(Font *f, FcPattern *pattern)
2076+ {
2077+ 	FcPattern *configured;
2078+ 	FcPattern *match;
2079+ 	FcResult result;
2080+-	XGlyphInfo extents;
2081++	struct wld_extents extents;
2082+ 	int wantattr, haveattr;
2083+ 
2084+ 	/*
2085+@@ -3389,7 +3178,7 @@ xloadfont(Font *f, FcPattern *pattern)
2086+ 		return 1;
2087+ 
2088+ 	FcConfigSubstitute(NULL, configured, FcMatchPattern);
2089+-	XftDefaultSubstitute(xw.dpy, xw.scr, configured);
2090++	FcDefaultSubstitute(configured);
2091+ 
2092+ 	match = FcFontMatch(NULL, configured, &result);
2093+ 	if (!match) {
2094+@@ -3397,37 +3186,36 @@ xloadfont(Font *f, FcPattern *pattern)
2095+ 		return 1;
2096+ 	}
2097+ 
2098+-	if (!(f->match = XftFontOpenPattern(xw.dpy, match))) {
2099++	if (!(f->match = wld_font_open_pattern(wld.fontctx, match))) {
2100+ 		FcPatternDestroy(configured);
2101+ 		FcPatternDestroy(match);
2102+ 		return 1;
2103+ 	}
2104+ 
2105+-	if ((XftPatternGetInteger(pattern, "slant", 0, &wantattr) ==
2106+-	    XftResultMatch)) {
2107++	if ((FcPatternGetInteger(pattern, "slant", 0, &wantattr) ==
2108++	    FcResultMatch)) {
2109+ 		/*
2110+ 		 * Check if xft was unable to find a font with the appropriate
2111+ 		 * slant but gave us one anyway. Try to mitigate.
2112+ 		 */
2113+-		if ((XftPatternGetInteger(f->match->pattern, "slant", 0,
2114+-		    &haveattr) != XftResultMatch) || haveattr < wantattr) {
2115++		if ((FcPatternGetInteger(match, "slant", 0,
2116++		    &haveattr) != FcResultMatch) || haveattr < wantattr) {
2117+ 			f->badslant = 1;
2118+ 			fputs("st: font slant does not match\n", stderr);
2119+ 		}
2120+ 	}
2121+ 
2122+-	if ((XftPatternGetInteger(pattern, "weight", 0, &wantattr) ==
2123+-	    XftResultMatch)) {
2124+-		if ((XftPatternGetInteger(f->match->pattern, "weight", 0,
2125+-		    &haveattr) != XftResultMatch) || haveattr != wantattr) {
2126++	if ((FcPatternGetInteger(pattern, "weight", 0, &wantattr) ==
2127++	    FcResultMatch)) {
2128++		if ((FcPatternGetInteger(match, "weight", 0,
2129++		    &haveattr) != FcResultMatch) || haveattr != wantattr) {
2130+ 			f->badweight = 1;
2131+ 			fputs("st: font weight does not match\n", stderr);
2132+ 		}
2133+ 	}
2134+ 
2135+-	XftTextExtentsUtf8(xw.dpy, f->match,
2136+-		(const FcChar8 *) ascii_printable,
2137+-		strlen(ascii_printable), &extents);
2138++
2139++	wld_font_text_extents(f->match, ascii_printable, &extents);
2140+ 
2141+ 	f->set = NULL;
2142+ 	f->pattern = configured;
2143+@@ -3435,23 +3223,24 @@ xloadfont(Font *f, FcPattern *pattern)
2144+ 	f->ascent = f->match->ascent;
2145+ 	f->descent = f->match->descent;
2146+ 	f->lbearing = 0;
2147+-	f->rbearing = f->match->max_advance_width;
2148++	f->rbearing = f->match->max_advance;
2149+ 
2150+ 	f->height = f->ascent + f->descent;
2151+-	f->width = DIVCEIL(extents.xOff, strlen(ascii_printable));
2152++	f->width = DIVCEIL(extents.advance, strlen(ascii_printable));
2153+ 
2154+ 	return 0;
2155+ }
2156+ 
2157+ void
2158+-xloadfonts(char *fontstr, double fontsize)
2159++wlloadfonts(char *fontstr, double fontsize)
2160+ {
2161+ 	FcPattern *pattern;
2162+ 	double fontval;
2163+ 	float ceilf(float);
2164+ 
2165+ 	if (fontstr[0] == '-') {
2166+-		pattern = XftXlfdParse(fontstr, False, False);
2167++		/* XXX: need XftXlfdParse equivalent */
2168++		pattern = NULL;
2169+ 	} else {
2170+ 		pattern = FcNameParse((FcChar8 *)fontstr);
2171+ 	}
2172+@@ -3482,11 +3271,14 @@ xloadfonts(char *fontstr, double fontsize)
2173+ 		defaultfontsize = usedfontsize;
2174+ 	}
2175+ 
2176+-	if (xloadfont(&dc.font, pattern))
2177++	FcConfigSubstitute(0, pattern, FcMatchPattern);
2178++	FcDefaultSubstitute(pattern);
2179++
2180++	if (wlloadfont(&dc.font, pattern))
2181+ 		die("st: can't open font %s\n", fontstr);
2182+ 
2183+ 	if (usedfontsize < 0) {
2184+-		FcPatternGetDouble(dc.font.match->pattern,
2185++		FcPatternGetDouble(dc.font.pattern,
2186+ 		                   FC_PIXEL_SIZE, 0, &fontval);
2187+ 		usedfontsize = fontval;
2188+ 		if (fontsize == 0)
2189+@@ -3494,282 +3286,339 @@ xloadfonts(char *fontstr, double fontsize)
2190+ 	}
2191+ 
2192+ 	/* Setting character width and height. */
2193+-	xw.cw = ceilf(dc.font.width * cwscale);
2194+-	xw.ch = ceilf(dc.font.height * chscale);
2195++	wl.cw = ceilf(dc.font.width * cwscale);
2196++	wl.ch = ceilf(dc.font.height * chscale);
2197+ 
2198+ 	FcPatternDel(pattern, FC_SLANT);
2199+ 	FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
2200+-	if (xloadfont(&dc.ifont, pattern))
2201++	if (wlloadfont(&dc.ifont, pattern))
2202+ 		die("st: can't open font %s\n", fontstr);
2203+ 
2204+ 	FcPatternDel(pattern, FC_WEIGHT);
2205+ 	FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
2206+-	if (xloadfont(&dc.ibfont, pattern))
2207++	if (wlloadfont(&dc.ibfont, pattern))
2208+ 		die("st: can't open font %s\n", fontstr);
2209+ 
2210+ 	FcPatternDel(pattern, FC_SLANT);
2211+ 	FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN);
2212+-	if (xloadfont(&dc.bfont, pattern))
2213++	if (wlloadfont(&dc.bfont, pattern))
2214+ 		die("st: can't open font %s\n", fontstr);
2215+ 
2216+ 	FcPatternDestroy(pattern);
2217+ }
2218+ 
2219+ void
2220+-xunloadfont(Font *f)
2221++wlunloadfont(Font *f)
2222+ {
2223+-	XftFontClose(xw.dpy, f->match);
2224++	wld_font_close(f->match);
2225+ 	FcPatternDestroy(f->pattern);
2226+ 	if (f->set)
2227+ 		FcFontSetDestroy(f->set);
2228+ }
2229+ 
2230+ void
2231+-xunloadfonts(void)
2232++wlunloadfonts(void)
2233+ {
2234+ 	/* Free the loaded fonts in the font cache.  */
2235+ 	while (frclen > 0)
2236+-		XftFontClose(xw.dpy, frc[--frclen].font);
2237++		wld_font_close(frc[--frclen].font);
2238+ 
2239+-	xunloadfont(&dc.font);
2240+-	xunloadfont(&dc.bfont);
2241+-	xunloadfont(&dc.ifont);
2242+-	xunloadfont(&dc.ibfont);
2243++	wlunloadfont(&dc.font);
2244++	wlunloadfont(&dc.bfont);
2245++	wlunloadfont(&dc.ifont);
2246++	wlunloadfont(&dc.ibfont);
2247+ }
2248+ 
2249+ void
2250+-xzoom(const Arg *arg)
2251++wlzoom(const Arg *arg)
2252+ {
2253+ 	Arg larg;
2254+ 
2255+ 	larg.f = usedfontsize + arg->f;
2256+-	xzoomabs(&larg);
2257++	wlzoomabs(&larg);
2258+ }
2259+ 
2260+ void
2261+-xzoomabs(const Arg *arg)
2262++wlzoomabs(const Arg *arg)
2263+ {
2264+-	xunloadfonts();
2265+-	xloadfonts(usedfont, arg->f);
2266++	wlunloadfonts();
2267++	wlloadfonts(usedfont, arg->f);
2268+ 	cresize(0, 0);
2269+ 	ttyresize();
2270+ 	redraw();
2271+-	xhints();
2272++	/* XXX: Should the window size be updated here because wayland doesn't
2273++	 * have a notion of hints?
2274++	 * xhints();
2275++	 */
2276+ }
2277+ 
2278+ void
2279+-xzoomreset(const Arg *arg)
2280++wlzoomreset(const Arg *arg)
2281+ {
2282+ 	Arg larg;
2283+ 
2284+ 	if (defaultfontsize > 0) {
2285+ 		larg.f = defaultfontsize;
2286+-		xzoomabs(&larg);
2287++		wlzoomabs(&larg);
2288+ 	}
2289+ }
2290+ 
2291+ void
2292+-xinit(void)
2293++wlinit(void)
2294+ {
2295+-	XGCValues gcvalues;
2296+-	Cursor cursor;
2297+-	Window parent;
2298+-	pid_t thispid = getpid();
2299+-	XColor xmousefg, xmousebg;
2300++	struct wl_registry *registry;
2301+ 
2302+-	if (!(xw.dpy = XOpenDisplay(NULL)))
2303++	if (!(wl.dpy = wl_display_connect(NULL)))
2304+ 		die("Can't open display\n");
2305+-	xw.scr = XDefaultScreen(xw.dpy);
2306+-	xw.vis = XDefaultVisual(xw.dpy, xw.scr);
2307++
2308++	registry = wl_display_get_registry(wl.dpy);
2309++	wl_registry_add_listener(registry, &reglistener, NULL);
2310++	wld.ctx = wld_wayland_create_context(wl.dpy, WLD_ANY);
2311++	wld.renderer = wld_create_renderer(wld.ctx);
2312++
2313++	wl_display_roundtrip(wl.dpy);
2314++
2315++	if (!wl.shm)
2316++		die("Display has no SHM\n");
2317++	if (!wl.seat)
2318++		die("Display has no seat\n");
2319++	if (!wl.datadevmanager)
2320++		die("Display has no data device manager\n");
2321++	if (!wl.wm)
2322++		die("Display has no window manager\n");
2323++
2324++	wl.keyboard = wl_seat_get_keyboard(wl.seat);
2325++	wl_keyboard_add_listener(wl.keyboard, &kbdlistener, NULL);
2326++	wl.pointer = wl_seat_get_pointer(wl.seat);
2327++	wl_pointer_add_listener(wl.pointer, &ptrlistener, NULL);
2328++	wl.datadev = wl_data_device_manager_get_data_device(wl.datadevmanager,
2329++			wl.seat);
2330++	wl_data_device_add_listener(wl.datadev, &datadevlistener, NULL);
2331+ 
2332+ 	/* font */
2333+ 	if (!FcInit())
2334+ 		die("Could not init fontconfig.\n");
2335+ 
2336+ 	usedfont = (opt_font == NULL)? font : opt_font;
2337+-	xloadfonts(usedfont, 0);
2338+-
2339+-	/* colors */
2340+-	xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
2341+-	xloadcols();
2342+-
2343+-	/* adjust fixed window geometry */
2344+-	xw.w = 2 * borderpx + term.col * xw.cw;
2345+-	xw.h = 2 * borderpx + term.row * xw.ch;
2346+-	if (xw.gm & XNegative)
2347+-		xw.l += DisplayWidth(xw.dpy, xw.scr) - xw.w - 2;
2348+-	if (xw.gm & YNegative)
2349+-		xw.t += DisplayHeight(xw.dpy, xw.scr) - xw.h - 2;
2350+-
2351+-	/* Events */
2352+-	xw.attrs.background_pixel = dc.col[defaultbg].pixel;
2353+-	xw.attrs.border_pixel = dc.col[defaultbg].pixel;
2354+-	xw.attrs.bit_gravity = NorthWestGravity;
2355+-	xw.attrs.event_mask = FocusChangeMask | KeyPressMask
2356+-		| ExposureMask | VisibilityChangeMask | StructureNotifyMask
2357+-		| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
2358+-	xw.attrs.colormap = xw.cmap;
2359+-
2360+-	if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
2361+-		parent = XRootWindow(xw.dpy, xw.scr);
2362+-	xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
2363+-			xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
2364+-			xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
2365+-			| CWEventMask | CWColormap, &xw.attrs);
2366+-
2367+-	memset(&gcvalues, 0, sizeof(gcvalues));
2368+-	gcvalues.graphics_exposures = False;
2369+-	dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
2370+-			&gcvalues);
2371+-	xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
2372+-			DefaultDepth(xw.dpy, xw.scr));
2373+-	XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
2374+-	XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
2375+-
2376+-	/* Xft rendering context */
2377+-	xw.draw = XftDrawCreate(xw.dpy, xw.buf, xw.vis, xw.cmap);
2378+-
2379+-	/* input methods */
2380+-	if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
2381+-		XSetLocaleModifiers("@im=local");
2382+-		if ((xw.xim =  XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
2383+-			XSetLocaleModifiers("@im=");
2384+-			if ((xw.xim = XOpenIM(xw.dpy,
2385+-					NULL, NULL, NULL)) == NULL) {
2386+-				die("XOpenIM failed. Could not open input"
2387+-					" device.\n");
2388+-			}
2389+-		}
2390+-	}
2391+-	xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing
2392+-					   | XIMStatusNothing, XNClientWindow, xw.win,
2393+-					   XNFocusWindow, xw.win, NULL);
2394+-	if (xw.xic == NULL)
2395+-		die("XCreateIC failed. Could not obtain input method.\n");
2396+-
2397+-	/* white cursor, black outline */
2398+-	cursor = XCreateFontCursor(xw.dpy, mouseshape);
2399+-	XDefineCursor(xw.dpy, xw.win, cursor);
2400+-
2401+-	if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) {
2402+-		xmousefg.red   = 0xffff;
2403+-		xmousefg.green = 0xffff;
2404+-		xmousefg.blue  = 0xffff;
2405+-	}
2406++	wld.fontctx = wld_font_create_context();
2407++	wlloadfonts(usedfont, 0);
2408+ 
2409+-	if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) {
2410+-		xmousebg.red   = 0x0000;
2411+-		xmousebg.green = 0x0000;
2412+-		xmousebg.blue  = 0x0000;
2413+-	}
2414++	wlloadcols();
2415++	wlloadcursor();
2416+ 
2417+-	XRecolorCursor(xw.dpy, cursor, &xmousefg, &xmousebg);
2418++	wl.vis = 0;
2419++	wl.h = 2 * borderpx + term.row * wl.ch;
2420++	wl.w = 2 * borderpx + term.col * wl.cw;
2421+ 
2422+-	xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False);
2423+-	xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False);
2424+-	xw.netwmname = XInternAtom(xw.dpy, "_NET_WM_NAME", False);
2425+-	XSetWMProtocols(xw.dpy, xw.win, &xw.wmdeletewin, 1);
2426++	wl.surface = wl_compositor_create_surface(wl.cmp);
2427++	wl_surface_add_listener(wl.surface, &surflistener, NULL);
2428+ 
2429+-	xw.netwmpid = XInternAtom(xw.dpy, "_NET_WM_PID", False);
2430+-	XChangeProperty(xw.dpy, xw.win, xw.netwmpid, XA_CARDINAL, 32,
2431+-			PropModeReplace, (uchar *)&thispid, 1);
2432++	wl.xdgsurface = xdg_wm_base_get_xdg_surface(wl.wm, wl.surface);
2433++	xdg_surface_add_listener(wl.xdgsurface, &xdgsurflistener, NULL);
2434++	wl.toplevel = xdg_surface_get_toplevel(wl.xdgsurface);
2435++	xdg_toplevel_add_listener(wl.toplevel, &toplevellistener, NULL);
2436++	xdg_toplevel_set_app_id(wl.toplevel, opt_class ? opt_class : termname);
2437++	wl_surface_commit(wl.surface);
2438+ 
2439+-	xresettitle();
2440+-	XMapWindow(xw.dpy, xw.win);
2441+-	xhints();
2442+-	XSync(xw.dpy, False);
2443++	wl.xkb.ctx = xkb_context_new(0);
2444++	wlresettitle();
2445+ }
2446+ 
2447+-int
2448+-xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x, int y)
2449++/*
2450++ * TODO: Implement something like XftDrawGlyphFontSpec in wld, and then apply a
2451++ * similar patch to ae1923d27533ff46400d93765e971558201ca1ee
2452++ */
2453++
2454++void
2455++wldraws(char *s, Glyph base, int x, int y, int charlen, int bytelen)
2456+ {
2457+-	float winx = borderpx + x * xw.cw, winy = borderpx + y * xw.ch, xp, yp;
2458+-	ushort mode, prevmode = USHRT_MAX;
2459++	int winx = borderpx + x * wl.cw, winy = borderpx + y * wl.ch,
2460++	    width = charlen * wl.cw, xp, i;
2461++	int frcflags, charexists;
2462++	int u8fl, u8fblen, u8cblen, doesexist;
2463++	char *u8c, *u8fs;
2464++	Rune unicodep;
2465+ 	Font *font = &dc.font;
2466+-	int frcflags = FRC_NORMAL;
2467+-	float runewidth = xw.cw;
2468+-	Rune rune;
2469+-	FT_UInt glyphidx;
2470+ 	FcResult fcres;
2471+ 	FcPattern *fcpattern, *fontpattern;
2472+ 	FcFontSet *fcsets[] = { NULL };
2473+ 	FcCharSet *fccharset;
2474+-	int i, f, numspecs = 0;
2475++	uint32_t fg, bg, temp;
2476++	int oneatatime;
2477+ 
2478+-	for (i = 0, xp = winx, yp = winy + font->ascent; i < len; ++i) {
2479+-		/* Fetch rune and mode for current glyph. */
2480+-		rune = glyphs[i].u;
2481+-		mode = glyphs[i].mode;
2482++	frcflags = FRC_NORMAL;
2483+ 
2484+-		/* Skip dummy wide-character spacing. */
2485+-		if (mode == ATTR_WDUMMY)
2486+-			continue;
2487++	/* Fallback on color display for attributes not supported by the font */
2488++	if (base.mode & ATTR_ITALIC && base.mode & ATTR_BOLD) {
2489++		if (dc.ibfont.badslant || dc.ibfont.badweight)
2490++			base.fg = defaultattr;
2491++		font = &dc.ibfont;
2492++		frcflags = FRC_ITALICBOLD;
2493++	} else if (base.mode & ATTR_ITALIC) {
2494++		if (dc.ifont.badslant)
2495++			base.fg = defaultattr;
2496++		font = &dc.ifont;
2497++		frcflags = FRC_ITALIC;
2498++	} else if (base.mode & ATTR_BOLD) {
2499++		if (dc.bfont.badweight)
2500++			base.fg = defaultattr;
2501++		font = &dc.ifont;
2502++		frcflags = FRC_BOLD;
2503++	}
2504+ 
2505+-		/* Determine font for glyph if different from previous glyph. */
2506+-		if (prevmode != mode) {
2507+-			prevmode = mode;
2508+-			font = &dc.font;
2509+-			frcflags = FRC_NORMAL;
2510+-			runewidth = xw.cw * ((mode & ATTR_WIDE) ? 2.0f : 1.0f);
2511+-			if ((mode & ATTR_ITALIC) && (mode & ATTR_BOLD)) {
2512+-				font = &dc.ibfont;
2513+-				frcflags = FRC_ITALICBOLD;
2514+-			} else if (mode & ATTR_ITALIC) {
2515+-				font = &dc.ifont;
2516+-				frcflags = FRC_ITALIC;
2517+-			} else if (mode & ATTR_BOLD) {
2518+-				font = &dc.bfont;
2519+-				frcflags = FRC_BOLD;
2520+-			}
2521+-			yp = winy + font->ascent;
2522++	if (IS_TRUECOL(base.fg)) {
2523++		fg = base.fg | 0xff000000;
2524++	} else {
2525++		fg = dc.col[base.fg];
2526++	}
2527++
2528++	if (IS_TRUECOL(base.bg)) {
2529++		bg = base.bg | 0xff000000;
2530++	} else {
2531++		bg = dc.col[base.bg];
2532++	}
2533++
2534++	if (base.mode & ATTR_BOLD) {
2535++		/*
2536++		 * change basic system colors [0-7]
2537++		 * to bright system colors [8-15]
2538++		 */
2539++		if (BETWEEN(base.fg, 0, 7) && !(base.mode & ATTR_FAINT))
2540++			fg = dc.col[base.fg + 8];
2541++
2542++		if (base.mode & ATTR_ITALIC) {
2543++			font = &dc.ibfont;
2544++			frcflags = FRC_ITALICBOLD;
2545++		} else {
2546++			font = &dc.bfont;
2547++			frcflags = FRC_BOLD;
2548+ 		}
2549++	}
2550+ 
2551+-		/* Lookup character index with default font. */
2552+-		glyphidx = XftCharIndex(xw.dpy, font->match, rune);
2553+-		if (glyphidx) {
2554+-			specs[numspecs].font = font->match;
2555+-			specs[numspecs].glyph = glyphidx;
2556+-			specs[numspecs].x = (short)xp;
2557+-			specs[numspecs].y = (short)yp;
2558+-			xp += runewidth;
2559+-			numspecs++;
2560+-			continue;
2561++	if (IS_SET(MODE_REVERSE)) {
2562++		if (fg == dc.col[defaultfg]) {
2563++			fg = dc.col[defaultbg];
2564++		} else {
2565++			fg = ~(fg & 0xffffff);
2566+ 		}
2567+ 
2568+-		/* Fallback on font cache, search the font cache for match. */
2569+-		for (f = 0; f < frclen; f++) {
2570+-			glyphidx = XftCharIndex(xw.dpy, frc[f].font, rune);
2571+-			/* Everything correct. */
2572+-			if (glyphidx && frc[f].flags == frcflags)
2573+-				break;
2574+-			/* We got a default font for a not found glyph. */
2575+-			if (!glyphidx && frc[f].flags == frcflags
2576+-					&& frc[f].unicodep == rune) {
2577+-				break;
2578+-			}
2579++		if (bg == dc.col[defaultbg]) {
2580++			bg = dc.col[defaultfg];
2581++		} else {
2582++			bg = ~(bg & 0xffffff);
2583+ 		}
2584++	}
2585+ 
2586+-		/* Nothing was found. Use fontconfig to find matching font. */
2587+-		if (f >= frclen) {
2588+-			if (!font->set)
2589+-				font->set = FcFontSort(0, font->pattern,
2590+-				                       1, 0, &fcres);
2591+-			fcsets[0] = font->set;
2592++	if (base.mode & ATTR_REVERSE) {
2593++		temp = fg;
2594++		fg = bg;
2595++		bg = temp;
2596++	}
2597+ 
2598+-			/*
2599+-			 * Nothing was found in the cache. Now use
2600+-			 * some dozen of Fontconfig calls to get the
2601+-			 * font for one single character.
2602+-			 *
2603+-			 * Xft and fontconfig are design failures.
2604+-			 */
2605+-			fcpattern = FcPatternDuplicate(font->pattern);
2606+-			fccharset = FcCharSetCreate();
2607++	if (base.mode & ATTR_FAINT && !(base.mode & ATTR_BOLD)) {
2608++		fg = (fg & (0xff << 24))
2609++			| ((((fg >> 16) & 0xff) / 2) << 16)
2610++			| ((((fg >> 8) & 0xff) / 2) << 8)
2611++			| ((fg & 0xff) / 2);
2612++	}
2613+ 
2614+-			FcCharSetAddChar(fccharset, rune);
2615+-			FcPatternAddCharSet(fcpattern, FC_CHARSET,
2616+-					fccharset);
2617+-			FcPatternAddBool(fcpattern, FC_SCALABLE, 1);
2618++	if (base.mode & ATTR_BLINK && term.mode & MODE_BLINK)
2619++		fg = bg;
2620++
2621++	if (base.mode & ATTR_INVISIBLE)
2622++		fg = bg;
2623++
2624++	/* Intelligent cleaning up of the borders. */
2625++	if (x == 0) {
2626++		wlclear(0, (y == 0)? 0 : winy, borderpx,
2627++			((y >= term.row-1)? wl.h : (winy + wl.ch)));
2628++	}
2629++	if (x + charlen >= term.col) {
2630++		wlclear(winx + width, (y == 0)? 0 : winy, wl.w,
2631++			((y >= term.row-1)? wl.h : (winy + wl.ch)));
2632++	}
2633++	if (y == 0)
2634++		wlclear(winx, 0, winx + width, borderpx);
2635++	if (y == term.row-1)
2636++		wlclear(winx, winy + wl.ch, winx + width, wl.h);
2637++
2638++	/* Clean up the region we want to draw to. */
2639++	wld_fill_rectangle(wld.renderer, bg, winx, winy, width, wl.ch);
2640++
2641++	for (xp = winx; bytelen > 0;) {
2642++		/*
2643++		 * Search for the range in the to be printed string of glyphs
2644++		 * that are in the main font. Then print that range. If
2645++		 * some glyph is found that is not in the font, do the
2646++		 * fallback dance.
2647++		 */
2648++		u8fs = s;
2649++		u8fblen = 0;
2650++		u8fl = 0;
2651++		oneatatime = font->width != wl.cw;
2652++		for (;;) {
2653++			u8c = s;
2654++			u8cblen = utf8decode(s, &unicodep, UTF_SIZ);
2655++			s += u8cblen;
2656++			bytelen -= u8cblen;
2657++
2658++			doesexist = wld_font_ensure_char(font->match, unicodep);
2659++			if (doesexist) {
2660++					u8fl++;
2661++					u8fblen += u8cblen;
2662++					if (!oneatatime && bytelen > 0)
2663++							continue;
2664++			}
2665++
2666++			if (u8fl > 0) {
2667++				wld_draw_text(wld.renderer,
2668++						font->match, fg, xp,
2669++						winy + font->ascent,
2670++						u8fs, u8fblen, NULL);
2671++				xp += wl.cw * u8fl;
2672++			}
2673++			break;
2674++		}
2675++		if (doesexist) {
2676++			if (oneatatime)
2677++				continue;
2678++			break;
2679++		}
2680++
2681++		/* Search the font cache. */
2682++		for (i = 0; i < frclen; i++) {
2683++			charexists = wld_font_ensure_char(frc[i].font, unicodep);
2684++			/* Everything correct. */
2685++			if (charexists && frc[i].flags == frcflags)
2686++				break;
2687++			/* We got a default font for a not found glyph. */
2688++			if (!charexists && frc[i].flags == frcflags \
2689++					&& frc[i].unicodep == unicodep) {
2690++				break;
2691++			}
2692++		}
2693++
2694++		/* Nothing was found. */
2695++		if (i >= frclen) {
2696++			if (!font->set)
2697++				font->set = FcFontSort(0, font->pattern,
2698++				                       1, 0, &fcres);
2699++			fcsets[0] = font->set;
2700++
2701++			/*
2702++			 * Nothing was found in the cache. Now use
2703++			 * some dozen of Fontconfig calls to get the
2704++			 * font for one single character.
2705++			 *
2706++			 * Xft and fontconfig are design failures.
2707++			 */
2708++			fcpattern = FcPatternDuplicate(font->pattern);
2709++			fccharset = FcCharSetCreate();
2710++
2711++			FcCharSetAddChar(fccharset, unicodep);
2712++			FcPatternAddCharSet(fcpattern, FC_CHARSET,
2713++					fccharset);
2714++			FcPatternAddBool(fcpattern, FC_SCALABLE, 1);
2715+ 
2716+ 			FcConfigSubstitute(0, fcpattern,
2717+ 					FcMatchPattern);
2718+@@ -3783,186 +3632,58 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
2719+ 			 */
2720+ 			if (frclen >= LEN(frc)) {
2721+ 				frclen = LEN(frc) - 1;
2722+-				XftFontClose(xw.dpy, frc[frclen].font);
2723++				wld_font_close(frc[frclen].font);
2724+ 				frc[frclen].unicodep = 0;
2725+ 			}
2726+ 
2727+-			frc[frclen].font = XftFontOpenPattern(xw.dpy,
2728++			frc[frclen].font = wld_font_open_pattern(wld.fontctx,
2729+ 					fontpattern);
2730+ 			frc[frclen].flags = frcflags;
2731+-			frc[frclen].unicodep = rune;
2732+-
2733+-			glyphidx = XftCharIndex(xw.dpy, frc[frclen].font, rune);
2734++			frc[frclen].unicodep = unicodep;
2735+ 
2736+-			f = frclen;
2737++			i = frclen;
2738+ 			frclen++;
2739+ 
2740+ 			FcPatternDestroy(fcpattern);
2741+ 			FcCharSetDestroy(fccharset);
2742+ 		}
2743+ 
2744+-		specs[numspecs].font = frc[f].font;
2745+-		specs[numspecs].glyph = glyphidx;
2746+-		specs[numspecs].x = (short)xp;
2747+-		specs[numspecs].y = (short)yp;
2748+-		xp += runewidth;
2749+-		numspecs++;
2750+-	}
2751+-
2752+-	return numspecs;
2753+-}
2754+-
2755+-void
2756+-xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, int y)
2757+-{
2758+-	int charlen = len * ((base.mode & ATTR_WIDE) ? 2 : 1);
2759+-	int winx = borderpx + x * xw.cw, winy = borderpx + y * xw.ch,
2760+-	    width = charlen * xw.cw;
2761+-	Color *fg, *bg, *temp, revfg, revbg, truefg, truebg;
2762+-	XRenderColor colfg, colbg;
2763+-	XRectangle r;
2764+-
2765+-	/* Fallback on color display for attributes not supported by the font */
2766+-	if (base.mode & ATTR_ITALIC && base.mode & ATTR_BOLD) {
2767+-		if (dc.ibfont.badslant || dc.ibfont.badweight)
2768+-			base.fg = defaultattr;
2769+-	} else if ((base.mode & ATTR_ITALIC && dc.ifont.badslant) ||
2770+-	    (base.mode & ATTR_BOLD && dc.bfont.badweight)) {
2771+-		base.fg = defaultattr;
2772+-	}
2773+-
2774+-	if (IS_TRUECOL(base.fg)) {
2775+-		colfg.alpha = 0xffff;
2776+-		colfg.red = TRUERED(base.fg);
2777+-		colfg.green = TRUEGREEN(base.fg);
2778+-		colfg.blue = TRUEBLUE(base.fg);
2779+-		XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &truefg);
2780+-		fg = &truefg;
2781+-	} else {
2782+-		fg = &dc.col[base.fg];
2783+-	}
2784+-
2785+-	if (IS_TRUECOL(base.bg)) {
2786+-		colbg.alpha = 0xffff;
2787+-		colbg.green = TRUEGREEN(base.bg);
2788+-		colbg.red = TRUERED(base.bg);
2789+-		colbg.blue = TRUEBLUE(base.bg);
2790+-		XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, &truebg);
2791+-		bg = &truebg;
2792+-	} else {
2793+-		bg = &dc.col[base.bg];
2794+-	}
2795+-
2796+-	/* Change basic system colors [0-7] to bright system colors [8-15] */
2797+-	if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7))
2798+-		fg = &dc.col[base.fg + 8];
2799+-
2800+-	if (IS_SET(MODE_REVERSE)) {
2801+-		if (fg == &dc.col[defaultfg]) {
2802+-			fg = &dc.col[defaultbg];
2803+-		} else {
2804+-			colfg.red = ~fg->color.red;
2805+-			colfg.green = ~fg->color.green;
2806+-			colfg.blue = ~fg->color.blue;
2807+-			colfg.alpha = fg->color.alpha;
2808+-			XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg,
2809+-					&revfg);
2810+-			fg = &revfg;
2811+-		}
2812+-
2813+-		if (bg == &dc.col[defaultbg]) {
2814+-			bg = &dc.col[defaultfg];
2815+-		} else {
2816+-			colbg.red = ~bg->color.red;
2817+-			colbg.green = ~bg->color.green;
2818+-			colbg.blue = ~bg->color.blue;
2819+-			colbg.alpha = bg->color.alpha;
2820+-			XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg,
2821+-					&revbg);
2822+-			bg = &revbg;
2823+-		}
2824+-	}
2825+-
2826+-	if (base.mode & ATTR_REVERSE) {
2827+-		temp = fg;
2828+-		fg = bg;
2829+-		bg = temp;
2830+-	}
2831+-
2832+-	if ((base.mode & ATTR_BOLD_FAINT) == ATTR_FAINT) {
2833+-		colfg.red = fg->color.red / 2;
2834+-		colfg.green = fg->color.green / 2;
2835+-		colfg.blue = fg->color.blue / 2;
2836+-		XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &revfg);
2837+-		fg = &revfg;
2838+-	}
2839+-
2840+-	if (base.mode & ATTR_BLINK && term.mode & MODE_BLINK)
2841+-		fg = bg;
2842+-
2843+-	if (base.mode & ATTR_INVISIBLE)
2844+-		fg = bg;
2845++		wld_draw_text(wld.renderer, frc[i].font, fg,
2846++				xp, winy + frc[i].font->ascent,
2847++				u8c, u8cblen, NULL);
2848+ 
2849+-	/* Intelligent cleaning up of the borders. */
2850+-	if (x == 0) {
2851+-		xclear(0, (y == 0)? 0 : winy, borderpx,
2852+-			winy + xw.ch + ((y >= term.row-1)? xw.h : 0));
2853+-	}
2854+-	if (x + charlen >= term.col) {
2855+-		xclear(winx + width, (y == 0)? 0 : winy, xw.w,
2856+-			((y >= term.row-1)? xw.h : (winy + xw.ch)));
2857++		xp += wl.cw * wcwidth(unicodep);
2858+ 	}
2859+-	if (y == 0)
2860+-		xclear(winx, 0, winx + width, borderpx);
2861+-	if (y == term.row-1)
2862+-		xclear(winx, winy + xw.ch, winx + width, xw.h);
2863+ 
2864+-	/* Clean up the region we want to draw to. */
2865+-	XftDrawRect(xw.draw, bg, winx, winy, width, xw.ch);
2866+-
2867+-	/* Set the clip region because Xft is sometimes dirty. */
2868+-	r.x = 0;
2869+-	r.y = 0;
2870+-	r.height = xw.ch;
2871+-	r.width = width;
2872+-	XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1);
2873+-
2874+-	/* Render the glyphs. */
2875+-	XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
2876+-
2877+-	/* Render underline and strikethrough. */
2878+ 	if (base.mode & ATTR_UNDERLINE) {
2879+-		XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent + 1,
2880++		wld_fill_rectangle(wld.renderer, fg, winx, winy + font->ascent + 1,
2881+ 				width, 1);
2882+ 	}
2883+ 
2884+ 	if (base.mode & ATTR_STRUCK) {
2885+-		XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent / 3,
2886++		wld_fill_rectangle(wld.renderer, fg, winx, winy + 2 * font->ascent / 3,
2887+ 				width, 1);
2888+ 	}
2889+-
2890+-	/* Reset clip to none. */
2891+-	XftDrawSetClip(xw.draw, 0);
2892+ }
2893+ 
2894+ void
2895+-xdrawglyph(Glyph g, int x, int y)
2896++wldrawglyph(Glyph g, int x, int y)
2897+ {
2898+-	int numspecs;
2899+-	XftGlyphFontSpec spec;
2900++	static char buf[UTF_SIZ];
2901++	size_t len = utf8encode(g.u, buf);
2902++	int width = g.mode & ATTR_WIDE ? 2 : 1;
2903+ 
2904+-	numspecs = xmakeglyphfontspecs(&spec, &g, 1, x, y);
2905+-	xdrawglyphfontspecs(&spec, g, numspecs, x, y);
2906++	wldraws(buf, g, x, y, width, len);
2907+ }
2908+ 
2909+ void
2910+-xdrawcursor(void)
2911++wldrawcursor(void)
2912+ {
2913+ 	static int oldx = 0, oldy = 0;
2914+ 	int curx;
2915+ 	Glyph g = {' ', ATTR_NULL, defaultbg, defaultcs}, og;
2916+ 	int ena_sel = sel.ob.x != -1 && sel.alt == IS_SET(MODE_ALTSCREEN);
2917+-	Color drawcol;
2918++	uint32_t drawcol;
2919+ 
2920+ 	LIMIT(oldx, 0, term.col-1);
2921+ 	LIMIT(oldy, 0, term.row-1);
2922+@@ -3979,7 +3700,11 @@ xdrawcursor(void)
2923+ 	og = term.line[oldy][oldx];
2924+ 	if (ena_sel && selected(oldx, oldy))
2925+ 		og.mode ^= ATTR_REVERSE;
2926+-	xdrawglyph(og, oldx, oldy);
2927++	wldrawglyph(og, oldx, oldy);
2928++	if (oldx != curx || oldy != term.c.y) {
2929++		wl_surface_damage(wl.surface, borderpx + oldx * wl.cw,
2930++				borderpx + oldy * wl.ch, wl.cw, wl.ch);
2931++	}
2932+ 
2933+ 	g.u = term.line[term.c.y][term.c.x].u;
2934+ 
2935+@@ -4010,198 +3735,152 @@ xdrawcursor(void)
2936+ 		return;
2937+ 
2938+ 	/* draw the new one */
2939+-	if (xw.state & WIN_FOCUSED) {
2940+-		switch (xw.cursor) {
2941++	if (wl.state & WIN_FOCUSED) {
2942++		switch (wl.cursor) {
2943+ 		case 7: /* st extension: snowman */
2944+ 			utf8decode("☃", &g.u, UTF_SIZ);
2945+ 		case 0: /* Blinking Block */
2946+ 		case 1: /* Blinking Block (Default) */
2947+ 		case 2: /* Steady Block */
2948+ 			g.mode |= term.line[term.c.y][curx].mode & ATTR_WIDE;
2949+-			xdrawglyph(g, term.c.x, term.c.y);
2950++			wldrawglyph(g, term.c.x, term.c.y);
2951+ 			break;
2952+ 		case 3: /* Blinking Underline */
2953+ 		case 4: /* Steady Underline */
2954+-			XftDrawRect(xw.draw, &drawcol,
2955+-					borderpx + curx * xw.cw,
2956+-					borderpx + (term.c.y + 1) * xw.ch - \
2957++			wld_fill_rectangle(wld.renderer, drawcol,
2958++					borderpx + curx * wl.cw,
2959++					borderpx + (term.c.y + 1) * wl.ch - \
2960+ 						cursorthickness,
2961+-					xw.cw, cursorthickness);
2962++					wl.cw, cursorthickness);
2963+ 			break;
2964+ 		case 5: /* Blinking bar */
2965+ 		case 6: /* Steady bar */
2966+-			XftDrawRect(xw.draw, &drawcol,
2967+-					borderpx + curx * xw.cw,
2968+-					borderpx + term.c.y * xw.ch,
2969+-					cursorthickness, xw.ch);
2970++			wld_fill_rectangle(wld.renderer, drawcol,
2971++					borderpx + curx * wl.cw,
2972++					borderpx + term.c.y * wl.ch,
2973++					cursorthickness, wl.ch);
2974+ 			break;
2975+ 		}
2976+ 	} else {
2977+-		XftDrawRect(xw.draw, &drawcol,
2978+-				borderpx + curx * xw.cw,
2979+-				borderpx + term.c.y * xw.ch,
2980+-				xw.cw - 1, 1);
2981+-		XftDrawRect(xw.draw, &drawcol,
2982+-				borderpx + curx * xw.cw,
2983+-				borderpx + term.c.y * xw.ch,
2984+-				1, xw.ch - 1);
2985+-		XftDrawRect(xw.draw, &drawcol,
2986+-				borderpx + (curx + 1) * xw.cw - 1,
2987+-				borderpx + term.c.y * xw.ch,
2988+-				1, xw.ch - 1);
2989+-		XftDrawRect(xw.draw, &drawcol,
2990+-				borderpx + curx * xw.cw,
2991+-				borderpx + (term.c.y + 1) * xw.ch - 1,
2992+-				xw.cw, 1);
2993++		wld_fill_rectangle(wld.renderer, drawcol,
2994++				borderpx + curx * wl.cw,
2995++				borderpx + term.c.y * wl.ch,
2996++				wl.cw - 1, 1);
2997++		wld_fill_rectangle(wld.renderer, drawcol,
2998++				borderpx + curx * wl.cw,
2999++				borderpx + term.c.y * wl.ch,
3000++				1, wl.ch - 1);
3001++		wld_fill_rectangle(wld.renderer, drawcol,
3002++				borderpx + (curx + 1) * wl.cw - 1,
3003++				borderpx + term.c.y * wl.ch,
3004++				1, wl.ch - 1);
3005++		wld_fill_rectangle(wld.renderer, drawcol,
3006++				borderpx + curx * wl.cw,
3007++				borderpx + (term.c.y + 1) * wl.ch - 1,
3008++				wl.cw, 1);
3009+ 	}
3010++	wl_surface_damage(wl.surface, borderpx + curx * wl.cw,
3011++			borderpx + term.c.y * wl.ch, wl.cw, wl.ch);
3012+ 	oldx = curx, oldy = term.c.y;
3013+ }
3014+ 
3015+-
3016+ void
3017+-xsettitle(char *p)
3018++wlsettitle(char *title)
3019+ {
3020+-	XTextProperty prop;
3021+-
3022+-	Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
3023+-			&prop);
3024+-	XSetWMName(xw.dpy, xw.win, &prop);
3025+-	XSetTextProperty(xw.dpy, xw.win, &prop, xw.netwmname);
3026+-	XFree(prop.value);
3027++	xdg_toplevel_set_title(wl.toplevel, title);
3028+ }
3029+ 
3030+ void
3031+-xresettitle(void)
3032++wlresettitle(void)
3033+ {
3034+-	xsettitle(opt_title ? opt_title : "st");
3035++	wlsettitle(opt_title ? opt_title : "st");
3036+ }
3037+ 
3038+ void
3039+ redraw(void)
3040+ {
3041+ 	tfulldirt();
3042+-	draw();
3043+ }
3044+ 
3045+ void
3046+ draw(void)
3047+ {
3048++	int y, y0;
3049++
3050++	for (y = 0; y <= term.bot; ++y) {
3051++		if (!term.dirty[y])
3052++			continue;
3053++		for (y0 = y; y <= term.bot && term.dirty[y]; ++y);
3054++		wl_surface_damage(wl.surface, 0, borderpx + y0 * wl.ch,
3055++				wl.w, (y - y0) * wl.ch);
3056++	}
3057++
3058++	wld_set_target_buffer(wld.renderer, wld.buffer);
3059+ 	drawregion(0, 0, term.col, term.row);
3060+-	XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, xw.w,
3061+-			xw.h, 0, 0);
3062+-	XSetForeground(xw.dpy, dc.gc,
3063+-			dc.col[IS_SET(MODE_REVERSE)?
3064+-				defaultfg : defaultbg].pixel);
3065++	wl.framecb = wl_surface_frame(wl.surface);
3066++	wl_callback_add_listener(wl.framecb, &framelistener, NULL);
3067++	wld_flush(wld.renderer);
3068++	wl_surface_attach(wl.surface, wl.buffer, 0, 0);
3069++	wl_surface_commit(wl.surface);
3070++	/* need to wait to destroy the old buffer until we commit the new
3071++	 * buffer */
3072++	if (wld.oldbuffer) {
3073++		wld_buffer_unreference(wld.oldbuffer);
3074++		wld.oldbuffer = 0;
3075++	}
3076++	needdraw = false;
3077+ }
3078+ 
3079+ void
3080+ drawregion(int x1, int y1, int x2, int y2)
3081+ {
3082+-	int i, x, y, ox, numspecs;
3083++	int ic, ib, x, y, ox;
3084+ 	Glyph base, new;
3085+-	XftGlyphFontSpec *specs;
3086++	char buf[DRAW_BUF_SIZ];
3087+ 	int ena_sel = sel.ob.x != -1 && sel.alt == IS_SET(MODE_ALTSCREEN);
3088+ 
3089+-	if (!(xw.state & WIN_VISIBLE))
3090+-		return;
3091+-
3092+ 	for (y = y1; y < y2; y++) {
3093+ 		if (!term.dirty[y])
3094+ 			continue;
3095+ 
3096+ 		term.dirty[y] = 0;
3097+-
3098+-		specs = term.specbuf;
3099+-		numspecs = xmakeglyphfontspecs(specs, &term.line[y][x1], x2 - x1, x1, y);
3100+-
3101+-		i = ox = 0;
3102+-		for (x = x1; x < x2 && i < numspecs; x++) {
3103++		base = term.line[y][0];
3104++		ic = ib = ox = 0;
3105++		for (x = x1; x < x2; x++) {
3106+ 			new = term.line[y][x];
3107+ 			if (new.mode == ATTR_WDUMMY)
3108+ 				continue;
3109+ 			if (ena_sel && selected(x, y))
3110+ 				new.mode ^= ATTR_REVERSE;
3111+-			if (i > 0 && ATTRCMP(base, new)) {
3112+-				xdrawglyphfontspecs(specs, base, i, ox, y);
3113+-				specs += i;
3114+-				numspecs -= i;
3115+-				i = 0;
3116++			if (ib > 0 && (ATTRCMP(base, new)
3117++					|| ib >= DRAW_BUF_SIZ-UTF_SIZ)) {
3118++				wldraws(buf, base, ox, y, ic, ib);
3119++				ic = ib = 0;
3120+ 			}
3121+-			if (i == 0) {
3122++			if (ib == 0) {
3123+ 				ox = x;
3124+ 				base = new;
3125+ 			}
3126+-			i++;
3127++
3128++			ib += utf8encode(new.u, buf+ib);
3129++			ic += (new.mode & ATTR_WIDE)? 2 : 1;
3130+ 		}
3131+-		if (i > 0)
3132+-			xdrawglyphfontspecs(specs, base, i, ox, y);
3133++		if (ib > 0)
3134++			wldraws(buf, base, ox, y, ic, ib);
3135+ 	}
3136+-	xdrawcursor();
3137+-}
3138+-
3139+-void
3140+-expose(XEvent *ev)
3141+-{
3142+-	redraw();
3143+-}
3144+-
3145+-void
3146+-visibility(XEvent *ev)
3147+-{
3148+-	XVisibilityEvent *e = &ev->xvisibility;
3149+-
3150+-	MODBIT(xw.state, e->state != VisibilityFullyObscured, WIN_VISIBLE);
3151+-}
3152+-
3153+-void
3154+-unmap(XEvent *ev)
3155+-{
3156+-	xw.state &= ~WIN_VISIBLE;
3157+-}
3158+-
3159+-void
3160+-xsetpointermotion(int set)
3161+-{
3162+-	MODBIT(xw.attrs.event_mask, set, PointerMotionMask);
3163+-	XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs);
3164++	wldrawcursor();
3165+ }
3166+ 
3167+ void
3168+-xseturgency(int add)
3169++wlseturgency(int add)
3170+ {
3171+-	XWMHints *h = XGetWMHints(xw.dpy, xw.win);
3172+-
3173+-	MODBIT(h->flags, add, XUrgencyHint);
3174+-	XSetWMHints(xw.dpy, xw.win, h);
3175+-	XFree(h);
3176+-}
3177+-
3178+-void
3179+-focus(XEvent *ev)
3180+-{
3181+-	XFocusChangeEvent *e = &ev->xfocus;
3182+-
3183+-	if (e->mode == NotifyGrab)
3184+-		return;
3185+-
3186+-	if (ev->type == FocusIn) {
3187+-		XSetICFocus(xw.xic);
3188+-		xw.state |= WIN_FOCUSED;
3189+-		xseturgency(0);
3190+-		if (IS_SET(MODE_FOCUS))
3191+-			ttywrite("\033[I", 3);
3192+-	} else {
3193+-		XUnsetICFocus(xw.xic);
3194+-		xw.state &= ~WIN_FOCUSED;
3195+-		if (IS_SET(MODE_FOCUS))
3196+-			ttywrite("\033[O", 3);
3197+-	}
3198++	/* XXX: no urgency equivalent yet in wayland */
3199+ }
3200+ 
3201+ int
3202+ match(uint mask, uint state)
3203+ {
3204+-	return mask == XK_ANY_MOD || mask == (state & ~ignoremod);
3205++	return mask == MOD_MASK_ANY || mask == (state & ~(ignoremod));
3206+ }
3207+ 
3208+ void
3209+@@ -4211,7 +3890,7 @@ numlock(const Arg *dummy)
3210+ }
3211+ 
3212+ char*
3213+-kmap(KeySym k, uint state)
3214++kmap(xkb_keysym_t k, uint state)
3215+ {
3216+ 	Key *kp;
3217+ 	int i;
3218+@@ -4251,38 +3930,176 @@ kmap(KeySym k, uint state)
3219+ }
3220+ 
3221+ void
3222+-kpress(XEvent *ev)
3223++cresize(int width, int height)
3224++{
3225++	int col, row;
3226++
3227++	if (width != 0)
3228++		wl.w = width;
3229++	if (height != 0)
3230++		wl.h = height;
3231++
3232++	col = (wl.w - 2 * borderpx) / wl.cw;
3233++	row = (wl.h - 2 * borderpx) / wl.ch;
3234++
3235++	tresize(col, row);
3236++	wlresize(col, row);
3237++}
3238++
3239++void
3240++regglobal(void *data, struct wl_registry *registry, uint32_t name,
3241++          const char *interface, uint32_t version)
3242++{
3243++	if (strcmp(interface, "wl_compositor") == 0) {
3244++		wl.cmp = wl_registry_bind(registry, name,
3245++				&wl_compositor_interface, 3);
3246++	} else if (strcmp(interface, "xdg_wm_base") == 0) {
3247++		wl.wm = wl_registry_bind(registry, name, &xdg_wm_base_interface, 1);
3248++		xdg_wm_base_add_listener(wl.wm, &wmlistener, NULL);
3249++	} else if (strcmp(interface, "wl_shm") == 0) {
3250++		wl.shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
3251++	} else if (strcmp(interface, "wl_seat") == 0) {
3252++		wl.seat = wl_registry_bind(registry, name,
3253++				&wl_seat_interface, 4);
3254++	} else if (strcmp(interface, "wl_data_device_manager") == 0) {
3255++		wl.datadevmanager = wl_registry_bind(registry, name,
3256++				&wl_data_device_manager_interface, 1);
3257++	} else if (strcmp(interface, "wl_output") == 0) {
3258++		/* bind to outputs so we can get surface enter events */
3259++		wl_registry_bind(registry, name, &wl_output_interface, 2);
3260++	}
3261++}
3262++
3263++void
3264++regglobalremove(void *data, struct wl_registry *registry, uint32_t name)
3265++{
3266++}
3267++
3268++void
3269++surfenter(void *data, struct wl_surface *surface, struct wl_output *output)
3270++{
3271++	wl.vis++;
3272++	if (!(wl.state & WIN_VISIBLE))
3273++		wl.state |= WIN_VISIBLE;
3274++}
3275++
3276++void
3277++surfleave(void *data, struct wl_surface *surface, struct wl_output *output)
3278++{
3279++	if (--wl.vis == 0)
3280++		wl.state &= ~WIN_VISIBLE;
3281++}
3282++
3283++void
3284++framedone(void *data, struct wl_callback *callback, uint32_t msecs)
3285++{
3286++	wl_callback_destroy(callback);
3287++	wl.framecb = NULL;
3288++	if (needdraw && wl.state & WIN_VISIBLE) {
3289++		draw();
3290++	}
3291++}
3292++
3293++void
3294++kbdkeymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int32_t fd,
3295++          uint32_t size)
3296+ {
3297+-	XKeyEvent *e = &ev->xkey;
3298+-	KeySym ksym;
3299+-	char buf[32], *customkey;
3300++	char *string;
3301++
3302++	if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
3303++		close(fd);
3304++		return;
3305++	}
3306++
3307++	string = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
3308++
3309++	if (string == MAP_FAILED) {
3310++		close(fd);
3311++		return;
3312++	}
3313++
3314++	wl.xkb.keymap = xkb_keymap_new_from_string(wl.xkb.ctx, string,
3315++			XKB_KEYMAP_FORMAT_TEXT_V1, 0);
3316++	munmap(string, size);
3317++	close(fd);
3318++	wl.xkb.state = xkb_state_new(wl.xkb.keymap);
3319++
3320++	wl.xkb.ctrl = xkb_keymap_mod_get_index(wl.xkb.keymap, XKB_MOD_NAME_CTRL);
3321++	wl.xkb.alt = xkb_keymap_mod_get_index(wl.xkb.keymap, XKB_MOD_NAME_ALT);
3322++	wl.xkb.shift = xkb_keymap_mod_get_index(wl.xkb.keymap, XKB_MOD_NAME_SHIFT);
3323++	wl.xkb.logo = xkb_keymap_mod_get_index(wl.xkb.keymap, XKB_MOD_NAME_LOGO);
3324++
3325++	wl.xkb.mods = 0;
3326++}
3327++
3328++void
3329++kbdenter(void *data, struct wl_keyboard *keyboard, uint32_t serial,
3330++         struct wl_surface *surface, struct wl_array *keys)
3331++{
3332++	wl.state |= WIN_FOCUSED;
3333++	if (IS_SET(MODE_FOCUS))
3334++		ttywrite("\033[I", 3);
3335++	/* need to redraw the cursor */
3336++	needdraw = true;
3337++}
3338++
3339++void
3340++kbdleave(void *data, struct wl_keyboard *keyboard, uint32_t serial,
3341++	 struct wl_surface *surface)
3342++{
3343++	/* selection offers are invalidated when we lose keyboard focus */
3344++	wl.seloffer = NULL;
3345++	wl.state &= ~WIN_FOCUSED;
3346++	if (IS_SET(MODE_FOCUS))
3347++		ttywrite("\033[O", 3);
3348++	/* need to redraw the cursor */
3349++	needdraw = true;
3350++	/* disable key repeat */
3351++	repeat.len = 0;
3352++}
3353++
3354++void
3355++kbdkey(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time,
3356++       uint32_t key, uint32_t state)
3357++{
3358++	xkb_keysym_t ksym;
3359++	char buf[32], *str;
3360+ 	int len;
3361+ 	Rune c;
3362+-	Status status;
3363+ 	Shortcut *bp;
3364+ 
3365+ 	if (IS_SET(MODE_KBDLOCK))
3366+ 		return;
3367+ 
3368+-	len = XmbLookupString(xw.xic, e, buf, sizeof buf, &ksym, &status);
3369++	if (state == WL_KEYBOARD_KEY_STATE_RELEASED) {
3370++		if (repeat.key == key)
3371++			repeat.len = 0;
3372++		return;
3373++	}
3374++
3375++	ksym = xkb_state_key_get_one_sym(wl.xkb.state, key + 8);
3376++	len = xkb_keysym_to_utf8(ksym, buf, sizeof buf);
3377++	if (len > 0)
3378++	    --len;
3379++
3380+ 	/* 1. shortcuts */
3381+ 	for (bp = shortcuts; bp < shortcuts + LEN(shortcuts); bp++) {
3382+-		if (ksym == bp->keysym && match(bp->mod, e->state)) {
3383++		if (ksym == bp->keysym && match(bp->mod, wl.xkb.mods)) {
3384+ 			bp->func(&(bp->arg));
3385+ 			return;
3386+ 		}
3387+ 	}
3388+ 
3389+ 	/* 2. custom keys from config.h */
3390+-	if ((customkey = kmap(ksym, e->state))) {
3391+-		ttysend(customkey, strlen(customkey));
3392+-		return;
3393++	if ((str = kmap(ksym, wl.xkb.mods))) {
3394++		len = strlen(str);
3395++		goto send;
3396+ 	}
3397+ 
3398+ 	/* 3. composed string from input method */
3399+ 	if (len == 0)
3400+ 		return;
3401+-	if (len == 1 && e->state & Mod1Mask) {
3402++	if (len == 1 && wl.xkb.mods & MOD_MASK_ALT) {
3403+ 		if (IS_SET(MODE_8BIT)) {
3404+ 			if (*buf < 0177) {
3405+ 				c = *buf | 0x80;
3406+@@ -4294,101 +4111,334 @@ kpress(XEvent *ev)
3407+ 			len = 2;
3408+ 		}
3409+ 	}
3410+-	ttysend(buf, len);
3411++	/* convert character to control character */
3412++	else if (len == 1 && wl.xkb.mods & MOD_MASK_CTRL) {
3413++		if ((*buf >= '@' && *buf < '\177') || *buf == ' ')
3414++			*buf &= 0x1F;
3415++		else if (*buf == '2') *buf = '\000';
3416++		else if (*buf >= '3' && *buf <= '7')
3417++			*buf -= ('3' - '\033');
3418++		else if (*buf == '8') *buf = '\177';
3419++		else if (*buf == '/') *buf = '_' & 0x1F;
3420++	}
3421++
3422++	str = buf;
3423++
3424++send:
3425++	memcpy(repeat.str, str, len);
3426++	repeat.key = key;
3427++	repeat.len = len;
3428++	repeat.started = false;
3429++	clock_gettime(CLOCK_MONOTONIC, &repeat.last);
3430++	ttysend(str, len);
3431+ }
3432+ 
3433++void
3434++kbdmodifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial,
3435++             uint32_t dep, uint32_t lat, uint32_t lck, uint32_t group)
3436++{
3437++	xkb_mod_mask_t mod_mask;
3438++
3439++	xkb_state_update_mask(wl.xkb.state, dep, lat, lck, group, 0, 0);
3440++
3441++	mod_mask = xkb_state_serialize_mods(wl.xkb.state, XKB_STATE_MODS_EFFECTIVE);
3442++	wl.xkb.mods = 0;
3443++
3444++	if (mod_mask & (1 << wl.xkb.ctrl))
3445++		wl.xkb.mods |= MOD_MASK_CTRL;
3446++	if (mod_mask & (1 << wl.xkb.alt))
3447++		wl.xkb.mods |= MOD_MASK_ALT;
3448++	if (mod_mask & (1 << wl.xkb.shift))
3449++		wl.xkb.mods |= MOD_MASK_SHIFT;
3450++	if (mod_mask & (1 << wl.xkb.logo))
3451++		wl.xkb.mods |= MOD_MASK_LOGO;
3452++}
3453+ 
3454+ void
3455+-cmessage(XEvent *e)
3456++kbdrepeatinfo(void *data, struct wl_keyboard *keyboard, int32_t rate,
3457++              int32_t delay)
3458+ {
3459+-	/*
3460+-	 * See xembed specs
3461+-	 *  http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html
3462+-	 */
3463+-	if (e->xclient.message_type == xw.xembed && e->xclient.format == 32) {
3464+-		if (e->xclient.data.l[1] == XEMBED_FOCUS_IN) {
3465+-			xw.state |= WIN_FOCUSED;
3466+-			xseturgency(0);
3467+-		} else if (e->xclient.data.l[1] == XEMBED_FOCUS_OUT) {
3468+-			xw.state &= ~WIN_FOCUSED;
3469++	keyrepeatdelay = delay;
3470++	keyrepeatinterval = 1000 / rate;
3471++}
3472++
3473++void
3474++ptrenter(void *data, struct wl_pointer *pointer, uint32_t serial,
3475++         struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y)
3476++{
3477++	struct wl_cursor_image *img = cursor.cursor->images[0];
3478++	struct wl_buffer *buffer;
3479++
3480++	wl_pointer_set_cursor(pointer, serial, cursor.surface,
3481++			img->hotspot_x, img->hotspot_y);
3482++	buffer = wl_cursor_image_get_buffer(img);
3483++	wl_surface_attach(cursor.surface, buffer, 0, 0);
3484++	wl_surface_damage(cursor.surface, 0, 0, img->width, img->height);
3485++	wl_surface_commit(cursor.surface);
3486++}
3487++
3488++void
3489++ptrleave(void *data, struct wl_pointer *pointer, uint32_t serial,
3490++         struct wl_surface *surface)
3491++{
3492++}
3493++
3494++void
3495++ptrmotion(void *data, struct wl_pointer * pointer, uint32_t serial,
3496++          wl_fixed_t x, wl_fixed_t y)
3497++{
3498++	int oldey, oldex, oldsby, oldsey;
3499++
3500++	if (IS_SET(MODE_MOUSE)) {
3501++		wlmousereportmotion(x, y);
3502++		return;
3503++	}
3504++
3505++	wl.px = wl_fixed_to_int(x);
3506++	wl.py = wl_fixed_to_int(y);
3507++
3508++	if (!sel.mode)
3509++		return;
3510++
3511++	sel.mode = SEL_READY;
3512++	oldey = sel.oe.y;
3513++	oldex = sel.oe.x;
3514++	oldsby = sel.nb.y;
3515++	oldsey = sel.ne.y;
3516++	getbuttoninfo();
3517++
3518++	if (oldey != sel.oe.y || oldex != sel.oe.x)
3519++		tsetdirt(MIN(sel.nb.y, oldsby), MAX(sel.ne.y, oldsey));
3520++}
3521++
3522++void
3523++ptrbutton(void * data, struct wl_pointer * pointer, uint32_t serial,
3524++          uint32_t time, uint32_t button, uint32_t state)
3525++{
3526++	MouseShortcut *ms;
3527++
3528++	if (IS_SET(MODE_MOUSE) && !(wl.xkb.mods & forceselmod)) {
3529++		wlmousereportbutton(button, state);
3530++		return;
3531++	}
3532++
3533++	switch (state) {
3534++	case WL_POINTER_BUTTON_STATE_RELEASED:
3535++		if (button == BTN_MIDDLE) {
3536++			selpaste(NULL);
3537++		} else if (button == BTN_LEFT) {
3538++			if (sel.mode == SEL_READY) {
3539++				getbuttoninfo();
3540++				selcopy(serial);
3541++			} else
3542++				selclear();
3543++			sel.mode = SEL_IDLE;
3544++			tsetdirt(sel.nb.y, sel.ne.y);
3545+ 		}
3546+-	} else if (e->xclient.data.l[0] == xw.wmdeletewin) {
3547+-		/* Send SIGHUP to shell */
3548+-		kill(pid, SIGHUP);
3549+-		exit(0);
3550++		break;
3551++
3552++	case WL_POINTER_BUTTON_STATE_PRESSED:
3553++		for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
3554++			if (button == ms->b && match(ms->mask, wl.xkb.mods)) {
3555++				ttysend(ms->s, strlen(ms->s));
3556++				return;
3557++			}
3558++		}
3559++
3560++		if (button == BTN_LEFT) {
3561++			/* Clear previous selection, logically and visually. */
3562++			selclear();
3563++			sel.mode = SEL_EMPTY;
3564++			sel.type = SEL_REGULAR;
3565++			sel.oe.x = sel.ob.x = x2col(wl.px);
3566++			sel.oe.y = sel.ob.y = y2row(wl.py);
3567++
3568++			/*
3569++			 * If the user clicks below predefined timeouts
3570++			 * specific snapping behaviour is exposed.
3571++			 */
3572++			if (time - sel.tclick2 <= tripleclicktimeout) {
3573++				sel.snap = SNAP_LINE;
3574++			} else if (time - sel.tclick1 <= doubleclicktimeout) {
3575++				sel.snap = SNAP_WORD;
3576++			} else {
3577++				sel.snap = 0;
3578++			}
3579++			selnormalize();
3580++
3581++			if (sel.snap != 0)
3582++				sel.mode = SEL_READY;
3583++			tsetdirt(sel.nb.y, sel.ne.y);
3584++			sel.tclick2 = sel.tclick1;
3585++			sel.tclick1 = time;
3586++		}
3587++		break;
3588+ 	}
3589+ }
3590+ 
3591+ void
3592+-cresize(int width, int height)
3593++ptraxis(void * data, struct wl_pointer * pointer, uint32_t time, uint32_t axis,
3594++        wl_fixed_t value)
3595+ {
3596+-	int col, row;
3597++	Axiskey *ak;
3598++	int dir = value > 0 ? +1 : -1;
3599+ 
3600+-	if (width != 0)
3601+-		xw.w = width;
3602+-	if (height != 0)
3603+-		xw.h = height;
3604++	if (IS_SET(MODE_MOUSE) && !(wl.xkb.mods & forceselmod)) {
3605++		wlmousereportaxis(axis, value);
3606++		return;
3607++	}
3608+ 
3609+-	col = (xw.w - 2 * borderpx) / xw.cw;
3610+-	row = (xw.h - 2 * borderpx) / xw.ch;
3611++	for (ak = ashortcuts; ak < ashortcuts + LEN(ashortcuts); ak++) {
3612++		if (axis == ak->axis && dir == ak->dir
3613++				&& match(ak->mask, wl.xkb.mods)) {
3614++			ttysend(ak->s, strlen(ak->s));
3615++			return;
3616++		}
3617++	}
3618++}
3619+ 
3620+-	tresize(col, row);
3621+-	xresize(col, row);
3622++void
3623++wmping(void *data, struct xdg_wm_base *wm, uint32_t serial)
3624++{
3625++	xdg_wm_base_pong(wm, serial);
3626++}
3627++
3628++void
3629++xdgsurfconfigure(void *data, struct xdg_surface *surf, uint32_t serial)
3630++{
3631++	xdg_surface_ack_configure(surf, serial);
3632+ }
3633+ 
3634+ void
3635+-resize(XEvent *e)
3636++toplevelconfigure(void *data, struct xdg_toplevel *toplevel, int32_t w, int32_t h,
3637++                  struct wl_array *states)
3638+ {
3639+-	if (e->xconfigure.width == xw.w && e->xconfigure.height == xw.h)
3640++	if (w == wl.w && h == wl.h)
3641+ 		return;
3642++	cresize(w, h);
3643++	if (wl.configured)
3644++		ttyresize();
3645++	else
3646++		wl.configured = true;
3647++}
3648+ 
3649+-	cresize(e->xconfigure.width, e->xconfigure.height);
3650+-	ttyresize();
3651++void
3652++toplevelclose(void *data, struct xdg_toplevel *toplevel)
3653++{
3654++	/* Send SIGHUP to shell */
3655++	kill(pid, SIGHUP);
3656++	exit(0);
3657++}
3658++
3659++void
3660++datadevoffer(void *data, struct wl_data_device *datadev,
3661++             struct wl_data_offer *offer)
3662++{
3663++	wl_data_offer_add_listener(offer, &dataofferlistener, NULL);
3664++}
3665++
3666++void
3667++datadeventer(void *data, struct wl_data_device *datadev, uint32_t serial,
3668++		struct wl_surface *surf, wl_fixed_t x, wl_fixed_t y,
3669++		struct wl_data_offer *offer)
3670++{
3671++}
3672++
3673++void
3674++datadevleave(void *data, struct wl_data_device *datadev)
3675++{
3676++}
3677++
3678++void
3679++datadevmotion(void *data, struct wl_data_device *datadev, uint32_t time,
3680++              wl_fixed_t x, wl_fixed_t y)
3681++{
3682++}
3683++
3684++void
3685++datadevdrop(void *data, struct wl_data_device *datadev)
3686++{
3687++}
3688++
3689++void
3690++datadevselection(void *data, struct wl_data_device *datadev,
3691++                 struct wl_data_offer *offer)
3692++{
3693++	if (offer && (uintptr_t) wl_data_offer_get_user_data(offer) == 1)
3694++		wl.seloffer = offer;
3695++	else
3696++		wl.seloffer = NULL;
3697++}
3698++
3699++void
3700++dataofferoffer(void *data, struct wl_data_offer *offer, const char *mimetype)
3701++{
3702++	/* mark the offer as usable if it supports plain text */
3703++	if (strncmp(mimetype, "text/plain", 10) == 0)
3704++		wl_data_offer_set_user_data(offer, (void *)(uintptr_t) 1);
3705++}
3706++
3707++void
3708++datasrctarget(void *data, struct wl_data_source *source, const char *mimetype)
3709++{
3710++}
3711++
3712++void
3713++datasrcsend(void *data, struct wl_data_source *source, const char *mimetype,
3714++            int32_t fd)
3715++{
3716++	char *buf = sel.primary;
3717++	int len = strlen(sel.primary);
3718++	ssize_t ret;
3719++	while ((ret = write(fd, buf, MIN(len, BUFSIZ))) > 0) {
3720++		len -= ret;
3721++		buf += ret;
3722++	}
3723++	close(fd);
3724++}
3725++
3726++void
3727++datasrccancelled(void *data, struct wl_data_source *source)
3728++{
3729++	if (sel.source == source) {
3730++		sel.source = NULL;
3731++		selclear();
3732++	}
3733++	wl_data_source_destroy(source);
3734+ }
3735+ 
3736+ void
3737+ run(void)
3738+ {
3739+-	XEvent ev;
3740+-	int w = xw.w, h = xw.h;
3741+ 	fd_set rfd;
3742+-	int xfd = XConnectionNumber(xw.dpy), xev, blinkset = 0, dodraw = 0;
3743++	int wlfd = wl_display_get_fd(wl.dpy), blinkset = 0;
3744+ 	struct timespec drawtimeout, *tv = NULL, now, last, lastblink;
3745+-	long deltatime;
3746++	ulong msecs;
3747+ 
3748+-	/* Waiting for window mapping */
3749+-	do {
3750+-		XNextEvent(xw.dpy, &ev);
3751+-		/*
3752+-		 * This XFilterEvent call is required because of XOpenIM. It
3753+-		 * does filter out the key event and some client message for
3754+-		 * the input method too.
3755+-		 */
3756+-		if (XFilterEvent(&ev, None))
3757+-			continue;
3758+-		if (ev.type == ConfigureNotify) {
3759+-			w = ev.xconfigure.width;
3760+-			h = ev.xconfigure.height;
3761+-		}
3762+-	} while (ev.type != MapNotify);
3763+-
3764+-	cresize(w, h);
3765+ 	ttynew();
3766+-	ttyresize();
3767++
3768++	/* Look for initial configure. */
3769++	wl_display_roundtrip(wl.dpy);
3770++	if (!wl.configured) {
3771++		cresize(wl.w, wl.h);
3772++		ttyresize();
3773++	}
3774++	draw();
3775+ 
3776+ 	clock_gettime(CLOCK_MONOTONIC, &last);
3777+ 	lastblink = last;
3778+ 
3779+-	for (xev = actionfps;;) {
3780++	for (;;) {
3781+ 		FD_ZERO(&rfd);
3782+ 		FD_SET(cmdfd, &rfd);
3783+-		FD_SET(xfd, &rfd);
3784++		FD_SET(wlfd, &rfd);
3785+ 
3786+-		if (pselect(MAX(xfd, cmdfd)+1, &rfd, NULL, NULL, tv, NULL) < 0) {
3787++		if (pselect(MAX(wlfd, cmdfd)+1, &rfd, NULL, NULL, tv, NULL) < 0) {
3788+ 			if (errno == EINTR)
3789+ 				continue;
3790+ 			die("select failed: %s\n", strerror(errno));
3791+ 		}
3792++
3793+ 		if (FD_ISSET(cmdfd, &rfd)) {
3794+ 			ttyread();
3795+ 			if (blinktimeout) {
3796+@@ -4398,60 +4448,54 @@ run(void)
3797+ 			}
3798+ 		}
3799+ 
3800+-		if (FD_ISSET(xfd, &rfd))
3801+-			xev = actionfps;
3802++		if (FD_ISSET(wlfd, &rfd)) {
3803++			if (wl_display_dispatch(wl.dpy) == -1)
3804++				die("Connection error\n");
3805++		}
3806+ 
3807+ 		clock_gettime(CLOCK_MONOTONIC, &now);
3808+-		drawtimeout.tv_sec = 0;
3809+-		drawtimeout.tv_nsec =  (1000 * 1E6)/ xfps;
3810+-		tv = &drawtimeout;
3811+-
3812+-		dodraw = 0;
3813+-		if (blinktimeout && TIMEDIFF(now, lastblink) > blinktimeout) {
3814+-			tsetdirtattr(ATTR_BLINK);
3815+-			term.mode ^= MODE_BLINK;
3816+-			lastblink = now;
3817+-			dodraw = 1;
3818++		msecs = -1;
3819++
3820++		if (blinkset && blinktimeout) {
3821++			if (TIMEDIFF(now, lastblink) >= blinktimeout) {
3822++				tsetdirtattr(ATTR_BLINK);
3823++				term.mode ^= MODE_BLINK;
3824++				lastblink = now;
3825++			} else {
3826++				msecs = MIN(msecs, blinktimeout - \
3827++						TIMEDIFF(now, lastblink));
3828++			}
3829+ 		}
3830+-		deltatime = TIMEDIFF(now, last);
3831+-		if (deltatime > 1000 / (xev ? xfps : actionfps)) {
3832+-			dodraw = 1;
3833+-			last = now;
3834++		if (repeat.len > 0) {
3835++			if (TIMEDIFF(now, repeat.last) >= \
3836++				(repeat.started ? keyrepeatinterval : \
3837++					keyrepeatdelay)) {
3838++				repeat.started = true;
3839++				repeat.last = now;
3840++				ttysend(repeat.str, repeat.len);
3841++			} else {
3842++				msecs = MIN(msecs, (repeat.started ? \
3843++					keyrepeatinterval : keyrepeatdelay) - \
3844++					TIMEDIFF(now, repeat.last));
3845++			}
3846+ 		}
3847+ 
3848+-		if (dodraw) {
3849+-			while (XPending(xw.dpy)) {
3850+-				XNextEvent(xw.dpy, &ev);
3851+-				if (XFilterEvent(&ev, None))
3852+-					continue;
3853+-				if (handler[ev.type])
3854+-					(handler[ev.type])(&ev);
3855++		if (needdraw && wl.state & WIN_VISIBLE) {
3856++			if (!wl.framecb) {
3857++				draw();
3858+ 			}
3859++		}
3860+ 
3861+-			draw();
3862+-			XFlush(xw.dpy);
3863+-
3864+-			if (xev && !FD_ISSET(xfd, &rfd))
3865+-				xev--;
3866+-			if (!FD_ISSET(cmdfd, &rfd) && !FD_ISSET(xfd, &rfd)) {
3867+-				if (blinkset) {
3868+-					if (TIMEDIFF(now, lastblink) \
3869+-							> blinktimeout) {
3870+-						drawtimeout.tv_nsec = 1000;
3871+-					} else {
3872+-						drawtimeout.tv_nsec = (1E6 * \
3873+-							(blinktimeout - \
3874+-							TIMEDIFF(now,
3875+-								lastblink)));
3876+-					}
3877+-					drawtimeout.tv_sec = \
3878+-					    drawtimeout.tv_nsec / 1E9;
3879+-					drawtimeout.tv_nsec %= (long)1E9;
3880+-				} else {
3881+-					tv = NULL;
3882+-				}
3883+-			}
3884++		if (msecs == -1) {
3885++			tv = NULL;
3886++		} else {
3887++			drawtimeout.tv_nsec = 1E6 * msecs;
3888++			drawtimeout.tv_sec = 0;
3889++			tv = &drawtimeout;
3890+ 		}
3891++
3892++		wl_display_dispatch_pending(wl.dpy);
3893++		wl_display_flush(wl.dpy);
3894+ 	}
3895+ }
3896+ 
3897+@@ -4471,9 +4515,7 @@ usage(void)
3898+ int
3899+ main(int argc, char *argv[])
3900+ {
3901+-	xw.l = xw.t = 0;
3902+-	xw.isfixed = False;
3903+-	xw.cursor = cursorshape;
3904++	wl.cursor = cursorshape;
3905+ 
3906+ 	ARGBEGIN {
3907+ 	case 'a':
3908+@@ -4489,13 +4531,6 @@ main(int argc, char *argv[])
3909+ 	case 'f':
3910+ 		opt_font = EARGF(usage());
3911+ 		break;
3912+-	case 'g':
3913+-		xw.gm = XParseGeometry(EARGF(usage()),
3914+-				&xw.l, &xw.t, &cols, &rows);
3915+-		break;
3916+-	case 'i':
3917+-		xw.isfixed = 1;
3918+-		break;
3919+ 	case 'o':
3920+ 		opt_io = EARGF(usage());
3921+ 		break;
3922+@@ -4527,9 +4562,8 @@ run:
3923+ 			opt_title = basename(xstrdup(argv[0]));
3924+ 	}
3925+ 	setlocale(LC_CTYPE, "");
3926+-	XSetLocaleModifiers("");
3927+ 	tnew(MAX(cols, 1), MAX(rows, 1));
3928+-	xinit();
3929++	wlinit();
3930+ 	selinit();
3931+ 	run();
3932+ 
3933+-- 
3934+2.37.3
3935+
+31, -0
 1@@ -0,0 +1,31 @@
 2+From 6ee6144c159551d45f0e02a87b5635c29e48fbbf Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Sat, 22 Feb 2020 17:17:01 -0800
 5+Subject: [PATCH] Only send SIGHUP on close when using PTY
 6+
 7+Otherwise, pid is at its default value (0), so SIGHUP gets sent to
 8+the entire process group.
 9+---
10+ st.c | 6 ++++--
11+ 1 file changed, 4 insertions(+), 2 deletions(-)
12+
13+diff --git a/st.c b/st.c
14+index 913c71b..20a3c3c 100644
15+--- a/st.c
16++++ b/st.c
17+@@ -4325,8 +4325,10 @@ toplevelconfigure(void *data, struct xdg_toplevel *toplevel, int32_t w, int32_t
18+ void
19+ toplevelclose(void *data, struct xdg_toplevel *toplevel)
20+ {
21+-	/* Send SIGHUP to shell */
22+-	kill(pid, SIGHUP);
23++	if (pid) {
24++		/* Send SIGHUP to shell */
25++		kill(pid, SIGHUP);
26++	}
27+ 	exit(0);
28+ }
29+ 
30+-- 
31+2.37.3
32+
+172, -0
  1@@ -0,0 +1,172 @@
  2+From 85a6bb6ba81de493c0ceb9a8d4c2f78eb5d1567f Mon Sep 17 00:00:00 2001
  3+From: Michael Forney <mforney@mforney.org>
  4+Date: Wed, 2 Dec 2020 17:54:35 -0800
  5+Subject: [PATCH] Add support for plumbing via right click
  6+
  7+---
  8+ config.def.h |  5 ++++
  9+ st.c         | 79 ++++++++++++++++++++++++++++++++++++++++++++--------
 10+ 2 files changed, 72 insertions(+), 12 deletions(-)
 11+
 12+diff --git a/config.def.h b/config.def.h
 13+index 49ca50b..a63d2be 100644
 14+--- a/config.def.h
 15++++ b/config.def.h
 16+@@ -460,3 +460,8 @@ static char ascii_printable[] =
 17+ 	"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
 18+ 	"`abcdefghijklmnopqrstuvwxyz{|}~";
 19+ 
 20++/*
 21++ * plumb_cmd is run on mouse button 3 click, with first NULL set to
 22++ * current selection and with cwd set to the cwd of the active shell
 23++ */
 24++static char *plumb_cmd[] = {"plumb", NULL, NULL};
 25+diff --git a/st.c b/st.c
 26+index 20a3c3c..914fdd5 100644
 27+--- a/st.c
 28++++ b/st.c
 29+@@ -44,6 +44,9 @@ char *argv0;
 30+ #elif defined(__FreeBSD__) || defined(__DragonFly__)
 31+  #include <libutil.h>
 32+ #endif
 33++#if defined(__OpenBSD__)
 34++ #include <sys/sysctl.h>
 35++#endif
 36+ 
 37+ 
 38+ /* Arbitrary sizes */
 39+@@ -558,6 +561,8 @@ static void *xmalloc(size_t);
 40+ static void *xrealloc(void *, size_t);
 41+ static char *xstrdup(char *);
 42+ 
 43++static int subprocwd(char *, size_t);
 44++
 45+ static void usage(void);
 46+ 
 47+ static struct wl_registry_listener reglistener = { regglobal, regglobalremove };
 48+@@ -579,6 +584,7 @@ static struct wl_data_source_listener datasrclistener =
 49+ 	{ datasrctarget, datasrcsend, datasrccancelled };
 50+ 
 51+ /* Globals */
 52++static int plumbsel;
 53+ static DC dc;
 54+ static Wayland wl;
 55+ static WLD wld;
 56+@@ -763,6 +769,21 @@ utf8validate(Rune *u, size_t i)
 57+ 	return i;
 58+ }
 59+ 
 60++int
 61++subprocwd(char *path, size_t len)
 62++{
 63++#if defined(__linux__)
 64++	if (snprintf(path, len, "/proc/%d/cwd", pid) < 0)
 65++		return -1;
 66++	return 0;
 67++#elif defined(__OpenBSD__)
 68++	int name[3] = {CTL_KERN, KERN_PROC_CWD, pid};
 69++	if (sysctl(name, 3, path, &len, 0, 0) == -1)
 70++		return -1;
 71++	return 0;
 72++#endif
 73++}
 74++
 75+ void
 76+ selinit(void)
 77+ {
 78+@@ -1165,6 +1186,29 @@ wlsetsel(char *str, uint32_t serial)
 79+ 	wl_data_device_set_selection(wl.datadev, sel.source, serial);
 80+ }
 81+ 
 82++void
 83++plumbinit(void)
 84++{
 85++	for (plumbsel = 0; plumb_cmd[plumbsel]; ++plumbsel)
 86++		;
 87++}
 88++
 89++void
 90++plumb(char *sel)
 91++{
 92++	char cwd[PATH_MAX];
 93++
 94++	if (!sel || subprocwd(cwd, sizeof(cwd)) != 0)
 95++		return;
 96++	plumb_cmd[plumbsel] = sel;
 97++
 98++	if (fork() == 0) {
 99++		if (chdir(cwd) == 0)
100++			execvp(plumb_cmd[0], plumb_cmd);
101++		_exit(1);
102++	}
103++}
104++
105+ void
106+ die(const char *errstr, ...)
107+ {
108+@@ -1227,15 +1271,18 @@ sigchld(int a)
109+ 	int stat;
110+ 	pid_t p;
111+ 
112+-	if ((p = waitpid(pid, &stat, WNOHANG)) < 0)
113+-		die("Waiting for pid %hd failed: %s\n", pid, strerror(errno));
114+-
115+-	if (pid != p)
116+-		return;
117+-
118+-	if (!WIFEXITED(stat) || WEXITSTATUS(stat))
119+-		die("child finished with error '%d'\n", stat);
120+-	exit(0);
121++	for (;;) {
122++		p = waitpid(-1, &stat, WNOHANG);
123++		if (p == 0)
124++			break;
125++		if (p < 0)
126++			die("waitpid: %s\n", strerror(errno));
127++		if (pid == p) {
128++			if (!WIFEXITED(stat) || WEXITSTATUS(stat))
129++				die("child finished with error '%d'\n", stat);
130++			exit(0);
131++		}
132++	}
133+ }
134+ 
135+ 
136+@@ -4224,16 +4271,23 @@ ptrbutton(void * data, struct wl_pointer * pointer, uint32_t serial,
137+ 
138+ 	switch (state) {
139+ 	case WL_POINTER_BUTTON_STATE_RELEASED:
140+-		if (button == BTN_MIDDLE) {
141++		switch (button) {
142++		case BTN_MIDDLE:
143+ 			selpaste(NULL);
144+-		} else if (button == BTN_LEFT) {
145++			break;
146++		case BTN_LEFT:
147+ 			if (sel.mode == SEL_READY) {
148+ 				getbuttoninfo();
149+ 				selcopy(serial);
150+-			} else
151++			} else {
152+ 				selclear();
153++			}
154+ 			sel.mode = SEL_IDLE;
155+ 			tsetdirt(sel.nb.y, sel.ne.y);
156++			break;
157++		case BTN_RIGHT:
158++			plumb(sel.primary);
159++			break;
160+ 		}
161+ 		break;
162+ 
163+@@ -4557,6 +4611,7 @@ main(int argc, char *argv[])
164+ 	} ARGEND;
165+ 
166+ run:
167++	plumbinit();
168+ 	if (argc > 0) {
169+ 		/* eat all remaining arguments */
170+ 		opt_cmd = argv;
171+-- 
172+2.37.3
173+
+25, -0
 1@@ -0,0 +1,25 @@
 2+From 1c67839b8a0eb410cef454b289405b6de3b7500f Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Mon, 29 Mar 2021 18:21:29 -0700
 5+Subject: [PATCH] Start dmenu on bottom for ISO 14755 input
 6+
 7+---
 8+ st.c | 2 +-
 9+ 1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+diff --git a/st.c b/st.c
12+index 02d5397..a319c7f 100644
13+--- a/st.c
14++++ b/st.c
15+@@ -97,7 +97,7 @@ char *argv0;
16+ #define TRUEBLUE(x)		(((x) & 0xff) << 8)
17+ 
18+ /* constants */
19+-#define ISO14755CMD		"dmenu -p codepoint: </dev/null"
20++#define ISO14755CMD		"dmenu -b -p codepoint: </dev/null"
21+ 
22+ enum glyph_attribute {
23+ 	ATTR_NULL       = 0,
24+-- 
25+2.30.1
26+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit c63a87cd936c1eeef14c4c21572e5b782d3df4bc
+1, -0
1@@ -0,0 +1 @@
2+c63a87cd93 r7
+1, -0
1@@ -0,0 +1 @@
2+/tools.ninja
+120, -0
  1@@ -0,0 +1,120 @@
  2+cflags{
  3+	'-Wall',
  4+	'-D _GNU_SOURCE',
  5+	'-D screen_new=swc__screen_new',
  6+	'-D remove_resource=swc__remove_resource',
  7+	'-I $outdir',
  8+	'-I $outdir/include',
  9+	'-I $srcdir',
 10+	'-isystem $builddir/pkg/fontconfig/include',
 11+	'-isystem $builddir/pkg/libinput/include',
 12+	'-isystem $builddir/pkg/libxkbcommon/include',
 13+	'-isystem $builddir/pkg/libdrm/include',
 14+	'-isystem $builddir/pkg/linux-headers/include',
 15+	'-isystem $builddir/pkg/pixman/include',
 16+	'-isystem $builddir/pkg/wayland-protocols/include',
 17+	'-isystem $builddir/pkg/wayland/include',
 18+	'-isystem $builddir/pkg/wld/include',
 19+}
 20+
 21+cc('launch/protocol.c')
 22+
 23+waylandproto('protocol/swc.xml', {
 24+	client='include/swc-client-protocol.h',
 25+	server='include/swc-server-protocol.h',
 26+	code='swc-protocol.c',
 27+})
 28+
 29+waylandproto('protocol/server-decoration.xml', {
 30+	server='include/server-decoration-server-protocol.h',
 31+	code='server-decoration-protocol.c',
 32+})
 33+
 34+pkg.hdrs = {
 35+	copy('$outdir/include', '$srcdir/libswc', {'swc.h'}),
 36+	'$outdir/include/server-decoration-server-protocol.h',
 37+	'$outdir/include/swc-client-protocol.h',
 38+	'$outdir/include/swc-server-protocol.h',
 39+}
 40+
 41+copy('$outdir', '$builddir/pkg/wld/protocol', {'wayland-drm-server-protocol.h'})
 42+
 43+sub('tools.ninja', function()
 44+	toolchain(config.host)
 45+	cflags{'-std=c99', '-D _POSIX_C_SOURCE=200809L'}
 46+	exe('convert_font', {'cursor/convert_font.c'})
 47+end)
 48+
 49+rule('convert_font', '$outdir/convert_font $in $out 2>/dev/null')
 50+build('convert_font', '$outdir/cursor/cursor_data.h', {'$srcdir/cursor/cursor.pcf', '|', '$outdir/convert_font'})
 51+
 52+pkg.deps = {
 53+	'$outdir/wayland-drm-server-protocol.h',
 54+	'$outdir/include/swc-server-protocol.h',
 55+	'$outdir/cursor/cursor_data.h',
 56+	'pkg/fontconfig/headers',
 57+	'pkg/libdrm/headers',
 58+	'pkg/libinput/headers',
 59+	'pkg/libxkbcommon/headers',
 60+	'pkg/linux-headers/headers',
 61+	'pkg/pixman/headers',
 62+	'pkg/wayland/headers',
 63+	'pkg/wayland-protocols/headers',
 64+	'pkg/wld/headers',
 65+}
 66+
 67+lib('libswc.a', [[
 68+	libswc/(
 69+		bindings.c
 70+		compositor.c
 71+		data.c
 72+		data_device.c
 73+		data_device_manager.c
 74+		dmabuf.c
 75+		drm.c
 76+		input.c
 77+		kde_decoration.c
 78+		keyboard.c
 79+		launch.c
 80+		mode.c
 81+		output.c
 82+		panel.c
 83+		panel_manager.c
 84+		plane.c
 85+		pointer.c
 86+		primary_plane.c
 87+		region.c
 88+		screen.c
 89+		shell.c
 90+		shell_surface.c
 91+		seat.c
 92+		shm.c
 93+		subcompositor.c
 94+		subsurface.c
 95+		surface.c
 96+		swc.c
 97+		util.c
 98+		view.c
 99+		wayland_buffer.c
100+		window.c
101+		xdg_decoration.c
102+		xdg_shell.c
103+	)
104+	launch/protocol.c.o
105+	server-decoration-protocol.c.o
106+	swc-protocol.c.o
107+	$builddir/(
108+		pkg/libinput/libinput.a.d
109+		pkg/libxkbcommon/libxkbcommon.a
110+		pkg/wayland-protocols/xdg-decoration-unstable-v1-protocol.c.o
111+		pkg/wayland-protocols/xdg-shell-protocol.c.o
112+		pkg/wayland-protocols/linux-dmabuf-unstable-v1-protocol.c.o
113+		pkg/wayland/libwayland-server.a.d
114+		pkg/wld/libwld.a.d
115+	)
116+]])
117+
118+exe('swc-launch', {'launch/launch.c', 'launch/devmajor-linux.c', 'launch/protocol.c.o', '$builddir/pkg/libdrm/libdrm.a'})
119+file('bin/swc-launch', '4755', '$outdir/swc-launch')
120+
121+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 19893a5ca3239082b904a04fdb9ac7c3a1fb62e2
+1, -0
1@@ -0,0 +1 @@
2+19893a5ca3 r0
+2, -0
1@@ -0,0 +1,2 @@
2+/Tamzen-1.11.6.tar.gz
3+/src
+38, -0
 1@@ -0,0 +1,38 @@
 2+local fonts = {
 3+	'Tamzen10x20b',
 4+	'Tamzen10x20r',
 5+	'Tamzen5x9b',
 6+	'Tamzen5x9r',
 7+	'Tamzen6x12b',
 8+	'Tamzen6x12r',
 9+	'Tamzen7x13b',
10+	'Tamzen7x13r',
11+	'Tamzen7x14b',
12+	'Tamzen7x14r',
13+	'Tamzen8x15b',
14+	'Tamzen8x15r',
15+	'Tamzen8x16b',
16+	'Tamzen8x16r',
17+	'TamzenForPowerline10x20b',
18+	'TamzenForPowerline10x20r',
19+	'TamzenForPowerline5x9b',
20+	'TamzenForPowerline5x9r',
21+	'TamzenForPowerline6x12b',
22+	'TamzenForPowerline6x12r',
23+	'TamzenForPowerline7x13b',
24+	'TamzenForPowerline7x13r',
25+	'TamzenForPowerline7x14b',
26+	'TamzenForPowerline7x14r',
27+	'TamzenForPowerline8x15b',
28+	'TamzenForPowerline8x15r',
29+	'TamzenForPowerline8x16b',
30+	'TamzenForPowerline8x16r',
31+}
32+
33+for _, font in ipairs(fonts) do
34+	local path = ('share/fonts/%s.ttf'):format(font)
35+	local src = ('$srcdir/ttf/%s.ttf'):format(font)
36+	file(path, '644', src)
37+end
38+
39+fetch 'curl'
+1, -0
1@@ -0,0 +1 @@
2+f35173177f9407bb78e48a93169f1981ae5c945d51fef6e4eeae85c1c9192577  Tamzen-1.11.6.tar.gz
+1, -0
1@@ -0,0 +1 @@
2+url ="https://github.com/sunaku/tamzen-font/archive/refs/tags/Tamzen-1.11.6.tar.gz"
+1, -0
1@@ -0,0 +1 @@
2+1.11.6 r0
+7, -0
1@@ -0,0 +1,7 @@
2+cflags{'-std=c99', '-Wall', '-Wpedantic'}
3+
4+pkg.hdrs = copy('$outdir/include', '$srcdir', {'utf8proc.h'})
5+
6+lib('libutf8proc.a', {'utf8proc.c'})
7+
8+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 8ca6144c85c165987cb1c5d8395c7314e13d4cd7
+1, -0
1@@ -0,0 +1 @@
2+2.7.0 r0
+60, -0
 1@@ -0,0 +1,60 @@
 2+cflags{
 3+	string.format([[-D 'VELOX_LIBEXEC="%s/libexec/velox"']], config.prefix),
 4+	'-I $outdir',
 5+	'-isystem $builddir/pkg/fontconfig/include',
 6+	'-isystem $builddir/pkg/libinput/include',
 7+	'-isystem $builddir/pkg/libxkbcommon/include',
 8+	'-isystem $builddir/pkg/linux-headers/include',
 9+	'-isystem $builddir/pkg/pixman/include',
10+	'-isystem $builddir/pkg/swc/include',
11+	'-isystem $builddir/pkg/wayland/include',
12+	'-isystem $builddir/pkg/wld/include',
13+}
14+
15+waylandproto('protocol/velox.xml', {
16+	client='protocol/velox-client-protocol.h',
17+	server='protocol/velox-server-protocol.h',
18+	code='velox-protocol.c',
19+})
20+build('copy', '$outdir/protocol/swc-client-protocol.h', '$builddir/pkg/swc/include/swc-client-protocol.h')
21+
22+pkg.deps = {
23+	'$outdir/protocol/swc-client-protocol.h',
24+	'$outdir/protocol/velox-client-protocol.h',
25+	'$outdir/protocol/velox-server-protocol.h',
26+	'pkg/fontconfig/headers',
27+	'pkg/libinput/headers',
28+	'pkg/libxkbcommon/headers',
29+	'pkg/linux-headers/headers',
30+	'pkg/pixman/headers',
31+	'pkg/swc/headers',
32+	'pkg/wayland/headers',
33+	'pkg/wld/headers',
34+}
35+
36+exe('velox', {
37+	'config.c',
38+	'layout.c',
39+	'screen.c',
40+	'tag.c',
41+	'util.c',
42+	'velox.c',
43+	'velox-protocol.c.o',
44+	'window.c',
45+	'$builddir/pkg/swc/libswc.a.d',
46+	'$builddir/pkg/wayland/libwayland-server.a.d',
47+})
48+file('bin/velox', '755', '$outdir/velox')
49+
50+exe('status_bar', {
51+	'clients/status_bar.c',
52+	'velox-protocol.c.o',
53+	'$builddir/pkg/swc/swc-protocol.c.o',
54+	'$builddir/pkg/wld/libwld.a.d',
55+	'$builddir/pkg/wayland/libwayland-client.a.d',
56+})
57+file('libexec/velox/status_bar', '755', '$outdir/status_bar')
58+
59+file('share/doc/velox/velox.conf.sample', '644', '$srcdir/velox.conf.sample')
60+
61+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 2ae5e99dfcccfc10f98b3e1a697201db4a8676f8
+1, -0
1@@ -0,0 +1 @@
2+2ae5e99dfc r0
+75, -0
 1@@ -0,0 +1,75 @@
 2+cflags{'-isystem $builddir/pkg/wayland/include'}
 3+
 4+waylandproto('stable/presentation-time/presentation-time.xml', {
 5+	client='include/presentation-time-client-protocol.h',
 6+	code='presentation-time-protocol.c',
 7+})
 8+
 9+waylandproto('stable/viewporter/viewporter.xml', {
10+	client='include/viewporter-client-protocol.h',
11+	code='viewporter-protocol.c',
12+})
13+
14+waylandproto('stable/xdg-shell/xdg-shell.xml', {
15+	client='include/xdg-shell-client-protocol.h',
16+	server='include/xdg-shell-server-protocol.h',
17+	code='xdg-shell-protocol.c',
18+})
19+
20+waylandproto('unstable/idle-inhibit/idle-inhibit-unstable-v1.xml', {
21+	client='include/idle-inhibit-unstable-v1-client-protocol.h',
22+	server='include/idle-inhibit-unstable-v1-server-protocol.h',
23+	code='idle-inhibit-unstable-v1-protocol.c'
24+})
25+
26+waylandproto('unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml', {
27+	client='include/linux-dmabuf-unstable-v1-client-protocol.h',
28+	server='include/linux-dmabuf-unstable-v1-server-protocol.h',
29+	code='linux-dmabuf-unstable-v1-protocol.c',
30+})
31+
32+waylandproto('unstable/xdg-decoration/xdg-decoration-unstable-v1.xml', {
33+	client='include/xdg-decoration-unstable-v1-client-protocol.h',
34+	server='include/xdg-decoration-unstable-v1-server-protocol.h',
35+	code='xdg-decoration-unstable-v1-protocol.c',
36+})
37+
38+waylandproto('unstable/text-input/text-input-unstable-v3.xml', {
39+	client='include/text-input-unstable-v3-client-protocol.h',
40+	server='include/text-input-unstable-v3-server-protocol.h',
41+	code='text-input-unstable-v3-protocol.c',
42+})
43+
44+waylandproto('staging/content-type/content-type-v1.xml', {
45+	client='include/content-type-v1-client-protocol.h',
46+	server='include/content-type-v1-server-protocol.h',
47+	code='content-type-v1-protocol.c',
48+})
49+
50+waylandproto('staging/fractional-scale/fractional-scale-v1.xml', {
51+	client='include/fractional-scale-v1-client-protocol.h',
52+	server='include/fractional-scale-v1-server-protocol.h',
53+	code='fractional-scale-v1-protocol.c',
54+})
55+
56+waylandproto('staging/single-pixel-buffer/single-pixel-buffer-v1.xml', {
57+	client='include/single-pixel-buffer-v1-client-protocol.h',
58+	server='include/single-pixel-buffer-v1-server-protocol.h',
59+	code='single-pixel-buffer-v1-protocol.c',
60+})
61+
62+pkg.hdrs = {
63+	'$outdir/include/presentation-time-client-protocol.h',
64+	'$outdir/include/xdg-shell-client-protocol.h',
65+	'$outdir/include/xdg-shell-server-protocol.h',
66+	'$outdir/include/idle-inhibit-unstable-v1-client-protocol.h',
67+	'$outdir/include/idle-inhibit-unstable-v1-server-protocol.h',
68+	'$outdir/include/linux-dmabuf-unstable-v1-client-protocol.h',
69+	'$outdir/include/linux-dmabuf-unstable-v1-server-protocol.h',
70+	'$outdir/include/xdg-decoration-unstable-v1-client-protocol.h',
71+	'$outdir/include/xdg-decoration-unstable-v1-server-protocol.h',
72+	'$outdir/include/text-input-unstable-v3-client-protocol.h',
73+	'$outdir/include/text-input-unstable-v3-server-protocol.h',
74+}
75+
76+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 4624cfaaf563cd7be5e2e2087c8de6d3a48ea867
+1, -0
1@@ -0,0 +1 @@
2+1.31 r0
+6, -0
1@@ -0,0 +1,6 @@
2+# wayland
3+
4+## config.h
5+Generated with
6+
7+	meson -Ddocumentation=false build
+14, -0
 1@@ -0,0 +1,14 @@
 2+#define HAVE_ACCEPT4
 3+#define HAVE_BROKEN_MSG_CMSG_CLOEXEC 0
 4+#define HAVE_MEMFD_CREATE
 5+#define HAVE_MKOSTEMP
 6+#define HAVE_MREMAP
 7+#define HAVE_POSIX_FALLOCATE
 8+#define HAVE_PRCTL
 9+#define HAVE_STRNDUP
10+#define HAVE_SYS_PRCTL_H
11+#undef HAVE_SYS_PROCCTL_H
12+#undef HAVE_SYS_UCRED_H
13+#define HAVE_XUCRED_CR_PID 0
14+#define PACKAGE "wayland"
15+#define PACKAGE_VERSION "1.21.0"
+90, -0
 1@@ -0,0 +1,90 @@
 2+cflags{
 3+	'-I $dir',
 4+	'-I $outdir/include',
 5+	'-I $srcdir',
 6+	'-I $srcdir/src',
 7+	'-isystem $builddir/pkg/expat/include',
 8+	'-isystem $builddir/pkg/libffi/include',
 9+}
10+
11+build('sed', '$outdir/include/wayland-version.h', '$srcdir/src/wayland-version.h.in', {
12+	expr={
13+		'-e s,@WAYLAND_VERSION_MAJOR@,1,',
14+		'-e s,@WAYLAND_VERSION_MINOR@,21,',
15+		'-e s,@WAYLAND_VERSION_MICRO@,0,',
16+		'-e s,@WAYLAND_VERSION@,1.21.0,',
17+	},
18+})
19+
20+waylandproto('protocol/wayland.xml', {
21+	client='include/wayland-client-protocol.h',
22+	server='include/wayland-server-protocol.h',
23+	code='src/wayland-protocol.c'
24+})
25+
26+pkg.hdrs = {
27+	copy('$outdir/include', '$srcdir/src', {
28+		'wayland-client-core.h',
29+		'wayland-client.h',
30+		'wayland-server-core.h',
31+		'wayland-server.h',
32+		'wayland-util.h',
33+	}),
34+	copy('$outdir/include', '$srcdir/cursor', {'wayland-cursor.h'}),
35+	'$outdir/include/wayland-client-protocol.h',
36+	'$outdir/include/wayland-server-protocol.h',
37+	'$outdir/include/wayland-version.h',
38+}
39+pkg.deps = {
40+	'$gendir/headers',
41+	'$outdir/include/wayland-version.h',
42+	'pkg/libffi/headers',
43+}
44+
45+cc('src/wayland-util.c', {'$outdir/include/wayland-version.h'})
46+cc('src/wayland-os.c')
47+cc('src/connection.c')
48+
49+exe('wayland-scanner', [[
50+	src/(
51+		scanner.c
52+		wayland-util.c.o
53+	)
54+	$builddir/pkg/expat/libexpat.a.d
55+]], {'pkg/expat/headers', '$outdir/include/wayland-version.h'})
56+file('bin/wayland-scanner', '755', '$outdir/wayland-scanner')
57+
58+lib('libwayland-server.a', [[
59+	src/(
60+		connection.c.o
61+		wayland-os.c.o
62+		wayland-protocol.c.o
63+		wayland-server.c
64+		wayland-shm.c
65+		wayland-util.c.o
66+		event-loop.c
67+	)
68+	$builddir/pkg/libffi/libffi.a
69+]])
70+
71+lib('libwayland-client.a', [[
72+	src/(
73+		connection.c.o
74+		wayland-os.c.o
75+		wayland-protocol.c.o
76+		wayland-client.c
77+		wayland-util.c.o
78+	)
79+	$builddir/pkg/libffi/libffi.a
80+]])
81+
82+lib('libwayland-cursor.a', [[
83+	cursor/(
84+		os-compatibility.c
85+		wayland-cursor.c
86+		xcursor.c
87+	)
88+	libwayland-client.a.d
89+]])
90+
91+fetch 'git'
+187, -0
  1@@ -0,0 +1,187 @@
  2+From 0861bb71b7a595fcf484db70fdc440b16ac8f970 Mon Sep 17 00:00:00 2001
  3+From: Michael Forney <mforney@mforney.org>
  4+Date: Fri, 30 Dec 2016 02:16:59 -0800
  5+Subject: [PATCH] cursor: Add hand2 and question_arrow
  6+
  7+---
  8+ cursor/convert_font.c |   4 +-
  9+ cursor/cursor-data.h  | 124 ++++++++++++++++++++++++++++++++++++++++----------
 10+ 2 files changed, 102 insertions(+), 26 deletions(-)
 11+
 12+diff --git a/cursor/convert_font.c b/cursor/convert_font.c
 13+index 45b6ac6..de1b0f4 100644
 14+--- a/cursor/convert_font.c
 15++++ b/cursor/convert_font.c
 16+@@ -488,7 +488,9 @@ static struct {
 17+ 	{ "top_side", "top_side" },
 18+ 	{ "xterm", "xterm" },
 19+ 	{ "hand1", "hand1" },
 20+-	{ "watch", "watch" }
 21++	{ "hand2", "hand2" },
 22++	{ "watch", "watch" },
 23++	{ "question_arrow", "question_arrow" },
 24+ };
 25+ 
 26+ static void
 27+diff --git a/cursor/cursor-data.h b/cursor/cursor-data.h
 28+index dd7a80a..8ff4acc 100644
 29+--- a/cursor/cursor-data.h
 30++++ b/cursor/cursor-data.h
 31+@@ -486,49 +486,121 @@ static uint32_t cursor_data[] = {
 32+ 	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 33+ 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
 34+ 	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 35++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
 36++	0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
 37++	0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 38++	0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
 39++	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
 40+ 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 41+-	0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
 42+-	0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
 43++	0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
 44++	0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
 45++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
 46++	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
 47++	0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
 48++	0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xff000000,
 49++	0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
 50++	0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
 51++	0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000,
 52++	0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
 53++	0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 54++	0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
 55++	0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
 56++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
 57++	0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
 58++	0xff000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
 59++	0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff,
 60++	0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff,
 61++	0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
 62++	0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
 63++	0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
 64++	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 65++	0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
 66++	0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
 67++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
 68++	0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff,
 69++	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 70++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
 71++	0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
 72++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 73++	0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
 74++	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 75++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 76++	0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
 77++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 78++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 79++	0x00000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 80+ 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
 81+ 	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
 82+ 	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 83+ 	0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
 84+ 	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
 85+-	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
 86++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
 87++	0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
 88++	0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
 89++	0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000,
 90+ 	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
 91+-	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
 92+-	0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
 93+-	0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff,
 94+-	0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
 95+-	0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
 96+-	0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
 97+-	0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff,
 98+-	0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
 99++	0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
100++	0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
101++	0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
102++	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xff000000, 0xff000000,
103+ 	0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
104+-	0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
105+-	0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
106++	0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000,
107++	0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
108++	0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff,
109+ 	0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
110+ 	0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
111+ 	0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
112+ 	0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
113+-	0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff,
114+-	0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
115+-	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
116++	0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000,
117++	0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
118++	0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
119++	0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
120++	0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
121++	0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff,
122++	0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
123++	0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
124+ 	0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
125+-	0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
126+-	0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
127+-	0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
128+-	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
129+-	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
130+-	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
131+-	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
132++	0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
133++	0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000,
134+ 	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
135+-	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
136++	0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
137+ 	0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
138+ 	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
139+ 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
140+ 	0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
141+ 	0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
142++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
143++	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
144++	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
145++	0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff,
146++	0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
147++	0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
148++	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
149++	0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
150++	0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000,
151++	0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000,
152++	0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
153++	0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000,
154++	0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
155++	0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
156++	0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
157++	0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
158++	0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
159++	0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
160++	0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
161++	0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
162++	0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
163++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
164++	0xff000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
165++	0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xff000000,
166++	0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
167++	0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
168++	0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
169++	0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xff000000,
170++	0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
171++	0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
172++	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
173++	0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
174+ 	0x00000000, 0x00000000,
175+ };
176+ 
177+@@ -550,5 +622,7 @@ static struct cursor_metadata {
178+ 	{ "top_side", 15, 16, 7, 1, 2160 },
179+ 	{ "xterm", 9, 16, 4, 8, 2400 },
180+ 	{ "hand1", 13, 16, 12, 0, 2544 },
181+-	{ "watch", 16, 16, 15, 9, 2752 },
182++	{ "hand2", 16, 16, 0, 1, 2752 },
183++	{ "watch", 16, 16, 15, 9, 3008 },
184++	{ "question_arrow", 11, 16, 5, 8, 3264 },
185+ };
186+-- 
187+2.11.0
188+
+38, -0
 1@@ -0,0 +1,38 @@
 2+From 73a48baabf1e154c6d6bc79270106305773ef95f Mon Sep 17 00:00:00 2001
 3+From: Michael Forney <mforney@mforney.org>
 4+Date: Wed, 16 Dec 2020 00:56:19 -0800
 5+Subject: [PATCH] wayland-util.h: remove unused math.h include
 6+
 7+This header is unused since f5df38959b (2012).
 8+---
 9+ src/connection.c   | 1 -
10+ src/wayland-util.h | 1 -
11+ 2 files changed, 2 deletions(-)
12+
13+diff --git a/src/connection.c b/src/connection.c
14+index d0c7d9f..62e6dbd 100644
15+--- a/src/connection.c
16++++ b/src/connection.c
17+@@ -26,7 +26,6 @@
18+ 
19+ #define _GNU_SOURCE
20+ 
21+-#include <math.h>
22+ #include <stdlib.h>
23+ #include <stdint.h>
24+ #include <string.h>
25+diff --git a/src/wayland-util.h b/src/wayland-util.h
26+index 7997778..5731cf8 100644
27+--- a/src/wayland-util.h
28++++ b/src/wayland-util.h
29+@@ -31,7 +31,6 @@
30+ #ifndef WAYLAND_UTIL_H
31+ #define WAYLAND_UTIL_H
32+ 
33+-#include <math.h>
34+ #include <stddef.h>
35+ #include <inttypes.h>
36+ #include <stdarg.h>
37+-- 
38+2.32.0
39+
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 8135e856ebd79872f886466e9cee39affb7d9ee8
+1, -0
1@@ -0,0 +1 @@
2+1.21.0 r0
+69, -0
 1@@ -0,0 +1,69 @@
 2+cflags{
 3+	'-D WITH_WAYLAND_SHM',
 4+	'-D WITH_WAYLAND_DRM',
 5+	'-I $outdir',
 6+	'-isystem $builddir/pkg/fontconfig/include',
 7+	'-isystem $builddir/pkg/freetype/include',
 8+	'-isystem $builddir/pkg/libdrm/include',
 9+	'-isystem $builddir/pkg/linux-headers/include',
10+	'-isystem $builddir/pkg/pixman/include',
11+	'-isystem $builddir/pkg/wayland/include',
12+}
13+
14+pkg.hdrs = copy('$outdir/include/wld', '$srcdir', {'drm.h', 'pixman.h', 'wayland.h', 'wld.h'})
15+pkg.hdrs.install = true
16+
17+local srcs = {
18+	'buffer.c',
19+	'buffered_surface.c',
20+	'color.c',
21+	'context.c',
22+	'drm.c',
23+	'dumb.c',
24+	'font.c',
25+	'renderer.c',
26+	'surface.c',
27+	'pixman.c',
28+	'wayland.c',
29+	'wayland-shm.c',
30+	'wayland-drm.c',
31+	'wayland-drm-protocol.c.o',
32+}
33+local libs = {
34+	'fontconfig/libfontconfig.a.d',
35+	'freetype/libfreetype.a.d',
36+	'libdrm/libdrm.a',
37+	'pixman/libpixman.a',
38+	'wayland/libwayland-client.a.d',
39+}
40+
41+if config.video_drivers and config.video_drivers['intel'] then
42+	cflags{'-D WITH_DRM_INTEL', '-isystem $basedir/pkg/libdrm/src/intel'}
43+	table.insert(srcs, {'intel.c', 'intel/batch.c'})
44+	table.insert(libs, 'libdrm/libdrm_intel.a.d')
45+end
46+if config.video_drivers and config.video_drivers['nouveau'] then
47+	cflags{'-D WITH_DRM_NOUVEAU', '-isystem $basedir/pkg/libdrm/src/nouveau'}
48+	table.insert(srcs, 'nouveau.c')
49+	table.insert(libs, 'libdrm/libdrm_nouveau.a')
50+end
51+
52+waylandproto('protocol/wayland-drm.xml', {
53+	client='protocol/wayland-drm-client-protocol.h',
54+	server='protocol/wayland-drm-server-protocol.h',
55+	code='wayland-drm-protocol.c'
56+})
57+
58+pkg.deps = {
59+	'$outdir/protocol/wayland-drm-client-protocol.h',
60+	'pkg/fontconfig/headers',
61+	'pkg/freetype/headers',
62+	'pkg/libdrm/headers',
63+	'pkg/linux-headers/headers',
64+	'pkg/pixman/headers',
65+	'pkg/wayland/headers',
66+}
67+
68+lib('libwld.a', {srcs, expand{'$builddir/pkg/', libs}})
69+
70+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 3fe15e769cf81784215c003b18438184083af8ce
+1, -0
1@@ -0,0 +1 @@
2+3fe15e769c r0
+158, -0
  1@@ -0,0 +1,158 @@
  2+local data = [[
  3+	compat/(
  4+		accessx basic caps complete
  5+		iso9995
  6+		japan ledcaps ledcompose
  7+		lednum ledscroll level5
  8+		misc mousekeys
  9+		olpc pc pc98 xfree86
 10+		xtest README
 11+	)
 12+	geometry/(
 13+		digital_vndr/(lk pc unix)
 14+		sgi_vndr/(indigo indy O2)
 15+		amiga ataritt chicony
 16+		dell everex fujitsu
 17+		hhk hp keytronic kinesis
 18+		macintosh microsoft nec nokia
 19+		northgate pc sanwa sony thinkpad
 20+		sun teck steelseries typematrix winbook README
 21+	)
 22+	keycodes/(
 23+		digital_vndr/(lk pc)
 24+		sgi_vndr/(indigo indy iris)
 25+		aliases
 26+		amiga
 27+		ataritt
 28+		empty
 29+		evdev
 30+		fujitsu
 31+		hp
 32+		ibm
 33+		jolla
 34+		macintosh
 35+		olpc
 36+		sony
 37+		sun
 38+		xfree86
 39+		xfree98
 40+		README
 41+	)
 42+	rules/(
 43+		xfree98
 44+		xkb.dtd
 45+		README
 46+	)
 47+	symbols/(
 48+		digital_vndr/(lk pc us vt)
 49+		fujitsu_vndr/(jp us)
 50+		hp_vndr/(us)
 51+		jolla_vndr/(sbj)
 52+		macintosh_vndr/(
 53+			apple ch de dk
 54+			fi fr
 55+			gb is it jp
 56+			latam nl no pt
 57+			se us
 58+		)
 59+		nec_vndr/(jp)
 60+		nokia_vndr/(rx-44 rx-51 su-8w)
 61+		sgi_vndr/(jp)
 62+		sharp_vndr/(sl-c3x00 ws003sh ws007sh ws011sh ws020sh)
 63+		sony_vndr/(us)
 64+		sun_vndr/(
 65+			ara be br ca ch
 66+			cz de dk ee es
 67+			fi fr gb gr it
 68+			jp kr lt lv nl
 69+			no pl pt ro ru
 70+			se sk solaris tr
 71+			tw ua us
 72+		)
 73+		xfree68_vndr/(amiga ataritt)
 74+		af al am apl
 75+		ara at au az
 76+		ba bd be
 77+		bg bqn br brai
 78+		bt bw by
 79+		ca cd ch
 80+		cm cn cz
 81+		de dk dz
 82+		ee eg es et epo eu
 83+		fi fo fr
 84+		gb ge gh gn
 85+		gr hr hu
 86+		id ie il
 87+		in iq
 88+		ir is it
 89+		jp
 90+		ke kg kh
 91+		kr kz
 92+		la latam latin
 93+		lk lt lv
 94+		ma mao md me
 95+		mk ml mm
 96+		mn mt mv my
 97+		ng nl no np
 98+		parens pc ph pk pl pt
 99+		ro rs ru
100+		se si sk sn
101+		sy th
102+		terminate tg
103+		tj tm tr trans tw tz
104+		ua us uz vn
105+		za
106+		altwin capslock compose ctrl empty eurosign rupeesign group inet
107+		keypad kpdl level2 level3 level5 nbsp olpc shift srvr_ctrl typo
108+	)
109+	types/(
110+		basic cancel caps
111+		complete default extra
112+		iso9995 level5 mousekeys nokia numpad
113+		pc README
114+	)
115+]]
116+for f in iterpaths(data) do
117+	file('share/xkb/'..f, '644', '$srcdir/'..f)
118+end
119+
120+local function parts(ruleset)
121+	return expand{'$srcdir/rules/', {
122+		'0000-hdr.part',
123+		'0001-lists.part',
124+		'0002-'..ruleset..'.lists.part',
125+		'0004-'..ruleset..'.m_k.part',
126+		'0005-l1_k.part',
127+		'0006-l_k.part',
128+		'0007-o_k.part',
129+		'0008-ml_g.part',
130+		'0009-m_g.part',
131+		'0011-mlv_s.part',
132+		'0013-ml_s.part',
133+		'0015-ml1_s.part',
134+		'0018-ml2_s.part ',
135+		'0020-ml3_s.part ',
136+		'0022-ml4_s.part ',
137+		'0026-'..ruleset..'.m_s.part',
138+		'0027-'..ruleset..'.ml_s1.part',
139+		'0033-ml_c.part',
140+		'0034-ml1_c.part',
141+		'0035-m_t.part',
142+		'0036-lo_s.part',
143+		'0037-l1o_s.part',
144+		'0038-l2o_s.part',
145+		'0039-l3o_s.part',
146+		'0040-l4o_s.part',
147+		'0042-o_s.part',
148+		'0043-o_c.part',
149+		'0044-o_t.part',
150+	}}
151+end
152+
153+build('cat', '$outdir/base', parts('base'))
154+file('share/xkb/rules/base', '644', '$outdir/base')
155+
156+build('cat', '$outdir/evdev', parts('evdev'))
157+file('share/xkb/rules/evdev', '644', '$outdir/evdev')
158+
159+fetch 'git'
+1, -0
1@@ -0,0 +1 @@
2+Subproject commit 60d5dd7bf463e5754f047cb98b17102e524e8f16
+1, -0
1@@ -0,0 +1 @@
2+2.36 r0
+13, -0
 1@@ -46,6 +46,7 @@ return {
 2 		'qbe',
 3 		'strace',
 4 		'the_silver_searcher',
 5+		'wayland',
 6 	},
 7 	net={
 8 		'catgirl',
 9@@ -54,4 +55,16 @@ return {
10 		'transmission',
11 		'wpa_supplicant',
12 	},
13+	desktop={
14+		'dmenu',
15+		'liberation-fonts',
16+		'libinput',
17+		'mupdf',
18+		'netsurf',
19+		'st',
20+		'swc',
21+		'tamzen-font',
22+		'velox',
23+		'xkeyboard-config',
24+	},
25 }