lib: Move idle function setup into lib/
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
bc5e53a423
commit
0b5478c591
|
@ -120,7 +120,7 @@ bool on_idle()
|
|||
|
||||
void enable_idle()
|
||||
{
|
||||
Glib::signal_idle().connect(sigc::ptr_fun(on_idle));
|
||||
lib :: idle(on_idle);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace lib
|
|||
const std::string share_file(const std::string &);
|
||||
Glib::RefPtr<Gtk::Builder> &get_builder();
|
||||
const std::string key_name(GdkEventKey *);
|
||||
void idle(bool (*)());
|
||||
void schedule(bool (*)(), unsigned int);
|
||||
|
||||
template <class T>
|
||||
|
|
|
@ -43,6 +43,11 @@ const std::string lib :: key_name(GdkEventKey *event)
|
|||
return key;
|
||||
}
|
||||
|
||||
void lib :: idle(bool (*func)())
|
||||
{
|
||||
Glib :: signal_idle().connect(sigc::ptr_fun(func));
|
||||
}
|
||||
|
||||
void lib :: schedule(bool (*func)(), unsigned int milliseconds)
|
||||
{
|
||||
Glib :: signal_timeout().connect(sigc::ptr_fun(func), milliseconds);
|
||||
|
|
Loading…
Reference in New Issue