comparison src/ui/bmi/mmiSoftKeys.c @ 175:717f87d300ae

mmiSoftKeys.c: white space fixes
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 19 Jan 2021 03:24:01 +0000
parents c0052fe355d3
children 6486d17f0f25
comparison
equal deleted inserted replaced
174:6838be2e9067 175:717f87d300ae
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
25 24
26 25
27 ******************************************************************************** 26 ********************************************************************************
28 27
29 $History: 28 $History:
30 29
31 xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 30 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 31 To display '?' to indicate to the user that help is available for a STK menu
33 32
34 25/10/00 Original Condat(UK) BMI version. 33 25/10/00 Original Condat(UK) BMI version.
35 34
36 $End 35 $End
37 36
38 *******************************************************************************/ 37 *******************************************************************************/
39 38
146 * when the approrpiate key is pressed. Returns SOFTKEYS_CREATED when 145 * when the approrpiate key is pressed. Returns SOFTKEYS_CREATED when
147 * everything went fine, or SOFTKEYS_FAILURE on failure. 146 * everything went fine, or SOFTKEYS_FAILURE on failure.
148 */ 147 */
149 SoftKeysResult softKeysHndCreate( MfwHnd window, SoftKeysSetup *setup) 148 SoftKeysResult softKeysHndCreate( MfwHnd window, SoftKeysSetup *setup)
150 { 149 {
151 if( window == NULL || setup == NULL ) 150 if( window == NULL || setup == NULL )
152 { 151 {
153 return SOFTKEYS_FAILURE; 152 return SOFTKEYS_FAILURE;
154 } 153 }
155 154
156 return softKeysWinCreate( (MfwWin *)((MfwHdr *)window)->data, setup); 155 return softKeysWinCreate( (MfwWin *)((MfwHdr *)window)->data, setup);
157 } 156 }
158 157
159 158
160 SoftKeysResult softKeysWinCreate( MfwWin *window, SoftKeysSetup *setup) 159 SoftKeysResult softKeysWinCreate( MfwWin *window, SoftKeysSetup *setup)
161 { 160 {
210 * a ...CallBack. Returns SOFTKEYS_CHANGED when everything went fine, 209 * a ...CallBack. Returns SOFTKEYS_CHANGED when everything went fine,
211 * or SOFTKEYS_FAILURE on failure. 210 * or SOFTKEYS_FAILURE on failure.
212 */ 211 */
213 SoftKeysResult softKeysHndSet( MfwHnd window, SoftKeysSetup *changes) 212 SoftKeysResult softKeysHndSet( MfwHnd window, SoftKeysSetup *changes)
214 { 213 {
215 if( window == NULL || changes == NULL ) 214 if( window == NULL || changes == NULL )
216 { 215 {
217 return SOFTKEYS_FAILURE; 216 return SOFTKEYS_FAILURE;
218 } 217 }
219 218
220 return softKeysWinSet( (MfwWin *)((MfwHdr *)window)->data, changes); 219 return softKeysWinSet( (MfwWin *)((MfwHdr *)window)->data, changes);
221 } 220 }
222 221
223 222
224 SoftKeysResult softKeysWinSet( MfwWin *window, SoftKeysSetup *changes) 223 SoftKeysResult softKeysWinSet( MfwWin *window, SoftKeysSetup *changes)
225 { 224 {
281 /* 280 /*
282 * You will need to call this whenever <window> is updated. 281 * You will need to call this whenever <window> is updated.
283 */ 282 */
284 void softKeysHndUpdate(MfwHnd window) 283 void softKeysHndUpdate(MfwHnd window)
285 { 284 {
286 if( window == NULL ) 285 if( window == NULL )
287 { 286 {
288 return; 287 return;
289 } 288 }
290 289
291 softKeysWinUpdate((MfwWin *)((MfwHdr *)window)->data); 290 softKeysWinUpdate((MfwWin *)((MfwHdr *)window)->data);
292 } 291 }
293 292
294 293
295 void softKeysWinUpdate(MfwWin *window) 294 void softKeysWinUpdate(MfwWin *window)
296 { 295 {
311 /* 310 /*
312 * Deletes the softkeys for <window>. 311 * Deletes the softkeys for <window>.
313 */ 312 */
314 void softkeysHndDelete(MfwHnd window) 313 void softkeysHndDelete(MfwHnd window)
315 { 314 {
316 if( window == NULL ) 315 if( window == NULL )
317 { 316 {
318 return; 317 return;
319 } 318 }
320 319
321 softkeysWinDelete((MfwWin *)((MfwHdr *)window)->data); 320 softkeysWinDelete((MfwWin *)((MfwHdr *)window)->data);
322 } 321 }
323 322
324 323
325 void softkeysWinDelete(MfwWin *window) 324 void softkeysWinDelete(MfwWin *window)
326 { 325 {
334 kbdDelete(softKeys->leftKeyHandler); 333 kbdDelete(softKeys->leftKeyHandler);
335 kbdDelete(softKeys->rightKeyHandler); 334 kbdDelete(softKeys->rightKeyHandler);
336 335
337 FREE_MEMORY( (void *)softKeys, sizeof(SoftKeysData)); 336 FREE_MEMORY( (void *)softKeys, sizeof(SoftKeysData));
338 } 337 }
338
339 typedef struct { 339 typedef struct {
340 char* str; 340 char* str;
341 int posX; 341 int posX;
342 int posY; 342 int posY;
343 } T_SK_DATA; 343 } T_SK_DATA;
344
344 typedef struct { 345 typedef struct {
345 T_SK_DATA lsk; 346 T_SK_DATA lsk;
346 T_SK_DATA rsk; 347 T_SK_DATA rsk;
347 MfwRect* rect; 348 MfwRect* rect;
348 } T_SK_DSPL_STRUCT; 349 } T_SK_DSPL_STRUCT;
411 sk_data.lsk.posX = sk_data.rect->px+LeftMargin; 412 sk_data.lsk.posX = sk_data.rect->px+LeftMargin;
412 sk_data.rsk.posX = sk_data.rect->px+sk_data.rect->sx-RightMargin-dspl_GetTextExtent(sk_data.rsk.str, 0); 413 sk_data.rsk.posX = sk_data.rect->px+sk_data.rect->sx-RightMargin-dspl_GetTextExtent(sk_data.rsk.str, 0);
413 414
414 softKeys_displayAll( &sk_data , format, colIndex); 415 softKeys_displayAll( &sk_data , format, colIndex);
415 } 416 }
417
416 /******************************************************************************* 418 /*******************************************************************************
417 419
418 $Function: 420 $Function:
419 421
420 $Description: 422 $Description:
502 rect.px = lskX; 504 rect.px = lskX;
503 rect.py = lpos; 505 rect.py = lpos;
504 rect.sx = rskX-lskX; 506 rect.sx = rskX-lskX;
505 rect.sy = Mmi_layout_softkeyHeight(); 507 rect.sy = Mmi_layout_softkeyHeight();
506 softKeys_displayStrXY(lsk, rsk, 0,COLOUR_LIST_MAIN, &rect); 508 softKeys_displayStrXY(lsk, rsk, 0,COLOUR_LIST_MAIN, &rect);
507
508
509
510 } 509 }
511 510
512 511
513 /******************************************************************************* 512 /*******************************************************************************
514 513
535 534
536 dspl_TextOut(LeftMargin,lpos, 0,lsk); 535 dspl_TextOut(LeftMargin,lpos, 0,lsk);
537 536
538 dspl_TextOut( 5 + dspl_GetTextExtent(lsk, (USHORT)strlen(lsk)) ,lpos, 0, ind); 537 dspl_TextOut( 5 + dspl_GetTextExtent(lsk, (USHORT)strlen(lsk)) ,lpos, 0, ind);
539 538
540 dspl_TextOut((mmiScrX-1)-RightMargin-dspl_GetTextExtent(rsk, (USHORT)strlen(rsk)),lpos ,0, rsk); 539 dspl_TextOut((mmiScrX-1)-RightMargin-dspl_GetTextExtent(rsk, (USHORT)strlen(rsk)),lpos ,0, rsk);
541 } 540 }
542 541
543 542
544 /******************************************************************************* 543 /*******************************************************************************
545 544
546 $Function: displayCustSoftKeys 545 $Function: displayCustSoftKeys
547 546
548 $Description: Display softkeys with text strings instead of text ID's 547 $Description: Display softkeys with text strings instead of text ID's
549 548
550 $Returns: None 549 $Returns: None
551 550
552 $Arguments: LeftSoftKey - char array to be displayed at the bottom-left of the display 551 $Arguments: LeftSoftKey - char array to be displayed at the bottom-left of the display
553 or NULL if no string is to be displayed 552 or NULL if no string is to be displayed
554 RightSoftKey- char array to be displayed at the bottom-right of the display 553 RightSoftKey- char array to be displayed at the bottom-right of the display
555 or NULL if no string is to be displayed 554 or NULL if no string is to be displayed
556 555
557 $History 556 $History
558 GW 28/11/02 - 557 GW 28/11/02 -
559 558
560 *******************************************************************************/ 559 *******************************************************************************/
571 /******************************************************************************* 570 /*******************************************************************************
572 571
573 $Function: displayHelpSymbol 572 $Function: displayHelpSymbol
574 573
575 $Description: Displaying '?' to indicate to the user that help is available for a menu 574 $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 575 xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357
577 576
578 $Returns: None 577 $Returns: None
579 578
580 $Arguments: None 579 $Arguments: None
581 *******************************************************************************/ 580 *******************************************************************************/
591 rect.py = defRect.py + 4; 590 rect.py = defRect.py + 4;
592 resources_setSKColour(COLOUR_LIST_XX); 591 resources_setSKColour(COLOUR_LIST_XX);
593 //Display the symbol in the center between the softkeys 592 //Display the symbol in the center between the softkeys
594 dspl_TextOut(rect.px, rect.py, DSPL_TXTATTR_CURRENT_MODE, "?"); 593 dspl_TextOut(rect.px, rect.py, DSPL_TXTATTR_CURRENT_MODE, "?");
595 resources_restoreMnuColour(); 594 resources_restoreMnuColour();
596
597 } 595 }
598 596
599 597
600 #define ICON_WIDTH 20 598 #define ICON_WIDTH 20
601 #define ICON_HEIGHT 19 599 #define ICON_HEIGHT 19
618 /******************************************************************************* 616 /*******************************************************************************
619 617
620 $Function: displayCameraIcon 618 $Function: displayCameraIcon
621 619
622 $Description: Displaying Camera icon to indicate to the user that user can use the 620 $Description: Displaying Camera icon to indicate to the user that user can use the
623 menu select key to capture the image. 621 menu select key to capture the image.
624 622
625 $Returns: None 623 $Returns: None
626 624
627 $Arguments: None 625 $Arguments: None
628 *******************************************************************************/ 626 *******************************************************************************/
728 /******************************************************************************* 726 /*******************************************************************************
729 727
730 $Function: displayCameraIcon 728 $Function: displayCameraIcon
731 729
732 $Description: Displaying Camera icon to indicate to the user that user can use the 730 $Description: Displaying Camera icon to indicate to the user that user can use the
733 menu select key to capture the image. 731 menu select key to capture the image.
734 732
735 $Returns: None 733 $Returns: None
736 734
737 $Arguments: None 735 $Arguments: None
738 *******************************************************************************/ 736 *******************************************************************************/
769 resources_restoreMnuColour(); 767 resources_restoreMnuColour();
770 dspl_Enable(1); 768 dspl_Enable(1);
771 769
772 } 770 }
773 #endif 771 #endif
774
775