Skip to content

Commit

Permalink
Fixed doxygen warnings and added a new documentation module "Callback
Browse files Browse the repository at this point in the history
function typedefs" so that they appear in an own documentation group.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7334 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Albrecht Schlosser committed Mar 25, 2010
1 parent 5591315 commit ee2935d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
18 changes: 18 additions & 0 deletions FL/Fl.H
Expand Up @@ -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);

Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions src/Fl_add_idle.cxx
Expand Up @@ -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;
Expand All @@ -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) {
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Fl_arg.cxx
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/forms_compatability.cxx
Expand Up @@ -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:

Expand Down

0 comments on commit ee2935d

Please sign in to comment.