scanner: add defines for wayland interface versions

Currently, it is cumbersome for clients that want to know what version of an
interface is supported at compile time. This can especially matter in cases
where the compositor and client aren't neccesarily compiled against the same
wayland and wayland protocol versions. Provide more information by adding a
simple int define for all interfaces that give the version that is already
defined in the source xml file.

Signed-off-by: Dudemanguy <random342@airmail.cc>
This commit is contained in:
Dudemanguy 2024-04-25 18:29:43 -05:00
parent 6137c8c213
commit ab4c580480
9 changed files with 262 additions and 0 deletions

View file

@ -964,6 +964,11 @@ struct wl_display_interface {
uint32_t registry);
};
/**
* @ingroup iface_wl_display
*/
#define WL_DISPLAY_MAX_VERSION 1
#define WL_DISPLAY_ERROR 0
#define WL_DISPLAY_DELETE_ID 1
@ -1006,6 +1011,11 @@ struct wl_registry_interface {
const char *interface, uint32_t version, uint32_t id);
};
/**
* @ingroup iface_wl_registry
*/
#define WL_REGISTRY_MAX_VERSION 1
#define WL_REGISTRY_GLOBAL 0
#define WL_REGISTRY_GLOBAL_REMOVE 1
@ -1049,6 +1059,11 @@ wl_registry_send_global_remove(struct wl_resource *resource_, uint32_t name)
wl_resource_post_event(resource_, WL_REGISTRY_GLOBAL_REMOVE, name);
}
/**
* @ingroup iface_wl_callback
*/
#define WL_CALLBACK_MAX_VERSION 1
#define WL_CALLBACK_DONE 0
/**
@ -1094,6 +1109,11 @@ struct wl_compositor_interface {
uint32_t id);
};
/**
* @ingroup iface_wl_compositor
*/
#define WL_COMPOSITOR_MAX_VERSION 4
/**
* @ingroup iface_wl_compositor
@ -1162,6 +1182,11 @@ struct wl_shm_pool_interface {
int32_t size);
};
/**
* @ingroup iface_wl_shm_pool
*/
#define WL_SHM_POOL_MAX_VERSION 1
/**
* @ingroup iface_wl_shm_pool
@ -1634,6 +1659,11 @@ struct wl_shm_interface {
int32_t size);
};
/**
* @ingroup iface_wl_shm
*/
#define WL_SHM_MAX_VERSION 1
#define WL_SHM_FORMAT 0
/**
@ -1675,6 +1705,11 @@ struct wl_buffer_interface {
struct wl_resource *resource);
};
/**
* @ingroup iface_wl_buffer
*/
#define WL_BUFFER_MAX_VERSION 1
#define WL_BUFFER_RELEASE 0
/**
@ -1870,6 +1905,11 @@ struct wl_data_offer_interface {
uint32_t preferred_action);
};
/**
* @ingroup iface_wl_data_offer
*/
#define WL_DATA_OFFER_MAX_VERSION 3
#define WL_DATA_OFFER_OFFER 0
#define WL_DATA_OFFER_SOURCE_ACTIONS 1
#define WL_DATA_OFFER_ACTION 2
@ -2027,6 +2067,11 @@ struct wl_data_source_interface {
uint32_t dnd_actions);
};
/**
* @ingroup iface_wl_data_source
*/
#define WL_DATA_SOURCE_MAX_VERSION 3
#define WL_DATA_SOURCE_TARGET 0
#define WL_DATA_SOURCE_SEND 1
#define WL_DATA_SOURCE_CANCELLED 2
@ -2242,6 +2287,11 @@ struct wl_data_device_interface {
struct wl_resource *resource);
};
/**
* @ingroup iface_wl_data_device
*/
#define WL_DATA_DEVICE_MAX_VERSION 3
#define WL_DATA_DEVICE_DATA_OFFER 0
#define WL_DATA_DEVICE_ENTER 1
#define WL_DATA_DEVICE_LEAVE 2
@ -2464,6 +2514,11 @@ struct wl_data_device_manager_interface {
struct wl_resource *seat);
};
/**
* @ingroup iface_wl_data_device_manager
*/
#define WL_DATA_DEVICE_MANAGER_MAX_VERSION 3
/**
* @ingroup iface_wl_data_device_manager
@ -2526,6 +2581,11 @@ struct wl_shell_interface {
struct wl_resource *surface);
};
/**
* @ingroup iface_wl_shell
*/
#define WL_SHELL_MAX_VERSION 1
/**
* @ingroup iface_wl_shell
@ -2925,6 +2985,11 @@ struct wl_shell_surface_interface {
const char *class_);
};
/**
* @ingroup iface_wl_shell_surface
*/
#define WL_SHELL_SURFACE_MAX_VERSION 1
#define WL_SHELL_SURFACE_PING 0
#define WL_SHELL_SURFACE_CONFIGURE 1
#define WL_SHELL_SURFACE_POPUP_DONE 2
@ -3419,6 +3484,11 @@ struct wl_surface_interface {
int32_t height);
};
/**
* @ingroup iface_wl_surface
*/
#define WL_SURFACE_MAX_VERSION 4
#define WL_SURFACE_ENTER 0
#define WL_SURFACE_LEAVE 1
@ -3604,6 +3674,11 @@ struct wl_seat_interface {
struct wl_resource *resource);
};
/**
* @ingroup iface_wl_seat
*/
#define WL_SEAT_MAX_VERSION 6
#define WL_SEAT_CAPABILITIES 0
#define WL_SEAT_NAME 1
@ -3910,6 +3985,11 @@ struct wl_pointer_interface {
struct wl_resource *resource);
};
/**
* @ingroup iface_wl_pointer
*/
#define WL_POINTER_MAX_VERSION 6
#define WL_POINTER_ENTER 0
#define WL_POINTER_LEAVE 1
#define WL_POINTER_MOTION 2
@ -4186,6 +4266,11 @@ struct wl_keyboard_interface {
struct wl_resource *resource);
};
/**
* @ingroup iface_wl_keyboard
*/
#define WL_KEYBOARD_MAX_VERSION 6
#define WL_KEYBOARD_KEYMAP 0
#define WL_KEYBOARD_ENTER 1
#define WL_KEYBOARD_LEAVE 2
@ -4323,6 +4408,11 @@ struct wl_touch_interface {
struct wl_resource *resource);
};
/**
* @ingroup iface_wl_touch
*/
#define WL_TOUCH_MAX_VERSION 6
#define WL_TOUCH_DOWN 0
#define WL_TOUCH_UP 1
#define WL_TOUCH_MOTION 2
@ -4672,6 +4762,11 @@ struct wl_output_interface {
struct wl_resource *resource);
};
/**
* @ingroup iface_wl_output
*/
#define WL_OUTPUT_MAX_VERSION 3
#define WL_OUTPUT_GEOMETRY 0
#define WL_OUTPUT_MODE 1
#define WL_OUTPUT_DONE 2
@ -4800,6 +4895,11 @@ struct wl_region_interface {
int32_t height);
};
/**
* @ingroup iface_wl_region
*/
#define WL_REGION_MAX_VERSION 1
/**
* @ingroup iface_wl_region
@ -4879,6 +4979,11 @@ struct wl_subcompositor_interface {
struct wl_resource *parent);
};
/**
* @ingroup iface_wl_subcompositor
*/
#define WL_SUBCOMPOSITOR_MAX_VERSION 1
/**
* @ingroup iface_wl_subcompositor
@ -5042,6 +5147,11 @@ struct wl_subsurface_interface {
struct wl_resource *resource);
};
/**
* @ingroup iface_wl_subsurface
*/
#define WL_SUBSURFACE_MAX_VERSION 1
/**
* @ingroup iface_wl_subsurface