if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return
/* Resource Data Mapping: (wl_resource_get_user_data)
- *
+ *
* wl_surface == e_pixmap
* wl_region == eina_tiler
* wl_subsurface == e_client
- *
+ *
*/
static void _e_comp_wl_subsurface_parent_commit(E_Client *ec, Eina_Bool parent_synchronized);
static double _last_event_time = 0.0;
/* local functions */
-static void
+static void
_e_comp_wl_focus_down_set(E_Client *ec)
{
Ecore_Window win = 0;
e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, win);
}
-static void
+static void
_e_comp_wl_focus_check(E_Comp *comp)
{
E_Client *ec;
e_grabinput_focus(comp->ee_win, E_FOCUS_METHOD_PASSIVE);
}
-static void
+static void
_e_comp_wl_log_cb_print(const char *format, va_list args)
{
EINA_LOG_DOM_INFO(e_log_dom, format, args);
}
-static Eina_Bool
+static Eina_Bool
_e_comp_wl_cb_read(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
{
E_Comp_Data *cdata;
return ECORE_CALLBACK_RENEW;
}
-static void
+static void
_e_comp_wl_cb_prepare(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
{
E_Comp_Data *cdata;
wl_display_flush_clients(cdata->wl.disp);
}
-static Eina_Bool
+static Eina_Bool
_e_comp_wl_cb_module_idle(void *data)
{
E_Comp_Data *cdata;
{
e_module_enable(mod);
- /* FIXME: NB:
+ /* FIXME: NB:
* Do we need to dispatch pending wl events here ?? */
return ECORE_CALLBACK_CANCEL;
return ECORE_CALLBACK_RENEW;
}
-static void
+static void
_e_comp_wl_evas_cb_show(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
E_Client *ec, *tmp;
if (!ec->override) e_hints_window_visible_set(ec);
- if ((!ec->override) && (!ec->re_manage) && (!ec->comp_data->reparented) &&
+ if ((!ec->override) && (!ec->re_manage) && (!ec->comp_data->reparented) &&
(!ec->comp_data->need_reparent))
{
ec->comp_data->need_reparent = EINA_TRUE;
evas_object_show(tmp->frame);
}
-static void
+static void
_e_comp_wl_evas_cb_hide(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
E_Client *ec, *tmp;
evas_object_hide(tmp->frame);
}
-static void
+static void
_e_comp_wl_evas_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
E_Client *ec;
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
- wl_pointer_send_enter(res, serial, ec->comp_data->surface,
- wl_fixed_from_int(ev->canvas.x),
+ wl_pointer_send_enter(res, serial, ec->comp_data->surface,
+ wl_fixed_from_int(ev->canvas.x),
wl_fixed_from_int(ev->canvas.y));
}
}
-static void
+static void
_e_comp_wl_evas_cb_mouse_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
E_Client *ec;
}
}
-static void
+static void
_e_comp_wl_evas_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
{
E_Client *ec;
if (e_object_is_del(E_OBJECT(ec))) return;
if (e_client_util_ignored_get(ec)) return;
- ec->comp->wl_comp_data->ptr.x =
+ ec->comp->wl_comp_data->ptr.x =
wl_fixed_from_int(ev->cur.canvas.x - ec->client.x);
- ec->comp->wl_comp_data->ptr.y =
+ ec->comp->wl_comp_data->ptr.y =
wl_fixed_from_int(ev->cur.canvas.y - ec->client.y);
if (!ec->comp_data->surface) return;
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
- wl_pointer_send_motion(res, ev->timestamp,
- ec->comp->wl_comp_data->ptr.x,
+ wl_pointer_send_motion(res, ev->timestamp,
+ ec->comp->wl_comp_data->ptr.x,
ec->comp->wl_comp_data->ptr.y);
}
}
-static void
+static void
_e_comp_wl_evas_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
{
E_Client *ec;
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
- wl_pointer_send_button(res, serial, ev->timestamp, btn,
+ wl_pointer_send_button(res, serial, ev->timestamp, btn,
WL_POINTER_BUTTON_STATE_PRESSED);
}
}
-static void
+static void
_e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
{
E_Client *ec;
{
if (!e_comp_wl_input_pointer_check(res)) continue;
if (wl_resource_get_client(res) != wc) continue;
- wl_pointer_send_button(res, serial, ev->timestamp, btn,
+ wl_pointer_send_button(res, serial, ev->timestamp, btn,
WL_POINTER_BUTTON_STATE_RELEASED);
}
}
-static void
+static void
_e_comp_wl_evas_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
{
E_Client *ec;
}
}
-static void
+static void
_e_comp_wl_client_priority_adjust(int pid, int set, int adj, Eina_Bool use_adj, Eina_Bool adj_child, Eina_Bool do_child)
{
Eina_List *files;
}
}
-static void
+static void
_e_comp_wl_client_priority_raise(E_Client *ec)
{
if (ec->netwm.pid <= 0) return;
if (ec->netwm.pid == getpid()) return;
- _e_comp_wl_client_priority_adjust(ec->netwm.pid,
- e_config->priority - 1, -1,
+ _e_comp_wl_client_priority_adjust(ec->netwm.pid,
+ e_config->priority - 1, -1,
EINA_FALSE, EINA_TRUE, EINA_FALSE);
}
-static void
+static void
_e_comp_wl_client_priority_normal(E_Client *ec)
{
if (ec->netwm.pid <= 0) return;
if (ec->netwm.pid == getpid()) return;
- _e_comp_wl_client_priority_adjust(ec->netwm.pid, e_config->priority, 1,
+ _e_comp_wl_client_priority_adjust(ec->netwm.pid, e_config->priority, 1,
EINA_FALSE, EINA_TRUE, EINA_FALSE);
}
-static Eina_Bool
+static Eina_Bool
_e_comp_wl_client_cb_idle(void *data EINA_UNUSED)
{
E_Client *ec;
if ((ec->post_resize) && (!ec->maximized))
{
if (cdata->shell.configure_send)
- cdata->shell.configure_send(cdata->shell.surface,
+ cdata->shell.configure_send(cdata->shell.surface,
ec->comp->wl_comp_data->resize.edges,
ec->client.w, ec->client.h);
}
return EINA_FALSE;
}
-static void
+static void
_e_comp_wl_client_idler_add(E_Client *ec)
{
if (!ec) return;
}
}
-static void
+static void
_e_comp_wl_evas_cb_focus_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
E_Client *ec, *focused;
_e_comp_wl_client_focus(ec);
}
-static void
+static void
_e_comp_wl_evas_cb_focus_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
E_Client *ec;
ec->comp_data->focus_update = 0;
}
-static void
+static void
_e_comp_wl_evas_cb_resize(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
E_Client *ec;
_e_comp_wl_client_idler_add(ec);
}
-static void
+static void
_e_comp_wl_evas_cb_delete_request(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
E_Client *ec;
* NB: No such animal wrt wayland */
}
-static void
+static void
_e_comp_wl_evas_cb_kill_request(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
E_Client *ec;
_e_comp_wl_focus_check(ec->comp);
}
-static void
+static void
_e_comp_wl_evas_cb_ping(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
E_Client *ec;
ec->comp_data->shell.ping(ec->comp_data->shell.surface);
}
-static void
+static void
_e_comp_wl_evas_cb_color_set(void *data, Evas_Object *obj, void *event EINA_UNUSED)
{
E_Client *ec;
ec->netwm.opacity_changed = EINA_TRUE;
}
-static void
+static void
_e_comp_wl_client_evas_init(E_Client *ec)
{
if (ec->comp_data->evas_init) return;
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW,
+ evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW,
_e_comp_wl_evas_cb_show, ec);
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_HIDE,
+ evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_HIDE,
_e_comp_wl_evas_cb_hide, ec);
/* setup input callbacks */
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_IN,
+ evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_IN,
_e_comp_wl_evas_cb_mouse_in, ec);
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_OUT,
+ evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_OUT,
_e_comp_wl_evas_cb_mouse_out, ec);
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_MOVE,
+ evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_MOVE,
_e_comp_wl_evas_cb_mouse_move, ec);
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_DOWN,
+ evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_DOWN,
_e_comp_wl_evas_cb_mouse_down, ec);
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_UP,
+ evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_UP,
_e_comp_wl_evas_cb_mouse_up, ec);
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_WHEEL,
+ evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_WHEEL,
_e_comp_wl_evas_cb_mouse_wheel, ec);
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_FOCUS_IN,
+ evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_FOCUS_IN,
_e_comp_wl_evas_cb_focus_in, ec);
- evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_FOCUS_OUT,
+ evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_FOCUS_OUT,
_e_comp_wl_evas_cb_focus_out, ec);
if (!ec->override)
{
- evas_object_smart_callback_add(ec->frame, "client_resize",
+ evas_object_smart_callback_add(ec->frame, "client_resize",
_e_comp_wl_evas_cb_resize, ec);
}
/* setup delete/kill callbacks */
- evas_object_smart_callback_add(ec->frame, "delete_request",
+ evas_object_smart_callback_add(ec->frame, "delete_request",
_e_comp_wl_evas_cb_delete_request, ec);
- evas_object_smart_callback_add(ec->frame, "kill_request",
+ evas_object_smart_callback_add(ec->frame, "kill_request",
_e_comp_wl_evas_cb_kill_request, ec);
/* setup ping callback */
- evas_object_smart_callback_add(ec->frame, "ping",
+ evas_object_smart_callback_add(ec->frame, "ping",
_e_comp_wl_evas_cb_ping, ec);
- evas_object_smart_callback_add(ec->frame, "color_set",
+ evas_object_smart_callback_add(ec->frame, "color_set",
_e_comp_wl_evas_cb_color_set, ec);
ec->comp_data->evas_init = EINA_TRUE;
}
#ifndef HAVE_WAYLAND_ONLY
-static Eina_Bool
+static Eina_Bool
_e_comp_wl_cb_randr_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
{
Eina_List *l;
break;
}
- e_comp_wl_output_init(screen->id, screen->info.screen,
+ e_comp_wl_output_init(screen->id, screen->info.screen,
screen->info.name,
- screen->config.geom.x, screen->config.geom.y,
- screen->config.geom.w, screen->config.geom.h,
- screen->info.size.w, screen->info.size.h,
+ screen->config.geom.x, screen->config.geom.y,
+ screen->config.geom.w, screen->config.geom.h,
+ screen->info.size.w, screen->info.size.h,
screen->config.mode.refresh, 0, transform);
}
}
#endif
-static Eina_Bool
+static Eina_Bool
_e_comp_wl_cb_comp_object_add(void *data EINA_UNUSED, int type EINA_UNUSED, E_Event_Comp_Object *ev)
{
E_Client *ec;
/* try to get the client from the object */
- if (!(ec = e_comp_object_client_get(ev->comp_object)))
+ if (!(ec = e_comp_object_client_get(ev->comp_object)))
return ECORE_CALLBACK_RENEW;
/* check for client being deleted */
return ECORE_CALLBACK_RENEW;
}
-static void
+static void
_e_comp_wl_cb_key_down(void *event)
{
E_Comp_Data *cdata;
EINA_LIST_FOREACH(cdata->kbd.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
- wl_keyboard_send_key(res, serial, ev->timestamp,
+ wl_keyboard_send_key(res, serial, ev->timestamp,
keycode, WL_KEYBOARD_KEY_STATE_PRESSED);
}
}
}
}
-static void
+static void
_e_comp_wl_cb_key_up(void *event)
{
E_Client *ec;
EINA_LIST_FOREACH(cdata->kbd.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
- wl_keyboard_send_key(res, serial, ev->timestamp,
+ wl_keyboard_send_key(res, serial, ev->timestamp,
keycode, WL_KEYBOARD_KEY_STATE_RELEASED);
}
}
}
}
-static Eina_Bool
+static Eina_Bool
_e_comp_wl_cb_input_event(void *data EINA_UNUSED, int type, void *ev)
{
_last_event_time = ecore_loop_time_get();
return ECORE_CALLBACK_RENEW;
}
-static void
+static void
_e_comp_wl_surface_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Pixmap *ep;
wl_resource_destroy(resource);
}
-static void
+static void
_e_comp_wl_surface_cb_attach(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *buffer_resource, int32_t sx, int32_t sy)
{
E_Pixmap *ep;
if (buffer_resource)
{
struct wl_shm_buffer *shmb;
-
+
/* check for this resource being a shm buffer */
if ((shmb = wl_shm_buffer_get(buffer_resource)))
{
}
}
-static void
+static void
_e_comp_wl_surface_cb_damage(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y, int32_t w, int32_t h)
{
E_Pixmap *ep;
if (!(dmg = eina_rectangle_new(x, y, w, h))) return;
/* add damage rectangle to list of pending damages */
- ec->comp_data->pending.damages =
+ ec->comp_data->pending.damages =
eina_list_append(ec->comp_data->pending.damages, dmg);
}
-static void
+static void
_e_comp_wl_frame_cb_destroy(struct wl_resource *resource)
{
E_Client *ec;
ec->comp_data->frames = eina_list_remove(ec->comp_data->frames, resource);
}
-static void
+static void
_e_comp_wl_surface_cb_frame(struct wl_client *client, struct wl_resource *resource, uint32_t callback)
{
E_Pixmap *ep;
if (e_object_is_del(E_OBJECT(ec))) return;
/* create frame callback */
- if (!(res =
+ if (!(res =
wl_resource_create(client, &wl_callback_interface, 1, callback)))
{
wl_resource_post_no_memory(resource);
ec->comp_data->frames = eina_list_append(ec->comp_data->frames, res);
}
-static void
+static void
_e_comp_wl_surface_cb_opaque_region_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *region_resource)
{
E_Pixmap *ep;
e_pixmap_image_opaque_set(ec->pixmap, 0, 0, 0, 0);
}
-static void
+static void
_e_comp_wl_surface_cb_input_region_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *region_resource)
{
E_Pixmap *ep;
}
else
{
- eina_tiler_rect_add(ec->comp_data->pending.input,
+ eina_tiler_rect_add(ec->comp_data->pending.input,
&(Eina_Rectangle){0, 0, ec->client.w, ec->client.h});
}
}
-static void
+static void
_e_comp_wl_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Pixmap *ep;
/* DBG("Surface Commit: %d", wl_resource_get_id(resource)); */
/* call the subsurface commit function
- *
+ *
* NB: Returns true on success */
if (e_comp_wl_subsurface_commit(ec)) return;
}
}
-static void
+static void
_e_comp_wl_surface_cb_buffer_transform_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED, int32_t transform EINA_UNUSED)
{
DBG("Surface Buffer Transform: %d", wl_resource_get_id(resource));
}
-static void
+static void
_e_comp_wl_surface_cb_buffer_scale_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED, int32_t scale EINA_UNUSED)
{
DBG("Surface Buffer Scale: %d", wl_resource_get_id(resource));
}
-static const struct wl_surface_interface _e_surface_interface =
+static const struct wl_surface_interface _e_surface_interface =
{
_e_comp_wl_surface_cb_destroy,
_e_comp_wl_surface_cb_attach,
_e_comp_wl_surface_cb_buffer_scale_set
};
-static void
+static void
_e_comp_wl_surface_destroy(struct wl_resource *resource)
{
E_Pixmap *ep;
e_object_del(E_OBJECT(ec));
}
-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;
DBG("Compositor Cb Surface Create: %d", id);
/* try to create an internal surface */
- if (!(res = wl_resource_create(client, &wl_surface_interface,
+ if (!(res = wl_resource_create(client, &wl_surface_interface,
wl_resource_get_version(resource), id)))
{
ERR("Could not create compositor surface");
DBG("\tCreated Resource: %d", wl_resource_get_id(res));
/* set implementation on resource */
- wl_resource_set_implementation(res, &_e_surface_interface, NULL,
+ wl_resource_set_implementation(res, &_e_surface_interface, NULL,
_e_comp_wl_surface_destroy);
wl_client_get_credentials(client, &pid, NULL, NULL);
wl_signal_emit(&comp->wl_comp_data->signals.surface.create, res);
}
-static void
+static void
_e_comp_wl_region_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
DBG("Region Destroy: %d", wl_resource_get_id(resource));
wl_resource_destroy(resource);
}
-static void
+static void
_e_comp_wl_region_cb_add(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y, int32_t w, int32_t h)
{
Eina_Tiler *tiler;
}
}
-static void
+static void
_e_comp_wl_region_cb_subtract(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y, int32_t w, int32_t h)
{
Eina_Tiler *tiler;
}
}
-static const struct wl_region_interface _e_region_interface =
+static const struct wl_region_interface _e_region_interface =
{
- _e_comp_wl_region_cb_destroy,
- _e_comp_wl_region_cb_add,
+ _e_comp_wl_region_cb_destroy,
+ _e_comp_wl_region_cb_add,
_e_comp_wl_region_cb_subtract
};
-static void
+static void
_e_comp_wl_compositor_cb_region_destroy(struct wl_resource *resource)
{
Eina_Tiler *tiler;
eina_tiler_free(tiler);
}
-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;
return;
}
- wl_resource_set_implementation(res, &_e_region_interface, tiler,
+ wl_resource_set_implementation(res, &_e_region_interface, tiler,
_e_comp_wl_compositor_cb_region_destroy);
}
-static const struct wl_compositor_interface _e_comp_interface =
+static const struct wl_compositor_interface _e_comp_interface =
{
_e_comp_wl_compositor_cb_surface_create,
_e_comp_wl_compositor_cb_region_create
};
-static void
+static void
_e_comp_wl_compositor_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
{
E_Comp *comp;
if (!(comp = data)) return;
- if (!(res =
- wl_resource_create(client, &wl_compositor_interface,
+ if (!(res =
+ wl_resource_create(client, &wl_compositor_interface,
MIN(version, COMPOSITOR_VERSION), id)))
{
ERR("Could not create compositor resource: %m");
wl_resource_set_implementation(res, &_e_comp_interface, comp, NULL);
}
-static void
+static void
_e_comp_wl_compositor_cb_del(E_Comp *comp)
{
E_Comp_Data *cdata;
free(cdata);
}
-static void
+static void
_e_comp_wl_subsurface_destroy(struct wl_resource *resource)
{
E_Client *ec;
if (sdata->parent)
{
/* remove this client from parents sub list */
- sdata->parent->comp_data->sub.list =
+ sdata->parent->comp_data->sub.list =
eina_list_remove(sdata->parent->comp_data->sub.list, ec);
}
/* release buffer */
if (sdata->cached.buffer) wl_buffer_send_release(sdata->cached.buffer);
- /* the client is getting deleted, which means the pixmap will be getting
+ /* the client is getting deleted, which means the pixmap will be getting
* freed. We need to unset the surface user data */
/* wl_resource_set_user_data(ec->comp_data->surface, NULL); */
ec->comp_data->sub.data = NULL;
}
-static Eina_Bool
+static Eina_Bool
_e_comp_wl_subsurface_synchronized_get(E_Comp_Wl_Subsurf_Data *sdata)
{
while (sdata)
return EINA_FALSE;
}
-static void
+static void
_e_comp_wl_subsurface_commit_to_cache(E_Client *ec)
{
E_Comp_Client_Data *cdata;
sdata->cached.has_data = EINA_TRUE;
}
-static void
+static void
_e_comp_wl_subsurface_commit_from_cache(E_Client *ec)
{
E_Comp_Client_Data *cdata;
ec->placed = placed;
}
- if (!cdata->mapped)
+ if (!cdata->mapped)
{
DBG("\tSurface Not Mapped. Skip to Unmapped");
goto unmap;
{
tmp = eina_tiler_new(ec->w, ec->h);
eina_tiler_tile_size_set(tmp, 1, 1);
- eina_tiler_rect_add(tmp,
+ eina_tiler_rect_add(tmp,
&(Eina_Rectangle){0, 0, ec->client.w, ec->client.h});
if ((src = eina_tiler_intersection(sdata->cached.input, tmp)))
EINA_ITERATOR_FOREACH(itr, rect)
ec->shape_input_rects_num += 1;
- ec->shape_input_rects =
+ ec->shape_input_rects =
malloc(sizeof(Eina_Rectangle) * ec->shape_input_rects_num);
if (ec->shape_input_rects)
{
EINA_ITERATOR_FOREACH(itr, rect)
{
- ec->shape_input_rects[i] =
+ ec->shape_input_rects[i] =
*(Eina_Rectangle *)((char *)rect);
ec->shape_input_rects[i].x = rect->x;
eina_tiler_clear(sdata->cached.input);
}
-static void
+static void
_e_comp_wl_subsurface_parent_commit(E_Client *ec, Eina_Bool parent_synchronized)
{
E_Client *parent;
if (sdata->position.set)
{
- evas_object_move(ec->frame, parent->x + sdata->position.x,
+ evas_object_move(ec->frame, parent->x + sdata->position.x,
parent->y + sdata->position.y);
sdata->position.set = EINA_FALSE;
}
}
}
-static void
+static void
_e_comp_wl_subsurface_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
wl_resource_destroy(resource);
}
-static void
+static void
_e_comp_wl_subsurface_cb_position_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t x, int32_t y)
{
E_Client *ec;
sdata->position.set = EINA_TRUE;
}
-static void
+static void
_e_comp_wl_subsurface_cb_place_above(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *sibling_resource)
{
E_Client *ec, *ecs;
if (!(parent = ec->comp_data->sub.data->parent)) return;
- parent->comp_data->sub.list =
+ parent->comp_data->sub.list =
eina_list_remove(parent->comp_data->sub.list, ec);
- parent->comp_data->sub.list =
+ parent->comp_data->sub.list =
eina_list_append_relative(parent->comp_data->sub.list, ec, ecs);
parent->comp_data->sub.restack_target = parent;
}
-static void
+static void
_e_comp_wl_subsurface_cb_place_below(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *sibling_resource)
{
E_Client *ec, *ecs;
if (!(parent = ec->comp_data->sub.data->parent)) return;
- parent->comp_data->sub.list =
+ parent->comp_data->sub.list =
eina_list_remove(parent->comp_data->sub.list, ec);
- parent->comp_data->sub.list =
+ parent->comp_data->sub.list =
eina_list_prepend_relative(parent->comp_data->sub.list, ec, ecs);
parent->comp_data->sub.restack_target = parent;
}
-static void
+static void
_e_comp_wl_subsurface_cb_sync_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Client *ec;
sdata->synchronized = EINA_TRUE;
}
-static void
+static void
_e_comp_wl_subsurface_cb_desync_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Client *ec;
sdata->synchronized = EINA_FALSE;
}
-static const struct wl_subsurface_interface _e_subsurface_interface =
+static const struct wl_subsurface_interface _e_subsurface_interface =
{
_e_comp_wl_subsurface_cb_destroy,
_e_comp_wl_subsurface_cb_position_set,
_e_comp_wl_subsurface_cb_place_above,
_e_comp_wl_subsurface_cb_place_below,
- _e_comp_wl_subsurface_cb_sync_set,
+ _e_comp_wl_subsurface_cb_sync_set,
_e_comp_wl_subsurface_cb_desync_set
};
-static Eina_Bool
+static Eina_Bool
_e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_resource *surface_resource)
{
struct wl_client *client;
/* try to get the wayland client from the surface resource */
if (!(client = wl_resource_get_client(surface_resource)))
{
- ERR("Could not get client from resource %d",
+ ERR("Could not get client from resource %d",
wl_resource_get_id(surface_resource));
return EINA_FALSE;
}
}
/* set resource implementation */
- wl_resource_set_implementation(res, &_e_subsurface_interface, ec,
+ wl_resource_set_implementation(res, &_e_subsurface_interface, ec,
_e_comp_wl_subsurface_destroy);
/* set subsurface data properties */
if (epc->comp_data)
{
/* append this client to the parents subsurface list */
- epc->comp_data->sub.list =
+ epc->comp_data->sub.list =
eina_list_append(epc->comp_data->sub.list, ec);
}
return EINA_FALSE;
}
-static void
+static void
_e_comp_wl_subcompositor_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
wl_resource_destroy(resource);
/* TODO: destroy iconify/uniconify handlers */
}
-static void
+static void
_e_comp_wl_subcompositor_cb_subsurface_get(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource, struct wl_resource *parent_resource)
{
E_Pixmap *ep, *epp;
E_Client *ec, *epc = NULL;
static const char where[] = "get_subsurface: wl_subsurface@";
- DBG("Subcompositor Create Subsurface for Surface: %d",
+ DBG("Subcompositor Create Subsurface for Surface: %d",
wl_resource_get_id(surface_resource));
/* try to get the surface pixmap */
if (!(ep = wl_resource_get_user_data(surface_resource)))
{
- wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE,
- "%s%d: wl_surface@%d is invalid.", where, id,
+ wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE,
+ "%s%d: wl_surface@%d is invalid.", where, id,
wl_resource_get_id(surface_resource));
return;
}
/* try to get the parent pixmap */
if (!(epp = wl_resource_get_user_data(parent_resource)))
{
- wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE,
- "%s%d: wl_surface@%d is invalid.", where, id,
+ wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE,
+ "%s%d: wl_surface@%d is invalid.", where, id,
wl_resource_get_id(parent_resource));
return;
}
/* try to create a new subsurface */
if (!_e_comp_wl_subsurface_create(ec, epc, id, surface_resource))
- ERR("Failed to create subsurface for surface %d",
+ ERR("Failed to create subsurface for surface %d",
wl_resource_get_id(surface_resource));
}
-static const struct wl_subcompositor_interface _e_subcomp_interface =
+static const struct wl_subcompositor_interface _e_subcomp_interface =
{
_e_comp_wl_subcompositor_cb_destroy,
_e_comp_wl_subcompositor_cb_subsurface_get
};
-static void
+static void
_e_comp_wl_subcompositor_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
{
E_Comp *comp;
if (!(comp = data)) return;
- if (!(res =
- wl_resource_create(client, &wl_subcompositor_interface,
+ if (!(res =
+ wl_resource_create(client, &wl_subcompositor_interface,
MIN(version, 1), id)))
{
ERR("Could not create subcompositor resource: %m");
/* TODO: add handlers for client iconify/uniconify */
}
-static void
+static void
_e_comp_wl_client_cb_new(void *data EINA_UNUSED, E_Client *ec)
{
uint64_t win;
ec->ignored = e_comp_ignore_win_find(win);
ec->border_size = 0;
- /* NB: could not find a better place to do this, BUT for internal windows,
- * we need to set delete_request else the close buttons on the frames do
+ /* NB: could not find a better place to do this, BUT for internal windows,
+ * we need to set delete_request else the close buttons on the frames do
* basically nothing */
- if ((ec->internal) || (ec->internal_elm_win))
+ if ((ec->internal) || (ec->internal_elm_win))
ec->icccm.delete_request = EINA_TRUE;
/* set initial client data properties */
e_hints_client_list_set();
}
-static void
+static void
_e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec)
{
/* uint64_t win; */
ec->parent->modal = NULL;
}
- /* the client is getting deleted, which means the pixmap will be getting
+ /* the client is getting deleted, which means the pixmap will be getting
* freed. We need to unset the surface user data */
if (ec->comp_data->surface)
wl_resource_set_user_data(ec->comp_data->surface, NULL);
_e_comp_wl_focus_check(ec->comp);
}
-static void
+static void
_e_comp_wl_client_cb_post_new(void *data EINA_UNUSED, E_Client *ec)
{
E_COMP_WL_PIXMAP_CHECK;
}
}
-static void
+static void
_e_comp_wl_client_cb_pre_frame(void *data EINA_UNUSED, E_Client *ec)
{
uint64_t parent;
switch (ec->netwm.type)
{
case E_WINDOW_TYPE_DIALOG:
- /* NB: If there is No transient set, then dialogs get
+ /* NB: If there is No transient set, then dialogs get
* treated as Normal Toplevel windows */
if (ec->icccm.transient_for)
type = ECORE_WL_WINDOW_TYPE_TRANSIENT;
ec->comp_data->reparented = EINA_TRUE;
}
-static void
+static void
_e_comp_wl_client_cb_focus_set(void *data EINA_UNUSED, E_Client *ec)
{
E_COMP_WL_PIXMAP_CHECK;
if (ec->comp_data->shell.configure_send)
{
if (ec->comp_data->shell.surface)
- ec->comp_data->shell.configure_send(ec->comp_data->shell.surface,
+ ec->comp_data->shell.configure_send(ec->comp_data->shell.surface,
0, 0, 0);
}
if ((ec->icccm.take_focus) && (ec->icccm.accepts_focus))
- e_grabinput_focus(e_client_util_win_get(ec),
+ e_grabinput_focus(e_client_util_win_get(ec),
E_FOCUS_METHOD_LOCALLY_ACTIVE);
else if (!ec->icccm.accepts_focus)
- e_grabinput_focus(e_client_util_win_get(ec),
+ e_grabinput_focus(e_client_util_win_get(ec),
E_FOCUS_METHOD_GLOBALLY_ACTIVE);
else if (!ec->icccm.take_focus)
e_grabinput_focus(e_client_util_win_get(ec), E_FOCUS_METHOD_PASSIVE);
}
}
-static void
+static void
_e_comp_wl_client_cb_focus_unset(void *data EINA_UNUSED, E_Client *ec)
{
E_COMP_WL_PIXMAP_CHECK;
if (ec->comp_data->shell.configure_send)
{
if (ec->comp_data->shell.surface)
- ec->comp_data->shell.configure_send(ec->comp_data->shell.surface,
+ ec->comp_data->shell.configure_send(ec->comp_data->shell.surface,
0, 0, 0);
}
ec->comp->wl_comp_data->kbd.focus = NULL;
}
-static void
+static void
_e_comp_wl_client_cb_resize_begin(void *data EINA_UNUSED, E_Client *ec)
{
E_COMP_WL_PIXMAP_CHECK;
}
}
-static void
+static void
_e_comp_wl_client_cb_resize_end(void *data EINA_UNUSED, E_Client *ec)
{
if (e_object_is_del(E_OBJECT(ec))) return;
if (!(output = data)) return;
- resource =
+ resource =
wl_resource_create(client, &wl_output_interface, MIN(version, 2), id);
if (!resource)
{
output->resources = eina_list_append(output->resources, resource);
- wl_resource_set_implementation(resource, NULL, output,
+ wl_resource_set_implementation(resource, NULL, output,
_e_comp_wl_cb_output_unbind);
wl_resource_set_user_data(resource, output);
- wl_output_send_geometry(resource, output->x, output->y,
- output->phys_width, output->phys_height,
- output->subpixel, output->make, output->model,
+ wl_output_send_geometry(resource, output->x, output->y,
+ output->phys_width, output->phys_height,
+ output->subpixel, output->make, output->model,
output->transform);
if (version >= WL_OUTPUT_SCALE_SINCE_VERSION)
wl_output_send_done(resource);
}
-static Eina_Bool
+static Eina_Bool
_e_comp_wl_compositor_create(void)
{
E_Comp *comp;
wl_signal_init(&cdata->signals.surface.kill);
/* try to add compositor to wayland globals */
- if (!wl_global_create(cdata->wl.disp, &wl_compositor_interface,
- COMPOSITOR_VERSION, comp,
+ if (!wl_global_create(cdata->wl.disp, &wl_compositor_interface,
+ COMPOSITOR_VERSION, 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,
+ if (!wl_global_create(cdata->wl.disp, &wl_subcompositor_interface, 1,
comp, _e_comp_wl_subcompositor_cb_bind))
{
ERR("Could not add subcompositor to wayland globals: %m");
root = ecore_x_window_root_first_get();
xkb = ecore_x_atom_get("_XKB_RULES_NAMES");
- ecore_x_window_prop_property_get(root, xkb, ECORE_X_ATOM_STRING,
+ ecore_x_window_prop_property_get(root, xkb, ECORE_X_ATOM_STRING,
1024, &dat, &len);
if ((dat) && (len > 0))
{
fd = wl_event_loop_get_fd(cdata->wl.loop);
/* create a listener for wayland main loop events */
- cdata->fd_hdlr =
- ecore_main_fd_handler_add(fd, (ECORE_FD_READ | ECORE_FD_ERROR),
+ cdata->fd_hdlr =
+ ecore_main_fd_handler_add(fd, (ECORE_FD_READ | ECORE_FD_ERROR),
_e_comp_wl_cb_read, cdata, NULL, NULL);
- ecore_main_fd_handler_prepare_callback_set(cdata->fd_hdlr,
+ ecore_main_fd_handler_prepare_callback_set(cdata->fd_hdlr,
_e_comp_wl_cb_prepare, cdata);
/* setup module idler to load shell mmodule */
}
/* public functions */
-EAPI Eina_Bool
+EAPI Eina_Bool
e_comp_wl_init(void)
{
/* set gl available if we have ecore_evas support */
- if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_WAYLAND_EGL) ||
+ if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_WAYLAND_EGL) ||
ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_DRM))
e_comp_gl_set(EINA_TRUE);
/* add event handlers to catch E events */
#ifndef HAVE_WAYLAND_ONLY
- E_LIST_HANDLER_APPEND(handlers, E_EVENT_RANDR_CHANGE,
+ E_LIST_HANDLER_APPEND(handlers, E_EVENT_RANDR_CHANGE,
_e_comp_wl_cb_randr_change, NULL);
#endif
- E_LIST_HANDLER_APPEND(handlers, E_EVENT_COMP_OBJECT_ADD,
+ E_LIST_HANDLER_APPEND(handlers, E_EVENT_COMP_OBJECT_ADD,
_e_comp_wl_cb_comp_object_add, NULL);
- E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_DOWN,
+ E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_DOWN,
_e_comp_wl_cb_input_event, NULL);
- E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_UP,
+ E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_UP,
_e_comp_wl_cb_input_event, NULL);
- E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN,
_e_comp_wl_cb_input_event, NULL);
- E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_BUTTON_UP,
+ E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_BUTTON_UP,
_e_comp_wl_cb_input_event, NULL);
- E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_MOVE,
+ E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_MOVE,
_e_comp_wl_cb_input_event, NULL);
- E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_WHEEL,
+ E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_WHEEL,
_e_comp_wl_cb_input_event, NULL);
/* add hooks to catch e_client events */
e_client_hook_add(E_CLIENT_HOOK_NEW_CLIENT, _e_comp_wl_client_cb_new, NULL);
e_client_hook_add(E_CLIENT_HOOK_DEL, _e_comp_wl_client_cb_del, NULL);
- e_client_hook_add(E_CLIENT_HOOK_EVAL_POST_NEW_CLIENT,
+ e_client_hook_add(E_CLIENT_HOOK_EVAL_POST_NEW_CLIENT,
_e_comp_wl_client_cb_post_new, NULL);
/* e_client_hook_add(E_CLIENT_HOOK_EVAL_PRE_FRAME_ASSIGN, */
/* _e_comp_wl_client_cb_pre_frame, NULL); */
- e_client_hook_add(E_CLIENT_HOOK_FOCUS_SET,
+ e_client_hook_add(E_CLIENT_HOOK_FOCUS_SET,
_e_comp_wl_client_cb_focus_set, NULL);
- e_client_hook_add(E_CLIENT_HOOK_FOCUS_UNSET,
+ e_client_hook_add(E_CLIENT_HOOK_FOCUS_UNSET,
_e_comp_wl_client_cb_focus_unset, NULL);
- e_client_hook_add(E_CLIENT_HOOK_RESIZE_BEGIN,
+ e_client_hook_add(E_CLIENT_HOOK_RESIZE_BEGIN,
_e_comp_wl_client_cb_resize_begin, NULL);
- e_client_hook_add(E_CLIENT_HOOK_RESIZE_END,
+ e_client_hook_add(E_CLIENT_HOOK_RESIZE_END,
_e_comp_wl_client_cb_resize_end, NULL);
_last_event_time = ecore_loop_time_get();
return EINA_TRUE;
}
-EAPI struct wl_signal
+EAPI struct wl_signal
e_comp_wl_surface_create_signal_get(E_Comp *comp)
{
return comp->wl_comp_data->signals.surface.create;
}
/* internal functions */
-EINTERN void
+EINTERN void
e_comp_wl_shutdown(void)
{
#ifndef HAVE_WAYLAND_ONLY
return ret;
}
-EINTERN Eina_Bool
+EINTERN Eina_Bool
e_comp_wl_surface_commit(E_Client *ec)
{
E_Pixmap *ep;
}
}
- if (!ec->comp_data->mapped)
+ if (!ec->comp_data->mapped)
{
DBG("\tSurface Not Mapped. Skip to Unmapped");
goto unmap;
{
tmp = eina_tiler_new(ec->w, ec->h);
eina_tiler_tile_size_set(tmp, 1, 1);
- eina_tiler_rect_add(tmp,
+ eina_tiler_rect_add(tmp,
&(Eina_Rectangle){0, 0, ec->client.w, ec->client.h});
if ((src = eina_tiler_intersection(ec->comp_data->pending.input, tmp)))
return EINA_TRUE;
}
-EINTERN Eina_Bool
+EINTERN Eina_Bool
e_comp_wl_subsurface_commit(E_Client *ec)
{
E_Comp_Wl_Subsurf_Data *sdata;
return EINA_TRUE;
}
-EAPI double
+EAPI double
e_comp_wl_idle_time_get(void)
{
return (ecore_loop_time_get() - _last_event_time);
}
-EAPI void
+EAPI void
e_comp_wl_output_init(const char *id, const char *make, const char *model, int x, int y, int w, int h, int pw, int ph, unsigned int refresh, unsigned int subpixel, unsigned int transform)
{
E_Comp_Data *cdata;
cdata->outputs = eina_list_append(cdata->outputs, output);
- output->global =
- wl_global_create(cdata->wl.disp, &wl_output_interface, 2,
+ output->global =
+ wl_global_create(cdata->wl.disp, &wl_output_interface, 2,
output, _e_comp_wl_cb_output_bind);
}
#define XDG_SERVER_VERSION 4
-static void
+static void
_e_shell_surface_parent_set(E_Client *ec, struct wl_resource *parent_resource)
{
E_Pixmap *pp;
ec->icccm.transient_for = pwin;
}
-static void
+static void
_e_shell_surface_mouse_down_helper(E_Client *ec, E_Binding_Event_Mouse_Button *ev, Eina_Bool move)
{
if (move)
/* tell E to start moving the client */
e_client_act_move_begin(ec, ev);
- /* we have to get a reference to the window_move action here, or else
+ /* we have to get a reference to the window_move action here, or else
* when e_client stops the move we will never get notified */
ec->cur_mouse_action = e_action_find("window_move");
if (ec->cur_mouse_action)
/* tell E to start resizing the client */
e_client_act_resize_begin(ec, ev);
- /* we have to get a reference to the window_resize action here,
+ /* we have to get a reference to the window_resize action here,
* or else when e_client stops the resize we will never get notified */
ec->cur_mouse_action = e_action_find("window_resize");
if (ec->cur_mouse_action)
{
if (ec->comp_data->mapped)
{
- if ((ec->comp_data->shell.surface) &&
+ if ((ec->comp_data->shell.surface) &&
(ec->comp_data->shell.unmap))
ec->comp_data->shell.unmap(ec->comp_data->shell.surface);
}
}
}
-static void
+static void
_e_shell_surface_cb_move(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial EINA_UNUSED)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
/* get compositor data from seat */
if (!(cdata = wl_resource_get_user_data(seat_resource)))
{
- wl_resource_post_error(seat_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(seat_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Comp_Data for Seat");
return;
}
break;
}
- e_comp_object_frame_xy_unadjust(ec->frame,
- wl_fixed_to_int(cdata->ptr.x) + ec->client.x,
- wl_fixed_to_int(cdata->ptr.y) + ec->client.y,
+ e_comp_object_frame_xy_unadjust(ec->frame,
+ wl_fixed_to_int(cdata->ptr.x) + ec->client.x,
+ wl_fixed_to_int(cdata->ptr.y) + ec->client.y,
&ev.canvas.x, &ev.canvas.y);
_e_shell_surface_mouse_down_helper(ec, &ev, EINA_TRUE);
}
-static void
+static void
_e_shell_surface_cb_resize(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial EINA_UNUSED, uint32_t edges)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
- if ((edges == 0) || (edges > 15) ||
+ if ((edges == 0) || (edges > 15) ||
((edges & 3) == 3) || ((edges & 12) == 12)) return;
if ((ec->maximized) || (ec->fullscreen)) return;
/* get compositor data from seat */
if (!(cdata = wl_resource_get_user_data(seat_resource)))
{
- wl_resource_post_error(seat_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(seat_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Comp_Data for Seat");
return;
}
break;
}
- e_comp_object_frame_xy_unadjust(ec->frame,
- wl_fixed_to_int(cdata->ptr.x) + ec->client.x,
- wl_fixed_to_int(cdata->ptr.y) + ec->client.y,
+ e_comp_object_frame_xy_unadjust(ec->frame,
+ wl_fixed_to_int(cdata->ptr.x) + ec->client.x,
+ wl_fixed_to_int(cdata->ptr.y) + ec->client.y,
&ev.canvas.x, &ev.canvas.y);
_e_shell_surface_mouse_down_helper(ec, &ev, EINA_FALSE);
}
-static void
+static void
_e_shell_surface_cb_toplevel_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
EC_CHANGED(ec);
}
-static void
+static void
_e_shell_surface_cb_transient_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *parent_resource, int32_t x EINA_UNUSED, int32_t y EINA_UNUSED, uint32_t flags EINA_UNUSED)
{
E_Client *ec;
EC_CHANGED(ec);
}
-static void
+static void
_e_shell_surface_cb_fullscreen_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t method EINA_UNUSED, uint32_t framerate EINA_UNUSED, struct wl_resource *output_resource EINA_UNUSED)
{
E_Client *ec;
e_client_fullscreen(ec, e_config->fullscreen_policy);
}
-static void
+static void
_e_shell_surface_cb_popup_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *seat_resource EINA_UNUSED, uint32_t serial EINA_UNUSED, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags EINA_UNUSED)
{
E_Client *ec;
EC_CHANGED(ec);
}
-static void
+static void
_e_shell_surface_cb_maximized_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *output_resource EINA_UNUSED)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
{
unsigned int edges = 0;
- e_client_maximize(ec, ((e_config->maximize_policy & E_MAXIMIZE_TYPE) |
+ e_client_maximize(ec, ((e_config->maximize_policy & E_MAXIMIZE_TYPE) |
E_MAXIMIZE_BOTH));
edges = (WL_SHELL_SURFACE_RESIZE_TOP | WL_SHELL_SURFACE_RESIZE_LEFT);
}
}
-static void
+static void
_e_shell_surface_cb_title_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, const char *title)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
if (ec->frame) e_comp_object_frame_title_set(ec->frame, title);
}
-static void
+static void
_e_shell_surface_cb_class_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, const char *clas)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
EC_CHANGED(ec);
}
-static const struct wl_shell_surface_interface _e_shell_surface_interface =
+static const struct wl_shell_surface_interface _e_shell_surface_interface =
{
_e_shell_surface_cb_pong,
_e_shell_surface_cb_move,
_e_shell_surface_cb_class_set,
};
-static void
+static void
_e_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges, int32_t width, int32_t height)
{
wl_shell_surface_send_configure(resource, edges, width, height);
}
-static void
+static void
_e_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
if (ec->parent)
{
- if ((ec->netwm.type == E_WINDOW_TYPE_MENU) ||
- (ec->netwm.type == E_WINDOW_TYPE_POPUP_MENU) ||
+ if ((ec->netwm.type == E_WINDOW_TYPE_MENU) ||
+ (ec->netwm.type == E_WINDOW_TYPE_POPUP_MENU) ||
(ec->netwm.type == E_WINDOW_TYPE_DROPDOWN_MENU))
{
x = E_CLAMP(ec->parent->client.x + ec->comp_data->popup.x,
e_client_util_move_resize_without_frame(ec, x, y, w, h);
}
-static void
+static void
_e_shell_surface_ping(struct wl_resource *resource)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
wl_shell_surface_send_ping(ec->comp_data->shell.surface, serial);
}
-static void
+static void
_e_shell_surface_map(struct wl_resource *resource)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
}
}
-static void
+static void
_e_shell_surface_unmap(struct wl_resource *resource)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
}
}
-static void
+static void
_e_shell_cb_shell_surface_get(struct wl_client *client, struct wl_resource *resource EINA_UNUSED, uint32_t id, struct wl_resource *surface_resource)
{
E_Pixmap *ep;
/* get the pixmap from this surface so we can find the client */
if (!(ep = wl_resource_get_user_data(surface_resource)))
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Pixmap Set On Surface");
return;
}
/* no client found. not internal window. maybe external client app ? */
if (!(ec = e_client_new(NULL, ep, 0, 0)))
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Pixmap");
return;
}
/* get the client data */
if (!(cdata = ec->comp_data))
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Data For Client");
return;
}
/* check for existing shell surface */
if (cdata->shell.surface)
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"Client already has shell surface");
return;
}
/* try to create a shell surface */
- if (!(cdata->shell.surface =
+ if (!(cdata->shell.surface =
wl_resource_create(client, &wl_shell_surface_interface, 1, id)))
{
wl_resource_post_no_memory(surface_resource);
return;
}
- wl_resource_set_implementation(cdata->shell.surface,
- &_e_shell_surface_interface,
+ wl_resource_set_implementation(cdata->shell.surface,
+ &_e_shell_surface_interface,
ec, _e_shell_surface_cb_destroy);
cdata->surface = surface_resource;
cdata->shell.unmap = _e_shell_surface_unmap;
}
-static void
+static void
_e_xdg_surface_state_add(struct wl_resource *resource, struct wl_array *states, uint32_t state)
{
uint32_t *s;
return;
}
-static void
+static void
_e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges, int32_t width, int32_t height)
{
E_Client *ec;
struct wl_array states;
uint32_t serial;
- DBG("XDG_SHELL: Surface Configure Send: %d \t%d %d\tEdges: %d",
+ DBG("XDG_SHELL: Surface Configure Send: %d \t%d %d\tEdges: %d",
wl_resource_get_id(resource), width, height, edges);
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
wl_array_release(&states);
}
-static void
+static void
_e_xdg_shell_surface_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
_e_shell_surface_destroy(resource);
}
-static void
+static void
_e_xdg_shell_surface_cb_parent_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *parent_resource)
{
E_Client *ec;
_e_shell_surface_parent_set(ec, parent_resource);
}
-static void
+static void
_e_xdg_shell_surface_cb_title_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, const char *title)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
if (ec->frame) e_comp_object_frame_title_set(ec->frame, title);
}
-static void
+static void
_e_xdg_shell_surface_cb_app_id_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, const char *id)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
EC_CHANGED(ec);
}
-static void
+static void
_e_xdg_shell_surface_cb_window_menu_show(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *seat_resource EINA_UNUSED, uint32_t serial EINA_UNUSED, int32_t x, int32_t y)
{
E_Client *ec;
e_int_client_menu_show(ec, x, y, 0, timestamp);
}
-static void
+static void
_e_xdg_shell_surface_cb_move(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial EINA_UNUSED)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
/* get compositor data from seat */
if (!(cdata = wl_resource_get_user_data(seat_resource)))
{
- wl_resource_post_error(seat_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(seat_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Comp_Data for Seat");
return;
}
break;
}
- e_comp_object_frame_xy_unadjust(ec->frame,
- wl_fixed_to_int(cdata->ptr.x) + ec->client.x,
- wl_fixed_to_int(cdata->ptr.y) + ec->client.y,
+ e_comp_object_frame_xy_unadjust(ec->frame,
+ wl_fixed_to_int(cdata->ptr.x) + ec->client.x,
+ wl_fixed_to_int(cdata->ptr.y) + ec->client.y,
&ev.canvas.x, &ev.canvas.y);
_e_shell_surface_mouse_down_helper(ec, &ev, EINA_TRUE);
}
-static void
+static void
_e_xdg_shell_surface_cb_resize(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial EINA_UNUSED, uint32_t edges)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
- if ((edges == 0) || (edges > 15) ||
+ if ((edges == 0) || (edges > 15) ||
((edges & 3) == 3) || ((edges & 12) == 12)) return;
if ((ec->maximized) || (ec->fullscreen)) return;
/* get compositor data from seat */
if (!(cdata = wl_resource_get_user_data(seat_resource)))
{
- wl_resource_post_error(seat_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(seat_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Comp_Data for Seat");
return;
}
break;
}
- e_comp_object_frame_xy_unadjust(ec->frame,
- wl_fixed_to_int(cdata->ptr.x) + ec->client.x,
- wl_fixed_to_int(cdata->ptr.y) + ec->client.y,
+ e_comp_object_frame_xy_unadjust(ec->frame,
+ wl_fixed_to_int(cdata->ptr.x) + ec->client.x,
+ wl_fixed_to_int(cdata->ptr.y) + ec->client.y,
&ev.canvas.x, &ev.canvas.y);
_e_shell_surface_mouse_down_helper(ec, &ev, EINA_FALSE);
}
-static void
+static void
_e_xdg_shell_surface_cb_ack_configure(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED, uint32_t serial EINA_UNUSED)
{
/* No-Op */
}
-static void
+static void
_e_xdg_shell_surface_cb_window_geometry_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED, int32_t x EINA_UNUSED, int32_t y EINA_UNUSED, int32_t w EINA_UNUSED, int32_t h EINA_UNUSED)
{
/* E_Client *ec; */
/* wl_resource_get_id(resource), x, y, w, h); */
}
-static void
+static void
_e_xdg_shell_surface_cb_maximized_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
- if (!ec->lock_user_maximize)
+ if (!ec->lock_user_maximize)
{
- e_client_maximize(ec, ((e_config->maximize_policy & E_MAXIMIZE_TYPE) |
+ e_client_maximize(ec, ((e_config->maximize_policy & E_MAXIMIZE_TYPE) |
E_MAXIMIZE_BOTH));
_e_xdg_shell_surface_configure_send(resource, 0, ec->w, ec->h);
}
}
-static void
+static void
_e_xdg_shell_surface_cb_maximized_unset(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
_e_xdg_shell_surface_configure_send(resource, 0, ec->w, ec->h);
}
-static void
+static void
_e_xdg_shell_surface_cb_fullscreen_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *output_resource EINA_UNUSED)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
e_client_fullscreen(ec, e_config->fullscreen_policy);
}
-static void
+static void
_e_xdg_shell_surface_cb_fullscreen_unset(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
e_client_unfullscreen(ec);
}
-static void
+static void
_e_xdg_shell_surface_cb_minimized_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
e_client_iconify(ec);
}
-static const struct xdg_surface_interface _e_xdg_surface_interface =
+static const struct xdg_surface_interface _e_xdg_surface_interface =
{
_e_xdg_shell_surface_cb_destroy,
_e_xdg_shell_surface_cb_parent_set,
_e_xdg_shell_surface_cb_minimized_set,
};
-static void
+static void
_e_xdg_shell_cb_unstable_version(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t version)
{
if (version > 1)
wl_resource_post_error(resource, 1, "XDG Version Not Implemented Yet");
}
-static void
+static void
_e_xdg_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
if (ec->parent)
{
- if ((ec->netwm.type == E_WINDOW_TYPE_MENU) ||
- (ec->netwm.type == E_WINDOW_TYPE_POPUP_MENU) ||
+ if ((ec->netwm.type == E_WINDOW_TYPE_MENU) ||
+ (ec->netwm.type == E_WINDOW_TYPE_POPUP_MENU) ||
(ec->netwm.type == E_WINDOW_TYPE_DROPDOWN_MENU))
{
x = ec->parent->client.x + ec->comp_data->popup.x;
/* TODO: ack configure ?? */
}
-static void
+static void
_e_xdg_shell_surface_ping(struct wl_resource *resource)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
xdg_shell_send_ping(ec->comp->wl_comp_data->shell_interface.xdg_shell, serial);
}
-static void
+static void
_e_xdg_shell_surface_map(struct wl_resource *resource)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
evas_object_show(ec->frame);
ec->comp_data->mapped = EINA_TRUE;
- /* FIXME: sometimes popup surfaces Do Not raise above their
+ /* FIXME: sometimes popup surfaces Do Not raise above their
* respective parents... */
/* if (ec->netwm.type == E_WINDOW_TYPE_POPUP_MENU) */
/* e_client_raise_latest_set(ec); */
}
}
-static void
+static void
_e_xdg_shell_surface_unmap(struct wl_resource *resource)
{
E_Client *ec;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
{
- wl_resource_post_error(resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Shell Surface");
return;
}
}
}
-static void
+static void
_e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resource EINA_UNUSED, uint32_t id, struct wl_resource *surface_resource)
{
E_Pixmap *ep;
/* get the pixmap from this surface so we can find the client */
if (!(ep = wl_resource_get_user_data(surface_resource)))
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Pixmap Set On Surface");
return;
}
/* no client found. not internal window. maybe external client app ? */
if (!(ec = e_client_new(NULL, ep, 0, 0)))
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Pixmap");
return;
}
/* get the client data */
if (!(cdata = ec->comp_data))
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Data For Client");
return;
}
/* check for existing shell surface */
if (cdata->shell.surface)
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"Client already has XDG shell surface");
return;
}
/* try to create a shell surface */
- if (!(cdata->shell.surface =
+ if (!(cdata->shell.surface =
wl_resource_create(client, &xdg_surface_interface, 1, id)))
{
ERR("Could not create xdg shell surface");
return;
}
- wl_resource_set_implementation(cdata->shell.surface,
- &_e_xdg_surface_interface, ec,
+ wl_resource_set_implementation(cdata->shell.surface,
+ &_e_xdg_surface_interface, ec,
_e_shell_surface_cb_destroy);
cdata->surface = surface_resource;
ec->comp_data->set_win_type = EINA_TRUE;
}
-static void
+static void
_e_xdg_shell_popup_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
_e_shell_surface_destroy(resource);
}
-static const struct xdg_popup_interface _e_xdg_popup_interface =
+static const struct xdg_popup_interface _e_xdg_popup_interface =
{
_e_xdg_shell_popup_cb_destroy,
};
-static void
+static void
_e_xdg_shell_cb_popup_get(struct wl_client *client, struct wl_resource *resource EINA_UNUSED, uint32_t id, struct wl_resource *surface_resource, struct wl_resource *parent_resource, struct wl_resource *seat_resource EINA_UNUSED, uint32_t serial EINA_UNUSED, int32_t x, int32_t y, uint32_t flags EINA_UNUSED)
{
E_Pixmap *ep;
/* get the pixmap from this surface so we can find the client */
if (!(ep = wl_resource_get_user_data(surface_resource)))
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Pixmap Set On Surface");
return;
}
/* no client found. create one */
if (!(ec = e_client_new(NULL, ep, 0, 1)))
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Client For Pixmap");
return;
}
/* get the client data */
if (!(cdata = ec->comp_data))
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"No Data For Client");
return;
}
/* check for existing shell surface */
if (cdata->shell.surface)
{
- wl_resource_post_error(surface_resource,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(surface_resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
"Client already has shell popup surface");
return;
}
{
wl_resource_post_error(surface_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
- "Popup requires a parent shell surface");
+ "Popup requires a parent shell surface");
return;
}
/* try to create a shell surface */
- if (!(cdata->shell.surface =
+ if (!(cdata->shell.surface =
wl_resource_create(client, &xdg_popup_interface, 1, id)))
{
ERR("Could not create xdg shell surface");
return;
}
- wl_resource_set_implementation(cdata->shell.surface,
+ wl_resource_set_implementation(cdata->shell.surface,
&_e_xdg_popup_interface, ec, NULL);
cdata->surface = surface_resource;
}
-static void
+static void
_e_xdg_shell_cb_pong(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t serial EINA_UNUSED)
{
E_Client *ec;
}
}
-static const struct wl_shell_interface _e_shell_interface =
+static const struct wl_shell_interface _e_shell_interface =
{
_e_shell_cb_shell_surface_get
};
-static const struct xdg_shell_interface _e_xdg_shell_interface =
+static const struct xdg_shell_interface _e_xdg_shell_interface =
{
_e_xdg_shell_cb_unstable_version,
_e_xdg_shell_cb_surface_get,
_e_xdg_shell_cb_pong
};
-static void
+static void
_e_xdg_shell_cb_unbind(struct wl_resource *resource)
{
E_Comp_Data *cdata;
cdata->shell_interface.xdg_shell = NULL;
}
-static int
+static int
_e_xdg_shell_cb_dispatch(const void *implementation EINA_UNUSED, void *target, uint32_t opcode, const struct wl_message *message EINA_UNUSED, union wl_argument *args)
{
E_Comp_Data *cdata;
if (opcode != 0)
{
- wl_resource_post_error(res, WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(res, WL_DISPLAY_ERROR_INVALID_OBJECT,
"Must call use_unstable_version first");
return 0;
}
if (args[0].i != XDG_SERVER_VERSION)
{
- wl_resource_post_error(res, WL_DISPLAY_ERROR_INVALID_OBJECT,
+ wl_resource_post_error(res, WL_DISPLAY_ERROR_INVALID_OBJECT,
"Incompatible versions. "
- "Server: %d, Client: %d",
+ "Server: %d, Client: %d",
XDG_SERVER_VERSION, args[0].i);
return 0;
}
- wl_resource_set_implementation(res, &_e_xdg_shell_interface, cdata,
+ wl_resource_set_implementation(res, &_e_xdg_shell_interface, cdata,
_e_xdg_shell_cb_unbind);
return 1;
}
-static void
+static void
_e_shell_cb_unbind(struct wl_resource *resource)
{
E_Comp_Data *cdata;
cdata->shell_interface.shell = NULL;
}
-static void
+static void
_e_shell_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
{
E_Comp_Data *cdata;
}
cdata->shell_interface.shell = res;
- wl_resource_set_implementation(res, &_e_shell_interface, cdata,
+ wl_resource_set_implementation(res, &_e_shell_interface, cdata,
_e_shell_cb_unbind);
}
-static void
+static void
_e_xdg_shell_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
{
E_Comp_Data *cdata;
if (!(cdata = comp->wl_comp_data)) return NULL;
/* try to create global shell interface */
- if (!wl_global_create(cdata->wl.disp, &wl_shell_interface, 1,
+ if (!wl_global_create(cdata->wl.disp, &wl_shell_interface, 1,
cdata, _e_shell_cb_bind))
{
ERR("Could not create shell global: %m");
}
/* try to create global xdg_shell interface */
- if (!wl_global_create(cdata->wl.disp, &xdg_shell_interface, 1,
+ if (!wl_global_create(cdata->wl.disp, &xdg_shell_interface, 1,
cdata, _e_xdg_shell_cb_bind))
{
ERR("Could not create xdg_shell global: %m");
return m;
}
-EAPI int
+EAPI int
e_modapi_shutdown(E_Module *m EINA_UNUSED)
{
return 1;