FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiDialogs.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 | 303704cf0701 |
comparison
equal
deleted
inserted
replaced
91:c3d28a37caad | 92:c0052fe355d3 |
---|---|
1 | 1 |
2 /******************************************************************************* | 2 /******************************************************************************* |
3 | 3 |
4 CONDAT (UK) | 4 CONDAT (UK) |
5 | 5 |
6 ******************************************************************************** | 6 ******************************************************************************** |
7 | 7 |
8 This software product is the property of Condat (UK) Ltd and may not be | 8 This software product is the property of Condat (UK) Ltd and may not be |
9 disclosed to any third party without the express permission of the owner. | 9 disclosed to any third party without the express permission of the owner. |
10 | 10 |
11 ******************************************************************************** | 11 ******************************************************************************** |
12 | 12 |
13 $Project name: Basic MMI | 13 $Project name: Basic MMI |
14 $Project code: BMI (6349) | 14 $Project code: BMI (6349) |
15 $Module: MmiDialogs | 15 $Module: MmiDialogs |
16 $File: MmiDialogs.c | 16 $File: MmiDialogs.c |
17 $Revision: 1.0 | 17 $Revision: 1.0 |
18 | 18 |
19 $Author: Condat(UK) | 19 $Author: Condat(UK) |
20 $Date: 25/10/00 | 20 $Date: 25/10/00 |
21 | 21 |
22 ******************************************************************************** | 22 ******************************************************************************** |
23 | 23 |
24 Description:MMI Information dialogue handling. | 24 Description:MMI Information dialogue handling. |
25 | 25 |
26 | 26 |
27 | 27 |
28 ******************************************************************************** | 28 ******************************************************************************** |
29 | 29 |
30 $History: MmiDialogs.c | 30 $History: MmiDialogs.c |
31 | 31 |
32 May 23, 2007 DR: OMAPS00127483 x0pleela | 32 May 23, 2007 DR: OMAPS00127483 x0pleela |
33 Description: Phonelock - Unable to unlock the phone during incoming call with ringer... | 33 Description: Phonelock - Unable to unlock the phone during incoming call with ringer... |
34 Solution: Made changes in the function dialog_info_win_resize_cb() to restart the ringer set for | 34 Solution: Made changes in the function dialog_info_win_resize_cb() to restart the ringer set for |
35 incoming call or alarm after thr phone is unlocked. | 35 incoming call or alarm after thr phone is unlocked. |
36 | 36 |
37 Apr 03, 2007 ER: OMAPS00122561 x0pleela | 37 Apr 03, 2007 ER: OMAPS00122561 x0pleela |
38 Description: [ACI] Phone lock feature has to be supported by ACI | 38 Description: [ACI] Phone lock feature has to be supported by ACI |
39 Solution: Phone Lock ER implementation | 39 Solution: Phone Lock ER implementation |
40 | 40 |
41 x0066814 06 Dec 2006, OMAPS00106825 | 41 x0066814 06 Dec 2006, OMAPS00106825 |
42 The window height calculation related to wrapping should be skipped when no | 42 The window height calculation related to wrapping should be skipped when no |
43 string wrapping is done | 43 string wrapping is done |
44 | 44 |
45 Mar 11, 2006 REF:DR:OMAPS00061467 x0035544 | 45 Mar 11, 2006 REF:DR:OMAPS00061467 x0035544 |
46 Description: 27.22.4.13.3 SET UP CALL (display of icons) fails. | 46 Description: 27.22.4.13.3 SET UP CALL (display of icons) fails. |
47 Solution: Assigned the default values for icon data for the structure display_info in the function | 47 Solution: Assigned the default values for icon data for the structure display_info in the function |
48 dlg_zeroDisplayData(). copied icon data in to the structure data->IconData and provided functionality | 48 dlg_zeroDisplayData(). copied icon data in to the structure data->IconData and provided functionality |
49 in the function dialog_info_win_resize_cb() to display icon data appropriately on the dialog screen for SAT | 49 in the function dialog_info_win_resize_cb() to display icon data appropriately on the dialog screen for SAT |
50 call setup. | 50 call setup. |
51 | 51 |
52 Sep 06 2005 REF: MMI-SPR-33548 x0012849 Jagan | 52 Sep 06 2005 REF: MMI-SPR-33548 x0012849 Jagan |
53 Description : A dialog with long message is not displayed properly. | 53 Description : A dialog with long message is not displayed properly. |
54 Solution : The no of lines in a dialog is increased from 4 to 15. | 54 Solution : The no of lines in a dialog is increased from 4 to 15. |
55 | 55 |
56 Feb 24, 2005 REF: CRR MMI-SPR-29102 xnkulkar | 56 Feb 24, 2005 REF: CRR MMI-SPR-29102 xnkulkar |
57 Description: The phone resets when user presses the ''End All' key while the SMSs are being deleted. | 57 Description: The phone resets when user presses the ''End All' key while the SMSs are being deleted. |
58 Solution: As the user has already confirmed that all SMS messages are to be deleted, ''End All' key | 58 Solution: As the user has already confirmed that all SMS messages are to be deleted, ''End All' key |
59 press is ignored till the delete operation is over. | 59 press is ignored till the delete operation is over. |
60 xrashmic 08 Feb, 2005 MMI-SPR-27853 | 60 xrashmic 08 Feb, 2005 MMI-SPR-27853 |
61 Moved the T_dialog_info structure from MmiDialogs.c to MmiDialogs.h | 61 Moved the T_dialog_info structure from MmiDialogs.c to MmiDialogs.h |
62 | 62 |
63 | 63 |
64 xrashmic 08 Feb, 2005 MMI-SPR-27853 | 64 xrashmic 08 Feb, 2005 MMI-SPR-27853 |
65 Moved the T_dialog_info structure from MmiDialogs.c to MmiDialogs.h | 65 Moved the T_dialog_info structure from MmiDialogs.c to MmiDialogs.h |
66 | 66 |
67 Aug 25, 2004 REF: CRR 24904 Deepa M.D | 67 Aug 25, 2004 REF: CRR 24904 Deepa M.D |
68 Bug:cleanup compile switches used for Go-lite | 68 Bug:cleanup compile switches used for Go-lite |
69 Fix:COLOURDISPLAY compiler switch has been added to the functions which are | 69 Fix:COLOURDISPLAY compiler switch has been added to the functions which are |
70 used only for the normal color build. | 70 used only for the normal color build. |
71 | 71 |
72 Aug 16, 2004 REF: CRR 24323 Deepa M.D | 72 Aug 16, 2004 REF: CRR 24323 Deepa M.D |
73 Bug:Clenup of sprintf used for tracing | 73 Bug:Clenup of sprintf used for tracing |
74 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX | 74 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX |
75 | 75 |
76 | 76 |
77 Sep 01, 2004 REF: CRR 21380 Deepa M.D | 77 Sep 01, 2004 REF: CRR 21380 Deepa M.D |
78 Bug:Not getting proper display, When Messages Memory is Full. | 78 Bug:Not getting proper display, When Messages Memory is Full. |
79 Fix:Assigning TextId and TextString will not display both the messages. | 79 Fix:Assigning TextId and TextString will not display both the messages. |
80 Hence we need to use TextId and TextString2 or TextId2 and TextString | 80 Hence we need to use TextId and TextString2 or TextId2 and TextString |
81 | 81 |
82 Jun 04,2004 CRR:13601 xpradipg - SASKEN | 82 Jun 04,2004 CRR:13601 xpradipg - SASKEN |
83 Description: CFO interrogation display : Timer to long | 83 Description: CFO interrogation display : Timer to long |
84 Fix: Timer is enabled for the information dialog. It times out after 5 seconds from the last key | 84 Fix: Timer is enabled for the information dialog. It times out after 5 seconds from the last key |
85 press. | 85 press. |
86 25/10/00 Original Condat(UK) BMI version. | 86 25/10/00 Original Condat(UK) BMI version. |
87 | 87 |
88 $End | 88 $End |
89 | 89 |
90 *******************************************************************************/ | 90 *******************************************************************************/ |
91 | 91 |
92 | 92 |
93 /******************************************************************************* | 93 /******************************************************************************* |
94 | 94 |
95 Include Files | 95 Include Files |
96 | 96 |
97 *******************************************************************************/ | 97 *******************************************************************************/ |
98 #define ENTITY_MFW | 98 #define ENTITY_MFW |
99 | 99 |
100 /* includes */ | 100 /* includes */ |
101 #include <string.h> | 101 #include <string.h> |
137 #include "mfw_kbd.h" | 137 #include "mfw_kbd.h" |
138 #include "mfw_nm.h" | 138 #include "mfw_nm.h" |
139 | 139 |
140 //x0pleela 15 May, 2007 DR: OMAPS00127483 | 140 //x0pleela 15 May, 2007 DR: OMAPS00127483 |
141 #ifdef FF_PHONE_LOCK | 141 #ifdef FF_PHONE_LOCK |
142 #ifdef FF_MIDI_RINGER | 142 #ifdef FF_MIDI_RINGER |
143 #include "mfw_midi.h" | 143 #include "mfw_midi.h" |
144 #endif //FF_MIDI_RINGER | 144 #endif //FF_MIDI_RINGER |
145 #endif /* FF_PHONE_LOCK */ | 145 #endif /* FF_PHONE_LOCK */ |
146 #include "dspl.h" | 146 #include "dspl.h" |
147 | 147 |
148 #include "ksd.h" | 148 #include "ksd.h" |
149 #include "psa.h" | 149 #include "psa.h" |
175 //x0pleela 27 Mar, 2007 ER: OMAPS00122561 | 175 //x0pleela 27 Mar, 2007 ER: OMAPS00122561 |
176 #ifdef FF_PHONE_LOCK | 176 #ifdef FF_PHONE_LOCK |
177 #include "MmiPins.h" | 177 #include "MmiPins.h" |
178 //x0pleela 15 May, 2007 DR: OMAPS00127483 | 178 //x0pleela 15 May, 2007 DR: OMAPS00127483 |
179 #include "MmiSounds.h" | 179 #include "MmiSounds.h" |
180 EXTERN T_call call_data; | 180 EXTERN T_call call_data; |
181 extern T_MFW_HND phlock_win_handle; /* to hold the win handle of phone unlock editor window */ | 181 extern T_MFW_HND phlock_win_handle; /* to hold the win handle of phone unlock editor window */ |
182 extern T_MFW_HND phlock_kbd_handle; /* to hold the kbd handle of phone unlock editor window */ | 182 extern T_MFW_HND phlock_kbd_handle; /* to hold the kbd handle of phone unlock editor window */ |
183 extern T_MFW_HND phlock_alarm_win_handle; /* to hold the win handle of alarm window */ | 183 extern T_MFW_HND phlock_alarm_win_handle; /* to hold the win handle of alarm window */ |
184 extern T_MFW_HND phlock_dialog_mtc_win_handle;/* to hold the win handle of MT call dialog window */ | 184 extern T_MFW_HND phlock_dialog_mtc_win_handle;/* to hold the win handle of MT call dialog window */ |
185 extern int phlock_alarm; /* flag to check whether alarm event has occured or not */ | 185 extern int phlock_alarm; /* flag to check whether alarm event has occured or not */ |
186 int phlock_mtc_anim_time; /* to hold the display info for MTC while in locked state */ | 186 int phlock_mtc_anim_time; /* to hold the display info for MTC while in locked state */ |
187 | 187 |
188 //x0pleela 15 May, 2007 DR: OMAPS00127483 | 188 //x0pleela 15 May, 2007 DR: OMAPS00127483 |
189 #ifdef FF_MMI_AUDIO_PROFILE | 189 #ifdef FF_MMI_AUDIO_PROFILE |
190 extern UBYTE mfwAudPlay;//flag for audio | 190 extern UBYTE mfwAudPlay;//flag for audio |
191 #endif | 191 #endif |
192 | 192 |
193 static T_MFW_HND phlock_dialog_info_create (T_MFW_HND parent_win); | 193 static T_MFW_HND phlock_dialog_info_create (T_MFW_HND parent_win); |
194 static int phlock_dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win); | 194 static int phlock_dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win); |
195 void phlock_dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | 195 void phlock_dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter); |
208 | 208 |
209 static T_MFW_HND dialog_info_create (T_MFW_HND parent_win); | 209 static T_MFW_HND dialog_info_create (T_MFW_HND parent_win); |
210 static void dialog_info (T_MFW_HND win, | 210 static void dialog_info (T_MFW_HND win, |
211 USHORT event, SHORT value, void * parameter); | 211 USHORT event, SHORT value, void * parameter); |
212 | 212 |
213 /* x0039928 - Lint warning fix | 213 /* x0039928 - Lint warning fix |
214 static int dialog_info_win_cb (T_MFW_EVENT event, T_MFW_WIN * win); */ | 214 static int dialog_info_win_cb (T_MFW_EVENT event, T_MFW_WIN * win); */ |
215 static int dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win); | 215 static int dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win); |
216 | 216 |
217 static T_MFW_CB dialog_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM * tc); | 217 static T_MFW_CB dialog_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM * tc); |
218 static int dialog_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD * keyboard); | 218 static int dialog_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD * keyboard); |
263 sx = dataSx; | 263 sx = dataSx; |
264 break; | 264 break; |
265 case DLG_INFO_LAYOUT_LEFT: //display all info at the top of the bitmap | 265 case DLG_INFO_LAYOUT_LEFT: //display all info at the top of the bitmap |
266 sx = dataSx; | 266 sx = dataSx; |
267 break; | 267 break; |
268 default: //display info over entire area | 268 default: //display info over entire area |
269 break; | 269 break; |
270 } | 270 } |
271 | 271 |
272 switch (dlgType & (DLG_INFO_LAYOUT_BOTTOM | DLG_INFO_LAYOUT_TOP)) | 272 switch (dlgType & (DLG_INFO_LAYOUT_BOTTOM | DLG_INFO_LAYOUT_TOP)) |
273 { | 273 { |
274 case DLG_INFO_LAYOUT_CENTRE: //display info in centre of display | 274 case DLG_INFO_LAYOUT_CENTRE: //display info in centre of display |
275 py = py + (sy-dataSy)/2; | 275 py = py + (sy-dataSy)/2; |
276 sy = dataSy; | 276 sy = dataSy; |
280 sy = dataSy; | 280 sy = dataSy; |
281 break; | 281 break; |
282 case DLG_INFO_LAYOUT_TOP: //display all info at the top of the bitmap | 282 case DLG_INFO_LAYOUT_TOP: //display all info at the top of the bitmap |
283 sy = dataSy; | 283 sy = dataSy; |
284 break; | 284 break; |
285 default: //display info over entire area | 285 default: //display info over entire area |
286 break; | 286 break; |
287 } | 287 } |
288 area.px = px; area.py = py; | 288 area.px = px; area.py = py; |
289 area.sx = sx; area.sy = sy; //Area sx/sy must be no smaller than dataSx/Sy | 289 area.sx = sx; area.sy = sy; //Area sx/sy must be no smaller than dataSx/Sy |
290 return (area); | 290 return (area); |
294 /******************************************************************************* | 294 /******************************************************************************* |
295 | 295 |
296 $Function: info_dialog | 296 $Function: info_dialog |
297 | 297 |
298 $Description: Common information dialog | 298 $Description: Common information dialog |
299 | 299 |
300 $Returns: Dialogue info win | 300 $Returns: Dialogue info win |
301 | 301 |
302 $Arguments: parent win, display info | 302 $Arguments: parent win, display info |
303 | 303 |
304 *******************************************************************************/ | 304 *******************************************************************************/ |
305 T_MFW_HND info_dialog (T_MFW_HND parent_win, | 305 T_MFW_HND info_dialog (T_MFW_HND parent_win, |
306 T_DISPLAY_DATA * display_info) | 306 T_DISPLAY_DATA * display_info) |
307 { | 307 { |
308 T_MFW_HND win; | 308 T_MFW_HND win; |
309 TRACE_FUNCTION("info_dialog()"); | 309 TRACE_FUNCTION("info_dialog()"); |
310 display_info->SoftKeyStrings = FALSE; | 310 display_info->SoftKeyStrings = FALSE; |
311 | 311 |
312 win = dialog_info_create (parent_win); | 312 win = dialog_info_create (parent_win); |
313 | 313 |
314 if (win NEQ NULL) | 314 if (win NEQ NULL) |
315 { | 315 { |
316 SEND_EVENT (win, DIALOG_INIT, 0, display_info); | 316 SEND_EVENT (win, DIALOG_INIT, 0, display_info); |
317 } | 317 } |
322 /******************************************************************************* | 322 /******************************************************************************* |
323 | 323 |
324 $Function: info_dialog_softkeystrings | 324 $Function: info_dialog_softkeystrings |
325 | 325 |
326 $Description: Common information dialog, sets "softkeystrings" to TRUE | 326 $Description: Common information dialog, sets "softkeystrings" to TRUE |
327 | 327 |
328 $Returns: Dialogue info win | 328 $Returns: Dialogue info win |
329 | 329 |
330 $Arguments: parent win, display info, leftsoftkey, rightsoftkey | 330 $Arguments: parent win, display info, leftsoftkey, rightsoftkey |
331 | 331 |
332 *******************************************************************************/ | 332 *******************************************************************************/ |
333 T_MFW_HND info_dialog_softkeystrings (T_MFW_HND parent_win, T_DISPLAY_DATA * display_info) | 333 T_MFW_HND info_dialog_softkeystrings (T_MFW_HND parent_win, T_DISPLAY_DATA * display_info) |
334 { | 334 { |
335 T_MFW_HND win; | 335 T_MFW_HND win; |
336 | 336 |
348 /******************************************************************************* | 348 /******************************************************************************* |
349 | 349 |
350 $Function: dialog_info_create | 350 $Function: dialog_info_create |
351 | 351 |
352 $Description: Creation of an information dialog | 352 $Description: Creation of an information dialog |
353 | 353 |
354 $Returns: Dialogue info win | 354 $Returns: Dialogue info win |
355 | 355 |
356 $Arguments: parent win | 356 $Arguments: parent win |
357 | 357 |
358 *******************************************************************************/ | 358 *******************************************************************************/ |
359 static T_MFW_HND dialog_info_create (T_MFW_HND parent_win) | 359 static T_MFW_HND dialog_info_create (T_MFW_HND parent_win) |
360 { | 360 { |
361 T_MFW_WIN * win_data; | 361 T_MFW_WIN * win_data; |
362 T_dialog_info * data = (T_dialog_info *)ALLOC_MEMORY (sizeof (T_dialog_info)); | 362 T_dialog_info * data = (T_dialog_info *)ALLOC_MEMORY (sizeof (T_dialog_info)); |
364 | 364 |
365 data->info_win = win_create (parent_win, 0, E_WIN_VISIBLE | 365 data->info_win = win_create (parent_win, 0, E_WIN_VISIBLE |
366 //x0pleela 06 Apr, 2007 ER: OMAPS00122561 | 366 //x0pleela 06 Apr, 2007 ER: OMAPS00122561 |
367 #ifdef FF_PHONE_LOCK | 367 #ifdef FF_PHONE_LOCK |
368 |E_WIN_RESUME | 368 |E_WIN_RESUME |
369 #endif //FF_PHONE_LOCK | 369 #endif //FF_PHONE_LOCK |
370 , (T_MFW_CB)dialog_info_win_resize_cb); | 370 , (T_MFW_CB)dialog_info_win_resize_cb); |
371 | 371 |
372 if (data->info_win EQ 0) | 372 if (data->info_win EQ 0) |
373 return 0; | 373 return 0; |
374 | 374 |
391 /******************************************************************************* | 391 /******************************************************************************* |
392 | 392 |
393 $Function: dialog_info_destroy | 393 $Function: dialog_info_destroy |
394 | 394 |
395 $Description: Destruction of an information dialog | 395 $Description: Destruction of an information dialog |
396 | 396 |
397 $Returns: void | 397 $Returns: void |
398 | 398 |
399 $Arguments: win | 399 $Arguments: win |
400 | 400 |
401 *******************************************************************************/ | 401 *******************************************************************************/ |
402 void dialog_info_destroy (T_MFW_HND own_window) | 402 void dialog_info_destroy (T_MFW_HND own_window) |
403 { | 403 { |
404 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data; | 404 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data; |
405 T_dialog_info * data = (T_dialog_info *)win->user; | 405 T_dialog_info * data = (T_dialog_info *)win->user; |
457 | 457 |
458 TRACE_EVENT("dlg_zeroDisplayData()"); | 458 TRACE_EVENT("dlg_zeroDisplayData()"); |
459 if (displayInfo == NULL) | 459 if (displayInfo == NULL) |
460 return; | 460 return; |
461 memset (displayInfo, 0x00, sizeof(T_DISPLAY_DATA)); | 461 memset (displayInfo, 0x00, sizeof(T_DISPLAY_DATA)); |
462 | 462 |
463 displayInfo->LeftSoftKey = 0; | 463 displayInfo->LeftSoftKey = 0; |
464 displayInfo->RightSoftKey = 0; | 464 displayInfo->RightSoftKey = 0; |
465 displayInfo->LSKString = NULL; | 465 displayInfo->LSKString = NULL; |
466 displayInfo->RSKString = NULL; | 466 displayInfo->RSKString = NULL; |
467 displayInfo->TextString = NULL; | 467 displayInfo->TextString = NULL; |
468 displayInfo->TextString2 = NULL; | 468 displayInfo->TextString2 = NULL; |
469 | 469 |
470 displayInfo->WrapStrings = 0; | 470 displayInfo->WrapStrings = 0; |
471 | 471 |
472 displayInfo->TextId = 0; | 472 displayInfo->TextId = 0; |
473 displayInfo->TextId2 = 0; | 473 displayInfo->TextId2 = 0; |
474 | 474 |
475 displayInfo->SoftKeyStrings = FALSE; | 475 displayInfo->SoftKeyStrings = FALSE; |
476 | 476 |
477 displayInfo->Identifier = 0; | 477 displayInfo->Identifier = 0; |
478 displayInfo->anim_time = 0; | 478 displayInfo->anim_time = 0; |
479 displayInfo->number_of_frames = 0; | 479 displayInfo->number_of_frames = 0; |
480 displayInfo->current_frame = 0; | 480 displayInfo->current_frame = 0; |
481 //x0035544 Feb 07, 2006 DR:OMAPS00061467 | 481 //x0035544 Feb 07, 2006 DR:OMAPS00061467 |
482 #ifdef FF_MMI_SAT_ICON | 482 #ifdef FF_MMI_SAT_ICON |
483 displayInfo->IconData.width = 0; | 483 displayInfo->IconData.width = 0; |
484 displayInfo->IconData.height = 0; | 484 displayInfo->IconData.height = 0; |
485 displayInfo->IconData.dst = NULL; | 485 displayInfo->IconData.dst = NULL; |
486 displayInfo->IconData.selfExplanatory = FALSE; | 486 displayInfo->IconData.selfExplanatory = FALSE; |
487 #endif | 487 #endif |
488 dlg_initDisplayData_events( displayInfo, NULL, 0, 0); | 488 dlg_initDisplayData_events( displayInfo, NULL, 0, 0); |
489 | 489 |
490 /* GW#2294 COLOUR_STATUS has been used for all popups - change this to default instead of COLOUR_POPUP .*/ | 490 /* GW#2294 COLOUR_STATUS has been used for all popups - change this to default instead of COLOUR_POPUP .*/ |
491 dlg_initDisplayData_type( displayInfo, COLOUR_STATUS, 0, NULL, 0 ); | 491 dlg_initDisplayData_type( displayInfo, COLOUR_STATUS, 0, NULL, 0 ); |
492 | 492 |
493 /* GW #2294 02/07/03 - The default bitmap is set-up here to allow us to disable it for some dialogs (if required) */ | 493 /* GW #2294 02/07/03 - The default bitmap is set-up here to allow us to disable it for some dialogs (if required) */ |
494 displayInfo->bgdBitmap = icon_getBgdBitmap(BGD_CLOUD); | 494 displayInfo->bgdBitmap = icon_getBgdBitmap(BGD_CLOUD); |
495 | 495 |
496 } | 496 } |
497 | 497 |
498 void dlg_initDisplayData_TextId( T_DISPLAY_DATA *displayInfo, int lsk, int rsk, int str1, int str2, int colId) | 498 void dlg_initDisplayData_TextId( T_DISPLAY_DATA *displayInfo, int lsk, int rsk, int str1, int str2, int colId) |
499 { | 499 { |
500 if (displayInfo == NULL) | 500 if (displayInfo == NULL) |
503 displayInfo->LeftSoftKey = (USHORT)lsk; | 503 displayInfo->LeftSoftKey = (USHORT)lsk; |
504 displayInfo->RightSoftKey = (USHORT)rsk; | 504 displayInfo->RightSoftKey = (USHORT)rsk; |
505 displayInfo->TextId = str1; | 505 displayInfo->TextId = str1; |
506 displayInfo->TextId2 = str2; | 506 displayInfo->TextId2 = str2; |
507 displayInfo->displayCol = colId ; | 507 displayInfo->displayCol = colId ; |
508 | 508 |
509 } | 509 } |
510 | 510 |
511 void dlg_initDisplayData_TextStr( T_DISPLAY_DATA *displayInfo, int lsk, int rsk,char *str1, char *str2, int colId) | 511 void dlg_initDisplayData_TextStr( T_DISPLAY_DATA *displayInfo, int lsk, int rsk,char *str1, char *str2, int colId) |
512 { | 512 { |
513 if (displayInfo == NULL) | 513 if (displayInfo == NULL) |
537 /******************************************************************************* | 537 /******************************************************************************* |
538 | 538 |
539 $Function: dialog_info | 539 $Function: dialog_info |
540 | 540 |
541 $Description: Dialog function for information dialog | 541 $Description: Dialog function for information dialog |
542 | 542 |
543 $Returns: void | 543 $Returns: void |
544 | 544 |
545 $Arguments: win, window handle event, value, parameter | 545 $Arguments: win, window handle event, value, parameter |
546 | 546 |
547 *******************************************************************************/ | 547 *******************************************************************************/ |
548 void dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | 548 void dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter) |
549 { | 549 { |
550 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 550 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
551 T_dialog_info * data = (T_dialog_info *)win_data->user; | 551 T_dialog_info * data = (T_dialog_info *)win_data->user; |
552 T_DISPLAY_DATA * display_info = (T_DISPLAY_DATA *)parameter; | 552 T_DISPLAY_DATA * display_info = (T_DISPLAY_DATA *)parameter; |
553 TRACE_FUNCTION ("dialog_info()"); | 553 TRACE_FUNCTION ("dialog_info()"); |
554 | 554 |
555 switch (event) | 555 switch (event) |
556 { | 556 { |
557 case DIALOG_INIT: | 557 case DIALOG_INIT: |
559 * Initialize dialog | 559 * Initialize dialog |
560 */ | 560 */ |
561 #if defined (WIN32) | 561 #if defined (WIN32) |
562 { | 562 { |
563 /***************************Go-lite Optimization changes Start***********************/ | 563 /***************************Go-lite Optimization changes Start***********************/ |
564 | 564 |
565 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | 565 //Aug 16, 2004 REF: CRR 24323 Deepa M.D |
566 TRACE_EVENT_P1( "Identifier %d", display_info->Identifier); | 566 TRACE_EVENT_P1( "Identifier %d", display_info->Identifier); |
567 /***************************Go-lite Optimization changes end***********************/ | 567 /***************************Go-lite Optimization changes end***********************/ |
568 | 568 |
569 } | 569 } |
570 #endif | 570 #endif |
571 /* | 571 /* |
572 * Create timer and keyboard handler | 572 * Create timer and keyboard handler |
573 */ | 573 */ |
574 data->info_tim = tim_create (win, display_info->Time, (T_MFW_CB)dialog_info_tim_cb); | 574 data->info_tim = tim_create (win, display_info->Time, (T_MFW_CB)dialog_info_tim_cb); |
575 data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); | 575 data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); |
576 data->info_kbd_long = kbd_create(win,KEY_ALL|KEY_LONG,(MfwCb)dialog_info_kbd_long_cb); | 576 data->info_kbd_long = kbd_create(win,KEY_ALL|KEY_LONG,(MfwCb)dialog_info_kbd_long_cb); |
577 | 577 |
578 //x0pleela 05 Apr, 2007 ER: OMAPS00122561 | 578 //x0pleela 05 Apr, 2007 ER: OMAPS00122561 |
579 #ifdef FF_PHONE_LOCK | 579 #ifdef FF_PHONE_LOCK |
580 if( phlock_win_handle && | 580 if( phlock_win_handle && |
581 ( ( phlock_alarm) || ( call_data.call_direction == MFW_CM_MTC ) ) ) | 581 ( ( phlock_alarm) || ( call_data.call_direction == MFW_CM_MTC ) ) ) |
582 { | 582 { |
583 TRACE_EVENT("dialog_info: Bef deleting kbd_delete(data->info_kbd);"); | 583 TRACE_EVENT("dialog_info: Bef deleting kbd_delete(data->info_kbd);"); |
584 if( phlock_alarm ) | 584 if( phlock_alarm ) |
585 phlock_alarm_win_handle = win; | 585 phlock_alarm_win_handle = win; |
586 | 586 |
587 if( call_data.call_direction == MFW_CM_MTC ) | 587 if( call_data.call_direction == MFW_CM_MTC ) |
588 phlock_dialog_mtc_win_handle = win; | 588 phlock_dialog_mtc_win_handle = win; |
589 | 589 |
590 kbd_delete(data->info_kbd); | 590 kbd_delete(data->info_kbd); |
591 data->info_kbd = phlock_kbd_handle; //set the kbd handle of unlock screen | 591 data->info_kbd = phlock_kbd_handle; //set the kbd handle of unlock screen |
592 } | 592 } |
593 #endif //FF_PHONE_LOCK | 593 #endif //FF_PHONE_LOCK |
594 | 594 |
621 #ifdef FF_MMI_SAT_ICON | 621 #ifdef FF_MMI_SAT_ICON |
622 if(display_info->IconData.dst != NULL) | 622 if(display_info->IconData.dst != NULL) |
623 { | 623 { |
624 data->IconData.width = display_info->IconData.width; | 624 data->IconData.width = display_info->IconData.width; |
625 data->IconData.height = display_info->IconData.height; | 625 data->IconData.height = display_info->IconData.height; |
626 data->IconData.dst = display_info->IconData.dst; | 626 data->IconData.dst = display_info->IconData.dst; |
627 data->IconData.selfExplanatory = display_info->IconData.selfExplanatory; | 627 data->IconData.selfExplanatory = display_info->IconData.selfExplanatory; |
628 } | 628 } |
629 else | 629 else |
630 { | 630 { |
631 data->IconData.dst = NULL; | 631 data->IconData.dst = NULL; |
632 data->IconData.selfExplanatory = FALSE; | 632 data->IconData.selfExplanatory = FALSE; |
633 data->IconData.width =0; | 633 data->IconData.width =0; |
634 data->IconData.height =0; | 634 data->IconData.height =0; |
635 } | 635 } |
636 #endif | 636 #endif |
637 | 637 |
638 TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); | 638 TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); |
639 TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); | 639 TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); |
640 //x0pleela 27 Mar, 2007 ER: OMAPS00122561 | 640 //x0pleela 27 Mar, 2007 ER: OMAPS00122561 |
641 #ifdef FF_PHONE_LOCK | 641 #ifdef FF_PHONE_LOCK |
642 phlock_mtc_anim_time = display_info->anim_time; | 642 phlock_mtc_anim_time = display_info->anim_time; |
643 if( ( !phlock_win_handle) || (mmiPinsEmergencyCall()) | 643 if( ( !phlock_win_handle) || (mmiPinsEmergencyCall()) |
644 || call_data.emergencyCall ) | 644 || call_data.emergencyCall ) |
645 { | 645 { |
646 #endif //FF_PHONE_LOCK | 646 #endif //FF_PHONE_LOCK |
647 if(display_info->anim_time != 0) | 647 if(display_info->anim_time != 0) |
648 { | 648 { |
652 | 652 |
653 if (display_info->Time NEQ FOREVER) | 653 if (display_info->Time NEQ FOREVER) |
654 tim_start (data->info_tim); | 654 tim_start (data->info_tim); |
655 win_show (win); | 655 win_show (win); |
656 | 656 |
657 #ifdef FF_PHONE_LOCK | 657 #ifdef FF_PHONE_LOCK |
658 } | 658 } |
659 else | 659 else |
660 { | 660 { |
661 if (display_info->Time NEQ FOREVER) | 661 if (display_info->Time NEQ FOREVER) |
662 tim_start (data->info_tim); | 662 tim_start (data->info_tim); |
678 /******************************************************************************* | 678 /******************************************************************************* |
679 | 679 |
680 $Function: dialog_info_win_cb | 680 $Function: dialog_info_win_cb |
681 | 681 |
682 $Description: Callback function for information dialog | 682 $Description: Callback function for information dialog |
683 | 683 |
684 $Returns: void | 684 $Returns: void |
685 | 685 |
686 $Arguments: window handle event, win | 686 $Arguments: window handle event, win |
687 *******************************************************************************/ | 687 *******************************************************************************/ |
688 //GW-SPR#762-Added code to wraps txtString2 if there is room on the display to allow | 688 //GW-SPR#762-Added code to wraps txtString2 if there is room on the display to allow |
689 //very long numbers to be displayed. | 689 //very long numbers to be displayed. |
690 #define MAX_LINE_CHAR MAX_LINE | 690 #define MAX_LINE_CHAR MAX_LINE |
691 static int dialog_info_win_cb (T_MFW_EVENT event, T_MFW_WIN * win) | 691 static int dialog_info_win_cb (T_MFW_EVENT event, T_MFW_WIN * win) |
692 { | 692 { |
693 T_dialog_info * data = (T_dialog_info *)win->user; | 693 T_dialog_info * data = (T_dialog_info *)win->user; |
720 icnShow(data->icon); | 720 icnShow(data->icon); |
721 if (data->SoftKeyStrings) | 721 if (data->SoftKeyStrings) |
722 displayCustSoftKeys(data->LSKString, data->RSKString); // SH - display text softkeys | 722 displayCustSoftKeys(data->LSKString, data->RSKString); // SH - display text softkeys |
723 else | 723 else |
724 displaySoftKeys(data->LeftSoftKey, data->RightSoftKey); // display ID softkeys | 724 displaySoftKeys(data->LeftSoftKey, data->RightSoftKey); // display ID softkeys |
725 | 725 |
726 /* | 726 /* |
727 * Print information | 727 * Print information |
728 */ | 728 */ |
729 /*MC SPR 1257, having to shift everything up 1 line as string wrapping for second | 729 /*MC SPR 1257, having to shift everything up 1 line as string wrapping for second |
730 string causes softkey overwrite when in Chinese*/ | 730 string causes softkey overwrite when in Chinese*/ |
732 { | 732 { |
733 ALIGNED_PROMPT(LEFT,0,DSPL_TXTATTR_CURRENT_MODE, data->TextId); | 733 ALIGNED_PROMPT(LEFT,0,DSPL_TXTATTR_CURRENT_MODE, data->TextId); |
734 } | 734 } |
735 else if (data->TextString NEQ NULL) | 735 else if (data->TextString NEQ NULL) |
736 { | 736 { |
737 #ifdef EASY_TEXT_ENABLED | 737 #ifdef EASY_TEXT_ENABLED |
738 if (data->TextString[0] == (char)0x80) //MC if this is a unicode string /* x0039928 -lint warning removal */ | 738 if (data->TextString[0] == (char)0x80) //MC if this is a unicode string /* x0039928 -lint warning removal */ |
739 displayAlignedText(LEFT, 0, DSPL_TXTATTR_UNICODE, &data->TextString[2]); | 739 displayAlignedText(LEFT, 0, DSPL_TXTATTR_UNICODE, &data->TextString[2]); |
740 else | 740 else |
741 #endif | 741 #endif |
742 displayAlignedText(LEFT, 0, DSPL_TXTATTR_NORMAL, data->TextString); | 742 displayAlignedText(LEFT, 0, DSPL_TXTATTR_NORMAL, data->TextString); |
745 if (data->TextId2 NEQ 0) | 745 if (data->TextId2 NEQ 0) |
746 { | 746 { |
747 ALIGNED_PROMPT(LEFT,Mmi_layout_first_line()/*MC*/,DSPL_TXTATTR_CURRENT_MODE, data->TextId2); | 747 ALIGNED_PROMPT(LEFT,Mmi_layout_first_line()/*MC*/,DSPL_TXTATTR_CURRENT_MODE, data->TextId2); |
748 } | 748 } |
749 else if (data->TextString2 NEQ NULL) | 749 else if (data->TextString2 NEQ NULL) |
750 { | 750 { |
751 #ifdef EASY_TEXT_ENABLED | 751 #ifdef EASY_TEXT_ENABLED |
752 if (data->TextString2[0] == (char)0x80 ) //MC if this is a unicode string /* x0039928 -Lint warning removal */ | 752 if (data->TextString2[0] == (char)0x80 ) //MC if this is a unicode string /* x0039928 -Lint warning removal */ |
753 displayAlignedText(LEFT, Mmi_layout_first_line()/*MC*/, DSPL_TXTATTR_UNICODE, &data->TextString2[2]); | 753 displayAlignedText(LEFT, Mmi_layout_first_line()/*MC*/, DSPL_TXTATTR_UNICODE, &data->TextString2[2]); |
754 else | 754 else |
755 #endif | 755 #endif |
756 { | 756 { |
760 bufPos = 0; | 760 bufPos = 0; |
761 nLines = Mmi_number_of_lines_without_icons_on_top()-2;//starting on 2nd line | 761 nLines = Mmi_number_of_lines_without_icons_on_top()-2;//starting on 2nd line |
762 len = strlen(data->TextString2); | 762 len = strlen(data->TextString2); |
763 while ((bufPos < len) && (nLines >=0)) | 763 while ((bufPos < len) && (nLines >=0)) |
764 { | 764 { |
765 memcpy(buffer,&data->TextString2[bufPos],MAX_LINE_CHAR); | 765 memcpy(buffer,&data->TextString2[bufPos],MAX_LINE_CHAR); |
766 bufPos = bufPos + MAX_LINE_CHAR; | 766 bufPos = bufPos + MAX_LINE_CHAR; |
767 buffer[MAX_LINE_CHAR] = 0x00; | 767 buffer[MAX_LINE_CHAR] = 0x00; |
768 displayAlignedText(LEFT, yPos, 0, buffer); | 768 displayAlignedText(LEFT, yPos, 0, buffer); |
769 yPos = yPos + Mmi_layout_line_height(); | 769 yPos = yPos + Mmi_layout_line_height(); |
770 nLines--; | 770 nLines--; |
789 /******************************************************************************* | 789 /******************************************************************************* |
790 | 790 |
791 $Function: dialog_info_win_cb | 791 $Function: dialog_info_win_cb |
792 | 792 |
793 $Description: Callback function for information dialog | 793 $Description: Callback function for information dialog |
794 | 794 |
795 $Returns: void | 795 $Returns: void |
796 | 796 |
797 $Arguments: window handle event, win | 797 $Arguments: window handle event, win |
798 | 798 |
799 GW SPR#2294 02/07/03 - Removed Unicode specific code as the 'display' routines called to calculate | 799 GW SPR#2294 02/07/03 - Removed Unicode specific code as the 'display' routines called to calculate |
800 the string length and output the text should correctly handle the 0x80 unicode tag | 800 the string length and output the text should correctly handle the 0x80 unicode tag |
801 at the start. | 801 at the start. |
802 Modified the display code to wrap the text in the second text string. | 802 Modified the display code to wrap the text in the second text string. |
803 Modified the window drawing code so that if the text will not fit in the dialog box | 803 Modified the window drawing code so that if the text will not fit in the dialog box |
804 with the background bitmap, a pop-up 'box' will be drawn instead. If this will still | 804 with the background bitmap, a pop-up 'box' will be drawn instead. If this will still |
805 not be large enough, the entire screen is used. | 805 not be large enough, the entire screen is used. |
806 For the C-sample, there is no bitmap. | 806 For the C-sample, there is no bitmap. |
807 Modified the code to use an array of values to position the text output. | 807 Modified the code to use an array of values to position the text output. |
808 GW SPR#2294 08/07/03 - Added code to expand the dialog box to include the animation (if any). | 808 GW SPR#2294 08/07/03 - Added code to expand the dialog box to include the animation (if any). |
809 | 809 |
810 *******************************************************************************/ | 810 *******************************************************************************/ |
811 // Allow 4 lines of text (0..3) for dialogs | 811 // Allow 4 lines of text (0..3) for dialogs |
812 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 812 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
813 // To display a dialog properly when it contain lengthy message - No of lines increased. | 813 // To display a dialog properly when it contain lengthy message - No of lines increased. |
814 #define MAX_DLG_LINES (15) | 814 #define MAX_DLG_LINES (15) |
815 //Allow up to 40 chars of text on a dialog line | 815 //Allow up to 40 chars of text on a dialog line |
816 #define MAX_WRAP_CHAR (42) | 816 #define MAX_WRAP_CHAR (42) |
817 //Allow us to wrap text from line 2 to lines 2,3 and 4 lines | 817 //Allow us to wrap text from line 2 to lines 2,3 and 4 lines |
818 #define MAX_WRAP_LINES (MAX_DLG_LINES-1) | 818 #define MAX_WRAP_LINES (MAX_DLG_LINES-1) |
819 | 819 |
820 #define DLG_USE_BITMAP 0x0001 //use bitmap if present | 820 #define DLG_USE_BITMAP 0x0001 //use bitmap if present |
821 #define DLG_USE_RECTANGLE 0x0002 //use a rectangle | 821 #define DLG_USE_RECTANGLE 0x0002 //use a rectangle |
822 #define DLG_USE_FULL_SCREEN 0x0004 //use full-screen | 822 #define DLG_USE_FULL_SCREEN 0x0004 //use full-screen |
823 | 823 |
824 #define DLG_LINE1 0 | 824 #define DLG_LINE1 0 |
825 #define DLG_LINE2 1 | 825 #define DLG_LINE2 1 |
826 | 826 |
829 T_dialog_info * data = (T_dialog_info *)win->user; | 829 T_dialog_info * data = (T_dialog_info *)win->user; |
830 // T_DISPLAY_DATA * display_info; // RAVI | 830 // T_DISPLAY_DATA * display_info; // RAVI |
831 int xPos[MAX_DLG_LINES]; | 831 int xPos[MAX_DLG_LINES]; |
832 int yPos[MAX_DLG_LINES]; | 832 int yPos[MAX_DLG_LINES]; |
833 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 833 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
834 //The size of array str and strlen are increased by 1, so that the last elements holds data | 834 //The size of array str and strlen are increased by 1, so that the last elements holds data |
835 // which is used while wrapping the text. | 835 // which is used while wrapping the text. |
836 char* str[MAX_DLG_LINES+1]; | 836 char* str[MAX_DLG_LINES+1]; |
837 int strLen[MAX_DLG_LINES+1]; | 837 int strLen[MAX_DLG_LINES+1]; |
838 int i; | 838 int i; |
839 char* lskStr,*rskStr; | 839 char* lskStr,*rskStr; |
840 int wx = 0; //,wy,sx=0,sy=0; // RAVI | 840 int wx = 0; //,wy,sx=0,sy=0; // RAVI |
841 int wy = 0; // RAVI | 841 int wy = 0; // RAVI |
842 int sx = 0; // RAVI | 842 int sx = 0; // RAVI |
845 int yOfs; | 845 int yOfs; |
846 int yBmpOfs = 0; | 846 int yBmpOfs = 0; |
847 MfwRect skArea; | 847 MfwRect skArea; |
848 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 848 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
849 #ifdef FF_MMI_SAT_ICON | 849 #ifdef FF_MMI_SAT_ICON |
850 USHORT titleIconWidth = 0; | 850 USHORT titleIconWidth = 0; |
851 #endif | 851 #endif |
852 MfwRect area; | 852 MfwRect area; |
853 int scrWidth = 0; //available width for the display // RAVI - Assignment to 0. | 853 int scrWidth = 0; //available width for the display // RAVI - Assignment to 0. |
854 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 854 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
855 // temp_ptr is used while wrapping the text. | 855 // temp_ptr is used while wrapping the text. |
856 // Now str2[][] is not required. | 856 // Now str2[][] is not required. |
857 char *temp_ptr; | 857 char *temp_ptr; |
858 int nChar; | 858 int nChar; |
859 | 859 |
860 /* t_font_bitmap bmp; */ /* Warning Removal - x0020906 - 24-08-2006 */ | 860 /* t_font_bitmap bmp; */ /* Warning Removal - x0020906 - 24-08-2006 */ |
861 // t_font_bitmap* bmpPtr = &bmp; // RAVI - Not Referenced. | 861 // t_font_bitmap* bmpPtr = &bmp; // RAVI - Not Referenced. |
862 | 862 |
863 int drawWinType; | 863 int drawWinType; |
864 int nLines; | 864 int nLines; |
865 | 865 |
866 int linePos=0; | 866 int linePos=0; |
867 int lineLen = 0; | 867 int lineLen = 0; |
868 int wrapLine = 0; /*GW #2294*/ // x0066814 06 Dec 2006, OMAPS00106825 | 868 int wrapLine = 0; /*GW #2294*/ // x0066814 06 Dec 2006, OMAPS00106825 |
869 | 869 |
870 const int charWidth = dspl_GetTextExtent("0",1); | 870 const int charWidth = dspl_GetTextExtent("0",1); |
871 TRACE_FUNCTION ("dialog_info_win_resize_cb()"); | 871 TRACE_FUNCTION ("dialog_info_win_resize_cb()"); |
872 | 872 |
873 | 873 |
874 memset(str,'\0',sizeof(str)); /* x0039928 - Lint warning fix */ | 874 memset(str,'\0',sizeof(str)); /* x0039928 - Lint warning fix */ |
875 memset(strLen,0,sizeof(strLen)); | 875 memset(strLen,0,sizeof(strLen)); |
876 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 876 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
877 #ifdef FF_MMI_SAT_ICON | 877 #ifdef FF_MMI_SAT_ICON |
878 if (data->IconData.dst != NULL) | 878 if (data->IconData.dst != NULL) |
879 { | 879 { |
880 if (data->IconData.width > TITLE_ICON_WIDTH) | 880 if (data->IconData.width > TITLE_ICON_WIDTH) |
881 { | 881 { |
882 titleIconWidth = TITLE_ICON_WIDTH; | 882 titleIconWidth = TITLE_ICON_WIDTH; |
883 } | 883 } |
884 else | 884 else |
885 { | 885 { |
886 titleIconWidth = data->IconData.width ; | 886 titleIconWidth = data->IconData.width ; |
887 } | 887 } |
888 } | 888 } |
889 else | 889 else |
890 { | 890 { |
891 titleIconWidth = 0; | 891 titleIconWidth = 0; |
892 } | 892 } |
893 | 893 |
894 #endif | 894 #endif |
895 if (data EQ 0) | 895 if (data EQ 0) |
896 return 1; | 896 return 1; |
897 | 897 |
898 switch (event) | 898 switch (event) |
899 { | 899 { |
900 //x0pleela 15 May, 2007 DR: OMAPS00127483 | 900 //x0pleela 15 May, 2007 DR: OMAPS00127483 |
901 //Added the following code to handle ringer for incoming call and alarm in phone unlocked state. | 901 //Added the following code to handle ringer for incoming call and alarm in phone unlocked state. |
902 //the ringer for incoming call or alarm is restarted here after unlocking the phone. | 902 //the ringer for incoming call or alarm is restarted here after unlocking the phone. |
903 case E_WIN_RESUME: | 903 case E_WIN_RESUME: |
904 | 904 |
905 #ifdef FF_PHONE_LOCK | 905 #ifdef FF_PHONE_LOCK |
906 | 906 |
907 if( ( ( ( call_data.call_direction == MFW_CM_MTC ) && ( phlock_dialog_mtc_win_handle ) ) || ( phlock_alarm ) ) | 907 if( ( ( ( call_data.call_direction == MFW_CM_MTC ) && ( phlock_dialog_mtc_win_handle ) ) || ( phlock_alarm ) ) |
908 #ifdef FF_MMI_AUDIO_PROFILE | 908 #ifdef FF_MMI_AUDIO_PROFILE |
909 && ( !mfwAudPlay) | 909 && ( !mfwAudPlay) |
910 #endif | 910 #endif |
911 ) | 911 ) |
912 { | 912 { |
913 if( call_data.call_direction == MFW_CM_MTC ) | 913 if( call_data.call_direction == MFW_CM_MTC ) |
914 { | 914 { |
915 #ifdef FF_MIDI_RINGER | 915 #ifdef FF_MIDI_RINGER |
916 mfw_ringer_start(AS_RINGER_MODE_IC, TRUE, sounds_midi_ringer_start_cb); | 916 mfw_ringer_start(AS_RINGER_MODE_IC, TRUE, sounds_midi_ringer_start_cb); |
917 #endif | 917 #endif |
918 } | 918 } |
919 else if ( phlock_alarm ) | 919 else if ( phlock_alarm ) |
920 { | 920 { |
921 #ifdef FF_MIDI_RINGER | 921 #ifdef FF_MIDI_RINGER |
922 mfw_ringer_start(AS_RINGER_MODE_ALARM, TRUE, sounds_midi_ringer_start_cb); | 922 mfw_ringer_start(AS_RINGER_MODE_ALARM, TRUE, sounds_midi_ringer_start_cb); |
923 #endif | 923 #endif |
924 } | 924 } |
925 } | 925 } |
926 | 926 |
927 #endif // FF_PHONE_LOCK | 927 #endif // FF_PHONE_LOCK |
928 | 928 |
929 break; | 929 break; |
930 | 930 |
931 case E_WIN_VISIBLE: | 931 case E_WIN_VISIBLE: |
932 if (win->flags & E_WIN_VISIBLE) | 932 if (win->flags & E_WIN_VISIBLE) |
933 { | 933 { |
934 TRACE_EVENT("dialog_info_win_resize_cb: E_WIN_VISIBLE"); | 934 TRACE_EVENT("dialog_info_win_resize_cb: E_WIN_VISIBLE"); |
935 | 935 |
936 #ifdef FF_PHONE_LOCK | 936 #ifdef FF_PHONE_LOCK |
937 if( phlock_alarm && phlock_alarm_win_handle ) | 937 if( phlock_alarm && phlock_alarm_win_handle ) |
938 { | 938 { |
939 TRACE_EVENT("dialog_info_win_resize_cb: creating alarm kbd handler"); | 939 TRACE_EVENT("dialog_info_win_resize_cb: creating alarm kbd handler"); |
940 data->info_kbd = kbd_create (phlock_alarm_win_handle, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); | 940 data->info_kbd = kbd_create (phlock_alarm_win_handle, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); |
941 } | 941 } |
948 data->animation_timer = timCreate(phlock_dialog_mtc_win_handle, phlock_mtc_anim_time, | 948 data->animation_timer = timCreate(phlock_dialog_mtc_win_handle, phlock_mtc_anim_time, |
949 (MfwCb)mmi_dialogs_animation_new_CB); | 949 (MfwCb)mmi_dialogs_animation_new_CB); |
950 timStart(data->animation_timer); | 950 timStart(data->animation_timer); |
951 } | 951 } |
952 } | 952 } |
953 #endif //FF_PHONE_LOCK | 953 #endif //FF_PHONE_LOCK |
954 | 954 |
955 /* | 955 /* |
956 * Print the information dialog | 956 * Print the information dialog |
957 */ | 957 */ |
958 for (i=0;i<MAX_DLG_LINES;i++) | 958 for (i=0;i<MAX_DLG_LINES;i++) |
962 str[i]=NULL; | 962 str[i]=NULL; |
963 strLen[i]=0; | 963 strLen[i]=0; |
964 } | 964 } |
965 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 965 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
966 // Assign the values to last elments of the array str and strLen | 966 // Assign the values to last elments of the array str and strLen |
967 str[MAX_DLG_LINES] = NULL; | 967 str[MAX_DLG_LINES] = NULL; |
968 strLen[MAX_DLG_LINES] = 0; | 968 strLen[MAX_DLG_LINES] = 0; |
969 yOfs = Mmi_layout_line_height()/4; | 969 yOfs = Mmi_layout_line_height()/4; |
970 if (data->TextId != 0) | 970 if (data->TextId != 0) |
971 str[DLG_LINE1] = MmiRsrcGetText( data->TextId); | 971 str[DLG_LINE1] = MmiRsrcGetText( data->TextId); |
972 else | 972 else |
973 str[DLG_LINE1] = data->TextString; | 973 str[DLG_LINE1] = data->TextString; |
974 | 974 |
975 if (data->TextId2 != 0) | 975 if (data->TextId2 != 0) |
976 str[DLG_LINE2] = MmiRsrcGetText( data->TextId2); | 976 str[DLG_LINE2] = MmiRsrcGetText( data->TextId2); |
977 else | 977 else |
978 str[DLG_LINE2] = data->TextString2; | 978 str[DLG_LINE2] = data->TextString2; |
979 | 979 |
980 if (data->SoftKeyStrings!=0) | 980 if (data->SoftKeyStrings!=0) |
981 { | 981 { |
982 lskStr = data->LSKString; | 982 lskStr = data->LSKString; |
983 rskStr = data->RSKString; | 983 rskStr = data->RSKString; |
985 else | 985 else |
986 { | 986 { |
987 if (data->LeftSoftKey != TxtNull) | 987 if (data->LeftSoftKey != TxtNull) |
988 lskStr = MmiRsrcGetText(data->LeftSoftKey); | 988 lskStr = MmiRsrcGetText(data->LeftSoftKey); |
989 else | 989 else |
990 lskStr = NULL; | 990 lskStr = NULL; |
991 | 991 |
992 if (data->RightSoftKey != TxtNull) | 992 if (data->RightSoftKey != TxtNull) |
993 rskStr = MmiRsrcGetText(data->RightSoftKey); | 993 rskStr = MmiRsrcGetText(data->RightSoftKey); |
994 else | 994 else |
995 rskStr = NULL; | 995 rskStr = NULL; |
996 } | 996 } |
997 | 997 |
998 if ((str[DLG_LINE1]!= NULL) || (str[DLG_LINE2]!=NULL)) | 998 if ((str[DLG_LINE1]!= NULL) || (str[DLG_LINE2]!=NULL)) |
999 { //Draw a window for status info | 999 { //Draw a window for status info |
1000 if (str[DLG_LINE2] == NULL) | 1000 if (str[DLG_LINE2] == NULL) |
1001 { | 1001 { |
1002 sy = Mmi_layout_line_height()+yOfs*2; // 18 or 12 | 1002 sy = Mmi_layout_line_height()+yOfs*2; // 18 or 12 |
1003 | 1003 |
1004 } | 1004 } |
1005 else | 1005 else |
1006 { | 1006 { |
1007 sy = Mmi_layout_line_height()*2+yOfs*3; // 33 or 22 | 1007 sy = Mmi_layout_line_height()*2+yOfs*3; // 33 or 22 |
1008 } | 1008 } |
1009 | 1009 |
1010 //MC, if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) | 1010 //MC, if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) |
1011 { //calculate longest string - use this to calc width of window | 1011 { //calculate longest string - use this to calc width of window |
1012 sx = 0; | 1012 sx = 0; |
1013 if ((lskStr!=NULL) || (rskStr!=NULL)) | 1013 if ((lskStr!=NULL) || (rskStr!=NULL)) |
1014 { | 1014 { |
1015 sy = sy+Mmi_layout_softkeyHeight()+yOfs*2; | 1015 sy = sy+Mmi_layout_softkeyHeight()+yOfs*2; |
1016 sx = sx + 10; | 1016 sx = sx + 10; |
1017 if (lskStr != NULL) | 1017 if (lskStr != NULL) |
1018 { | 1018 { |
1019 sx = sx + dspl_GetTextExtent(lskStr, 0); | 1019 sx = sx + dspl_GetTextExtent(lskStr, 0); |
1020 } | 1020 } |
1021 if (rskStr != NULL) | 1021 if (rskStr != NULL) |
1022 { | 1022 { |
1023 sx = sx + dspl_GetTextExtent(rskStr,0); | 1023 sx = sx + dspl_GetTextExtent(rskStr,0); |
1024 } | 1024 } |
1025 | 1025 |
1026 } | 1026 } |
1027 for (i=DLG_LINE1;i<=DLG_LINE2;i++) | 1027 for (i=DLG_LINE1;i<=DLG_LINE2;i++) |
1028 { | 1028 { |
1029 strLen[i] = dspl_GetTextExtent(str[i],0); | 1029 strLen[i] = dspl_GetTextExtent(str[i],0); |
1030 } | 1030 } |
1031 | 1031 |
1032 /* Work out the desired width of the dialog. If we can wrap line 2 and it is long, wrap it */ | 1032 /* Work out the desired width of the dialog. If we can wrap line 2 and it is long, wrap it */ |
1033 if (data->WrapStrings & WRAP_STRING_2) | 1033 if (data->WrapStrings & WRAP_STRING_2) |
1034 nLines = MAX_WRAP_LINES; | 1034 nLines = MAX_WRAP_LINES; |
1035 else | 1035 else |
1036 nLines = 1; | 1036 nLines = 1; |
1037 #ifdef COLOURDISPLAY | 1037 #ifdef COLOURDISPLAY |
1038 if (data->dlgBgdBitmap!=NULL) | 1038 if (data->dlgBgdBitmap!=NULL) |
1039 { | 1039 { |
1040 //we only have room to split line 2 into 'max_lines_dlg_popup' lines in the pop-up. | 1040 //we only have room to split line 2 into 'max_lines_dlg_popup' lines in the pop-up. |
1041 //NB this should be calculated depending on the height of the popup bitmap. | 1041 //NB this should be calculated depending on the height of the popup bitmap. |
1042 const int max_lines_dlg_popup=2; | 1042 const int max_lines_dlg_popup=2; |
1043 if (nLines>max_lines_dlg_popup) | 1043 if (nLines>max_lines_dlg_popup) |
1044 nLines = max_lines_dlg_popup; | 1044 nLines = max_lines_dlg_popup; |
1045 scrWidth = (data->dlgBgdBitmap->area.sx * 3)/4; //the max width is about 3/4 of the pop-up | 1045 scrWidth = (data->dlgBgdBitmap->area.sx * 3)/4; //the max width is about 3/4 of the pop-up |
1046 if ( (strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) || | 1046 if ( (strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) || |
1047 (strLen[DLG_LINE1] > scrWidth)) | 1047 (strLen[DLG_LINE1] > scrWidth)) |
1048 { | 1048 { |
1049 //recalculate width below. | 1049 //recalculate width below. |
1050 if (data->WrapStrings & WRAP_STRING_2) | 1050 if (data->WrapStrings & WRAP_STRING_2) |
1051 nLines = MAX_WRAP_LINES; | 1051 nLines = MAX_WRAP_LINES; |
1052 fullScreen = DLG_USE_RECTANGLE; | 1052 fullScreen = DLG_USE_RECTANGLE; |
1053 } | 1053 } |
1054 else | 1054 else |
1055 { | 1055 { |
1056 fullScreen = DLG_USE_BITMAP; | 1056 fullScreen = DLG_USE_BITMAP; |
1057 //Leave width as is | 1057 //Leave width as is |
1060 #else | 1060 #else |
1061 //On a C-sample, limit pop-up lines to 2 extra (any more - use entire screen) | 1061 //On a C-sample, limit pop-up lines to 2 extra (any more - use entire screen) |
1062 { | 1062 { |
1063 const int max_lines_dlg_popup=2; | 1063 const int max_lines_dlg_popup=2; |
1064 if (nLines>max_lines_dlg_popup) | 1064 if (nLines>max_lines_dlg_popup) |
1065 nLines = max_lines_dlg_popup; | 1065 nLines = max_lines_dlg_popup; |
1066 } | 1066 } |
1067 | 1067 |
1068 #endif | 1068 #endif |
1069 if (fullScreen == DLG_USE_RECTANGLE) | 1069 if (fullScreen == DLG_USE_RECTANGLE) |
1070 { | 1070 { |
1071 //see if we can display as a pop-up | 1071 //see if we can display as a pop-up |
1072 if (SCREEN_SIZE_X < 128) | 1072 if (SCREEN_SIZE_X < 128) |
1073 scrWidth = SCREEN_SIZE_X-6; | 1073 scrWidth = SCREEN_SIZE_X-6; |
1074 else | 1074 else |
1075 scrWidth = (SCREEN_SIZE_X*7)/8; | 1075 scrWidth = (SCREEN_SIZE_X*7)/8; |
1076 if ( strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) | 1076 if ( strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) |
1077 { | 1077 { |
1078 //Cannot fit in as a pop-up - use full screen | 1078 //Cannot fit in as a pop-up - use full screen |
1079 fullScreen = DLG_USE_FULL_SCREEN; | 1079 fullScreen = DLG_USE_FULL_SCREEN; |
1080 scrWidth = SCREEN_SIZE_X; | 1080 scrWidth = SCREEN_SIZE_X; |
1082 else | 1082 else |
1083 { | 1083 { |
1084 //We can fit it in - but we may want to reduce the width for a nicer look. | 1084 //We can fit it in - but we may want to reduce the width for a nicer look. |
1085 } | 1085 } |
1086 } | 1086 } |
1087 | 1087 |
1088 /* | 1088 /* |
1089 * Wrap second text line (e.g. for long phone numbers.) | 1089 * Wrap second text line (e.g. for long phone numbers.) |
1090 */ | 1090 */ |
1091 if (strLen[DLG_LINE2] > scrWidth-charWidth) | 1091 if (strLen[DLG_LINE2] > scrWidth-charWidth) |
1092 { | 1092 { |
1101 // memset is not required any more . | 1101 // memset is not required any more . |
1102 //Now the last element of the str[] will point to the second string of the dialog | 1102 //Now the last element of the str[] will point to the second string of the dialog |
1103 str[MAX_DLG_LINES] = str[DLG_LINE2]; // Now move the second line of text to the last element of the arrya | 1103 str[MAX_DLG_LINES] = str[DLG_LINE2]; // Now move the second line of text to the last element of the arrya |
1104 strLen[MAX_DLG_LINES] = strLen[DLG_LINE2];// put the right value for the length of the string | 1104 strLen[MAX_DLG_LINES] = strLen[DLG_LINE2];// put the right value for the length of the string |
1105 str[DLG_LINE2] = NULL ; // Assign NULL to the second element of the array. | 1105 str[DLG_LINE2] = NULL ; // Assign NULL to the second element of the array. |
1106 while ((wrapLine < MAX_WRAP_LINES) && (linePos<lineLen)) | 1106 while ((wrapLine < MAX_WRAP_LINES) && (linePos<lineLen)) |
1107 { | 1107 { |
1108 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1108 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1109 // Instead of DLG_LINE2 use MAX_DLG_LINES | 1109 // Instead of DLG_LINE2 use MAX_DLG_LINES |
1110 nChar = dspl_GetNcharToFit (&str[MAX_DLG_LINES][linePos], (USHORT)scrWidth); | 1110 nChar = dspl_GetNcharToFit (&str[MAX_DLG_LINES][linePos], (USHORT)scrWidth); |
1111 if (nChar > MAX_WRAP_CHAR) | 1111 if (nChar > MAX_WRAP_CHAR) |
1112 nChar = MAX_WRAP_CHAR; | 1112 nChar = MAX_WRAP_CHAR; |
1113 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1113 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1114 // Allocate MAX_WRAP_CHAR no of bytes | 1114 // Allocate MAX_WRAP_CHAR no of bytes |
1115 temp_ptr = (char*)mfwAlloc(MAX_WRAP_CHAR); | 1115 temp_ptr = (char*)mfwAlloc(MAX_WRAP_CHAR); |
1116 if(NULL == temp_ptr) | 1116 if(NULL == temp_ptr) |
1117 return 0; | 1117 return 0; |
1118 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1118 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1119 // Now the destination of memcpy is temp_ptr instead of str2[wrapLine] and the source is str[MAX_DLG_LINES] instead of str[DLG_LINE2] | 1119 // Now the destination of memcpy is temp_ptr instead of str2[wrapLine] and the source is str[MAX_DLG_LINES] instead of str[DLG_LINE2] |
1120 memcpy(temp_ptr,&str[MAX_DLG_LINES][linePos],nChar); // Now the source data is from the last element of the array. | 1120 memcpy(temp_ptr,&str[MAX_DLG_LINES][linePos],nChar); // Now the source data is from the last element of the array. |
1121 linePos = linePos+nChar; | 1121 linePos = linePos+nChar; |
1122 ////GW - even if we cannot display the entire string - it is better than what we would have otherwise | 1122 ////GW - even if we cannot display the entire string - it is better than what we would have otherwise |
1123 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1123 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1124 // Assign the value of pointer temp_ptr to str[] | 1124 // Assign the value of pointer temp_ptr to str[] |
1125 str[DLG_LINE2+wrapLine] = temp_ptr; | 1125 str[DLG_LINE2+wrapLine] = temp_ptr; |
1126 temp_ptr = NULL; | 1126 temp_ptr = NULL; |
1127 strLen[DLG_LINE2 + wrapLine] = dspl_GetTextExtent(str[DLG_LINE2+wrapLine],0); | 1127 strLen[DLG_LINE2 + wrapLine] = dspl_GetTextExtent(str[DLG_LINE2+wrapLine],0); |
1128 wrapLine++; | 1128 wrapLine++; |
1129 } | 1129 } |
1130 | 1130 |
1131 } | 1131 } |
1132 else | 1132 else |
1133 { | 1133 { |
1134 //Unicode is more problematic - we need the 0x80 at the front of the string | 1134 //Unicode is more problematic - we need the 0x80 at the front of the string |
1135 //for the call to 'dspl_GetNcharToFit'. This will involve copying the entire remainder | 1135 //for the call to 'dspl_GetNcharToFit'. This will involve copying the entire remainder |
1136 //of 'str2' into a temporary buffer. At the moment, we only wrap numbers so this | 1136 //of 'str2' into a temporary buffer. At the moment, we only wrap numbers so this |
1137 //code will wait until it is required. | 1137 //code will wait until it is required. |
1138 // str[3] = "Code not written!!"; //issue warning | 1138 // str[3] = "Code not written!!"; //issue warning |
1139 // strLen[3] = dspl_GetTextExtent(str[3],0); | 1139 // strLen[3] = dspl_GetTextExtent(str[3],0); |
1140 fullScreen = DLG_USE_FULL_SCREEN; //error - use full screen | 1140 fullScreen = DLG_USE_FULL_SCREEN; //error - use full screen |
1141 } | 1141 } |
1142 } | 1142 } |
1143 } | 1143 } |
1144 | 1144 |
1145 //Calculate longest line of text (including softkeys - sx already set to the softkey width) | 1145 //Calculate longest line of text (including softkeys - sx already set to the softkey width) |
1146 for (i=0;i< MAX_DLG_LINES;i++) | 1146 for (i=0;i< MAX_DLG_LINES;i++) |
1147 { | 1147 { |
1148 if (strLen[i]>sx) | 1148 if (strLen[i]>sx) |
1149 sx = strLen[i]; | 1149 sx = strLen[i]; |
1150 } | 1150 } |
1151 if (sx > SCREEN_SIZE_X-charWidth) | 1151 if (sx > SCREEN_SIZE_X-charWidth) |
1152 sx = SCREEN_SIZE_X; | 1152 sx = SCREEN_SIZE_X; |
1153 else | 1153 else |
1155 if (sx > SCREEN_SIZE_X/2) | 1155 if (sx > SCREEN_SIZE_X/2) |
1156 sx = sx + charWidth; | 1156 sx = sx + charWidth; |
1157 else | 1157 else |
1158 sx = sx + charWidth*2; | 1158 sx = sx + charWidth*2; |
1159 } | 1159 } |
1160 if (sy> sx) | 1160 if (sy> sx) |
1161 sx = sy; | 1161 sx = sy; |
1162 wx = (SCREEN_SIZE_X-sx)/2; | 1162 wx = (SCREEN_SIZE_X-sx)/2; |
1163 if (wx<0) | 1163 if (wx<0) |
1164 wx=0; | 1164 wx=0; |
1165 } | 1165 } |
1166 | 1166 |
1167 if (sy > SCREEN_SIZE_Y) | 1167 if (sy > SCREEN_SIZE_Y) |
1168 wy = 0; | 1168 wy = 0; |
1169 else if (SCREEN_SIZE_Y > 2*sy) | 1169 else if (SCREEN_SIZE_Y > 2*sy) |
1170 wy = (SCREEN_SIZE_Y*2/3-sy)/2; //display in middle of top 2/3 of screen | 1170 wy = (SCREEN_SIZE_Y*2/3-sy)/2; //display in middle of top 2/3 of screen |
1171 else | 1171 else |
1172 wy = (SCREEN_SIZE_Y-sy)/2; //display in middle of screen | 1172 wy = (SCREEN_SIZE_Y-sy)/2; //display in middle of screen |
1173 if (wy < 10) | 1173 if (wy < 10) |
1174 wy = wy/2; | 1174 wy = wy/2; |
1175 | 1175 |
1176 if ((wx == 0) || (wy==0)) | 1176 if ((wx == 0) || (wy==0)) |
1177 { //not enough room to display as a window - use whole screen | 1177 { //not enough room to display as a window - use whole screen |
1178 fullScreen = DLG_USE_FULL_SCREEN; | 1178 fullScreen = DLG_USE_FULL_SCREEN; |
1179 } | 1179 } |
1180 | 1180 |
1181 #ifdef COLOURDISPLAY | 1181 #ifdef COLOURDISPLAY |
1182 if ((data->icon_array != NULL) && (fullScreen != DLG_USE_BITMAP)) | 1182 if ((data->icon_array != NULL) && (fullScreen != DLG_USE_BITMAP)) |
1183 { //The dialog has an animation - we must make the pop-up large enough to support this | 1183 { //The dialog has an animation - we must make the pop-up large enough to support this |
1184 if (sx < data->icon_array[0].area.sx) | 1184 if (sx < data->icon_array[0].area.sx) |
1185 sx = data->icon_array[0].area.sx; | 1185 sx = data->icon_array[0].area.sx; |
1186 yBmpOfs = data->icon_array[0].area.py + data->icon_array[0].area.sy; | 1186 yBmpOfs = data->icon_array[0].area.py + data->icon_array[0].area.sy; |
1187 wy = data->icon_array[0].area.py; | 1187 wy = data->icon_array[0].area.py; |
1188 sy = sy + data->icon_array[0].area.sy; | 1188 sy = sy + data->icon_array[0].area.sy; |
1189 } | 1189 } |
1190 #endif | 1190 #endif |
1191 } | 1191 } |
1192 else | 1192 else |
1193 { | 1193 { |
1194 //We have no strings to display - clear entire screen | 1194 //We have no strings to display - clear entire screen |
1195 fullScreen = DLG_USE_FULL_SCREEN; | 1195 fullScreen = DLG_USE_FULL_SCREEN; |
1196 } | 1196 } |
1197 | 1197 |
1198 | 1198 |
1205 area.py = 0; | 1205 area.py = 0; |
1206 area.sx = sx; | 1206 area.sx = sx; |
1207 area.sy = sy; | 1207 area.sy = sy; |
1208 resources_setColour(data->dlgCol); | 1208 resources_setColour(data->dlgCol); |
1209 drawWinType = DSPL_WIN_CENTRE; | 1209 drawWinType = DSPL_WIN_CENTRE; |
1210 | 1210 |
1211 if (fullScreen!=DLG_USE_FULL_SCREEN) | 1211 if (fullScreen!=DLG_USE_FULL_SCREEN) |
1212 { | 1212 { |
1213 t_font_bitmap bmp; | 1213 t_font_bitmap bmp; |
1214 t_font_bitmap* bmpPtr = NULL; | 1214 t_font_bitmap* bmpPtr = NULL; |
1215 | 1215 |
1217 { | 1217 { |
1218 //centre text | 1218 //centre text |
1219 xPos[i] = wx+(sx-strLen[i])/2; | 1219 xPos[i] = wx+(sx-strLen[i])/2; |
1220 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; | 1220 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; |
1221 } | 1221 } |
1222 | 1222 |
1223 #ifdef COLOURDISPLAY | 1223 #ifdef COLOURDISPLAY |
1224 if ((data->dlgBgdBitmap != NULL) && (fullScreen==DLG_USE_BITMAP)) | 1224 if ((data->dlgBgdBitmap != NULL) && (fullScreen==DLG_USE_BITMAP)) |
1225 { | 1225 { |
1226 bmp.format = data->dlgBgdBitmap->icnType; | 1226 bmp.format = data->dlgBgdBitmap->icnType; |
1227 bmp.height = data->dlgBgdBitmap->area.sy; | 1227 bmp.height = data->dlgBgdBitmap->area.sy; |
1243 { | 1243 { |
1244 xPos[i] = xPos[i] + area.px; | 1244 xPos[i] = xPos[i] + area.px; |
1245 yPos[i] = yPos[i] + area.py; | 1245 yPos[i] = yPos[i] + area.py; |
1246 } | 1246 } |
1247 | 1247 |
1248 TRACE_EVENT_P3("wy = %d, yOfs = %d, area.py = %d",wy,yOfs,area.py); | 1248 TRACE_EVENT_P3("wy = %d, yOfs = %d, area.py = %d",wy,yOfs,area.py); |
1249 if( data->dlgBgdBitmap->icnType != ICON_TYPE_1BIT_UNPACKED ) | 1249 if( data->dlgBgdBitmap->icnType != ICON_TYPE_1BIT_UNPACKED ) |
1250 dspl_SetBgdColour( COL_TRANSPARENT ); | 1250 dspl_SetBgdColour( COL_TRANSPARENT ); |
1251 | 1251 |
1252 | 1252 |
1253 } | 1253 } |
1254 else | 1254 else |
1255 { | 1255 { |
1256 // x0066814 06 Dec 2006, OMAPS00106825 | 1256 // x0066814 06 Dec 2006, OMAPS00106825 |
1257 //The window height calculation related to wrapping should be skipped when no | 1257 //The window height calculation related to wrapping should be skipped when no |
1258 //string wrapping is done | 1258 //string wrapping is done |
1259 if(wrapLine>0) | 1259 if(wrapLine>0) |
1260 { | 1260 { |
1261 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); | 1261 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); |
1262 } | 1262 } |
1265 #else | 1265 #else |
1266 if (wrapLine>1) | 1266 if (wrapLine>1) |
1267 { | 1267 { |
1268 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); | 1268 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); |
1269 area.sy = sy; | 1269 area.sy = sy; |
1270 } | 1270 } |
1271 #endif | 1271 #endif |
1272 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1272 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1273 //If length of the dialog is bigger than screen then start the dialog from the top corner. | 1273 //If length of the dialog is bigger than screen then start the dialog from the top corner. |
1274 if(sy+wy >= SCREEN_SIZE_Y && sy < SCREEN_SIZE_Y) | 1274 if(sy+wy >= SCREEN_SIZE_Y && sy < SCREEN_SIZE_Y) |
1275 if(wy>0 && wy < sy) | 1275 if(wy>0 && wy < sy) |
1276 { | 1276 { |
1277 wy = (SCREEN_SIZE_Y - sy ) /2 ;// centre the dialog | 1277 wy = (SCREEN_SIZE_Y - sy ) /2 ;// centre the dialog |
1278 if(wy < 0) | 1278 if(wy < 0) |
1279 wy=0; | 1279 wy=0; |
1280 for (i=0;i<MAX_DLG_LINES;i++) | 1280 for (i=0;i<MAX_DLG_LINES;i++) |
1281 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; | 1281 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; |
1282 } | 1282 } |
1283 dspl_DrawWin( wx,wy,sx,sy, drawWinType , bmpPtr); | 1283 dspl_DrawWin( wx,wy,sx,sy, drawWinType , bmpPtr); |
1284 } | 1284 } |
1285 else | 1285 else |
1286 { | 1286 { |
1287 dspl_ClearAll(); | 1287 dspl_ClearAll(); |
1288 sx = 84; | 1288 sx = 84; |
1289 for (i=0;i<MAX_DLG_LINES;i++) | 1289 for (i=0;i<MAX_DLG_LINES;i++) |
1290 { | 1290 { |
1291 xPos[i] = 0; | 1291 xPos[i] = 0; |
1292 yPos[i] = Mmi_layout_line(i+1); | 1292 yPos[i] = Mmi_layout_line(i+1); |
1303 else | 1303 else |
1304 { | 1304 { |
1305 skArea.px = area.px+wx; | 1305 skArea.px = area.px+wx; |
1306 skArea.sx = area.sx; | 1306 skArea.sx = area.sx; |
1307 skArea.py = area.py+wy+area.sy-Mmi_layout_softkeyHeight()-1; | 1307 skArea.py = area.py+wy+area.sy-Mmi_layout_softkeyHeight()-1; |
1308 skArea.sy = Mmi_layout_softkeyHeight(); | 1308 skArea.sy = Mmi_layout_softkeyHeight(); |
1309 } | 1309 } |
1310 softKeys_displayStrXY(lskStr, rskStr, data->dlgSkFormat, data->dlgCol, &skArea); | 1310 softKeys_displayStrXY(lskStr, rskStr, data->dlgSkFormat, data->dlgCol, &skArea); |
1311 } | 1311 } |
1312 | 1312 |
1313 /****************************** | 1313 /****************************** |
1314 * Print dialog text | 1314 * Print dialog text |
1315 *****************************/ | 1315 *****************************/ |
1316 for (i=0;i<MAX_DLG_LINES;i++) | 1316 for (i=0;i<MAX_DLG_LINES;i++) |
1317 { /* GW#2294 No need to draw zero length strings .*/ | 1317 { /* GW#2294 No need to draw zero length strings .*/ |
1318 if ((str[i] != NULL) && (strLen[i] > 0)) | 1318 if ((str[i] != NULL) && (strLen[i] > 0)) |
1319 { | 1319 { |
1320 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 1320 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
1321 #ifdef FF_MMI_SAT_ICON | 1321 #ifdef FF_MMI_SAT_ICON |
1322 if(data->IconData.selfExplanatory == FALSE) | 1322 if(data->IconData.selfExplanatory == FALSE) |
1323 dspl_TextOut(xPos[i] + titleIconWidth, yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); | 1323 dspl_TextOut(xPos[i] + titleIconWidth, yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); |
1324 #else | 1324 #else |
1325 dspl_TextOut(xPos[i] , yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); | 1325 dspl_TextOut(xPos[i] , yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); |
1326 #endif | 1326 #endif |
1327 } | 1327 } |
1328 } | 1328 } |
1329 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 1329 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
1330 #ifdef FF_MMI_SAT_ICON | 1330 #ifdef FF_MMI_SAT_ICON |
1331 if(data->IconData.dst != NULL) | 1331 if(data->IconData.dst != NULL) |
1332 { | 1332 { |
1333 if(str[DLG_LINE2] == NULL) | 1333 if(str[DLG_LINE2] == NULL) |
1334 { | 1334 { |
1335 if ((data->IconData.width > TITLE_ICON_WIDTH) || | 1335 if ((data->IconData.width > TITLE_ICON_WIDTH) || |
1336 (data->IconData.height > TITLE_ICON_HEIGHT)) | 1336 (data->IconData.height > TITLE_ICON_HEIGHT)) |
1337 { | 1337 { |
1338 dspl_BitBlt2(xPos[0], yPos[0], 8, | 1338 dspl_BitBlt2(xPos[0], yPos[0], 8, |
1339 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); | 1339 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); |
1340 } | 1340 } |
1341 | 1341 |
1342 else | 1342 else |
1343 dspl_BitBlt2(xPos[0], yPos[0], data->IconData.width, | 1343 dspl_BitBlt2(xPos[0], yPos[0], data->IconData.width, |
1344 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); | 1344 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); |
1345 } | 1345 } |
1346 else | 1346 else |
1347 { | 1347 { |
1348 if ((data->IconData.width > TITLE_ICON_WIDTH) || | 1348 if ((data->IconData.width > TITLE_ICON_WIDTH) || |
1349 (data->IconData.height > TITLE_ICON_HEIGHT)) | 1349 (data->IconData.height > TITLE_ICON_HEIGHT)) |
1350 { | 1350 { |
1351 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2], 8, | 1351 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2], 8, |
1352 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); | 1352 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); |
1353 } | 1353 } |
1354 else | 1354 else |
1355 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2],data->IconData.width, | 1355 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2],data->IconData.width, |
1356 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); | 1356 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); |
1357 } | 1357 } |
1358 | 1358 |
1359 } | 1359 } |
1360 #endif | 1360 #endif |
1361 | 1361 |
1362 | 1362 |
1363 resources_restoreColour(); | 1363 resources_restoreColour(); |
1364 } | 1364 } |
1365 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1365 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1366 // Now free the allocated memory | 1366 // Now free the allocated memory |
1367 /* x0039928 - Lint warning removal */ | 1367 /* x0039928 - Lint warning removal */ |
1368 if (strLen[MAX_DLG_LINES] > scrWidth-charWidth) | 1368 if (strLen[MAX_DLG_LINES] > scrWidth-charWidth) |
1369 if (data->WrapStrings & WRAP_STRING_2) | 1369 if (data->WrapStrings & WRAP_STRING_2) |
1370 if (str[MAX_DLG_LINES][0] != (char)0x80) /* x0039928 - lint warning removal */ | 1370 if (str[MAX_DLG_LINES][0] != (char)0x80) /* x0039928 - lint warning removal */ |
1371 { | 1371 { |
1372 for(i=DLG_LINE2;i<MAX_DLG_LINES;i++) | 1372 for(i=DLG_LINE2;i<MAX_DLG_LINES;i++) |
1373 { | 1373 { |
1374 if(NULL != str[i] && strLen[i] > 0) | 1374 if(NULL != str[i] && strLen[i] > 0) |
1375 mfwFree((U8*)str[i],MAX_WRAP_CHAR); | 1375 mfwFree((U8*)str[i],MAX_WRAP_CHAR); |
1376 } | 1376 } |
1377 str[MAX_DLG_LINES]=NULL; | 1377 str[MAX_DLG_LINES]=NULL; |
1378 } | 1378 } |
1379 | 1379 |
1380 break; | 1380 break; |
1381 default: | 1381 default: |
1382 return 0; | 1382 return 0; |
1383 } | 1383 } |
1384 | 1384 |
1385 return 1; | 1385 return 1; |
1386 } | 1386 } |
1387 | 1387 |
1388 /******************************************************************************* | 1388 /******************************************************************************* |
1389 | 1389 |
1390 $Function: dialog_info_tim_cb | 1390 $Function: dialog_info_tim_cb |
1391 | 1391 |
1392 $Description: Callback function for the dialog info timer. | 1392 $Description: Callback function for the dialog info timer. |
1393 | 1393 |
1394 | 1394 |
1395 $Returns: MFW event handler | 1395 $Returns: MFW event handler |
1396 | 1396 |
1397 $Arguments: window handle event, timer control block | 1397 $Arguments: window handle event, timer control block |
1398 | 1398 |
1399 *******************************************************************************/ | 1399 *******************************************************************************/ |
1420 #endif | 1420 #endif |
1421 | 1421 |
1422 /* | 1422 /* |
1423 ** SPR#1744 NDH | 1423 ** SPR#1744 NDH |
1424 ** Move the dialog destory in front of the Callback to make the processing consistent | 1424 ** Move the dialog destory in front of the Callback to make the processing consistent |
1425 ** with the Right Keypress and Hangup Processing. Also to ensure that the dialog is | 1425 ** with the Right Keypress and Hangup Processing. Also to ensure that the dialog is |
1426 ** removed when the screen is redrawn. | 1426 ** removed when the screen is redrawn. |
1427 */ | 1427 */ |
1428 dialog_info_destroy (win); | 1428 dialog_info_destroy (win); |
1429 | 1429 |
1430 //TISH modified for MSIM | 1430 //TISH modified for MSIM |
1459 | 1459 |
1460 TRACE_FUNCTION("dialog_info_kbd_cb"); | 1460 TRACE_FUNCTION("dialog_info_kbd_cb"); |
1461 switch (keyboard->code) | 1461 switch (keyboard->code) |
1462 { | 1462 { |
1463 case KCD_LEFT: | 1463 case KCD_LEFT: |
1464 if (data->KeyEvents & KEY_LEFT ) | 1464 if (data->KeyEvents & KEY_LEFT ) |
1465 { | 1465 { |
1466 TRACE_EVENT("dialog_info_kbd_cb: KEY_LEFT"); | 1466 TRACE_EVENT("dialog_info_kbd_cb: KEY_LEFT"); |
1467 | 1467 |
1468 dialog_info_destroy (win); | 1468 dialog_info_destroy (win); |
1469 if (Callback) | 1469 if (Callback) |
1470 (Callback) (parent_win, Identifier, INFO_KCD_LEFT); | 1470 (Callback) (parent_win, Identifier, INFO_KCD_LEFT); |
1471 } | 1471 } |
1472 break; | 1472 break; |
1473 | 1473 |
1474 case KCD_RIGHT: | 1474 case KCD_RIGHT: |
1475 if (data->KeyEvents & KEY_RIGHT) | 1475 if (data->KeyEvents & KEY_RIGHT) |
1476 { | 1476 { |
1477 dialog_info_destroy (win); | 1477 dialog_info_destroy (win); |
1478 if (Callback) | 1478 if (Callback) |
1479 (Callback) (parent_win, Identifier, INFO_KCD_RIGHT); | 1479 (Callback) (parent_win, Identifier, INFO_KCD_RIGHT); |
1480 } | 1480 } |
1487 if (Callback) | 1487 if (Callback) |
1488 (Callback) (parent_win, Identifier, INFO_KCD_HUP); | 1488 (Callback) (parent_win, Identifier, INFO_KCD_HUP); |
1489 } | 1489 } |
1490 break; | 1490 break; |
1491 case KCD_MNUUP: | 1491 case KCD_MNUUP: |
1492 | 1492 |
1493 if (data->KeyEvents & KEY_MNUUP) | 1493 if (data->KeyEvents & KEY_MNUUP) |
1494 { | 1494 { |
1495 if (Callback) | 1495 if (Callback) |
1496 (Callback) (parent_win, Identifier, INFO_KCD_UP); | 1496 (Callback) (parent_win, Identifier, INFO_KCD_UP); |
1497 } | 1497 } |
1498 | 1498 |
1499 break; | 1499 break; |
1500 case KCD_MNUDOWN: | 1500 case KCD_MNUDOWN: |
1501 | 1501 |
1502 if (data->KeyEvents & KEY_MNUDOWN) | 1502 if (data->KeyEvents & KEY_MNUDOWN) |
1503 { | 1503 { |
1504 if (Callback) | 1504 if (Callback) |
1505 (Callback) (parent_win, Identifier, INFO_KCD_DOWN); | 1505 (Callback) (parent_win, Identifier, INFO_KCD_DOWN); |
1506 } | 1506 } |
1507 | 1507 |
1508 break; | 1508 break; |
1509 //MZ 7/3/01 used to start a call. | 1509 //MZ 7/3/01 used to start a call. |
1510 case KCD_CALL: | 1510 case KCD_CALL: |
1511 if (data->KeyEvents & KEY_CALL ) | 1511 if (data->KeyEvents & KEY_CALL ) |
1512 { | 1512 { |
1513 dialog_info_destroy (win); | 1513 dialog_info_destroy (win); |
1514 if (Callback) | 1514 if (Callback) |
1515 (Callback) (parent_win, Identifier, INFO_KCD_OFFHOOK); | 1515 (Callback) (parent_win, Identifier, INFO_KCD_OFFHOOK); |
1516 } | 1516 } |
1530 if (Callback) | 1530 if (Callback) |
1531 (Callback) (parent_win, Identifier, INFO_KCD_ALL); | 1531 (Callback) (parent_win, Identifier, INFO_KCD_ALL); |
1532 } | 1532 } |
1533 break; | 1533 break; |
1534 | 1534 |
1535 } | 1535 } |
1536 return MFW_EVENT_CONSUMED; | 1536 return MFW_EVENT_CONSUMED; |
1537 } | 1537 } |
1538 | 1538 |
1539 static int dialog_info_kbd_long_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard){ | 1539 static int dialog_info_kbd_long_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard){ |
1540 return MFW_EVENT_CONSUMED; | 1540 return MFW_EVENT_CONSUMED; |
1544 | 1544 |
1545 /******************************************************************************* | 1545 /******************************************************************************* |
1546 | 1546 |
1547 $Function: mmi_dialog_information_screen | 1547 $Function: mmi_dialog_information_screen |
1548 | 1548 |
1549 $Description: | 1549 $Description: |
1550 | 1550 |
1551 $Returns: | 1551 $Returns: |
1552 | 1552 |
1553 $Arguments: | 1553 $Arguments: |
1554 | 1554 |
1555 *******************************************************************************/ | 1555 *******************************************************************************/ |
1556 | 1556 |
1557 T_MFW_HND mmi_dialog_information_screen(T_MFW_HND parent_win, int TxtId, char* text, T_VOID_FUNC call_back, USHORT identifier) | 1557 T_MFW_HND mmi_dialog_information_screen(T_MFW_HND parent_win, int TxtId, char* text, T_VOID_FUNC call_back, USHORT identifier) |
1558 { | 1558 { |
1559 T_DISPLAY_DATA display_info; | 1559 T_DISPLAY_DATA display_info; |
1560 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtId, TxtNull, COLOUR_STATUS); | 1560 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtId, TxtNull, COLOUR_STATUS); |
1561 dlg_initDisplayData_events( &display_info, call_back, THREE_SECS, KEY_ALL ); | 1561 dlg_initDisplayData_events( &display_info, call_back, THREE_SECS, KEY_ALL ); |
1562 //Sep 01, 2004 REF: CRR 21380 Deepa M.D | 1562 //Sep 01, 2004 REF: CRR 21380 Deepa M.D |
1563 //Assigning TextId and TextString will not display both the messages. | 1563 //Assigning TextId and TextString will not display both the messages. |
1564 //Hence we need to use TextId and TextString2 or TextId2 and TextString | 1564 //Hence we need to use TextId and TextString2 or TextId2 and TextString |
1565 display_info.TextString2 = text; | 1565 display_info.TextString2 = text; |
1566 display_info.Identifier = identifier; | 1566 display_info.Identifier = identifier; |
1567 return info_dialog(parent_win,&display_info); //information screen | 1567 return info_dialog(parent_win,&display_info); //information screen |
1568 | 1568 |
1569 } | 1569 } |
1570 | 1570 |
1571 T_MFW_HND mmi_dialog_information_screen_forever(MfwHnd win,int TextId, char* TextStr, int colour) | 1571 T_MFW_HND mmi_dialog_information_screen_forever(MfwHnd win,int TextId, char* TextStr, int colour) |
1572 { | 1572 { |
1573 T_DISPLAY_DATA DisplayInfo; | 1573 T_DISPLAY_DATA DisplayInfo; |
1579 | 1579 |
1580 /******************************************************************************* | 1580 /******************************************************************************* |
1581 | 1581 |
1582 $Function: mmi_dialogs_insert_icon | 1582 $Function: mmi_dialogs_insert_icon |
1583 | 1583 |
1584 $Description: Displays one icon in a dialog | 1584 $Description: Displays one icon in a dialog |
1585 | 1585 |
1586 $Returns: none | 1586 $Returns: none |
1587 | 1587 |
1588 $Arguments: win, pointer to an icon | 1588 $Arguments: win, pointer to an icon |
1589 | 1589 |
1592 { | 1592 { |
1593 T_MFW_WIN * win_data = ((T_MFW_HDR *)win_dialog)->data; | 1593 T_MFW_WIN * win_data = ((T_MFW_HDR *)win_dialog)->data; |
1594 T_dialog_info * data = (T_dialog_info *)win_data->user; | 1594 T_dialog_info * data = (T_dialog_info *)win_data->user; |
1595 | 1595 |
1596 | 1596 |
1597 data->icon = icnCreate(win_dialog,icon,E_ICN_VISIBLE,NULL); | 1597 data->icon = icnCreate(win_dialog,icon,E_ICN_VISIBLE,NULL); |
1598 icnUnhide(data->icon); | 1598 icnUnhide(data->icon); |
1599 winShow(win_dialog); | 1599 winShow(win_dialog); |
1600 | 1600 |
1601 } | 1601 } |
1602 | 1602 |
1603 /******************************************************************************* | 1603 /******************************************************************************* |
1604 | 1604 |
1605 $Function: mmi_dialogs_insert_animation | 1605 $Function: mmi_dialogs_insert_animation |
1617 T_dialog_info * data = (T_dialog_info *)win_data->user; | 1617 T_dialog_info * data = (T_dialog_info *)win_data->user; |
1618 | 1618 |
1619 | 1619 |
1620 data->number_of_frames = number_of_frames; | 1620 data->number_of_frames = number_of_frames; |
1621 data->current_frame = 0; | 1621 data->current_frame = 0; |
1622 data->icon_array = icon; | 1622 data->icon_array = icon; |
1623 data->current_icon = data->icon_array; | 1623 data->current_icon = data->icon_array; |
1624 data->icon = icnCreate(win_dialog,data->current_icon,E_ICN_VISIBLE,NULL); | 1624 data->icon = icnCreate(win_dialog,data->current_icon,E_ICN_VISIBLE,NULL); |
1625 icnUnhide(data->icon); | 1625 icnUnhide(data->icon); |
1626 | 1626 |
1627 data->animation_timer = timCreate(win_dialog,anim_time,(MfwCb)mmi_dialogs_insert_animation_CB); | 1627 data->animation_timer = timCreate(win_dialog,anim_time,(MfwCb)mmi_dialogs_insert_animation_CB); |
1628 timStart(data->animation_timer); | 1628 timStart(data->animation_timer); |
1629 winShow(win_dialog); | 1629 winShow(win_dialog); |
1630 | 1630 |
1631 } | 1631 } |
1632 | 1632 |
1633 /******************************************************************************* | 1633 /******************************************************************************* |
1634 | 1634 |
1635 $Function: mmi_dialogs_insert_animation_CB | 1635 $Function: mmi_dialogs_insert_animation_CB |
1645 { | 1645 { |
1646 T_MFW_HND win = mfw_parent (mfw_header()); | 1646 T_MFW_HND win = mfw_parent (mfw_header()); |
1647 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 1647 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
1648 T_dialog_info * data = (T_dialog_info *)win_data->user; | 1648 T_dialog_info * data = (T_dialog_info *)win_data->user; |
1649 | 1649 |
1650 | 1650 |
1651 icnDelete(data->icon); | 1651 icnDelete(data->icon); |
1652 if (data->current_frame < (data->number_of_frames-1)) | 1652 if (data->current_frame < (data->number_of_frames-1)) |
1653 { | 1653 { |
1654 data->current_frame++; | 1654 data->current_frame++; |
1655 data->current_icon++; | 1655 data->current_icon++; |
1656 } | 1656 } |
1657 else | 1657 else |
1658 { | 1658 { |
1659 data->current_frame = 0; | 1659 data->current_frame = 0; |
1660 data->current_icon = data->icon_array; | 1660 data->current_icon = data->icon_array; |
1661 } | 1661 } |
1662 data->icon = icnCreate(win,data->current_icon,E_ICN_VISIBLE,NULL); | 1662 data->icon = icnCreate(win,data->current_icon,E_ICN_VISIBLE,NULL); |
1663 icnUnhide(data->icon); | 1663 icnUnhide(data->icon); |
1664 timStart(data->animation_timer); | 1664 timStart(data->animation_timer); |
1665 winShow(win); | 1665 winShow(win); |
1666 | 1666 |
1667 } | 1667 } |
1668 /***************************Go-lite Optimization changes Start***********************/ | 1668 /***************************Go-lite Optimization changes Start***********************/ |
1669 | 1669 |
1670 //Aug 25, 2004 REF: CRR 24904 Deepa M.D | 1670 //Aug 25, 2004 REF: CRR 24904 Deepa M.D |
1671 //This function is used only for the Color build.Hence it is put under the | 1671 //This function is used only for the Color build.Hence it is put under the |
1672 //COLOURDISPLAY compiler switch | 1672 //COLOURDISPLAY compiler switch |
1673 #ifdef COLOURDISPLAY | 1673 #ifdef COLOURDISPLAY |
1674 void mmi_dialogs_insert_animation_new (T_DISPLAY_DATA *animateInfo , S32 anim_time ,MfwIcnAttr* icon ,UBYTE number_of_frames) | 1674 void mmi_dialogs_insert_animation_new (T_DISPLAY_DATA *animateInfo , S32 anim_time ,MfwIcnAttr* icon ,UBYTE number_of_frames) |
1675 { | 1675 { |
1676 TRACE_EVENT("mmi_dialogs_insert_animation_new()"); | 1676 TRACE_EVENT("mmi_dialogs_insert_animation_new()"); |
1677 | 1677 |
1678 animateInfo->number_of_frames = number_of_frames; | 1678 animateInfo->number_of_frames = number_of_frames; |
1679 animateInfo->current_frame = 0; | 1679 animateInfo->current_frame = 0; |
1680 animateInfo->icon_array = icon; | 1680 animateInfo->icon_array = icon; |
1681 animateInfo->anim_time = anim_time; | 1681 animateInfo->anim_time = anim_time; |
1682 | 1682 |
1683 } | 1683 } |
1684 #endif | 1684 #endif |
1685 /***************************Go-lite Optimization changes end***********************/ | 1685 /***************************Go-lite Optimization changes end***********************/ |
1686 | 1686 |
1687 void mmi_dialogs_animation_new_CB (T_MFW_EVENT event, T_MFW_TIM *tc) | 1687 void mmi_dialogs_animation_new_CB (T_MFW_EVENT event, T_MFW_TIM *tc) |
1694 MfwIcnAttr* icn_array; | 1694 MfwIcnAttr* icn_array; |
1695 MfwIcnAttr* icn; | 1695 MfwIcnAttr* icn; |
1696 | 1696 |
1697 TRACE_EVENT("mmi_dialogs_insert_animation_new_CB()"); | 1697 TRACE_EVENT("mmi_dialogs_insert_animation_new_CB()"); |
1698 | 1698 |
1699 | 1699 |
1700 | 1700 |
1701 data->current_frame = (data->current_frame +1) % data->number_of_frames; | 1701 data->current_frame = (data->current_frame +1) % data->number_of_frames; |
1702 TRACE_EVENT_P1("data->current_frame = %d", data->current_frame); | 1702 TRACE_EVENT_P1("data->current_frame = %d", data->current_frame); |
1703 TRACE_EVENT_P1("number_of_frames = %d", data->number_of_frames); | 1703 TRACE_EVENT_P1("number_of_frames = %d", data->number_of_frames); |
1704 | 1704 |
1705 icn_array = (MfwIcnAttr*)data->icon_array; | 1705 icn_array = (MfwIcnAttr*)data->icon_array; |
1706 TRACE_EVENT_P1("data->icon_array = %x", (int)data->icon_array); | 1706 TRACE_EVENT_P1("data->icon_array = %x", (int)data->icon_array); |
1707 | 1707 |
1708 icn = &icn_array[data->current_frame]; | 1708 icn = &icn_array[data->current_frame]; |
1709 | 1709 |
1710 px = icn->area.px; | 1710 px = icn->area.px; |
1711 py = icn->area.py; | 1711 py = icn->area.py; |
1712 sx = icn->area.sx; | 1712 sx = icn->area.sx; |
1713 sy = icn->area.sy; | 1713 sy = icn->area.sy; |
1714 | 1714 |
1715 TRACE_EVENT_P4("px = %d, py = %d, sx = %d, sy = %d", icn->area.px,icn->area.py,icn->area.sx,icn->area.sy); | 1715 TRACE_EVENT_P4("px = %d, py = %d, sx = %d, sy = %d", icn->area.px,icn->area.py,icn->area.sx,icn->area.sy); |
1716 | 1716 |
1717 idData = icn->icons; | 1717 idData = icn->icons; |
1718 | 1718 |
1719 dspl_BitBlt2(px,py,sx,sy,(void*)idData,0,0x02); | 1719 dspl_BitBlt2(px,py,sx,sy,(void*)idData,0,0x02); |
1720 timStart(data->animation_timer); | 1720 timStart(data->animation_timer); |
1721 | 1721 |
1722 } | 1722 } |
1723 //Jun 04,2004 CRR:13601 xpradipg - SASKEN | 1723 //Jun 04,2004 CRR:13601 xpradipg - SASKEN |
1735 | 1735 |
1736 void InfoDialogTimRestart(T_MFW_HND win) | 1736 void InfoDialogTimRestart(T_MFW_HND win) |
1737 { | 1737 { |
1738 T_MFW_WIN * win_data; | 1738 T_MFW_WIN * win_data; |
1739 T_dialog_info * data; | 1739 T_dialog_info * data; |
1740 | 1740 |
1741 win_data = ((T_MFW_HDR *)win)->data; | 1741 win_data = ((T_MFW_HDR *)win)->data; |
1742 data = (T_dialog_info *)win_data->user; | 1742 data = (T_dialog_info *)win_data->user; |
1743 | 1743 |
1744 tim_stop(data->info_tim); | 1744 tim_stop(data->info_tim); |
1745 tim_start(data->info_tim); | 1745 tim_start(data->info_tim); |
1760 | 1760 |
1761 *******************************************************************************/ | 1761 *******************************************************************************/ |
1762 T_MFW_HND mmi_dialog_information_screen_delete_all(MfwHnd win,int TextId, char* TextStr, int colour) | 1762 T_MFW_HND mmi_dialog_information_screen_delete_all(MfwHnd win,int TextId, char* TextStr, int colour) |
1763 { | 1763 { |
1764 T_DISPLAY_DATA DisplayInfo; | 1764 T_DISPLAY_DATA DisplayInfo; |
1765 | 1765 |
1766 dlg_initDisplayData_TextId( &DisplayInfo, TxtNull, TxtNull, TextId, TxtNull, colour); | 1766 dlg_initDisplayData_TextId( &DisplayInfo, TxtNull, TxtNull, TextId, TxtNull, colour); |
1767 dlg_initDisplayData_events( &DisplayInfo, NULL, FOREVER, NULL ); | 1767 dlg_initDisplayData_events( &DisplayInfo, NULL, FOREVER, NULL ); |
1768 DisplayInfo.TextString = TextStr; | 1768 DisplayInfo.TextString = TextStr; |
1769 | 1769 |
1770 return info_dialog(win, &DisplayInfo); | 1770 return info_dialog(win, &DisplayInfo); |
1771 } | 1771 } |
1772 | 1772 |
1773 //x0peela 02 Apr, 2007 ER: OMAPS00122561 | 1773 //x0peela 02 Apr, 2007 ER: OMAPS00122561 |
1774 #ifdef FF_PHONE_LOCK | 1774 #ifdef FF_PHONE_LOCK |
1775 /******************************************************************************* | 1775 /******************************************************************************* |
1776 | 1776 |
1777 $Function: phlock_info_dialog | 1777 $Function: phlock_info_dialog |
1778 | 1778 |
1779 $Description: Common information dialog | 1779 $Description: Common information dialog |
1780 | 1780 |
1781 $Returns: Dialogue info win | 1781 $Returns: Dialogue info win |
1782 | 1782 |
1783 $Arguments: parent win, display info | 1783 $Arguments: parent win, display info |
1784 | 1784 |
1785 *******************************************************************************/ | 1785 *******************************************************************************/ |
1786 T_MFW_HND phlock_info_dialog (T_MFW_HND parent_win, | 1786 T_MFW_HND phlock_info_dialog (T_MFW_HND parent_win, |
1787 T_DISPLAY_DATA * display_info) | 1787 T_DISPLAY_DATA * display_info) |
1788 { | 1788 { |
1789 T_MFW_HND win; | 1789 T_MFW_HND win; |
1790 TRACE_FUNCTION("phlock_info_dialog()"); | 1790 TRACE_FUNCTION("phlock_info_dialog()"); |
1791 display_info->SoftKeyStrings = FALSE; | 1791 display_info->SoftKeyStrings = FALSE; |
1792 | 1792 |
1793 win = phlock_dialog_info_create (parent_win); | 1793 win = phlock_dialog_info_create (parent_win); |
1794 | 1794 |
1795 if (win NEQ NULL) | 1795 if (win NEQ NULL) |
1796 { | 1796 { |
1797 SEND_EVENT (win, DIALOG_INIT, 0, display_info); | 1797 SEND_EVENT (win, DIALOG_INIT, 0, display_info); |
1798 } | 1798 } |
1802 /******************************************************************************* | 1802 /******************************************************************************* |
1803 | 1803 |
1804 $Function: phlock_dialog_info_create | 1804 $Function: phlock_dialog_info_create |
1805 | 1805 |
1806 $Description: Creation of an information dialog | 1806 $Description: Creation of an information dialog |
1807 | 1807 |
1808 $Returns: Dialogue info win | 1808 $Returns: Dialogue info win |
1809 | 1809 |
1810 $Arguments: parent win | 1810 $Arguments: parent win |
1811 | 1811 |
1812 *******************************************************************************/ | 1812 *******************************************************************************/ |
1813 static T_MFW_HND phlock_dialog_info_create (T_MFW_HND parent_win) | 1813 static T_MFW_HND phlock_dialog_info_create (T_MFW_HND parent_win) |
1814 { | 1814 { |
1815 T_MFW_WIN * win_data; | 1815 T_MFW_WIN * win_data; |
1816 T_dialog_info * data = (T_dialog_info *)ALLOC_MEMORY (sizeof (T_dialog_info)); | 1816 T_dialog_info * data = (T_dialog_info *)ALLOC_MEMORY (sizeof (T_dialog_info)); |
1839 /******************************************************************************* | 1839 /******************************************************************************* |
1840 | 1840 |
1841 $Function: phlock_dialog_info_win_resize_cb | 1841 $Function: phlock_dialog_info_win_resize_cb |
1842 | 1842 |
1843 $Description: Creation of an information dialog | 1843 $Description: Creation of an information dialog |
1844 | 1844 |
1845 $Returns: Dialogue info win | 1845 $Returns: Dialogue info win |
1846 | 1846 |
1847 $Arguments: parent win | 1847 $Arguments: parent win |
1848 | 1848 |
1849 *******************************************************************************/ | 1849 *******************************************************************************/ |
1850 static int phlock_dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win) | 1850 static int phlock_dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win) |
1851 { | 1851 { |
1852 T_dialog_info * data = (T_dialog_info *)win->user; | 1852 T_dialog_info * data = (T_dialog_info *)win->user; |
1853 // T_DISPLAY_DATA * display_info; // RAVI | 1853 // T_DISPLAY_DATA * display_info; // RAVI |
1854 int xPos[MAX_DLG_LINES]; | 1854 int xPos[MAX_DLG_LINES]; |
1855 int yPos[MAX_DLG_LINES]; | 1855 int yPos[MAX_DLG_LINES]; |
1856 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1856 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1857 //The size of array str and strlen are increased by 1, so that the last elements holds data | 1857 //The size of array str and strlen are increased by 1, so that the last elements holds data |
1858 // which is used while wrapping the text. | 1858 // which is used while wrapping the text. |
1859 char* str[MAX_DLG_LINES+1]; | 1859 char* str[MAX_DLG_LINES+1]; |
1860 int strLen[MAX_DLG_LINES+1]; | 1860 int strLen[MAX_DLG_LINES+1]; |
1861 int i; | 1861 int i; |
1862 char* lskStr,*rskStr; | 1862 char* lskStr,*rskStr; |
1863 int wx = 0; //,wy,sx=0,sy=0; // RAVI | 1863 int wx = 0; //,wy,sx=0,sy=0; // RAVI |
1864 int wy = 0; // RAVI | 1864 int wy = 0; // RAVI |
1865 int sx = 0; // RAVI | 1865 int sx = 0; // RAVI |
1868 int yOfs; | 1868 int yOfs; |
1869 int yBmpOfs = 0; | 1869 int yBmpOfs = 0; |
1870 MfwRect skArea; | 1870 MfwRect skArea; |
1871 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 1871 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
1872 #ifdef FF_MMI_SAT_ICON | 1872 #ifdef FF_MMI_SAT_ICON |
1873 USHORT titleIconWidth = 0; | 1873 USHORT titleIconWidth = 0; |
1874 #endif | 1874 #endif |
1875 MfwRect area; | 1875 MfwRect area; |
1876 int scrWidth = 0; //available width for the display // RAVI - Assignment to 0. | 1876 int scrWidth = 0; //available width for the display // RAVI - Assignment to 0. |
1877 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1877 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1878 // temp_ptr is used while wrapping the text. | 1878 // temp_ptr is used while wrapping the text. |
1879 // Now str2[][] is not required. | 1879 // Now str2[][] is not required. |
1880 char *temp_ptr; | 1880 char *temp_ptr; |
1881 int nChar; | 1881 int nChar; |
1882 | 1882 |
1883 /* t_font_bitmap bmp; */ /* Warning Removal - x0020906 - 24-08-2006 */ | 1883 /* t_font_bitmap bmp; */ /* Warning Removal - x0020906 - 24-08-2006 */ |
1884 // t_font_bitmap* bmpPtr = &bmp; // RAVI - Not Referenced. | 1884 // t_font_bitmap* bmpPtr = &bmp; // RAVI - Not Referenced. |
1885 | 1885 |
1886 int drawWinType; | 1886 int drawWinType; |
1887 int nLines; | 1887 int nLines; |
1888 | 1888 |
1889 int linePos=0; | 1889 int linePos=0; |
1890 int lineLen = 0; | 1890 int lineLen = 0; |
1891 int wrapLine = 0; /*GW #2294*/ // x0066814 06 Dec 2006, OMAPS00106825 | 1891 int wrapLine = 0; /*GW #2294*/ // x0066814 06 Dec 2006, OMAPS00106825 |
1892 | 1892 |
1893 const int charWidth = dspl_GetTextExtent("0",1); | 1893 const int charWidth = dspl_GetTextExtent("0",1); |
1894 TRACE_FUNCTION ("phlock_dialog_info_win_resize_cb()"); | 1894 TRACE_FUNCTION ("phlock_dialog_info_win_resize_cb()"); |
1895 | 1895 |
1896 memset(str,'\0',sizeof(str)); /* x0039928 - Lint warning fix */ | 1896 memset(str,'\0',sizeof(str)); /* x0039928 - Lint warning fix */ |
1897 memset(strLen,0,sizeof(strLen)); | 1897 memset(strLen,0,sizeof(strLen)); |
1898 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 1898 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
1899 #ifdef FF_MMI_SAT_ICON | 1899 #ifdef FF_MMI_SAT_ICON |
1900 if (data->IconData.dst != NULL) | 1900 if (data->IconData.dst != NULL) |
1901 { | 1901 { |
1902 if (data->IconData.width > TITLE_ICON_WIDTH) | 1902 if (data->IconData.width > TITLE_ICON_WIDTH) |
1903 { | 1903 { |
1904 titleIconWidth = TITLE_ICON_WIDTH; | 1904 titleIconWidth = TITLE_ICON_WIDTH; |
1905 } | 1905 } |
1906 else | 1906 else |
1907 { | 1907 { |
1908 titleIconWidth = data->IconData.width ; | 1908 titleIconWidth = data->IconData.width ; |
1909 } | 1909 } |
1910 } | 1910 } |
1911 else | 1911 else |
1912 { | 1912 { |
1913 titleIconWidth = 0; | 1913 titleIconWidth = 0; |
1914 } | 1914 } |
1915 | 1915 |
1916 #endif | 1916 #endif |
1917 if (data EQ 0) | 1917 if (data EQ 0) |
1918 return 1; | 1918 return 1; |
1919 | 1919 |
1920 switch (event) | 1920 switch (event) |
1921 { | 1921 { |
1932 str[i]=NULL; | 1932 str[i]=NULL; |
1933 strLen[i]=0; | 1933 strLen[i]=0; |
1934 } | 1934 } |
1935 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1935 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1936 // Assign the values to last elments of the array str and strLen | 1936 // Assign the values to last elments of the array str and strLen |
1937 str[MAX_DLG_LINES] = NULL; | 1937 str[MAX_DLG_LINES] = NULL; |
1938 strLen[MAX_DLG_LINES] = 0; | 1938 strLen[MAX_DLG_LINES] = 0; |
1939 yOfs = Mmi_layout_line_height()/4; | 1939 yOfs = Mmi_layout_line_height()/4; |
1940 if (data->TextId != 0) | 1940 if (data->TextId != 0) |
1941 str[DLG_LINE1] = MmiRsrcGetText( data->TextId); | 1941 str[DLG_LINE1] = MmiRsrcGetText( data->TextId); |
1942 else | 1942 else |
1943 str[DLG_LINE1] = data->TextString; | 1943 str[DLG_LINE1] = data->TextString; |
1944 | 1944 |
1945 if (data->TextId2 != 0) | 1945 if (data->TextId2 != 0) |
1946 str[DLG_LINE2] = MmiRsrcGetText( data->TextId2); | 1946 str[DLG_LINE2] = MmiRsrcGetText( data->TextId2); |
1947 else | 1947 else |
1948 str[DLG_LINE2] = data->TextString2; | 1948 str[DLG_LINE2] = data->TextString2; |
1949 | 1949 |
1950 if (data->SoftKeyStrings!=0) | 1950 if (data->SoftKeyStrings!=0) |
1951 { | 1951 { |
1952 lskStr = data->LSKString; | 1952 lskStr = data->LSKString; |
1953 rskStr = data->RSKString; | 1953 rskStr = data->RSKString; |
1955 else | 1955 else |
1956 { | 1956 { |
1957 if (data->LeftSoftKey != TxtNull) | 1957 if (data->LeftSoftKey != TxtNull) |
1958 lskStr = MmiRsrcGetText(data->LeftSoftKey); | 1958 lskStr = MmiRsrcGetText(data->LeftSoftKey); |
1959 else | 1959 else |
1960 lskStr = NULL; | 1960 lskStr = NULL; |
1961 | 1961 |
1962 if (data->RightSoftKey != TxtNull) | 1962 if (data->RightSoftKey != TxtNull) |
1963 rskStr = MmiRsrcGetText(data->RightSoftKey); | 1963 rskStr = MmiRsrcGetText(data->RightSoftKey); |
1964 else | 1964 else |
1965 rskStr = NULL; | 1965 rskStr = NULL; |
1966 } | 1966 } |
1967 | 1967 |
1968 if ((str[DLG_LINE1]!= NULL) || (str[DLG_LINE2]!=NULL)) | 1968 if ((str[DLG_LINE1]!= NULL) || (str[DLG_LINE2]!=NULL)) |
1969 { //Draw a window for status info | 1969 { //Draw a window for status info |
1970 if (str[DLG_LINE2] == NULL) | 1970 if (str[DLG_LINE2] == NULL) |
1971 { | 1971 { |
1972 sy = Mmi_layout_line_height()+yOfs*2; // 18 or 12 | 1972 sy = Mmi_layout_line_height()+yOfs*2; // 18 or 12 |
1973 | 1973 |
1974 } | 1974 } |
1975 else | 1975 else |
1976 { | 1976 { |
1977 sy = Mmi_layout_line_height()*2+yOfs*3; // 33 or 22 | 1977 sy = Mmi_layout_line_height()*2+yOfs*3; // 33 or 22 |
1978 } | 1978 } |
1979 | 1979 |
1980 //MC, if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) | 1980 //MC, if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) |
1981 { //calculate longest string - use this to calc width of window | 1981 { //calculate longest string - use this to calc width of window |
1982 sx = 0; | 1982 sx = 0; |
1983 if ((lskStr!=NULL) || (rskStr!=NULL)) | 1983 if ((lskStr!=NULL) || (rskStr!=NULL)) |
1984 { | 1984 { |
1985 sy = sy+Mmi_layout_softkeyHeight()+yOfs*2; | 1985 sy = sy+Mmi_layout_softkeyHeight()+yOfs*2; |
1986 sx = sx + 10; | 1986 sx = sx + 10; |
1987 if (lskStr != NULL) | 1987 if (lskStr != NULL) |
1988 { | 1988 { |
1989 sx = sx + dspl_GetTextExtent(lskStr, 0); | 1989 sx = sx + dspl_GetTextExtent(lskStr, 0); |
1990 } | 1990 } |
1991 if (rskStr != NULL) | 1991 if (rskStr != NULL) |
1992 { | 1992 { |
1993 sx = sx + dspl_GetTextExtent(rskStr,0); | 1993 sx = sx + dspl_GetTextExtent(rskStr,0); |
1994 } | 1994 } |
1995 | 1995 |
1996 } | 1996 } |
1997 for (i=DLG_LINE1;i<=DLG_LINE2;i++) | 1997 for (i=DLG_LINE1;i<=DLG_LINE2;i++) |
1998 { | 1998 { |
1999 strLen[i] = dspl_GetTextExtent(str[i],0); | 1999 strLen[i] = dspl_GetTextExtent(str[i],0); |
2000 } | 2000 } |
2001 | 2001 |
2002 /* Work out the desired width of the dialog. If we can wrap line 2 and it is long, wrap it */ | 2002 /* Work out the desired width of the dialog. If we can wrap line 2 and it is long, wrap it */ |
2003 if (data->WrapStrings & WRAP_STRING_2) | 2003 if (data->WrapStrings & WRAP_STRING_2) |
2004 nLines = MAX_WRAP_LINES; | 2004 nLines = MAX_WRAP_LINES; |
2005 else | 2005 else |
2006 nLines = 1; | 2006 nLines = 1; |
2007 #ifdef COLOURDISPLAY | 2007 #ifdef COLOURDISPLAY |
2008 if (data->dlgBgdBitmap!=NULL) | 2008 if (data->dlgBgdBitmap!=NULL) |
2009 { | 2009 { |
2010 //we only have room to split line 2 into 'max_lines_dlg_popup' lines in the pop-up. | 2010 //we only have room to split line 2 into 'max_lines_dlg_popup' lines in the pop-up. |
2011 //NB this should be calculated depending on the height of the popup bitmap. | 2011 //NB this should be calculated depending on the height of the popup bitmap. |
2012 const int max_lines_dlg_popup=2; | 2012 const int max_lines_dlg_popup=2; |
2013 if (nLines>max_lines_dlg_popup) | 2013 if (nLines>max_lines_dlg_popup) |
2014 nLines = max_lines_dlg_popup; | 2014 nLines = max_lines_dlg_popup; |
2015 scrWidth = (data->dlgBgdBitmap->area.sx * 3)/4; //the max width is about 3/4 of the pop-up | 2015 scrWidth = (data->dlgBgdBitmap->area.sx * 3)/4; //the max width is about 3/4 of the pop-up |
2016 if ( (strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) || | 2016 if ( (strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) || |
2017 (strLen[DLG_LINE1] > scrWidth)) | 2017 (strLen[DLG_LINE1] > scrWidth)) |
2018 { | 2018 { |
2019 //recalculate width below. | 2019 //recalculate width below. |
2020 if (data->WrapStrings & WRAP_STRING_2) | 2020 if (data->WrapStrings & WRAP_STRING_2) |
2021 nLines = MAX_WRAP_LINES; | 2021 nLines = MAX_WRAP_LINES; |
2022 fullScreen = DLG_USE_RECTANGLE; | 2022 fullScreen = DLG_USE_RECTANGLE; |
2023 } | 2023 } |
2024 else | 2024 else |
2025 { | 2025 { |
2026 fullScreen = DLG_USE_BITMAP; | 2026 fullScreen = DLG_USE_BITMAP; |
2027 //Leave width as is | 2027 //Leave width as is |
2030 #else | 2030 #else |
2031 //On a C-sample, limit pop-up lines to 2 extra (any more - use entire screen) | 2031 //On a C-sample, limit pop-up lines to 2 extra (any more - use entire screen) |
2032 { | 2032 { |
2033 const int max_lines_dlg_popup=2; | 2033 const int max_lines_dlg_popup=2; |
2034 if (nLines>max_lines_dlg_popup) | 2034 if (nLines>max_lines_dlg_popup) |
2035 nLines = max_lines_dlg_popup; | 2035 nLines = max_lines_dlg_popup; |
2036 } | 2036 } |
2037 | 2037 |
2038 #endif | 2038 #endif |
2039 if (fullScreen == DLG_USE_RECTANGLE) | 2039 if (fullScreen == DLG_USE_RECTANGLE) |
2040 { | 2040 { |
2041 //see if we can display as a pop-up | 2041 //see if we can display as a pop-up |
2042 if (SCREEN_SIZE_X < 128) | 2042 if (SCREEN_SIZE_X < 128) |
2043 scrWidth = SCREEN_SIZE_X-6; | 2043 scrWidth = SCREEN_SIZE_X-6; |
2044 else | 2044 else |
2045 scrWidth = (SCREEN_SIZE_X*7)/8; | 2045 scrWidth = (SCREEN_SIZE_X*7)/8; |
2046 if ( strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) | 2046 if ( strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) |
2047 { | 2047 { |
2048 //Cannot fit in as a pop-up - use full screen | 2048 //Cannot fit in as a pop-up - use full screen |
2049 fullScreen = DLG_USE_FULL_SCREEN; | 2049 fullScreen = DLG_USE_FULL_SCREEN; |
2050 scrWidth = SCREEN_SIZE_X; | 2050 scrWidth = SCREEN_SIZE_X; |
2052 else | 2052 else |
2053 { | 2053 { |
2054 //We can fit it in - but we may want to reduce the width for a nicer look. | 2054 //We can fit it in - but we may want to reduce the width for a nicer look. |
2055 } | 2055 } |
2056 } | 2056 } |
2057 | 2057 |
2058 /* | 2058 /* |
2059 * Wrap second text line (e.g. for long phone numbers.) | 2059 * Wrap second text line (e.g. for long phone numbers.) |
2060 */ | 2060 */ |
2061 if (strLen[DLG_LINE2] > scrWidth-charWidth) | 2061 if (strLen[DLG_LINE2] > scrWidth-charWidth) |
2062 { | 2062 { |
2071 // memset is not required any more . | 2071 // memset is not required any more . |
2072 //Now the last element of the str[] will point to the second string of the dialog | 2072 //Now the last element of the str[] will point to the second string of the dialog |
2073 str[MAX_DLG_LINES] = str[DLG_LINE2]; // Now move the second line of text to the last element of the arrya | 2073 str[MAX_DLG_LINES] = str[DLG_LINE2]; // Now move the second line of text to the last element of the arrya |
2074 strLen[MAX_DLG_LINES] = strLen[DLG_LINE2];// put the right value for the length of the string | 2074 strLen[MAX_DLG_LINES] = strLen[DLG_LINE2];// put the right value for the length of the string |
2075 str[DLG_LINE2] = NULL ; // Assign NULL to the second element of the array. | 2075 str[DLG_LINE2] = NULL ; // Assign NULL to the second element of the array. |
2076 while ((wrapLine < MAX_WRAP_LINES) && (linePos<lineLen)) | 2076 while ((wrapLine < MAX_WRAP_LINES) && (linePos<lineLen)) |
2077 { | 2077 { |
2078 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 2078 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
2079 // Instead of DLG_LINE2 use MAX_DLG_LINES | 2079 // Instead of DLG_LINE2 use MAX_DLG_LINES |
2080 nChar = dspl_GetNcharToFit (&str[MAX_DLG_LINES][linePos], (USHORT)scrWidth); | 2080 nChar = dspl_GetNcharToFit (&str[MAX_DLG_LINES][linePos], (USHORT)scrWidth); |
2081 if (nChar > MAX_WRAP_CHAR) | 2081 if (nChar > MAX_WRAP_CHAR) |
2082 nChar = MAX_WRAP_CHAR; | 2082 nChar = MAX_WRAP_CHAR; |
2083 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 2083 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
2084 // Allocate MAX_WRAP_CHAR no of bytes | 2084 // Allocate MAX_WRAP_CHAR no of bytes |
2085 temp_ptr = (char*)mfwAlloc(MAX_WRAP_CHAR); | 2085 temp_ptr = (char*)mfwAlloc(MAX_WRAP_CHAR); |
2086 if(NULL == temp_ptr) | 2086 if(NULL == temp_ptr) |
2087 return 0; | 2087 return 0; |
2088 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 2088 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
2089 // Now the destination of memcpy is temp_ptr instead of str2[wrapLine] and the source is str[MAX_DLG_LINES] instead of str[DLG_LINE2] | 2089 // Now the destination of memcpy is temp_ptr instead of str2[wrapLine] and the source is str[MAX_DLG_LINES] instead of str[DLG_LINE2] |
2090 memcpy(temp_ptr,&str[MAX_DLG_LINES][linePos],nChar); // Now the source data is from the last element of the array. | 2090 memcpy(temp_ptr,&str[MAX_DLG_LINES][linePos],nChar); // Now the source data is from the last element of the array. |
2091 linePos = linePos+nChar; | 2091 linePos = linePos+nChar; |
2092 ////GW - even if we cannot display the entire string - it is better than what we would have otherwise | 2092 ////GW - even if we cannot display the entire string - it is better than what we would have otherwise |
2093 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 2093 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
2094 // Assign the value of pointer temp_ptr to str[] | 2094 // Assign the value of pointer temp_ptr to str[] |
2095 str[DLG_LINE2+wrapLine] = temp_ptr; | 2095 str[DLG_LINE2+wrapLine] = temp_ptr; |
2096 temp_ptr = NULL; | 2096 temp_ptr = NULL; |
2097 strLen[DLG_LINE2 + wrapLine] = dspl_GetTextExtent(str[DLG_LINE2+wrapLine],0); | 2097 strLen[DLG_LINE2 + wrapLine] = dspl_GetTextExtent(str[DLG_LINE2+wrapLine],0); |
2098 wrapLine++; | 2098 wrapLine++; |
2099 } | 2099 } |
2100 | 2100 |
2101 } | 2101 } |
2102 else | 2102 else |
2103 { | 2103 { |
2104 //Unicode is more problematic - we need the 0x80 at the front of the string | 2104 //Unicode is more problematic - we need the 0x80 at the front of the string |
2105 //for the call to 'dspl_GetNcharToFit'. This will involve copying the entire remainder | 2105 //for the call to 'dspl_GetNcharToFit'. This will involve copying the entire remainder |
2106 //of 'str2' into a temporary buffer. At the moment, we only wrap numbers so this | 2106 //of 'str2' into a temporary buffer. At the moment, we only wrap numbers so this |
2107 //code will wait until it is required. | 2107 //code will wait until it is required. |
2108 // str[3] = "Code not written!!"; //issue warning | 2108 // str[3] = "Code not written!!"; //issue warning |
2109 // strLen[3] = dspl_GetTextExtent(str[3],0); | 2109 // strLen[3] = dspl_GetTextExtent(str[3],0); |
2110 fullScreen = DLG_USE_FULL_SCREEN; //error - use full screen | 2110 fullScreen = DLG_USE_FULL_SCREEN; //error - use full screen |
2111 } | 2111 } |
2112 } | 2112 } |
2113 } | 2113 } |
2114 | 2114 |
2115 //Calculate longest line of text (including softkeys - sx already set to the softkey width) | 2115 //Calculate longest line of text (including softkeys - sx already set to the softkey width) |
2116 for (i=0;i< MAX_DLG_LINES;i++) | 2116 for (i=0;i< MAX_DLG_LINES;i++) |
2117 { | 2117 { |
2118 if (strLen[i]>sx) | 2118 if (strLen[i]>sx) |
2119 sx = strLen[i]; | 2119 sx = strLen[i]; |
2120 } | 2120 } |
2121 if (sx > SCREEN_SIZE_X-charWidth) | 2121 if (sx > SCREEN_SIZE_X-charWidth) |
2122 sx = SCREEN_SIZE_X; | 2122 sx = SCREEN_SIZE_X; |
2123 else | 2123 else |
2125 if (sx > SCREEN_SIZE_X/2) | 2125 if (sx > SCREEN_SIZE_X/2) |
2126 sx = sx + charWidth; | 2126 sx = sx + charWidth; |
2127 else | 2127 else |
2128 sx = sx + charWidth*2; | 2128 sx = sx + charWidth*2; |
2129 } | 2129 } |
2130 if (sy> sx) | 2130 if (sy> sx) |
2131 sx = sy; | 2131 sx = sy; |
2132 wx = (SCREEN_SIZE_X-sx)/2; | 2132 wx = (SCREEN_SIZE_X-sx)/2; |
2133 if (wx<0) | 2133 if (wx<0) |
2134 wx=0; | 2134 wx=0; |
2135 } | 2135 } |
2136 | 2136 |
2137 if (sy > SCREEN_SIZE_Y) | 2137 if (sy > SCREEN_SIZE_Y) |
2138 wy = 0; | 2138 wy = 0; |
2139 else if (SCREEN_SIZE_Y > 2*sy) | 2139 else if (SCREEN_SIZE_Y > 2*sy) |
2140 wy = (SCREEN_SIZE_Y*2/3-sy)/2; //display in middle of top 2/3 of screen | 2140 wy = (SCREEN_SIZE_Y*2/3-sy)/2; //display in middle of top 2/3 of screen |
2141 else | 2141 else |
2142 wy = (SCREEN_SIZE_Y-sy)/2; //display in middle of screen | 2142 wy = (SCREEN_SIZE_Y-sy)/2; //display in middle of screen |
2143 if (wy < 10) | 2143 if (wy < 10) |
2144 wy = wy/2; | 2144 wy = wy/2; |
2145 | 2145 |
2146 if ((wx == 0) || (wy==0)) | 2146 if ((wx == 0) || (wy==0)) |
2147 { //not enough room to display as a window - use whole screen | 2147 { //not enough room to display as a window - use whole screen |
2148 fullScreen = DLG_USE_FULL_SCREEN; | 2148 fullScreen = DLG_USE_FULL_SCREEN; |
2149 } | 2149 } |
2150 | 2150 |
2151 #ifdef COLOURDISPLAY | 2151 #ifdef COLOURDISPLAY |
2152 if ((data->icon_array != NULL) && (fullScreen != DLG_USE_BITMAP)) | 2152 if ((data->icon_array != NULL) && (fullScreen != DLG_USE_BITMAP)) |
2153 { //The dialog has an animation - we must make the pop-up large enough to support this | 2153 { //The dialog has an animation - we must make the pop-up large enough to support this |
2154 if (sx < data->icon_array[0].area.sx) | 2154 if (sx < data->icon_array[0].area.sx) |
2155 sx = data->icon_array[0].area.sx; | 2155 sx = data->icon_array[0].area.sx; |
2156 yBmpOfs = data->icon_array[0].area.py + data->icon_array[0].area.sy; | 2156 yBmpOfs = data->icon_array[0].area.py + data->icon_array[0].area.sy; |
2157 wy = data->icon_array[0].area.py; | 2157 wy = data->icon_array[0].area.py; |
2158 sy = sy + data->icon_array[0].area.sy; | 2158 sy = sy + data->icon_array[0].area.sy; |
2159 } | 2159 } |
2160 #endif | 2160 #endif |
2161 } | 2161 } |
2162 else | 2162 else |
2163 { | 2163 { |
2164 //We have no strings to display - clear entire screen | 2164 //We have no strings to display - clear entire screen |
2165 fullScreen = DLG_USE_FULL_SCREEN; | 2165 fullScreen = DLG_USE_FULL_SCREEN; |
2166 } | 2166 } |
2167 | 2167 |
2168 | 2168 |
2175 area.py = 0; | 2175 area.py = 0; |
2176 area.sx = sx; | 2176 area.sx = sx; |
2177 area.sy = sy; | 2177 area.sy = sy; |
2178 resources_setColour(data->dlgCol); | 2178 resources_setColour(data->dlgCol); |
2179 drawWinType = DSPL_WIN_CENTRE; | 2179 drawWinType = DSPL_WIN_CENTRE; |
2180 | 2180 |
2181 if (fullScreen!=DLG_USE_FULL_SCREEN) | 2181 if (fullScreen!=DLG_USE_FULL_SCREEN) |
2182 { | 2182 { |
2183 t_font_bitmap bmp; | 2183 t_font_bitmap bmp; |
2184 t_font_bitmap* bmpPtr = NULL; | 2184 t_font_bitmap* bmpPtr = NULL; |
2185 | 2185 |
2187 { | 2187 { |
2188 //centre text | 2188 //centre text |
2189 xPos[i] = wx+(sx-strLen[i])/2; | 2189 xPos[i] = wx+(sx-strLen[i])/2; |
2190 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; | 2190 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; |
2191 } | 2191 } |
2192 | 2192 |
2193 #ifdef COLOURDISPLAY | 2193 #ifdef COLOURDISPLAY |
2194 if ((data->dlgBgdBitmap != NULL) && (fullScreen==DLG_USE_BITMAP)) | 2194 if ((data->dlgBgdBitmap != NULL) && (fullScreen==DLG_USE_BITMAP)) |
2195 { | 2195 { |
2196 bmp.format = data->dlgBgdBitmap->icnType; | 2196 bmp.format = data->dlgBgdBitmap->icnType; |
2197 bmp.height = data->dlgBgdBitmap->area.sy; | 2197 bmp.height = data->dlgBgdBitmap->area.sy; |
2213 { | 2213 { |
2214 xPos[i] = xPos[i] + area.px; | 2214 xPos[i] = xPos[i] + area.px; |
2215 yPos[i] = yPos[i] + area.py; | 2215 yPos[i] = yPos[i] + area.py; |
2216 } | 2216 } |
2217 | 2217 |
2218 TRACE_EVENT_P3("wy = %d, yOfs = %d, area.py = %d",wy,yOfs,area.py); | 2218 TRACE_EVENT_P3("wy = %d, yOfs = %d, area.py = %d",wy,yOfs,area.py); |
2219 if( data->dlgBgdBitmap->icnType != ICON_TYPE_1BIT_UNPACKED ) | 2219 if( data->dlgBgdBitmap->icnType != ICON_TYPE_1BIT_UNPACKED ) |
2220 dspl_SetBgdColour( COL_TRANSPARENT ); | 2220 dspl_SetBgdColour( COL_TRANSPARENT ); |
2221 | 2221 |
2222 | 2222 |
2223 } | 2223 } |
2224 else | 2224 else |
2225 { | 2225 { |
2226 // x0066814 06 Dec 2006, OMAPS00106825 | 2226 // x0066814 06 Dec 2006, OMAPS00106825 |
2227 //The window height calculation related to wrapping should be skipped when no | 2227 //The window height calculation related to wrapping should be skipped when no |
2228 //string wrapping is done | 2228 //string wrapping is done |
2229 if(wrapLine>0) | 2229 if(wrapLine>0) |
2230 { | 2230 { |
2231 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); | 2231 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); |
2232 } | 2232 } |
2235 #else | 2235 #else |
2236 if (wrapLine>1) | 2236 if (wrapLine>1) |
2237 { | 2237 { |
2238 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); | 2238 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); |
2239 area.sy = sy; | 2239 area.sy = sy; |
2240 } | 2240 } |
2241 #endif | 2241 #endif |
2242 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 2242 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
2243 //If length of the dialog is bigger than screen then start the dialog from the top corner. | 2243 //If length of the dialog is bigger than screen then start the dialog from the top corner. |
2244 if(sy+wy >= SCREEN_SIZE_Y && sy < SCREEN_SIZE_Y) | 2244 if(sy+wy >= SCREEN_SIZE_Y && sy < SCREEN_SIZE_Y) |
2245 if(wy>0 && wy < sy) | 2245 if(wy>0 && wy < sy) |
2246 { | 2246 { |
2247 wy = (SCREEN_SIZE_Y - sy ) /2 ;// centre the dialog | 2247 wy = (SCREEN_SIZE_Y - sy ) /2 ;// centre the dialog |
2248 if(wy < 0) | 2248 if(wy < 0) |
2249 wy=0; | 2249 wy=0; |
2250 for (i=0;i<MAX_DLG_LINES;i++) | 2250 for (i=0;i<MAX_DLG_LINES;i++) |
2251 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; | 2251 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; |
2252 } | 2252 } |
2253 dspl_DrawWin( wx,wy,sx,sy, drawWinType , bmpPtr); | 2253 dspl_DrawWin( wx,wy,sx,sy, drawWinType , bmpPtr); |
2254 } | 2254 } |
2255 else | 2255 else |
2256 { | 2256 { |
2257 dspl_ClearAll(); | 2257 dspl_ClearAll(); |
2258 sx = 84; | 2258 sx = 84; |
2259 for (i=0;i<MAX_DLG_LINES;i++) | 2259 for (i=0;i<MAX_DLG_LINES;i++) |
2260 { | 2260 { |
2261 xPos[i] = 0; | 2261 xPos[i] = 0; |
2262 yPos[i] = Mmi_layout_line(i+1); | 2262 yPos[i] = Mmi_layout_line(i+1); |
2273 else | 2273 else |
2274 { | 2274 { |
2275 skArea.px = area.px+wx; | 2275 skArea.px = area.px+wx; |
2276 skArea.sx = area.sx; | 2276 skArea.sx = area.sx; |
2277 skArea.py = area.py+wy+area.sy-Mmi_layout_softkeyHeight()-1; | 2277 skArea.py = area.py+wy+area.sy-Mmi_layout_softkeyHeight()-1; |
2278 skArea.sy = Mmi_layout_softkeyHeight(); | 2278 skArea.sy = Mmi_layout_softkeyHeight(); |
2279 } | 2279 } |
2280 softKeys_displayStrXY(lskStr, rskStr, data->dlgSkFormat, data->dlgCol, &skArea); | 2280 softKeys_displayStrXY(lskStr, rskStr, data->dlgSkFormat, data->dlgCol, &skArea); |
2281 } | 2281 } |
2282 | 2282 |
2283 /****************************** | 2283 /****************************** |
2284 * Print dialog text | 2284 * Print dialog text |
2285 *****************************/ | 2285 *****************************/ |
2286 for (i=0;i<MAX_DLG_LINES;i++) | 2286 for (i=0;i<MAX_DLG_LINES;i++) |
2287 { /* GW#2294 No need to draw zero length strings .*/ | 2287 { /* GW#2294 No need to draw zero length strings .*/ |
2288 if ((str[i] != NULL) && (strLen[i] > 0)) | 2288 if ((str[i] != NULL) && (strLen[i] > 0)) |
2289 { | 2289 { |
2290 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 2290 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
2291 #ifdef FF_MMI_SAT_ICON | 2291 #ifdef FF_MMI_SAT_ICON |
2292 if(data->IconData.selfExplanatory == FALSE) | 2292 if(data->IconData.selfExplanatory == FALSE) |
2293 dspl_TextOut(xPos[i] + titleIconWidth, yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); | 2293 dspl_TextOut(xPos[i] + titleIconWidth, yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); |
2294 #else | 2294 #else |
2295 dspl_TextOut(xPos[i] , yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); | 2295 dspl_TextOut(xPos[i] , yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); |
2296 #endif | 2296 #endif |
2297 } | 2297 } |
2298 } | 2298 } |
2299 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 2299 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
2300 #ifdef FF_MMI_SAT_ICON | 2300 #ifdef FF_MMI_SAT_ICON |
2301 if(data->IconData.dst != NULL) | 2301 if(data->IconData.dst != NULL) |
2302 { | 2302 { |
2303 if(str[DLG_LINE2] == NULL) | 2303 if(str[DLG_LINE2] == NULL) |
2304 { | 2304 { |
2305 if ((data->IconData.width > TITLE_ICON_WIDTH) || | 2305 if ((data->IconData.width > TITLE_ICON_WIDTH) || |
2306 (data->IconData.height > TITLE_ICON_HEIGHT)) | 2306 (data->IconData.height > TITLE_ICON_HEIGHT)) |
2307 { | 2307 { |
2308 dspl_BitBlt2(xPos[0], yPos[0], 8, | 2308 dspl_BitBlt2(xPos[0], yPos[0], 8, |
2309 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); | 2309 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); |
2310 } | 2310 } |
2311 | 2311 |
2312 else | 2312 else |
2313 dspl_BitBlt2(xPos[0], yPos[0], data->IconData.width, | 2313 dspl_BitBlt2(xPos[0], yPos[0], data->IconData.width, |
2314 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); | 2314 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); |
2315 } | 2315 } |
2316 else | 2316 else |
2317 { | 2317 { |
2318 if ((data->IconData.width > TITLE_ICON_WIDTH) || | 2318 if ((data->IconData.width > TITLE_ICON_WIDTH) || |
2319 (data->IconData.height > TITLE_ICON_HEIGHT)) | 2319 (data->IconData.height > TITLE_ICON_HEIGHT)) |
2320 { | 2320 { |
2321 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2], 8, | 2321 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2], 8, |
2322 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); | 2322 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); |
2323 } | 2323 } |
2324 else | 2324 else |
2325 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2],data->IconData.width, | 2325 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2],data->IconData.width, |
2326 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); | 2326 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); |
2327 } | 2327 } |
2328 | 2328 |
2329 } | 2329 } |
2330 #endif | 2330 #endif |
2331 | 2331 |
2332 | 2332 |
2333 resources_restoreColour(); | 2333 resources_restoreColour(); |
2334 } | 2334 } |
2335 | 2335 |
2336 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 2336 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
2337 // Now free the allocated memory | 2337 // Now free the allocated memory |
2338 /* x0039928 - Lint warning removal */ | 2338 /* x0039928 - Lint warning removal */ |
2339 if (strLen[MAX_DLG_LINES] > scrWidth-charWidth) | 2339 if (strLen[MAX_DLG_LINES] > scrWidth-charWidth) |
2340 if (data->WrapStrings & WRAP_STRING_2) | 2340 if (data->WrapStrings & WRAP_STRING_2) |
2341 if (str[MAX_DLG_LINES][0] != (char)0x80) /* x0039928 - lint warning removal */ | 2341 if (str[MAX_DLG_LINES][0] != (char)0x80) /* x0039928 - lint warning removal */ |
2342 { | 2342 { |
2343 for(i=DLG_LINE2;i<MAX_DLG_LINES;i++) | 2343 for(i=DLG_LINE2;i<MAX_DLG_LINES;i++) |
2344 { | 2344 { |
2345 if(NULL != str[i] && strLen[i] > 0) | 2345 if(NULL != str[i] && strLen[i] > 0) |
2346 mfwFree((U8*)str[i],MAX_WRAP_CHAR); | 2346 mfwFree((U8*)str[i],MAX_WRAP_CHAR); |
2347 } | 2347 } |
2348 str[MAX_DLG_LINES]=NULL; | 2348 str[MAX_DLG_LINES]=NULL; |
2349 } | 2349 } |
2350 | 2350 |
2351 break; | 2351 break; |
2352 | 2352 |
2353 default: | 2353 default: |
2354 return 0; | 2354 return 0; |
2355 } | 2355 } |
2356 | 2356 |
2357 return 1; | 2357 return 1; |
2358 } | 2358 } |
2359 | 2359 |
2360 /******************************************************************************* | 2360 /******************************************************************************* |
2361 | 2361 |
2362 $Function: phlock_dialog_info | 2362 $Function: phlock_dialog_info |
2363 | 2363 |
2364 $Description: Dialog function for information dialog | 2364 $Description: Dialog function for information dialog |
2365 | 2365 |
2366 $Returns: void | 2366 $Returns: void |
2367 | 2367 |
2368 $Arguments: win, window handle event, value, parameter | 2368 $Arguments: win, window handle event, value, parameter |
2369 | 2369 |
2370 *******************************************************************************/ | 2370 *******************************************************************************/ |
2371 void phlock_dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | 2371 void phlock_dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter) |
2372 { | 2372 { |
2373 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 2373 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
2374 T_dialog_info * data = (T_dialog_info *)win_data->user; | 2374 T_dialog_info * data = (T_dialog_info *)win_data->user; |
2375 T_DISPLAY_DATA * display_info = (T_DISPLAY_DATA *)parameter; | 2375 T_DISPLAY_DATA * display_info = (T_DISPLAY_DATA *)parameter; |
2376 TRACE_FUNCTION ("phlock_dialog_info()"); | 2376 TRACE_FUNCTION ("phlock_dialog_info()"); |
2377 | 2377 |
2378 switch (event) | 2378 switch (event) |
2379 { | 2379 { |
2380 case DIALOG_INIT: | 2380 case DIALOG_INIT: |
2382 * Initialize dialog | 2382 * Initialize dialog |
2383 */ | 2383 */ |
2384 #if defined (WIN32) | 2384 #if defined (WIN32) |
2385 { | 2385 { |
2386 /***************************Go-lite Optimization changes Start***********************/ | 2386 /***************************Go-lite Optimization changes Start***********************/ |
2387 | 2387 |
2388 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | 2388 //Aug 16, 2004 REF: CRR 24323 Deepa M.D |
2389 TRACE_EVENT_P1( "Identifier %d", display_info->Identifier); | 2389 TRACE_EVENT_P1( "Identifier %d", display_info->Identifier); |
2390 /***************************Go-lite Optimization changes end***********************/ | 2390 /***************************Go-lite Optimization changes end***********************/ |
2391 | 2391 |
2392 } | 2392 } |
2427 #ifdef FF_MMI_SAT_ICON | 2427 #ifdef FF_MMI_SAT_ICON |
2428 if(display_info->IconData.dst != NULL) | 2428 if(display_info->IconData.dst != NULL) |
2429 { | 2429 { |
2430 data->IconData.width = display_info->IconData.width; | 2430 data->IconData.width = display_info->IconData.width; |
2431 data->IconData.height = display_info->IconData.height; | 2431 data->IconData.height = display_info->IconData.height; |
2432 data->IconData.dst = display_info->IconData.dst; | 2432 data->IconData.dst = display_info->IconData.dst; |
2433 data->IconData.selfExplanatory = display_info->IconData.selfExplanatory; | 2433 data->IconData.selfExplanatory = display_info->IconData.selfExplanatory; |
2434 } | 2434 } |
2435 else | 2435 else |
2436 { | 2436 { |
2437 data->IconData.dst = NULL; | 2437 data->IconData.dst = NULL; |
2438 data->IconData.selfExplanatory = FALSE; | 2438 data->IconData.selfExplanatory = FALSE; |
2439 data->IconData.width =0; | 2439 data->IconData.width =0; |
2440 data->IconData.height =0; | 2440 data->IconData.height =0; |
2441 } | 2441 } |
2442 #endif | 2442 #endif |
2443 | 2443 |
2444 TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); | 2444 TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); |
2445 TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); | 2445 TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); |
2446 if(display_info->anim_time != 0) | 2446 if(display_info->anim_time != 0) |
2447 { | 2447 { |
2465 | 2465 |
2466 $Function: phlock_dialog_info_tim_cb | 2466 $Function: phlock_dialog_info_tim_cb |
2467 | 2467 |
2468 $Description: Callback function for the dialog info timer. | 2468 $Description: Callback function for the dialog info timer. |
2469 | 2469 |
2470 | 2470 |
2471 $Returns: MFW event handler | 2471 $Returns: MFW event handler |
2472 | 2472 |
2473 $Arguments: window handle event, timer control block | 2473 $Arguments: window handle event, timer control block |
2474 | 2474 |
2475 *******************************************************************************/ | 2475 *******************************************************************************/ |
2501 | 2501 |
2502 #endif //FF_PHONE_LOCK | 2502 #endif //FF_PHONE_LOCK |
2503 /* | 2503 /* |
2504 ** SPR#1744 NDH | 2504 ** SPR#1744 NDH |
2505 ** Move the dialog destory in front of the Callback to make the processing consistent | 2505 ** Move the dialog destory in front of the Callback to make the processing consistent |
2506 ** with the Right Keypress and Hangup Processing. Also to ensure that the dialog is | 2506 ** with the Right Keypress and Hangup Processing. Also to ensure that the dialog is |
2507 ** removed when the screen is redrawn. | 2507 ** removed when the screen is redrawn. |
2508 */ | 2508 */ |
2509 | 2509 |
2510 TRACE_EVENT("phlock_dialog_info_tim_cb: Bef dialog_info_destrroy"); | 2510 TRACE_EVENT("phlock_dialog_info_tim_cb: Bef dialog_info_destrroy"); |
2511 phlock_dialog_info_destroy (win); | 2511 phlock_dialog_info_destroy (win); |
2512 | 2512 |
2513 #ifdef FF_PHONE_LOCK | 2513 #ifdef FF_PHONE_LOCK |
2514 TRACE_EVENT("Aft. destroy"); | 2514 TRACE_EVENT("Aft. destroy"); |
2515 TRACE_EVENT_P1("phlock_dialog_info_tim_cb: win: %02x", win); | 2515 TRACE_EVENT_P1("phlock_dialog_info_tim_cb: win: %02x", win); |
2516 #endif //FF_PHONE_LOCK | 2516 #endif //FF_PHONE_LOCK |
2517 | 2517 |
2518 if (Callback) | 2518 if (Callback) |
2519 (Callback) (parent_win, Identifier, INFO_TIMEOUT); | 2519 (Callback) (parent_win, Identifier, INFO_TIMEOUT); |
2520 | 2520 |
2521 return 0; | 2521 return 0; |
2522 } | 2522 } |
2545 TRACE_FUNCTION("phlock_dialog_info_kbd_cb"); | 2545 TRACE_FUNCTION("phlock_dialog_info_kbd_cb"); |
2546 | 2546 |
2547 switch (keyboard->code) | 2547 switch (keyboard->code) |
2548 { | 2548 { |
2549 case KCD_LEFT: | 2549 case KCD_LEFT: |
2550 if (data->KeyEvents & KEY_LEFT ) | 2550 if (data->KeyEvents & KEY_LEFT ) |
2551 { | 2551 { |
2552 phlock_dialog_info_destroy (win); | 2552 phlock_dialog_info_destroy (win); |
2553 if (Callback) | 2553 if (Callback) |
2554 (Callback) (parent_win, Identifier, INFO_KCD_LEFT); | 2554 (Callback) (parent_win, Identifier, INFO_KCD_LEFT); |
2555 } | 2555 } |
2556 break; | 2556 break; |
2557 | 2557 |
2558 case KCD_RIGHT: | 2558 case KCD_RIGHT: |
2559 if (data->KeyEvents & KEY_RIGHT) | 2559 if (data->KeyEvents & KEY_RIGHT) |
2560 { | 2560 { |
2561 phlock_dialog_info_destroy (win); | 2561 phlock_dialog_info_destroy (win); |
2562 if (Callback) | 2562 if (Callback) |
2563 (Callback) (parent_win, Identifier, INFO_KCD_RIGHT); | 2563 (Callback) (parent_win, Identifier, INFO_KCD_RIGHT); |
2564 } | 2564 } |
2571 if (Callback) | 2571 if (Callback) |
2572 (Callback) (parent_win, Identifier, INFO_KCD_HUP); | 2572 (Callback) (parent_win, Identifier, INFO_KCD_HUP); |
2573 } | 2573 } |
2574 break; | 2574 break; |
2575 case KCD_MNUUP: | 2575 case KCD_MNUUP: |
2576 | 2576 |
2577 if (data->KeyEvents & KEY_MNUUP) | 2577 if (data->KeyEvents & KEY_MNUUP) |
2578 { | 2578 { |
2579 if (Callback) | 2579 if (Callback) |
2580 (Callback) (parent_win, Identifier, INFO_KCD_UP); | 2580 (Callback) (parent_win, Identifier, INFO_KCD_UP); |
2581 } | 2581 } |
2582 | 2582 |
2583 break; | 2583 break; |
2584 case KCD_MNUDOWN: | 2584 case KCD_MNUDOWN: |
2585 | 2585 |
2586 if (data->KeyEvents & KEY_MNUDOWN) | 2586 if (data->KeyEvents & KEY_MNUDOWN) |
2587 { | 2587 { |
2588 if (Callback) | 2588 if (Callback) |
2589 (Callback) (parent_win, Identifier, INFO_KCD_DOWN); | 2589 (Callback) (parent_win, Identifier, INFO_KCD_DOWN); |
2590 } | 2590 } |
2591 | 2591 |
2592 break; | 2592 break; |
2593 //MZ 7/3/01 used to start a call. | 2593 //MZ 7/3/01 used to start a call. |
2594 case KCD_CALL: | 2594 case KCD_CALL: |
2595 if (data->KeyEvents & KEY_CALL ) | 2595 if (data->KeyEvents & KEY_CALL ) |
2596 { | 2596 { |
2597 phlock_dialog_info_destroy (win); | 2597 phlock_dialog_info_destroy (win); |
2598 if (Callback) | 2598 if (Callback) |
2599 (Callback) (parent_win, Identifier, INFO_KCD_OFFHOOK); | 2599 (Callback) (parent_win, Identifier, INFO_KCD_OFFHOOK); |
2600 } | 2600 } |
2638 /******************************************************************************* | 2638 /******************************************************************************* |
2639 | 2639 |
2640 $Function: phlock_dialog_info_destroy | 2640 $Function: phlock_dialog_info_destroy |
2641 | 2641 |
2642 $Description: Destruction of an information dialog | 2642 $Description: Destruction of an information dialog |
2643 | 2643 |
2644 $Returns: void | 2644 $Returns: void |
2645 | 2645 |
2646 $Arguments: win | 2646 $Arguments: win |
2647 | 2647 |
2648 *******************************************************************************/ | 2648 *******************************************************************************/ |
2649 void phlock_dialog_info_destroy (T_MFW_HND own_window) | 2649 void phlock_dialog_info_destroy (T_MFW_HND own_window) |
2650 { | 2650 { |
2651 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data; | 2651 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data; |
2652 T_dialog_info * data = (T_dialog_info *)win->user; | 2652 T_dialog_info * data = (T_dialog_info *)win->user; |
2656 if (own_window == NULL) | 2656 if (own_window == NULL) |
2657 { | 2657 { |
2658 TRACE_EVENT ("Error :- Called with NULL Pointer"); | 2658 TRACE_EVENT ("Error :- Called with NULL Pointer"); |
2659 return; | 2659 return; |
2660 } | 2660 } |
2661 | 2661 |
2662 if (data) | 2662 if (data) |
2663 { | 2663 { |
2664 /* | 2664 /* |
2665 * Exit TIMER & KEYBOARD Handle | 2665 * Exit TIMER & KEYBOARD Handle |
2666 */ | 2666 */ |