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
|
|
|
*/
|
2002-11-08 00:02:15 -08:00
|
|
|
void
|
|
|
|
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;
|
2002-11-08 00:02:15 -08:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2003-10-08 20:05:17 -07:00
|
|
|
if (obj->smart.smart->smart_class->raise)
|
|
|
|
obj->smart.smart->smart_class->raise(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
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;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->layer->objects = evas_object_list_remove(obj->layer->objects, obj);
|
|
|
|
obj->layer->objects = evas_object_list_append(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-07-22 03:28:11 -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
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
evas_object_inform_call_restack(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
|
|
|
*/
|
2002-11-08 00:02:15 -08:00
|
|
|
void
|
|
|
|
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-11-08 00:02:15 -08:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2003-10-08 20:05:17 -07:00
|
|
|
if (obj->smart.smart->smart_class->lower)
|
|
|
|
obj->smart.smart->smart_class->lower(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
if (!(((Evas_Object_List *)obj)->prev))
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
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-07-22 03:28:11 -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
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
evas_object_inform_call_restack(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
|
|
|
*/
|
2002-11-08 00:02:15 -08:00
|
|
|
void
|
|
|
|
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;
|
2002-11-08 00:02:15 -08:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2003-10-08 20:05:17 -07:00
|
|
|
if (obj->smart.smart->smart_class->stack_above)
|
|
|
|
obj->smart.smart->smart_class->stack_above(obj, above);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
if (above->layer != obj->layer)
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (((Evas_Object_List *)obj)->prev == (Evas_Object_List *)above)
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
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-07-22 03:28:11 -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
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
evas_object_inform_call_restack(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
|
|
|
*/
|
2002-11-08 00:02:15 -08:00
|
|
|
void
|
|
|
|
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;
|
2002-11-08 00:02:15 -08:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2003-10-08 20:05:17 -07:00
|
|
|
if (obj->smart.smart->smart_class->stack_below)
|
|
|
|
obj->smart.smart->smart_class->stack_below(obj, below);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
if (below->layer != obj->layer)
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (((Evas_Object_List *)obj)->next == (Evas_Object_List *)below)
|
|
|
|
{
|
|
|
|
evas_object_inform_call_restack(obj);
|
|
|
|
return;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
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-07-22 03:28:11 -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
|
|
|
}
|
2002-12-09 22:45:18 -08:00
|
|
|
evas_object_inform_call_restack(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
|
|
|
*/
|
2002-11-08 00:02:15 -08:00
|
|
|
Evas_Object *
|
|
|
|
evas_object_above_get(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Object *obj2;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
obj2 = evas_object_above_get_internal(obj);
|
2004-03-15 20:13:05 -08:00
|
|
|
while (((obj2) && (obj2->smart.parent)) ||
|
|
|
|
((obj2) && (obj2->delete_me)))
|
2005-05-21 19:49:50 -07:00
|
|
|
obj2 = evas_object_above_get_internal(obj2);
|
2002-11-08 00:02:15 -08:00
|
|
|
return obj2;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
*/
|
2002-11-08 00:02:15 -08:00
|
|
|
Evas_Object *
|
|
|
|
evas_object_below_get(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Object *obj2;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
obj2 = evas_object_below_get_internal(obj);
|
2004-03-15 20:13:05 -08:00
|
|
|
while (((obj2) && (obj2->smart.parent)) ||
|
|
|
|
((obj2) && (obj2->delete_me)))
|
2005-05-21 19:49:50 -07:00
|
|
|
obj2 = evas_object_below_get_internal(obj2);
|
2002-11-08 00:02:15 -08:00
|
|
|
return obj2;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
*/
|
2002-11-08 00:02:15 -08:00
|
|
|
Evas_Object *
|
|
|
|
evas_object_bottom_get(Evas *e)
|
|
|
|
{
|
2003-10-17 20:34:00 -07:00
|
|
|
Evas_Object *obj2 = NULL;
|
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();
|
|
|
|
if (e->layers)
|
|
|
|
obj2 = e->layers->objects;
|
2004-03-15 20:13:05 -08:00
|
|
|
while (((obj2) && (obj2->smart.parent)) ||
|
|
|
|
((obj2) && (obj2->delete_me)))
|
2002-11-08 00:02:15 -08:00
|
|
|
obj2 = evas_object_above_get_internal(obj2);
|
|
|
|
return obj2;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
*/
|
2002-11-08 00:02:15 -08:00
|
|
|
Evas_Object *
|
|
|
|
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;
|
|
|
|
|
2004-03-15 20:13:05 -08:00
|
|
|
while (((obj2) && (obj2->smart.parent)) ||
|
2005-05-09 12:40:49 -07:00
|
|
|
((obj2) && (obj2->delete_me))) {
|
2002-11-08 00:02:15 -08:00
|
|
|
obj2 = evas_object_below_get_internal(obj2);
|
2005-05-09 12:40:49 -07:00
|
|
|
}
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
return obj2;
|
|
|
|
}
|