197 Commits

Author SHA1 Message Date
Isaac Freund
003984f3bf scanner: remove commented code
This lives on in the git history.
2022-05-08 15:47:33 +02:00
Isaac Freund
881f35ae62 scanner: clean up excessive ArrayList usage 2022-05-08 15:46:24 +02:00
Isaac Freund
8218e21bc6 examples: Fix compilation 2022-04-28 16:18:01 +02:00
Isaac Freund
5dd0ba638a Rework wrapping of wl_display functions
With the way libwayland uses errno, it isn't feasible for me to
determine exactly which errno values are possible after libwayland
function calls in most cases. Returning the full errno enum provided
by the zig standard and allowing the users to check for only those
values they care to handle differently is the most robust way to use
thesl APIs.

This change makes it so that the "number of events dispatched"
is no longer available, but I'm not aware of any use-case for this
information.
2022-04-28 16:09:23 +02:00
Isaac Freund
f4ca39015b Add several missing client wl_display_* functions 2022-04-28 16:09:23 +02:00
Hugo Machet
75802aa74a ci: Update to zig 0.9.1 2022-02-17 19:41:57 +02:00
Isaac Freund
753dfe81d9 client: handle EPROTO in dispatch() 2022-01-23 22:07:49 +01:00
Isaac Freund
d4bf1dd7ae ci: update to zig 0.9.0 2021-12-23 19:51:55 +00:00
Isaac Freund
80166ba1d5 Remove ScanProtocolsStep.getPkg()
Instead users should manually create the std.build.Pkg using the new
ScanProtocolsStep.result GeneratedFile. For example:

const wayland = Pkg{
    .name = "wayland",
    .path = .{ .generated = &scanner.result },
};

This gives users control over the name of the package and will likely
integrate better with future zig build system changes.
2021-12-23 18:12:47 +00:00
Isaac Freund
398059895f Update to zig version 0.9.0 2021-12-23 18:12:29 +00:00
Isaac Freund
38b5de89b3 Fix type of event loop idle callbacks 2021-11-23 22:43:46 +01:00
Isaac Freund
ff5c30a7cc Generate wrappers for wl.Proxy.destroy() if needed
If the client has a destroy request, then that function servers as a
wl.Proxy.destroy() wrapper as well. However if the client doesn't have a
destroy request we need a wrapper to avoid annoying/ugly @ptrCast()s.
2021-10-14 17:59:45 +02:00
Isaac Freund
1923460448 Clean up wl_proxy and wl_display bindings 2021-10-13 15:50:43 +02:00
Isaac Freund
476727bc07 Generate Proxy.setQueue() wrappers for client objects
display.setQueue(queue); is much nicer than needing a
@ptrCast(*wl.Proxy, display) first.
2021-10-13 15:45:00 +02:00
Isaac Freund
398f83bb11 Bind wl_proxy_set_queue() 2021-10-13 15:36:50 +02:00
novakane
f85bb15e66 ci: fix xbps invocation
This avoids errors like:

