_surface_init(E_Desktop_Surface *surface, E_Surface *e_surface, E_Desktop_Surface_Interface *iface)
{
surface->iface = iface;
+
+ surface->ec = e_surface_ec_get(e_surface);
+ assert(surface->ec);
+
surface->surface = e_surface;
surface->surface_destroy.notify = _surface_cb_surface_destroy;
e_surface_destroy_listener_add(e_surface, &surface->surface_destroy);
if (!surface->surface)
return;
- e_shell_e_client_destroy(e_surface_ec_get(surface->surface));
+ e_shell_e_client_destroy(surface->ec);
wl_list_remove(&surface->surface_destroy.link);
surface->iface = NULL;
surface->surface = NULL;
if (surface->iface->configure)
surface->iface->configure(surface->iface, x, y, width, height);
else
- e_client_util_move_resize_without_frame(e_surface_ec_get(surface->surface), x, y, width, height);
+ e_client_util_move_resize_without_frame(surface->ec, x, y, width, height);
}
EINTERN void
if (surface->iface->map)
surface->iface->map(surface->iface);
else
- e_shell_e_client_map(e_surface_ec_get(surface->surface));
+ e_shell_e_client_map(surface->ec);
}
EINTERN void
if (surface->iface->unmap)
surface->iface->unmap(surface->iface);
else
- e_shell_e_client_unmap(e_surface_ec_get(surface->surface));
+ e_shell_e_client_unmap(surface->ec);
}
static void
_toplevel_init(E_Desktop_Toplevel *toplevel, struct wl_resource *shell_surface_resource)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
-
- e_shell_e_client_shsurface_assign(ec, shell_surface_resource, NULL);
- e_shell_e_client_toplevel_set(ec);
+ e_shell_e_client_shsurface_assign(toplevel->surface.ec, shell_surface_resource, NULL);
+ e_shell_e_client_toplevel_set(toplevel->surface.ec);
}
EINTERN void
EINTERN void
e_desktop_toplevel_title_set(E_Desktop_Toplevel *toplevel, const char *title)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
-
- e_shell_e_client_name_title_set(ec, title, title);
+ e_shell_e_client_name_title_set(toplevel->surface.ec, title, title);
}
EINTERN void
e_desktop_toplevel_app_id_set(E_Desktop_Toplevel *toplevel, const char *app_id)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
-
- e_shell_e_client_app_id_set(ec, app_id);
+ e_shell_e_client_app_id_set(toplevel->surface.ec, app_id);
}
EINTERN void
e_desktop_toplevel_parent_set(E_Desktop_Toplevel *toplevel, E_Desktop_Toplevel *parent)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
E_Client *epc = NULL;
if (parent)
- epc = e_surface_ec_get(parent->surface.surface);
+ epc = parent->surface.ec;
- e_client_parent_set(ec, epc);
- EC_CHANGED(ec);
+ e_client_parent_set(toplevel->surface.ec, epc);
+ EC_CHANGED(toplevel->surface.ec);
}
EINTERN void
e_desktop_toplevel_interactive_move_begin(E_Desktop_Toplevel *toplevel, struct wl_resource *seat_resource)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
-
- e_shell_e_client_interactive_move(ec, seat_resource);
+ e_shell_e_client_interactive_move(toplevel->surface.ec, seat_resource);
}
EINTERN void
e_desktop_toplevel_interactive_resize_begin(E_Desktop_Toplevel *toplevel, struct wl_resource *toplevel_resource, struct wl_resource *seat_resource, int32_t edges)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
-
- e_shell_e_client_interactive_resize(ec, toplevel_resource, seat_resource, edges);
+ e_shell_e_client_interactive_resize(toplevel->surface.ec, toplevel_resource, seat_resource, edges);
}
EINTERN void
e_desktop_toplevel_fullscreen_request(E_Desktop_Toplevel *toplevel)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
+ E_Client *ec = toplevel->surface.ec;
if (ec->lock_user_fullscreen)
return;
EINTERN void
e_desktop_toplevel_unfullscreen_request(E_Desktop_Toplevel *toplevel)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
+ E_Client *ec = toplevel->surface.ec;
if (ec->lock_user_fullscreen)
return;
EINTERN void
e_desktop_toplevel_maximize_request(E_Desktop_Toplevel *toplevel)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
+ E_Client *ec = toplevel->surface.ec;
E_Maximize max = ec->maximize_type | E_MAXIMIZE_BOTH;
if (ec->lock_user_maximize)
EINTERN void
e_desktop_toplevel_unmaximize_request(E_Desktop_Toplevel *toplevel)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
+ E_Client *ec = toplevel->surface.ec;
e_client_layout_apply(ec, EINA_FALSE);
EINTERN void
e_desktop_toplevel_minimize_request(E_Desktop_Toplevel *toplevel)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
+ E_Client *ec = toplevel->surface.ec;
if (ec->lock_client_iconify)
return;
EINTERN void
e_desktop_toplevel_window_geometry_set(E_Desktop_Toplevel *toplevel, int x, int y, int width, int height)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
-
- EINA_RECTANGLE_SET(&ec->comp_data->shell.window, x, y, width, height);
+ EINA_RECTANGLE_SET(&toplevel->surface.ec->comp_data->shell.window, x, y, width, height);
}
EINTERN void
e_desktop_toplevel_min_size_set(E_Desktop_Toplevel *toplevel, int width, int height)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
+ E_Client *ec = toplevel->surface.ec;
if (ec->lock_client_size)
return;
EINTERN void
e_desktop_toplevel_max_size_set(E_Desktop_Toplevel *toplevel, int width, int height)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
+ E_Client *ec = toplevel->surface.ec;
if (ec->lock_client_size)
return;
EINTERN bool
e_desktop_toplevel_is_fullscreen(E_Desktop_Toplevel *toplevel)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
-
- return ec->fullscreen;
+ return toplevel->surface.ec->fullscreen;
}
EINTERN bool
e_desktop_toplevel_is_maximized(E_Desktop_Toplevel *toplevel)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
-
- return !!ec->maximized;
+ return !!toplevel->surface.ec->maximized;
}
EINTERN bool
e_desktop_toplevel_is_activated(E_Desktop_Toplevel *toplevel)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
-
- return ec == e_client_focused_get();
+ return toplevel->surface.ec == e_client_focused_get();
}
EINTERN void
e_desktop_toplevel_fullscreen_size_get(E_Desktop_Toplevel *toplevel, int32_t *width, int32_t *height)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
-
- e_client_base_output_resolution_useful_geometry_get(ec, NULL, NULL, width, height);
+ e_client_base_output_resolution_useful_geometry_get(toplevel->surface.ec, NULL, NULL, width, height);
}
EINTERN void
e_desktop_toplevel_maximized_size_get(E_Desktop_Toplevel *toplevel, int32_t *width, int32_t *height)
{
- E_Client *ec = e_surface_ec_get(toplevel->surface.surface);
-
- e_client_maximized_geometry_get(ec, NULL, NULL, width, height);
+ e_client_maximized_geometry_get(toplevel->surface.ec, NULL, NULL, width, height);
}
EINTERN E_Client *
e_desktop_toplevel_ec_get(E_Desktop_Toplevel *toplevel)
{
- return e_surface_ec_get(toplevel->surface.surface);
+ return toplevel->surface.ec;
}