_e_input_panel_cb_surface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource)
{
E_Input_Panel *input_panel = wl_resource_get_user_data(resource);
- E_Pixmap *ep = wl_resource_get_user_data(surface_resource);
+ E_Client *ec = wl_resource_get_user_data(surface_resource);
E_Input_Panel_Surface *ips = NULL;
E_Comp_Client_Data *cdata = NULL;
- E_Client *ec = NULL;
if (!input_panel)
{
return;
}
- if (!ep)
+ if (!ec)
{
wl_resource_post_error(surface_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Pixmap Set On Surface");
+ "No E_Client Set On Surface");
return;
}
- if (e_pixmap_type_get(ep) != E_PIXMAP_TYPE_WL)
+ if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL)
return;
- if (!(ips = E_NEW(E_Input_Panel_Surface, 1)))
- {
- wl_client_post_no_memory(client);
- return;
- }
-
- if (!(ec = e_pixmap_client_get(ep)))
- ec = e_pixmap_find_client(E_PIXMAP_TYPE_WL, e_pixmap_window_get(ep));
-
- if (!ec)
- {
- if (!(ec = e_client_new(NULL, ep, 0, 0)))
- {
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Client For Pixmap");
- return;
- }
- }
-
if (!(cdata = ec->comp_data))
{
wl_resource_post_error(surface_resource,
return;
}
+ if (ec->ignored)
+ e_client_unignore(ec);
+
/* set input panel client properties */
ec->borderless = EINA_TRUE;
ec->argb = EINA_TRUE;
cdata->shell.map = _e_input_panel_surface_map;
cdata->shell.unmap = _e_input_panel_surface_unmap;
+ if (!(ips = E_NEW(E_Input_Panel_Surface, 1)))
+ {
+ wl_client_post_no_memory(client);
+ return;
+ }
+
ips->ec = ec;
ips->input_panel = input_panel;
}
Eina_Bool
-e_input_panel_init(E_Comp_Data *cdata)
+e_input_panel_init(void)
{
- if (!cdata) return EINA_FALSE;
+ if (!e_comp_wl) return EINA_FALSE;
if (!(g_input_panel = E_NEW(E_Input_Panel, 1)))
{
return EINA_FALSE;
}
- g_input_panel->global = wl_global_create(cdata->wl.disp,
+ g_input_panel->global = wl_global_create(e_comp_wl->wl.disp,
&wl_input_panel_interface, 1,
g_input_panel, _e_input_panel_bind);
}
void
-e_input_panel_shutdown(E_Comp_Data *cdata EINA_UNUSED)
+e_input_panel_shutdown(void)
{
if (g_input_panel)
{
{
struct wl_resource *resource;
- E_Comp_Data *cdata;
Eina_List *input_methods;
Eina_Bool input_panel_visibile;
};
struct wl_global *global;
struct wl_resource *resource;
- E_Comp_Data *cdata;
Eina_List *text_input_list;
};
struct wl_global *global;
struct wl_resource *resource;
- E_Comp_Data *cdata;
E_Text_Input *model;
E_Input_Method_Context *context;
};
_e_text_input_method_context_keyboard_grab_keyboard_modifiers_update(E_Input_Method_Context *context, struct wl_resource *keyboard)
{
uint32_t serial;
- E_Comp_Data *cdata = NULL;
- if (!context->model || !(cdata = context->model->cdata)) return;
+ if (!context->model) return;
if (!context->kbd.state) return;
context->kbd.mod_depressed =
context->kbd.mod_group =
xkb_state_serialize_layout(context->kbd.state, XKB_STATE_LAYOUT_EFFECTIVE);
- serial = wl_display_next_serial(cdata->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
wl_keyboard_send_modifiers(keyboard, serial,
context->kbd.mod_depressed,
context->kbd.mod_latched,
static void
_e_text_input_method_context_key_send(E_Input_Method_Context *context, unsigned int keycode, unsigned int timestamp, enum wl_keyboard_key_state state)
{
- E_Comp_Data *cdata = NULL;
uint32_t serial, nk;
- if (!context->model || !(cdata = context->model->cdata)) return;
+ if (!context->model) return;
nk = keycode - 8;
/* update modifier state */
_e_text_input_method_context_keyboard_grab_keyboard_state_update(context, nk, state == WL_KEYBOARD_KEY_STATE_PRESSED);
- serial = wl_display_next_serial(cdata->wl.disp);
+ serial = wl_display_next_serial(e_comp_wl->wl.disp);
wl_keyboard_send_key(context->kbd.resource, serial, timestamp, nk, state);
if (context->kbd.mod_changed)
static void
_e_text_input_method_context_grab_set(E_Input_Method_Context *context, Eina_Bool set)
{
- E_Comp_Data *cdata = NULL;
if (set == context->kbd.grabbed)
return;
- if (!context->model || !(cdata = context->model->cdata))
+ if (!context->model)
return;
context->kbd.grabbed = set;
{
if (context->kbd.keymap) xkb_map_unref(context->kbd.keymap);
if (context->kbd.state) xkb_state_unref(context->kbd.state);
- context->kbd.keymap = xkb_map_ref(cdata->xkb.keymap);
- context->kbd.state = xkb_state_new(cdata->xkb.keymap);
+ context->kbd.keymap = xkb_map_ref(e_comp_wl->xkb.keymap);
+ context->kbd.state = xkb_state_new(e_comp_wl->xkb.keymap);
E_LIST_HANDLER_APPEND(context->kbd.handlers, ECORE_EVENT_KEY_DOWN,
_e_text_input_method_context_ecore_cb_key_down,
context);
_e_text_input_method_context_ecore_cb_key_up,
context);
- e_comp_grab_input(e_comp, 0, 1);
+ e_comp_grab_input(0, 1);
}
else
{
E_FREE_LIST(context->kbd.handlers, ecore_event_handler_del);
- e_comp_ungrab_input(e_comp, 0, 1);
+ e_comp_ungrab_input(0, 1);
if (context->kbd.keymap) xkb_map_unref(context->kbd.keymap);
if (context->kbd.state) xkb_state_unref(context->kbd.state);
DBG("Input Method Context - grab keyboard %d", wl_resource_get_id(resource));
E_Input_Method_Context *context = wl_resource_get_user_data(resource);
struct wl_resource *keyboard = NULL;
- E_Comp_Data *cdata = NULL;
+
if (!context)
{
wl_resource_post_error(resource,
wl_resource_set_implementation(keyboard, &_e_keyboard_grab_interface, context, _e_text_input_method_context_keyboard_grab_cb_keyboard_unbind);
- if (context->model && context->model->cdata)
- {
- cdata = context->model->cdata;
- /* send current keymap */
- wl_keyboard_send_keymap(keyboard, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
- cdata->xkb.fd, cdata->xkb.size);
- }
+ /* send current keymap */
+ wl_keyboard_send_keymap(keyboard, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
+ e_comp_wl->xkb.fd, e_comp_wl->xkb.size);
context->kbd.resource = keyboard;
{
g_text_input = NULL;
E_Text_Input *text_input = wl_resource_get_user_data(resource);
- E_Comp_Data *cdata = wl_resource_get_user_data(seat);
E_Input_Method *input_method = NULL;
if (!text_input)
return;
}
- if (!cdata)
- {
- wl_resource_post_error(seat,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "No Comp Data For Seat");
- return;
- }
-
// FIXME: should get input_method object from seat.
if (g_input_method && g_input_method->resource)
input_method = wl_resource_get_user_data(g_input_method->resource);
wl_resource_set_implementation(text_input->resource,
&_e_text_input_implementation,
text_input, _e_text_input_cb_destroy);
-
- text_input->cdata = text_input_mgr->cdata;
}
static const struct wl_text_input_manager_interface _e_text_input_manager_implementation = {
}
static Eina_Bool
-_e_text_input_method_create(E_Comp_Data *cdata)
+_e_text_input_method_create(void)
{
- if (!cdata) return EINA_FALSE;
-
if (!(g_input_method = E_NEW(E_Input_Method, 1)))
{
ERR("Could not allocate space for Input_Method");
return EINA_FALSE;
}
- g_input_method->cdata = cdata;
g_input_method->global =
- wl_global_create(cdata->wl.disp, &wl_input_method_interface, 1,
+ wl_global_create(e_comp_wl->wl.disp, &wl_input_method_interface, 1,
g_input_method, _e_text_cb_bind_input_method);
if (!g_input_method->global)
}
static Eina_Bool
-_e_text_input_manager_create(E_Comp_Data *cdata)
+_e_text_input_manager_create(void)
{
E_Text_Input_Mgr *text_input_mgr;
- if (!cdata) return EINA_FALSE;
-
if (!(text_input_mgr = E_NEW(E_Text_Input_Mgr, 1)))
{
ERR("Could not allocate space for Text_Input_Manager");
return EINA_FALSE;
}
- text_input_mgr->cdata = cdata;
text_input_mgr->global =
- wl_global_create(cdata->wl.disp,
+ wl_global_create(e_comp_wl->wl.disp,
&wl_text_input_manager_interface, 1,
text_input_mgr, _e_text_cb_bind_text_input_manager);
}
}
-EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Wl_Text_Input" };
+E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Wl_Text_Input" };
static void
_e_mod_eeze_udev_watch_cb(const char *text, Eeze_Udev_Event event, void *data, Eeze_Udev_Watch *watch)
return ECORE_CALLBACK_PASS_ON;
}
-EAPI void *
+E_API void *
e_modapi_init(E_Module *m)
{
- E_Comp_Data *cdata = NULL;
-
- if (!e_comp) return NULL;
-
- if (!(cdata = e_comp->wl_comp_data)) return NULL;
+ if (!e_comp_wl) return NULL;
// FIXME: create only one input method object per seat.
- if (!_e_text_input_method_create(cdata))
+ if (!_e_text_input_method_create())
return NULL;
- if (!e_input_panel_init(cdata))
+ if (!e_input_panel_init())
goto err;
- if (!_e_text_input_manager_create(cdata))
+ if (!_e_text_input_manager_create())
goto err;
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_RESIZE, _e_text_input_method_context_cb_client_resize, NULL);
return NULL;
}
-EAPI int
+E_API int
e_modapi_shutdown(E_Module *m EINA_UNUSED)
{
E_FREE_LIST(handlers, ecore_event_handler_del);
}
_e_mod_text_input_shutdown();
- e_input_panel_shutdown(NULL);
+ e_input_panel_shutdown();
return 1;
}