}
static void
-_e_comp_wl_focus_check(E_Comp *comp)
+_e_comp_wl_focus_check(void)
{
E_Client *ec;
if (stopping) return;
ec = e_client_focused_get();
if ((!ec) || (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL))
- e_grabinput_focus(comp->ee_win, E_FOCUS_METHOD_PASSIVE);
+ e_grabinput_focus(e_comp->ee_win, E_FOCUS_METHOD_PASSIVE);
}
static void
e_object_del(E_OBJECT(ec));
- _e_comp_wl_focus_check(e_comp);
+ _e_comp_wl_focus_check();
/* TODO: Delete request send ??
* NB: No such animal wrt wayland */
if (ec->visible) evas_object_hide(ec->frame);
if (!ec->internal) e_object_del(E_OBJECT(ec));
- _e_comp_wl_focus_check(e_comp);
+ _e_comp_wl_focus_check();
}
static void
static void
_e_comp_wl_compositor_cb_surface_create(struct wl_client *client, struct wl_resource *resource, uint32_t id)
{
- E_Comp *comp;
struct wl_resource *res;
E_Pixmap *ep;
uint64_t win;
pid_t pid;
- if (!(comp = wl_resource_get_user_data(resource))) return;
-
DBG("Compositor Cb Surface Create: %d", id);
/* try to create an internal surface */
wl_resource_set_user_data(res, ep);
/* emit surface create signal */
- wl_signal_emit(&comp->wl_comp_data->signals.surface.create, res);
+ wl_signal_emit(&e_comp->wl_comp_data->signals.surface.create, res);
}
static void
static void
_e_comp_wl_compositor_cb_region_create(struct wl_client *client, struct wl_resource *resource, uint32_t id)
{
- E_Comp *comp;
Eina_Tiler *tiler;
struct wl_resource *res;
- /* get the compositor from the resource */
- if (!(comp = wl_resource_get_user_data(resource))) return;
-
DBG("Region Create: %d", wl_resource_get_id(resource));
/* try to create new tiler */
- if (!(tiler = eina_tiler_new(comp->man->w, comp->man->h)))
+ if (!(tiler = eina_tiler_new(e_comp->man->w, e_comp->man->h)))
{
ERR("Could not create Eina_Tiler");
wl_resource_post_no_memory(resource);
};
static void
-_e_comp_wl_compositor_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
+_e_comp_wl_compositor_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t version, uint32_t id)
{
- E_Comp *comp;
struct wl_resource *res;
- if (!(comp = data)) return;
-
if (!(res =
wl_resource_create(client, &wl_compositor_interface,
MIN(version, COMPOSITOR_VERSION), id)))
return;
}
- wl_resource_set_implementation(res, &_e_comp_interface, comp, NULL);
+ wl_resource_set_implementation(res, &_e_comp_interface, e_comp, NULL);
}
static void
};
static void
-_e_comp_wl_subcompositor_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
+_e_comp_wl_subcompositor_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t version, uint32_t id)
{
- E_Comp *comp;
struct wl_resource *res;
- if (!(comp = data)) return;
-
if (!(res =
wl_resource_create(client, &wl_subcompositor_interface,
MIN(version, 1), id)))
return;
}
- wl_resource_set_implementation(res, &_e_subcomp_interface, comp, NULL);
+ wl_resource_set_implementation(res, &_e_subcomp_interface, e_comp, NULL);
/* TODO: add handlers for client iconify/uniconify */
}
E_FREE(ec->comp_data);
- _e_comp_wl_focus_check(e_comp);
+ _e_comp_wl_focus_check();
}
static void
0, 0, 0);
}
- _e_comp_wl_focus_check(e_comp);
+ _e_comp_wl_focus_check();
if (e_comp->wl_comp_data->kbd.focus == ec->comp_data->surface)
e_comp->wl_comp_data->kbd.focus = NULL;
static Eina_Bool
_e_comp_wl_compositor_create(void)
{
- E_Comp *comp;
E_Comp_Data *cdata;
const char *name;
int fd = 0;
/* check for existing compositor. create if needed */
- if (!(comp = e_comp))
+ if (!e_comp)
{
- comp = e_comp_new();
- comp->comp_type = E_PIXMAP_TYPE_WL;
- E_OBJECT_DEL_SET(comp, _e_comp_wl_compositor_cb_del);
+ e_comp_new();
+ e_comp->comp_type = E_PIXMAP_TYPE_WL;
+ E_OBJECT_DEL_SET(e_comp, _e_comp_wl_compositor_cb_del);
}
/* create new compositor data */
}
/* set compositor wayland data */
- comp->wl_comp_data = cdata;
+ e_comp->wl_comp_data = cdata;
/* set wayland log handler */
wl_log_set_handler_server(_e_comp_wl_log_cb_print);
/* try to add compositor to wayland globals */
if (!wl_global_create(cdata->wl.disp, &wl_compositor_interface,
- COMPOSITOR_VERSION, comp,
+ COMPOSITOR_VERSION, e_comp,
_e_comp_wl_compositor_cb_bind))
{
ERR("Could not add compositor to wayland globals: %m");
/* try to add subcompositor to wayland globals */
if (!wl_global_create(cdata->wl.disp, &wl_subcompositor_interface, 1,
- comp, _e_comp_wl_subcompositor_cb_bind))
+ e_comp, _e_comp_wl_subcompositor_cb_bind))
{
ERR("Could not add subcompositor to wayland globals: %m");
goto comp_global_err;
/* setup module idler to load shell mmodule */
ecore_idler_add(_e_comp_wl_cb_module_idle, cdata);
- if (comp->comp_type == E_PIXMAP_TYPE_X)
+ if (e_comp->comp_type == E_PIXMAP_TYPE_X)
{
e_comp_wl_input_pointer_enabled_set(cdata, EINA_TRUE);
e_comp_wl_input_keyboard_enabled_set(cdata, EINA_TRUE);
* @returns the corresponding Wayland signal
*/
EAPI struct wl_signal
-e_comp_wl_surface_create_signal_get(E_Comp *comp)
+e_comp_wl_surface_create_signal_get(void)
{
- return comp->wl_comp_data->signals.surface.create;
+ return e_comp->wl_comp_data->signals.surface.create;
}
/* internal functions */