summaryrefslogtreecommitdiffstats
path: root/src/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/clock.c')
-rw-r--r--src/clock.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/clock.c b/src/clock.c
index f6ffdcf..a914aa3 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -51,8 +51,10 @@ static const uint16_t _clock_font[] = {
075757, /* 8 */
075717, /* 9 */
004040, /* : */
+ 000000, /* Blank */
};
#define COLON_DIGIT 10
+#define BLANK_DIGIT 11
struct clock {
WINDOW *win;
@@ -184,6 +186,22 @@ clock_draw(struct clock *clock)
_clock_draw_digit(clock, x += SPACING + DIGIT_WIDTH, tm->tm_sec % 10);
}
+void
+clock_clear(struct clock *clock)
+{
+ int x;
+
+ x = 0;
+ _clock_draw_digit(clock, x += SPACING , BLANK_DIGIT);
+ _clock_draw_digit(clock, x += SPACING + DIGIT_WIDTH, BLANK_DIGIT);
+ _clock_draw_digit(clock, x += SPACING + DIGIT_WIDTH, BLANK_DIGIT);
+ _clock_draw_digit(clock, x += SPACING + COLON_WIDTH, BLANK_DIGIT);
+ _clock_draw_digit(clock, x += SPACING + DIGIT_WIDTH, BLANK_DIGIT);
+ _clock_draw_digit(clock, x += SPACING + DIGIT_WIDTH, BLANK_DIGIT);
+ _clock_draw_digit(clock, x += SPACING + COLON_WIDTH, BLANK_DIGIT);
+ _clock_draw_digit(clock, x += SPACING + DIGIT_WIDTH, BLANK_DIGIT);
+}
+
struct clock *
clock_destroy(struct clock **clock_p)
{