Domingo Alvarez Duarte wrote:
> I'm trying to bind fltk with http://daovm.net/ DAO scripting language
> and I have some problems with the idle functions been declared with full
> pointers declaration instead of a typedef, I propose to modify Fl.H and
> Fl_add_idle.cxx to the following:
>
> -------
> /** signature of some idle callback functions passed as parameters */
> typedef void (*Fl_Idle_Handler)(void*);
>
> ....
>
> static void add_idle(Fl_Idle_Handler cb, void* data = 0);
> static int has_idle(Fl_Idle_Handler cb, void* data = 0);
> static void remove_idle(Fl_Idle_Handler cb, void* data = 0);
> -----
>
> This way it becomes more in line with other parts of fltk where instead
> of full pointer declaration typedefs are used, also it reduces
> duplication of code since only one place define the function type used
> by idle functions.

There is more like that:

  static int args(int, char**, int&, int (*)(int,char**,int&) = 0);
  static void add_fd(int fd, int when, void (*cb)(int,void*),void* =0);
  static void add_fd(int fd, void (*cb)(int, void*), void* = 0);
  static void add_handler(int (*h)(int));
  static void remove_handler(int (*h)(int));
  static int get_font_sizes(Fl_Font, int*& sizep);
  static void set_abort(void (*f)(const char*,...));
  static void set_atclose(void (*f)(Fl_Window*,void*));
  static void set_idle(void (*cb)());


----
/** signature of add_idle callback functions passed as parameters */
typedef void (*Fl_Idle_Handler)(void*);

/** signature of add_fd functions passed as parameters */
typedef void (*Fl_fd_Handler)(int,void*);

/** signature of add_handler functions passed as parameters */
typedef int (*Fl_add_Handler)(int);

...

   static void add_fd(int fd, int when, Fl_fd_Handler cb,void* =0); // 
platform dependent
   /** See void add_fd(int fd, int when, Fl_fd_Handler cb,void* =0) */
   static void add_fd(int fd, Fl_fd_Handler cb, void* = 0); // platform 
dependent

...

   static void add_handler(Fl_add_Handler h);
   static void remove_handler(Fl_add_Handler h);


----
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to