#define TIMEOUT_6 18.0 // top timer1 and start timer7 and timer8 with changed precision
#define TIMEOUT_7 1.1 // interval for timer7
#define TIMEOUT_8 1.2 // interval for timer8
-#define DELAY_1 3.0 // delay time for timer1 - used by timer2
+#define DELAY_1 3.0 // delay time for timer1 - used by timer2
#define INTERVAL1 2.0 // new interval for timer1 - used by timer5
static double _initial_time = 0;
-struct context { // helper struct to give some context to the callbacks
- Ecore_Timer *timer1;
- Ecore_Timer *timer2;
- Ecore_Timer *timer3;
- Ecore_Timer *timer4;
- Ecore_Timer *timer5;
- Ecore_Timer *timer6;
- Ecore_Timer *timer7;
- Ecore_Timer *timer8;
+struct context // helper struct to give some context to the callbacks
+{
+ Ecore_Timer *timer1;
+ Ecore_Timer *timer2;
+ Ecore_Timer *timer3;
+ Ecore_Timer *timer4;
+ Ecore_Timer *timer5;
+ Ecore_Timer *timer6;
+ Ecore_Timer *timer7;
+ Ecore_Timer *timer8;
};
static double
{
struct context *ctxt = data;
printf("Timer2 expired after %0.3f seconds. "
- "Adding delay of %0.3f seconds to timer1.\n",
- _get_current_time(), DELAY_1);
+ "Adding delay of %0.3f seconds to timer1.\n",
+ _get_current_time(), DELAY_1);
ecore_timer_delay(ctxt->timer1, DELAY_1);
{
struct context *ctxt = data;
printf("Timer3 expired after %0.3f seconds. "
- "Freezing timer1.\n", _get_current_time());
+ "Freezing timer1.\n", _get_current_time());
ecore_timer_freeze(ctxt->timer1);
{
struct context *ctxt = data;
printf("Timer4 expired after %0.3f seconds. "
- "Resuming timer1, which has %0.3f seconds left to expire.\n",
- _get_current_time(), ecore_timer_pending_get(ctxt->timer1));
+ "Resuming timer1, which has %0.3f seconds left to expire.\n",
+ _get_current_time(), ecore_timer_pending_get(ctxt->timer1));
ecore_timer_thaw(ctxt->timer1);
double interval = ecore_timer_interval_get(ctxt->timer1);
printf("Timer5 expired after %0.3f seconds. "
- "Changing interval of timer1 from %0.3f to %0.3f seconds.\n",
- _get_current_time(), interval, INTERVAL1);
+ "Changing interval of timer1 from %0.3f to %0.3f seconds.\n",
+ _get_current_time(), interval, INTERVAL1);
ecore_timer_interval_set(ctxt->timer1, INTERVAL1);
ctxt->timer1 = NULL;
printf("Starting timer7 (%0.3fs) and timer8 (%0.3fs).\n",
- TIMEOUT_7, TIMEOUT_8);
+ TIMEOUT_7, TIMEOUT_8);
ctxt->timer7 = ecore_timer_add(TIMEOUT_7, _timer7_cb, ctxt);
ctxt->timer8 = ecore_timer_add(TIMEOUT_8, _timer8_cb, ctxt);
return ECORE_CALLBACK_CANCEL;
}
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
struct context ctxt = {0};
if (!ecore_init())
{
- printf("ERROR: Cannot init Ecore!\n");
- return -1;
+ printf("ERROR: Cannot init Ecore!\n");
+ return -1;
}
_initial_time = ecore_time_get();
return 0;
}
+