Last change
on this file was
7044,
checked in by westram, 14 years ago
|
- fixed include wrappers (merges [7006] [7007])
- use gcc-style include-wrappers
- use same convention for local wrappers in TREEGEN as rest of ARB
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
2.1 KB
|
Line | |
---|
1 | // ==================================================================== // |
---|
2 | // // |
---|
3 | // File : awt_hotkeys.hxx // |
---|
4 | // Purpose : // |
---|
5 | // // |
---|
6 | // // |
---|
7 | // Coded by Ralf Westram (coder@reallysoft.de) in August 2001 // |
---|
8 | // Copyright Department of Microbiology (Technical University Munich) // |
---|
9 | // // |
---|
10 | // Visit our web site at: http://www.arb-home.de/ // |
---|
11 | // // |
---|
12 | // // |
---|
13 | // ==================================================================== // |
---|
14 | |
---|
15 | #ifndef AWT_HOTKEYS_HXX |
---|
16 | #define AWT_HOTKEYS_HXX |
---|
17 | |
---|
18 | #ifndef _GLIBCXX_STRING |
---|
19 | #include <string> |
---|
20 | #endif |
---|
21 | |
---|
22 | #if defined(DEBUG) |
---|
23 | #ifndef _GLIBCXX_CSTDIO |
---|
24 | #include <cstdio> |
---|
25 | #endif |
---|
26 | #endif // DEBUG |
---|
27 | |
---|
28 | // -------------------------- |
---|
29 | // class awt_hotkeys |
---|
30 | // -------------------------- |
---|
31 | // this class automatically creates hotkeys from strings |
---|
32 | // use one instance for one set of hotkeys |
---|
33 | class awt_hotkeys { |
---|
34 | private: |
---|
35 | bool used[26]; |
---|
36 | bool USED[26]; |
---|
37 | char artificial; |
---|
38 | char current[2]; |
---|
39 | |
---|
40 | awt_hotkeys(const awt_hotkeys& other); // copying not allowed |
---|
41 | awt_hotkeys& operator=(const awt_hotkeys& other); // assignment not allowed |
---|
42 | public: |
---|
43 | awt_hotkeys() { |
---|
44 | for (int i = 0; i<26; ++i) { |
---|
45 | USED[i] = used[i] = false; |
---|
46 | } |
---|
47 | artificial = '0'; |
---|
48 | current[0] = current[1] = 0; |
---|
49 | } |
---|
50 | virtual ~awt_hotkeys() {} |
---|
51 | |
---|
52 | // return a unique hotkey (returns an empty string if no hotkey left) |
---|
53 | const char* artificial_hotkey(); |
---|
54 | // return a unique hotkey for label (uses one character from label if possible) |
---|
55 | const char* hotkey(const std::string& label); |
---|
56 | }; |
---|
57 | |
---|
58 | |
---|
59 | |
---|
60 | #else |
---|
61 | #error awt_hotkeys.hxx included twice |
---|
62 | #endif // AWT_HOTKEYS_HXX |
---|
63 | |
---|
Note: See
TracBrowser
for help on using the repository browser.