Mercurial > ~dholland > hg > ag > index.cgi
comparison anagram/vaclgui/openfile.hpp @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:13d2b8934445 |
---|---|
1 /* | |
2 * AnaGram, A System for Syntax Directed Programming | |
3 * Copyright 1997-2002 Parsifal Software. All Rights Reserved. | |
4 * See the file COPYING for license and usage terms. | |
5 * | |
6 * openfile.hpp | |
7 */ | |
8 | |
9 #ifndef OPENFILE_HPP | |
10 #define OPENFILE_HPP | |
11 | |
12 #include <ithread.hpp> | |
13 #include "action.h" | |
14 | |
15 class ControlPanel; | |
16 | |
17 | |
18 extern int analyzeThreadActive; | |
19 | |
20 class AnalyzeGrammarFn : public IThreadFn { | |
21 private: | |
22 ControlPanel *sourceWindow; | |
23 IThread *controlThread; | |
24 | |
25 public: | |
26 | |
27 AnalyzeGrammarFn(ControlPanel *window) | |
28 : sourceWindow(window) | |
29 , controlThread(&IThread::current()) | |
30 {} | |
31 | |
32 virtual void run(); | |
33 }; | |
34 | |
35 class BuildParserFn : public IThreadFn { | |
36 private: | |
37 ControlPanel *sourceWindow; | |
38 IThread *controlThread; | |
39 | |
40 public: | |
41 BuildParserFn(ControlPanel *window) | |
42 : sourceWindow(window) | |
43 , controlThread(&IThread::current()) | |
44 {} | |
45 | |
46 virtual void run(); | |
47 }; | |
48 | |
49 class AgThread : public IThread { | |
50 private: | |
51 IReference<IThreadFn> threadFn; | |
52 | |
53 public: | |
54 void run() { | |
55 IThread::start(threadFn); | |
56 } | |
57 void start(IThreadFn *f) { | |
58 threadFn = f; | |
59 defer(this, run); | |
60 } | |
61 }; | |
62 | |
63 | |
64 #endif /* OPENFILE_HPP */ |