#include "e_comp_wl_subsurface_intern.h"
#include "e_comp_wl_intern.h"
#include "e_comp_wl_viewport_intern.h"
-#include "e_compositor_intern.h"
#include "e_pixmap_intern.h"
#include "e_client_video_intern.h"
#include "e_client_intern.h"
e_comp_wl_subsurface_check(E_Client *ec)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
-
- return !!e_subsurface_try_from_ec(ec);
+ return ec->comp_data ? !!ec->comp_data->sub.data : EINA_FALSE;
}
EINTERN E_Client *
e_comp_wl_subsurface_parent_get(E_Client *ec)
{
- E_Surface *surface;
- E_Subsurface *subsurface;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
-
- surface = e_surface_try_from_ec(ec);
- EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
-
- subsurface = e_subsurface_try_from_surface(surface);
- if (!subsurface)
- return NULL;
-
- surface = e_subsurface_parent_try_get(subsurface);
- if (!surface)
- return NULL;
-
- return e_surface_ec_get(surface);
+ /* Must be called with valid comp_data. */
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, NULL);
+ return ec->comp_data->sub.data ? ec->comp_data->sub.data->parent : NULL;
}
EINTERN Eina_Bool
{
E_Subsurface *subsurface;
- assert(ec->comp_data && ec->comp_data->sub.data);
+ assert(ec->comp_data->sub.data);
return wl_container_of(ec->comp_data->sub.data, subsurface, base);
}
-EINTERN E_Subsurface *
-e_subsurface_try_from_ec(E_Client *ec)
-{
- if ((!ec->comp_data) || (!ec->comp_data->sub.data))
- return NULL;
-
- return e_subsurface_from_ec(ec);
-}
-
EINTERN Eina_Bool
e_subsurface_position_set(E_Subsurface *subsurface, int x, int y)
{
E_Subsurface *e_subsurface_from_resource(struct wl_resource *resource);
E_Subsurface *e_subsurface_try_from_surface(E_Surface *surface);
E_Subsurface *e_subsurface_from_ec(E_Client *ec);
-E_Subsurface *e_subsurface_try_from_ec(E_Client *ec);
Eina_Bool e_subsurface_position_set(E_Subsurface *subsurface, int x, int y);
void e_subsurface_destroy_listener_add(E_Subsurface *subsurface, struct wl_listener *listener);
void e_subsurface_reposition_listener_add(E_Subsurface *subsurface, struct wl_listener *listener);