1 #ifndef DS_TIZEN_KEYROUTER_H
2 #define DS_TIZEN_KEYROUTER_H
5 #include <wayland-server.h>
6 #include <tizen-extension-server-protocol.h>
8 #include "libds-tizen/keyrouter.h"
10 #define KEYROUTER_MAX_KEYS 512
13 * Keyroute mode of keyroutes returned by keyrouter_grab_get_keyroutes()
14 * for a given keycode.
18 * The keycode is not under any keyroute mode.
19 * The compositor may send a keycode to a focused wayland cliet as usual.
23 * Exclusive mode means that a given keycode is required to be sent
24 * exclusively to wayland clients of returned keyroutes. So the compositor
25 * must not send this keycode to any other wayland clients except for
26 * returned wayland clients.
28 KEYROUTE_MODE_EXCLUSIVE,
30 * The keycode is required to be shared with returned wayland clients.
31 * The compositor must send the keycode not only to returned wayland
32 * clients, but also to a focused wayland client.
39 struct wl_client *wl_client;
43 struct keyrouter_grabbed
46 struct wl_list excl; // keyroute_info::link
47 struct wl_list or_excl; // keyroute_info::link
48 struct wl_list top; // keyroute_info::link
49 struct wl_list shared; // keyroute_info::link
52 struct wl_list pressed;
57 struct keyrouter_grabbed hard_keys[KEYROUTER_MAX_KEYS];
60 struct keyrouter_key_options
66 struct ds_tizen_keyrouter
68 struct wl_global *global;
70 struct wl_list clients;
72 struct wl_listener display_destroy;
75 struct wl_signal destroy;
78 struct keyrouter_key_options *opts;
80 struct keyrouter_grab keygrab;
82 bool security_initialized;
85 struct keyrouter_client
87 struct ds_tizen_keyrouter *keyrouter;
89 struct wl_resource *resource;
90 struct wl_client *wl_client;
94 struct wl_list link; // ds_tizen_keyrouter::clients
97 struct ds_tizen_grab_data
104 struct ds_tizen_ungrab_data
110 void keyrouter_grab_init(struct keyrouter_grab *keygrab);
112 void keyrouter_grab_finish(struct keyrouter_grab *keygrab);
114 int keyrouter_grab_grab_key(struct keyrouter_grab *keygrab, int mode,
115 int keycode, struct wl_client *wl_client);
117 void keyrouter_grab_ungrab_key(struct keyrouter_grab *keygrab, int mode,
118 int keycode, struct wl_client *wl_client);
121 keyrouter_grab_get_keyroutes(struct keyrouter_grab *keygrab, int keycode,
122 struct wl_client *topmost_client, struct wl_array *keyroutes);