fixed cgo wayland patch

This commit is contained in:
Roland Singer 2017-11-28 13:59:58 +01:00
parent 7af11fba36
commit ca8e3a675d
4 changed files with 25 additions and 23 deletions

View file

@ -30,14 +30,14 @@
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface zwp_idle_inhibitor_v1_interface;
static const struct wl_interface *types[] = {
static const struct wl_interface *wl_ii_types[] = {
&zwp_idle_inhibitor_v1_interface,
&wl_surface_interface,
};
static const struct wl_message zwp_idle_inhibit_manager_v1_requests[] = {
{ "destroy", "", types + 0 },
{ "create_inhibitor", "no", types + 0 },
{ "destroy", "", wl_ii_types + 0 },
{ "create_inhibitor", "no", wl_ii_types + 0 },
};
WL_EXPORT const struct wl_interface zwp_idle_inhibit_manager_v1_interface = {
@ -47,7 +47,7 @@ WL_EXPORT const struct wl_interface zwp_idle_inhibit_manager_v1_interface = {
};
static const struct wl_message zwp_idle_inhibitor_v1_requests[] = {
{ "destroy", "", types + 0 },
{ "destroy", "", wl_ii_types + 0 },
};
WL_EXPORT const struct wl_interface zwp_idle_inhibitor_v1_interface = {

View file

@ -34,7 +34,7 @@ extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface zwp_confined_pointer_v1_interface;
extern const struct wl_interface zwp_locked_pointer_v1_interface;
static const struct wl_interface *types[] = {
static const struct wl_interface *wl_pc_types[] = {
NULL,
NULL,
&zwp_locked_pointer_v1_interface,
@ -52,9 +52,9 @@ static const struct wl_interface *types[] = {
};
static const struct wl_message zwp_pointer_constraints_v1_requests[] = {
{ "destroy", "", types + 0 },
{ "lock_pointer", "noo?ou", types + 2 },
{ "confine_pointer", "noo?ou", types + 7 },
{ "destroy", "", wl_pc_types + 0 },
{ "lock_pointer", "noo?ou", wl_pc_types + 2 },
{ "confine_pointer", "noo?ou", wl_pc_types + 7 },
};
WL_EXPORT const struct wl_interface zwp_pointer_constraints_v1_interface = {
@ -64,14 +64,14 @@ WL_EXPORT const struct wl_interface zwp_pointer_constraints_v1_interface = {
};
static const struct wl_message zwp_locked_pointer_v1_requests[] = {
{ "destroy", "", types + 0 },
{ "set_cursor_position_hint", "ff", types + 0 },
{ "set_region", "?o", types + 12 },
{ "destroy", "", wl_pc_types + 0 },
{ "set_cursor_position_hint", "ff", wl_pc_types + 0 },
{ "set_region", "?o", wl_pc_types + 12 },
};
static const struct wl_message zwp_locked_pointer_v1_events[] = {
{ "locked", "", types + 0 },
{ "unlocked", "", types + 0 },
{ "locked", "", wl_pc_types + 0 },
{ "unlocked", "", wl_pc_types + 0 },
};
WL_EXPORT const struct wl_interface zwp_locked_pointer_v1_interface = {
@ -81,13 +81,13 @@ WL_EXPORT const struct wl_interface zwp_locked_pointer_v1_interface = {
};
static const struct wl_message zwp_confined_pointer_v1_requests[] = {
{ "destroy", "", types + 0 },
{ "set_region", "?o", types + 13 },
{ "destroy", "", wl_pc_types + 0 },
{ "set_region", "?o", wl_pc_types + 13 },
};
static const struct wl_message zwp_confined_pointer_v1_events[] = {
{ "confined", "", types + 0 },
{ "unconfined", "", types + 0 },
{ "confined", "", wl_pc_types + 0 },
{ "unconfined", "", wl_pc_types + 0 },
};
WL_EXPORT const struct wl_interface zwp_confined_pointer_v1_interface = {

View file

@ -31,7 +31,7 @@
extern const struct wl_interface wl_pointer_interface;
extern const struct wl_interface zwp_relative_pointer_v1_interface;
static const struct wl_interface *types2[] = {
static const struct wl_interface *wl_rp_types[] = {
NULL,
NULL,
NULL,
@ -43,8 +43,8 @@ static const struct wl_interface *types2[] = {
};
static const struct wl_message zwp_relative_pointer_manager_v1_requests[] = {
{ "destroy", "", types2 + 0 },
{ "get_relative_pointer", "no", types2 + 6 },
{ "destroy", "", wl_rp_types + 0 },
{ "get_relative_pointer", "no", wl_rp_types + 6 },
};
WL_EXPORT const struct wl_interface zwp_relative_pointer_manager_v1_interface = {
@ -54,11 +54,11 @@ WL_EXPORT const struct wl_interface zwp_relative_pointer_manager_v1_interface =
};
static const struct wl_message zwp_relative_pointer_v1_requests[] = {
{ "destroy", "", types2 + 0 },
{ "destroy", "", wl_rp_types + 0 },
};
static const struct wl_message zwp_relative_pointer_v1_events[] = {
{ "relative_motion", "uuffff", types2 + 0 },
{ "relative_motion", "uuffff", wl_rp_types + 0 },
};
WL_EXPORT const struct wl_interface zwp_relative_pointer_v1_interface = {

View file

@ -21,4 +21,6 @@ wayland-scanner code ./unstable/idle-inhibit/idle-inhibit-unstable-v1.xml "$GLGL
wayland-scanner client-header ./unstable/idle-inhibit/idle-inhibit-unstable-v1.xml "$GLGLFW_PATH"/wayland-idle-inhibit-unstable-v1-client-protocol.h
# Patch for cgo
sed -i "s|types|types2|g" "$GLGLFW_PATH"/wayland-relative-pointer-unstable-v1-client-protocol.c
sed -i "s|types|wl_pc_types|g" "$GLGLFW_PATH"/wayland-pointer-constraints-unstable-v1-client-protocol.c
sed -i "s|types|wl_rp_types|g" "$GLGLFW_PATH"/wayland-relative-pointer-unstable-v1-client-protocol.c
sed -i "s|types|wl_ii_types|g" "$GLGLFW_PATH"/wayland-idle-inhibit-unstable-v1-client-protocol.c