author | zecke <zecke> | 2004-11-03 22:57:37 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-03 22:57:37 (UTC) |
commit | 07900eb7986f63e56072b1fb8fe5dbf846c8519d (patch) (unidiff) | |
tree | fb1242d501314408de6328e43ced421a274f9c48 | |
parent | c85842bfd4b008eb6bd7527f0511f36dbf693ba5 (diff) | |
download | opie-07900eb7986f63e56072b1fb8fe5dbf846c8519d.zip opie-07900eb7986f63e56072b1fb8fe5dbf846c8519d.tar.gz opie-07900eb7986f63e56072b1fb8fe5dbf846c8519d.tar.bz2 |
-Make struct s_button (simpad button) really internal
-Make the s_button array static and invisible
-Use namespace { instead of 'using namespace...;'
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 27 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.h | 12 |
2 files changed, 23 insertions, 16 deletions
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index ebf0cbb..9fde7f9 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp | |||
@@ -57,6 +57,18 @@ | |||
57 | 57 | ||
58 | using namespace Opie::Core; | 58 | namespace Opie { |
59 | using namespace Opie::Core::Internal; | 59 | namespace Core { |
60 | namespace Internal { | ||
61 | namespace { | ||
62 | struct s_button { | ||
63 | uint model; | ||
64 | Qt::Key code; | ||
65 | char *utext; | ||
66 | char *pix; | ||
67 | char *fpressedservice; | ||
68 | char *fpressedaction; | ||
69 | char *fheldservice; | ||
70 | char *fheldaction; | ||
71 | }; | ||
60 | 72 | ||
61 | struct s_button simpad_buttons [] = { | 73 | static struct s_button simpad_buttons [] = { |
62 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 74 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
@@ -115,2 +127,4 @@ struct s_button simpad_buttons [] = { | |||
115 | }; | 127 | }; |
128 | } | ||
129 | |||
116 | 130 | ||
@@ -151,3 +165,4 @@ void SIMpad::initButtons() | |||
151 | 165 | ||
152 | for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { | 166 | uint size = sizeof(simpad_buttons)/sizeof(s_button); |
167 | for ( uint i = 0; i < size; i++ ) { | ||
153 | s_button *sb = simpad_buttons + i; | 168 | s_button *sb = simpad_buttons + i; |
@@ -383 +398,5 @@ void SIMpad::updateAllWidgets() { | |||
383 | } | 398 | } |
399 | |||
400 | } | ||
401 | } | ||
402 | } | ||
diff --git a/libopie2/opiecore/device/odevice_simpad.h b/libopie2/opiecore/device/odevice_simpad.h index c25b911..41b94d1 100644 --- a/libopie2/opiecore/device/odevice_simpad.h +++ b/libopie2/opiecore/device/odevice_simpad.h | |||
@@ -70,14 +70,2 @@ private: | |||
70 | }; | 70 | }; |
71 | |||
72 | struct s_button { | ||
73 | uint model; | ||
74 | Qt::Key code; | ||
75 | char *utext; | ||
76 | char *pix; | ||
77 | char *fpressedservice; | ||
78 | char *fpressedaction; | ||
79 | char *fheldservice; | ||
80 | char *fheldaction; | ||
81 | }; | ||
82 | |||
83 | } | 71 | } |