diff options
author | lemort | 2008-01-22 08:33:42 +0000 |
---|---|---|
committer | lemort | 2008-01-22 08:33:42 +0000 |
commit | 0e652cdcfd509fdde56afa2ad7b24dafd50af154 (patch) | |
tree | 74ffdef663758c9b883d11ea6041ef21948b7037 /generic/Group.c | |
parent | ec349c8062d22e28142346efd1e08dd5fe71a85c (diff) | |
download | tkzinc-0e652cdcfd509fdde56afa2ad7b24dafd50af154.zip tkzinc-0e652cdcfd509fdde56afa2ad7b24dafd50af154.tar.gz tkzinc-0e652cdcfd509fdde56afa2ad7b24dafd50af154.tar.bz2 tkzinc-0e652cdcfd509fdde56afa2ad7b24dafd50af154.tar.xz |
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
Diffstat (limited to 'generic/Group.c')
-rw-r--r-- | generic/Group.c | 67 |
1 files changed, 67 insertions, 0 deletions
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, |