From da11526bb878e009b93fadd163d18d24e5ca203a Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 20 Oct 2022 19:36:03 +0200 Subject: Improve and clarify documentation of timeout functions Some functions didn't document the handling of arguments properly, particularly Fl::has_timeout() and Fl::remove_timeout(). This is now fixed by documenting the correct behavior that was preserved (re-implemented) from FLTK 1.3.x in the new class Fl_Timeout. Unfortunately there have been some inconsistencies (likely unexpected behavior) which have been preserved and which are now documented. --- src/Fl_Timeout.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/Fl_Timeout.h') diff --git a/src/Fl_Timeout.h b/src/Fl_Timeout.h index 8cff84689..f6a54a7a6 100644 --- a/src/Fl_Timeout.h +++ b/src/Fl_Timeout.h @@ -29,19 +29,27 @@ - Fl::add_timeout() - Fl::repeat_timeout() - - Fl::remove_timeout() - Fl::has_timeout() + - Fl::remove_timeout() and related methods of class Fl_Timeout. */ /** - Class Fl_Timeout handles all timeout related functions. + The internal class Fl_Timeout handles all timeout related functions. + + All code is platform independent except retrieving a timestamp which + requires calling a system driver function and potentially results in + different timer resolutions (from milliseconds to microseconds). + + Related user documentation: + + - \ref Fl_Timeout_Handler + - Fl::add_timeout(double time, Fl_Timeout_Handler cb, void *data) + - Fl::repeat_timeout(double time, Fl_Timeout_Handler cb, void *data) + - Fl::has_timeout(Fl_Timeout_Handler cb, void *data) + - Fl::remove_timeout(Fl_Timeout_Handler cb, void *data) - All code is platform independent except retrieving a timestamp - which requires calling a system driver function and potentially - results in different timer resolutions (from milliseconds to - microseconds). */ class Fl_Timeout { @@ -62,8 +70,10 @@ protected: skip = 0; } + // destructor ~Fl_Timeout() {} + // get a new timer entry from the pool or allocate a new one static Fl_Timeout *get(double time, Fl_Timeout_Handler cb, void *data); // insert this timer into the active timer queue, sorted by expiration time -- cgit v1.2.3