Merge pull request #27 from r0l1/master

Fixed Wayland Support
This commit is contained in:
Milan Nikolic 2017-11-28 14:06:32 +01:00 committed by GitHub
commit 02f3d57418
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 23 deletions

View file

@ -16,6 +16,7 @@ package raylib
#include "external/glfw/src/wl_window.c" #include "external/glfw/src/wl_window.c"
#include "external/glfw/src/wayland-pointer-constraints-unstable-v1-client-protocol.c" #include "external/glfw/src/wayland-pointer-constraints-unstable-v1-client-protocol.c"
#include "external/glfw/src/wayland-relative-pointer-unstable-v1-client-protocol.c" #include "external/glfw/src/wayland-relative-pointer-unstable-v1-client-protocol.c"
#include "external/glfw/src/wayland-idle-inhibit-unstable-v1-client-protocol.c"
#endif #endif
#ifdef _GLFW_X11 #ifdef _GLFW_X11
#include "external/glfw/src/x11_init.c" #include "external/glfw/src/x11_init.c"

View file

@ -30,14 +30,14 @@
extern const struct wl_interface wl_surface_interface; extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface zwp_idle_inhibitor_v1_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, &zwp_idle_inhibitor_v1_interface,
&wl_surface_interface, &wl_surface_interface,
}; };
static const struct wl_message zwp_idle_inhibit_manager_v1_requests[] = { static const struct wl_message zwp_idle_inhibit_manager_v1_requests[] = {
{ "destroy", "", types + 0 }, { "destroy", "", wl_ii_types + 0 },
{ "create_inhibitor", "no", types + 0 }, { "create_inhibitor", "no", wl_ii_types + 0 },
}; };
WL_EXPORT const struct wl_interface zwp_idle_inhibit_manager_v1_interface = { 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[] = { 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 = { 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_confined_pointer_v1_interface;
extern const struct wl_interface zwp_locked_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,
NULL, NULL,
&zwp_locked_pointer_v1_interface, &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[] = { static const struct wl_message zwp_pointer_constraints_v1_requests[] = {
{ "destroy", "", types + 0 }, { "destroy", "", wl_pc_types + 0 },
{ "lock_pointer", "noo?ou", types + 2 }, { "lock_pointer", "noo?ou", wl_pc_types + 2 },
{ "confine_pointer", "noo?ou", types + 7 }, { "confine_pointer", "noo?ou", wl_pc_types + 7 },
}; };
WL_EXPORT const struct wl_interface zwp_pointer_constraints_v1_interface = { 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[] = { static const struct wl_message zwp_locked_pointer_v1_requests[] = {
{ "destroy", "", types + 0 }, { "destroy", "", wl_pc_types + 0 },
{ "set_cursor_position_hint", "ff", types + 0 }, { "set_cursor_position_hint", "ff", wl_pc_types + 0 },
{ "set_region", "?o", types + 12 }, { "set_region", "?o", wl_pc_types + 12 },
}; };
static const struct wl_message zwp_locked_pointer_v1_events[] = { static const struct wl_message zwp_locked_pointer_v1_events[] = {
{ "locked", "", types + 0 }, { "locked", "", wl_pc_types + 0 },
{ "unlocked", "", types + 0 }, { "unlocked", "", wl_pc_types + 0 },
}; };
WL_EXPORT const struct wl_interface zwp_locked_pointer_v1_interface = { 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[] = { static const struct wl_message zwp_confined_pointer_v1_requests[] = {
{ "destroy", "", types + 0 }, { "destroy", "", wl_pc_types + 0 },
{ "set_region", "?o", types + 13 }, { "set_region", "?o", wl_pc_types + 13 },
}; };
static const struct wl_message zwp_confined_pointer_v1_events[] = { static const struct wl_message zwp_confined_pointer_v1_events[] = {
{ "confined", "", types + 0 }, { "confined", "", wl_pc_types + 0 },
{ "unconfined", "", types + 0 }, { "unconfined", "", wl_pc_types + 0 },
}; };
WL_EXPORT const struct wl_interface zwp_confined_pointer_v1_interface = { 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 wl_pointer_interface;
extern const struct wl_interface zwp_relative_pointer_v1_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, NULL,
NULL, NULL,
@ -43,8 +43,8 @@ static const struct wl_interface *types2[] = {
}; };
static const struct wl_message zwp_relative_pointer_manager_v1_requests[] = { static const struct wl_message zwp_relative_pointer_manager_v1_requests[] = {
{ "destroy", "", types2 + 0 }, { "destroy", "", wl_rp_types + 0 },
{ "get_relative_pointer", "no", types2 + 6 }, { "get_relative_pointer", "no", wl_rp_types + 6 },
}; };
WL_EXPORT const struct wl_interface zwp_relative_pointer_manager_v1_interface = { 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[] = { 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[] = { 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 = { 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 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 # 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