Last change
on this file since 3168 was
3165,
checked in by bensch, 20 years ago
|
orxonox/trunk/gui: compiling as not-GTK possibe, but it is not usable yet
|
File size:
1.3 KB
|
Line | |
---|
1 | /*! |
---|
2 | \file orxonox_gui_keys.h |
---|
3 | \brief File that holds the class that creates the Keyboard-Options. |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _ORXONOX_GUI_KEYS_H |
---|
7 | #define _ORXONOX_GUI_KEYS_H |
---|
8 | |
---|
9 | #include "orxonox_gui.h" |
---|
10 | #ifdef HAVE_GTK2 |
---|
11 | #include <gdk/gdkkeysyms.h> |
---|
12 | #endif /* HAVE_GTK2 */ |
---|
13 | /** |
---|
14 | * defines the Possible Player Keys |
---|
15 | */ |
---|
16 | enum KEYS { UP, DOWN, LEFT, RIGHT, SHOOT }; |
---|
17 | |
---|
18 | class Player; |
---|
19 | //! Class that creates the Keys-Options. |
---|
20 | class OrxonoxGuiKeys |
---|
21 | { |
---|
22 | private: |
---|
23 | Frame* keysFrame; |
---|
24 | Box* keysBox; |
---|
25 | Player* player1; |
---|
26 | Player* player2; |
---|
27 | Button* misc; |
---|
28 | |
---|
29 | public: |
---|
30 | OrxonoxGuiKeys (); |
---|
31 | ~OrxonoxGuiKeys (); |
---|
32 | |
---|
33 | Widget* getWidget (); |
---|
34 | }; |
---|
35 | |
---|
36 | //! Class to hold infos about a Player |
---|
37 | class Player |
---|
38 | { |
---|
39 | private: |
---|
40 | Window* pKeyWindow; |
---|
41 | Frame* pKeyFrame; |
---|
42 | Button* openButton; |
---|
43 | Button* closeButton; |
---|
44 | Box* pKeysBox; |
---|
45 | |
---|
46 | struct InputKey |
---|
47 | { |
---|
48 | Box* pKeyBox; |
---|
49 | Button* pKeyButton; |
---|
50 | OptionLabel* pKeyOLabel; |
---|
51 | }; |
---|
52 | |
---|
53 | InputKey* inputKey[10]; |
---|
54 | |
---|
55 | static Window* inputWindow; |
---|
56 | static Button* inputButton; |
---|
57 | static long keySignal; |
---|
58 | public: |
---|
59 | Player(char* player); |
---|
60 | |
---|
61 | Widget* addKey (KEYS key, char* name); |
---|
62 | |
---|
63 | Button* getOpenButton(); |
---|
64 | |
---|
65 | #ifdef HAVE_GTK2 |
---|
66 | static gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* widget); |
---|
67 | static gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey); |
---|
68 | #endif /* HAVE_GTK2 */ |
---|
69 | void setkey(KEYS key); |
---|
70 | |
---|
71 | }; |
---|
72 | |
---|
73 | |
---|
74 | |
---|
75 | #endif /* _ORXONOX_GUI_KEYS_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.