Diffstat (limited to 'libopie2/opiecore/device/odevice_simpad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 6c3253c..bf46e43 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp | |||
@@ -102,98 +102,97 @@ struct s_button simpad_buttons [] = { | |||
102 | /* | 102 | /* |
103 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 103 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
104 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 104 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
105 | "devicebuttons/simpad_lower_upper", | 105 | "devicebuttons/simpad_lower_upper", |
106 | "QPE/Launcher", "home()", | 106 | "QPE/Launcher", "home()", |
107 | "buttonsettings", "raise()" }, | 107 | "buttonsettings", "raise()" }, |
108 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 108 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
109 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 109 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
110 | "devicebuttons/simpad_upper_lower", | 110 | "devicebuttons/simpad_upper_lower", |
111 | "QPE/Launcher", "home()", | 111 | "QPE/Launcher", "home()", |
112 | "buttonsettings", "raise()" }, | 112 | "buttonsettings", "raise()" }, |
113 | */ | 113 | */ |
114 | }; | 114 | }; |
115 | 115 | ||
116 | void SIMpad::init(const QString&) | 116 | void SIMpad::init(const QString&) |
117 | { | 117 | { |
118 | d->m_vendorstr = "SIEMENS"; | 118 | d->m_vendorstr = "SIEMENS"; |
119 | d->m_vendor = Vendor_SIEMENS; | 119 | d->m_vendor = Vendor_SIEMENS; |
120 | 120 | ||
121 | 121 | ||
122 | //TODO Implement model checking | 122 | //TODO Implement model checking |
123 | //FIXME For now we assume an SL4 | 123 | //FIXME For now we assume an SL4 |
124 | 124 | ||
125 | d->m_modelstr = "SL4"; | 125 | d->m_modelstr = "SL4"; |
126 | d->m_model = Model_SIMpad_SL4; | 126 | d->m_model = Model_SIMpad_SL4; |
127 | 127 | ||
128 | switch ( d->m_model ) { | 128 | switch ( d->m_model ) { |
129 | default: | 129 | default: |
130 | d->m_rotation = Rot0; | 130 | d->m_rotation = Rot0; |
131 | d->m_direction = CCW; | 131 | d->m_direction = CCW; |
132 | d->m_holdtime = 1000; // 1000ms | 132 | d->m_holdtime = 1000; // 1000ms |
133 | 133 | ||
134 | break; | 134 | break; |
135 | } | 135 | } |
136 | 136 | ||
137 | //Distribution detecting code is now in base class | 137 | //Distribution detecting code is now in base class |
138 | m_leds [0] = m_leds [1] = Led_Off; | 138 | m_leds [0] = m_leds [1] = Led_Off; |
139 | 139 | ||
140 | m_power_timer = 0; | 140 | m_power_timer = 0; |
141 | 141 | ||
142 | } | 142 | } |
143 | 143 | ||
144 | void SIMpad::initButtons() | 144 | void SIMpad::initButtons() |
145 | { | 145 | { |
146 | if ( d->m_buttons ) | 146 | if ( d->m_buttons ) |
147 | return; | 147 | return; |
148 | 148 | ||
149 | if ( isQWS( ) ) { | 149 | if ( isQWS( ) ) { |
150 | Opie::Core::OKeyFilter::inst()->addPreHandler(this); | 150 | addPreHandler(this); |
151 | // QWSServer::setKeyboardFilter ( this ); | ||
152 | } | 151 | } |
153 | 152 | ||
154 | 153 | ||
155 | d->m_buttons = new QValueList <ODeviceButton>; | 154 | d->m_buttons = new QValueList <ODeviceButton>; |
156 | 155 | ||
157 | for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { | 156 | for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { |
158 | s_button *sb = simpad_buttons + i; | 157 | s_button *sb = simpad_buttons + i; |
159 | ODeviceButton b; | 158 | ODeviceButton b; |
160 | 159 | ||
161 | if (( sb->model & d->m_model ) == d->m_model ) { | 160 | if (( sb->model & d->m_model ) == d->m_model ) { |
162 | b. setKeycode ( sb->code ); | 161 | b. setKeycode ( sb->code ); |
163 | b. setUserText ( QObject::tr ( "Button", sb->utext )); | 162 | b. setUserText ( QObject::tr ( "Button", sb->utext )); |
164 | b. setPixmap ( Resource::loadPixmap ( sb->pix )); | 163 | b. setPixmap ( Resource::loadPixmap ( sb->pix )); |
165 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb->fpressedservice ), sb->fpressedaction )); | 164 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb->fpressedservice ), sb->fpressedaction )); |
166 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb->fheldservice ), sb->fheldaction )); | 165 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb->fheldservice ), sb->fheldaction )); |
167 | 166 | ||
168 | d->m_buttons->append ( b ); | 167 | d->m_buttons->append ( b ); |
169 | } | 168 | } |
170 | } | 169 | } |
171 | reloadButtonMapping(); | 170 | reloadButtonMapping(); |
172 | 171 | ||
173 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 172 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
174 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); | 173 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); |
175 | } | 174 | } |
176 | 175 | ||
177 | // SIMpad boardcontrol register CS3 | 176 | // SIMpad boardcontrol register CS3 |
178 | #define SIMPAD_BOARDCONTROL "/proc/cs3" | 177 | #define SIMPAD_BOARDCONTROL "/proc/cs3" |
179 | #define SIMPAD_VCC_5V_EN 0x0001 // For 5V PCMCIA | 178 | #define SIMPAD_VCC_5V_EN 0x0001 // For 5V PCMCIA |
180 | #define SIMPAD_VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA | 179 | #define SIMPAD_VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA |
181 | #define SIMPAD_EN1 0x0004 // This is only for EPROM's | 180 | #define SIMPAD_EN1 0x0004 // This is only for EPROM's |
182 | #define SIMPAD_EN0 0x0008 // Both should be enable for 3.3V or 5V | 181 | #define SIMPAD_EN0 0x0008 // Both should be enable for 3.3V or 5V |
183 | #define SIMPAD_DISPLAY_ON 0x0010 | 182 | #define SIMPAD_DISPLAY_ON 0x0010 |
184 | #define SIMPAD_PCMCIA_BUFF_DIS 0x0020 | 183 | #define SIMPAD_PCMCIA_BUFF_DIS 0x0020 |
185 | #define SIMPAD_MQ_RESET 0x0040 | 184 | #define SIMPAD_MQ_RESET 0x0040 |
186 | #define SIMPAD_PCMCIA_RESET 0x0080 | 185 | #define SIMPAD_PCMCIA_RESET 0x0080 |
187 | #define SIMPAD_DECT_POWER_ON 0x0100 | 186 | #define SIMPAD_DECT_POWER_ON 0x0100 |
188 | #define SIMPAD_IRDA_SD 0x0200 // Shutdown for powersave | 187 | #define SIMPAD_IRDA_SD 0x0200 // Shutdown for powersave |
189 | #define SIMPAD_RS232_ON 0x0400 | 188 | #define SIMPAD_RS232_ON 0x0400 |
190 | #define SIMPAD_SD_MEDIAQ 0x0800 // Shutdown for powersave | 189 | #define SIMPAD_SD_MEDIAQ 0x0800 // Shutdown for powersave |
191 | #define SIMPAD_LED2_ON 0x1000 | 190 | #define SIMPAD_LED2_ON 0x1000 |
192 | #define SIMPAD_IRDA_MODE 0x2000 // Fast/Slow IrDA mode | 191 | #define SIMPAD_IRDA_MODE 0x2000 // Fast/Slow IrDA mode |
193 | #define SIMPAD_ENABLE_5V 0x4000 // Enable 5V circuit | 192 | #define SIMPAD_ENABLE_5V 0x4000 // Enable 5V circuit |
194 | #define SIMPAD_RESET_SIMCARD 0x8000 | 193 | #define SIMPAD_RESET_SIMCARD 0x8000 |
195 | 194 | ||
196 | //SIMpad touchscreen backlight strength control | 195 | //SIMpad touchscreen backlight strength control |
197 | #define SIMPAD_BACKLIGHT_CONTROL "/proc/driver/mq200/registers/PWM_CONTROL" | 196 | #define SIMPAD_BACKLIGHT_CONTROL "/proc/driver/mq200/registers/PWM_CONTROL" |
198 | #define SIMPAD_BACKLIGHT_MASK 0x00a10044 | 197 | #define SIMPAD_BACKLIGHT_MASK 0x00a10044 |
199 | 198 | ||