raiguard/odin-wayland

git clone https://git.raiguard.me/raiguard/odin-wayland

Caleb HeuerMove generated -> mockgenfd8ef50

trunk
1.5 KiB58 linesraw
1// =====================================================================================================================
2// GENERATED CODE
3// This code was generated with wayland/codegen.
4// Do not edit this code!
5// =====================================================================================================================
6
7#+build linux
8#+vet explicit-allocators
9package wayland
10
11import "core:fmt"
12import "core:io"
13import "core:reflect"
14
15Object_Kind :: enum {
16	// Core global object.
17	Display = 1,
18	// Global registry object.
19	Registry,
20	// Callback object.
21	Callback,
22	// The compositor singleton.
23	Compositor,
24}
25
26@(rodata)
27object_kind_to_interface_name := [Object_Kind]string {
28	.Display = DISPLAY_INTERFACE_NAME,
29	.Registry = REGISTRY_INTERFACE_NAME,
30	.Callback = CALLBACK_INTERFACE_NAME,
31	.Compositor = COMPOSITOR_INTERFACE_NAME,
32}
33
34// TODO gen:
35// registry_bind :: proc{}
36
37on_event :: proc{
38	on_display_error,
39	on_display_delete_id,
40	on_registry_global,
41	on_registry_global_remove,
42	on_callback_done,
43}
44
45// TODO: Make Object_ID a union and transmute its discriminant into Object_Kind.
46_object_id_type_to_kind :: #force_inline proc($ID_Type: typeid) -> Object_Kind {
47	when ID_Type == Display_ID {
48		return .Display
49	} else when ID_Type == Registry_ID {
50		return .Registry
51	} else when ID_Type == Callback_ID {
52		return .Callback
53	} else when ID_Type == Compositor_ID {
54		return .Compositor
55	} else {
56		#panic("Unhandled ID type passed to _object_id_type_to_kind")
57	}
58}