diff options
-rw-r--r-- | .gitignore | 17 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rwxr-xr-x | bin/gentags | 18 | ||||
-rwxr-xr-x | bin/initmk | 49 | ||||
-rwxr-xr-x | bin/updatedirs | 21 | ||||
-rw-r--r-- | rules.mk | 21 | ||||
-rw-r--r-- | share/paths.mk | 19 | ||||
-rw-r--r-- | src/base/arg.c (renamed from sys/base/arg.c) | 0 | ||||
-rw-r--r-- | src/base/bufio/dump.c (renamed from sys/base/bufio/dump.c) | 0 | ||||
-rw-r--r-- | src/base/bufio/get.c (renamed from sys/base/bufio/get.c) | 0 | ||||
-rw-r--r-- | src/base/bufio/internal.h (renamed from sys/base/bufio/internal.h) | 0 | ||||
-rw-r--r-- | src/base/bufio/read.c (renamed from sys/base/bufio/read.c) | 0 | ||||
-rw-r--r-- | src/base/bufio/reader.c (renamed from sys/base/bufio/reader.c) | 0 | ||||
-rw-r--r-- | src/base/bufio/refill.h (renamed from sys/base/bufio/refill.h) | 0 | ||||
-rw-r--r-- | src/base/bufio/rules.mk (renamed from sys/base/bufio/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/bufio/unget.c (renamed from sys/base/bufio/unget.c) | 0 | ||||
-rw-r--r-- | src/base/coro/coro.c (renamed from sys/base/coro/coro.c) | 0 | ||||
-rw-r--r-- | src/base/coro/internal.h (renamed from sys/base/coro/internal.h) | 0 | ||||
-rw-r--r-- | src/base/coro/rules.mk (renamed from sys/base/coro/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/coro/unix_x64.s (renamed from sys/base/coro/unix_x64.s) | 0 | ||||
-rw-r--r-- | src/base/error/errorf.c (renamed from sys/base/error/errorf.c) | 0 | ||||
-rw-r--r-- | src/base/error/exits.c (renamed from sys/base/error/exits.c) | 0 | ||||
-rw-r--r-- | src/base/error/internal.h (renamed from sys/base/error/internal.h) | 0 | ||||
-rw-r--r-- | src/base/error/panicf.c (renamed from sys/base/error/panicf.c) | 0 | ||||
-rw-r--r-- | src/base/error/rules.mk (renamed from sys/base/error/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/error/verrorf.c (renamed from sys/base/error/verrorf.c) | 0 | ||||
-rw-r--r-- | src/base/error/vpanicf.c (renamed from sys/base/error/vpanicf.c) | 0 | ||||
-rw-r--r-- | src/base/flate/internal.h (renamed from sys/base/flate/internal.h) | 0 | ||||
-rw-r--r-- | src/base/flate/read.c (renamed from sys/base/flate/read.c) | 0 | ||||
-rw-r--r-- | src/base/flate/reader.c (renamed from sys/base/flate/reader.c) | 0 | ||||
-rw-r--r-- | src/base/flate/rules.mk (renamed from sys/base/flate/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/flate/write.c (renamed from sys/base/flate/write.c) | 0 | ||||
-rw-r--r-- | src/base/flate/writer.c (renamed from sys/base/flate/writer.c) | 0 | ||||
-rw-r--r-- | src/base/fs/internal.h (renamed from sys/base/fs/internal.h) | 0 | ||||
-rw-r--r-- | src/base/fs/rules.mk (renamed from sys/base/fs/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/fs/walk.c (renamed from sys/base/fs/walk.c) | 0 | ||||
-rw-r--r-- | src/base/fs/walker.c (renamed from sys/base/fs/walker.c) | 0 | ||||
-rw-r--r-- | src/base/gz/flush.c (renamed from sys/base/gz/flush.c) | 0 | ||||
-rw-r--r-- | src/base/gz/get.c (renamed from sys/base/gz/get.c) | 0 | ||||
-rw-r--r-- | src/base/gz/interface.c (renamed from sys/base/gz/interface.c) | 0 | ||||
-rw-r--r-- | src/base/gz/internal.h (renamed from sys/base/gz/internal.h) | 0 | ||||
-rw-r--r-- | src/base/gz/open.c (renamed from sys/base/gz/open.c) | 0 | ||||
-rw-r--r-- | src/base/gz/printf.c (renamed from sys/base/gz/printf.c) | 0 | ||||
-rw-r--r-- | src/base/gz/put.c (renamed from sys/base/gz/put.c) | 0 | ||||
-rw-r--r-- | src/base/gz/putstring.c (renamed from sys/base/gz/putstring.c) | 0 | ||||
-rw-r--r-- | src/base/gz/read.c (renamed from sys/base/gz/read.c) | 0 | ||||
-rw-r--r-- | src/base/gz/rules.mk (renamed from sys/base/gz/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/gz/seek.c (renamed from sys/base/gz/seek.c) | 0 | ||||
-rw-r--r-- | src/base/gz/write.c (renamed from sys/base/gz/write.c) | 0 | ||||
-rw-r--r-- | src/base/io/fd.c (renamed from sys/base/io/fd.c) | 0 | ||||
-rw-r--r-- | src/base/io/flush.c (renamed from sys/base/io/flush.c) | 0 | ||||
-rw-r--r-- | src/base/io/get.c (renamed from sys/base/io/get.c) | 0 | ||||
-rw-r--r-- | src/base/io/interface.c (renamed from sys/base/io/interface.c) | 0 | ||||
-rw-r--r-- | src/base/io/internal.h (renamed from sys/base/io/internal.h) | 0 | ||||
-rw-r--r-- | src/base/io/open.c (renamed from sys/base/io/open.c) | 0 | ||||
-rw-r--r-- | src/base/io/putbyte.c (renamed from sys/base/io/putbyte.c) | 0 | ||||
-rw-r--r-- | src/base/io/putstring.c (renamed from sys/base/io/putstring.c) | 0 | ||||
-rw-r--r-- | src/base/io/read.c (renamed from sys/base/io/read.c) | 0 | ||||
-rw-r--r-- | src/base/io/readln.c (renamed from sys/base/io/readln.c) | 0 | ||||
-rw-r--r-- | src/base/io/rules.mk (renamed from sys/base/io/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/io/seek.c (renamed from sys/base/io/seek.c) | 0 | ||||
-rw-r--r-- | src/base/io/stat.c (renamed from sys/base/io/stat.c) | 0 | ||||
-rw-r--r-- | src/base/io/tell.c (renamed from sys/base/io/tell.c) | 0 | ||||
-rw-r--r-- | src/base/io/unget.c (renamed from sys/base/io/unget.c) | 0 | ||||
-rw-r--r-- | src/base/io/write.c (renamed from sys/base/io/write.c) | 0 | ||||
-rw-r--r-- | src/base/mem/arena.c (renamed from sys/base/mem/arena.c) | 0 | ||||
-rw-r--r-- | src/base/mem/buffer.c (renamed from sys/base/mem/buffer.c) | 0 | ||||
-rw-r--r-- | src/base/mem/interface.c (renamed from sys/base/mem/interface.c) | 0 | ||||
-rw-r--r-- | src/base/mem/internal.h (renamed from sys/base/mem/internal.h) | 0 | ||||
-rw-r--r-- | src/base/mem/rules.mk (renamed from sys/base/mem/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/mem/set64.c (renamed from sys/base/mem/set64.c) | 0 | ||||
-rw-r--r-- | src/base/mmap/internal.h (renamed from sys/base/mmap/internal.h) | 0 | ||||
-rw-r--r-- | src/base/mmap/mmap.c (renamed from sys/base/mmap/mmap.c) | 0 | ||||
-rw-r--r-- | src/base/mmap/rules.mk (renamed from sys/base/mmap/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/os/basename.c (renamed from sys/base/os/basename.c) | 0 | ||||
-rw-r--r-- | src/base/os/exists.c (renamed from sys/base/os/exists.c) | 0 | ||||
-rw-r--r-- | src/base/os/internal.h (renamed from sys/base/os/internal.h) | 0 | ||||
-rw-r--r-- | src/base/os/rules.mk (renamed from sys/base/os/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/os/sep.c (renamed from sys/base/os/sep.c) | 0 | ||||
-rw-r--r-- | src/base/rng/base.c (renamed from sys/base/rng/base.c) | 0 | ||||
-rw-r--r-- | src/base/rng/bernoulli.c (renamed from sys/base/rng/bernoulli.c) | 0 | ||||
-rw-r--r-- | src/base/rng/exponential.c (renamed from sys/base/rng/exponential.c) | 0 | ||||
-rw-r--r-- | src/base/rng/internal.h (renamed from sys/base/rng/internal.h) | 0 | ||||
-rw-r--r-- | src/base/rng/normal.c (renamed from sys/base/rng/normal.c) | 0 | ||||
-rw-r--r-- | src/base/rng/poisson.c (renamed from sys/base/rng/poisson.c) | 0 | ||||
-rw-r--r-- | src/base/rng/random.c (renamed from sys/base/rng/random.c) | 0 | ||||
-rw-r--r-- | src/base/rng/rules.mk (renamed from sys/base/rng/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/rules.mk (renamed from sys/base/rules.mk) | 15 | ||||
-rw-r--r-- | src/base/sort/double.c (renamed from sys/base/sort/double.c) | 0 | ||||
-rw-r--r-- | src/base/sort/float.c (renamed from sys/base/sort/float.c) | 0 | ||||
-rw-r--r-- | src/base/sort/int.c (renamed from sys/base/sort/int.c) | 0 | ||||
-rw-r--r-- | src/base/sort/int16.c (renamed from sys/base/sort/int16.c) | 0 | ||||
-rw-r--r-- | src/base/sort/int32.c (renamed from sys/base/sort/int32.c) | 0 | ||||
-rw-r--r-- | src/base/sort/int64.c (renamed from sys/base/sort/int64.c) | 0 | ||||
-rw-r--r-- | src/base/sort/int8.c (renamed from sys/base/sort/int8.c) | 0 | ||||
-rw-r--r-- | src/base/sort/internal.h (renamed from sys/base/sort/internal.h) | 0 | ||||
-rw-r--r-- | src/base/sort/rules.mk (renamed from sys/base/sort/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/sort/string.c (renamed from sys/base/sort/string.c) | 0 | ||||
-rw-r--r-- | src/base/sort/uint.c (renamed from sys/base/sort/uint.c) | 0 | ||||
-rw-r--r-- | src/base/sort/uint16.c (renamed from sys/base/sort/uint16.c) | 0 | ||||
-rw-r--r-- | src/base/sort/uint32.c (renamed from sys/base/sort/uint32.c) | 0 | ||||
-rw-r--r-- | src/base/sort/uint64.c (renamed from sys/base/sort/uint64.c) | 0 | ||||
-rw-r--r-- | src/base/sort/uint8.c (renamed from sys/base/sort/uint8.c) | 0 | ||||
-rw-r--r-- | src/base/string/append.c (renamed from sys/base/string/append.c) | 0 | ||||
-rw-r--r-- | src/base/string/appendf.c (renamed from sys/base/string/appendf.c) | 0 | ||||
-rw-r--r-- | src/base/string/clear.c (renamed from sys/base/string/clear.c) | 0 | ||||
-rw-r--r-- | src/base/string/copyn.c (renamed from sys/base/string/copyn.c) | 0 | ||||
-rw-r--r-- | src/base/string/equals.c (renamed from sys/base/string/equals.c) | 0 | ||||
-rw-r--r-- | src/base/string/find.c (renamed from sys/base/string/find.c) | 0 | ||||
-rw-r--r-- | src/base/string/fit.c (renamed from sys/base/string/fit.c) | 0 | ||||
-rw-r--r-- | src/base/string/free.c (renamed from sys/base/string/free.c) | 0 | ||||
-rw-r--r-- | src/base/string/grow.c (renamed from sys/base/string/grow.c) | 0 | ||||
-rw-r--r-- | src/base/string/internal.h (renamed from sys/base/string/internal.h) | 0 | ||||
-rw-r--r-- | src/base/string/join.c (renamed from sys/base/string/join.c) | 0 | ||||
-rw-r--r-- | src/base/string/len.c (renamed from sys/base/string/len.c) | 0 | ||||
-rw-r--r-- | src/base/string/lower.c (renamed from sys/base/string/lower.c) | 0 | ||||
-rw-r--r-- | src/base/string/make.c (renamed from sys/base/string/make.c) | 0 | ||||
-rw-r--r-- | src/base/string/makef.c (renamed from sys/base/string/makef.c) | 0 | ||||
-rw-r--r-- | src/base/string/read.c (renamed from sys/base/string/read.c) | 0 | ||||
-rw-r--r-- | src/base/string/replace.c (renamed from sys/base/string/replace.c) | 0 | ||||
-rw-r--r-- | src/base/string/rules.mk (renamed from sys/base/string/rules.mk) | 0 | ||||
-rw-r--r-- | src/base/string/split.c (renamed from sys/base/string/split.c) | 0 | ||||
-rw-r--r-- | src/base/string/upper.c (renamed from sys/base/string/upper.c) | 0 | ||||
-rw-r--r-- | src/base/test.c (renamed from sys/base/test.c) | 0 | ||||
-rw-r--r-- | src/cmd/cc/ast.c (renamed from sys/cmd/cc/ast.c) | 0 | ||||
-rw-r--r-- | src/cmd/cc/bits.c (renamed from sys/cmd/cc/bits.c) | 0 | ||||
-rw-r--r-- | src/cmd/cc/cc.c (renamed from sys/cmd/cc/cc.c) | 0 | ||||
-rw-r--r-- | src/cmd/cc/cc.h (renamed from sys/cmd/cc/cc.h) | 0 | ||||
-rw-r--r-- | src/cmd/cc/lex.c (renamed from sys/cmd/cc/lex.c) | 0 | ||||
-rw-r--r-- | src/cmd/cc/pp.c (renamed from sys/cmd/cc/pp.c) | 0 | ||||
-rw-r--r-- | src/cmd/cc/rules.mk (renamed from sys/cmd/cc/rules.mk) | 18 | ||||
-rw-r--r-- | src/cmd/cc/scratch.c (renamed from sys/cmd/cc/scratch.c) | 0 | ||||
-rw-r--r-- | src/cmd/cc/util.c (renamed from sys/cmd/cc/util.c) | 0 | ||||
-rw-r--r-- | src/cmd/dwm/LICENSE (renamed from sys/cmd/dwm/LICENSE) | 0 | ||||
-rw-r--r-- | src/cmd/dwm/client.c (renamed from sys/cmd/dwm/client.c) | 0 | ||||
-rw-r--r-- | src/cmd/dwm/config.h (renamed from sys/cmd/dwm/config.h) | 0 | ||||
-rw-r--r-- | src/cmd/dwm/drw.c (renamed from sys/cmd/dwm/drw.c) | 0 | ||||
-rw-r--r-- | src/cmd/dwm/dwm.c (renamed from sys/cmd/dwm/dwm.c) | 0 | ||||
-rw-r--r-- | src/cmd/dwm/dwm.h (renamed from sys/cmd/dwm/dwm.h) | 0 | ||||
-rw-r--r-- | src/cmd/dwm/hook.c (renamed from sys/cmd/dwm/hook.c) | 0 | ||||
-rw-r--r-- | src/cmd/dwm/rules.mk | 29 | ||||
-rw-r--r-- | src/cmd/dwm/util.c (renamed from sys/cmd/dwm/util.c) | 0 | ||||
-rw-r--r-- | src/cmd/filter/filter.c (renamed from sys/cmd/filter/filter.c) | 0 | ||||
-rw-r--r-- | src/cmd/filter/rules.mk | 14 | ||||
-rw-r--r-- | src/cmd/ic/LICENSE (renamed from sys/cmd/ic/LICENSE) | 0 | ||||
-rw-r--r-- | src/cmd/ic/ic.1 (renamed from sys/cmd/ic/ic.1) | 0 | ||||
-rw-r--r-- | src/cmd/ic/ic.c (renamed from sys/cmd/ic/ic.c) | 0 | ||||
-rw-r--r-- | src/cmd/ic/rules.mk (renamed from sys/cmd/ic/rules.mk) | 6 | ||||
-rw-r--r-- | src/cmd/ic/strlcpy.c (renamed from sys/cmd/ic/strlcpy.c) | 0 | ||||
-rw-r--r-- | src/cmd/menu/LICENSE (renamed from sys/cmd/menu/LICENSE) | 0 | ||||
-rw-r--r-- | src/cmd/menu/config.h (renamed from sys/cmd/menu/config.h) | 0 | ||||
-rw-r--r-- | src/cmd/menu/drw.c (renamed from sys/cmd/menu/drw.c) | 0 | ||||
-rw-r--r-- | src/cmd/menu/drw.h (renamed from sys/cmd/menu/drw.h) | 0 | ||||
-rw-r--r-- | src/cmd/menu/menu.c (renamed from sys/cmd/menu/menu.c) | 0 | ||||
-rw-r--r-- | src/cmd/menu/menu.h (renamed from sys/cmd/menu/menu.h) | 0 | ||||
-rw-r--r-- | src/cmd/menu/rules.mk | 27 | ||||
-rw-r--r-- | src/cmd/menu/util.c (renamed from sys/cmd/menu/util.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/code.c (renamed from sys/cmd/rc/code.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/exec.c (renamed from sys/cmd/rc/exec.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/exec.h (renamed from sys/cmd/rc/exec.h) | 0 | ||||
-rw-r--r-- | src/cmd/rc/input.c (renamed from sys/cmd/rc/input.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/io.c (renamed from sys/cmd/rc/io.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/job.c (renamed from sys/cmd/rc/job.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/lex.c (renamed from sys/cmd/rc/lex.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/main.c (renamed from sys/cmd/rc/main.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/parse.c (renamed from sys/cmd/rc/parse.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/parse.h (renamed from sys/cmd/rc/parse.h) | 0 | ||||
-rw-r--r-- | src/cmd/rc/prompt.c (renamed from sys/cmd/rc/prompt.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/rc.h (renamed from sys/cmd/rc/rc.h) | 0 | ||||
-rw-r--r-- | src/cmd/rc/rules.mk (renamed from sys/cmd/rc/rules.mk) | 9 | ||||
-rw-r--r-- | src/cmd/rc/syntax.y (renamed from sys/cmd/rc/syntax.y) | 0 | ||||
-rw-r--r-- | src/cmd/rc/sys.c (renamed from sys/cmd/rc/sys.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/tree.c (renamed from sys/cmd/rc/tree.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/util.c (renamed from sys/cmd/rc/util.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/var.c (renamed from sys/cmd/rc/var.c) | 0 | ||||
-rw-r--r-- | src/cmd/rc/wait.c (renamed from sys/cmd/rc/wait.c) | 0 | ||||
-rw-r--r-- | src/cmd/rules.mk (renamed from sys/cmd/rules.mk) | 8 | ||||
-rw-r--r-- | src/cmd/term/LICENSE (renamed from sys/cmd/term/LICENSE) | 0 | ||||
-rw-r--r-- | src/cmd/term/config.h (renamed from sys/cmd/term/config.h) | 0 | ||||
-rw-r--r-- | src/cmd/term/hb.c (renamed from sys/cmd/term/hb.c) | 0 | ||||
-rw-r--r-- | src/cmd/term/nonspacing.h (renamed from sys/cmd/term/nonspacing.h) | 0 | ||||
-rw-r--r-- | src/cmd/term/rules.mk | 26 | ||||
-rw-r--r-- | src/cmd/term/term.c (renamed from sys/cmd/term/term.c) | 0 | ||||
-rw-r--r-- | src/cmd/term/term.h (renamed from sys/cmd/term/term.h) | 0 | ||||
-rw-r--r-- | src/cmd/term/term.info (renamed from sys/cmd/term/term.info) | 0 | ||||
-rw-r--r-- | src/cmd/term/util.c (renamed from sys/cmd/term/util.c) | 0 | ||||
-rw-r--r-- | src/cmd/term/wide.h (renamed from sys/cmd/term/wide.h) | 0 | ||||
-rw-r--r-- | src/cmd/term/x.c (renamed from sys/cmd/term/x.c) | 0 | ||||
-rw-r--r-- | src/cmd/walk/rules.mk | 15 | ||||
-rw-r--r-- | src/cmd/walk/walk.c (renamed from sys/cmd/walk/walk.c) | 0 | ||||
-rw-r--r-- | src/cmd/wm/arg.c (renamed from sys/cmd/wm/arg.c) | 0 | ||||
-rw-r--r-- | src/cmd/wm/client.c (renamed from sys/cmd/wm/client.c) | 0 | ||||
-rw-r--r-- | src/cmd/wm/config.h (renamed from sys/cmd/wm/config.h) | 0 | ||||
-rw-r--r-- | src/cmd/wm/input.c (renamed from sys/cmd/wm/input.c) | 0 | ||||
-rw-r--r-- | src/cmd/wm/layer.c (renamed from sys/cmd/wm/layer.c) | 0 | ||||
-rw-r--r-- | src/cmd/wm/main.c (renamed from sys/cmd/wm/main.c) | 0 | ||||
-rw-r--r-- | src/cmd/wm/monitor.c (renamed from sys/cmd/wm/monitor.c) | 0 | ||||
-rwxr-xr-x | src/cmd/wm/protocol/sync (renamed from sys/cmd/wm/protocol/sync) | 0 | ||||
-rw-r--r-- | src/cmd/wm/protocol/wlr-layer-shell-unstable-v1.xml | 390 | ||||
-rw-r--r-- | src/cmd/wm/render.c (renamed from sys/cmd/wm/render.c) | 0 | ||||
-rw-r--r-- | src/cmd/wm/rules.mk (renamed from sys/cmd/wm/rules.mk) | 53 | ||||
-rw-r--r-- | src/cmd/wm/util.c (renamed from sys/cmd/wm/util.c) | 0 | ||||
-rw-r--r-- | src/cmd/wm/wlr-layer-shell-unstable-v1-protocol.c | 93 | ||||
-rw-r--r-- | src/cmd/wm/wlr-layer-shell-unstable-v1-protocol.h | 564 | ||||
-rw-r--r-- | src/cmd/wm/wm.h (renamed from sys/cmd/wm/wm.h) | 0 | ||||
-rw-r--r-- | src/cmd/wm/xdg-shell-protocol.c | 181 | ||||
-rw-r--r-- | src/cmd/wm/xdg-shell-protocol.h | 1676 | ||||
-rw-r--r-- | src/cmd/wm/xdg.c (renamed from sys/cmd/wm/xdg.c) | 0 | ||||
-rw-r--r-- | src/libbio/align.c (renamed from sys/libbio/align.c) | 0 | ||||
-rw-r--r-- | src/libbio/fasta.c (renamed from sys/libbio/fasta.c) | 0 | ||||
-rw-r--r-- | src/libbio/newick.c (renamed from sys/libbio/newick.c) | 0 | ||||
-rw-r--r-- | src/libbio/phylo.c (renamed from sys/libbio/phylo.c) | 0 | ||||
-rw-r--r-- | src/libbio/rules.mk (renamed from sys/libbio/rules.mk) | 14 | ||||
-rw-r--r-- | src/libbio/simulate.c (renamed from sys/libbio/simulate.c) | 0 | ||||
-rw-r--r-- | src/libbio/test.c (renamed from sys/libbio/test.c) | 0 | ||||
-rw-r--r-- | src/libc/rules.mk (renamed from sys/libc/rules.mk) | 5 | ||||
-rw-r--r-- | src/libc/stdio.c (renamed from sys/libc/stdio.c) | 0 | ||||
-rw-r--r-- | src/libc/string.c (renamed from sys/libc/string.c) | 0 | ||||
-rw-r--r-- | src/libfmt/buffer.c (renamed from sys/libfmt/buffer.c) | 0 | ||||
-rw-r--r-- | src/libfmt/do.c (renamed from sys/libfmt/do.c) | 0 | ||||
-rw-r--r-- | src/libfmt/esprint.c (renamed from sys/libfmt/esprint.c) | 0 | ||||
-rw-r--r-- | src/libfmt/float.c (renamed from sys/libfmt/float.c) | 0 | ||||
-rw-r--r-- | src/libfmt/fprint.c (renamed from sys/libfmt/fprint.c) | 0 | ||||
-rw-r--r-- | src/libfmt/internal.h (renamed from sys/libfmt/internal.h) | 0 | ||||
-rw-r--r-- | src/libfmt/locale.c (renamed from sys/libfmt/locale.c) | 0 | ||||
-rw-r--r-- | src/libfmt/nsprint.c (renamed from sys/libfmt/nsprint.c) | 0 | ||||
-rw-r--r-- | src/libfmt/open.c (renamed from sys/libfmt/open.c) | 0 | ||||
-rw-r--r-- | src/libfmt/print.c (renamed from sys/libfmt/print.c) | 0 | ||||
-rw-r--r-- | src/libfmt/rules.mk (renamed from sys/libfmt/rules.mk) | 11 | ||||
-rw-r--r-- | src/libfmt/sprint.c (renamed from sys/libfmt/sprint.c) | 0 | ||||
-rw-r--r-- | src/libfmt/test.c (renamed from sys/libfmt/test.c) | 0 | ||||
-rw-r--r-- | src/libfmt/vesprint.c (renamed from sys/libfmt/vesprint.c) | 0 | ||||
-rw-r--r-- | src/libfmt/vfprint.c (renamed from sys/libfmt/vfprint.c) | 0 | ||||
-rw-r--r-- | src/libfmt/vnsprint.c (renamed from sys/libfmt/vnsprint.c) | 0 | ||||
-rw-r--r-- | src/libfmt/vprint.c (renamed from sys/libfmt/vprint.c) | 0 | ||||
-rw-r--r-- | src/libfmt/vwrite.c (renamed from sys/libfmt/vwrite.c) | 0 | ||||
-rw-r--r-- | src/libfmt/write.c (renamed from sys/libfmt/write.c) | 0 | ||||
-rw-r--r-- | src/libmath/basic.c (renamed from sys/libmath/basic.c) | 0 | ||||
-rw-r--r-- | src/libmath/blas.c (renamed from sys/libmath/blas.c) | 0 | ||||
-rw-r--r-- | src/libmath/blas1.c (renamed from sys/libmath/blas1.c) | 0 | ||||
-rw-r--r-- | src/libmath/blas1body (renamed from sys/libmath/blas1body) | 0 | ||||
-rw-r--r-- | src/libmath/blas2.c (renamed from sys/libmath/blas2.c) | 0 | ||||
-rw-r--r-- | src/libmath/blas2body (renamed from sys/libmath/blas2body) | 0 | ||||
-rw-r--r-- | src/libmath/blas3.c (renamed from sys/libmath/blas3.c) | 0 | ||||
-rw-r--r-- | src/libmath/lapack.c (renamed from sys/libmath/lapack.c) | 0 | ||||
-rw-r--r-- | src/libmath/linalg.c (renamed from sys/libmath/linalg.c) | 0 | ||||
-rw-r--r-- | src/libmath/loop.h (renamed from sys/libmath/loop.h) | 0 | ||||
-rw-r--r-- | src/libmath/matrix.c (renamed from sys/libmath/matrix.c) | 0 | ||||
-rw-r--r-- | src/libmath/rules.mk | 27 | ||||
-rw-r--r-- | src/libmath/test.c (renamed from sys/libmath/test.c) | 0 | ||||
-rw-r--r-- | src/libsre/lex.c (renamed from sys/libsre/lex.c) | 0 | ||||
-rw-r--r-- | src/libsre/sre.h (renamed from sys/libsre/sre.h) | 0 | ||||
-rw-r--r-- | src/libterm/term.c (renamed from sys/libterm/term.c) | 0 | ||||
-rw-r--r-- | src/libterm/term.h (renamed from sys/libterm/term.h) | 0 | ||||
-rw-r--r-- | src/libterm/window.c (renamed from sys/libterm/window.c) | 0 | ||||
-rw-r--r-- | src/libutf/canfit.c (renamed from sys/libutf/canfit.c) | 0 | ||||
-rw-r--r-- | src/libutf/decode.c (renamed from sys/libutf/decode.c) | 0 | ||||
-rw-r--r-- | src/libutf/decodeprev.c (renamed from sys/libutf/decodeprev.c) | 0 | ||||
-rw-r--r-- | src/libutf/encode.c (renamed from sys/libutf/encode.c) | 0 | ||||
-rw-r--r-- | src/libutf/find.c (renamed from sys/libutf/find.c) | 0 | ||||
-rw-r--r-- | src/libutf/findlast.c (renamed from sys/libutf/findlast.c) | 0 | ||||
-rw-r--r-- | src/libutf/internal.h (renamed from sys/libutf/internal.h) | 0 | ||||
-rw-r--r-- | src/libutf/len.c (renamed from sys/libutf/len.c) | 0 | ||||
-rw-r--r-- | src/libutf/rules.mk (renamed from sys/libutf/rules.mk) | 32 | ||||
-rw-r--r-- | src/libutf/runelen.c (renamed from sys/libutf/runelen.c) | 0 | ||||
-rw-r--r-- | src/libutf/vendor/common.c (renamed from sys/libutf/vendor/common.c) | 0 | ||||
-rw-r--r-- | src/libutf/vendor/common.h (renamed from sys/libutf/vendor/common.h) | 0 | ||||
-rw-r--r-- | src/libutf/vendor/mkgraphemedata.c (renamed from sys/libutf/vendor/mkgraphemedata.c) | 0 | ||||
-rw-r--r-- | src/libutf/vendor/mkrunetype.c (renamed from sys/libutf/vendor/mkrunetype.c) | 0 | ||||
-rw-r--r-- | src/libutf/vendor/mkrunewidth.c (renamed from sys/libutf/vendor/mkrunewidth.c) | 0 | ||||
-rw-r--r-- | src/nixos/rules.mk (renamed from sys/nixos/rules.mk) | 0 | ||||
-rw-r--r-- | src/rules.mk (renamed from sys/rules.mk) | 18 | ||||
-rw-r--r-- | sys/cmd/dwm/rules.mk | 28 | ||||
-rw-r--r-- | sys/cmd/filter/rules.mk | 13 | ||||
-rw-r--r-- | sys/cmd/menu/rules.mk | 25 | ||||
-rw-r--r-- | sys/cmd/term/rules.mk | 24 | ||||
-rw-r--r-- | sys/cmd/walk/rules.mk | 13 | ||||
-rw-r--r-- | sys/libmath/rules.mk | 24 |
278 files changed, 3157 insertions, 350 deletions
@@ -1,18 +1,14 @@ bin/ lib/ -src/ data/ share/ vendor/ test/ -.build/ -.test/ +obj/ .cache/ include/libc include/vendor -include/libdraw.h -include/libimage.h sys/cc sys/nixos @@ -20,14 +16,9 @@ sys/libdraw sys/libimage sys/libterm -sys/libutf/*-14.0.0.c - -sys/cmd/muc -sys/cmd/wm -sys/cmd/term2 - -bin/fasttree -bin/mafft +src/libutf/*-14.0.0.c .dep/ .clangd + +compile_commands.json @@ -13,8 +13,8 @@ BIN_DIR := bin SYS_DIR := sys LIB_DIR := lib SRC_DIR := src -OBJ_DIR := .build -TST_DIR := .test +OBJ_DIR := obj +TST_DIR := test # C runtime library CINIT := $(LIB_DIR)/crt/crt1.o $(LIB_DIR)/crt/x86_64/crti.o `gcc --print-file-name=crtbeginS.o` diff --git a/bin/gentags b/bin/gentags deleted file mode 100755 index d9019c9..0000000 --- a/bin/gentags +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# TAGS=".tag-files" - -# echo "finding files ..." -# ROOT=/home/nolln/root -# find $ROOT \ -# -path "$ROOT/sys/*.[chs]" -prune -o \ -# -path "$ROOT/vendor/musl/src/*.[chs]" -prune -o \ -# -path "$ROOT/include/*.h" \ -# -path "$ROOT/include/vendor/*.h" > "$TAGS" - -ctags -R -f .tags . - -# cscope -b -k -I include/vendor/libc -I include/ -i "$CSCOPE_DIR/files" - -# CSCOPE_DB="$ROOT/cscope.out" -# echo "exported CSCOPE_DB to: '$CSCOPE_DB'" diff --git a/bin/initmk b/bin/initmk deleted file mode 100755 index 2ea018f..0000000 --- a/bin/initmk +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/python - -import os -import sys - -NAME = "rules.mk" -TEMPLATE = """include share/push.mk -# Iterate through subdirectory tree - -# Local sources -SRCS_$(d) := -LIBS_$(d) := -BINS_$(d) := -TSTS_$(d) := - -include share/paths.mk - -# Local rules -# $(LIBS_$(d)) = TCFLAGS := -# $(LIBS_$(d)) = TCINCS := -# $(LIBS_$(d)) = TCLIBS := - -$(LIBS_$(d)): $(OBJS_$(d)) - $(ARCHIVE) - -$(BINS_$(d)): $(OBJS_$(d)) - $(LINK) - -$(UNTS_$(d)): $(TOBJS_$(d)) $(LIBS_$(d)) - $(LINK) - -include share/pop.mk""" - -if __name__ == "__main__": - if len(sys.argv) == 2: - dir = sys.argv[1] - if not os.path.exists(dir): - raise ValueError(f"path '{dir}' does not exist") - path = f"{dir}/{NAME}" - elif len(sys.argv) > 2: - raise ValueError("only one argument is accepted") - else: - path = NAME - try: - with open(path, 'x') as makefile: - makefile.write(f"{TEMPLATE}\n") - except: - print("rules.mk already present", file=sys.stderr) - exit(1) diff --git a/bin/updatedirs b/bin/updatedirs index cde7a6b..b304251 100755 --- a/bin/updatedirs +++ b/bin/updatedirs @@ -2,10 +2,10 @@ import os ROOT = "/home/nolln/u" -SRCS = ["src", "sys"] -BUILD = ".build" -TEST = ".test" -IGNORED = ["build", "include", "lib", "bin", ".git", "vendor", "obj", "dep", ".generated"] +SRC = "src" +BUILD = "obj" +TEST = "test" +IGNORED = ["include", "lib", "bin", ".git", "vendor", "obj", ".dep"] if __name__ == "__main__": if not os.path.exists(BUILD): @@ -14,10 +14,9 @@ if __name__ == "__main__": if not os.path.exists(TEST): os.mkdir(TEST) - for SRC in SRCS: - for root, dirs, _ in os.walk(f"{ROOT}/{SRC}"): - dirs[:] = [d for d in dirs if d not in IGNORED] - for newroot in [BUILD, TEST]: - blddir = f"{ROOT}/{newroot}/{SRC}/{root[len(ROOT)+len(SRC)+2:]}" - if not os.path.exists(blddir): - os.mkdir(blddir) + for root, dirs, _ in os.walk(f"{ROOT}/{SRC}"): + dirs[:] = [d for d in dirs if d not in IGNORED] + for newroot in [BUILD, TEST]: + blddir = f"{ROOT}/{newroot}/{root[len(ROOT)+len(SRC)+2:]}" + if not os.path.exists(blddir): + os.mkdir(blddir) @@ -13,7 +13,7 @@ debug: CINIT := debug: CFINI := debug: targets -release: CFLAGS += -O3 -mtune=native -flto -ffast-math #-DNDEBUG +release: CFLAGS += -O2 -mtune=native -flto -ffast-math #-DNDEBUG release: targets # Targets & array of sources & intermediates @@ -23,17 +23,14 @@ DEPS := LIBS := BINS := -UNTS := +TEST := GENS := # Iterate through directory tree -DIR := sys +DIR := src include $(DIR)/rules.mk -# DIR := src -# include $(DIR)/rules.mk - # Generic rules %.a: %.o $(ARCHIVE) @@ -41,16 +38,16 @@ include $(DIR)/rules.mk %: %.o $(LINK) -$(OBJ_DIR)/%.o: %.c +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(COMPILE) -$(OBJ_DIR)/%.o: %.s +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.s $(ASSEMBLE) -$(OBJ_DIR)/%: %.c +$(OBJ_DIR)/%: $(SRC_DIR)%.c $(COMPLNK) -targets: $(LIBS) $(BINS) $(UNTS) +targets: $(LIBS) $(BINS) $(TEST) clean: @echo removing object files @@ -64,7 +61,7 @@ clean: @echo removing binaries @rm -f $(BINS) @echo removing unit tests - @rm -f $(UNTS) + @rm -f $(TEST) install: targets @echo installing executables @@ -76,7 +73,7 @@ install: targets install $(LIBS) $(LIB_DIR); \ fi @echo installing terminfo - @tic -sx sys/cmd/term/term.info + @tic -sx cmd/term/term.info database: compiledb make -j4 diff --git a/share/paths.mk b/share/paths.mk index 91a101f..371ab7a 100644 --- a/share/paths.mk +++ b/share/paths.mk @@ -1,22 +1,25 @@ OBJS_$(d) := $(filter %.o, $(SRCS_$(d):.c=.o)) OBJS_$(d) += $(filter %.o, $(SRCS_$(d):.s=.o)) -OBJS_$(d) := $(addprefix $(OBJ_DIR)/, $(OBJS_$(d))) +OBJS_$(d) := $(patsubst $(SRC_DIR)/%, $(OBJ_DIR)/%, $(OBJS_$(d))) DEPS_$(d) := $(OBJS_$(d):.o=.d) -OBJS := $(OBJS) $(OBJS_$(d)) $(TOBJS_$(d)) +# Binary building + +OBJS += $(OBJS_$(d)) DEPS += $(DEPS_$(d)) -LIBS_$(d) := $(addprefix $(OBJ_DIR)/, $(LIBS_$(d))) +LIBS_$(d) := $(patsubst $(SRC_DIR)/%, $(OBJ_DIR)/%, $(LIBS_$(d))) LIBS += $(LIBS_$(d)) -BINS_$(d) := $(addprefix $(OBJ_DIR)/, $(BINS_$(d))) +BINS_$(d) := $(patsubst $(SRC_DIR)/%, $(OBJ_DIR)/%, $(BINS_$(d))) BINS += $(BINS_$(d)) # Testing infrastructure -TOBJS_$(d) := $(TSTS_$(d):.c=.o) -TOBJS_$(d) := $(addprefix $(OBJ_DIR)/, $(TOBJS_$(d))) +UNIT_$(d) := $(CHECK_$(d):.c=.o) +UNIT_$(d) := $(patsubst %(SRC_DIR)/%, $(OBJ_DIR)/%, $(UNIT_$(d))) +OBJS += $(UNIT_$(d)) -UNTS_$(d) := $(addprefix $(TST_DIR)/, $(TSTS_$(d):.c=)) -UNTS += $(UNTS_$(d)) +TEST_$(d) := $(patsubst $(SRC_DIR)/%, $(TEST_DIR)/%, $(TEST_$(d):.c=)) +TEST += $(TEST_$(d)) diff --git a/sys/base/arg.c b/src/base/arg.c index 269043e..269043e 100644 --- a/sys/base/arg.c +++ b/src/base/arg.c diff --git a/sys/base/bufio/dump.c b/src/base/bufio/dump.c index 0b527e2..0b527e2 100644 --- a/sys/base/bufio/dump.c +++ b/src/base/bufio/dump.c diff --git a/sys/base/bufio/get.c b/src/base/bufio/get.c index 9f10c88..9f10c88 100644 --- a/sys/base/bufio/get.c +++ b/src/base/bufio/get.c diff --git a/sys/base/bufio/internal.h b/src/base/bufio/internal.h index 302c035..302c035 100644 --- a/sys/base/bufio/internal.h +++ b/src/base/bufio/internal.h diff --git a/sys/base/bufio/read.c b/src/base/bufio/read.c index 09a9f83..09a9f83 100644 --- a/sys/base/bufio/read.c +++ b/src/base/bufio/read.c diff --git a/sys/base/bufio/reader.c b/src/base/bufio/reader.c index afdaf60..afdaf60 100644 --- a/sys/base/bufio/reader.c +++ b/src/base/bufio/reader.c diff --git a/sys/base/bufio/refill.h b/src/base/bufio/refill.h index 41e357e..41e357e 100644 --- a/sys/base/bufio/refill.h +++ b/src/base/bufio/refill.h diff --git a/sys/base/bufio/rules.mk b/src/base/bufio/rules.mk index 84f283f..84f283f 100644 --- a/sys/base/bufio/rules.mk +++ b/src/base/bufio/rules.mk diff --git a/sys/base/bufio/unget.c b/src/base/bufio/unget.c index 3fd16de..3fd16de 100644 --- a/sys/base/bufio/unget.c +++ b/src/base/bufio/unget.c diff --git a/sys/base/coro/coro.c b/src/base/coro/coro.c index 2255c99..2255c99 100644 --- a/sys/base/coro/coro.c +++ b/src/base/coro/coro.c diff --git a/sys/base/coro/internal.h b/src/base/coro/internal.h index f57d27b..f57d27b 100644 --- a/sys/base/coro/internal.h +++ b/src/base/coro/internal.h diff --git a/sys/base/coro/rules.mk b/src/base/coro/rules.mk index c2ee89f..c2ee89f 100644 --- a/sys/base/coro/rules.mk +++ b/src/base/coro/rules.mk diff --git a/sys/base/coro/unix_x64.s b/src/base/coro/unix_x64.s index d7de2a2..d7de2a2 100644 --- a/sys/base/coro/unix_x64.s +++ b/src/base/coro/unix_x64.s diff --git a/sys/base/error/errorf.c b/src/base/error/errorf.c index 193dd9d..193dd9d 100644 --- a/sys/base/error/errorf.c +++ b/src/base/error/errorf.c diff --git a/sys/base/error/exits.c b/src/base/error/exits.c index 6be7d3b..6be7d3b 100644 --- a/sys/base/error/exits.c +++ b/src/base/error/exits.c diff --git a/sys/base/error/internal.h b/src/base/error/internal.h index 88a8895..88a8895 100644 --- a/sys/base/error/internal.h +++ b/src/base/error/internal.h diff --git a/sys/base/error/panicf.c b/src/base/error/panicf.c index d698576..d698576 100644 --- a/sys/base/error/panicf.c +++ b/src/base/error/panicf.c diff --git a/sys/base/error/rules.mk b/src/base/error/rules.mk index e3a9ce0..e3a9ce0 100644 --- a/sys/base/error/rules.mk +++ b/src/base/error/rules.mk diff --git a/sys/base/error/verrorf.c b/src/base/error/verrorf.c index 15af064..15af064 100644 --- a/sys/base/error/verrorf.c +++ b/src/base/error/verrorf.c diff --git a/sys/base/error/vpanicf.c b/src/base/error/vpanicf.c index bea97ac..bea97ac 100644 --- a/sys/base/error/vpanicf.c +++ b/src/base/error/vpanicf.c diff --git a/sys/base/flate/internal.h b/src/base/flate/internal.h index 794c7c2..794c7c2 100644 --- a/sys/base/flate/internal.h +++ b/src/base/flate/internal.h diff --git a/sys/base/flate/read.c b/src/base/flate/read.c index 9a42070..9a42070 100644 --- a/sys/base/flate/read.c +++ b/src/base/flate/read.c diff --git a/sys/base/flate/reader.c b/src/base/flate/reader.c index 84f0d80..84f0d80 100644 --- a/sys/base/flate/reader.c +++ b/src/base/flate/reader.c diff --git a/sys/base/flate/rules.mk b/src/base/flate/rules.mk index 54d8c14..54d8c14 100644 --- a/sys/base/flate/rules.mk +++ b/src/base/flate/rules.mk diff --git a/sys/base/flate/write.c b/src/base/flate/write.c index 3f07b94..3f07b94 100644 --- a/sys/base/flate/write.c +++ b/src/base/flate/write.c diff --git a/sys/base/flate/writer.c b/src/base/flate/writer.c index f339ae0..f339ae0 100644 --- a/sys/base/flate/writer.c +++ b/src/base/flate/writer.c diff --git a/sys/base/fs/internal.h b/src/base/fs/internal.h index 7fde093..7fde093 100644 --- a/sys/base/fs/internal.h +++ b/src/base/fs/internal.h diff --git a/sys/base/fs/rules.mk b/src/base/fs/rules.mk index 3927ae3..3927ae3 100644 --- a/sys/base/fs/rules.mk +++ b/src/base/fs/rules.mk diff --git a/sys/base/fs/walk.c b/src/base/fs/walk.c index d528896..d528896 100644 --- a/sys/base/fs/walk.c +++ b/src/base/fs/walk.c diff --git a/sys/base/fs/walker.c b/src/base/fs/walker.c index 65ff391..65ff391 100644 --- a/sys/base/fs/walker.c +++ b/src/base/fs/walker.c diff --git a/sys/base/gz/flush.c b/src/base/gz/flush.c index 011a3ab..011a3ab 100644 --- a/sys/base/gz/flush.c +++ b/src/base/gz/flush.c diff --git a/sys/base/gz/get.c b/src/base/gz/get.c index 24ba23a..24ba23a 100644 --- a/sys/base/gz/get.c +++ b/src/base/gz/get.c diff --git a/sys/base/gz/interface.c b/src/base/gz/interface.c index 15b8f10..15b8f10 100644 --- a/sys/base/gz/interface.c +++ b/src/base/gz/interface.c diff --git a/sys/base/gz/internal.h b/src/base/gz/internal.h index 6a268c4..6a268c4 100644 --- a/sys/base/gz/internal.h +++ b/src/base/gz/internal.h diff --git a/sys/base/gz/open.c b/src/base/gz/open.c index c84ce5e..c84ce5e 100644 --- a/sys/base/gz/open.c +++ b/src/base/gz/open.c diff --git a/sys/base/gz/printf.c b/src/base/gz/printf.c index d7f75cf..d7f75cf 100644 --- a/sys/base/gz/printf.c +++ b/src/base/gz/printf.c diff --git a/sys/base/gz/put.c b/src/base/gz/put.c index fa9807d..fa9807d 100644 --- a/sys/base/gz/put.c +++ b/src/base/gz/put.c diff --git a/sys/base/gz/putstring.c b/src/base/gz/putstring.c index 64ff470..64ff470 100644 --- a/sys/base/gz/putstring.c +++ b/src/base/gz/putstring.c diff --git a/sys/base/gz/read.c b/src/base/gz/read.c index 112fe4d..112fe4d 100644 --- a/sys/base/gz/read.c +++ b/src/base/gz/read.c diff --git a/sys/base/gz/rules.mk b/src/base/gz/rules.mk index a933291..a933291 100644 --- a/sys/base/gz/rules.mk +++ b/src/base/gz/rules.mk diff --git a/sys/base/gz/seek.c b/src/base/gz/seek.c index 328886d..328886d 100644 --- a/sys/base/gz/seek.c +++ b/src/base/gz/seek.c diff --git a/sys/base/gz/write.c b/src/base/gz/write.c index 862d833..862d833 100644 --- a/sys/base/gz/write.c +++ b/src/base/gz/write.c diff --git a/sys/base/io/fd.c b/src/base/io/fd.c index ded1b02..ded1b02 100644 --- a/sys/base/io/fd.c +++ b/src/base/io/fd.c diff --git a/sys/base/io/flush.c b/src/base/io/flush.c index 0f1217a..0f1217a 100644 --- a/sys/base/io/flush.c +++ b/src/base/io/flush.c diff --git a/sys/base/io/get.c b/src/base/io/get.c index d4e52f8..d4e52f8 100644 --- a/sys/base/io/get.c +++ b/src/base/io/get.c diff --git a/sys/base/io/interface.c b/src/base/io/interface.c index bead9e1..bead9e1 100644 --- a/sys/base/io/interface.c +++ b/src/base/io/interface.c diff --git a/sys/base/io/internal.h b/src/base/io/internal.h index 302c035..302c035 100644 --- a/sys/base/io/internal.h +++ b/src/base/io/internal.h diff --git a/sys/base/io/open.c b/src/base/io/open.c index e50e334..e50e334 100644 --- a/sys/base/io/open.c +++ b/src/base/io/open.c diff --git a/sys/base/io/putbyte.c b/src/base/io/putbyte.c index 2350a8d..2350a8d 100644 --- a/sys/base/io/putbyte.c +++ b/src/base/io/putbyte.c diff --git a/sys/base/io/putstring.c b/src/base/io/putstring.c index 53fa993..53fa993 100644 --- a/sys/base/io/putstring.c +++ b/src/base/io/putstring.c diff --git a/sys/base/io/read.c b/src/base/io/read.c index b0ed3d2..b0ed3d2 100644 --- a/sys/base/io/read.c +++ b/src/base/io/read.c diff --git a/sys/base/io/readln.c b/src/base/io/readln.c index 283472d..283472d 100644 --- a/sys/base/io/readln.c +++ b/src/base/io/readln.c diff --git a/sys/base/io/rules.mk b/src/base/io/rules.mk index 2e03ca5..2e03ca5 100644 --- a/sys/base/io/rules.mk +++ b/src/base/io/rules.mk diff --git a/sys/base/io/seek.c b/src/base/io/seek.c index d0e7488..d0e7488 100644 --- a/sys/base/io/seek.c +++ b/src/base/io/seek.c diff --git a/sys/base/io/stat.c b/src/base/io/stat.c index d86f1ee..d86f1ee 100644 --- a/sys/base/io/stat.c +++ b/src/base/io/stat.c diff --git a/sys/base/io/tell.c b/src/base/io/tell.c index 1c50439..1c50439 100644 --- a/sys/base/io/tell.c +++ b/src/base/io/tell.c diff --git a/sys/base/io/unget.c b/src/base/io/unget.c index 5ec3536..5ec3536 100644 --- a/sys/base/io/unget.c +++ b/src/base/io/unget.c diff --git a/sys/base/io/write.c b/src/base/io/write.c index 63df664..63df664 100644 --- a/sys/base/io/write.c +++ b/src/base/io/write.c diff --git a/sys/base/mem/arena.c b/src/base/mem/arena.c index b2ce044..b2ce044 100644 --- a/sys/base/mem/arena.c +++ b/src/base/mem/arena.c diff --git a/sys/base/mem/buffer.c b/src/base/mem/buffer.c index b684d35..b684d35 100644 --- a/sys/base/mem/buffer.c +++ b/src/base/mem/buffer.c diff --git a/sys/base/mem/interface.c b/src/base/mem/interface.c index 4d7d1ce..4d7d1ce 100644 --- a/sys/base/mem/interface.c +++ b/src/base/mem/interface.c diff --git a/sys/base/mem/internal.h b/src/base/mem/internal.h index 302c035..302c035 100644 --- a/sys/base/mem/internal.h +++ b/src/base/mem/internal.h diff --git a/sys/base/mem/rules.mk b/src/base/mem/rules.mk index b912d0c..b912d0c 100644 --- a/sys/base/mem/rules.mk +++ b/src/base/mem/rules.mk diff --git a/sys/base/mem/set64.c b/src/base/mem/set64.c index 464b3ad..464b3ad 100644 --- a/sys/base/mem/set64.c +++ b/src/base/mem/set64.c diff --git a/sys/base/mmap/internal.h b/src/base/mmap/internal.h index 7606c7e..7606c7e 100644 --- a/sys/base/mmap/internal.h +++ b/src/base/mmap/internal.h diff --git a/sys/base/mmap/mmap.c b/src/base/mmap/mmap.c index ce3011c..ce3011c 100644 --- a/sys/base/mmap/mmap.c +++ b/src/base/mmap/mmap.c diff --git a/sys/base/mmap/rules.mk b/src/base/mmap/rules.mk index fb3cab5..fb3cab5 100644 --- a/sys/base/mmap/rules.mk +++ b/src/base/mmap/rules.mk diff --git a/sys/base/os/basename.c b/src/base/os/basename.c index b5bb343..b5bb343 100644 --- a/sys/base/os/basename.c +++ b/src/base/os/basename.c diff --git a/sys/base/os/exists.c b/src/base/os/exists.c index a3c8935..a3c8935 100644 --- a/sys/base/os/exists.c +++ b/src/base/os/exists.c diff --git a/sys/base/os/internal.h b/src/base/os/internal.h index 302c035..302c035 100644 --- a/sys/base/os/internal.h +++ b/src/base/os/internal.h diff --git a/sys/base/os/rules.mk b/src/base/os/rules.mk index bf1e71d..bf1e71d 100644 --- a/sys/base/os/rules.mk +++ b/src/base/os/rules.mk diff --git a/sys/base/os/sep.c b/src/base/os/sep.c index 750e627..750e627 100644 --- a/sys/base/os/sep.c +++ b/src/base/os/sep.c diff --git a/sys/base/rng/base.c b/src/base/rng/base.c index 9ec496e..9ec496e 100644 --- a/sys/base/rng/base.c +++ b/src/base/rng/base.c diff --git a/sys/base/rng/bernoulli.c b/src/base/rng/bernoulli.c index 02f531e..02f531e 100644 --- a/sys/base/rng/bernoulli.c +++ b/src/base/rng/bernoulli.c diff --git a/sys/base/rng/exponential.c b/src/base/rng/exponential.c index c07e007..c07e007 100644 --- a/sys/base/rng/exponential.c +++ b/src/base/rng/exponential.c diff --git a/sys/base/rng/internal.h b/src/base/rng/internal.h index 9cf5f41..9cf5f41 100644 --- a/sys/base/rng/internal.h +++ b/src/base/rng/internal.h diff --git a/sys/base/rng/normal.c b/src/base/rng/normal.c index aab5731..aab5731 100644 --- a/sys/base/rng/normal.c +++ b/src/base/rng/normal.c diff --git a/sys/base/rng/poisson.c b/src/base/rng/poisson.c index 3ec15c9..3ec15c9 100644 --- a/sys/base/rng/poisson.c +++ b/src/base/rng/poisson.c diff --git a/sys/base/rng/random.c b/src/base/rng/random.c index bd1bd6b..bd1bd6b 100644 --- a/sys/base/rng/random.c +++ b/src/base/rng/random.c diff --git a/sys/base/rng/rules.mk b/src/base/rng/rules.mk index 407b1bf..407b1bf 100644 --- a/sys/base/rng/rules.mk +++ b/src/base/rng/rules.mk diff --git a/sys/base/rules.mk b/src/base/rules.mk index 1726aa3..847e4d8 100644 --- a/sys/base/rules.mk +++ b/src/base/rules.mk @@ -2,8 +2,9 @@ include share/push.mk # Iterate through subdirectory tree -# Local sources -SRCS_$(d) := $(d)/arg.c +# local sources +SRCS_$(d):=\ + $(d)/arg.c include $(d)/bufio/rules.mk include $(d)/coro/rules.mk include $(d)/error/rules.mk @@ -17,10 +18,10 @@ include $(d)/os/rules.mk include $(d)/rng/rules.mk include $(d)/sort/rules.mk include $(d)/string/rules.mk +CHECK_$(d):=\ + $(d)/test.c - -TSTS_$(d) := $(d)/test.c - +# outputs LIBS_$(d) := $(d)/base.a BINS_$(d) := @@ -29,8 +30,8 @@ include share/paths.mk $(LIBS_$(d)): $(OBJS_$(d)) $(ARCHIVE) -$(UNTS_$(d)): TCLIBS := $(LIBS_$(d)) -$(UNTS_$(d)): $(TOBJS_$(d)) $(LIBS_$(d)) +$(TEST_$(d)): TCLIBS := $(LIBS_$(d)) +$(TEST_$(d)): $(UNIT_$(d)) $(LIBS_$(d)) $(LINK) include share/pop.mk diff --git a/sys/base/sort/double.c b/src/base/sort/double.c index c3feac2..c3feac2 100644 --- a/sys/base/sort/double.c +++ b/src/base/sort/double.c diff --git a/sys/base/sort/float.c b/src/base/sort/float.c index 57bd482..57bd482 100644 --- a/sys/base/sort/float.c +++ b/src/base/sort/float.c diff --git a/sys/base/sort/int.c b/src/base/sort/int.c index 33e1def..33e1def 100644 --- a/sys/base/sort/int.c +++ b/src/base/sort/int.c diff --git a/sys/base/sort/int16.c b/src/base/sort/int16.c index 072a3eb..072a3eb 100644 --- a/sys/base/sort/int16.c +++ b/src/base/sort/int16.c diff --git a/sys/base/sort/int32.c b/src/base/sort/int32.c index 27b3b7b..27b3b7b 100644 --- a/sys/base/sort/int32.c +++ b/src/base/sort/int32.c diff --git a/sys/base/sort/int64.c b/src/base/sort/int64.c index b3fa5d4..b3fa5d4 100644 --- a/sys/base/sort/int64.c +++ b/src/base/sort/int64.c diff --git a/sys/base/sort/int8.c b/src/base/sort/int8.c index 5848e6e..5848e6e 100644 --- a/sys/base/sort/int8.c +++ b/src/base/sort/int8.c diff --git a/sys/base/sort/internal.h b/src/base/sort/internal.h index ac569de..ac569de 100644 --- a/sys/base/sort/internal.h +++ b/src/base/sort/internal.h diff --git a/sys/base/sort/rules.mk b/src/base/sort/rules.mk index 780d6ea..780d6ea 100644 --- a/sys/base/sort/rules.mk +++ b/src/base/sort/rules.mk diff --git a/sys/base/sort/string.c b/src/base/sort/string.c index b511efa..b511efa 100644 --- a/sys/base/sort/string.c +++ b/src/base/sort/string.c diff --git a/sys/base/sort/uint.c b/src/base/sort/uint.c index 5b27330..5b27330 100644 --- a/sys/base/sort/uint.c +++ b/src/base/sort/uint.c diff --git a/sys/base/sort/uint16.c b/src/base/sort/uint16.c index 2b635b4..2b635b4 100644 --- a/sys/base/sort/uint16.c +++ b/src/base/sort/uint16.c diff --git a/sys/base/sort/uint32.c b/src/base/sort/uint32.c index 99a58cf..99a58cf 100644 --- a/sys/base/sort/uint32.c +++ b/src/base/sort/uint32.c diff --git a/sys/base/sort/uint64.c b/src/base/sort/uint64.c index 2769825..2769825 100644 --- a/sys/base/sort/uint64.c +++ b/src/base/sort/uint64.c diff --git a/sys/base/sort/uint8.c b/src/base/sort/uint8.c index ff02b3c..ff02b3c 100644 --- a/sys/base/sort/uint8.c +++ b/src/base/sort/uint8.c diff --git a/sys/base/string/append.c b/src/base/string/append.c index d4d0396..d4d0396 100644 --- a/sys/base/string/append.c +++ b/src/base/string/append.c diff --git a/sys/base/string/appendf.c b/src/base/string/appendf.c index 4b8d76c..4b8d76c 100644 --- a/sys/base/string/appendf.c +++ b/src/base/string/appendf.c diff --git a/sys/base/string/clear.c b/src/base/string/clear.c index 986f809..986f809 100644 --- a/sys/base/string/clear.c +++ b/src/base/string/clear.c diff --git a/sys/base/string/copyn.c b/src/base/string/copyn.c index 09c2879..09c2879 100644 --- a/sys/base/string/copyn.c +++ b/src/base/string/copyn.c diff --git a/sys/base/string/equals.c b/src/base/string/equals.c index a975cf5..a975cf5 100644 --- a/sys/base/string/equals.c +++ b/src/base/string/equals.c diff --git a/sys/base/string/find.c b/src/base/string/find.c index 20f990e..20f990e 100644 --- a/sys/base/string/find.c +++ b/src/base/string/find.c diff --git a/sys/base/string/fit.c b/src/base/string/fit.c index 56ab041..56ab041 100644 --- a/sys/base/string/fit.c +++ b/src/base/string/fit.c diff --git a/sys/base/string/free.c b/src/base/string/free.c index 7b5ee98..7b5ee98 100644 --- a/sys/base/string/free.c +++ b/src/base/string/free.c diff --git a/sys/base/string/grow.c b/src/base/string/grow.c index 39a9d2f..39a9d2f 100644 --- a/sys/base/string/grow.c +++ b/src/base/string/grow.c diff --git a/sys/base/string/internal.h b/src/base/string/internal.h index 8c16c64..8c16c64 100644 --- a/sys/base/string/internal.h +++ b/src/base/string/internal.h diff --git a/sys/base/string/join.c b/src/base/string/join.c index fb97b6c..fb97b6c 100644 --- a/sys/base/string/join.c +++ b/src/base/string/join.c diff --git a/sys/base/string/len.c b/src/base/string/len.c index 5e42919..5e42919 100644 --- a/sys/base/string/len.c +++ b/src/base/string/len.c diff --git a/sys/base/string/lower.c b/src/base/string/lower.c index c6935f8..c6935f8 100644 --- a/sys/base/string/lower.c +++ b/src/base/string/lower.c diff --git a/sys/base/string/make.c b/src/base/string/make.c index eb71543..eb71543 100644 --- a/sys/base/string/make.c +++ b/src/base/string/make.c diff --git a/sys/base/string/makef.c b/src/base/string/makef.c index 8fb9c38..8fb9c38 100644 --- a/sys/base/string/makef.c +++ b/src/base/string/makef.c diff --git a/sys/base/string/read.c b/src/base/string/read.c index df2028f..df2028f 100644 --- a/sys/base/string/read.c +++ b/src/base/string/read.c diff --git a/sys/base/string/replace.c b/src/base/string/replace.c index 127daed..127daed 100644 --- a/sys/base/string/replace.c +++ b/src/base/string/replace.c diff --git a/sys/base/string/rules.mk b/src/base/string/rules.mk index e517ca5..e517ca5 100644 --- a/sys/base/string/rules.mk +++ b/src/base/string/rules.mk diff --git a/sys/base/string/split.c b/src/base/string/split.c index 2aa68b4..2aa68b4 100644 --- a/sys/base/string/split.c +++ b/src/base/string/split.c diff --git a/sys/base/string/upper.c b/src/base/string/upper.c index ab692c1..ab692c1 100644 --- a/sys/base/string/upper.c +++ b/src/base/string/upper.c diff --git a/sys/base/test.c b/src/base/test.c index a29be1d..a29be1d 100644 --- a/sys/base/test.c +++ b/src/base/test.c diff --git a/sys/cmd/cc/ast.c b/src/cmd/cc/ast.c index 4330bcc..4330bcc 100644 --- a/sys/cmd/cc/ast.c +++ b/src/cmd/cc/ast.c diff --git a/sys/cmd/cc/bits.c b/src/cmd/cc/bits.c index 4b405dc..4b405dc 100644 --- a/sys/cmd/cc/bits.c +++ b/src/cmd/cc/bits.c diff --git a/sys/cmd/cc/cc.c b/src/cmd/cc/cc.c index 8ad0022..8ad0022 100644 --- a/sys/cmd/cc/cc.c +++ b/src/cmd/cc/cc.c diff --git a/sys/cmd/cc/cc.h b/src/cmd/cc/cc.h index 8fc5f73..8fc5f73 100644 --- a/sys/cmd/cc/cc.h +++ b/src/cmd/cc/cc.h diff --git a/sys/cmd/cc/lex.c b/src/cmd/cc/lex.c index 33fc5d0..33fc5d0 100644 --- a/sys/cmd/cc/lex.c +++ b/src/cmd/cc/lex.c diff --git a/sys/cmd/cc/pp.c b/src/cmd/cc/pp.c index 57c3501..57c3501 100644 --- a/sys/cmd/cc/pp.c +++ b/src/cmd/cc/pp.c diff --git a/sys/cmd/cc/rules.mk b/src/cmd/cc/rules.mk index 34df34d..b7b4688 100644 --- a/sys/cmd/cc/rules.mk +++ b/src/cmd/cc/rules.mk @@ -1,18 +1,16 @@ include share/push.mk -# Iterate through subdirectory tree -# Local sources -SRCS_$(d) := \ - $(d)/pp.c \ - $(d)/lex.c \ - $(d)/ast.c \ - $(d)/bits.c \ +# local sources +SRCS_$(d):=\ + $(d)/pp.c\ + $(d)/lex.c\ + $(d)/ast.c\ + $(d)/bits.c\ $(d)/cc.c +TEST_$(d) := - -LIBS_$(d) := +# outputs BINS_$(d) := $(d)/cc -UNTS_$(d) := include share/paths.mk diff --git a/sys/cmd/cc/scratch.c b/src/cmd/cc/scratch.c index b37d9a5..b37d9a5 100644 --- a/sys/cmd/cc/scratch.c +++ b/src/cmd/cc/scratch.c diff --git a/sys/cmd/cc/util.c b/src/cmd/cc/util.c index cca16f2..cca16f2 100644 --- a/sys/cmd/cc/util.c +++ b/src/cmd/cc/util.c diff --git a/sys/cmd/dwm/LICENSE b/src/cmd/dwm/LICENSE index d221f09..d221f09 100644 --- a/sys/cmd/dwm/LICENSE +++ b/src/cmd/dwm/LICENSE diff --git a/sys/cmd/dwm/client.c b/src/cmd/dwm/client.c index fa04f5f..fa04f5f 100644 --- a/sys/cmd/dwm/client.c +++ b/src/cmd/dwm/client.c diff --git a/sys/cmd/dwm/config.h b/src/cmd/dwm/config.h index 1f82b1f..1f82b1f 100644 --- a/sys/cmd/dwm/config.h +++ b/src/cmd/dwm/config.h diff --git a/sys/cmd/dwm/drw.c b/src/cmd/dwm/drw.c index a6d6902..a6d6902 100644 --- a/sys/cmd/dwm/drw.c +++ b/src/cmd/dwm/drw.c diff --git a/sys/cmd/dwm/dwm.c b/src/cmd/dwm/dwm.c index 0567650..0567650 100644 --- a/sys/cmd/dwm/dwm.c +++ b/src/cmd/dwm/dwm.c diff --git a/sys/cmd/dwm/dwm.h b/src/cmd/dwm/dwm.h index afec1f2..afec1f2 100644 --- a/sys/cmd/dwm/dwm.h +++ b/src/cmd/dwm/dwm.h diff --git a/sys/cmd/dwm/hook.c b/src/cmd/dwm/hook.c index 9758965..9758965 100644 --- a/sys/cmd/dwm/hook.c +++ b/src/cmd/dwm/hook.c diff --git a/src/cmd/dwm/rules.mk b/src/cmd/dwm/rules.mk new file mode 100644 index 0000000..a840217 --- /dev/null +++ b/src/cmd/dwm/rules.mk @@ -0,0 +1,29 @@ +include share/push.mk + +# local sources +SRCS_$(d):=\ + $(d)/drw.c\ + $(d)/hook.c\ + $(d)/client.c\ + $(d)/util.c\ + $(d)/dwm.c + +# outputs +BINS_$(d) := $(d)/dwm + +include share/paths.mk + +# Local rules +include share/dynamic.mk +$(BINS_$(d)): TCFLAGS=\ + `$(PKG) --cflags fontconfig`\ + `$(PKG) --cflags freetype2` +$(BINS_$(d)): TCLIBS=\ + `$(PKG) --libs fontconfig`\ + `$(PKG) --libs freetype2`\ + -lX11 -lXinerama -lXft -lX11-xcb -lxcb -lxcb-res + +$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/libutf/libutf.a $(OBJ_DIR)/base/base.a + $(COMPLINK) + +include share/pop.mk diff --git a/sys/cmd/dwm/util.c b/src/cmd/dwm/util.c index 0db71cc..0db71cc 100644 --- a/sys/cmd/dwm/util.c +++ b/src/cmd/dwm/util.c diff --git a/sys/cmd/filter/filter.c b/src/cmd/filter/filter.c index abc9a88..abc9a88 100644 --- a/sys/cmd/filter/filter.c +++ b/src/cmd/filter/filter.c diff --git a/src/cmd/filter/rules.mk b/src/cmd/filter/rules.mk new file mode 100644 index 0000000..13ddd56 --- /dev/null +++ b/src/cmd/filter/rules.mk @@ -0,0 +1,14 @@ +include share/push.mk + +# local sources +SRCS_$(d):=$(d)/filter.c +# outputs +BINS_$(d):=$(d)/filter + +include share/paths.mk + +# Local rules +$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/base/base.a + $(COMPLINK) + +include share/pop.mk diff --git a/sys/cmd/ic/LICENSE b/src/cmd/ic/LICENSE index a5816a8..a5816a8 100644 --- a/sys/cmd/ic/LICENSE +++ b/src/cmd/ic/LICENSE diff --git a/sys/cmd/ic/ic.1 b/src/cmd/ic/ic.1 index 3302dad..3302dad 100644 --- a/sys/cmd/ic/ic.1 +++ b/src/cmd/ic/ic.1 diff --git a/sys/cmd/ic/ic.c b/src/cmd/ic/ic.c index 7fc37d8..7fc37d8 100644 --- a/sys/cmd/ic/ic.c +++ b/src/cmd/ic/ic.c diff --git a/sys/cmd/ic/rules.mk b/src/cmd/ic/rules.mk index 649c9ac..d001c01 100644 --- a/sys/cmd/ic/rules.mk +++ b/src/cmd/ic/rules.mk @@ -2,13 +2,13 @@ include share/push.mk # Iterate through subdirectory tree # Local sources -SRCS_$(d) := $(d)/strlcpy.c $(d)/ic.c -BINS_$(d) := $(d)/ic +SRCS_$(d):=$(d)/strlcpy.c $(d)/ic.c +BINS_$(d):=$(d)/ic include share/paths.mk # Local rules -$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/base/base.a +$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/base/base.a $(COMPLINK) include share/pop.mk diff --git a/sys/cmd/ic/strlcpy.c b/src/cmd/ic/strlcpy.c index 5af7906..5af7906 100644 --- a/sys/cmd/ic/strlcpy.c +++ b/src/cmd/ic/strlcpy.c diff --git a/sys/cmd/menu/LICENSE b/src/cmd/menu/LICENSE index 9762166..9762166 100644 --- a/sys/cmd/menu/LICENSE +++ b/src/cmd/menu/LICENSE diff --git a/sys/cmd/menu/config.h b/src/cmd/menu/config.h index 9bfd5b3..9bfd5b3 100644 --- a/sys/cmd/menu/config.h +++ b/src/cmd/menu/config.h diff --git a/sys/cmd/menu/drw.c b/src/cmd/menu/drw.c index 162fe40..162fe40 100644 --- a/sys/cmd/menu/drw.c +++ b/src/cmd/menu/drw.c diff --git a/sys/cmd/menu/drw.h b/src/cmd/menu/drw.h index 4c67419..4c67419 100644 --- a/sys/cmd/menu/drw.h +++ b/src/cmd/menu/drw.h diff --git a/sys/cmd/menu/menu.c b/src/cmd/menu/menu.c index e6e4bb2..e6e4bb2 100644 --- a/sys/cmd/menu/menu.c +++ b/src/cmd/menu/menu.c diff --git a/sys/cmd/menu/menu.h b/src/cmd/menu/menu.h index f4345bb..f4345bb 100644 --- a/sys/cmd/menu/menu.h +++ b/src/cmd/menu/menu.h diff --git a/src/cmd/menu/rules.mk b/src/cmd/menu/rules.mk new file mode 100644 index 0000000..f9b59aa --- /dev/null +++ b/src/cmd/menu/rules.mk @@ -0,0 +1,27 @@ +include share/push.mk +# Iterate through subdirectory tree + +# Local sources +SRCS_$(d):=\ + $(d)/menu.c\ + $(d)/drw.c\ + $(d)/util.c + +#outputs +BINS_$(d):=$(d)/menu + +include share/paths.mk + +# Local rules +include share/dynamic.mk + +$(BINS_$(d)): TCLIBS=\ + -lfontconfig -lXft -lXinerama -lX11 +$(BINS_$(d)): TCINCS=\ + `$(PKG) --cflags fontconfig`\ + `$(PKG) --cflags freetype2` + +$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/base/base.a + $(COMPLINK) + +include share/pop.mk diff --git a/sys/cmd/menu/util.c b/src/cmd/menu/util.c index 14bfe1c..14bfe1c 100644 --- a/sys/cmd/menu/util.c +++ b/src/cmd/menu/util.c diff --git a/sys/cmd/rc/code.c b/src/cmd/rc/code.c index 786f284..786f284 100644 --- a/sys/cmd/rc/code.c +++ b/src/cmd/rc/code.c diff --git a/sys/cmd/rc/exec.c b/src/cmd/rc/exec.c index 5baaf1a..5baaf1a 100644 --- a/sys/cmd/rc/exec.c +++ b/src/cmd/rc/exec.c diff --git a/sys/cmd/rc/exec.h b/src/cmd/rc/exec.h index a3a6ae9..a3a6ae9 100644 --- a/sys/cmd/rc/exec.h +++ b/src/cmd/rc/exec.h diff --git a/sys/cmd/rc/input.c b/src/cmd/rc/input.c index cc2383d..cc2383d 100644 --- a/sys/cmd/rc/input.c +++ b/src/cmd/rc/input.c diff --git a/sys/cmd/rc/io.c b/src/cmd/rc/io.c index dc81c2e..dc81c2e 100644 --- a/sys/cmd/rc/io.c +++ b/src/cmd/rc/io.c diff --git a/sys/cmd/rc/job.c b/src/cmd/rc/job.c index 1587951..1587951 100644 --- a/sys/cmd/rc/job.c +++ b/src/cmd/rc/job.c diff --git a/sys/cmd/rc/lex.c b/src/cmd/rc/lex.c index 9ca2453..9ca2453 100644 --- a/sys/cmd/rc/lex.c +++ b/src/cmd/rc/lex.c diff --git a/sys/cmd/rc/main.c b/src/cmd/rc/main.c index 2c0aa42..2c0aa42 100644 --- a/sys/cmd/rc/main.c +++ b/src/cmd/rc/main.c diff --git a/sys/cmd/rc/parse.c b/src/cmd/rc/parse.c index 1b29d41..1b29d41 100644 --- a/sys/cmd/rc/parse.c +++ b/src/cmd/rc/parse.c diff --git a/sys/cmd/rc/parse.h b/src/cmd/rc/parse.h index 64ee07b..64ee07b 100644 --- a/sys/cmd/rc/parse.h +++ b/src/cmd/rc/parse.h diff --git a/sys/cmd/rc/prompt.c b/src/cmd/rc/prompt.c index 1122d54..1122d54 100644 --- a/sys/cmd/rc/prompt.c +++ b/src/cmd/rc/prompt.c diff --git a/sys/cmd/rc/rc.h b/src/cmd/rc/rc.h index 9b415fc..9b415fc 100644 --- a/sys/cmd/rc/rc.h +++ b/src/cmd/rc/rc.h diff --git a/sys/cmd/rc/rules.mk b/src/cmd/rc/rules.mk index a2fd058..76837fc 100644 --- a/sys/cmd/rc/rules.mk +++ b/src/cmd/rc/rules.mk @@ -1,8 +1,8 @@ include share/push.mk # Iterate through subdirectory tree -# Local sources -SRCS_$(d) :=\ +# local sources +SRCS_$(d):=\ $(d)/util.c\ $(d)/input.c\ $(d)/prompt.c\ @@ -18,14 +18,15 @@ SRCS_$(d) :=\ $(d)/exec.c\ $(d)/main.c +# local targets BINS_$(d) := $(d)/rc include share/paths.mk $(d)/parse.h $(d)/parse.c: $(d)/syntax.y yacc --header=$(<D)/parse.h --output=$(<D)/parse.c $(<) -# Local rules -$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/libutf/libutf.a $(OBJ_DIR)/sys/base/base.a $(d)/parse.h +# local rules +$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/libutf/libutf.a $(OBJ_DIR)/base/base.a $(d)/parse.h $(COMPLINK) include share/pop.mk diff --git a/sys/cmd/rc/syntax.y b/src/cmd/rc/syntax.y index 0bdc776..0bdc776 100644 --- a/sys/cmd/rc/syntax.y +++ b/src/cmd/rc/syntax.y diff --git a/sys/cmd/rc/sys.c b/src/cmd/rc/sys.c index 807359d..807359d 100644 --- a/sys/cmd/rc/sys.c +++ b/src/cmd/rc/sys.c diff --git a/sys/cmd/rc/tree.c b/src/cmd/rc/tree.c index 2c65041..2c65041 100644 --- a/sys/cmd/rc/tree.c +++ b/src/cmd/rc/tree.c diff --git a/sys/cmd/rc/util.c b/src/cmd/rc/util.c index b0be788..b0be788 100644 --- a/sys/cmd/rc/util.c +++ b/src/cmd/rc/util.c diff --git a/sys/cmd/rc/var.c b/src/cmd/rc/var.c index 3e9635f..3e9635f 100644 --- a/sys/cmd/rc/var.c +++ b/src/cmd/rc/var.c diff --git a/sys/cmd/rc/wait.c b/src/cmd/rc/wait.c index 911601c..911601c 100644 --- a/sys/cmd/rc/wait.c +++ b/src/cmd/rc/wait.c diff --git a/sys/cmd/rules.mk b/src/cmd/rules.mk index 52a059b..72cd0ce 100644 --- a/sys/cmd/rules.mk +++ b/src/cmd/rules.mk @@ -14,25 +14,19 @@ include $(DIR)/rules.mk DIR := $(d)/filter include $(DIR)/rules.mk -# DIR := $(d)/test -# include $(DIR)/rules.mk - DIR := $(d)/ic include $(DIR)/rules.mk DIR := $(d)/dwm include $(DIR)/rules.mk -DIR := $(d)/wm -include $(DIR)/rules.mk - DIR := $(d)/menu include $(DIR)/rules.mk DIR := $(d)/term include $(DIR)/rules.mk -# DIR := $(d)/term2 +# DIR := $(d)/wm # include $(DIR)/rules.mk include share/pop.mk diff --git a/sys/cmd/term/LICENSE b/src/cmd/term/LICENSE index c356c39..c356c39 100644 --- a/sys/cmd/term/LICENSE +++ b/src/cmd/term/LICENSE diff --git a/sys/cmd/term/config.h b/src/cmd/term/config.h index a740ecf..a740ecf 100644 --- a/sys/cmd/term/config.h +++ b/src/cmd/term/config.h diff --git a/sys/cmd/term/hb.c b/src/cmd/term/hb.c index 4b6b42d..4b6b42d 100644 --- a/sys/cmd/term/hb.c +++ b/src/cmd/term/hb.c diff --git a/sys/cmd/term/nonspacing.h b/src/cmd/term/nonspacing.h index 5d05a3d..5d05a3d 100644 --- a/sys/cmd/term/nonspacing.h +++ b/src/cmd/term/nonspacing.h diff --git a/src/cmd/term/rules.mk b/src/cmd/term/rules.mk new file mode 100644 index 0000000..76701ec --- /dev/null +++ b/src/cmd/term/rules.mk @@ -0,0 +1,26 @@ +include share/push.mk + +# local sources +SRCS_$(d) := $(d)/term.c $(d)/x.c #$(d)/hb.c + +# local outputs +BINS_$(d) := $(d)/term + +include share/paths.mk + +# Local rules +include share/dynamic.mk + +$(BINS_$(d)): TCFLAGS=\ + `$(PKG) --cflags fontconfig`\ + `$(PKG) --cflags freetype2` + +$(BINS_$(d)): TCLIBS=\ + `$(PKG) --libs fontconfig`\ + `$(PKG) --libs freetype2`\ + -lm -lrt -lX11 -lutil -lXft -lXrender #-lharfbuzz + +$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/libutf/libutf.a $(OBJ_DIR)/base/base.a + $(COMPLINK) + +include share/pop.mk diff --git a/sys/cmd/term/term.c b/src/cmd/term/term.c index 50ab29c..50ab29c 100644 --- a/sys/cmd/term/term.c +++ b/src/cmd/term/term.c diff --git a/sys/cmd/term/term.h b/src/cmd/term/term.h index 6784974..6784974 100644 --- a/sys/cmd/term/term.h +++ b/src/cmd/term/term.h diff --git a/sys/cmd/term/term.info b/src/cmd/term/term.info index 7b90344..7b90344 100644 --- a/sys/cmd/term/term.info +++ b/src/cmd/term/term.info diff --git a/sys/cmd/term/util.c b/src/cmd/term/util.c index 3e7d81b..3e7d81b 100644 --- a/sys/cmd/term/util.c +++ b/src/cmd/term/util.c diff --git a/sys/cmd/term/wide.h b/src/cmd/term/wide.h index e403c9a..e403c9a 100644 --- a/sys/cmd/term/wide.h +++ b/src/cmd/term/wide.h diff --git a/sys/cmd/term/x.c b/src/cmd/term/x.c index 27a2e7a..27a2e7a 100644 --- a/sys/cmd/term/x.c +++ b/src/cmd/term/x.c diff --git a/src/cmd/walk/rules.mk b/src/cmd/walk/rules.mk new file mode 100644 index 0000000..cb9768c --- /dev/null +++ b/src/cmd/walk/rules.mk @@ -0,0 +1,15 @@ +include share/push.mk + +# local sources +SRCS_$(d):=$(d)/walk.c + +# local outputs +BINS_$(d):=$(d)/walk + +include share/paths.mk + +# Local rules +$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/base/base.a + $(COMPLINK) + +include share/pop.mk diff --git a/sys/cmd/walk/walk.c b/src/cmd/walk/walk.c index c68d6e0..c68d6e0 100644 --- a/sys/cmd/walk/walk.c +++ b/src/cmd/walk/walk.c diff --git a/sys/cmd/wm/arg.c b/src/cmd/wm/arg.c index e69de29..e69de29 100644 --- a/sys/cmd/wm/arg.c +++ b/src/cmd/wm/arg.c diff --git a/sys/cmd/wm/client.c b/src/cmd/wm/client.c index 5e0927a..5e0927a 100644 --- a/sys/cmd/wm/client.c +++ b/src/cmd/wm/client.c diff --git a/sys/cmd/wm/config.h b/src/cmd/wm/config.h index 1f5ba85..1f5ba85 100644 --- a/sys/cmd/wm/config.h +++ b/src/cmd/wm/config.h diff --git a/sys/cmd/wm/input.c b/src/cmd/wm/input.c index 4c6bfd4..4c6bfd4 100644 --- a/sys/cmd/wm/input.c +++ b/src/cmd/wm/input.c diff --git a/sys/cmd/wm/layer.c b/src/cmd/wm/layer.c index bfac744..bfac744 100644 --- a/sys/cmd/wm/layer.c +++ b/src/cmd/wm/layer.c diff --git a/sys/cmd/wm/main.c b/src/cmd/wm/main.c index 2607801..2607801 100644 --- a/sys/cmd/wm/main.c +++ b/src/cmd/wm/main.c diff --git a/sys/cmd/wm/monitor.c b/src/cmd/wm/monitor.c index 93073f3..93073f3 100644 --- a/sys/cmd/wm/monitor.c +++ b/src/cmd/wm/monitor.c diff --git a/sys/cmd/wm/protocol/sync b/src/cmd/wm/protocol/sync index 19a728a..19a728a 100755 --- a/sys/cmd/wm/protocol/sync +++ b/src/cmd/wm/protocol/sync diff --git a/src/cmd/wm/protocol/wlr-layer-shell-unstable-v1.xml b/src/cmd/wm/protocol/wlr-layer-shell-unstable-v1.xml new file mode 100644 index 0000000..d62fd51 --- /dev/null +++ b/src/cmd/wm/protocol/wlr-layer-shell-unstable-v1.xml @@ -0,0 +1,390 @@ +<?xml version="1.0" encoding="UTF-8"?> +<protocol name="wlr_layer_shell_unstable_v1"> + <copyright> + Copyright © 2017 Drew DeVault + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that copyright notice and this permission + notice appear in supporting documentation, and that the name of + the copyright holders not be used in advertising or publicity + pertaining to distribution of the software without specific, + written prior permission. The copyright holders make no + representations about the suitability of this software for any + purpose. It is provided "as is" without express or implied + warranty. + + THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + THIS SOFTWARE. + </copyright> + + <interface name="zwlr_layer_shell_v1" version="4"> + <description summary="create surfaces that are layers of the desktop"> + Clients can use this interface to assign the surface_layer role to + wl_surfaces. Such surfaces are assigned to a "layer" of the output and + rendered with a defined z-depth respective to each other. They may also be + anchored to the edges and corners of a screen and specify input handling + semantics. This interface should be suitable for the implementation of + many desktop shell components, and a broad number of other applications + that interact with the desktop. + </description> + + <request name="get_layer_surface"> + <description summary="create a layer_surface from a surface"> + Create a layer surface for an existing surface. This assigns the role of + layer_surface, or raises a protocol error if another role is already + assigned. + + Creating a layer surface from a wl_surface which has a buffer attached + or committed is a client error, and any attempts by a client to attach + or manipulate a buffer prior to the first layer_surface.configure call + must also be treated as errors. + + After creating a layer_surface object and setting it up, the client + must perform an initial commit without any buffer attached. + The compositor will reply with a layer_surface.configure event. + The client must acknowledge it and is then allowed to attach a buffer + to map the surface. + + You may pass NULL for output to allow the compositor to decide which + output to use. Generally this will be the one that the user most + recently interacted with. + + Clients can specify a namespace that defines the purpose of the layer + surface. + </description> + <arg name="id" type="new_id" interface="zwlr_layer_surface_v1"/> + <arg name="surface" type="object" interface="wl_surface"/> + <arg name="output" type="object" interface="wl_output" allow-null="true"/> + <arg name="layer" type="uint" enum="layer" summary="layer to add this surface to"/> + <arg name="namespace" type="string" summary="namespace for the layer surface"/> + </request> + + <enum name="error"> + <entry name="role" value="0" summary="wl_surface has another role"/> + <entry name="invalid_layer" value="1" summary="layer value is invalid"/> + <entry name="already_constructed" value="2" summary="wl_surface has a buffer attached or committed"/> + </enum> + + <enum name="layer"> + <description summary="available layers for surfaces"> + These values indicate which layers a surface can be rendered in. They + are ordered by z depth, bottom-most first. Traditional shell surfaces + will typically be rendered between the bottom and top layers. + Fullscreen shell surfaces are typically rendered at the top layer. + Multiple surfaces can share a single layer, and ordering within a + single layer is undefined. + </description> + + <entry name="background" value="0"/> + <entry name="bottom" value="1"/> + <entry name="top" value="2"/> + <entry name="overlay" value="3"/> + </enum> + + <!-- Version 3 additions --> + + <request name="destroy" type="destructor" since="3"> + <description summary="destroy the layer_shell object"> + This request indicates that the client will not use the layer_shell + object any more. Objects that have been created through this instance + are not affected. + </description> + </request> + </interface> + + <interface name="zwlr_layer_surface_v1" version="4"> + <description summary="layer metadata interface"> + An interface that may be implemented by a wl_surface, for surfaces that + are designed to be rendered as a layer of a stacked desktop-like + environment. + + Layer surface state (layer, size, anchor, exclusive zone, + margin, interactivity) is double-buffered, and will be applied at the + time wl_surface.commit of the corresponding wl_surface is called. + + Attaching a null buffer to a layer surface unmaps it. + + Unmapping a layer_surface means that the surface cannot be shown by the + compositor until it is explicitly mapped again. The layer_surface + returns to the state it had right after layer_shell.get_layer_surface. + The client can re-map the surface by performing a commit without any + buffer attached, waiting for a configure event and handling it as usual. + </description> + + <request name="set_size"> + <description summary="sets the size of the surface"> + Sets the size of the surface in surface-local coordinates. The + compositor will display the surface centered with respect to its + anchors. + + If you pass 0 for either value, the compositor will assign it and + inform you of the assignment in the configure event. You must set your + anchor to opposite edges in the dimensions you omit; not doing so is a + protocol error. Both values are 0 by default. + + Size is double-buffered, see wl_surface.commit. + </description> + <arg name="width" type="uint"/> + <arg name="height" type="uint"/> + </request> + + <request name="set_anchor"> + <description summary="configures the anchor point of the surface"> + Requests that the compositor anchor the surface to the specified edges + and corners. If two orthogonal edges are specified (e.g. 'top' and + 'left'), then the anchor point will be the intersection of the edges + (e.g. the top left corner of the output); otherwise the anchor point + will be centered on that edge, or in the center if none is specified. + + Anchor is double-buffered, see wl_surface.commit. + </description> + <arg name="anchor" type="uint" enum="anchor"/> + </request> + + <request name="set_exclusive_zone"> + <description summary="configures the exclusive geometry of this surface"> + Requests that the compositor avoids occluding an area with other + surfaces. The compositor's use of this information is + implementation-dependent - do not assume that this region will not + actually be occluded. + + A positive value is only meaningful if the surface is anchored to one + edge or an edge and both perpendicular edges. If the surface is not + anchored, anchored to only two perpendicular edges (a corner), anchored + to only two parallel edges or anchored to all edges, a positive value + will be treated the same as zero. + + A positive zone is the distance from the edge in surface-local + coordinates to consider exclusive. + + Surfaces that do not wish to have an exclusive zone may instead specify + how they should interact with surfaces that do. If set to zero, the + surface indicates that it would like to be moved to avoid occluding + surfaces with a positive exclusive zone. If set to -1, the surface + indicates that it would not like to be moved to accommodate for other + surfaces, and the compositor should extend it all the way to the edges + it is anchored to. + + For example, a panel might set its exclusive zone to 10, so that + maximized shell surfaces are not shown on top of it. A notification + might set its exclusive zone to 0, so that it is moved to avoid + occluding the panel, but shell surfaces are shown underneath it. A + wallpaper or lock screen might set their exclusive zone to -1, so that + they stretch below or over the panel. + + The default value is 0. + + Exclusive zone is double-buffered, see wl_surface.commit. + </description> + <arg name="zone" type="int"/> + </request> + + <request name="set_margin"> + <description summary="sets a margin from the anchor point"> + Requests that the surface be placed some distance away from the anchor + point on the output, in surface-local coordinates. Setting this value + for edges you are not anchored to has no effect. + + The exclusive zone includes the margin. + + Margin is double-buffered, see wl_surface.commit. + </description> + <arg name="top" type="int"/> + <arg name="right" type="int"/> + <arg name="bottom" type="int"/> + <arg name="left" type="int"/> + </request> + + <enum name="keyboard_interactivity"> + <description summary="types of keyboard interaction possible for a layer shell surface"> + Types of keyboard interaction possible for layer shell surfaces. The + rationale for this is twofold: (1) some applications are not interested + in keyboard events and not allowing them to be focused can improve the + desktop experience; (2) some applications will want to take exclusive + keyboard focus. + </description> + + <entry name="none" value="0"> + <description summary="no keyboard focus is possible"> + This value indicates that this surface is not interested in keyboard + events and the compositor should never assign it the keyboard focus. + + This is the default value, set for newly created layer shell surfaces. + + This is useful for e.g. desktop widgets that display information or + only have interaction with non-keyboard input devices. + </description> + </entry> + <entry name="exclusive" value="1"> + <description summary="request exclusive keyboard focus"> + Request exclusive keyboard focus if this surface is above the shell surface layer. + + For the top and overlay layers, the seat will always give + exclusive keyboard focus to the top-most layer which has keyboard + interactivity set to exclusive. If this layer contains multiple + surfaces with keyboard interactivity set to exclusive, the compositor + determines the one receiving keyboard events in an implementation- + defined manner. In this case, no guarantee is made when this surface + will receive keyboard focus (if ever). + + For the bottom and background layers, the compositor is allowed to use + normal focus semantics. + + This setting is mainly intended for applications that need to ensure + they receive all keyboard events, such as a lock screen or a password + prompt. + </description> + </entry> + <entry name="on_demand" value="2" since="4"> + <description summary="request regular keyboard focus semantics"> + This requests the compositor to allow this surface to be focused and + unfocused by the user in an implementation-defined manner. The user + should be able to unfocus this surface even regardless of the layer + it is on. + + Typically, the compositor will want to use its normal mechanism to + manage keyboard focus between layer shell surfaces with this setting + and regular toplevels on the desktop layer (e.g. click to focus). + Nevertheless, it is possible for a compositor to require a special + interaction to focus or unfocus layer shell surfaces (e.g. requiring + a click even if focus follows the mouse normally, or providing a + keybinding to switch focus between layers). + + This setting is mainly intended for desktop shell components (e.g. + panels) that allow keyboard interaction. Using this option can allow + implementing a desktop shell that can be fully usable without the + mouse. + </description> + </entry> + </enum> + + <request name="set_keyboard_interactivity"> + <description summary="requests keyboard events"> + Set how keyboard events are delivered to this surface. By default, + layer shell surfaces do not receive keyboard events; this request can + be used to change this. + + This setting is inherited by child surfaces set by the get_popup + request. + + Layer surfaces receive pointer, touch, and tablet events normally. If + you do not want to receive them, set the input region on your surface + to an empty region. + + Keyboard interactivity is double-buffered, see wl_surface.commit. + </description> + <arg name="keyboard_interactivity" type="uint" enum="keyboard_interactivity"/> + </request> + + <request name="get_popup"> + <description summary="assign this layer_surface as an xdg_popup parent"> + This assigns an xdg_popup's parent to this layer_surface. This popup + should have been created via xdg_surface::get_popup with the parent set + to NULL, and this request must be invoked before committing the popup's + initial state. + + See the documentation of xdg_popup for more details about what an + xdg_popup is and how it is used. + </description> + <arg name="popup" type="object" interface="xdg_popup"/> + </request> + + <request name="ack_configure"> + <description summary="ack a configure event"> + When a configure event is received, if a client commits the + surface in response to the configure event, then the client + must make an ack_configure request sometime before the commit + request, passing along the serial of the configure event. + + If the client receives multiple configure events before it + can respond to one, it only has to ack the last configure event. + + A client is not required to commit immediately after sending + an ack_configure request - it may even ack_configure several times + before its next surface commit. + + A client may send multiple ack_configure requests before committing, but + only the last request sent before a commit indicates which configure + event the client really is responding to. + </description> + <arg name="serial" type="uint" summary="the serial from the configure event"/> + </request> + + <request name="destroy" type="destructor"> + <description summary="destroy the layer_surface"> + This request destroys the layer surface. + </description> + </request> + + <event name="configure"> + <description summary="suggest a surface change"> + The configure event asks the client to resize its surface. + + Clients should arrange their surface for the new states, and then send + an ack_configure request with the serial sent in this configure event at + some point before committing the new surface. + + The client is free to dismiss all but the last configure event it + received. + + The width and height arguments specify the size of the window in + surface-local coordinates. + + The size is a hint, in the sense that the client is free to ignore it if + it doesn't resize, pick a smaller size (to satisfy aspect ratio or + resize in steps of NxM pixels). If the client picks a smaller size and + is anchored to two opposite anchors (e.g. 'top' and 'bottom'), the + surface will be centered on this axis. + + If the width or height arguments are zero, it means the client should + decide its own window dimension. + </description> + <arg name="serial" type="uint"/> + <arg name="width" type="uint"/> + <arg name="height" type="uint"/> + </event> + + <event name="closed"> + <description summary="surface should be closed"> + The closed event is sent by the compositor when the surface will no + longer be shown. The output may have been destroyed or the user may + have asked for it to be removed. Further changes to the surface will be + ignored. The client should destroy the resource after receiving this + event, and create a new surface if they so choose. + </description> + </event> + + <enum name="error"> + <entry name="invalid_surface_state" value="0" summary="provided surface state is invalid"/> + <entry name="invalid_size" value="1" summary="size is invalid"/> + <entry name="invalid_anchor" value="2" summary="anchor bitfield is invalid"/> + <entry name="invalid_keyboard_interactivity" value="3" summary="keyboard interactivity is invalid"/> + </enum> + + <enum name="anchor" bitfield="true"> + <entry name="top" value="1" summary="the top edge of the anchor rectangle"/> + <entry name="bottom" value="2" summary="the bottom edge of the anchor rectangle"/> + <entry name="left" value="4" summary="the left edge of the anchor rectangle"/> + <entry name="right" value="8" summary="the right edge of the anchor rectangle"/> + </enum> + + <!-- Version 2 additions --> + + <request name="set_layer" since="2"> + <description summary="change the layer of the surface"> + Change the layer that the surface is rendered on. + + Layer is double-buffered, see wl_surface.commit. + </description> + <arg name="layer" type="uint" enum="zwlr_layer_shell_v1.layer" summary="layer to move this surface to"/> + </request> + </interface> +</protocol> diff --git a/sys/cmd/wm/render.c b/src/cmd/wm/render.c index 1f51804..1f51804 100644 --- a/sys/cmd/wm/render.c +++ b/src/cmd/wm/render.c diff --git a/sys/cmd/wm/rules.mk b/src/cmd/wm/rules.mk index 5a36b6f..30d786d 100644 --- a/sys/cmd/wm/rules.mk +++ b/src/cmd/wm/rules.mk @@ -1,18 +1,20 @@ include share/push.mk # Iterate through subdirectory tree -# Local sources -SRCS_$(d) := \ - $(d)/xdg-shell-protocol.c \ - $(d)/wlr-layer-shell-unstable-v1-protocol.c \ - $(d)/util.c \ - $(d)/input.c \ - $(d)/render.c \ - $(d)/layer.c \ - $(d)/xdg.c \ - $(d)/client.c \ - $(d)/monitor.c \ +# local sources +SRCS_$(d):=\ + $(d)/xdg-shell-protocol.c\ + $(d)/wlr-layer-shell-unstable-v1-protocol.c\ + $(d)/util.c\ + $(d)/input.c\ + $(d)/render.c\ + $(d)/layer.c\ + $(d)/xdg.c\ + $(d)/client.c\ + $(d)/monitor.c\ $(d)/main.c + +# local outputs BINS_$(d) := $(d)/wm include share/paths.mk @@ -36,26 +38,25 @@ $(d)/wlr-layer-shell-unstable-v1-protocol.c: $(d)/wlr-layer-shell-unstable-v1-pr @echo "MK $(notdir $@)";\ $(WL_SCAN) private-code $(dir $@)protocol/wlr-layer-shell-unstable-v1.xml $@ -GENS += \ -$(d)/xdg-shell-protocol.h \ -$(d)/xdg-shell-protocol.c \ -$(d)/wlr-layer-shell-unstable-v1-protocol.h \ -$(d)/wlr-layer-shell-unstable-v1-protocol.c +GENS+=\ + $(d)/xdg-shell-protocol.h\ + $(d)/xdg-shell-protocol.c\ + $(d)/wlr-layer-shell-unstable-v1-protocol.h\ + $(d)/wlr-layer-shell-unstable-v1-protocol.c -$(BINS_$(d)): TCINCS = \ - -I sys/cmd/wm +$(BINS_$(d)): TCINCS=-I cmd/wm -$(BINS_$(d)): TCFLAGS = \ - `$(PKG) --cflags wlroots` \ - `$(PKG) --cflags wayland-server` \ +$(BINS_$(d)): TCFLAGS=\ + `$(PKG) --cflags wlroots`\ + `$(PKG) --cflags wayland-server`\ `$(PKG) --cflags xkbcommon` -$(BINS_$(d)): TCLIBS = \ - `$(PKG) --libs wlroots` \ - `$(PKG) --libs wayland-server` \ - `$(PKG) --libs xkbcommon` \ +$(BINS_$(d)): TCLIBS=\ + `$(PKG) --libs wlroots`\ + `$(PKG) --libs wayland-server`\ + `$(PKG) --libs xkbcommon`\ -$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/base/base.a +$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/base/base.a $(COMPLINK) include share/pop.mk diff --git a/sys/cmd/wm/util.c b/src/cmd/wm/util.c index 7871d15..7871d15 100644 --- a/sys/cmd/wm/util.c +++ b/src/cmd/wm/util.c diff --git a/src/cmd/wm/wlr-layer-shell-unstable-v1-protocol.c b/src/cmd/wm/wlr-layer-shell-unstable-v1-protocol.c new file mode 100644 index 0000000..95ff317 --- /dev/null +++ b/src/cmd/wm/wlr-layer-shell-unstable-v1-protocol.c @@ -0,0 +1,93 @@ +/* Generated by wayland-scanner 1.19.0 */ + +/* + * Copyright © 2017 Drew DeVault + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation, and that the name of + * the copyright holders not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + +#include <stdlib.h> +#include <stdint.h> +#include "wayland-util.h" + +#ifndef __has_attribute +# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ +#endif + +#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4) +#define WL_PRIVATE __attribute__ ((visibility("hidden"))) +#else +#define WL_PRIVATE +#endif + +extern const struct wl_interface wl_output_interface; +extern const struct wl_interface wl_surface_interface; +extern const struct wl_interface xdg_popup_interface; +extern const struct wl_interface zwlr_layer_surface_v1_interface; + +static const struct wl_interface *wlr_layer_shell_unstable_v1_types[] = { + NULL, + NULL, + NULL, + NULL, + &zwlr_layer_surface_v1_interface, + &wl_surface_interface, + &wl_output_interface, + NULL, + NULL, + &xdg_popup_interface, +}; + +static const struct wl_message zwlr_layer_shell_v1_requests[] = { + { "get_layer_surface", "no?ous", wlr_layer_shell_unstable_v1_types + 4 }, + { "destroy", "3", wlr_layer_shell_unstable_v1_types + 0 }, +}; + +WL_PRIVATE const struct wl_interface zwlr_layer_shell_v1_interface = { + "zwlr_layer_shell_v1", 4, + 2, zwlr_layer_shell_v1_requests, + 0, NULL, +}; + +static const struct wl_message zwlr_layer_surface_v1_requests[] = { + { "set_size", "uu", wlr_layer_shell_unstable_v1_types + 0 }, + { "set_anchor", "u", wlr_layer_shell_unstable_v1_types + 0 }, + { "set_exclusive_zone", "i", wlr_layer_shell_unstable_v1_types + 0 }, + { "set_margin", "iiii", wlr_layer_shell_unstable_v1_types + 0 }, + { "set_keyboard_interactivity", "u", wlr_layer_shell_unstable_v1_types + 0 }, + { "get_popup", "o", wlr_layer_shell_unstable_v1_types + 9 }, + { "ack_configure", "u", wlr_layer_shell_unstable_v1_types + 0 }, + { "destroy", "", wlr_layer_shell_unstable_v1_types + 0 }, + { "set_layer", "2u", wlr_layer_shell_unstable_v1_types + 0 }, +}; + +static const struct wl_message zwlr_layer_surface_v1_events[] = { + { "configure", "uuu", wlr_layer_shell_unstable_v1_types + 0 }, + { "closed", "", wlr_layer_shell_unstable_v1_types + 0 }, +}; + +WL_PRIVATE const struct wl_interface zwlr_layer_surface_v1_interface = { + "zwlr_layer_surface_v1", 4, + 9, zwlr_layer_surface_v1_requests, + 2, zwlr_layer_surface_v1_events, +}; + diff --git a/src/cmd/wm/wlr-layer-shell-unstable-v1-protocol.h b/src/cmd/wm/wlr-layer-shell-unstable-v1-protocol.h new file mode 100644 index 0000000..ea2fa9b --- /dev/null +++ b/src/cmd/wm/wlr-layer-shell-unstable-v1-protocol.h @@ -0,0 +1,564 @@ +/* Generated by wayland-scanner 1.19.0 */ + +#ifndef WLR_LAYER_SHELL_UNSTABLE_V1_SERVER_PROTOCOL_H +#define WLR_LAYER_SHELL_UNSTABLE_V1_SERVER_PROTOCOL_H + +#include <stdint.h> +#include <stddef.h> +#include "wayland-server.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct wl_client; +struct wl_resource; + +/** + * @page page_wlr_layer_shell_unstable_v1 The wlr_layer_shell_unstable_v1 protocol + * @section page_ifaces_wlr_layer_shell_unstable_v1 Interfaces + * - @subpage page_iface_zwlr_layer_shell_v1 - create surfaces that are layers of the desktop + * - @subpage page_iface_zwlr_layer_surface_v1 - layer metadata interface + * @section page_copyright_wlr_layer_shell_unstable_v1 Copyright + * <pre> + * + * Copyright © 2017 Drew DeVault + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation, and that the name of + * the copyright holders not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + * </pre> + */ +struct wl_output; +struct wl_surface; +struct xdg_popup; +struct zwlr_layer_shell_v1; +struct zwlr_layer_surface_v1; + +#ifndef ZWLR_LAYER_SHELL_V1_INTERFACE +#define ZWLR_LAYER_SHELL_V1_INTERFACE +/** + * @page page_iface_zwlr_layer_shell_v1 zwlr_layer_shell_v1 + * @section page_iface_zwlr_layer_shell_v1_desc Description + * + * Clients can use this interface to assign the surface_layer role to + * wl_surfaces. Such surfaces are assigned to a "layer" of the output and + * rendered with a defined z-depth respective to each other. They may also be + * anchored to the edges and corners of a screen and specify input handling + * semantics. This interface should be suitable for the implementation of + * many desktop shell components, and a broad number of other applications + * that interact with the desktop. + * @section page_iface_zwlr_layer_shell_v1_api API + * See @ref iface_zwlr_layer_shell_v1. + */ +/** + * @defgroup iface_zwlr_layer_shell_v1 The zwlr_layer_shell_v1 interface + * + * Clients can use this interface to assign the surface_layer role to + * wl_surfaces. Such surfaces are assigned to a "layer" of the output and + * rendered with a defined z-depth respective to each other. They may also be + * anchored to the edges and corners of a screen and specify input handling + * semantics. This interface should be suitable for the implementation of + * many desktop shell components, and a broad number of other applications + * that interact with the desktop. + */ +extern const struct wl_interface zwlr_layer_shell_v1_interface; +#endif +#ifndef ZWLR_LAYER_SURFACE_V1_INTERFACE +#define ZWLR_LAYER_SURFACE_V1_INTERFACE +/** + * @page page_iface_zwlr_layer_surface_v1 zwlr_layer_surface_v1 + * @section page_iface_zwlr_layer_surface_v1_desc Description + * + * An interface that may be implemented by a wl_surface, for surfaces that + * are designed to be rendered as a layer of a stacked desktop-like + * environment. + * + * Layer surface state (layer, size, anchor, exclusive zone, + * margin, interactivity) is double-buffered, and will be applied at the + * time wl_surface.commit of the corresponding wl_surface is called. + * + * Attaching a null buffer to a layer surface unmaps it. + * + * Unmapping a layer_surface means that the surface cannot be shown by the + * compositor until it is explicitly mapped again. The layer_surface + * returns to the state it had right after layer_shell.get_layer_surface. + * The client can re-map the surface by performing a commit without any + * buffer attached, waiting for a configure event and handling it as usual. + * @section page_iface_zwlr_layer_surface_v1_api API + * See @ref iface_zwlr_layer_surface_v1. + */ +/** + * @defgroup iface_zwlr_layer_surface_v1 The zwlr_layer_surface_v1 interface + * + * An interface that may be implemented by a wl_surface, for surfaces that + * are designed to be rendered as a layer of a stacked desktop-like + * environment. + * + * Layer surface state (layer, size, anchor, exclusive zone, + * margin, interactivity) is double-buffered, and will be applied at the + * time wl_surface.commit of the corresponding wl_surface is called. + * + * Attaching a null buffer to a layer surface unmaps it. + * + * Unmapping a layer_surface means that the surface cannot be shown by the + * compositor until it is explicitly mapped again. The layer_surface + * returns to the state it had right after layer_shell.get_layer_surface. + * The client can re-map the surface by performing a commit without any + * buffer attached, waiting for a configure event and handling it as usual. + */ +extern const struct wl_interface zwlr_layer_surface_v1_interface; +#endif + +#ifndef ZWLR_LAYER_SHELL_V1_ERROR_ENUM +#define ZWLR_LAYER_SHELL_V1_ERROR_ENUM +enum zwlr_layer_shell_v1_error { + /** + * wl_surface has another role + */ + ZWLR_LAYER_SHELL_V1_ERROR_ROLE = 0, + /** + * layer value is invalid + */ + ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER = 1, + /** + * wl_surface has a buffer attached or committed + */ + ZWLR_LAYER_SHELL_V1_ERROR_ALREADY_CONSTRUCTED = 2, +}; +#endif /* ZWLR_LAYER_SHELL_V1_ERROR_ENUM */ + +#ifndef ZWLR_LAYER_SHELL_V1_LAYER_ENUM +#define ZWLR_LAYER_SHELL_V1_LAYER_ENUM +/** + * @ingroup iface_zwlr_layer_shell_v1 + * available layers for surfaces + * + * These values indicate which layers a surface can be rendered in. They + * are ordered by z depth, bottom-most first. Traditional shell surfaces + * will typically be rendered between the bottom and top layers. + * Fullscreen shell surfaces are typically rendered at the top layer. + * Multiple surfaces can share a single layer, and ordering within a + * single layer is undefined. + */ +enum zwlr_layer_shell_v1_layer { + ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND = 0, + ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM = 1, + ZWLR_LAYER_SHELL_V1_LAYER_TOP = 2, + ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY = 3, +}; +#endif /* ZWLR_LAYER_SHELL_V1_LAYER_ENUM */ + +/** + * @ingroup iface_zwlr_layer_shell_v1 + * @struct zwlr_layer_shell_v1_interface + */ +struct zwlr_layer_shell_v1_interface { + /** + * create a layer_surface from a surface + * + * Create a layer surface for an existing surface. This assigns + * the role of layer_surface, or raises a protocol error if another + * role is already assigned. + * + * Creating a layer surface from a wl_surface which has a buffer + * attached or committed is a client error, and any attempts by a + * client to attach or manipulate a buffer prior to the first + * layer_surface.configure call must also be treated as errors. + * + * After creating a layer_surface object and setting it up, the + * client must perform an initial commit without any buffer + * attached. The compositor will reply with a + * layer_surface.configure event. The client must acknowledge it + * and is then allowed to attach a buffer to map the surface. + * + * You may pass NULL for output to allow the compositor to decide + * which output to use. Generally this will be the one that the + * user most recently interacted with. + * + * Clients can specify a namespace that defines the purpose of the + * layer surface. + * @param layer layer to add this surface to + * @param namespace namespace for the layer surface + */ + void (*get_layer_surface)(struct wl_client *client, + struct wl_resource *resource, + uint32_t id, + struct wl_resource *surface, + struct wl_resource *output, + uint32_t layer, + const char *namespace); + /** + * destroy the layer_shell object + * + * This request indicates that the client will not use the + * layer_shell object any more. Objects that have been created + * through this instance are not affected. + * @since 3 + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); +}; + + +/** + * @ingroup iface_zwlr_layer_shell_v1 + */ +#define ZWLR_LAYER_SHELL_V1_GET_LAYER_SURFACE_SINCE_VERSION 1 +/** + * @ingroup iface_zwlr_layer_shell_v1 + */ +#define ZWLR_LAYER_SHELL_V1_DESTROY_SINCE_VERSION 3 + +#ifndef ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM +#define ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM +/** + * @ingroup iface_zwlr_layer_surface_v1 + * request regular keyboard focus semantics + * + * This requests the compositor to allow this surface to be focused and + * unfocused by the user in an implementation-defined manner. The user + * should be able to unfocus this surface even regardless of the layer + * it is on. + * + * Typically, the compositor will want to use its normal mechanism to + * manage keyboard focus between layer shell surfaces with this setting + * and regular toplevels on the desktop layer (e.g. click to focus). + * Nevertheless, it is possible for a compositor to require a special + * interaction to focus or unfocus layer shell surfaces (e.g. requiring + * a click even if focus follows the mouse normally, or providing a + * keybinding to switch focus between layers). + * + * This setting is mainly intended for desktop shell components (e.g. + * panels) that allow keyboard interaction. Using this option can allow + * implementing a desktop shell that can be fully usable without the + * mouse. + */ +enum zwlr_layer_surface_v1_keyboard_interactivity { + ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE = 0, + ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE = 1, + /** + * @since 4 + */ + ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND = 2, +}; +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND_SINCE_VERSION 4 +#endif /* ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ENUM */ + +#ifndef ZWLR_LAYER_SURFACE_V1_ERROR_ENUM +#define ZWLR_LAYER_SURFACE_V1_ERROR_ENUM +enum zwlr_layer_surface_v1_error { + /** + * provided surface state is invalid + */ + ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SURFACE_STATE = 0, + /** + * size is invalid + */ + ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SIZE = 1, + /** + * anchor bitfield is invalid + */ + ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_ANCHOR = 2, + /** + * keyboard interactivity is invalid + */ + ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_KEYBOARD_INTERACTIVITY = 3, +}; +#endif /* ZWLR_LAYER_SURFACE_V1_ERROR_ENUM */ + +#ifndef ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM +#define ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM +enum zwlr_layer_surface_v1_anchor { + /** + * the top edge of the anchor rectangle + */ + ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP = 1, + /** + * the bottom edge of the anchor rectangle + */ + ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM = 2, + /** + * the left edge of the anchor rectangle + */ + ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT = 4, + /** + * the right edge of the anchor rectangle + */ + ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT = 8, +}; +#endif /* ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM */ + +/** + * @ingroup iface_zwlr_layer_surface_v1 + * @struct zwlr_layer_surface_v1_interface + */ +struct zwlr_layer_surface_v1_interface { + /** + * sets the size of the surface + * + * Sets the size of the surface in surface-local coordinates. The + * compositor will display the surface centered with respect to its + * anchors. + * + * If you pass 0 for either value, the compositor will assign it + * and inform you of the assignment in the configure event. You + * must set your anchor to opposite edges in the dimensions you + * omit; not doing so is a protocol error. Both values are 0 by + * default. + * + * Size is double-buffered, see wl_surface.commit. + */ + void (*set_size)(struct wl_client *client, + struct wl_resource *resource, + uint32_t width, + uint32_t height); + /** + * configures the anchor point of the surface + * + * Requests that the compositor anchor the surface to the + * specified edges and corners. If two orthogonal edges are + * specified (e.g. 'top' and 'left'), then the anchor point will be + * the intersection of the edges (e.g. the top left corner of the + * output); otherwise the anchor point will be centered on that + * edge, or in the center if none is specified. + * + * Anchor is double-buffered, see wl_surface.commit. + */ + void (*set_anchor)(struct wl_client *client, + struct wl_resource *resource, + uint32_t anchor); + /** + * configures the exclusive geometry of this surface + * + * Requests that the compositor avoids occluding an area with + * other surfaces. The compositor's use of this information is + * implementation-dependent - do not assume that this region will + * not actually be occluded. + * + * A positive value is only meaningful if the surface is anchored + * to one edge or an edge and both perpendicular edges. If the + * surface is not anchored, anchored to only two perpendicular + * edges (a corner), anchored to only two parallel edges or + * anchored to all edges, a positive value will be treated the same + * as zero. + * + * A positive zone is the distance from the edge in surface-local + * coordinates to consider exclusive. + * + * Surfaces that do not wish to have an exclusive zone may instead + * specify how they should interact with surfaces that do. If set + * to zero, the surface indicates that it would like to be moved to + * avoid occluding surfaces with a positive exclusive zone. If set + * to -1, the surface indicates that it would not like to be moved + * to accommodate for other surfaces, and the compositor should + * extend it all the way to the edges it is anchored to. + * + * For example, a panel might set its exclusive zone to 10, so that + * maximized shell surfaces are not shown on top of it. A + * notification might set its exclusive zone to 0, so that it is + * moved to avoid occluding the panel, but shell surfaces are shown + * underneath it. A wallpaper or lock screen might set their + * exclusive zone to -1, so that they stretch below or over the + * panel. + * + * The default value is 0. + * + * Exclusive zone is double-buffered, see wl_surface.commit. + */ + void (*set_exclusive_zone)(struct wl_client *client, + struct wl_resource *resource, + int32_t zone); + /** + * sets a margin from the anchor point + * + * Requests that the surface be placed some distance away from + * the anchor point on the output, in surface-local coordinates. + * Setting this value for edges you are not anchored to has no + * effect. + * + * The exclusive zone includes the margin. + * + * Margin is double-buffered, see wl_surface.commit. + */ + void (*set_margin)(struct wl_client *client, + struct wl_resource *resource, + int32_t top, + int32_t right, + int32_t bottom, + int32_t left); + /** + * requests keyboard events + * + * Set how keyboard events are delivered to this surface. By + * default, layer shell surfaces do not receive keyboard events; + * this request can be used to change this. + * + * This setting is inherited by child surfaces set by the get_popup + * request. + * + * Layer surfaces receive pointer, touch, and tablet events + * normally. If you do not want to receive them, set the input + * region on your surface to an empty region. + * + * Keyboard interactivity is double-buffered, see + * wl_surface.commit. + */ + void (*set_keyboard_interactivity)(struct wl_client *client, + struct wl_resource *resource, + uint32_t keyboard_interactivity); + /** + * assign this layer_surface as an xdg_popup parent + * + * This assigns an xdg_popup's parent to this layer_surface. This + * popup should have been created via xdg_surface::get_popup with + * the parent set to NULL, and this request must be invoked before + * committing the popup's initial state. + * + * See the documentation of xdg_popup for more details about what + * an xdg_popup is and how it is used. + */ + void (*get_popup)(struct wl_client *client, + struct wl_resource *resource, + struct wl_resource *popup); + /** + * ack a configure event + * + * When a configure event is received, if a client commits the + * surface in response to the configure event, then the client must + * make an ack_configure request sometime before the commit + * request, passing along the serial of the configure event. + * + * If the client receives multiple configure events before it can + * respond to one, it only has to ack the last configure event. + * + * A client is not required to commit immediately after sending an + * ack_configure request - it may even ack_configure several times + * before its next surface commit. + * + * A client may send multiple ack_configure requests before + * committing, but only the last request sent before a commit + * indicates which configure event the client really is responding + * to. + * @param serial the serial from the configure event + */ + void (*ack_configure)(struct wl_client *client, + struct wl_resource *resource, + uint32_t serial); + /** + * destroy the layer_surface + * + * This request destroys the layer surface. + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); + /** + * change the layer of the surface + * + * Change the layer that the surface is rendered on. + * + * Layer is double-buffered, see wl_surface.commit. + * @param layer layer to move this surface to + * @since 2 + */ + void (*set_layer)(struct wl_client *client, + struct wl_resource *resource, + uint32_t layer); +}; + +#define ZWLR_LAYER_SURFACE_V1_CONFIGURE 0 +#define ZWLR_LAYER_SURFACE_V1_CLOSED 1 + +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_CONFIGURE_SINCE_VERSION 1 +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_CLOSED_SINCE_VERSION 1 + +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_SET_SIZE_SINCE_VERSION 1 +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_SET_ANCHOR_SINCE_VERSION 1 +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_SET_EXCLUSIVE_ZONE_SINCE_VERSION 1 +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_SET_MARGIN_SINCE_VERSION 1 +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_SET_KEYBOARD_INTERACTIVITY_SINCE_VERSION 1 +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_GET_POPUP_SINCE_VERSION 1 +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_ACK_CONFIGURE_SINCE_VERSION 1 +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zwlr_layer_surface_v1 + */ +#define ZWLR_LAYER_SURFACE_V1_SET_LAYER_SINCE_VERSION 2 + +/** + * @ingroup iface_zwlr_layer_surface_v1 + * Sends an configure event to the client owning the resource. + * @param resource_ The client's resource + */ +static inline void +zwlr_layer_surface_v1_send_configure(struct wl_resource *resource_, uint32_t serial, uint32_t width, uint32_t height) +{ + wl_resource_post_event(resource_, ZWLR_LAYER_SURFACE_V1_CONFIGURE, serial, width, height); +} + +/** + * @ingroup iface_zwlr_layer_surface_v1 + * Sends an closed event to the client owning the resource. + * @param resource_ The client's resource + */ +static inline void +zwlr_layer_surface_v1_send_closed(struct wl_resource *resource_) +{ + wl_resource_post_event(resource_, ZWLR_LAYER_SURFACE_V1_CLOSED); +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sys/cmd/wm/wm.h b/src/cmd/wm/wm.h index a263804..a263804 100644 --- a/sys/cmd/wm/wm.h +++ b/src/cmd/wm/wm.h diff --git a/src/cmd/wm/xdg-shell-protocol.c b/src/cmd/wm/xdg-shell-protocol.c new file mode 100644 index 0000000..62a2612 --- /dev/null +++ b/src/cmd/wm/xdg-shell-protocol.c @@ -0,0 +1,181 @@ +/* Generated by wayland-scanner 1.19.0 */ + +/* + * Copyright © 2008-2013 Kristian Høgsberg + * Copyright © 2013 Rafael Antognolli + * Copyright © 2013 Jasper St. Pierre + * Copyright © 2010-2013 Intel Corporation + * Copyright © 2015-2017 Samsung Electronics Co., Ltd + * Copyright © 2015-2017 Red Hat Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include <stdlib.h> +#include <stdint.h> +#include "wayland-util.h" + +#ifndef __has_attribute +# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ +#endif + +#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4) +#define WL_PRIVATE __attribute__ ((visibility("hidden"))) +#else +#define WL_PRIVATE +#endif + +extern const struct wl_interface wl_output_interface; +extern const struct wl_interface wl_seat_interface; +extern const struct wl_interface wl_surface_interface; +extern const struct wl_interface xdg_popup_interface; +extern const struct wl_interface xdg_positioner_interface; +extern const struct wl_interface xdg_surface_interface; +extern const struct wl_interface xdg_toplevel_interface; + +static const struct wl_interface *xdg_shell_types[] = { + NULL, + NULL, + NULL, + NULL, + &xdg_positioner_interface, + &xdg_surface_interface, + &wl_surface_interface, + &xdg_toplevel_interface, + &xdg_popup_interface, + &xdg_surface_interface, + &xdg_positioner_interface, + &xdg_toplevel_interface, + &wl_seat_interface, + NULL, + NULL, + NULL, + &wl_seat_interface, + NULL, + &wl_seat_interface, + NULL, + NULL, + &wl_output_interface, + &wl_seat_interface, + NULL, + &xdg_positioner_interface, + NULL, +}; + +static const struct wl_message xdg_wm_base_requests[] = { + { "destroy", "", xdg_shell_types + 0 }, + { "create_positioner", "n", xdg_shell_types + 4 }, + { "get_xdg_surface", "no", xdg_shell_types + 5 }, + { "pong", "u", xdg_shell_types + 0 }, +}; + +static const struct wl_message xdg_wm_base_events[] = { + { "ping", "u", xdg_shell_types + 0 }, +}; + +WL_PRIVATE const struct wl_interface xdg_wm_base_interface = { + "xdg_wm_base", 3, + 4, xdg_wm_base_requests, + 1, xdg_wm_base_events, +}; + +static const struct wl_message xdg_positioner_requests[] = { + { "destroy", "", xdg_shell_types + 0 }, + { "set_size", "ii", xdg_shell_types + 0 }, + { "set_anchor_rect", "iiii", xdg_shell_types + 0 }, + { "set_anchor", "u", xdg_shell_types + 0 }, + { "set_gravity", "u", xdg_shell_types + 0 }, + { "set_constraint_adjustment", "u", xdg_shell_types + 0 }, + { "set_offset", "ii", xdg_shell_types + 0 }, + { "set_reactive", "3", xdg_shell_types + 0 }, + { "set_parent_size", "3ii", xdg_shell_types + 0 }, + { "set_parent_configure", "3u", xdg_shell_types + 0 }, +}; + +WL_PRIVATE const struct wl_interface xdg_positioner_interface = { + "xdg_positioner", 3, + 10, xdg_positioner_requests, + 0, NULL, +}; + +static const struct wl_message xdg_surface_requests[] = { + { "destroy", "", xdg_shell_types + 0 }, + { "get_toplevel", "n", xdg_shell_types + 7 }, + { "get_popup", "n?oo", xdg_shell_types + 8 }, + { "set_window_geometry", "iiii", xdg_shell_types + 0 }, + { "ack_configure", "u", xdg_shell_types + 0 }, +}; + +static const struct wl_message xdg_surface_events[] = { + { "configure", "u", xdg_shell_types + 0 }, +}; + +WL_PRIVATE const struct wl_interface xdg_surface_interface = { + "xdg_surface", 3, + 5, xdg_surface_requests, + 1, xdg_surface_events, +}; + +static const struct wl_message xdg_toplevel_requests[] = { + { "destroy", "", xdg_shell_types + 0 }, + { "set_parent", "?o", xdg_shell_types + 11 }, + { "set_title", "s", xdg_shell_types + 0 }, + { "set_app_id", "s", xdg_shell_types + 0 }, + { "show_window_menu", "ouii", xdg_shell_types + 12 }, + { "move", "ou", xdg_shell_types + 16 }, + { "resize", "ouu", xdg_shell_types + 18 }, + { "set_max_size", "ii", xdg_shell_types + 0 }, + { "set_min_size", "ii", xdg_shell_types + 0 }, + { "set_maximized", "", xdg_shell_types + 0 }, + { "unset_maximized", "", xdg_shell_types + 0 }, + { "set_fullscreen", "?o", xdg_shell_types + 21 }, + { "unset_fullscreen", "", xdg_shell_types + 0 }, + { "set_minimized", "", xdg_shell_types + 0 }, +}; + +static const struct wl_message xdg_toplevel_events[] = { + { "configure", "iia", xdg_shell_types + 0 }, + { "close", "", xdg_shell_types + 0 }, +}; + +WL_PRIVATE const struct wl_interface xdg_toplevel_interface = { + "xdg_toplevel", 3, + 14, xdg_toplevel_requests, + 2, xdg_toplevel_events, +}; + +static const struct wl_message xdg_popup_requests[] = { + { "destroy", "", xdg_shell_types + 0 }, + { "grab", "ou", xdg_shell_types + 22 }, + { "reposition", "3ou", xdg_shell_types + 24 }, +}; + +static const struct wl_message xdg_popup_events[] = { + { "configure", "iiii", xdg_shell_types + 0 }, + { "popup_done", "", xdg_shell_types + 0 }, + { "repositioned", "3u", xdg_shell_types + 0 }, +}; + +WL_PRIVATE const struct wl_interface xdg_popup_interface = { + "xdg_popup", 3, + 3, xdg_popup_requests, + 3, xdg_popup_events, +}; + diff --git a/src/cmd/wm/xdg-shell-protocol.h b/src/cmd/wm/xdg-shell-protocol.h new file mode 100644 index 0000000..312e5b9 --- /dev/null +++ b/src/cmd/wm/xdg-shell-protocol.h @@ -0,0 +1,1676 @@ +/* Generated by wayland-scanner 1.19.0 */ + +#ifndef XDG_SHELL_SERVER_PROTOCOL_H +#define XDG_SHELL_SERVER_PROTOCOL_H + +#include <stdint.h> +#include <stddef.h> +#include "wayland-server.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct wl_client; +struct wl_resource; + +/** + * @page page_xdg_shell The xdg_shell protocol + * @section page_ifaces_xdg_shell Interfaces + * - @subpage page_iface_xdg_wm_base - create desktop-style surfaces + * - @subpage page_iface_xdg_positioner - child surface positioner + * - @subpage page_iface_xdg_surface - desktop user interface surface base interface + * - @subpage page_iface_xdg_toplevel - toplevel surface + * - @subpage page_iface_xdg_popup - short-lived, popup surfaces for menus + * @section page_copyright_xdg_shell Copyright + * <pre> + * + * Copyright © 2008-2013 Kristian Høgsberg + * Copyright © 2013 Rafael Antognolli + * Copyright © 2013 Jasper St. Pierre + * Copyright © 2010-2013 Intel Corporation + * Copyright © 2015-2017 Samsung Electronics Co., Ltd + * Copyright © 2015-2017 Red Hat Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * </pre> + */ +struct wl_output; +struct wl_seat; +struct wl_surface; +struct xdg_popup; +struct xdg_positioner; +struct xdg_surface; +struct xdg_toplevel; +struct xdg_wm_base; + +#ifndef XDG_WM_BASE_INTERFACE +#define XDG_WM_BASE_INTERFACE +/** + * @page page_iface_xdg_wm_base xdg_wm_base + * @section page_iface_xdg_wm_base_desc Description + * + * The xdg_wm_base interface is exposed as a global object enabling clients + * to turn their wl_surfaces into windows in a desktop environment. It + * defines the basic functionality needed for clients and the compositor to + * create windows that can be dragged, resized, maximized, etc, as well as + * creating transient windows such as popup menus. + * @section page_iface_xdg_wm_base_api API + * See @ref iface_xdg_wm_base. + */ +/** + * @defgroup iface_xdg_wm_base The xdg_wm_base interface + * + * The xdg_wm_base interface is exposed as a global object enabling clients + * to turn their wl_surfaces into windows in a desktop environment. It + * defines the basic functionality needed for clients and the compositor to + * create windows that can be dragged, resized, maximized, etc, as well as + * creating transient windows such as popup menus. + */ +extern const struct wl_interface xdg_wm_base_interface; +#endif +#ifndef XDG_POSITIONER_INTERFACE +#define XDG_POSITIONER_INTERFACE +/** + * @page page_iface_xdg_positioner xdg_positioner + * @section page_iface_xdg_positioner_desc Description + * + * The xdg_positioner provides a collection of rules for the placement of a + * child surface relative to a parent surface. Rules can be defined to ensure + * the child surface remains within the visible area's borders, and to + * specify how the child surface changes its position, such as sliding along + * an axis, or flipping around a rectangle. These positioner-created rules are + * constrained by the requirement that a child surface must intersect with or + * be at least partially adjacent to its parent surface. + * + * See the various requests for details about possible rules. + * + * At the time of the request, the compositor makes a copy of the rules + * specified by the xdg_positioner. Thus, after the request is complete the + * xdg_positioner object can be destroyed or reused; further changes to the + * object will have no effect on previous usages. + * + * For an xdg_positioner object to be considered complete, it must have a + * non-zero size set by set_size, and a non-zero anchor rectangle set by + * set_anchor_rect. Passing an incomplete xdg_positioner object when + * positioning a surface raises an error. + * @section page_iface_xdg_positioner_api API + * See @ref iface_xdg_positioner. + */ +/** + * @defgroup iface_xdg_positioner The xdg_positioner interface + * + * The xdg_positioner provides a collection of rules for the placement of a + * child surface relative to a parent surface. Rules can be defined to ensure + * the child surface remains within the visible area's borders, and to + * specify how the child surface changes its position, such as sliding along + * an axis, or flipping around a rectangle. These positioner-created rules are + * constrained by the requirement that a child surface must intersect with or + * be at least partially adjacent to its parent surface. + * + * See the various requests for details about possible rules. + * + * At the time of the request, the compositor makes a copy of the rules + * specified by the xdg_positioner. Thus, after the request is complete the + * xdg_positioner object can be destroyed or reused; further changes to the + * object will have no effect on previous usages. + * + * For an xdg_positioner object to be considered complete, it must have a + * non-zero size set by set_size, and a non-zero anchor rectangle set by + * set_anchor_rect. Passing an incomplete xdg_positioner object when + * positioning a surface raises an error. + */ +extern const struct wl_interface xdg_positioner_interface; +#endif +#ifndef XDG_SURFACE_INTERFACE +#define XDG_SURFACE_INTERFACE +/** + * @page page_iface_xdg_surface xdg_surface + * @section page_iface_xdg_surface_desc Description + * + * An interface that may be implemented by a wl_surface, for + * implementations that provide a desktop-style user interface. + * + * It provides a base set of functionality required to construct user + * interface elements requiring management by the compositor, such as + * toplevel windows, menus, etc. The types of functionality are split into + * xdg_surface roles. + * + * Creating an xdg_surface does not set the role for a wl_surface. In order + * to map an xdg_surface, the client must create a role-specific object + * using, e.g., get_toplevel, get_popup. The wl_surface for any given + * xdg_surface can have at most one role, and may not be assigned any role + * not based on xdg_surface. + * + * A role must be assigned before any other requests are made to the + * xdg_surface object. + * + * The client must call wl_surface.commit on the corresponding wl_surface + * for the xdg_surface state to take effect. + * + * Creating an xdg_surface from a wl_surface which has a buffer attached or + * committed is a client error, and any attempts by a client to attach or + * manipulate a buffer prior to the first xdg_surface.configure call must + * also be treated as errors. + * + * After creating a role-specific object and setting it up, the client must + * perform an initial commit without any buffer attached. The compositor + * will reply with an xdg_surface.configure event. The client must + * acknowledge it and is then allowed to attach a buffer to map the surface. + * + * Mapping an xdg_surface-based role surface is defined as making it + * possible for the surface to be shown by the compositor. Note that + * a mapped surface is not guaranteed to be visible once it is mapped. + * + * For an xdg_surface to be mapped by the compositor, the following + * conditions must be met: + * (1) the client has assigned an xdg_surface-based role to the surface + * (2) the client has set and committed the xdg_surface state and the + * role-dependent state to the surface + * (3) the client has committed a buffer to the surface + * + * A newly-unmapped surface is considered to have met condition (1) out + * of the 3 required conditions for mapping a surface if its role surface + * has not been destroyed. + * @section page_iface_xdg_surface_api API + * See @ref iface_xdg_surface. + */ +/** + * @defgroup iface_xdg_surface The xdg_surface interface + * + * An interface that may be implemented by a wl_surface, for + * implementations that provide a desktop-style user interface. + * + * It provides a base set of functionality required to construct user + * interface elements requiring management by the compositor, such as + * toplevel windows, menus, etc. The types of functionality are split into + * xdg_surface roles. + * + * Creating an xdg_surface does not set the role for a wl_surface. In order + * to map an xdg_surface, the client must create a role-specific object + * using, e.g., get_toplevel, get_popup. The wl_surface for any given + * xdg_surface can have at most one role, and may not be assigned any role + * not based on xdg_surface. + * + * A role must be assigned before any other requests are made to the + * xdg_surface object. + * + * The client must call wl_surface.commit on the corresponding wl_surface + * for the xdg_surface state to take effect. + * + * Creating an xdg_surface from a wl_surface which has a buffer attached or + * committed is a client error, and any attempts by a client to attach or + * manipulate a buffer prior to the first xdg_surface.configure call must + * also be treated as errors. + * + * After creating a role-specific object and setting it up, the client must + * perform an initial commit without any buffer attached. The compositor + * will reply with an xdg_surface.configure event. The client must + * acknowledge it and is then allowed to attach a buffer to map the surface. + * + * Mapping an xdg_surface-based role surface is defined as making it + * possible for the surface to be shown by the compositor. Note that + * a mapped surface is not guaranteed to be visible once it is mapped. + * + * For an xdg_surface to be mapped by the compositor, the following + * conditions must be met: + * (1) the client has assigned an xdg_surface-based role to the surface + * (2) the client has set and committed the xdg_surface state and the + * role-dependent state to the surface + * (3) the client has committed a buffer to the surface + * + * A newly-unmapped surface is considered to have met condition (1) out + * of the 3 required conditions for mapping a surface if its role surface + * has not been destroyed. + */ +extern const struct wl_interface xdg_surface_interface; +#endif +#ifndef XDG_TOPLEVEL_INTERFACE +#define XDG_TOPLEVEL_INTERFACE +/** + * @page page_iface_xdg_toplevel xdg_toplevel + * @section page_iface_xdg_toplevel_desc Description + * + * This interface defines an xdg_surface role which allows a surface to, + * among other things, set window-like properties such as maximize, + * fullscreen, and minimize, set application-specific metadata like title and + * id, and well as trigger user interactive operations such as interactive + * resize and move. + * + * Unmapping an xdg_toplevel means that the surface cannot be shown + * by the compositor until it is explicitly mapped again. + * All active operations (e.g., move, resize) are canceled and all + * attributes (e.g. title, state, stacking, ...) are discarded for + * an xdg_toplevel surface when it is unmapped. The xdg_toplevel returns to + * the state it had right after xdg_surface.get_toplevel. The client + * can re-map the toplevel by perfoming a commit without any buffer + * attached, waiting for a configure event and handling it as usual (see + * xdg_surface description). + * + * Attaching a null buffer to a toplevel unmaps the surface. + * @section page_iface_xdg_toplevel_api API + * See @ref iface_xdg_toplevel. + */ +/** + * @defgroup iface_xdg_toplevel The xdg_toplevel interface + * + * This interface defines an xdg_surface role which allows a surface to, + * among other things, set window-like properties such as maximize, + * fullscreen, and minimize, set application-specific metadata like title and + * id, and well as trigger user interactive operations such as interactive + * resize and move. + * + * Unmapping an xdg_toplevel means that the surface cannot be shown + * by the compositor until it is explicitly mapped again. + * All active operations (e.g., move, resize) are canceled and all + * attributes (e.g. title, state, stacking, ...) are discarded for + * an xdg_toplevel surface when it is unmapped. The xdg_toplevel returns to + * the state it had right after xdg_surface.get_toplevel. The client + * can re-map the toplevel by perfoming a commit without any buffer + * attached, waiting for a configure event and handling it as usual (see + * xdg_surface description). + * + * Attaching a null buffer to a toplevel unmaps the surface. + */ +extern const struct wl_interface xdg_toplevel_interface; +#endif +#ifndef XDG_POPUP_INTERFACE +#define XDG_POPUP_INTERFACE +/** + * @page page_iface_xdg_popup xdg_popup + * @section page_iface_xdg_popup_desc Description + * + * A popup surface is a short-lived, temporary surface. It can be used to + * implement for example menus, popovers, tooltips and other similar user + * interface concepts. + * + * A popup can be made to take an explicit grab. See xdg_popup.grab for + * details. + * + * When the popup is dismissed, a popup_done event will be sent out, and at + * the same time the surface will be unmapped. See the xdg_popup.popup_done + * event for details. + * + * Explicitly destroying the xdg_popup object will also dismiss the popup and + * unmap the surface. Clients that want to dismiss the popup when another + * surface of their own is clicked should dismiss the popup using the destroy + * request. + * + * A newly created xdg_popup will be stacked on top of all previously created + * xdg_popup surfaces associated with the same xdg_toplevel. + * + * The parent of an xdg_popup must be mapped (see the xdg_surface + * description) before the xdg_popup itself. + * + * The client must call wl_surface.commit on the corresponding wl_surface + * for the xdg_popup state to take effect. + * @section page_iface_xdg_popup_api API + * See @ref iface_xdg_popup. + */ +/** + * @defgroup iface_xdg_popup The xdg_popup interface + * + * A popup surface is a short-lived, temporary surface. It can be used to + * implement for example menus, popovers, tooltips and other similar user + * interface concepts. + * + * A popup can be made to take an explicit grab. See xdg_popup.grab for + * details. + * + * When the popup is dismissed, a popup_done event will be sent out, and at + * the same time the surface will be unmapped. See the xdg_popup.popup_done + * event for details. + * + * Explicitly destroying the xdg_popup object will also dismiss the popup and + * unmap the surface. Clients that want to dismiss the popup when another + * surface of their own is clicked should dismiss the popup using the destroy + * request. + * + * A newly created xdg_popup will be stacked on top of all previously created + * xdg_popup surfaces associated with the same xdg_toplevel. + * + * The parent of an xdg_popup must be mapped (see the xdg_surface + * description) before the xdg_popup itself. + * + * The client must call wl_surface.commit on the corresponding wl_surface + * for the xdg_popup state to take effect. + */ +extern const struct wl_interface xdg_popup_interface; +#endif + +#ifndef XDG_WM_BASE_ERROR_ENUM +#define XDG_WM_BASE_ERROR_ENUM +enum xdg_wm_base_error { + /** + * given wl_surface has another role + */ + XDG_WM_BASE_ERROR_ROLE = 0, + /** + * xdg_wm_base was destroyed before children + */ + XDG_WM_BASE_ERROR_DEFUNCT_SURFACES = 1, + /** + * the client tried to map or destroy a non-topmost popup + */ + XDG_WM_BASE_ERROR_NOT_THE_TOPMOST_POPUP = 2, + /** + * the client specified an invalid popup parent surface + */ + XDG_WM_BASE_ERROR_INVALID_POPUP_PARENT = 3, + /** + * the client provided an invalid surface state + */ + XDG_WM_BASE_ERROR_INVALID_SURFACE_STATE = 4, + /** + * the client provided an invalid positioner + */ + XDG_WM_BASE_ERROR_INVALID_POSITIONER = 5, +}; +#endif /* XDG_WM_BASE_ERROR_ENUM */ + +/** + * @ingroup iface_xdg_wm_base + * @struct xdg_wm_base_interface + */ +struct xdg_wm_base_interface { + /** + * destroy xdg_wm_base + * + * Destroy this xdg_wm_base object. + * + * Destroying a bound xdg_wm_base object while there are surfaces + * still alive created by this xdg_wm_base object instance is + * illegal and will result in a protocol error. + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); + /** + * create a positioner object + * + * Create a positioner object. A positioner object is used to + * position surfaces relative to some parent surface. See the + * interface description and xdg_surface.get_popup for details. + */ + void (*create_positioner)(struct wl_client *client, + struct wl_resource *resource, + uint32_t id); + /** + * create a shell surface from a surface + * + * This creates an xdg_surface for the given surface. While + * xdg_surface itself is not a role, the corresponding surface may + * only be assigned a role extending xdg_surface, such as + * xdg_toplevel or xdg_popup. It is illegal to create an + * xdg_surface for a wl_surface which already has an assigned role + * and this will result in a protocol error. + * + * This creates an xdg_surface for the given surface. An + * xdg_surface is used as basis to define a role to a given + * surface, such as xdg_toplevel or xdg_popup. It also manages + * functionality shared between xdg_surface based surface roles. + * + * See the documentation of xdg_surface for more details about what + * an xdg_surface is and how it is used. + */ + void (*get_xdg_surface)(struct wl_client *client, + struct wl_resource *resource, + uint32_t id, + struct wl_resource *surface); + /** + * respond to a ping event + * + * A client must respond to a ping event with a pong request or + * the client may be deemed unresponsive. See xdg_wm_base.ping. + * @param serial serial of the ping event + */ + void (*pong)(struct wl_client *client, + struct wl_resource *resource, + uint32_t serial); +}; + +#define XDG_WM_BASE_PING 0 + +/** + * @ingroup iface_xdg_wm_base + */ +#define XDG_WM_BASE_PING_SINCE_VERSION 1 + +/** + * @ingroup iface_xdg_wm_base + */ +#define XDG_WM_BASE_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_wm_base + */ +#define XDG_WM_BASE_CREATE_POSITIONER_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_wm_base + */ +#define XDG_WM_BASE_GET_XDG_SURFACE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_wm_base + */ +#define XDG_WM_BASE_PONG_SINCE_VERSION 1 + +/** + * @ingroup iface_xdg_wm_base + * Sends an ping event to the client owning the resource. + * @param resource_ The client's resource + * @param serial pass this to the pong request + */ +static inline void +xdg_wm_base_send_ping(struct wl_resource *resource_, uint32_t serial) +{ + wl_resource_post_event(resource_, XDG_WM_BASE_PING, serial); +} + +#ifndef XDG_POSITIONER_ERROR_ENUM +#define XDG_POSITIONER_ERROR_ENUM +enum xdg_positioner_error { + /** + * invalid input provided + */ + XDG_POSITIONER_ERROR_INVALID_INPUT = 0, +}; +#endif /* XDG_POSITIONER_ERROR_ENUM */ + +#ifndef XDG_POSITIONER_ANCHOR_ENUM +#define XDG_POSITIONER_ANCHOR_ENUM +enum xdg_positioner_anchor { + XDG_POSITIONER_ANCHOR_NONE = 0, + XDG_POSITIONER_ANCHOR_TOP = 1, + XDG_POSITIONER_ANCHOR_BOTTOM = 2, + XDG_POSITIONER_ANCHOR_LEFT = 3, + XDG_POSITIONER_ANCHOR_RIGHT = 4, + XDG_POSITIONER_ANCHOR_TOP_LEFT = 5, + XDG_POSITIONER_ANCHOR_BOTTOM_LEFT = 6, + XDG_POSITIONER_ANCHOR_TOP_RIGHT = 7, + XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT = 8, +}; +#endif /* XDG_POSITIONER_ANCHOR_ENUM */ + +#ifndef XDG_POSITIONER_GRAVITY_ENUM +#define XDG_POSITIONER_GRAVITY_ENUM +enum xdg_positioner_gravity { + XDG_POSITIONER_GRAVITY_NONE = 0, + XDG_POSITIONER_GRAVITY_TOP = 1, + XDG_POSITIONER_GRAVITY_BOTTOM = 2, + XDG_POSITIONER_GRAVITY_LEFT = 3, + XDG_POSITIONER_GRAVITY_RIGHT = 4, + XDG_POSITIONER_GRAVITY_TOP_LEFT = 5, + XDG_POSITIONER_GRAVITY_BOTTOM_LEFT = 6, + XDG_POSITIONER_GRAVITY_TOP_RIGHT = 7, + XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT = 8, +}; +#endif /* XDG_POSITIONER_GRAVITY_ENUM */ + +#ifndef XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM +#define XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM +/** + * @ingroup iface_xdg_positioner + * vertically resize the surface + * + * Resize the surface vertically so that it is completely unconstrained. + */ +enum xdg_positioner_constraint_adjustment { + XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_NONE = 0, + XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X = 1, + XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y = 2, + XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X = 4, + XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y = 8, + XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X = 16, + XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y = 32, +}; +#endif /* XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM */ + +/** + * @ingroup iface_xdg_positioner + * @struct xdg_positioner_interface + */ +struct xdg_positioner_interface { + /** + * destroy the xdg_positioner object + * + * Notify the compositor that the xdg_positioner will no longer + * be used. + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); + /** + * set the size of the to-be positioned rectangle + * + * Set the size of the surface that is to be positioned with the + * positioner object. The size is in surface-local coordinates and + * corresponds to the window geometry. See + * xdg_surface.set_window_geometry. + * + * If a zero or negative size is set the invalid_input error is + * raised. + * @param width width of positioned rectangle + * @param height height of positioned rectangle + */ + void (*set_size)(struct wl_client *client, + struct wl_resource *resource, + int32_t width, + int32_t height); + /** + * set the anchor rectangle within the parent surface + * + * Specify the anchor rectangle within the parent surface that + * the child surface will be placed relative to. The rectangle is + * relative to the window geometry as defined by + * xdg_surface.set_window_geometry of the parent surface. + * + * When the xdg_positioner object is used to position a child + * surface, the anchor rectangle may not extend outside the window + * geometry of the positioned child's parent surface. + * + * If a negative size is set the invalid_input error is raised. + * @param x x position of anchor rectangle + * @param y y position of anchor rectangle + * @param width width of anchor rectangle + * @param height height of anchor rectangle + */ + void (*set_anchor_rect)(struct wl_client *client, + struct wl_resource *resource, + int32_t x, + int32_t y, + int32_t width, + int32_t height); + /** + * set anchor rectangle anchor + * + * Defines the anchor point for the anchor rectangle. The + * specified anchor is used derive an anchor point that the child + * surface will be positioned relative to. If a corner anchor is + * set (e.g. 'top_left' or 'bottom_right'), the anchor point will + * be at the specified corner; otherwise, the derived anchor point + * will be centered on the specified edge, or in the center of the + * anchor rectangle if no edge is specified. + * @param anchor anchor + */ + void (*set_anchor)(struct wl_client *client, + struct wl_resource *resource, + uint32_t anchor); + /** + * set child surface gravity + * + * Defines in what direction a surface should be positioned, + * relative to the anchor point of the parent surface. If a corner + * gravity is specified (e.g. 'bottom_right' or 'top_left'), then + * the child surface will be placed towards the specified gravity; + * otherwise, the child surface will be centered over the anchor + * point on any axis that had no gravity specified. + * @param gravity gravity direction + */ + void (*set_gravity)(struct wl_client *client, + struct wl_resource *resource, + uint32_t gravity); + /** + * set the adjustment to be done when constrained + * + * Specify how the window should be positioned if the originally + * intended position caused the surface to be constrained, meaning + * at least partially outside positioning boundaries set by the + * compositor. The adjustment is set by constructing a bitmask + * describing the adjustment to be made when the surface is + * constrained on that axis. + * + * If no bit for one axis is set, the compositor will assume that + * the child surface should not change its position on that axis + * when constrained. + * + * If more than one bit for one axis is set, the order of how + * adjustments are applied is specified in the corresponding + * adjustment descriptions. + * + * The default adjustment is none. + * @param constraint_adjustment bit mask of constraint adjustments + */ + void (*set_constraint_adjustment)(struct wl_client *client, + struct wl_resource *resource, + uint32_t constraint_adjustment); + /** + * set surface position offset + * + * Specify the surface position offset relative to the position + * of the anchor on the anchor rectangle and the anchor on the + * surface. For example if the anchor of the anchor rectangle is at + * (x, y), the surface has the gravity bottom|right, and the offset + * is (ox, oy), the calculated surface position will be (x + ox, y + * + oy). The offset position of the surface is the one used for + * constraint testing. See set_constraint_adjustment. + * + * An example use case is placing a popup menu on top of a user + * interface element, while aligning the user interface element of + * the parent surface with some user interface element placed + * somewhere in the popup surface. + * @param x surface position x offset + * @param y surface position y offset + */ + void (*set_offset)(struct wl_client *client, + struct wl_resource *resource, + int32_t x, + int32_t y); + /** + * continuously reconstrain the surface + * + * When set reactive, the surface is reconstrained if the + * conditions used for constraining changed, e.g. the parent window + * moved. + * + * If the conditions changed and the popup was reconstrained, an + * xdg_popup.configure event is sent with updated geometry, + * followed by an xdg_surface.configure event. + * @since 3 + */ + void (*set_reactive)(struct wl_client *client, + struct wl_resource *resource); + /** + * + * + * Set the parent window geometry the compositor should use when + * positioning the popup. The compositor may use this information + * to determine the future state the popup should be constrained + * using. If this doesn't match the dimension of the parent the + * popup is eventually positioned against, the behavior is + * undefined. + * + * The arguments are given in the surface-local coordinate space. + * @param parent_width future window geometry width of parent + * @param parent_height future window geometry height of parent + * @since 3 + */ + void (*set_parent_size)(struct wl_client *client, + struct wl_resource *resource, + int32_t parent_width, + int32_t parent_height); + /** + * set parent configure this is a response to + * + * Set the serial of an xdg_surface.configure event this + * positioner will be used in response to. The compositor may use + * this information together with set_parent_size to determine what + * future state the popup should be constrained using. + * @param serial serial of parent configure event + * @since 3 + */ + void (*set_parent_configure)(struct wl_client *client, + struct wl_resource *resource, + uint32_t serial); +}; + + +/** + * @ingroup iface_xdg_positioner + */ +#define XDG_POSITIONER_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_positioner + */ +#define XDG_POSITIONER_SET_SIZE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_positioner + */ +#define XDG_POSITIONER_SET_ANCHOR_RECT_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_positioner + */ +#define XDG_POSITIONER_SET_ANCHOR_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_positioner + */ +#define XDG_POSITIONER_SET_GRAVITY_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_positioner + */ +#define XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_positioner + */ +#define XDG_POSITIONER_SET_OFFSET_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_positioner + */ +#define XDG_POSITIONER_SET_REACTIVE_SINCE_VERSION 3 +/** + * @ingroup iface_xdg_positioner + */ +#define XDG_POSITIONER_SET_PARENT_SIZE_SINCE_VERSION 3 +/** + * @ingroup iface_xdg_positioner + */ +#define XDG_POSITIONER_SET_PARENT_CONFIGURE_SINCE_VERSION 3 + +#ifndef XDG_SURFACE_ERROR_ENUM +#define XDG_SURFACE_ERROR_ENUM +enum xdg_surface_error { + XDG_SURFACE_ERROR_NOT_CONSTRUCTED = 1, + XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED = 2, + XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER = 3, +}; +#endif /* XDG_SURFACE_ERROR_ENUM */ + +/** + * @ingroup iface_xdg_surface + * @struct xdg_surface_interface + */ +struct xdg_surface_interface { + /** + * destroy the xdg_surface + * + * Destroy the xdg_surface object. An xdg_surface must only be + * destroyed after its role object has been destroyed. + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); + /** + * assign the xdg_toplevel surface role + * + * This creates an xdg_toplevel object for the given xdg_surface + * and gives the associated wl_surface the xdg_toplevel role. + * + * See the documentation of xdg_toplevel for more details about + * what an xdg_toplevel is and how it is used. + */ + void (*get_toplevel)(struct wl_client *client, + struct wl_resource *resource, + uint32_t id); + /** + * assign the xdg_popup surface role + * + * This creates an xdg_popup object for the given xdg_surface and + * gives the associated wl_surface the xdg_popup role. + * + * If null is passed as a parent, a parent surface must be + * specified using some other protocol, before committing the + * initial state. + * + * See the documentation of xdg_popup for more details about what + * an xdg_popup is and how it is used. + */ + void (*get_popup)(struct wl_client *client, + struct wl_resource *resource, + uint32_t id, + struct wl_resource *parent, + struct wl_resource *positioner); + /** + * set the new window geometry + * + * The window geometry of a surface is its "visible bounds" from + * the user's perspective. Client-side decorations often have + * invisible portions like drop-shadows which should be ignored for + * the purposes of aligning, placing and constraining windows. + * + * The window geometry is double buffered, and will be applied at + * the time wl_surface.commit of the corresponding wl_surface is + * called. + * + * When maintaining a position, the compositor should treat the (x, + * y) coordinate of the window geometry as the top left corner of + * the window. A client changing the (x, y) window geometry + * coordinate should in general not alter the position of the + * window. + * + * Once the window geometry of the surface is set, it is not + * possible to unset it, and it will remain the same until + * set_window_geometry is called again, even if a new subsurface or + * buffer is attached. + * + * If never set, the value is the full bounds of the surface, + * including any subsurfaces. This updates dynamically on every + * commit. This unset is meant for extremely simple clients. + * + * The arguments are given in the surface-local coordinate space of + * the wl_surface associated with this xdg_surface. + * + * The width and height must be greater than zero. Setting an + * invalid size will raise an error. When applied, the effective + * window geometry will be the set window geometry clamped to the + * bounding rectangle of the combined geometry of the surface of + * the xdg_surface and the associated subsurfaces. + */ + void (*set_window_geometry)(struct wl_client *client, + struct wl_resource *resource, + int32_t x, + int32_t y, + int32_t width, + int32_t height); + /** + * ack a configure event + * + * When a configure event is received, if a client commits the + * surface in response to the configure event, then the client must + * make an ack_configure request sometime before the commit + * request, passing along the serial of the configure event. + * + * For instance, for toplevel surfaces the compositor might use + * this information to move a surface to the top left only when the + * client has drawn itself for the maximized or fullscreen state. + * + * If the client receives multiple configure events before it can + * respond to one, it only has to ack the last configure event. + * + * A client is not required to commit immediately after sending an + * ack_configure request - it may even ack_configure several times + * before its next surface commit. + * + * A client may send multiple ack_configure requests before + * committing, but only the last request sent before a commit + * indicates which configure event the client really is responding + * to. + * @param serial the serial from the configure event + */ + void (*ack_configure)(struct wl_client *client, + struct wl_resource *resource, + uint32_t serial); +}; + +#define XDG_SURFACE_CONFIGURE 0 + +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1 + +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_GET_TOPLEVEL_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_GET_POPUP_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_SET_WINDOW_GEOMETRY_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_ACK_CONFIGURE_SINCE_VERSION 1 + +/** + * @ingroup iface_xdg_surface + * Sends an configure event to the client owning the resource. + * @param resource_ The client's resource + * @param serial serial of the configure event + */ +static inline void +xdg_surface_send_configure(struct wl_resource *resource_, uint32_t serial) +{ + wl_resource_post_event(resource_, XDG_SURFACE_CONFIGURE, serial); +} + +#ifndef XDG_TOPLEVEL_RESIZE_EDGE_ENUM +#define XDG_TOPLEVEL_RESIZE_EDGE_ENUM +/** + * @ingroup iface_xdg_toplevel + * edge values for resizing + * + * These values are used to indicate which edge of a surface + * is being dragged in a resize operation. + */ +enum xdg_toplevel_resize_edge { + XDG_TOPLEVEL_RESIZE_EDGE_NONE = 0, + XDG_TOPLEVEL_RESIZE_EDGE_TOP = 1, + XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM = 2, + XDG_TOPLEVEL_RESIZE_EDGE_LEFT = 4, + XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT = 5, + XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT = 6, + XDG_TOPLEVEL_RESIZE_EDGE_RIGHT = 8, + XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT = 9, + XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT = 10, +}; +#endif /* XDG_TOPLEVEL_RESIZE_EDGE_ENUM */ + +#ifndef XDG_TOPLEVEL_STATE_ENUM +#define XDG_TOPLEVEL_STATE_ENUM +/** + * @ingroup iface_xdg_toplevel + * the surface is tiled + * + * The window is currently in a tiled layout and the bottom edge is + * considered to be adjacent to another part of the tiling grid. + */ +enum xdg_toplevel_state { + /** + * the surface is maximized + */ + XDG_TOPLEVEL_STATE_MAXIMIZED = 1, + /** + * the surface is fullscreen + */ + XDG_TOPLEVEL_STATE_FULLSCREEN = 2, + /** + * the surface is being resized + */ + XDG_TOPLEVEL_STATE_RESIZING = 3, + /** + * the surface is now activated + */ + XDG_TOPLEVEL_STATE_ACTIVATED = 4, + /** + * @since 2 + */ + XDG_TOPLEVEL_STATE_TILED_LEFT = 5, + /** + * @since 2 + */ + XDG_TOPLEVEL_STATE_TILED_RIGHT = 6, + /** + * @since 2 + */ + XDG_TOPLEVEL_STATE_TILED_TOP = 7, + /** + * @since 2 + */ + XDG_TOPLEVEL_STATE_TILED_BOTTOM = 8, +}; +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_STATE_TILED_LEFT_SINCE_VERSION 2 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION 2 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_STATE_TILED_TOP_SINCE_VERSION 2 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_STATE_TILED_BOTTOM_SINCE_VERSION 2 +#endif /* XDG_TOPLEVEL_STATE_ENUM */ + +/** + * @ingroup iface_xdg_toplevel + * @struct xdg_toplevel_interface + */ +struct xdg_toplevel_interface { + /** + * destroy the xdg_toplevel + * + * This request destroys the role surface and unmaps the surface; + * see "Unmapping" behavior in interface section for details. + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); + /** + * set the parent of this surface + * + * Set the "parent" of this surface. This surface should be + * stacked above the parent surface and all other ancestor + * surfaces. + * + * Parent windows should be set on dialogs, toolboxes, or other + * "auxiliary" surfaces, so that the parent is raised when the + * dialog is raised. + * + * Setting a null parent for a child window removes any + * parent-child relationship for the child. Setting a null parent + * for a window which currently has no parent is a no-op. + * + * If the parent is unmapped then its children are managed as + * though the parent of the now-unmapped parent has become the + * parent of this surface. If no parent exists for the now-unmapped + * parent then the children are managed as though they have no + * parent surface. + */ + void (*set_parent)(struct wl_client *client, + struct wl_resource *resource, + struct wl_resource *parent); + /** + * set surface title + * + * Set a short title for the surface. + * + * This string may be used to identify the surface in a task bar, + * window list, or other user interface elements provided by the + * compositor. + * + * The string must be encoded in UTF-8. + */ + void (*set_title)(struct wl_client *client, + struct wl_resource *resource, + const char *title); + /** + * set application ID + * + * Set an application identifier for the surface. + * + * The app ID identifies the general class of applications to which + * the surface belongs. The compositor can use this to group + * multiple surfaces together, or to determine how to launch a new + * application. + * + * For D-Bus activatable applications, the app ID is used as the + * D-Bus service name. + * + * The compositor shell will try to group application surfaces + * together by their app ID. As a best practice, it is suggested to + * select app ID's that match the basename of the application's + * .desktop file. For example, "org.freedesktop.FooViewer" where + * the .desktop file is "org.freedesktop.FooViewer.desktop". + * + * Like other properties, a set_app_id request can be sent after + * the xdg_toplevel has been mapped to update the property. + * + * See the desktop-entry specification [0] for more details on + * application identifiers and how they relate to well-known D-Bus + * names and .desktop files. + * + * [0] http://standards.freedesktop.org/desktop-entry-spec/ + */ + void (*set_app_id)(struct wl_client *client, + struct wl_resource *resource, + const char *app_id); + /** + * show the window menu + * + * Clients implementing client-side decorations might want to + * show a context menu when right-clicking on the decorations, + * giving the user a menu that they can use to maximize or minimize + * the window. + * + * This request asks the compositor to pop up such a window menu at + * the given position, relative to the local surface coordinates of + * the parent surface. There are no guarantees as to what menu + * items the window menu contains. + * + * This request must be used in response to some sort of user + * action like a button press, key press, or touch down event. + * @param seat the wl_seat of the user event + * @param serial the serial of the user event + * @param x the x position to pop up the window menu at + * @param y the y position to pop up the window menu at + */ + void (*show_window_menu)(struct wl_client *client, + struct wl_resource *resource, + struct wl_resource *seat, + uint32_t serial, + int32_t x, + int32_t y); + /** + * start an interactive move + * + * Start an interactive, user-driven move of the surface. + * + * This request must be used in response to some sort of user + * action like a button press, key press, or touch down event. The + * passed serial is used to determine the type of interactive move + * (touch, pointer, etc). + * + * The server may ignore move requests depending on the state of + * the surface (e.g. fullscreen or maximized), or if the passed + * serial is no longer valid. + * + * If triggered, the surface will lose the focus of the device + * (wl_pointer, wl_touch, etc) used for the move. It is up to the + * compositor to visually indicate that the move is taking place, + * such as updating a pointer cursor, during the move. There is no + * guarantee that the device focus will return when the move is + * completed. + * @param seat the wl_seat of the user event + * @param serial the serial of the user event + */ + void (*move)(struct wl_client *client, + struct wl_resource *resource, + struct wl_resource *seat, + uint32_t serial); + /** + * start an interactive resize + * + * Start a user-driven, interactive resize of the surface. + * + * This request must be used in response to some sort of user + * action like a button press, key press, or touch down event. The + * passed serial is used to determine the type of interactive + * resize (touch, pointer, etc). + * + * The server may ignore resize requests depending on the state of + * the surface (e.g. fullscreen or maximized). + * + * If triggered, the client will receive configure events with the + * "resize" state enum value and the expected sizes. See the + * "resize" enum value for more details about what is required. The + * client must also acknowledge configure events using + * "ack_configure". After the resize is completed, the client will + * receive another "configure" event without the resize state. + * + * If triggered, the surface also will lose the focus of the device + * (wl_pointer, wl_touch, etc) used for the resize. It is up to the + * compositor to visually indicate that the resize is taking place, + * such as updating a pointer cursor, during the resize. There is + * no guarantee that the device focus will return when the resize + * is completed. + * + * The edges parameter specifies how the surface should be resized, + * and is one of the values of the resize_edge enum. The compositor + * may use this information to update the surface position for + * example when dragging the top left corner. The compositor may + * also use this information to adapt its behavior, e.g. choose an + * appropriate cursor image. + * @param seat the wl_seat of the user event + * @param serial the serial of the user event + * @param edges which edge or corner is being dragged + */ + void (*resize)(struct wl_client *client, + struct wl_resource *resource, + struct wl_resource *seat, + uint32_t serial, + uint32_t edges); + /** + * set the maximum size + * + * Set a maximum size for the window. + * + * The client can specify a maximum size so that the compositor + * does not try to configure the window beyond this size. + * + * The width and height arguments are in window geometry + * coordinates. See xdg_surface.set_window_geometry. + * + * Values set in this way are double-buffered. They will get + * applied on the next commit. + * + * The compositor can use this information to allow or disallow + * different states like maximize or fullscreen and draw accurate + * animations. + * + * Similarly, a tiling window manager may use this information to + * place and resize client windows in a more effective way. + * + * The client should not rely on the compositor to obey the maximum + * size. The compositor may decide to ignore the values set by the + * client and request a larger size. + * + * If never set, or a value of zero in the request, means that the + * client has no expected maximum size in the given dimension. As a + * result, a client wishing to reset the maximum size to an + * unspecified state can use zero for width and height in the + * request. + * + * Requesting a maximum size to be smaller than the minimum size of + * a surface is illegal and will result in a protocol error. + * + * The width and height must be greater than or equal to zero. + * Using strictly negative values for width and height will result + * in a protocol error. + */ + void (*set_max_size)(struct wl_client *client, + struct wl_resource *resource, + int32_t width, + int32_t height); + /** + * set the minimum size + * + * Set a minimum size for the window. + * + * The client can specify a minimum size so that the compositor + * does not try to configure the window below this size. + * + * The width and height arguments are in window geometry + * coordinates. See xdg_surface.set_window_geometry. + * + * Values set in this way are double-buffered. They will get + * applied on the next commit. + * + * The compositor can use this information to allow or disallow + * different states like maximize or fullscreen and draw accurate + * animations. + * + * Similarly, a tiling window manager may use this information to + * place and resize client windows in a more effective way. + * + * The client should not rely on the compositor to obey the minimum + * size. The compositor may decide to ignore the values set by the + * client and request a smaller size. + * + * If never set, or a value of zero in the request, means that the + * client has no expected minimum size in the given dimension. As a + * result, a client wishing to reset the minimum size to an + * unspecified state can use zero for width and height in the + * request. + * + * Requesting a minimum size to be larger than the maximum size of + * a surface is illegal and will result in a protocol error. + * + * The width and height must be greater than or equal to zero. + * Using strictly negative values for width and height will result + * in a protocol error. + */ + void (*set_min_size)(struct wl_client *client, + struct wl_resource *resource, + int32_t width, + int32_t height); + /** + * maximize the window + * + * Maximize the surface. + * + * After requesting that the surface should be maximized, the + * compositor will respond by emitting a configure event. Whether + * this configure actually sets the window maximized is subject to + * compositor policies. The client must then update its content, + * drawing in the configured state. The client must also + * acknowledge the configure when committing the new content (see + * ack_configure). + * + * It is up to the compositor to decide how and where to maximize + * the surface, for example which output and what region of the + * screen should be used. + * + * If the surface was already maximized, the compositor will still + * emit a configure event with the "maximized" state. + * + * If the surface is in a fullscreen state, this request has no + * direct effect. It may alter the state the surface is returned to + * when unmaximized unless overridden by the compositor. + */ + void (*set_maximized)(struct wl_client *client, + struct wl_resource *resource); + /** + * unmaximize the window + * + * Unmaximize the surface. + * + * After requesting that the surface should be unmaximized, the + * compositor will respond by emitting a configure event. Whether + * this actually un-maximizes the window is subject to compositor + * policies. If available and applicable, the compositor will + * include the window geometry dimensions the window had prior to + * being maximized in the configure event. The client must then + * update its content, drawing it in the configured state. The + * client must also acknowledge the configure when committing the + * new content (see ack_configure). + * + * It is up to the compositor to position the surface after it was + * unmaximized; usually the position the surface had before + * maximizing, if applicable. + * + * If the surface was already not maximized, the compositor will + * still emit a configure event without the "maximized" state. + * + * If the surface is in a fullscreen state, this request has no + * direct effect. It may alter the state the surface is returned to + * when unmaximized unless overridden by the compositor. + */ + void (*unset_maximized)(struct wl_client *client, + struct wl_resource *resource); + /** + * set the window as fullscreen on an output + * + * Make the surface fullscreen. + * + * After requesting that the surface should be fullscreened, the + * compositor will respond by emitting a configure event. Whether + * the client is actually put into a fullscreen state is subject to + * compositor policies. The client must also acknowledge the + * configure when committing the new content (see ack_configure). + * + * The output passed by the request indicates the client's + * preference as to which display it should be set fullscreen on. + * If this value is NULL, it's up to the compositor to choose which + * display will be used to map this surface. + * + * If the surface doesn't cover the whole output, the compositor + * will position the surface in the center of the output and + * compensate with with border fill covering the rest of the + * output. The content of the border fill is undefined, but should + * be assumed to be in some way that attempts to blend into the + * surrounding area (e.g. solid black). + * + * If the fullscreened surface is not opaque, the compositor must + * make sure that other screen content not part of the same surface + * tree (made up of subsurfaces, popups or similarly coupled + * surfaces) are not visible below the fullscreened surface. + */ + void (*set_fullscreen)(struct wl_client *client, + struct wl_resource *resource, + struct wl_resource *output); + /** + * unset the window as fullscreen + * + * Make the surface no longer fullscreen. + * + * After requesting that the surface should be unfullscreened, the + * compositor will respond by emitting a configure event. Whether + * this actually removes the fullscreen state of the client is + * subject to compositor policies. + * + * Making a surface unfullscreen sets states for the surface based + * on the following: * the state(s) it may have had before becoming + * fullscreen * any state(s) decided by the compositor * any + * state(s) requested by the client while the surface was + * fullscreen + * + * The compositor may include the previous window geometry + * dimensions in the configure event, if applicable. + * + * The client must also acknowledge the configure when committing + * the new content (see ack_configure). + */ + void (*unset_fullscreen)(struct wl_client *client, + struct wl_resource *resource); + /** + * set the window as minimized + * + * Request that the compositor minimize your surface. There is no + * way to know if the surface is currently minimized, nor is there + * any way to unset minimization on this surface. + * + * If you are looking to throttle redrawing when minimized, please + * instead use the wl_surface.frame event for this, as this will + * also work with live previews on windows in Alt-Tab, Expose or + * similar compositor features. + */ + void (*set_minimized)(struct wl_client *client, + struct wl_resource *resource); +}; + +#define XDG_TOPLEVEL_CONFIGURE 0 +#define XDG_TOPLEVEL_CLOSE 1 + +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_CONFIGURE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_CLOSE_SINCE_VERSION 1 + +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_SET_PARENT_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_SET_TITLE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_SET_APP_ID_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_SHOW_WINDOW_MENU_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_MOVE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_RESIZE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_SET_MAX_SIZE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_SET_MIN_SIZE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_SET_MAXIMIZED_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_UNSET_MAXIMIZED_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_SET_FULLSCREEN_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_UNSET_FULLSCREEN_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_toplevel + */ +#define XDG_TOPLEVEL_SET_MINIMIZED_SINCE_VERSION 1 + +/** + * @ingroup iface_xdg_toplevel + * Sends an configure event to the client owning the resource. + * @param resource_ The client's resource + */ +static inline void +xdg_toplevel_send_configure(struct wl_resource *resource_, int32_t width, int32_t height, struct wl_array *states) +{ + wl_resource_post_event(resource_, XDG_TOPLEVEL_CONFIGURE, width, height, states); +} + +/** + * @ingroup iface_xdg_toplevel + * Sends an close event to the client owning the resource. + * @param resource_ The client's resource + */ +static inline void +xdg_toplevel_send_close(struct wl_resource *resource_) +{ + wl_resource_post_event(resource_, XDG_TOPLEVEL_CLOSE); +} + +#ifndef XDG_POPUP_ERROR_ENUM +#define XDG_POPUP_ERROR_ENUM +enum xdg_popup_error { + /** + * tried to grab after being mapped + */ + XDG_POPUP_ERROR_INVALID_GRAB = 0, +}; +#endif /* XDG_POPUP_ERROR_ENUM */ + +/** + * @ingroup iface_xdg_popup + * @struct xdg_popup_interface + */ +struct xdg_popup_interface { + /** + * remove xdg_popup interface + * + * This destroys the popup. Explicitly destroying the xdg_popup + * object will also dismiss the popup, and unmap the surface. + * + * If this xdg_popup is not the "topmost" popup, a protocol error + * will be sent. + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); + /** + * make the popup take an explicit grab + * + * This request makes the created popup take an explicit grab. An + * explicit grab will be dismissed when the user dismisses the + * popup, or when the client destroys the xdg_popup. This can be + * done by the user clicking outside the surface, using the + * keyboard, or even locking the screen through closing the lid or + * a timeout. + * + * If the compositor denies the grab, the popup will be immediately + * dismissed. + * + * This request must be used in response to some sort of user + * action like a button press, key press, or touch down event. The + * serial number of the event should be passed as 'serial'. + * + * The parent of a grabbing popup must either be an xdg_toplevel + * surface or another xdg_popup with an explicit grab. If the + * parent is another xdg_popup it means that the popups are nested, + * with this popup now being the topmost popup. + * + * Nested popups must be destroyed in the reverse order they were + * created in, e.g. the only popup you are allowed to destroy at + * all times is the topmost one. + * + * When compositors choose to dismiss a popup, they may dismiss + * every nested grabbing popup as well. When a compositor dismisses + * popups, it will follow the same dismissing order as required + * from the client. + * + * The parent of a grabbing popup must either be another xdg_popup + * with an active explicit grab, or an xdg_popup or xdg_toplevel, + * if there are no explicit grabs already taken. + * + * If the topmost grabbing popup is destroyed, the grab will be + * returned to the parent of the popup, if that parent previously + * had an explicit grab. + * + * If the parent is a grabbing popup which has already been + * dismissed, this popup will be immediately dismissed. If the + * parent is a popup that did not take an explicit grab, an error + * will be raised. + * + * During a popup grab, the client owning the grab will receive + * pointer and touch events for all their surfaces as normal + * (similar to an "owner-events" grab in X11 parlance), while the + * top most grabbing popup will always have keyboard focus. + * @param seat the wl_seat of the user event + * @param serial the serial of the user event + */ + void (*grab)(struct wl_client *client, + struct wl_resource *resource, + struct wl_resource *seat, + uint32_t serial); + /** + * recalculate the popup's location + * + * Reposition an already-mapped popup. The popup will be placed + * given the details in the passed xdg_positioner object, and a + * xdg_popup.repositioned followed by xdg_popup.configure and + * xdg_surface.configure will be emitted in response. Any + * parameters set by the previous positioner will be discarded. + * + * The passed token will be sent in the corresponding + * xdg_popup.repositioned event. The new popup position will not + * take effect until the corresponding configure event is + * acknowledged by the client. See xdg_popup.repositioned for + * details. The token itself is opaque, and has no other special + * meaning. + * + * If multiple reposition requests are sent, the compositor may + * skip all but the last one. + * + * If the popup is repositioned in response to a configure event + * for its parent, the client should send an + * xdg_positioner.set_parent_configure and possibly an + * xdg_positioner.set_parent_size request to allow the compositor + * to properly constrain the popup. + * + * If the popup is repositioned together with a parent that is + * being resized, but not in response to a configure event, the + * client should send an xdg_positioner.set_parent_size request. + * @param token reposition request token + * @since 3 + */ + void (*reposition)(struct wl_client *client, + struct wl_resource *resource, + struct wl_resource *positioner, + uint32_t token); +}; + +#define XDG_POPUP_CONFIGURE 0 +#define XDG_POPUP_POPUP_DONE 1 +#define XDG_POPUP_REPOSITIONED 2 + +/** + * @ingroup iface_xdg_popup + */ +#define XDG_POPUP_CONFIGURE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_popup + */ +#define XDG_POPUP_POPUP_DONE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_popup + */ +#define XDG_POPUP_REPOSITIONED_SINCE_VERSION 3 + +/** + * @ingroup iface_xdg_popup + */ +#define XDG_POPUP_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_popup + */ +#define XDG_POPUP_GRAB_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_popup + */ +#define XDG_POPUP_REPOSITION_SINCE_VERSION 3 + +/** + * @ingroup iface_xdg_popup + * Sends an configure event to the client owning the resource. + * @param resource_ The client's resource + * @param x x position relative to parent surface window geometry + * @param y y position relative to parent surface window geometry + * @param width window geometry width + * @param height window geometry height + */ +static inline void +xdg_popup_send_configure(struct wl_resource *resource_, int32_t x, int32_t y, int32_t width, int32_t height) +{ + wl_resource_post_event(resource_, XDG_POPUP_CONFIGURE, x, y, width, height); +} + +/** + * @ingroup iface_xdg_popup + * Sends an popup_done event to the client owning the resource. + * @param resource_ The client's resource + */ +static inline void +xdg_popup_send_popup_done(struct wl_resource *resource_) +{ + wl_resource_post_event(resource_, XDG_POPUP_POPUP_DONE); +} + +/** + * @ingroup iface_xdg_popup + * Sends an repositioned event to the client owning the resource. + * @param resource_ The client's resource + * @param token reposition request token + */ +static inline void +xdg_popup_send_repositioned(struct wl_resource *resource_, uint32_t token) +{ + wl_resource_post_event(resource_, XDG_POPUP_REPOSITIONED, token); +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sys/cmd/wm/xdg.c b/src/cmd/wm/xdg.c index 6a0c2c8..6a0c2c8 100644 --- a/sys/cmd/wm/xdg.c +++ b/src/cmd/wm/xdg.c diff --git a/sys/libbio/align.c b/src/libbio/align.c index 20a57df..20a57df 100644 --- a/sys/libbio/align.c +++ b/src/libbio/align.c diff --git a/sys/libbio/fasta.c b/src/libbio/fasta.c index 3788544..3788544 100644 --- a/sys/libbio/fasta.c +++ b/src/libbio/fasta.c diff --git a/sys/libbio/newick.c b/src/libbio/newick.c index 5e6d30a..5e6d30a 100644 --- a/sys/libbio/newick.c +++ b/src/libbio/newick.c diff --git a/sys/libbio/phylo.c b/src/libbio/phylo.c index d50934f..d50934f 100644 --- a/sys/libbio/phylo.c +++ b/src/libbio/phylo.c diff --git a/sys/libbio/rules.mk b/src/libbio/rules.mk index cbc6887..07ce97e 100644 --- a/sys/libbio/rules.mk +++ b/src/libbio/rules.mk @@ -4,25 +4,21 @@ include share/push.mk SRCS_$(d) := \ $(d)/fasta.c \ $(d)/newick.c \ - $(d)/phylo.c + $(d)/phylo.c LIBS_$(d) := $(d)/libbio.a -BINS_$(d) := -# TSTS_$(d) := \ +BINS_$(d) := +# CHECK_$(d) := \ # $(d)/test.c \ # $(d)/simulate.c include share/paths.mk # Local rules -# $(LIBS_$(d)) = TCFLAGS := -# $(LIBS_$(d)) = TCINCS := -# $(LIBS_$(d)) = TCLIBS := - $(LIBS_$(d)): $(OBJS_$(d)) $(OBJS_$(d)/io) $(ARCHIVE) -$(UNTS_$(d)): TCLIBS := $(LIBS_$(d)) $(OBJ_DIR)/libn/libn.a -$(UNTS_$(d)): $(TOBJS_$(d)) $(LIBS_$(d)) $(OBJ_DIR)/libn/libn.a +$(TEST_$(d)): TCLIBS = $(LIBS_$(d)) $(OBJ_DIR)/libn/libn.a +$(TEST_$(d)): $(UNIT_$(d)) $(LIBS_$(d)) $(OBJ_DIR)/libn/libn.a $(LINK) include share/pop.mk diff --git a/sys/libbio/simulate.c b/src/libbio/simulate.c index 0f5a97e..0f5a97e 100644 --- a/sys/libbio/simulate.c +++ b/src/libbio/simulate.c diff --git a/sys/libbio/test.c b/src/libbio/test.c index 9926764..9926764 100644 --- a/sys/libbio/test.c +++ b/src/libbio/test.c diff --git a/sys/libc/rules.mk b/src/libc/rules.mk index 96d4202..34e0912 100644 --- a/sys/libc/rules.mk +++ b/src/libc/rules.mk @@ -10,10 +10,7 @@ BINS_$(d) := include share/paths.mk # Local rules -# $(LIBS_$(d)) = TGTINCS := -# $(LIBS_$(d)) = TGTLIBS := - -$(LIBS_$(d)): TCFLAGS := -ffreestanding -fno-builtin -nostdlib +$(LIBS_$(d)): TCFLAGS = -ffreestanding -fno-builtin -nostdlib $(LIBS_$(d)): $(OBJS_$(d)) $(ARCHIVE) diff --git a/sys/libc/stdio.c b/src/libc/stdio.c index 8bbbe9a..8bbbe9a 100644 --- a/sys/libc/stdio.c +++ b/src/libc/stdio.c diff --git a/sys/libc/string.c b/src/libc/string.c index 0e41efa..0e41efa 100644 --- a/sys/libc/string.c +++ b/src/libc/string.c diff --git a/sys/libfmt/buffer.c b/src/libfmt/buffer.c index 0099e72..0099e72 100644 --- a/sys/libfmt/buffer.c +++ b/src/libfmt/buffer.c diff --git a/sys/libfmt/do.c b/src/libfmt/do.c index eaac0a3..eaac0a3 100644 --- a/sys/libfmt/do.c +++ b/src/libfmt/do.c diff --git a/sys/libfmt/esprint.c b/src/libfmt/esprint.c index 6d97340..6d97340 100644 --- a/sys/libfmt/esprint.c +++ b/src/libfmt/esprint.c diff --git a/sys/libfmt/float.c b/src/libfmt/float.c index 63ea80f..63ea80f 100644 --- a/sys/libfmt/float.c +++ b/src/libfmt/float.c diff --git a/sys/libfmt/fprint.c b/src/libfmt/fprint.c index 26343f7..26343f7 100644 --- a/sys/libfmt/fprint.c +++ b/src/libfmt/fprint.c diff --git a/sys/libfmt/internal.h b/src/libfmt/internal.h index 725cfff..725cfff 100644 --- a/sys/libfmt/internal.h +++ b/src/libfmt/internal.h diff --git a/sys/libfmt/locale.c b/src/libfmt/locale.c index 437c61e..437c61e 100644 --- a/sys/libfmt/locale.c +++ b/src/libfmt/locale.c diff --git a/sys/libfmt/nsprint.c b/src/libfmt/nsprint.c index 90489e0..90489e0 100644 --- a/sys/libfmt/nsprint.c +++ b/src/libfmt/nsprint.c diff --git a/sys/libfmt/open.c b/src/libfmt/open.c index 8aadef5..8aadef5 100644 --- a/sys/libfmt/open.c +++ b/src/libfmt/open.c diff --git a/sys/libfmt/print.c b/src/libfmt/print.c index 20b8e00..20b8e00 100644 --- a/sys/libfmt/print.c +++ b/src/libfmt/print.c diff --git a/sys/libfmt/rules.mk b/src/libfmt/rules.mk index 2b1b431..9080bba 100644 --- a/sys/libfmt/rules.mk +++ b/src/libfmt/rules.mk @@ -1,9 +1,7 @@ include share/push.mk -# Iterate through subdirectory tree - # Local sources -SRCS_$(d) :=\ +SRCS_$(d):=\ $(d)/buffer.c\ $(d)/do.c\ $(d)/esprint.c\ @@ -20,9 +18,10 @@ SRCS_$(d) :=\ $(d)/vwrite.c\ $(d)/write.c -LIBS_$(d) := $(d)/libfmt.a +LIBS_$(d):=\ + $(d)/libfmt.a -TSTS_$(d) := \ +CHECK_$(d):=\ $(d)/test.c include share/paths.mk @@ -30,7 +29,7 @@ include share/paths.mk $(LIBS_$(d)): $(OBJS_$(d)) $(ARCHIVE) -$(UNTS_$(d)): $(TOBJS_$(d)) $(LIBS_$(d)) $(OBJ_DIR)/sys/libutf/libutf.a $(OBJ_DIR)/sys/base/base.a +$(TEST_$(d)): $(UNIT_$(d)) $(LIBS_$(d)) $(OBJ_DIR)/libutf/libutf.a $(OBJ_DIR)/base/base.a $(COMPLINK) include share/pop.mk diff --git a/sys/libfmt/sprint.c b/src/libfmt/sprint.c index f1be6dd..f1be6dd 100644 --- a/sys/libfmt/sprint.c +++ b/src/libfmt/sprint.c diff --git a/sys/libfmt/test.c b/src/libfmt/test.c index d81a62e..d81a62e 100644 --- a/sys/libfmt/test.c +++ b/src/libfmt/test.c diff --git a/sys/libfmt/vesprint.c b/src/libfmt/vesprint.c index 18f4dd2..18f4dd2 100644 --- a/sys/libfmt/vesprint.c +++ b/src/libfmt/vesprint.c diff --git a/sys/libfmt/vfprint.c b/src/libfmt/vfprint.c index 4306ea7..4306ea7 100644 --- a/sys/libfmt/vfprint.c +++ b/src/libfmt/vfprint.c diff --git a/sys/libfmt/vnsprint.c b/src/libfmt/vnsprint.c index 7ded908..7ded908 100644 --- a/sys/libfmt/vnsprint.c +++ b/src/libfmt/vnsprint.c diff --git a/sys/libfmt/vprint.c b/src/libfmt/vprint.c index bb3076b..bb3076b 100644 --- a/sys/libfmt/vprint.c +++ b/src/libfmt/vprint.c diff --git a/sys/libfmt/vwrite.c b/src/libfmt/vwrite.c index cacdef2..cacdef2 100644 --- a/sys/libfmt/vwrite.c +++ b/src/libfmt/vwrite.c diff --git a/sys/libfmt/write.c b/src/libfmt/write.c index 9a77223..9a77223 100644 --- a/sys/libfmt/write.c +++ b/src/libfmt/write.c diff --git a/sys/libmath/basic.c b/src/libmath/basic.c index 1341f7b..1341f7b 100644 --- a/sys/libmath/basic.c +++ b/src/libmath/basic.c diff --git a/sys/libmath/blas.c b/src/libmath/blas.c index 18f9760..18f9760 100644 --- a/sys/libmath/blas.c +++ b/src/libmath/blas.c diff --git a/sys/libmath/blas1.c b/src/libmath/blas1.c index a8ca085..a8ca085 100644 --- a/sys/libmath/blas1.c +++ b/src/libmath/blas1.c diff --git a/sys/libmath/blas1body b/src/libmath/blas1body index de4b637..de4b637 100644 --- a/sys/libmath/blas1body +++ b/src/libmath/blas1body diff --git a/sys/libmath/blas2.c b/src/libmath/blas2.c index 7e4b08e..7e4b08e 100644 --- a/sys/libmath/blas2.c +++ b/src/libmath/blas2.c diff --git a/sys/libmath/blas2body b/src/libmath/blas2body index 45baf67..45baf67 100644 --- a/sys/libmath/blas2body +++ b/src/libmath/blas2body diff --git a/sys/libmath/blas3.c b/src/libmath/blas3.c index b048c95..b048c95 100644 --- a/sys/libmath/blas3.c +++ b/src/libmath/blas3.c diff --git a/sys/libmath/lapack.c b/src/libmath/lapack.c index e69de29..e69de29 100644 --- a/sys/libmath/lapack.c +++ b/src/libmath/lapack.c diff --git a/sys/libmath/linalg.c b/src/libmath/linalg.c index 8551ff1..8551ff1 100644 --- a/sys/libmath/linalg.c +++ b/src/libmath/linalg.c diff --git a/sys/libmath/loop.h b/src/libmath/loop.h index a877d84..a877d84 100644 --- a/sys/libmath/loop.h +++ b/src/libmath/loop.h diff --git a/sys/libmath/matrix.c b/src/libmath/matrix.c index e8bca0b..e8bca0b 100644 --- a/sys/libmath/matrix.c +++ b/src/libmath/matrix.c diff --git a/src/libmath/rules.mk b/src/libmath/rules.mk new file mode 100644 index 0000000..577aba4 --- /dev/null +++ b/src/libmath/rules.mk @@ -0,0 +1,27 @@ +include share/push.mk + +# Iterate through subdirectory tree + +# local sources +SRCS_$(d):=\ + $(d)/basic.c\ + $(d)/blas1.c\ + $(d)/blas2.c\ + $(d)/blas3.c +CHECK_$(d):=\ + +# outputs +LIBS_$(d):=\ + $(d)/libmath.a + +include share/paths.mk + +$(LIBS_$(d)): $(OBJS_$(d)) + $(ARCHIVE) + +$(TEST_$(d)): TCFLAGS = -D_GNU_SOURCE +$(TEST_$(d)): TCLIBS = -lpthread -lm $(LIB_DIR)/libblas.a +$(TEST_$(d)): $(UNIT_$(d)) $(LIBS_$(d)) $(OBJ_DIR)/base/base.a + $(LINK) + +include share/pop.mk diff --git a/sys/libmath/test.c b/src/libmath/test.c index 66700f8..66700f8 100644 --- a/sys/libmath/test.c +++ b/src/libmath/test.c diff --git a/sys/libsre/lex.c b/src/libsre/lex.c index f4c6ac2..f4c6ac2 100644 --- a/sys/libsre/lex.c +++ b/src/libsre/lex.c diff --git a/sys/libsre/sre.h b/src/libsre/sre.h index a7ace1a..a7ace1a 100644 --- a/sys/libsre/sre.h +++ b/src/libsre/sre.h diff --git a/sys/libterm/term.c b/src/libterm/term.c index 11591fc..11591fc 100644 --- a/sys/libterm/term.c +++ b/src/libterm/term.c diff --git a/sys/libterm/term.h b/src/libterm/term.h index 6bd2f6b..6bd2f6b 100644 --- a/sys/libterm/term.h +++ b/src/libterm/term.h diff --git a/sys/libterm/window.c b/src/libterm/window.c index 5d36c8b..5d36c8b 100644 --- a/sys/libterm/window.c +++ b/src/libterm/window.c diff --git a/sys/libutf/canfit.c b/src/libutf/canfit.c index 4579ab3..4579ab3 100644 --- a/sys/libutf/canfit.c +++ b/src/libutf/canfit.c diff --git a/sys/libutf/decode.c b/src/libutf/decode.c index 01797f1..01797f1 100644 --- a/sys/libutf/decode.c +++ b/src/libutf/decode.c diff --git a/sys/libutf/decodeprev.c b/src/libutf/decodeprev.c index 27dced6..27dced6 100644 --- a/sys/libutf/decodeprev.c +++ b/src/libutf/decodeprev.c diff --git a/sys/libutf/encode.c b/src/libutf/encode.c index fa7c93e..fa7c93e 100644 --- a/sys/libutf/encode.c +++ b/src/libutf/encode.c diff --git a/sys/libutf/find.c b/src/libutf/find.c index d75feb8..d75feb8 100644 --- a/sys/libutf/find.c +++ b/src/libutf/find.c diff --git a/sys/libutf/findlast.c b/src/libutf/findlast.c index ab25ab2..ab25ab2 100644 --- a/sys/libutf/findlast.c +++ b/src/libutf/findlast.c diff --git a/sys/libutf/internal.h b/src/libutf/internal.h index 9719977..9719977 100644 --- a/sys/libutf/internal.h +++ b/src/libutf/internal.h diff --git a/sys/libutf/len.c b/src/libutf/len.c index 8fbd679..8fbd679 100644 --- a/sys/libutf/len.c +++ b/src/libutf/len.c diff --git a/sys/libutf/rules.mk b/src/libutf/rules.mk index 53ff8cf..aeb86b2 100644 --- a/sys/libutf/rules.mk +++ b/src/libutf/rules.mk @@ -1,20 +1,20 @@ include share/push.mk -UNICODE = 14.0.0 - -SRCS_$(d) := \ - $(d)/encode.c \ - $(d)/decode.c \ - $(d)/decodeprev.c \ - $(d)/find.c \ - $(d)/findlast.c \ - $(d)/canfit.c \ - $(d)/runelen.c \ - $(d)/len.c \ - $(d)/runetype-$(UNICODE).c \ +UNICODE=14.0.0 + +SRCS_$(d):=\ + $(d)/encode.c\ + $(d)/decode.c\ + $(d)/decodeprev.c\ + $(d)/find.c\ + $(d)/findlast.c\ + $(d)/canfit.c\ + $(d)/runelen.c\ + $(d)/len.c\ + $(d)/runetype-$(UNICODE).c\ $(d)/runewidth-$(UNICODE).c -LIBS_$(d) := $(d)/libutf.a +LIBS_$(d):=$(d)/libutf.a include share/paths.mk @@ -29,7 +29,7 @@ $(d)/vendor/UnicodeData-$(UNICODE).txt: @echo "GET UnicodeData.txt";\ curl https://www.unicode.org/Public/$(UNICODE)/ucd/UnicodeData.txt > $@ -$(d)/vendor/mkrunetype: $(d)/vendor/mkrunetype.c $(d)/vendor/common.o $(OBJ_DIR)/sys/base/base.a +$(d)/vendor/mkrunetype: $(d)/vendor/mkrunetype.c $(d)/vendor/common.o $(OBJ_DIR)/base/base.a $(COMPLINK) GENS += $(d)/vendor/mkrunetype @@ -46,7 +46,7 @@ $(d)/vendor/EmojiData-$(UNICODE).txt: @echo "GET EmojiData.txt";\ curl https://www.unicode.org/Public/$(UNICODE)/ucd/emoji/emoji-data.txt > $@ -$(d)/vendor/mkrunewidth: $(d)/vendor/mkrunewidth.c $(d)/vendor/common.o $(OBJ_DIR)/sys/base/base.a +$(d)/vendor/mkrunewidth: $(d)/vendor/mkrunewidth.c $(d)/vendor/common.o $(OBJ_DIR)/base/base.a $(COMPLINK) GENS += $(d)/vendor/mkrunewidth @@ -59,7 +59,7 @@ $(d)/vendor/GraphemeBreakProperty-$(UNICODE).txt: @echo "GET GraphemeBreakProperty.txt";\ curl https://www.unicode.org/Public/$(UNICODE)/ucd/auxiliary/GraphemeBreakProperty.txt > $@ -$(d)/vendor/mkgraphemedata: $(d)/vendor/mkgraphemedata.c $(d)/vendor/common.o $(OBJ_DIR)/sys/base/base.a +$(d)/vendor/mkgraphemedata: $(d)/vendor/mkgraphemedata.c $(d)/vendor/common.o $(OBJ_DIR)/base/base.a $(COMPLINK) $(d)/graphemedata-$(UNICODE).c: $(d)/vendor/mkgraphemedata $(d)/vendor/GraphemeBreakProperty-$(UNICODE).txt diff --git a/sys/libutf/runelen.c b/src/libutf/runelen.c index dac7f15..dac7f15 100644 --- a/sys/libutf/runelen.c +++ b/src/libutf/runelen.c diff --git a/sys/libutf/vendor/common.c b/src/libutf/vendor/common.c index 5a03a50..5a03a50 100644 --- a/sys/libutf/vendor/common.c +++ b/src/libutf/vendor/common.c diff --git a/sys/libutf/vendor/common.h b/src/libutf/vendor/common.h index 62f6c5b..62f6c5b 100644 --- a/sys/libutf/vendor/common.h +++ b/src/libutf/vendor/common.h diff --git a/sys/libutf/vendor/mkgraphemedata.c b/src/libutf/vendor/mkgraphemedata.c index ce5a952..ce5a952 100644 --- a/sys/libutf/vendor/mkgraphemedata.c +++ b/src/libutf/vendor/mkgraphemedata.c diff --git a/sys/libutf/vendor/mkrunetype.c b/src/libutf/vendor/mkrunetype.c index 9f939f4..9f939f4 100644 --- a/sys/libutf/vendor/mkrunetype.c +++ b/src/libutf/vendor/mkrunetype.c diff --git a/sys/libutf/vendor/mkrunewidth.c b/src/libutf/vendor/mkrunewidth.c index 14e6973..14e6973 100644 --- a/sys/libutf/vendor/mkrunewidth.c +++ b/src/libutf/vendor/mkrunewidth.c diff --git a/sys/nixos/rules.mk b/src/nixos/rules.mk index e69de29..e69de29 100644 --- a/sys/nixos/rules.mk +++ b/src/nixos/rules.mk diff --git a/sys/rules.mk b/src/rules.mk index 6d1dfa5..9bb61ae 100644 --- a/sys/rules.mk +++ b/src/rules.mk @@ -20,22 +20,4 @@ include $(DIR)/rules.mk DIR := $(d)/libbio include $(DIR)/rules.mk -# DIR := $(d)/libc -# include $(DIR)/rules.mk - -# DIR := $(d)/libdraw -# include $(DIR)/rules.mk - -# DIR := $(d)/libimage -# include $(DIR)/rules.mk - -# DIR := $(d)/libfont -# include $(DIR)/rules.mk - -# DIR := $(d)/libterm -# include $(DIR)/rules.mk - -# DIR := $(d)/libsre -# include $(DIR)/rules.mk - include share/pop.mk diff --git a/sys/cmd/dwm/rules.mk b/sys/cmd/dwm/rules.mk deleted file mode 100644 index 79c4548..0000000 --- a/sys/cmd/dwm/rules.mk +++ /dev/null @@ -1,28 +0,0 @@ -include share/push.mk -# Iterate through subdirectory tree - -# Local sources -SRCS_$(d) := \ - $(d)/drw.c \ - $(d)/hook.c \ - $(d)/client.c \ - $(d)/util.c \ - $(d)/dwm.c -BINS_$(d) := $(d)/dwm - -include share/paths.mk - -# Local rules -include share/dynamic.mk -$(BINS_$(d)): TCFLAGS = \ - `$(PKG) --cflags fontconfig` \ - `$(PKG) --cflags freetype2` -$(BINS_$(d)): TCLIBS = \ - `$(PKG) --libs fontconfig` \ - `$(PKG) --libs freetype2` \ - -lX11 -lXinerama -lXft -lX11-xcb -lxcb -lxcb-res - -$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/libutf/libutf.a $(OBJ_DIR)/sys/base/base.a - $(COMPLINK) - -include share/pop.mk diff --git a/sys/cmd/filter/rules.mk b/sys/cmd/filter/rules.mk deleted file mode 100644 index 31bb257..0000000 --- a/sys/cmd/filter/rules.mk +++ /dev/null @@ -1,13 +0,0 @@ -include share/push.mk - -# Local sources -SRCS_$(d) := $(d)/filter.c -BINS_$(d) := $(d)/filter - -include share/paths.mk - -# Local rules -$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/base/base.a - $(COMPLINK) - -include share/pop.mk diff --git a/sys/cmd/menu/rules.mk b/sys/cmd/menu/rules.mk deleted file mode 100644 index 1ee3ab0..0000000 --- a/sys/cmd/menu/rules.mk +++ /dev/null @@ -1,25 +0,0 @@ -include share/push.mk -# Iterate through subdirectory tree - -# Local sources -SRCS_$(d) := \ - $(d)/menu.c \ - $(d)/drw.c \ - $(d)/util.c - -BINS_$(d) := $(d)/menu - -include share/paths.mk - -# Local rules -include share/dynamic.mk -$(BINS_$(d)): TCLIBS = \ - -lfontconfig -lXft -lXinerama -lX11 -$(BINS_$(d)): TCINCS = \ - `$(PKG) --cflags fontconfig` \ - `$(PKG) --cflags freetype2` - -$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/base/base.a - $(COMPLINK) - -include share/pop.mk diff --git a/sys/cmd/term/rules.mk b/sys/cmd/term/rules.mk deleted file mode 100644 index 45c9eb2..0000000 --- a/sys/cmd/term/rules.mk +++ /dev/null @@ -1,24 +0,0 @@ -include share/push.mk -# Iterate through subdirectory tree - -# Local sources -SRCS_$(d) := $(d)/term.c $(d)/x.c #$(d)/hb.c -BINS_$(d) := $(d)/term - -include share/paths.mk - -# Local rules -include share/dynamic.mk -$(BINS_$(d)): TCFLAGS = \ - `$(PKG) --cflags fontconfig` \ - `$(PKG) --cflags freetype2` - -$(BINS_$(d)): TCLIBS = \ - `$(PKG) --libs fontconfig` \ - `$(PKG) --libs freetype2` \ - -lm -lrt -lX11 -lutil -lXft -lXrender #-lharfbuzz - -$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/libutf/libutf.a $(OBJ_DIR)/sys/base/base.a - $(COMPLINK) - -include share/pop.mk diff --git a/sys/cmd/walk/rules.mk b/sys/cmd/walk/rules.mk deleted file mode 100644 index 5b9192d..0000000 --- a/sys/cmd/walk/rules.mk +++ /dev/null @@ -1,13 +0,0 @@ -include share/push.mk - -# Local sources -SRCS_$(d) := $(d)/walk.c -BINS_$(d) := $(d)/walk - -include share/paths.mk - -# Local rules -$(BINS_$(d)): $(OBJS_$(d)) $(OBJ_DIR)/sys/base/base.a - $(COMPLINK) - -include share/pop.mk diff --git a/sys/libmath/rules.mk b/sys/libmath/rules.mk deleted file mode 100644 index 83945d7..0000000 --- a/sys/libmath/rules.mk +++ /dev/null @@ -1,24 +0,0 @@ -include share/push.mk - -# Iterate through subdirectory tree - -# Local sources -SRCS_$(d) := \ - $(d)/basic.c \ - $(d)/blas1.c \ - $(d)/blas2.c \ - $(d)/blas3.c -LIBS_$(d) := $(d)/libmath.a -TSTS_$(d) := - -include share/paths.mk - -$(LIBS_$(d)): $(OBJS_$(d)) - $(ARCHIVE) - -$(UNTS_$(d)): TCFLAGS := -D_GNU_SOURCE -$(UNTS_$(d)): TCLIBS := -lpthread -lm $(LIB_DIR)/libblas.a $(OBJ_DIR)/sys/libn/libn.a $(LIBS_$(d)) -$(UNTS_$(d)): $(TOBJS_$(d)) $(LIBS_$(d)) $(OBJ_DIR)/sys/libn/libn.a - $(LINK) - -include share/pop.mk |