FreeCalypso > hg > fc-tourmaline
diff 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 |
line wrap: on
line diff
--- a/src/ui/bmi/mmiDialogs.c Tue Apr 06 01:01:11 2021 +0000 +++ b/src/ui/bmi/mmiDialogs.c Tue Apr 06 01:19:02 2021 +0000 @@ -135,12 +135,6 @@ #include "mfw_kbd.h" #include "mfw_nm.h" -//x0pleela 15 May, 2007 DR: OMAPS00127483 -#ifdef FF_PHONE_LOCK -#ifdef FF_MIDI_RINGER -#include "mfw_midi.h" -#endif //FF_MIDI_RINGER -#endif /* FF_PHONE_LOCK */ #include "dspl.h" #include "ksd.h" @@ -167,37 +161,8 @@ #include "pcm.h" #endif - #include "mmiColours.h" -//x0pleela 27 Mar, 2007 ER: OMAPS00122561 -#ifdef FF_PHONE_LOCK -#include "MmiPins.h" -//x0pleela 15 May, 2007 DR: OMAPS00127483 -#include "MmiSounds.h" -EXTERN T_call call_data; -extern T_MFW_HND phlock_win_handle; /* to hold the win handle of phone unlock editor window */ -extern T_MFW_HND phlock_kbd_handle; /* to hold the kbd handle of phone unlock editor window */ -extern T_MFW_HND phlock_alarm_win_handle; /* to hold the win handle of alarm window */ -extern T_MFW_HND phlock_dialog_mtc_win_handle;/* to hold the win handle of MT call dialog window */ -extern int phlock_alarm; /* flag to check whether alarm event has occured or not */ -int phlock_mtc_anim_time; /* to hold the display info for MTC while in locked state */ - -//x0pleela 15 May, 2007 DR: OMAPS00127483 -#ifdef FF_MMI_AUDIO_PROFILE -extern UBYTE mfwAudPlay;//flag for audio -#endif - -static T_MFW_HND phlock_dialog_info_create (T_MFW_HND parent_win); -static int phlock_dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win); -void phlock_dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter); -static T_MFW_CB phlock_dialog_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc); -static int phlock_dialog_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard); -static int phlock_dialog_info_kbd_long_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard); -void phlock_dialog_info_destroy (T_MFW_HND own_window); - -#endif //FF_PHONE_LOCK - void dlg_initDisplayData_type( T_DISPLAY_DATA *displayInfo, U32 displayCol, int dlgType, T_BITMAP* dlgBitmap , int dlgSKFormat ); /* @@ -361,10 +326,6 @@ TRACE_FUNCTION ("dialog_info_create()"); data->info_win = win_create (parent_win, 0, E_WIN_VISIBLE - //x0pleela 06 Apr, 2007 ER: OMAPS00122561 - #ifdef FF_PHONE_LOCK - |E_WIN_RESUME - #endif //FF_PHONE_LOCK , (T_MFW_CB)dialog_info_win_resize_cb); if (data->info_win EQ 0) @@ -435,19 +396,6 @@ */ FREE_MEMORY ((void *)data, sizeof (T_dialog_info)); } -//x0pleela 05 Apr, 2007 ER: OMAPS00122561 -#ifdef FF_PHONE_LOCK - if( phlock_alarm && phlock_alarm_win_handle ) - { - phlock_alarm_win_handle = NULL; - } - - if(( call_data.call_direction == MFW_CM_MTC )&& phlock_dialog_mtc_win_handle ) - { - phlock_dialog_mtc_win_handle = NULL; - } -#endif //FF_PHONE_LOCK - } void dlg_zeroDisplayData( T_DISPLAY_DATA *displayInfo) @@ -570,23 +518,6 @@ data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); data->info_kbd_long = kbd_create(win,KEY_ALL|KEY_LONG,(MfwCb)dialog_info_kbd_long_cb); -//x0pleela 05 Apr, 2007 ER: OMAPS00122561 -#ifdef FF_PHONE_LOCK - if( phlock_win_handle && - ( ( phlock_alarm) || ( call_data.call_direction == MFW_CM_MTC ) ) ) - { - TRACE_EVENT("dialog_info: Bef deleting kbd_delete(data->info_kbd);"); - if( phlock_alarm ) - phlock_alarm_win_handle = win; - - if( call_data.call_direction == MFW_CM_MTC ) - phlock_dialog_mtc_win_handle = win; - - kbd_delete(data->info_kbd); - data->info_kbd = phlock_kbd_handle; //set the kbd handle of unlock screen - } -#endif //FF_PHONE_LOCK - /* * Store any other data */ @@ -632,14 +563,7 @@ TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); -//x0pleela 27 Mar, 2007 ER: OMAPS00122561 -#ifdef FF_PHONE_LOCK - phlock_mtc_anim_time = display_info->anim_time; -if( ( !phlock_win_handle) || (mmiPinsEmergencyCall()) - || call_data.emergencyCall ) -{ -#endif //FF_PHONE_LOCK -if(display_info->anim_time != 0) + if (display_info->anim_time != 0) { data->animation_timer = timCreate(win,display_info->anim_time,(MfwCb)mmi_dialogs_animation_new_CB); timStart(data->animation_timer); @@ -649,18 +573,6 @@ tim_start (data->info_tim); win_show (win); -#ifdef FF_PHONE_LOCK -} -else -{ - if (display_info->Time NEQ FOREVER) - tim_start (data->info_tim); - - - - winShow(phlock_win_handle ); -} -#endif //FF_PHONE_LOCK break; case DIALOG_DESTROY: @@ -669,117 +581,6 @@ } } -#if(0) /* x0039928 - Lint warning fix */ -/******************************************************************************* - - $Function: dialog_info_win_cb - - $Description: Callback function for information dialog - - $Returns: void - - $Arguments: window handle event, win -*******************************************************************************/ -//GW-SPR#762-Added code to wraps txtString2 if there is room on the display to allow -//very long numbers to be displayed. -#define MAX_LINE_CHAR MAX_LINE -static int dialog_info_win_cb (T_MFW_EVENT event, T_MFW_WIN * win) -{ - T_dialog_info * data = (T_dialog_info *)win->user; - char buffer[MAX_LINE_CHAR+1]; - int yPos,len,bufPos,nLines; - - TRACE_FUNCTION ("dialog_info_win_cb()"); - - - if (data EQ 0) - return 1; - - switch (event) - { - case E_WIN_VISIBLE: - if (win->flags & E_WIN_VISIBLE) - { - /* - * Print the information dialog - */ - - /* - * Clear Screen - */ - dspl_ClearAll(); - - /* - * Print softkeys - */ - icnShow(data->icon); - if (data->SoftKeyStrings) - displayCustSoftKeys(data->LSKString, data->RSKString); // SH - display text softkeys - else - displaySoftKeys(data->LeftSoftKey, data->RightSoftKey); // display ID softkeys - - /* - * Print information - */ - /*MC SPR 1257, having to shift everything up 1 line as string wrapping for second - string causes softkey overwrite when in Chinese*/ - if (data->TextId NEQ 0) - { - ALIGNED_PROMPT(LEFT,0,DSPL_TXTATTR_CURRENT_MODE, data->TextId); - } - else if (data->TextString NEQ NULL) - { -#ifdef EASY_TEXT_ENABLED - if (data->TextString[0] == (char)0x80) //MC if this is a unicode string /* x0039928 -lint warning removal */ - displayAlignedText(LEFT, 0, DSPL_TXTATTR_UNICODE, &data->TextString[2]); - else -#endif - displayAlignedText(LEFT, 0, DSPL_TXTATTR_NORMAL, data->TextString); - } - - if (data->TextId2 NEQ 0) - { - ALIGNED_PROMPT(LEFT,Mmi_layout_first_line()/*MC*/,DSPL_TXTATTR_CURRENT_MODE, data->TextId2); - } - else if (data->TextString2 NEQ NULL) - { -#ifdef EASY_TEXT_ENABLED - if (data->TextString2[0] == (char)0x80 ) //MC if this is a unicode string /* x0039928 -Lint warning removal */ - displayAlignedText(LEFT, Mmi_layout_first_line()/*MC*/, DSPL_TXTATTR_UNICODE, &data->TextString2[2]); - else -#endif - { - if ((data->WrapStrings & WRAP_STRING_2) && (strlen(data->TextString2) > MAX_LINE_CHAR)) - { //Display text over a number of lines - yPos = Mmi_layout_first_line();/*MC*/ - bufPos = 0; - nLines = Mmi_number_of_lines_without_icons_on_top()-2;//starting on 2nd line - len = strlen(data->TextString2); - while ((bufPos < len) && (nLines >=0)) - { - memcpy(buffer,&data->TextString2[bufPos],MAX_LINE_CHAR); - bufPos = bufPos + MAX_LINE_CHAR; - buffer[MAX_LINE_CHAR] = 0x00; - displayAlignedText(LEFT, yPos, 0, buffer); - yPos = yPos + Mmi_layout_line_height(); - nLines--; - } - } - else - { - displayAlignedText(LEFT, Mmi_layout_second_line(),DSPL_TXTATTR_NORMAL, data->TextString2); - } - } - } - } - break; - - default: - return 0; - } - return 1; -} -#endif /******************************************************************************* @@ -896,31 +697,6 @@ //Added the following code to handle ringer for incoming call and alarm in phone unlocked state. //the ringer for incoming call or alarm is restarted here after unlocking the phone. case E_WIN_RESUME: - -#ifdef FF_PHONE_LOCK - - if( ( ( ( call_data.call_direction == MFW_CM_MTC ) && ( phlock_dialog_mtc_win_handle ) ) || ( phlock_alarm ) ) - #ifdef FF_MMI_AUDIO_PROFILE - && ( !mfwAudPlay) - #endif - ) - { - if( call_data.call_direction == MFW_CM_MTC ) - { - #ifdef FF_MIDI_RINGER - mfw_ringer_start(AS_RINGER_MODE_IC, TRUE, sounds_midi_ringer_start_cb); - #endif - } - else if ( phlock_alarm ) - { - #ifdef FF_MIDI_RINGER - mfw_ringer_start(AS_RINGER_MODE_ALARM, TRUE, sounds_midi_ringer_start_cb); - #endif - } - } - -#endif // FF_PHONE_LOCK - break; case E_WIN_VISIBLE: @@ -928,25 +704,6 @@ { TRACE_EVENT("dialog_info_win_resize_cb: E_WIN_VISIBLE"); -#ifdef FF_PHONE_LOCK - if( phlock_alarm && phlock_alarm_win_handle ) - { - TRACE_EVENT("dialog_info_win_resize_cb: creating alarm kbd handler"); - data->info_kbd = kbd_create (phlock_alarm_win_handle, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); - } - if( ( call_data.call_direction == MFW_CM_MTC ) && ( phlock_dialog_mtc_win_handle ) ) - { - TRACE_EVENT("dialog_info_win_resize_cb: creating mtc kbd handler"); - data->info_kbd = kbd_create (phlock_dialog_mtc_win_handle, KEY_ALL, (T_MFW_CB)dialog_info_kbd_cb); - if(phlock_mtc_anim_time != 0) - { - data->animation_timer = timCreate(phlock_dialog_mtc_win_handle, phlock_mtc_anim_time, - (MfwCb)mmi_dialogs_animation_new_CB); - timStart(data->animation_timer); - } - } -#endif //FF_PHONE_LOCK - /* * Print the information dialog */ @@ -1752,923 +1509,3 @@ return info_dialog(win, &DisplayInfo); } - -//x0peela 02 Apr, 2007 ER: OMAPS00122561 -#ifdef FF_PHONE_LOCK -/******************************************************************************* - - $Function: phlock_info_dialog - - $Description: Common information dialog - - $Returns: Dialogue info win - - $Arguments: parent win, display info - -*******************************************************************************/ -T_MFW_HND phlock_info_dialog (T_MFW_HND parent_win, - T_DISPLAY_DATA * display_info) -{ - T_MFW_HND win; - TRACE_FUNCTION("phlock_info_dialog()"); - display_info->SoftKeyStrings = FALSE; - - win = phlock_dialog_info_create (parent_win); - - if (win NEQ NULL) - { - SEND_EVENT (win, DIALOG_INIT, 0, display_info); - } - return win; -} - -/******************************************************************************* - - $Function: phlock_dialog_info_create - - $Description: Creation of an information dialog - - $Returns: Dialogue info win - - $Arguments: parent win - -*******************************************************************************/ -static T_MFW_HND phlock_dialog_info_create (T_MFW_HND parent_win) -{ - T_MFW_WIN * win_data; - T_dialog_info * data = (T_dialog_info *)ALLOC_MEMORY (sizeof (T_dialog_info)); - TRACE_FUNCTION ("phlock_dialog_info_create()"); - - data->info_win = win_create (parent_win, 0, E_WIN_VISIBLE, (T_MFW_CB)phlock_dialog_info_win_resize_cb); - - if (data->info_win EQ 0) - return 0; - TRACE_EVENT_P1("phlock_dialog_info_create:data->info_win:%02x", data->info_win); - /* - * Create window handler - */ - data->mmi_control.dialog = (T_DIALOG_FUNC)phlock_dialog_info; - data->mmi_control.data = data; - data->parent_win = parent_win; - win_data = ((T_MFW_HDR *)data->info_win)->data; - win_data->user = (void *)data; - - /* - * return window handle - */ - return data->info_win; -} - -/******************************************************************************* - - $Function: phlock_dialog_info_win_resize_cb - - $Description: Creation of an information dialog - - $Returns: Dialogue info win - - $Arguments: parent win - -*******************************************************************************/ -static int phlock_dialog_info_win_resize_cb (T_MFW_EVENT event, T_MFW_WIN * win) -{ - T_dialog_info * data = (T_dialog_info *)win->user; -// T_DISPLAY_DATA * display_info; // RAVI - int xPos[MAX_DLG_LINES]; - int yPos[MAX_DLG_LINES]; - // Sep 06 2005 REF: MMI-SPR-33548 x0012849 - //The size of array str and strlen are increased by 1, so that the last elements holds data - // which is used while wrapping the text. - char* str[MAX_DLG_LINES+1]; - int strLen[MAX_DLG_LINES+1]; - int i; - char* lskStr,*rskStr; - int wx = 0; //,wy,sx=0,sy=0; // RAVI - int wy = 0; // RAVI - int sx = 0; // RAVI - int sy = 0; // RAVI - int fullScreen = DLG_USE_RECTANGLE; - int yOfs; - int yBmpOfs = 0; - MfwRect skArea; - //x0035544 Feb 15, 2006. DR:OMAPS00061467 -#ifdef FF_MMI_SAT_ICON - USHORT titleIconWidth = 0; -#endif - MfwRect area; - int scrWidth = 0; //available width for the display // RAVI - Assignment to 0. - // Sep 06 2005 REF: MMI-SPR-33548 x0012849 - // temp_ptr is used while wrapping the text. - // Now str2[][] is not required. - char *temp_ptr; - int nChar; - - /* t_font_bitmap bmp; */ /* Warning Removal - x0020906 - 24-08-2006 */ -// t_font_bitmap* bmpPtr = &bmp; // RAVI - Not Referenced. - - int drawWinType; - int nLines; - - int linePos=0; - int lineLen = 0; - int wrapLine = 0; /*GW #2294*/ // x0066814 06 Dec 2006, OMAPS00106825 - - const int charWidth = dspl_GetTextExtent("0",1); - TRACE_FUNCTION ("phlock_dialog_info_win_resize_cb()"); - - memset(str,'\0',sizeof(str)); /* x0039928 - Lint warning fix */ - memset(strLen,0,sizeof(strLen)); -//x0035544 Feb 15, 2006. DR:OMAPS00061467 -#ifdef FF_MMI_SAT_ICON - if (data->IconData.dst != NULL) - { - if (data->IconData.width > TITLE_ICON_WIDTH) - { - titleIconWidth = TITLE_ICON_WIDTH; - } - else - { - titleIconWidth = data->IconData.width ; - } - } - else - { - titleIconWidth = 0; - } - -#endif - if (data EQ 0) - return 1; - - switch (event) - { - case E_WIN_VISIBLE: - if (win->flags & E_WIN_VISIBLE) - { - /* - * Print the information dialog - */ - for (i=0;i<MAX_DLG_LINES;i++) - { - xPos[i]=0; - yPos[i] = Mmi_layout_line_height()*i; - str[i]=NULL; - strLen[i]=0; - } - // Sep 06 2005 REF: MMI-SPR-33548 x0012849 - // Assign the values to last elments of the array str and strLen - str[MAX_DLG_LINES] = NULL; - strLen[MAX_DLG_LINES] = 0; - yOfs = Mmi_layout_line_height()/4; - if (data->TextId != 0) - str[DLG_LINE1] = MmiRsrcGetText( data->TextId); - else - str[DLG_LINE1] = data->TextString; - - if (data->TextId2 != 0) - str[DLG_LINE2] = MmiRsrcGetText( data->TextId2); - else - str[DLG_LINE2] = data->TextString2; - - if (data->SoftKeyStrings!=0) - { - lskStr = data->LSKString; - rskStr = data->RSKString; - } - else - { - if (data->LeftSoftKey != TxtNull) - lskStr = MmiRsrcGetText(data->LeftSoftKey); - else - lskStr = NULL; - - if (data->RightSoftKey != TxtNull) - rskStr = MmiRsrcGetText(data->RightSoftKey); - else - rskStr = NULL; - } - - if ((str[DLG_LINE1]!= NULL) || (str[DLG_LINE2]!=NULL)) - { //Draw a window for status info - if (str[DLG_LINE2] == NULL) - { - sy = Mmi_layout_line_height()+yOfs*2; // 18 or 12 - - } - else - { - sy = Mmi_layout_line_height()*2+yOfs*3; // 33 or 22 - } - - //MC, if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE) - { //calculate longest string - use this to calc width of window - sx = 0; - if ((lskStr!=NULL) || (rskStr!=NULL)) - { - sy = sy+Mmi_layout_softkeyHeight()+yOfs*2; - sx = sx + 10; - if (lskStr != NULL) - { - sx = sx + dspl_GetTextExtent(lskStr, 0); - } - if (rskStr != NULL) - { - sx = sx + dspl_GetTextExtent(rskStr,0); - } - - } - for (i=DLG_LINE1;i<=DLG_LINE2;i++) - { - strLen[i] = dspl_GetTextExtent(str[i],0); - } - - /* Work out the desired width of the dialog. If we can wrap line 2 and it is long, wrap it */ - if (data->WrapStrings & WRAP_STRING_2) - nLines = MAX_WRAP_LINES; - else - nLines = 1; -#ifdef COLOURDISPLAY - if (data->dlgBgdBitmap!=NULL) - { - //we only have room to split line 2 into 'max_lines_dlg_popup' lines in the pop-up. - //NB this should be calculated depending on the height of the popup bitmap. - const int max_lines_dlg_popup=2; - if (nLines>max_lines_dlg_popup) - nLines = max_lines_dlg_popup; - scrWidth = (data->dlgBgdBitmap->area.sx * 3)/4; //the max width is about 3/4 of the pop-up - if ( (strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) || - (strLen[DLG_LINE1] > scrWidth)) - { - //recalculate width below. - if (data->WrapStrings & WRAP_STRING_2) - nLines = MAX_WRAP_LINES; - fullScreen = DLG_USE_RECTANGLE; - } - else - { - fullScreen = DLG_USE_BITMAP; - //Leave width as is - } - } -#else - //On a C-sample, limit pop-up lines to 2 extra (any more - use entire screen) - { - const int max_lines_dlg_popup=2; - if (nLines>max_lines_dlg_popup) - nLines = max_lines_dlg_popup; - } - -#endif - if (fullScreen == DLG_USE_RECTANGLE) - { - //see if we can display as a pop-up - if (SCREEN_SIZE_X < 128) - scrWidth = SCREEN_SIZE_X-6; - else - scrWidth = (SCREEN_SIZE_X*7)/8; - if ( strLen[DLG_LINE2] > (scrWidth-charWidth)*nLines) - { - //Cannot fit in as a pop-up - use full screen - fullScreen = DLG_USE_FULL_SCREEN; - scrWidth = SCREEN_SIZE_X; - } - else - { - //We can fit it in - but we may want to reduce the width for a nicer look. - } - } - - /* - * Wrap second text line (e.g. for long phone numbers.) - */ - if (strLen[DLG_LINE2] > scrWidth-charWidth) - { - //If we can fit the string on 2 lines - do it. - if (data->WrapStrings & WRAP_STRING_2) - { - if (str[DLG_LINE2][0] != (char)0x80) //not unicode /* x0039928 -Lint warning removal */ - { - wrapLine = 0; - lineLen = strlen(str[DLG_LINE2]); - // Sep 06 2005 REF: MMI-SPR-33548 x0012849 - // memset is not required any more . - //Now the last element of the str[] will point to the second string of the dialog - str[MAX_DLG_LINES] = str[DLG_LINE2]; // Now move the second line of text to the last element of the arrya - strLen[MAX_DLG_LINES] = strLen[DLG_LINE2];// put the right value for the length of the string - str[DLG_LINE2] = NULL ; // Assign NULL to the second element of the array. - while ((wrapLine < MAX_WRAP_LINES) && (linePos<lineLen)) - { - // Sep 06 2005 REF: MMI-SPR-33548 x0012849 - // Instead of DLG_LINE2 use MAX_DLG_LINES - nChar = dspl_GetNcharToFit (&str[MAX_DLG_LINES][linePos], (USHORT)scrWidth); - if (nChar > MAX_WRAP_CHAR) - nChar = MAX_WRAP_CHAR; - // Sep 06 2005 REF: MMI-SPR-33548 x0012849 - // Allocate MAX_WRAP_CHAR no of bytes - temp_ptr = (char*)mfwAlloc(MAX_WRAP_CHAR); - if(NULL == temp_ptr) - return 0; - // Sep 06 2005 REF: MMI-SPR-33548 x0012849 - // 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] - memcpy(temp_ptr,&str[MAX_DLG_LINES][linePos],nChar); // Now the source data is from the last element of the array. - linePos = linePos+nChar; - ////GW - even if we cannot display the entire string - it is better than what we would have otherwise - // Sep 06 2005 REF: MMI-SPR-33548 x0012849 - // Assign the value of pointer temp_ptr to str[] - str[DLG_LINE2+wrapLine] = temp_ptr; - temp_ptr = NULL; - strLen[DLG_LINE2 + wrapLine] = dspl_GetTextExtent(str[DLG_LINE2+wrapLine],0); - wrapLine++; - } - - } - else - { - //Unicode is more problematic - we need the 0x80 at the front of the string - //for the call to 'dspl_GetNcharToFit'. This will involve copying the entire remainder - //of 'str2' into a temporary buffer. At the moment, we only wrap numbers so this - //code will wait until it is required. - // str[3] = "Code not written!!"; //issue warning - // strLen[3] = dspl_GetTextExtent(str[3],0); - fullScreen = DLG_USE_FULL_SCREEN; //error - use full screen - } - } - } - - //Calculate longest line of text (including softkeys - sx already set to the softkey width) - for (i=0;i< MAX_DLG_LINES;i++) - { - if (strLen[i]>sx) - sx = strLen[i]; - } - if (sx > SCREEN_SIZE_X-charWidth) - sx = SCREEN_SIZE_X; - else - { - if (sx > SCREEN_SIZE_X/2) - sx = sx + charWidth; - else - sx = sx + charWidth*2; - } - if (sy> sx) - sx = sy; - wx = (SCREEN_SIZE_X-sx)/2; - if (wx<0) - wx=0; - } - - if (sy > SCREEN_SIZE_Y) - wy = 0; - else if (SCREEN_SIZE_Y > 2*sy) - wy = (SCREEN_SIZE_Y*2/3-sy)/2; //display in middle of top 2/3 of screen - else - wy = (SCREEN_SIZE_Y-sy)/2; //display in middle of screen - if (wy < 10) - wy = wy/2; - - if ((wx == 0) || (wy==0)) - { //not enough room to display as a window - use whole screen - fullScreen = DLG_USE_FULL_SCREEN; - } - -#ifdef COLOURDISPLAY - if ((data->icon_array != NULL) && (fullScreen != DLG_USE_BITMAP)) - { //The dialog has an animation - we must make the pop-up large enough to support this - if (sx < data->icon_array[0].area.sx) - sx = data->icon_array[0].area.sx; - yBmpOfs = data->icon_array[0].area.py + data->icon_array[0].area.sy; - wy = data->icon_array[0].area.py; - sy = sy + data->icon_array[0].area.sy; - } -#endif - } - else - { - //We have no strings to display - clear entire screen - fullScreen = DLG_USE_FULL_SCREEN; - } - - - /****************************** - * Draw window (full screen/pop-up) - *****************************/ - if (fullScreen != DLG_USE_FULL_SCREEN) - dspl_unfocusDisplay(); - area.px = 0; - area.py = 0; - area.sx = sx; - area.sy = sy; - resources_setColour(data->dlgCol); - drawWinType = DSPL_WIN_CENTRE; - - if (fullScreen!=DLG_USE_FULL_SCREEN) - { - t_font_bitmap bmp; - t_font_bitmap* bmpPtr = NULL; - - for (i=0;i<MAX_DLG_LINES;i++) - { - //centre text - xPos[i] = wx+(sx-strLen[i])/2; - yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; - } - -#ifdef COLOURDISPLAY - if ((data->dlgBgdBitmap != NULL) && (fullScreen==DLG_USE_BITMAP)) - { - bmp.format = data->dlgBgdBitmap->icnType; - bmp.height = data->dlgBgdBitmap->area.sy; - bmp.width = data->dlgBgdBitmap->area.sx; - bmp.bitmap = data->dlgBgdBitmap->icons; - bmpPtr = &bmp; - area = calcLayout(data->dlgType, sx, sy, bmp.width, bmp.height); - - //Adjust size of available area depending on bitmap properties/dlgType. - //dlgType== 0 =>display info in centre of bitmap - if (data->dlgType == 0) - { - //If the bmp is bigger than the data we will move the bmp to - //lie over the centre of the data - area.px = area.px - (bmp.width - sx)/2; - area.py = area.py - (bmp.height- sy)/2; - } - for (i=0;i<MAX_DLG_LINES;i++) - { - xPos[i] = xPos[i] + area.px; - yPos[i] = yPos[i] + area.py; - } - - TRACE_EVENT_P3("wy = %d, yOfs = %d, area.py = %d",wy,yOfs,area.py); - if( data->dlgBgdBitmap->icnType != ICON_TYPE_1BIT_UNPACKED ) - dspl_SetBgdColour( COL_TRANSPARENT ); - - - } - else - { - // x0066814 06 Dec 2006, OMAPS00106825 - //The window height calculation related to wrapping should be skipped when no - //string wrapping is done - if(wrapLine>0) - { - sy = sy + (wrapLine-1)*Mmi_layout_line_height(); - } - area.sy = sy; - } -#else - if (wrapLine>1) - { - sy = sy + (wrapLine-1)*Mmi_layout_line_height(); - area.sy = sy; - } -#endif - // Sep 06 2005 REF: MMI-SPR-33548 x0012849 - //If length of the dialog is bigger than screen then start the dialog from the top corner. - if(sy+wy >= SCREEN_SIZE_Y && sy < SCREEN_SIZE_Y) - if(wy>0 && wy < sy) - { - wy = (SCREEN_SIZE_Y - sy ) /2 ;// centre the dialog - if(wy < 0) - wy=0; - for (i=0;i<MAX_DLG_LINES;i++) - yPos[i] = wy+yOfs+yBmpOfs+Mmi_layout_line_height()*i; - } - dspl_DrawWin( wx,wy,sx,sy, drawWinType , bmpPtr); - } - else - { - dspl_ClearAll(); - sx = 84; - for (i=0;i<MAX_DLG_LINES;i++) - { - xPos[i] = 0; - yPos[i] = Mmi_layout_line(i+1); - } - } - /****************************** - * Print softkeys - *****************************/ - icnShow(data->icon); - if ((lskStr != NULL) || (rskStr != NULL)) - { - if (fullScreen==DLG_USE_FULL_SCREEN) - Mmi_layout_softkeyArea( &skArea ); - else - { - skArea.px = area.px+wx; - skArea.sx = area.sx; - skArea.py = area.py+wy+area.sy-Mmi_layout_softkeyHeight()-1; - skArea.sy = Mmi_layout_softkeyHeight(); - } - softKeys_displayStrXY(lskStr, rskStr, data->dlgSkFormat, data->dlgCol, &skArea); - } - - /****************************** - * Print dialog text - *****************************/ - for (i=0;i<MAX_DLG_LINES;i++) - { /* GW#2294 No need to draw zero length strings .*/ - if ((str[i] != NULL) && (strLen[i] > 0)) - { - //x0035544 Feb 15, 2006. DR:OMAPS00061467 - #ifdef FF_MMI_SAT_ICON - if(data->IconData.selfExplanatory == FALSE) - dspl_TextOut(xPos[i] + titleIconWidth, yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); - #else - dspl_TextOut(xPos[i] , yPos[i], DSPL_TXTATTR_NORMAL, str[i] ); - #endif - } - } - //x0035544 Feb 15, 2006. DR:OMAPS00061467 - #ifdef FF_MMI_SAT_ICON - if(data->IconData.dst != NULL) - { - if(str[DLG_LINE2] == NULL) - { - if ((data->IconData.width > TITLE_ICON_WIDTH) || - (data->IconData.height > TITLE_ICON_HEIGHT)) - { - dspl_BitBlt2(xPos[0], yPos[0], 8, - 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); - } - - else - dspl_BitBlt2(xPos[0], yPos[0], data->IconData.width, - data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); - } - else - { - if ((data->IconData.width > TITLE_ICON_WIDTH) || - (data->IconData.height > TITLE_ICON_HEIGHT)) - { - dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2], 8, - 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); - } - else - dspl_BitBlt2(xPos[DLG_LINE2], yPos[DLG_LINE2],data->IconData.width, - data->IconData.height, (void*)data->IconData.dst, 0, BMP_FORMAT_256_COLOUR); - } - - } - #endif - - - resources_restoreColour(); - } - - // Sep 06 2005 REF: MMI-SPR-33548 x0012849 - // Now free the allocated memory - /* x0039928 - Lint warning removal */ - if (strLen[MAX_DLG_LINES] > scrWidth-charWidth) - if (data->WrapStrings & WRAP_STRING_2) - if (str[MAX_DLG_LINES][0] != (char)0x80) /* x0039928 - lint warning removal */ - { - for(i=DLG_LINE2;i<MAX_DLG_LINES;i++) - { - if(NULL != str[i] && strLen[i] > 0) - mfwFree((U8*)str[i],MAX_WRAP_CHAR); - } - str[MAX_DLG_LINES]=NULL; - } - - break; - - default: - return 0; - } - - return 1; -} - -/******************************************************************************* - - $Function: phlock_dialog_info - - $Description: Dialog function for information dialog - - $Returns: void - - $Arguments: win, window handle event, value, parameter - -*******************************************************************************/ -void phlock_dialog_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; - T_dialog_info * data = (T_dialog_info *)win_data->user; - T_DISPLAY_DATA * display_info = (T_DISPLAY_DATA *)parameter; - TRACE_FUNCTION ("phlock_dialog_info()"); - - switch (event) - { - case DIALOG_INIT: - /* - * Initialize dialog - */ -#if defined (WIN32) - { - /***************************Go-lite Optimization changes Start***********************/ - - //Aug 16, 2004 REF: CRR 24323 Deepa M.D - TRACE_EVENT_P1( "Identifier %d", display_info->Identifier); - /***************************Go-lite Optimization changes end***********************/ - - } -#endif - /* - * Create timer and keyboard handler - */ - data->info_tim = tim_create (win, display_info->Time, (T_MFW_CB)phlock_dialog_info_tim_cb); - data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)phlock_dialog_info_kbd_cb); - data->info_kbd_long = kbd_create(win,KEY_ALL|KEY_LONG,(MfwCb)phlock_dialog_info_kbd_long_cb); - - /* - * Store any other data - */ - data->KeyEvents = display_info->KeyEvents; - data->TextString = display_info->TextString; - data->LeftSoftKey = display_info->LeftSoftKey; - data->RightSoftKey = display_info->RightSoftKey; - data->SoftKeyStrings = display_info->SoftKeyStrings; // SH - TRUE if using strings rather than IDs - data->LSKString = display_info->LSKString; // Text for left soft key - data->RSKString = display_info->RSKString; // Text for right soft key - data->TextId = display_info->TextId; - data->Identifier = display_info->Identifier; - data->Callback = display_info->Callback; - data->TextString2 = display_info->TextString2; - data->TextId2 = display_info->TextId2; - data->WrapStrings = display_info->WrapStrings; //GW-SPR#762 - - data->dlgCol = display_info->displayCol; - data->dlgType = display_info->dlgType; - data->dlgBgdBitmap = display_info->bgdBitmap; - data->dlgSkFormat = 0; - data->current_frame = display_info->current_frame; - data->number_of_frames = display_info->number_of_frames; - data->icon_array = (MfwIcnAttr*)display_info->icon_array; - data->animation_timer = 0; -//x0035544 Feb 07, 2006 DR:OMAPS00061467 -#ifdef FF_MMI_SAT_ICON - if(display_info->IconData.dst != NULL) - { - data->IconData.width = display_info->IconData.width; - data->IconData.height = display_info->IconData.height; - data->IconData.dst = display_info->IconData.dst; - data->IconData.selfExplanatory = display_info->IconData.selfExplanatory; - } - else - { - data->IconData.dst = NULL; - data->IconData.selfExplanatory = FALSE; - data->IconData.width =0; - data->IconData.height =0; - } -#endif - - TRACE_EVENT_P1("anim_time = %d", display_info->anim_time); - TRACE_EVENT_P1("data->anim_time = %d", data->anim_time); -if(display_info->anim_time != 0) - { - data->animation_timer = timCreate(win,display_info->anim_time,(MfwCb)mmi_dialogs_animation_new_CB); - timStart(data->animation_timer); - } - - if (display_info->Time NEQ FOREVER) - tim_start (data->info_tim); - win_show (win); - - break; - - case DIALOG_DESTROY: - phlock_dialog_info_destroy(win); - break; - } -} - -/******************************************************************************* - - $Function: phlock_dialog_info_tim_cb - - $Description: Callback function for the dialog info timer. - - - $Returns: MFW event handler - - $Arguments: window handle event, timer control block - -*******************************************************************************/ -static T_MFW_CB phlock_dialog_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc) -{ - T_MFW_HND win = mfw_parent (mfw_header()); - T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; - T_dialog_info * data = (T_dialog_info *)win_data->user; - - T_MFW_HND parent_win = data->parent_win; - USHORT Identifier = data->Identifier; - void (* Callback)() = data->Callback; - - TRACE_FUNCTION("phlock_dialog_info_tim_cb()"); -#if defined (WIN32) - { - /***************************Go-lite Optimization changes Start***********************/ - - //Aug 16, 2004 REF: CRR 24323 Deepa M.D - TRACE_EVENT_P1 ("Identifier %d", data->Identifier);); - /***************************Go-lite Optimization changes end***********************/ - - } -#endif - -#ifdef FF_PHONE_LOCK - TRACE_EVENT("Bef. destroy"); - TRACE_EVENT_P1("phlock_dialog_info_tim_cb: win: %02x", win); - -#endif //FF_PHONE_LOCK - /* - ** SPR#1744 NDH - ** Move the dialog destory in front of the Callback to make the processing consistent - ** with the Right Keypress and Hangup Processing. Also to ensure that the dialog is - ** removed when the screen is redrawn. - */ - - TRACE_EVENT("phlock_dialog_info_tim_cb: Bef dialog_info_destrroy"); - phlock_dialog_info_destroy (win); - - #ifdef FF_PHONE_LOCK - TRACE_EVENT("Aft. destroy"); - TRACE_EVENT_P1("phlock_dialog_info_tim_cb: win: %02x", win); - #endif //FF_PHONE_LOCK - - if (Callback) - (Callback) (parent_win, Identifier, INFO_TIMEOUT); - - return 0; -} - -/******************************************************************************* - - $Function: phlock_dialog_info_kbd_cb - - $Description: Keyboard event handler - - $Returns: status int - - $Arguments: window handle event, keyboard control block - -*******************************************************************************/ - -static int phlock_dialog_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard) -{ - T_MFW_HND win = mfw_parent (mfw_header()); - T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; - T_dialog_info * data = (T_dialog_info *)win_data->user; - T_MFW_HND parent_win = data->parent_win; - USHORT Identifier = data->Identifier; - void (* Callback)() = data->Callback; - - TRACE_FUNCTION("phlock_dialog_info_kbd_cb"); - - switch (keyboard->code) - { - case KCD_LEFT: - if (data->KeyEvents & KEY_LEFT ) - { - phlock_dialog_info_destroy (win); - if (Callback) - (Callback) (parent_win, Identifier, INFO_KCD_LEFT); - } - break; - - case KCD_RIGHT: - if (data->KeyEvents & KEY_RIGHT) - { - phlock_dialog_info_destroy (win); - if (Callback) - (Callback) (parent_win, Identifier, INFO_KCD_RIGHT); - } - break; - - case KCD_HUP: - if (data->KeyEvents & KEY_HUP || data->KeyEvents & INFO_KCD_ALL) - { - phlock_dialog_info_destroy (win); - if (Callback) - (Callback) (parent_win, Identifier, INFO_KCD_HUP); - } - break; - case KCD_MNUUP: - - if (data->KeyEvents & KEY_MNUUP) - { - if (Callback) - (Callback) (parent_win, Identifier, INFO_KCD_UP); - } - - break; - case KCD_MNUDOWN: - - if (data->KeyEvents & KEY_MNUDOWN) - { - if (Callback) - (Callback) (parent_win, Identifier, INFO_KCD_DOWN); - } - - break; - //MZ 7/3/01 used to start a call. - case KCD_CALL: - if (data->KeyEvents & KEY_CALL ) - { - phlock_dialog_info_destroy (win); - if (Callback) - (Callback) (parent_win, Identifier, INFO_KCD_OFFHOOK); - } - break; - default: - if (data->KeyEvents & INFO_KCD_ALL) - { - /* - Note: The variable Identifier is overwritten with the - keycode of the dialog; - we need it only for the Multicall Control !! - */ - Identifier = keyboard->code; - phlock_dialog_info_destroy (win); - if (Callback) - (Callback) (parent_win, Identifier, INFO_KCD_ALL); - } - break; - - } - return MFW_EVENT_CONSUMED; -} - -/******************************************************************************* - - $Function: phlock_dialog_info_kbd_long_cb - - $Description: Keyboard event handler - - $Returns: status int - - $Arguments: window handle event, keyboard control block - -*******************************************************************************/ -static int phlock_dialog_info_kbd_long_cb(T_MFW_EVENT event, T_MFW_KBD *keyboard) -{ -TRACE_FUNCTION("dialog_info_kbd_long_cb()"); - return MFW_EVENT_CONSUMED; -} - -/******************************************************************************* - - $Function: phlock_dialog_info_destroy - - $Description: Destruction of an information dialog - - $Returns: void - - $Arguments: win - -*******************************************************************************/ -void phlock_dialog_info_destroy (T_MFW_HND own_window) -{ - T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data; - T_dialog_info * data = (T_dialog_info *)win->user; - - TRACE_FUNCTION ("phlock_dialog_info_destroy()"); - - if (own_window == NULL) - { - TRACE_EVENT ("Error :- Called with NULL Pointer"); - return; - } - - if (data) - { - /* - * Exit TIMER & KEYBOARD Handle - */ - kbd_delete (data->info_kbd); - tim_delete (data->info_tim); - - if(data->animation_timer != 0) - { - timDelete(data->animation_timer); - - if (data->icon != 0) - icnDelete(data->icon); - } - - /* - * Delete WIN Handler - */ - TRACE_EVENT_P1("phlock_dialog_info_destroy: deleting:data->info_win:%02x",data->info_win); - - win_delete (data->info_win); - /* - * Free Memory - */ - FREE_MEMORY ((void *)data, sizeof (T_dialog_info)); - } -} -#endif //FF_PHONE_LOCK -