| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The Chromium Authors. | 2 * Copyright 2016 The Chromium Authors. |
| 3 * | 3 * |
| 4 * Permission is hereby granted, free of charge, to any person obtaining a | 4 * Permission is hereby granted, free of charge, to any person obtaining a |
| 5 * copy of this software and associated documentation files (the "Software"), | 5 * copy of this software and associated documentation files (the "Software"), |
| 6 * to deal in the Software without restriction, including without limitation | 6 * to deal in the Software without restriction, including without limitation |
| 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, | 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 * and/or sell copies of the Software, and to permit persons to whom the | 8 * and/or sell copies of the Software, and to permit persons to whom the |
| 9 * Software is furnished to do so, subject to the following conditions: | 9 * Software is furnished to do so, subject to the following conditions: |
| 10 * | 10 * |
| 11 * The above copyright notice and this permission notice (including the next | 11 * The above copyright notice and this permission notice (including the next |
| 12 * paragraph) shall be included in all copies or substantial portions of the | 12 * paragraph) shall be included in all copies or substantial portions of the |
| 13 * Software. | 13 * Software. |
| 14 * | 14 * |
| 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 21 * DEALINGS IN THE SOFTWARE. | 21 * DEALINGS IN THE SOFTWARE. |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #include <stdlib.h> | 24 #include <stdlib.h> |
| 25 #include <stdint.h> | 25 #include <stdint.h> |
| 26 #include "wayland-util.h" | 26 #include "wayland-util.h" |
| 27 | 27 |
| 28 extern const struct wl_interface zwp_gamepad_v1_interface; | 28 extern const struct wl_interface zwp_pointer_stylus_v1_interface; |
| 29 extern const struct wl_interface wl_seat_interface; | 29 extern const struct wl_interface wl_pointer_interface; |
| 30 | 30 |
| 31 static const struct wl_interface *types[] = { | 31 static const struct wl_interface *types[] = { |
| 32 NULL, | 32 NULL, |
| 33 NULL, | 33 NULL, |
| 34 NULL, | 34 NULL, |
| 35 » NULL, | 35 » &zwp_pointer_stylus_v1_interface, |
| 36 » &zwp_gamepad_v1_interface, | 36 » &wl_pointer_interface, |
| 37 » &wl_seat_interface, | |
| 38 }; | 37 }; |
| 39 | 38 |
| 40 static const struct wl_message zwp_gaming_input_v1_requests[] = { | 39 static const struct wl_message zwp_stylus_v1_requests[] = { |
| 41 » { "get_gamepad", "no", types + 4 }, | 40 » { "get_pointer_stylus", "no", types + 3 }, |
| 42 }; | 41 }; |
| 43 | 42 |
| 44 WL_EXPORT const struct wl_interface zwp_gaming_input_v1_interface = { | 43 WL_EXPORT const struct wl_interface zwp_stylus_v1_interface = { |
| 45 » "zwp_gaming_input_v1", 1, | 44 » "zwp_stylus_v1", 1, |
| 46 » 1, zwp_gaming_input_v1_requests, | 45 » 1, zwp_stylus_v1_requests, |
| 47 0, NULL, | 46 0, NULL, |
| 48 }; | 47 }; |
| 49 | 48 |
| 50 static const struct wl_message zwp_gamepad_v1_requests[] = { | 49 static const struct wl_message zwp_pointer_stylus_v1_requests[] = { |
| 51 { "destroy", "", types + 0 }, | 50 { "destroy", "", types + 0 }, |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 static const struct wl_message zwp_gamepad_v1_events[] = { | 53 static const struct wl_message zwp_pointer_stylus_v1_events[] = { |
| 55 » { "state_change", "u", types + 0 }, | 54 » { "tool_change", "u", types + 0 }, |
| 56 » { "axis", "uuf", types + 0 }, | 55 » { "force", "uf", types + 0 }, |
| 57 » { "button", "uuuf", types + 0 }, | 56 » { "tilt", "uff", types + 0 }, |
| 58 » { "frame", "u", types + 0 }, | |
| 59 }; | 57 }; |
| 60 | 58 |
| 61 WL_EXPORT const struct wl_interface zwp_gamepad_v1_interface = { | 59 WL_EXPORT const struct wl_interface zwp_pointer_stylus_v1_interface = { |
| 62 » "zwp_gamepad_v1", 1, | 60 » "zwp_pointer_stylus_v1", 1, |
| 63 » 1, zwp_gamepad_v1_requests, | 61 » 1, zwp_pointer_stylus_v1_requests, |
| 64 » 4, zwp_gamepad_v1_events, | 62 » 3, zwp_pointer_stylus_v1_events, |
| 65 }; | 63 }; |
| 66 | 64 |
| OLD | NEW |