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"
|
|
|
|
|
2008-10-17 04:23:18 -07:00
|
|
|
static Eina_Inlist *
|
2009-11-27 01:51:08 -08:00
|
|
|
get_layer_objects(Evas_Layer *l)
|
2006-01-22 22:54:04 -08:00
|
|
|
{
|
2010-11-26 02:01:18 -08:00
|
|
|
if ((!l) || (!l->objects)) return NULL;
|
2009-11-27 01:51:08 -08:00
|
|
|
return (EINA_INLIST_GET(l->objects));
|
2006-01-22 22:54:04 -08:00
|
|
|
}
|
|
|
|
|
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-10-21 19:12:33 -07:00
|
|
|
static const Evas_Object_Filter_Data default_filter = {
|
2017-03-22 00:55:26 -07:00
|
|
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, {}, {}, NULL, {}, EINA_FALSE, EINA_FALSE, EINA_TRUE, EINA_TRUE
|
2014-10-21 19:12:33 -07:00
|
|
|
};
|
2014-10-28 23:10:03 -07:00
|
|
|
const void * const evas_object_filter_cow_default = &default_filter;
|
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
|
|
|
};
|
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-10-21 19:12:33 -07:00
|
|
|
Eina_Cow *evas_object_filter_cow = NULL;
|
2014-11-12 17:40:16 -08:00
|
|
|
Eina_Cow *evas_object_mask_cow = NULL;
|
2013-12-26 23:56:30 -08:00
|
|
|
|
2013-01-21 19:56:00 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_init_cow(void)
|
|
|
|
{
|
2014-10-21 19:12:33 -07:00
|
|
|
if (evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow && evas_object_3d_cow && evas_object_filter_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-10-21 19:12:33 -07:00
|
|
|
evas_object_filter_cow = eina_cow_add("Evas Filter Data", sizeof (Evas_Object_Filter_Data), 8, &default_filter, 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);
|
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 &&
|
|
|
|
evas_object_3d_cow && evas_object_filter_cow && evas_object_mask_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_filter_cow);
|
|
|
|
eina_cow_del(evas_object_mask_cow);
|
|
|
|
|
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-10-21 19:12:33 -07:00
|
|
|
evas_object_filter_cow = NULL;
|
2014-11-12 17:40:16 -08:00
|
|
|
evas_object_mask_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;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(obj->pointer_grabs, pdata)
|
|
|
|
{
|
|
|
|
if (pdata->evas_pdata->pointer == pointer)
|
|
|
|
return pdata;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_evas_object_pointer_grab_del(Evas_Object_Protected_Data *obj, Evas_Object_Pointer_Data *pdata);
|
|
|
|
|
2016-10-21 05:25:41 -07:00
|
|
|
static void
|
|
|
|
_evas_device_del_cb(void *data, const Efl_Event *ev)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = data;
|
2016-12-05 08:26:25 -08:00
|
|
|
Evas_Object_Pointer_Data *pdata = _evas_object_pointer_data_find(obj,
|
|
|
|
ev->object);
|
2016-10-21 05:25:41 -07:00
|
|
|
|
2016-12-05 08:26:25 -08:00
|
|
|
if (!pdata) return;
|
|
|
|
_evas_object_pointer_grab_del(obj, pdata);
|
2016-10-21 05:25:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-12-05 08:26:25 -08: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))
|
2016-10-21 05:25:41 -07:00
|
|
|
pdata->evas_pdata->mouse_grabbed -= pdata->mouse_grabbed;
|
|
|
|
if (((pdata->mouse_in) || (pdata->mouse_grabbed > 0)) &&
|
2016-12-05 08:26:25 -08:00
|
|
|
(obj->layer) && (obj->layer->evas))
|
|
|
|
pdata->evas_pdata->object.in = eina_list_remove(pdata->evas_pdata->object.in, obj->object);
|
2016-10-21 05:25:41 -07:00
|
|
|
efl_event_callback_del(pdata->evas_pdata->pointer, EFL_EVENT_DEL,
|
2016-12-05 08:26:25 -08:00
|
|
|
_evas_device_del_cb, obj);
|
|
|
|
obj->pointer_grabs = eina_inlist_remove(obj->pointer_grabs,
|
|
|
|
EINA_INLIST_GET(pdata));
|
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;
|
2016-12-05 08:26:25 -08:00
|
|
|
obj->pointer_grabs = eina_inlist_append(obj->pointer_grabs,
|
|
|
|
EINA_INLIST_GET(pdata));
|
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,
|
|
|
|
_evas_device_del_cb, obj);
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2015-04-13 05:50:43 -07:00
|
|
|
Eo *parent = NULL;
|
2016-06-20 23:45:31 -07:00
|
|
|
Evas *evas;
|
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));
|
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
|
|
|
|
2016-06-20 23:45:31 -07:00
|
|
|
if (!obj || !_init_cow() || !evas)
|
2013-01-16 23:21:06 -08:00
|
|
|
{
|
2016-06-20 23:45:31 -07:00
|
|
|
ERR("Failed to create a canvas object (evas: %p)", evas);
|
2015-05-19 03:41:27 -07:00
|
|
|
return NULL;
|
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);
|
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;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
Evas_Coord_Rectangle bounding_box;
|
|
|
|
|
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
|
2016-12-15 21:35:52 -08:00
|
|
|
evas_object_free(Evas_Object *eo_obj, Eina_Bool clean_layer)
|
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
|
|
|
if (!obj) return;
|
2016-12-15 21:35:52 -08:00
|
|
|
obj->clean_layer = !!clean_layer;
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2005-10-26 19:44:36 -07:00
|
|
|
int was_smart_child = 0;
|
2006-07-30 07:30:24 -07:00
|
|
|
|
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)
|
|
|
|
{
|
2015-07-01 20:04:02 -07:00
|
|
|
obj->layer->evas->engine.func->image_free
|
2012-11-11 18:22:39 -08:00
|
|
|
(obj->layer->evas->engine.data.output,
|
2013-01-21 19:56:00 -08:00
|
|
|
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)
|
|
|
|
{
|
|
|
|
obj->layer->evas->engine.func->image_free
|
|
|
|
(obj->layer->evas->engine.data.output, mask->surface);
|
|
|
|
mask->surface = NULL;
|
|
|
|
}
|
2015-01-21 00:30:18 -08:00
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_mask_cow, obj->mask, mask);
|
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_grabs_cleanup(eo_obj, obj);
|
|
|
|
evas_object_intercept_cleanup(eo_obj);
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->smart.parent) was_smart_child = 1;
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_smart_cleanup(eo_obj);
|
|
|
|
if (obj->func->free)
|
|
|
|
{
|
2013-07-08 17:46:15 -07:00
|
|
|
obj->func->free(eo_obj, obj, obj->private_data);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
if (!was_smart_child) evas_object_release(eo_obj, 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);
|
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)
|
|
|
|
{
|
2015-07-01 20:04:02 -07:00
|
|
|
obj->layer->evas->engine.func->image_free
|
2013-02-28 13:36:32 -08:00
|
|
|
(obj->layer->evas->engine.data.output, map_write->surface);
|
|
|
|
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
|
|
|
|
2012-10-08 18:58:41 -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))
|
2013-04-26 11:01:44 -07:00
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output,
|
|
|
|
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))
|
2013-04-26 11:01:44 -07:00
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output,
|
|
|
|
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))
|
2013-04-26 11:01:44 -07:00
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output,
|
|
|
|
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))
|
2013-04-26 11:01:44 -07:00
|
|
|
obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output,
|
|
|
|
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
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_del(Evas_Object *eo_obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
if (!eo_obj) return;
|
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2006-10-15 07:39:16 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, MY_CLASS);
|
2006-07-12 17:26:25 -07:00
|
|
|
|
2012-11-09 19:44:04 -08:00
|
|
|
if (!obj) return;
|
2015-02-10 03:44:38 -08:00
|
|
|
evas_object_async_block(obj);
|
2016-08-10 07:23:04 -07:00
|
|
|
if (obj->delete_me || obj->efl_del_called) return;
|
2011-03-08 04:23:37 -08:00
|
|
|
if (obj->ref > 0)
|
|
|
|
{
|
2012-03-28 00:17:39 -07:00
|
|
|
obj->del_ref = EINA_TRUE;
|
2011-03-08 04:23:37 -08:00
|
|
|
return;
|
|
|
|
}
|
2016-04-26 13:18:15 -07:00
|
|
|
evas_object_hide(eo_obj);
|
2016-08-10 07:23:04 -07:00
|
|
|
obj->efl_del_called = EINA_TRUE;
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_del(eo_obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2016-12-06 06:42:30 -08:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_canvas_object_efl_input_interface_seat_event_filter_get(Eo *eo_obj EINA_UNUSED,
|
|
|
|
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;
|
|
|
|
return eina_list_data_find(obj->events_whitelist, seat) ?
|
|
|
|
EINA_TRUE : EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_whitelist_events_device_remove_cb(void *data, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
Evas_Object_Protected_Data *obj = data;
|
|
|
|
obj->events_whitelist = eina_list_remove(obj->events_whitelist,
|
|
|
|
event->object);
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
if (efl_input_device_type_get(seat) != EFL_INPUT_DEVICE_CLASS_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)
|
|
|
|
{
|
|
|
|
if (eina_list_data_find(obj->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) */
|
|
|
|
if ((!obj->events_whitelist) && (obj->layer) && (obj->layer->evas))
|
|
|
|
{
|
|
|
|
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) ==
|
|
|
|
EFL_INPUT_DEVICE_CLASS_SEAT) && (dev != seat))
|
|
|
|
efl_canvas_object_seat_focus_del(eo_obj, dev);
|
|
|
|
}
|
|
|
|
}
|
2016-12-06 06:42:30 -08:00
|
|
|
obj->events_whitelist = eina_list_append(obj->events_whitelist, seat);
|
|
|
|
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);
|
2016-12-06 06:42:30 -08:00
|
|
|
obj->events_whitelist = eina_list_remove(obj->events_whitelist, seat);
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_canvas_object_efl_object_event_callback_call(Eo *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj EINA_UNUSED,
|
|
|
|
const Efl_Event_Description *desc,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
if (_is_event_blocked(eo_obj, desc, event_info)) return EINA_FALSE;
|
|
|
|
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,
|
|
|
|
Evas_Object_Protected_Data *obj EINA_UNUSED,
|
|
|
|
const Efl_Event_Description *desc,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
if (_is_event_blocked(eo_obj, desc, event_info)) return EINA_FALSE;
|
|
|
|
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
|
2016-08-10 07:23:04 -07:00
|
|
|
_efl_canvas_object_efl_object_destructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2014-02-05 03:09:05 -08:00
|
|
|
Evas_Object *proxy;
|
|
|
|
Eina_List *l, *l2;
|
2015-06-17 07:31:14 -07:00
|
|
|
Evas_Canvas3D_Texture *texture;
|
2016-10-19 06:02:18 -07:00
|
|
|
Efl_Input_Device *dev;
|
|
|
|
Evas_Public_Data *edata;
|
2016-12-05 08:26:25 -08:00
|
|
|
Evas_Object_Pointer_Data *pdata;
|
2017-02-16 02:34:08 -08:00
|
|
|
int event_id;
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2016-10-19 06:02:18 -07:00
|
|
|
edata = efl_data_scope_get(evas_object_evas_get(eo_obj), EVAS_CANVAS_CLASS);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_hide(eo_obj);
|
2016-10-19 06:02:18 -07:00
|
|
|
EINA_LIST_FREE (obj->focused_by_seats, dev)
|
2011-03-08 22:16:46 -08:00
|
|
|
{
|
2017-02-16 02:34:08 -08:00
|
|
|
event_id = _evas_event_counter;
|
2016-10-19 06:02:18 -07:00
|
|
|
efl_event_callback_del(dev, EFL_EVENT_DEL,
|
|
|
|
_evas_focus_device_del_cb, obj);
|
|
|
|
eina_hash_del_by_key(edata->focused_objects, &dev);
|
2016-11-18 07:00:34 -08:00
|
|
|
_evas_focus_dispatch_event(obj, dev, EINA_FALSE);
|
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);
|
2011-03-08 22:16:46 -08:00
|
|
|
}
|
2016-12-05 08:26:25 -08:00
|
|
|
EINA_INLIST_FREE(obj->pointer_grabs, pdata)
|
|
|
|
_evas_object_pointer_grab_del(obj, pdata);
|
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);
|
2016-12-06 06:42:30 -08:00
|
|
|
EINA_LIST_FREE(obj->events_whitelist, dev)
|
|
|
|
efl_event_callback_del(dev, EFL_EVENT_DEL, _whitelist_events_device_remove_cb, obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
if (obj->name) evas_object_name_set(eo_obj, NULL);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!obj->layer)
|
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_manual_free_set(eo_obj, EINA_FALSE);
|
2012-10-08 18:58:41 -07:00
|
|
|
obj->clean_layer = 1;
|
|
|
|
goto end;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_grabs_cleanup(eo_obj, obj);
|
2016-01-27 19:18:34 -08:00
|
|
|
if (obj->clip.clipees)
|
2014-03-11 00:34:56 -07:00
|
|
|
{
|
2016-01-27 19:18:34 -08:00
|
|
|
ERR("object %p still has %d clippees after del callback",
|
|
|
|
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);
|
|
|
|
}
|
2014-03-11 00:34:56 -07:00
|
|
|
}
|
2016-03-16 03:37:04 -07:00
|
|
|
|
|
|
|
/* FIXME: Proxies should listen to source death */
|
2014-02-05 03:09:05 -08:00
|
|
|
EINA_LIST_FOREACH_SAFE(obj->proxy->proxies, l, l2, proxy)
|
2014-03-03 21:14:15 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
if (efl_isa(proxy, EFL_CANVAS_IMAGE_INTERNAL_CLASS))
|
2014-03-03 21:14:15 -08:00
|
|
|
evas_object_image_source_unset(proxy);
|
2016-08-15 06:44:41 -07:00
|
|
|
if (efl_isa(proxy, EFL_GFX_FILTER_INTERFACE))
|
2016-03-01 10:06:28 -08:00
|
|
|
efl_gfx_filter_source_set(proxy, NULL, eo_obj);
|
2014-03-03 21:14:15 -08:00
|
|
|
}
|
2014-01-07 00:39:23 -08:00
|
|
|
|
2014-10-28 22:15:11 -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-05-12 00:47:54 -07:00
|
|
|
{
|
2014-10-28 22:15:11 -07:00
|
|
|
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy,
|
|
|
|
Evas_Object_Proxy_Data, proxy_src)
|
|
|
|
{
|
|
|
|
EINA_LIST_FREE(proxy_src->proxy_textures, texture)
|
2016-03-01 10:06:28 -08:00
|
|
|
evas_canvas3d_texture_source_set(texture, NULL);
|
2014-10-28 22:15:11 -07:00
|
|
|
}
|
|
|
|
EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_src);
|
2014-05-12 00:47:54 -07:00
|
|
|
}
|
2014-01-07 00:39:23 -08:00
|
|
|
|
2013-03-12 05:58:19 -07:00
|
|
|
if (obj->cur->clipper) evas_object_clip_unset(eo_obj);
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_clip_prev_reset(obj, EINA_FALSE);
|
2016-01-27 19:18:34 -08:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_map_set(eo_obj, NULL);
|
|
|
|
if (obj->is_smart) evas_object_smart_del(eo_obj);
|
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
|
|
|
}
|
|
|
|
|
2016-06-08 23:05:36 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_geometry_set(Eo *obj, Evas_Object_Protected_Data *pd EINA_UNUSED,
|
|
|
|
int x, int y, int w, int h)
|
2016-06-08 23:05:36 -07:00
|
|
|
{
|
|
|
|
efl_gfx_position_set(obj, x, y);
|
|
|
|
efl_gfx_size_set(obj, w, h);
|
|
|
|
}
|
|
|
|
|
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();
|
2016-06-08 23:05:36 -07:00
|
|
|
efl_gfx_geometry_set(eo_obj, 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)
|
|
|
|
{
|
2016-03-01 10:06:28 -08:00
|
|
|
efl_gfx_position_set((Evas_Object *)obj, x, y);
|
2013-07-19 02:37:11 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_position_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
|
|
|
Evas_Coord x, Evas_Coord y)
|
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;
|
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)
|
|
|
|
{
|
2016-03-01 10:06:28 -08:00
|
|
|
efl_gfx_size_set((Evas_Object *)obj, 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
|
|
|
|
_efl_canvas_object_efl_gfx_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
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
|
|
|
Evas_Coord w, Evas_Coord h)
|
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
|
|
|
|
2016-05-18 12:27:58 -07:00
|
|
|
if (w < 0) w = 0;
|
|
|
|
if (h < 0) h = 0;
|
2011-12-26 15:09:45 -08:00
|
|
|
|
2017-02-17 01:46:09 -08:00
|
|
|
if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 1, w, 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)
|
|
|
|
obj->smart.smart->smart_class->resize(eo_obj, w, 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)
|
|
|
|
{
|
|
|
|
state_write->geometry.w = w;
|
|
|
|
state_write->geometry.h = h;
|
|
|
|
}
|
|
|
|
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);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_resize(eo_obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2016-06-08 23:05:36 -07:00
|
|
|
EOLIAN void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_geometry_get(Eo *obj, Evas_Object_Protected_Data *pd EINA_UNUSED,
|
|
|
|
int *x, int *y, int *w, int *h)
|
2016-06-08 23:05:36 -07:00
|
|
|
{
|
|
|
|
efl_gfx_position_get(obj, x, y);
|
|
|
|
efl_gfx_size_get(obj, w, h);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2016-05-18 12:27:58 -07:00
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
|
|
|
if (w) *w = 0;
|
|
|
|
if (h) *h = 0;
|
2002-11-08 00:02:15 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2016-06-08 23:05:36 -07:00
|
|
|
efl_gfx_geometry_get(eo_obj, x, y, w, h);
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_position_get(Eo *obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *pd,
|
|
|
|
Evas_Coord *x, Evas_Coord *y)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2015-04-03 07:23:17 -07:00
|
|
|
if ((pd->delete_me) || (!pd->layer))
|
2004-03-07 18:42:08 -08:00
|
|
|
{
|
2016-05-18 12:27:58 -07:00
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
2011-06-08 19:45:59 -07:00
|
|
|
return;
|
2004-03-07 18:42:08 -08:00
|
|
|
}
|
2012-01-02 13:27:46 -08:00
|
|
|
|
2015-04-03 07:23:17 -07:00
|
|
|
if (x) *x = pd->cur->geometry.x;
|
|
|
|
if (y) *y = pd->cur->geometry.y;
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|
|
|
|
|
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_get(Eo *obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *pd,
|
|
|
|
Evas_Coord *w, Evas_Coord *h)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2015-04-03 07:23:17 -07:00
|
|
|
if (pd->delete_me)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2016-05-18 12:27:58 -07:00
|
|
|
if (w) *w = 0;
|
|
|
|
if (h) *h = 0;
|
2012-10-08 18:58:41 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:23:17 -07:00
|
|
|
if (w) *w = pd->cur->geometry.w;
|
|
|
|
if (h) *h = pd->cur->geometry.h;
|
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;
|
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static Evas_Display_Mode
|
2016-06-29 22:23:42 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_display_mode_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2012-09-27 01:54:54 -07:00
|
|
|
{
|
2012-11-09 19:44:04 -08:00
|
|
|
if (!obj) return EVAS_DISPLAY_MODE_NONE;
|
2012-09-27 01:54:54 -07:00
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
|
|
|
return EVAS_DISPLAY_MODE_NONE;
|
|
|
|
return obj->size_hints->dispmode;
|
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static void
|
2016-06-29 22:23:42 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_display_mode_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Display_Mode dispmode)
|
2012-09-27 01:54:54 -07:00
|
|
|
{
|
2012-11-09 19:44:04 -08:00
|
|
|
if (!obj) return;
|
|
|
|
if (obj->delete_me) return;
|
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;
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj);
|
2008-10-04 09:57:02 -07:00
|
|
|
}
|
2008-04-11 16:12:20 -07:00
|
|
|
|
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_restricted_min_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *w, Evas_Coord *h)
|
2008-04-11 16:12:20 -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
|
|
|
{
|
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->min.w;
|
|
|
|
if (h) *h = obj->size_hints->min.h;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
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_restricted_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord w, Evas_Coord h)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-04-11 16:12:20 -07:00
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
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->min.w == w) && (obj->size_hints->min.h == h)) return;
|
2008-04-30 15:51:08 -07:00
|
|
|
obj->size_hints->min.w = w;
|
|
|
|
obj->size_hints->min.h = h;
|
2008-04-11 16:12:20 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj);
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
2016-06-08 04:24:59 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_combined_min_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *w, Evas_Coord *h)
|
2016-06-08 04:24:59 -07:00
|
|
|
{
|
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
|
|
|
{
|
|
|
|
if (w) *w = 0;
|
|
|
|
if (h) *h = 0;
|
|
|
|
return;
|
|
|
|
}
|
2016-06-09 00:24:13 -07:00
|
|
|
if (w) *w = MAX(obj->size_hints->min.w, obj->size_hints->user_min.w);
|
|
|
|
if (h) *h = MAX(obj->size_hints->min.h, obj->size_hints->user_min.h);
|
2016-06-08 04:24:59 -07:00
|
|
|
}
|
|
|
|
|
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_max_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *w, Evas_Coord *h)
|
2008-04-11 16:12:20 -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
|
|
|
{
|
2016-05-18 12:27:58 -07:00
|
|
|
if (w) *w = -1;
|
|
|
|
if (h) *h = -1;
|
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->max.w;
|
|
|
|
if (h) *h = obj->size_hints->max.h;
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
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_max_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord w, Evas_Coord h)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-04-11 16:12:20 -07:00
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
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 == -1) && (h == -1)) return;
|
|
|
|
_evas_object_size_hint_alloc(eo_obj, obj);
|
|
|
|
}
|
2008-10-04 10:10:44 -07:00
|
|
|
if ((obj->size_hints->max.w == w) && (obj->size_hints->max.h == h)) return;
|
2008-04-30 15:51:08 -07:00
|
|
|
obj->size_hints->max.w = w;
|
|
|
|
obj->size_hints->max.h = h;
|
2008-04-11 16:12:20 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj);
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
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_request_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *w, Evas_Coord *h)
|
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
|
|
|
{
|
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
|
|
|
}
|
|
|
|
|
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_request_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord w, Evas_Coord h)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-04-11 16:12:20 -07:00
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
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
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj);
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
2016-06-09 00:24:13 -07:00
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_min_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *w, Evas_Coord *h)
|
2016-06-09 00:24:13 -07:00
|
|
|
{
|
|
|
|
if ((!obj->size_hints) || obj->delete_me)
|
|
|
|
{
|
|
|
|
if (w) *w = 0;
|
|
|
|
if (h) *h = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (w) *w = obj->size_hints->user_min.w;
|
|
|
|
if (h) *h = obj->size_hints->user_min.h;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_size_hint_hint_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord w, Evas_Coord h)
|
2016-06-09 00:24:13 -07:00
|
|
|
{
|
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
|
|
|
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);
|
|
|
|
}
|
2016-06-09 00:24:13 -07:00
|
|
|
if ((obj->size_hints->user_min.w == w) && (obj->size_hints->user_min.h == h)) return;
|
|
|
|
obj->size_hints->user_min.w = w;
|
|
|
|
obj->size_hints->user_min.h = h;
|
|
|
|
|
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj);
|
|
|
|
}
|
|
|
|
|
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_aspect_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Efl_Gfx_Size_Hint_Aspect *aspect, Evas_Coord *w, Evas_Coord *h)
|
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;
|
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 (aspect) *aspect = obj->size_hints->aspect.mode;
|
|
|
|
if (w) *w = obj->size_hints->aspect.size.w;
|
|
|
|
if (h) *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
|
2016-06-20 21:26:15 -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, Evas_Coord w, Evas_Coord h)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-04-11 16:12:20 -07:00
|
|
|
if (obj->delete_me)
|
|
|
|
return;
|
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 20:47:52 -07:00
|
|
|
if ((obj->size_hints->aspect.mode == aspect) && (obj->size_hints->aspect.size.w == w) && (obj->size_hints->aspect.size.h == h)) return;
|
2008-04-30 15:51:08 -07:00
|
|
|
obj->size_hints->aspect.mode = aspect;
|
|
|
|
obj->size_hints->aspect.size.w = w;
|
|
|
|
obj->size_hints->aspect.size.h = h;
|
2008-04-11 16:12:20 -07:00
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj);
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
|
|
|
|
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_get(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;
|
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-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
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj);
|
2008-10-04 09:11:23 -07:00
|
|
|
}
|
|
|
|
|
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_get(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;
|
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-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
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_obj);
|
2008-10-04 09:11:23 -07:00
|
|
|
}
|
|
|
|
|
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_get(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;
|
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;
|
|
|
|
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(eo_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();
|
2016-03-01 10:06:28 -08:00
|
|
|
efl_gfx_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;
|
2016-03-01 10:06:28 -08:00
|
|
|
efl_gfx_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)
|
|
|
|
{
|
2016-03-01 10:06:28 -08:00
|
|
|
return efl_gfx_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
|
|
|
{
|
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);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_show(eo_obj);
|
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)
|
|
|
|
{
|
2015-07-01 20:04:02 -07:00
|
|
|
obj->layer->evas->engine.func->image_free
|
2015-01-22 00:43:23 -08:00
|
|
|
(obj->layer->evas->engine.data.output, mask->surface);
|
|
|
|
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) ||
|
2013-01-21 19:56:00 -08:00
|
|
|
((obj->map->cur.map) && (obj->map->cur.map->count == 4) && (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;
|
2016-12-05 08:26:25 -08:00
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(obj->pointer_grabs, obj_pdata)
|
2011-09-25 19:45:06 -07:00
|
|
|
{
|
2016-10-21 05:25:41 -07:00
|
|
|
if (!obj_pdata->mouse_grabbed &&
|
|
|
|
evas_object_is_in_output_rect(eo_obj, obj, obj_pdata->evas_pdata->x,
|
|
|
|
obj_pdata->evas_pdata->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);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_hide(eo_obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2016-10-10 02:59:42 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_efl_canvas_object_efl_gfx_visible_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
|
|
|
Eina_Bool vis)
|
|
|
|
{
|
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);
|
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
static Eina_Bool
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_visible_get(Eo *eo_obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2014-03-11 04:51:35 -07:00
|
|
|
if (obj->delete_me) return EINA_FALSE;
|
|
|
|
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
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_color_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
|
|
|
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);
|
|
|
|
|
2016-10-07 00:25:49 -07:00
|
|
|
if (obj->is_smart && obj->smart.smart->smart_class &&
|
|
|
|
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:30:32 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_color_part_set(Eo *obj, Evas_Object_Protected_Data *pd,
|
|
|
|
const char *part,
|
|
|
|
int r, int g, int b, int a)
|
2015-04-03 07:30:32 -07:00
|
|
|
{
|
|
|
|
if (part) return EINA_FALSE;
|
|
|
|
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_color_set(obj, pd, r, g, b, a);
|
2015-04-03 07:30:32 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
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
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_color_get(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
|
|
|
}
|
|
|
|
|
2015-04-03 07:30:32 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_color_part_get(Eo *obj,
|
|
|
|
Evas_Object_Protected_Data *pd,
|
|
|
|
const char *part,
|
|
|
|
int *r, int *g, int *b, int *a)
|
2015-04-03 07:30:32 -07:00
|
|
|
{
|
|
|
|
if (part) return EINA_FALSE;
|
|
|
|
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_efl_gfx_color_get(obj, pd, r, g, b, a);
|
2015-04-03 07:30:32 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
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
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_anti_alias_get(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
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_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);
|
2013-07-08 17:46:15 -07:00
|
|
|
if (obj->func->scale_update) obj->func->scale_update(eo_obj, obj, obj->private_data);
|
2008-09-09 07:14:26 -07:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN static double
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_scale_get(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
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_render_op_get(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;
|
|
|
|
int w, h;
|
|
|
|
int requestw, requesth;
|
|
|
|
int minw, minh;
|
|
|
|
int maxw, maxh;
|
|
|
|
int x, y;
|
|
|
|
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;
|
|
|
|
|
2016-03-01 10:06:28 -08:00
|
|
|
visible = efl_gfx_visible_get(eo_obj);
|
|
|
|
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);
|
2016-03-01 10:06:28 -08:00
|
|
|
efl_gfx_position_get(eo_obj, &x, &y);
|
|
|
|
efl_gfx_size_get(eo_obj, &w, &h);
|
2016-06-20 21:26:15 -07:00
|
|
|
scale = efl_canvas_object_scale_get(eo_obj);
|
2016-06-08 22:31:37 -07:00
|
|
|
efl_gfx_size_hint_restricted_min_get(eo_obj, &minw, &minh);
|
2016-06-08 00:09:38 -07:00
|
|
|
efl_gfx_size_hint_max_get(eo_obj, &maxw, &maxh);
|
|
|
|
efl_gfx_size_hint_request_get(eo_obj, &requestw, &requesth);
|
|
|
|
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");
|
|
|
|
EFL_DBG_INFO_APPEND(node, "x", EINA_VALUE_TYPE_INT, x);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "y", EINA_VALUE_TYPE_INT, 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");
|
|
|
|
EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_INT, w);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_INT, 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");
|
|
|
|
EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_INT, minw);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_INT, minh);
|
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");
|
|
|
|
EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_INT, maxw);
|
|
|
|
EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_INT, maxh);
|
2013-01-28 22:36:23 -08:00
|
|
|
|
2016-08-15 06:44:41 -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 *
|
2016-08-10 07:23:04 -07:00
|
|
|
_efl_canvas_object_efl_object_provider_find(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)
|
|
|
|
{
|
|
|
|
if ((obj->delete_me) || (!obj->layer)) return NULL;
|
|
|
|
return obj->layer->evas->evas;
|
|
|
|
}
|
2016-12-12 20:38:16 -08:00
|
|
|
else if (klass == EFL_LOOP_CLASS)
|
|
|
|
return ecore_main_loop_get();
|
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 *
|
|
|
|
_efl_canvas_object_efl_loop_user_loop_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED)
|
|
|
|
{
|
|
|
|
return ecore_main_loop_get();
|
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN Evas_Object*
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_object_top_at_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2002-11-08 00:02:15 -08:00
|
|
|
int xx, yy;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2006-11-15 19:20:24 -08:00
|
|
|
xx = x;
|
|
|
|
yy = y;
|
2012-10-08 18:58:41 -07:00
|
|
|
//// xx = evas_coord_world_x_to_screen(eo_e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(eo_e, y);
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
|
|
|
Evas_Object_Protected_Data *obj;
|
2011-06-08 19:45:59 -07:00
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_obj = obj->object;
|
2011-06-08 19:45:59 -07:00
|
|
|
if (obj->delete_me) continue;
|
2011-11-15 07:10:19 -08:00
|
|
|
if ((!include_pass_events_objects) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
(evas_event_passes_through(eo_obj, obj))) continue;
|
2012-10-21 21:57:32 -07:00
|
|
|
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
|
2013-03-12 05:58:19 -07:00
|
|
|
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
|
2014-03-11 23:53:00 -07:00
|
|
|
(!obj->clip.clipees)) return eo_obj;
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
}
|
2014-03-11 23:53:00 -07:00
|
|
|
return NULL;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_Object *
|
2014-06-30 11:29:54 -07:00
|
|
|
evas_object_top_at_pointer_get(const Evas *eo_e)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Public_Data *e = efl_isa(eo_e, EVAS_CANVAS_CLASS) ?
|
|
|
|
efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS) : NULL;
|
2012-11-09 19:44:04 -08:00
|
|
|
if (!e) return NULL;
|
2016-10-21 05:25:41 -07:00
|
|
|
|
|
|
|
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, NULL);
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
|
|
|
|
return evas_canvas_object_top_at_xy_get((Eo *)eo_e, pdata->x, pdata->y, EINA_TRUE, EINA_TRUE);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN Evas_Object*
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_object_top_in_rectangle_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2002-11-08 00:02:15 -08:00
|
|
|
int xx, yy, ww, hh;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2006-11-15 19:20:24 -08:00
|
|
|
xx = x;
|
|
|
|
yy = y;
|
|
|
|
ww = w;
|
|
|
|
hh = h;
|
2012-10-08 18:58:41 -07:00
|
|
|
//// xx = evas_coord_world_x_to_screen(eo_e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(eo_e, y);
|
|
|
|
//// ww = evas_coord_world_x_to_screen(eo_e, w);
|
|
|
|
//// hh = evas_coord_world_y_to_screen(eo_e, h);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (ww < 1) ww = 1;
|
|
|
|
if (hh < 1) hh = 1;
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
|
|
|
Evas_Object_Protected_Data *obj;
|
2011-06-08 19:45:59 -07:00
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_obj = obj->object;
|
2011-06-08 19:45:59 -07:00
|
|
|
if (obj->delete_me) continue;
|
2011-11-15 07:10:19 -08:00
|
|
|
if ((!include_pass_events_objects) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
(evas_event_passes_through(eo_obj, obj))) continue;
|
2012-10-21 21:57:32 -07:00
|
|
|
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
|
2013-03-12 05:58:19 -07:00
|
|
|
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
|
2014-03-11 23:53:00 -07:00
|
|
|
(!obj->clip.clipees)) return eo_obj;
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2012-10-08 18:58:41 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN Eina_List*
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_objects_at_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2012-10-08 18:58:41 -07:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *in = NULL;
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2002-11-08 00:02:15 -08:00
|
|
|
int xx, yy;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2006-11-15 19:20:24 -08:00
|
|
|
xx = x;
|
|
|
|
yy = y;
|
2012-10-08 18:58:41 -07:00
|
|
|
//// xx = evas_coord_world_x_to_screen(eo_e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(eo_e, y);
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
|
|
|
Evas_Object_Protected_Data *obj;
|
2011-06-08 19:45:59 -07:00
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_obj = obj->object;
|
|
|
|
// FIXME - Daniel: we don't know yet how to handle the next line
|
2011-06-08 19:45:59 -07:00
|
|
|
if (obj->delete_me) continue;
|
2011-11-15 07:10:19 -08:00
|
|
|
if ((!include_pass_events_objects) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
(evas_event_passes_through(eo_obj, obj))) continue;
|
2012-10-21 21:57:32 -07:00
|
|
|
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
|
2013-03-12 05:58:19 -07:00
|
|
|
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
|
2011-06-08 19:45:59 -07:00
|
|
|
(!obj->clip.clipees))
|
2016-08-09 21:52:26 -07:00
|
|
|
{
|
|
|
|
// evas_object_is_in_output_rect is based on the clip which
|
|
|
|
// may be larger than the geometry (bounding box)
|
|
|
|
if (!RECTS_INTERSECT(xx, yy, 1, 1,
|
|
|
|
obj->cur->geometry.x,
|
|
|
|
obj->cur->geometry.y,
|
|
|
|
obj->cur->geometry.w,
|
|
|
|
obj->cur->geometry.h))
|
|
|
|
continue;
|
|
|
|
in = eina_list_prepend(in, eo_obj);
|
|
|
|
}
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2014-03-11 23:53:00 -07:00
|
|
|
return in;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2009-09-17 15:38:10 -07:00
|
|
|
/**
|
|
|
|
* Retrieves the objects in the given rectangle region
|
2012-10-22 23:26:40 -07:00
|
|
|
* @param eo_e The given evas object.
|
2009-09-17 15:38:10 -07:00
|
|
|
* @param x The horizontal coordinate.
|
|
|
|
* @param y The vertical coordinate.
|
|
|
|
* @param w The width size.
|
|
|
|
* @param h The height size.
|
|
|
|
* @param include_pass_events_objects Boolean Flag to include or not pass events objects
|
|
|
|
* @param include_hidden_objects Boolean Flag to include or not hidden objects
|
|
|
|
* @return The list of evas object in the rectangle region.
|
|
|
|
*
|
|
|
|
*/
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN Eina_List*
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_objects_in_rectangle_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *in = NULL;
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2002-11-08 00:02:15 -08:00
|
|
|
int xx, yy, ww, hh;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2006-11-15 19:20:24 -08:00
|
|
|
xx = x;
|
|
|
|
yy = y;
|
2008-10-17 04:23:18 -07:00
|
|
|
ww = w;
|
2006-11-15 19:20:24 -08:00
|
|
|
hh = h;
|
2012-10-08 18:58:41 -07:00
|
|
|
//// xx = evas_coord_world_x_to_screen(eo_e, x);
|
|
|
|
//// yy = evas_coord_world_y_to_screen(eo_e, y);
|
|
|
|
//// ww = evas_coord_world_x_to_screen(eo_e, w);
|
|
|
|
//// hh = evas_coord_world_y_to_screen(eo_e, h);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (ww < 1) ww = 1;
|
|
|
|
if (hh < 1) hh = 1;
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
Evas_Object *eo_obj;
|
|
|
|
Evas_Object_Protected_Data *obj;
|
2011-06-08 19:45:59 -07:00
|
|
|
|
|
|
|
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
eo_obj = obj->object;
|
|
|
|
// FIXME - Daniel: we don't know yet how to handle the next line
|
2011-06-08 19:45:59 -07:00
|
|
|
if (obj->delete_me) continue;
|
2011-11-15 07:10:19 -08:00
|
|
|
if ((!include_pass_events_objects) &&
|
2012-10-08 18:58:41 -07:00
|
|
|
(evas_event_passes_through(eo_obj, obj))) continue;
|
2012-10-21 21:57:32 -07:00
|
|
|
if (evas_object_is_source_invisible(eo_obj, obj)) continue;
|
2013-03-12 05:58:19 -07:00
|
|
|
if ((!include_hidden_objects) && (!obj->cur->visible)) continue;
|
2013-04-06 22:00:10 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
2012-10-08 18:58:41 -07:00
|
|
|
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, ww, hh)) &&
|
2011-06-08 19:45:59 -07:00
|
|
|
(!obj->clip.clipees))
|
2012-10-22 01:57:08 -07:00
|
|
|
in = eina_list_prepend(in, eo_obj);
|
2011-06-08 19:45:59 -07:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2014-03-11 23:53:00 -07:00
|
|
|
return in;
|
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_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
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_precise_is_inside_get(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
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_is_frame_object_get(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 *
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_render_parent_get(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
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_paragraph_direction_get(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));
|
2016-03-14 03:38:44 -07:00
|
|
|
obj->legacy = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2016-06-20 23:45:31 -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)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_aspect_set(obj, aspect, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_aspect_get(obj, aspect, w, h);
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_max_set(obj, w, h);
|
|
|
|
}
|
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)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_max_get(obj, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_request_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_request_set(obj, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_request_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_request_get(obj, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
|
|
{
|
2016-06-08 22:31:37 -07:00
|
|
|
efl_gfx_size_hint_restricted_min_set(obj, 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)
|
|
|
|
{
|
2016-06-08 22:31:37 -07:00
|
|
|
efl_gfx_size_hint_restricted_min_get(obj, w, 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)
|
|
|
|
{
|
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
|
|
|
}
|
|
|
|
|
2016-06-29 22:23:42 -07:00
|
|
|
EAPI void
|
|
|
|
evas_object_size_hint_display_mode_set(Evas_Object *obj, Evas_Display_Mode dispmode)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_display_mode_set(obj, dispmode);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Display_Mode
|
|
|
|
evas_object_size_hint_display_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
return efl_gfx_size_hint_display_mode_get(obj);
|
|
|
|
}
|
|
|
|
|
2016-06-20 21:26:15 -07:00
|
|
|
#include "canvas/efl_canvas_object.eo.c"
|