aboutsummaryrefslogtreecommitdiff
path: root/generic/Group.c
diff options
context:
space:
mode:
authorlecoanet2001-10-24 13:12:12 +0000
committerlecoanet2001-10-24 13:12:12 +0000
commite01f4240a3dc15fa147b22158212536698a12b95 (patch)
treee47faa6b7139082f9c3c526e8b17b400c24c824d /generic/Group.c
parent615729a337312d54e20b88624c88c0c02707b4c7 (diff)
downloadtkzinc-e01f4240a3dc15fa147b22158212536698a12b95.zip
tkzinc-e01f4240a3dc15fa147b22158212536698a12b95.tar.gz
tkzinc-e01f4240a3dc15fa147b22158212536698a12b95.tar.bz2
tkzinc-e01f4240a3dc15fa147b22158212536698a12b95.tar.xz
Ajout d'un alpha aux groupes et expression de l'alpha en pourcent
Diffstat (limited to 'generic/Group.c')
-rw-r--r--generic/Group.c20
1 files changed, 14 insertions, 6 deletions
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, &current_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
}