Héctor Orón Martínez | f5285f5 | 2016-02-07 21:22:32 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright © 2012 Intel Corporation |
| 3 | * |
| 4 | * Permission to use, copy, modify, distribute, and sell this |
| 5 | * software and its documentation for any purpose is hereby granted |
| 6 | * without fee, provided that the above copyright notice appear in |
| 7 | * all copies and that both that copyright notice and this permission |
| 8 | * notice appear in supporting documentation, and that the name of |
| 9 | * the copyright holders not be used in advertising or publicity |
| 10 | * pertaining to distribution of the software without specific, |
| 11 | * written prior permission. The copyright holders make no |
| 12 | * representations about the suitability of this software for any |
| 13 | * purpose. It is provided "as is" without express or implied |
| 14 | * warranty. |
| 15 | * |
| 16 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS |
| 17 | * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 18 | * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 19 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN |
| 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, |
| 22 | * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF |
| 23 | * THIS SOFTWARE. |
| 24 | */ |
| 25 | |
| 26 | #ifndef WL_TEST_SERVER_PROTOCOL_H |
| 27 | #define WL_TEST_SERVER_PROTOCOL_H |
| 28 | |
| 29 | #ifdef __cplusplus |
| 30 | extern "C" { |
| 31 | #endif |
| 32 | |
| 33 | #include <stdint.h> |
| 34 | #include <stddef.h> |
| 35 | #include "wayland-util.h" |
| 36 | |
| 37 | struct wl_client; |
| 38 | struct wl_resource; |
| 39 | |
| 40 | struct wl_test; |
| 41 | |
| 42 | extern const struct wl_interface wl_test_interface; |
| 43 | |
| 44 | struct wl_test_interface { |
| 45 | /** |
| 46 | * move_surface - (none) |
| 47 | * @surface: (none) |
| 48 | * @x: (none) |
| 49 | * @y: (none) |
| 50 | */ |
| 51 | void (*move_surface)(struct wl_client *client, |
| 52 | struct wl_resource *resource, |
| 53 | struct wl_resource *surface, |
| 54 | int32_t x, |
| 55 | int32_t y); |
| 56 | /** |
| 57 | * move_pointer - (none) |
| 58 | * @x: (none) |
| 59 | * @y: (none) |
| 60 | */ |
| 61 | void (*move_pointer)(struct wl_client *client, |
| 62 | struct wl_resource *resource, |
| 63 | int32_t x, |
| 64 | int32_t y); |
| 65 | /** |
| 66 | * send_button - (none) |
| 67 | * @button: (none) |
| 68 | * @state: (none) |
| 69 | */ |
| 70 | void (*send_button)(struct wl_client *client, |
| 71 | struct wl_resource *resource, |
| 72 | int32_t button, |
| 73 | uint32_t state); |
| 74 | /** |
| 75 | * activate_surface - (none) |
| 76 | * @surface: (none) |
| 77 | */ |
| 78 | void (*activate_surface)(struct wl_client *client, |
| 79 | struct wl_resource *resource, |
| 80 | struct wl_resource *surface); |
| 81 | /** |
| 82 | * send_key - (none) |
| 83 | * @key: (none) |
| 84 | * @state: (none) |
| 85 | */ |
| 86 | void (*send_key)(struct wl_client *client, |
| 87 | struct wl_resource *resource, |
| 88 | uint32_t key, |
| 89 | uint32_t state); |
| 90 | /** |
| 91 | * get_n_egl_buffers - (none) |
| 92 | */ |
| 93 | void (*get_n_egl_buffers)(struct wl_client *client, |
| 94 | struct wl_resource *resource); |
| 95 | }; |
| 96 | |
| 97 | #define WL_TEST_POINTER_POSITION 0 |
| 98 | #define WL_TEST_N_EGL_BUFFERS 1 |
| 99 | |
| 100 | #define WL_TEST_POINTER_POSITION_SINCE_VERSION 1 |
| 101 | #define WL_TEST_N_EGL_BUFFERS_SINCE_VERSION 1 |
| 102 | |
| 103 | static inline void |
| 104 | wl_test_send_pointer_position(struct wl_resource *resource_, wl_fixed_t x, wl_fixed_t y) |
| 105 | { |
| 106 | wl_resource_post_event(resource_, WL_TEST_POINTER_POSITION, x, y); |
| 107 | } |
| 108 | |
| 109 | static inline void |
| 110 | wl_test_send_n_egl_buffers(struct wl_resource *resource_, uint32_t n) |
| 111 | { |
| 112 | wl_resource_post_event(resource_, WL_TEST_N_EGL_BUFFERS, n); |
| 113 | } |
| 114 | |
| 115 | #ifdef __cplusplus |
| 116 | } |
| 117 | #endif |
| 118 | |
| 119 | #endif |