diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-02-04 19:11:44 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-02-04 19:11:44 +0000 |
commit | d865c30bd21fc0e298f418fdf8887ce25bac057b (patch) | |
tree | 06a21b7c54a8f1e586cc1d69c9d144fe0284ac01 /widget_icon.c | |
parent | add433dc14a9686d39981b8a2e9722a2bcbae7d0 (diff) | |
download | lcd4linux-d865c30bd21fc0e298f418fdf8887ce25bac057b.tar.gz |
[lcd4linux @ 2004-02-04 19:11:44 by reinelt]
icon visibility patch from Xavier
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@355 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'widget_icon.c')
-rw-r--r-- | widget_icon.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/widget_icon.c b/widget_icon.c index 88bbc00..5420f14 100644 --- a/widget_icon.c +++ b/widget_icon.c @@ -1,4 +1,4 @@ -/* $Id: widget_icon.c,v 1.4 2004/01/30 20:57:56 reinelt Exp $ +/* $Id: widget_icon.c,v 1.5 2004/02/04 19:11:44 reinelt Exp $ * * icon widget handling * @@ -21,6 +21,9 @@ * * * $Log: widget_icon.c,v $ + * Revision 1.5 2004/02/04 19:11:44 reinelt + * icon visibility patch from Xavier + * * Revision 1.4 2004/01/30 20:57:56 reinelt * HD44780 patch from Martin Hejl * dmalloc integrated @@ -117,10 +120,22 @@ void widget_icon_update (void *Self) DelResult(&result); } + Icon->visible = 1; + if (Icon->visible_expr!=NULL && *Icon->visible_expr!='\0') { + Eval(Icon->visible_expr, &result); + Icon->visible = R2N(&result); + if (Icon->visible<1) Icon->visible=0; + DelResult(&result); + } + + if (Icon->visible) { // rotate icon bitmap Icon->curmap++; if (Icon->curmap >= Icon->maxmap) Icon->curmap=0; + } else { + Icon->curmap=0; // FIXME : put an emply map here ! + } // finally, draw it! if (W->class->draw) @@ -152,12 +167,17 @@ int widget_icon_init (WIDGET *Self) // get raw expressions (we evaluate them ourselves) Icon->speed_expr = cfg_get_raw (section, "speed", NULL); + Icon->visible_expr = cfg_get_raw (section, "visible", NULL); // sanity check if (Icon->speed_expr==NULL || *Icon->speed_expr=='\0') { error ("Icon %s has no speed, using '100'", Self->name); Icon->speed_expr="100"; } + if (Icon->visible_expr==NULL || *Icon->visible_expr=='\0') { + error ("Icon %s has no visible atribute, using '1'", Self->name); + Icon->visible_expr="1"; + } // read bitmap widget_icon_read_bitmap (section, Icon); |