Enlightenment CVS committal Author : rephorm Project : e17 Module : apps/elicit
Dir : e17/apps/elicit/src Modified Files: callbacks.c Log Message: hmm. not everything committed for some reason =================================================================== RCS file: /cvs/e/e17/apps/elicit/src/callbacks.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- callbacks.c 5 Sep 2005 12:15:21 -0000 1.19 +++ callbacks.c 10 Jul 2006 22:15:54 -0000 1.20 @@ -3,6 +3,7 @@ #include <string.h> +void _elicit_color_signal_process(Elicit *el); static int elicit_timer_color(void *data); void @@ -101,6 +102,7 @@ w = sw * (1 / el->zoom); h = sh * (1 / el->zoom); + elicit_util_shoot(el->shot, (int)w, (int)h); } } @@ -126,6 +128,13 @@ el->change_sig = NULL; } } + else if (elicit_glob_match(sig, "*,up") || elicit_glob_match(sig, "*,down")) + { + el->flags.changing = 1; + el->change_sig = (char *)sig; + _elicit_color_signal_process(data); + el->change_sig = NULL; + } } void @@ -358,7 +367,7 @@ Elicit *el = data; static double start = 0.0; double duration = 2.0; - double r, d, dir; + double r, d; /* we're done */ if (!el->flags.changing) @@ -382,13 +391,27 @@ if (d > 1) d = 1.0; r = sin(d * .5 * M_PI); - if (elicit_glob_match(el->change_sig, "*,up,*")) dir = 1; - else if (elicit_glob_match(el->change_sig, "*,down,*")) dir = -1; + _elicit_color_signal_process(el); + + /* we want the time to wait to depend on how far along it is... */ + el->change_timer = ecore_timer_add(.16 - .15*r, elicit_timer_color, el); + + return 0; +} + +void _elicit_color_signal_process(Elicit *el) +{ + int dir; + + if (!el->change_sig) return; + + if (elicit_glob_match(el->change_sig, "*,up*")) dir = 1; + else if (elicit_glob_match(el->change_sig, "*,down*")) dir = -1; else dir = 0; /* this shouldn't happen */ if (elicit_glob_match(el->change_sig, "*,r,*")) { - el->color.r += dir * 1; + el->color.r += dir; if (el->color.r > 255) el->color.r = 255; if (el->color.r < 0) el->color.r = 0; @@ -397,7 +420,7 @@ else if (elicit_glob_match(el->change_sig, "*,g,*")) { - el->color.g += dir * 1; + el->color.g += dir; if (el->color.g > 255) el->color.g = 255; if (el->color.g < 0) el->color.g = 0; @@ -406,7 +429,7 @@ else if (elicit_glob_match(el->change_sig, "*,b,*")) { - el->color.b += dir * 1; + el->color.b += dir; if (el->color.b > 255) el->color.b = 255; if (el->color.b < 0) el->color.b = 0; @@ -415,7 +438,7 @@ else if (elicit_glob_match(el->change_sig, "*,h,*")) { - el->color.h += dir * 1; + el->color.h += dir; if (el->color.h > 360) el->color.h = 360; if (el->color.h < 0) el->color.h = 0; @@ -450,10 +473,4 @@ evas_object_color_set(el->swatch, el->color.r, el->color.g, el->color.b, 255); el->flags.changed = 1; - - /* we want the time to wait to depend on how far along it is... */ - el->change_timer = ecore_timer_add(.16 - .15*r, elicit_timer_color, el); - - return 0; } - ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs