RetroArch
wayland_common.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2011-2017 - Daniel De Matteis
3  *
4  * RetroArch is free software: you can redistribute it and/or modify it under the terms
5  * of the GNU General Public License as published by the Free Software Found-
6  * ation, either version 3 of the License, or (at your option) any later version.
7  *
8  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10  * PURPOSE. See the GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License along with RetroArch.
13  * If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #ifndef WAYLAND_COMMON_H__
17 #define WAYLAND_COMMON_H__
18 
19 #include <stdint.h>
20 #include <boolean.h>
21 
22 #include <linux/input.h>
23 #include <wayland-client.h>
24 #include <wayland-cursor.h>
25 
26 #include "../../input/input_driver.h"
27 
28 #define UDEV_KEY_MAX 0x2ff
29 #define UDEV_MAX_KEYS (UDEV_KEY_MAX + 7) / 8
30 
31 #define MAX_TOUCHES 16
32 
33 typedef struct
34 {
35  bool active;
39 
40 
41 typedef struct input_ctx_wayland_data
42 {
43  /* Wayland uses Linux keysyms. */
46 
47  struct
48  {
49  int last_x, last_y;
50  int x, y;
52  bool last_valid;
53  bool focus;
54  bool left, right, middle;
55  } mouse;
56 
57  struct wl_display *dpy;
58  int fd;
59 
61  bool blocked;
62 
64 
66 
67 #endif
68 
int fd
Definition: wayland_common.h:58
int16_t x
Definition: wayland_common.h:36
int16_t y
Definition: wayland_common.h:37
Definition: wayland_common.h:33
struct wl_display * dpy
Definition: wayland_common.h:57
bool right
Definition: wayland_common.h:54
int last_x
Definition: wayland_common.h:49
struct input_ctx_wayland_data input_ctx_wayland_data_t
int delta_y
Definition: wayland_common.h:51
int x
Definition: wayland_common.h:50
uint8_t key_state[UDEV_MAX_KEYS]
Definition: wayland_common.h:44
bool active
Definition: wayland_common.h:35
bool last_valid
Definition: wayland_common.h:52
bool blocked
Definition: wayland_common.h:61
bool focus
Definition: wayland_common.h:53
signed short int16_t
Definition: stdint.h:122
bool left
Definition: wayland_common.h:54
bool keyboard_focus
Definition: wayland_common.h:45
int y
Definition: wayland_common.h:50
Definition: input_driver.h:170
#define MAX_TOUCHES
Definition: wayland_common.h:31
int last_y
Definition: wayland_common.h:49
bool middle
Definition: wayland_common.h:54
#define UDEV_MAX_KEYS
Definition: wayland_common.h:29
struct input_ctx_wayland_data::@220 mouse
Definition: wayland_common.h:41
wayland_touch_data_t touches[MAX_TOUCHES]
Definition: wayland_common.h:63
unsigned char uint8_t
Definition: stdint.h:124
const input_device_driver_t * joypad
Definition: wayland_common.h:60
int delta_x
Definition: wayland_common.h:51