From 9b1379e6888abc7cc051a6c82d8b27ce454ceb5a Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 13 May 2025 21:04:56 +0200 Subject: Remove deprecated function Fl::set_idle() This turned out to be more complicated than just to delete a function because it was used internally, and the callback signatures were a bit flaky. I also added a lot of documentation to clarify matters. FL/Fl.H: document idle callback signatures, make some internal functions of class Fl private, add public Fl::idle() accessor (read- only), add Fl::add_idle(Fl_Old_Idle_Handler cb) to enable using old-style idle callbacks w/o 'data' argument. FL/forms.H: replace Fl::set_idle() with Fl::add_idle(). src/Fl.cxx: rename private Fl::idle_ with trailing underscore. src/Fl_System_Driver.cxx: use new public accessor Fl::idle() to access Fl::idle_ which is now private. src/Fl_add_idle.cxx: improve documentation, clarify idle callback matching, add example code in docs, rename methods, add overloaded Fl::add_idle(Fl_Old_Idle_Handler cb). src/Fl_win32.cxx: use public Fl::idle() rather than private member. src/drivers/Unix/Fl_Unix_System_Driver.cxx: same as above. src/Fl_cocoa.mm: same as above. --- src/Fl.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Fl.cxx') diff --git a/src/Fl.cxx b/src/Fl.cxx index bae7f1328..b1c38caf6 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -580,7 +580,7 @@ void fl_trigger_clipboard_notify(int source) { //////////////////////////////////////////////////////////////// // idle/wait/run/check/ready: -void (*Fl::idle)(); // see Fl::add_idle.cxx for the add/remove functions +void (*Fl::idle_)(); // see Fl::add_idle.cxx for the add/remove functions /* Private, undocumented method to run idle callbacks. @@ -611,9 +611,9 @@ void (*Fl::idle)(); // see Fl::add_idle.cxx for the add/remove functions */ void Fl::run_idle() { static char in_idle; - if (Fl::idle && !in_idle) { + if (Fl::idle_ && !in_idle) { in_idle = 1; - Fl::idle(); + Fl::idle_(); // call the idle callback stored in Fl::idle_ == Fl::idle() in_idle = 0; } } -- cgit v1.2.3