From e01f4240a3dc15fa147b22158212536698a12b95 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Wed, 24 Oct 2001 13:12:12 +0000 Subject: Ajout d'un alpha aux groupes et expression de l'alpha en pourcent --- generic/Group.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'generic/Group.c') diff --git a/generic/Group.c b/generic/Group.c index 84e0692..d2f290b 100644 --- a/generic/Group.c +++ b/generic/Group.c @@ -48,6 +48,8 @@ static const char compile_id[]="$Compile: " __FILE__ " " __DATE__ " " __TIME__ " ********************************************************************************** */ static ZnAttrConfig group_attrs[] = { + { ZN_CONFIG_ALPHA, "-alpha", NULL, + Tk_Offset(GroupItemStruct, alpha), 0, ZN_DRAW_FLAG, False }, { ZN_CONFIG_BOOL, "-atomic", NULL, Tk_Offset(GroupItemStruct, header.flags), ATOMIC_BIT, ZN_REPICK_FLAG, False }, @@ -93,6 +95,7 @@ Init(Item item, group->head = ZN_NO_ITEM; group->tail = ZN_NO_ITEM; group->clip = ZN_NO_ITEM; + group->alpha = 100; group->dependents = NULL; SET(item->flags, VISIBLE_BIT); SET(item->flags, SENSITIVE_BIT); @@ -854,17 +857,19 @@ Draw(Item item) static void Render(Item item) { +#ifdef GLX GroupItem group = (GroupItem) item; Item current_item; -#ifndef GLX WidgetInfo *wi = item->wi; ZnBBox *clip_box; ZnBBox bbox, old_damaged_area; -#endif + unsigned char save_alpha = wi->alpha; + + wi->alpha = wi->alpha * group->alpha / 100; PushTransform(item); PushClip(group, True); -#ifndef GLX +#if 0 if (group->clip != ZN_NO_ITEM) { ITEM_P.CurrentClip(wi, NULL, &clip_box, NULL); old_damaged_area = wi->damaged_area; @@ -876,7 +881,7 @@ Render(Item item) current_item = group->tail; while (current_item != ZN_NO_ITEM) { if (ISSET(current_item->flags, VISIBLE_BIT)) { -#ifndef GLX +#if 0 IntersectBBox(&wi->damaged_area, ¤t_item->item_bounding_box, &bbox); if (!IsEmptyBBox(&bbox)) { #endif @@ -887,14 +892,14 @@ Render(Item item) if (current_item->class != ZnGroup) { PopTransform(current_item); } -#ifndef GLX +#if 0 } #endif } current_item = current_item->previous; } -#ifndef GLX +#if 0 if (group->clip != ZN_NO_ITEM) { wi->damaged_area = old_damaged_area; } @@ -902,6 +907,9 @@ Render(Item item) PopClip(group, True); PopTransform(item); + + wi->alpha = save_alpha; +#endif } -- cgit v1.1