5 #include <tizen-extension-server-protocol.h>
7 #include <cynara-session.h>
8 #include <cynara-client.h>
9 #include <cynara-creds-socket.h>
12 #ifdef TRACE_INPUT_BEGIN
13 #undef TRACE_INPUT_BEGIN
15 #ifdef TRACE_INPUT_END
16 #undef TRACE_INPUT_END
22 #define TRACE_INPUT_BEGIN(NAME) traceBegin(TTRACE_TAG_INPUT, "INPUT:KRT:"#NAME)
23 #define TRACE_INPUT_END() traceEnd(TTRACE_TAG_INPUT)
25 #define TRACE_INPUT_BEGIN(NAME)
26 #define TRACE_INPUT_END()
29 /* Temporary value of maximum number of HWKeys */
31 #define CHECK_ERR(val) if (TIZEN_KEYROUTER_ERROR_NONE != val) return;
32 #define CHECK_ERR_VAL(val) if (TIZEN_KEYROUTER_ERROR_NONE != val) return val;
33 #define CHECK_NULL(val) if (!val) return;
34 #define CHECK_NULL_VAL(val) if (!val) return val;
36 #define KLERR(msg, ARG...) ERR("[tizen_keyrouter][%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
37 #define KLWRN(msg, ARG...) WRN("[tizen_keyrouter][%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
38 #define KLINF(msg, ARG...) INF("[tizen_keyrouter][%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
39 #define KLDBG(msg, ARG...) DBG("[tizen_keyrouter][%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
41 typedef struct _E_Keyrouter E_Keyrouter;
42 typedef struct _E_Keyrouter* E_KeyrouterPtr;
43 typedef struct _E_Keyrouter_Key_List_Node E_Keyrouter_Key_List_Node;
44 typedef struct _E_Keyrouter_Key_List_Node* E_Keyrouter_Key_List_NodePtr;
45 typedef struct _E_Keyrouter_Tizen_HWKey E_Keyrouter_Tizen_HWKey;
46 typedef struct _E_Keyrouter_Grabbed_Key E_Keyrouter_Grabbed_Key;
47 typedef struct _E_Keyrouter_Grab_Request E_Keyrouter_Grab_Request;
48 typedef struct _E_Keyrouter_Grab_Result E_Keyrouter_Grab_Result;
49 typedef struct _E_Keyrouter_Registered_Window_Info E_Keyrouter_Registered_Window_Info;
51 typedef struct _E_Keyrouter_Conf_Edd E_Keyrouter_Conf_Edd;
52 typedef struct _E_Keyrouter_Config_Data E_Keyrouter_Config_Data;
54 #define TIZEN_KEYROUTER_MODE_PRESSED TIZEN_KEYROUTER_MODE_REGISTERED+1
56 extern E_KeyrouterPtr krt;
58 struct _E_Keyrouter_Conf_Edd
65 struct _E_Keyrouter_Config_Data
68 E_Config_DD *conf_edd;
69 E_Config_DD *conf_hwkeys_edd;
70 E_Keyrouter_Conf_Edd *conf;
73 struct _E_Keyrouter_Registered_Window_Info
75 struct wl_resource *surface;
79 struct _E_Keyrouter_Key_List_Node
81 struct wl_resource *surface;
85 struct _E_Keyrouter_Tizen_HWKey
92 struct _E_Keyrouter_Grabbed_Key
96 Eina_Bool no_privcheck;
99 Eina_List *or_excl_ptr;
101 Eina_List *shared_ptr;
102 Eina_List *press_ptr;
103 E_Keyrouter_Key_List_Node *registered_ptr;
108 struct wl_global *global;
109 Ecore_Event_Filter *ef_handler;
112 E_Keyrouter_Config_Data *conf;
114 E_Keyrouter_Grabbed_Key *HardKeys;
115 Eina_List *grab_surface_list;
116 Eina_List *grab_client_list;
118 Eina_List *registered_window_list;
120 Eina_Bool isWindowStackChanged;
122 int max_tizen_hwkeys;
128 struct _E_Keyrouter_Grab_Request {
133 struct _E_Keyrouter_Grab_Result {
134 E_Keyrouter_Grab_Request request_data;
140 E_API extern E_Module_Api e_modapi;
141 E_API void *e_modapi_init(E_Module *m);
142 E_API int e_modapi_shutdown(E_Module *m);
143 E_API int e_modapi_save(E_Module *m);
145 int e_keyrouter_set_keygrab_in_list(struct wl_resource *surface, struct wl_client *client, uint32_t key, uint32_t mode);
146 int e_keyrouter_prepend_to_keylist(struct wl_resource *surface, struct wl_client *wc, uint32_t key, uint32_t mode);
147 void e_keyrouter_find_and_remove_client_from_list(struct wl_resource *surface, struct wl_client *wc, uint32_t key, uint32_t mode);
148 void e_keyrouter_remove_client_from_list(struct wl_resource *surface, struct wl_client *wc);
149 int e_keyrouter_find_key_in_list(struct wl_resource *surface, struct wl_client *wc, uint32_t key);
151 int e_keyrouter_add_client_destroy_listener(struct wl_client *client);
152 int e_keyrouter_add_surface_destroy_listener(struct wl_resource *surface);
154 Eina_Bool e_keyrouter_process_key_event(void *event, int type);
156 int e_keyrouter_set_keyregister(struct wl_client *client, struct wl_resource *surface, uint32_t key);
157 int e_keyrouter_unset_keyregister(struct wl_resource *surface, struct wl_client *client, uint32_t key);
158 Eina_Bool e_keyrouter_is_registered_window(struct wl_resource *surface);
159 void e_keyrouter_clear_registered_window(void);
161 struct wl_resource *e_keyrouter_util_get_surface_from_eclient(E_Client *client);
162 int e_keyrouter_util_get_pid(struct wl_client *client, struct wl_resource *surface);
164 void e_keyrouter_conf_init(E_Keyrouter_Config_Data *kconfig);
165 void e_keyrouter_conf_deinit(E_Keyrouter_Config_Data *kconfig);