Fl_Free.H 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //
  2. // "$Id: Fl_Free.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
  3. //
  4. // Forms free header file for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2010 by Bill Spitzak and others.
  7. //
  8. // This library is free software. Distribution and use rights are outlined in
  9. // the file "COPYING" which should have been included with this file. If this
  10. // file is missing or damaged, see the license at:
  11. //
  12. // http://www.fltk.org/COPYING.php
  13. //
  14. // Please report all bugs and problems on the following page:
  15. //
  16. // http://www.fltk.org/str.php
  17. //
  18. /* \file
  19. Fl_Free widget . */
  20. #ifndef Fl_Free_H
  21. #define Fl_Free_H
  22. #ifndef Fl_Widget_H
  23. #include "Fl_Widget.H"
  24. #endif
  25. #define FL_NORMAL_FREE 1 /**< normal event handling */
  26. #define FL_SLEEPING_FREE 2 /**< deactivate event handling */
  27. #define FL_INPUT_FREE 3 /**< accepts FL_FOCUS events */
  28. #define FL_CONTINUOUS_FREE 4 /**< repeated timeout handling */
  29. #define FL_ALL_FREE 5 /**< FL_INPUT_FREE and FL_CONTINOUS_FREE */
  30. /** appropriate signature for handle function */
  31. typedef int (*FL_HANDLEPTR)(Fl_Widget *, int , float, float, char);
  32. /**
  33. Emulation of the Forms "free" widget.
  34. This emulation allows the free demo to run, and appears to be useful for
  35. porting programs written in Forms which use the free widget or make
  36. subclasses of the Forms widgets.
  37. There are five types of free, which determine when the handle function
  38. is called:
  39. \li \c FL_NORMAL_FREE normal event handling.
  40. \li \c FL_SLEEPING_FREE deactivates event handling (widget is inactive).
  41. \li \c FL_INPUT_FREE accepts FL_FOCUS events.
  42. \li \c FL_CONTINUOUS_FREE sets a timeout callback 100 times a second and
  43. provides an FL_STEP event. This has obvious
  44. detrimental effects on machine performance.
  45. \li \c FL_ALL_FREE same as FL_INPUT_FREE and FL_CONTINUOUS_FREE.
  46. */
  47. class FL_EXPORT Fl_Free : public Fl_Widget {
  48. FL_HANDLEPTR hfunc;
  49. static void step(void *);
  50. protected:
  51. void draw();
  52. public:
  53. int handle(int e);
  54. Fl_Free(uchar t,int X,int Y,int W,int H,const char *L,FL_HANDLEPTR hdl);
  55. ~Fl_Free();
  56. };
  57. // old event names for compatibility:
  58. #define FL_MOUSE FL_DRAG /**< for backward compatibility */
  59. #define FL_DRAW 100 /**< for backward compatibility [UNUSED]*/
  60. #define FL_STEP 101 /**< for backward compatibility */
  61. #define FL_FREEMEM 102 /**< for backward compatibility [UNUSED]*/
  62. #define FL_FREEZE 103 /**< for backward compatibility [UNUSED]*/
  63. #define FL_THAW 104 /**< for backward compatibility [UNUSED]*/
  64. #endif
  65. //
  66. // End of "$Id: Fl_Free.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
  67. //