-rw-r--r-- | noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp | 18 | ||||
-rw-r--r-- | noncore/games/qasteroids/view.cpp | 7 | ||||
-rw-r--r-- | noncore/games/solitaire/cardpile.h | 2 |
3 files changed, 18 insertions, 9 deletions
diff --git a/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp b/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp index b2180ba..a47bf6c 100644 --- a/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp +++ b/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp | |||
@@ -1,23 +1,25 @@ | |||
1 | #include <qmap.h> | 1 | #include <qmap.h> |
2 | 2 | ||
3 | #include "zkbnames.h" | 3 | #include "zkbnames.h" |
4 | 4 | ||
5 | QString Null_String((const char*) 0); | 5 | QString Null_String((const char*) 0); |
6 | 6 | ||
7 | // Implementation of KeyNames | 7 | // Implementation of KeyNames |
8 | static struct { | 8 | struct Key_Names_t { |
9 | int key; | 9 | int key; |
10 | char *name; | 10 | char *name; |
11 | } Key_Names[] = { | 11 | }; |
12 | |||
13 | static const Key_Names_t Key_Names[] = { | ||
12 | { 32, "Space" }, | 14 | { 32, "Space" }, |
13 | { 39, "Apostrophe" }, | 15 | { 39, "Apostrophe" }, |
14 | { 44, "Comma" }, | 16 | { 44, "Comma" }, |
15 | { 46, "Period" }, | 17 | { 46, "Period" }, |
16 | { 47, "Slash" }, | 18 | { 47, "Slash" }, |
17 | { 65, "A" }, | 19 | { 65, "A" }, |
18 | { 66, "B" }, | 20 | { 66, "B" }, |
19 | { 67, "C" }, | 21 | { 67, "C" }, |
20 | { 68, "D" }, | 22 | { 68, "D" }, |
21 | { 69, "E" }, | 23 | { 69, "E" }, |
22 | { 70, "F" }, | 24 | { 70, "F" }, |
23 | { 71, "G" }, | 25 | { 71, "G" }, |
@@ -96,28 +98,30 @@ const QString& KeyNames::find(int k) { | |||
96 | init_kn_maps(); | 98 | init_kn_maps(); |
97 | } | 99 | } |
98 | 100 | ||
99 | QMap<int, QString>::Iterator it = kn_rmap.find(k); | 101 | QMap<int, QString>::Iterator it = kn_rmap.find(k); |
100 | if (it == kn_rmap.end()) { | 102 | if (it == kn_rmap.end()) { |
101 | return Null_String; | 103 | return Null_String; |
102 | } else { | 104 | } else { |
103 | return it.data(); | 105 | return it.data(); |
104 | } | 106 | } |
105 | } | 107 | } |
106 | 108 | ||
107 | // Implementation of ModifierNames | 109 | // Implementation of ModifierNames |
108 | struct { | 110 | struct Modifier_Names_t { |
109 | int value; | 111 | int value; |
110 | char* name; | 112 | char* name; |
111 | } Modifier_Names[] = { | 113 | }; |
114 | |||
115 | static const Modifier_Names_t Modifier_Names[] = { | ||
112 | { 8, "Shift" }, | 116 | { 8, "Shift" }, |
113 | { 16, "Control" }, | 117 | { 16, "Control" }, |
114 | { 32, "Alt" }, | 118 | { 32, "Alt" }, |
115 | { 0x4000, "Keypad" }, | 119 | { 0x4000, "Keypad" }, |
116 | { 0, 0 } | 120 | { 0, 0 } |
117 | }; | 121 | }; |
118 | 122 | ||
119 | static QMap<QString, int> mn_map; | 123 | static QMap<QString, int> mn_map; |
120 | static QMap<int, QString> mn_rmap; | 124 | static QMap<int, QString> mn_rmap; |
121 | 125 | ||
122 | void init_mn_maps() { | 126 | void init_mn_maps() { |
123 | int i = 0; | 127 | int i = 0; |
@@ -150,28 +154,30 @@ const QString& ModifierNames::find(int k) { | |||
150 | } | 154 | } |
151 | 155 | ||
152 | QMap<int, QString>::Iterator it = mn_rmap.find(k); | 156 | QMap<int, QString>::Iterator it = mn_rmap.find(k); |
153 | if (it == mn_rmap.end()) { | 157 | if (it == mn_rmap.end()) { |
154 | return Null_String; | 158 | return Null_String; |
155 | } else { | 159 | } else { |
156 | return it.data(); | 160 | return it.data(); |
157 | } | 161 | } |
158 | } | 162 | } |
159 | 163 | ||
160 | // Implementation of KeycodeNames | 164 | // Implementation of KeycodeNames |
161 | 165 | ||
162 | struct { | 166 | struct Keycode_Names_t { |
163 | char* name; | 167 | char* name; |
164 | int keycode; | 168 | int keycode; |
165 | } Keycode_Names[] = { | 169 | }; |
170 | |||
171 | static const Keycode_Names_t Keycode_Names[] = { | ||
166 | { "Escape", 0x1000 }, | 172 | { "Escape", 0x1000 }, |
167 | { "Tab", 0x1001 }, | 173 | { "Tab", 0x1001 }, |
168 | { "Backtab", 0x1002 }, | 174 | { "Backtab", 0x1002 }, |
169 | { "Backspace", 0x1003 }, | 175 | { "Backspace", 0x1003 }, |
170 | { "BackSpace", 0x1003 }, | 176 | { "BackSpace", 0x1003 }, |
171 | { "Return", 0x1004 }, | 177 | { "Return", 0x1004 }, |
172 | { "Enter", 0x1005 }, | 178 | { "Enter", 0x1005 }, |
173 | { "Insert", 0x1006 }, | 179 | { "Insert", 0x1006 }, |
174 | { "Delete", 0x1007 }, | 180 | { "Delete", 0x1007 }, |
175 | { "Pause", 0x1008 }, | 181 | { "Pause", 0x1008 }, |
176 | { "Print", 0x1009 }, | 182 | { "Print", 0x1009 }, |
177 | { "SysReq", 0x100a }, | 183 | { "SysReq", 0x100a }, |
diff --git a/noncore/games/qasteroids/view.cpp b/noncore/games/qasteroids/view.cpp index 352c63b..3a4d410 100644 --- a/noncore/games/qasteroids/view.cpp +++ b/noncore/games/qasteroids/view.cpp | |||
@@ -46,31 +46,32 @@ | |||
46 | #define MAX_SHIP_SPEED 8 | 46 | #define MAX_SHIP_SPEED 8 |
47 | #define MAX_BRAKES 5 | 47 | #define MAX_BRAKES 5 |
48 | #define MAX_SHIELDS 5 | 48 | #define MAX_SHIELDS 5 |
49 | #define MAX_FIREPOWER 5 | 49 | #define MAX_FIREPOWER 5 |
50 | 50 | ||
51 | #define TEXT_SPEED 4 | 51 | #define TEXT_SPEED 4 |
52 | 52 | ||
53 | #define PI_X_2 6.283185307 | 53 | #define PI_X_2 6.283185307 |
54 | #ifndef M_PI | 54 | #ifndef M_PI |
55 | #define M_PI 3.141592654 | 55 | #define M_PI 3.141592654 |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | struct | 58 | struct kas_animations_t |
59 | { | 59 | { |
60 | int id; | 60 | int id; |
61 | const char *path; | 61 | const char *path; |
62 | int frames; | 62 | int frames; |
63 | } | 63 | }; |
64 | kas_animations [] = | 64 | |
65 | static const kas_animations_t kas_animations [] = | ||
65 | { | 66 | { |
66 | // { ID_ROCK_LARGE, "rock1/rock1\%1.png", 32 }, | 67 | // { ID_ROCK_LARGE, "rock1/rock1\%1.png", 32 }, |
67 | { ID_ROCK_MEDIUM, "rock2/rock2\%1.png", 32 }, | 68 | { ID_ROCK_MEDIUM, "rock2/rock2\%1.png", 32 }, |
68 | { ID_ROCK_SMALL, "rock3/rock3\%1.png", 32 }, | 69 | { ID_ROCK_SMALL, "rock3/rock3\%1.png", 32 }, |
69 | { ID_SHIP, "ship/ship\%1.png", 32 }, | 70 | { ID_SHIP, "ship/ship\%1.png", 32 }, |
70 | { ID_MISSILE, "missile/missile.png", 0 }, | 71 | { ID_MISSILE, "missile/missile.png", 0 }, |
71 | { ID_BIT, "bits/bits\%1.png", 16 }, | 72 | { ID_BIT, "bits/bits\%1.png", 16 }, |
72 | { ID_EXHAUST, "exhaust/exhaust.png", 0 }, | 73 | { ID_EXHAUST, "exhaust/exhaust.png", 0 }, |
73 | { ID_ENERGY_POWERUP, "powerups/energy.png", 0 }, | 74 | { ID_ENERGY_POWERUP, "powerups/energy.png", 0 }, |
74 | // { ID_TELEPORT_POWERUP, "powerups/teleport%1.png", 12 }, | 75 | // { ID_TELEPORT_POWERUP, "powerups/teleport%1.png", 12 }, |
75 | { ID_BRAKE_POWERUP, "powerups/brake.png", 0 }, | 76 | { ID_BRAKE_POWERUP, "powerups/brake.png", 0 }, |
76 | { ID_SHIELD_POWERUP, "powerups/shield.png", 0 }, | 77 | { ID_SHIELD_POWERUP, "powerups/shield.png", 0 }, |
diff --git a/noncore/games/solitaire/cardpile.h b/noncore/games/solitaire/cardpile.h index 1eb2499..757e6b3 100644 --- a/noncore/games/solitaire/cardpile.h +++ b/noncore/games/solitaire/cardpile.h | |||
@@ -11,24 +11,26 @@ | |||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef CARD_PILE_H | 20 | #ifndef CARD_PILE_H |
21 | #define CARD_PILE_H | 21 | #define CARD_PILE_H |
22 | 22 | ||
23 | #include "card.h" | ||
24 | |||
23 | 25 | ||
24 | #include <qpoint.h> | 26 | #include <qpoint.h> |
25 | #include <qlist.h> | 27 | #include <qlist.h> |
26 | 28 | ||
27 | 29 | ||
28 | enum ePileStackingType { | 30 | enum ePileStackingType { |
29 | pileCascades = 0, pileStacks, pileCascadesOrStacks | 31 | pileCascades = 0, pileStacks, pileCascadesOrStacks |
30 | }; | 32 | }; |
31 | 33 | ||
32 | 34 | ||
33 | enum ePileFaceingType { | 35 | enum ePileFaceingType { |
34 | pileFaceUp = 0, pileFaceDown, pileFaceUpOrDown | 36 | pileFaceUp = 0, pileFaceDown, pileFaceUpOrDown |