annotate src/timeout.cc @ 35:d9e7b35430de

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