# HG changeset patch # User Mychaela Falconia # Date 1605766404 0 # Node ID d715ee7265266140b29905ed17d6709923b7b7cd # Parent 6b740edabc07528e1e93ef3a66cfe6a7c84179b6 mmiSatMenu.c: bogotab fixes diff -r 6b740edabc07 -r d715ee726526 src/ui/bmi/mmiSatMenu.c --- a/src/ui/bmi/mmiSatMenu.c Wed Nov 18 23:58:07 2020 +0000 +++ b/src/ui/bmi/mmiSatMenu.c Thu Nov 19 06:13:24 2020 +0000 @@ -1,7 +1,6 @@ - /******************************************************************************* - CONDAT (UK) + CONDAT (UK) ******************************************************************************** @@ -12,12 +11,12 @@ $Project name: Basic MMI $Project code: BMI (6349) - $Module: MMI - $File: MmiSatMenu.c - $Revision: 1.0 + $Module: MMI + $File: MmiSatMenu.c + $Revision: 1.0 - $Author: Condat(UK) - $Date: 25/10/00 + $Author: Condat(UK) + $Date: 25/10/00 ******************************************************************************** @@ -30,8 +29,6 @@ $History: MmiSatMenu.c - - Jun 06, 2006 DR: OMAPS00080543 - xreddymn Description: Default item is not being highlighted for SELECT ITEM command. Solution: Change list menu highlight index based on the default item provided @@ -62,14 +59,13 @@ Bug:Clenup of sprintf used for tracing Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX - 25/10/00 Original Condat(UK) BMI version. + 25/10/00 Original Condat(UK) BMI version. $End *******************************************************************************/ - /******************************************************************************* Include Files @@ -102,7 +98,6 @@ #include "prim.h" - #include "mfw_mfw.h" #include "mfw_win.h" #include "mfw_kbd.h" @@ -176,7 +171,7 @@ T_MMI_CONTROL mmi_control; T_MFW_HND win; - T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */ + T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */ /* associated handlers */ @@ -206,7 +201,6 @@ COLOUR_LIST_XX, TxtNull, NULL, MNUATTRSPARE, /* 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ TRUE - }; static MfwMnuAttr sat_select_menuAttrib = @@ -239,12 +233,12 @@ T_MFW_HND win; TRACE_FUNCTION ("sat_setup_menu_start()"); - /***************************Go-lite Optimization changes Start***********************/ - //Aug 16, 2004 REF: CRR 24323 Deepa M.D - TRACE_EVENT_P1("MFW Memory Left after starting SAT %d",mfwCheckMemoryLeft()); - /***************************Go-lite Optimization changes end***********************/ + /***************************Go-lite Optimization changes Start***********************/ + //Aug 16, 2004 REF: CRR 24323 Deepa M.D + TRACE_EVENT_P1("MFW Memory Left after starting SAT %d",mfwCheckMemoryLeft()); + /***************************Go-lite Optimization changes end***********************/ - win = sat_setup_menu_create (NULL); + win = sat_setup_menu_create (NULL); if (win NEQ NULL) { @@ -281,14 +275,13 @@ win = ((T_MFW_HDR *)data->win)->data; win->user = (MfwUserDataPtr)data; - data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ + data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ /* * return window handle */ - - g_SATsession_is_active = TRUE; + g_SATsession_is_active = TRUE; win_show(data->win); return data->win; @@ -388,15 +381,15 @@ int i; SatMenu * menu = &data->sat_command->c.menu; int Unicode_menu = FALSE; /*MC, SPR 940/2flag to lay-out as Unicode*/ - T_MFW retVal; + T_MFW retVal; // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 #ifdef FF_MMI_SAT_ICON - USHORT icon_length; - USHORT fontHeight = 0, menuHeight = 0, titleHeight; + USHORT icon_length; + USHORT fontHeight = 0, menuHeight = 0, titleHeight; #endif - TRACE_EVENT ("sat_setup_menu_recreate()"); + TRACE_EVENT ("sat_setup_menu_recreate()"); #ifdef __COMPLETE_LIST_SUPPORT__ /* ??? rsa for future extension */ if ((&data->sat_command.qual & SAT_M_SETUP_HELP_AVAIL) NEQ 0) @@ -504,7 +497,7 @@ /* SPR#2492 - DS - Setup menu header */ if (menu->header.len > 0 && menu->header.len != 0xFF) - { + { if (menuHdr) /* Free previously allocated header */ { TRACE_EVENT_P2("Destroy menuHdr %d with size %d", menuHdr, *(menuHdr -(U16)sizeof(U16)) ); @@ -603,12 +596,12 @@ displayHelpSymbol(); } if (retVal != LISTS_FAIL) - sat_set_setup_menu_listmnu_win(data->list_menu_data.win); + sat_set_setup_menu_listmnu_win(data->list_menu_data.win); else - sat_set_setup_menu_listmnu_win(NULL); + sat_set_setup_menu_listmnu_win(NULL); - return retVal; - } + return retVal; +} static void sat_setup_menu_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command) /* callback handler for events sent from parents or childs to to trigger some execution */ @@ -617,8 +610,6 @@ T_sat_setup_menu * data = (T_sat_setup_menu *)win_data->user; T_SAT_RES sat_res; - - TRACE_FUNCTION ("sat_setup_menu_exec()"); switch (event) @@ -637,14 +628,14 @@ data->list_menu_data.Font = 0; data->list_menu_data.LeftSoftKey = TxtSoftSelect; data->list_menu_data.RightSoftKey = TxtSoftBack; - // xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 + // xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 //Adding the support for MenuSelect in this list view data->list_menu_data.KeyEvents = KEY_CLEAR | KEY_RIGHT | KEY_LEFT | KEY_MNUSELECT| KEY_MNULEFT| KEY_MNUUP | KEY_MNUDOWN |KEY_HUP; data->list_menu_data.Reason = 0; data->list_menu_data.Strings = TRUE; data->list_menu_data.Attr = &sat_setup_menuAttrib; data->list_menu_data.List = NULL; /* c030 rsa mark as first time creation */ - data->list_menu_data.autoDestroy = TRUE; + data->list_menu_data.autoDestroy = TRUE; // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 #ifdef FF_MMI_SAT_ICON @@ -668,7 +659,7 @@ // end c030 rsa if (sat_get_setup_menu_listmnu_win() == NULL) - { + { /* (re)create the dialog handler */ if (sat_setup_menu_recreate(data) == LISTS_FAIL) { @@ -677,11 +668,11 @@ sat_done (sat_command, sat_res); sat_setup_menu_destroy (data->win); } - } - break; + } + break; - /* sbh - all window types are being provided with this event to destroy the window */ - case SAT_DESTROY_WINDOW: + /* sbh - all window types are being provided with this event to destroy the window */ + case SAT_DESTROY_WINDOW: /* ...sbh */ case SAT_EXIT: @@ -705,13 +696,13 @@ TRACE_FUNCTION ("sat_setup_menu_listmnu_cb()"); - if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL)) - return; + if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL)) + return; switch (ListData->Reason) { case E_MNU_SELECT: - case LISTS_REASON_SELECT: + case LISTS_REASON_SELECT: index = ListData->ListPosition; /* index of selected item */ item = &data->sat_command->c.menu.items[index]; /* selected item */ @@ -734,7 +725,7 @@ break; case LISTS_REASON_TIMEOUT: // c015 rsa case LISTS_REASON_BACK: /* back to previous menu */ - case LISTS_REASON_HANGUP: // sbh - added so hangup key exits + case LISTS_REASON_HANGUP: // sbh - added so hangup key exits case LISTS_REASON_CLEAR: /* @@ -772,13 +763,13 @@ /* associated handlers */ - T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */ + T_MFW_HND kbd; /* sbh - keyboard handler, so window can be destroyed by user */ /* internal data */ T_SAT_CMD *sat_command; /* pointer to sat_command in parent */ ListMenuData_t list_menu_data; T_MFW_HND sat_timer; // May 24, 2005 REF: CRR 29358 x0021334 - ULONG sat_timeout; // May 24, 2005 REF: CRR 29358 x0021334 + ULONG sat_timeout; // May 24, 2005 REF: CRR 29358 x0021334 } T_sat_select_item; static void sat_select_item_destroy (T_MFW_HND window); @@ -820,13 +811,12 @@ win = ((T_MFW_HDR *)data->win)->data; win->user = (MfwUserDataPtr)data; - data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ + data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ /* * return window handle */ - win_show(data->win); return data->win; } @@ -919,7 +909,7 @@ static T_MFW sat_select_item_recreate(T_sat_select_item *data) { - int i; + int i; int Unicode_menu = FALSE; /*MC, SPR 940/2 flag to lay-out as Unicode*/ //May 24, 2005 REF: CRR 29358 x0021334 // Added this variable to store return value from listDisplayListMenu @@ -945,7 +935,7 @@ } #endif - /* allocate sufficient memory to hold the list of menu items */ + /* allocate sufficient memory to hold the list of menu items */ data->list_menu_data.ListLength = menu->nItems; /* actual number of entries in list menu. */ data->list_menu_data.List = (MfwMnuItem *)ALLOC_MEMORY (data->list_menu_data.ListLength * sizeof (MfwMnuItem)); memset(data->list_menu_data.List, 0x00, data->list_menu_data.ListLength * sizeof (MfwMnuItem)); @@ -996,7 +986,7 @@ for (i=0; i < data->list_menu_data.ListLength; i++) /* Fill Menu List */ { - mnuInitDataItem(&data->list_menu_data.List[i]); + mnuInitDataItem(&data->list_menu_data.List[i]); // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 #ifdef FF_MMI_SAT_ICON @@ -1044,22 +1034,22 @@ /* SPR#2492 - DS - Setup menu header */ if (menu->header.len > 0 && menu->header.len != 0xFF) - { + { if (menuHdr) /* Free previously allocated header */ { - TRACE_EVENT_P2("Destroy menuHdr %d with size %d", menuHdr, *(menuHdr -(U16)sizeof(U16)) ); + TRACE_EVENT_P2("Destroy menuHdr %d with size %d", menuHdr, *(menuHdr -(U16)sizeof(U16)) ); // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 #ifdef FF_MMI_SAT_ICON - /* Free the memory allocated for Header icon data. */ - if(selectItemHeaderIconData.dst != NULL) - { + /* Free the memory allocated for Header icon data. */ + if(selectItemHeaderIconData.dst != NULL) + { FREE_MEMORY((U8 *)selectItemHeaderIconData.dst, selectItemHeaderIconData.width * - selectItemHeaderIconData.height); + selectItemHeaderIconData.height); selectItemHeaderIconData.dst = NULL; - } + } #endif - sat_destroy_TEXT_ASCIIZ(menuHdr); - menuHdr = NULL; /* dsm 01/12/03 - Added to explicitly set menuHdr to NULL */ + sat_destroy_TEXT_ASCIIZ(menuHdr); + menuHdr = NULL; /* dsm 01/12/03 - Added to explicitly set menuHdr to NULL */ } // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 @@ -1099,7 +1089,6 @@ } #endif - menuHdr = sat_create_TEXT_ASCIIZ(&menu->header); TRACE_EVENT_P1("SAT menu header: %s", menuHdr); @@ -1147,7 +1136,7 @@ } tim_start(data->sat_timer); return sat_select_item_status; - } +} static void sat_select_item_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command) /* callback handler for events sent from parents or childs to to trigger some execution */ @@ -1176,14 +1165,14 @@ data->list_menu_data.Reason = 0; data->list_menu_data.Strings = TRUE; data->list_menu_data.Attr = &sat_select_menuAttrib; - data->list_menu_data.autoDestroy = TRUE; + data->list_menu_data.autoDestroy = TRUE; - // May 24, 2005 REF: CRR 29358 x0021334 - // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response - // Fix: Set Timeout period to 20 seconds and create the timer. - data->sat_timeout = TWENTY_SECS; - data->sat_timer = tim_create(data->win, data->sat_timeout, (T_MFW_CB)sat_select_TimerCb); - g_sat_scroll_status = TRUE; + // May 24, 2005 REF: CRR 29358 x0021334 + // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response + // Fix: Set Timeout period to 20 seconds and create the timer. + data->sat_timeout = TWENTY_SECS; + data->sat_timer = tim_create(data->win, data->sat_timeout, (T_MFW_CB)sat_select_TimerCb); + g_sat_scroll_status = TRUE; // Shashi Shekar B.S., a0876501, Feb 4, 2006, DR: OMAPS00061462 #ifdef FF_MMI_SAT_ICON @@ -1212,39 +1201,39 @@ } break; - /* sbh - all window types are being provided with this event to destroy the window */ - case SAT_DESTROY_WINDOW: - // May 24, 2005 REF: CRR 29358 x0021334 - // Delete the timer and set g_sat_scroll_status to FALSE. - tim_delete (data->sat_timer); - g_sat_scroll_status = FALSE; - sat_select_item_destroy (data->win); - break; + /* sbh - all window types are being provided with this event to destroy the window */ + case SAT_DESTROY_WINDOW: + // May 24, 2005 REF: CRR 29358 x0021334 + // Delete the timer and set g_sat_scroll_status to FALSE. + tim_delete (data->sat_timer); + g_sat_scroll_status = FALSE; + sat_select_item_destroy (data->win); + break; /* ...sbh */ - // May 24, 2005 REF: CRR 29358 x0021334 - // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response - // Fix: Timeout has occured. Used existing LISTS_REASON_TIMEOUT event for the same - case LISTS_REASON_TIMEOUT: - sat_res[SAT_ERR_INDEX] = SAT_RES_USER_NO_RESP; // set no response from user - sat_res[SAT_AI_INDEX] = SatResAiNoCause; - sat_done (data->sat_command, sat_res); - tim_stop(data->sat_timer); // stop the timer - tim_delete(data->sat_timer); // delete the timer - g_sat_scroll_status = FALSE; // set scrolling status to FALSE - sat_select_item_destroy(data->win); - break; + // May 24, 2005 REF: CRR 29358 x0021334 + // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response + // Fix: Timeout has occured. Used existing LISTS_REASON_TIMEOUT event for the same + case LISTS_REASON_TIMEOUT: + sat_res[SAT_ERR_INDEX] = SAT_RES_USER_NO_RESP; // set no response from user + sat_res[SAT_AI_INDEX] = SatResAiNoCause; + sat_done (data->sat_command, sat_res); + tim_stop(data->sat_timer); // stop the timer + tim_delete(data->sat_timer); // delete the timer + g_sat_scroll_status = FALSE; // set scrolling status to FALSE + sat_select_item_destroy(data->win); + break; - // May 24, 2005 REF: CRR 29358 x0021334 - // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response - // Fix: User has scrolled up/down. Used existing LISTS_REASON_SCROLL event for the same - case LISTS_REASON_SCROLL: - tim_stop(data->sat_timer); // stop the timer - tim_start(data->sat_timer); // start the timer again for 20 seconds - break; - default: - TRACE_EVENT ("sim_select_item_exec() unexpected event"); - break; + // May 24, 2005 REF: CRR 29358 x0021334 + // Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response + // Fix: User has scrolled up/down. Used existing LISTS_REASON_SCROLL event for the same + case LISTS_REASON_SCROLL: + tim_stop(data->sat_timer); // stop the timer + tim_start(data->sat_timer); // start the timer again for 20 seconds + break; + default: + TRACE_EVENT ("sim_select_item_exec() unexpected event"); + break; } } @@ -1257,21 +1246,21 @@ int index; T_SAT_RES sat_res; - if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL)) - return; + if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL)) + return; TRACE_FUNCTION ("sat_select_item_listmnu_cb()"); switch (ListData->Reason) { case E_MNU_SELECT: - case LISTS_REASON_SELECT: + case LISTS_REASON_SELECT: index = ListData->ListPosition; /* index of selected item */ item = &data->sat_command->c.menu.items[index]; /* selected item */ /* CQ 16307 - Start */ if (data->sat_command->c.menu.itemIconQual == 0xFF) sat_res[SAT_ERR_INDEX] = SatResSuccess; - else + else { // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 #ifdef FF_MMI_SAT_ICON @@ -1282,7 +1271,6 @@ #endif } - // xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 // Using the MenuSelect Key for requesting the help info in STK menu. if(ListData->selectKey && ((data->sat_command->qual & SAT_M_SELECT_HELP_AVAIL) != 0)) @@ -1290,16 +1278,15 @@ sat_res[SAT_ERR_INDEX] = SatResUserHelp; ListData->selectKey = FALSE; } - sat_res[SAT_AI_INDEX] = SatResAiNoCause; - satItem (data->sat_command, item->id, sat_res, sizeof(T_SAT_RES)); /* issue the answering envelope */ - + sat_res[SAT_AI_INDEX] = SatResAiNoCause; + satItem (data->sat_command, item->id, sat_res, sizeof(T_SAT_RES)); /* issue the answering envelope */ - // May 24, 2005 REF: CRR 29358 x0021334 - // Stop and delete the timer. Also, set scrolling status to FALSE - tim_stop(data->sat_timer); - tim_delete(data->sat_timer); - g_sat_scroll_status = FALSE; - sat_select_item_destroy(data->win); + // May 24, 2005 REF: CRR 29358 x0021334 + // Stop and delete the timer. Also, set scrolling status to FALSE + tim_stop(data->sat_timer); + tim_delete(data->sat_timer); + g_sat_scroll_status = FALSE; + sat_select_item_destroy(data->win); break; // c015 rsa case LISTS_REASON_TIMEOUT: @@ -1321,12 +1308,12 @@ sat_res[SAT_AI_INDEX] = SatResAiNoCause; sat_done (data->sat_command, sat_res); - // May 24, 2005 REF: CRR 29358 x0021334 - // Stop and delete the timer. Also, set scrolling status to FALSE - tim_stop(data->sat_timer); - tim_delete(data->sat_timer); - g_sat_scroll_status = FALSE; - sat_select_item_destroy(data->win); + // May 24, 2005 REF: CRR 29358 x0021334 + // Stop and delete the timer. Also, set scrolling status to FALSE + tim_stop(data->sat_timer); + tim_delete(data->sat_timer); + g_sat_scroll_status = FALSE; + sat_select_item_destroy(data->win); break; default: return; @@ -1340,9 +1327,9 @@ // Fix: This is the call back function for sat timer static int sat_select_TimerCb (T_MFW_EVENT event, T_MFW_TIM *timer) { - T_MFW_HND win = mfw_parent (mfw_header()); - T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; - T_sat_select_item *data = (T_sat_select_item *)win_data->user; + T_MFW_HND win = mfw_parent (mfw_header()); + T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; + T_sat_select_item *data = (T_sat_select_item *)win_data->user; TRACE_FUNCTION("sat_select_TimerCb()"); @@ -1350,7 +1337,7 @@ listsDestroy(data->list_menu_data.win); // Send timeout event. SEND_EVENT (data->win, LISTS_REASON_TIMEOUT, NULL, NULL); - return MFW_EVENT_CONSUMED; + return MFW_EVENT_CONSUMED; } // May 24, 2005 REF: CRR 29358 x0021334 @@ -1358,5 +1345,5 @@ // Fix: This function returns the status of scrolling, which is used for restarting the timer BOOL getScrollStatus() { - return g_sat_scroll_status; + return g_sat_scroll_status; }