summaryrefslogtreecommitdiff
path: root/src/Fl_Timeout.h
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2022-10-20 19:36:03 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2022-10-20 19:36:03 +0200
commitda11526bb878e009b93fadd163d18d24e5ca203a (patch)
treee9690244cb6e8abf8b974876e573948f6f7079b0 /src/Fl_Timeout.h
parenteca61ab98abb588b3b964795595b41e9dd5e00dd (diff)
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.
Diffstat (limited to 'src/Fl_Timeout.h')
-rw-r--r--src/Fl_Timeout.h22
1 files changed, 16 insertions, 6 deletions
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