FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiDialogs.c @ 204:a7d9fe97e5b8
mmiDialogs.c: rm FF_PHONE_LOCK and other dead code
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 06 Apr 2021 01:19:02 +0000 |
parents | 303704cf0701 |
children | 81f5c4ca1fb3 |
comparison
equal
deleted
inserted
replaced
203:45455ba52f9d | 204:a7d9fe97e5b8 |
---|---|
133 #include "mfw_lng.h" | 133 #include "mfw_lng.h" |
134 #include "mfw_sat.h" | 134 #include "mfw_sat.h" |
135 #include "mfw_kbd.h" | 135 #include "mfw_kbd.h" |
136 #include "mfw_nm.h" | 136 #include "mfw_nm.h" |
137 | 137 |
138 //x0pleela 15 May, 2007 DR: OMAPS00127483 | |
139 #ifdef FF_PHONE_LOCK | |
140 #ifdef FF_MIDI_RINGER | |
141 #include "mfw_midi.h" | |
142 #endif //FF_MIDI_RINGER | |
143 #endif /* FF_PHONE_LOCK */ | |
144 #include "dspl.h" | 138 #include "dspl.h" |
145 | 139 |
146 #include "ksd.h" | 140 #include "ksd.h" |
147 #include "psa.h" | 141 #include "psa.h" |
148 | 142 |
165 #include "prim.h" | 159 #include "prim.h" |
166 #ifndef PCM_2_FFS | 160 #ifndef PCM_2_FFS |
167 #include "pcm.h" | 161 #include "pcm.h" |
168 #endif | 162 #endif |
169 | 163 |
170 | |
171 #include "mmiColours.h" | 164 #include "mmiColours.h" |
172 | |
173 //x0pleela 27 Mar, 2007 ER: OMAPS00122561 | |
174 #ifdef FF_PHONE_LOCK | |
175 #include "MmiPins.h" | |
176 //x0pleela 15 May, 2007 DR: OMAPS00127483 | |
177 #include "MmiSounds.h" | |
178 EXTERN T_call call_data; | |
179 extern T_MFW_HND phlock_win_handle; /* to hold the win handle of phone unlock editor window */ | |
180 extern T_MFW_HND phlock_kbd_handle; /* to hold the kbd handle of phone unlock editor window */ | |
181 extern T_MFW_HND phlock_alarm_win_handle; /* to hold the win handle of alarm window */ | |
182 extern T_MFW_HND phlock_dialog_mtc_win_handle;/* to hold the win handle of MT call dialog window */ | |
183 extern int phlock_alarm; /* flag to check whether alarm event has occured or not */ | |
184 int phlock_mtc_anim_time; /* to hold the display info for MTC while in locked state */ | |
185 | |
186 //x0pleela 15 May, 2007 DR: OMAPS00127483 | |
187 #ifdef FF_MMI_AUDIO_PROFILE | |
188 extern UBYTE mfwAudPlay;//flag for audio | |
189 #endif | |
190 | |
191 static T_MFW_HND phlock_dialog_info_create (T_MFW_HND parent_win); | |
192 static int phlock_dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win); | |
193 void phlock_dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | |
194 static T_MFW_CB phlock_dialog_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc); | |
195 static int phlock_dialog_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard); | |
196 static int phlock_dialog_info_kbd_long_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard); | |
197 void phlock_dialog_info_destroy (T_MFW_HND own_window); | |
198 | |
199 #endif //FF_PHONE_LOCK | |
200 | 165 |
201 void dlg_initDisplayData_type( T_DISPLAY_DATA *displayInfo, U32 displayCol, int dlgType, T_BITMAP* dlgBitmap , int dlgSKFormat ); | 166 void dlg_initDisplayData_type( T_DISPLAY_DATA *displayInfo, U32 displayCol, int dlgType, T_BITMAP* dlgBitmap , int dlgSKFormat ); |
202 | 167 |
203 /* | 168 /* |
204 * START NEW PART | 169 * START NEW PART |
359 T_MFW_WIN * win_data; | 324 T_MFW_WIN * win_data; |
360 T_dialog_info * data = (T_dialog_info *)ALLOC_MEMORY (sizeof (T_dialog_info)); | 325 T_dialog_info * data = (T_dialog_info *)ALLOC_MEMORY (sizeof (T_dialog_info)); |
361 TRACE_FUNCTION ("dialog_info_create()"); | 326 TRACE_FUNCTION ("dialog_info_create()"); |
362 | 327 |
363 data->info_win = win_create (parent_win, 0, E_WIN_VISIBLE | 328 data->info_win = win_create (parent_win, 0, E_WIN_VISIBLE |
364 //x0pleela 06 Apr, 2007 ER: OMAPS00122561 | |
365 #ifdef FF_PHONE_LOCK | |
366 |E_WIN_RESUME | |
367 #endif //FF_PHONE_LOCK | |
368 , (T_MFW_CB)dialog_info_win_resize_cb); | 329 , (T_MFW_CB)dialog_info_win_resize_cb); |
369 | 330 |
370 if (data->info_win EQ 0) | 331 if (data->info_win EQ 0) |
371 return 0; | 332 return 0; |
372 | 333 |
433 /* | 394 /* |
434 * Free Memory | 395 * Free Memory |
435 */ | 396 */ |
436 FREE_MEMORY ((void *)data, sizeof (T_dialog_info)); | 397 FREE_MEMORY ((void *)data, sizeof (T_dialog_info)); |
437 } | 398 } |
438 //x0pleela 05 Apr, 2007 ER: OMAPS00122561 | |
439 #ifdef FF_PHONE_LOCK | |
440 if( phlock_alarm && phlock_alarm_win_handle ) | |
441 { | |
442 phlock_alarm_win_handle = NULL; | |
443 } | |
444 | |
445 if(( call_data.call_direction == MFW_CM_MTC )&& phlock_dialog_mtc_win_handle ) | |
446 { | |
447 phlock_dialog_mtc_win_handle = NULL; | |
448 } | |
449 #endif //FF_PHONE_LOCK | |
450 | |
451 } | 399 } |
452 | 400 |
453 void dlg_zeroDisplayData( T_DISPLAY_DATA *displayInfo) | 401 void dlg_zeroDisplayData( T_DISPLAY_DATA *displayInfo) |
454 { | 402 { |
455 TRACE_EVENT("dlg_zeroDisplayData()"); | 403 TRACE_EVENT("dlg_zeroDisplayData()"); |
567 * Create timer and keyboard handler | 515 * Create timer and keyboard handler |
568 */ | 516 */ |
569 data->info_tim = tim_create (win, display_info->Time, (T_MFW_CB)dialog_info_tim_cb); | 517 data->info_tim = tim_create (win, display_info->Time, (T_MFW_CB)dialog_info_tim_cb); |
570 data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); | 518 data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); |
571 data->info_kbd_long = kbd_create(win,KEY_ALL|KEY_LONG,(MfwCb)dialog_info_kbd_long_cb); | 519 data->info_kbd_long = kbd_create(win,KEY_ALL|KEY_LONG,(MfwCb)dialog_info_kbd_long_cb); |
572 | |
573 //x0pleela 05 Apr, 2007 ER: OMAPS00122561 | |
574 #ifdef FF_PHONE_LOCK | |
575 if( phlock_win_handle && | |
576 ( ( phlock_alarm) || ( call_data.call_direction == MFW_CM_MTC ) ) ) | |
577 { | |
578 TRACE_EVENT("dialog_info: Bef deleting kbd_delete(data->info_kbd);"); | |
579 if( phlock_alarm ) | |
580 phlock_alarm_win_handle = win; | |
581 | |
582 if( call_data.call_direction == MFW_CM_MTC ) | |
583 phlock_dialog_mtc_win_handle = win; | |
584 | |
585 kbd_delete(data->info_kbd); | |
586 data->info_kbd = phlock_kbd_handle; //set the kbd handle of unlock screen | |
587 } | |
588 #endif //FF_PHONE_LOCK | |
589 | 520 |
590 /* | 521 /* |
591 * Store any other data | 522 * Store any other data |
592 */ | 523 */ |
593 data->KeyEvents = display_info->KeyEvents; | 524 data->KeyEvents = display_info->KeyEvents; |
630 } | 561 } |
631 #endif | 562 #endif |
632 | 563 |
633 TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); | 564 TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); |
634 TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); | 565 TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); |
635 //x0pleela 27 Mar, 2007 ER: OMAPS00122561 | 566 if (display_info->anim_time != 0) |
636 #ifdef FF_PHONE_LOCK | |
637 phlock_mtc_anim_time = display_info->anim_time; | |
638 if( ( !phlock_win_handle) || (mmiPinsEmergencyCall()) | |
639 || call_data.emergencyCall ) | |
640 { | |
641 #endif //FF_PHONE_LOCK | |
642 if(display_info->anim_time != 0) | |
643 { | 567 { |
644 data->animation_timer = timCreate(win,display_info->anim_time,(MfwCb)mmi_dialogs_animation_new_CB); | 568 data->animation_timer = timCreate(win,display_info->anim_time,(MfwCb)mmi_dialogs_animation_new_CB); |
645 timStart(data->animation_timer); | 569 timStart(data->animation_timer); |
646 } | 570 } |
647 | 571 |
648 if (display_info->Time NEQ FOREVER) | 572 if (display_info->Time NEQ FOREVER) |
649 tim_start (data->info_tim); | 573 tim_start (data->info_tim); |
650 win_show (win); | 574 win_show (win); |
651 | 575 |
652 #ifdef FF_PHONE_LOCK | |
653 } | |
654 else | |
655 { | |
656 if (display_info->Time NEQ FOREVER) | |
657 tim_start (data->info_tim); | |
658 | |
659 | |
660 | |
661 winShow(phlock_win_handle ); | |
662 } | |
663 #endif //FF_PHONE_LOCK | |
664 break; | 576 break; |
665 | 577 |
666 case DIALOG_DESTROY: | 578 case DIALOG_DESTROY: |
667 dialog_info_destroy(win); | 579 dialog_info_destroy(win); |
668 break; | 580 break; |
669 } | 581 } |
670 } | 582 } |
671 | 583 |
672 #if(0) /* x0039928 - Lint warning fix */ | |
673 /******************************************************************************* | |
674 | |
675 $Function: dialog_info_win_cb | |
676 | |
677 $Description: Callback function for information dialog | |
678 | |
679 $Returns: void | |
680 | |
681 $Arguments: window handle event, win | |
682 *******************************************************************************/ | |
683 //GW-SPR#762-Added code to wraps txtString2 if there is room on the display to allow | |
684 //very long numbers to be displayed. | |
685 #define MAX_LINE_CHAR MAX_LINE | |
686 static int dialog_info_win_cb (T_MFW_EVENT event, T_MFW_WIN * win) | |
687 { | |
688 T_dialog_info * data = (T_dialog_info *)win->user; | |
689 char buffer[MAX_LINE_CHAR+1]; | |
690 int yPos,len,bufPos,nLines; | |
691 | |
692 TRACE_FUNCTION ("dialog_info_win_cb()"); | |
693 | |
694 | |
695 if (data EQ 0) | |
696 return 1; | |
697 | |
698 switch (event) | |
699 { | |
700 case E_WIN_VISIBLE: | |
701 if (win->flags & E_WIN_VISIBLE) | |
702 { | |
703 /* | |
704 * Print the information dialog | |
705 */ | |
706 | |
707 /* | |
708 * Clear Screen | |
709 */ | |
710 dspl_ClearAll(); | |
711 | |
712 /* | |
713 * Print softkeys | |
714 */ | |
715 icnShow(data->icon); | |
716 if (data->SoftKeyStrings) | |
717 displayCustSoftKeys(data->LSKString, data->RSKString); // SH - display text softkeys | |
718 else | |
719 displaySoftKeys(data->LeftSoftKey, data->RightSoftKey); // display ID softkeys | |
720 | |
721 /* | |
722 * Print information | |
723 */ | |
724 /*MC SPR 1257, having to shift everything up 1 line as string wrapping for second | |
725 string causes softkey overwrite when in Chinese*/ | |
726 if (data->TextId NEQ 0) | |
727 { | |
728 ALIGNED_PROMPT(LEFT,0,DSPL_TXTATTR_CURRENT_MODE, data->TextId); | |
729 } | |
730 else if (data->TextString NEQ NULL) | |
731 { | |
732 #ifdef EASY_TEXT_ENABLED | |
733 if (data->TextString[0] == (char)0x80) //MC if this is a unicode string /* x0039928 -lint warning removal */ | |
734 displayAlignedText(LEFT, 0, DSPL_TXTATTR_UNICODE, &data->TextString[2]); | |
735 else | |
736 #endif | |
737 displayAlignedText(LEFT, 0, DSPL_TXTATTR_NORMAL, data->TextString); | |
738 } | |
739 | |
740 if (data->TextId2 NEQ 0) | |
741 { | |
742 ALIGNED_PROMPT(LEFT,Mmi_layout_first_line()/*MC*/,DSPL_TXTATTR_CURRENT_MODE, data->TextId2); | |
743 } | |
744 else if (data->TextString2 NEQ NULL) | |
745 { | |
746 #ifdef EASY_TEXT_ENABLED | |
747 if (data->TextString2[0] == (char)0x80 ) //MC if this is a unicode string /* x0039928 -Lint warning removal */ | |
748 displayAlignedText(LEFT, Mmi_layout_first_line()/*MC*/, DSPL_TXTATTR_UNICODE, &data->TextString2[2]); | |
749 else | |
750 #endif | |
751 { | |
752 if ((data->WrapStrings & WRAP_STRING_2) && (strlen(data->TextString2) > MAX_LINE_CHAR)) | |
753 { //Display text over a number of lines | |
754 yPos = Mmi_layout_first_line();/*MC*/ | |
755 bufPos = 0; | |
756 nLines = Mmi_number_of_lines_without_icons_on_top()-2;//starting on 2nd line | |
757 len = strlen(data->TextString2); | |
758 while ((bufPos < len) && (nLines >=0)) | |
759 { | |
760 memcpy(buffer,&data->TextString2[bufPos],MAX_LINE_CHAR); | |
761 bufPos = bufPos + MAX_LINE_CHAR; | |
762 buffer[MAX_LINE_CHAR] = 0x00; | |
763 displayAlignedText(LEFT, yPos, 0, buffer); | |
764 yPos = yPos + Mmi_layout_line_height(); | |
765 nLines--; | |
766 } | |
767 } | |
768 else | |
769 { | |
770 displayAlignedText(LEFT, Mmi_layout_second_line(),DSPL_TXTATTR_NORMAL, data->TextString2); | |
771 } | |
772 } | |
773 } | |
774 } | |
775 break; | |
776 | |
777 default: | |
778 return 0; | |
779 } | |
780 return 1; | |
781 } | |
782 #endif | |
783 | 584 |
784 /******************************************************************************* | 585 /******************************************************************************* |
785 | 586 |
786 $Function: dialog_info_win_cb | 587 $Function: dialog_info_win_cb |
787 | 588 |
894 { | 695 { |
895 //x0pleela 15 May, 2007 DR: OMAPS00127483 | 696 //x0pleela 15 May, 2007 DR: OMAPS00127483 |
896 //Added the following code to handle ringer for incoming call and alarm in phone unlocked state. | 697 //Added the following code to handle ringer for incoming call and alarm in phone unlocked state. |
897 //the ringer for incoming call or alarm is restarted here after unlocking the phone. | 698 //the ringer for incoming call or alarm is restarted here after unlocking the phone. |
898 case E_WIN_RESUME: | 699 case E_WIN_RESUME: |
899 | |
900 #ifdef FF_PHONE_LOCK | |
901 | |
902 if( ( ( ( call_data.call_direction == MFW_CM_MTC ) && ( phlock_dialog_mtc_win_handle ) ) || ( phlock_alarm ) ) | |
903 #ifdef FF_MMI_AUDIO_PROFILE | |
904 && ( !mfwAudPlay) | |
905 #endif | |
906 ) | |
907 { | |
908 if( call_data.call_direction == MFW_CM_MTC ) | |
909 { | |
910 #ifdef FF_MIDI_RINGER | |
911 mfw_ringer_start(AS_RINGER_MODE_IC, TRUE, sounds_midi_ringer_start_cb); | |
912 #endif | |
913 } | |
914 else if ( phlock_alarm ) | |
915 { | |
916 #ifdef FF_MIDI_RINGER | |
917 mfw_ringer_start(AS_RINGER_MODE_ALARM, TRUE, sounds_midi_ringer_start_cb); | |
918 #endif | |
919 } | |
920 } | |
921 | |
922 #endif // FF_PHONE_LOCK | |
923 | |
924 break; | 700 break; |
925 | 701 |
926 case E_WIN_VISIBLE: | 702 case E_WIN_VISIBLE: |
927 if (win->flags & E_WIN_VISIBLE) | 703 if (win->flags & E_WIN_VISIBLE) |
928 { | 704 { |
929 TRACE_EVENT("dialog_info_win_resize_cb: E_WIN_VISIBLE"); | 705 TRACE_EVENT("dialog_info_win_resize_cb: E_WIN_VISIBLE"); |
930 | |
931 #ifdef FF_PHONE_LOCK | |
932 if( phlock_alarm && phlock_alarm_win_handle ) | |
933 { | |
934 TRACE_EVENT("dialog_info_win_resize_cb: creating alarm kbd handler"); | |
935 data->info_kbd = kbd_create (phlock_alarm_win_handle, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); | |
936 } | |
937 if( ( call_data.call_direction == MFW_CM_MTC ) && ( phlock_dialog_mtc_win_handle ) ) | |
938 { | |
939 TRACE_EVENT("dialog_info_win_resize_cb: creating mtc kbd handler"); | |
940 data->info_kbd = kbd_create (phlock_dialog_mtc_win_handle, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); | |
941 if(phlock_mtc_anim_time != 0) | |
942 { | |
943 data->animation_timer = timCreate(phlock_dialog_mtc_win_handle, phlock_mtc_anim_time, | |
944 (MfwCb)mmi_dialogs_animation_new_CB); | |
945 timStart(data->animation_timer); | |
946 } | |
947 } | |
948 #endif //FF_PHONE_LOCK | |
949 | 706 |
950 /* | 707 /* |
951 * Print the information dialog | 708 * Print the information dialog |
952 */ | 709 */ |
953 for (i=0;i<MAX_DLG_LINES;i++) | 710 for (i=0;i<MAX_DLG_LINES;i++) |
1750 dlg_initDisplayData_events( &DisplayInfo, NULL, FOREVER, NULL ); | 1507 dlg_initDisplayData_events( &DisplayInfo, NULL, FOREVER, NULL ); |
1751 DisplayInfo.TextString = TextStr; | 1508 DisplayInfo.TextString = TextStr; |
1752 | 1509 |
1753 return info_dialog(win, &DisplayInfo); | 1510 return info_dialog(win, &DisplayInfo); |
1754 } | 1511 } |
1755 | |
1756 //x0peela 02 Apr, 2007 ER: OMAPS00122561 | |
1757 #ifdef FF_PHONE_LOCK | |
1758 /******************************************************************************* | |
1759 | |
1760 $Function: phlock_info_dialog | |
1761 | |
1762 $Description: Common information dialog | |
1763 | |
1764 $Returns: Dialogue info win | |
1765 | |
1766 $Arguments: parent win, display info | |
1767 | |
1768 *******************************************************************************/ | |
1769 T_MFW_HND phlock_info_dialog (T_MFW_HND parent_win, | |
1770 T_DISPLAY_DATA * display_info) | |
1771 { | |
1772 T_MFW_HND win; | |
1773 TRACE_FUNCTION("phlock_info_dialog()"); | |
1774 display_info->SoftKeyStrings = FALSE; | |
1775 | |
1776 win = phlock_dialog_info_create (parent_win); | |
1777 | |
1778 if (win NEQ NULL) | |
1779 { | |
1780 SEND_EVENT (win, DIALOG_INIT, 0, display_info); | |
1781 } | |
1782 return win; | |
1783 } | |
1784 | |
1785 /******************************************************************************* | |
1786 | |
1787 $Function: phlock_dialog_info_create | |
1788 | |
1789 $Description: Creation of an information dialog | |
1790 | |
1791 $Returns: Dialogue info win | |
1792 | |
1793 $Arguments: parent win | |
1794 | |
1795 *******************************************************************************/ | |
1796 static T_MFW_HND phlock_dialog_info_create (T_MFW_HND parent_win) | |
1797 { | |
1798 T_MFW_WIN * win_data; | |
1799 T_dialog_info * data = (T_dialog_info *)ALLOC_MEMORY (sizeof (T_dialog_info)); | |
1800 TRACE_FUNCTION ("phlock_dialog_info_create()"); | |
1801 | |
1802 data->info_win = win_create (parent_win, 0, E_WIN_VISIBLE, (T_MFW_CB)phlock_dialog_info_win_resize_cb); | |
1803 | |
1804 if (data->info_win EQ 0) | |
1805 return 0; | |
1806 TRACE_EVENT_P1("phlock_dialog_info_create:data->info_win:%02x", data->info_win); | |
1807 /* | |
1808 * Create window handler | |
1809 */ | |
1810 data->mmi_control.dialog = (T_DIALOG_FUNC)phlock_dialog_info; | |
1811 data->mmi_control.data = data; | |
1812 data->parent_win = parent_win; | |
1813 win_data = ((T_MFW_HDR *)data->info_win)->data; | |
1814 win_data->user = (void *)data; | |
1815 | |
1816 /* | |
1817 * return window handle | |
1818 */ | |
1819 return data->info_win; | |
1820 } | |
1821 | |
1822 /******************************************************************************* | |
1823 | |
1824 $Function: phlock_dialog_info_win_resize_cb | |
1825 | |
1826 $Description: Creation of an information dialog | |
1827 | |
1828 $Returns: Dialogue info win | |
1829 | |
1830 $Arguments: parent win | |
1831 | |
1832 *******************************************************************************/ | |
1833 static int phlock_dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win) | |
1834 { | |
1835 T_dialog_info * data = (T_dialog_info *)win->user; | |
1836 // T_DISPLAY_DATA * display_info; // RAVI | |
1837 int xPos[MAX_DLG_LINES]; | |
1838 int yPos[MAX_DLG_LINES]; | |
1839 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | |
1840 //The size of array str and strlen are increased by 1, so that the last elements holds data | |
1841 // which is used while wrapping the text. | |
1842 char* str[MAX_DLG_LINES+1]; | |
1843 int strLen[MAX_DLG_LINES+1]; | |
1844 int i; | |
1845 char* lskStr,*rskStr; | |
1846 int wx = 0; //,wy,sx=0,sy=0; // RAVI | |
1847 int wy = 0; // RAVI | |
1848 int sx = 0; // RAVI | |
1849 int sy = 0; // RAVI | |
1850 int fullScreen = DLG_USE_RECTANGLE; | |
1851 int yOfs; | |
1852 int yBmpOfs = 0; | |
1853 MfwRect skArea; | |
1854 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | |
1855 #ifdef FF_MMI_SAT_ICON | |
1856 USHORT titleIconWidth = 0; | |
1857 #endif | |
1858 MfwRect area; | |
1859 int scrWidth = 0; //available width for the display // RAVI - Assignment to 0. | |
1860 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | |
1861 // temp_ptr is used while wrapping the text. | |
1862 // Now str2[][] is not required. | |
1863 char *temp_ptr; | |
1864 int nChar; | |
1865 | |
1866 /* t_font_bitmap bmp; */ /* Warning Removal - x0020906 - 24-08-2006 */ | |
1867 // t_font_bitmap* bmpPtr = &bmp; // RAVI - Not Referenced. | |
1868 | |
1869 int drawWinType; | |
1870 int nLines; | |
1871 | |
1872 int linePos=0; | |
1873 int lineLen = 0; | |
1874 int wrapLine = 0; /*GW #2294*/ // x0066814 06 Dec 2006, OMAPS00106825 | |
1875 | |
1876 const int charWidth = dspl_GetTextExtent("0",1); | |
1877 TRACE_FUNCTION ("phlock_dialog_info_win_resize_cb()"); | |
1878 | |
1879 memset(str,'\0',sizeof(str)); /* x0039928 - Lint warning fix */ | |
1880 memset(strLen,0,sizeof(strLen)); | |
1881 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | |
1882 #ifdef FF_MMI_SAT_ICON | |
1883 if (data->IconData.dst != NULL) | |
1884 { | |
1885 if (data->IconData.width > TITLE_ICON_WIDTH) | |
1886 { | |
1887 titleIconWidth = TITLE_ICON_WIDTH; | |
1888 } | |
1889 else | |
1890 { | |
1891 titleIconWidth = data->IconData.width ; | |
1892 } | |
1893 } | |
1894 else | |
1895 { | |
1896 titleIconWidth = 0; | |
1897 } | |
1898 | |
1899 #endif | |
1900 if (data EQ 0) | |
1901 return 1; | |
1902 | |
1903 switch (event) | |
1904 { | |
1905 case E_WIN_VISIBLE: | |
1906 if (win->flags & E_WIN_VISIBLE) | |
1907 { | |
1908 /* | |
1909 * Print the information dialog | |
1910 */ | |
1911 for (i=0;i<MAX_DLG_LINES;i++) | |
1912 { | |
1913 xPos[i]=0; | |
1914 yPos[i] = Mmi_layout_line_height()*i; | |
1915 str[i]=NULL; | |
1916 strLen[i]=0; | |
1917 } | |
1918 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | |
1919 // Assign the values to last elments of the array str and strLen | |
1920 str[MAX_DLG_LINES] = NULL; | |
1921 strLen[MAX_DLG_LINES] = 0; | |
1922 yOfs = Mmi_layout_line_height()/4; | |
1923 if (data->TextId != 0) | |
1924 str[DLG_LINE1] = MmiRsrcGetText( data->TextId); | |
1925 else | |
1926 str[DLG_LINE1] = data->TextString; | |
1927 | |
1928 if (data->TextId2 != 0) | |
1929 str[DLG_LINE2] = MmiRsrcGetText( data->TextId2); | |
1930 else | |
1931 str[DLG_LINE2] = data->TextString2; | |
1932 | |
1933 if (data->SoftKeyStrings!=0) | |
1934 { | |
1935 lskStr = data->LSKString; | |
1936 rskStr = data->RSKString; | |
1937 } | |
1938 else | |
1939 { | |
1940 if (data->LeftSoftKey != TxtNull) | |
1941 lskStr = MmiRsrcGetText(data->LeftSoftKey); | |
1942 else | |
1943 lskStr = NULL; | |
1944 | |
1945 if (data->RightSoftKey != TxtNull) | |
1946 rskStr = MmiRsrcGetText(data->RightSoftKey); | |
1947 else | |
1948 rskStr = NULL; | |
1949 } | |
1950 | |
1951 if ((str[DLG_LINE1]!= NULL) || (str[DLG_LINE2]!=NULL)) | |
1952 { //Draw a window for status info | |
1953 if (str[DLG_LINE2] == NULL) | |
1954 { | |
1955 sy = Mmi_layout_line_height()+yOfs*2; // 18 or 12 | |
1956 | |
1957 } | |
1958 else | |
1959 { | |
1960 sy = Mmi_layout_line_height()*2+yOfs*3; // 33 or 22 | |
1961 } | |
1962 | |
1963 //MC, if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) | |
1964 { //calculate longest string - use this to calc width of window | |
1965 sx = 0; | |
1966 if ((lskStr!=NULL) || (rskStr!=NULL)) | |
1967 { | |
1968 sy = sy+Mmi_layout_softkeyHeight()+yOfs*2; | |
1969 sx = sx + 10; | |
1970 if (lskStr != NULL) | |
1971 { | |
1972 sx = sx + dspl_GetTextExtent(lskStr, 0); | |
1973 } | |
1974 if (rskStr != NULL) | |
1975 { | |
1976 sx = sx + dspl_GetTextExtent(rskStr,0); | |
1977 } | |
1978 | |
1979 } | |
1980 for (i=DLG_LINE1;i<=DLG_LINE2;i++) | |
1981 { | |
1982 strLen[i] = dspl_GetTextExtent(str[i],0); | |
1983 } | |
1984 | |
1985 /* Work out the desired width of the dialog. If we can wrap line 2 and it is long, wrap it */ | |
1986 if (data->WrapStrings & WRAP_STRING_2) | |
1987 nLines = MAX_WRAP_LINES; | |
1988 else | |
1989 nLines = 1; | |
1990 #ifdef COLOURDISPLAY | |
1991 if (data->dlgBgdBitmap!=NULL) | |
1992 { | |
1993 //we only have room to split line 2 into 'max_lines_dlg_popup' lines in the pop-up. | |
1994 //NB this should be calculated depending on the height of the popup bitmap. | |
1995 const int max_lines_dlg_popup=2; | |
1996 if (nLines>max_lines_dlg_popup) | |
1997 nLines = max_lines_dlg_popup; | |
1998 scrWidth = (data->dlgBgdBitmap->area.sx * 3)/4; //the max width is about 3/4 of the pop-up | |
1999 if ( (strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) || | |
2000 (strLen[DLG_LINE1] > scrWidth)) | |
2001 { | |
2002 //recalculate width below. | |
2003 if (data->WrapStrings & WRAP_STRING_2) | |
2004 nLines = MAX_WRAP_LINES; | |
2005 fullScreen = DLG_USE_RECTANGLE; | |
2006 } | |
2007 else | |
2008 { | |
2009 fullScreen = DLG_USE_BITMAP; | |
2010 //Leave width as is | |
2011 } | |
2012 } | |
2013 #else | |
2014 //On a C-sample, limit pop-up lines to 2 extra (any more - use entire screen) | |
2015 { | |
2016 const int max_lines_dlg_popup=2; | |
2017 if (nLines>max_lines_dlg_popup) | |
2018 nLines = max_lines_dlg_popup; | |
2019 } | |
2020 | |
2021 #endif | |
2022 if (fullScreen == DLG_USE_RECTANGLE) | |
2023 { | |
2024 //see if we can display as a pop-up | |
2025 if (SCREEN_SIZE_X < 128) | |
2026 scrWidth = SCREEN_SIZE_X-6; | |
2027 else | |
2028 scrWidth = (SCREEN_SIZE_X*7)/8; | |
2029 if ( strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) | |
2030 { | |
2031 //Cannot fit in as a pop-up - use full screen | |
2032 fullScreen = DLG_USE_FULL_SCREEN; | |
2033 scrWidth = SCREEN_SIZE_X; | |
2034 } | |
2035 else | |
2036 { | |
2037 //We can fit it in - but we may want to reduce the width for a nicer look. | |
2038 } | |
2039 } | |
2040 | |
2041 /* | |
2042 * Wrap second text line (e.g. for long phone numbers.) | |
2043 */ | |
2044 if (strLen[DLG_LINE2] > scrWidth-charWidth) | |
2045 { | |
2046 //If we can fit the string on 2 lines - do it. | |
2047 if (data->WrapStrings & WRAP_STRING_2) | |
2048 { | |
2049 if (str[DLG_LINE2][0] != (char)0x80) //not unicode /* x0039928 -Lint warning removal */ | |
2050 { | |
2051 wrapLine = 0; | |
2052 lineLen = strlen(str[DLG_LINE2]); | |
2053 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | |
2054 // memset is not required any more . | |
2055 //Now the last element of the str[] will point to the second string of the dialog | |
2056 str[MAX_DLG_LINES] = str[DLG_LINE2]; // Now move the second line of text to the last element of the arrya | |
2057 strLen[MAX_DLG_LINES] = strLen[DLG_LINE2];// put the right value for the length of the string | |
2058 str[DLG_LINE2] = NULL ; // Assign NULL to the second element of the array. | |
2059 while ((wrapLine < MAX_WRAP_LINES) && (linePos<lineLen)) | |
2060 { | |
2061 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | |
2062 // Instead of DLG_LINE2 use MAX_DLG_LINES | |
2063 nChar = dspl_GetNcharToFit (&str[MAX_DLG_LINES][linePos], (USHORT)scrWidth); | |
2064 if (nChar > MAX_WRAP_CHAR) | |
2065 nChar = MAX_WRAP_CHAR; | |
2066 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | |
2067 // Allocate MAX_WRAP_CHAR no of bytes | |
2068 temp_ptr = (char*)mfwAlloc(MAX_WRAP_CHAR); | |
2069 if(NULL == temp_ptr) | |
2070 return 0; | |
2071 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | |
2072 // Now the destination of memcpy is temp_ptr instead of str2[wrapLine] and the source is str[MAX_DLG_LINES] instead of str[DLG_LINE2] | |
2073 memcpy(temp_ptr,&str[MAX_DLG_LINES][linePos],nChar); // Now the source data is from the last element of the array. | |
2074 linePos = linePos+nChar; | |
2075 ////GW - even if we cannot display the entire string - it is better than what we would have otherwise | |
2076 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | |
2077 // Assign the value of pointer temp_ptr to str[] | |
2078 str[DLG_LINE2+wrapLine] = temp_ptr; | |
2079 temp_ptr = NULL; | |
2080 strLen[DLG_LINE2 + wrapLine] = dspl_GetTextExtent(str[DLG_LINE2+wrapLine],0); | |
2081 wrapLine++; | |
2082 } | |
2083 | |
2084 } | |
2085 else | |
2086 { | |
2087 //Unicode is more problematic - we need the 0x80 at the front of the string | |
2088 //for the call to 'dspl_GetNcharToFit'. This will involve copying the entire remainder | |
2089 //of 'str2' into a temporary buffer. At the moment, we only wrap numbers so this | |
2090 //code will wait until it is required. | |
2091 // str[3] = "Code not written!!"; //issue warning | |
2092 // strLen[3] = dspl_GetTextExtent(str[3],0); | |
2093 fullScreen = DLG_USE_FULL_SCREEN; //error - use full screen | |
2094 } | |
2095 } | |
2096 } | |
2097 | |
2098 //Calculate longest line of text (including softkeys - sx already set to the softkey width) | |
2099 for (i=0;i< MAX_DLG_LINES;i++) | |
2100 { | |
2101 if (strLen[i]>sx) | |
2102 sx = strLen[i]; | |
2103 } | |
2104 if (sx > SCREEN_SIZE_X-charWidth) | |
2105 sx = SCREEN_SIZE_X; | |
2106 else | |
2107 { | |
2108 if (sx > SCREEN_SIZE_X/2) | |
2109 sx = sx + charWidth; | |
2110 else | |
2111 sx = sx + charWidth*2; | |
2112 } | |
2113 if (sy> sx) | |
2114 sx = sy; | |
2115 wx = (SCREEN_SIZE_X-sx)/2; | |
2116 if (wx<0) | |
2117 wx=0; | |
2118 } | |
2119 | |
2120 if (sy > SCREEN_SIZE_Y) | |
2121 wy = 0; | |
2122 else if (SCREEN_SIZE_Y > 2*sy) | |
2123 wy = (SCREEN_SIZE_Y*2/3-sy)/2; //display in middle of top 2/3 of screen | |
2124 else | |
2125 wy = (SCREEN_SIZE_Y-sy)/2; //display in middle of screen | |
2126 if (wy < 10) | |
2127 wy = wy/2; | |
2128 | |
2129 if ((wx == 0) || (wy==0)) | |
2130 { //not enough room to display as a window - use whole screen | |
2131 fullScreen = DLG_USE_FULL_SCREEN; | |
2132 } | |
2133 | |
2134 #ifdef COLOURDISPLAY | |
2135 if ((data->icon_array != NULL) && (fullScreen != DLG_USE_BITMAP)) | |
2136 { //The dialog has an animation - we must make the pop-up large enough to support this | |
2137 if (sx < data->icon_array[0].area.sx) | |
2138 sx = data->icon_array[0].area.sx; | |
2139 yBmpOfs = data->icon_array[0].area.py + data->icon_array[0].area.sy; | |
2140 wy = data->icon_array[0].area.py; | |
2141 sy = sy + data->icon_array[0].area.sy; | |
2142 } | |
2143 #endif | |
2144 } | |
2145 else | |
2146 { | |
2147 //We have no strings to display - clear entire screen | |
2148 fullScreen = DLG_USE_FULL_SCREEN; | |
2149 } | |
2150 | |
2151 | |
2152 /****************************** | |
2153 * Draw window (full screen/pop-up) | |
2154 *****************************/ | |
2155 if (fullScreen != DLG_USE_FULL_SCREEN) | |
2156 dspl_unfocusDisplay(); | |
2157 area.px = 0; | |
2158 area.py = 0; | |
2159 area.sx = sx; | |
2160 area.sy = sy; | |
2161 resources_setColour(data->dlgCol); | |
2162 drawWinType = DSPL_WIN_CENTRE; | |
2163 | |
2164 if (fullScreen!=DLG_USE_FULL_SCREEN) | |
2165 { | |
2166 t_font_bitmap bmp; | |
2167 t_font_bitmap* bmpPtr = NULL; | |
2168 | |
2169 for (i=0;i<MAX_DLG_LINES;i++) | |
2170 { | |
2171 //centre text | |
2172 xPos[i] = wx+(sx-strLen[i])/2; | |
2173 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; | |
2174 } | |
2175 | |
2176 #ifdef COLOURDISPLAY | |
2177 if ((data->dlgBgdBitmap != NULL) && (fullScreen==DLG_USE_BITMAP)) | |
2178 { | |
2179 bmp.format = data->dlgBgdBitmap->icnType; | |
2180 bmp.height = data->dlgBgdBitmap->area.sy; | |
2181 bmp.width = data->dlgBgdBitmap->area.sx; | |
2182 bmp.bitmap = data->dlgBgdBitmap->icons; | |
2183 bmpPtr = &bmp; | |
2184 area = calcLayout(data->dlgType, sx, sy, bmp.width, bmp.height); | |
2185 | |
2186 //Adjust size of available area depending on bitmap properties/dlgType. | |
2187 //dlgType== 0 =>display info in centre of bitmap | |
2188 if (data->dlgType == 0) | |
2189 { | |
2190 //If the bmp is bigger than the data we will move the bmp to | |
2191 //lie over the centre of the data | |
2192 area.px = area.px - (bmp.width - sx)/2; | |
2193 area.py = area.py - (bmp.height- sy)/2; | |
2194 } | |
2195 for (i=0;i<MAX_DLG_LINES;i++) | |
2196 { | |
2197 xPos[i] = xPos[i] + area.px; | |
2198 yPos[i] = yPos[i] + area.py; | |
2199 } | |
2200 | |
2201 TRACE_EVENT_P3("wy = %d, yOfs = %d, area.py = %d",wy,yOfs,area.py); | |
2202 if( data->dlgBgdBitmap->icnType != ICON_TYPE_1BIT_UNPACKED ) | |
2203 dspl_SetBgdColour( COL_TRANSPARENT ); | |
2204 | |
2205 | |
2206 } | |
2207 else | |
2208 { | |
2209 // x0066814 06 Dec 2006, OMAPS00106825 | |
2210 //The window height calculation related to wrapping should be skipped when no | |
2211 //string wrapping is done | |
2212 if(wrapLine>0) | |
2213 { | |
2214 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); | |
2215 } | |
2216 area.sy = sy; | |
2217 } | |
2218 #else | |
2219 if (wrapLine>1) | |
2220 { | |
2221 sy = sy + (wrapLine-1)*Mmi_layout_line_height(); | |
2222 area.sy = sy; | |
2223 } | |
2224 #endif | |
2225 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | |
2226 //If length of the dialog is bigger than screen then start the dialog from the top corner. | |
2227 if(sy+wy >= SCREEN_SIZE_Y && sy < SCREEN_SIZE_Y) | |
2228 if(wy>0 && wy < sy) | |
2229 { | |
2230 wy = (SCREEN_SIZE_Y - sy ) /2 ;// centre the dialog | |
2231 if(wy < 0) | |
2232 wy=0; | |
2233 for (i=0;i<MAX_DLG_LINES;i++) | |
2234 yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; | |
2235 } | |
2236 dspl_DrawWin( wx,wy,sx,sy, drawWinType , bmpPtr); | |
2237 } | |
2238 else | |
2239 { | |
2240 dspl_ClearAll(); | |
2241 sx = 84; | |
2242 for (i=0;i<MAX_DLG_LINES;i++) | |
2243 { | |
2244 xPos[i] = 0; | |
2245 yPos[i] = Mmi_layout_line(i+1); | |
2246 } | |
2247 } | |
2248 /****************************** | |
2249 * Print softkeys | |
2250 *****************************/ | |
2251 icnShow(data->icon); | |
2252 if ((lskStr != NULL) || (rskStr != NULL)) | |
2253 { | |
2254 if (fullScreen==DLG_USE_FULL_SCREEN) | |
2255 Mmi_layout_softkeyArea( &skArea ); | |
2256 else | |
2257 { | |
2258 skArea.px = area.px+wx; | |
2259 skArea.sx = area.sx; | |
2260 skArea.py = area.py+wy+area.sy-Mmi_layout_softkeyHeight()-1; | |
2261 skArea.sy = Mmi_layout_softkeyHeight(); | |
2262 } | |
2263 softKeys_displayStrXY(lskStr, rskStr, data->dlgSkFormat, data->dlgCol, &skArea); | |
2264 } | |
2265 | |
2266 /****************************** | |
2267 * Print dialog text | |
2268 *****************************/ | |
2269 for (i=0;i<MAX_DLG_LINES;i++) | |
2270 { /* GW#2294 No need to draw zero length strings .*/ | |
2271 if ((str[i] != NULL) && (strLen[i] > 0)) | |
2272 { | |
2273 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | |
2274 #ifdef FF_MMI_SAT_ICON | |
2275 if(data->IconData.selfExplanatory == FALSE) | |
2276 dspl_TextOut(xPos[i] + titleIconWidth, yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); | |
2277 #else | |
2278 dspl_TextOut(xPos[i] , yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); | |
2279 #endif | |
2280 } | |
2281 } | |
2282 //x0035544 Feb 15, 2006. DR:OMAPS00061467 | |
2283 #ifdef FF_MMI_SAT_ICON | |
2284 if(data->IconData.dst != NULL) | |
2285 { | |
2286 if(str[DLG_LINE2] == NULL) | |
2287 { | |
2288 if ((data->IconData.width > TITLE_ICON_WIDTH) || | |
2289 (data->IconData.height > TITLE_ICON_HEIGHT)) | |
2290 { | |
2291 dspl_BitBlt2(xPos[0], yPos[0], 8, | |
2292 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); | |
2293 } | |
2294 | |
2295 else | |
2296 dspl_BitBlt2(xPos[0], yPos[0], data->IconData.width, | |
2297 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); | |
2298 } | |
2299 else | |
2300 { | |
2301 if ((data->IconData.width > TITLE_ICON_WIDTH) || | |
2302 (data->IconData.height > TITLE_ICON_HEIGHT)) | |
2303 { | |
2304 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2], 8, | |
2305 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); | |
2306 } | |
2307 else | |
2308 dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2],data->IconData.width, | |
2309 data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); | |
2310 } | |
2311 | |
2312 } | |
2313 #endif | |
2314 | |
2315 | |
2316 resources_restoreColour(); | |
2317 } | |
2318 | |
2319 // Sep 06 2005 REF: MMI-SPR-33548 x0012849 | |
2320 // Now free the allocated memory | |
2321 /* x0039928 - Lint warning removal */ | |
2322 if (strLen[MAX_DLG_LINES] > scrWidth-charWidth) | |
2323 if (data->WrapStrings & WRAP_STRING_2) | |
2324 if (str[MAX_DLG_LINES][0] != (char)0x80) /* x0039928 - lint warning removal */ | |
2325 { | |
2326 for(i=DLG_LINE2;i<MAX_DLG_LINES;i++) | |
2327 { | |
2328 if(NULL != str[i] && strLen[i] > 0) | |
2329 mfwFree((U8*)str[i],MAX_WRAP_CHAR); | |
2330 } | |
2331 str[MAX_DLG_LINES]=NULL; | |
2332 } | |
2333 | |
2334 break; | |
2335 | |
2336 default: | |
2337 return 0; | |
2338 } | |
2339 | |
2340 return 1; | |
2341 } | |
2342 | |
2343 /******************************************************************************* | |
2344 | |
2345 $Function: phlock_dialog_info | |
2346 | |
2347 $Description: Dialog function for information dialog | |
2348 | |
2349 $Returns: void | |
2350 | |
2351 $Arguments: win, window handle event, value, parameter | |
2352 | |
2353 *******************************************************************************/ | |
2354 void phlock_dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | |
2355 { | |
2356 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | |
2357 T_dialog_info * data = (T_dialog_info *)win_data->user; | |
2358 T_DISPLAY_DATA * display_info = (T_DISPLAY_DATA *)parameter; | |
2359 TRACE_FUNCTION ("phlock_dialog_info()"); | |
2360 | |
2361 switch (event) | |
2362 { | |
2363 case DIALOG_INIT: | |
2364 /* | |
2365 * Initialize dialog | |
2366 */ | |
2367 #if defined (WIN32) | |
2368 { | |
2369 /***************************Go-lite Optimization changes Start***********************/ | |
2370 | |
2371 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
2372 TRACE_EVENT_P1( "Identifier %d", display_info->Identifier); | |
2373 /***************************Go-lite Optimization changes end***********************/ | |
2374 | |
2375 } | |
2376 #endif | |
2377 /* | |
2378 * Create timer and keyboard handler | |
2379 */ | |
2380 data->info_tim = tim_create (win, display_info->Time, (T_MFW_CB)phlock_dialog_info_tim_cb); | |
2381 data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)phlock_dialog_info_kbd_cb); | |
2382 data->info_kbd_long = kbd_create(win,KEY_ALL|KEY_LONG,(MfwCb)phlock_dialog_info_kbd_long_cb); | |
2383 | |
2384 /* | |
2385 * Store any other data | |
2386 */ | |
2387 data->KeyEvents = display_info->KeyEvents; | |
2388 data->TextString = display_info->TextString; | |
2389 data->LeftSoftKey = display_info->LeftSoftKey; | |
2390 data->RightSoftKey = display_info->RightSoftKey; | |
2391 data->SoftKeyStrings = display_info->SoftKeyStrings; // SH - TRUE if using strings rather than IDs | |
2392 data->LSKString = display_info->LSKString; // Text for left soft key | |
2393 data->RSKString = display_info->RSKString; // Text for right soft key | |
2394 data->TextId = display_info->TextId; | |
2395 data->Identifier = display_info->Identifier; | |
2396 data->Callback = display_info->Callback; | |
2397 data->TextString2 = display_info->TextString2; | |
2398 data->TextId2 = display_info->TextId2; | |
2399 data->WrapStrings = display_info->WrapStrings; //GW-SPR#762 | |
2400 | |
2401 data->dlgCol = display_info->displayCol; | |
2402 data->dlgType = display_info->dlgType; | |
2403 data->dlgBgdBitmap = display_info->bgdBitmap; | |
2404 data->dlgSkFormat = 0; | |
2405 data->current_frame = display_info->current_frame; | |
2406 data->number_of_frames = display_info->number_of_frames; | |
2407 data->icon_array = (MfwIcnAttr*)display_info->icon_array; | |
2408 data->animation_timer = 0; | |
2409 //x0035544 Feb 07, 2006 DR:OMAPS00061467 | |
2410 #ifdef FF_MMI_SAT_ICON | |
2411 if(display_info->IconData.dst != NULL) | |
2412 { | |
2413 data->IconData.width = display_info->IconData.width; | |
2414 data->IconData.height = display_info->IconData.height; | |
2415 data->IconData.dst = display_info->IconData.dst; | |
2416 data->IconData.selfExplanatory = display_info->IconData.selfExplanatory; | |
2417 } | |
2418 else | |
2419 { | |
2420 data->IconData.dst = NULL; | |
2421 data->IconData.selfExplanatory = FALSE; | |
2422 data->IconData.width =0; | |
2423 data->IconData.height =0; | |
2424 } | |
2425 #endif | |
2426 | |
2427 TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); | |
2428 TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); | |
2429 if(display_info->anim_time != 0) | |
2430 { | |
2431 data->animation_timer = timCreate(win,display_info->anim_time,(MfwCb)mmi_dialogs_animation_new_CB); | |
2432 timStart(data->animation_timer); | |
2433 } | |
2434 | |
2435 if (display_info->Time NEQ FOREVER) | |
2436 tim_start (data->info_tim); | |
2437 win_show (win); | |
2438 | |
2439 break; | |
2440 | |
2441 case DIALOG_DESTROY: | |
2442 phlock_dialog_info_destroy(win); | |
2443 break; | |
2444 } | |
2445 } | |
2446 | |
2447 /******************************************************************************* | |
2448 | |
2449 $Function: phlock_dialog_info_tim_cb | |
2450 | |
2451 $Description: Callback function for the dialog info timer. | |
2452 | |
2453 | |
2454 $Returns: MFW event handler | |
2455 | |
2456 $Arguments: window handle event, timer control block | |
2457 | |
2458 *******************************************************************************/ | |
2459 static T_MFW_CB phlock_dialog_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc) | |
2460 { | |
2461 T_MFW_HND win = mfw_parent (mfw_header()); | |
2462 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | |
2463 T_dialog_info * data = (T_dialog_info *)win_data->user; | |
2464 | |
2465 T_MFW_HND parent_win = data->parent_win; | |
2466 USHORT Identifier = data->Identifier; | |
2467 void (* Callback)() = data->Callback; | |
2468 | |
2469 TRACE_FUNCTION("phlock_dialog_info_tim_cb()"); | |
2470 #if defined (WIN32) | |
2471 { | |
2472 /***************************Go-lite Optimization changes Start***********************/ | |
2473 | |
2474 //Aug 16, 2004 REF: CRR 24323 Deepa M.D | |
2475 TRACE_EVENT_P1 ("Identifier %d", data->Identifier);); | |
2476 /***************************Go-lite Optimization changes end***********************/ | |
2477 | |
2478 } | |
2479 #endif | |
2480 | |
2481 #ifdef FF_PHONE_LOCK | |
2482 TRACE_EVENT("Bef. destroy"); | |
2483 TRACE_EVENT_P1("phlock_dialog_info_tim_cb: win: %02x", win); | |
2484 | |
2485 #endif //FF_PHONE_LOCK | |
2486 /* | |
2487 ** SPR#1744 NDH | |
2488 ** Move the dialog destory in front of the Callback to make the processing consistent | |
2489 ** with the Right Keypress and Hangup Processing. Also to ensure that the dialog is | |
2490 ** removed when the screen is redrawn. | |
2491 */ | |
2492 | |
2493 TRACE_EVENT("phlock_dialog_info_tim_cb: Bef dialog_info_destrroy"); | |
2494 phlock_dialog_info_destroy (win); | |
2495 | |
2496 #ifdef FF_PHONE_LOCK | |
2497 TRACE_EVENT("Aft. destroy"); | |
2498 TRACE_EVENT_P1("phlock_dialog_info_tim_cb: win: %02x", win); | |
2499 #endif //FF_PHONE_LOCK | |
2500 | |
2501 if (Callback) | |
2502 (Callback) (parent_win, Identifier, INFO_TIMEOUT); | |
2503 | |
2504 return 0; | |
2505 } | |
2506 | |
2507 /******************************************************************************* | |
2508 | |
2509 $Function: phlock_dialog_info_kbd_cb | |
2510 | |
2511 $Description: Keyboard event handler | |
2512 | |
2513 $Returns: status int | |
2514 | |
2515 $Arguments: window handle event, keyboard control block | |
2516 | |
2517 *******************************************************************************/ | |
2518 | |
2519 static int phlock_dialog_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard) | |
2520 { | |
2521 T_MFW_HND win = mfw_parent (mfw_header()); | |
2522 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | |
2523 T_dialog_info * data = (T_dialog_info *)win_data->user; | |
2524 T_MFW_HND parent_win = data->parent_win; | |
2525 USHORT Identifier = data->Identifier; | |
2526 void (* Callback)() = data->Callback; | |
2527 | |
2528 TRACE_FUNCTION("phlock_dialog_info_kbd_cb"); | |
2529 | |
2530 switch (keyboard->code) | |
2531 { | |
2532 case KCD_LEFT: | |
2533 if (data->KeyEvents & KEY_LEFT ) | |
2534 { | |
2535 phlock_dialog_info_destroy (win); | |
2536 if (Callback) | |
2537 (Callback) (parent_win, Identifier, INFO_KCD_LEFT); | |
2538 } | |
2539 break; | |
2540 | |
2541 case KCD_RIGHT: | |
2542 if (data->KeyEvents & KEY_RIGHT) | |
2543 { | |
2544 phlock_dialog_info_destroy (win); | |
2545 if (Callback) | |
2546 (Callback) (parent_win, Identifier, INFO_KCD_RIGHT); | |
2547 } | |
2548 break; | |
2549 | |
2550 case KCD_HUP: | |
2551 if (data->KeyEvents & KEY_HUP || data->KeyEvents & INFO_KCD_ALL) | |
2552 { | |
2553 phlock_dialog_info_destroy (win); | |
2554 if (Callback) | |
2555 (Callback) (parent_win, Identifier, INFO_KCD_HUP); | |
2556 } | |
2557 break; | |
2558 case KCD_MNUUP: | |
2559 | |
2560 if (data->KeyEvents & KEY_MNUUP) | |
2561 { | |
2562 if (Callback) | |
2563 (Callback) (parent_win, Identifier, INFO_KCD_UP); | |
2564 } | |
2565 | |
2566 break; | |
2567 case KCD_MNUDOWN: | |
2568 | |
2569 if (data->KeyEvents & KEY_MNUDOWN) | |
2570 { | |
2571 if (Callback) | |
2572 (Callback) (parent_win, Identifier, INFO_KCD_DOWN); | |
2573 } | |
2574 | |
2575 break; | |
2576 //MZ 7/3/01 used to start a call. | |
2577 case KCD_CALL: | |
2578 if (data->KeyEvents & KEY_CALL ) | |
2579 { | |
2580 phlock_dialog_info_destroy (win); | |
2581 if (Callback) | |
2582 (Callback) (parent_win, Identifier, INFO_KCD_OFFHOOK); | |
2583 } | |
2584 break; | |
2585 default: | |
2586 if (data->KeyEvents & INFO_KCD_ALL) | |
2587 { | |
2588 /* | |
2589 Note: The variable Identifier is overwritten with the | |
2590 keycode of the dialog; | |
2591 we need it only for the Multicall Control !! | |
2592 */ | |
2593 Identifier = keyboard->code; | |
2594 phlock_dialog_info_destroy (win); | |
2595 if (Callback) | |
2596 (Callback) (parent_win, Identifier, INFO_KCD_ALL); | |
2597 } | |
2598 break; | |
2599 | |
2600 } | |
2601 return MFW_EVENT_CONSUMED; | |
2602 } | |
2603 | |
2604 /******************************************************************************* | |
2605 | |
2606 $Function: phlock_dialog_info_kbd_long_cb | |
2607 | |
2608 $Description: Keyboard event handler | |
2609 | |
2610 $Returns: status int | |
2611 | |
2612 $Arguments: window handle event, keyboard control block | |
2613 | |
2614 *******************************************************************************/ | |
2615 static int phlock_dialog_info_kbd_long_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard) | |
2616 { | |
2617 TRACE_FUNCTION("dialog_info_kbd_long_cb()"); | |
2618 return MFW_EVENT_CONSUMED; | |
2619 } | |
2620 | |
2621 /******************************************************************************* | |
2622 | |
2623 $Function: phlock_dialog_info_destroy | |
2624 | |
2625 $Description: Destruction of an information dialog | |
2626 | |
2627 $Returns: void | |
2628 | |
2629 $Arguments: win | |
2630 | |
2631 *******************************************************************************/ | |
2632 void phlock_dialog_info_destroy (T_MFW_HND own_window) | |
2633 { | |
2634 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data; | |
2635 T_dialog_info * data = (T_dialog_info *)win->user; | |
2636 | |
2637 TRACE_FUNCTION ("phlock_dialog_info_destroy()"); | |
2638 | |
2639 if (own_window == NULL) | |
2640 { | |
2641 TRACE_EVENT ("Error :- Called with NULL Pointer"); | |
2642 return; | |
2643 } | |
2644 | |
2645 if (data) | |
2646 { | |
2647 /* | |
2648 * Exit TIMER & KEYBOARD Handle | |
2649 */ | |
2650 kbd_delete (data->info_kbd); | |
2651 tim_delete (data->info_tim); | |
2652 | |
2653 if(data->animation_timer != 0) | |
2654 { | |
2655 timDelete(data->animation_timer); | |
2656 | |
2657 if (data->icon != 0) | |
2658 icnDelete(data->icon); | |
2659 } | |
2660 | |
2661 /* | |
2662 * Delete WIN Handler | |
2663 */ | |
2664 TRACE_EVENT_P1("phlock_dialog_info_destroy: deleting:data->info_win:%02x",data->info_win); | |
2665 | |
2666 win_delete (data->info_win); | |
2667 /* | |
2668 * Free Memory | |
2669 */ | |
2670 FREE_MEMORY ((void *)data, sizeof (T_dialog_info)); | |
2671 } | |
2672 } | |
2673 #endif //FF_PHONE_LOCK | |
2674 |