raiguard/odin-wayland
git clone https://git.raiguard.me/raiguard/odin-wayland
fd8ef50
trunk
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. 17Display = 1 , 18// Global registry object. 19Registry , 20// Callback object. 21Callback , 22// The compositor singleton. 23Compositor , 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 { 38on_display_error , 39on_display_delete_id , 40on_registry_global , 41on_registry_global_remove , 42on_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 { 47when ID_Type == Display_ID { 48return . Display 49} else when ID_Type == Registry_ID { 50return . Registry 51} else when ID_Type == Callback_ID { 52return . Callback 53} else when ID_Type == Compositor_ID { 54return . Compositor 55} else { 56#panic ( "Unhandled ID type passed to _object_id_type_to_kind" ) 57} 58}