summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2000-06-16 07:28:03 +0000
committerBill Spitzak <spitzak@gmail.com>2000-06-16 07:28:03 +0000
commit4dd096e7b52301663ddaa002984e10cb83d97b9a (patch)
treecf147534bff0f11532f289c7650c9b797457d7c9 /src
parent084b19e305eccead76c2322d1533af526684ed6b (diff)
Added has_timeout() and has_idle() calls as suggested by Eric Sven Ristad.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1214 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx10
-rw-r--r--src/Fl_add_idle.cxx10
2 files changed, 16 insertions, 4 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 73fa187bb..4792db339 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl.cxx,v 1.24.2.25 2000/06/10 21:30:59 bill Exp $"
+// "$Id: Fl.cxx,v 1.24.2.26 2000/06/16 07:28:02 bill Exp $"
//
// Main event handling code for the Fast Light Tool Kit (FLTK).
//
@@ -102,6 +102,12 @@ void Fl::add_timeout(double t, Fl_Timeout_Handler cb, void *v) {
numtimeouts++;
}
+int Fl::has_timeout(void (*cb)(void *), void *v) {
+ for (int i=0; i<numtimeouts; i++)
+ if (timeout[i].cb == cb && timeout[i].arg==v) return 1;
+ return 0;
+}
+
void Fl::remove_timeout(Fl_Timeout_Handler cb, void *v) {
int i,j;
for (i=j=0; i<numtimeouts; i++) {
@@ -721,5 +727,5 @@ void Fl_Window::flush() {
}
//
-// End of "$Id: Fl.cxx,v 1.24.2.25 2000/06/10 21:30:59 bill Exp $".
+// End of "$Id: Fl.cxx,v 1.24.2.26 2000/06/16 07:28:02 bill Exp $".
//
diff --git a/src/Fl_add_idle.cxx b/src/Fl_add_idle.cxx
index 227fa65b8..748d03767 100644
--- a/src/Fl_add_idle.cxx
+++ b/src/Fl_add_idle.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_add_idle.cxx,v 1.4.2.3 2000/06/05 21:21:00 mike Exp $"
+// "$Id: Fl_add_idle.cxx,v 1.4.2.4 2000/06/16 07:28:03 bill Exp $"
//
// Idle routine support for the Fast Light Tool Kit (FLTK).
//
@@ -63,6 +63,12 @@ void Fl::add_idle(void (*cb)(void*), void* data) {
}
}
+int Fl::has_idle(void (*cb)(void*), void* data) {
+ for (idle_cb* p = first; p != last; p = p->next)
+ if (p->cb == cb && p->data == data) return 1;
+ return 0;
+}
+
void Fl::remove_idle(void (*cb)(void*), void* data) {
idle_cb* p = first;
if (!p) return;
@@ -84,5 +90,5 @@ void Fl::remove_idle(void (*cb)(void*), void* data) {
}
//
-// End of "$Id: Fl_add_idle.cxx,v 1.4.2.3 2000/06/05 21:21:00 mike Exp $".
+// End of "$Id: Fl_add_idle.cxx,v 1.4.2.4 2000/06/16 07:28:03 bill Exp $".
//