2016-06-20 21:26:15 -07:00
|
|
|
#define EFL_CANVAS_OBJECT_PROTECTED
|
|
|
|
#define EFL_CANVAS_OBJECT_BETA
|
2016-06-08 00:09:38 -07:00
|
|
|
#define EFL_GFX_SIZE_HINT_PROTECTED
|
2016-04-14 10:33:25 -07:00
|
|
|
|
2013-06-20 03:53:29 -07:00
|
|
|
#include "evas_common_private.h"
|
2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_private.h"
|
2016-12-12 20:38:16 -08:00
|
|
|
#include <Ecore.h>
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2010-11-26 02:01:18 -08:00
|
|
|
EVAS_MEMPOOL(_mp_sh);
|
|
|
|
|
2016-06-20 21:26:15 -07:00
|
|
|
#define MY_CLASS EFL_CANVAS_OBJECT_CLASS
|
2012-10-08 18:58:41 -07:00
|
|
|
|
|
|
|
#define MY_CLASS_NAME "Evas_Object"
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* evas internal stuff */
|
2013-01-16 23:21:06 -08:00
|
|
|
static const Evas_Object_Proxy_Data default_proxy = {
|
2013-12-26 23:56:30 -08:00
|
|
|
NULL, NULL, NULL, 0, 0, NULL, 0, 0, 0, 0
|
2013-01-16 23:21:06 -08:00
|
|
|
};
|
2013-01-21 19:56:00 -08:00
|
|
|
static const Evas_Object_Map_Data default_map = {
|
|
|
|
{ NULL, NULL, 0, 0 }, { NULL, NULL, 0, 0 }, NULL, 0, 0, NULL, NULL
|
|
|
|
};
|
2013-03-12 05:58:19 -07:00
|
|
|
static const Evas_Object_Protected_State default_state = {
|
2013-04-06 23:11:56 -07:00
|
|
|
NULL, { 0, 0, 0, 0 },
|
2015-01-20 22:14:50 -08:00
|
|
|
{ { 0, 0, 0, 0, 0, 0, 0, 0, EINA_FALSE, EINA_FALSE } },
|
2013-03-12 05:58:19 -07:00
|
|
|
{ 255, 255, 255, 255 },
|
2015-11-01 23:03:48 -08:00
|
|
|
1.0, 0, EVAS_RENDER_BLEND, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE
|
2013-03-12 05:58:19 -07:00
|
|
|
};
|
2014-11-12 17:40:16 -08:00
|
|
|
static const Evas_Object_Mask_Data default_mask = {
|
2015-04-21 02:44:41 -07:00
|
|
|
NULL, 0, 0, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE
|
2014-11-12 17:40:16 -08:00
|
|
|
};
|
2017-06-13 09:36:33 -07:00
|
|
|
static const Evas_Object_Events_Data default_events = {
|
2017-06-14 14:17:18 -07:00
|
|
|
NULL, NULL, NULL, NULL
|
2017-06-13 09:36:33 -07:00
|
|
|
};
|
2013-01-16 23:21:06 -08:00
|
|
|
|
|
|
|
Eina_Cow *evas_object_proxy_cow = NULL;
|
2013-01-21 19:56:00 -08:00
|
|
|
Eina_Cow *evas_object_map_cow = NULL;
|
2013-03-12 05:58:19 -07:00
|
|
|
Eina_Cow *evas_object_state_cow = NULL;
|
2013-12-26 23:56:30 -08:00
|
|
|
Eina_Cow *evas_object_3d_cow = NULL;
|
2014-11-12 17:40:16 -08:00
|
|
|
Eina_Cow *evas_object_mask_cow = NULL;
|
2017-06-13 09:36:33 -07:00
|
|
|
Eina_Cow *evas_object_events_cow = NULL;
|
2013-12-26 23:56:30 -08:00
|
|
|
|
2017-08-30 00:16:18 -07:00
|
|
|
typedef struct _Event_Animation
|
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
EINA_INLIST;
|
2017-08-30 00:16:18 -07:00
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
const Efl_Event_Description *desc;
|
2018-04-10 06:09:39 -07:00
|
|
|
Efl_Canvas_Animation *anim;
|
2017-10-13 04:40:01 -07:00
|
|
|
} Event_Animation;
|
2017-08-30 00:16:18 -07:00
|
|
|
|
2013-01-21 19:56:00 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_init_cow(void)
|
|
|
|
{
|
2017-03-23 00:22:43 -07:00
|
|
|
if (evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow && evas_object_3d_cow) return EINA_TRUE;
|
2013-01-21 19:56:00 -08:00
|
|
|
|
2013-04-02 01:10:35 -07:00
|
|
|
evas_object_proxy_cow = eina_cow_add("Evas Object Proxy", sizeof (Evas_Object_Proxy_Data), 8, &default_proxy, EINA_TRUE);
|
|
|
|
evas_object_map_cow = eina_cow_add("Evas Object Map", sizeof (Evas_Object_Map_Data), 8, &default_map, EINA_TRUE);
|
|
|
|
evas_object_state_cow = eina_cow_add("Evas Object State", sizeof (Evas_Object_Protected_State), 64, &default_state, EINA_FALSE);
|
2013-12-26 23:56:30 -08:00
|
|
|
evas_object_3d_cow = eina_cow_add("Evas Object 3D", sizeof (Evas_Object_3D_Data), 8, &default_proxy, EINA_TRUE);
|
2014-11-12 17:40:16 -08:00
|
|
|
evas_object_mask_cow = eina_cow_add("Evas Mask Data", sizeof (Evas_Object_Mask_Data), 8, &default_mask, EINA_TRUE);
|
2017-06-13 09:36:33 -07:00
|
|
|
evas_object_events_cow = eina_cow_add("Evas Events Data", sizeof (Evas_Object_Events_Data), 8, &default_events, EINA_TRUE);
|
2013-12-26 23:56:30 -08:00
|
|
|
|
2014-11-12 17:40:16 -08:00
|
|
|
if (!(evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow &&
|
2017-06-13 09:36:33 -07:00
|
|
|
evas_object_3d_cow && evas_object_mask_cow && evas_object_events_cow))
|
2013-01-21 19:56:00 -08:00
|
|
|
{
|
|
|
|
eina_cow_del(evas_object_proxy_cow);
|
|
|
|
eina_cow_del(evas_object_map_cow);
|
2013-11-17 20:08:28 -08:00
|
|
|
eina_cow_del(evas_object_state_cow);
|
2014-11-12 17:40:16 -08:00
|
|
|
eina_cow_del(evas_object_3d_cow);
|
|
|
|
eina_cow_del(evas_object_mask_cow);
|
2017-06-13 09:36:33 -07:00
|
|
|
eina_cow_del(evas_object_events_cow);
|
2014-11-12 17:40:16 -08:00
|
|
|
|
2013-01-27 00:42:57 -08:00
|
|
|
evas_object_proxy_cow = NULL;
|
|
|
|
evas_object_map_cow = NULL;
|
2013-11-17 20:08:28 -08:00
|
|
|
evas_object_state_cow = NULL;
|
2013-12-26 23:56:30 -08:00
|
|
|
evas_object_3d_cow = NULL;
|
2014-11-12 17:40:16 -08:00
|
|
|
evas_object_mask_cow = NULL;
|
2017-06-13 09:36:33 -07:00
|
|
|
evas_object_events_cow = NULL;
|
2014-10-21 19:12:33 -07:00
|
|
|
|
2013-01-21 19:56:00 -08:00
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2013-01-16 23:21:06 -08:00
|
|
|
|
2016-12-05 08:26:25 -08:00
|
|
|
static Evas_Object_Pointer_Data *
|
|
|
|
_evas_object_pointer_data_find(Evas_Object_Protected_Data *obj,
|
|
|
|
Efl_Input_Device *pointer)
|
|
|
|
{
|
|
|
|
Evas_Object_Pointer_Data *pdata;
|
|
|
|
|
2017-06-13 09:36:33 -07:00
|
|
|
EINA_INLIST_FOREACH(obj->events->pointer_grabs, pdata)
|
2016-12-05 08:26:25 -08:00
|
|
|
{
|
|
|
|
if (pdata->evas_pdata->pointer == pointer)
|
|
|
|
return pdata;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2018-06-15 08:22:37 -07:00
|
|
|
_evas_object_pointer_grab_del(Evas_Object_Protected_Data *obj, Evas_Object_Pointer_Data *pdata);
|
2016-12-05 08:26:25 -08:00
|
|
|
|
2016-10-21 05:25:41 -07:00
|
|
|
static void
|
|
|
|
_evas_device_del_cb(void *data, const Efl_Event *ev)
|
|
|
|
{
|
2017-08-21 17:37:39 -07:00
|
|
|
Evas_Object_Protected_Data *obj;
|
|
|
|
Evas_Object_Pointer_Data *pdata;
|
2016-10-21 05:25:41 -07:00
|
|
|
|
2017-08-21 17:37:39 -07:00
|
|
|
obj = efl_data_scope_safe_get(data, MY_CLASS);
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(obj);
|
|
|
|
pdata = _evas_object_pointer_data_find(obj, ev->object);
|
2016-12-05 08:26:25 -08:00
|
|
|
if (!pdata) return;
|
2018-06-15 08:22:37 -07:00
|
|
|
_evas_object_pointer_grab_del(obj, pdata);
|
2016-10-21 05:25:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2018-06-15 08:22:37 -07:00
|
|
|
_evas_object_pointer_grab_del(Evas_Object_Protected_Data *obj,
|
|
|
|
Evas_Object_Pointer_Data *pdata)
|
2016-10-21 05:25:41 -07:00
|
|
|
{
|
2016-12-05 08:26:25 -08:00
|
|
|
if ((pdata->mouse_grabbed > 0) && (obj->layer) && (obj->layer->evas))
|
2017-06-02 15:23:45 -07:00
|
|
|
pdata->evas_pdata->seat->mouse_grabbed -= pdata->mouse_grabbed;
|
2016-10-21 05:25:41 -07:00
|
|
|
if (((pdata->mouse_in) || (pdata->mouse_grabbed > 0)) &&
|
2016-12-05 08:26:25 -08:00
|
|
|
(obj->layer) && (obj->layer->evas))
|
2017-06-02 15:23:45 -07:00
|
|
|
pdata->evas_pdata->seat->object.in = eina_list_remove(pdata->evas_pdata->seat->object.in, obj->object);
|
2016-10-21 05:25:41 -07:00
|
|
|
efl_event_callback_del(pdata->evas_pdata->pointer, EFL_EVENT_DEL,
|
2017-08-21 17:37:39 -07:00
|
|
|
_evas_device_del_cb, obj->object);
|
2018-06-15 08:22:37 -07:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events)
|
|
|
|
events->pointer_grabs = eina_inlist_remove(events->pointer_grabs, EINA_INLIST_GET(pdata));
|
|
|
|
EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
|
2017-06-13 09:36:33 -07:00
|
|
|
|
2016-10-21 05:25:41 -07:00
|
|
|
free(pdata);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object_Pointer_Data *
|
|
|
|
_evas_object_pointer_data_add(Evas_Pointer_Data *evas_pdata,
|
2016-12-05 08:48:58 -08:00
|
|
|
Evas_Object_Protected_Data *obj)
|
2016-10-21 05:25:41 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Pointer_Data *pdata;
|
|
|
|
|
|
|
|
pdata = calloc(1, sizeof(Evas_Object_Pointer_Data));
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
|
|
|
|
pdata->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
|
|
|
|
pdata->evas_pdata = evas_pdata;
|
2017-06-13 09:36:33 -07:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events)
|
|
|
|
events->pointer_grabs = eina_inlist_append(events->pointer_grabs,
|
|
|
|
EINA_INLIST_GET(pdata));
|
|
|
|
EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
|
|
|
|
|
2016-12-05 08:48:58 -08:00
|
|
|
efl_event_callback_priority_add(evas_pdata->pointer, EFL_EVENT_DEL,
|
2016-10-21 05:25:41 -07:00
|
|
|
EFL_CALLBACK_PRIORITY_BEFORE,
|
2017-08-21 17:37:39 -07:00
|
|
|
_evas_device_del_cb, obj->object);
|
2016-10-21 05:25:41 -07:00
|
|
|
return pdata;
|
|
|
|
}
|
|
|
|
|
|
|
|
Evas_Object_Pointer_Data *
|
|
|
|
_evas_object_pointer_data_get(Evas_Pointer_Data *evas_pdata,
|
2016-12-05 08:48:58 -08:00
|
|
|
Evas_Object_Protected_Data *obj)
|
2016-10-21 05:25:41 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Pointer_Data *pdata;
|
|
|
|
|
2016-12-05 08:26:25 -08:00
|
|
|
pdata = _evas_object_pointer_data_find(obj, evas_pdata->pointer);
|
|
|
|
|
2016-10-21 05:25:41 -07:00
|
|
|
//The pointer does not exist yet - create one.
|
|
|
|
if (!pdata)
|
2016-12-05 08:48:58 -08:00
|
|
|
return _evas_object_pointer_data_add(evas_pdata, obj);
|
2016-10-21 05:25:41 -07:00
|
|
|
return pdata;
|
|
|
|
}
|
|
|
|
|
2018-01-16 03:31:15 -08:00
|
|
|
static void _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
|
2017-10-13 04:40:01 -07:00
|
|
|
|
|
|
|
static void
|
2018-04-10 06:09:39 -07:00
|
|
|
_anim_started_cb(void *data, const Efl_Event *ev)
|
2017-10-13 04:40:01 -07:00
|
|
|
{
|
2018-04-10 06:09:39 -07:00
|
|
|
const Efl_Event_Description *desc = data;
|
2017-10-13 04:40:01 -07:00
|
|
|
|
2018-04-30 08:07:27 -07:00
|
|
|
Efl_Canvas_Object_Animation_Event event;
|
|
|
|
event.event_desc = desc;
|
2017-10-13 04:40:01 -07:00
|
|
|
|
2018-04-10 06:09:39 -07:00
|
|
|
Eo *eo_obj = efl_animation_player_target_get(ev->object);
|
|
|
|
|
|
|
|
efl_event_callback_call(eo_obj, EFL_CANVAS_OBJECT_EVENT_ANIM_STARTED,
|
|
|
|
&event);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_anim_running_cb(void *data, const Efl_Event *ev)
|
|
|
|
{
|
|
|
|
const Efl_Event_Description *desc = data;
|
|
|
|
|
2018-04-30 08:07:27 -07:00
|
|
|
Efl_Canvas_Object_Animation_Event event;
|
|
|
|
event.event_desc = desc;
|
2017-10-13 04:40:01 -07:00
|
|
|
|
2018-04-10 06:09:39 -07:00
|
|
|
Eo *eo_obj = efl_animation_player_target_get(ev->object);
|
|
|
|
|
|
|
|
efl_event_callback_call(eo_obj, EFL_CANVAS_OBJECT_EVENT_ANIM_RUNNING,
|
|
|
|
&event);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_anim_ended_cb(void *data, const Efl_Event *ev)
|
|
|
|
{
|
|
|
|
const Efl_Event_Description *desc = data;
|
|
|
|
|
|
|
|
efl_event_callback_del(ev->object, EFL_ANIMATION_PLAYER_EVENT_STARTED,
|
|
|
|
_anim_started_cb, desc);
|
|
|
|
efl_event_callback_del(ev->object, EFL_ANIMATION_PLAYER_EVENT_RUNNING,
|
|
|
|
_anim_running_cb, desc);
|
|
|
|
efl_event_callback_del(ev->object, EFL_ANIMATION_PLAYER_EVENT_ENDED,
|
|
|
|
_anim_ended_cb, desc);
|
|
|
|
|
2018-04-30 08:07:27 -07:00
|
|
|
Efl_Canvas_Object_Animation_Event event;
|
|
|
|
event.event_desc = desc;
|
2018-04-10 06:09:39 -07:00
|
|
|
|
|
|
|
Eo *eo_obj = efl_animation_player_target_get(ev->object);
|
|
|
|
|
|
|
|
efl_event_callback_call(eo_obj, EFL_CANVAS_OBJECT_EVENT_ANIM_ENDED,
|
|
|
|
&event);
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
if (desc == EFL_GFX_ENTITY_EVENT_HIDE)
|
2018-04-10 06:09:39 -07:00
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
|
|
|
|
if (!obj) return;
|
|
|
|
|
|
|
|
_hide(eo_obj, obj);
|
|
|
|
}
|
2017-10-13 04:40:01 -07:00
|
|
|
}
|
|
|
|
|
2017-08-30 00:16:18 -07:00
|
|
|
static void
|
2017-10-13 04:40:01 -07:00
|
|
|
_animation_intercept_hide(void *data, Evas_Object *eo_obj)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
Event_Animation *event_anim = data;
|
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
|
2018-04-09 10:12:58 -07:00
|
|
|
if (!obj) return;
|
2017-08-30 00:16:18 -07:00
|
|
|
|
2018-01-16 03:31:15 -08:00
|
|
|
if (event_anim->anim && obj->anim_player &&
|
2018-04-10 06:09:39 -07:00
|
|
|
(event_anim->anim != efl_animation_player_animation_get(obj->anim_player)))
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2018-01-16 03:31:15 -08:00
|
|
|
efl_animation_player_animation_set(obj->anim_player, event_anim->anim);
|
2018-04-10 06:09:39 -07:00
|
|
|
|
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_STARTED,
|
2018-04-05 01:47:26 -07:00
|
|
|
_anim_started_cb, EFL_GFX_ENTITY_EVENT_HIDE);
|
2018-04-10 06:09:39 -07:00
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_RUNNING,
|
2018-04-05 01:47:26 -07:00
|
|
|
_anim_running_cb, EFL_GFX_ENTITY_EVENT_HIDE);
|
2018-04-10 06:09:39 -07:00
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_ENDED,
|
2018-04-05 01:47:26 -07:00
|
|
|
_anim_ended_cb, EFL_GFX_ENTITY_EVENT_HIDE);
|
2018-04-10 06:09:39 -07:00
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
//Start animation
|
2018-01-16 03:31:15 -08:00
|
|
|
efl_player_start(obj->anim_player);
|
2017-08-30 00:16:18 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2018-01-16 03:31:15 -08:00
|
|
|
_event_anim_free(Event_Animation *event_anim, Evas_Object_Protected_Data *obj)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
if (event_anim->anim)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2018-04-10 06:09:39 -07:00
|
|
|
//Unset callbacks for Hide event
|
2018-04-05 01:47:26 -07:00
|
|
|
if (event_anim->desc == EFL_GFX_ENTITY_EVENT_HIDE)
|
2018-04-10 06:09:39 -07:00
|
|
|
evas_object_intercept_hide_callback_del(obj->object,
|
|
|
|
_animation_intercept_hide);
|
|
|
|
|
|
|
|
if (efl_player_play_get(obj->anim_player))
|
2017-10-13 04:40:01 -07:00
|
|
|
{
|
2018-04-10 06:09:39 -07:00
|
|
|
Efl_Animation *running_anim =
|
|
|
|
efl_animation_player_animation_get(obj->anim_player);
|
|
|
|
|
|
|
|
if (running_anim == event_anim->anim)
|
|
|
|
efl_player_stop(obj->anim_player);
|
2017-10-13 04:40:01 -07:00
|
|
|
}
|
2017-08-30 00:16:18 -07:00
|
|
|
}
|
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
free(event_anim);
|
2017-08-30 00:16:18 -07:00
|
|
|
}
|
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
EOLIAN static Eo *
|
2016-08-10 07:23:04 -07:00
|
|
|
_efl_canvas_object_efl_object_constructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2018-05-14 16:14:30 -07:00
|
|
|
const char *class_name;
|
2015-04-13 05:50:43 -07:00
|
|
|
Eo *parent = NULL;
|
2018-05-14 16:14:30 -07:00
|
|
|
Evas *evas = NULL;
|
|
|
|
|
|
|
|
class_name = efl_class_name_get(eo_obj);
|
2015-04-13 05:50:43 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
|
2018-05-14 16:14:30 -07:00
|
|
|
if (!eo_obj) goto on_error;
|
2016-06-20 21:26:15 -07:00
|
|
|
efl_canvas_object_type_set(eo_obj, MY_CLASS_NAME);
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_manual_free_set(eo_obj, EINA_TRUE);
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
parent = efl_parent_get(eo_obj);
|
2016-06-20 23:45:31 -07:00
|
|
|
evas = evas_object_evas_get(parent);
|
2015-04-13 05:50:43 -07:00
|
|
|
|
2018-05-14 16:14:30 -07:00
|
|
|
if (!obj || !_init_cow() || !evas) goto on_error;
|
2013-01-16 23:21:06 -08:00
|
|
|
|
2011-12-26 15:09:45 -08:00
|
|
|
obj->is_frame = EINA_FALSE;
|
2012-10-08 18:58:41 -07:00
|
|
|
obj->object = eo_obj;
|
2013-01-16 23:21:06 -08:00
|
|
|
obj->proxy = eina_cow_alloc(evas_object_proxy_cow);
|
2013-01-21 19:56:00 -08:00
|
|
|
obj->map = eina_cow_alloc(evas_object_map_cow);
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur = eina_cow_alloc(evas_object_state_cow);
|
|
|
|
obj->prev = eina_cow_alloc(evas_object_state_cow);
|
2013-12-26 23:56:30 -08:00
|
|
|
obj->data_3d = eina_cow_alloc(evas_object_3d_cow);
|
2014-11-12 17:40:16 -08:00
|
|
|
obj->mask = eina_cow_alloc(evas_object_mask_cow);
|
2017-06-13 09:36:33 -07:00
|
|
|
obj->events = eina_cow_alloc(evas_object_events_cow);
|
2017-10-13 04:40:01 -07:00
|
|
|
obj->event_anims = NULL;
|
2015-05-19 03:41:27 -07:00
|
|
|
|
2016-06-20 23:45:31 -07:00
|
|
|
evas_object_inject(eo_obj, obj, evas);
|
2016-08-19 00:20:39 -07:00
|
|
|
evas_object_callback_init(eo_obj, obj);
|
2016-01-28 16:15:20 -08:00
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
return eo_obj;
|
2018-05-14 16:14:30 -07:00
|
|
|
|
|
|
|
on_error:
|
|
|
|
ERR("Failed to create a canvas object (evas: %p) of type '%s'.", evas, class_name);
|
|
|
|
return NULL;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2017-07-06 00:29:20 -07:00
|
|
|
EOLIAN static Eo *
|
|
|
|
_efl_canvas_object_efl_object_finalize(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
|
|
|
Evas_Public_Data *e;
|
|
|
|
|
|
|
|
if (!EVAS_OBJECT_DATA_ALIVE(obj)) goto end;
|
|
|
|
if (obj->legacy.ctor) goto end;
|
|
|
|
|
2017-07-27 04:46:17 -07:00
|
|
|
if (!obj->legacy.weight_set)
|
|
|
|
efl_gfx_size_hint_weight_set(eo_obj, 1.0, 1.0);
|
|
|
|
|
2017-08-22 23:23:50 -07:00
|
|
|
if (!obj->legacy.align_set)
|
|
|
|
efl_gfx_size_hint_align_set(eo_obj, -1.0, -1.0);
|
|
|
|
|
2017-07-06 00:29:20 -07:00
|
|
|
if (obj->legacy.visible_set /* && ... */)
|
|
|
|
{
|
|
|
|
obj->legacy.finalized = EINA_TRUE;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
e = obj->layer->evas;
|
|
|
|
e->finalize_objects = eina_list_prepend(e->finalize_objects, eo_obj);
|
|
|
|
|
|
|
|
end:
|
|
|
|
return efl_finalize(efl_super(eo_obj, MY_CLASS));
|
|
|
|
}
|
|
|
|
|
2012-05-16 05:59:33 -07:00
|
|
|
void
|
2017-02-03 18:31:55 -08:00
|
|
|
evas_object_change_reset(Evas_Object_Protected_Data *obj)
|
2012-05-16 05:59:33 -07:00
|
|
|
{
|
|
|
|
obj->changed = EINA_FALSE;
|
|
|
|
obj->changed_move = EINA_FALSE;
|
2012-05-18 00:17:34 -07:00
|
|
|
obj->changed_color = EINA_FALSE;
|
2012-05-16 05:59:33 -07:00
|
|
|
obj->changed_pchange = EINA_FALSE;
|
2012-10-25 08:24:27 -07:00
|
|
|
obj->changed_src_visible = EINA_FALSE;
|
2014-08-06 23:32:39 -07:00
|
|
|
obj->need_surface_clear = EINA_FALSE;
|
2012-05-16 05:59:33 -07:00
|
|
|
}
|
|
|
|
|
remove memcmp calls for better performance where size is known
so i have been doing some profiling on my rpi3 ... and it seems
memcmp() is like the number one top used function - especially running
e in wayland compositor mode. it uses accoring to perf top about 9-15%
of samples (samples are not adding up to 100%). no - i cant seem to
get a call graph because all that happens is the whole kernel locks up
solid if i try, so i can only get the leaf node call stats. what
function was currently active at the sample time. memcmp is the
biggest by far. 2-3 times anything else.
13.47% libarmmem.so [.] memcmp
6.43% libevas.so.1.18.99 [.] _evas_render_phase1_object_pro
4.74% libevas.so.1.18.99 [.] evas_render_updates_internal.c
2.84% libeo.so.1.18.99 [.] _eo_obj_pointer_get
2.49% libevas.so.1.18.99 [.] evas_render_updates_internal_l
2.03% libpthread-2.24.so [.] pthread_getspecific
1.61% libeo.so.1.18.99 [.] efl_data_scope_get
1.60% libevas.so.1.18.99 [.] _evas_event_object_list_raw_in
1.54% libevas.so.1.18.99 [.] evas_object_smart_changed_get
1.32% libgcc_s.so.1 [.] __udivsi3
1.21% libevas.so.1.18.99 [.] evas_object_is_active
1.14% libc-2.24.so [.] malloc
0.96% libevas.so.1.18.99 [.] evas_render_mapped
0.85% libeo.so.1.18.99 [.] efl_isa
yeah. it's perf. it's sampling so not 100% accurate, but close to
"good enough" for the bigger stuff. so interestingly memcmp() is
actually in a special library/module (libarmmem.so) and is a REAL
function call. so doing memcmp's for small bits of memory ESPECIALLY
when we know their size in advance is not great. i am not sure our own
use of memcmp() is the actual culprit because even with this patch
memcmp still is right up there. we use it for stringshare which is
harder to remove as stringshare has variable sized memory blobs to
compare.
but the point remains - memcmp() is an ACTUAL function call. even on
x86 (i checked the assembly). and replacing it with a static inline
custom comparer is better. in fact i did that and benchmarked it as a
sample case for eina_tiler which has 4 ints (16 bytes) to compare
every time. i also compiled to assembly on x86 to inspect and make sure
things made sense.
the text color compare was just comparing 4 bytes as a color (an int
worth) which was silly to use memcmp on as it could just cast to an
int and do a == b. the map was a little more evil as it was 2 ptrs
plus 2 bitfields, but the way bitfields work means i can assume the
last byte is both bitfields combined. i can be a little more evil for
the rect tests as 4 ints compared is the same as comparing 2 long
longs (64bit types). yes. don't get pedantic. all platforms efl works
on work this way and this is a base assumption in efl and it's true
everywhere worth talking about.
yes - i tried __int128 too. it was not faster on x86 anyway and can't
compile on armv7. in my speed tests on x86-64, comparing 2 rects by
casting to a struct of 2 long long's and comparing just those is 70%
faster than comapring 4 ints. and the 2 long longs is 360% faster than
a memcmp. on arm (my rpi3) the long long is 12% faster than the 4 ints,
and it is 226% faster than a memcmp().
it'd be best if we didnt even have to compare at all, but with these
algorithms we do, so doing it faster is better.
we probably should nuke all the memcmp's we have that are not of large
bits of memory or variable sized bits of memory.
i set breakpoints for memcmp and found at least a chunk in efl. but
also it seems the vc4 driver was also doing it too. i have no idea how
much memory it was doing this to and it may ultimately be the biggest
culprit here, BUT we may as well reduce our overhead since i've found
this anyway. less "false positives" when hunting problems.
why am i doing this? i'm setting framerate hiccups. eg like we drop 3,
5 or 10 frames, then drop another bunch, then go back to smooth, then
this hiccup again. finding out WHAT is causing that hiccup is hard. i
can only SEE the hiccups on my rpi3 - not on x86. i am not so sure
it's cpufreq bouncing about as i've locked cpu to 600mhz and it still
happens. it's something else. maybe something we are polling? maybe
it's something in our drm/kms backend? maybe its in the vc4 drivers or
kernel parts? i have no idea. trying to hunt this is hard, but this is
important as this is something that possibly is affecting everyone but
other hw is fast enough to hide it...
in the meantime find and optimize what i find along the way.
@optimize
2016-11-05 20:30:13 -07:00
|
|
|
typedef struct _Map_Same
|
|
|
|
{
|
|
|
|
void *p1, *p2;
|
|
|
|
Eina_Bool b1;
|
|
|
|
} Map_Same;
|
|
|
|
|
2016-11-26 19:02:12 -08:00
|
|
|
void
|
2017-02-20 03:24:21 -08:00
|
|
|
evas_object_clip_recalc_do(Evas_Object_Protected_Data *obj, Evas_Object_Protected_Data *clipper)
|
2016-11-26 19:02:12 -08:00
|
|
|
{
|
|
|
|
int cx, cy, cw, ch, cr, cg, cb, ca;
|
|
|
|
int nx, ny, nw, nh, nr, ng, nb, na;
|
|
|
|
Eina_Bool cvis, nvis;
|
|
|
|
|
2017-02-20 03:24:21 -08:00
|
|
|
evas_object_coords_recalc(obj->object, obj);
|
2016-11-26 19:02:12 -08:00
|
|
|
|
2017-02-06 10:46:00 -08:00
|
|
|
if (EINA_UNLIKELY((!!obj->map) && (obj->map->cur.map) && (obj->map->cur.usemap)))
|
2016-11-26 19:02:12 -08:00
|
|
|
{
|
|
|
|
cx = obj->map->cur.map->normal_geometry.x;
|
|
|
|
cy = obj->map->cur.map->normal_geometry.y;
|
|
|
|
cw = obj->map->cur.map->normal_geometry.w;
|
|
|
|
ch = obj->map->cur.map->normal_geometry.h;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (obj->is_smart)
|
|
|
|
{
|
2017-09-13 00:38:33 -07:00
|
|
|
Eina_Rectangle bounding_box;
|
2016-11-26 19:02:12 -08:00
|
|
|
|
2017-02-20 02:34:58 -08:00
|
|
|
evas_object_smart_bounding_box_update(obj);
|
|
|
|
evas_object_smart_bounding_box_get(obj, &bounding_box, NULL);
|
2016-11-26 19:02:12 -08:00
|
|
|
cx = bounding_box.x;
|
|
|
|
cy = bounding_box.y;
|
|
|
|
cw = bounding_box.w;
|
|
|
|
ch = bounding_box.h;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cx = obj->cur->geometry.x;
|
|
|
|
cy = obj->cur->geometry.y;
|
|
|
|
cw = obj->cur->geometry.w;
|
|
|
|
ch = obj->cur->geometry.h;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (EINA_UNLIKELY((obj->cur->color.a == 0) &&
|
|
|
|
(obj->cur->render_op == EVAS_RENDER_BLEND)))
|
|
|
|
cvis = EINA_FALSE;
|
|
|
|
else cvis = obj->cur->visible;
|
|
|
|
|
|
|
|
cr = obj->cur->color.r; cg = obj->cur->color.g;
|
|
|
|
cb = obj->cur->color.b; ca = obj->cur->color.a;
|
|
|
|
|
|
|
|
if (EVAS_OBJECT_DATA_VALID(clipper))
|
|
|
|
{
|
|
|
|
// this causes problems... hmmm ?????
|
|
|
|
evas_object_clip_recalc(clipper);
|
|
|
|
|
|
|
|
// I don't know why this test was here in the first place. As I have
|
|
|
|
// no issue showing up due to this, I keep it and move color out of it.
|
|
|
|
// breaks cliping of mapped images!!!
|
2017-02-06 10:45:12 -08:00
|
|
|
if (EINA_LIKELY(!!clipper->map) &&
|
|
|
|
EINA_LIKELY(!!obj->map) &&
|
|
|
|
clipper->map->cur.map_parent == obj->map->cur.map_parent)
|
2016-11-26 19:02:12 -08:00
|
|
|
{
|
|
|
|
nx = clipper->cur->cache.clip.x;
|
|
|
|
ny = clipper->cur->cache.clip.y;
|
|
|
|
nw = clipper->cur->cache.clip.w;
|
|
|
|
nh = clipper->cur->cache.clip.h;
|
|
|
|
RECTS_CLIP_TO_RECT(cx, cy, cw, ch, nx, ny, nw, nh);
|
|
|
|
}
|
|
|
|
|
|
|
|
obj->clip.prev_mask = NULL;
|
|
|
|
if (EINA_UNLIKELY(clipper->mask->is_mask))
|
|
|
|
{
|
|
|
|
// Set complex masks the object being clipped (parent)
|
|
|
|
obj->clip.mask = clipper;
|
|
|
|
|
|
|
|
// Forward any mask from the parents
|
|
|
|
if (EINA_LIKELY(obj->smart.parent != NULL))
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *parent =
|
|
|
|
efl_data_scope_get(obj->smart.parent, EFL_CANVAS_OBJECT_CLASS);
|
2016-12-15 19:16:01 -08:00
|
|
|
evas_object_clip_recalc(parent);
|
2016-11-26 19:02:12 -08:00
|
|
|
if (parent->clip.mask)
|
|
|
|
{
|
|
|
|
if (parent->clip.mask != obj->clip.mask)
|
|
|
|
obj->clip.prev_mask = parent->clip.mask;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (EINA_UNLIKELY(clipper->clip.mask != NULL))
|
|
|
|
{
|
|
|
|
// Pass complex masks to children
|
|
|
|
obj->clip.mask = clipper->clip.mask;
|
|
|
|
}
|
|
|
|
else obj->clip.mask = NULL;
|
|
|
|
|
|
|
|
nvis = clipper->cur->cache.clip.visible;
|
|
|
|
nr = clipper->cur->cache.clip.r;
|
|
|
|
ng = clipper->cur->cache.clip.g;
|
|
|
|
nb = clipper->cur->cache.clip.b;
|
|
|
|
na = clipper->cur->cache.clip.a;
|
|
|
|
cvis = (cvis & nvis);
|
|
|
|
cr = (cr * (nr + 1)) >> 8;
|
|
|
|
cg = (cg * (ng + 1)) >> 8;
|
|
|
|
cb = (cb * (nb + 1)) >> 8;
|
|
|
|
ca = (ca * (na + 1)) >> 8;
|
|
|
|
}
|
2017-04-10 21:47:55 -07:00
|
|
|
else obj->clip.mask = NULL;
|
|
|
|
if (!EVAS_OBJECT_DATA_VALID(obj->clip.mask))
|
|
|
|
obj->clip.mask = NULL;
|
2016-11-26 19:02:12 -08:00
|
|
|
|
|
|
|
if (((ca == 0) && (obj->cur->render_op == EVAS_RENDER_BLEND)) ||
|
|
|
|
(cw <= 0) || (ch <= 0))
|
|
|
|
cvis = EINA_FALSE;
|
|
|
|
|
|
|
|
if ((obj->cur->cache.clip.dirty == EINA_FALSE) &&
|
|
|
|
(obj->cur->cache.clip.visible == cvis) &&
|
|
|
|
(obj->cur->cache.clip.x == cx) &&
|
|
|
|
(obj->cur->cache.clip.y == cy) &&
|
|
|
|
(obj->cur->cache.clip.w == cw) &&
|
|
|
|
(obj->cur->cache.clip.h == ch) &&
|
|
|
|
(obj->cur->cache.clip.r == cr) &&
|
|
|
|
(obj->cur->cache.clip.g == cg) &&
|
|
|
|
(obj->cur->cache.clip.b == cb) &&
|
|
|
|
(obj->cur->cache.clip.a == ca))
|
|
|
|
return;
|
|
|
|
|
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
{
|
|
|
|
state_write->cache.clip.x = cx;
|
|
|
|
state_write->cache.clip.y = cy;
|
|
|
|
state_write->cache.clip.w = cw;
|
|
|
|
state_write->cache.clip.h = ch;
|
|
|
|
state_write->cache.clip.visible = cvis;
|
|
|
|
state_write->cache.clip.r = cr;
|
|
|
|
state_write->cache.clip.g = cg;
|
|
|
|
state_write->cache.clip.b = cb;
|
|
|
|
state_write->cache.clip.a = ca;
|
|
|
|
state_write->cache.clip.dirty = EINA_FALSE;
|
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
|
|
|
}
|
|
|
|
|
remove memcmp calls for better performance where size is known
so i have been doing some profiling on my rpi3 ... and it seems
memcmp() is like the number one top used function - especially running
e in wayland compositor mode. it uses accoring to perf top about 9-15%
of samples (samples are not adding up to 100%). no - i cant seem to
get a call graph because all that happens is the whole kernel locks up
solid if i try, so i can only get the leaf node call stats. what
function was currently active at the sample time. memcmp is the
biggest by far. 2-3 times anything else.
13.47% libarmmem.so [.] memcmp
6.43% libevas.so.1.18.99 [.] _evas_render_phase1_object_pro
4.74% libevas.so.1.18.99 [.] evas_render_updates_internal.c
2.84% libeo.so.1.18.99 [.] _eo_obj_pointer_get
2.49% libevas.so.1.18.99 [.] evas_render_updates_internal_l
2.03% libpthread-2.24.so [.] pthread_getspecific
1.61% libeo.so.1.18.99 [.] efl_data_scope_get
1.60% libevas.so.1.18.99 [.] _evas_event_object_list_raw_in
1.54% libevas.so.1.18.99 [.] evas_object_smart_changed_get
1.32% libgcc_s.so.1 [.] __udivsi3
1.21% libevas.so.1.18.99 [.] evas_object_is_active
1.14% libc-2.24.so [.] malloc
0.96% libevas.so.1.18.99 [.] evas_render_mapped
0.85% libeo.so.1.18.99 [.] efl_isa
yeah. it's perf. it's sampling so not 100% accurate, but close to
"good enough" for the bigger stuff. so interestingly memcmp() is
actually in a special library/module (libarmmem.so) and is a REAL
function call. so doing memcmp's for small bits of memory ESPECIALLY
when we know their size in advance is not great. i am not sure our own
use of memcmp() is the actual culprit because even with this patch
memcmp still is right up there. we use it for stringshare which is
harder to remove as stringshare has variable sized memory blobs to
compare.
but the point remains - memcmp() is an ACTUAL function call. even on
x86 (i checked the assembly). and replacing it with a static inline
custom comparer is better. in fact i did that and benchmarked it as a
sample case for eina_tiler which has 4 ints (16 bytes) to compare
every time. i also compiled to assembly on x86 to inspect and make sure
things made sense.
the text color compare was just comparing 4 bytes as a color (an int
worth) which was silly to use memcmp on as it could just cast to an
int and do a == b. the map was a little more evil as it was 2 ptrs
plus 2 bitfields, but the way bitfields work means i can assume the
last byte is both bitfields combined. i can be a little more evil for
the rect tests as 4 ints compared is the same as comparing 2 long
longs (64bit types). yes. don't get pedantic. all platforms efl works
on work this way and this is a base assumption in efl and it's true
everywhere worth talking about.
yes - i tried __int128 too. it was not faster on x86 anyway and can't
compile on armv7. in my speed tests on x86-64, comparing 2 rects by
casting to a struct of 2 long long's and comparing just those is 70%
faster than comapring 4 ints. and the 2 long longs is 360% faster than
a memcmp. on arm (my rpi3) the long long is 12% faster than the 4 ints,
and it is 226% faster than a memcmp().
it'd be best if we didnt even have to compare at all, but with these
algorithms we do, so doing it faster is better.
we probably should nuke all the memcmp's we have that are not of large
bits of memory or variable sized bits of memory.
i set breakpoints for memcmp and found at least a chunk in efl. but
also it seems the vc4 driver was also doing it too. i have no idea how
much memory it was doing this to and it may ultimately be the biggest
culprit here, BUT we may as well reduce our overhead since i've found
this anyway. less "false positives" when hunting problems.
why am i doing this? i'm setting framerate hiccups. eg like we drop 3,
5 or 10 frames, then drop another bunch, then go back to smooth, then
this hiccup again. finding out WHAT is causing that hiccup is hard. i
can only SEE the hiccups on my rpi3 - not on x86. i am not so sure
it's cpufreq bouncing about as i've locked cpu to 600mhz and it still
happens. it's something else. maybe something we are polling? maybe
it's something in our drm/kms backend? maybe its in the vc4 drivers or
kernel parts? i have no idea. trying to hunt this is hard, but this is
important as this is something that possibly is affecting everyone but
other hw is fast enough to hide it...
in the meantime find and optimize what i find along the way.
@optimize
2016-11-05 20:30:13 -07:00
|
|
|
static inline Eina_Bool
|
|
|
|
_map_same(const void *map1, const void *map2)
|
|
|
|
{
|
|
|
|
const Map_Same *same1 = map1, *same2 = map2;
|
|
|
|
return ((same1->p1 == same2->p1) &&
|
|
|
|
(same1->p2 == same2->p2) &&
|
|
|
|
(same1->b1 == same2->b1));
|
|
|
|
}
|
|
|
|
|
2012-07-17 02:09:45 -07:00
|
|
|
void
|
2017-02-03 18:31:55 -08:00
|
|
|
evas_object_cur_prev(Evas_Object_Protected_Data *obj)
|
2012-07-17 02:09:45 -07:00
|
|
|
{
|
2013-01-21 19:56:00 -08:00
|
|
|
if (!obj->map->prev.valid_map && obj->map->prev.map)
|
2012-09-12 11:36:15 -07:00
|
|
|
{
|
2013-01-21 19:56:00 -08:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
|
|
|
{
|
|
|
|
if (map_write->prev.map != map_write->cur.map)
|
|
|
|
evas_map_free(map_write->prev.map);
|
|
|
|
if (map_write->cache_map == map_write->prev.map)
|
|
|
|
map_write->cache_map = NULL;
|
|
|
|
map_write->prev.map = NULL;
|
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
|
2012-09-12 11:36:15 -07:00
|
|
|
}
|
2012-08-23 12:58:02 -07:00
|
|
|
|
2013-01-21 19:56:00 -08:00
|
|
|
if (obj->map->cur.map != obj->map->prev.map)
|
2012-07-17 02:09:45 -07:00
|
|
|
{
|
2013-01-21 19:56:00 -08:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
|
|
|
{
|
|
|
|
if (map_write->cache_map) evas_map_free(map_write->cache_map);
|
|
|
|
map_write->cache_map = map_write->prev.map;
|
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
|
|
|
|
}
|
remove memcmp calls for better performance where size is known
so i have been doing some profiling on my rpi3 ... and it seems
memcmp() is like the number one top used function - especially running
e in wayland compositor mode. it uses accoring to perf top about 9-15%
of samples (samples are not adding up to 100%). no - i cant seem to
get a call graph because all that happens is the whole kernel locks up
solid if i try, so i can only get the leaf node call stats. what
function was currently active at the sample time. memcmp is the
biggest by far. 2-3 times anything else.
13.47% libarmmem.so [.] memcmp
6.43% libevas.so.1.18.99 [.] _evas_render_phase1_object_pro
4.74% libevas.so.1.18.99 [.] evas_render_updates_internal.c
2.84% libeo.so.1.18.99 [.] _eo_obj_pointer_get
2.49% libevas.so.1.18.99 [.] evas_render_updates_internal_l
2.03% libpthread-2.24.so [.] pthread_getspecific
1.61% libeo.so.1.18.99 [.] efl_data_scope_get
1.60% libevas.so.1.18.99 [.] _evas_event_object_list_raw_in
1.54% libevas.so.1.18.99 [.] evas_object_smart_changed_get
1.32% libgcc_s.so.1 [.] __udivsi3
1.21% libevas.so.1.18.99 [.] evas_object_is_active
1.14% libc-2.24.so [.] malloc
0.96% libevas.so.1.18.99 [.] evas_render_mapped
0.85% libeo.so.1.18.99 [.] efl_isa
yeah. it's perf. it's sampling so not 100% accurate, but close to
"good enough" for the bigger stuff. so interestingly memcmp() is
actually in a special library/module (libarmmem.so) and is a REAL
function call. so doing memcmp's for small bits of memory ESPECIALLY
when we know their size in advance is not great. i am not sure our own
use of memcmp() is the actual culprit because even with this patch
memcmp still is right up there. we use it for stringshare which is
harder to remove as stringshare has variable sized memory blobs to
compare.
but the point remains - memcmp() is an ACTUAL function call. even on
x86 (i checked the assembly). and replacing it with a static inline
custom comparer is better. in fact i did that and benchmarked it as a
sample case for eina_tiler which has 4 ints (16 bytes) to compare
every time. i also compiled to assembly on x86 to inspect and make sure
things made sense.
the text color compare was just comparing 4 bytes as a color (an int
worth) which was silly to use memcmp on as it could just cast to an
int and do a == b. the map was a little more evil as it was 2 ptrs
plus 2 bitfields, but the way bitfields work means i can assume the
last byte is both bitfields combined. i can be a little more evil for
the rect tests as 4 ints compared is the same as comparing 2 long
longs (64bit types). yes. don't get pedantic. all platforms efl works
on work this way and this is a base assumption in efl and it's true
everywhere worth talking about.
yes - i tried __int128 too. it was not faster on x86 anyway and can't
compile on armv7. in my speed tests on x86-64, comparing 2 rects by
casting to a struct of 2 long long's and comparing just those is 70%
faster than comapring 4 ints. and the 2 long longs is 360% faster than
a memcmp. on arm (my rpi3) the long long is 12% faster than the 4 ints,
and it is 226% faster than a memcmp().
it'd be best if we didnt even have to compare at all, but with these
algorithms we do, so doing it faster is better.
we probably should nuke all the memcmp's we have that are not of large
bits of memory or variable sized bits of memory.
i set breakpoints for memcmp and found at least a chunk in efl. but
also it seems the vc4 driver was also doing it too. i have no idea how
much memory it was doing this to and it may ultimately be the biggest
culprit here, BUT we may as well reduce our overhead since i've found
this anyway. less "false positives" when hunting problems.
why am i doing this? i'm setting framerate hiccups. eg like we drop 3,
5 or 10 frames, then drop another bunch, then go back to smooth, then
this hiccup again. finding out WHAT is causing that hiccup is hard. i
can only SEE the hiccups on my rpi3 - not on x86. i am not so sure
it's cpufreq bouncing about as i've locked cpu to 600mhz and it still
happens. it's something else. maybe something we are polling? maybe
it's something in our drm/kms backend? maybe its in the vc4 drivers or
kernel parts? i have no idea. trying to hunt this is hard, but this is
important as this is something that possibly is affecting everyone but
other hw is fast enough to hide it...
in the meantime find and optimize what i find along the way.
@optimize
2016-11-05 20:30:13 -07:00
|
|
|
if (!_map_same(&obj->map->prev, &obj->map->cur))
|
2013-01-21 19:56:00 -08:00
|
|
|
{
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
|
|
|
map_write->prev = map_write->cur;
|
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
|
2012-07-17 02:09:45 -07:00
|
|
|
}
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_clip_prev_reset(obj, EINA_TRUE);
|
2013-03-12 05:58:19 -07:00
|
|
|
eina_cow_memcpy(evas_object_state_cow, (const Eina_Cow_Data **) &obj->prev, obj->cur);
|
2012-07-17 02:09:45 -07:00
|
|
|
}
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
void
|
2018-05-14 16:15:48 -07:00
|
|
|
evas_object_free(Evas_Object_Protected_Data *obj, Eina_Bool clean_layer)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2018-05-14 16:15:48 -07:00
|
|
|
Evas_Object *eo_obj;
|
2005-10-26 19:44:36 -07:00
|
|
|
int was_smart_child = 0;
|
2006-07-30 07:30:24 -07:00
|
|
|
|
2018-05-14 16:15:48 -07:00
|
|
|
if (!obj) return ;
|
|
|
|
eo_obj = obj->object;
|
|
|
|
|
2017-02-27 15:00:55 -08:00
|
|
|
evas_object_callback_shutdown(eo_obj, obj);
|
2016-08-15 06:44:41 -07:00
|
|
|
if (efl_isa(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS))
|
2016-03-16 03:03:41 -07:00
|
|
|
_evas_object_image_free(eo_obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_map_set(eo_obj, NULL);
|
2013-01-21 19:56:00 -08:00
|
|
|
if (obj->map->prev.map) evas_map_free(obj->map->prev.map);
|
|
|
|
if (obj->map->cache_map) evas_map_free(obj->map->cache_map);
|
|
|
|
if (obj->map->surface)
|
2012-09-07 01:02:32 -07:00
|
|
|
{
|
2012-11-11 18:22:39 -08:00
|
|
|
if (obj->layer)
|
|
|
|
{
|
2017-04-24 15:09:25 -07:00
|
|
|
obj->layer->evas->engine.func->image_free(ENC, obj->map->surface);
|
2012-11-11 18:22:39 -08:00
|
|
|
}
|
2013-01-21 19:56:00 -08:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
|
|
|
map_write->surface = NULL;
|
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
|
2012-09-07 01:02:32 -07:00
|
|
|
}
|
2015-01-21 00:30:18 -08:00
|
|
|
if (obj->mask->is_mask)
|
|
|
|
{
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_mask_cow, obj->mask, Evas_Object_Mask_Data, mask)
|
|
|
|
mask->is_mask = EINA_FALSE;
|
|
|
|
mask->redraw = EINA_FALSE;
|
|
|
|
mask->is_alpha = EINA_FALSE;
|
2015-02-03 19:08:50 -08:00
|
|
|
mask->w = mask->h = 0;
|
2015-01-21 00:30:18 -08:00
|
|
|
if (mask->surface)
|
|
|
|
{
|
2016-07-11 05:14:51 -07:00
|
|
|
if (obj->layer)
|
|
|
|
{
|
2017-04-24 15:09:25 -07:00
|
|
|
obj->layer->evas->engine.func->image_free(ENC, mask->surface);
|
2016-07-11 05:14:51 -07:00
|
|
|
mask->surface = NULL;
|
|
|
|
}
|
2015-01-21 00:30:18 -08:00
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_mask_cow, obj->mask, mask);
|
|
|
|
}
|
2018-05-14 16:15:48 -07:00
|
|
|
if (eo_obj)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2018-05-14 16:15:48 -07:00
|
|
|
evas_object_grabs_cleanup(eo_obj, obj);
|
|
|
|
evas_object_intercept_cleanup(eo_obj);
|
|
|
|
if (obj->smart.parent) was_smart_child = 1;
|
|
|
|
evas_object_smart_cleanup(eo_obj);
|
|
|
|
if (obj->func->free)
|
|
|
|
{
|
|
|
|
obj->func->free(eo_obj, obj, obj->private_data);
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
2018-05-14 16:15:48 -07:00
|
|
|
if (!was_smart_child) evas_object_release(eo_obj, obj, !!clean_layer);
|
2013-11-03 19:23:25 -08:00
|
|
|
if (obj->clip.clipees)
|
2013-12-29 22:54:21 -08:00
|
|
|
obj->clip.clipees = eina_list_free(obj->clip.clipees);
|
2013-04-10 21:21:54 -07:00
|
|
|
obj->clip.cache_clipees_answer = eina_list_free(obj->clip.cache_clipees_answer);
|
2017-02-03 18:31:55 -08:00
|
|
|
evas_object_clip_changes_clean(obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_event_callback_all_del(eo_obj);
|
|
|
|
evas_object_event_callback_cleanup(eo_obj);
|
2013-01-21 19:56:00 -08:00
|
|
|
if (obj->map->spans)
|
2012-08-03 21:14:38 -07:00
|
|
|
{
|
2013-01-21 19:56:00 -08:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
|
|
|
{
|
|
|
|
free(map_write->spans);
|
|
|
|
map_write->spans = NULL;
|
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2010-11-26 02:01:18 -08:00
|
|
|
if (obj->size_hints)
|
|
|
|
{
|
2013-11-03 19:23:25 -08:00
|
|
|
EVAS_MEMPOOL_FREE(_mp_sh, obj->size_hints);
|
2010-11-26 02:01:18 -08:00
|
|
|
}
|
2013-11-03 19:47:48 -08:00
|
|
|
eina_cow_free(evas_object_proxy_cow, (const Eina_Cow_Data**) &obj->proxy);
|
|
|
|
eina_cow_free(evas_object_map_cow, (const Eina_Cow_Data**) &obj->map);
|
|
|
|
eina_cow_free(evas_object_state_cow, (const Eina_Cow_Data**) &obj->cur);
|
|
|
|
eina_cow_free(evas_object_state_cow, (const Eina_Cow_Data**) &obj->prev);
|
2013-12-26 23:56:30 -08:00
|
|
|
eina_cow_free(evas_object_3d_cow, (const Eina_Cow_Data**) &obj->data_3d);
|
2014-11-12 17:40:16 -08:00
|
|
|
eina_cow_free(evas_object_mask_cow, (const Eina_Cow_Data**) &obj->mask);
|
2017-06-14 10:00:04 -07:00
|
|
|
eina_cow_free(evas_object_events_cow, (const Eina_Cow_Data**) &obj->events);
|
2017-10-13 04:40:01 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_data_unref(eo_obj, obj->private_data);
|
2013-07-08 17:46:15 -07:00
|
|
|
obj->private_data = NULL;
|
2013-11-26 04:16:22 -08:00
|
|
|
|
|
|
|
/* Try to manual free, and if it fails, unset it so the next unref will
|
|
|
|
* actually free the object. */
|
2016-08-15 06:44:41 -07:00
|
|
|
if (!efl_manual_free(eo_obj))
|
|
|
|
efl_manual_free_set(eo_obj, EINA_FALSE);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2017-02-20 22:11:42 -08:00
|
|
|
evas_object_change(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l;
|
2013-04-10 21:21:54 -07:00
|
|
|
Evas_Object_Protected_Data *obj2;
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj2;
|
2012-05-17 03:51:54 -07:00
|
|
|
Eina_Bool movch = EINA_FALSE;
|
2015-06-17 07:31:14 -07:00
|
|
|
Evas_Canvas3D_Texture *texture;
|
2012-05-17 03:51:54 -07:00
|
|
|
|
2015-10-16 19:19:06 -07:00
|
|
|
if ((!obj->layer) || (!obj->layer->evas)) return;
|
2012-05-17 03:51:54 -07:00
|
|
|
if (obj->layer->evas->nochange) return;
|
|
|
|
obj->layer->evas->changed = EINA_TRUE;
|
2011-06-08 19:45:59 -07:00
|
|
|
|
2011-01-19 03:59:53 -08:00
|
|
|
if (obj->changed_move)
|
|
|
|
{
|
2012-05-17 03:51:54 -07:00
|
|
|
movch = EINA_TRUE;
|
2012-03-28 00:17:39 -07:00
|
|
|
obj->changed_move = EINA_FALSE;
|
2011-01-19 03:59:53 -08:00
|
|
|
}
|
2014-08-06 23:32:39 -07:00
|
|
|
else obj->need_surface_clear = EINA_TRUE;
|
2012-05-17 03:51:54 -07:00
|
|
|
|
2012-07-16 20:35:53 -07:00
|
|
|
if (obj->changed) return;
|
2012-05-17 03:51:54 -07:00
|
|
|
|
2017-02-20 19:24:56 -08:00
|
|
|
evas_render_object_recalc(obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
/* set changed flag on all objects this one clips too */
|
2011-01-19 03:59:53 -08:00
|
|
|
if (!((movch) && (obj->is_static_clip)))
|
|
|
|
{
|
2013-04-10 21:21:54 -07:00
|
|
|
EINA_LIST_FOREACH(obj->clip.clipees, l, obj2)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2013-04-10 21:21:54 -07:00
|
|
|
evas_object_change(obj2->object, obj2);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
}
|
2013-01-16 23:21:06 -08:00
|
|
|
EINA_LIST_FOREACH(obj->proxy->proxies, l, eo_obj2)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
obj2 = efl_data_scope_get(eo_obj2, MY_CLASS);
|
2013-04-10 21:21:54 -07:00
|
|
|
|
2013-11-17 20:08:28 -08:00
|
|
|
if (!obj2) continue;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj2, obj2);
|
2011-01-19 03:59:53 -08:00
|
|
|
}
|
2013-12-26 23:56:30 -08:00
|
|
|
EINA_LIST_FOREACH(obj->proxy->proxy_textures, l, texture)
|
|
|
|
{
|
2016-03-01 10:06:28 -08:00
|
|
|
evas_canvas3d_object_change(texture, EVAS_CANVAS3D_STATE_TEXTURE_DATA, NULL);
|
2013-12-26 23:56:30 -08:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->smart.parent)
|
2011-05-19 06:01:44 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *smart_parent = efl_data_scope_get(obj->smart.parent, MY_CLASS);
|
2012-11-09 19:44:04 -08:00
|
|
|
if (!smart_parent) return;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(obj->smart.parent, smart_parent);
|
2011-05-19 06:01:44 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2013-02-28 13:36:32 -08:00
|
|
|
void
|
|
|
|
evas_object_content_change(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
if ((obj->map) && (obj->map->surface))
|
|
|
|
{
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_map_cow,
|
|
|
|
obj->map, Evas_Object_Map_Data, map_write)
|
|
|
|
{
|
2017-04-24 15:09:25 -07:00
|
|
|
obj->layer->evas->engine.func->image_free(ENC, map_write->surface);
|
2013-02-28 13:36:32 -08:00
|
|
|
map_write->surface = NULL;
|
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-07 14:29:29 -07:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *eo_obj, int is_v, int was_v)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, MY_CLASS);
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2012-11-09 19:44:04 -08:00
|
|
|
if (!obj) return;
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart) return;
|
2011-12-26 15:09:45 -08:00
|
|
|
if (is_v == was_v) return;
|
2002-11-08 00:02:15 -08:00
|
|
|
if (is_v)
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_add_rect(rects,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->cache.clip.x,
|
|
|
|
obj->cur->cache.clip.y,
|
|
|
|
obj->cur->cache.clip.w,
|
|
|
|
obj->cur->cache.clip.h);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_add_rect(rects,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->prev->cache.clip.x,
|
|
|
|
obj->prev->cache.clip.y,
|
|
|
|
obj->prev->cache.clip.w,
|
|
|
|
obj->prev->cache.clip.h);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-07 14:29:29 -07:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *eo_obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, MY_CLASS);
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2012-11-09 19:44:04 -08:00
|
|
|
if (!obj) return;
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart) return;
|
2013-03-12 05:58:19 -07:00
|
|
|
if (obj->cur->clipper == obj->prev->clipper) return;
|
|
|
|
if ((obj->cur->clipper) && (obj->prev->clipper))
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
/* get difference rects between clippers */
|
|
|
|
evas_rects_return_difference_rects(rects,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->clipper->cur->cache.clip.x,
|
|
|
|
obj->cur->clipper->cur->cache.clip.y,
|
|
|
|
obj->cur->clipper->cur->cache.clip.w,
|
|
|
|
obj->cur->clipper->cur->cache.clip.h,
|
|
|
|
obj->prev->clipper->prev->cache.clip.x,
|
|
|
|
obj->prev->clipper->prev->cache.clip.y,
|
|
|
|
obj->prev->clipper->prev->cache.clip.w,
|
|
|
|
obj->prev->clipper->prev->cache.clip.h);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2013-03-12 05:58:19 -07:00
|
|
|
else if (obj->cur->clipper)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_rects_return_difference_rects(rects,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->geometry.x,
|
|
|
|
obj->cur->geometry.y,
|
|
|
|
obj->cur->geometry.w,
|
|
|
|
obj->cur->geometry.h,
|
|
|
|
//// rl = evas_rects_return_difference_rects(obj->cur->cache.geometry.x,
|
|
|
|
//// obj->cur->cache.geometry.y,
|
|
|
|
//// obj->cur->cache.geometry.w,
|
|
|
|
//// obj->cur->cache.geometry.h,
|
|
|
|
obj->cur->clipper->cur->cache.clip.x,
|
|
|
|
obj->cur->clipper->cur->cache.clip.y,
|
|
|
|
obj->cur->clipper->cur->cache.clip.w,
|
|
|
|
obj->cur->clipper->cur->cache.clip.h);
|
|
|
|
}
|
|
|
|
else if (obj->prev->clipper)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
evas_rects_return_difference_rects(rects,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->prev->geometry.x,
|
|
|
|
obj->prev->geometry.y,
|
|
|
|
obj->prev->geometry.w,
|
|
|
|
obj->prev->geometry.h,
|
|
|
|
//// rl = evas_rects_return_difference_rects(obj->prev->cache.geometry.x,
|
|
|
|
//// obj->prev->cache.geometry.y,
|
|
|
|
//// obj->prev->cache.geometry.w,
|
|
|
|
//// obj->prev->cache.geometry.h,
|
|
|
|
obj->prev->clipper->prev->cache.clip.x,
|
|
|
|
obj->prev->clipper->prev->cache.clip.y,
|
|
|
|
obj->prev->clipper->prev->cache.clip.w,
|
|
|
|
obj->prev->clipper->prev->cache.clip.h);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-07 14:29:29 -07:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!obj) return;
|
|
|
|
|
2008-07-07 14:29:29 -07:00
|
|
|
evas_add_rect(rects,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->cache.clip.x,
|
|
|
|
obj->cur->cache.clip.y,
|
|
|
|
obj->cur->cache.clip.w,
|
|
|
|
obj->cur->cache.clip.h);
|
2009-11-03 07:41:36 -08:00
|
|
|
evas_add_rect(rects,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->prev->cache.clip.x,
|
|
|
|
obj->prev->cache.clip.y,
|
|
|
|
obj->prev->cache.clip.w,
|
|
|
|
obj->prev->cache.clip.h);
|
2012-03-28 00:17:39 -07:00
|
|
|
/*
|
2009-11-03 07:41:36 -08:00
|
|
|
evas_add_rect(rects,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->geometry.x,
|
|
|
|
obj->cur->geometry.y,
|
|
|
|
obj->cur->geometry.w,
|
|
|
|
obj->cur->geometry.h);
|
|
|
|
//// obj->cur->cache.geometry.x,
|
|
|
|
//// obj->cur->cache.geometry.y,
|
|
|
|
//// obj->cur->cache.geometry.w,
|
|
|
|
//// obj->cur->cache.geometry.h);
|
2009-11-03 07:41:36 -08:00
|
|
|
evas_add_rect(rects,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->prev->geometry.x,
|
|
|
|
obj->prev->geometry.y,
|
|
|
|
obj->prev->geometry.w,
|
|
|
|
obj->prev->geometry.h);
|
|
|
|
//// obj->prev->cache.geometry.x,
|
|
|
|
//// obj->prev->cache.geometry.y,
|
|
|
|
//// obj->prev->cache.geometry.w,
|
|
|
|
//// obj->prev->cache.geometry.h);
|
2009-11-03 07:41:36 -08:00
|
|
|
*/
|
2005-05-21 19:49:50 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2009-04-14 05:15:07 -07:00
|
|
|
void
|
2017-02-03 18:31:55 -08:00
|
|
|
evas_object_clip_changes_clean(Evas_Object_Protected_Data *obj)
|
2009-04-14 05:15:07 -07:00
|
|
|
{
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2009-04-14 05:15:07 -07:00
|
|
|
|
2017-02-03 18:31:55 -08:00
|
|
|
EINA_LIST_FREE(obj->clip.changes, r) eina_rectangle_free(r);
|
2009-04-14 05:15:07 -07:00
|
|
|
}
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, int is_v, int was_v EINA_UNUSED)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, MY_CLASS);
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *l;
|
2008-07-07 14:29:29 -07:00
|
|
|
unsigned int i;
|
2009-04-15 06:40:37 -07:00
|
|
|
Eina_Array_Iterator it;
|
2008-07-07 14:29:29 -07:00
|
|
|
int x, y, w, h;
|
2002-11-08 00:02:15 -08:00
|
|
|
|
2012-10-10 00:23:00 -07:00
|
|
|
if (!obj) return;
|
2012-11-11 18:22:39 -08:00
|
|
|
if (!obj->layer) return;
|
2012-10-10 00:23:00 -07:00
|
|
|
|
2018-06-05 04:58:35 -07:00
|
|
|
if (obj->is_smart) goto end;
|
2002-11-08 00:02:15 -08:00
|
|
|
/* FIXME: was_v isn't used... why? */
|
|
|
|
if (!obj->clip.clipees)
|
|
|
|
{
|
2013-04-26 11:01:44 -07:00
|
|
|
Evas_Public_Data *e;
|
|
|
|
e = obj->layer->evas;
|
2011-06-08 19:45:59 -07:00
|
|
|
EINA_ARRAY_ITER_NEXT(rects, i, r, it)
|
|
|
|
{
|
|
|
|
/* get updates and clip to current clip */
|
|
|
|
x = r->x;
|
|
|
|
y = r->y;
|
|
|
|
w = r->w;
|
|
|
|
h = r->h;
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->cache.clip.x,
|
|
|
|
obj->cur->cache.clip.y,
|
|
|
|
obj->cur->cache.clip.w,
|
|
|
|
obj->cur->cache.clip.h);
|
2011-06-08 19:45:59 -07:00
|
|
|
if ((w > 0) && (h > 0))
|
2017-08-25 10:49:53 -07:00
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(ENC,
|
2013-04-26 11:01:44 -07:00
|
|
|
x + e->framespace.x,
|
|
|
|
y + e->framespace.y,
|
|
|
|
w, h);
|
2011-06-08 19:45:59 -07:00
|
|
|
/* get updates and clip to previous clip */
|
|
|
|
x = r->x;
|
|
|
|
y = r->y;
|
|
|
|
w = r->w;
|
|
|
|
h = r->h;
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->prev->cache.clip.x,
|
|
|
|
obj->prev->cache.clip.y,
|
|
|
|
obj->prev->cache.clip.w,
|
|
|
|
obj->prev->cache.clip.h);
|
2011-06-08 19:45:59 -07:00
|
|
|
if ((w > 0) && (h > 0))
|
2017-08-25 10:49:53 -07:00
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(ENC,
|
2013-04-26 11:01:44 -07:00
|
|
|
x + e->framespace.x,
|
|
|
|
y + e->framespace.y,
|
|
|
|
w, h);
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
|
|
|
/* if the object is actually visible, take any parent clip changes */
|
|
|
|
if (is_v)
|
|
|
|
{
|
2012-10-10 00:23:00 -07:00
|
|
|
Evas_Object_Protected_Data *clipper;
|
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
clipper = obj->cur->clipper;
|
2012-10-10 00:23:00 -07:00
|
|
|
while (clipper)
|
2011-06-08 19:45:59 -07:00
|
|
|
{
|
|
|
|
EINA_LIST_FOREACH(clipper->clip.changes, l, r)
|
|
|
|
{
|
|
|
|
/* get updates and clip to current clip */
|
|
|
|
x = r->x; y = r->y; w = r->w; h = r->h;
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->cur->cache.clip.x,
|
|
|
|
obj->cur->cache.clip.y,
|
|
|
|
obj->cur->cache.clip.w,
|
|
|
|
obj->cur->cache.clip.h);
|
2011-06-08 19:45:59 -07:00
|
|
|
if ((w > 0) && (h > 0))
|
2017-08-25 10:49:53 -07:00
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(ENC,
|
2013-04-26 11:01:44 -07:00
|
|
|
x + e->framespace.x,
|
|
|
|
y + e->framespace.y,
|
|
|
|
w, h);
|
2011-06-08 19:45:59 -07:00
|
|
|
/* get updates and clip to previous clip */
|
|
|
|
x = r->x; y = r->y; w = r->w; h = r->h;
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->prev->cache.clip.x,
|
|
|
|
obj->prev->cache.clip.y,
|
|
|
|
obj->prev->cache.clip.w,
|
|
|
|
obj->prev->cache.clip.h);
|
2011-06-08 19:45:59 -07:00
|
|
|
if ((w > 0) && (h > 0))
|
2017-08-25 10:49:53 -07:00
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(ENC,
|
2013-04-26 11:01:44 -07:00
|
|
|
x + e->framespace.x,
|
|
|
|
y + e->framespace.y,
|
|
|
|
w, h);
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
2013-03-12 05:58:19 -07:00
|
|
|
clipper = clipper->cur->clipper;
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-11-12 17:40:16 -08:00
|
|
|
/* This is a clipper object: add regions that changed here,
|
|
|
|
* See above: EINA_LIST_FOREACH(clipper->clip.changes) */
|
2017-02-03 18:31:55 -08:00
|
|
|
evas_object_clip_changes_clean(obj);
|
2011-06-08 19:45:59 -07:00
|
|
|
EINA_ARRAY_ITER_NEXT(rects, i, r, it)
|
|
|
|
obj->clip.changes = eina_list_append(obj->clip.changes, r);
|
|
|
|
eina_array_clean(rects);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2008-07-07 14:29:29 -07:00
|
|
|
|
2018-06-05 05:36:22 -07:00
|
|
|
end:
|
2009-04-15 06:40:37 -07:00
|
|
|
EINA_ARRAY_ITER_NEXT(rects, i, r, it)
|
2009-06-23 06:57:27 -07:00
|
|
|
eina_rectangle_free(r);
|
2009-04-15 06:40:37 -07:00
|
|
|
eina_array_clean(rects);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_was_in_output_rect(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, int x, int y, int w, int h)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2013-01-21 19:56:00 -08:00
|
|
|
if (obj->is_smart && !obj->map->prev.map && !obj->map->prev.usemap) return 0;
|
2002-11-08 00:02:15 -08:00
|
|
|
/* assumes coords have been recalced */
|
|
|
|
if ((RECTS_INTERSECT(x, y, w, h,
|
2013-03-12 05:58:19 -07:00
|
|
|
obj->prev->cache.clip.x,
|
|
|
|
obj->prev->cache.clip.y,
|
|
|
|
obj->prev->cache.clip.w,
|
|
|
|
obj->prev->cache.clip.h)))
|
2002-11-08 00:02:15 -08:00
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart) return 0;
|
2013-03-12 05:58:19 -07:00
|
|
|
if (obj->prev->cache.clip.a == 255)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (obj->func->was_opaque)
|
2013-07-08 17:46:15 -07:00
|
|
|
return obj->func->was_opaque(eo_obj, obj, obj->private_data);
|
2011-06-08 19:45:59 -07:00
|
|
|
return 1;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-07-23 07:22:57 -07:00
|
|
|
int
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord x, Evas_Coord y)
|
2007-07-23 07:22:57 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart) return 0;
|
2007-07-23 07:22:57 -07:00
|
|
|
if (obj->func->is_inside)
|
2013-07-08 17:46:15 -07:00
|
|
|
return obj->func->is_inside(eo_obj, obj, obj->private_data, x, y);
|
2007-07-23 07:22:57 -07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_was_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord x, Evas_Coord y)
|
2007-07-23 07:22:57 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart) return 0;
|
2007-07-23 07:22:57 -07:00
|
|
|
if (obj->func->was_inside)
|
2013-07-08 17:46:15 -07:00
|
|
|
return obj->func->was_inside(eo_obj, obj, obj->private_data, x, y);
|
2007-07-23 07:22:57 -07:00
|
|
|
return 0;
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
/* routines apps will call */
|
|
|
|
|
2011-03-08 04:23:37 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_ref(Evas_Object *eo_obj)
|
2011-03-08 04:23:37 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2011-03-08 04:23:37 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_ref(eo_obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, MY_CLASS);
|
2012-11-09 19:44:04 -08:00
|
|
|
if (!obj) return;
|
2011-03-08 04:23:37 -08:00
|
|
|
obj->ref++;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_unref(Evas_Object *eo_obj)
|
2011-03-08 04:23:37 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2011-03-08 04:23:37 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, MY_CLASS);
|
2012-11-09 19:44:04 -08:00
|
|
|
if (!obj) return;
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2011-03-08 04:23:37 -08:00
|
|
|
if (obj->ref == 0) return;
|
|
|
|
obj->ref--;
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_unref(eo_obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((obj->del_ref) && (obj->ref == 0)) evas_object_del(eo_obj);
|
|
|
|
|
2011-03-08 04:23:37 -08:00
|
|
|
}
|
|
|
|
|
2012-03-29 00:46:30 -07:00
|
|
|
EAPI int
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_ref_get(const Evas_Object *eo_obj)
|
2012-03-29 00:46:30 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2012-03-29 00:46:30 -07:00
|
|
|
return 0;
|
|
|
|
MAGIC_CHECK_END();
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, MY_CLASS);
|
2012-11-09 19:44:04 -08:00
|
|
|
if (!obj) return 0;
|
2012-03-29 00:46:30 -07:00
|
|
|
return obj->ref;
|
|
|
|
}
|
|
|
|
|
2017-09-28 02:03:33 -07:00
|
|
|
EAPI void
|
2018-05-08 18:08:57 -07:00
|
|
|
evas_object_del(Evas_Object *obj)
|
2017-09-28 02:03:33 -07:00
|
|
|
{
|
2018-05-08 18:08:57 -07:00
|
|
|
Evas_Object_Protected_Data *pd;
|
|
|
|
|
|
|
|
if (!obj) return;
|
|
|
|
if (!efl_isa(obj, MY_CLASS))
|
2017-09-28 02:03:33 -07:00
|
|
|
{
|
|
|
|
ERR("Called %s on a non-evas object: %s@%p",
|
2018-05-08 18:08:57 -07:00
|
|
|
__FUNCTION__, efl_class_name_get(obj), obj);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
pd = efl_data_scope_get(obj, MY_CLASS);
|
2018-05-17 13:44:29 -07:00
|
|
|
if (pd->delete_me || pd->efl_del_called) return;
|
2018-05-08 18:08:57 -07:00
|
|
|
if (pd->ref)
|
|
|
|
{
|
|
|
|
pd->del_ref = EINA_TRUE;
|
2017-09-28 02:03:33 -07:00
|
|
|
return;
|
|
|
|
}
|
2018-05-08 18:08:57 -07:00
|
|
|
efl_del(obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2016-12-06 06:42:30 -08:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_efl_input_interface_seat_event_filter_get(const Eo *eo_obj EINA_UNUSED,
|
2016-12-06 06:42:30 -08:00
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
Efl_Input_Device *seat)
|
|
|
|
{
|
2016-12-19 07:58:01 -08:00
|
|
|
//It means this object accept events from any seat.
|
|
|
|
if (!obj->events_filter_enabled)
|
2016-12-06 06:42:30 -08:00
|
|
|
return EINA_TRUE;
|
2017-06-13 09:36:33 -07:00
|
|
|
return eina_list_data_find(obj->events->events_whitelist, seat) ?
|
2016-12-06 06:42:30 -08:00
|
|
|
EINA_TRUE : EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_whitelist_events_device_remove_cb(void *data, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = data;
|
2017-06-13 09:36:33 -07:00
|
|
|
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events)
|
|
|
|
events->events_whitelist = eina_list_remove(events->events_whitelist,
|
|
|
|
event->object);
|
|
|
|
EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
|
2016-12-06 06:42:30 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_efl_canvas_object_efl_input_interface_seat_event_filter_set(Eo *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
Efl_Input_Device *seat,
|
|
|
|
Eina_Bool add)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(seat);
|
|
|
|
|
2017-06-11 22:56:36 -07:00
|
|
|
if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_TYPE_SEAT) return;
|
2016-12-19 07:58:01 -08:00
|
|
|
|
|
|
|
obj->events_filter_enabled = EINA_TRUE;
|
2016-12-06 06:42:30 -08:00
|
|
|
if (add)
|
|
|
|
{
|
2017-06-13 09:36:33 -07:00
|
|
|
if (eina_list_data_find(obj->events->events_whitelist, seat)) return;
|
2016-12-16 12:11:05 -08:00
|
|
|
/* remove all previously focused seats, if any - it may happen
|
|
|
|
since there wasn't a whitelist in place (no restrictions) */
|
2017-06-13 09:36:33 -07:00
|
|
|
if ((!obj->events->events_whitelist) && (obj->layer) && (obj->layer->evas))
|
2016-12-16 12:11:05 -08:00
|
|
|
{
|
|
|
|
const Eina_List *devices, *l;
|
|
|
|
Efl_Input_Device *dev;
|
|
|
|
|
|
|
|
devices = obj->layer->evas->devices;
|
|
|
|
EINA_LIST_FOREACH(devices, l, dev)
|
|
|
|
{
|
|
|
|
if ((efl_input_device_type_get(dev) ==
|
2017-06-11 22:56:36 -07:00
|
|
|
EFL_INPUT_DEVICE_TYPE_SEAT) && (dev != seat))
|
2016-12-16 12:11:05 -08:00
|
|
|
efl_canvas_object_seat_focus_del(eo_obj, dev);
|
|
|
|
}
|
|
|
|
}
|
2017-06-13 09:36:33 -07:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events)
|
|
|
|
events->events_whitelist = eina_list_append(events->events_whitelist, seat);
|
|
|
|
EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
|
|
|
|
|
2016-12-06 06:42:30 -08:00
|
|
|
efl_event_callback_add(seat, EFL_EVENT_DEL,
|
|
|
|
_whitelist_events_device_remove_cb, obj);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-12-16 12:11:05 -08:00
|
|
|
efl_canvas_object_seat_focus_del(eo_obj, seat);
|
2017-06-13 09:36:33 -07:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events)
|
|
|
|
events->events_whitelist = eina_list_remove(events->events_whitelist, seat);
|
|
|
|
EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
|
|
|
|
|
2016-12-06 06:42:30 -08:00
|
|
|
efl_event_callback_del(seat, EFL_EVENT_DEL,
|
|
|
|
_whitelist_events_device_remove_cb, obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-06 13:27:15 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_is_event_blocked(Eo *eo_obj, const Efl_Event_Description *desc,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
if ((desc == EFL_EVENT_FOCUS_IN) ||
|
|
|
|
(desc == EFL_EVENT_FOCUS_OUT) ||
|
|
|
|
(desc == EFL_EVENT_KEY_DOWN) ||
|
|
|
|
(desc == EFL_EVENT_KEY_UP) ||
|
|
|
|
(desc == EFL_EVENT_HOLD) ||
|
|
|
|
(desc == EFL_EVENT_POINTER_IN) ||
|
|
|
|
(desc == EFL_EVENT_POINTER_OUT) ||
|
|
|
|
(desc == EFL_EVENT_POINTER_DOWN) ||
|
|
|
|
(desc == EFL_EVENT_POINTER_UP) ||
|
|
|
|
(desc == EFL_EVENT_POINTER_MOVE) ||
|
|
|
|
(desc == EFL_EVENT_POINTER_WHEEL) ||
|
|
|
|
(desc == EFL_EVENT_POINTER_CANCEL) ||
|
|
|
|
(desc == EFL_EVENT_POINTER_AXIS) ||
|
|
|
|
(desc == EFL_EVENT_FINGER_MOVE) ||
|
|
|
|
(desc == EFL_EVENT_FINGER_DOWN) ||
|
|
|
|
(desc == EFL_EVENT_FINGER_UP))
|
|
|
|
{
|
|
|
|
Efl_Input_Device *seat = efl_input_device_seat_get(efl_input_device_get(event_info));
|
|
|
|
return !efl_input_seat_event_filter_get(eo_obj, seat);
|
|
|
|
}
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
static Event_Animation *
|
|
|
|
_event_animation_find(Evas_Object_Protected_Data *obj,
|
|
|
|
const Efl_Event_Description *desc)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
Event_Animation *event_anim;
|
|
|
|
EINA_INLIST_FOREACH(obj->event_anims, event_anim)
|
|
|
|
{
|
|
|
|
if (event_anim->desc == desc)
|
|
|
|
return event_anim;
|
|
|
|
}
|
|
|
|
return NULL;
|
2017-08-30 00:16:18 -07:00
|
|
|
}
|
|
|
|
|
2016-12-06 13:27:15 -08:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_canvas_object_efl_object_event_callback_call(Eo *eo_obj,
|
2017-10-13 04:40:01 -07:00
|
|
|
Evas_Object_Protected_Data *obj,
|
2016-12-06 13:27:15 -08:00
|
|
|
const Efl_Event_Description *desc,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
if (_is_event_blocked(eo_obj, desc, event_info)) return EINA_FALSE;
|
2017-08-30 00:16:18 -07:00
|
|
|
|
|
|
|
//Start animation corresponding to the current event
|
2017-10-13 04:40:01 -07:00
|
|
|
if (desc)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2018-04-05 01:47:26 -07:00
|
|
|
if ((desc != EFL_GFX_ENTITY_EVENT_HIDE) && desc != (EFL_GFX_ENTITY_EVENT_SHOW))
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
Event_Animation *event_anim = _event_animation_find(obj, desc);
|
|
|
|
if (event_anim)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
//Create animation object to start animation
|
2018-01-16 03:31:15 -08:00
|
|
|
efl_animation_player_animation_set(obj->anim_player, event_anim->anim);
|
2017-10-13 04:40:01 -07:00
|
|
|
|
2018-04-10 06:09:39 -07:00
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_STARTED,
|
|
|
|
_anim_started_cb, desc);
|
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_RUNNING,
|
|
|
|
_anim_running_cb, desc);
|
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_ENDED,
|
|
|
|
_anim_ended_cb, desc);
|
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
//Start animation
|
2018-01-16 03:31:15 -08:00
|
|
|
efl_player_start(obj->anim_player);
|
2017-08-30 00:16:18 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-06 13:27:15 -08:00
|
|
|
return efl_event_callback_call(efl_super(eo_obj, MY_CLASS),
|
|
|
|
desc, event_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_canvas_object_efl_object_event_callback_legacy_call(Eo *eo_obj,
|
2017-10-13 04:40:01 -07:00
|
|
|
Evas_Object_Protected_Data *obj,
|
2016-12-06 13:27:15 -08:00
|
|
|
const Efl_Event_Description *desc,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
if (_is_event_blocked(eo_obj, desc, event_info)) return EINA_FALSE;
|
2017-08-30 00:16:18 -07:00
|
|
|
|
|
|
|
//Start animation corresponding to the current event
|
2017-10-13 04:40:01 -07:00
|
|
|
if (desc)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2018-04-05 01:47:26 -07:00
|
|
|
if ((desc != EFL_GFX_ENTITY_EVENT_HIDE) && desc != (EFL_GFX_ENTITY_EVENT_SHOW))
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
Event_Animation *event_anim = _event_animation_find(obj, desc);
|
|
|
|
if (event_anim)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
//Create animation object to start animation
|
2018-01-16 03:31:15 -08:00
|
|
|
efl_animation_player_animation_set(obj->anim_player, event_anim->anim);
|
2017-10-13 04:40:01 -07:00
|
|
|
|
2018-04-10 06:09:39 -07:00
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_STARTED,
|
|
|
|
_anim_started_cb, desc);
|
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_RUNNING,
|
|
|
|
_anim_running_cb, desc);
|
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_ENDED,
|
|
|
|
_anim_ended_cb, desc);
|
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
//Start animation
|
2018-01-16 03:31:15 -08:00
|
|
|
efl_player_start(obj->anim_player);
|
2017-08-30 00:16:18 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-06 13:27:15 -08:00
|
|
|
return efl_event_callback_legacy_call(efl_super(eo_obj, MY_CLASS),
|
|
|
|
desc, event_info);
|
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2018-05-09 20:01:17 -07:00
|
|
|
_efl_canvas_object_efl_object_invalidate(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-10-19 06:02:18 -07:00
|
|
|
Efl_Input_Device *dev;
|
2016-12-05 08:26:25 -08:00
|
|
|
Evas_Object_Pointer_Data *pdata;
|
2018-05-09 20:01:17 -07:00
|
|
|
Evas_Object *proxy;
|
|
|
|
Eina_List *l, *l2;
|
2017-02-16 02:34:08 -08:00
|
|
|
int event_id;
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2018-05-09 20:01:17 -07:00
|
|
|
evas_object_async_block(obj);
|
|
|
|
|
|
|
|
// Unset callbacks for Hide event before hiding
|
|
|
|
evas_object_intercept_hide_callback_del((Eo *)eo_obj,
|
|
|
|
_animation_intercept_hide);
|
|
|
|
|
|
|
|
efl_gfx_entity_visible_set((Eo *) eo_obj, EINA_FALSE);
|
|
|
|
obj->efl_del_called = EINA_TRUE;
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_hide(eo_obj);
|
2017-06-13 09:36:33 -07:00
|
|
|
|
2018-05-12 22:16:09 -07:00
|
|
|
if (obj->events)
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events)
|
|
|
|
{
|
|
|
|
Evas_Public_Data *edata = NULL;
|
|
|
|
|
|
|
|
if (!efl_invalidated_get(evas_object_evas_get(eo_obj)))
|
|
|
|
edata = efl_data_scope_get(evas_object_evas_get(eo_obj), EVAS_CANVAS_CLASS);
|
|
|
|
|
|
|
|
EINA_LIST_FREE (events->focused_by_seats, dev)
|
|
|
|
{
|
|
|
|
event_id = _evas_event_counter;
|
2018-05-29 09:24:53 -07:00
|
|
|
efl_event_callback_del(dev, EFL_EVENT_INVALIDATE,
|
|
|
|
_evas_focus_device_invalidate_cb, obj);
|
2018-05-12 22:16:09 -07:00
|
|
|
if (edata) eina_hash_del_by_key(edata->focused_objects, &dev);
|
|
|
|
_evas_focus_dispatch_event(obj, dev, EINA_FALSE);
|
|
|
|
if ((obj->layer) && (obj->layer->evas))
|
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
|
|
|
}
|
|
|
|
EINA_INLIST_FREE(events->pointer_grabs, pdata)
|
2018-06-15 08:22:37 -07:00
|
|
|
_evas_object_pointer_grab_del(obj, pdata);
|
2018-05-12 22:16:09 -07:00
|
|
|
EINA_LIST_FREE(events->events_whitelist, dev)
|
|
|
|
efl_event_callback_del(dev, EFL_EVENT_DEL, _whitelist_events_device_remove_cb, obj);
|
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
|
2017-06-13 09:36:33 -07:00
|
|
|
|
2017-02-16 02:34:08 -08:00
|
|
|
event_id = _evas_object_event_new();
|
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_DEL, NULL, event_id, NULL);
|
2015-10-13 22:47:38 -07:00
|
|
|
if ((obj->layer) && (obj->layer->evas))
|
2017-02-16 02:34:08 -08:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
2018-05-09 20:01:17 -07:00
|
|
|
|
2017-06-09 17:16:07 -07:00
|
|
|
if (obj->layer)
|
|
|
|
{
|
|
|
|
if (obj->layer->evas)
|
|
|
|
if (obj->layer->evas->pending_default_focus_obj == eo_obj)
|
|
|
|
obj->layer->evas->pending_default_focus_obj = NULL;
|
|
|
|
}
|
2018-05-09 20:01:17 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_grabs_cleanup(eo_obj, obj);
|
2016-03-16 03:37:04 -07:00
|
|
|
|
|
|
|
/* FIXME: Proxies should listen to source death */
|
2018-05-09 20:01:17 -07:00
|
|
|
if (obj->proxy)
|
2014-03-03 21:14:15 -08:00
|
|
|
{
|
2018-05-09 20:01:17 -07:00
|
|
|
EINA_LIST_FOREACH_SAFE(obj->proxy->proxies, l, l2, proxy)
|
|
|
|
{
|
|
|
|
if (efl_isa(proxy, EFL_CANVAS_IMAGE_INTERNAL_CLASS))
|
|
|
|
evas_object_image_source_unset(proxy);
|
|
|
|
if (efl_isa(proxy, EFL_GFX_FILTER_INTERFACE))
|
|
|
|
efl_gfx_filter_source_set(proxy, NULL, eo_obj);
|
|
|
|
}
|
2014-01-07 00:39:23 -08:00
|
|
|
|
2018-05-09 20:01:17 -07:00
|
|
|
/* Eina_Cow has no way to know if we are going to really change something
|
|
|
|
or not. So before calling the cow, let's check if we want to do something */
|
|
|
|
if (obj->proxy->proxy_textures)
|
2014-10-28 22:15:11 -07:00
|
|
|
{
|
2018-05-09 20:01:17 -07:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy,
|
|
|
|
Evas_Object_Proxy_Data, proxy_src)
|
|
|
|
{
|
|
|
|
Evas_Canvas3D_Texture *texture;
|
|
|
|
|
|
|
|
EINA_LIST_FREE(proxy_src->proxy_textures, texture)
|
|
|
|
evas_canvas3d_texture_source_set(texture, NULL);
|
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_src);
|
2014-10-28 22:15:11 -07:00
|
|
|
}
|
2014-05-12 00:47:54 -07:00
|
|
|
}
|
2014-01-07 00:39:23 -08:00
|
|
|
|
2018-05-15 14:53:13 -07:00
|
|
|
if (obj->cur && obj->cur->clipper) evas_object_clip_unset(eo_obj);
|
|
|
|
if (obj->prev) _efl_canvas_object_clip_prev_reset(obj, EINA_FALSE);
|
2016-01-27 19:18:34 -08:00
|
|
|
|
2018-01-16 03:31:15 -08:00
|
|
|
//Free event animations
|
|
|
|
while (obj->event_anims)
|
|
|
|
{
|
|
|
|
Event_Animation *event_anim =
|
|
|
|
EINA_INLIST_CONTAINER_GET(obj->event_anims, Event_Animation);
|
|
|
|
|
|
|
|
obj->event_anims =
|
|
|
|
eina_inlist_remove(obj->event_anims, obj->event_anims);
|
|
|
|
|
|
|
|
_event_anim_free(event_anim, obj);
|
|
|
|
}
|
|
|
|
|
2018-05-15 14:53:13 -07:00
|
|
|
if (obj->map) evas_object_map_set(eo_obj, NULL);
|
2018-05-09 20:01:17 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->is_smart) evas_object_smart_del(eo_obj);
|
2018-05-09 20:01:17 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
|
|
|
|
|
|
|
efl_invalidate(efl_super(eo_obj, MY_CLASS));
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_efl_canvas_object_efl_object_destructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
|
|
|
{
|
|
|
|
int event_id;
|
|
|
|
|
|
|
|
if (obj->clip.clipees)
|
|
|
|
{
|
|
|
|
ERR("object %p of type '%s' still has %d clippees after del callback",
|
|
|
|
eo_obj, efl_class_name_get(eo_obj), eina_list_count(obj->clip.clipees));
|
|
|
|
/* "while" should be used for null check of obj->clip.clipees,
|
|
|
|
because evas_objct_clip_unset can set null to obj->clip.clipees */
|
|
|
|
while (obj->clip.clipees)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *tmp;
|
|
|
|
tmp = eina_list_data_get(obj->clip.clipees);
|
|
|
|
evas_object_clip_unset(tmp->object);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (obj->name) evas_object_name_set(eo_obj, NULL);
|
|
|
|
if (!obj->layer)
|
|
|
|
{
|
|
|
|
efl_manual_free_set(eo_obj, EINA_FALSE);
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
2017-02-16 02:34:08 -08:00
|
|
|
event_id = _evas_object_event_new();
|
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FREE, NULL, event_id, NULL);
|
2015-10-13 22:47:38 -07:00
|
|
|
if ((obj->layer) && (obj->layer->evas))
|
2017-02-16 02:34:08 -08:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_smart_cleanup(eo_obj);
|
2004-03-07 18:42:08 -08:00
|
|
|
obj->delete_me = 1;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
|
|
|
end:
|
2013-04-11 12:08:24 -07:00
|
|
|
evas_object_event_callback_all_del(eo_obj);
|
|
|
|
evas_object_event_callback_cleanup(eo_obj);
|
2013-07-08 17:46:15 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_destructor(efl_super(eo_obj, MY_CLASS));
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2018-05-09 20:01:17 -07:00
|
|
|
|
2016-06-08 23:05:36 -07:00
|
|
|
EOLIAN static void
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_canvas_object_efl_gfx_entity_geometry_set(Eo *obj, Evas_Object_Protected_Data *pd EINA_UNUSED, Eina_Rect r)
|
2016-06-08 23:05:36 -07:00
|
|
|
{
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_position_set(obj, r.pos);
|
|
|
|
efl_gfx_entity_size_set(obj, EINA_SIZE2D(r.w, r.h));
|
2016-06-08 23:05:36 -07:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2013-07-19 02:37:11 -07:00
|
|
|
evas_object_geometry_set(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_geometry_set(eo_obj, EINA_RECT(x, y, w, h));
|
2015-04-03 07:23:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
|
|
|
{
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_position_set(obj, EINA_POSITION2D(x, y));
|
2013-07-19 02:37:11 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_canvas_object_efl_gfx_entity_position_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Position2D pos)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-21 22:02:53 -07:00
|
|
|
Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE;
|
|
|
|
Eina_Bool source_invisible = EINA_FALSE;
|
2016-10-21 05:25:41 -07:00
|
|
|
Eina_List *was = NULL;
|
2017-02-20 00:25:29 -08:00
|
|
|
Evas_Map *map;
|
2017-09-14 20:14:32 -07:00
|
|
|
int x = pos.x;
|
|
|
|
int y = pos.y;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2017-02-17 01:46:09 -08:00
|
|
|
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 1, x, y))
|
2016-10-10 20:39:05 -07:00
|
|
|
return;
|
2012-01-02 13:27:46 -08:00
|
|
|
|
2017-02-20 00:25:29 -08:00
|
|
|
map = obj->map->cur.map;
|
2014-11-27 20:18:16 -08:00
|
|
|
if (map && map->move_sync.enabled)
|
|
|
|
{
|
|
|
|
Evas_Coord diff_x = x - obj->cur->geometry.x;
|
|
|
|
Evas_Coord diff_y = y - obj->cur->geometry.y;
|
|
|
|
evas_map_object_move_diff_set(map, diff_x, diff_y);
|
|
|
|
}
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!(obj->layer->evas->is_frozen))
|
2005-07-22 03:28:11 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
pass = evas_event_passes_through(eo_obj, obj);
|
|
|
|
freeze = evas_event_freezes_through(eo_obj, obj);
|
2012-10-21 21:57:32 -07:00
|
|
|
source_invisible = evas_object_is_source_invisible(eo_obj, obj);
|
|
|
|
if ((!pass) && (!freeze) && (!source_invisible))
|
2016-10-21 05:25:41 -07:00
|
|
|
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj, obj,
|
|
|
|
1, 1);
|
2005-07-22 03:28:11 -07:00
|
|
|
}
|
2010-10-14 22:39:53 -07:00
|
|
|
obj->doing.in_move++;
|
2011-12-26 15:09:45 -08:00
|
|
|
|
2016-10-10 20:39:05 -07:00
|
|
|
if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class->move)
|
|
|
|
obj->smart.smart->smart_class->move(eo_obj, x, y);
|
2011-12-26 15:09:45 -08:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
{
|
2013-04-26 15:34:35 -07:00
|
|
|
state_write->geometry.x = x;
|
|
|
|
state_write->geometry.y = y;
|
2013-03-12 05:58:19 -07:00
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
2011-12-26 15:09:45 -08:00
|
|
|
|
2016-05-06 17:01:10 -07:00
|
|
|
evas_object_update_bounding_box(eo_obj, obj, NULL);
|
2012-05-01 00:31:42 -07:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
//// obj->cur->cache.geometry.validity = 0;
|
2012-03-28 00:17:39 -07:00
|
|
|
obj->changed_move = EINA_TRUE;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
|
|
|
evas_object_clip_dirty(eo_obj, obj);
|
2010-10-14 22:39:53 -07:00
|
|
|
obj->doing.in_move--;
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!(obj->layer->evas->is_frozen))
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_recalc_clippees(obj);
|
2016-10-21 05:25:41 -07:00
|
|
|
if (!pass && !obj->is_smart && obj->cur->visible)
|
|
|
|
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_TRUE, NULL);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2016-10-21 05:25:41 -07:00
|
|
|
eina_list_free(was);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_move(eo_obj, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2015-04-03 07:23:17 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_size_set((Evas_Object *)obj, EINA_SIZE2D(w, h));
|
2015-04-03 07:23:17 -07:00
|
|
|
}
|
|
|
|
|
evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
- intercept
- smart resize (do stuff), super, super, super
- evas object resize
The new code is more like:
- intercept
- super, super, super, evas object resize
- do stuff
But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-11 00:54:31 -07:00
|
|
|
Eina_Bool
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_canvas_object_efl_gfx_entity_size_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
2016-11-30 23:55:20 -08:00
|
|
|
Evas_Coord w, Evas_Coord h, Eina_Bool internal)
|
evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
- intercept
- smart resize (do stuff), super, super, super
- evas object resize
The new code is more like:
- intercept
- super, super, super, evas object resize
- do stuff
But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-11 00:54:31 -07:00
|
|
|
{
|
2016-11-30 23:55:20 -08:00
|
|
|
if (!internal && (obj->doing.in_resize > 0))
|
evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
- intercept
- smart resize (do stuff), super, super, super
- evas object resize
The new code is more like:
- intercept
- super, super, super, evas object resize
- do stuff
But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-11 00:54:31 -07:00
|
|
|
{
|
|
|
|
WRN("evas_object_resize() called on object %p (%s) when in the middle "
|
|
|
|
"of resizing the same object", eo_obj, efl_class_name_get(eo_obj));
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (w < 0) w = 0;
|
|
|
|
if (h < 0) h = 0;
|
|
|
|
|
|
|
|
if ((obj->cur->geometry.w == w) && (obj->cur->geometry.h == h))
|
|
|
|
return EINA_TRUE;
|
|
|
|
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_canvas_object_efl_gfx_entity_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
2017-09-15 02:37:25 -07:00
|
|
|
Eina_Size2D sz)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2012-10-21 22:02:53 -07:00
|
|
|
Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE;
|
2012-11-10 01:05:05 -08:00
|
|
|
Eina_Bool source_invisible = EINA_FALSE;
|
2016-10-21 05:25:41 -07:00
|
|
|
Eina_List *was = NULL;
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2017-09-15 02:37:25 -07:00
|
|
|
if (sz.w < 0) sz.w = 0;
|
|
|
|
if (sz.h < 0) sz.h = 0;
|
2011-12-26 15:09:45 -08:00
|
|
|
|
2017-09-15 02:37:25 -07:00
|
|
|
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 1, sz.w, sz.h))
|
evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
- intercept
- smart resize (do stuff), super, super, super
- evas object resize
The new code is more like:
- intercept
- super, super, super, evas object resize
- do stuff
But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-11 00:54:31 -07:00
|
|
|
return;
|
2012-01-02 13:27:46 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!(obj->layer->evas->is_frozen))
|
2005-07-22 03:28:11 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
pass = evas_event_passes_through(eo_obj, obj);
|
|
|
|
freeze = evas_event_freezes_through(eo_obj, obj);
|
2012-11-10 01:05:05 -08:00
|
|
|
source_invisible = evas_object_is_source_invisible(eo_obj, obj);
|
|
|
|
if ((!pass) && (!freeze) && (!source_invisible))
|
2016-10-21 05:25:41 -07:00
|
|
|
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj,
|
|
|
|
obj, 1, 1);
|
2005-07-22 03:28:11 -07:00
|
|
|
}
|
2010-10-14 22:39:53 -07:00
|
|
|
obj->doing.in_resize++;
|
2011-12-26 15:09:45 -08:00
|
|
|
|
evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
- intercept
- smart resize (do stuff), super, super, super
- evas object resize
The new code is more like:
- intercept
- super, super, super, evas object resize
- do stuff
But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-11 00:54:31 -07:00
|
|
|
if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class->resize)
|
2017-09-15 02:37:25 -07:00
|
|
|
obj->smart.smart->smart_class->resize(eo_obj, sz.w, sz.h);
|
2011-12-26 15:09:45 -08:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
{
|
2017-09-15 02:37:25 -07:00
|
|
|
state_write->geometry.w = sz.w;
|
|
|
|
state_write->geometry.h = sz.h;
|
2013-03-12 05:58:19 -07:00
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
2011-12-26 15:09:45 -08:00
|
|
|
|
2016-05-06 17:01:10 -07:00
|
|
|
evas_object_update_bounding_box(eo_obj, obj, NULL);
|
2012-05-01 00:31:42 -07:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
//// obj->cur->cache.geometry.validity = 0;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
|
|
|
evas_object_clip_dirty(eo_obj, obj);
|
2010-10-14 22:39:53 -07:00
|
|
|
obj->doing.in_resize--;
|
2009-08-07 13:35:30 -07:00
|
|
|
/* NB: evas_object_recalc_clippees was here previously ( < 08/07/2009) */
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!(obj->layer->evas->is_frozen))
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-08-07 13:35:30 -07:00
|
|
|
/* NB: If this creates glitches on screen then move to above position */
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_recalc_clippees(obj);
|
2009-08-07 13:35:30 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
// if (obj->func->coords_recalc) obj->func->coords_recalc(eo_obj);
|
2016-10-21 05:25:41 -07:00
|
|
|
if (!pass && !obj->is_smart && obj->cur->visible)
|
|
|
|
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_TRUE, NULL);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2016-10-21 05:25:41 -07:00
|
|
|
eina_list_free(was);
|
2017-10-19 16:07:39 -07:00
|
|
|
evas_object_inform_call_resize(eo_obj, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:59:44 -07:00
|
|
|
EOLIAN Eina_Rect
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_canvas_object_efl_gfx_entity_geometry_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2016-06-08 23:05:36 -07:00
|
|
|
{
|
2017-09-13 19:59:44 -07:00
|
|
|
return (Eina_Rect) obj->cur->geometry;
|
2016-06-08 23:05:36 -07:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_geometry_get(const Evas_Object *eo_obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2018-04-05 01:47:26 -07:00
|
|
|
Eina_Rect r = efl_gfx_entity_geometry_get(eo_obj);
|
2017-09-13 00:49:04 -07:00
|
|
|
if (x) *x = r.x;
|
|
|
|
if (y) *y = r.y;
|
|
|
|
if (w) *w = r.w;
|
|
|
|
if (h) *h = r.h;
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2017-09-14 20:14:32 -07:00
|
|
|
EOLIAN static Eina_Position2D
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_canvas_object_efl_gfx_entity_position_get(const Eo *obj EINA_UNUSED,
|
2017-09-14 20:14:32 -07:00
|
|
|
Evas_Object_Protected_Data *pd)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2015-04-03 07:23:17 -07:00
|
|
|
if ((pd->delete_me) || (!pd->layer))
|
2017-09-14 20:14:32 -07:00
|
|
|
return EINA_POSITION2D(0, 0);
|
2012-01-02 13:27:46 -08:00
|
|
|
|
2017-09-14 20:14:32 -07:00
|
|
|
return ((Eina_Rect) pd->cur->geometry).pos;
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2017-09-15 02:37:25 -07:00
|
|
|
EOLIAN static Eina_Size2D
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_canvas_object_efl_gfx_entity_size_get(const Eo *obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *pd)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2015-04-03 07:23:17 -07:00
|
|
|
if (pd->delete_me)
|
2017-09-15 02:37:25 -07:00
|
|
|
return EINA_SIZE2D(0, 0);
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2017-09-15 02:37:25 -07:00
|
|
|
return ((Eina_Rect) pd->cur->geometry).size;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2008-10-04 09:57:02 -07:00
|
|
|
static void
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_object_size_hint_alloc(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2008-10-04 09:57:02 -07:00
|
|
|
{
|
|
|
|
if (obj->size_hints) return;
|
2009-09-03 22:13:19 -07:00
|
|
|
|
2012-06-16 18:32:10 -07:00
|
|
|
EVAS_MEMPOOL_INIT(_mp_sh, "evas_size_hints", Evas_Size_Hints, 32, );
|
2010-11-26 02:01:18 -08:00
|
|
|
obj->size_hints = EVAS_MEMPOOL_ALLOC(_mp_sh, Evas_Size_Hints);
|
|
|
|
if (!obj->size_hints) return;
|
|
|
|
EVAS_MEMPOOL_PREP(_mp_sh, obj->size_hints, Evas_Size_Hints);
|
2008-10-04 09:57:02 -07:00
|
|
|
obj->size_hints->max.w = -1;
|
|
|
|
obj->size_hints->max.h = -1;
|
|
|
|
obj->size_hints->align.x = 0.5;
|
|
|
|
obj->size_hints->align.y = 0.5;
|
2012-09-27 01:54:54 -07:00
|
|
|
obj->size_hints->dispmode = EVAS_DISPLAY_MODE_NONE;
|
|
|
|
}
|
|
|
|
|
2017-05-31 01:58:14 -07:00
|
|
|
/* Legacy only */
|
|
|
|
EAPI Evas_Display_Mode
|
|
|
|
evas_object_size_hint_display_mode_get(const Evas_Object *eo_obj)
|
2012-09-27 01:54:54 -07:00
|
|
|
{
|
2017-05-31 01:58:14 -07:00
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
|
|
|
|
EVAS_OBJECT_DATA_ALIVE_CHECK(obj, EVAS_DISPLAY_MODE_NONE);
|
|
|
|
if (!obj->size_hints) return EVAS_DISPLAY_MODE_NONE;
|
2012-09-27 01:54:54 -07:00
|
|
|
return obj->size_hints->dispmode;
|
|
|
|
}
|
|
|
|
|
2017-05-31 01:58:14 -07:00
|
|
|
/* Legacy only */
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_display_mode_set(Eo *eo_obj, Evas_Display_Mode dispmode)
|
2012-09-27 01:54:54 -07:00
|
|
|
{
|
2017-05-31 01:58:14 -07:00
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
|
2017-11-05 23:36:23 -08:00
|
|
|
|
2017-05-31 01:58:14 -07:00
|
|
|
EVAS_OBJECT_DATA_ALIVE_CHECK(obj);
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2017-01-04 23:14:27 -08:00
|
|
|
if (EINA_UNLIKELY(!obj->size_hints))
|
|
|
|
{
|
|
|
|
if (dispmode == EVAS_DISPLAY_MODE_NONE) return;
|
|
|
|
_evas_object_size_hint_alloc(eo_obj, obj);
|
|
|
|
}
|
2012-09-27 01:54:54 -07:00
|
|
|
if (obj->size_hints->dispmode == dispmode) return;
|
|
|
|
obj->size_hints->dispmode = dispmode;
|
|
|
|
|
2017-10-19 16:14:48 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj, obj);
|
2008-10-04 09:57:02 -07:00
|
|
|
}
|
2008-04-11 16:12:20 -07:00
|
|
|
|
2017-09-17 22:49:08 -07:00
|
|
|
EOLIAN static Eina_Size2D
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2008-04-11 16:12:20 -07:00
|
|
|
{
|
2008-04-30 15:51:08 -07:00
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
2017-09-17 22:49:08 -07:00
|
|
|
return EINA_SIZE2D(0, 0);
|
|
|
|
|
|
|
|
return obj->size_hints->min;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2017-09-17 22:49:08 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-04-11 16:12:20 -07:00
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2017-11-05 23:36:23 -08:00
|
|
|
|
|
|
|
EVAS_OBJECT_DATA_VALID_CHECK(obj);
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2017-01-04 23:14:27 -08:00
|
|
|
if (EINA_UNLIKELY(!obj->size_hints))
|
|
|
|
{
|
2017-09-17 22:49:08 -07:00
|
|
|
if (!sz.w && !sz.h) return;
|
2017-01-04 23:14:27 -08:00
|
|
|
_evas_object_size_hint_alloc(eo_obj, obj);
|
|
|
|
}
|
2017-09-17 22:49:08 -07:00
|
|
|
if ((obj->size_hints->min.w == sz.w) && (obj->size_hints->min.h == sz.h)) return;
|
|
|
|
obj->size_hints->min = sz;
|
2008-04-11 16:12:20 -07:00
|
|
|
|
2017-10-19 16:14:48 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj, obj);
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
2017-09-18 00:22:01 -07:00
|
|
|
EOLIAN static Eina_Size2D
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_combined_min_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2016-06-08 04:24:59 -07:00
|
|
|
{
|
2017-09-18 00:22:01 -07:00
|
|
|
Eina_Size2D sz = { 0, 0 };
|
|
|
|
|
2016-06-08 04:24:59 -07:00
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
2017-09-18 00:22:01 -07:00
|
|
|
return sz;
|
|
|
|
|
|
|
|
sz.w = MAX(obj->size_hints->min.w, obj->size_hints->user_min.w);
|
|
|
|
sz.h = MAX(obj->size_hints->min.h, obj->size_hints->user_min.h);
|
|
|
|
return sz;
|
2016-06-08 04:24:59 -07:00
|
|
|
}
|
|
|
|
|
2017-09-17 22:07:56 -07:00
|
|
|
EOLIAN static Eina_Size2D
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_max_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2008-04-11 16:12:20 -07:00
|
|
|
{
|
2008-04-30 15:51:08 -07:00
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
2017-09-17 22:07:56 -07:00
|
|
|
return EINA_SIZE2D(-1, -1);
|
|
|
|
|
|
|
|
return obj->size_hints->max;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2017-09-17 22:07:56 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_max_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-04-11 16:12:20 -07:00
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2017-09-17 22:07:56 -07:00
|
|
|
|
2017-11-05 23:36:23 -08:00
|
|
|
EVAS_OBJECT_DATA_VALID_CHECK(obj);
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2017-01-04 23:14:27 -08:00
|
|
|
if (EINA_UNLIKELY(!obj->size_hints))
|
|
|
|
{
|
2017-09-17 22:07:56 -07:00
|
|
|
if ((sz.w == -1) && (sz.h == -1)) return;
|
2017-01-04 23:14:27 -08:00
|
|
|
_evas_object_size_hint_alloc(eo_obj, obj);
|
|
|
|
}
|
2017-09-17 22:07:56 -07:00
|
|
|
if ((obj->size_hints->max.w == sz.w) && (obj->size_hints->max.h == sz.h)) return;
|
|
|
|
obj->size_hints->max.w = sz.w;
|
|
|
|
obj->size_hints->max.h = sz.h;
|
2008-04-11 16:12:20 -07:00
|
|
|
|
2017-10-19 16:14:48 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj, obj);
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
2017-08-22 23:16:22 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_request_get(const Eo *eo_obj, Evas_Coord *w, Evas_Coord *h)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2017-08-22 23:16:22 -07:00
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
|
|
|
|
EVAS_OBJECT_DATA_VALID_CHECK(obj);
|
|
|
|
|
2008-04-30 15:51:08 -07:00
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
2008-04-11 16:12:20 -07:00
|
|
|
{
|
2016-05-18 12:27:58 -07:00
|
|
|
if (w) *w = 0;
|
|
|
|
if (h) *h = 0;
|
2011-06-08 19:45:59 -07:00
|
|
|
return;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
2008-04-30 15:51:08 -07:00
|
|
|
if (w) *w = obj->size_hints->request.w;
|
|
|
|
if (h) *h = obj->size_hints->request.h;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
2017-08-22 23:16:22 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_request_set(Eo *eo_obj, Evas_Coord w, Evas_Coord h)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2017-08-22 23:16:22 -07:00
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
|
|
|
|
EVAS_OBJECT_DATA_ALIVE_CHECK(obj);
|
|
|
|
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2017-01-04 23:14:27 -08:00
|
|
|
if (EINA_UNLIKELY(!obj->size_hints))
|
|
|
|
{
|
|
|
|
if (!w && !h) return;
|
|
|
|
_evas_object_size_hint_alloc(eo_obj, obj);
|
|
|
|
}
|
2008-10-04 10:10:44 -07:00
|
|
|
if ((obj->size_hints->request.w == w) && (obj->size_hints->request.h == h)) return;
|
2008-04-30 15:51:08 -07:00
|
|
|
obj->size_hints->request.w = w;
|
|
|
|
obj->size_hints->request.h = h;
|
2008-04-11 16:12:20 -07:00
|
|
|
|
2017-10-19 16:14:48 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj, obj);
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
2017-09-17 22:35:22 -07:00
|
|
|
EOLIAN static Eina_Size2D
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_min_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2016-06-09 00:24:13 -07:00
|
|
|
{
|
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
2017-09-17 22:35:22 -07:00
|
|
|
return EINA_SIZE2D(0, 0);
|
|
|
|
|
|
|
|
return obj->size_hints->user_min;
|
2016-06-09 00:24:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2017-09-17 22:35:22 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz)
|
2016-06-09 00:24:13 -07:00
|
|
|
{
|
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2017-09-17 22:35:22 -07:00
|
|
|
|
2017-11-05 23:36:23 -08:00
|
|
|
EVAS_OBJECT_DATA_VALID_CHECK(obj);
|
2016-06-09 00:24:13 -07:00
|
|
|
evas_object_async_block(obj);
|
2017-01-04 23:14:27 -08:00
|
|
|
if (EINA_UNLIKELY(!obj->size_hints))
|
|
|
|
{
|
2017-09-17 22:35:22 -07:00
|
|
|
if (!sz.w && !sz.h) return;
|
2017-01-04 23:14:27 -08:00
|
|
|
_evas_object_size_hint_alloc(eo_obj, obj);
|
|
|
|
}
|
2017-09-17 22:35:22 -07:00
|
|
|
if ((obj->size_hints->user_min.w == sz.w) && (obj->size_hints->user_min.h == sz.h)) return;
|
|
|
|
obj->size_hints->user_min = sz;
|
2016-06-09 00:24:13 -07:00
|
|
|
|
2017-10-19 16:14:48 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj, obj);
|
2016-06-09 00:24:13 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_aspect_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Efl_Gfx_Size_Hint_Aspect *aspect, Eina_Size2D *sz)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-04-30 15:51:08 -07:00
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
2008-04-11 16:12:20 -07:00
|
|
|
{
|
2011-06-08 19:45:59 -07:00
|
|
|
if (aspect) *aspect = EVAS_ASPECT_CONTROL_NONE;
|
2017-09-18 00:44:42 -07:00
|
|
|
if (sz) *sz = EINA_SIZE2D(0, 0);
|
2011-06-08 19:45:59 -07:00
|
|
|
return;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
2008-04-30 15:51:08 -07:00
|
|
|
if (aspect) *aspect = obj->size_hints->aspect.mode;
|
2017-09-18 00:44:42 -07:00
|
|
|
if (sz)
|
|
|
|
{
|
|
|
|
sz->w = obj->size_hints->aspect.size.w;
|
|
|
|
sz->h = obj->size_hints->aspect.size.h;
|
|
|
|
}
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2017-09-18 00:44:42 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_aspect_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Size_Hint_Aspect aspect, Eina_Size2D sz)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-04-11 16:12:20 -07:00
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2017-09-18 00:44:42 -07:00
|
|
|
|
2017-11-05 23:36:23 -08:00
|
|
|
EVAS_OBJECT_DATA_VALID_CHECK(obj);
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2017-01-04 23:14:27 -08:00
|
|
|
if (EINA_UNLIKELY(!obj->size_hints))
|
|
|
|
{
|
2017-09-18 00:44:42 -07:00
|
|
|
if (!sz.w && !sz.h) return;
|
2017-01-04 23:14:27 -08:00
|
|
|
_evas_object_size_hint_alloc(eo_obj, obj);
|
|
|
|
}
|
2017-09-18 00:44:42 -07:00
|
|
|
if ((obj->size_hints->aspect.mode == aspect) &&
|
|
|
|
(obj->size_hints->aspect.size.w == sz.w) &&
|
|
|
|
(obj->size_hints->aspect.size.h == sz.h)) return;
|
2008-04-30 15:51:08 -07:00
|
|
|
obj->size_hints->aspect.mode = aspect;
|
2017-09-18 00:44:42 -07:00
|
|
|
obj->size_hints->aspect.size = sz;
|
2008-04-11 16:12:20 -07:00
|
|
|
|
2017-10-19 16:14:48 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj, obj);
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_align_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, double *x, double *y)
|
2008-10-04 09:11:23 -07:00
|
|
|
{
|
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
|
|
|
{
|
2016-05-18 12:27:58 -07:00
|
|
|
if (x) *x = 0.5;
|
|
|
|
if (y) *y = 0.5;
|
2011-06-08 19:45:59 -07:00
|
|
|
return;
|
2008-10-04 09:11:23 -07:00
|
|
|
}
|
|
|
|
if (x) *x = obj->size_hints->align.x;
|
|
|
|
if (y) *y = obj->size_hints->align.y;
|
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_align_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double x, double y)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-10-04 09:11:23 -07:00
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2017-11-05 23:36:23 -08:00
|
|
|
|
|
|
|
EVAS_OBJECT_DATA_VALID_CHECK(obj);
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2017-08-22 23:23:50 -07:00
|
|
|
if (!obj->legacy.align_set) obj->legacy.align_set = 1;
|
2017-01-04 23:14:27 -08:00
|
|
|
if (EINA_UNLIKELY(!obj->size_hints))
|
|
|
|
{
|
2017-01-06 09:57:46 -08:00
|
|
|
if (EINA_DBL_EQ(x, 0.5) && EINA_DBL_EQ(y, 0.5)) return;
|
2017-01-04 23:14:27 -08:00
|
|
|
_evas_object_size_hint_alloc(eo_obj, obj);
|
|
|
|
}
|
2017-01-06 09:57:46 -08:00
|
|
|
if ((EINA_DBL_EQ(obj->size_hints->align.x, x)) &&
|
|
|
|
(EINA_DBL_EQ(obj->size_hints->align.y, y)))
|
2016-12-20 06:29:49 -08:00
|
|
|
return;
|
2008-10-04 09:11:23 -07:00
|
|
|
obj->size_hints->align.x = x;
|
2008-10-04 10:10:44 -07:00
|
|
|
obj->size_hints->align.y = y;
|
2008-10-04 09:11:23 -07:00
|
|
|
|
2017-10-19 16:14:48 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj, obj);
|
2008-10-04 09:11:23 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_weight_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, double *x, double *y)
|
2008-10-04 09:11:23 -07:00
|
|
|
{
|
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
|
|
|
{
|
2016-05-18 12:27:58 -07:00
|
|
|
if (x) *x = 0.0;
|
|
|
|
if (y) *y = 0.0;
|
2011-06-08 19:45:59 -07:00
|
|
|
return;
|
2008-10-04 09:11:23 -07:00
|
|
|
}
|
|
|
|
if (x) *x = obj->size_hints->weight.x;
|
|
|
|
if (y) *y = obj->size_hints->weight.y;
|
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_weight_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double x, double y)
|
2008-10-04 09:11:23 -07:00
|
|
|
{
|
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2017-11-05 23:36:23 -08:00
|
|
|
|
|
|
|
EVAS_OBJECT_DATA_VALID_CHECK(obj);
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2017-08-22 23:23:50 -07:00
|
|
|
if (!obj->legacy.weight_set) obj->legacy.weight_set = 1;
|
2017-01-04 23:14:27 -08:00
|
|
|
if (EINA_UNLIKELY(!obj->size_hints))
|
|
|
|
{
|
2017-01-06 09:57:46 -08:00
|
|
|
if (EINA_DBL_EQ(x, 0.0) && EINA_DBL_EQ(y, 0.0)) return;
|
2017-01-04 23:14:27 -08:00
|
|
|
_evas_object_size_hint_alloc(eo_obj, obj);
|
|
|
|
}
|
2017-01-06 09:57:46 -08:00
|
|
|
if ((EINA_DBL_EQ(obj->size_hints->weight.x, x)) &&
|
|
|
|
(EINA_DBL_EQ(obj->size_hints->weight.y, y)))
|
2016-12-20 06:29:49 -08:00
|
|
|
return;
|
2008-10-04 09:11:23 -07:00
|
|
|
obj->size_hints->weight.x = x;
|
2008-10-04 10:10:44 -07:00
|
|
|
obj->size_hints->weight.y = y;
|
2008-10-04 09:11:23 -07:00
|
|
|
|
2017-10-19 16:14:48 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj, obj);
|
2008-10-04 09:11:23 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_margin_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-10-04 09:11:23 -07:00
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
|
|
|
{
|
2016-05-18 12:27:58 -07:00
|
|
|
if (l) *l = 0;
|
|
|
|
if (r) *r = 0;
|
|
|
|
if (t) *t = 0;
|
|
|
|
if (b) *b = 0;
|
2011-06-08 19:45:59 -07:00
|
|
|
return;
|
2008-10-04 09:11:23 -07:00
|
|
|
}
|
|
|
|
if (l) *l = obj->size_hints->padding.l;
|
|
|
|
if (r) *r = obj->size_hints->padding.r;
|
|
|
|
if (t) *t = obj->size_hints->padding.t;
|
|
|
|
if (b) *b = obj->size_hints->padding.b;
|
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_margin_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-10-04 09:11:23 -07:00
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
2017-11-05 23:36:23 -08:00
|
|
|
|
|
|
|
EVAS_OBJECT_DATA_VALID_CHECK(obj);
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2017-01-04 23:14:27 -08:00
|
|
|
if (EINA_UNLIKELY(!obj->size_hints))
|
|
|
|
{
|
|
|
|
if (!l && !r && !t && !b) return;
|
|
|
|
_evas_object_size_hint_alloc(eo_obj, obj);
|
|
|
|
}
|
2008-10-04 10:10:44 -07:00
|
|
|
if ((obj->size_hints->padding.l == l) && (obj->size_hints->padding.r == r) && (obj->size_hints->padding.t == t) && (obj->size_hints->padding.b == b)) return;
|
2008-10-04 10:28:43 -07:00
|
|
|
obj->size_hints->padding.l = l;
|
2008-10-04 09:11:23 -07:00
|
|
|
obj->size_hints->padding.r = r;
|
|
|
|
obj->size_hints->padding.t = t;
|
|
|
|
obj->size_hints->padding.b = b;
|
|
|
|
|
2017-10-19 16:14:48 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj, obj);
|
2008-10-04 09:11:23 -07:00
|
|
|
}
|
2008-04-11 16:12:20 -07:00
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_show(Evas_Object *eo_obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(eo_obj, EINA_TRUE);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_hide(Evas_Object *eo_obj)
|
|
|
|
{
|
|
|
|
if (!eo_obj) return;
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(eo_obj, EINA_FALSE);
|
2015-04-03 07:23:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_object_visible_get(const Evas_Object *obj)
|
|
|
|
{
|
2018-04-05 01:47:26 -07:00
|
|
|
return efl_gfx_entity_visible_get((Evas_Object *)obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-11-11 18:22:39 -08:00
|
|
|
_show(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2018-01-16 03:31:15 -08:00
|
|
|
if (obj->anim_player)
|
|
|
|
efl_player_stop(obj->anim_player);
|
2016-10-10 02:59:42 -07:00
|
|
|
if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class->show)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2016-10-10 02:59:42 -07:00
|
|
|
obj->smart.smart->smart_class->show(eo_obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2013-03-12 05:58:19 -07:00
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
{
|
|
|
|
state_write->visible = 1;
|
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
|
|
|
evas_object_clip_dirty(eo_obj, obj);
|
|
|
|
if (!(obj->layer->evas->is_frozen))
|
|
|
|
{
|
|
|
|
evas_object_clip_across_clippees_check(eo_obj, obj);
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_recalc_clippees(obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((!evas_event_passes_through(eo_obj, obj)) &&
|
2012-10-21 21:57:32 -07:00
|
|
|
(!evas_event_freezes_through(eo_obj, obj)) &&
|
|
|
|
(!evas_object_is_source_invisible(eo_obj, obj)))
|
2011-06-08 19:45:59 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!obj->is_smart)
|
2011-06-08 19:45:59 -07:00
|
|
|
{
|
2016-10-21 05:25:41 -07:00
|
|
|
_evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas,
|
|
|
|
eo_obj,
|
|
|
|
obj, 1, 1,
|
|
|
|
EINA_FALSE,
|
|
|
|
NULL);
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2016-07-07 17:54:33 -07:00
|
|
|
evas_object_update_bounding_box(eo_obj, obj, NULL);
|
2017-10-19 16:04:12 -07:00
|
|
|
evas_object_inform_call_show(eo_obj, obj);
|
2017-08-30 00:16:18 -07:00
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
Event_Animation *event_anim = _event_animation_find(obj, EFL_GFX_ENTITY_EVENT_SHOW);
|
2017-10-13 04:40:01 -07:00
|
|
|
if (event_anim)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
//Create animation object to start animation
|
2018-01-16 03:31:15 -08:00
|
|
|
efl_animation_player_animation_set(obj->anim_player, event_anim->anim);
|
2017-10-13 04:40:01 -07:00
|
|
|
|
2018-04-10 06:09:39 -07:00
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_STARTED,
|
2018-04-05 01:47:26 -07:00
|
|
|
_anim_started_cb, EFL_GFX_ENTITY_EVENT_SHOW);
|
2018-04-10 06:09:39 -07:00
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_RUNNING,
|
2018-04-05 01:47:26 -07:00
|
|
|
_anim_running_cb, EFL_GFX_ENTITY_EVENT_SHOW);
|
2018-04-10 06:09:39 -07:00
|
|
|
efl_event_callback_add(obj->anim_player,
|
|
|
|
EFL_ANIMATION_PLAYER_EVENT_ENDED,
|
2018-04-05 01:47:26 -07:00
|
|
|
_anim_ended_cb, EFL_GFX_ENTITY_EVENT_SHOW);
|
2018-04-10 06:09:39 -07:00
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
//Start animation
|
2018-01-16 03:31:15 -08:00
|
|
|
efl_player_start(obj->anim_player);
|
2017-08-30 00:16:18 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
static void
|
|
|
|
_hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2016-10-10 02:59:42 -07:00
|
|
|
if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class->hide)
|
2014-07-22 07:10:19 -07:00
|
|
|
{
|
2016-10-10 02:59:42 -07:00
|
|
|
obj->smart.smart->smart_class->hide(eo_obj);
|
2014-07-22 07:10:19 -07:00
|
|
|
}
|
2013-03-12 05:58:19 -07:00
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
{
|
|
|
|
state_write->visible = 0;
|
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
|
|
|
|
2015-01-22 00:43:23 -08:00
|
|
|
if (obj->mask->is_mask)
|
|
|
|
{
|
|
|
|
if (obj->mask->surface ||
|
2015-02-03 19:08:50 -08:00
|
|
|
obj->mask->w || obj->mask->h ||
|
2015-01-22 00:43:23 -08:00
|
|
|
obj->mask->is_alpha || obj->mask->redraw)
|
|
|
|
{
|
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_mask_cow, obj->mask,
|
|
|
|
Evas_Object_Mask_Data, mask)
|
|
|
|
mask->redraw = EINA_FALSE;
|
|
|
|
mask->is_alpha = EINA_FALSE;
|
2015-02-03 19:08:50 -08:00
|
|
|
mask->w = mask->h = 0;
|
2015-01-22 00:43:23 -08:00
|
|
|
if (mask->surface)
|
|
|
|
{
|
2017-04-24 15:09:25 -07:00
|
|
|
obj->layer->evas->engine.func->image_free(ENC, mask->surface);
|
2015-01-22 00:43:23 -08:00
|
|
|
mask->surface = NULL;
|
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_mask_cow, obj->mask, mask);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
|
|
|
evas_object_clip_dirty(eo_obj, obj);
|
2014-09-18 01:44:18 -07:00
|
|
|
if (obj->layer->evas && !(obj->layer->evas->is_frozen))
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
|
|
|
evas_object_clip_across_clippees_check(eo_obj, obj);
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_recalc_clippees(obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((!evas_event_passes_through(eo_obj, obj)) &&
|
2012-10-21 21:57:32 -07:00
|
|
|
(!evas_event_freezes_through(eo_obj, obj)) &&
|
|
|
|
(!evas_object_is_source_invisible(eo_obj, obj)))
|
2011-06-08 19:45:59 -07:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((!obj->is_smart) ||
|
2018-10-26 04:33:44 -07:00
|
|
|
((obj->map->cur.map) && (obj->map->cur.usemap)))
|
2011-06-08 19:45:59 -07:00
|
|
|
{
|
2016-10-21 05:25:41 -07:00
|
|
|
Evas_Object_Pointer_Data *obj_pdata;
|
2018-10-26 04:28:03 -07:00
|
|
|
Eina_Bool mouse_grabbed = EINA_FALSE;
|
2017-06-13 09:36:33 -07:00
|
|
|
EINA_INLIST_FOREACH(obj->events->pointer_grabs, obj_pdata)
|
2011-09-25 19:45:06 -07:00
|
|
|
{
|
2018-10-26 04:28:03 -07:00
|
|
|
if (obj_pdata->mouse_grabbed > 0)
|
|
|
|
{
|
|
|
|
mouse_grabbed = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!mouse_grabbed)
|
|
|
|
{
|
|
|
|
EINA_INLIST_FOREACH(obj->events->pointer_grabs, obj_pdata)
|
|
|
|
{
|
|
|
|
if (evas_object_is_in_output_rect(eo_obj, obj, obj_pdata->evas_pdata->seat->x,
|
|
|
|
obj_pdata->evas_pdata->seat->y,
|
|
|
|
1, 1))
|
|
|
|
_evas_canvas_event_pointer_move_event_dispatch(obj->layer->evas, obj_pdata->evas_pdata, NULL);
|
|
|
|
}
|
2011-09-25 19:45:06 -07:00
|
|
|
}
|
2011-09-24 21:43:02 -07:00
|
|
|
/* this is at odds to handling events when an obj is moved out of the mouse
|
|
|
|
* ore resized out or clipped out. if mouse is grabbed - regardless of
|
|
|
|
* visibility, mouse move events should keep happening and mouse up.
|
|
|
|
* for better or worse it's at least consistent.
|
2011-09-25 19:45:06 -07:00
|
|
|
if (obj->delete_me) return;
|
2011-06-08 19:45:59 -07:00
|
|
|
if (obj->mouse_grabbed > 0)
|
2011-09-24 21:43:02 -07:00
|
|
|
obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
|
2008-11-14 21:13:09 -08:00
|
|
|
if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
|
2012-10-22 01:57:08 -07:00
|
|
|
obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, eo_obj);
|
2008-11-14 21:13:09 -08:00
|
|
|
obj->mouse_grabbed = 0;
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->layer->evas->is_frozen)
|
2008-11-14 21:13:09 -08:00
|
|
|
{
|
|
|
|
obj->mouse_in = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (obj->mouse_in)
|
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Out ev;
|
2009-09-03 22:13:19 -07:00
|
|
|
|
2011-06-08 19:45:59 -07:00
|
|
|
_evas_object_event_new();
|
2010-03-04 06:48:21 -08:00
|
|
|
|
2008-11-14 21:13:09 -08:00
|
|
|
obj->mouse_in = 0;
|
|
|
|
ev.buttons = obj->layer->evas->pointer.button;
|
|
|
|
ev.output.x = obj->layer->evas->pointer.x;
|
|
|
|
ev.output.y = obj->layer->evas->pointer.y;
|
|
|
|
ev.canvas.x = obj->layer->evas->pointer.x;
|
|
|
|
ev.canvas.y = obj->layer->evas->pointer.y;
|
|
|
|
ev.data = NULL;
|
|
|
|
ev.modifiers = &(obj->layer->evas->modifiers);
|
|
|
|
ev.locks = &(obj->layer->evas->locks);
|
2011-06-08 19:45:59 -07:00
|
|
|
ev.timestamp = obj->layer->evas->last_timestamp;
|
|
|
|
ev.event_flags = EVAS_EVENT_FLAG_NONE;
|
2017-02-16 02:34:08 -08:00
|
|
|
event_id = _evas_object_event_new();
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
|
2017-02-16 02:34:08 -08:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas, obj->layer->evas, event_id);
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
2011-09-24 21:43:02 -07:00
|
|
|
*/
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2005-08-01 06:52:55 -07:00
|
|
|
else
|
|
|
|
{
|
2012-03-28 00:17:39 -07:00
|
|
|
/*
|
2011-07-06 01:43:18 -07:00
|
|
|
if (obj->mouse_grabbed > 0)
|
2011-09-24 21:43:02 -07:00
|
|
|
obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
|
2011-06-08 19:45:59 -07:00
|
|
|
if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
|
2012-10-22 01:57:08 -07:00
|
|
|
obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, eo_obj);
|
2011-06-08 19:45:59 -07:00
|
|
|
obj->mouse_grabbed = 0;
|
|
|
|
obj->mouse_in = 0;
|
2011-09-24 21:43:02 -07:00
|
|
|
*/
|
2005-08-01 06:52:55 -07:00
|
|
|
}
|
2016-07-07 17:54:33 -07:00
|
|
|
evas_object_update_bounding_box(eo_obj, obj, NULL);
|
2017-10-19 16:05:30 -07:00
|
|
|
evas_object_inform_call_hide(eo_obj, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2016-10-10 02:59:42 -07:00
|
|
|
EOLIAN static void
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_canvas_object_efl_gfx_entity_visible_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
2016-10-10 02:59:42 -07:00
|
|
|
Eina_Bool vis)
|
|
|
|
{
|
2017-07-06 00:29:20 -07:00
|
|
|
if (!obj->legacy.visible_set)
|
|
|
|
obj->legacy.visible_set = EINA_TRUE;
|
2017-02-17 01:46:09 -08:00
|
|
|
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 1, vis))
|
2016-10-10 02:59:42 -07:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (vis) _show(eo_obj, obj);
|
|
|
|
else _hide(eo_obj, obj);
|
|
|
|
}
|
|
|
|
|
2017-07-06 00:29:20 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_canvas_object_efl_gfx_entity_visible_get(const Eo *eo_obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2017-07-06 00:29:20 -07:00
|
|
|
if (!EVAS_OBJECT_DATA_ALIVE(obj)) return EINA_FALSE;
|
|
|
|
#if 0
|
2017-08-21 03:18:53 -07:00
|
|
|
// Try to return TRUE when an object is an EO object (must be finalized,
|
|
|
|
// otherwise we can't know for sure if it's legacy or not).
|
|
|
|
// Note: This was disabled as it used to lead to render bugs.
|
|
|
|
if (obj->legacy.finalized && !obj->legacy.ctor && !obj->legacy.visible_set)
|
2017-07-06 00:29:20 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
#endif
|
2014-03-11 04:51:35 -07:00
|
|
|
return obj->cur->visible;
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2015-04-03 07:23:17 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a)
|
|
|
|
{
|
2016-03-01 10:06:28 -08:00
|
|
|
efl_gfx_color_set((Evas_Object *)obj, r, g, b, a);
|
2015-04-03 07:23:17 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2017-12-19 23:34:01 -08:00
|
|
|
_efl_canvas_object_efl_gfx_color_color_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
2016-06-20 21:26:15 -07:00
|
|
|
int r, int g, int b, int a)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-09-06 05:03:11 -07:00
|
|
|
int prev_a;
|
|
|
|
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me) return;
|
2016-09-06 05:03:11 -07:00
|
|
|
|
|
|
|
if (EVAS_COLOR_SANITIZE(r, g, b, a))
|
|
|
|
ERR("Evas only handles premultiplied colors (0 <= R,G,B <= A <= 255)");
|
2012-02-22 20:53:19 -08:00
|
|
|
|
2017-02-17 01:46:09 -08:00
|
|
|
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_COLOR_SET, 1, r, g, b, a)) return;
|
2013-03-12 05:58:19 -07:00
|
|
|
if ((obj->cur->color.r == r) &&
|
|
|
|
(obj->cur->color.g == g) &&
|
|
|
|
(obj->cur->color.b == b) &&
|
|
|
|
(obj->cur->color.a == a)) return;
|
|
|
|
|
2016-09-06 05:03:11 -07:00
|
|
|
prev_a = obj->cur->color.a;
|
2013-03-12 05:58:19 -07:00
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
{
|
|
|
|
state_write->color.r = r;
|
|
|
|
state_write->color.g = g;
|
|
|
|
state_write->color.b = b;
|
2016-09-06 05:03:11 -07:00
|
|
|
state_write->color.a = a;
|
2013-03-12 05:58:19 -07:00
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
|
|
|
|
2017-08-29 16:01:10 -07:00
|
|
|
if (obj->is_smart && obj->smart.smart &&
|
|
|
|
obj->smart.smart->smart_class &&
|
2016-10-07 00:25:49 -07:00
|
|
|
obj->smart.smart->smart_class->color_set)
|
|
|
|
{
|
|
|
|
obj->smart.smart->smart_class->color_set(eo_obj, r, g, b, a);
|
|
|
|
}
|
2016-09-06 22:47:33 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_clip_dirty(eo_obj, obj);
|
2016-09-06 05:03:11 -07:00
|
|
|
if ((prev_a == 0) && (a == 0) && (obj->cur->render_op == EVAS_RENDER_BLEND)) return;
|
2013-03-12 05:58:19 -07:00
|
|
|
|
2012-05-18 00:17:34 -07:00
|
|
|
obj->changed_color = EINA_TRUE;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2015-04-03 07:23:17 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
|
|
|
|
{
|
2016-03-01 10:06:28 -08:00
|
|
|
efl_gfx_color_get((Evas_Object *)obj, r, g, b, a);
|
2015-04-03 07:23:17 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_efl_gfx_color_color_get(const Eo *eo_obj EINA_UNUSED,
|
2015-04-03 07:23:17 -07:00
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
int *r, int *g, int *b, int *a)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2004-03-07 18:42:08 -08:00
|
|
|
if (obj->delete_me)
|
|
|
|
{
|
2016-05-18 12:27:58 -07:00
|
|
|
if (r) *r = 0;
|
|
|
|
if (g) *g = 0;
|
|
|
|
if (b) *b = 0;
|
|
|
|
if (a) *a = 0;
|
2011-06-08 19:45:59 -07:00
|
|
|
return;
|
2004-03-07 18:42:08 -08:00
|
|
|
}
|
2013-03-12 05:58:19 -07:00
|
|
|
if (r) *r = obj->cur->color.r;
|
|
|
|
if (g) *g = obj->cur->color.g;
|
|
|
|
if (b) *b = obj->cur->color.b;
|
|
|
|
if (a) *a = obj->cur->color.a;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_anti_alias_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool anti_alias)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2005-12-03 01:27:53 -08:00
|
|
|
if (obj->delete_me) return;
|
2010-08-23 19:56:04 -07:00
|
|
|
anti_alias = !!anti_alias;
|
2013-03-12 05:58:19 -07:00
|
|
|
if (obj->cur->anti_alias == anti_alias)return;
|
|
|
|
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2013-03-12 05:58:19 -07:00
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
{
|
|
|
|
state_write->anti_alias = anti_alias;
|
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
2005-12-03 01:27:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_anti_alias_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2005-12-03 01:27:53 -08:00
|
|
|
{
|
2014-03-11 04:51:35 -07:00
|
|
|
if (obj->delete_me) return EINA_FALSE;
|
|
|
|
return obj->cur->anti_alias;
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_canvas_object_efl_gfx_entity_scale_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double scale)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-09-09 07:14:26 -07:00
|
|
|
if (obj->delete_me) return;
|
2017-01-06 09:57:46 -08:00
|
|
|
if (EINA_DBL_EQ(obj->cur->scale, scale)) return;
|
2013-03-12 05:58:19 -07:00
|
|
|
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2013-03-12 05:58:19 -07:00
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
{
|
|
|
|
state_write->scale = scale;
|
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_change(eo_obj, obj);
|
2008-09-09 07:14:26 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static double
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_canvas_object_efl_gfx_entity_scale_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2008-09-09 07:14:26 -07:00
|
|
|
{
|
2014-03-11 04:51:35 -07:00
|
|
|
if (obj->delete_me) return 1.0;
|
|
|
|
return obj->cur->scale;
|
2008-09-09 07:14:26 -07:00
|
|
|
}
|
|
|
|
|
2016-06-16 03:49:06 -07:00
|
|
|
static void
|
|
|
|
_render_op_set(Evas_Object_Protected_Data *obj, Evas_Render_Op render_op)
|
2006-05-02 00:28:49 -07:00
|
|
|
{
|
2016-06-16 03:49:06 -07:00
|
|
|
if (!obj || obj->delete_me) return;
|
2013-03-12 05:58:19 -07:00
|
|
|
if (obj->cur->render_op == render_op) return;
|
|
|
|
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2013-03-12 05:58:19 -07:00
|
|
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
|
|
|
{
|
|
|
|
state_write->render_op = render_op;
|
|
|
|
}
|
|
|
|
EINA_COW_STATE_WRITE_END(obj, state_write, cur);
|
|
|
|
|
2016-06-16 03:49:06 -07:00
|
|
|
evas_object_change(obj->object, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_render_op_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Efl_Gfx_Render_Op rop)
|
2016-06-16 03:49:06 -07:00
|
|
|
{
|
|
|
|
_render_op_set(obj, _gfx_to_evas_render_op(rop));
|
2006-05-02 00:28:49 -07:00
|
|
|
}
|
|
|
|
|
2016-06-16 03:49:06 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_render_op_set(Evas_Object *eo_obj, Evas_Render_Op render_op)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj);
|
|
|
|
_render_op_set(obj, render_op);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Efl_Gfx_Render_Op
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_render_op_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-06-16 03:49:06 -07:00
|
|
|
return _evas_to_gfx_render_op(obj->cur->render_op);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Render_Op
|
|
|
|
evas_object_render_op_get(const Evas_Object *eo_obj)
|
|
|
|
{
|
2016-06-20 21:26:15 -07:00
|
|
|
return _gfx_to_evas_render_op(efl_canvas_object_render_op_get(eo_obj));
|
2006-05-02 00:28:49 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2016-08-10 07:23:04 -07:00
|
|
|
_efl_canvas_object_efl_object_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED, Efl_Dbg_Info *root)
|
2013-01-28 22:36:23 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_dbg_info_get(efl_super(eo_obj, MY_CLASS), root);
|
|
|
|
Efl_Dbg_Info *group = EFL_DBG_INFO_LIST_APPEND(root, MY_CLASS_NAME);
|
2016-08-10 07:23:04 -07:00
|
|
|
Efl_Dbg_Info *node;
|
2013-09-06 09:19:57 -07:00
|
|
|
const char *name;
|
2013-04-11 02:56:52 -07:00
|
|
|
double dblw, dblh;
|
|
|
|
double dblx, dbly;
|
|
|
|
double scale;
|
|
|
|
unsigned int m;
|
|
|
|
int r, g, b, a;
|
2017-08-22 23:16:22 -07:00
|
|
|
//int requestw, requesth;
|
2017-09-14 20:14:32 -07:00
|
|
|
Eina_Rect geom;
|
2017-09-17 22:49:08 -07:00
|
|
|
Eina_Size2D max, min;
|
2013-04-11 02:56:52 -07:00
|
|
|
short layer;
|
|
|
|
Eina_Bool focus;
|
2013-01-28 22:36:23 -08:00
|
|
|
Eina_Bool visible;
|
2013-04-11 02:56:52 -07:00
|
|
|
Eina_Bool pass_event;
|
|
|
|
Eina_Bool propagate_event;
|
|
|
|
Eina_Bool repeat_event;
|
|
|
|
Eina_Bool clipees_has;
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
visible = efl_gfx_entity_visible_get(eo_obj);
|
2016-03-01 10:06:28 -08:00
|
|
|
layer = efl_gfx_stack_layer_get(eo_obj);
|
2016-08-10 07:23:04 -07:00
|
|
|
name = efl_name_get(eo_obj); // evas_object_name_get(eo_obj);
|
2018-04-05 01:47:26 -07:00
|
|
|
geom = efl_gfx_entity_geometry_get(eo_obj);
|
|
|
|
scale = efl_gfx_entity_scale_get(eo_obj);
|
2017-09-17 22:49:08 -07:00
|
|
|
min = efl_gfx_size_hint_restricted_min_get(eo_obj);
|
2017-09-17 22:07:56 -07:00
|
|
|
max = efl_gfx_size_hint_max_get(eo_obj);
|
2017-08-22 23:16:22 -07:00
|
|
|
//efl_gfx_size_hint_request_get(eo_obj, &requestw, &requesth);
|
2016-06-08 00:09:38 -07:00
|
|
|
efl_gfx_size_hint_align_get(eo_obj, &dblx, &dbly);
|
|
|
|
efl_gfx_size_hint_weight_get(eo_obj, &dblw, &dblh);
|
2016-03-01 10:06:28 -08:00
|
|
|
efl_gfx_color_get(eo_obj, &r, &g, &b, &a);
|
2016-06-16 01:19:23 -07:00
|
|
|
focus = evas_object_focus_get(eo_obj);
|
2016-06-20 21:26:15 -07:00
|
|
|
m = efl_canvas_object_pointer_mode_get(eo_obj);
|
|
|
|
pass_event = efl_canvas_object_pass_events_get(eo_obj);
|
|
|
|
repeat_event = efl_canvas_object_repeat_events_get(eo_obj);
|
|
|
|
propagate_event = efl_canvas_object_propagate_events_get(eo_obj);
|
|
|
|
clipees_has = efl_canvas_object_clipees_has(eo_obj);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_DBG_INFO_APPEND(group, "Visibility", EINA_VALUE_TYPE_CHAR, visible);
|
2013-09-06 09:19:57 -07:00
|
|
|
|
|
|
|
if (name)
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_DBG_INFO_APPEND(group, "Name", EINA_VALUE_TYPE_STRING, name);
|
2013-09-06 09:19:57 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_DBG_INFO_APPEND(group, "Layer", EINA_VALUE_TYPE_INT, layer);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
node = EFL_DBG_INFO_LIST_APPEND(group, "Position");
|
2017-09-14 20:14:32 -07:00
|
|
|
EFL_DBG_INFO_APPEND(node, "x", EINA_VALUE_TYPE_INT, geom.x);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "y", EINA_VALUE_TYPE_INT, geom.y);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
node = EFL_DBG_INFO_LIST_APPEND(group, "Size");
|
2017-09-14 20:14:32 -07:00
|
|
|
EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_INT, geom.w);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_INT, geom.h);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_DBG_INFO_APPEND(group, "Scale", EINA_VALUE_TYPE_DOUBLE, scale);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
node = EFL_DBG_INFO_LIST_APPEND(group, "Min size");
|
2017-09-17 22:49:08 -07:00
|
|
|
EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_INT, min.w);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_INT, min.h);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
node = EFL_DBG_INFO_LIST_APPEND(group, "Max size");
|
2017-09-17 22:07:56 -07:00
|
|
|
EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_INT, max.w);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_INT, max.h);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2017-08-22 23:16:22 -07:00
|
|
|
//node = EFL_DBG_INFO_LIST_APPEND(group, "Request size");
|
|
|
|
//EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_INT, requestw);
|
|
|
|
//EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_INT, requesth);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
node = EFL_DBG_INFO_LIST_APPEND(group, "Align");
|
|
|
|
EFL_DBG_INFO_APPEND(node, "x", EINA_VALUE_TYPE_DOUBLE, dblx);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "y", EINA_VALUE_TYPE_DOUBLE, dbly);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
node = EFL_DBG_INFO_LIST_APPEND(group, "Weight");
|
|
|
|
EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_DOUBLE, dblw);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_DOUBLE, dblh);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
node = EFL_DBG_INFO_LIST_APPEND(group, "Color");
|
|
|
|
EFL_DBG_INFO_APPEND(node, "r", EINA_VALUE_TYPE_INT, r);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "g", EINA_VALUE_TYPE_INT, g);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "b", EINA_VALUE_TYPE_INT, b);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "a", EINA_VALUE_TYPE_INT, a);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_DBG_INFO_APPEND(group, "Has focus", EINA_VALUE_TYPE_CHAR, focus);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2013-04-11 02:56:52 -07:00
|
|
|
{
|
2013-09-06 09:19:07 -07:00
|
|
|
const char *text = NULL;
|
|
|
|
switch (m)
|
|
|
|
{
|
|
|
|
case EVAS_OBJECT_POINTER_MODE_AUTOGRAB:
|
|
|
|
text = "EVAS_OBJECT_POINTER_MODE_AUTOGRAB";
|
|
|
|
break;
|
|
|
|
case EVAS_OBJECT_POINTER_MODE_NOGRAB:
|
|
|
|
text = "EVAS_OBJECT_POINTER_MODE_NOGRAB";
|
|
|
|
break;
|
|
|
|
case EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN:
|
|
|
|
text = "EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
text = NULL;
|
|
|
|
break;
|
|
|
|
}
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2013-09-06 09:19:07 -07:00
|
|
|
if (text)
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_DBG_INFO_APPEND(group, "Pointer Mode", EINA_VALUE_TYPE_STRING, text);
|
2013-09-06 09:19:07 -07:00
|
|
|
}
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_DBG_INFO_APPEND(group, "Pass Events", EINA_VALUE_TYPE_CHAR, pass_event);
|
|
|
|
EFL_DBG_INFO_APPEND(group, "Repeat Events", EINA_VALUE_TYPE_CHAR, repeat_event);
|
|
|
|
EFL_DBG_INFO_APPEND(group, "Propagate Events", EINA_VALUE_TYPE_CHAR, propagate_event);
|
|
|
|
EFL_DBG_INFO_APPEND(group, "Has clipees", EINA_VALUE_TYPE_CHAR, clipees_has);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2013-04-17 00:58:27 -07:00
|
|
|
Evas_Object *clipper = NULL;
|
2016-06-20 21:26:15 -07:00
|
|
|
clipper = efl_canvas_object_clip_get(eo_obj);
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_DBG_INFO_APPEND(group, "Clipper", EINA_VALUE_TYPE_UINT64, (uintptr_t) clipper);
|
2013-04-17 00:58:27 -07:00
|
|
|
|
2013-01-28 22:36:23 -08:00
|
|
|
const Evas_Map *map = evas_object_map_get(eo_obj);
|
|
|
|
if (map)
|
|
|
|
{ /* Save map coords count info if object has map */
|
2016-08-15 06:44:41 -07:00
|
|
|
node = EFL_DBG_INFO_LIST_APPEND(group, "Evas Map");
|
2013-01-28 22:36:23 -08:00
|
|
|
int points_count = evas_map_count_get(map);
|
2016-08-15 06:44:41 -07:00
|
|
|
Efl_Dbg_Info *points = EFL_DBG_INFO_LIST_APPEND(node, "Points");
|
|
|
|
Efl_Dbg_Info *pointsuv = EFL_DBG_INFO_LIST_APPEND(node, "Image UV");
|
2013-04-04 05:32:06 -07:00
|
|
|
for (int i = 0 ; i < points_count; i++)
|
2013-01-28 22:36:23 -08:00
|
|
|
{
|
2013-04-04 05:32:06 -07:00
|
|
|
{
|
|
|
|
Evas_Coord px, py, pz;
|
|
|
|
evas_map_point_coord_get(map, i, &px, &py, &pz);
|
2016-08-15 06:44:41 -07:00
|
|
|
Efl_Dbg_Info *point = EFL_DBG_INFO_LIST_APPEND(points, "Points");
|
|
|
|
EFL_DBG_INFO_APPEND(point, "x", EINA_VALUE_TYPE_INT, px);
|
|
|
|
EFL_DBG_INFO_APPEND(point, "y", EINA_VALUE_TYPE_INT, py);
|
|
|
|
EFL_DBG_INFO_APPEND(point, "z", EINA_VALUE_TYPE_INT, pz);
|
2013-04-04 05:32:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
double pu, pv;
|
|
|
|
evas_map_point_image_uv_get(map, i, &pu, &pv);
|
2016-08-15 06:44:41 -07:00
|
|
|
Efl_Dbg_Info *point = EFL_DBG_INFO_LIST_APPEND(pointsuv, "Image UV");
|
|
|
|
EFL_DBG_INFO_APPEND(point, "u", EINA_VALUE_TYPE_DOUBLE, pu);
|
|
|
|
EFL_DBG_INFO_APPEND(point, "v", EINA_VALUE_TYPE_DOUBLE, pv);
|
2013-04-04 05:32:06 -07:00
|
|
|
}
|
2013-01-28 22:36:23 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-20 23:45:31 -07:00
|
|
|
EOLIAN static Eo *
|
2018-01-04 11:41:49 -08:00
|
|
|
_efl_canvas_object_efl_object_provider_find(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, const Efl_Class *klass)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-06-20 23:45:31 -07:00
|
|
|
if (klass == EVAS_CANVAS_CLASS)
|
|
|
|
{
|
2017-08-24 10:28:51 -07:00
|
|
|
if ((obj->delete_me) || (!obj->layer)) goto fallback;
|
2016-06-20 23:45:31 -07:00
|
|
|
return obj->layer->evas->evas;
|
|
|
|
}
|
2016-12-12 20:38:16 -08:00
|
|
|
else if (klass == EFL_LOOP_CLASS)
|
2018-02-26 21:10:12 -08:00
|
|
|
return efl_main_loop_get();
|
2017-08-24 10:28:51 -07:00
|
|
|
fallback:
|
2016-08-15 06:44:41 -07:00
|
|
|
return efl_provider_find(efl_super(eo_obj, MY_CLASS), klass);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2016-12-12 20:38:16 -08:00
|
|
|
EOLIAN static Efl_Loop *
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_efl_loop_consumer_loop_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED)
|
2016-12-12 20:38:16 -08:00
|
|
|
{
|
2018-02-26 21:10:12 -08:00
|
|
|
return efl_main_loop_get();
|
2016-12-12 20:38:16 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_type_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, const char *type)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
if (efl_finalized_get(eo_obj))
|
2016-06-16 00:05:00 -07:00
|
|
|
{
|
|
|
|
ERR("This function is only allowed during construction.");
|
|
|
|
return;
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
obj->type = type; // Store it as the top type of this class
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2007-07-23 07:22:57 -07:00
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_precise_is_inside_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Bool precise)
|
2007-07-23 07:22:57 -07:00
|
|
|
{
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2007-07-23 07:22:57 -07:00
|
|
|
obj->precise_is_inside = precise;
|
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_precise_is_inside_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2007-07-23 07:22:57 -07:00
|
|
|
{
|
2014-03-11 04:51:35 -07:00
|
|
|
return obj->precise_is_inside;
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2017-06-09 17:16:08 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_coords_inside_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Position2D pos)
|
2017-06-09 17:16:08 -07:00
|
|
|
{
|
2017-09-13 00:38:33 -07:00
|
|
|
Eina_Rectangle c;
|
2017-06-09 17:16:08 -07:00
|
|
|
|
|
|
|
if (obj->is_smart)
|
|
|
|
{
|
2017-09-13 00:38:33 -07:00
|
|
|
Eina_Rectangle bounding_box = { 0, };
|
2017-06-09 17:16:08 -07:00
|
|
|
|
|
|
|
evas_object_smart_bounding_box_update(obj);
|
|
|
|
evas_object_smart_bounding_box_get(obj, &bounding_box, NULL);
|
|
|
|
c = bounding_box;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (obj->clip.clipees) return EINA_FALSE;
|
|
|
|
c = obj->cur->geometry;
|
|
|
|
}
|
2017-12-11 23:44:41 -08:00
|
|
|
return RECTS_INTERSECT(pos.x, pos.y, 1, 1, c.x, c.y, c.w, c.h);
|
2017-06-09 17:16:08 -07:00
|
|
|
}
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
static void
|
2013-03-26 10:51:05 -07:00
|
|
|
_is_frame_flag_set(Evas_Object_Protected_Data *obj, Eina_Bool is_frame)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2013-03-26 10:51:05 -07:00
|
|
|
const Eina_Inlist *l;
|
|
|
|
Evas_Object_Protected_Data *child;
|
|
|
|
|
2016-11-16 01:09:37 -08:00
|
|
|
/* Small hack here:
|
|
|
|
* The main frame object (ie. the frame edje object itself) will set
|
|
|
|
* a value of 2 here (Eina_Bool is an unsigned char). That way we can
|
|
|
|
* safely propagate the frame flag inside smart_member_add. */
|
|
|
|
if (is_frame > 1)
|
|
|
|
{
|
|
|
|
obj->is_frame_top = EINA_TRUE;
|
|
|
|
is_frame = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2011-12-26 15:09:45 -08:00
|
|
|
obj->is_frame = is_frame;
|
2013-03-26 10:51:05 -07:00
|
|
|
|
2017-02-20 01:07:00 -08:00
|
|
|
if (!obj->is_smart) return;
|
2013-03-26 10:51:05 -07:00
|
|
|
l = evas_object_smart_members_get_direct(obj->object);
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(l, child)
|
|
|
|
_is_frame_flag_set(child, is_frame);
|
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_is_frame_object_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool is_frame)
|
2013-03-26 10:51:05 -07:00
|
|
|
{
|
|
|
|
Evas_Coord x, y;
|
|
|
|
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2013-03-26 10:51:05 -07:00
|
|
|
evas_object_geometry_get(eo_obj, &x, &y, NULL, NULL);
|
|
|
|
|
|
|
|
_is_frame_flag_set(obj, is_frame);
|
|
|
|
|
|
|
|
evas_object_move(eo_obj, x, y);
|
2011-12-26 15:09:45 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_is_frame_object_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2011-12-26 15:09:45 -08:00
|
|
|
{
|
2014-03-11 04:51:35 -07:00
|
|
|
return obj->is_frame;
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static Evas_Object *
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_render_parent_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2014-03-11 04:51:35 -07:00
|
|
|
if (!obj) return NULL;
|
|
|
|
return obj->smart.parent;
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2015-11-19 03:37:07 -08:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_paragraph_direction_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, Evas_BiDi_Direction dir EINA_UNUSED)
|
2015-11-19 03:37:07 -08:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Evas_BiDi_Direction
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_paragraph_direction_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED)
|
2015-11-19 03:37:07 -08:00
|
|
|
{
|
|
|
|
return EVAS_BIDI_DIRECTION_NEUTRAL;
|
|
|
|
}
|
|
|
|
|
2016-03-14 03:38:44 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_legacy_ctor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
2016-03-14 03:38:44 -07:00
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
EINA_SAFETY_ON_FALSE_RETURN(!efl_finalized_get(eo_obj));
|
2017-07-06 00:29:20 -07:00
|
|
|
obj->legacy.ctor = EINA_TRUE;
|
2016-03-14 03:38:44 -07:00
|
|
|
}
|
|
|
|
|
2018-05-08 16:56:51 -07:00
|
|
|
EAPI Eo *
|
|
|
|
evas_find(const Eo *obj)
|
|
|
|
{
|
|
|
|
if (efl_isa(obj, EVAS_CANVAS_CLASS))
|
|
|
|
return (Eo*) obj;
|
|
|
|
if (efl_isa(obj, EFL_CANVAS_OBJECT_CLASS))
|
|
|
|
return evas_object_evas_get(obj);
|
|
|
|
return efl_provider_find(obj, EVAS_CANVAS_CLASS);
|
|
|
|
}
|
|
|
|
|
2017-08-30 00:16:18 -07:00
|
|
|
EOLIAN void
|
|
|
|
_efl_canvas_object_event_animation_set(Eo *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *pd,
|
2017-10-13 04:40:01 -07:00
|
|
|
const Efl_Event_Description *desc,
|
2018-02-21 10:38:39 -08:00
|
|
|
Efl_Canvas_Animation *animation)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
Event_Animation *event_anim = _event_animation_find(pd, desc);
|
2017-10-12 22:29:15 -07:00
|
|
|
|
2018-01-16 03:31:15 -08:00
|
|
|
if (!pd->anim_player)
|
|
|
|
{
|
2018-02-21 10:38:39 -08:00
|
|
|
pd->anim_player = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, eo_obj,
|
2018-01-16 03:31:15 -08:00
|
|
|
efl_animation_player_target_set(efl_added, eo_obj));
|
|
|
|
}
|
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
if (event_anim)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
if (event_anim->anim == animation)
|
|
|
|
return;
|
2017-08-30 00:16:18 -07:00
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
pd->event_anims =
|
|
|
|
eina_inlist_remove(pd->event_anims, EINA_INLIST_GET(event_anim));
|
2017-08-30 00:16:18 -07:00
|
|
|
|
2018-01-16 03:31:15 -08:00
|
|
|
_event_anim_free(event_anim, pd);
|
2017-08-30 00:16:18 -07:00
|
|
|
}
|
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
if (!animation) return;
|
2017-08-30 00:16:18 -07:00
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
event_anim = calloc(1, sizeof(Event_Animation));
|
2017-08-30 00:16:18 -07:00
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
//Set callback for Hide event
|
2018-04-05 01:47:26 -07:00
|
|
|
if (desc == EFL_GFX_ENTITY_EVENT_HIDE)
|
2017-10-13 04:40:01 -07:00
|
|
|
{
|
2018-01-16 03:31:15 -08:00
|
|
|
evas_object_intercept_hide_callback_add(eo_obj,
|
2017-10-13 04:40:01 -07:00
|
|
|
_animation_intercept_hide,
|
|
|
|
event_anim);
|
2017-08-30 00:16:18 -07:00
|
|
|
}
|
|
|
|
|
2017-10-13 04:40:01 -07:00
|
|
|
event_anim->desc = desc;
|
|
|
|
event_anim->anim = animation;
|
|
|
|
|
|
|
|
pd->event_anims =
|
|
|
|
eina_inlist_append(pd->event_anims, EINA_INLIST_GET(event_anim));
|
2017-08-30 00:16:18 -07:00
|
|
|
}
|
|
|
|
|
2018-02-21 10:38:39 -08:00
|
|
|
EOLIAN Efl_Canvas_Animation *
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_canvas_object_event_animation_get(const Eo *eo_obj EINA_UNUSED,
|
2017-08-30 00:16:18 -07:00
|
|
|
Evas_Object_Protected_Data *pd,
|
2017-10-13 04:40:01 -07:00
|
|
|
const Efl_Event_Description *desc)
|
2017-08-30 00:16:18 -07:00
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
Event_Animation *event_anim = _event_animation_find(pd, desc);
|
2018-01-16 03:31:15 -08:00
|
|
|
if (event_anim)
|
|
|
|
return event_anim->anim;
|
2017-08-30 00:16:18 -07:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_efl_canvas_object_event_animation_cancel(Eo *eo_obj)
|
|
|
|
{
|
2017-10-13 04:40:01 -07:00
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
|
|
|
|
|
2018-01-16 03:31:15 -08:00
|
|
|
if (obj)
|
|
|
|
efl_player_stop(obj->anim_player);
|
2017-08-30 00:16:18 -07:00
|
|
|
}
|
|
|
|
|
2016-06-07 22:56:51 -07:00
|
|
|
/* legacy */
|
|
|
|
|
2016-06-16 00:05:00 -07:00
|
|
|
EAPI const char *
|
|
|
|
evas_object_type_get(const Evas_Object *eo_obj)
|
|
|
|
{
|
2016-06-16 00:20:25 -07:00
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, NULL);
|
|
|
|
if (obj->delete_me) return "";
|
2016-06-16 00:05:00 -07:00
|
|
|
return obj->type;
|
|
|
|
}
|
|
|
|
|
2016-06-16 00:20:25 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_static_clip_set(Evas_Object *eo_obj, Eina_Bool is_static_clip)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj);
|
|
|
|
evas_object_async_block(obj);
|
|
|
|
obj->is_static_clip = is_static_clip;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_object_static_clip_get(const Evas_Object *eo_obj)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, EINA_FALSE);
|
|
|
|
return obj->is_static_clip;
|
|
|
|
}
|
|
|
|
|
2016-06-07 22:56:51 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_aspect_set(Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
2017-09-18 00:44:42 -07:00
|
|
|
efl_gfx_size_hint_aspect_set(obj, aspect, EINA_SIZE2D(w, h));
|
2016-06-07 22:56:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
2017-09-18 00:44:42 -07:00
|
|
|
Eina_Size2D sz = { 0, 0 };
|
|
|
|
efl_gfx_size_hint_aspect_get(obj, aspect, &sz);
|
|
|
|
if (w) *w = sz.w;
|
|
|
|
if (h) *h = sz.h;
|
2016-06-07 22:56:51 -07:00
|
|
|
}
|
|
|
|
|
2016-06-08 00:09:38 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_max_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
2017-09-17 22:07:56 -07:00
|
|
|
efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(w, h));
|
2016-06-08 00:09:38 -07:00
|
|
|
}
|
2014-03-11 23:53:00 -07:00
|
|
|
|
2016-06-08 00:09:38 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_max_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
2017-09-17 22:07:56 -07:00
|
|
|
Eina_Size2D sz;
|
|
|
|
sz = efl_gfx_size_hint_max_get(obj);
|
|
|
|
if (w) *w = sz.w;
|
|
|
|
if (h) *h = sz.h;
|
2016-06-08 00:09:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
2017-09-17 22:49:08 -07:00
|
|
|
efl_gfx_size_hint_restricted_min_set(obj, EINA_SIZE2D(w, h));
|
2016-06-08 00:09:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_min_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
2017-09-17 22:49:08 -07:00
|
|
|
Eina_Size2D sz;
|
|
|
|
sz = efl_gfx_size_hint_restricted_min_get(obj);
|
|
|
|
if (w) *w = sz.w;
|
|
|
|
if (h) *h = sz.h;
|
2016-06-08 00:09:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_padding_set(Evas_Object *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_margin_set(obj, l, r, t, b);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_padding_get(const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_margin_get(obj, l, r, t, b);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_weight_set(Evas_Object *obj, double x, double y)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_weight_set(obj, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_weight_get(const Evas_Object *obj, double *x, double *y)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_weight_get(obj, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_align_set(Evas_Object *obj, double x, double y)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_align_set(obj, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_align_get(const Evas_Object *obj, double *x, double *y)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_align_get(obj, x, y);
|
|
|
|
}
|
|
|
|
|
2016-06-20 23:45:31 -07:00
|
|
|
EAPI Evas *
|
|
|
|
evas_object_evas_get(const Eo *eo_obj)
|
|
|
|
{
|
2018-04-06 11:28:55 -07:00
|
|
|
if (efl_isa(eo_obj, EFL_CANVAS_OBJECT_CLASS))
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, NULL);
|
|
|
|
|
|
|
|
if (!obj->layer || !obj->layer->evas) return NULL;
|
|
|
|
return obj->layer->evas->evas;
|
|
|
|
}
|
2016-08-10 07:23:04 -07:00
|
|
|
return efl_provider_find((Eo *) eo_obj, EVAS_CANVAS_CLASS);
|
2016-06-20 23:45:31 -07:00
|
|
|
}
|
|
|
|
|
2017-11-29 00:59:34 -08:00
|
|
|
EAPI void
|
|
|
|
evas_object_scale_set(Evas_Object *obj, double scale)
|
|
|
|
{
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_scale_set(obj, scale);
|
2017-11-29 00:59:34 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI double
|
|
|
|
evas_object_scale_get(const Evas_Object *obj)
|
|
|
|
{
|
2018-04-05 01:47:26 -07:00
|
|
|
return efl_gfx_entity_scale_get(obj);
|
2017-11-29 00:59:34 -08:00
|
|
|
}
|
|
|
|
|
2017-12-07 23:04:18 -08:00
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_object_pointer_inside_by_device_get(const Evas_Object *eo_obj, Efl_Input_Device *dev)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, EINA_FALSE);
|
|
|
|
|
|
|
|
obj->is_pointer_inside_legacy = EINA_TRUE;
|
|
|
|
return efl_canvas_pointer_inside_get(eo_obj, dev);
|
|
|
|
}
|
|
|
|
|
2017-12-12 20:42:17 -08:00
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_object_pointer_coords_inside_get(const Evas_Object *eo_obj, int x, int y)
|
|
|
|
{
|
|
|
|
Eina_Position2D pos = EINA_POSITION2D(x, y);
|
|
|
|
|
|
|
|
return efl_canvas_object_coords_inside_get(eo_obj, pos);
|
|
|
|
}
|
|
|
|
|
2017-12-07 23:04:18 -08:00
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_object_pointer_inside_get(const Evas_Object *eo_obj)
|
|
|
|
{
|
|
|
|
return evas_object_pointer_inside_by_device_get(eo_obj, NULL);
|
|
|
|
}
|
|
|
|
|
2017-05-18 01:37:26 -07:00
|
|
|
/* Internal EO APIs and hidden overrides */
|
|
|
|
|
|
|
|
EOAPI EFL_VOID_FUNC_BODY(efl_canvas_object_legacy_ctor)
|
2017-05-18 01:41:37 -07:00
|
|
|
EOAPI EFL_VOID_FUNC_BODYV(efl_canvas_object_type_set, EFL_FUNC_CALL(type), const char *type)
|
2017-05-18 01:37:26 -07:00
|
|
|
|
2017-04-20 09:24:38 -07:00
|
|
|
#define EFL_CANVAS_OBJECT_EXTRA_OPS \
|
2017-04-21 08:58:38 -07:00
|
|
|
EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_canvas_object_efl_object_dbg_info_get), \
|
2017-04-20 09:24:38 -07:00
|
|
|
EFL_OBJECT_OP_FUNC(efl_event_callback_legacy_call, _efl_canvas_object_efl_object_event_callback_legacy_call), \
|
2017-05-18 01:37:26 -07:00
|
|
|
EFL_OBJECT_OP_FUNC(efl_event_callback_call, _efl_canvas_object_efl_object_event_callback_call), \
|
2017-05-18 01:41:37 -07:00
|
|
|
EFL_OBJECT_OP_FUNC(efl_canvas_object_legacy_ctor, _efl_canvas_object_legacy_ctor), \
|
|
|
|
EFL_OBJECT_OP_FUNC(efl_canvas_object_type_set, _efl_canvas_object_type_set)
|
2017-04-20 09:24:38 -07:00
|
|
|
|
2016-06-20 21:26:15 -07:00
|
|
|
#include "canvas/efl_canvas_object.eo.c"
|