source: NonGTP/FLTK/include/fltk/run.h @ 773

Revision 773, 3.0 KB checked in by gumbau, 19 years ago (diff)

FLTK imported to SVN repository to be linked agains the GeoTool? application

RevLine 
[773]1//
2// "$Id: run.h 4218 2005-03-31 05:14:08Z spitzak $"
3//
4// The basic fltk runtime. Every program needs to call this somewhere.
5//
6// Copyright 1998-2003 by Bill Spitzak and others.
7//
8// This library is free software; you can redistribute it and/or
9// modify it under the terms of the GNU Library General Public
10// License as published by the Free Software Foundation; either
11// version 2 of the License, or (at your option) any later version.
12//
13// This library is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16// Library General Public License for more details.
17//
18// You should have received a copy of the GNU Library General Public
19// License along with this library; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21// USA.
22//
23// Please report all bugs and problems to "fltk-bugs@fltk.org".
24//
25
26#ifndef fltk_run_h
27#define fltk_run_h
28
29#include "FL_API.h"
30#ifdef check
31# undef check
32#endif
33
34namespace fltk {
35
36/*! \addtogroup startup
37  \{ */
38FL_API float version();
39FL_API void display(const char*);
40FL_API int arg(int, char**, int&);
41FL_API int args(int, char**, int&, int (*)(int,char**,int&) = 0);
42extern FL_API const char* const help;
43FL_API void args(int, char**);
44FL_API bool enable_tablet_events();
45
46/*! \} */
47
48/*! \addtogroup execution
49  \{ */
50FL_API int wait();
51FL_API int wait(float time);
52FL_API int check();
53FL_API int ready();
54FL_API int run();
55FL_API void flush();
56FL_API void redraw();
57extern FL_API int damage_;
58inline void damage(int d) {damage_ = d;}
59inline int damage() {return damage_;}
60
61/*! Type of function passed to add_timeout(), add_check(), and add_idle() */
62typedef void (*TimeoutHandler)(void*);
63
64FL_API void add_timeout(float t, TimeoutHandler, void* v = 0);
65FL_API void repeat_timeout(float t, TimeoutHandler,void* = 0);
66FL_API bool has_timeout(TimeoutHandler, void* = 0);
67FL_API void remove_timeout(TimeoutHandler, void* = 0);
68
69FL_API void add_check(TimeoutHandler, void* = 0);
70FL_API bool has_check(TimeoutHandler, void* = 0);
71FL_API void remove_check(TimeoutHandler, void* = 0);
72
73FL_API void add_idle(TimeoutHandler, void* = 0);
74FL_API bool has_idle(TimeoutHandler, void* = 0);
75FL_API void remove_idle(TimeoutHandler, void* = 0);
76
77// For back-compatability only:
78extern FL_API void (*idle)();
79inline void set_idle(void (*cb)()) {idle = cb;}
80
81/*! Type of function passed to add_fd() */
82typedef void (*FileHandler)(int fd, void*);
83enum {READ = 1, WRITE = 4, EXCEPT = 8};
84FL_API void add_fd(int fd, int when, FileHandler, void* =0);
85FL_API void add_fd(int fd, FileHandler, void* = 0);
86FL_API void remove_fd(int, int when = -1);
87
88/*! \} */
89
90extern FL_API bool in_main_thread_;
91
92/*! \addtogroup multithreading
93  \{ */
94FL_API void lock();
95FL_API void unlock();
96FL_API void awake(void* message = 0);
97FL_API void* thread_message();
98inline bool in_main_thread() {return in_main_thread_;}
99/*! \} */
100
101}
102
103#endif
Note: See TracBrowser for help on using the repository browser.