2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_common.h"
|
|
|
|
#include "evas_private.h"
|
|
|
|
|
|
|
|
static Evas_Object *evas_object_above_get_internal(Evas_Object *obj);
|
|
|
|
static Evas_Object *evas_object_below_get_internal(Evas_Object *obj);
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
evas_object_above_get_internal(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
if (((Evas_Object_List *)obj)->next)
|
|
|
|
return (Evas_Object *)(((Evas_Object_List *)obj)->next);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (((Evas_Object_List *)(((Evas_Object *)obj)->layer))->next)
|
|
|
|
{
|
|
|
|
Evas_Layer *l;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
l = (Evas_Layer *)(((Evas_Object_List *)(((Evas_Object *)obj)->layer))->next);
|
|
|
|
return l->objects;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
evas_object_below_get_internal(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
if (((Evas_Object_List *)obj)->prev)
|
|
|
|
return (Evas_Object *)(((Evas_Object_List *)obj)->prev);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (((Evas_Object_List *)(((Evas_Object *)obj)->layer))->prev)
|
|
|
|
{
|
|
|
|
Evas_Layer *l;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
l = (Evas_Layer *)(((Evas_Object_List *)(((Evas_Object *)obj)->layer))->prev);
|
|
|
|
return (Evas_Object *)(((Evas_Object_List *)(l->objects))->last);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_raise(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2002-12-14 16:33:57 -08:00
|
|
|
if (evas_object_intercept_call_raise(obj)) return;
|
2005-05-21 19:49:50 -07:00
|
|
|
if (!(((Evas_Object_List *)obj)->next))
|
2002-12-09 22:45:18 -08:00
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->smart.parent)
|
2005-08-25 23:53:37 -07:00
|
|
|
{
|
2005-10-26 19:44:36 -07:00
|
|
|
obj->smart.parent->smart.contained = evas_object_list_remove(obj->smart.parent->smart.contained, obj);
|
|
|
|
obj->smart.parent->smart.contained = evas_object_list_append(obj->smart.parent->smart.contained, obj);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (obj->in_layer)
|
|
|
|
{
|
|
|
|
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
|
|
|
obj->layer->objects = evas_object_list_append(obj->layer->objects, obj);
|
|
|
|
}
|
2005-08-25 23:53:37 -07:00
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
if (obj->clip.clipees)
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->restack = 1;
|
|
|
|
evas_object_change(obj);
|
2005-10-26 21:25:30 -07:00
|
|
|
evas_object_inform_call_restack(obj);
|
2005-09-21 19:52:53 -07:00
|
|
|
if (obj->layer->evas->events_frozen <= 0)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-07-22 03:28:11 -07:00
|
|
|
if (!evas_event_passes_through(obj))
|
2003-07-21 22:16:47 -07:00
|
|
|
{
|
2005-07-22 03:28:11 -07:00
|
|
|
if (!obj->smart.smart)
|
|
|
|
{
|
|
|
|
if (evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1) &&
|
|
|
|
obj->cur.visible)
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_move(obj->layer->evas,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y,
|
|
|
|
obj->layer->evas->last_timestamp,
|
|
|
|
NULL);
|
2005-07-22 03:28:11 -07:00
|
|
|
}
|
2003-07-21 22:16:47 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_lower(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2002-12-14 16:33:57 -08:00
|
|
|
if (evas_object_intercept_call_lower(obj)) return;
|
2002-12-09 22:45:18 -08:00
|
|
|
if (!(((Evas_Object_List *)obj)->prev))
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->smart.parent)
|
|
|
|
{
|
|
|
|
obj->smart.parent->smart.contained = evas_object_list_remove(obj->smart.parent->smart.contained, obj);
|
|
|
|
obj->smart.parent->smart.contained = evas_object_list_prepend(obj->smart.parent->smart.contained, obj);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (obj->in_layer)
|
|
|
|
{
|
|
|
|
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
|
|
|
obj->layer->objects = evas_object_list_prepend(obj->layer->objects, obj);
|
|
|
|
}
|
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
if (obj->clip.clipees)
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->restack = 1;
|
|
|
|
evas_object_change(obj);
|
2005-10-26 21:25:30 -07:00
|
|
|
evas_object_inform_call_restack(obj);
|
2005-09-21 19:52:53 -07:00
|
|
|
if (obj->layer->evas->events_frozen <= 0)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-07-22 03:28:11 -07:00
|
|
|
if (!evas_event_passes_through(obj))
|
2003-07-21 22:16:47 -07:00
|
|
|
{
|
2005-07-22 03:28:11 -07:00
|
|
|
if (!obj->smart.smart)
|
|
|
|
{
|
|
|
|
if (evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1) &&
|
|
|
|
obj->cur.visible)
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_move(obj->layer->evas,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y,
|
|
|
|
obj->layer->evas->last_timestamp,
|
|
|
|
NULL);
|
2005-07-22 03:28:11 -07:00
|
|
|
}
|
2003-07-21 22:16:47 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
MAGIC_CHECK(above, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2002-12-14 16:33:57 -08:00
|
|
|
if (evas_object_intercept_call_stack_above(obj, above)) return;
|
2005-10-26 19:44:36 -07:00
|
|
|
if (!above)
|
2005-08-25 23:53:37 -07:00
|
|
|
{
|
2005-10-26 19:44:36 -07:00
|
|
|
evas_object_raise(obj);
|
2002-12-09 22:45:18 -08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (((Evas_Object_List *)obj)->prev == (Evas_Object_List *)above)
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->smart.parent)
|
|
|
|
{
|
|
|
|
if (obj->smart.parent != above->smart.parent)
|
|
|
|
{
|
|
|
|
// printf("BITCH! evas_object_stack_above(), %p not inside same smart as %p!\n", obj, above);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
obj->smart.parent->smart.contained = evas_object_list_remove(obj->smart.parent->smart.contained, obj);
|
|
|
|
obj->smart.parent->smart.contained = evas_object_list_append_relative(obj->smart.parent->smart.contained, obj, above);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-10-27 03:33:47 -07:00
|
|
|
if (above->smart.parent) return;
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->layer != above->layer)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (obj->in_layer)
|
|
|
|
{
|
|
|
|
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
|
|
|
obj->layer->objects = evas_object_list_append_relative(obj->layer->objects, obj, above);
|
|
|
|
}
|
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
if (obj->clip.clipees)
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->restack = 1;
|
|
|
|
evas_object_change(obj);
|
2005-10-26 21:25:30 -07:00
|
|
|
evas_object_inform_call_restack(obj);
|
2005-09-21 19:52:53 -07:00
|
|
|
if (obj->layer->evas->events_frozen <= 0)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-07-22 03:28:11 -07:00
|
|
|
if (!evas_event_passes_through(obj))
|
2003-07-21 22:16:47 -07:00
|
|
|
{
|
2005-07-22 03:28:11 -07:00
|
|
|
if (!obj->smart.smart)
|
|
|
|
{
|
|
|
|
if (evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1) &&
|
|
|
|
obj->cur.visible)
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_move(obj->layer->evas,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y,
|
|
|
|
obj->layer->evas->last_timestamp,
|
|
|
|
NULL);
|
2005-07-22 03:28:11 -07:00
|
|
|
}
|
2003-07-21 22:16:47 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_stack_below(Evas_Object *obj, Evas_Object *below)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
MAGIC_CHECK(below, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2002-12-14 16:33:57 -08:00
|
|
|
if (evas_object_intercept_call_stack_below(obj, below)) return;
|
2005-10-26 19:44:36 -07:00
|
|
|
if (!below)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-10-26 19:44:36 -07:00
|
|
|
evas_object_lower(obj);
|
2002-12-09 22:45:18 -08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (((Evas_Object_List *)obj)->next == (Evas_Object_List *)below)
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->smart.parent)
|
|
|
|
{
|
|
|
|
if (obj->smart.parent != below->smart.parent)
|
|
|
|
{
|
|
|
|
// printf("BITCH! evas_object_stack_below(), %p not inside same smart as %p!\n", obj, below);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
obj->smart.parent->smart.contained = evas_object_list_remove(obj->smart.parent->smart.contained, obj);
|
|
|
|
obj->smart.parent->smart.contained = evas_object_list_prepend_relative(obj->smart.parent->smart.contained, obj, below);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-10-27 03:33:47 -07:00
|
|
|
if (below->smart.parent) return;
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->layer != below->layer)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (obj->in_layer)
|
|
|
|
{
|
|
|
|
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
|
|
|
obj->layer->objects = evas_object_list_prepend_relative(obj->layer->objects, obj, below);
|
|
|
|
}
|
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
if (obj->clip.clipees)
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->restack = 1;
|
|
|
|
evas_object_change(obj);
|
2005-10-26 21:25:30 -07:00
|
|
|
evas_object_inform_call_restack(obj);
|
2005-09-21 19:52:53 -07:00
|
|
|
if (obj->layer->evas->events_frozen <= 0)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-07-22 03:28:11 -07:00
|
|
|
if (!evas_event_passes_through(obj))
|
2003-07-21 22:16:47 -07:00
|
|
|
{
|
2005-07-22 03:28:11 -07:00
|
|
|
if (!obj->smart.smart)
|
|
|
|
{
|
|
|
|
if (evas_object_is_in_output_rect(obj,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y, 1, 1) &&
|
|
|
|
obj->cur.visible)
|
2005-07-25 02:55:47 -07:00
|
|
|
evas_event_feed_mouse_move(obj->layer->evas,
|
|
|
|
obj->layer->evas->pointer.x,
|
|
|
|
obj->layer->evas->pointer.y,
|
|
|
|
obj->layer->evas->last_timestamp,
|
|
|
|
NULL);
|
2005-07-22 03:28:11 -07:00
|
|
|
}
|
2003-07-21 22:16:47 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Object *
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_above_get(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->smart.parent)
|
|
|
|
return (Evas_Object *)(((Evas_Object_List *)(obj))->next);
|
|
|
|
return evas_object_above_get_internal(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Object *
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_below_get(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->smart.parent)
|
|
|
|
return (Evas_Object *)(((Evas_Object_List *)(obj))->prev);
|
|
|
|
return evas_object_below_get_internal(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Object *
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_bottom_get(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (e->layers)
|
2005-10-26 19:44:36 -07:00
|
|
|
return e->layers->objects;
|
|
|
|
return NULL;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Object *
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_top_get(Evas *e)
|
|
|
|
{
|
2003-10-17 20:34:00 -07:00
|
|
|
Evas_Object *obj2 = NULL;
|
2005-05-09 12:40:49 -07:00
|
|
|
Evas_Object_List *list;
|
|
|
|
Evas_Layer *layer;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2005-05-09 12:40:49 -07:00
|
|
|
|
|
|
|
list = (Evas_Object_List *) e->layers;
|
|
|
|
if (!list) return NULL;
|
|
|
|
|
|
|
|
layer = (Evas_Layer *) list->last;
|
|
|
|
if (!layer) return NULL;
|
|
|
|
|
|
|
|
list = (Evas_Object_List *) layer->objects;
|
|
|
|
if (!list) return NULL;
|
|
|
|
|
|
|
|
obj2 = (Evas_Object *) list->last;
|
|
|
|
if (!obj2) return NULL;
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
return obj2;
|
|
|
|
}
|