FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiDialogs.c @ 146:303704cf0701
mmiDialogs.c: bogotab fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 16 Nov 2020 05:38:13 +0000 |
parents | c0052fe355d3 |
children | a7d9fe97e5b8 |
comparison
equal
deleted
inserted
replaced
145:833f3aa0e230 | 146:303704cf0701 |
---|---|
1 | |
2 /******************************************************************************* | 1 /******************************************************************************* |
3 | 2 |
4 CONDAT (UK) | 3 CONDAT (UK) |
5 | 4 |
6 ******************************************************************************** | 5 ******************************************************************************** |
7 | 6 |
8 This software product is the property of Condat (UK) Ltd and may not be | 7 This software product is the property of Condat (UK) Ltd and may not be |
9 disclosed to any third party without the express permission of the owner. | 8 disclosed to any third party without the express permission of the owner. |
10 | 9 |
11 ******************************************************************************** | 10 ******************************************************************************** |
12 | 11 |
13 $Project name: Basic MMI | 12 $Project name: Basic MMI |
14 $Project code: BMI (6349) | 13 $Project code: BMI (6349) |
15 $Module: MmiDialogs | 14 $Module: MmiDialogs |
16 $File: MmiDialogs.c | 15 $File: MmiDialogs.c |
17 $Revision: 1.0 | 16 $Revision: 1.0 |
18 | 17 |
19 $Author: Condat(UK) | 18 $Author: Condat(UK) |
20 $Date: 25/10/00 | 19 $Date: 25/10/00 |
21 | 20 |
22 ******************************************************************************** | 21 ******************************************************************************** |
23 | 22 |
24 Description:MMI Information dialogue handling. | 23 Description:MMI Information dialogue handling. |
25 | 24 |
26 | 25 |
27 | |
28 ******************************************************************************** | 26 ******************************************************************************** |
29 | 27 |
30 $History: MmiDialogs.c | 28 $History: MmiDialogs.c |
31 | 29 |
32 May 23, 2007 DR: OMAPS00127483 x0pleela | 30 May 23, 2007 DR: OMAPS00127483 x0pleela |
33 Description: Phonelock - Unable to unlock the phone during incoming call with ringer... | 31 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 | 32 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. | 33 incoming call or alarm after thr phone is unlocked. |
36 | 34 |
37 Apr 03, 2007 ER: OMAPS00122561 x0pleela | 35 Apr 03, 2007 ER: OMAPS00122561 x0pleela |
38 Description: [ACI] Phone lock feature has to be supported by ACI | 36 Description: [ACI] Phone lock feature has to be supported by ACI |
39 Solution: Phone Lock ER implementation | 37 Solution: Phone Lock ER implementation |
40 | 38 |
41 x0066814 06 Dec 2006, OMAPS00106825 | 39 x0066814 06 Dec 2006, OMAPS00106825 |
42 The window height calculation related to wrapping should be skipped when no | 40 The window height calculation related to wrapping should be skipped when no |
43 string wrapping is done | 41 string wrapping is done |
44 | 42 |
45 Mar 11, 2006 REF:DR:OMAPS00061467 x0035544 | 43 Mar 11, 2006 REF:DR:OMAPS00061467 x0035544 |
46 Description: 27.22.4.13.3 SET UP CALL (display of icons) fails. | 44 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 | 45 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 | 46 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 | 47 in the function dialog_info_win_resize_cb() to display icon data appropriately on the dialog screen for SAT |
50 call setup. | 48 call setup. |
51 | 49 |
52 Sep 06 2005 REF: MMI-SPR-33548 x0012849 Jagan | 50 Sep 06 2005 REF: MMI-SPR-33548 x0012849 Jagan |
53 Description : A dialog with long message is not displayed properly. | 51 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. | 52 Solution : The no of lines in a dialog is increased from 4 to 15. |
55 | 53 |
56 Feb 24, 2005 REF: CRR MMI-SPR-29102 xnkulkar | 54 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. | 55 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 | 56 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. | 57 press is ignored till the delete operation is over. |
60 xrashmic 08 Feb, 2005 MMI-SPR-27853 | 58 xrashmic 08 Feb, 2005 MMI-SPR-27853 |
61 Moved the T_dialog_info structure from MmiDialogs.c to MmiDialogs.h | 59 Moved the T_dialog_info structure from MmiDialogs.c to MmiDialogs.h |
62 | 60 |
63 | 61 |
64 xrashmic 08 Feb, 2005 MMI-SPR-27853 | 62 xrashmic 08 Feb, 2005 MMI-SPR-27853 |
65 Moved the T_dialog_info structure from MmiDialogs.c to MmiDialogs.h | 63 Moved the T_dialog_info structure from MmiDialogs.c to MmiDialogs.h |
66 | 64 |
67 Aug 25, 2004 REF: CRR 24904 Deepa M.D | 65 Aug 25, 2004 REF: CRR 24904 Deepa M.D |
68 Bug:cleanup compile switches used for Go-lite | 66 Bug:cleanup compile switches used for Go-lite |
69 Fix:COLOURDISPLAY compiler switch has been added to the functions which are | 67 Fix:COLOURDISPLAY compiler switch has been added to the functions which are |
70 used only for the normal color build. | 68 used only for the normal color build. |
71 | 69 |
72 Aug 16, 2004 REF: CRR 24323 Deepa M.D | 70 Aug 16, 2004 REF: CRR 24323 Deepa M.D |
73 Bug:Clenup of sprintf used for tracing | 71 Bug:Clenup of sprintf used for tracing |
74 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX | 72 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX |
75 | 73 |
76 | 74 |
77 Sep 01, 2004 REF: CRR 21380 Deepa M.D | 75 Sep 01, 2004 REF: CRR 21380 Deepa M.D |
78 Bug:Not getting proper display, When Messages Memory is Full. | 76 Bug:Not getting proper display, When Messages Memory is Full. |
79 Fix:Assigning TextId and TextString will not display both the messages. | 77 Fix:Assigning TextId and TextString will not display both the messages. |
80 Hence we need to use TextId and TextString2 or TextId2 and TextString | 78 Hence we need to use TextId and TextString2 or TextId2 and TextString |
81 | 79 |
82 Jun 04,2004 CRR:13601 xpradipg - SASKEN | 80 Jun 04,2004 CRR:13601 xpradipg - SASKEN |
83 Description: CFO interrogation display : Timer to long | 81 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 | 82 Fix: Timer is enabled for the information dialog. It times out after 5 seconds from the last key |
85 press. | 83 press. |
86 25/10/00 Original Condat(UK) BMI version. | 84 25/10/00 Original Condat(UK) BMI version. |
87 | 85 |
88 $End | 86 $End |
89 | 87 |
90 *******************************************************************************/ | 88 *******************************************************************************/ |
91 | 89 |
176 #ifdef FF_PHONE_LOCK | 174 #ifdef FF_PHONE_LOCK |
177 #include "MmiPins.h" | 175 #include "MmiPins.h" |
178 //x0pleela 15 May, 2007 DR: OMAPS00127483 | 176 //x0pleela 15 May, 2007 DR: OMAPS00127483 |
179 #include "MmiSounds.h" | 177 #include "MmiSounds.h" |
180 EXTERN T_call call_data; | 178 EXTERN T_call call_data; |
181 extern T_MFW_HND phlock_win_handle; /* to hold the win handle of phone unlock editor window */ | 179 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 */ | 180 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 */ | 181 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 */ | 182 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 */ | 183 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 */ | 184 int phlock_mtc_anim_time; /* to hold the display info for MTC while in locked state */ |
187 | 185 |
188 //x0pleela 15 May, 2007 DR: OMAPS00127483 | 186 //x0pleela 15 May, 2007 DR: OMAPS00127483 |
189 #ifdef FF_MMI_AUDIO_PROFILE | 187 #ifdef FF_MMI_AUDIO_PROFILE |
190 extern UBYTE mfwAudPlay;//flag for audio | 188 extern UBYTE mfwAudPlay;//flag for audio |
191 #endif | 189 #endif |
210 static void dialog_info (T_MFW_HND win, | 208 static void dialog_info (T_MFW_HND win, |
211 USHORT event, SHORT value, void * parameter); | 209 USHORT event, SHORT value, void * parameter); |
212 | 210 |
213 /* x0039928 - Lint warning fix | 211 /* x0039928 - Lint warning fix |
214 static int dialog_info_win_cb (T_MFW_EVENT event, T_MFW_WIN * win); */ | 212 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); | 213 static int dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win); |
216 | 214 |
217 static T_MFW_CB dialog_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM * tc); | 215 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); | 216 static int dialog_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD * keyboard); |
219 static int dialog_info_kbd_long_cb (T_MFW_EVENT event, T_MFW_KBD * keyboard); | 217 static int dialog_info_kbd_long_cb (T_MFW_EVENT event, T_MFW_KBD * keyboard); |
220 void mmi_dialogs_insert_animation_CB (T_MFW_EVENT event, T_MFW_TIM *tc); | 218 void mmi_dialogs_insert_animation_CB (T_MFW_EVENT event, T_MFW_TIM *tc); |
221 void mmi_dialogs_animation_new_CB (T_MFW_EVENT event, T_MFW_TIM *tc); | 219 void mmi_dialogs_animation_new_CB (T_MFW_EVENT event, T_MFW_TIM *tc); |
222 | 220 |
223 | 221 |
224 MfwRect calcLayout( int dlgType, int dataSx, int dataSy, int bmpSx, int bmpSy) | 222 MfwRect calcLayout( int dlgType, int dataSx, int dataSy, int bmpSx, int bmpSy) |
225 { | 223 { |
226 MfwRect area; | 224 MfwRect area; |
227 int px,py; | 225 int px,py; |
228 int sx =0,sy = 0; | 226 int sx =0,sy = 0; |
229 | 227 |
230 TRACE_EVENT_P5("dlgType,= %d, dataSx = %d, dataSy = %d, bmpSx = %d, bmpSy = %d", dlgType, dataSx, dataSy, bmpSx, bmpSy); | 228 TRACE_EVENT_P5("dlgType,= %d, dataSx = %d, dataSy = %d, bmpSx = %d, bmpSy = %d", dlgType, dataSx, dataSy, bmpSx, bmpSy); |
231 | 229 |
232 /*Adjust area available for drawing by the border */ | 230 /*Adjust area available for drawing by the border */ |
233 switch (dlgType & DLG_BORDER_VERTICAL) | 231 switch (dlgType & DLG_BORDER_VERTICAL) |
234 { | 232 { |
235 case DLG_BORDER_VERTICAL_0: sx =bmpSx; break; | 233 case DLG_BORDER_VERTICAL_0: sx =bmpSx; break; |
236 case DLG_BORDER_VERTICAL_1: sx =bmpSx*6/8; break; | 234 case DLG_BORDER_VERTICAL_1: sx =bmpSx*6/8; break; |
237 case DLG_BORDER_VERTICAL_2: sx =bmpSx*4/8; break; | 235 case DLG_BORDER_VERTICAL_2: sx =bmpSx*4/8; break; |
238 case DLG_BORDER_VERTICAL_3: sx =bmpSx*3/8; break; | 236 case DLG_BORDER_VERTICAL_3: sx =bmpSx*3/8; break; |
239 } | 237 } |
240 if (sx < dataSx) | 238 if (sx < dataSx) |
241 sx = dataSx; | 239 sx = dataSx; |
242 px = 0; | 240 px = 0; |
243 | 241 |
244 switch (dlgType & DLG_BORDER_HORIZONTAL) | 242 switch (dlgType & DLG_BORDER_HORIZONTAL) |
245 { | 243 { |
246 case DLG_BORDER_HORIZONTAL_0: sy =bmpSy; break; | 244 case DLG_BORDER_HORIZONTAL_0: sy =bmpSy; break; |
247 case DLG_BORDER_HORIZONTAL_1: sy =bmpSy*6/8; break; | 245 case DLG_BORDER_HORIZONTAL_1: sy =bmpSy*6/8; break; |
248 case DLG_BORDER_HORIZONTAL_2: sy =bmpSy*4/8; break; | 246 case DLG_BORDER_HORIZONTAL_2: sy =bmpSy*4/8; break; |
249 case DLG_BORDER_HORIZONTAL_3: sy =bmpSy*3/8; break; | 247 case DLG_BORDER_HORIZONTAL_3: sy =bmpSy*3/8; break; |
250 } | 248 } |
251 if (sy < dataSy) | 249 if (sy < dataSy) |
252 sy = dataSy; | 250 sy = dataSy; |
253 py = 0; | 251 py = 0; |
254 | 252 |
255 switch (dlgType & (DLG_INFO_LAYOUT_LEFT | DLG_INFO_LAYOUT_RIGHT)) | 253 switch (dlgType & (DLG_INFO_LAYOUT_LEFT | DLG_INFO_LAYOUT_RIGHT)) |
256 { | 254 { |
257 case DLG_INFO_LAYOUT_CENTRE: //display info in centre of display | 255 case DLG_INFO_LAYOUT_CENTRE: //display info in centre of display |
258 px = px + (sx-dataSx)/2; | 256 px = px + (sx-dataSx)/2; |
259 sx = dataSx; | 257 sx = dataSx; |
260 break; | 258 break; |
261 case DLG_INFO_LAYOUT_RIGHT: //all info is displayed at the foot of trhe display | 259 case DLG_INFO_LAYOUT_RIGHT: //all info is displayed at the foot of trhe display |
262 px = px+(sx-dataSx); | 260 px = px+(sx-dataSx); |
263 sx = dataSx; | 261 sx = dataSx; |
264 break; | 262 break; |
265 case DLG_INFO_LAYOUT_LEFT: //display all info at the top of the bitmap | 263 case DLG_INFO_LAYOUT_LEFT: //display all info at the top of the bitmap |
266 sx = dataSx; | 264 sx = dataSx; |
267 break; | 265 break; |
268 default: //display info over entire area | 266 default: //display info over entire area |
269 break; | 267 break; |
270 } | 268 } |
271 | 269 |
272 switch (dlgType & (DLG_INFO_LAYOUT_BOTTOM | DLG_INFO_LAYOUT_TOP)) | 270 switch (dlgType & (DLG_INFO_LAYOUT_BOTTOM | DLG_INFO_LAYOUT_TOP)) |
273 { | 271 { |
274 case DLG_INFO_LAYOUT_CENTRE: //display info in centre of display | 272 case DLG_INFO_LAYOUT_CENTRE: //display info in centre of display |
275 py = py + (sy-dataSy)/2; | 273 py = py + (sy-dataSy)/2; |
276 sy = dataSy; | 274 sy = dataSy; |
277 break; | 275 break; |
278 case DLG_INFO_LAYOUT_BOTTOM: //all info is displayed at the foot of trhe display | 276 case DLG_INFO_LAYOUT_BOTTOM: //all info is displayed at the foot of trhe display |
279 py = py+(sy-dataSy); | 277 py = py+(sy-dataSy); |
280 sy = dataSy; | 278 sy = dataSy; |
281 break; | 279 break; |
282 case DLG_INFO_LAYOUT_TOP: //display all info at the top of the bitmap | 280 case DLG_INFO_LAYOUT_TOP: //display all info at the top of the bitmap |
283 sy = dataSy; | 281 sy = dataSy; |
284 break; | 282 break; |
285 default: //display info over entire area | 283 default: //display info over entire area |
286 break; | 284 break; |
287 } | 285 } |
288 area.px = px; area.py = py; | 286 area.px = px; area.py = py; |
289 area.sx = sx; area.sy = sy; //Area sx/sy must be no smaller than dataSx/Sy | 287 area.sx = sx; area.sy = sy; //Area sx/sy must be no smaller than dataSx/Sy |
290 return (area); | 288 return (area); |
291 } | 289 } |
292 | 290 |
293 | 291 |
294 /******************************************************************************* | 292 /******************************************************************************* |
295 | 293 |
296 $Function: info_dialog | 294 $Function: info_dialog |
297 | 295 |
298 $Description: Common information dialog | 296 $Description: Common information dialog |
299 | 297 |
300 $Returns: Dialogue info win | 298 $Returns: Dialogue info win |
301 | 299 |
302 $Arguments: parent win, display info | 300 $Arguments: parent win, display info |
303 | 301 |
304 *******************************************************************************/ | 302 *******************************************************************************/ |
305 T_MFW_HND info_dialog (T_MFW_HND parent_win, | 303 T_MFW_HND info_dialog (T_MFW_HND parent_win, |
306 T_DISPLAY_DATA * display_info) | 304 T_DISPLAY_DATA * display_info) |
307 { | 305 { |
319 } | 317 } |
320 | 318 |
321 | 319 |
322 /******************************************************************************* | 320 /******************************************************************************* |
323 | 321 |
324 $Function: info_dialog_softkeystrings | 322 $Function: info_dialog_softkeystrings |
325 | 323 |
326 $Description: Common information dialog, sets "softkeystrings" to TRUE | 324 $Description: Common information dialog, sets "softkeystrings" to TRUE |
327 | 325 |
328 $Returns: Dialogue info win | 326 $Returns: Dialogue info win |
329 | 327 |
330 $Arguments: parent win, display info, leftsoftkey, rightsoftkey | 328 $Arguments: parent win, display info, leftsoftkey, rightsoftkey |
331 | 329 |
332 *******************************************************************************/ | 330 *******************************************************************************/ |
333 T_MFW_HND info_dialog_softkeystrings (T_MFW_HND parent_win, T_DISPLAY_DATA * display_info) | 331 T_MFW_HND info_dialog_softkeystrings (T_MFW_HND parent_win, T_DISPLAY_DATA * display_info) |
334 { | 332 { |
335 T_MFW_HND win; | 333 T_MFW_HND win; |
345 } | 343 } |
346 | 344 |
347 | 345 |
348 /******************************************************************************* | 346 /******************************************************************************* |
349 | 347 |
350 $Function: dialog_info_create | 348 $Function: dialog_info_create |
351 | 349 |
352 $Description: Creation of an information dialog | 350 $Description: Creation of an information dialog |
353 | 351 |
354 $Returns: Dialogue info win | 352 $Returns: Dialogue info win |
355 | 353 |
356 $Arguments: parent win | 354 $Arguments: parent win |
357 | 355 |
358 *******************************************************************************/ | 356 *******************************************************************************/ |
359 static T_MFW_HND dialog_info_create (T_MFW_HND parent_win) | 357 static T_MFW_HND dialog_info_create (T_MFW_HND parent_win) |
360 { | 358 { |
361 T_MFW_WIN * win_data; | 359 T_MFW_WIN * win_data; |
362 T_dialog_info * data = (T_dialog_info *)ALLOC_MEMORY (sizeof (T_dialog_info)); | 360 T_dialog_info * data = (T_dialog_info *)ALLOC_MEMORY (sizeof (T_dialog_info)); |
363 TRACE_FUNCTION ("dialog_info_create()"); | 361 TRACE_FUNCTION ("dialog_info_create()"); |
364 | 362 |
365 data->info_win = win_create (parent_win, 0, E_WIN_VISIBLE | 363 data->info_win = win_create (parent_win, 0, E_WIN_VISIBLE |
366 //x0pleela 06 Apr, 2007 ER: OMAPS00122561 | 364 //x0pleela 06 Apr, 2007 ER: OMAPS00122561 |
367 #ifdef FF_PHONE_LOCK | 365 #ifdef FF_PHONE_LOCK |
368 |E_WIN_RESUME | 366 |E_WIN_RESUME |
369 #endif //FF_PHONE_LOCK | 367 #endif //FF_PHONE_LOCK |
370 , (T_MFW_CB)dialog_info_win_resize_cb); | 368 , (T_MFW_CB)dialog_info_win_resize_cb); |
371 | 369 |
372 if (data->info_win EQ 0) | 370 if (data->info_win EQ 0) |
373 return 0; | 371 return 0; |
374 | 372 |
375 /* | 373 /* |
376 * Create window handler | 374 * Create window handler |
377 */ | 375 */ |
378 data->mmi_control.dialog = (T_DIALOG_FUNC)dialog_info; | 376 data->mmi_control.dialog = (T_DIALOG_FUNC)dialog_info; |
379 data->mmi_control.data = data; | 377 data->mmi_control.data = data; |
380 data->parent_win = parent_win; | 378 data->parent_win = parent_win; |
388 } | 386 } |
389 | 387 |
390 | 388 |
391 /******************************************************************************* | 389 /******************************************************************************* |
392 | 390 |
393 $Function: dialog_info_destroy | 391 $Function: dialog_info_destroy |
394 | 392 |
395 $Description: Destruction of an information dialog | 393 $Description: Destruction of an information dialog |
396 | 394 |
397 $Returns: void | 395 $Returns: void |
398 | 396 |
399 $Arguments: win | 397 $Arguments: win |
400 | 398 |
401 *******************************************************************************/ | 399 *******************************************************************************/ |
402 void dialog_info_destroy (T_MFW_HND own_window) | 400 void dialog_info_destroy (T_MFW_HND own_window) |
403 { | 401 { |
404 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data; | 402 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data; |
406 | 404 |
407 TRACE_FUNCTION ("dialog_info_destroy()"); | 405 TRACE_FUNCTION ("dialog_info_destroy()"); |
408 | 406 |
409 if (own_window == NULL) | 407 if (own_window == NULL) |
410 { | 408 { |
411 TRACE_EVENT ("Error :- Called with NULL Pointer"); | 409 TRACE_EVENT ("Error :- Called with NULL Pointer"); |
412 return; | 410 return; |
413 } | 411 } |
414 | 412 |
415 if (data) | 413 if (data) |
416 { | 414 { |
417 /* | 415 /* |
418 * Exit TIMER & KEYBOARD Handle | 416 * Exit TIMER & KEYBOARD Handle |
419 */ | 417 */ |
420 kbd_delete (data->info_kbd); | 418 kbd_delete (data->info_kbd); |
421 tim_delete (data->info_tim); | 419 tim_delete (data->info_tim); |
422 | 420 |
423 if(data->animation_timer != 0) | 421 if(data->animation_timer != 0) |
424 { | 422 { |
425 timDelete(data->animation_timer); | 423 timDelete(data->animation_timer); |
426 | 424 |
427 if (data->icon != 0) | 425 if (data->icon != 0) |
428 icnDelete(data->icon); | 426 icnDelete(data->icon); |
429 } | 427 } |
430 | 428 |
431 /* | 429 /* |
432 * Delete WIN Handler | 430 * Delete WIN Handler |
433 */ | 431 */ |
437 */ | 435 */ |
438 FREE_MEMORY ((void *)data, sizeof (T_dialog_info)); | 436 FREE_MEMORY ((void *)data, sizeof (T_dialog_info)); |
439 } | 437 } |
440 //x0pleela 05 Apr, 2007 ER: OMAPS00122561 | 438 //x0pleela 05 Apr, 2007 ER: OMAPS00122561 |
441 #ifdef FF_PHONE_LOCK | 439 #ifdef FF_PHONE_LOCK |
442 if( phlock_alarm && phlock_alarm_win_handle ) | 440 if( phlock_alarm && phlock_alarm_win_handle ) |
443 { | 441 { |
444 phlock_alarm_win_handle = NULL; | 442 phlock_alarm_win_handle = NULL; |
445 } | 443 } |
446 | 444 |
447 if(( call_data.call_direction == MFW_CM_MTC )&& phlock_dialog_mtc_win_handle ) | 445 if(( call_data.call_direction == MFW_CM_MTC )&& phlock_dialog_mtc_win_handle ) |
448 { | 446 { |
449 phlock_dialog_mtc_win_handle = NULL; | 447 phlock_dialog_mtc_win_handle = NULL; |
450 } | 448 } |
451 #endif //FF_PHONE_LOCK | 449 #endif //FF_PHONE_LOCK |
452 | 450 |
453 } | 451 } |
454 | 452 |
455 void dlg_zeroDisplayData( T_DISPLAY_DATA *displayInfo) | 453 void dlg_zeroDisplayData( T_DISPLAY_DATA *displayInfo) |
456 { | 454 { |
457 | 455 TRACE_EVENT("dlg_zeroDisplayData()"); |
458 TRACE_EVENT("dlg_zeroDisplayData()"); | 456 if (displayInfo == NULL) |
459 if (displayInfo == NULL) | 457 return; |
460 return; | 458 memset (displayInfo, 0x00, sizeof(T_DISPLAY_DATA)); |
461 memset (displayInfo, 0x00, sizeof(T_DISPLAY_DATA)); | 459 |
462 | 460 displayInfo->LeftSoftKey = 0; |
463 displayInfo->LeftSoftKey = 0; | 461 displayInfo->RightSoftKey = 0; |
464 displayInfo->RightSoftKey = 0; | 462 displayInfo->LSKString = NULL; |
465 displayInfo->LSKString = NULL; | 463 displayInfo->RSKString = NULL; |
466 displayInfo->RSKString = NULL; | 464 displayInfo->TextString = NULL; |
467 displayInfo->TextString = NULL; | 465 displayInfo->TextString2 = NULL; |
468 displayInfo->TextString2 = NULL; | 466 |
469 | 467 displayInfo->WrapStrings = 0; |
470 displayInfo->WrapStrings = 0; | 468 |
471 | 469 displayInfo->TextId = 0; |
472 displayInfo->TextId = 0; | 470 displayInfo->TextId2 = 0; |
473 displayInfo->TextId2 = 0; | 471 |
474 | 472 displayInfo->SoftKeyStrings = FALSE; |
475 displayInfo->SoftKeyStrings = FALSE; | 473 |
476 | 474 displayInfo->Identifier = 0; |
477 displayInfo->Identifier = 0; | 475 displayInfo->anim_time = 0; |
478 displayInfo->anim_time = 0; | 476 displayInfo->number_of_frames = 0; |
479 displayInfo->number_of_frames = 0; | 477 displayInfo->current_frame = 0; |
480 displayInfo->current_frame = 0; | |
481 //x0035544 Feb 07, 2006 DR:OMAPS00061467 | 478 //x0035544 Feb 07, 2006 DR:OMAPS00061467 |
482 #ifdef FF_MMI_SAT_ICON | 479 #ifdef FF_MMI_SAT_ICON |
483 displayInfo->IconData.width = 0; | 480 displayInfo->IconData.width = 0; |
484 displayInfo->IconData.height = 0; | 481 displayInfo->IconData.height = 0; |
485 displayInfo->IconData.dst = NULL; | 482 displayInfo->IconData.dst = NULL; |
486 displayInfo->IconData.selfExplanatory = FALSE; | 483 displayInfo->IconData.selfExplanatory = FALSE; |
487 #endif | 484 #endif |
488 dlg_initDisplayData_events( displayInfo, NULL, 0, 0); | 485 dlg_initDisplayData_events( displayInfo, NULL, 0, 0); |
489 | 486 |
490 /* GW#2294 COLOUR_STATUS has been used for all popups - change this to default instead of COLOUR_POPUP .*/ | 487 /* 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 ); | 488 dlg_initDisplayData_type( displayInfo, COLOUR_STATUS, 0, NULL, 0 ); |
492 | 489 |
493 /* GW #2294 02/07/03 - The default bitmap is set-up here to allow us to disable it for some dialogs (if required) */ | 490 /* 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); | 491 displayInfo->bgdBitmap = icon_getBgdBitmap(BGD_CLOUD); |
495 | |
496 } | 492 } |
497 | 493 |
498 void dlg_initDisplayData_TextId( T_DISPLAY_DATA *displayInfo, int lsk, int rsk, int str1, int str2, int colId) | 494 void dlg_initDisplayData_TextId( T_DISPLAY_DATA *displayInfo, int lsk, int rsk, int str1, int str2, int colId) |
499 { | 495 { |
500 if (displayInfo == NULL) | 496 if (displayInfo == NULL) |
501 return; | 497 return; |
502 dlg_zeroDisplayData(displayInfo); | 498 dlg_zeroDisplayData(displayInfo); |
503 displayInfo->LeftSoftKey = (USHORT)lsk; | 499 displayInfo->LeftSoftKey = (USHORT)lsk; |
504 displayInfo->RightSoftKey = (USHORT)rsk; | 500 displayInfo->RightSoftKey = (USHORT)rsk; |
505 displayInfo->TextId = str1; | 501 displayInfo->TextId = str1; |
506 displayInfo->TextId2 = str2; | 502 displayInfo->TextId2 = str2; |
507 displayInfo->displayCol = colId ; | 503 displayInfo->displayCol = colId ; |
508 | |
509 } | 504 } |
510 | 505 |
511 void dlg_initDisplayData_TextStr( T_DISPLAY_DATA *displayInfo, int lsk, int rsk,char *str1, char *str2, int colId) | 506 void dlg_initDisplayData_TextStr( T_DISPLAY_DATA *displayInfo, int lsk, int rsk,char *str1, char *str2, int colId) |
512 { | 507 { |
513 if (displayInfo == NULL) | 508 if (displayInfo == NULL) |
514 return; | 509 return; |
515 dlg_zeroDisplayData(displayInfo); | 510 dlg_zeroDisplayData(displayInfo); |
516 displayInfo->LeftSoftKey = (USHORT)lsk; | 511 displayInfo->LeftSoftKey = (USHORT)lsk; |
517 displayInfo->RightSoftKey = (USHORT)rsk; | 512 displayInfo->RightSoftKey = (USHORT)rsk; |
518 displayInfo->TextString = str1; | 513 displayInfo->TextString = str1; |
519 displayInfo->TextString2 = str2; | 514 displayInfo->TextString2 = str2; |
520 displayInfo->displayCol = colId ; | 515 displayInfo->displayCol = colId ; |
521 } | 516 } |
522 | 517 |
523 void dlg_initDisplayData_events( T_DISPLAY_DATA *displayInfo, T_VOID_FUNC callback, int timer, T_MFW_EVENT keyEvents) | 518 void dlg_initDisplayData_events( T_DISPLAY_DATA *displayInfo, T_VOID_FUNC callback, int timer, T_MFW_EVENT keyEvents) |
524 { | 519 { |
525 displayInfo->Callback = callback; | 520 displayInfo->Callback = callback; |
526 displayInfo->Time = timer; | 521 displayInfo->Time = timer; |
527 displayInfo->KeyEvents = keyEvents; | 522 displayInfo->KeyEvents = keyEvents; |
528 } | 523 } |
529 | 524 |
530 void dlg_initDisplayData_type( T_DISPLAY_DATA *displayInfo, U32 displayCol, int dlgType, T_BITMAP* dlgBitmap, int dlgSkFormat ) | 525 void dlg_initDisplayData_type( T_DISPLAY_DATA *displayInfo, U32 displayCol, int dlgType, T_BITMAP* dlgBitmap, int dlgSkFormat ) |
531 { | 526 { |
532 displayInfo->displayCol = displayCol; | 527 displayInfo->displayCol = displayCol; |
533 displayInfo->dlgType = dlgType; | 528 displayInfo->dlgType = dlgType; |
534 displayInfo->bgdBitmap = dlgBitmap; | 529 displayInfo->bgdBitmap = dlgBitmap; |
535 } | 530 } |
536 | 531 |
537 /******************************************************************************* | 532 /******************************************************************************* |
538 | 533 |
539 $Function: dialog_info | 534 $Function: dialog_info |
540 | 535 |
541 $Description: Dialog function for information dialog | 536 $Description: Dialog function for information dialog |
542 | 537 |
543 $Returns: void | 538 $Returns: void |
544 | 539 |
545 $Arguments: win, window handle event, value, parameter | 540 $Arguments: win, window handle event, value, parameter |
546 | 541 |
547 *******************************************************************************/ | 542 *******************************************************************************/ |
548 void dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | 543 void dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter) |
549 { | 544 { |
550 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 545 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
558 /* | 553 /* |
559 * Initialize dialog | 554 * Initialize dialog |
560 */ | 555 */ |
561 #if defined (WIN32) | 556 #if defined (WIN32) |
562 { | 557 { |
563 /***************************Go-lite Optimization changes Start***********************/ | 558 /***************************Go-lite Optimization changes Start***********************/ |
564 | 559 |
565 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | 560 //Aug 16, 2004 REF: CRR 24323 Deepa M.D |
566 TRACE_EVENT_P1( "Identifier %d", display_info->Identifier); | 561 TRACE_EVENT_P1( "Identifier %d", display_info->Identifier); |
567 /***************************Go-lite Optimization changes end***********************/ | 562 /***************************Go-lite Optimization changes end***********************/ |
568 | 563 |
569 } | 564 } |
570 #endif | 565 #endif |
571 /* | 566 /* |
572 * Create timer and keyboard handler | 567 * Create timer and keyboard handler |
573 */ | 568 */ |
574 data->info_tim = tim_create (win, display_info->Time, (T_MFW_CB)dialog_info_tim_cb); | 569 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); | 570 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); | 571 data->info_kbd_long = kbd_create(win,KEY_ALL|KEY_LONG,(MfwCb)dialog_info_kbd_long_cb); |
577 | 572 |
578 //x0pleela 05 Apr, 2007 ER: OMAPS00122561 | 573 //x0pleela 05 Apr, 2007 ER: OMAPS00122561 |
579 #ifdef FF_PHONE_LOCK | 574 #ifdef FF_PHONE_LOCK |
580 if( phlock_win_handle && | 575 if( phlock_win_handle && |
581 ( ( phlock_alarm) || ( call_data.call_direction == MFW_CM_MTC ) ) ) | 576 ( ( phlock_alarm) || ( call_data.call_direction == MFW_CM_MTC ) ) ) |
582 { | 577 { |
583 TRACE_EVENT("dialog_info: Bef deleting kbd_delete(data->info_kbd);"); | 578 TRACE_EVENT("dialog_info: Bef deleting kbd_delete(data->info_kbd);"); |
584 if( phlock_alarm ) | 579 if( phlock_alarm ) |
585 phlock_alarm_win_handle = win; | 580 phlock_alarm_win_handle = win; |
586 | 581 |
587 if( call_data.call_direction == MFW_CM_MTC ) | 582 if( call_data.call_direction == MFW_CM_MTC ) |
588 phlock_dialog_mtc_win_handle = win; | 583 phlock_dialog_mtc_win_handle = win; |
589 | 584 |
590 kbd_delete(data->info_kbd); | 585 kbd_delete(data->info_kbd); |
591 data->info_kbd = phlock_kbd_handle; //set the kbd handle of unlock screen | 586 data->info_kbd = phlock_kbd_handle; //set the kbd handle of unlock screen |
592 } | 587 } |
593 #endif //FF_PHONE_LOCK | 588 #endif //FF_PHONE_LOCK |
594 | 589 |
595 /* | 590 /* |
596 * Store any other data | 591 * Store any other data |
597 */ | 592 */ |
598 data->KeyEvents = display_info->KeyEvents; | 593 data->KeyEvents = display_info->KeyEvents; |
599 data->TextString = display_info->TextString; | 594 data->TextString = display_info->TextString; |
600 data->LeftSoftKey = display_info->LeftSoftKey; | 595 data->LeftSoftKey = display_info->LeftSoftKey; |
601 data->RightSoftKey = display_info->RightSoftKey; | 596 data->RightSoftKey = display_info->RightSoftKey; |
602 data->SoftKeyStrings = display_info->SoftKeyStrings; // SH - TRUE if using strings rather than IDs | 597 data->SoftKeyStrings = display_info->SoftKeyStrings; // SH - TRUE if using strings rather than IDs |
603 data->LSKString = display_info->LSKString; // Text for left soft key | 598 data->LSKString = display_info->LSKString; // Text for left soft key |
604 data->RSKString = display_info->RSKString; // Text for right soft key | 599 data->RSKString = display_info->RSKString; // Text for right soft key |
605 data->TextId = display_info->TextId; | 600 data->TextId = display_info->TextId; |
606 data->Identifier = display_info->Identifier; | 601 data->Identifier = display_info->Identifier; |
607 data->Callback = display_info->Callback; | 602 data->Callback = display_info->Callback; |
608 data->TextString2 = display_info->TextString2; | 603 data->TextString2 = display_info->TextString2; |
609 data->TextId2 = display_info->TextId2; | 604 data->TextId2 = display_info->TextId2; |
610 data->WrapStrings = display_info->WrapStrings; //GW-SPR#762 | 605 data->WrapStrings = display_info->WrapStrings; //GW-SPR#762 |
611 | 606 |
612 data->dlgCol = display_info->displayCol; | 607 data->dlgCol = display_info->displayCol; |
613 data->dlgType = display_info->dlgType; | 608 data->dlgType = display_info->dlgType; |
614 data->dlgBgdBitmap = display_info->bgdBitmap; | 609 data->dlgBgdBitmap = display_info->bgdBitmap; |
615 data->dlgSkFormat = 0; | 610 data->dlgSkFormat = 0; |
616 data->current_frame = display_info->current_frame; | 611 data->current_frame = display_info->current_frame; |
617 data->number_of_frames = display_info->number_of_frames; | 612 data->number_of_frames = display_info->number_of_frames; |
618 data->icon_array = (MfwIcnAttr*)display_info->icon_array; | 613 data->icon_array = (MfwIcnAttr*)display_info->icon_array; |
619 data->animation_timer = 0; | 614 data->animation_timer = 0; |
620 //x0035544 Feb 07, 2006 DR:OMAPS00061467 | 615 //x0035544 Feb 07, 2006 DR:OMAPS00061467 |
621 #ifdef FF_MMI_SAT_ICON | 616 #ifdef FF_MMI_SAT_ICON |
622 if(display_info->IconData.dst != NULL) | 617 if(display_info->IconData.dst != NULL) |
623 { | 618 { |
624 data->IconData.width = display_info->IconData.width; | 619 data->IconData.width = display_info->IconData.width; |
625 data->IconData.height = display_info->IconData.height; | 620 data->IconData.height = display_info->IconData.height; |
626 data->IconData.dst = display_info->IconData.dst; | 621 data->IconData.dst = display_info->IconData.dst; |
627 data->IconData.selfExplanatory = display_info->IconData.selfExplanatory; | 622 data->IconData.selfExplanatory = display_info->IconData.selfExplanatory; |
628 } | 623 } |
629 else | 624 else |
630 { | 625 { |
631 data->IconData.dst = NULL; | 626 data->IconData.dst = NULL; |
632 data->IconData.selfExplanatory = FALSE; | 627 data->IconData.selfExplanatory = FALSE; |
633 data->IconData.width =0; | 628 data->IconData.width =0; |
634 data->IconData.height =0; | 629 data->IconData.height =0; |
635 } | 630 } |
636 #endif | 631 #endif |
637 | 632 |
638 TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); | 633 TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); |
639 TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); | 634 TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); |
640 //x0pleela 27 Mar, 2007 ER: OMAPS00122561 | 635 //x0pleela 27 Mar, 2007 ER: OMAPS00122561 |
641 #ifdef FF_PHONE_LOCK | 636 #ifdef FF_PHONE_LOCK |
642 phlock_mtc_anim_time = display_info->anim_time; | 637 phlock_mtc_anim_time = display_info->anim_time; |
643 if( ( !phlock_win_handle) || (mmiPinsEmergencyCall()) | 638 if( ( !phlock_win_handle) || (mmiPinsEmergencyCall()) |
644 || call_data.emergencyCall ) | 639 || call_data.emergencyCall ) |
645 { | 640 { |
646 #endif //FF_PHONE_LOCK | 641 #endif //FF_PHONE_LOCK |
647 if(display_info->anim_time != 0) | 642 if(display_info->anim_time != 0) |
648 { | 643 { |
649 data->animation_timer = timCreate(win,display_info->anim_time,(MfwCb)mmi_dialogs_animation_new_CB); | 644 data->animation_timer = timCreate(win,display_info->anim_time,(MfwCb)mmi_dialogs_animation_new_CB); |
650 timStart(data->animation_timer); | 645 timStart(data->animation_timer); |
651 } | 646 } |
652 | 647 |
653 if (display_info->Time NEQ FOREVER) | 648 if (display_info->Time NEQ FOREVER) |
654 tim_start (data->info_tim); | 649 tim_start (data->info_tim); |
655 win_show (win); | 650 win_show (win); |
656 | 651 |
657 #ifdef FF_PHONE_LOCK | 652 #ifdef FF_PHONE_LOCK |
658 } | 653 } |
659 else | 654 else |
660 { | 655 { |
661 if (display_info->Time NEQ FOREVER) | 656 if (display_info->Time NEQ FOREVER) |
662 tim_start (data->info_tim); | 657 tim_start (data->info_tim); |
663 | 658 |
664 | 659 |
665 | 660 |
666 winShow(phlock_win_handle ); | 661 winShow(phlock_win_handle ); |
667 } | 662 } |
668 #endif //FF_PHONE_LOCK | 663 #endif //FF_PHONE_LOCK |
669 break; | 664 break; |
670 | 665 |
671 case DIALOG_DESTROY: | 666 case DIALOG_DESTROY: |
672 dialog_info_destroy(win); | 667 dialog_info_destroy(win); |
673 break; | 668 break; |
674 } | 669 } |
675 } | 670 } |
676 | 671 |
677 #if(0) /* x0039928 - Lint warning fix */ | 672 #if(0) /* x0039928 - Lint warning fix */ |
678 /******************************************************************************* | 673 /******************************************************************************* |
679 | 674 |
680 $Function: dialog_info_win_cb | 675 $Function: dialog_info_win_cb |
681 | 676 |
682 $Description: Callback function for information dialog | 677 $Description: Callback function for information dialog |
683 | 678 |
684 $Returns: void | 679 $Returns: void |
685 | 680 |
686 $Arguments: window handle event, win | 681 $Arguments: window handle event, win |
687 *******************************************************************************/ | 682 *******************************************************************************/ |
688 //GW-SPR#762-Added code to wraps txtString2 if there is room on the display to allow | 683 //GW-SPR#762-Added code to wraps txtString2 if there is room on the display to allow |
689 //very long numbers to be displayed. | 684 //very long numbers to be displayed. |
690 #define MAX_LINE_CHAR MAX_LINE | 685 #define MAX_LINE_CHAR MAX_LINE |
691 static int dialog_info_win_cb (T_MFW_EVENT event, T_MFW_WIN * win) | 686 static int dialog_info_win_cb (T_MFW_EVENT event, T_MFW_WIN * win) |
692 { | 687 { |
693 T_dialog_info * data = (T_dialog_info *)win->user; | 688 T_dialog_info * data = (T_dialog_info *)win->user; |
694 char buffer[MAX_LINE_CHAR+1]; | 689 char buffer[MAX_LINE_CHAR+1]; |
695 int yPos,len,bufPos,nLines; | 690 int yPos,len,bufPos,nLines; |
696 | 691 |
697 TRACE_FUNCTION ("dialog_info_win_cb()"); | 692 TRACE_FUNCTION ("dialog_info_win_cb()"); |
698 | 693 |
699 | 694 |
700 if (data EQ 0) | 695 if (data EQ 0) |
701 return 1; | 696 return 1; |
702 | 697 |
703 switch (event) | 698 switch (event) |
704 { | 699 { |
705 case E_WIN_VISIBLE: | 700 case E_WIN_VISIBLE: |
706 if (win->flags & E_WIN_VISIBLE) | 701 if (win->flags & E_WIN_VISIBLE) |
707 { | 702 { |
708 /* | 703 /* |
709 * Print the information dialog | 704 * Print the information dialog |
710 */ | 705 */ |
711 | 706 |
712 /* | 707 /* |
713 * Clear Screen | 708 * Clear Screen |
714 */ | 709 */ |
715 dspl_ClearAll(); | 710 dspl_ClearAll(); |
716 | 711 |
717 /* | 712 /* |
718 * Print softkeys | 713 * Print softkeys |
719 */ | 714 */ |
720 icnShow(data->icon); | 715 icnShow(data->icon); |
721 if (data->SoftKeyStrings) | 716 if (data->SoftKeyStrings) |
722 displayCustSoftKeys(data->LSKString, data->RSKString); // SH - display text softkeys | 717 displayCustSoftKeys(data->LSKString, data->RSKString); // SH - display text softkeys |
723 else | 718 else |
724 displaySoftKeys(data->LeftSoftKey, data->RightSoftKey); // display ID softkeys | 719 displaySoftKeys(data->LeftSoftKey, data->RightSoftKey); // display ID softkeys |
725 | 720 |
726 /* | 721 /* |
727 * Print information | 722 * Print information |
728 */ | 723 */ |
729 /*MC SPR 1257, having to shift everything up 1 line as string wrapping for second | 724 /*MC SPR 1257, having to shift everything up 1 line as string wrapping for second |
730 string causes softkey overwrite when in Chinese*/ | 725 string causes softkey overwrite when in Chinese*/ |
731 if (data->TextId NEQ 0) | 726 if (data->TextId NEQ 0) |
732 { | 727 { |
733 ALIGNED_PROMPT(LEFT,0,DSPL_TXTATTR_CURRENT_MODE, data->TextId); | 728 ALIGNED_PROMPT(LEFT,0,DSPL_TXTATTR_CURRENT_MODE, data->TextId); |
734 } | 729 } |
735 else if (data->TextString NEQ NULL) | 730 else if (data->TextString NEQ NULL) |
736 { | 731 { |
737 #ifdef EASY_TEXT_ENABLED | 732 #ifdef EASY_TEXT_ENABLED |
738 if (data->TextString[0] == (char)0x80) //MC if this is a unicode string /* x0039928 -lint warning removal */ | 733 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]); | 734 displayAlignedText(LEFT, 0, DSPL_TXTATTR_UNICODE, &data->TextString[2]); |
740 else | 735 else |
741 #endif | 736 #endif |
742 displayAlignedText(LEFT, 0, DSPL_TXTATTR_NORMAL, data->TextString); | 737 displayAlignedText(LEFT, 0, DSPL_TXTATTR_NORMAL, data->TextString); |
743 } | 738 } |
744 | 739 |
745 if (data->TextId2 NEQ 0) | 740 if (data->TextId2 NEQ 0) |
746 { | 741 { |
747 ALIGNED_PROMPT(LEFT,Mmi_layout_first_line()/*MC*/,DSPL_TXTATTR_CURRENT_MODE, data->TextId2); | 742 ALIGNED_PROMPT(LEFT,Mmi_layout_first_line()/*MC*/,DSPL_TXTATTR_CURRENT_MODE, data->TextId2); |
748 } | 743 } |
749 else if (data->TextString2 NEQ NULL) | 744 else if (data->TextString2 NEQ NULL) |
750 { | 745 { |
751 #ifdef EASY_TEXT_ENABLED | 746 #ifdef EASY_TEXT_ENABLED |
752 if (data->TextString2[0] == (char)0x80 ) //MC if this is a unicode string /* x0039928 -Lint warning removal */ | 747 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]); | 748 displayAlignedText(LEFT, Mmi_layout_first_line()/*MC*/, DSPL_TXTATTR_UNICODE, &data->TextString2[2]); |
754 else | 749 else |
755 #endif | 750 #endif |
756 { | 751 { |
757 if ((data->WrapStrings & WRAP_STRING_2) && (strlen(data->TextString2) > MAX_LINE_CHAR)) | 752 if ((data->WrapStrings & WRAP_STRING_2) && (strlen(data->TextString2) > MAX_LINE_CHAR)) |
758 { //Display text over a number of lines | 753 { //Display text over a number of lines |
759 yPos = Mmi_layout_first_line();/*MC*/ | 754 yPos = Mmi_layout_first_line();/*MC*/ |
760 bufPos = 0; | 755 bufPos = 0; |
761 nLines = Mmi_number_of_lines_without_icons_on_top()-2;//starting on 2nd line | 756 nLines = Mmi_number_of_lines_without_icons_on_top()-2;//starting on 2nd line |
762 len = strlen(data->TextString2); | 757 len = strlen(data->TextString2); |
763 while ((bufPos < len) && (nLines >=0)) | 758 while ((bufPos < len) && (nLines >=0)) |
764 { | 759 { |
765 memcpy(buffer,&data->TextString2[bufPos],MAX_LINE_CHAR); | 760 memcpy(buffer,&data->TextString2[bufPos],MAX_LINE_CHAR); |
766 bufPos = bufPos + MAX_LINE_CHAR; | 761 bufPos = bufPos + MAX_LINE_CHAR; |
767 buffer[MAX_LINE_CHAR] = 0x00; | 762 buffer[MAX_LINE_CHAR] = 0x00; |
768 displayAlignedText(LEFT, yPos, 0, buffer); | 763 displayAlignedText(LEFT, yPos, 0, buffer); |
769 yPos = yPos + Mmi_layout_line_height(); | 764 yPos = yPos + Mmi_layout_line_height(); |
770 nLines--; | 765 nLines--; |
771 } | 766 } |
772 } | 767 } |
773 else | 768 else |
774 { | 769 { |
775 displayAlignedText(LEFT, Mmi_layout_second_line(),DSPL_TXTATTR_NORMAL, data->TextString2); | 770 displayAlignedText(LEFT, Mmi_layout_second_line(),DSPL_TXTATTR_NORMAL, data->TextString2); |
776 } | 771 } |
777 } | 772 } |
778 } | 773 } |
779 } | 774 } |
780 break; | 775 break; |
781 | 776 |
782 default: | 777 default: |
783 return 0; | 778 return 0; |
784 } | 779 } |
785 return 1; | 780 return 1; |
786 } | 781 } |
787 #endif | 782 #endif |
788 | 783 |
789 /******************************************************************************* | 784 /******************************************************************************* |
790 | 785 |
791 $Function: dialog_info_win_cb | 786 $Function: dialog_info_win_cb |
792 | 787 |
793 $Description: Callback function for information dialog | 788 $Description: Callback function for information dialog |
794 | 789 |
795 $Returns: void | 790 $Returns: void |
796 | 791 |
797 $Arguments: window handle event, win | 792 $Arguments: window handle event, win |
798 | 793 |
799 GW SPR#2294 02/07/03 - Removed Unicode specific code as the 'display' routines called to calculate | 794 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 | 795 the string length and output the text should correctly handle the 0x80 unicode tag |
801 at the start. | 796 at the start. |
802 Modified the display code to wrap the text in the second text string. | 797 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 | 798 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 | 799 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. | 800 not be large enough, the entire screen is used. |
806 For the C-sample, there is no bitmap. | 801 For the C-sample, there is no bitmap. |
807 Modified the code to use an array of values to position the text output. | 802 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). | 803 GW SPR#2294 08/07/03 - Added code to expand the dialog box to include the animation (if any). |
809 | 804 |
810 *******************************************************************************/ | 805 *******************************************************************************/ |
811 // Allow 4 lines of text (0..3) for dialogs | 806 // Allow 4 lines of text (0..3) for dialogs |
812 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 807 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
815 //Allow up to 40 chars of text on a dialog line | 810 //Allow up to 40 chars of text on a dialog line |
816 #define MAX_WRAP_CHAR (42) | 811 #define MAX_WRAP_CHAR (42) |
817 //Allow us to wrap text from line 2 to lines 2,3 and 4 lines | 812 //Allow us to wrap text from line 2 to lines 2,3 and 4 lines |
818 #define MAX_WRAP_LINES (MAX_DLG_LINES-1) | 813 #define MAX_WRAP_LINES (MAX_DLG_LINES-1) |
819 | 814 |
820 #define DLG_USE_BITMAP 0x0001 //use bitmap if present | 815 #define DLG_USE_BITMAP 0x0001 //use bitmap if present |
821 #define DLG_USE_RECTANGLE 0x0002 //use a rectangle | 816 #define DLG_USE_RECTANGLE 0x0002 //use a rectangle |
822 #define DLG_USE_FULL_SCREEN 0x0004 //use full-screen | 817 #define DLG_USE_FULL_SCREEN 0x0004 //use full-screen |
823 | 818 |
824 #define DLG_LINE1 0 | 819 #define DLG_LINE1 0 |
825 #define DLG_LINE2 1 | 820 #define DLG_LINE2 1 |
826 | 821 |
827 static int dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win) | 822 static int dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win) |
833 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 828 // 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 | 829 //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. | 830 // which is used while wrapping the text. |
836 char* str[MAX_DLG_LINES+1]; | 831 char* str[MAX_DLG_LINES+1]; |
837 int strLen[MAX_DLG_LINES+1]; | 832 int strLen[MAX_DLG_LINES+1]; |
838 int i; | 833 int i; |
839 char* lskStr,*rskStr; | 834 char* lskStr,*rskStr; |
840 int wx = 0; //,wy,sx=0,sy=0; // RAVI | 835 int wx = 0; //,wy,sx=0,sy=0; // RAVI |
841 int wy = 0; // RAVI | 836 int wy = 0; // RAVI |
842 int sx = 0; // RAVI | 837 int sx = 0; // RAVI |
843 int sy = 0; // RAVI | 838 int sy = 0; // RAVI |
844 int fullScreen = DLG_USE_RECTANGLE; | 839 int fullScreen = DLG_USE_RECTANGLE; |
845 int yOfs; | 840 int yOfs; |
846 int yBmpOfs = 0; | 841 int yBmpOfs = 0; |
847 MfwRect skArea; | 842 MfwRect skArea; |
848 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 843 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
849 #ifdef FF_MMI_SAT_ICON | 844 #ifdef FF_MMI_SAT_ICON |
850 USHORT titleIconWidth = 0; | 845 USHORT titleIconWidth = 0; |
851 #endif | 846 #endif |
852 MfwRect area; | 847 MfwRect area; |
853 int scrWidth = 0; //available width for the display // RAVI - Assignment to 0. | 848 int scrWidth = 0; //available width for the display // RAVI - Assignment to 0. |
854 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 849 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
855 // temp_ptr is used while wrapping the text. | 850 // temp_ptr is used while wrapping the text. |
856 // Now str2[][] is not required. | 851 // Now str2[][] is not required. |
857 char *temp_ptr; | 852 char *temp_ptr; |
858 int nChar; | 853 int nChar; |
859 | 854 |
860 /* t_font_bitmap bmp; */ /* Warning Removal - x0020906 - 24-08-2006 */ | 855 /* t_font_bitmap bmp; */ /* Warning Removal - x0020906 - 24-08-2006 */ |
861 // t_font_bitmap* bmpPtr = &bmp; // RAVI - Not Referenced. | 856 // t_font_bitmap* bmpPtr = &bmp; // RAVI - Not Referenced. |
862 | 857 |
863 int drawWinType; | 858 int drawWinType; |
864 int nLines; | 859 int nLines; |
865 | 860 |
866 int linePos=0; | 861 int linePos=0; |
867 int lineLen = 0; | 862 int lineLen = 0; |
868 int wrapLine = 0; /*GW #2294*/ // x0066814 06 Dec 2006, OMAPS00106825 | 863 int wrapLine = 0; /*GW #2294*/ // x0066814 06 Dec 2006, OMAPS00106825 |
869 | 864 |
870 const int charWidth = dspl_GetTextExtent("0",1); | 865 const int charWidth = dspl_GetTextExtent("0",1); |
871 TRACE_FUNCTION ("dialog_info_win_resize_cb()"); | 866 TRACE_FUNCTION ("dialog_info_win_resize_cb()"); |
872 | 867 |
873 | 868 |
874 memset(str,'\0',sizeof(str)); /* x0039928 - Lint warning fix */ | 869 memset(str,'\0',sizeof(str)); /* x0039928 - Lint warning fix */ |
875 memset(strLen,0,sizeof(strLen)); | 870 memset(strLen,0,sizeof(strLen)); |
876 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 871 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
877 #ifdef FF_MMI_SAT_ICON | 872 #ifdef FF_MMI_SAT_ICON |
878 if (data->IconData.dst != NULL) | 873 if (data->IconData.dst != NULL) |
879 { | 874 { |
880 if (data->IconData.width > TITLE_ICON_WIDTH) | 875 if (data->IconData.width > TITLE_ICON_WIDTH) |
881 { | 876 { |
882 titleIconWidth = TITLE_ICON_WIDTH; | 877 titleIconWidth = TITLE_ICON_WIDTH; |
883 } | 878 } |
884 else | 879 else |
885 { | 880 { |
886 titleIconWidth = data->IconData.width ; | 881 titleIconWidth = data->IconData.width ; |
887 } | 882 } |
888 } | 883 } |
889 else | 884 else |
890 { | 885 { |
891 titleIconWidth = 0; | 886 titleIconWidth = 0; |
892 } | 887 } |
893 | 888 |
894 #endif | 889 #endif |
895 if (data EQ 0) | 890 if (data EQ 0) |
896 return 1; | 891 return 1; |
897 | 892 |
898 switch (event) | 893 switch (event) |
899 { | 894 { |
900 //x0pleela 15 May, 2007 DR: OMAPS00127483 | 895 //x0pleela 15 May, 2007 DR: OMAPS00127483 |
901 //Added the following code to handle ringer for incoming call and alarm in phone unlocked state. | 896 //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. | 897 //the ringer for incoming call or alarm is restarted here after unlocking the phone. |
903 case E_WIN_RESUME: | 898 case E_WIN_RESUME: |
904 | 899 |
905 #ifdef FF_PHONE_LOCK | 900 #ifdef FF_PHONE_LOCK |
906 | 901 |
907 if( ( ( ( call_data.call_direction == MFW_CM_MTC ) && ( phlock_dialog_mtc_win_handle ) ) || ( phlock_alarm ) ) | 902 if( ( ( ( call_data.call_direction == MFW_CM_MTC ) && ( phlock_dialog_mtc_win_handle ) ) || ( phlock_alarm ) ) |
908 #ifdef FF_MMI_AUDIO_PROFILE | 903 #ifdef FF_MMI_AUDIO_PROFILE |
909 && ( !mfwAudPlay) | 904 && ( !mfwAudPlay) |
910 #endif | 905 #endif |
911 ) | 906 ) |
912 { | 907 { |
913 if( call_data.call_direction == MFW_CM_MTC ) | 908 if( call_data.call_direction == MFW_CM_MTC ) |
914 { | 909 { |
915 #ifdef FF_MIDI_RINGER | 910 #ifdef FF_MIDI_RINGER |
916 mfw_ringer_start(AS_RINGER_MODE_IC, TRUE, sounds_midi_ringer_start_cb); | 911 mfw_ringer_start(AS_RINGER_MODE_IC, TRUE, sounds_midi_ringer_start_cb); |
917 #endif | 912 #endif |
918 } | 913 } |
919 else if ( phlock_alarm ) | 914 else if ( phlock_alarm ) |
920 { | 915 { |
921 #ifdef FF_MIDI_RINGER | 916 #ifdef FF_MIDI_RINGER |
922 mfw_ringer_start(AS_RINGER_MODE_ALARM, TRUE, sounds_midi_ringer_start_cb); | 917 mfw_ringer_start(AS_RINGER_MODE_ALARM, TRUE, sounds_midi_ringer_start_cb); |
923 #endif | 918 #endif |
924 } | 919 } |
925 } | 920 } |
926 | 921 |
927 #endif // FF_PHONE_LOCK | 922 #endif // FF_PHONE_LOCK |
928 | 923 |
929 break; | 924 break; |
930 | 925 |
931 case E_WIN_VISIBLE: | 926 case E_WIN_VISIBLE: |
932 if (win->flags & E_WIN_VISIBLE) | 927 if (win->flags & E_WIN_VISIBLE) |
933 { | 928 { |
934 TRACE_EVENT("dialog_info_win_resize_cb: E_WIN_VISIBLE"); | 929 TRACE_EVENT("dialog_info_win_resize_cb: E_WIN_VISIBLE"); |
935 | 930 |
936 #ifdef FF_PHONE_LOCK | 931 #ifdef FF_PHONE_LOCK |
937 if( phlock_alarm && phlock_alarm_win_handle ) | 932 if( phlock_alarm && phlock_alarm_win_handle ) |
938 { | 933 { |
939 TRACE_EVENT("dialog_info_win_resize_cb: creating alarm kbd handler"); | 934 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); | 935 data->info_kbd = kbd_create (phlock_alarm_win_handle, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); |
941 } | 936 } |
942 if( ( call_data.call_direction == MFW_CM_MTC ) && ( phlock_dialog_mtc_win_handle ) ) | 937 if( ( call_data.call_direction == MFW_CM_MTC ) && ( phlock_dialog_mtc_win_handle ) ) |
943 { | 938 { |
944 TRACE_EVENT("dialog_info_win_resize_cb: creating mtc kbd handler"); | 939 TRACE_EVENT("dialog_info_win_resize_cb: creating mtc kbd handler"); |
945 data->info_kbd = kbd_create (phlock_dialog_mtc_win_handle, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); | 940 data->info_kbd = kbd_create (phlock_dialog_mtc_win_handle, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); |
946 if(phlock_mtc_anim_time != 0) | 941 if(phlock_mtc_anim_time != 0) |
947 { | 942 { |
948 data->animation_timer = timCreate(phlock_dialog_mtc_win_handle, phlock_mtc_anim_time, | 943 data->animation_timer = timCreate(phlock_dialog_mtc_win_handle, phlock_mtc_anim_time, |
949 (MfwCb)mmi_dialogs_animation_new_CB); | 944 (MfwCb)mmi_dialogs_animation_new_CB); |
950 timStart(data->animation_timer); | 945 timStart(data->animation_timer); |
951 } | 946 } |
952 } | 947 } |
953 #endif //FF_PHONE_LOCK | 948 #endif //FF_PHONE_LOCK |
954 | 949 |
955 /* | 950 /* |
956 * Print the information dialog | 951 * Print the information dialog |
957 */ | 952 */ |
958 for (i=0;i<MAX_DLG_LINES;i++) | 953 for (i=0;i<MAX_DLG_LINES;i++) |
959 { | 954 { |
960 xPos[i]=0; | 955 xPos[i]=0; |
961 yPos[i] = Mmi_layout_line_height()*i; | 956 yPos[i] = Mmi_layout_line_height()*i; |
962 str[i]=NULL; | 957 str[i]=NULL; |
963 strLen[i]=0; | 958 strLen[i]=0; |
964 } | 959 } |
965 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 960 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
966 // Assign the values to last elments of the array str and strLen | 961 // Assign the values to last elments of the array str and strLen |
967 str[MAX_DLG_LINES] = NULL; | 962 str[MAX_DLG_LINES] = NULL; |
968 strLen[MAX_DLG_LINES] = 0; | 963 strLen[MAX_DLG_LINES] = 0; |
969 yOfs = Mmi_layout_line_height()/4; | 964 yOfs = Mmi_layout_line_height()/4; |
970 if (data->TextId != 0) | 965 if (data->TextId != 0) |
971 str[DLG_LINE1] = MmiRsrcGetText( data->TextId); | 966 str[DLG_LINE1] = MmiRsrcGetText( data->TextId); |
972 else | 967 else |
973 str[DLG_LINE1] = data->TextString; | 968 str[DLG_LINE1] = data->TextString; |
974 | 969 |
975 if (data->TextId2 != 0) | 970 if (data->TextId2 != 0) |
976 str[DLG_LINE2] = MmiRsrcGetText( data->TextId2); | 971 str[DLG_LINE2] = MmiRsrcGetText( data->TextId2); |
977 else | 972 else |
978 str[DLG_LINE2] = data->TextString2; | 973 str[DLG_LINE2] = data->TextString2; |
979 | 974 |
980 if (data->SoftKeyStrings!=0) | 975 if (data->SoftKeyStrings!=0) |
981 { | 976 { |
982 lskStr = data->LSKString; | 977 lskStr = data->LSKString; |
983 rskStr = data->RSKString; | 978 rskStr = data->RSKString; |
984 } | 979 } |
985 else | 980 else |
986 { | 981 { |
987 if (data->LeftSoftKey != TxtNull) | 982 if (data->LeftSoftKey != TxtNull) |
988 lskStr = MmiRsrcGetText(data->LeftSoftKey); | 983 lskStr = MmiRsrcGetText(data->LeftSoftKey); |
989 else | 984 else |
990 lskStr = NULL; | 985 lskStr = NULL; |
991 | 986 |
992 if (data->RightSoftKey != TxtNull) | 987 if (data->RightSoftKey != TxtNull) |
993 rskStr = MmiRsrcGetText(data->RightSoftKey); | 988 rskStr = MmiRsrcGetText(data->RightSoftKey); |
994 else | 989 else |
995 rskStr = NULL; | 990 rskStr = NULL; |
996 } | 991 } |
997 | 992 |
998 if ((str[DLG_LINE1]!= NULL) || (str[DLG_LINE2]!=NULL)) | 993 if ((str[DLG_LINE1]!= NULL) || (str[DLG_LINE2]!=NULL)) |
999 { //Draw a window for status info | 994 { //Draw a window for status info |
1000 if (str[DLG_LINE2] == NULL) | 995 if (str[DLG_LINE2] == NULL) |
1001 { | 996 { |
1002 sy = Mmi_layout_line_height()+yOfs*2; // 18 or 12 | 997 sy = Mmi_layout_line_height()+yOfs*2; // 18 or 12 |
1003 | 998 |
1004 } | 999 } |
1005 else | 1000 else |
1006 { | 1001 { |
1007 sy = Mmi_layout_line_height()*2+yOfs*3; // 33 or 22 | 1002 sy = Mmi_layout_line_height()*2+yOfs*3; // 33 or 22 |
1008 } | 1003 } |
1009 | 1004 |
1010 //MC, if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) | 1005 //MC, if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) |
1011 { //calculate longest string - use this to calc width of window | 1006 { //calculate longest string - use this to calc width of window |
1012 sx = 0; | 1007 sx = 0; |
1013 if ((lskStr!=NULL) || (rskStr!=NULL)) | 1008 if ((lskStr!=NULL) || (rskStr!=NULL)) |
1014 { | 1009 { |
1015 sy = sy+Mmi_layout_softkeyHeight()+yOfs*2; | 1010 sy = sy+Mmi_layout_softkeyHeight()+yOfs*2; |
1016 sx = sx + 10; | 1011 sx = sx + 10; |
1017 if (lskStr != NULL) | 1012 if (lskStr != NULL) |
1018 { | 1013 { |
1019 sx = sx + dspl_GetTextExtent(lskStr, 0); | 1014 sx = sx + dspl_GetTextExtent(lskStr, 0); |
1020 } | 1015 } |
1021 if (rskStr != NULL) | 1016 if (rskStr != NULL) |
1022 { | 1017 { |
1023 sx = sx + dspl_GetTextExtent(rskStr,0); | 1018 sx = sx + dspl_GetTextExtent(rskStr,0); |
1024 } | 1019 } |
1025 | 1020 |
1026 } | 1021 } |
1027 for (i=DLG_LINE1;i<=DLG_LINE2;i++) | 1022 for (i=DLG_LINE1;i<=DLG_LINE2;i++) |
1028 { | 1023 { |
1029 strLen[i] = dspl_GetTextExtent(str[i],0); | 1024 strLen[i] = dspl_GetTextExtent(str[i],0); |
1030 } | 1025 } |
1031 | 1026 |
1032 /* Work out the desired width of the dialog. If we can wrap line 2 and it is long, wrap it */ | 1027 /* 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) | 1028 if (data->WrapStrings & WRAP_STRING_2) |
1034 nLines = MAX_WRAP_LINES; | 1029 nLines = MAX_WRAP_LINES; |
1035 else | 1030 else |
1036 nLines = 1; | 1031 nLines = 1; |
1037 #ifdef COLOURDISPLAY | 1032 #ifdef COLOURDISPLAY |
1038 if (data->dlgBgdBitmap!=NULL) | 1033 if (data->dlgBgdBitmap!=NULL) |
1039 { | 1034 { |
1040 //we only have room to split line 2 into 'max_lines_dlg_popup' lines in the pop-up. | 1035 //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. | 1036 //NB this should be calculated depending on the height of the popup bitmap. |
1042 const int max_lines_dlg_popup=2; | 1037 const int max_lines_dlg_popup=2; |
1043 if (nLines>max_lines_dlg_popup) | 1038 if (nLines>max_lines_dlg_popup) |
1044 nLines = max_lines_dlg_popup; | 1039 nLines = max_lines_dlg_popup; |
1045 scrWidth = (data->dlgBgdBitmap->area.sx * 3)/4; //the max width is about 3/4 of the pop-up | 1040 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) || | 1041 if ( (strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) || |
1047 (strLen[DLG_LINE1] > scrWidth)) | 1042 (strLen[DLG_LINE1] > scrWidth)) |
1048 { | 1043 { |
1049 //recalculate width below. | 1044 //recalculate width below. |
1050 if (data->WrapStrings & WRAP_STRING_2) | 1045 if (data->WrapStrings & WRAP_STRING_2) |
1051 nLines = MAX_WRAP_LINES; | 1046 nLines = MAX_WRAP_LINES; |
1052 fullScreen = DLG_USE_RECTANGLE; | 1047 fullScreen = DLG_USE_RECTANGLE; |
1053 } | 1048 } |
1054 else | 1049 else |
1055 { | 1050 { |
1056 fullScreen = DLG_USE_BITMAP; | 1051 fullScreen = DLG_USE_BITMAP; |
1057 //Leave width as is | 1052 //Leave width as is |
1058 } | 1053 } |
1059 } | 1054 } |
1060 #else | 1055 #else |
1061 //On a C-sample, limit pop-up lines to 2 extra (any more - use entire screen) | 1056 //On a C-sample, limit pop-up lines to 2 extra (any more - use entire screen) |
1062 { | 1057 { |
1063 const int max_lines_dlg_popup=2; | 1058 const int max_lines_dlg_popup=2; |
1064 if (nLines>max_lines_dlg_popup) | 1059 if (nLines>max_lines_dlg_popup) |
1065 nLines = max_lines_dlg_popup; | 1060 nLines = max_lines_dlg_popup; |
1066 } | 1061 } |
1067 | 1062 |
1068 #endif | 1063 #endif |
1069 if (fullScreen == DLG_USE_RECTANGLE) | 1064 if (fullScreen == DLG_USE_RECTANGLE) |
1070 { | 1065 { |
1071 //see if we can display as a pop-up | 1066 //see if we can display as a pop-up |
1072 if (SCREEN_SIZE_X < 128) | 1067 if (SCREEN_SIZE_X < 128) |
1073 scrWidth = SCREEN_SIZE_X-6; | 1068 scrWidth = SCREEN_SIZE_X-6; |
1074 else | 1069 else |
1075 scrWidth = (SCREEN_SIZE_X*7)/8; | 1070 scrWidth = (SCREEN_SIZE_X*7)/8; |
1076 if ( strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) | 1071 if ( strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) |
1077 { | 1072 { |
1078 //Cannot fit in as a pop-up - use full screen | 1073 //Cannot fit in as a pop-up - use full screen |
1079 fullScreen = DLG_USE_FULL_SCREEN; | 1074 fullScreen = DLG_USE_FULL_SCREEN; |
1080 scrWidth = SCREEN_SIZE_X; | 1075 scrWidth = SCREEN_SIZE_X; |
1081 } | 1076 } |
1082 else | 1077 else |
1083 { | 1078 { |
1084 //We can fit it in - but we may want to reduce the width for a nicer look. | 1079 //We can fit it in - but we may want to reduce the width for a nicer look. |
1085 } | 1080 } |
1086 } | 1081 } |
1087 | 1082 |
1088 /* | 1083 /* |
1089 * Wrap second text line (e.g. for long phone numbers.) | 1084 * Wrap second text line (e.g. for long phone numbers.) |
1090 */ | 1085 */ |
1091 if (strLen[DLG_LINE2] > scrWidth-charWidth) | 1086 if (strLen[DLG_LINE2] > scrWidth-charWidth) |
1092 { | 1087 { |
1093 //If we can fit the string on 2 lines - do it. | 1088 //If we can fit the string on 2 lines - do it. |
1094 if (data->WrapStrings & WRAP_STRING_2) | 1089 if (data->WrapStrings & WRAP_STRING_2) |
1095 { | 1090 { |
1126 temp_ptr = NULL; | 1121 temp_ptr = NULL; |
1127 strLen[DLG_LINE2 + wrapLine] = dspl_GetTextExtent(str[DLG_LINE2+wrapLine],0); | 1122 strLen[DLG_LINE2 + wrapLine] = dspl_GetTextExtent(str[DLG_LINE2+wrapLine],0); |
1128 wrapLine++; | 1123 wrapLine++; |
1129 } | 1124 } |
1130 | 1125 |
1131 } | 1126 } |
1132 else | 1127 else |
1133 { | 1128 { |
1134 //Unicode is more problematic - we need the 0x80 at the front of the string | 1129 //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 | 1130 //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 | 1131 //of 'str2' into a temporary buffer. At the moment, we only wrap numbers so this |
1137 //code will wait until it is required. | 1132 //code will wait until it is required. |
1138 // str[3] = "Code not written!!"; //issue warning | 1133 // str[3] = "Code not written!!"; //issue warning |
1139 // strLen[3] = dspl_GetTextExtent(str[3],0); | 1134 // strLen[3] = dspl_GetTextExtent(str[3],0); |
1140 fullScreen = DLG_USE_FULL_SCREEN; //error - use full screen | 1135 fullScreen = DLG_USE_FULL_SCREEN; //error - use full screen |
1141 } | 1136 } |
1142 } | 1137 } |
1143 } | 1138 } |
1144 | 1139 |
1145 //Calculate longest line of text (including softkeys - sx already set to the softkey width) | 1140 //Calculate longest line of text (including softkeys - sx already set to the softkey width) |
1146 for (i=0;i< MAX_DLG_LINES;i++) | 1141 for (i=0;i< MAX_DLG_LINES;i++) |
1147 { | 1142 { |
1148 if (strLen[i]>sx) | 1143 if (strLen[i]>sx) |
1149 sx = strLen[i]; | 1144 sx = strLen[i]; |
1150 } | 1145 } |
1151 if (sx > SCREEN_SIZE_X-charWidth) | 1146 if (sx > SCREEN_SIZE_X-charWidth) |
1152 sx = SCREEN_SIZE_X; | 1147 sx = SCREEN_SIZE_X; |
1153 else | 1148 else |
1154 { | 1149 { |
1155 if (sx > SCREEN_SIZE_X/2) | 1150 if (sx > SCREEN_SIZE_X/2) |
1156 sx = sx + charWidth; | 1151 sx = sx + charWidth; |
1157 else | 1152 else |
1158 sx = sx + charWidth*2; | 1153 sx = sx + charWidth*2; |
1159 } | 1154 } |
1160 if (sy> sx) | 1155 if (sy> sx) |
1161 sx = sy; | 1156 sx = sy; |
1162 wx = (SCREEN_SIZE_X-sx)/2; | 1157 wx = (SCREEN_SIZE_X-sx)/2; |
1163 if (wx<0) | 1158 if (wx<0) |
1164 wx=0; | 1159 wx=0; |
1165 } | 1160 } |
1166 | 1161 |
1167 if (sy > SCREEN_SIZE_Y) | 1162 if (sy > SCREEN_SIZE_Y) |
1168 wy = 0; | 1163 wy = 0; |
1169 else if (SCREEN_SIZE_Y > 2*sy) | 1164 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 | 1165 wy = (SCREEN_SIZE_Y*2/3-sy)/2; //display in middle of top 2/3 of screen |
1171 else | 1166 else |
1172 wy = (SCREEN_SIZE_Y-sy)/2; //display in middle of screen | 1167 wy = (SCREEN_SIZE_Y-sy)/2; //display in middle of screen |
1173 if (wy < 10) | 1168 if (wy < 10) |
1174 wy = wy/2; | 1169 wy = wy/2; |
1175 | 1170 |
1176 if ((wx == 0) || (wy==0)) | 1171 if ((wx == 0) || (wy==0)) |
1177 { //not enough room to display as a window - use whole screen | 1172 { //not enough room to display as a window - use whole screen |
1178 fullScreen = DLG_USE_FULL_SCREEN; | 1173 fullScreen = DLG_USE_FULL_SCREEN; |
1179 } | 1174 } |
1180 | 1175 |
1181 #ifdef COLOURDISPLAY | 1176 #ifdef COLOURDISPLAY |
1182 if ((data->icon_array != NULL) && (fullScreen != DLG_USE_BITMAP)) | 1177 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 | 1178 { //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) | 1179 if (sx < data->icon_array[0].area.sx) |
1185 sx = data->icon_array[0].area.sx; | 1180 sx = data->icon_array[0].area.sx; |
1186 yBmpOfs = data->icon_array[0].area.py + data->icon_array[0].area.sy; | 1181 yBmpOfs = data->icon_array[0].area.py + data->icon_array[0].area.sy; |
1187 wy = data->icon_array[0].area.py; | 1182 wy = data->icon_array[0].area.py; |
1188 sy = sy + data->icon_array[0].area.sy; | 1183 sy = sy + data->icon_array[0].area.sy; |
1189 } | 1184 } |
1190 #endif | 1185 #endif |
1191 } | 1186 } |
1192 else | 1187 else |
1193 { | 1188 { |
1194 //We have no strings to display - clear entire screen | 1189 //We have no strings to display - clear entire screen |
1195 fullScreen = DLG_USE_FULL_SCREEN; | 1190 fullScreen = DLG_USE_FULL_SCREEN; |
1196 } | 1191 } |
1197 | 1192 |
1198 | 1193 |
1199 /****************************** | 1194 /****************************** |
1200 * Draw window (full screen/pop-up) | 1195 * Draw window (full screen/pop-up) |
1201 *****************************/ | 1196 *****************************/ |
1202 if (fullScreen != DLG_USE_FULL_SCREEN) | 1197 if (fullScreen != DLG_USE_FULL_SCREEN) |
1203 dspl_unfocusDisplay(); | 1198 dspl_unfocusDisplay(); |
1204 area.px = 0; | 1199 area.px = 0; |
1205 area.py = 0; | 1200 area.py = 0; |
1206 area.sx = sx; | 1201 area.sx = sx; |
1207 area.sy = sy; | 1202 area.sy = sy; |
1208 resources_setColour(data->dlgCol); | 1203 resources_setColour(data->dlgCol); |
1209 drawWinType = DSPL_WIN_CENTRE; | 1204 drawWinType = DSPL_WIN_CENTRE; |
1210 | 1205 |
1211 if (fullScreen!=DLG_USE_FULL_SCREEN) | 1206 if (fullScreen!=DLG_USE_FULL_SCREEN) |
1212 { | 1207 { |
1213 t_font_bitmap bmp; | 1208 t_font_bitmap bmp; |
1214 t_font_bitmap* bmpPtr = NULL; | 1209 t_font_bitmap* bmpPtr = NULL; |
1215 | 1210 |
1216 for (i=0;i<MAX_DLG_LINES;i++) | 1211 for (i=0;i<MAX_DLG_LINES;i++) |
1217 { | 1212 { |
1218 //centre text | 1213 //centre text |
1219 xPos[i] = wx+(sx-strLen[i])/2; | 1214 xPos[i] = wx+(sx-strLen[i])/2; |
1220 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; | 1215 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; |
1221 } | 1216 } |
1222 | 1217 |
1223 #ifdef COLOURDISPLAY | 1218 #ifdef COLOURDISPLAY |
1224 if ((data->dlgBgdBitmap != NULL) && (fullScreen==DLG_USE_BITMAP)) | 1219 if ((data->dlgBgdBitmap != NULL) && (fullScreen==DLG_USE_BITMAP)) |
1225 { | 1220 { |
1226 bmp.format = data->dlgBgdBitmap->icnType; | 1221 bmp.format = data->dlgBgdBitmap->icnType; |
1227 bmp.height = data->dlgBgdBitmap->area.sy; | 1222 bmp.height = data->dlgBgdBitmap->area.sy; |
1228 bmp.width = data->dlgBgdBitmap->area.sx; | 1223 bmp.width = data->dlgBgdBitmap->area.sx; |
1229 bmp.bitmap = data->dlgBgdBitmap->icons; | 1224 bmp.bitmap = data->dlgBgdBitmap->icons; |
1230 bmpPtr = &bmp; | 1225 bmpPtr = &bmp; |
1231 area = calcLayout(data->dlgType, sx, sy, bmp.width, bmp.height); | 1226 area = calcLayout(data->dlgType, sx, sy, bmp.width, bmp.height); |
1232 | 1227 |
1233 //Adjust size of available area depending on bitmap properties/dlgType. | 1228 //Adjust size of available area depending on bitmap properties/dlgType. |
1234 //dlgType== 0 =>display info in centre of bitmap | 1229 //dlgType== 0 =>display info in centre of bitmap |
1235 if (data->dlgType == 0) | 1230 if (data->dlgType == 0) |
1236 { | 1231 { |
1237 //If the bmp is bigger than the data we will move the bmp to | 1232 //If the bmp is bigger than the data we will move the bmp to |
1238 //lie over the centre of the data | 1233 //lie over the centre of the data |
1239 area.px = area.px - (bmp.width - sx)/2; | 1234 area.px = area.px - (bmp.width - sx)/2; |
1240 area.py = area.py - (bmp.height- sy)/2; | 1235 area.py = area.py - (bmp.height- sy)/2; |
1241 } | 1236 } |
1242 for (i=0;i<MAX_DLG_LINES;i++) | 1237 for (i=0;i<MAX_DLG_LINES;i++) |
1243 { | 1238 { |
1244 xPos[i] = xPos[i] + area.px; | 1239 xPos[i] = xPos[i] + area.px; |
1245 yPos[i] = yPos[i] + area.py; | 1240 yPos[i] = yPos[i] + area.py; |
1246 } | 1241 } |
1247 | 1242 |
1248 TRACE_EVENT_P3("wy = %d, yOfs = %d, area.py = %d",wy,yOfs,area.py); | 1243 TRACE_EVENT_P3("wy = %d, yOfs = %d, area.py = %d",wy,yOfs,area.py); |
1249 if( data->dlgBgdBitmap->icnType != ICON_TYPE_1BIT_UNPACKED ) | 1244 if( data->dlgBgdBitmap->icnType != ICON_TYPE_1BIT_UNPACKED ) |
1250 dspl_SetBgdColour( COL_TRANSPARENT ); | 1245 dspl_SetBgdColour( COL_TRANSPARENT ); |
1251 | 1246 |
1252 | 1247 |
1253 } | 1248 } |
1254 else | 1249 else |
1255 { | 1250 { |
1256 // x0066814 06 Dec 2006, OMAPS00106825 | 1251 // x0066814 06 Dec 2006, OMAPS00106825 |
1257 //The window height calculation related to wrapping should be skipped when no | 1252 //The window height calculation related to wrapping should be skipped when no |
1258 //string wrapping is done | 1253 //string wrapping is done |
1259 if(wrapLine>0) | 1254 if(wrapLine>0) |
1260 { | 1255 { |
1261 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); | 1256 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); |
1262 } | 1257 } |
1263 area.sy = sy; | 1258 area.sy = sy; |
1264 } | 1259 } |
1265 #else | 1260 #else |
1266 if (wrapLine>1) | 1261 if (wrapLine>1) |
1267 { | 1262 { |
1268 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); | 1263 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); |
1269 area.sy = sy; | 1264 area.sy = sy; |
1270 } | 1265 } |
1271 #endif | 1266 #endif |
1272 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1267 // 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. | 1268 //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) | 1269 if(sy+wy >= SCREEN_SIZE_Y && sy < SCREEN_SIZE_Y) |
1275 if(wy>0 && wy < sy) | 1270 if(wy>0 && wy < sy) |
1278 if(wy < 0) | 1273 if(wy < 0) |
1279 wy=0; | 1274 wy=0; |
1280 for (i=0;i<MAX_DLG_LINES;i++) | 1275 for (i=0;i<MAX_DLG_LINES;i++) |
1281 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; | 1276 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; |
1282 } | 1277 } |
1283 dspl_DrawWin( wx,wy,sx,sy, drawWinType , bmpPtr); | 1278 dspl_DrawWin( wx,wy,sx,sy, drawWinType , bmpPtr); |
1284 } | 1279 } |
1285 else | 1280 else |
1286 { | 1281 { |
1287 dspl_ClearAll(); | 1282 dspl_ClearAll(); |
1288 sx = 84; | 1283 sx = 84; |
1289 for (i=0;i<MAX_DLG_LINES;i++) | 1284 for (i=0;i<MAX_DLG_LINES;i++) |
1290 { | 1285 { |
1291 xPos[i] = 0; | 1286 xPos[i] = 0; |
1292 yPos[i] = Mmi_layout_line(i+1); | 1287 yPos[i] = Mmi_layout_line(i+1); |
1293 } | 1288 } |
1294 } | 1289 } |
1295 /****************************** | 1290 /****************************** |
1296 * Print softkeys | 1291 * Print softkeys |
1297 *****************************/ | 1292 *****************************/ |
1298 icnShow(data->icon); | 1293 icnShow(data->icon); |
1299 if ((lskStr != NULL) || (rskStr != NULL)) | 1294 if ((lskStr != NULL) || (rskStr != NULL)) |
1300 { | 1295 { |
1301 if (fullScreen==DLG_USE_FULL_SCREEN) | 1296 if (fullScreen==DLG_USE_FULL_SCREEN) |
1302 Mmi_layout_softkeyArea( &skArea ); | 1297 Mmi_layout_softkeyArea( &skArea ); |
1303 else | 1298 else |
1304 { | 1299 { |
1305 skArea.px = area.px+wx; | 1300 skArea.px = area.px+wx; |
1306 skArea.sx = area.sx; | 1301 skArea.sx = area.sx; |
1307 skArea.py = area.py+wy+area.sy-Mmi_layout_softkeyHeight()-1; | 1302 skArea.py = area.py+wy+area.sy-Mmi_layout_softkeyHeight()-1; |
1308 skArea.sy = Mmi_layout_softkeyHeight(); | 1303 skArea.sy = Mmi_layout_softkeyHeight(); |
1309 } | 1304 } |
1310 softKeys_displayStrXY(lskStr, rskStr, data->dlgSkFormat, data->dlgCol, &skArea); | 1305 softKeys_displayStrXY(lskStr, rskStr, data->dlgSkFormat, data->dlgCol, &skArea); |
1311 } | 1306 } |
1312 | 1307 |
1313 /****************************** | 1308 /****************************** |
1314 * Print dialog text | 1309 * Print dialog text |
1315 *****************************/ | 1310 *****************************/ |
1316 for (i=0;i<MAX_DLG_LINES;i++) | 1311 for (i=0;i<MAX_DLG_LINES;i++) |
1317 { /* GW#2294 No need to draw zero length strings .*/ | 1312 { /* GW#2294 No need to draw zero length strings .*/ |
1318 if ((str[i] != NULL) && (strLen[i] > 0)) | 1313 if ((str[i] != NULL) && (strLen[i] > 0)) |
1319 { | 1314 { |
1320 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 1315 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
1321 #ifdef FF_MMI_SAT_ICON | 1316 #ifdef FF_MMI_SAT_ICON |
1322 if(data->IconData.selfExplanatory == FALSE) | 1317 if(data->IconData.selfExplanatory == FALSE) |
1323 dspl_TextOut(xPos[i] + titleIconWidth, yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); | 1318 dspl_TextOut(xPos[i] + titleIconWidth, yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); |
1324 #else | 1319 #else |
1325 dspl_TextOut(xPos[i] , yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); | 1320 dspl_TextOut(xPos[i] , yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); |
1326 #endif | 1321 #endif |
1327 } | 1322 } |
1328 } | 1323 } |
1329 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 1324 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
1330 #ifdef FF_MMI_SAT_ICON | 1325 #ifdef FF_MMI_SAT_ICON |
1331 if(data->IconData.dst != NULL) | 1326 if(data->IconData.dst != NULL) |
1332 { | 1327 { |
1333 if(str[DLG_LINE2] == NULL) | 1328 if(str[DLG_LINE2] == NULL) |
1334 { | 1329 { |
1335 if ((data->IconData.width > TITLE_ICON_WIDTH) || | 1330 if ((data->IconData.width > TITLE_ICON_WIDTH) || |
1336 (data->IconData.height > TITLE_ICON_HEIGHT)) | 1331 (data->IconData.height > TITLE_ICON_HEIGHT)) |
1337 { | 1332 { |
1338 dspl_BitBlt2(xPos[0], yPos[0], 8, | 1333 dspl_BitBlt2(xPos[0], yPos[0], 8, |
1339 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); | 1334 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); |
1340 } | 1335 } |
1341 | 1336 |
1342 else | 1337 else |
1343 dspl_BitBlt2(xPos[0], yPos[0], data->IconData.width, | 1338 dspl_BitBlt2(xPos[0], yPos[0], data->IconData.width, |
1344 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); | 1339 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); |
1345 } | 1340 } |
1346 else | 1341 else |
1347 { | 1342 { |
1348 if ((data->IconData.width > TITLE_ICON_WIDTH) || | 1343 if ((data->IconData.width > TITLE_ICON_WIDTH) || |
1349 (data->IconData.height > TITLE_ICON_HEIGHT)) | 1344 (data->IconData.height > TITLE_ICON_HEIGHT)) |
1350 { | 1345 { |
1351 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2], 8, | 1346 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2], 8, |
1352 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); | 1347 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); |
1353 } | 1348 } |
1354 else | 1349 else |
1355 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2],data->IconData.width, | 1350 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2],data->IconData.width, |
1356 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); | 1351 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); |
1357 } | 1352 } |
1358 | 1353 |
1359 } | 1354 } |
1360 #endif | 1355 #endif |
1361 | 1356 |
1362 | 1357 |
1363 resources_restoreColour(); | 1358 resources_restoreColour(); |
1364 } | 1359 } |
1365 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1360 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1366 // Now free the allocated memory | 1361 // Now free the allocated memory |
1367 /* x0039928 - Lint warning removal */ | 1362 /* x0039928 - Lint warning removal */ |
1368 if (strLen[MAX_DLG_LINES] > scrWidth-charWidth) | 1363 if (strLen[MAX_DLG_LINES] > scrWidth-charWidth) |
1369 if (data->WrapStrings & WRAP_STRING_2) | 1364 if (data->WrapStrings & WRAP_STRING_2) |
1370 if (str[MAX_DLG_LINES][0] != (char)0x80) /* x0039928 - lint warning removal */ | 1365 if (str[MAX_DLG_LINES][0] != (char)0x80) /* x0039928 - lint warning removal */ |
1371 { | 1366 { |
1372 for(i=DLG_LINE2;i<MAX_DLG_LINES;i++) | 1367 for(i=DLG_LINE2;i<MAX_DLG_LINES;i++) |
1373 { | 1368 { |
1374 if(NULL != str[i] && strLen[i] > 0) | 1369 if(NULL != str[i] && strLen[i] > 0) |
1375 mfwFree((U8*)str[i],MAX_WRAP_CHAR); | 1370 mfwFree((U8*)str[i],MAX_WRAP_CHAR); |
1376 } | 1371 } |
1377 str[MAX_DLG_LINES]=NULL; | 1372 str[MAX_DLG_LINES]=NULL; |
1378 } | 1373 } |
1379 | 1374 |
1380 break; | 1375 break; |
1381 default: | 1376 default: |
1382 return 0; | 1377 return 0; |
1383 } | 1378 } |
1384 | 1379 |
1385 return 1; | 1380 return 1; |
1386 } | 1381 } |
1387 | 1382 |
1388 /******************************************************************************* | 1383 /******************************************************************************* |
1389 | 1384 |
1390 $Function: dialog_info_tim_cb | 1385 $Function: dialog_info_tim_cb |
1391 | 1386 |
1392 $Description: Callback function for the dialog info timer. | 1387 $Description: Callback function for the dialog info timer. |
1393 | 1388 |
1394 | 1389 |
1395 $Returns: MFW event handler | 1390 $Returns: MFW event handler |
1396 | 1391 |
1397 $Arguments: window handle event, timer control block | 1392 $Arguments: window handle event, timer control block |
1398 | 1393 |
1399 *******************************************************************************/ | 1394 *******************************************************************************/ |
1400 static T_MFW_CB dialog_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc) | 1395 static T_MFW_CB dialog_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc) |
1401 { | 1396 { |
1402 T_MFW_HND win = mfw_parent (mfw_header()); | 1397 T_MFW_HND win = mfw_parent (mfw_header()); |
1405 | 1400 |
1406 T_MFW_HND parent_win = data->parent_win; | 1401 T_MFW_HND parent_win = data->parent_win; |
1407 USHORT Identifier = data->Identifier; | 1402 USHORT Identifier = data->Identifier; |
1408 void (* Callback)() = data->Callback; | 1403 void (* Callback)() = data->Callback; |
1409 | 1404 |
1410 TRACE_FUNCTION("dialog_info_tim_cb()"); | 1405 TRACE_FUNCTION("dialog_info_tim_cb()"); |
1411 #if defined (WIN32) | 1406 #if defined (WIN32) |
1412 { | 1407 { |
1413 /***************************Go-lite Optimization changes Start***********************/ | 1408 /***************************Go-lite Optimization changes Start***********************/ |
1414 | 1409 |
1415 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | 1410 //Aug 16, 2004 REF: CRR 24323 Deepa M.D |
1416 TRACE_EVENT_P1 ("Identifier %d", data->Identifier); | 1411 TRACE_EVENT_P1 ("Identifier %d", data->Identifier); |
1417 /***************************Go-lite Optimization changes end***********************/ | 1412 /***************************Go-lite Optimization changes end***********************/ |
1418 | 1413 |
1419 } | 1414 } |
1420 #endif | 1415 #endif |
1421 | 1416 |
1422 /* | 1417 /* |
1436 } | 1431 } |
1437 | 1432 |
1438 | 1433 |
1439 /******************************************************************************* | 1434 /******************************************************************************* |
1440 | 1435 |
1441 $Function: dialog_info_kbd_cb | 1436 $Function: dialog_info_kbd_cb |
1442 | 1437 |
1443 $Description: Keyboard event handler | 1438 $Description: Keyboard event handler |
1444 | 1439 |
1445 $Returns: status int | 1440 $Returns: status int |
1446 | 1441 |
1447 $Arguments: window handle event, keyboard control block | 1442 $Arguments: window handle event, keyboard control block |
1448 | 1443 |
1449 *******************************************************************************/ | 1444 *******************************************************************************/ |
1450 | 1445 |
1451 static int dialog_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard) | 1446 static int dialog_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard) |
1452 { | 1447 { |
1459 | 1454 |
1460 TRACE_FUNCTION("dialog_info_kbd_cb"); | 1455 TRACE_FUNCTION("dialog_info_kbd_cb"); |
1461 switch (keyboard->code) | 1456 switch (keyboard->code) |
1462 { | 1457 { |
1463 case KCD_LEFT: | 1458 case KCD_LEFT: |
1464 if (data->KeyEvents & KEY_LEFT ) | 1459 if (data->KeyEvents & KEY_LEFT ) |
1465 { | 1460 { |
1466 TRACE_EVENT("dialog_info_kbd_cb: KEY_LEFT"); | 1461 TRACE_EVENT("dialog_info_kbd_cb: KEY_LEFT"); |
1467 | 1462 |
1468 dialog_info_destroy (win); | 1463 dialog_info_destroy (win); |
1469 if (Callback) | 1464 if (Callback) |
1470 (Callback) (parent_win, Identifier, INFO_KCD_LEFT); | 1465 (Callback) (parent_win, Identifier, INFO_KCD_LEFT); |
1471 } | 1466 } |
1472 break; | 1467 break; |
1473 | 1468 |
1474 case KCD_RIGHT: | 1469 case KCD_RIGHT: |
1475 if (data->KeyEvents & KEY_RIGHT) | 1470 if (data->KeyEvents & KEY_RIGHT) |
1476 { | 1471 { |
1477 dialog_info_destroy (win); | 1472 dialog_info_destroy (win); |
1478 if (Callback) | 1473 if (Callback) |
1479 (Callback) (parent_win, Identifier, INFO_KCD_RIGHT); | 1474 (Callback) (parent_win, Identifier, INFO_KCD_RIGHT); |
1480 } | 1475 } |
1481 break; | 1476 break; |
1482 | 1477 |
1483 case KCD_HUP: | 1478 case KCD_HUP: |
1484 if (data->KeyEvents & KEY_HUP || data->KeyEvents & INFO_KCD_ALL) | 1479 if (data->KeyEvents & KEY_HUP || data->KeyEvents & INFO_KCD_ALL) |
1485 { | 1480 { |
1486 dialog_info_destroy (win); | 1481 dialog_info_destroy (win); |
1487 if (Callback) | 1482 if (Callback) |
1488 (Callback) (parent_win, Identifier, INFO_KCD_HUP); | 1483 (Callback) (parent_win, Identifier, INFO_KCD_HUP); |
1489 } | 1484 } |
1490 break; | 1485 break; |
1486 | |
1491 case KCD_MNUUP: | 1487 case KCD_MNUUP: |
1492 | 1488 if (data->KeyEvents & KEY_MNUUP) |
1493 if (data->KeyEvents & KEY_MNUUP) | 1489 { |
1494 { | 1490 if (Callback) |
1495 if (Callback) | 1491 (Callback) (parent_win, Identifier, INFO_KCD_UP); |
1496 (Callback) (parent_win, Identifier, INFO_KCD_UP); | 1492 } |
1497 } | 1493 break; |
1498 | 1494 |
1499 break; | |
1500 case KCD_MNUDOWN: | 1495 case KCD_MNUDOWN: |
1501 | 1496 if (data->KeyEvents & KEY_MNUDOWN) |
1502 if (data->KeyEvents & KEY_MNUDOWN) | 1497 { |
1503 { | 1498 if (Callback) |
1504 if (Callback) | 1499 (Callback) (parent_win, Identifier, INFO_KCD_DOWN); |
1505 (Callback) (parent_win, Identifier, INFO_KCD_DOWN); | 1500 } |
1506 } | 1501 break; |
1507 | 1502 |
1508 break; | |
1509 //MZ 7/3/01 used to start a call. | 1503 //MZ 7/3/01 used to start a call. |
1510 case KCD_CALL: | 1504 case KCD_CALL: |
1511 if (data->KeyEvents & KEY_CALL ) | 1505 if (data->KeyEvents & KEY_CALL ) |
1512 { | 1506 { |
1513 dialog_info_destroy (win); | 1507 dialog_info_destroy (win); |
1514 if (Callback) | 1508 if (Callback) |
1515 (Callback) (parent_win, Identifier, INFO_KCD_OFFHOOK); | 1509 (Callback) (parent_win, Identifier, INFO_KCD_OFFHOOK); |
1516 } | 1510 } |
1517 break; | 1511 break; |
1512 | |
1518 default: | 1513 default: |
1519 if (data->KeyEvents & INFO_KCD_ALL) | 1514 if (data->KeyEvents & INFO_KCD_ALL) |
1520 { | 1515 { |
1521 TRACE_EVENT("dialog_info_kbd_cb: INFO_KCD_ALL"); | 1516 TRACE_EVENT("dialog_info_kbd_cb: INFO_KCD_ALL"); |
1522 | 1517 |
1523 /* | 1518 /* |
1524 Note: The variable Identifier is overwritten with the | 1519 Note: The variable Identifier is overwritten with the |
1525 keycode of the dialog; | 1520 keycode of the dialog; |
1526 we need it only for the Multicall Control !! | 1521 we need it only for the Multicall Control !! |
1527 */ | 1522 */ |
1528 Identifier = keyboard->code; | 1523 Identifier = keyboard->code; |
1529 dialog_info_destroy (win); | 1524 dialog_info_destroy (win); |
1530 if (Callback) | 1525 if (Callback) |
1531 (Callback) (parent_win, Identifier, INFO_KCD_ALL); | 1526 (Callback) (parent_win, Identifier, INFO_KCD_ALL); |
1532 } | 1527 } |
1533 break; | 1528 break; |
1534 | 1529 |
1535 } | 1530 } |
1536 return MFW_EVENT_CONSUMED; | 1531 return MFW_EVENT_CONSUMED; |
1537 } | 1532 } |
1538 | 1533 |
1539 static int dialog_info_kbd_long_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard){ | 1534 static int dialog_info_kbd_long_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard){ |
1540 return MFW_EVENT_CONSUMED; | 1535 return MFW_EVENT_CONSUMED; |
1541 } | 1536 } |
1542 | |
1543 | 1537 |
1544 | 1538 |
1545 /******************************************************************************* | 1539 /******************************************************************************* |
1546 | 1540 |
1547 $Function: mmi_dialog_information_screen | 1541 $Function: mmi_dialog_information_screen |
1548 | 1542 |
1549 $Description: | 1543 $Description: |
1550 | 1544 |
1551 $Returns: | 1545 $Returns: |
1552 | 1546 |
1554 | 1548 |
1555 *******************************************************************************/ | 1549 *******************************************************************************/ |
1556 | 1550 |
1557 T_MFW_HND mmi_dialog_information_screen(T_MFW_HND parent_win, int TxtId, char* text, T_VOID_FUNC call_back, USHORT identifier) | 1551 T_MFW_HND mmi_dialog_information_screen(T_MFW_HND parent_win, int TxtId, char* text, T_VOID_FUNC call_back, USHORT identifier) |
1558 { | 1552 { |
1559 T_DISPLAY_DATA display_info; | 1553 T_DISPLAY_DATA display_info; |
1560 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtId, TxtNull, COLOUR_STATUS); | 1554 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtId, TxtNull, COLOUR_STATUS); |
1561 dlg_initDisplayData_events( &display_info, call_back, THREE_SECS, KEY_ALL ); | 1555 dlg_initDisplayData_events( &display_info, call_back, THREE_SECS, KEY_ALL ); |
1562 //Sep 01, 2004 REF: CRR 21380 Deepa M.D | 1556 //Sep 01, 2004 REF: CRR 21380 Deepa M.D |
1563 //Assigning TextId and TextString will not display both the messages. | 1557 //Assigning TextId and TextString will not display both the messages. |
1564 //Hence we need to use TextId and TextString2 or TextId2 and TextString | 1558 //Hence we need to use TextId and TextString2 or TextId2 and TextString |
1565 display_info.TextString2 = text; | 1559 display_info.TextString2 = text; |
1566 display_info.Identifier = identifier; | 1560 display_info.Identifier = identifier; |
1567 return info_dialog(parent_win,&display_info); //information screen | 1561 return info_dialog(parent_win,&display_info); //information screen |
1568 | |
1569 } | 1562 } |
1570 | 1563 |
1571 T_MFW_HND mmi_dialog_information_screen_forever(MfwHnd win,int TextId, char* TextStr, int colour) | 1564 T_MFW_HND mmi_dialog_information_screen_forever(MfwHnd win,int TextId, char* TextStr, int colour) |
1572 { | 1565 { |
1573 T_DISPLAY_DATA DisplayInfo; | 1566 T_DISPLAY_DATA DisplayInfo; |
1574 dlg_initDisplayData_TextId( &DisplayInfo, TxtNull, TxtNull, TextId, TxtNull, colour); | 1567 dlg_initDisplayData_TextId( &DisplayInfo, TxtNull, TxtNull, TextId, TxtNull, colour); |
1575 dlg_initDisplayData_events( &DisplayInfo, NULL, FOREVER, KEY_HUP ); | 1568 dlg_initDisplayData_events( &DisplayInfo, NULL, FOREVER, KEY_HUP ); |
1576 DisplayInfo.TextString = TextStr; | 1569 DisplayInfo.TextString = TextStr; |
1577 return info_dialog(win, &DisplayInfo); | 1570 return info_dialog(win, &DisplayInfo); |
1578 } | 1571 } |
1579 | 1572 |
1580 /******************************************************************************* | 1573 /******************************************************************************* |
1581 | 1574 |
1582 $Function: mmi_dialogs_insert_icon | 1575 $Function: mmi_dialogs_insert_icon |
1583 | 1576 |
1584 $Description: Displays one icon in a dialog | 1577 $Description: Displays one icon in a dialog |
1585 | 1578 |
1586 $Returns: none | 1579 $Returns: none |
1587 | 1580 |
1588 $Arguments: win, pointer to an icon | 1581 $Arguments: win, pointer to an icon |
1589 | 1582 |
1590 *******************************************************************************/ | 1583 *******************************************************************************/ |
1591 void mmi_dialogs_insert_icon (T_MFW_HND win_dialog ,MfwIcnAttr *icon) | 1584 void mmi_dialogs_insert_icon (T_MFW_HND win_dialog ,MfwIcnAttr *icon) |
1592 { | 1585 { |
1593 T_MFW_WIN * win_data = ((T_MFW_HDR *)win_dialog)->data; | 1586 T_MFW_WIN * win_data = ((T_MFW_HDR *)win_dialog)->data; |
1594 T_dialog_info * data = (T_dialog_info *)win_data->user; | 1587 T_dialog_info * data = (T_dialog_info *)win_data->user; |
1595 | 1588 |
1596 | 1589 data->icon = icnCreate(win_dialog,icon,E_ICN_VISIBLE,NULL); |
1597 data->icon = icnCreate(win_dialog,icon,E_ICN_VISIBLE,NULL); | 1590 icnUnhide(data->icon); |
1598 icnUnhide(data->icon); | 1591 winShow(win_dialog); |
1599 winShow(win_dialog); | |
1600 | |
1601 } | 1592 } |
1602 | 1593 |
1603 /******************************************************************************* | 1594 /******************************************************************************* |
1604 | 1595 |
1605 $Function: mmi_dialogs_insert_animation | 1596 $Function: mmi_dialogs_insert_animation |
1606 | 1597 |
1607 $Description: starts an animation in a dialog | 1598 $Description: starts an animation in a dialog |
1608 | 1599 |
1609 $Returns: none | 1600 $Returns: none |
1610 | 1601 |
1611 $Arguments: win, animation time, pointer to an icon, number of frames | 1602 $Arguments: win, animation time, pointer to an icon, number of frames |
1612 | 1603 |
1613 *******************************************************************************/ | 1604 *******************************************************************************/ |
1614 void mmi_dialogs_insert_animation (T_MFW_HND win_dialog , S32 anim_time ,MfwIcnAttr *icon ,UBYTE number_of_frames) | 1605 void mmi_dialogs_insert_animation (T_MFW_HND win_dialog , S32 anim_time ,MfwIcnAttr *icon ,UBYTE number_of_frames) |
1615 { | 1606 { |
1616 T_MFW_WIN * win_data = ((T_MFW_HDR *)win_dialog)->data; | 1607 T_MFW_WIN * win_data = ((T_MFW_HDR *)win_dialog)->data; |
1617 T_dialog_info * data = (T_dialog_info *)win_data->user; | 1608 T_dialog_info * data = (T_dialog_info *)win_data->user; |
1618 | 1609 |
1619 | 1610 data->number_of_frames = number_of_frames; |
1620 data->number_of_frames = number_of_frames; | 1611 data->current_frame = 0; |
1621 data->current_frame = 0; | 1612 data->icon_array = icon; |
1622 data->icon_array = icon; | 1613 data->current_icon = data->icon_array; |
1623 data->current_icon = data->icon_array; | 1614 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); | 1615 icnUnhide(data->icon); |
1625 icnUnhide(data->icon); | 1616 |
1626 | 1617 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); | 1618 timStart(data->animation_timer); |
1628 timStart(data->animation_timer); | 1619 winShow(win_dialog); |
1629 winShow(win_dialog); | |
1630 | |
1631 } | 1620 } |
1632 | 1621 |
1633 /******************************************************************************* | 1622 /******************************************************************************* |
1634 | 1623 |
1635 $Function: mmi_dialogs_insert_animation_CB | 1624 $Function: mmi_dialogs_insert_animation_CB |
1636 | 1625 |
1637 $Description: destroys the current icon and starts the next icon | 1626 $Description: destroys the current icon and starts the next icon |
1638 | 1627 |
1639 $Returns: none | 1628 $Returns: none |
1640 | 1629 |
1641 $Arguments: timer event, timer control block | 1630 $Arguments: timer event, timer control block |
1642 | 1631 |
1643 *******************************************************************************/ | 1632 *******************************************************************************/ |
1644 void mmi_dialogs_insert_animation_CB (T_MFW_EVENT event, T_MFW_TIM *tc) | 1633 void mmi_dialogs_insert_animation_CB (T_MFW_EVENT event, T_MFW_TIM *tc) |
1645 { | 1634 { |
1646 T_MFW_HND win = mfw_parent (mfw_header()); | 1635 T_MFW_HND win = mfw_parent (mfw_header()); |
1647 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 1636 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
1648 T_dialog_info * data = (T_dialog_info *)win_data->user; | 1637 T_dialog_info * data = (T_dialog_info *)win_data->user; |
1649 | 1638 |
1650 | 1639 icnDelete(data->icon); |
1651 icnDelete(data->icon); | 1640 if (data->current_frame < (data->number_of_frames-1)) |
1652 if (data->current_frame < (data->number_of_frames-1)) | 1641 { |
1653 { | 1642 data->current_frame++; |
1654 data->current_frame++; | 1643 data->current_icon++; |
1655 data->current_icon++; | 1644 } |
1656 } | 1645 else |
1657 else | 1646 { |
1658 { | 1647 data->current_frame = 0; |
1659 data->current_frame = 0; | 1648 data->current_icon = data->icon_array; |
1660 data->current_icon = data->icon_array; | 1649 } |
1661 } | 1650 data->icon = icnCreate(win,data->current_icon,E_ICN_VISIBLE,NULL); |
1662 data->icon = icnCreate(win,data->current_icon,E_ICN_VISIBLE,NULL); | 1651 icnUnhide(data->icon); |
1663 icnUnhide(data->icon); | 1652 timStart(data->animation_timer); |
1664 timStart(data->animation_timer); | 1653 winShow(win); |
1665 winShow(win); | |
1666 | |
1667 } | 1654 } |
1668 /***************************Go-lite Optimization changes Start***********************/ | 1655 /***************************Go-lite Optimization changes Start***********************/ |
1669 | 1656 |
1670 //Aug 25, 2004 REF: CRR 24904 Deepa M.D | 1657 //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 | 1658 //This function is used only for the Color build.Hence it is put under the |
1672 //COLOURDISPLAY compiler switch | 1659 //COLOURDISPLAY compiler switch |
1673 #ifdef COLOURDISPLAY | 1660 #ifdef COLOURDISPLAY |
1674 void mmi_dialogs_insert_animation_new (T_DISPLAY_DATA *animateInfo , S32 anim_time ,MfwIcnAttr* icon ,UBYTE number_of_frames) | 1661 void mmi_dialogs_insert_animation_new (T_DISPLAY_DATA *animateInfo , S32 anim_time ,MfwIcnAttr* icon ,UBYTE number_of_frames) |
1675 { | 1662 { |
1676 TRACE_EVENT("mmi_dialogs_insert_animation_new()"); | 1663 TRACE_EVENT("mmi_dialogs_insert_animation_new()"); |
1677 | 1664 |
1678 animateInfo->number_of_frames = number_of_frames; | 1665 animateInfo->number_of_frames = number_of_frames; |
1679 animateInfo->current_frame = 0; | 1666 animateInfo->current_frame = 0; |
1680 animateInfo->icon_array = icon; | 1667 animateInfo->icon_array = icon; |
1681 animateInfo->anim_time = anim_time; | 1668 animateInfo->anim_time = anim_time; |
1682 | |
1683 } | 1669 } |
1684 #endif | 1670 #endif |
1685 /***************************Go-lite Optimization changes end***********************/ | 1671 /***************************Go-lite Optimization changes end***********************/ |
1686 | 1672 |
1687 void mmi_dialogs_animation_new_CB (T_MFW_EVENT event, T_MFW_TIM *tc) | 1673 void mmi_dialogs_animation_new_CB (T_MFW_EVENT event, T_MFW_TIM *tc) |
1688 { | 1674 { |
1689 T_MFW_HND win = mfw_parent (mfw_header()); | 1675 T_MFW_HND win = mfw_parent (mfw_header()); |
1690 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 1676 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
1691 T_dialog_info * data = (T_dialog_info *)win_data->user; | 1677 T_dialog_info * data = (T_dialog_info *)win_data->user; |
1692 char * idData; | 1678 char * idData; |
1693 int px, py, sx, sy; | 1679 int px, py, sx, sy; |
1694 MfwIcnAttr* icn_array; | 1680 MfwIcnAttr* icn_array; |
1695 MfwIcnAttr* icn; | 1681 MfwIcnAttr* icn; |
1696 | 1682 |
1697 TRACE_EVENT("mmi_dialogs_insert_animation_new_CB()"); | 1683 TRACE_EVENT("mmi_dialogs_insert_animation_new_CB()"); |
1698 | 1684 |
1699 | |
1700 | |
1701 data->current_frame = (data->current_frame +1) % data->number_of_frames; | 1685 data->current_frame = (data->current_frame +1) % data->number_of_frames; |
1702 TRACE_EVENT_P1("data->current_frame = %d", data->current_frame); | 1686 TRACE_EVENT_P1("data->current_frame = %d", data->current_frame); |
1703 TRACE_EVENT_P1("number_of_frames = %d", data->number_of_frames); | 1687 TRACE_EVENT_P1("number_of_frames = %d", data->number_of_frames); |
1704 | 1688 |
1705 icn_array = (MfwIcnAttr*)data->icon_array; | 1689 icn_array = (MfwIcnAttr*)data->icon_array; |
1716 | 1700 |
1717 idData = icn->icons; | 1701 idData = icn->icons; |
1718 | 1702 |
1719 dspl_BitBlt2(px,py,sx,sy,(void*)idData,0,0x02); | 1703 dspl_BitBlt2(px,py,sx,sy,(void*)idData,0,0x02); |
1720 timStart(data->animation_timer); | 1704 timStart(data->animation_timer); |
1721 | |
1722 } | 1705 } |
1723 //Jun 04,2004 CRR:13601 xpradipg - SASKEN | 1706 //Jun 04,2004 CRR:13601 xpradipg - SASKEN |
1724 /******************************************************************************* | 1707 /******************************************************************************* |
1725 | 1708 |
1726 $Function: InfoDialogTimRestart | 1709 $Function: InfoDialogTimRestart |
1727 | 1710 |
1728 $Description: restarts the information dialog timer | 1711 $Description: restarts the information dialog timer |
1729 | 1712 |
1730 $Returns: none | 1713 $Returns: none |
1731 | 1714 |
1732 $Arguments: window handler | 1715 $Arguments: window handler |
1733 | 1716 |
1734 *******************************************************************************/ | 1717 *******************************************************************************/ |
1735 | 1718 |
1736 void InfoDialogTimRestart(T_MFW_HND win) | 1719 void InfoDialogTimRestart(T_MFW_HND win) |
1737 { | 1720 { |
1738 T_MFW_WIN * win_data; | 1721 T_MFW_WIN * win_data; |
1739 T_dialog_info * data; | 1722 T_dialog_info * data; |
1740 | 1723 |
1741 win_data = ((T_MFW_HDR *)win)->data; | 1724 win_data = ((T_MFW_HDR *)win)->data; |
1742 data = (T_dialog_info *)win_data->user; | 1725 data = (T_dialog_info *)win_data->user; |
1743 | 1726 |
1744 tim_stop(data->info_tim); | 1727 tim_stop(data->info_tim); |
1745 tim_start(data->info_tim); | 1728 tim_start(data->info_tim); |
1746 } | 1729 } |
1747 | 1730 |
1748 // Feb 24, 2005 CRR:29102 xnkulkar - SASKEN | 1731 // Feb 24, 2005 CRR:29102 xnkulkar - SASKEN |
1749 // As the user has already confirmed that all SMS messages are to be deleted, KEY_HUP is not | 1732 // As the user has already confirmed that all SMS messages are to be deleted, KEY_HUP is not |
1750 // registered. | 1733 // registered. |
1751 /******************************************************************************* | 1734 /******************************************************************************* |
1752 | 1735 |
1753 $Function: mmi_dialog_information_screen_delete_all | 1736 $Function: mmi_dialog_information_screen_delete_all |
1754 | 1737 |
1755 $Description: Displays the information screen during "Delete All" operation | 1738 $Description: Displays the information screen during "Delete All" operation |
1756 | 1739 |
1757 $Returns: Handle of information dialog | 1740 $Returns: Handle of information dialog |
1758 | 1741 |
1759 $Arguments: window handle, text id, text string and generic status window | 1742 $Arguments: window handle, text id, text string and generic status window |
1760 | 1743 |
1761 *******************************************************************************/ | 1744 *******************************************************************************/ |
1762 T_MFW_HND mmi_dialog_information_screen_delete_all(MfwHnd win,int TextId, char* TextStr, int colour) | 1745 T_MFW_HND mmi_dialog_information_screen_delete_all(MfwHnd win,int TextId, char* TextStr, int colour) |
1763 { | 1746 { |
1764 T_DISPLAY_DATA DisplayInfo; | 1747 T_DISPLAY_DATA DisplayInfo; |
1765 | 1748 |
1766 dlg_initDisplayData_TextId( &DisplayInfo, TxtNull, TxtNull, TextId, TxtNull, colour); | 1749 dlg_initDisplayData_TextId( &DisplayInfo, TxtNull, TxtNull, TextId, TxtNull, colour); |
1767 dlg_initDisplayData_events( &DisplayInfo, NULL, FOREVER, NULL ); | 1750 dlg_initDisplayData_events( &DisplayInfo, NULL, FOREVER, NULL ); |
1768 DisplayInfo.TextString = TextStr; | 1751 DisplayInfo.TextString = TextStr; |
1769 | 1752 |
1770 return info_dialog(win, &DisplayInfo); | 1753 return info_dialog(win, &DisplayInfo); |
1771 } | 1754 } |
1772 | 1755 |
1773 //x0peela 02 Apr, 2007 ER: OMAPS00122561 | 1756 //x0peela 02 Apr, 2007 ER: OMAPS00122561 |
1774 #ifdef FF_PHONE_LOCK | 1757 #ifdef FF_PHONE_LOCK |
1775 /******************************************************************************* | 1758 /******************************************************************************* |
1776 | 1759 |
1777 $Function: phlock_info_dialog | 1760 $Function: phlock_info_dialog |
1778 | 1761 |
1779 $Description: Common information dialog | 1762 $Description: Common information dialog |
1780 | 1763 |
1781 $Returns: Dialogue info win | 1764 $Returns: Dialogue info win |
1782 | 1765 |
1783 $Arguments: parent win, display info | 1766 $Arguments: parent win, display info |
1784 | 1767 |
1785 *******************************************************************************/ | 1768 *******************************************************************************/ |
1786 T_MFW_HND phlock_info_dialog (T_MFW_HND parent_win, | 1769 T_MFW_HND phlock_info_dialog (T_MFW_HND parent_win, |
1787 T_DISPLAY_DATA * display_info) | 1770 T_DISPLAY_DATA * display_info) |
1788 { | 1771 { |
1789 T_MFW_HND win; | 1772 T_MFW_HND win; |
1790 TRACE_FUNCTION("phlock_info_dialog()"); | 1773 TRACE_FUNCTION("phlock_info_dialog()"); |
1791 display_info->SoftKeyStrings = FALSE; | 1774 display_info->SoftKeyStrings = FALSE; |
1792 | 1775 |
1799 return win; | 1782 return win; |
1800 } | 1783 } |
1801 | 1784 |
1802 /******************************************************************************* | 1785 /******************************************************************************* |
1803 | 1786 |
1804 $Function: phlock_dialog_info_create | 1787 $Function: phlock_dialog_info_create |
1805 | 1788 |
1806 $Description: Creation of an information dialog | 1789 $Description: Creation of an information dialog |
1807 | 1790 |
1808 $Returns: Dialogue info win | 1791 $Returns: Dialogue info win |
1809 | 1792 |
1810 $Arguments: parent win | 1793 $Arguments: parent win |
1811 | 1794 |
1812 *******************************************************************************/ | 1795 *******************************************************************************/ |
1813 static T_MFW_HND phlock_dialog_info_create (T_MFW_HND parent_win) | 1796 static T_MFW_HND phlock_dialog_info_create (T_MFW_HND parent_win) |
1814 { | 1797 { |
1815 T_MFW_WIN * win_data; | 1798 T_MFW_WIN * win_data; |
1836 return data->info_win; | 1819 return data->info_win; |
1837 } | 1820 } |
1838 | 1821 |
1839 /******************************************************************************* | 1822 /******************************************************************************* |
1840 | 1823 |
1841 $Function: phlock_dialog_info_win_resize_cb | 1824 $Function: phlock_dialog_info_win_resize_cb |
1842 | 1825 |
1843 $Description: Creation of an information dialog | 1826 $Description: Creation of an information dialog |
1844 | 1827 |
1845 $Returns: Dialogue info win | 1828 $Returns: Dialogue info win |
1846 | 1829 |
1847 $Arguments: parent win | 1830 $Arguments: parent win |
1848 | 1831 |
1849 *******************************************************************************/ | 1832 *******************************************************************************/ |
1850 static int phlock_dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win) | 1833 static int phlock_dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win) |
1851 { | 1834 { |
1852 T_dialog_info * data = (T_dialog_info *)win->user; | 1835 T_dialog_info * data = (T_dialog_info *)win->user; |
1856 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1839 // 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 | 1840 //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. | 1841 // which is used while wrapping the text. |
1859 char* str[MAX_DLG_LINES+1]; | 1842 char* str[MAX_DLG_LINES+1]; |
1860 int strLen[MAX_DLG_LINES+1]; | 1843 int strLen[MAX_DLG_LINES+1]; |
1861 int i; | 1844 int i; |
1862 char* lskStr,*rskStr; | 1845 char* lskStr,*rskStr; |
1863 int wx = 0; //,wy,sx=0,sy=0; // RAVI | 1846 int wx = 0; //,wy,sx=0,sy=0; // RAVI |
1864 int wy = 0; // RAVI | 1847 int wy = 0; // RAVI |
1865 int sx = 0; // RAVI | 1848 int sx = 0; // RAVI |
1866 int sy = 0; // RAVI | 1849 int sy = 0; // RAVI |
1867 int fullScreen = DLG_USE_RECTANGLE; | 1850 int fullScreen = DLG_USE_RECTANGLE; |
1868 int yOfs; | 1851 int yOfs; |
1869 int yBmpOfs = 0; | 1852 int yBmpOfs = 0; |
1870 MfwRect skArea; | 1853 MfwRect skArea; |
1871 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 1854 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
1872 #ifdef FF_MMI_SAT_ICON | 1855 #ifdef FF_MMI_SAT_ICON |
1873 USHORT titleIconWidth = 0; | 1856 USHORT titleIconWidth = 0; |
1874 #endif | 1857 #endif |
1875 MfwRect area; | 1858 MfwRect area; |
1876 int scrWidth = 0; //available width for the display // RAVI - Assignment to 0. | 1859 int scrWidth = 0; //available width for the display // RAVI - Assignment to 0. |
1877 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1860 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1878 // temp_ptr is used while wrapping the text. | 1861 // temp_ptr is used while wrapping the text. |
1879 // Now str2[][] is not required. | 1862 // Now str2[][] is not required. |
1880 char *temp_ptr; | 1863 char *temp_ptr; |
1881 int nChar; | 1864 int nChar; |
1882 | 1865 |
1883 /* t_font_bitmap bmp; */ /* Warning Removal - x0020906 - 24-08-2006 */ | 1866 /* t_font_bitmap bmp; */ /* Warning Removal - x0020906 - 24-08-2006 */ |
1884 // t_font_bitmap* bmpPtr = &bmp; // RAVI - Not Referenced. | 1867 // t_font_bitmap* bmpPtr = &bmp; // RAVI - Not Referenced. |
1885 | 1868 |
1886 int drawWinType; | 1869 int drawWinType; |
1887 int nLines; | 1870 int nLines; |
1888 | 1871 |
1889 int linePos=0; | 1872 int linePos=0; |
1890 int lineLen = 0; | 1873 int lineLen = 0; |
1891 int wrapLine = 0; /*GW #2294*/ // x0066814 06 Dec 2006, OMAPS00106825 | 1874 int wrapLine = 0; /*GW #2294*/ // x0066814 06 Dec 2006, OMAPS00106825 |
1892 | 1875 |
1893 const int charWidth = dspl_GetTextExtent("0",1); | 1876 const int charWidth = dspl_GetTextExtent("0",1); |
1894 TRACE_FUNCTION ("phlock_dialog_info_win_resize_cb()"); | 1877 TRACE_FUNCTION ("phlock_dialog_info_win_resize_cb()"); |
1895 | 1878 |
1896 memset(str,'\0',sizeof(str)); /* x0039928 - Lint warning fix */ | 1879 memset(str,'\0',sizeof(str)); /* x0039928 - Lint warning fix */ |
1897 memset(strLen,0,sizeof(strLen)); | 1880 memset(strLen,0,sizeof(strLen)); |
1898 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 1881 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
1899 #ifdef FF_MMI_SAT_ICON | 1882 #ifdef FF_MMI_SAT_ICON |
1900 if (data->IconData.dst != NULL) | 1883 if (data->IconData.dst != NULL) |
1901 { | 1884 { |
1902 if (data->IconData.width > TITLE_ICON_WIDTH) | 1885 if (data->IconData.width > TITLE_ICON_WIDTH) |
1903 { | 1886 { |
1904 titleIconWidth = TITLE_ICON_WIDTH; | 1887 titleIconWidth = TITLE_ICON_WIDTH; |
1905 } | 1888 } |
1906 else | 1889 else |
1907 { | 1890 { |
1908 titleIconWidth = data->IconData.width ; | 1891 titleIconWidth = data->IconData.width ; |
1909 } | 1892 } |
1910 } | 1893 } |
1911 else | 1894 else |
1912 { | 1895 { |
1913 titleIconWidth = 0; | 1896 titleIconWidth = 0; |
1914 } | 1897 } |
1915 | 1898 |
1916 #endif | 1899 #endif |
1917 if (data EQ 0) | 1900 if (data EQ 0) |
1918 return 1; | 1901 return 1; |
1919 | 1902 |
1920 switch (event) | 1903 switch (event) |
1921 { | 1904 { |
1922 case E_WIN_VISIBLE: | 1905 case E_WIN_VISIBLE: |
1923 if (win->flags & E_WIN_VISIBLE) | 1906 if (win->flags & E_WIN_VISIBLE) |
1924 { | 1907 { |
1925 /* | 1908 /* |
1926 * Print the information dialog | 1909 * Print the information dialog |
1927 */ | 1910 */ |
1928 for (i=0;i<MAX_DLG_LINES;i++) | 1911 for (i=0;i<MAX_DLG_LINES;i++) |
1929 { | 1912 { |
1930 xPos[i]=0; | 1913 xPos[i]=0; |
1931 yPos[i] = Mmi_layout_line_height()*i; | 1914 yPos[i] = Mmi_layout_line_height()*i; |
1932 str[i]=NULL; | 1915 str[i]=NULL; |
1933 strLen[i]=0; | 1916 strLen[i]=0; |
1934 } | 1917 } |
1935 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 1918 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
1936 // Assign the values to last elments of the array str and strLen | 1919 // Assign the values to last elments of the array str and strLen |
1937 str[MAX_DLG_LINES] = NULL; | 1920 str[MAX_DLG_LINES] = NULL; |
1938 strLen[MAX_DLG_LINES] = 0; | 1921 strLen[MAX_DLG_LINES] = 0; |
1939 yOfs = Mmi_layout_line_height()/4; | 1922 yOfs = Mmi_layout_line_height()/4; |
1940 if (data->TextId != 0) | 1923 if (data->TextId != 0) |
1941 str[DLG_LINE1] = MmiRsrcGetText( data->TextId); | 1924 str[DLG_LINE1] = MmiRsrcGetText( data->TextId); |
1942 else | 1925 else |
1943 str[DLG_LINE1] = data->TextString; | 1926 str[DLG_LINE1] = data->TextString; |
1944 | 1927 |
1945 if (data->TextId2 != 0) | 1928 if (data->TextId2 != 0) |
1946 str[DLG_LINE2] = MmiRsrcGetText( data->TextId2); | 1929 str[DLG_LINE2] = MmiRsrcGetText( data->TextId2); |
1947 else | 1930 else |
1948 str[DLG_LINE2] = data->TextString2; | 1931 str[DLG_LINE2] = data->TextString2; |
1949 | 1932 |
1950 if (data->SoftKeyStrings!=0) | 1933 if (data->SoftKeyStrings!=0) |
1951 { | 1934 { |
1952 lskStr = data->LSKString; | 1935 lskStr = data->LSKString; |
1953 rskStr = data->RSKString; | 1936 rskStr = data->RSKString; |
1954 } | 1937 } |
1955 else | 1938 else |
1956 { | 1939 { |
1957 if (data->LeftSoftKey != TxtNull) | 1940 if (data->LeftSoftKey != TxtNull) |
1958 lskStr = MmiRsrcGetText(data->LeftSoftKey); | 1941 lskStr = MmiRsrcGetText(data->LeftSoftKey); |
1959 else | 1942 else |
1960 lskStr = NULL; | 1943 lskStr = NULL; |
1961 | 1944 |
1962 if (data->RightSoftKey != TxtNull) | 1945 if (data->RightSoftKey != TxtNull) |
1963 rskStr = MmiRsrcGetText(data->RightSoftKey); | 1946 rskStr = MmiRsrcGetText(data->RightSoftKey); |
1964 else | 1947 else |
1965 rskStr = NULL; | 1948 rskStr = NULL; |
1966 } | 1949 } |
1967 | 1950 |
1968 if ((str[DLG_LINE1]!= NULL) || (str[DLG_LINE2]!=NULL)) | 1951 if ((str[DLG_LINE1]!= NULL) || (str[DLG_LINE2]!=NULL)) |
1969 { //Draw a window for status info | 1952 { //Draw a window for status info |
1970 if (str[DLG_LINE2] == NULL) | 1953 if (str[DLG_LINE2] == NULL) |
1971 { | 1954 { |
1972 sy = Mmi_layout_line_height()+yOfs*2; // 18 or 12 | 1955 sy = Mmi_layout_line_height()+yOfs*2; // 18 or 12 |
1973 | 1956 |
1974 } | 1957 } |
1975 else | 1958 else |
1976 { | 1959 { |
1977 sy = Mmi_layout_line_height()*2+yOfs*3; // 33 or 22 | 1960 sy = Mmi_layout_line_height()*2+yOfs*3; // 33 or 22 |
1978 } | 1961 } |
1979 | 1962 |
1980 //MC, if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) | 1963 //MC, if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) |
1981 { //calculate longest string - use this to calc width of window | 1964 { //calculate longest string - use this to calc width of window |
1982 sx = 0; | 1965 sx = 0; |
1983 if ((lskStr!=NULL) || (rskStr!=NULL)) | 1966 if ((lskStr!=NULL) || (rskStr!=NULL)) |
1984 { | 1967 { |
1985 sy = sy+Mmi_layout_softkeyHeight()+yOfs*2; | 1968 sy = sy+Mmi_layout_softkeyHeight()+yOfs*2; |
1986 sx = sx + 10; | 1969 sx = sx + 10; |
1987 if (lskStr != NULL) | 1970 if (lskStr != NULL) |
1988 { | 1971 { |
1989 sx = sx + dspl_GetTextExtent(lskStr, 0); | 1972 sx = sx + dspl_GetTextExtent(lskStr, 0); |
1990 } | 1973 } |
1991 if (rskStr != NULL) | 1974 if (rskStr != NULL) |
1992 { | 1975 { |
1993 sx = sx + dspl_GetTextExtent(rskStr,0); | 1976 sx = sx + dspl_GetTextExtent(rskStr,0); |
1994 } | 1977 } |
1995 | 1978 |
1996 } | 1979 } |
1997 for (i=DLG_LINE1;i<=DLG_LINE2;i++) | 1980 for (i=DLG_LINE1;i<=DLG_LINE2;i++) |
1998 { | 1981 { |
1999 strLen[i] = dspl_GetTextExtent(str[i],0); | 1982 strLen[i] = dspl_GetTextExtent(str[i],0); |
2000 } | 1983 } |
2001 | 1984 |
2002 /* Work out the desired width of the dialog. If we can wrap line 2 and it is long, wrap it */ | 1985 /* 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) | 1986 if (data->WrapStrings & WRAP_STRING_2) |
2004 nLines = MAX_WRAP_LINES; | 1987 nLines = MAX_WRAP_LINES; |
2005 else | 1988 else |
2006 nLines = 1; | 1989 nLines = 1; |
2007 #ifdef COLOURDISPLAY | 1990 #ifdef COLOURDISPLAY |
2008 if (data->dlgBgdBitmap!=NULL) | 1991 if (data->dlgBgdBitmap!=NULL) |
2009 { | 1992 { |
2010 //we only have room to split line 2 into 'max_lines_dlg_popup' lines in the pop-up. | 1993 //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. | 1994 //NB this should be calculated depending on the height of the popup bitmap. |
2012 const int max_lines_dlg_popup=2; | 1995 const int max_lines_dlg_popup=2; |
2013 if (nLines>max_lines_dlg_popup) | 1996 if (nLines>max_lines_dlg_popup) |
2014 nLines = max_lines_dlg_popup; | 1997 nLines = max_lines_dlg_popup; |
2015 scrWidth = (data->dlgBgdBitmap->area.sx * 3)/4; //the max width is about 3/4 of the pop-up | 1998 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) || | 1999 if ( (strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) || |
2017 (strLen[DLG_LINE1] > scrWidth)) | 2000 (strLen[DLG_LINE1] > scrWidth)) |
2018 { | 2001 { |
2019 //recalculate width below. | 2002 //recalculate width below. |
2020 if (data->WrapStrings & WRAP_STRING_2) | 2003 if (data->WrapStrings & WRAP_STRING_2) |
2021 nLines = MAX_WRAP_LINES; | 2004 nLines = MAX_WRAP_LINES; |
2022 fullScreen = DLG_USE_RECTANGLE; | 2005 fullScreen = DLG_USE_RECTANGLE; |
2023 } | 2006 } |
2024 else | 2007 else |
2025 { | 2008 { |
2026 fullScreen = DLG_USE_BITMAP; | 2009 fullScreen = DLG_USE_BITMAP; |
2027 //Leave width as is | 2010 //Leave width as is |
2028 } | 2011 } |
2029 } | 2012 } |
2030 #else | 2013 #else |
2031 //On a C-sample, limit pop-up lines to 2 extra (any more - use entire screen) | 2014 //On a C-sample, limit pop-up lines to 2 extra (any more - use entire screen) |
2032 { | 2015 { |
2033 const int max_lines_dlg_popup=2; | 2016 const int max_lines_dlg_popup=2; |
2034 if (nLines>max_lines_dlg_popup) | 2017 if (nLines>max_lines_dlg_popup) |
2035 nLines = max_lines_dlg_popup; | 2018 nLines = max_lines_dlg_popup; |
2036 } | 2019 } |
2037 | 2020 |
2038 #endif | 2021 #endif |
2039 if (fullScreen == DLG_USE_RECTANGLE) | 2022 if (fullScreen == DLG_USE_RECTANGLE) |
2040 { | 2023 { |
2041 //see if we can display as a pop-up | 2024 //see if we can display as a pop-up |
2042 if (SCREEN_SIZE_X < 128) | 2025 if (SCREEN_SIZE_X < 128) |
2043 scrWidth = SCREEN_SIZE_X-6; | 2026 scrWidth = SCREEN_SIZE_X-6; |
2044 else | 2027 else |
2045 scrWidth = (SCREEN_SIZE_X*7)/8; | 2028 scrWidth = (SCREEN_SIZE_X*7)/8; |
2046 if ( strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) | 2029 if ( strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) |
2047 { | 2030 { |
2048 //Cannot fit in as a pop-up - use full screen | 2031 //Cannot fit in as a pop-up - use full screen |
2049 fullScreen = DLG_USE_FULL_SCREEN; | 2032 fullScreen = DLG_USE_FULL_SCREEN; |
2050 scrWidth = SCREEN_SIZE_X; | 2033 scrWidth = SCREEN_SIZE_X; |
2051 } | 2034 } |
2052 else | 2035 else |
2053 { | 2036 { |
2054 //We can fit it in - but we may want to reduce the width for a nicer look. | 2037 //We can fit it in - but we may want to reduce the width for a nicer look. |
2055 } | 2038 } |
2056 } | 2039 } |
2057 | 2040 |
2058 /* | 2041 /* |
2059 * Wrap second text line (e.g. for long phone numbers.) | 2042 * Wrap second text line (e.g. for long phone numbers.) |
2060 */ | 2043 */ |
2061 if (strLen[DLG_LINE2] > scrWidth-charWidth) | 2044 if (strLen[DLG_LINE2] > scrWidth-charWidth) |
2062 { | 2045 { |
2063 //If we can fit the string on 2 lines - do it. | 2046 //If we can fit the string on 2 lines - do it. |
2064 if (data->WrapStrings & WRAP_STRING_2) | 2047 if (data->WrapStrings & WRAP_STRING_2) |
2065 { | 2048 { |
2096 temp_ptr = NULL; | 2079 temp_ptr = NULL; |
2097 strLen[DLG_LINE2 + wrapLine] = dspl_GetTextExtent(str[DLG_LINE2+wrapLine],0); | 2080 strLen[DLG_LINE2 + wrapLine] = dspl_GetTextExtent(str[DLG_LINE2+wrapLine],0); |
2098 wrapLine++; | 2081 wrapLine++; |
2099 } | 2082 } |
2100 | 2083 |
2101 } | 2084 } |
2102 else | 2085 else |
2103 { | 2086 { |
2104 //Unicode is more problematic - we need the 0x80 at the front of the string | 2087 //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 | 2088 //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 | 2089 //of 'str2' into a temporary buffer. At the moment, we only wrap numbers so this |
2107 //code will wait until it is required. | 2090 //code will wait until it is required. |
2108 // str[3] = "Code not written!!"; //issue warning | 2091 // str[3] = "Code not written!!"; //issue warning |
2109 // strLen[3] = dspl_GetTextExtent(str[3],0); | 2092 // strLen[3] = dspl_GetTextExtent(str[3],0); |
2110 fullScreen = DLG_USE_FULL_SCREEN; //error - use full screen | 2093 fullScreen = DLG_USE_FULL_SCREEN; //error - use full screen |
2111 } | 2094 } |
2112 } | 2095 } |
2113 } | 2096 } |
2114 | 2097 |
2115 //Calculate longest line of text (including softkeys - sx already set to the softkey width) | 2098 //Calculate longest line of text (including softkeys - sx already set to the softkey width) |
2116 for (i=0;i< MAX_DLG_LINES;i++) | 2099 for (i=0;i< MAX_DLG_LINES;i++) |
2117 { | 2100 { |
2118 if (strLen[i]>sx) | 2101 if (strLen[i]>sx) |
2119 sx = strLen[i]; | 2102 sx = strLen[i]; |
2120 } | 2103 } |
2121 if (sx > SCREEN_SIZE_X-charWidth) | 2104 if (sx > SCREEN_SIZE_X-charWidth) |
2122 sx = SCREEN_SIZE_X; | 2105 sx = SCREEN_SIZE_X; |
2123 else | 2106 else |
2124 { | 2107 { |
2125 if (sx > SCREEN_SIZE_X/2) | 2108 if (sx > SCREEN_SIZE_X/2) |
2126 sx = sx + charWidth; | 2109 sx = sx + charWidth; |
2127 else | 2110 else |
2128 sx = sx + charWidth*2; | 2111 sx = sx + charWidth*2; |
2129 } | 2112 } |
2130 if (sy> sx) | 2113 if (sy> sx) |
2131 sx = sy; | 2114 sx = sy; |
2132 wx = (SCREEN_SIZE_X-sx)/2; | 2115 wx = (SCREEN_SIZE_X-sx)/2; |
2133 if (wx<0) | 2116 if (wx<0) |
2134 wx=0; | 2117 wx=0; |
2135 } | 2118 } |
2136 | 2119 |
2137 if (sy > SCREEN_SIZE_Y) | 2120 if (sy > SCREEN_SIZE_Y) |
2138 wy = 0; | 2121 wy = 0; |
2139 else if (SCREEN_SIZE_Y > 2*sy) | 2122 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 | 2123 wy = (SCREEN_SIZE_Y*2/3-sy)/2; //display in middle of top 2/3 of screen |
2141 else | 2124 else |
2142 wy = (SCREEN_SIZE_Y-sy)/2; //display in middle of screen | 2125 wy = (SCREEN_SIZE_Y-sy)/2; //display in middle of screen |
2143 if (wy < 10) | 2126 if (wy < 10) |
2144 wy = wy/2; | 2127 wy = wy/2; |
2145 | 2128 |
2146 if ((wx == 0) || (wy==0)) | 2129 if ((wx == 0) || (wy==0)) |
2147 { //not enough room to display as a window - use whole screen | 2130 { //not enough room to display as a window - use whole screen |
2148 fullScreen = DLG_USE_FULL_SCREEN; | 2131 fullScreen = DLG_USE_FULL_SCREEN; |
2149 } | 2132 } |
2150 | 2133 |
2151 #ifdef COLOURDISPLAY | 2134 #ifdef COLOURDISPLAY |
2152 if ((data->icon_array != NULL) && (fullScreen != DLG_USE_BITMAP)) | 2135 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 | 2136 { //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) | 2137 if (sx < data->icon_array[0].area.sx) |
2155 sx = data->icon_array[0].area.sx; | 2138 sx = data->icon_array[0].area.sx; |
2156 yBmpOfs = data->icon_array[0].area.py + data->icon_array[0].area.sy; | 2139 yBmpOfs = data->icon_array[0].area.py + data->icon_array[0].area.sy; |
2157 wy = data->icon_array[0].area.py; | 2140 wy = data->icon_array[0].area.py; |
2158 sy = sy + data->icon_array[0].area.sy; | 2141 sy = sy + data->icon_array[0].area.sy; |
2159 } | 2142 } |
2160 #endif | 2143 #endif |
2161 } | 2144 } |
2162 else | 2145 else |
2163 { | 2146 { |
2164 //We have no strings to display - clear entire screen | 2147 //We have no strings to display - clear entire screen |
2165 fullScreen = DLG_USE_FULL_SCREEN; | 2148 fullScreen = DLG_USE_FULL_SCREEN; |
2166 } | 2149 } |
2167 | 2150 |
2168 | 2151 |
2169 /****************************** | 2152 /****************************** |
2170 * Draw window (full screen/pop-up) | 2153 * Draw window (full screen/pop-up) |
2171 *****************************/ | 2154 *****************************/ |
2172 if (fullScreen != DLG_USE_FULL_SCREEN) | 2155 if (fullScreen != DLG_USE_FULL_SCREEN) |
2173 dspl_unfocusDisplay(); | 2156 dspl_unfocusDisplay(); |
2174 area.px = 0; | 2157 area.px = 0; |
2175 area.py = 0; | 2158 area.py = 0; |
2176 area.sx = sx; | 2159 area.sx = sx; |
2177 area.sy = sy; | 2160 area.sy = sy; |
2178 resources_setColour(data->dlgCol); | 2161 resources_setColour(data->dlgCol); |
2179 drawWinType = DSPL_WIN_CENTRE; | 2162 drawWinType = DSPL_WIN_CENTRE; |
2180 | 2163 |
2181 if (fullScreen!=DLG_USE_FULL_SCREEN) | 2164 if (fullScreen!=DLG_USE_FULL_SCREEN) |
2182 { | 2165 { |
2183 t_font_bitmap bmp; | 2166 t_font_bitmap bmp; |
2184 t_font_bitmap* bmpPtr = NULL; | 2167 t_font_bitmap* bmpPtr = NULL; |
2185 | 2168 |
2186 for (i=0;i<MAX_DLG_LINES;i++) | 2169 for (i=0;i<MAX_DLG_LINES;i++) |
2187 { | 2170 { |
2188 //centre text | 2171 //centre text |
2189 xPos[i] = wx+(sx-strLen[i])/2; | 2172 xPos[i] = wx+(sx-strLen[i])/2; |
2190 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; | 2173 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; |
2191 } | 2174 } |
2192 | 2175 |
2193 #ifdef COLOURDISPLAY | 2176 #ifdef COLOURDISPLAY |
2194 if ((data->dlgBgdBitmap != NULL) && (fullScreen==DLG_USE_BITMAP)) | 2177 if ((data->dlgBgdBitmap != NULL) && (fullScreen==DLG_USE_BITMAP)) |
2195 { | 2178 { |
2196 bmp.format = data->dlgBgdBitmap->icnType; | 2179 bmp.format = data->dlgBgdBitmap->icnType; |
2197 bmp.height = data->dlgBgdBitmap->area.sy; | 2180 bmp.height = data->dlgBgdBitmap->area.sy; |
2198 bmp.width = data->dlgBgdBitmap->area.sx; | 2181 bmp.width = data->dlgBgdBitmap->area.sx; |
2199 bmp.bitmap = data->dlgBgdBitmap->icons; | 2182 bmp.bitmap = data->dlgBgdBitmap->icons; |
2200 bmpPtr = &bmp; | 2183 bmpPtr = &bmp; |
2201 area = calcLayout(data->dlgType, sx, sy, bmp.width, bmp.height); | 2184 area = calcLayout(data->dlgType, sx, sy, bmp.width, bmp.height); |
2202 | 2185 |
2203 //Adjust size of available area depending on bitmap properties/dlgType. | 2186 //Adjust size of available area depending on bitmap properties/dlgType. |
2204 //dlgType== 0 =>display info in centre of bitmap | 2187 //dlgType== 0 =>display info in centre of bitmap |
2205 if (data->dlgType == 0) | 2188 if (data->dlgType == 0) |
2206 { | 2189 { |
2207 //If the bmp is bigger than the data we will move the bmp to | 2190 //If the bmp is bigger than the data we will move the bmp to |
2208 //lie over the centre of the data | 2191 //lie over the centre of the data |
2209 area.px = area.px - (bmp.width - sx)/2; | 2192 area.px = area.px - (bmp.width - sx)/2; |
2210 area.py = area.py - (bmp.height- sy)/2; | 2193 area.py = area.py - (bmp.height- sy)/2; |
2211 } | 2194 } |
2212 for (i=0;i<MAX_DLG_LINES;i++) | 2195 for (i=0;i<MAX_DLG_LINES;i++) |
2213 { | 2196 { |
2214 xPos[i] = xPos[i] + area.px; | 2197 xPos[i] = xPos[i] + area.px; |
2215 yPos[i] = yPos[i] + area.py; | 2198 yPos[i] = yPos[i] + area.py; |
2216 } | 2199 } |
2217 | 2200 |
2218 TRACE_EVENT_P3("wy = %d, yOfs = %d, area.py = %d",wy,yOfs,area.py); | 2201 TRACE_EVENT_P3("wy = %d, yOfs = %d, area.py = %d",wy,yOfs,area.py); |
2219 if( data->dlgBgdBitmap->icnType != ICON_TYPE_1BIT_UNPACKED ) | 2202 if( data->dlgBgdBitmap->icnType != ICON_TYPE_1BIT_UNPACKED ) |
2220 dspl_SetBgdColour( COL_TRANSPARENT ); | 2203 dspl_SetBgdColour( COL_TRANSPARENT ); |
2221 | 2204 |
2222 | 2205 |
2223 } | 2206 } |
2224 else | 2207 else |
2225 { | 2208 { |
2226 // x0066814 06 Dec 2006, OMAPS00106825 | 2209 // x0066814 06 Dec 2006, OMAPS00106825 |
2227 //The window height calculation related to wrapping should be skipped when no | 2210 //The window height calculation related to wrapping should be skipped when no |
2228 //string wrapping is done | 2211 //string wrapping is done |
2229 if(wrapLine>0) | 2212 if(wrapLine>0) |
2230 { | 2213 { |
2231 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); | 2214 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); |
2232 } | 2215 } |
2233 area.sy = sy; | 2216 area.sy = sy; |
2234 } | 2217 } |
2235 #else | 2218 #else |
2236 if (wrapLine>1) | 2219 if (wrapLine>1) |
2237 { | 2220 { |
2238 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); | 2221 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); |
2239 area.sy = sy; | 2222 area.sy = sy; |
2240 } | 2223 } |
2241 #endif | 2224 #endif |
2242 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 2225 // 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. | 2226 //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) | 2227 if(sy+wy >= SCREEN_SIZE_Y && sy < SCREEN_SIZE_Y) |
2245 if(wy>0 && wy < sy) | 2228 if(wy>0 && wy < sy) |
2248 if(wy < 0) | 2231 if(wy < 0) |
2249 wy=0; | 2232 wy=0; |
2250 for (i=0;i<MAX_DLG_LINES;i++) | 2233 for (i=0;i<MAX_DLG_LINES;i++) |
2251 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; | 2234 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; |
2252 } | 2235 } |
2253 dspl_DrawWin( wx,wy,sx,sy, drawWinType , bmpPtr); | 2236 dspl_DrawWin( wx,wy,sx,sy, drawWinType , bmpPtr); |
2254 } | 2237 } |
2255 else | 2238 else |
2256 { | 2239 { |
2257 dspl_ClearAll(); | 2240 dspl_ClearAll(); |
2258 sx = 84; | 2241 sx = 84; |
2259 for (i=0;i<MAX_DLG_LINES;i++) | 2242 for (i=0;i<MAX_DLG_LINES;i++) |
2260 { | 2243 { |
2261 xPos[i] = 0; | 2244 xPos[i] = 0; |
2262 yPos[i] = Mmi_layout_line(i+1); | 2245 yPos[i] = Mmi_layout_line(i+1); |
2263 } | 2246 } |
2264 } | 2247 } |
2265 /****************************** | 2248 /****************************** |
2266 * Print softkeys | 2249 * Print softkeys |
2267 *****************************/ | 2250 *****************************/ |
2268 icnShow(data->icon); | 2251 icnShow(data->icon); |
2269 if ((lskStr != NULL) || (rskStr != NULL)) | 2252 if ((lskStr != NULL) || (rskStr != NULL)) |
2270 { | 2253 { |
2271 if (fullScreen==DLG_USE_FULL_SCREEN) | 2254 if (fullScreen==DLG_USE_FULL_SCREEN) |
2272 Mmi_layout_softkeyArea( &skArea ); | 2255 Mmi_layout_softkeyArea( &skArea ); |
2273 else | 2256 else |
2274 { | 2257 { |
2275 skArea.px = area.px+wx; | 2258 skArea.px = area.px+wx; |
2276 skArea.sx = area.sx; | 2259 skArea.sx = area.sx; |
2277 skArea.py = area.py+wy+area.sy-Mmi_layout_softkeyHeight()-1; | 2260 skArea.py = area.py+wy+area.sy-Mmi_layout_softkeyHeight()-1; |
2278 skArea.sy = Mmi_layout_softkeyHeight(); | 2261 skArea.sy = Mmi_layout_softkeyHeight(); |
2279 } | 2262 } |
2280 softKeys_displayStrXY(lskStr, rskStr, data->dlgSkFormat, data->dlgCol, &skArea); | 2263 softKeys_displayStrXY(lskStr, rskStr, data->dlgSkFormat, data->dlgCol, &skArea); |
2281 } | 2264 } |
2282 | 2265 |
2283 /****************************** | 2266 /****************************** |
2284 * Print dialog text | 2267 * Print dialog text |
2285 *****************************/ | 2268 *****************************/ |
2286 for (i=0;i<MAX_DLG_LINES;i++) | 2269 for (i=0;i<MAX_DLG_LINES;i++) |
2287 { /* GW#2294 No need to draw zero length strings .*/ | 2270 { /* GW#2294 No need to draw zero length strings .*/ |
2288 if ((str[i] != NULL) && (strLen[i] > 0)) | 2271 if ((str[i] != NULL) && (strLen[i] > 0)) |
2289 { | 2272 { |
2290 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 2273 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
2291 #ifdef FF_MMI_SAT_ICON | 2274 #ifdef FF_MMI_SAT_ICON |
2292 if(data->IconData.selfExplanatory == FALSE) | 2275 if(data->IconData.selfExplanatory == FALSE) |
2293 dspl_TextOut(xPos[i] + titleIconWidth, yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); | 2276 dspl_TextOut(xPos[i] + titleIconWidth, yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); |
2294 #else | 2277 #else |
2295 dspl_TextOut(xPos[i] , yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); | 2278 dspl_TextOut(xPos[i] , yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); |
2296 #endif | 2279 #endif |
2297 } | 2280 } |
2298 } | 2281 } |
2299 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | 2282 //x0035544 Feb 15, 2006. DR:OMAPS00061467 |
2300 #ifdef FF_MMI_SAT_ICON | 2283 #ifdef FF_MMI_SAT_ICON |
2301 if(data->IconData.dst != NULL) | 2284 if(data->IconData.dst != NULL) |
2302 { | 2285 { |
2303 if(str[DLG_LINE2] == NULL) | 2286 if(str[DLG_LINE2] == NULL) |
2304 { | 2287 { |
2305 if ((data->IconData.width > TITLE_ICON_WIDTH) || | 2288 if ((data->IconData.width > TITLE_ICON_WIDTH) || |
2306 (data->IconData.height > TITLE_ICON_HEIGHT)) | 2289 (data->IconData.height > TITLE_ICON_HEIGHT)) |
2307 { | 2290 { |
2308 dspl_BitBlt2(xPos[0], yPos[0], 8, | 2291 dspl_BitBlt2(xPos[0], yPos[0], 8, |
2309 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); | 2292 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); |
2310 } | 2293 } |
2311 | 2294 |
2312 else | 2295 else |
2313 dspl_BitBlt2(xPos[0], yPos[0], data->IconData.width, | 2296 dspl_BitBlt2(xPos[0], yPos[0], data->IconData.width, |
2314 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); | 2297 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); |
2315 } | 2298 } |
2316 else | 2299 else |
2317 { | 2300 { |
2318 if ((data->IconData.width > TITLE_ICON_WIDTH) || | 2301 if ((data->IconData.width > TITLE_ICON_WIDTH) || |
2319 (data->IconData.height > TITLE_ICON_HEIGHT)) | 2302 (data->IconData.height > TITLE_ICON_HEIGHT)) |
2320 { | 2303 { |
2321 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2], 8, | 2304 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2], 8, |
2322 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); | 2305 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); |
2323 } | 2306 } |
2324 else | 2307 else |
2325 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2],data->IconData.width, | 2308 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2],data->IconData.width, |
2326 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); | 2309 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); |
2327 } | 2310 } |
2328 | 2311 |
2329 } | 2312 } |
2330 #endif | 2313 #endif |
2331 | 2314 |
2332 | 2315 |
2333 resources_restoreColour(); | 2316 resources_restoreColour(); |
2334 } | 2317 } |
2335 | 2318 |
2336 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | 2319 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 |
2337 // Now free the allocated memory | 2320 // Now free the allocated memory |
2338 /* x0039928 - Lint warning removal */ | 2321 /* x0039928 - Lint warning removal */ |
2339 if (strLen[MAX_DLG_LINES] > scrWidth-charWidth) | 2322 if (strLen[MAX_DLG_LINES] > scrWidth-charWidth) |
2341 if (str[MAX_DLG_LINES][0] != (char)0x80) /* x0039928 - lint warning removal */ | 2324 if (str[MAX_DLG_LINES][0] != (char)0x80) /* x0039928 - lint warning removal */ |
2342 { | 2325 { |
2343 for(i=DLG_LINE2;i<MAX_DLG_LINES;i++) | 2326 for(i=DLG_LINE2;i<MAX_DLG_LINES;i++) |
2344 { | 2327 { |
2345 if(NULL != str[i] && strLen[i] > 0) | 2328 if(NULL != str[i] && strLen[i] > 0) |
2346 mfwFree((U8*)str[i],MAX_WRAP_CHAR); | 2329 mfwFree((U8*)str[i],MAX_WRAP_CHAR); |
2347 } | 2330 } |
2348 str[MAX_DLG_LINES]=NULL; | 2331 str[MAX_DLG_LINES]=NULL; |
2349 } | 2332 } |
2350 | 2333 |
2351 break; | 2334 break; |
2352 | 2335 |
2353 default: | 2336 default: |
2354 return 0; | 2337 return 0; |
2355 } | 2338 } |
2356 | 2339 |
2357 return 1; | 2340 return 1; |
2358 } | 2341 } |
2359 | 2342 |
2360 /******************************************************************************* | 2343 /******************************************************************************* |
2361 | 2344 |
2362 $Function: phlock_dialog_info | 2345 $Function: phlock_dialog_info |
2363 | 2346 |
2364 $Description: Dialog function for information dialog | 2347 $Description: Dialog function for information dialog |
2365 | 2348 |
2366 $Returns: void | 2349 $Returns: void |
2367 | 2350 |
2368 $Arguments: win, window handle event, value, parameter | 2351 $Arguments: win, window handle event, value, parameter |
2369 | 2352 |
2370 *******************************************************************************/ | 2353 *******************************************************************************/ |
2371 void phlock_dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | 2354 void phlock_dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter) |
2372 { | 2355 { |
2373 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 2356 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
2381 /* | 2364 /* |
2382 * Initialize dialog | 2365 * Initialize dialog |
2383 */ | 2366 */ |
2384 #if defined (WIN32) | 2367 #if defined (WIN32) |
2385 { | 2368 { |
2386 /***************************Go-lite Optimization changes Start***********************/ | 2369 /***************************Go-lite Optimization changes Start***********************/ |
2387 | 2370 |
2388 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | 2371 //Aug 16, 2004 REF: CRR 24323 Deepa M.D |
2389 TRACE_EVENT_P1( "Identifier %d", display_info->Identifier); | 2372 TRACE_EVENT_P1( "Identifier %d", display_info->Identifier); |
2390 /***************************Go-lite Optimization changes end***********************/ | 2373 /***************************Go-lite Optimization changes end***********************/ |
2391 | 2374 |
2392 } | 2375 } |
2393 #endif | 2376 #endif |
2394 /* | 2377 /* |
2395 * Create timer and keyboard handler | 2378 * Create timer and keyboard handler |
2396 */ | 2379 */ |
2397 data->info_tim = tim_create (win, display_info->Time, (T_MFW_CB)phlock_dialog_info_tim_cb); | 2380 data->info_tim = tim_create (win, display_info->Time, (T_MFW_CB)phlock_dialog_info_tim_cb); |
2398 data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)phlock_dialog_info_kbd_cb); | 2381 data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)phlock_dialog_info_kbd_cb); |
2399 data->info_kbd_long = kbd_create(win,KEY_ALL|KEY_LONG,(MfwCb)phlock_dialog_info_kbd_long_cb); | 2382 data->info_kbd_long = kbd_create(win,KEY_ALL|KEY_LONG,(MfwCb)phlock_dialog_info_kbd_long_cb); |
2400 | 2383 |
2401 /* | 2384 /* |
2402 * Store any other data | 2385 * Store any other data |
2403 */ | 2386 */ |
2404 data->KeyEvents = display_info->KeyEvents; | 2387 data->KeyEvents = display_info->KeyEvents; |
2405 data->TextString = display_info->TextString; | 2388 data->TextString = display_info->TextString; |
2406 data->LeftSoftKey = display_info->LeftSoftKey; | 2389 data->LeftSoftKey = display_info->LeftSoftKey; |
2407 data->RightSoftKey = display_info->RightSoftKey; | 2390 data->RightSoftKey = display_info->RightSoftKey; |
2408 data->SoftKeyStrings = display_info->SoftKeyStrings; // SH - TRUE if using strings rather than IDs | 2391 data->SoftKeyStrings = display_info->SoftKeyStrings; // SH - TRUE if using strings rather than IDs |
2409 data->LSKString = display_info->LSKString; // Text for left soft key | 2392 data->LSKString = display_info->LSKString; // Text for left soft key |
2410 data->RSKString = display_info->RSKString; // Text for right soft key | 2393 data->RSKString = display_info->RSKString; // Text for right soft key |
2411 data->TextId = display_info->TextId; | 2394 data->TextId = display_info->TextId; |
2412 data->Identifier = display_info->Identifier; | 2395 data->Identifier = display_info->Identifier; |
2413 data->Callback = display_info->Callback; | 2396 data->Callback = display_info->Callback; |
2414 data->TextString2 = display_info->TextString2; | 2397 data->TextString2 = display_info->TextString2; |
2415 data->TextId2 = display_info->TextId2; | 2398 data->TextId2 = display_info->TextId2; |
2416 data->WrapStrings = display_info->WrapStrings; //GW-SPR#762 | 2399 data->WrapStrings = display_info->WrapStrings; //GW-SPR#762 |
2417 | 2400 |
2418 data->dlgCol = display_info->displayCol; | 2401 data->dlgCol = display_info->displayCol; |
2419 data->dlgType = display_info->dlgType; | 2402 data->dlgType = display_info->dlgType; |
2420 data->dlgBgdBitmap = display_info->bgdBitmap; | 2403 data->dlgBgdBitmap = display_info->bgdBitmap; |
2421 data->dlgSkFormat = 0; | 2404 data->dlgSkFormat = 0; |
2422 data->current_frame = display_info->current_frame; | 2405 data->current_frame = display_info->current_frame; |
2423 data->number_of_frames = display_info->number_of_frames; | 2406 data->number_of_frames = display_info->number_of_frames; |
2424 data->icon_array = (MfwIcnAttr*)display_info->icon_array; | 2407 data->icon_array = (MfwIcnAttr*)display_info->icon_array; |
2425 data->animation_timer = 0; | 2408 data->animation_timer = 0; |
2426 //x0035544 Feb 07, 2006 DR:OMAPS00061467 | 2409 //x0035544 Feb 07, 2006 DR:OMAPS00061467 |
2427 #ifdef FF_MMI_SAT_ICON | 2410 #ifdef FF_MMI_SAT_ICON |
2428 if(display_info->IconData.dst != NULL) | 2411 if(display_info->IconData.dst != NULL) |
2429 { | 2412 { |
2430 data->IconData.width = display_info->IconData.width; | 2413 data->IconData.width = display_info->IconData.width; |
2431 data->IconData.height = display_info->IconData.height; | 2414 data->IconData.height = display_info->IconData.height; |
2432 data->IconData.dst = display_info->IconData.dst; | 2415 data->IconData.dst = display_info->IconData.dst; |
2433 data->IconData.selfExplanatory = display_info->IconData.selfExplanatory; | 2416 data->IconData.selfExplanatory = display_info->IconData.selfExplanatory; |
2434 } | 2417 } |
2435 else | 2418 else |
2436 { | 2419 { |
2437 data->IconData.dst = NULL; | 2420 data->IconData.dst = NULL; |
2438 data->IconData.selfExplanatory = FALSE; | 2421 data->IconData.selfExplanatory = FALSE; |
2439 data->IconData.width =0; | 2422 data->IconData.width =0; |
2440 data->IconData.height =0; | 2423 data->IconData.height =0; |
2441 } | 2424 } |
2442 #endif | 2425 #endif |
2443 | 2426 |
2444 TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); | 2427 TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); |
2445 TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); | 2428 TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); |
2446 if(display_info->anim_time != 0) | 2429 if(display_info->anim_time != 0) |
2447 { | 2430 { |
2448 data->animation_timer = timCreate(win,display_info->anim_time,(MfwCb)mmi_dialogs_animation_new_CB); | 2431 data->animation_timer = timCreate(win,display_info->anim_time,(MfwCb)mmi_dialogs_animation_new_CB); |
2449 timStart(data->animation_timer); | 2432 timStart(data->animation_timer); |
2450 } | 2433 } |
2451 | 2434 |
2452 if (display_info->Time NEQ FOREVER) | 2435 if (display_info->Time NEQ FOREVER) |
2453 tim_start (data->info_tim); | 2436 tim_start (data->info_tim); |
2454 win_show (win); | 2437 win_show (win); |
2455 | 2438 |
2456 break; | 2439 break; |
2457 | 2440 |
2458 case DIALOG_DESTROY: | 2441 case DIALOG_DESTROY: |
2459 phlock_dialog_info_destroy(win); | 2442 phlock_dialog_info_destroy(win); |
2460 break; | 2443 break; |
2461 } | 2444 } |
2462 } | 2445 } |
2463 | 2446 |
2464 /******************************************************************************* | 2447 /******************************************************************************* |
2465 | 2448 |
2466 $Function: phlock_dialog_info_tim_cb | 2449 $Function: phlock_dialog_info_tim_cb |
2467 | 2450 |
2468 $Description: Callback function for the dialog info timer. | 2451 $Description: Callback function for the dialog info timer. |
2469 | 2452 |
2470 | 2453 |
2471 $Returns: MFW event handler | 2454 $Returns: MFW event handler |
2472 | 2455 |
2473 $Arguments: window handle event, timer control block | 2456 $Arguments: window handle event, timer control block |
2474 | 2457 |
2475 *******************************************************************************/ | 2458 *******************************************************************************/ |
2476 static T_MFW_CB phlock_dialog_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc) | 2459 static T_MFW_CB phlock_dialog_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc) |
2477 { | 2460 { |
2478 T_MFW_HND win = mfw_parent (mfw_header()); | 2461 T_MFW_HND win = mfw_parent (mfw_header()); |
2481 | 2464 |
2482 T_MFW_HND parent_win = data->parent_win; | 2465 T_MFW_HND parent_win = data->parent_win; |
2483 USHORT Identifier = data->Identifier; | 2466 USHORT Identifier = data->Identifier; |
2484 void (* Callback)() = data->Callback; | 2467 void (* Callback)() = data->Callback; |
2485 | 2468 |
2486 TRACE_FUNCTION("phlock_dialog_info_tim_cb()"); | 2469 TRACE_FUNCTION("phlock_dialog_info_tim_cb()"); |
2487 #if defined (WIN32) | 2470 #if defined (WIN32) |
2488 { | 2471 { |
2489 /***************************Go-lite Optimization changes Start***********************/ | 2472 /***************************Go-lite Optimization changes Start***********************/ |
2490 | 2473 |
2491 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | 2474 //Aug 16, 2004 REF: CRR 24323 Deepa M.D |
2492 TRACE_EVENT_P1 ("Identifier %d", data->Identifier);); | 2475 TRACE_EVENT_P1 ("Identifier %d", data->Identifier);); |
2493 /***************************Go-lite Optimization changes end***********************/ | 2476 /***************************Go-lite Optimization changes end***********************/ |
2494 | 2477 |
2495 } | 2478 } |
2496 #endif | 2479 #endif |
2497 | 2480 |
2498 #ifdef FF_PHONE_LOCK | 2481 #ifdef FF_PHONE_LOCK |
2499 TRACE_EVENT("Bef. destroy"); | 2482 TRACE_EVENT("Bef. destroy"); |
2500 TRACE_EVENT_P1("phlock_dialog_info_tim_cb: win: %02x", win); | 2483 TRACE_EVENT_P1("phlock_dialog_info_tim_cb: win: %02x", win); |
2501 | 2484 |
2502 #endif //FF_PHONE_LOCK | 2485 #endif //FF_PHONE_LOCK |
2503 /* | 2486 /* |
2504 ** SPR#1744 NDH | 2487 ** SPR#1744 NDH |
2505 ** Move the dialog destory in front of the Callback to make the processing consistent | 2488 ** Move the dialog destory in front of the Callback to make the processing consistent |
2509 | 2492 |
2510 TRACE_EVENT("phlock_dialog_info_tim_cb: Bef dialog_info_destrroy"); | 2493 TRACE_EVENT("phlock_dialog_info_tim_cb: Bef dialog_info_destrroy"); |
2511 phlock_dialog_info_destroy (win); | 2494 phlock_dialog_info_destroy (win); |
2512 | 2495 |
2513 #ifdef FF_PHONE_LOCK | 2496 #ifdef FF_PHONE_LOCK |
2514 TRACE_EVENT("Aft. destroy"); | 2497 TRACE_EVENT("Aft. destroy"); |
2515 TRACE_EVENT_P1("phlock_dialog_info_tim_cb: win: %02x", win); | 2498 TRACE_EVENT_P1("phlock_dialog_info_tim_cb: win: %02x", win); |
2516 #endif //FF_PHONE_LOCK | 2499 #endif //FF_PHONE_LOCK |
2517 | 2500 |
2518 if (Callback) | 2501 if (Callback) |
2519 (Callback) (parent_win, Identifier, INFO_TIMEOUT); | 2502 (Callback) (parent_win, Identifier, INFO_TIMEOUT); |
2520 | 2503 |
2521 return 0; | 2504 return 0; |
2522 } | 2505 } |
2523 | 2506 |
2524 /******************************************************************************* | 2507 /******************************************************************************* |
2525 | 2508 |
2526 $Function: phlock_dialog_info_kbd_cb | 2509 $Function: phlock_dialog_info_kbd_cb |
2527 | 2510 |
2528 $Description: Keyboard event handler | 2511 $Description: Keyboard event handler |
2529 | 2512 |
2530 $Returns: status int | 2513 $Returns: status int |
2531 | 2514 |
2532 $Arguments: window handle event, keyboard control block | 2515 $Arguments: window handle event, keyboard control block |
2533 | 2516 |
2534 *******************************************************************************/ | 2517 *******************************************************************************/ |
2535 | 2518 |
2536 static int phlock_dialog_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard) | 2519 static int phlock_dialog_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard) |
2537 { | 2520 { |
2545 TRACE_FUNCTION("phlock_dialog_info_kbd_cb"); | 2528 TRACE_FUNCTION("phlock_dialog_info_kbd_cb"); |
2546 | 2529 |
2547 switch (keyboard->code) | 2530 switch (keyboard->code) |
2548 { | 2531 { |
2549 case KCD_LEFT: | 2532 case KCD_LEFT: |
2550 if (data->KeyEvents & KEY_LEFT ) | 2533 if (data->KeyEvents & KEY_LEFT ) |
2551 { | 2534 { |
2552 phlock_dialog_info_destroy (win); | 2535 phlock_dialog_info_destroy (win); |
2553 if (Callback) | 2536 if (Callback) |
2554 (Callback) (parent_win, Identifier, INFO_KCD_LEFT); | 2537 (Callback) (parent_win, Identifier, INFO_KCD_LEFT); |
2555 } | 2538 } |
2556 break; | 2539 break; |
2557 | 2540 |
2558 case KCD_RIGHT: | 2541 case KCD_RIGHT: |
2559 if (data->KeyEvents & KEY_RIGHT) | 2542 if (data->KeyEvents & KEY_RIGHT) |
2560 { | 2543 { |
2561 phlock_dialog_info_destroy (win); | 2544 phlock_dialog_info_destroy (win); |
2562 if (Callback) | 2545 if (Callback) |
2563 (Callback) (parent_win, Identifier, INFO_KCD_RIGHT); | 2546 (Callback) (parent_win, Identifier, INFO_KCD_RIGHT); |
2564 } | 2547 } |
2565 break; | 2548 break; |
2566 | 2549 |
2567 case KCD_HUP: | 2550 case KCD_HUP: |
2568 if (data->KeyEvents & KEY_HUP || data->KeyEvents & INFO_KCD_ALL) | 2551 if (data->KeyEvents & KEY_HUP || data->KeyEvents & INFO_KCD_ALL) |
2569 { | 2552 { |
2570 phlock_dialog_info_destroy (win); | 2553 phlock_dialog_info_destroy (win); |
2571 if (Callback) | 2554 if (Callback) |
2572 (Callback) (parent_win, Identifier, INFO_KCD_HUP); | 2555 (Callback) (parent_win, Identifier, INFO_KCD_HUP); |
2573 } | 2556 } |
2574 break; | 2557 break; |
2575 case KCD_MNUUP: | 2558 case KCD_MNUUP: |
2576 | 2559 |
2577 if (data->KeyEvents & KEY_MNUUP) | 2560 if (data->KeyEvents & KEY_MNUUP) |
2578 { | 2561 { |
2579 if (Callback) | 2562 if (Callback) |
2580 (Callback) (parent_win, Identifier, INFO_KCD_UP); | 2563 (Callback) (parent_win, Identifier, INFO_KCD_UP); |
2581 } | 2564 } |
2582 | 2565 |
2583 break; | 2566 break; |
2584 case KCD_MNUDOWN: | 2567 case KCD_MNUDOWN: |
2585 | 2568 |
2586 if (data->KeyEvents & KEY_MNUDOWN) | 2569 if (data->KeyEvents & KEY_MNUDOWN) |
2587 { | 2570 { |
2588 if (Callback) | 2571 if (Callback) |
2589 (Callback) (parent_win, Identifier, INFO_KCD_DOWN); | 2572 (Callback) (parent_win, Identifier, INFO_KCD_DOWN); |
2590 } | 2573 } |
2591 | 2574 |
2592 break; | 2575 break; |
2593 //MZ 7/3/01 used to start a call. | 2576 //MZ 7/3/01 used to start a call. |
2594 case KCD_CALL: | 2577 case KCD_CALL: |
2595 if (data->KeyEvents & KEY_CALL ) | 2578 if (data->KeyEvents & KEY_CALL ) |
2596 { | 2579 { |
2597 phlock_dialog_info_destroy (win); | 2580 phlock_dialog_info_destroy (win); |
2598 if (Callback) | 2581 if (Callback) |
2599 (Callback) (parent_win, Identifier, INFO_KCD_OFFHOOK); | 2582 (Callback) (parent_win, Identifier, INFO_KCD_OFFHOOK); |
2600 } | 2583 } |
2601 break; | 2584 break; |
2602 default: | 2585 default: |
2603 if (data->KeyEvents & INFO_KCD_ALL) | 2586 if (data->KeyEvents & INFO_KCD_ALL) |
2604 { | 2587 { |
2605 /* | 2588 /* |
2606 Note: The variable Identifier is overwritten with the | 2589 Note: The variable Identifier is overwritten with the |
2607 keycode of the dialog; | 2590 keycode of the dialog; |
2608 we need it only for the Multicall Control !! | 2591 we need it only for the Multicall Control !! |
2609 */ | 2592 */ |
2610 Identifier = keyboard->code; | 2593 Identifier = keyboard->code; |
2611 phlock_dialog_info_destroy (win); | 2594 phlock_dialog_info_destroy (win); |
2612 if (Callback) | 2595 if (Callback) |
2613 (Callback) (parent_win, Identifier, INFO_KCD_ALL); | 2596 (Callback) (parent_win, Identifier, INFO_KCD_ALL); |
2614 } | 2597 } |
2615 break; | 2598 break; |
2616 | 2599 |
2617 } | 2600 } |
2618 return MFW_EVENT_CONSUMED; | 2601 return MFW_EVENT_CONSUMED; |
2619 } | 2602 } |
2620 | 2603 |
2621 /******************************************************************************* | 2604 /******************************************************************************* |
2622 | 2605 |
2623 $Function: phlock_dialog_info_kbd_long_cb | 2606 $Function: phlock_dialog_info_kbd_long_cb |
2624 | 2607 |
2625 $Description: Keyboard event handler | 2608 $Description: Keyboard event handler |
2626 | 2609 |
2627 $Returns: status int | 2610 $Returns: status int |
2628 | 2611 |
2629 $Arguments: window handle event, keyboard control block | 2612 $Arguments: window handle event, keyboard control block |
2630 | 2613 |
2631 *******************************************************************************/ | 2614 *******************************************************************************/ |
2632 static int phlock_dialog_info_kbd_long_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard) | 2615 static int phlock_dialog_info_kbd_long_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard) |
2633 { | 2616 { |
2634 TRACE_FUNCTION("dialog_info_kbd_long_cb()"); | 2617 TRACE_FUNCTION("dialog_info_kbd_long_cb()"); |
2635 return MFW_EVENT_CONSUMED; | 2618 return MFW_EVENT_CONSUMED; |
2636 } | 2619 } |
2637 | 2620 |
2638 /******************************************************************************* | 2621 /******************************************************************************* |
2639 | 2622 |
2640 $Function: phlock_dialog_info_destroy | 2623 $Function: phlock_dialog_info_destroy |
2641 | 2624 |
2642 $Description: Destruction of an information dialog | 2625 $Description: Destruction of an information dialog |
2643 | 2626 |
2644 $Returns: void | 2627 $Returns: void |
2645 | 2628 |
2646 $Arguments: win | 2629 $Arguments: win |
2647 | 2630 |
2648 *******************************************************************************/ | 2631 *******************************************************************************/ |
2649 void phlock_dialog_info_destroy (T_MFW_HND own_window) | 2632 void phlock_dialog_info_destroy (T_MFW_HND own_window) |
2650 { | 2633 { |
2651 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data; | 2634 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data; |
2653 | 2636 |
2654 TRACE_FUNCTION ("phlock_dialog_info_destroy()"); | 2637 TRACE_FUNCTION ("phlock_dialog_info_destroy()"); |
2655 | 2638 |
2656 if (own_window == NULL) | 2639 if (own_window == NULL) |
2657 { | 2640 { |
2658 TRACE_EVENT ("Error :- Called with NULL Pointer"); | 2641 TRACE_EVENT ("Error :- Called with NULL Pointer"); |
2659 return; | 2642 return; |
2660 } | 2643 } |
2661 | 2644 |
2662 if (data) | 2645 if (data) |
2663 { | 2646 { |
2664 /* | 2647 /* |
2667 kbd_delete (data->info_kbd); | 2650 kbd_delete (data->info_kbd); |
2668 tim_delete (data->info_tim); | 2651 tim_delete (data->info_tim); |
2669 | 2652 |
2670 if(data->animation_timer != 0) | 2653 if(data->animation_timer != 0) |
2671 { | 2654 { |
2672 timDelete(data->animation_timer); | 2655 timDelete(data->animation_timer); |
2673 | 2656 |
2674 if (data->icon != 0) | 2657 if (data->icon != 0) |
2675 icnDelete(data->icon); | 2658 icnDelete(data->icon); |
2676 } | 2659 } |
2677 | 2660 |
2678 /* | 2661 /* |
2679 * Delete WIN Handler | 2662 * Delete WIN Handler |
2680 */ | 2663 */ |