1 /* 2 * This file is part of the XForms library package. 3 * 4 * XForms is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU Lesser General Public License as 6 * published by the Free Software Foundation; either version 2.1, or 7 * (at your option) any later version. 8 * 9 * XForms is distributed in the hope that it will be useful, but 10 * WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public License 15 * along with XForms. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 /********************** crop here for forms.h **********************/ 19 20 /** 21 * \file timer.h 22 * 23 * Object Class: Timer 24 */ 25 26 #ifndef FL_TIMER_H 27 #define FL_TIMER_H 28 29 30 typedef enum { 31 FL_NORMAL_TIMER, 32 FL_VALUE_TIMER, 33 FL_HIDDEN_TIMER 34 } FL_TIMER_TYPE; 35 36 /***** Defaults *****/ 37 38 #define FL_TIMER_BOXTYPE FL_DOWN_BOX 39 #define FL_TIMER_COL1 FL_COL1 40 #define FL_TIMER_COL2 FL_RED 41 #define FL_TIMER_LCOL FL_LCOL 42 #define FL_TIMER_ALIGN FL_ALIGN_CENTER 43 44 /***** Others *****/ 45 46 #define FL_TIMER_BLINKRATE 0.2 47 48 /***** Routines *****/ 49 50 typedef char * ( * FL_TIMER_FILTER )( FL_OBJECT *, double ); 51 52 FL_EXPORT FL_OBJECT * fl_create_timer( int type, 53 FL_Coord x, 54 FL_Coord y, 55 FL_Coord w, 56 FL_Coord h, 57 const char * label ); 58 59 FL_EXPORT FL_OBJECT * fl_add_timer( int type, 60 FL_Coord x, 61 FL_Coord y, 62 FL_Coord w, 63 FL_Coord h, 64 const char * label ); 65 66 FL_EXPORT void fl_set_timer( FL_OBJECT * ob, 67 double total ); 68 69 FL_EXPORT double fl_get_timer( FL_OBJECT * ob ); 70 71 FL_EXPORT void fl_set_timer_countup( FL_OBJECT * ob, 72 int yes ); 73 74 FL_EXPORT FL_TIMER_FILTER fl_set_timer_filter( FL_OBJECT * ob, 75 FL_TIMER_FILTER filter ); 76 77 FL_EXPORT void fl_suspend_timer( FL_OBJECT * ob ); 78 79 FL_EXPORT void fl_resume_timer( FL_OBJECT * ob ); 80 81 #endif /* ! defined FL_TIMER_H */ 82