util-linux-common-2.37.2_1 in transaction breaks installed pkg `libfdisk-2.37.1_1'
util-linux-common-2.37.2_1 in transaction breaks installed pkg `libsmartcols-2.37.1_1'
libuuid-2.37.2_1 in transaction breaks installed pkg `libfdisk-2.37.1_1'
libuuid-2.37.2_1 in transaction breaks installed pkg `util-linux-2.37.1_1'
libblkid-2.37.2_1 in transaction breaks installed pkg `libfdisk-2.37.1_1'
libblkid-2.37.2_1 in transaction breaks installed pkg `util-linux-2.37.1_1'
libmount-2.37.2_1 in transaction breaks installed pkg `util-linux-2.37.1_1'
Transaction aborted due to unresolved dependencies.
2021-10-12 21:34:25 +02:00
Isaac Freund
a8e1efcfd3 Bump zig requirement to 0.8.0 2021-06-05 17:01:45 +00:00
Isaac Freund
b01238f904 Use inline keyword over callconv(.Inline) 2021-05-23 14:38:38 +02:00
novakne
55bc32c4b3 scanner: refactor to use new std.fmt features 2021-05-23 14:38:38 +02:00
Isaac Freund
ce545d8851 Update for breaking std.testing changes 2021-05-23 14:38:38 +02:00
hafermix
a62779fbc4 Pass compilation with current Zig 0.8.0 master 2021-05-12 11:32:35 +02:00
Isaac Freund
902828abe1 examples: fix build failure due to previous commit 2021-04-27 12:27:10 +02:00
Isaac Freund
a453b26a07 client: assert instead of returning error in setListener
libwayland does not allow the listener/dispatcher for a proxy to be
changed once set, therefore setting a listener a second time is always
a bug.
2021-04-27 12:21:29 +02:00
Leon Henrik Plickat
f14bd736e7 scanner: Skip attributes for toplevel description 2021-04-15 10:26:01 +02:00
Leon Henrik Plickat
8841de4065 scanner: Add "generated by ..." comment 2021-04-10 19:58:27 +02:00
Leon Henrik Plickat
efd3a37c03 scanner: Add copyright and toplevel description 2021-04-10 19:58:27 +02:00
Isaac Freund
8631649596 scanner: prefix local variables with an underscore
This avoids shadowing issues, for example if a request named "key" also
has an argument named "key" as is the case for virtual-keyboard.
2021-04-08 19:45:52 +02:00
Isaac Freund
f170fe0265 Use build root instead of cwd in scanner 2021-03-09 21:05:36 +01:00
Isaac Freund
5def9c5810 Obtain namespace from interface names
Some protocols omit the namespace prefix from protocol names, for
example pointer-constraints.
2021-01-31 14:36:11 +01:00
Isaac Freund
67e2c11ff3 Remove *_set_user_data definitions
Using these breaks the type safety provided by zig-wayland. If users
really need them for some reason they can always define them themselves.
2021-01-17 17:04:32 +01:00
Isaac Freund
6880196f57 Allow data pointers to be const 2021-01-17 16:08:23 +01:00
Isaac Freund
05f539c893 Add list.Head.SafeIterator() 2021-01-15 18:03:02 +01:00
Isaac Freund
4356423568 Specify supported zig version 2021-01-10 20:13:43 +01:00
Isaac Freund
1d98fbc1d4 Generate postError function for server objects 2021-01-10 18:31:20 +01:00
Isaac Freund
0dd1bee2de Add wl.Listener.init() 2020-12-31 14:16:32 +01:00
Isaac Freund
992e39999e Make type-safe wrappers inline
This avoids code bloat from generics and makes the type safe zero-cost.
2020-12-31 13:36:01 +01:00
Isaac Freund
d693b3704e Avoid potential packed struct bugs in generated code
The stage1 zig compiler is known to have bugs with packed structs.
The best way to ensure our generated packed struct bitfields always
have the size and alignment of a u32 is to pad exclusively with bool
fields.
2020-12-24 00:14:14 +01:00
Isaac Freund
4bfcc09b28 Make wl.list.Direction and wl.list.Head.Iterator pub 2020-12-21 17:41:02 +01:00
Isaac Freund
52326e7ee0 Output generated code to zig-cache of host project
This is a (minor) breaking change, the second parameter of
ScanProtocolStep.create() has been removed as it is no longer needed.

This will make packaging zig-wayland much more pleasant.
2020-12-06 13:48:28 +01:00
Isaac Freund
d8d4e0ca06 Add basic CI 2020-12-05 22:53:19 +01:00
Isaac Freund
dd6ca8c2e1 Link wayland-cursor for ref-all test 2020-12-05 22:36:26 +01:00
Leon Henrik Plickat
455ebd136f Add wayland-cursor bindings 2020-12-05 19:00:58 +01:00
Isaac Freund
6503341b64 Add wayland-egl bindings 2020-11-29 11:11:57 +01:00
Isaac Freund
90dc0ef93a Fix dispatching of pointer types 2020-11-28 15:10:51 +01:00
Isaac Freund
ed785e53bc Add Array.slice() convenience function 2020-11-28 15:09:23 +01:00
Isaac Freund
dc37fd58df Make fromArrayList() pub
This fixes an oversight in the previous commit
2020-11-28 13:09:42 +01:00
Isaac Freund
2cd6117872 Add Array.fromArrayList(), make data optional 2020-11-28 13:07:06 +01:00
Isaac Freund
a57a8f2e73 Pass correct function to wl_resource_set_dispatcher 2020-11-28 12:55:59 +01:00
Isaac Freund
f9e5a786a3 Allow null resource destroy handlers 2020-11-28 12:22:01 +01:00
Isaac Freund
bee1887766 Fix Dispatcher for void fields, clean up logic 2020-11-26 11:11:15 +01:00