From c043b337b1747498fb2bf3180decdee4561d0d91 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 8 Aug 2013 21:50:07 +0200 Subject: EventLoop: un-inline Run() and others Prepare for adding more code. --- src/event/Loop.hxx | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'src/event/Loop.hxx') diff --git a/src/event/Loop.hxx b/src/event/Loop.hxx index 72731ea2b..a222f098d 100644 --- a/src/event/Loop.hxx +++ b/src/event/Loop.hxx @@ -56,33 +56,15 @@ public: g_main_loop_quit(loop); } - void Run() { - g_main_loop_run(loop); - } + void Run(); - guint AddIdle(GSourceFunc function, gpointer data) { - GSource *source = g_idle_source_new(); - g_source_set_callback(source, function, data, NULL); - guint id = g_source_attach(source, GetContext()); - g_source_unref(source); - return id; - } + guint AddIdle(GSourceFunc function, gpointer data); GSource *AddTimeout(guint interval_ms, - GSourceFunc function, gpointer data) { - GSource *source = g_timeout_source_new(interval_ms); - g_source_set_callback(source, function, data, nullptr); - g_source_attach(source, GetContext()); - return source; - } + GSourceFunc function, gpointer data); GSource *AddTimeoutSeconds(guint interval_s, - GSourceFunc function, gpointer data) { - GSource *source = g_timeout_source_new_seconds(interval_s); - g_source_set_callback(source, function, data, nullptr); - g_source_attach(source, GetContext()); - return source; - } + GSourceFunc function, gpointer data); }; #endif /* MAIN_NOTIFY_H */ -- cgit v1.2.3