You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
3.0KB

  1. //
  2. // "$Id: Fl_Free.H 7903 2010-11-28 21:06:39Z matt $"
  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; you can redistribute it and/or
  9. // modify it under the terms of the GNU Library General Public
  10. // License as published by the Free Software Foundation; either
  11. // version 2 of the License, or (at your option) any later version.
  12. //
  13. // This library is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. // Library General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Library General Public
  19. // License along with this library; if not, write to the Free Software
  20. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  21. // USA.
  22. //
  23. // Please report all bugs and problems on the following page:
  24. //
  25. // http://www.fltk.org/str.php
  26. //
  27. /* \file
  28. Fl_Free widget . */
  29. #ifndef Fl_Free_H
  30. #define Fl_Free_H
  31. #ifndef Fl_Widget_H
  32. #include "Fl_Widget.H"
  33. #endif
  34. #define FL_NORMAL_FREE 1 /**< normal event handling */
  35. #define FL_SLEEPING_FREE 2 /**< deactivate event handling */
  36. #define FL_INPUT_FREE 3 /**< accepts FL_FOCUS events */
  37. #define FL_CONTINUOUS_FREE 4 /**< repeated timeout handling */
  38. #define FL_ALL_FREE 5 /**< FL_INPUT_FREE and FL_CONTINOUS_FREE */
  39. /** appropriate signature for handle function */
  40. typedef int (*FL_HANDLEPTR)(Fl_Widget *, int , float, float, char);
  41. /**
  42. Emulation of the Forms "free" widget.
  43. This emulation allows the free demo to run, and appears to be useful for
  44. porting programs written in Forms which use the free widget or make
  45. subclasses of the Forms widgets.
  46. There are five types of free, which determine when the handle function
  47. is called:
  48. \li \c FL_NORMAL_FREE normal event handling.
  49. \li \c FL_SLEEPING_FREE deactivates event handling (widget is inactive).
  50. \li \c FL_INPUT_FREE accepts FL_FOCUS events.
  51. \li \c FL_CONTINUOUS_FREE sets a timeout callback 100 times a second and
  52. provides an FL_STEP event. This has obvious
  53. detrimental effects on machine performance.
  54. \li \c FL_ALL_FREE same as FL_INPUT_FREE and FL_CONTINUOUS_FREE.
  55. */
  56. class FL_EXPORT Fl_Free : public Fl_Widget {
  57. FL_HANDLEPTR hfunc;
  58. static void step(void *);
  59. protected:
  60. void draw();
  61. public:
  62. int handle(int e);
  63. Fl_Free(uchar t,int X,int Y,int W,int H,const char *L,FL_HANDLEPTR hdl);
  64. ~Fl_Free();
  65. };
  66. // old event names for compatibility:
  67. #define FL_MOUSE FL_DRAG /**< for backward compatibility */
  68. #define FL_DRAW 100 /**< for backward compatibility [UNUSED]*/
  69. #define FL_STEP 101 /**< for backward compatibility */
  70. #define FL_FREEMEM 102 /**< for backward compatibility [UNUSED]*/
  71. #define FL_FREEZE 103 /**< for backward compatibility [UNUSED]*/
  72. #define FL_THAW 104 /**< for backward compatibility [UNUSED]*/
  73. #endif
  74. //
  75. // End of "$Id: Fl_Free.H 7903 2010-11-28 21:06:39Z matt $".
  76. //