comparison src/timeout.cc @ 0:6ee11bf9e3ea

Initial revision
author jcid
date Sun, 07 Oct 2007 00:36:34 +0200
parents
children d9e7b35430de
comparison
equal deleted inserted replaced
-1:000000000000 0:6ee11bf9e3ea
1 /*
2 * File: timeout.cc
3 *
4 * Copyright (C) 2005 Jorge Arellano Cid <jcid@dillo.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 */
11
12 // Simple ADT for timeout functions
13
14 #include <fltk/run.h>
15 #include "timeout.hh"
16
17 using namespace fltk;
18
19
20 // C++ functions with C linkage ----------------------------------------------
21
22 /*
23 * Hook a one-time timeout function 'cb' after 't' seconds
24 * with 'cbdata" as its data.
25 */
26 void a_Timeout_add(float t, TimeoutCb_t cb, void *cbdata)
27 {
28 add_timeout(t, cb, cbdata);
29 }
30
31 /*
32 * To be called from iside the 'cb' function when it wants to keep running
33 */
34 void a_Timeout_repeat(float t, TimeoutCb_t cb, void *cbdata)
35 {
36 add_timeout(t, cb, cbdata);
37 }
38
39 /*
40 * Stop running a timeout function
41 */
42 void a_Timeout_remove()
43 {
44 /* in FLTK, timeouts run one time by default */
45 }
46