comparison src/ui/bmi/mmiBookMenuWindow.c @ 142:ec9f955fc487

mmiBook*.c: bogotab fixes
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 14 Nov 2020 08:43:59 +0000
parents c0052fe355d3
children
comparison
equal deleted inserted replaced
141:67b91d34f75e 142:ec9f955fc487
1 /******************************************************************************* 1 /*******************************************************************************
2 2
3 CONDAT (UK) 3 CONDAT (UK)
4 4
5 ******************************************************************************** 5 ********************************************************************************
6 6
7 This software product is the property of Condat (UK) Ltd and may not be 7 This software product is the property of Condat (UK) Ltd and may not be
8 disclosed to any third party without the express permission of the owner. 8 disclosed to any third party without the express permission of the owner.
9 9
10 ******************************************************************************** 10 ********************************************************************************
11 11
12 $Project name: Basic MMI 12 $Project name: Basic MMI
13 $Project code: BMI (6349) 13 $Project code: BMI (6349)
14 $Module: PhoneBook 14 $Module: PhoneBook
15 $File: MmiBookMenuWindow.c 15 $File: MmiBookMenuWindow.c
16 $Revision: 1.0 16 $Revision: 1.0
17 17
18 $Author: Condat(UK) 18 $Author: Condat(UK)
19 $Date: 25/10/00 19 $Date: 25/10/00
20 20
21 ******************************************************************************** 21 ********************************************************************************
22 22
23 Description: 23 Description:
24 24
27 ******************************************************************************** 27 ********************************************************************************
28 $History: MmiBookMenuWindow.c 28 $History: MmiBookMenuWindow.c
29 Mar 30, 2007 OMAPS00123019 a0393213(R.Prabakar) 29 Mar 30, 2007 OMAPS00123019 a0393213(R.Prabakar)
30 Description : Reboot of the target when you unplug/plug USB cable using camera application 30 Description : Reboot of the target when you unplug/plug USB cable using camera application
31 31
32 xrashmic 28 Jun 2006, OMAPS00084172 32 xrashmic 28 Jun 2006, OMAPS00084172
33 On pressing back from options menu in camera, the midi stopped playing. 33 On pressing back from options menu in camera, the midi stopped playing.
34 Hence added stopRingerVolSettingInactivityTimer under the if(getSoundsReason() == SettingVolume) 34 Hence added stopRingerVolSettingInactivityTimer under the if(getSoundsReason() == SettingVolume)
35 35
36 Sep 01, 2005 REF: CRR 32707 x0021334 36 Sep 01, 2005 REF: CRR 32707 x0021334
37 Description: Select Softkey dosen't work for the second time on choosing Volume option in Ringer menu 37 Description: Select Softkey dosen't work for the second time on choosing Volume option in Ringer menu
38 Fix: Select soft key operation in volume menu has been modified to fix this problem. 38 Fix: Select soft key operation in volume menu has been modified to fix this problem.
39 39
40 Apr 05, 2005 REF: ENH 29994 xdeepadh 40 Apr 05, 2005 REF: ENH 29994 xdeepadh
41 Description: Implementation of Generic Midi Ringer and Modification of existing Midi Test Application 41 Description: Implementation of Generic Midi Ringer and Modification of existing Midi Test Application
42 Solution: Generic Midi Ringer and Midi Test Application were implemented. 42 Solution: Generic Midi Ringer and Midi Test Application were implemented.
43 43
44 25/10/00 Original Condat(UK) BMI version. 44 25/10/00 Original Condat(UK) BMI version.
45 45
46 $End 46 $End
47 47
48 *******************************************************************************/ 48 *******************************************************************************/
49 49
133 #include "MmiBookShared.h" 133 #include "MmiBookShared.h"
134 #include "MmiSettings.h" // for keypadlock 134 #include "MmiSettings.h" // for keypadlock
135 #include "MmiSounds.h" 135 #include "MmiSounds.h"
136 #include "MmiIdle.h" 136 #include "MmiIdle.h"
137 137
138 extern UBYTE HUPKeyOrigin; // Variable to indicate that long end key press is coming from menu 138 extern UBYTE HUPKeyOrigin; // Variable to indicate that long end key press is coming from menu
139 139
140 /******************************************************************************* 140 /*******************************************************************************
141 External Function Prototype 141 External Function Prototype
142 142
143 *******************************************************************************/ 143 *******************************************************************************/
159 Private Methods 159 Private Methods
160 160
161 *******************************************************************************/ 161 *******************************************************************************/
162 162
163 163
164 164 /*******************************************************************************
165 /******************************************************************************* 165
166 166 $Function: bookMenuMenuCB
167 $Function: bookMenuMenuCB 167
168 168 $Description: Menu handler for the menu window
169 $Description: Menu handler for the menu window 169
170 170 $Returns: MFW_EVENT_CONSUMED if event handled, otherwise
171 $Returns: MFW_EVENT_CONSUMED if event handled, otherwise 171 MFW_EVENT_PASSED
172 MFW_EVENT_PASSED 172
173 173 $Arguments: e, event, m, menu handle
174 $Arguments: e, event, m, menu handle
175 174
176 *******************************************************************************/ 175 *******************************************************************************/
177 176
178 static int bookMenuMenuCB( MfwEvt e, MfwMnu *m ) 177 static int bookMenuMenuCB( MfwEvt e, MfwMnu *m )
179 { 178 {
180 T_MFW_HND window = mfwParent( mfw_header() ); 179 T_MFW_HND window = mfwParent( mfw_header() );
181 T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data; 180 T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data;
182 tBookStandard *data = (tBookStandard *) win_data->user; 181 tBookStandard *data = (tBookStandard *) win_data->user;
183 182
184 TRACE_FUNCTION( "bookMenuMenuCB()" ); 183 TRACE_FUNCTION( "bookMenuMenuCB()" );
185 184
186 /* We only handle the ESCAPE event in here 185 /* We only handle the ESCAPE event in here
187 */ 186 */
188 switch( e ) 187 switch( e )
189 { 188 {
190 case E_MNU_ESCAPE: 189 case E_MNU_ESCAPE:
191 { 190 {
192 /* Escape requested, we need to shut down this window 191 /* Escape requested, we need to shut down this window
193 */ 192 */
194 if (data->Callback) 193 if (data->Callback)
195 (data->Callback) (data->parent_win, NULL, NULL); 194 (data->Callback) (data->parent_win, NULL, NULL);
196 bookMenuDestroy( window ); 195 bookMenuDestroy( window );
197 //xrashmic 28 Jun 2006, OMAPS00084172 196 //xrashmic 28 Jun 2006, OMAPS00084172
198 //On pressing back from options menu in camera, the midi stopped playing. 197 //On pressing back from options menu in camera, the midi stopped playing.
199 if(getSoundsReason() == SettingVolume) 198 if(getSoundsReason() == SettingVolume)
200 stopRingerVolSettingInactivityTimer(); 199 stopRingerVolSettingInactivityTimer();
201 } 200 }
202 break; 201 break;
203 202
204 default: 203 default:
205 { 204 {
206 /* unknown event, pass it up the tree for handling elsewhere 205 /* unknown event, pass it up the tree for handling elsewhere
207 */ 206 */
208 return MFW_EVENT_PASSED; 207 return MFW_EVENT_PASSED;
209 } 208 }
210 /* break; */ /* RAVI */ 209 /* break; */ /* RAVI */
211 } 210 }
212 211
213 /* We got here, event handled, prevent anyone else 212 /* We got here, event handled, prevent anyone else
214 dealing with it 213 dealing with it
215 */ 214 */
216 return MFW_EVENT_CONSUMED; 215 return MFW_EVENT_CONSUMED;
217 } 216 }
218 217
219 218
220 219 /*******************************************************************************
221 220
222 221 $Function: bookMenuDialog
223 222
224 /******************************************************************************* 223 $Description: Menu window dialog function
225 224
226 $Function: bookMenuDialog 225 $Returns: none
227 226
228 $Description: Menu window dialog function 227 $Arguments: win, window handle
229
230 $Returns: none
231
232 $Arguments: win, window handle
233 event, event to be handled 228 event, event to be handled
234 value, not used 229 value, not used
235 parameter, not used 230 parameter, not used
236 231
237 *******************************************************************************/ 232 *******************************************************************************/
238 233
239 void bookMenuDialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter ) 234 void bookMenuDialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter )
240 { 235 {
241 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; 236 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data;
242 tBookStandard *data = (tBookStandard *) win_data->user; 237 tBookStandard *data = (tBookStandard *) win_data->user;
243 /* MfwMnu *mnu; */ /* RAVI */ 238 /* MfwMnu *mnu; */ /* RAVI */
244 239
245 TRACE_FUNCTION( "bookMenuDialog()" ); 240 TRACE_FUNCTION( "bookMenuDialog()" );
246 241
247 /* The menu dialog function has to deal with initialisation 242 /* The menu dialog function has to deal with initialisation
248 and responses from the PIN2 validation methods 243 and responses from the PIN2 validation methods
249 */ 244 */
250 switch( event ) 245 switch( event )
251 { 246 {
252 case MENU_INIT: 247 case MENU_INIT:
253 { 248 {
254 /* On initialisation, we can create the menus and 249 /* On initialisation, we can create the menus and
255 display the window 250 display the window
256 */ 251 */
257 data->menu = mnuCreate( data->win, (MfwMnuAttr *) parameter, E_MNU_ESCAPE, (MfwCb) bookMenuMenuCB ); 252 data->menu = mnuCreate( data->win, (MfwMnuAttr *) parameter, E_MNU_ESCAPE, (MfwCb) bookMenuMenuCB );
258 mnuLang( data->menu, mainMmiLng ); 253 mnuLang( data->menu, mainMmiLng );
259 mnuUnhide( data->menu ); 254 mnuUnhide( data->menu );
260 winShow( data->win ); 255 winShow( data->win );
261 256
262 if (value EQ PhbkMainMenu) 257 if (value EQ PhbkMainMenu)
263 { 258 {
264 // start the timer for the keypadlock 259 // start the timer for the keypadlock
265 tim_start (data->menu_tim); 260 tim_start (data->menu_tim);
266 data->status_of_timer = FALSE; 261 data->status_of_timer = FALSE;
267 } 262 }
268 else 263 else
269 { 264 {
270 data->status_of_timer = TRUE; 265 data->status_of_timer = TRUE;
271 } 266 }
272 if(value == SettingVolume) 267 if(value == SettingVolume)
273 { 268 {
274 /* 269 /*
275 The ringer volume settings dialog has been invoked, create and start the 270 The ringer volume settings dialog has been invoked, create and start the
276 4 second time out. 271 4 second time out.
277 */ 272 */
278 /* RAVI - 20-1-2006 */ 273 /* RAVI - 20-1-2006 */
279 #ifdef NEPTUNE_BOARD 274 #ifdef NEPTUNE_BOARD
280 setSoundsReason(SettingVolume); 275 setSoundsReason(SettingVolume);
281 #endif 276 #endif
282 /* END RAVI */ 277 /* END RAVI */
283 startRingerVolSettingInactivityTimer(); 278 startRingerVolSettingInactivityTimer();
284 } 279 }
285 280
286 } 281 }
287 break; 282 break;
288 283
289 case ADD_CALLBACK: 284 case ADD_CALLBACK:
290 { 285 {
291 /* Change the callback from the default menu callback to one specified 286 /* Change the callback from the default menu callback to one specified
292 * in parameter */ 287 * in parameter */
293 data->Callback = (T_VOID_FUNC)parameter; 288 data->Callback = (T_VOID_FUNC)parameter;
294 } 289 }
295 break; 290 break;
296 291
297 case DEFAULT_OPTION: 292 case DEFAULT_OPTION:
298 { 293 {
299 /* Highlight an option in the menu when it is opened. Parameter points to a UBYTE. */ 294 /* Highlight an option in the menu when it is opened. Parameter points to a UBYTE. */
300 295
301 mnuChooseVisibleItem(data->menu, *((UBYTE *)parameter)); 296 mnuChooseVisibleItem(data->menu, *((UBYTE *)parameter));
302 } 297 }
303 break; 298 break;
304 299
305 case PIN2_OK: 300 case PIN2_OK:
306 { 301 {
307 /* We have received a PIN2 authorisation, so we can execute the 302 /* We have received a PIN2 authorisation, so we can execute the
308 the requested function 303 the requested function
309 */ 304 */
310 305
311 TRACE_EVENT("PIN2_OK: Should carry on to perform phonebook op"); 306 TRACE_EVENT("PIN2_OK: Should carry on to perform phonebook op");
312 (data->phbk->pin2_next)( data->phbk->menu, data->phbk->item); 307 (data->phbk->pin2_next)( data->phbk->menu, data->phbk->item);
313 308
314 } 309 }
315 break; 310 break;
316 case E_MNU_ESCAPE: 311 case E_MNU_ESCAPE:
317 { 312 {
318 /* Escape requested, we need to shut down this window 313 /* Escape requested, we need to shut down this window
319 */ 314 */
320 bookMenuDestroy( win); 315 bookMenuDestroy( win);
321 } 316 }
322 break; 317 break;
323 default: 318 default:
324 { 319 {
325 /* In situations where a PIN2 abort is returned, we can handle it 320 /* In situations where a PIN2 abort is returned, we can handle it
326 as a default event, and just ignore it 321 as a default event, and just ignore it
327 */ 322 */
328 TRACE_EVENT("PIN2 not OK"); 323 TRACE_EVENT("PIN2 not OK");
329 } 324 }
330 break; 325 break;
331 } 326 }
332 } 327 }
333 328
334 329
335 330 /*******************************************************************************
336 /******************************************************************************* 331
337 332 $Function: bookMenuTimCB
338 $Function: bookMenuTimCB 333
339 334 $Description: Menu tim handler
340 $Description: Menu tim handler
341 335
342 $Returns: 336 $Returns:
343 337
344 $Arguments: 338 $Arguments:
345 339
346 *******************************************************************************/ 340 *******************************************************************************/
347 341
348 static int bookMenuTimCB (T_MFW_EVENT event, T_MFW_TIM *tc) 342 static int bookMenuTimCB (T_MFW_EVENT event, T_MFW_TIM *tc)
349 { 343 {
350 T_MFW_HND window = mfwParent( mfw_header() ); 344 T_MFW_HND window = mfwParent( mfw_header() );
351 T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data; 345 T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data;
352 tBookStandard *data = (tBookStandard *) win_data->user; 346 tBookStandard *data = (tBookStandard *) win_data->user;
353 347
354 data->status_of_timer = TRUE; 348 data->status_of_timer = TRUE;
355 349
356 /* ADDED RAVI - 25-11-2005 */ 350 /* ADDED RAVI - 25-11-2005 */
357 return 0; 351 return 0;
358 /* END RAVI */ 352 /* END RAVI */
359 353
360 } 354 }
361 355
362 356
363 357 /*******************************************************************************
364 358
365 359 $Function: bookMenuWindowCB
366 360
367 /******************************************************************************* 361 $Description: Menu window handler
368 362
369 $Function: bookMenuWindowCB 363 $Returns: MFW_EVENT_CONSUMED if event handled, otherwise
370 364 MFW_EVENT_PASSED
371 $Description: Menu window handler 365
372 366 $Arguments: e, event, m, window handle
373 $Returns: MFW_EVENT_CONSUMED if event handled, otherwise
374 MFW_EVENT_PASSED
375
376 $Arguments: e, event, m, window handle
377 367
378 *******************************************************************************/ 368 *******************************************************************************/
379 369
380 static int bookMenuWindowCB( MfwEvt e, MfwWin *w ) 370 static int bookMenuWindowCB( MfwEvt e, MfwWin *w )
381 { 371 {
382 tBookStandard * data = (tBookStandard *)w->user; 372 tBookStandard * data = (tBookStandard *)w->user;
383 MfwMnu * mnu; 373 MfwMnu * mnu;
384 374
385 TRACE_FUNCTION( "bookMenuWindowCB()" ); 375 TRACE_FUNCTION( "bookMenuWindowCB()" );
386 376
387 if (!w) 377 if (!w)
388 return MFW_EVENT_PASSED; 378 return MFW_EVENT_PASSED;
389 379
390 switch( e ) 380 switch( e )
391 { 381 {
392 case MfwWinVisible: 382 case MfwWinVisible:
393 { 383 {
394 dspl_ClearAll(); // sbh - clear screen before update 384 dspl_ClearAll(); // sbh - clear screen before update
395 mnu = (MfwMnu *) mfwControl( data->menu ); 385 mnu = (MfwMnu *) mfwControl( data->menu );
396 386
397 /* 387 /*
398 **Check whether the data is valid, if not use 'sensible' default values 388 **Check whether the data is valid, if not use 'sensible' default values
399 */ 389 */
400 if (mnu) 390 if (mnu)
401 { 391 {
402 if (mnu->curAttr) 392 if (mnu->curAttr)
403 softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, mnu->curAttr->mnuColour); 393 softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, mnu->curAttr->mnuColour);
404 else 394 else
405 softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, COLOUR_LIST_SUBMENU); 395 softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, COLOUR_LIST_SUBMENU);
406 396
407 } 397 }
408 else 398 else
409 softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, COLOUR_LIST_SUBMENU); 399 softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, COLOUR_LIST_SUBMENU);
410 } 400 }
411 break; 401 break;
412 402
413 default: 403 default:
414 { 404 {
415 /* unknown event, pass it up the tree for handling elsewhere 405 /* unknown event, pass it up the tree for handling elsewhere
416 */ 406 */
417 return MFW_EVENT_PASSED; 407 return MFW_EVENT_PASSED;
418 } 408 }
419 /* break; */ /* RAVI */ 409 /* break; */ /* RAVI */
420 } 410 }
421 411
422 /* We got here, event handled, prevent anyone else 412 /* We got here, event handled, prevent anyone else
423 dealing with it 413 dealing with it
424 */ 414 */
425 return MFW_EVENT_CONSUMED; 415 return MFW_EVENT_CONSUMED;
426 } 416 }
427 417
428 418
429 419 /*******************************************************************************
430 420
431 421 $Function: bookMenuKbdCB
432 422
433 /******************************************************************************* 423 $Description: tbd
434 424
435 $Function: bookMenuKbdCB 425 $Returns: MFW_EVENT_CONSUMED always
436 426
437 $Description: tbd 427 $Arguments: e, event, k, key handle
438
439 $Returns: MFW_EVENT_CONSUMED always
440
441 $Arguments: e, event, k, key handle
442 428
443 *******************************************************************************/ 429 *******************************************************************************/
444 430
445 static int bookMenuKbdCB( MfwEvt e, MfwKbd *k ) 431 static int bookMenuKbdCB( MfwEvt e, MfwKbd *k )
446 { 432 {
447 static BOOL storeSelectedItemToPcm=FALSE; 433 static BOOL storeSelectedItemToPcm=FALSE;
448 T_MFW_HND window = mfwParent( mfw_header() ); 434 T_MFW_HND window = mfwParent( mfw_header() );
449 T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data; 435 T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data;
450 tBookStandard *data = (tBookStandard *) win_data->user; 436 tBookStandard *data = (tBookStandard *) win_data->user;
451 MfwMnu *mnu; 437 MfwMnu *mnu;
452 U8 keycode; /* SPR#1608 - SH */ 438 U8 keycode; /* SPR#1608 - SH */
453 439
454 TRACE_FUNCTION( "bookMenuKbdCB()" ); 440 TRACE_FUNCTION( "bookMenuKbdCB()" );
455 441
456 /* handle the keypress 442 /* handle the keypress
457 */ 443 */
458 switch (k->code) 444 switch (k->code)
459 { 445 {
460 case KCD_MNUUP: 446 case KCD_MNUUP:
461 { 447 {
462 // keypadLock will not activate anymore 448 // keypadLock will not activate anymore
463 data->status_of_timer = TRUE; 449 data->status_of_timer = TRUE;
464 /* Update the window with the previous element 450 /* Update the window with the previous element
465 */ 451 */
466 mnuUp( data->menu ); 452 mnuUp( data->menu );
467 /* 453 /*
468 Special case when setting up ringer volume, the current ringer 454 Special case when setting up ringer volume, the current ringer
469 is played as user scrolls the volume settings Silent -> cresendo. 455 is played as user scrolls the volume settings Silent -> cresendo.
470 MZ. 456 MZ.
471 */ 457 */
472 /* RAVI - 20-1-2006 */ 458 /* RAVI - 20-1-2006 */
473 #ifdef NEPTUNE_BOARD 459 #ifdef NEPTUNE_BOARD
474 if (getSoundsReason () == SettingVolume) 460 if (getSoundsReason () == SettingVolume)
475 { 461 {
476 volumeMenuScrollUp(); 462 volumeMenuScrollUp();
477 } 463 }
478 #endif 464 #endif
479 /* END RAVI */ 465 /* END RAVI */
480 466
481 if(getScrollSelectMenuItem() == TRUE ||(getSoundsReason() == SettingVolume) ) 467 if(getScrollSelectMenuItem() == TRUE ||(getSoundsReason() == SettingVolume) )
482 { 468 {
483 mnuSelect(data->menu); 469 mnuSelect(data->menu);
484 /* Scroll up in volume setting */ 470 /* Scroll up in volume setting */
485 restartVolSettingInactivityTimer(); 471 restartVolSettingInactivityTimer();
486 } 472 }
487 } 473 }
488 break; 474 break;
489 475
490 case KCD_MNUDOWN: 476 case KCD_MNUDOWN:
491 { 477 {
492 // keypadLock will not activate anymore 478 // keypadLock will not activate anymore
493 data->status_of_timer = TRUE; 479 data->status_of_timer = TRUE;
494 /* Update the window with the next element 480 /* Update the window with the next element
495 */ 481 */
496 mnuDown( data->menu ); 482 mnuDown( data->menu );
497 483
498 /* 484 /*
499 Special case when setting up ringer volume, the current ringer 485 Special case when setting up ringer volume, the current ringer
500 is played as user scrolls the volume settings Silent -> cresendo. 486 is played as user scrolls the volume settings Silent -> cresendo.
501 MZ. 487 MZ.
502 */ 488 */
503 /* RAVI - 20-1-2006 */ 489 /* RAVI - 20-1-2006 */
504 #ifdef NEPTUNE_BOARD 490 #ifdef NEPTUNE_BOARD
505 if (getSoundsReason () == SettingVolume) 491 if (getSoundsReason () == SettingVolume)
506 { 492 {
507 volumeMenuScrollDown(); 493 volumeMenuScrollDown();
508 } 494 }
509 #endif 495 #endif
510 /* END RAVI */ 496 /* END RAVI */
511 497
512 if((getScrollSelectMenuItem() == TRUE) || (getSoundsReason() == SettingVolume)) 498 if((getScrollSelectMenuItem() == TRUE) || (getSoundsReason() == SettingVolume))
513 { 499 {
514 mnuSelect(data->menu); 500 mnuSelect(data->menu);
515 restartVolSettingInactivityTimer(); 501 restartVolSettingInactivityTimer();
516 } 502 }
517 503
518 } 504 }
519 break; 505 break;
520 506
521 case KCD_MNUSELECT: 507 case KCD_MNUSELECT:
522 case KCD_LEFT: 508 case KCD_LEFT:
523 { 509 {
524 // keypadLock will not activate anymore 510 // keypadLock will not activate anymore
525 data->status_of_timer = TRUE; 511 data->status_of_timer = TRUE;
526 512
527 // Select this element 513 // Select this element
528 mnuSelect( data->menu ); 514 mnuSelect( data->menu );
529 /*30 Mar 2007 a0393213 (R.Prabakar) 515 /*30 Mar 2007 a0393213 (R.Prabakar)
530 OMAPS00123019 ( Reboot of the target when you unplug/plug USB cable using camera application) 516 OMAPS00123019 ( Reboot of the target when you unplug/plug USB cable using camera application)
531 The usb enumeration option window has to be destroyed automatically once the user selects an option. 517 The usb enumeration option window has to be destroyed automatically once the user selects an option.
532 Earlier the menu was destroyed in the menu select call back function (mmi_usb_enumeration) and the same menu was 518 Earlier the menu was destroyed in the menu select call back function (mmi_usb_enumeration) and the same menu was
533 accesed further in this function. This was resulting in crash. 519 accesed further in this function. This was resulting in crash.
534 Now the menu is destroyed in this function and returned immediately. 520 Now the menu is destroyed in this function and returned immediately.
535 */ 521 */
536 #ifdef FF_MMI_USBMS 522 #ifdef FF_MMI_USBMS
537 if(usb_opt_win && 523 if(usb_opt_win &&
538 data->menu==((tBookStandard*)(((MfwWin*)(((T_MFW_HDR *)usb_opt_win)->data))->user))->menu) 524 data->menu==((tBookStandard*)(((MfwWin*)(((T_MFW_HDR *)usb_opt_win)->data))->user))->menu)
539 { 525 {
540 bookMenuDestroy(usb_opt_win); 526 bookMenuDestroy(usb_opt_win);
541 usb_opt_win=NULL; 527 usb_opt_win=NULL;
542 break; 528 break;
543 } 529 }
544 #endif 530 #endif
545 mnu = (MfwMnu *) mfwControl( data->menu ); 531 mnu = (MfwMnu *) mfwControl( data->menu );
546 532
547 if (mnu != NULL) 533 if (mnu != NULL)
548 { 534 {
549 if (mnu->curAttr != NULL) 535 if (mnu->curAttr != NULL)
550 { 536 {
551 // API - 24-01-03 - 1606 - Soft Key updating add this win Focus check 537 // API - 24-01-03 - 1606 - Soft Key updating add this win Focus check
552 if( winIsFocussed(window) ) 538 if( winIsFocussed(window) )
553 softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, mnu->curAttr->mnuColour); 539 softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, mnu->curAttr->mnuColour);
554 } 540 }
555 } 541 }
556 542
557 // A volume or tone setting menu has been entered. MZ 2/4/01 543 // A volume or tone setting menu has been entered. MZ 2/4/01
558 if((getScrollSelectMenuItem() == TRUE) || (getSoundsReason() == SettingVolume)) 544 if((getScrollSelectMenuItem() == TRUE) || (getSoundsReason() == SettingVolume))
559 { 545 {
560 TRACE_FUNCTION("@@@@ A volume or tone settin"); 546 TRACE_FUNCTION("@@@@ A volume or tone settin");
561 547
562 /* 548 /*
563 First time pcm flag is false, subsequent selection of menu item 549 First time pcm flag is false, subsequent selection of menu item
564 will select and terminate the volume settings menu. 3/4/01 MZ. 550 will select and terminate the volume settings menu. 3/4/01 MZ.
565 */ 551 */
566 if(storeSelectedItemToPcm ==TRUE || getSoundsReason() == SettingVolume ) 552 if(storeSelectedItemToPcm ==TRUE || getSoundsReason() == SettingVolume )
567 { 553 {
568 clearScrollSelectMenuItem(); 554 clearScrollSelectMenuItem();
569 volMenuItemSelected(); 555 volMenuItemSelected();
570 storeSelectedItemToPcm =FALSE; 556 storeSelectedItemToPcm =FALSE;
571 mnuEscape( data->menu ); 557 mnuEscape( data->menu );
572 if(getSoundsReason() == SettingVolume) 558 if(getSoundsReason() == SettingVolume)
573 { 559 {
574 setSoundsReason(SoundsNone); 560 setSoundsReason(SoundsNone);
575 stopRingerVolSettingInactivityTimer(); 561 stopRingerVolSettingInactivityTimer();
576 } 562 }
577 //Apr 05, 2005 REF: ENH 29994 xdeepadh 563 //Apr 05, 2005 REF: ENH 29994 xdeepadh
578 #ifdef FF_MIDI_RINGER 564 #ifdef FF_MIDI_RINGER
579 //Delete the timer for volume scrolling 565 //Delete the timer for volume scrolling
580 if(hPlayerStartTimer!=NULL) 566 if(hPlayerStartTimer!=NULL)
581 timDelete(hPlayerStartTimer); 567 timDelete(hPlayerStartTimer);
582 #endif 568 #endif
583 break; 569 break;
584 } 570 }
585 /* 571 /*
586 Second time the left soft key is used, store the setting in pcm and terminate the 572 Second time the left soft key is used, store the setting in pcm and terminate the
587 volume settings menu. 573 volume settings menu.
588 */ 574 */
589 storeSelectedItemToPcm =TRUE; 575 storeSelectedItemToPcm =TRUE;
590 576
591 } 577 }
592 } 578 }
593 break; 579 break;
594 580
595 // POWER key takes us to idle screen. 581 // POWER key takes us to idle screen.
596 case KCD_POWER: 582 case KCD_POWER:
597 data->status_of_timer = TRUE; 583 data->status_of_timer = TRUE;
598 584
599 HUPKeyOrigin = 0; // sbh - we're coming from the menu screen, so don't shut down right away 585 HUPKeyOrigin = 0; // sbh - we're coming from the menu screen, so don't shut down right away
600 586
601 //return to idle screen 587 //return to idle screen
602 588
603 if (data->Callback) 589 if (data->Callback)
604 (data->Callback) (data->parent_win, NULL, NULL); 590 (data->Callback) (data->parent_win, NULL, NULL);
605 591
606 bookMenuDestroy(data->win); 592 bookMenuDestroy(data->win);
607 stopRingerVolSettingInactivityTimer(); 593 stopRingerVolSettingInactivityTimer();
608 594
609 SEND_EVENT(idle_get_window(), IDLE_UPDATE, 0, 0); 595 SEND_EVENT(idle_get_window(), IDLE_UPDATE, 0, 0);
610 break; 596 break;
611 597
612 case KCD_RIGHT: 598 case KCD_RIGHT:
613 case KCD_HUP: 599 case KCD_HUP:
614 { 600 {
615 // keypadLock will not activate anymore 601 // keypadLock will not activate anymore
616 data->status_of_timer = TRUE; 602 data->status_of_timer = TRUE;
617 603
618 // Sep 01, 2005 REF: CRR 32707 x0021334 604 // Sep 01, 2005 REF: CRR 32707 x0021334
619 // Set storeSelectedItemToPcm to FALSE to enable proper operation every time instead of 605 // Set storeSelectedItemToPcm to FALSE to enable proper operation every time instead of
620 // handling it in alterate attempts. 606 // handling it in alterate attempts.
621 storeSelectedItemToPcm = FALSE; 607 storeSelectedItemToPcm = FALSE;
622 608
623 HUPKeyOrigin = 0; // sbh - we're coming from the menu screen, so don't shut down right away 609 HUPKeyOrigin = 0; // sbh - we're coming from the menu screen, so don't shut down right away
624 610
625 /* get us out of here 611 /* get us out of here
626 */ 612 */
627 mnuEscape( data->menu ); 613 mnuEscape( data->menu );
628 mnu = (MfwMnu *) mfwControl( data->menu ); 614 mnu = (MfwMnu *) mfwControl( data->menu );
629 if (mnu != NULL) 615 if (mnu != NULL)
630 { 616 {
631 if (mnu->curAttr != NULL) 617 if (mnu->curAttr != NULL)
632 { 618 {
633 // API - 24-01-03 - 1606 - Soft Key updating add this win Focus check 619 // API - 24-01-03 - 1606 - Soft Key updating add this win Focus check
634 if( winIsFocussed(window) ) 620 if( winIsFocussed(window) )
635 softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, mnu->curAttr->mnuColour); 621 softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, mnu->curAttr->mnuColour);
636 } 622 }
637 } 623 }
638 624
639 // Return the menu scroll behavior to normal. 625 // Return the menu scroll behavior to normal.
640 if(getScrollSelectMenuItem() == TRUE) 626 if(getScrollSelectMenuItem() == TRUE)
641 { 627 {
642 clearScrollSelectMenuItem(); 628 clearScrollSelectMenuItem();
643 } 629 }
644 /* 630 /*
645 If user exits the volume settings menu from the Idle or Incoming call screen. 631 If user exits the volume settings menu from the Idle or Incoming call screen.
646 clear the soundsReason. 632 clear the soundsReason.
647 */ 633 */
648 if(getSoundsReason() == SettingVolume) 634 if(getSoundsReason() == SettingVolume)
649 { 635 {
650 /* RAVI - 20-1-2006 */ 636 /* RAVI - 20-1-2006 */
651 #ifdef NEPTUNE_BOARD 637 #ifdef NEPTUNE_BOARD
652 /* Restore the volume setting */ 638 /* Restore the volume setting */
653 restorePreviousVolumeSetting (); 639 restorePreviousVolumeSetting ();
654 #endif 640 #endif
655 /* END RAVI */ 641 /* END RAVI */
656 stopRingerVolSettingInactivityTimer(); 642 stopRingerVolSettingInactivityTimer();
657 setSoundsReason(SoundsNone); 643 setSoundsReason(SoundsNone);
658 //Apr 05, 2005 REF: ENH 29994 xdeepadh 644 //Apr 05, 2005 REF: ENH 29994 xdeepadh
659 #ifdef FF_MIDI_RINGER 645 #ifdef FF_MIDI_RINGER
660 //Delete teh timer for volume scrolling 646 //Delete teh timer for volume scrolling
661 if(hPlayerStartTimer!=NULL) 647 if(hPlayerStartTimer!=NULL)
662 timDelete(hPlayerStartTimer); 648 timDelete(hPlayerStartTimer);
663 #endif 649 #endif
664 } 650 }
665 651
666 } 652 }
667 break; 653 break;
668 654
669 case KCD_STAR: 655 case KCD_STAR:
670 { 656 {
671 657
672 /* 658 /*
673 * Keypadlock will lock only 659 * Keypadlock will lock only
674 * within two seconds by press "*" 660 * within two seconds by press "*"
675 */ 661 */
676 662
677 if(data->status_of_timer EQ FALSE) 663 if(data->status_of_timer EQ FALSE)
678 { 664 {
679 TRACE_EVENT ("activate KEYpadLOCK"); 665 TRACE_EVENT ("activate KEYpadLOCK");
680 mnuEscape( data->menu ); 666 mnuEscape( data->menu );
681 settingsKeyPadLockOn (); 667 settingsKeyPadLockOn ();
682 } 668 }
683 669
684 /* SPR#1608 - SH - Otherwise, send '*' keypress to idle screen */ 670 /* SPR#1608 - SH - Otherwise, send '*' keypress to idle screen */
685 671
686 else if (window == data->phbk->menu_main_win) 672 else if (window == data->phbk->menu_main_win)
687 { 673 {
688 /* Number key presses in phonebook menu returns user to idle screen, 674 /* Number key presses in phonebook menu returns user to idle screen,
689 add key press to Idle edit screen. */ 675 add key press to Idle edit screen. */
690 676
691 keycode = k->code; 677 keycode = k->code;
692 678
693 bookMenuDestroy(data->win); 679 bookMenuDestroy(data->win);
694 680
695 SEND_EVENT(idle_get_window(), IDLE_START_DIALLING_NUMBER, 0, &keycode); 681 SEND_EVENT(idle_get_window(), IDLE_START_DIALLING_NUMBER, 0, &keycode);
696 } 682 }
697 } 683 }
698 break; 684 break;
699 685
700 case KCD_HASH: 686 case KCD_HASH:
701 { 687 {
702 /* 688 /*
703 * Keypadlock will lock only 689 * Keypadlock will lock only
704 * within two seconds by press "*" 690 * within two seconds by press "*"
705 */ 691 */
706 if(data->status_of_timer EQ FALSE) 692 if(data->status_of_timer EQ FALSE)
707 { 693 {
708 TRACE_EVENT ("activate Silent mode"); 694 TRACE_EVENT ("activate Silent mode");
709 695
710 if(FFS_flashData.settings_status & SettingsSilentMode) 696 if(FFS_flashData.settings_status & SettingsSilentMode)
711 { 697 {
712 settingsSilentModeOff(); 698 settingsSilentModeOff();
713 } 699 }
714 else 700 else
715 { 701 {
716 settingsSilentModeOn(); 702 settingsSilentModeOn();
717 } 703 }
718 mnuEscape( data->menu ); 704 mnuEscape( data->menu );
719 } 705 }
720 706
721 /* SPR#1608 - SH - Otherwise, send '#' keypress to idle screen */ 707 /* SPR#1608 - SH - Otherwise, send '#' keypress to idle screen */
722 708
723 else if (window == data->phbk->menu_main_win) 709 else if (window == data->phbk->menu_main_win)
724 { 710 {
725 /* Number key presses in phonebook menu returns user to idle screen, 711 /* Number key presses in phonebook menu returns user to idle screen,
726 add key press to Idle edit screen. */ 712 add key press to Idle edit screen. */
727 713
728 keycode = k->code; 714 keycode = k->code;
729 715
730 bookMenuDestroy(data->win); 716 bookMenuDestroy(data->win);
731 717
732 SEND_EVENT(idle_get_window(), IDLE_START_DIALLING_NUMBER, 0, &keycode); 718 SEND_EVENT(idle_get_window(), IDLE_START_DIALLING_NUMBER, 0, &keycode);
733 } 719 }
734 } 720 }
735 break; 721 break;
736 722
737 default: 723 default:
738 { 724 {
739 TRACE_EVENT("bookMenuKbdCb - DEFAULT!"); 725 TRACE_EVENT("bookMenuKbdCb - DEFAULT!");
740 /* SH - only allow dialling if we are in the main menu */ 726 /* SH - only allow dialling if we are in the main menu */
741 if (window == data->phbk->menu_main_win) 727 if (window == data->phbk->menu_main_win)
742 { 728 {
743 /* keypadLock will not activate anymore */ 729 /* keypadLock will not activate anymore */
744 data->status_of_timer = TRUE; 730 data->status_of_timer = TRUE;
745 731
746 /* Number key presses in phonebook menu returns user to idle screen, 732 /* Number key presses in phonebook menu returns user to idle screen,
747 add key press to Idle edit screen. */ 733 add key press to Idle edit screen. */
748 734
749 keycode = k->code; 735 keycode = k->code;
750 736
751 bookMenuDestroy(data->win); 737 bookMenuDestroy(data->win);
752 738
753 /* x0045876, 14-Aug-2006 (WR - pointless comparison of unsigned integer with zero) */ 739 /* x0045876, 14-Aug-2006 (WR - pointless comparison of unsigned integer with zero) */
754 /* if ((k->code>=KCD_0 && k->code<=KCD_9)) */ 740 /* if ((k->code>=KCD_0 && k->code<=KCD_9)) */
755 if (k->code<=KCD_9) 741 if (k->code<=KCD_9)
756 { 742 {
757 TRACE_EVENT("Idle Editor Start!"); 743 TRACE_EVENT("Idle Editor Start!");
758 SEND_EVENT(idle_get_window(), IDLE_START_DIALLING_NUMBER, 0, &keycode); 744 SEND_EVENT(idle_get_window(), IDLE_START_DIALLING_NUMBER, 0, &keycode);
759 } 745 }
760 } 746 }
761 } 747 }
762 break; 748 break;
763 } 749 }
764 750
765 /* always consume the event 751 /* always consume the event
766 */ 752 */
767 return MFW_EVENT_CONSUMED; 753 return MFW_EVENT_CONSUMED;
768 } 754 }
769 755
770 756
771 757 /*******************************************************************************
772 758
773 759 $Function: bookMenuKbdLongCB
774 760
775 761 $Description: keyboard long press event handler
776 /******************************************************************************* 762
777 763 $Returns: MFW_EVENT_CONSUMED always
778 $Function: bookMenuKbdLongCB 764
779 765 $Arguments: e, event, k, key handle
780 $Description: keyboard long press event handler
781
782 $Returns: MFW_EVENT_CONSUMED always
783
784 $Arguments: e, event, k, key handle
785 766
786 *******************************************************************************/ 767 *******************************************************************************/
787 768
788 static int bookMenuKbdLongCB( MfwEvt e, MfwKbd *k ) 769 static int bookMenuKbdLongCB( MfwEvt e, MfwKbd *k )
789 { 770 {
790 T_MFW_HND window = mfwParent( mfw_header() ); 771 T_MFW_HND window = mfwParent( mfw_header() );
791 T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data; 772 T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data;
792 tBookStandard *data = (tBookStandard *) win_data->user; 773 tBookStandard *data = (tBookStandard *) win_data->user;
793 774
794 TRACE_FUNCTION( "bookMenuKbdLongCB()" ); 775 TRACE_FUNCTION( "bookMenuKbdLongCB()" );
795 776
796 if ( ( e & KEY_CLEAR ) && ( e & KEY_LONG ) ) 777 if ( ( e & KEY_CLEAR ) && ( e & KEY_LONG ) )
797 { mnuEscape( data->menu ); 778 { mnuEscape( data->menu );
798 return MFW_EVENT_CONSUMED; 779 return MFW_EVENT_CONSUMED;
799 } 780 }
800 /*if long press on END key*/ 781 /*if long press on END key*/
801 if ( ( e & KEY_HUP) && ( e & KEY_LONG ) ) 782 if ( ( e & KEY_HUP) && ( e & KEY_LONG ) )
802 { 783 {
803 U8 keycode; 784 U8 keycode;
804 U8 uMode; 785 U8 uMode;
805 uMode = dspl_Enable(0); 786 uMode = dspl_Enable(0);
806 787
807 // keypadLock will not activate anymore 788 // keypadLock will not activate anymore
808 data->status_of_timer = TRUE; 789 data->status_of_timer = TRUE;
809 790
810 //return to idle screen 791 //return to idle screen
811 792
812 keycode = k->code; 793 keycode = k->code;
813 794
814 if (data->Callback) 795 if (data->Callback)
815 (data->Callback) (data->parent_win, NULL, NULL); 796 (data->Callback) (data->parent_win, NULL, NULL);
816 797
817 bookMenuDestroy(data->win); 798 bookMenuDestroy(data->win);
818 stopRingerVolSettingInactivityTimer(); 799 stopRingerVolSettingInactivityTimer();
819 800
820 SEND_EVENT(idle_get_window(), IDLE_UPDATE, 0, &keycode); 801 SEND_EVENT(idle_get_window(), IDLE_UPDATE, 0, &keycode);
821 802
822 dspl_Enable(uMode); 803 dspl_Enable(uMode);
823 } 804 }
824 805
825 return MFW_EVENT_CONSUMED; 806 return MFW_EVENT_CONSUMED;
826 } 807 }
827 808
828 809
829 810 /*******************************************************************************
830 811
831 812 $Function: bookMenuCreate
832 813
833 /******************************************************************************* 814 $Description: Create the menu window
834 815
835 $Function: bookMenuCreate 816 $Returns: handle of newly created window, or NULL if error
836 817
837 $Description: Create the menu window 818 $Arguments: parent, handle of the parent window
838
839 $Returns: handle of newly created window, or NULL if error
840
841 $Arguments: parent, handle of the parent window
842 819
843 *******************************************************************************/ 820 *******************************************************************************/
844 821
845 static T_MFW_HND bookMenuCreate( MfwHnd parent ) 822 static T_MFW_HND bookMenuCreate( MfwHnd parent )
846 { 823 {
847 T_MFW_WIN *parent_win_data = ( (T_MFW_HDR *) parent )->data; 824 T_MFW_WIN *parent_win_data = ( (T_MFW_HDR *) parent )->data;
848 T_phbk *phbk = (T_phbk *)parent_win_data->user; 825 T_phbk *phbk = (T_phbk *)parent_win_data->user;
849 T_MFW_WIN *win_data; 826 T_MFW_WIN *win_data;
850 tBookStandard *data; 827 tBookStandard *data;
851 828
852 TRACE_FUNCTION( "bookMenuCreate()" ); 829 TRACE_FUNCTION( "bookMenuCreate()" );
853 830
854 /* allocate memory for our control block 831 /* allocate memory for our control block
855 */ 832 */
856 if ( ( data = (tBookStandard *) ALLOC_MEMORY( sizeof( tBookStandard ) ) ) == NULL ) 833 if ( ( data = (tBookStandard *) ALLOC_MEMORY( sizeof( tBookStandard ) ) ) == NULL )
857 return NULL; 834 return NULL;
858 835
859 /* Create the window if we can 836 /* Create the window if we can
860 */ 837 */
861 if ( ( data->win = win_create( parent, 0, E_WIN_VISIBLE, (T_MFW_CB) bookMenuWindowCB ) ) == NULL ) 838 if ( ( data->win = win_create( parent, 0, E_WIN_VISIBLE, (T_MFW_CB) bookMenuWindowCB ) ) == NULL )
862 { 839 {
863 FREE_MEMORY( (void *)data, sizeof( tBookStandard ) ); 840 FREE_MEMORY( (void *)data, sizeof( tBookStandard ) );
864 return NULL; 841 return NULL;
865 } 842 }
866 843
867 /* Okay, we have created the control block and the window, so 844 /* Okay, we have created the control block and the window, so
868 we now need to configure the dialog and data pointers 845 we now need to configure the dialog and data pointers
869 */ 846 */
870 data->mmi_control.dialog = (T_DIALOG_FUNC) bookMenuDialog; 847 data->mmi_control.dialog = (T_DIALOG_FUNC) bookMenuDialog;
871 data->mmi_control.data = data; 848 data->mmi_control.data = data;
872 win_data = ((T_MFW_HDR *)data->win)->data; 849 win_data = ((T_MFW_HDR *)data->win)->data;
873 win_data->user = (void *) data; 850 win_data->user = (void *) data;
874 data->phbk = phbk; 851 data->phbk = phbk;
875 data->parent_win = parent; 852 data->parent_win = parent;
876 853
877 /* create keyboards and menus for our window 854 /* create keyboards and menus for our window
878 */ 855 */
879 data->kbd = kbdCreate ( data->win, KEY_ALL, (MfwCb) bookMenuKbdCB ); 856 data->kbd = kbdCreate ( data->win, KEY_ALL, (MfwCb) bookMenuKbdCB );
880 data->kbd_long = kbdCreate ( data->win, KEY_ALL | KEY_LONG, (MfwCb) bookMenuKbdLongCB ); 857 data->kbd_long = kbdCreate ( data->win, KEY_ALL | KEY_LONG, (MfwCb) bookMenuKbdLongCB );
881 data->menu_tim = tim_create (data->win, THREE_SECS, (MfwCb) bookMenuTimCB); 858 data->menu_tim = tim_create (data->win, THREE_SECS, (MfwCb) bookMenuTimCB);
882 859
883 data->Callback = NULL; // Use standard menu callback (changed by sending event ADD_CALLBACK) 860 data->Callback = NULL; // Use standard menu callback (changed by sending event ADD_CALLBACK)
884 861
885 /* And return the handle of the newly created window 862 /* And return the handle of the newly created window
886 */ 863 */
887 return data->win; 864 return data->win;
888 } 865 }
889 866
890 867
891
892
893
894 /******************************************************************************* 868 /*******************************************************************************
895 869
896 Public Methods 870 Public Methods
897 871
898 *******************************************************************************/ 872 *******************************************************************************/
899 873
900 /******************************************************************************* 874 /*******************************************************************************
901 875
902 $Function: bookMenuStart 876 $Function: bookMenuStart
903 877
904 $Description: tbd 878 $Description: tbd
905 879
906 $Returns: tbd 880 $Returns: tbd
907 881
908 $Arguments: tbd 882 $Arguments: tbd
909 883
910 *******************************************************************************/ 884 *******************************************************************************/
911 885
912 T_MFW_HND bookMenuStart( MfwHnd parent, MfwMnuAttr *menuAttr,SHORT reason ) 886 T_MFW_HND bookMenuStart( MfwHnd parent, MfwMnuAttr *menuAttr,SHORT reason )
913 { 887 {
914 T_MFW_HND win; 888 T_MFW_HND win;
915 889
916 win = bookMenuCreate( parent ); 890 win = bookMenuCreate( parent );
917 891
918 if ( win != NULL ) 892 if ( win != NULL )
919 SEND_EVENT( win, MENU_INIT, reason, (MfwMnuAttr *) menuAttr ); 893 SEND_EVENT( win, MENU_INIT, reason, (MfwMnuAttr *) menuAttr );
920 return win; 894 return win;
921 } 895 }
922 896
923 897
924 898 /*******************************************************************************
925 /******************************************************************************* 899
926 900 $Function: bookMenuDestroy
927 $Function: bookMenuDestroy 901
928 902 $Description: Destroy the menu window
929 $Description: Destroy the menu window 903
930 904 $Returns: none
931 $Returns: none 905
932 906 $Arguments: window, handle of the window being destroyed
933 $Arguments: window, handle of the window being destroyed
934 907
935 *******************************************************************************/ 908 *******************************************************************************/
936 909
937 void bookMenuDestroy( MfwHnd window ) 910 void bookMenuDestroy( MfwHnd window )
938 { 911 {
939 T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data; 912 T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data;
940 tBookStandard *data = (tBookStandard *) win_data->user; 913 tBookStandard *data = (tBookStandard *) win_data->user;
941 char test_string[40]; 914 char test_string[40];
942 915
943 TRACE_FUNCTION( "bookMenuDestroy()" ); 916 TRACE_FUNCTION( "bookMenuDestroy()" );
944 917
945 if (window == NULL) 918 if (window == NULL)
946 { 919 {
947 TRACE_EVENT ("Error : Called with NULL Pointer"); 920 TRACE_EVENT ("Error : Called with NULL Pointer");
948 return; 921 return;
949 } 922 }
950 923
951 if ( data ) 924 if ( data )
952 { 925 {
953 926
954 /* If we have the root window here then we use the main phone 927 /* If we have the root window here then we use the main phone
955 book destroy method 928 book destroy method
956 */ 929 */
957 if ( data->phbk->root_win == window ) 930 if ( data->phbk->root_win == window )
958 { 931 {
959 bookPhonebookDestroy( data->phbk->win ); 932 bookPhonebookDestroy( data->phbk->win );
960 return; 933 return;
961 } 934 }
962 935
963 /* Otherwise clear down our pointers and free the current 936 /* Otherwise clear down our pointers and free the current
964 menu window structures 937 menu window structures
965 */ 938 */
966 if ( data->phbk->search_win == window ) 939 if ( data->phbk->search_win == window )
967 data->phbk->search_win = 0; 940 data->phbk->search_win = 0;
968 if ( data->phbk->menu_main_win == window ) 941 if ( data->phbk->menu_main_win == window )
969 data->phbk->menu_main_win = 0; 942 data->phbk->menu_main_win = 0;
970 if ( data->phbk->menu_options_win == window ) 943 if ( data->phbk->menu_options_win == window )
971 data->phbk->menu_options_win = 0; 944 data->phbk->menu_options_win = 0;
972 if ( data->phbk->menu_options_win_2 == window ) 945 if ( data->phbk->menu_options_win_2 == window )
973 data->phbk->menu_options_win_2 = 0; 946 data->phbk->menu_options_win_2 = 0;
974 if ( data->phbk->menu_call_options_win == window ) 947 if ( data->phbk->menu_call_options_win == window )
975 data->phbk->menu_call_options_win = 0; 948 data->phbk->menu_call_options_win = 0;
976 if ( data->phbk->menu_call_options_win_2 == window ) 949 if ( data->phbk->menu_call_options_win_2 == window )
977 data->phbk->menu_call_options_win_2 = 0; 950 data->phbk->menu_call_options_win_2 = 0;
978 951
979 winDelete( data->win ); 952 winDelete( data->win );
980 FREE_MEMORY( (void *)data, sizeof( tBookStandard ) ); 953 FREE_MEMORY( (void *)data, sizeof( tBookStandard ) );
981 sprintf(test_string, "Bookmenudestroy: %d", mfwCheckMemoryLeft()); 954 sprintf(test_string, "Bookmenudestroy: %d", mfwCheckMemoryLeft());
982 TRACE_EVENT(test_string); 955 TRACE_EVENT(test_string);
983 } 956 }
984 957
985 } 958 }
986 959
987 960
988
989
990
991
992 /******************************************************************************* 961 /*******************************************************************************
993 962
994 End of File 963 End of File
995 964
996 *******************************************************************************/ 965 *******************************************************************************/