FreeCalypso > hg > fc-tourmaline
comparison src/ui/mfw/mfw_td.c @ 188:92abb46dc1ba
src/ui/mfw/*.[ch]: rm trailing white space
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 19 Jan 2021 06:10:27 +0000 |
parents | 67bfe9f274f6 |
children |
comparison
equal
deleted
inserted
replaced
187:a33dd8a5dcc9 | 188:92abb46dc1ba |
---|---|
13 | 13 |
14 EXPORT : | 14 EXPORT : |
15 | 15 |
16 TO DO : | 16 TO DO : |
17 | 17 |
18 $History:: mfw_td.c | 18 $History:: mfw_td.c |
19 Dec 05, 2006 REF:OMAPS00106887 Prabakar R(a0393213) | 19 Dec 05, 2006 REF:OMAPS00106887 Prabakar R(a0393213) |
20 Description:Compilation error when FF_POWER_MANAGEMENT is not defined | 20 Description:Compilation error when FF_POWER_MANAGEMENT is not defined |
21 | 21 |
22 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) | 22 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) |
23 Description: Removal of clone code: entity GDI | 23 Description: Removal of clone code: entity GDI |
24 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). | 24 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). |
25 As a result interface of rtc_get_time_date() has been changed. The changes are only for locosto. | 25 As a result interface of rtc_get_time_date() has been changed. The changes are only for locosto. |
26 | 26 |
27 Jan 06,2004 REF: CRR 27859 xkundadu | 27 Jan 06,2004 REF: CRR 27859 xkundadu |
28 Description: Clock: Alarm does not go off even if timer times out. | 28 Description: Clock: Alarm does not go off even if timer times out. |
29 Solution: Check whether FFS is formatted before writing into FFS. | 29 Solution: Check whether FFS is formatted before writing into FFS. |
30 If it is not formatted, format it and create /mmi folder in FFS. | 30 If it is not formatted, format it and create /mmi folder in FFS. |
31 | 31 |
62 #include "mfw_tim.h" | 62 #include "mfw_tim.h" |
63 #include "Mfw_td.h" | 63 #include "Mfw_td.h" |
64 #include "mfw_win.h" | 64 #include "mfw_win.h" |
65 #include "mfw_acie.h" | 65 #include "mfw_acie.h" |
66 #include "dspl.h" | 66 #include "dspl.h" |
67 | 67 |
68 // Jan 06,2004 REF: CRR 27859 xkundadu | 68 // Jan 06,2004 REF: CRR 27859 xkundadu |
69 // Description: Clock: Alarm does not go off even if timer times out. | 69 // Description: Clock: Alarm does not go off even if timer times out. |
70 // Solution: Check whether FFS is formatted before writing into FFS. | 70 // Solution: Check whether FFS is formatted before writing into FFS. |
71 // If it is not formatted, format it and create /mmi folder in FFS. | 71 // If it is not formatted, format it and create /mmi folder in FFS. |
72 | 72 |
73 // Included this header file to call FFS related functions | 73 // Included this header file to call FFS related functions |
74 #include "Mfw_ffs.h" | 74 #include "Mfw_ffs.h" |
75 | 75 |
76 #define TD_STRING_LEN 15 | 76 #define TD_STRING_LEN 15 |
77 | 77 |
78 #define ONE_MINUTE 60000 | 78 #define ONE_MINUTE 60000 |
79 | 79 |
140 { /*get time/date from driver and initialise these*/ | 140 { /*get time/date from driver and initialise these*/ |
141 /* | 141 /* |
142 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) | 142 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) |
143 Description: Removal of clone code: entity GDI | 143 Description: Removal of clone code: entity GDI |
144 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). | 144 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). |
145 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be | 145 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be |
146 consistent with the new interface. | 146 consistent with the new interface. |
147 */ | 147 */ |
148 #if 0 | 148 #if 0 |
149 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); | 149 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); |
150 #else | 150 #else |
151 rtc_get_time_date(¤t_date, ¤t_time); | 151 rtc_get_time_date(¤t_date, ¤t_time); |
152 #endif | 152 #endif |
153 } | 153 } |
154 else | 154 else |
155 { | 155 { |
156 /* | 156 /* |
157 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) | 157 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) |
158 Description: Removal of clone code: entity GDI | 158 Description: Removal of clone code: entity GDI |
159 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). | 159 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). |
160 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be | 160 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be |
161 consistent with the new interface. | 161 consistent with the new interface. |
162 */ | 162 */ |
163 #if 0 | 163 #if 0 |
164 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); | 164 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); |
165 #else | 165 #else |
166 rtc_get_time_date(¤t_date, ¤t_time); | 166 rtc_get_time_date(¤t_date, ¤t_time); |
167 #endif | 167 #endif |
168 /*use a default time/date*/ | 168 /*use a default time/date*/ |
169 current_time.second = 0; | 169 current_time.second = 0; |
170 current_time.minute = 0; | 170 current_time.minute = 0; |
171 current_time.hour = 0; | 171 current_time.hour = 0; |
311 /*SPR 2639, use global var, don't need to update time as it's already updated every minute*/ | 311 /*SPR 2639, use global var, don't need to update time as it's already updated every minute*/ |
312 /* | 312 /* |
313 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) | 313 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) |
314 Description: Removal of clone code: entity GDI | 314 Description: Removal of clone code: entity GDI |
315 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). | 315 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). |
316 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be | 316 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be |
317 consistent with the new interface. | 317 consistent with the new interface. |
318 */ | 318 */ |
319 #if 0 | 319 #if 0 |
320 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); | 320 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); |
321 #else | 321 #else |
322 rtc_get_time_date(¤t_date, ¤t_time); | 322 rtc_get_time_date(¤t_date, ¤t_time); |
323 #endif | 323 #endif |
324 | 324 |
325 // Issue Number : MMI-SPR-12159 on 07/04/04 by Rashmi C N and Deepa M D | 325 // Issue Number : MMI-SPR-12159 on 07/04/04 by Rashmi C N and Deepa M D |
326 // change by Sasken ( Rashmi C N and Deepa M D) on April 07th 2004 | 326 // change by Sasken ( Rashmi C N and Deepa M D) on April 07th 2004 |
327 // Bug : The AM PM for 12 hour fomrat was not being displayed, Also there were some bugs with the 12 hour fomat | 327 // Bug : The AM PM for 12 hour fomrat was not being displayed, Also there were some bugs with the 12 hour fomat |
328 // Change 1: Uncommented the above line "rtc_get_time_date(¤t_date, ¤t_time); " | 328 // Change 1: Uncommented the above line "rtc_get_time_date(¤t_date, ¤t_time); " |
329 // as the time was not getting refreshed when the time format was changed | 329 // as the time was not getting refreshed when the time format was changed |
330 // Change 2 : To display the time in appropriate format in idle screen | 330 // Change 2 : To display the time in appropriate format in idle screen |
331 | 331 |
332 if(current_time.format==RTC_TIME_FORMAT_12HOUR) | 332 if(current_time.format==RTC_TIME_FORMAT_12HOUR) |
333 { | 333 { |
334 if(current_time.PM_flag==1) | 334 if(current_time.PM_flag==1) |
335 sprintf(time_string, "%02d:%02d pm ", current_time.hour, current_time.minute); | 335 sprintf(time_string, "%02d:%02d pm ", current_time.hour, current_time.minute); |
336 else | 336 else |
337 sprintf(time_string, "%02d:%02d am ", current_time.hour, current_time.minute); | 337 sprintf(time_string, "%02d:%02d am ", current_time.hour, current_time.minute); |
338 } | 338 } |
339 else | 339 else |
340 sprintf(time_string, "%02d:%02d", current_time.hour, current_time.minute); | 340 sprintf(time_string, "%02d:%02d", current_time.hour, current_time.minute); |
341 return time_string; | 341 return time_string; |
342 } | 342 } |
343 /* | 343 /* |
373 #ifndef WIN32 | 373 #ifndef WIN32 |
374 /* | 374 /* |
375 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) | 375 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) |
376 Description: Removal of clone code: entity GDI | 376 Description: Removal of clone code: entity GDI |
377 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). | 377 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). |
378 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be | 378 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be |
379 consistent with the new interface. | 379 consistent with the new interface. |
380 */ | 380 */ |
381 #if 0 | 381 #if 0 |
382 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); | 382 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); |
383 #else | 383 #else |
384 rtc_get_time_date(¤t_date, ¤t_time); | 384 rtc_get_time_date(¤t_date, ¤t_time); |
385 #endif | 385 #endif |
386 #endif | 386 #endif |
387 return ¤t_date; | 387 return ¤t_date; |
388 } | 388 } |
389 /* | 389 /* |
402 #ifndef WIN32 | 402 #ifndef WIN32 |
403 /* | 403 /* |
404 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) | 404 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) |
405 Description: Removal of clone code: entity GDI | 405 Description: Removal of clone code: entity GDI |
406 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). | 406 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). |
407 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be | 407 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be |
408 consistent with the new interface. | 408 consistent with the new interface. |
409 */ | 409 */ |
410 #if 0 | 410 #if 0 |
411 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); | 411 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); |
412 #else | 412 #else |
413 rtc_get_time_date(¤t_date, ¤t_time); | 413 rtc_get_time_date(¤t_date, ¤t_time); |
414 #endif | 414 #endif |
415 #endif | 415 #endif |
416 return ¤t_time; | 416 return ¤t_time; |
417 } | 417 } |
418 | 418 |
431 { | 431 { |
432 /*SPR 2639*/ | 432 /*SPR 2639*/ |
433 #ifndef WIN32 | 433 #ifndef WIN32 |
434 int result; | 434 int result; |
435 T_MFW_ALARM_INFO alarmInfo; | 435 T_MFW_ALARM_INFO alarmInfo; |
436 | 436 |
437 /*SPR 2639, save alarm info to FFS*/ | 437 /*SPR 2639, save alarm info to FFS*/ |
438 /***************************Go-lite Optimization changes Start***********************/ | 438 /***************************Go-lite Optimization changes Start***********************/ |
439 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | 439 //Aug 16, 2004 REF: CRR 24323 Deepa M.D |
440 TRACE_EVENT_P5("alarm Time:%d:%d, date %d/%d%d", time->hour, time->minute, date->day, | 440 TRACE_EVENT_P5("alarm Time:%d:%d, date %d/%d%d", time->hour, time->minute, date->day, |
441 date->month, date->year); | 441 date->month, date->year); |
454 // If FFS is not formatted, format the /mmi volume. | 454 // If FFS is not formatted, format the /mmi volume. |
455 if(ffs_format("/mmi", 0x2BAD ) == EFFS_OK) | 455 if(ffs_format("/mmi", 0x2BAD ) == EFFS_OK) |
456 { | 456 { |
457 TRACE_EVENT("Format success"); | 457 TRACE_EVENT("Format success"); |
458 } | 458 } |
459 else | 459 else |
460 { | 460 { |
461 TRACE_EVENT("FFS NOT formatted "); | 461 TRACE_EVENT("FFS NOT formatted "); |
462 //FFS Format failed return ERROR | 462 //FFS Format failed return ERROR |
463 return MfwResErr; | 463 return MfwResErr; |
464 } | 464 } |
465 | 465 |
466 } | 466 } |
467 else | 467 else |
468 { | 468 { |
469 // Already formatted. | 469 // Already formatted. |
470 TRACE_EVENT("FFS formatted "); | 470 TRACE_EVENT("FFS formatted "); |
475 switch(ffs_mkdir("/mmi") ) | 475 switch(ffs_mkdir("/mmi") ) |
476 { | 476 { |
477 case EFFS_OK: | 477 case EFFS_OK: |
478 TRACE_EVENT("Created mmi!!"); | 478 TRACE_EVENT("Created mmi!!"); |
479 break; | 479 break; |
480 case EFFS_EXISTS: | 480 case EFFS_EXISTS: |
481 TRACE_EVENT("EFFS_EXISTS!"); | 481 TRACE_EVENT("EFFS_EXISTS!"); |
482 break; | 482 break; |
483 case EFFS_NAMETOOLONG: | 483 case EFFS_NAMETOOLONG: |
484 TRACE_EVENT("EFFS_NAMETOOLONG!"); | 484 TRACE_EVENT("EFFS_NAMETOOLONG!"); |
485 break; | 485 break; |
486 case EFFS_BADNAME: | 486 case EFFS_BADNAME: |
487 TRACE_EVENT("EFFS_BADNAME!"); | 487 TRACE_EVENT("EFFS_BADNAME!"); |
488 break; | 488 break; |
489 case EFFS_NOSPACE: | 489 case EFFS_NOSPACE: |
490 TRACE_EVENT("EFFS_NOSPACE!"); | 490 TRACE_EVENT("EFFS_NOSPACE!"); |
491 case EFFS_FSFULL: | 491 case EFFS_FSFULL: |
492 TRACE_EVENT("EFFS_FSFULL!"); | 492 TRACE_EVENT("EFFS_FSFULL!"); |
493 break; | 493 break; |
494 case EFFS_MEMORY: | 494 case EFFS_MEMORY: |
495 TRACE_EVENT("EFFS_MEMORY!"); | 495 TRACE_EVENT("EFFS_MEMORY!"); |
496 break; | 496 break; |
497 case EFFS_MSGSEND: | 497 case EFFS_MSGSEND: |
498 TRACE_EVENT("EFFS_MSGSEND!"); | 498 TRACE_EVENT("EFFS_MSGSEND!"); |
499 break; | 499 break; |
500 default: | 500 default: |
501 TRACE_EVENT("default!"); | 501 TRACE_EVENT("default!"); |
502 break; | 502 break; |
503 | 503 |
504 } | 504 } |
505 | 505 |
506 | 506 |
507 result =ffs_fwrite("/mmi/alarminfo",&alarmInfo, sizeof(T_MFW_ALARM_INFO)); | 507 result =ffs_fwrite("/mmi/alarminfo",&alarmInfo, sizeof(T_MFW_ALARM_INFO)); |
508 | 508 |
509 if (result<0) | 509 if (result<0) |
510 { TRACE_EVENT("RTC alarm files not written"); | 510 { TRACE_EVENT("RTC alarm files not written"); |
511 return MfwResErr; | 511 return MfwResErr; |
512 } | 512 } |
513 #endif | 513 #endif |
719 | 719 |
720 */ | 720 */ |
721 void mfw_td_signal (MfwEvt event, void *para) | 721 void mfw_td_signal (MfwEvt event, void *para) |
722 { | 722 { |
723 UBYTE temp = dspl_Enable(0); | 723 UBYTE temp = dspl_Enable(0); |
724 | 724 |
725 | 725 |
726 if (mfwSignallingMethod EQ 0) | 726 if (mfwSignallingMethod EQ 0) |
727 { | 727 { |
728 if (mfwFocus) | 728 if (mfwFocus) |
729 if (mfw_td_sign_exec(mfwFocus,event,para)) | 729 if (mfw_td_sign_exec(mfwFocus,event,para)) |
795 | 795 |
796 PURPOSE : Used by mfw_td_signal() to pass event to MMI layer | 796 PURPOSE : Used by mfw_td_signal() to pass event to MMI layer |
797 | 797 |
798 */ | 798 */ |
799 int mfw_td_sign_exec (MfwHdr *cur_elem, MfwEvt event, T_MFW_TD_PARA *para) | 799 int mfw_td_sign_exec (MfwHdr *cur_elem, MfwEvt event, T_MFW_TD_PARA *para) |
800 { | 800 { |
801 | 801 |
802 | 802 |
803 while (cur_elem) | 803 while (cur_elem) |
804 { | 804 { |
805 | 805 |
806 | 806 |
807 | 807 |
808 if (cur_elem->type == MfwTypTd) | 808 if (cur_elem->type == MfwTypTd) |
809 { | 809 { |
810 | 810 |
811 T_MFW_TD *td_data; | 811 T_MFW_TD *td_data; |
812 td_data = (T_MFW_TD *) cur_elem->data; | 812 td_data = (T_MFW_TD *) cur_elem->data; |
813 | 813 |
814 | 814 |
815 if (td_data->emask & event) | 815 if (td_data->emask & event) |
816 { | 816 { |
817 td_data->event = event; | 817 td_data->event = event; |
818 | 818 |
819 // Jan 06,2004 REF: CRR 27859 xkundadu | 819 // Jan 06,2004 REF: CRR 27859 xkundadu |
820 // Description: Clock: Alarm does not go off even if timer times out. | 820 // Description: Clock: Alarm does not go off even if timer times out. |
821 // Solution: Assign para to NULL, instead of *para = NULL which is not correct. | 821 // Solution: Assign para to NULL, instead of *para = NULL which is not correct. |
822 | 822 |
823 // para = NULL; /*we're not passing any data to MMI*/ // RAVI | 823 // para = NULL; /*we're not passing any data to MMI*/ // RAVI |
824 | 824 |
825 if (td_data->handler) | 825 if (td_data->handler) |
826 { | 826 { |
827 // PATCH LE 06.06.00 | 827 // PATCH LE 06.06.00 |
828 // store current mfw elem | 828 // store current mfw elem |
829 current_mfw_elem = cur_elem; | 829 current_mfw_elem = cur_elem; |
928 #ifndef WIN32 | 928 #ifndef WIN32 |
929 /* | 929 /* |
930 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) | 930 Aug 02, 2006 REF:OMAPS00083404 Prabakar R (a0393213) |
931 Description: Removal of clone code: entity GDI | 931 Description: Removal of clone code: entity GDI |
932 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). | 932 Solution: Two similar functions(rtc_get_time_date() and rtc_get_alarm()) are made into one function rtc_get_time_date(). |
933 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be | 933 As a result, interface for rtc_get_time_date() has been changed. Change has been done here to be |
934 consistent with the new interface. | 934 consistent with the new interface. |
935 */ | 935 */ |
936 #if 0 | 936 #if 0 |
937 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); | 937 rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT); |
938 #else | 938 #else |
939 rtc_get_time_date(¤t_date, ¤t_time); | 939 rtc_get_time_date(¤t_date, ¤t_time); |
940 #endif | 940 #endif |
941 | 941 |
942 timStart(timer_handle);/*restart timer */ | 942 timStart(timer_handle);/*restart timer */ |
943 /***************************Go-lite Optimization changes Start***********************/ | 943 /***************************Go-lite Optimization changes Start***********************/ |
944 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | 944 //Aug 16, 2004 REF: CRR 24323 Deepa M.D |
951 /***************************Go-lite Optimization changes end***********************/ | 951 /***************************Go-lite Optimization changes end***********************/ |
952 /*if alarm is set*/ | 952 /*if alarm is set*/ |
953 if (alarm_date.day != NULL) | 953 if (alarm_date.day != NULL) |
954 { if (dates_match(¤t_date, &alarm_date)) | 954 { if (dates_match(¤t_date, &alarm_date)) |
955 { if (times_match(¤t_time, &alarm_time)) | 955 { if (times_match(¤t_time, &alarm_time)) |
956 { | 956 { |
957 mfw_td_signal(MFW_TD_ALARM, NULL); | 957 mfw_td_signal(MFW_TD_ALARM, NULL); |
958 mfw_td_cancel_alarm(); | 958 mfw_td_cancel_alarm(); |
959 | 959 |
960 } | 960 } |
961 else | 961 else |