comparison src/ui/bmi/mmiSoftKeys.c @ 92:c0052fe355d3

src/ui/bmi/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 08 Nov 2020 06:39:16 +0000
parents 67bfe9f274f6
children 717f87d300ae
comparison
equal deleted inserted replaced
91:c3d28a37caad 92:c0052fe355d3
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: Softkeys 14 $Module: Softkeys
15 $File: MmiSoftkeys.c 15 $File: MmiSoftkeys.c
16 $Revision: 1.0 16 $Revision: 1.0
17 17
18 $Author: Condat(UK) 18 $Author: Condat(UK)
19 $Date: 22/02/01 19 $Date: 22/02/01
20 20
21 ******************************************************************************** 21 ********************************************************************************
22 22
23 Description: 23 Description:
24 24
25 25
26 26
27 ******************************************************************************** 27 ********************************************************************************
28 28
29 $History: 29 $History:
30 30
31 xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 31 xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357
32 To display '?' to indicate to the user that help is available for a STK menu 32 To display '?' to indicate to the user that help is available for a STK menu
33 33
34 25/10/00 Original Condat(UK) BMI version. 34 25/10/00 Original Condat(UK) BMI version.
35 35
36 $End 36 $End
37 37
38 *******************************************************************************/ 38 *******************************************************************************/
39 39
40 40
41 /******************************************************************************* 41 /*******************************************************************************
42 42
43 Include Files 43 Include Files
44 44
45 *******************************************************************************/ 45 *******************************************************************************/
46 46
47 #define ENTITY_MFW 47 #define ENTITY_MFW
48 48
49 /* includes */ 49 /* includes */
347 MfwRect* rect; 347 MfwRect* rect;
348 } T_SK_DSPL_STRUCT; 348 } T_SK_DSPL_STRUCT;
349 349
350 /******************************************************************************* 350 /*******************************************************************************
351 351
352 $Function: 352 $Function:
353 353
354 $Description: 354 $Description:
355 355
356 $Returns: 356 $Returns:
357 357
358 $Arguments: 358 $Arguments:
359 359
360 $History 360 $History
361 GW 28/11/02 - 361 GW 28/11/02 -
362 362
363 *******************************************************************************/ 363 *******************************************************************************/
364 static void softKeys_displayAll(T_SK_DSPL_STRUCT* sk_data , int format, unsigned int colIndex ) 364 static void softKeys_displayAll(T_SK_DSPL_STRUCT* sk_data , int format, unsigned int colIndex )
365 { 365 {
366 resources_setSKColour(colIndex); 366 resources_setSKColour(colIndex);
367 // #ifdef COLOURDISPLAY 367 // #ifdef COLOURDISPLAY
368 dspl_Clear( sk_data->rect->px, 368 dspl_Clear( sk_data->rect->px,
369 sk_data->rect->py, 369 sk_data->rect->py,
370 sk_data->rect->px+sk_data->rect->sx-1, 370 sk_data->rect->px+sk_data->rect->sx-1,
371 sk_data->rect->py+sk_data->rect->sy-1); 371 sk_data->rect->py+sk_data->rect->sy-1);
372 /* Line height must be less than rect.sy */ 372 /* Line height must be less than rect.sy */
373 // #endif 373 // #endif
374 if (sk_data->lsk.str!= NULL) 374 if (sk_data->lsk.str!= NULL)
375 dspl_TextOut(sk_data->lsk.posX, sk_data->lsk.posY,DSPL_TXTATTR_CURRENT_MODE, sk_data->lsk.str); 375 dspl_TextOut(sk_data->lsk.posX, sk_data->lsk.posY,DSPL_TXTATTR_CURRENT_MODE, sk_data->lsk.str);
376 if (sk_data->rsk.str!= NULL) 376 if (sk_data->rsk.str!= NULL)
377 dspl_TextOut(sk_data->rsk.posX, sk_data->rsk.posY,DSPL_TXTATTR_CURRENT_MODE, sk_data->rsk.str); 377 dspl_TextOut(sk_data->rsk.posX, sk_data->rsk.posY,DSPL_TXTATTR_CURRENT_MODE, sk_data->rsk.str);
378 resources_restoreMnuColour(); 378 resources_restoreMnuColour();
379 } 379 }
380 380
381 /******************************************************************************* 381 /*******************************************************************************
382 382
383 $Function: 383 $Function:
384 384
385 $Description: 385 $Description:
386 386
387 $Returns: 387 $Returns:
388 388
389 $Arguments: 389 $Arguments:
390 390
391 $History 391 $History
392 GW 28/11/02 - 392 GW 28/11/02 -
393 393
394 *******************************************************************************/ 394 *******************************************************************************/
395 void softKeys_displayStrXY(char* leftSoftKey_str,char* rightSoftKey_str, int format, unsigned int colIndex, MfwRect* rect ) 395 void softKeys_displayStrXY(char* leftSoftKey_str,char* rightSoftKey_str, int format, unsigned int colIndex, MfwRect* rect )
396 { 396 {
397 MfwRect defRect; 397 MfwRect defRect;
398 398
399 T_SK_DSPL_STRUCT sk_data; 399 T_SK_DSPL_STRUCT sk_data;
400 sk_data.lsk.str = leftSoftKey_str; 400 sk_data.lsk.str = leftSoftKey_str;
401 sk_data.rsk.str = rightSoftKey_str; 401 sk_data.rsk.str = rightSoftKey_str;
402 if (rect != NULL) 402 if (rect != NULL)
403 sk_data.rect = rect; 403 sk_data.rect = rect;
404 else 404 else
405 { 405 {
406 Mmi_layout_softkeyArea( &defRect ); 406 Mmi_layout_softkeyArea( &defRect );
407 sk_data.rect = &defRect; 407 sk_data.rect = &defRect;
408 } 408 }
409 sk_data.lsk.posY = sk_data.rect->py + (sk_data.rect->sy-Mmi_layout_line_height())/2; 409 sk_data.lsk.posY = sk_data.rect->py + (sk_data.rect->sy-Mmi_layout_line_height())/2;
410 sk_data.rsk.posY = sk_data.lsk.posY; 410 sk_data.rsk.posY = sk_data.lsk.posY;
411 sk_data.lsk.posX = sk_data.rect->px+LeftMargin; 411 sk_data.lsk.posX = sk_data.rect->px+LeftMargin;
413 413
414 softKeys_displayAll( &sk_data , format, colIndex); 414 softKeys_displayAll( &sk_data , format, colIndex);
415 } 415 }
416 /******************************************************************************* 416 /*******************************************************************************
417 417
418 $Function: 418 $Function:
419 419
420 $Description: 420 $Description:
421 421
422 $Returns: 422 $Returns:
423 423
424 $Arguments: 424 $Arguments:
425 425
426 $History 426 $History
427 GW 28/11/02 - 427 GW 28/11/02 -
428 428
429 *******************************************************************************/ 429 *******************************************************************************/
430 void softKeys_displayStr(char* leftSoftKey_str,char* rightSoftKey_str, int format, int unsigned colIndex) 430 void softKeys_displayStr(char* leftSoftKey_str,char* rightSoftKey_str, int format, int unsigned colIndex)
431 { 431 {
432 softKeys_displayStrXY(leftSoftKey_str, rightSoftKey_str,format,colIndex, NULL); 432 softKeys_displayStrXY(leftSoftKey_str, rightSoftKey_str,format,colIndex, NULL);
433 } 433 }
434 434
435 /******************************************************************************* 435 /*******************************************************************************
436 436
437 $Function: 437 $Function:
438 438
439 $Description: 439 $Description:
440 440
441 $Returns: 441 $Returns:
442 442
443 $Arguments: 443 $Arguments:
444 444
445 $History 445 $History
446 GW 28/11/02 - 446 GW 28/11/02 -
447 447
448 *******************************************************************************/ 448 *******************************************************************************/
449 void softKeys_displayId(int leftSoftKey,int rightSoftKey, int format, unsigned int colIndex) 449 void softKeys_displayId(int leftSoftKey,int rightSoftKey, int format, unsigned int colIndex)
450 { 450 {
451 char *lsk,*rsk; 451 char *lsk,*rsk;
454 softKeys_displayStrXY(lsk,rsk,format,colIndex,NULL); 454 softKeys_displayStrXY(lsk,rsk,format,colIndex,NULL);
455 } 455 }
456 456
457 /******************************************************************************* 457 /*******************************************************************************
458 458
459 $Function: 459 $Function:
460 460
461 $Description: 461 $Description:
462 462
463 $Returns: 463 $Returns:
464 464
465 $Arguments: 465 $Arguments:
466 466
467 $History 467 $History
468 GW 28/11/02 - 468 GW 28/11/02 -
469 469
470 *******************************************************************************/ 470 *******************************************************************************/
471 //Old function - replace with calls to 'softKeys_displayId' 471 //Old function - replace with calls to 'softKeys_displayId'
472 //GW 28/11/02 - Removed commented out code 472 //GW 28/11/02 - Removed commented out code
473 void displaySoftKeys(int leftSoftKey,int rightSoftKey) 473 void displaySoftKeys(int leftSoftKey,int rightSoftKey)
478 softKeys_displayStrXY(lsk,rsk,0, COLOUR_LIST_SUBMENU, NULL); 478 softKeys_displayStrXY(lsk,rsk,0, COLOUR_LIST_SUBMENU, NULL);
479 } 479 }
480 480
481 /******************************************************************************* 481 /*******************************************************************************
482 482
483 $Function: 483 $Function:
484 484
485 $Description: 485 $Description:
486 486
487 $Returns: 487 $Returns:
488 488
489 $Arguments: 489 $Arguments:
490 490
491 $History 491 $History
492 GW 28/11/02 - 492 GW 28/11/02 -
493 493
494 *******************************************************************************/ 494 *******************************************************************************/
495 void displaySoftKeysXY(int leftSoftKey,int rightSoftKey,int lskX,int rskX, int lpos) 495 void displaySoftKeysXY(int leftSoftKey,int rightSoftKey,int lskX,int rskX, int lpos)
496 { 496 {
497 char *lsk,*rsk; 497 char *lsk,*rsk;
498 MfwRect rect; 498 MfwRect rect;
499 499
500 lsk = MmiRsrcGetText(leftSoftKey); 500 lsk = MmiRsrcGetText(leftSoftKey);
501 rsk = MmiRsrcGetText(rightSoftKey); 501 rsk = MmiRsrcGetText(rightSoftKey);
502 rect.px = lskX; 502 rect.px = lskX;
503 rect.py = lpos; 503 rect.py = lpos;
504 rect.sx = rskX-lskX; 504 rect.sx = rskX-lskX;
512 512
513 /******************************************************************************* 513 /*******************************************************************************
514 514
515 $Function: displaySoftKeys_edition 515 $Function: displaySoftKeys_edition
516 516
517 $Description: 517 $Description:
518 518
519 $Returns: 519 $Returns:
520 520
521 $Arguments: 521 $Arguments:
522 522
523 $History 523 $History
524 524
525 *******************************************************************************/ 525 *******************************************************************************/
526 void displaySoftKeys_edition(int leftSoftKey,int index, int rightSoftKey) 526 void displaySoftKeys_edition(int leftSoftKey,int index, int rightSoftKey)
527 { 527 {
528 char *lsk,*rsk, *ind; 528 char *lsk,*rsk, *ind;
529 USHORT lpos; 529 USHORT lpos;
530 530
531 lsk = MmiRsrcGetText(leftSoftKey); 531 lsk = MmiRsrcGetText(leftSoftKey);
532 ind = MmiRsrcGetText(index); 532 ind = MmiRsrcGetText(index);
533 rsk = MmiRsrcGetText(rightSoftKey); 533 rsk = MmiRsrcGetText(rightSoftKey);
534 lpos = Mmi_layout_line(SECOND_LAST_LINE_TOP); 534 lpos = Mmi_layout_line(SECOND_LAST_LINE_TOP);
535 535
544 /******************************************************************************* 544 /*******************************************************************************
545 545
546 $Function: displayCustSoftKeys 546 $Function: displayCustSoftKeys
547 547
548 $Description: Display softkeys with text strings instead of text ID's 548 $Description: Display softkeys with text strings instead of text ID's
549 549
550 $Returns: None 550 $Returns: None
551 551
552 $Arguments: LeftSoftKey - char array to be displayed at the bottom-left of the display 552 $Arguments: LeftSoftKey - char array to be displayed at the bottom-left of the display
553 or NULL if no string is to be displayed 553 or NULL if no string is to be displayed
554 RightSoftKey- char array to be displayed at the bottom-right of the display 554 RightSoftKey- char array to be displayed at the bottom-right of the display
555 or NULL if no string is to be displayed 555 or NULL if no string is to be displayed
556 556
557 $History 557 $History
558 GW 28/11/02 - 558 GW 28/11/02 -
559 559
560 *******************************************************************************/ 560 *******************************************************************************/
561 // SH - 25/5/01 561 // SH - 25/5/01
562 // This function provided for WAP, to allow the printing of custom softkeys 562 // This function provided for WAP, to allow the printing of custom softkeys
563 // from strings provided. 563 // from strings provided.
565 void displayCustSoftKeys(char *LeftSoftKey, char *RightSoftKey) 565 void displayCustSoftKeys(char *LeftSoftKey, char *RightSoftKey)
566 { 566 {
567 softKeys_displayStrXY(LeftSoftKey,RightSoftKey,0,COLOUR_LIST_MAIN, NULL); 567 softKeys_displayStrXY(LeftSoftKey,RightSoftKey,0,COLOUR_LIST_MAIN, NULL);
568 } 568 }
569 569
570 570
571 /******************************************************************************* 571 /*******************************************************************************
572 572
573 $Function: displayHelpSymbol 573 $Function: displayHelpSymbol
574 574
575 $Description: Displaying '?' to indicate to the user that help is available for a menu 575 $Description: Displaying '?' to indicate to the user that help is available for a menu
576 xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 576 xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357
577 577
578 $Returns: None 578 $Returns: None
579 579
580 $Arguments: None 580 $Arguments: None
581 *******************************************************************************/ 581 *******************************************************************************/
582 void displayHelpSymbol(void) 582 void displayHelpSymbol(void)
583 { 583 {
584 MfwRect defRect, rect; 584 MfwRect defRect, rect;
585 585
586 /* x0045876, 14-Aug-2006 (WR - "line_height" & "sk_data" was declared but never referenced) */ 586 /* x0045876, 14-Aug-2006 (WR - "line_height" & "sk_data" was declared but never referenced) */
587 /* U16 line_height; 587 /* U16 line_height;
588 T_SK_DSPL_STRUCT sk_data; */ 588 T_SK_DSPL_STRUCT sk_data; */
589 Mmi_layout_softkeyArea( &defRect ); 589 Mmi_layout_softkeyArea( &defRect );
590 rect.px = defRect.sx >> 1; 590 rect.px = defRect.sx >> 1;
591 rect.py = defRect.py + 4; 591 rect.py = defRect.py + 4;
592 resources_setSKColour(COLOUR_LIST_XX); 592 resources_setSKColour(COLOUR_LIST_XX);
593 //Display the symbol in the center between the softkeys 593 //Display the symbol in the center between the softkeys
594 dspl_TextOut(rect.px, rect.py, DSPL_TXTATTR_CURRENT_MODE, "?"); 594 dspl_TextOut(rect.px, rect.py, DSPL_TXTATTR_CURRENT_MODE, "?");
595 resources_restoreMnuColour(); 595 resources_restoreMnuColour();
619 619
620 $Function: displayCameraIcon 620 $Function: displayCameraIcon
621 621
622 $Description: Displaying Camera icon to indicate to the user that user can use the 622 $Description: Displaying Camera icon to indicate to the user that user can use the
623 menu select key to capture the image. 623 menu select key to capture the image.
624 624
625 $Returns: None 625 $Returns: None
626 626
627 $Arguments: None 627 $Arguments: None
628 *******************************************************************************/ 628 *******************************************************************************/
629 void displayCameraIcon(void) 629 void displayCameraIcon(void)
630 { 630 {
631 MfwRect rect; 631 MfwRect rect;
632 632
633 rect.px = (SCREEN_SIZE_X - ICON_WIDTH)/2; 633 rect.px = (SCREEN_SIZE_X - ICON_WIDTH)/2;
634 rect.py = ((SCREEN_SIZE_Y - ICON_HEIGHT) -((Mmi_layout_softkeyHeight() -ICON_HEIGHT)/2)); 634 rect.py = ((SCREEN_SIZE_Y - ICON_HEIGHT) -((Mmi_layout_softkeyHeight() -ICON_HEIGHT)/2));
635 rect.sx = ICON_WIDTH; 635 rect.sx = ICON_WIDTH;
636 rect.sy = ICON_HEIGHT; 636 rect.sy = ICON_HEIGHT;
637 637
638 resources_setSKColour(COLOUR_LIST_XX); 638 resources_setSKColour(COLOUR_LIST_XX);
729 729
730 $Function: displayCameraIcon 730 $Function: displayCameraIcon
731 731
732 $Description: Displaying Camera icon to indicate to the user that user can use the 732 $Description: Displaying Camera icon to indicate to the user that user can use the
733 menu select key to capture the image. 733 menu select key to capture the image.
734 734
735 $Returns: None 735 $Returns: None
736 736
737 $Arguments: None 737 $Arguments: None
738 *******************************************************************************/ 738 *******************************************************************************/
739 void displayMenuKeys(T_MENU_KEY key) 739 void displayMenuKeys(T_MENU_KEY key)
740 { 740 {
741 MfwRect rect; 741 MfwRect rect;
742 char * buf = NULL; 742 char * buf = NULL;
743 rect.px = (SCREEN_SIZE_X - ICON_WIDTH)/2; 743 rect.px = (SCREEN_SIZE_X - ICON_WIDTH)/2;
744 rect.py = ((SCREEN_SIZE_Y - ICON_HEIGHT) -((Mmi_layout_softkeyHeight() -MENU_ICON_HEIGHT)/2)); 744 rect.py = ((SCREEN_SIZE_Y - ICON_HEIGHT) -((Mmi_layout_softkeyHeight() -MENU_ICON_HEIGHT)/2));
745 rect.sx = MENU_ICON_WIDTH; 745 rect.sx = MENU_ICON_WIDTH;
746 rect.sy = MENU_ICON_HEIGHT; 746 rect.sy = MENU_ICON_HEIGHT;
747 resources_setSKColour(COLOUR_LIST_XX); 747 resources_setSKColour(COLOUR_LIST_XX);
748 //Display the symbol in the center between the softkeys 748 //Display the symbol in the center between the softkeys
760 case MENU_KEY_UP_DOWN_STOP: 760 case MENU_KEY_UP_DOWN_STOP:
761 buf = (char *)updownstop; 761 buf = (char *)updownstop;
762 break; 762 break;
763 case MENU_KEY_WAIT: 763 case MENU_KEY_WAIT:
764 buf = (char *)wait; 764 buf = (char *)wait;
765 break; 765 break;
766 } 766 }
767 dspl_Clear(rect.px, rect.py, rect.px+rect.sx-1,rect.py+rect.sy-1); 767 dspl_Clear(rect.px, rect.py, rect.px+rect.sx-1,rect.py+rect.sy-1);
768 dspl_BitBlt2(rect.px, rect.py, rect.sx,rect.sy,buf, 0,ICON_TYPE_256_COL); 768 dspl_BitBlt2(rect.px, rect.py, rect.sx,rect.sy,buf, 0,ICON_TYPE_256_COL);
769 resources_restoreMnuColour(); 769 resources_restoreMnuColour();
770 dspl_Enable(1); 770 dspl_Enable(1);