static struct wl_global *global = NULL;
static Eina_List *hooks = NULL;
+static E_Comp_Wl_Subsurf_Data *_e_comp_wl_subsurface_data_get(E_Client *ec);
+
static Eina_Bool _e_comp_wl_subsurface_circular_reference_check(E_Client *ec, E_Client *parent);
static void _e_comp_wl_subsurface_invalid_parent_handle(E_Client *ec, struct wl_resource *resource);
static void _e_comp_wl_subsurface_parent_commit(E_Client *ec, Eina_Bool parent_synchronized);
{
E_Client *topmost;
- if (ec->comp_data->sub.data)
+ if (_e_comp_wl_subsurface_data_get(ec))
{
topmost = e_comp_wl_topmost_parent_get(ec);
if (!topmost || e_object_is_del(E_OBJECT(topmost)) || !topmost->comp_data) return;
Eina_Rectangle *rect;
if (!(cdata = ec->comp_data)) return;
- if (!(sdata = cdata->sub.data)) return;
+
+ sdata = _e_comp_wl_subsurface_data_get(ec);
+ if (!sdata) return;
DBG("Subsurface Commit to Cache");
static void
_e_comp_wl_subsurface_commit_from_cache(E_Client *ec)
{
- E_Comp_Client_Data *cdata;
E_Comp_Wl_Subsurf_Data *sdata;
- if (!(cdata = ec->comp_data)) return;
- if (!(sdata = cdata->sub.data)) return;
+ sdata = _e_comp_wl_subsurface_data_get(ec);
+ if (!sdata) return;
DBG("Subsurface Commit from Cache");
E_Client *subc;
Eina_List *l;
- sdata = ec->comp_data->sub.data;
+ sdata = _e_comp_wl_subsurface_data_get(ec);
if (sdata->cached.has_data)
_e_comp_wl_subsurface_commit_from_cache(ec);
E_Comp_Wl_Subsurf_Data *sdata;
if (!ec || e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
- if (!(sdata = ec->comp_data->sub.data)) return;
+
+ sdata = _e_comp_wl_subsurface_data_get(ec);
+ if (!sdata) return;
if (!(parent = sdata->parent)) return;
if (sdata->position.set)
ec = wl_resource_get_user_data(resource);
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
- if (!(sdata = ec->comp_data->sub.data)) return;
+
+ sdata = _e_comp_wl_subsurface_data_get(ec);
+ if (!sdata) return;
sdata->position.x = x;
sdata->position.y = y;
ec = wl_resource_get_user_data(resource);
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
- if (!(sdata = ec->comp_data->sub.data)) return;
+
+ sdata = _e_comp_wl_subsurface_data_get(ec);
+ if (!sdata) return;
sdata->synchronized = EINA_TRUE;
}
ec = wl_resource_get_user_data(resource);
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
- if (!(sdata = ec->comp_data->sub.data)) return;
+
+ sdata = _e_comp_wl_subsurface_data_get(ec);
+ if (!sdata) return;
if (sdata->synchronized)
{
if (!sdata->parent->comp_data) return EINA_FALSE;
if (e_object_is_del(E_OBJECT(sdata->parent))) return EINA_FALSE;
- sdata = sdata->parent->comp_data->sub.data;
+ sdata = _e_comp_wl_subsurface_data_get(sdata->parent);
}
return EINA_FALSE;
/* check for valid subcompositor data */
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return EINA_FALSE;
- if (!(sdata = ec->comp_data->sub.data)) return EINA_FALSE;
+
+ sdata = _e_comp_wl_subsurface_data_get(ec);
+ if (!sdata) return EINA_FALSE;
if (_e_comp_wl_subsurface_synchronized_get(sdata))
_e_comp_wl_subsurface_commit_to_cache(ec);
EINTERN Eina_Bool
e_comp_wl_subsurface_can_show(E_Client *ec)
{
- E_Comp_Wl_Subsurf_Data *sdata = ec->comp_data->sub.data;
+ E_Comp_Wl_Subsurf_Data *sdata;
E_Client *invisible_parent;
E_Client *topmost;
/* if it's not subsurface */
- if (!sdata)
- return EINA_FALSE;
+ sdata = _e_comp_wl_subsurface_data_get(ec);
+ if (!sdata) return EINA_FALSE;
invisible_parent = _e_comp_wl_subsurface_invisible_parent_get(ec);
topmost = e_comp_wl_topmost_parent_get(ec);
parent->comp_data->sub.below_list_pending =
eina_list_remove(parent->comp_data->sub.below_list_pending, subc);
}
+
+static E_Comp_Wl_Subsurf_Data *
+_e_comp_wl_subsurface_data_get(E_Client *ec)
+{
+ return (ec->comp_data) ? (ec->comp_data->sub.data) : NULL;
+}