From 0e652cdcfd509fdde56afa2ad7b24dafd50af154 Mon Sep 17 00:00:00 2001 From: lemort Date: Tue, 22 Jan 2008 08:33:42 +0000 Subject: Ajout de l'item viewport qui permet de deleguer le rendu dans une zone rectangulaire a une librairie externe. Pour l'instant, seule l'implementation Windows fonctionne: le rendu est deleguea une DLL qui doit contenir certaines fonctions --- generic/Group.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'generic/Group.c') diff --git a/generic/Group.c b/generic/Group.c index 8a1f668..cee860d 100644 --- a/generic/Group.c +++ b/generic/Group.c @@ -1043,6 +1043,72 @@ Draw(ZnItem item) } + +/* + ********************************************************************************** + * + * PreRender -- + * + ********************************************************************************** + */ +#ifdef GL +static void +PreRender(ZnItem item) +{ + GroupItem group = (GroupItem) item; + ZnItem current_item; + ZnWInfo *wi = item->wi; + unsigned char save_alpha = wi->alpha; + unsigned char save_alpha2; + + if (ISSET(item->flags, ZN_COMPOSE_ALPHA_BIT)) { + wi->alpha = wi->alpha * group->alpha / 100; + } + else { + wi->alpha = group->alpha; + } + save_alpha2 = wi->alpha; + + PushTransform(item); + + current_item = group->tail; + while (current_item != ZN_NO_ITEM) { + if (ISSET(current_item->flags, ZN_VISIBLE_BIT)) { + + if ( current_item->class->PreRender != NULL ) + { + if (current_item->class != ZnGroup) { + PushTransform(current_item); + if (ISCLEAR(current_item->flags, ZN_COMPOSE_ALPHA_BIT)) { + wi->alpha = 100; + } + } + + current_item->class->PreRender(current_item); + + if (current_item->class != ZnGroup) { + PopTransform(current_item); + wi->alpha = save_alpha2; + } + } + } + current_item = current_item->previous; + } + + PopTransform(item); + + wi->alpha = save_alpha; +} +#else +static void +PreRender(ZnItem item) +{ +} +#endif + + + + /* ********************************************************************************** * @@ -1818,6 +1884,7 @@ static ZnItemClassStruct GROUP_ITEM_CLASS = { ComputeCoordinates, ToArea, Draw, + PreRender, /* Pre-render */ Render, IsSensitive, Pick, -- cgit v1.1