1 // 2 // "$Id$" 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 19 /* \file 20 Fl_Free widget . */ 21 22 #ifndef Fl_Free_H 23 #define Fl_Free_H 24 25 #ifndef Fl_Widget_H 26 #include "Fl_Widget.H" 27 #endif 28 29 #define FL_NORMAL_FREE 1 /**< normal event handling */ 30 #define FL_SLEEPING_FREE 2 /**< deactivate event handling */ 31 #define FL_INPUT_FREE 3 /**< accepts FL_FOCUS events */ 32 #define FL_CONTINUOUS_FREE 4 /**< repeated timeout handling */ 33 #define FL_ALL_FREE 5 /**< FL_INPUT_FREE and FL_CONTINOUS_FREE */ 34 35 /** appropriate signature for handle function */ 36 typedef int (*FL_HANDLEPTR)(Fl_Widget *, int , float, float, char); 37 38 /** 39 Emulation of the Forms "free" widget. 40 41 This emulation allows the free demo to run, and appears to be useful for 42 porting programs written in Forms which use the free widget or make 43 subclasses of the Forms widgets. 44 45 There are five types of free, which determine when the handle function 46 is called: 47 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 */ 57 class FL_EXPORT Fl_Free : public Fl_Widget { 58 FL_HANDLEPTR hfunc; 59 static void step(void *); 60 protected: 61 void draw(); 62 public: 63 int handle(int e); 64 Fl_Free(uchar t,int X,int Y,int W,int H,const char *L,FL_HANDLEPTR hdl); 65 ~Fl_Free(); 66 }; 67 68 // old event names for compatibility: 69 #define FL_MOUSE FL_DRAG /**< for backward compatibility */ 70 #define FL_DRAW 100 /**< for backward compatibility [UNUSED]*/ 71 #define FL_STEP 101 /**< for backward compatibility */ 72 #define FL_FREEMEM 102 /**< for backward compatibility [UNUSED]*/ 73 #define FL_FREEZE 103 /**< for backward compatibility [UNUSED]*/ 74 #define FL_THAW 104 /**< for backward compatibility [UNUSED]*/ 75 76 #endif 77 78 // 79 // End of "$Id$". 80 // 81