From 93b2f9fd447b73fff736d71826880ef9ac64bd94 Mon Sep 17 00:00:00 2001 From: Kevin Ferrare Date: Sat, 4 Aug 2007 03:01:46 +0000 Subject: Rewrote the clock plugin in a cleaner and more modular way so that it can scale on remote screens. Use left-right keys to change the type of clock displayed (analogic, digital, binary) and up/downto change the look of the clock git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14174 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/clock/clock_counter.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 apps/plugins/clock/clock_counter.h (limited to 'apps/plugins/clock/clock_counter.h') diff --git a/apps/plugins/clock/clock_counter.h b/apps/plugins/clock/clock_counter.h new file mode 100644 index 0000000000..25523d45f6 --- /dev/null +++ b/apps/plugins/clock/clock_counter.h @@ -0,0 +1,19 @@ +#ifndef _CLOCK_MESSAGE_ +#define _CLOCK_MESSAGE_ +#include "clock.h" +#include "plugin.h" +#include "picture.h" + +struct counter{ + int ticks_at_last_unpause;/* to count the time from last pause to now */ + int ticks_since_started;/* accumulated time */ + bool paused; +}; + +void counter_init(struct counter* counter); +void counter_toggle(struct counter* counter); +#define counter_reset(counter) counter_init(counter) +void counter_pause(struct counter* counter, bool paused); +void counter_get_elapsed_time(struct counter* counter, struct time* elapsed_time); + +#endif /* _CLOCK_MESSAGE_ */ -- cgit v1.2.3