From 9c8413684e589ae90c416e08e0419b91db6f7cc3 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 28 Aug 2006 08:47:59 +0000 Subject: Added a -catchevent attribute that specifies whether an item should handle events or act as a decorating object. Groups can be controlled too, there catching state propagates to their children. --- generic/Group.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'generic/Group.c') diff --git a/generic/Group.c b/generic/Group.c index ce581a8..c4fef66 100644 --- a/generic/Group.c +++ b/generic/Group.c @@ -72,6 +72,9 @@ static ZnAttrConfig group_attrs[] = { { ZN_CONFIG_BOOL, "-atomic", NULL, Tk_Offset(GroupItemStruct, header.flags), ATOMIC_BIT, ZN_REPICK_FLAG, False }, + { ZN_CONFIG_BOOL, "-catchevent", NULL, + Tk_Offset(GroupItemStruct, header.flags), ZN_CATCH_EVENT_BIT, + ZN_REPICK_FLAG, False }, { ZN_CONFIG_ITEM, "-clip", NULL, Tk_Offset(GroupItemStruct, clip), 0, ZN_COORDS_FLAG|ZN_ITEM_FLAG, False }, @@ -121,6 +124,7 @@ Init(ZnItem item, group->dependents = NULL; SET(item->flags, ZN_VISIBLE_BIT); SET(item->flags, ZN_SENSITIVE_BIT); + SET(item->flags, ZN_CATCH_EVENT_BIT); SET(item->flags, ZN_COMPOSE_ALPHA_BIT); SET(item->flags, ZN_COMPOSE_ROTATION_BIT); SET(item->flags, ZN_COMPOSE_SCALE_BIT); @@ -1240,12 +1244,15 @@ Pick(ZnItem item, for ( ; current_item != ZN_NO_ITEM; current_item = current_item->next) { /* + * If an item doesn't catch events it can be safely skipped + * right now. * Sensitive item must be reported even if they are invisible. * It is legal to fire bindings on invisible sensitive items. * This is _not_ a bug do _not_ modify the test below. */ - if (ISCLEAR(current_item->flags, ZN_SENSITIVE_BIT) && - ISCLEAR(current_item->flags, ZN_VISIBLE_BIT)) { + if (ISCLEAR(current_item->flags, ZN_CATCH_EVENT_BIT) || + (ISCLEAR(current_item->flags, ZN_SENSITIVE_BIT) && + ISCLEAR(current_item->flags, ZN_VISIBLE_BIT))) { continue; } ZnIntersectBBox(&bbox, ¤t_item->item_bounding_box, &inter); -- cgit v1.1