forked from enlightenment/efl
temporary smart stacking workaround until we fix it properly with internal
sub-object lists SVN revision: 16367
This commit is contained in:
parent
e9ada42ee1
commit
8b2d57a76c
|
@ -8,6 +8,8 @@ static void _edje_smart_raise(Evas_Object * obj);
|
||||||
static void _edje_smart_lower(Evas_Object * obj);
|
static void _edje_smart_lower(Evas_Object * obj);
|
||||||
static void _edje_smart_stack_above(Evas_Object * obj, Evas_Object * above);
|
static void _edje_smart_stack_above(Evas_Object * obj, Evas_Object * above);
|
||||||
static void _edje_smart_stack_below(Evas_Object * obj, Evas_Object * below);
|
static void _edje_smart_stack_below(Evas_Object * obj, Evas_Object * below);
|
||||||
|
static Evas_Object *_edje_smart_above_get(Evas_Object * obj);
|
||||||
|
static Evas_Object *_edje_smart_below_get(Evas_Object * obj);
|
||||||
static void _edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y);
|
static void _edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y);
|
||||||
static void _edje_smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h);
|
static void _edje_smart_resize(Evas_Object * obj, Evas_Coord w, Evas_Coord h);
|
||||||
static void _edje_smart_show(Evas_Object * obj);
|
static void _edje_smart_show(Evas_Object * obj);
|
||||||
|
@ -50,6 +52,8 @@ edje_object_add(Evas *evas)
|
||||||
_edje_smart_clip_set,
|
_edje_smart_clip_set,
|
||||||
_edje_smart_clip_unset,
|
_edje_smart_clip_unset,
|
||||||
NULL);
|
NULL);
|
||||||
|
evas_smart_above_get_set(_edje_smart, _edje_smart_above_get);
|
||||||
|
evas_smart_below_get_set(_edje_smart, _edje_smart_below_get);
|
||||||
}
|
}
|
||||||
return evas_object_smart_add(evas, _edje_smart);
|
return evas_object_smart_add(evas, _edje_smart);
|
||||||
}
|
}
|
||||||
|
@ -243,6 +247,42 @@ _edje_smart_stack_below(Evas_Object * obj, Evas_Object * below)
|
||||||
_edje_emit(ed, "stack_below", "");
|
_edje_emit(ed, "stack_below", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_edje_smart_above_get(Evas_Object * obj)
|
||||||
|
{
|
||||||
|
Edje *ed;
|
||||||
|
|
||||||
|
ed = evas_object_smart_data_get(obj);
|
||||||
|
if (!ed) return obj;
|
||||||
|
if (ed->parts)
|
||||||
|
{
|
||||||
|
Edje_Real_Part *ep;
|
||||||
|
|
||||||
|
ep = evas_list_last(ed->parts)->data;
|
||||||
|
if (ep->swallowed_object)
|
||||||
|
return ep->swallowed_object;
|
||||||
|
return ep->object;
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_edje_smart_below_get(Evas_Object * obj)
|
||||||
|
{
|
||||||
|
Edje *ed;
|
||||||
|
|
||||||
|
ed = evas_object_smart_data_get(obj);
|
||||||
|
if (!ed) return obj;
|
||||||
|
if (ed->parts)
|
||||||
|
{
|
||||||
|
Edje_Real_Part *ep;
|
||||||
|
|
||||||
|
ep = ed->parts->data;
|
||||||
|
return ep->object;
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
|
_edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
|
||||||
{
|
{
|
||||||
|
|
|
@ -95,6 +95,8 @@ struct _Evas_Smart_Class /** a smart object class */
|
||||||
void (*lower) (Evas_Object *o);
|
void (*lower) (Evas_Object *o);
|
||||||
void (*stack_above) (Evas_Object *o, Evas_Object *above);
|
void (*stack_above) (Evas_Object *o, Evas_Object *above);
|
||||||
void (*stack_below) (Evas_Object *o, Evas_Object *below);
|
void (*stack_below) (Evas_Object *o, Evas_Object *below);
|
||||||
|
Evas_Object *(*above_get) (Evas_Object *o);
|
||||||
|
Evas_Object *(*below_get) (Evas_Object *o);
|
||||||
void (*move) (Evas_Object *o, Evas_Coord x, Evas_Coord y);
|
void (*move) (Evas_Object *o, Evas_Coord x, Evas_Coord y);
|
||||||
void (*resize) (Evas_Object *o, Evas_Coord w, Evas_Coord h);
|
void (*resize) (Evas_Object *o, Evas_Coord w, Evas_Coord h);
|
||||||
void (*show) (Evas_Object *o);
|
void (*show) (Evas_Object *o);
|
||||||
|
@ -558,6 +560,8 @@ extern "C" {
|
||||||
|
|
||||||
EAPI Evas_Smart *evas_smart_new (const char *name, void (*func_add) (Evas_Object *obj), void (*func_del) (Evas_Object *obj), void (*func_layer_set) (Evas_Object *obj, int l), void (*func_raise) (Evas_Object *obj), void (*func_lower) (Evas_Object *obj), void (*func_stack_above) (Evas_Object *obj, Evas_Object *above), void (*func_stack_below) (Evas_Object *obj, Evas_Object *below), void (*func_move) (Evas_Object *obj, Evas_Coord x, Evas_Coord y), void (*func_resize) (Evas_Object *obj, Evas_Coord w, Evas_Coord h), void (*func_show) (Evas_Object *obj), void (*func_hide) (Evas_Object *obj), void (*func_color_set) (Evas_Object *obj, int r, int g, int b, int a), void (*func_clip_set) (Evas_Object *obj, Evas_Object *clip), void (*func_clip_unset) (Evas_Object *obj), const void *data);
|
EAPI Evas_Smart *evas_smart_new (const char *name, void (*func_add) (Evas_Object *obj), void (*func_del) (Evas_Object *obj), void (*func_layer_set) (Evas_Object *obj, int l), void (*func_raise) (Evas_Object *obj), void (*func_lower) (Evas_Object *obj), void (*func_stack_above) (Evas_Object *obj, Evas_Object *above), void (*func_stack_below) (Evas_Object *obj, Evas_Object *below), void (*func_move) (Evas_Object *obj, Evas_Coord x, Evas_Coord y), void (*func_resize) (Evas_Object *obj, Evas_Coord w, Evas_Coord h), void (*func_show) (Evas_Object *obj), void (*func_hide) (Evas_Object *obj), void (*func_color_set) (Evas_Object *obj, int r, int g, int b, int a), void (*func_clip_set) (Evas_Object *obj, Evas_Object *clip), void (*func_clip_unset) (Evas_Object *obj), const void *data);
|
||||||
EAPI void evas_smart_free (Evas_Smart *s);
|
EAPI void evas_smart_free (Evas_Smart *s);
|
||||||
|
EAPI void evas_smart_above_get_set (Evas_Smart *s, Evas_Object *(*func_above_get) (Evas_Object *o));
|
||||||
|
EAPI void evas_smart_below_get_set (Evas_Smart *s, Evas_Object *(*func_below_get) (Evas_Object *o));
|
||||||
EAPI Evas_Smart *evas_smart_class_new (Evas_Smart_Class *sc);
|
EAPI Evas_Smart *evas_smart_class_new (Evas_Smart_Class *sc);
|
||||||
EAPI Evas_Smart_Class *evas_smart_class_get (Evas_Smart *s);
|
EAPI Evas_Smart_Class *evas_smart_class_get (Evas_Smart *s);
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,38 @@ evas_smart_free(Evas_Smart *s)
|
||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be documented.
|
||||||
|
*
|
||||||
|
* FIXME: To be fixed.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_smart_above_get_set(Evas_Smart *s, Evas_Object *(*func_above_get) (Evas_Object *o))
|
||||||
|
{
|
||||||
|
Evas_Smart_Class *sc;
|
||||||
|
|
||||||
|
if (!(sc = evas_smart_class_get(s)))
|
||||||
|
return;
|
||||||
|
sc->above_get = func_above_get;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To be documented.
|
||||||
|
*
|
||||||
|
* FIXME: To be fixed.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
evas_smart_below_get_set(Evas_Smart *s, Evas_Object *(*func_below_get) (Evas_Object *o))
|
||||||
|
{
|
||||||
|
Evas_Smart_Class *sc;
|
||||||
|
|
||||||
|
if (!(sc = evas_smart_class_get(s)))
|
||||||
|
return;
|
||||||
|
sc->below_get = func_below_get;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To be documented.
|
* To be documented.
|
||||||
*
|
*
|
||||||
|
|
|
@ -53,11 +53,6 @@ evas_object_raise(Evas_Object *obj)
|
||||||
return;
|
return;
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
if (evas_object_intercept_call_raise(obj)) return;
|
if (evas_object_intercept_call_raise(obj)) return;
|
||||||
if (obj->smart.smart)
|
|
||||||
{
|
|
||||||
if (obj->smart.smart->smart_class->raise)
|
|
||||||
obj->smart.smart->smart_class->raise(obj);
|
|
||||||
}
|
|
||||||
if (!(((Evas_Object_List *)obj)->next))
|
if (!(((Evas_Object_List *)obj)->next))
|
||||||
{
|
{
|
||||||
evas_object_inform_call_restack(obj);
|
evas_object_inform_call_restack(obj);
|
||||||
|
@ -65,6 +60,11 @@ evas_object_raise(Evas_Object *obj)
|
||||||
}
|
}
|
||||||
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
||||||
obj->layer->objects = evas_object_list_append(obj->layer->objects, obj);
|
obj->layer->objects = evas_object_list_append(obj->layer->objects, obj);
|
||||||
|
if (obj->smart.smart)
|
||||||
|
{
|
||||||
|
if (obj->smart.smart->smart_class->raise)
|
||||||
|
obj->smart.smart->smart_class->raise(obj);
|
||||||
|
}
|
||||||
if (obj->clip.clipees)
|
if (obj->clip.clipees)
|
||||||
{
|
{
|
||||||
evas_object_inform_call_restack(obj);
|
evas_object_inform_call_restack(obj);
|
||||||
|
@ -162,6 +162,11 @@ evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
|
||||||
return;
|
return;
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
if (evas_object_intercept_call_stack_above(obj, above)) return;
|
if (evas_object_intercept_call_stack_above(obj, above)) return;
|
||||||
|
if (above->smart.smart)
|
||||||
|
{
|
||||||
|
if (above->smart.smart->smart_class->above_get)
|
||||||
|
above = above->smart.smart->smart_class->above_get(above);
|
||||||
|
}
|
||||||
if (obj->smart.smart)
|
if (obj->smart.smart)
|
||||||
{
|
{
|
||||||
if (obj->smart.smart->smart_class->stack_above)
|
if (obj->smart.smart->smart_class->stack_above)
|
||||||
|
@ -223,6 +228,11 @@ evas_object_stack_below(Evas_Object *obj, Evas_Object *below)
|
||||||
return;
|
return;
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
if (evas_object_intercept_call_stack_below(obj, below)) return;
|
if (evas_object_intercept_call_stack_below(obj, below)) return;
|
||||||
|
if (below->smart.smart)
|
||||||
|
{
|
||||||
|
if (below->smart.smart->smart_class->below_get)
|
||||||
|
below = below->smart.smart->smart_class->below_get(below);
|
||||||
|
}
|
||||||
if (obj->smart.smart)
|
if (obj->smart.smart)
|
||||||
{
|
{
|
||||||
if (obj->smart.smart->smart_class->stack_below)
|
if (obj->smart.smart->smart_class->stack_below)
|
||||||
|
|
Loading…
Reference in New Issue