practice-timer/TimerClock.h

26 lines
603 B
C
Raw Normal View History

2022-08-28 14:20:12 -07:00
#ifndef INCLUDED_TIMER_CLOCK_H
#define INCLUDED_TIMER_CLOCK_H
#include <glib-object.h>
G_BEGIN_DECLS
#define TIMER_TYPE_CLOCK timer_clock_get_type()
G_DECLARE_FINAL_TYPE(TimerClock, timer_clock, TIMER, CLOCK, GObject);
typedef void(*TimerClockAction)(gpointer);
/* All intervals are in miliseconds (unless otherwise stated) */
TimerClock *timer_clock_new(int interval, TimerClockAction action, gpointer data);
void timer_clock_start(TimerClock *self);
void timer_clock_stop(TimerClock *self);
gboolean timer_clock_is_running(TimerClock *self);
G_END_DECLS
#endif /* INCLUDED_TIMER_CLOCK_H */