forked from enlightenment/efl
evas/event - dont pass events when source_events is false
SVN revision: 78386
This commit is contained in:
parent
0438eb2134
commit
bebeefb155
|
@ -158,7 +158,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
|
|||
}
|
||||
|
||||
static void
|
||||
_evas_object_source_event(Evas_Object *eo_obj, Evas *eo_e, Evas_Callback_Type type, void *ev, int event_id)
|
||||
_evas_object_source_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Callback_Type type, void *ev, int event_id)
|
||||
{
|
||||
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
||||
Evas_Object *src_eo = _evas_object_image_source_get(eo_obj);
|
||||
|
@ -207,8 +207,8 @@ _evas_object_source_event(Evas_Object *eo_obj, Evas *eo_e, Evas_Callback_Type ty
|
|||
static inline void
|
||||
_evas_event_pass_to_source(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas *eo_e, Evas_Callback_Type type, void *ev, int event_id)
|
||||
{
|
||||
if (obj->proxy.is_proxy)
|
||||
_evas_object_source_event(eo_obj, eo_e, type, ev, event_id);
|
||||
if (obj->proxy.is_proxy && obj->proxy.source_events)
|
||||
_evas_object_source_events(eo_obj, eo_e, type, ev, event_id);
|
||||
}
|
||||
|
||||
static Eina_List *
|
||||
|
|
|
@ -88,8 +88,6 @@ struct _Evas_Object_Image
|
|||
Eina_Bool dirty_pixels : 1;
|
||||
Eina_Bool filled : 1;
|
||||
Eina_Bool proxyrendering : 1;
|
||||
Eina_Bool source_invisible : 1;
|
||||
Eina_Bool source_events: 1;
|
||||
Eina_Bool preloading : 1;
|
||||
Eina_Bool video_surface : 1;
|
||||
Eina_Bool video_visible : 1;
|
||||
|
@ -572,12 +570,13 @@ _image_source_events_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|||
{
|
||||
Evas_Object_Image *o = _pd;
|
||||
Eina_Bool source_events = va_arg(*list, int);
|
||||
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
||||
|
||||
source_events = !!source_events;
|
||||
if (o->source_events == source_events) return;
|
||||
o->source_events = source_events;
|
||||
if (obj->proxy.source_events == source_events) return;
|
||||
obj->proxy.source_events = source_events;
|
||||
if (!o->cur.source) return;
|
||||
if ((o->source_invisible) || (!source_events)) return;
|
||||
if ((obj->proxy.source_invisible) || (!source_events)) return;
|
||||
//FIXME: Feed mouse events here.
|
||||
}
|
||||
|
||||
|
@ -597,10 +596,10 @@ evas_object_image_source_events_get(const Evas_Object *eo_obj)
|
|||
static void
|
||||
_image_source_events_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
||||
{
|
||||
Evas_Object_Image *o = _pd;
|
||||
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
||||
Eina_Bool *source_events = va_arg(*list, Eina_Bool *);
|
||||
if (!source_events) return;
|
||||
*source_events = o->source_events;
|
||||
*source_events = obj->proxy.source_events;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -620,17 +619,17 @@ _image_source_visible_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|||
Evas_Object_Image *o = _pd;
|
||||
Eina_Bool visible = va_arg(*list, int);
|
||||
|
||||
visible = !!visible;
|
||||
if (o->source_invisible == !visible) return;
|
||||
o->source_invisible = !visible;
|
||||
if (!o->cur.source) return;
|
||||
|
||||
visible = !!visible;
|
||||
src_obj = eo_data_get(o->cur.source, EVAS_OBJ_CLASS);
|
||||
if (src_obj->proxy.source_invisible == !visible) return;
|
||||
src_obj->proxy.source_invisible = !visible;
|
||||
src_obj->changed_source_visible = EINA_TRUE;
|
||||
evas_object_smart_member_cache_invalidate(o->cur.source, EINA_FALSE,
|
||||
EINA_FALSE, EINA_TRUE);
|
||||
evas_object_change(o->cur.source, src_obj);
|
||||
if ((!visible) || (!o->source_events)) return;
|
||||
if ((!visible) || (!src_obj->proxy.source_events)) return;
|
||||
//FIXME: Feed mouse events here.
|
||||
}
|
||||
|
||||
|
@ -653,11 +652,11 @@ _image_source_visible_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|||
Evas_Object_Protected_Data *src_obj;
|
||||
Evas_Object_Image *o = _pd;
|
||||
Eina_Bool *visible = va_arg(*list, Eina_Bool *);
|
||||
if (!visible) return;
|
||||
|
||||
if (!visible) return;
|
||||
if (!o->cur.source) *visible = EINA_FALSE;
|
||||
src_obj = eo_data_get(o->cur.source, EVAS_OBJ_CLASS);
|
||||
if (src_obj)
|
||||
*visible = !o->source_invisible;
|
||||
if (src_obj) *visible = !src_obj->proxy.source_invisible;
|
||||
else *visible = EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2703,12 +2702,6 @@ _proxy_set(Evas_Object *eo_proxy, Evas_Object *eo_src)
|
|||
|
||||
src->proxy.proxies = eina_list_append(src->proxy.proxies, eo_proxy);
|
||||
src->proxy.redraw = EINA_TRUE;
|
||||
if (o->source_invisible)
|
||||
{
|
||||
src->proxy.source_invisible = EINA_TRUE;
|
||||
evas_object_smart_member_cache_invalidate(o->cur.source, EINA_FALSE,
|
||||
EINA_FALSE, EINA_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Some moron just set a proxy on a proxy.
|
||||
|
|
|
@ -595,9 +595,10 @@ struct _Evas_Object_Protected_Data
|
|||
Eina_List *proxies;
|
||||
void *surface;
|
||||
int w,h;
|
||||
Eina_Bool is_proxy : 1;
|
||||
Eina_Bool redraw : 1;
|
||||
Eina_Bool is_proxy : 1;
|
||||
Eina_Bool source_invisible : 1;
|
||||
Eina_Bool source_events: 1;
|
||||
} proxy;
|
||||
|
||||
// Pointer to the Evas_Object itself
|
||||
|
|
Loading…
Reference in New Issue