static void _e_surface_cb_new_subsurface(struct wl_listener *listener, void *data);
static E_Subsurface *_e_subsurface_create(struct ds_subsurface *ds_subsurface, E_Surface *parent_surface);
-static E_Subsurface *_e_subsurface_from_surface(E_Surface *surface);
-static E_Subsurface *_e_subsurface_from_resource(struct wl_resource *resource);
-static E_Subsurface *_e_subsurface_from_ds_subsurface(struct ds_subsurface *ds_subsurface);
+static E_Subsurface *_e_subsurface_try_from_surface(E_Surface *surface);
+static E_Subsurface *_e_subsurface_try_from_resource(struct wl_resource *resource);
+static E_Subsurface *_e_subsurface_try_from_ds_subsurface(struct ds_subsurface *ds_subsurface);
static void _e_subsurface_destroy(E_Subsurface *sub);
static void _e_subsurface_commit(E_Subsurface *sub);
static void _e_subsurface_place_below_parent(E_Subsurface *sub);
{
ds_subsurface_create(factory_resource, surface->ds_surface, parent->ds_surface, id);
- return _e_subsurface_from_surface(surface);
+ return _e_subsurface_try_from_surface(surface);
}
EINTERN E_Subsurface *
{
E_Subsurface *sub;
- sub = _e_subsurface_from_resource(subsurface_resource);
+ sub = _e_subsurface_try_from_resource(subsurface_resource);
if (!sub)
{
INF("The given subsurface resource(%p) seems inert.", subsurface_resource);
E_Subsurface *sub;
E_Comp_Wl_Client_Data *epc_cdata;
- sub = _e_subsurface_from_resource(subsurface_resource);
+ sub = _e_subsurface_try_from_resource(subsurface_resource);
if (!sub)
{
INF("The given subsurface resource(%p) seems inert.", subsurface_resource);
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return EINA_FALSE;
surface = e_surface_from_ec(ec);
- sub = _e_subsurface_from_surface(surface);
+ sub = _e_subsurface_try_from_surface(surface);
if (!sub)
return EINA_FALSE;
surface->base.pending.buffer_viewport = *vp;
- sub = _e_subsurface_from_surface(surface);
+ sub = _e_subsurface_try_from_surface(surface);
if (sub)
sub->base.cached.buffer_viewport = *vp;
surface->base.pending.buffer_viewport = *vp;
- sub = _e_subsurface_from_surface(surface);
+ sub = _e_subsurface_try_from_surface(surface);
if (sub)
sub->base.cached.buffer_viewport = *vp;
surface->base.pending.buffer_viewport = *vp;
- sub = _e_subsurface_from_surface(surface);
+ sub = _e_subsurface_try_from_surface(surface);
if (sub)
sub->base.cached.buffer_viewport = *vp;
}
EINTERN E_Subsurface *
-e_subsurface_from_surface(E_Surface *surface)
+e_subsurface_try_from_surface(E_Surface *surface)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
- return _e_subsurface_from_surface(surface);
+ return _e_subsurface_try_from_surface(surface);
}
EINTERN E_Subsurface *
E_Surface *iter = surface;
E_Subsurface *sub;
- while ((sub = _e_subsurface_from_surface(iter)))
+ while ((sub = _e_subsurface_try_from_surface(iter)))
iter = _e_surface_from_ds_surface(sub->ds_subsurface->parent);
return iter;
if (ds_surface->buffer)
{
- buffer = e_comp_wl_buffer_get(ds_surface->buffer);
+ buffer = e_comp_wl_buffer_try_get(ds_surface->buffer);
if (buffer)
_e_surface_buffer_video_content_type_check_and_set(surface, buffer);
}
&ds_surface->pending.subsurfaces_above,
pending.link)
{
- sub = _e_subsurface_from_ds_subsurface(ds_subsurface);
+ sub = _e_subsurface_try_from_ds_subsurface(ds_subsurface);
surface->base.sub.list_pending =
eina_list_append(surface->base.sub.list_pending, sub->surface->ec);
&ds_surface->pending.subsurfaces_below,
pending.link)
{
- sub = _e_subsurface_from_ds_subsurface(ds_subsurface);
+ sub = _e_subsurface_try_from_ds_subsurface(ds_subsurface);
surface->base.sub.below_list_pending =
eina_list_append(surface->base.sub.below_list_pending, sub->surface->ec);
E_Subsurface *subsurface;
surface = wl_container_of(listener, surface, precommit_to_cache);
- subsurface = _e_subsurface_from_surface(surface);
+ subsurface = _e_subsurface_try_from_surface(surface);
wl_signal_emit(&surface->events.precommit_to_cache, surface);
E_Subsurface *subsurface;
surface = wl_container_of(listener, surface, precommit_from_cache);
- subsurface = _e_subsurface_from_surface(surface);
+ subsurface = _e_subsurface_try_from_surface(surface);
wl_signal_emit(&surface->events.precommit_from_cache, surface);
}
static E_Subsurface *
-_e_subsurface_from_ds_subsurface(struct ds_subsurface *ds_subsurface)
+_e_subsurface_try_from_ds_subsurface(struct ds_subsurface *ds_subsurface)
{
struct wl_listener *listener;
E_Subsurface *sub = NULL;
}
static E_Subsurface *
-_e_subsurface_from_surface(E_Surface *surface)
+_e_subsurface_try_from_surface(E_Surface *surface)
{
struct ds_subsurface *ds_subsurface;
if (!ds_subsurface)
return NULL;
- return _e_subsurface_from_ds_subsurface(ds_subsurface);
+ return _e_subsurface_try_from_ds_subsurface(ds_subsurface);
}
static E_Subsurface *
-_e_subsurface_from_resource(struct wl_resource *resource)
+_e_subsurface_try_from_resource(struct wl_resource *resource)
{
struct ds_subsurface *ds_subsurface;
if (!ds_subsurface)
return NULL;
- return _e_subsurface_from_ds_subsurface(ds_subsurface);
+ return _e_subsurface_try_from_ds_subsurface(ds_subsurface);
}
static Eina_Bool
{
E_Subsurface *subsurface;
- subsurface = _e_subsurface_from_resource(resource);
+ subsurface = _e_subsurface_try_from_resource(resource);
assert(subsurface);
return subsurface;
}
EINTERN E_Surface *
-e_subsurface_parent_get(E_Subsurface *subsurface)
+e_subsurface_parent_try_get(E_Subsurface *subsurface)
{
return subsurface->parent;
}
E_Subsurface *e_subsurface_create(struct wl_resource *factory_resource, uint32_t id, E_Surface *surface, E_Surface *parent);
E_Subsurface *e_subsurface_from_resource(struct wl_resource *resource);
-E_Subsurface *e_subsurface_from_surface(E_Surface *surface);
+E_Subsurface *e_subsurface_try_from_surface(E_Surface *surface);
E_Subsurface *e_subsurface_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_stand_alone_mode_unset(E_Subsurface *sub);
void e_subsurface_coord_get(E_Subsurface *subsurface, int *x, int *y);
E_Surface *e_subsurface_surface_get(E_Subsurface *subsurface);
-E_Surface *e_subsurface_parent_get(E_Subsurface *subsurface);
+E_Surface *e_subsurface_parent_try_get(E_Subsurface *subsurface);
void e_subsurface_view_position_set(E_Subsurface *subsurface, int x, int y);
void e_subsurface_view_reposition(E_Subsurface *subsurface);
static void
_viewport_name_init(E_Video_Viewport *viewport)
{
- E_Surface *parent_surface = e_subsurface_parent_get(viewport->subsurface);
+ E_Surface *parent_surface = e_subsurface_parent_try_get(viewport->subsurface);
E_Client *parent_ec = e_surface_ec_get(parent_surface);
char name[256];
viewport->reposition.notify = _viewport_cb_reposition;
e_subsurface_reposition_listener_add(viewport->subsurface, &viewport->reposition);
- parent_surface = e_subsurface_parent_get(viewport->subsurface);
+ parent_surface = e_subsurface_parent_try_get(viewport->subsurface);
viewport->parent_map.notify = _viewport_cb_parent_map;
e_surface_map_listener_add(parent_surface, &viewport->parent_map);
if (surface->role == E_VIDEO_SURFACE_ROLE_SUBSURFACE)
{
- ec = e_surface_ec_get(e_subsurface_parent_get(surface->subsurface));
+ ec = e_surface_ec_get(e_subsurface_parent_try_get(surface->subsurface));
snprintf(suffix, sizeof(suffix), "VS::Subsurface(Parent 0x%08zx)", e_log_client_util_win_get(ec));
}
else if (surface->role == E_VIDEO_SURFACE_ROLE_VIEWPORT_SOURCE)
fprintf(fp, "\ttransform: %s\n", _viewport_transform_to_str(viewport->current.transform));
fprintf(fp, "\tmap: %s\n", viewport->current.map ? "true" : "false");
- ec = e_surface_ec_get(e_subsurface_parent_get(viewport->subsurface));
+ ec = e_surface_ec_get(e_subsurface_parent_try_get(viewport->subsurface));
name = (char *)e_client_netwm_name_get(ec);
if (!name)
name = (char *)e_client_icccm_title_get(ec);
evas_object_layer_set(viewport->border, evas_object_layer_get(ec->frame));
evas_object_stack_above(viewport->border, ec->frame);
- parent_ec = e_surface_ec_get(e_subsurface_parent_get(viewport->subsurface));
+ parent_ec = e_surface_ec_get(e_subsurface_parent_try_get(viewport->subsurface));
if (evas_object_visible_get(parent_ec->frame))
evas_object_show(viewport->border);
else
ec = e_surface_ec_get(e_subsurface_surface_get(viewport->subsurface));
- parent_surface = e_subsurface_parent_get(viewport->subsurface);
+ parent_surface = e_subsurface_parent_try_get(viewport->subsurface);
if (parent_surface)
{
parent_ec = e_surface_ec_get(parent_surface);