summaryrefslogtreecommitdiff
path: root/src/util/timeout_handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/timeout_handler.c')
-rw-r--r--src/util/timeout_handler.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/util/timeout_handler.c b/src/util/timeout_handler.c
index 411666b..244b24a 100644
--- a/src/util/timeout_handler.c
+++ b/src/util/timeout_handler.c
@@ -101,16 +101,25 @@ static Eina_Bool _event_occured(void *data, int type, void *event)
return r;
}
+void timeout_handler_pause(struct timeout_handler *handle)
+{
+ ecore_timer_del(handle->timer);
+ handle->timer = NULL;
+}
+
+void timeout_handler_resume(struct timeout_handler *handle)
+{
+ _timer_reset(handle);
+}
+
void timeout_handler_enable(struct timeout_handler *handle, bool enable)
{
handle->enable = enable;
- if (enable) {
- _timer_reset(handle);
- } else {
- ecore_timer_del(handle->timer);
- handle->timer = NULL;
- }
+ if (enable)
+ timeout_handler_resume(handle);
+ else
+ timeout_handler_pause(handle);
}
struct timeout_handler *timeout_handler_init(double timeout,