summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl.H18
-rw-r--r--src/Fl_add_idle.cxx6
-rw-r--r--src/Fl_arg.cxx2
-rw-r--r--src/forms_compatability.cxx2
4 files changed, 24 insertions, 4 deletions
diff --git a/FL/Fl.H b/FL/Fl.H
index 8b9a5883e..dfd2a48c9 100644
--- a/FL/Fl.H
+++ b/FL/Fl.H
@@ -52,6 +52,22 @@ class Fl_Window;
class Fl_Image;
struct Fl_Label;
+
+/** \defgroup callback_functions Callback function typedefs
+ \brief Typedefs for callback or handler functions passed as function parameters.
+
+ FLTK uses callback functions as parameters for some function calls, e.g. to
+ set up global event handlers (Fl::add_handler()), to add a timeout handler
+ (Fl::add_timeout()), and many more.
+
+ The typedefs defined in this group describe the function parameters used to set
+ up or clear the callback functions and should also be referenced to define the
+ callback function to handle such events in the user's code.
+
+ \see Fl::add_handler(), Fl::add_timeout(), Fl::repeat_timeout(),
+ Fl::remove_timeout() and others
+ @{ */
+
/** signature of some label drawing functions passed as parameters */
typedef void (Fl_Label_Draw_F)(const Fl_Label *label, int x, int y, int w, int h, Fl_Align align);
@@ -88,6 +104,8 @@ typedef void (*Fl_Atclose_Handler)(Fl_Window *window, void *data);
/** signature of args functions passed as parameters */
typedef int (*Fl_Args_Handler)(int argc, char **argv, int &i);
+/** @} */ /* group callback_functions */
+
/**
The Fl is the FLTK global (static) containing
state information and global methods for the current application.
diff --git a/src/Fl_add_idle.cxx b/src/Fl_add_idle.cxx
index 428e99fb3..ad2e54b82 100644
--- a/src/Fl_add_idle.cxx
+++ b/src/Fl_add_idle.cxx
@@ -66,7 +66,7 @@ static void call_idle() {
FLTK will not recursively call the idle callback.
*/
-void Fl::add_idle(void (*cb)(void*), void* data) {
+void Fl::add_idle(Fl_Idle_Handler cb, void* data) {
idle_cb* p = freelist;
if (p) freelist = p->next;
else p = new idle_cb;
@@ -86,7 +86,7 @@ void Fl::add_idle(void (*cb)(void*), void* data) {
/**
Returns true if the specified idle callback is currently installed.
*/
-int Fl::has_idle(void (*cb)(void*), void* data) {
+int Fl::has_idle(Fl_Idle_Handler cb, void* data) {
idle_cb* p = first;
if (!p) return 0;
for (;; p = p->next) {
@@ -98,7 +98,7 @@ int Fl::has_idle(void (*cb)(void*), void* data) {
/**
Removes the specified idle callback, if it is installed.
*/
-void Fl::remove_idle(void (*cb)(void*), void* data) {
+void Fl::remove_idle(Fl_Idle_Handler cb, void* data) {
idle_cb* p = first;
if (!p) return;
idle_cb* l = last;
diff --git a/src/Fl_arg.cxx b/src/Fl_arg.cxx
index b1476faa9..d6d46a4dc 100644
--- a/src/Fl_arg.cxx
+++ b/src/Fl_arg.cxx
@@ -277,7 +277,7 @@ int Fl::arg(int argc, char **argv, int &i) {
Fl::help pointer.
*/
-int Fl::args(int argc, char** argv, int& i, int (*cb)(int,char**,int&)) {
+int Fl::args(int argc, char** argv, int& i, Fl_Args_Handler cb) {
arg_called = 1;
i = 1; // skip argv[0]
while (i < argc) {
diff --git a/src/forms_compatability.cxx b/src/forms_compatability.cxx
index 4e48b2db6..32219b48a 100644
--- a/src/forms_compatability.cxx
+++ b/src/forms_compatability.cxx
@@ -138,11 +138,13 @@ Fl_Widget *fl_check_forms() {
void fl_set_graphics_mode(int /*r*/,int /*d*/) {}
+#ifndef FL_DOXYGEN // FIXME: suppress doxygen warning
void Fl_FormsText::draw() {
draw_box();
align(align()|FL_ALIGN_INSIDE); // questionable method of compatibility
draw_label();
}
+#endif
// Create a forms button by selecting correct fltk subclass: