# HG changeset patch # User Mychaela Falconia # Date 1605556148 0 # Node ID 65f0ce5bd32ff52aa065b78667fd277012a5301f # Parent 8129ee8ee6c29b52cdd5f7f1943d8fc15a35eb03 mmiLists.c: bogotab fixes diff -r 8129ee8ee6c2 -r 65f0ce5bd32f src/ui/bmi/mmiLists.c --- a/src/ui/bmi/mmiLists.c Mon Nov 16 07:07:46 2020 +0000 +++ b/src/ui/bmi/mmiLists.c Mon Nov 16 19:49:08 2020 +0000 @@ -1,6 +1,6 @@ /******************************************************************************* - CONDAT (UK) + CONDAT (UK) ******************************************************************************** @@ -9,21 +9,20 @@ ******************************************************************************** - $Project name: Basic MMI - $Project code: BMI (6349) - $Module: MMI - $File: MmiLists.c - $Revision: 1.0 + $Project name: Basic MMI + $Project code: BMI (6349) + $Module: MMI + $File: MmiLists.c + $Revision: 1.0 - $Author: Condat(UK) - $Date: 22/02/01 + $Author: Condat(UK) + $Date: 22/02/01 ******************************************************************************** Description: - ******************************************************************************** $History: MmiLists.c @@ -36,44 +35,44 @@ Description: COMBO: No melody heard on parsing over different volums in tones menu Solution: E_MELODY_START event is sent to play the melody. - xrashmic 8 Sep 2006, OMAPS00091618 - Removed redundant code introduced during integration + xrashmic 8 Sep 2006, OMAPS00091618 + Removed redundant code introduced during integration June 19, 2006 REF: DRT OMAPS00076378 x0012849 : Jagannatha Description: MIDI files should play while browsing Solution: Event will be generated upon press of Menu up and down key. - June 05, 2006 REF:OMAPS00060424 x0045876 - Description: Header Toggling - Solution: Implemented the toggling of header when displaying the length text in SELECT ITEM and SET UP MENU + June 05, 2006 REF:OMAPS00060424 x0045876 + Description: Header Toggling + Solution: Implemented the toggling of header when displaying the length text in SELECT ITEM and SET UP MENU - May 18, 2006 REF: DRT OMAPS00076438 xdeepadh - Description: Scrolling not implemented in Imageviewer - Solution: The support for scrolling has been provided. + May 18, 2006 REF: DRT OMAPS00076438 xdeepadh + Description: Scrolling not implemented in Imageviewer + Solution: The support for scrolling has been provided. - May 03, 2006 REF: DRT OMAPS00076439 xdeepadh - Description: Image viewer back not working - Solution: The Preview List will be repopulated, when the list window is - resumed. + May 03, 2006 REF: DRT OMAPS00076439 xdeepadh + Description: Image viewer back not working + Solution: The Preview List will be repopulated, when the list window is + resumed. - May 03, 2006 REF: DRT OMAPS00076376 xdeepadh - Description: File Viewer-N5.12 issues (very unstable) - Solution: The keys are blocked until the view or preview is completed. + May 03, 2006 REF: DRT OMAPS00076376 xdeepadh + Description: File Viewer-N5.12 issues (very unstable) + Solution: The keys are blocked until the view or preview is completed. - Dec 22, 2005 REF: ENH xdeepadh - Description: Image Viewer Application - Solution: Implemeted the Image Viewer to view the jpeg images + Dec 22, 2005 REF: ENH xdeepadh + Description: Image Viewer Application + Solution: Implemeted the Image Viewer to view the jpeg images xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 Using the MenuSelect Key for requesting the help info in STK menu. Storing the info that MenuSelectKey was pressed in a list view. - May 24, 2005 REF: CRR 29358 x0021334 - Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response - Fix: The implementation is now based on timer. After the specified timeout period - the control comes back to SAT main menu, if there is no selection done by the user. + May 24, 2005 REF: CRR 29358 x0021334 + Description: CT_PTCRB 27.22.4.9.8 fails: wrong terminal response + Fix: The implementation is now based on timer. After the specified timeout period + the control comes back to SAT main menu, if there is no selection done by the user. - 25/10/00 Original Condat(UK) BMI version. + 25/10/00 Original Condat(UK) BMI version. $End @@ -123,8 +122,6 @@ #endif - - #include "mfw_sys.h" #include "mfw_mfw.h" @@ -159,7 +156,6 @@ #include "MmiLists.h" - #include "MmiMenu.h" #include "mmiCall.h" #include "Mmiicons.h" @@ -178,7 +174,6 @@ #include "MmiTimers.h" - #include "mmiColours.h" @@ -205,7 +200,6 @@ } e_lists_events; - /*----------------------------------------------------------------------------- * * List menu handling functions: @@ -231,9 +225,9 @@ $Function: listIconsDisplayListMenu - $Description: Creates a list menu from data stored in NVRAM. + $Description: Creates a list menu from data stored in NVRAM. - $Returns: none. + $Returns: none. $Arguments: @@ -249,97 +243,97 @@ TRACE_FUNCTION ("listIconsDisplayListMenu() Start"); winLists = winCreate(Parent, 0, E_WIN_VISIBLE |E_WIN_RESUME|E_WIN_SUSPEND, (MfwCb)listsIconsWinEvent); - winIconsLists=winLists; + winIconsLists=winLists; if (winLists == NULL) - { - Status = LISTS_FAIL; /* Inform caller of failure. */ - TRACE_EVENT ("win creation fails"); - } + { + Status = LISTS_FAIL; /* Inform caller of failure. */ + TRACE_EVENT ("win creation fails"); + } else - { - ListIconsWinInfo * ListData = (ListIconsWinInfo *)ALLOC_MEMORY (sizeof (ListIconsWinInfo)); + { + ListIconsWinInfo * ListData = (ListIconsWinInfo *)ALLOC_MEMORY (sizeof (ListIconsWinInfo)); - if (!ListData) - { - /* cq12719. if insufficient memory for listdata then delete window and Free allocated memory.16-03-04.MZ */ - if(NULL != winLists) - winDelete(winLists); + if (!ListData) + { + /* cq12719. if insufficient memory for listdata then delete window and Free allocated memory.16-03-04.MZ */ + if(NULL != winLists) + winDelete(winLists); - TRACE_EVENT ("(ListIconsWinInfo *)ALLOC_MEMORY fails"); - return LISTS_FAIL; - } + TRACE_EVENT ("(ListIconsWinInfo *)ALLOC_MEMORY fails"); + return LISTS_FAIL; + } - ListData->mmi_control.dialog = (T_DIALOG_FUNC)lists_exec_cb; - ListData->mmi_control.data = ListData; - win = ((MfwHdr *)winLists)->data; - win->user = (void *) ListData; + ListData->mmi_control.dialog = (T_DIALOG_FUNC)lists_exec_cb; + ListData->mmi_control.data = ListData; + win = ((MfwHdr *)winLists)->data; + win->user = (void *) ListData; - ListData->Parent = Parent; - ListData->Callback = cbFunc; - ListData->winLists = winLists; - ListData->kbdLists = kbdCreate(winLists,Data->KeyEvents|KEY_MAKE,(MfwCb)listsIconsKeyEvent); - ListData->kbdLists_long = kbdCreate(winLists,Data->KeyEvents|KEY_LONG,(MfwCb)listsIconsKeyEvent); + ListData->Parent = Parent; + ListData->Callback = cbFunc; + ListData->winLists = winLists; + ListData->kbdLists = kbdCreate(winLists,Data->KeyEvents|KEY_MAKE,(MfwCb)listsIconsKeyEvent); + ListData->kbdLists_long = kbdCreate(winLists,Data->KeyEvents|KEY_LONG,(MfwCb)listsIconsKeyEvent); - if ((ListData->kbdLists == NULL) || (ListData->kbdLists_long == NULL)) - { - Status = LISTS_FAIL; - TRACE_EVENT ("ListData->kbdLists fails"); - } - else - { - /* Create initial list menu for display. */ + if ((ListData->kbdLists == NULL) || (ListData->kbdLists_long == NULL)) + { + Status = LISTS_FAIL; + TRACE_EVENT ("ListData->kbdLists fails"); + } + else + { + /* Create initial list menu for display. */ - /* - * set menu list from outside - */ - ListData->MenuListsAttr = *Data->Attr; /* copy contents */ + /* + * set menu list from outside + */ + ListData->MenuListsAttr = *Data->Attr; /* copy contents */ - /* SPR#2492 - DS - Do not overwrite mode settings unless mode is zero */ - if (ListData->MenuListsAttr.mode == 0x0000) /* Mode not yet setup */ - ListData->MenuListsAttr.mode = MNU_LEFT | MNU_LIST | MNU_CUR_LINE; - else - ListData->MenuListsAttr.mode |= Data->Attr->mode; + /* SPR#2492 - DS - Do not overwrite mode settings unless mode is zero */ + if (ListData->MenuListsAttr.mode == 0x0000) /* Mode not yet setup */ + ListData->MenuListsAttr.mode = MNU_LEFT | MNU_LIST | MNU_CUR_LINE; + else + ListData->MenuListsAttr.mode |= Data->Attr->mode; - ListData->MenuListsAttr.font = Data->Font; - ListData->MenuListsAttr.items = Data->List; - ListData->MenuListsAttr.nItems = Data->ListLength; + ListData->MenuListsAttr.font = Data->Font; + ListData->MenuListsAttr.items = Data->List; + ListData->MenuListsAttr.nItems = Data->ListLength; - /* START: x0045876, 05-June-2006 (OMAPS00060424 - Header Toggle) */ - ListData->MenuListsAttr.header_toggle = Data->Attr->header_toggle; - if (ListData->MenuListsAttr.header_toggle) - g_win = winLists; - /* END: x0045876, 05-June-2006 (OMAPS00060424 - Header Toggle) */ + /* START: x0045876, 05-June-2006 (OMAPS00060424 - Header Toggle) */ + ListData->MenuListsAttr.header_toggle = Data->Attr->header_toggle; + if (ListData->MenuListsAttr.header_toggle) + g_win = winLists; + /* END: x0045876, 05-June-2006 (OMAPS00060424 - Header Toggle) */ - /* - * Intialize List Menu Data - */ - ListData->MenuData = Data; /* copy contents */ - ListData->MenuData->listCol = COLOUR_LIST_XX; //Set-up colour - ListData->MenuData->Attr = &ListData->MenuListsAttr; /* copy data*/ - ListData->MenuLists = mnuCreate(winLists, &ListData->MenuListsAttr, - E_MNU_SELECT | E_MNU_ESCAPE| E_MNU_POSTDRAW, - (MfwCb)listsIconsListCbMenu); - ListData->MenuData->win = winLists; - Data->win = winLists; - mnuScrollMode(ListData->MenuLists,0); - if (Data->Strings) - mnuLang (ListData->MenuLists,0); - else - mnuLang (ListData->MenuLists,mainMmiLng); + /* + * Intialize List Menu Data + */ + ListData->MenuData = Data; /* copy contents */ + ListData->MenuData->listCol = COLOUR_LIST_XX; //Set-up colour + ListData->MenuData->Attr = &ListData->MenuListsAttr; /* copy data*/ + ListData->MenuLists = mnuCreate(winLists, &ListData->MenuListsAttr, + E_MNU_SELECT | E_MNU_ESCAPE| E_MNU_POSTDRAW, + (MfwCb)listsIconsListCbMenu); + ListData->MenuData->win = winLists; + Data->win = winLists; + mnuScrollMode(ListData->MenuLists,0); + if (Data->Strings) + mnuLang (ListData->MenuLists,0); + else + mnuLang (ListData->MenuLists,mainMmiLng); - /* SPR#1983 - SH - Set up whether menu is in unicode or not */ - if (inUnicode != 0) - { - mnuDCSType(ListData->MenuLists, inUnicode); /* Unicode display */ - } - mnuChooseVisibleItem(ListData->MenuLists, Data->ListPosition-1); - mnuUnhide(ListData->MenuLists); - displaySoftKeys(ListData->MenuData->LeftSoftKey,ListData->MenuData->RightSoftKey); - winShow(winLists); + /* SPR#1983 - SH - Set up whether menu is in unicode or not */ + if (inUnicode != 0) + { + mnuDCSType(ListData->MenuLists, inUnicode); /* Unicode display */ + } + mnuChooseVisibleItem(ListData->MenuLists, Data->ListPosition-1); + mnuUnhide(ListData->MenuLists); + displaySoftKeys(ListData->MenuData->LeftSoftKey,ListData->MenuData->RightSoftKey); + winShow(winLists); - } - } + } + } return Status; } @@ -351,131 +345,131 @@ ListIconsWinInfo * data = (ListIconsWinInfo *)win_data->user; MfwMnu *MenuHandle; - /* This trace function was added inside the fflag by vinoj to remove compilation error: 2/6/06*/ - TRACE_FUNCTION("listsIconsKeyEvent() start"); + /* This trace function was added inside the fflag by vinoj to remove compilation error: 2/6/06*/ + TRACE_FUNCTION("listsIconsKeyEvent() start"); { //xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 //Initialize selectKey to FALSE here. It will be set to TRUE only when a key event for KCD_MNUSELECT occurs. data->MenuData->selectKey = FALSE; - if (!(e & KEY_MAKE)) - { - return MFW_EVENT_CONSUMED; - } - if(data->MenuData->block_keys == TRUE) - { - return MFW_EVENT_CONSUMED; - } + if (!(e & KEY_MAKE)) + { + return MFW_EVENT_CONSUMED; + } + if(data->MenuData->block_keys == TRUE) + { + return MFW_EVENT_CONSUMED; + } if (e & KEY_LONG) - { - switch (k->code) - { - case KCD_HUP: /* back to previous menu */ - mnuEscape(data->MenuLists); - break; - case KCD_RIGHT: /* Power Down */ - return MFW_EVENT_PASSED; /* handled by idle */ - default: /* no response to all other keys */ - return MFW_EVENT_CONSUMED; - } - } + { + switch (k->code) + { + case KCD_HUP: /* back to previous menu */ + mnuEscape(data->MenuLists); + break; + case KCD_RIGHT: /* Power Down */ + return MFW_EVENT_PASSED; /* handled by idle */ + default: /* no response to all other keys */ + return MFW_EVENT_CONSUMED; + } + } else - { - switch (k->code) - { - case KCD_MNUUP: /* highlight previous entry */ - mnuUp(data->MenuLists); - { - MenuHandle = mfwControl(data->MenuLists); - data->MenuData->Reason = LISTS_REASON_SCROLL; - data->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - data->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; - // Send event to indicate that the user has scrolled list items - SEND_EVENT(data->Parent, LISTS_REASON_SCROLL, 0, NULL); - } + { + switch (k->code) + { + case KCD_MNUUP: /* highlight previous entry */ + mnuUp(data->MenuLists); + { + MenuHandle = mfwControl(data->MenuLists); + data->MenuData->Reason = LISTS_REASON_SCROLL; + data->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + data->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; + // Send event to indicate that the user has scrolled list items + SEND_EVENT(data->Parent, LISTS_REASON_SCROLL, 0, NULL); + } - break; - case KCD_MNUDOWN: /* highlight next entry */ - mnuDown(data->MenuLists); - { - MenuHandle = mfwControl(data->MenuLists); - data->MenuData->Reason = LISTS_REASON_SCROLL; - data->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - data->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; - // Send event to indicate that the user has scrolled list items - SEND_EVENT(data->Parent, LISTS_REASON_SCROLL, 0, NULL); - } - break; - case KCD_MNUSELECT: + break; + case KCD_MNUDOWN: /* highlight next entry */ + mnuDown(data->MenuLists); + { + MenuHandle = mfwControl(data->MenuLists); + data->MenuData->Reason = LISTS_REASON_SCROLL; + data->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + data->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; + // Send event to indicate that the user has scrolled list items + SEND_EVENT(data->Parent, LISTS_REASON_SCROLL, 0, NULL); + } + break; + case KCD_MNUSELECT: //xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 //Menu Select Key was pressed, storing this for future use. data->MenuData->selectKey = TRUE; //Break is delibrately not used here. The control should pass through the KCD_LEFT case. - case KCD_LEFT: /* activate this entry */ - MenuHandle = mfwControl(data->MenuLists); + case KCD_LEFT: /* activate this entry */ + MenuHandle = mfwControl(data->MenuLists); data->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - mnuSelect(data->MenuLists); - break; - case KCD_CALL: /* press send key */ - data->ExitReason = LISTS_REASON_SEND; - data->MenuData->Reason = LISTS_REASON_SEND; - MenuHandle = mfwControl(data->MenuLists); - data->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - data->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ + mnuSelect(data->MenuLists); + break; + case KCD_CALL: /* press send key */ + data->ExitReason = LISTS_REASON_SEND; + data->MenuData->Reason = LISTS_REASON_SEND; + MenuHandle = mfwControl(data->MenuLists); + data->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + data->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ - /* SPR998 - SH - check if callback exists before calling it! */ - if (data->Callback) - data->Callback(data->Parent, data->MenuData); + /* SPR998 - SH - check if callback exists before calling it! */ + if (data->Callback) + data->Callback(data->Parent, data->MenuData); - if (data->MenuData->autoDestroy) - { - /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - if (data->MenuListsAttr.header_toggle) - { - if (g_title_timer) - { - tim_delete(g_title_timer); - g_title_timer = NULL; - } - } - /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - winDelete (win); - FREE_MEMORY ((void*)data, sizeof (ListIconsWinInfo)); - } - break; - case KCD_HUP: /* back to previous menu */ - data->ExitReason = LISTS_REASON_HANGUP; - data->MenuData->Reason = LISTS_REASON_HANGUP; - /*NM, p023 */ + if (data->MenuData->autoDestroy) + { + /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + if (data->MenuListsAttr.header_toggle) + { + if (g_title_timer) + { + tim_delete(g_title_timer); + g_title_timer = NULL; + } + } + /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + winDelete (win); + FREE_MEMORY ((void*)data, sizeof (ListIconsWinInfo)); + } + break; + case KCD_HUP: /* back to previous menu */ + data->ExitReason = LISTS_REASON_HANGUP; + data->MenuData->Reason = LISTS_REASON_HANGUP; + /*NM, p023 */ - MenuHandle = mfwControl(data->MenuLists); - data->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - data->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ - /*NM, p023 end */ - data->Callback(data->Parent, data->MenuData); - //July 10, 2007 REF: DRT OMAPS00135679 x0073106 - /*if (data->MenuData->autoDestroy) - {*/ - /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - if (data->MenuListsAttr.header_toggle) - { - if (g_title_timer) - { - tim_delete(g_title_timer); - g_title_timer = NULL; - } - } - /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - /* winDelete (win); - FREE_MEMORY ((void*)data, sizeof (ListIconsWinInfo)); - }*/ - break; - case KCD_RIGHT: /* back to previous menu */ - mnuEscape(data->MenuLists); - break; - default: /* no response to all other keys */ - return MFW_EVENT_CONSUMED; - } - } + MenuHandle = mfwControl(data->MenuLists); + data->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + data->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ + /*NM, p023 end */ + data->Callback(data->Parent, data->MenuData); + //July 10, 2007 REF: DRT OMAPS00135679 x0073106 + /*if (data->MenuData->autoDestroy) + {*/ + /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + if (data->MenuListsAttr.header_toggle) + { + if (g_title_timer) + { + tim_delete(g_title_timer); + g_title_timer = NULL; + } + } + /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + /* winDelete (win); + FREE_MEMORY ((void*)data, sizeof (ListIconsWinInfo)); + }*/ + break; + case KCD_RIGHT: /* back to previous menu */ + mnuEscape(data->MenuLists); + break; + default: /* no response to all other keys */ + return MFW_EVENT_CONSUMED; + } + } } return MFW_EVENT_CONSUMED; } @@ -484,9 +478,9 @@ $Function: listsWinEvent - $Description: window event handler + $Description: window event handler - $Returns: none. + $Returns: none. $Arguments: @@ -498,17 +492,17 @@ TRACE_FUNCTION("listsIconsWinEvent() start"); TRACE_EVENT_P1("ListData->Parent %x",ListData->Parent); switch (e) - { + { case E_WIN_VISIBLE: SEND_EVENT(ListData->Parent,LISTS_REASON_VISIBLE,0,(void*)ListData); - break; + break; case MfwWinResume: - SEND_EVENT(ListData->Parent,LISTS_REASON_RESUME,0,(void*)ListData); - break; + SEND_EVENT(ListData->Parent,LISTS_REASON_RESUME,0,(void*)ListData); + break; case MfwWinSuspend: - SEND_EVENT(ListData->Parent,LISTS_REASON_SUSPEND,0,(void*)ListData); - break; - } + SEND_EVENT(ListData->Parent,LISTS_REASON_SUSPEND,0,(void*)ListData); + break; + } return MFW_EVENT_CONSUMED; } /*a0393213 lint warning removal - This function is not used currently. So it's put under the flag. If it is required just remove the flag.*/ @@ -523,33 +517,33 @@ TRACE_FUNCTION ("listsIcons_exec_cb() start"); switch (event) - { - case E_INIT: - case E_BACK: - case E_RETURN: - case E_ABORT: - case E_EXIT: - /* defaultreaction */ - l_parent = ListData->Parent; - l_id = ListData->id; + { + case E_INIT: + case E_BACK: + case E_RETURN: + case E_ABORT: + case E_EXIT: + /* defaultreaction */ + l_parent = ListData->Parent; + l_id = ListData->id; - /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - if (ListData->MenuListsAttr.header_toggle) - { - if (g_title_timer) - { - tim_delete(g_title_timer); - g_title_timer = NULL; - } - } - /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - winDelete (win); - FREE_MEMORY ((void*) ListData, sizeof (ListIconsWinInfo)); - SEND_EVENT (l_parent, event, l_id, NULL); /* forward event to parent */ - break; - default: - return; - } + /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + if (ListData->MenuListsAttr.header_toggle) + { + if (g_title_timer) + { + tim_delete(g_title_timer); + g_title_timer = NULL; + } + } + /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + winDelete (win); + FREE_MEMORY ((void*) ListData, sizeof (ListIconsWinInfo)); + SEND_EVENT (l_parent, event, l_id, NULL); /* forward event to parent */ + break; + default: + return; + } } #endif @@ -558,9 +552,9 @@ $Function: listsListCbMenu - $Description: List menu handler. (mfw callback function) + $Description: List menu handler. (mfw callback function) - $Returns: none. + $Returns: none. $Arguments: @@ -574,80 +568,78 @@ TRACE_FUNCTION("listsIconsListCbMenu() "); switch (EventCode) - { - case E_MNU_SELECT: - ListData->ExitReason = E_MNU_SELECT; - ListData->MenuData->Reason = LISTS_REASON_SELECT;// MZ 14/2/01 E_MNU_SELECT; - ListData->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - ListData->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ - /* SPR998 - SH - check if callback exists before calling it! */ - if (ListData->Callback) - ListData->Callback(ListData->Parent, ListData->MenuData); - break; - case E_MNU_ESCAPE: - ListData->ExitReason = LISTS_REASON_BACK; - ListData->MenuData->Reason = LISTS_REASON_BACK; - /*NM, p023*/ - ListData->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - ListData->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ - /*NM, p023*/ + { + case E_MNU_SELECT: + ListData->ExitReason = E_MNU_SELECT; + ListData->MenuData->Reason = LISTS_REASON_SELECT;// MZ 14/2/01 E_MNU_SELECT; + ListData->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + ListData->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ + /* SPR998 - SH - check if callback exists before calling it! */ + if (ListData->Callback) + ListData->Callback(ListData->Parent, ListData->MenuData); + break; + case E_MNU_ESCAPE: + ListData->ExitReason = LISTS_REASON_BACK; + ListData->MenuData->Reason = LISTS_REASON_BACK; + /*NM, p023*/ + ListData->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + ListData->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ + /*NM, p023*/ - /* SPR998 - SH - check if callback exists before calling it! */ - if (ListData->Callback) - ListData->Callback(ListData->Parent, ListData->MenuData); + /* SPR998 - SH - check if callback exists before calling it! */ + if (ListData->Callback) + ListData->Callback(ListData->Parent, ListData->MenuData); - break; - case E_MNU_POSTDRAW: - { - T_MFW_WIN * winIconsLists_data = ((T_MFW_HDR *)winIconsLists)->data; - ListIconsWinInfo* winIconsListsData = (ListIconsWinInfo *)winIconsLists_data->user; - winIconsListsData->ExitReason = LISTS_REASON_DRAWCOMPLETE; - winIconsListsData->MenuData->Reason = LISTS_REASON_DRAWCOMPLETE; - winIconsListsData->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - winIconsListsData->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ - winIconsListsData->MenuData->lineHeight= MenuHandle->lineHeight; - if (winIconsListsData->Callback) - winIconsListsData->Callback(winIconsListsData->Parent, winIconsListsData->MenuData); - } - break; - default: - Status = LISTS_FAIL; - break; - } - + break; + case E_MNU_POSTDRAW: + { + T_MFW_WIN * winIconsLists_data = ((T_MFW_HDR *)winIconsLists)->data; + ListIconsWinInfo* winIconsListsData = (ListIconsWinInfo *)winIconsLists_data->user; + winIconsListsData->ExitReason = LISTS_REASON_DRAWCOMPLETE; + winIconsListsData->MenuData->Reason = LISTS_REASON_DRAWCOMPLETE; + winIconsListsData->MenuData->CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + winIconsListsData->MenuData->ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ + winIconsListsData->MenuData->lineHeight= MenuHandle->lineHeight; + if (winIconsListsData->Callback) + winIconsListsData->Callback(winIconsListsData->Parent, winIconsListsData->MenuData); + } + break; + default: + Status = LISTS_FAIL; + break; + } return Status; } void listsIconsDestroy(T_MFW_HND win) { - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - ListIconsWinInfo * ListData = (ListIconsWinInfo *)win_data->user; + T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; + ListIconsWinInfo * ListData = (ListIconsWinInfo *)win_data->user; TRACE_EVENT_P1("listsIconsDestroy %x",win); - /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - if (ListData->MenuListsAttr.header_toggle) - { - if(g_title_timer) - { - tim_delete(g_title_timer); - g_title_timer = NULL; - } - } - /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + if (ListData->MenuListsAttr.header_toggle) + { + if(g_title_timer) + { + tim_delete(g_title_timer); + g_title_timer = NULL; + } + } + /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - winDelete (win); - FREE_MEMORY ((void*) ListData, sizeof (ListIconsWinInfo)); - + winDelete (win); + FREE_MEMORY ((void*) ListData, sizeof (ListIconsWinInfo)); } /******************************************************************************* $Function: listDisplayListMenu - $Description: Creates a list menu from data stored in NVRAM. + $Description: Creates a list menu from data stored in NVRAM. - $Returns: none. + $Returns: none. $Arguments: @@ -664,94 +656,94 @@ winLists = winCreate(Parent, 0, E_WIN_VISIBLE |E_WIN_RESUME|E_WIN_SUSPEND, (MfwCb)listsWinEvent); if (winLists == NULL) - { - Status = LISTS_FAIL; /* Inform caller of failure. */ - TRACE_EVENT ("win creation fails"); - } + { + Status = LISTS_FAIL; /* Inform caller of failure. */ + TRACE_EVENT ("win creation fails"); + } else - { - ListWinInfo * ListData = (ListWinInfo *)ALLOC_MEMORY (sizeof (ListWinInfo)); + { + ListWinInfo * ListData = (ListWinInfo *)ALLOC_MEMORY (sizeof (ListWinInfo)); - if (!ListData) - { - /* cq12719. if insufficient memory for listdata then delete window and Free allocated memory.16-03-04.MZ */ - if(NULL != winLists) - winDelete(winLists); + if (!ListData) + { + /* cq12719. if insufficient memory for listdata then delete window and Free allocated memory.16-03-04.MZ */ + if(NULL != winLists) + winDelete(winLists); - TRACE_EVENT ("(ListWinInfo *)ALLOC_MEMORY fails"); - return LISTS_FAIL; - } + TRACE_EVENT ("(ListWinInfo *)ALLOC_MEMORY fails"); + return LISTS_FAIL; + } - ListData->mmi_control.dialog = (T_DIALOG_FUNC)lists_exec_cb; - ListData->mmi_control.data = ListData; - win = ((MfwHdr *)winLists)->data; - win->user = (void *) ListData; + ListData->mmi_control.dialog = (T_DIALOG_FUNC)lists_exec_cb; + ListData->mmi_control.data = ListData; + win = ((MfwHdr *)winLists)->data; + win->user = (void *) ListData; - ListData->Parent = Parent; - ListData->Callback = cbFunc; - ListData->winLists = winLists; - ListData->kbdLists = kbdCreate(winLists,Data->KeyEvents|KEY_MAKE, (MfwCb)listsKeyEvent); - ListData->kbdLists_long = kbdCreate(winLists,Data->KeyEvents|KEY_LONG,(MfwCb)listsKeyEvent); + ListData->Parent = Parent; + ListData->Callback = cbFunc; + ListData->winLists = winLists; + ListData->kbdLists = kbdCreate(winLists,Data->KeyEvents|KEY_MAKE, (MfwCb)listsKeyEvent); + ListData->kbdLists_long = kbdCreate(winLists,Data->KeyEvents|KEY_LONG,(MfwCb)listsKeyEvent); - if ((ListData->kbdLists == NULL) || (ListData->kbdLists_long == NULL)) - { - Status = LISTS_FAIL; - TRACE_EVENT ("ListData->kbdLists fails"); - } - else - { - /* Create initial list menu for display. */ + if ((ListData->kbdLists == NULL) || (ListData->kbdLists_long == NULL)) + { + Status = LISTS_FAIL; + TRACE_EVENT ("ListData->kbdLists fails"); + } + else + { + /* Create initial list menu for display. */ - /* - * set menu list from outside - */ - ListData->MenuListsAttr = *Data->Attr; /* copy contents */ + /* + * set menu list from outside + */ + ListData->MenuListsAttr = *Data->Attr; /* copy contents */ - /* SPR#2492 - DS - Do not overwrite mode settings unless mode is zero */ - if (ListData->MenuListsAttr.mode == 0x0000) /* Mode not yet setup */ - ListData->MenuListsAttr.mode = MNU_LEFT | MNU_LIST | MNU_CUR_LINE; - else - ListData->MenuListsAttr.mode |= Data->Attr->mode; + /* SPR#2492 - DS - Do not overwrite mode settings unless mode is zero */ + if (ListData->MenuListsAttr.mode == 0x0000) /* Mode not yet setup */ + ListData->MenuListsAttr.mode = MNU_LEFT | MNU_LIST | MNU_CUR_LINE; + else + ListData->MenuListsAttr.mode |= Data->Attr->mode; - ListData->MenuListsAttr.font = Data->Font; - ListData->MenuListsAttr.items = Data->List; - ListData->MenuListsAttr.nItems = Data->ListLength; + ListData->MenuListsAttr.font = Data->Font; + ListData->MenuListsAttr.items = Data->List; + ListData->MenuListsAttr.nItems = Data->ListLength; - /* START: x0045876, 05-June-2006 (OMAPS00060424 - Header Toggle) */ - ListData->MenuListsAttr.header_toggle = Data->Attr->header_toggle; - if (ListData->MenuListsAttr.header_toggle) - g_win = winLists; - /* END: x0045876, 05-June-2006 (OMAPS00060424 - Header Toggle) */ + /* START: x0045876, 05-June-2006 (OMAPS00060424 - Header Toggle) */ + ListData->MenuListsAttr.header_toggle = Data->Attr->header_toggle; + if (ListData->MenuListsAttr.header_toggle) + g_win = winLists; + /* END: x0045876, 05-June-2006 (OMAPS00060424 - Header Toggle) */ - /* - * Intialize List Menu Data - */ - ListData->MenuData = *Data; /* copy contents */ - ListData->MenuData.listCol = COLOUR_LIST_XX; //Set-up colour - ListData->MenuData.Attr = &ListData->MenuListsAttr; /* copy data*/ - ListData->MenuLists = mnuCreate(winLists, &ListData->MenuListsAttr, - E_MNU_SELECT | E_MNU_ESCAPE, - (MfwCb)listsListCbMenu); - ListData->MenuData.win = winLists; - Data->win = winLists; - mnuScrollMode(ListData->MenuLists,1); - if (Data->Strings) - mnuLang (ListData->MenuLists,0); - else - mnuLang (ListData->MenuLists,mainMmiLng); + /* + * Intialize List Menu Data + */ + ListData->MenuData = *Data; /* copy contents */ + ListData->MenuData.listCol = COLOUR_LIST_XX; //Set-up colour + ListData->MenuData.Attr = &ListData->MenuListsAttr; /* copy data*/ + ListData->MenuLists = mnuCreate(winLists, &ListData->MenuListsAttr, + E_MNU_SELECT | E_MNU_ESCAPE, + (MfwCb)listsListCbMenu); + ListData->MenuData.win = winLists; + Data->win = winLists; + mnuScrollMode(ListData->MenuLists,1); + if (Data->Strings) + mnuLang (ListData->MenuLists,0); + else + mnuLang (ListData->MenuLists,mainMmiLng); - /* SPR#1983 - SH - Set up whether menu is in unicode or not */ - if (inUnicode != 0) - { - mnuDCSType(ListData->MenuLists, inUnicode); /* Unicode display */ - } - mnuChooseVisibleItem(ListData->MenuLists, Data->ListPosition-1); - mnuUnhide(ListData->MenuLists); - TRACE_EVENT ("mmiList winShow()"); - winShow(winLists); - } - } + /* SPR#1983 - SH - Set up whether menu is in unicode or not */ + if (inUnicode != 0) + { + mnuDCSType(ListData->MenuLists, inUnicode); /* Unicode display */ + } + mnuChooseVisibleItem(ListData->MenuLists, Data->ListPosition-1); + mnuUnhide(ListData->MenuLists); + TRACE_EVENT ("mmiList winShow()"); + winShow(winLists); + } + } return Status; } @@ -761,9 +753,9 @@ $Function: listsKeyEvent - $Description: Keyboard event handler + $Description: Keyboard event handler - $Returns: none. + $Returns: none. $Arguments: @@ -776,154 +768,154 @@ ListWinInfo * data = (ListWinInfo *)win_data->user; MfwMnu *MenuHandle; - /* This trace function was added inside the fflag by vinoj to remove compilation error: 2/6/06*/ + /* This trace function was added inside the fflag by vinoj to remove compilation error: 2/6/06*/ { //xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 //Initialize selectKey to FALSE here. It will be set to TRUE only when a key event for KCD_MNUSELECT occurs. data->MenuData.selectKey = FALSE; - if (!(e & KEY_MAKE)) - { - return MFW_EVENT_CONSUMED; - } + if (!(e & KEY_MAKE)) + { + return MFW_EVENT_CONSUMED; + } if (e & KEY_LONG) - { - switch (k->code) - { - case KCD_HUP: /* back to previous menu */ - mnuEscape(data->MenuLists); - break; - case KCD_RIGHT: /* Power Down */ - return MFW_EVENT_PASSED; /* handled by idle */ - default: /* no response to all other keys */ - return MFW_EVENT_CONSUMED; - } - } + { + switch (k->code) + { + case KCD_HUP: /* back to previous menu */ + mnuEscape(data->MenuLists); + break; + case KCD_RIGHT: /* Power Down */ + return MFW_EVENT_PASSED; /* handled by idle */ + default: /* no response to all other keys */ + return MFW_EVENT_CONSUMED; + } + } else - { - switch (k->code) - { - case KCD_MNUUP: /* highlight previous entry */ - mnuUp(data->MenuLists); -//GW Not needed? winShow(win); - // Only required in melody list selection. + { + switch (k->code) + { + case KCD_MNUUP: /* highlight previous entry */ + mnuUp(data->MenuLists); +//GW Not needed? winShow(win); + // Only required in melody list selection. /* Mar 30, 2007 REF: OMAPS00122691 x0039928 */ /* This event will be used to play the selected file. */ - if(getMelodyListStatus()== TRUE) - { - MenuHandle = mfwControl(data->MenuLists); + if(getMelodyListStatus()== TRUE) + { + MenuHandle = mfwControl(data->MenuLists); - data->MenuData.Reason = LISTS_REASON_SCROLL; - data->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - data->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; - SEND_EVENT(data->Parent,E_START_MELODY,0,(void*)data); - } + data->MenuData.Reason = LISTS_REASON_SCROLL; + data->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + data->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; + SEND_EVENT(data->Parent,E_START_MELODY,0,(void*)data); + } - if(getScrollStatus() == TRUE) - { - // Send event to indicate that the user has scrolled list items - SEND_EVENT(data->Parent, LISTS_REASON_SCROLL, 0, NULL); - } - break; - case KCD_MNUDOWN: /* highlight next entry */ - mnuDown(data->MenuLists); -//GW Not needed? winShow(win); + if(getScrollStatus() == TRUE) + { + // Send event to indicate that the user has scrolled list items + SEND_EVENT(data->Parent, LISTS_REASON_SCROLL, 0, NULL); + } + break; + case KCD_MNUDOWN: /* highlight next entry */ + mnuDown(data->MenuLists); +//GW Not needed? winShow(win); /* Mar 30, 2007 REF: OMAPS00122691 x0039928 */ /* This event will be used to play the selected file. */ - if(getMelodyListStatus()== TRUE) - { - MenuHandle = mfwControl(data->MenuLists); + if(getMelodyListStatus()== TRUE) + { + MenuHandle = mfwControl(data->MenuLists); - data->MenuData.Reason = LISTS_REASON_SCROLL; - data->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - data->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; - SEND_EVENT(data->Parent,E_START_MELODY,0,(void*)data); - } + data->MenuData.Reason = LISTS_REASON_SCROLL; + data->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + data->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; + SEND_EVENT(data->Parent,E_START_MELODY,0,(void*)data); + } - if(getScrollStatus() == TRUE) - { - // Send event to indicate that the user has scrolled list items - SEND_EVENT(data->Parent, LISTS_REASON_SCROLL, 0, NULL); - } - break; - case KCD_MNUSELECT: + if(getScrollStatus() == TRUE) + { + // Send event to indicate that the user has scrolled list items + SEND_EVENT(data->Parent, LISTS_REASON_SCROLL, 0, NULL); + } + break; + case KCD_MNUSELECT: //xrashmic 5 Oct, 2005 MMI-SPR-29356, MMI-SPR-29357 //Menu Select Key was pressed, storing this for future use. data->MenuData.selectKey = TRUE; //Break is delibrately not used here. The control should pass through the KCD_LEFT case. - case KCD_LEFT: /* activate this entry */ - mnuSelect(data->MenuLists); - MenuHandle = mfwControl(data->MenuLists); - if ((MenuHandle != NULL) && // Marcus: Issue 1810: 12/03/2003 - (MenuHandle->curAttr != NULL) && - winIsFocussed(win)) - { - softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, MenuHandle->curAttr->mnuColour); - } - break; - case KCD_CALL: /* press send key */ - data->ExitReason = LISTS_REASON_SEND; - data->MenuData.Reason = LISTS_REASON_SEND; - MenuHandle = mfwControl(data->MenuLists); - data->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - data->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ + case KCD_LEFT: /* activate this entry */ + mnuSelect(data->MenuLists); + MenuHandle = mfwControl(data->MenuLists); + if ((MenuHandle != NULL) && // Marcus: Issue 1810: 12/03/2003 + (MenuHandle->curAttr != NULL) && + winIsFocussed(win)) + { + softKeys_displayId( TxtSoftSelect, TxtSoftBack, 0, MenuHandle->curAttr->mnuColour); + } + break; + case KCD_CALL: /* press send key */ + data->ExitReason = LISTS_REASON_SEND; + data->MenuData.Reason = LISTS_REASON_SEND; + MenuHandle = mfwControl(data->MenuLists); + data->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + data->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ - /* SPR998 - SH - check if callback exists before calling it! */ - if (data->Callback) - data->Callback(data->Parent, &data->MenuData); + /* SPR998 - SH - check if callback exists before calling it! */ + if (data->Callback) + data->Callback(data->Parent, &data->MenuData); - if (data->MenuData.autoDestroy) - { - /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - if (data->MenuListsAttr.header_toggle) - { - if (g_title_timer) - { - tim_delete(g_title_timer); - g_title_timer = NULL; - } - } - /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - winDelete (win); - FREE_MEMORY ((void*)data, sizeof (ListWinInfo)); - } - break; - case KCD_HUP: /* back to previous menu */ - data->ExitReason = LISTS_REASON_HANGUP; - data->MenuData.Reason = LISTS_REASON_HANGUP; - /*NM, p023 */ - MenuHandle = mfwControl(data->MenuLists); - data->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - data->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ - /*NM, p023 end */ - data->Callback(data->Parent, &data->MenuData); - if (data->MenuData.autoDestroy) - { - /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - if (data->MenuListsAttr.header_toggle) - { - if (g_title_timer) - { - tim_delete(g_title_timer); - g_title_timer = NULL; - } - } - /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - winDelete (win); - FREE_MEMORY ((void*)data, sizeof (ListWinInfo)); - } - break; - case KCD_RIGHT: /* back to previous menu */ - mnuEscape(data->MenuLists); - break; - default: /* no response to all other keys */ - return MFW_EVENT_CONSUMED; - } - } + if (data->MenuData.autoDestroy) + { + /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + if (data->MenuListsAttr.header_toggle) + { + if (g_title_timer) + { + tim_delete(g_title_timer); + g_title_timer = NULL; + } + } + /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + winDelete (win); + FREE_MEMORY ((void*)data, sizeof (ListWinInfo)); + } + break; + case KCD_HUP: /* back to previous menu */ + data->ExitReason = LISTS_REASON_HANGUP; + data->MenuData.Reason = LISTS_REASON_HANGUP; + /*NM, p023 */ + MenuHandle = mfwControl(data->MenuLists); + data->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + data->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ + /*NM, p023 end */ + data->Callback(data->Parent, &data->MenuData); + if (data->MenuData.autoDestroy) + { + /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + if (data->MenuListsAttr.header_toggle) + { + if (g_title_timer) + { + tim_delete(g_title_timer); + g_title_timer = NULL; + } + } + /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + winDelete (win); + FREE_MEMORY ((void*)data, sizeof (ListWinInfo)); + } + break; + case KCD_RIGHT: /* back to previous menu */ + mnuEscape(data->MenuLists); + break; + default: /* no response to all other keys */ + return MFW_EVENT_CONSUMED; + } + } } TRACE_FUNCTION("listsKeyEvent()-end"); return MFW_EVENT_CONSUMED; @@ -933,9 +925,9 @@ $Function: listsWinEvent - $Description: window event handler + $Description: window event handler - $Returns: none. + $Returns: none. $Arguments: @@ -947,17 +939,17 @@ TRACE_FUNCTION("listsWinEvent()"); switch (e) - { + { case E_WIN_VISIBLE: SEND_EVENT(ListData->Parent,LISTS_REASON_VISIBLE,0,(void*)ListData); - break; + break; case MfwWinResume: - SEND_EVENT(ListData->Parent,LISTS_REASON_RESUME,0,(void*)ListData); - break; + SEND_EVENT(ListData->Parent,LISTS_REASON_RESUME,0,(void*)ListData); + break; case MfwWinSuspend: - SEND_EVENT(ListData->Parent,LISTS_REASON_SUSPEND,0,(void*)ListData); - break; - } + SEND_EVENT(ListData->Parent,LISTS_REASON_SUSPEND,0,(void*)ListData); + break; + } return MFW_EVENT_CONSUMED; } @@ -971,44 +963,43 @@ TRACE_FUNCTION ("lists_exec_cb()"); switch (event) - { - case E_INIT: - case E_BACK: - case E_RETURN: - case E_ABORT: - case E_EXIT: - /* defaultreaction */ - l_parent = ListData->Parent; - l_id = ListData->id; + { + case E_INIT: + case E_BACK: + case E_RETURN: + case E_ABORT: + case E_EXIT: + /* defaultreaction */ + l_parent = ListData->Parent; + l_id = ListData->id; - /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - if (ListData->MenuListsAttr.header_toggle) - { - if (g_title_timer) - { - tim_delete(g_title_timer); - g_title_timer = NULL; - } - } - /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - winDelete (win); - FREE_MEMORY ((void*) ListData, sizeof (ListWinInfo)); - SEND_EVENT (l_parent, event, l_id, NULL); /* forward event to parent */ - break; - default: - return; - } + /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + if (ListData->MenuListsAttr.header_toggle) + { + if (g_title_timer) + { + tim_delete(g_title_timer); + g_title_timer = NULL; + } + } + /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + winDelete (win); + FREE_MEMORY ((void*) ListData, sizeof (ListWinInfo)); + SEND_EVENT (l_parent, event, l_id, NULL); /* forward event to parent */ + break; + default: + return; + } } - /******************************************************************************* $Function: listsListCbMenu - $Description: List menu handler. (mfw callback function) + $Description: List menu handler. (mfw callback function) - $Returns: none. + $Returns: none. $Arguments: @@ -1023,75 +1014,73 @@ TRACE_FUNCTION("listsCbMenu()"); switch (EventCode) - { + { case E_MNU_SELECT: - ListData->ExitReason = E_MNU_SELECT; - ListData->MenuData.Reason = LISTS_REASON_SELECT;// MZ 14/2/01 E_MNU_SELECT; - ListData->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - ListData->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ - /* SPR998 - SH - check if callback exists before calling it! */ - if (ListData->Callback) - ListData->Callback(ListData->Parent, &ListData->MenuData); - break; + ListData->ExitReason = E_MNU_SELECT; + ListData->MenuData.Reason = LISTS_REASON_SELECT;// MZ 14/2/01 E_MNU_SELECT; + ListData->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + ListData->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ + /* SPR998 - SH - check if callback exists before calling it! */ + if (ListData->Callback) + ListData->Callback(ListData->Parent, &ListData->MenuData); + break; case E_MNU_ESCAPE: - ListData->ExitReason = LISTS_REASON_BACK; - ListData->MenuData.Reason = LISTS_REASON_BACK; - /*NM, p023*/ - ListData->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; - ListData->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ - /*NM, p023*/ + ListData->ExitReason = LISTS_REASON_BACK; + ListData->MenuData.Reason = LISTS_REASON_BACK; + /*NM, p023*/ + ListData->MenuData.CursorPosition = MenuHandle->lCursor[MenuHandle->level]; + ListData->MenuData.ListPosition = MenuHandle->lCursor[MenuHandle->level]; /* True cursor position in list menu. */ + /*NM, p023*/ - /* SPR998 - SH - check if callback exists before calling it! */ - if (ListData->Callback) - ListData->Callback(ListData->Parent, &ListData->MenuData); - break; + /* SPR998 - SH - check if callback exists before calling it! */ + if (ListData->Callback) + ListData->Callback(ListData->Parent, &ListData->MenuData); + break; default: - Status = LISTS_FAIL; - TRACE_EVENT("Activation 77 error"); - break; - } + Status = LISTS_FAIL; + TRACE_EVENT("Activation 77 error"); + break; + } /* * Free all allocated memory and handler */ - if (ListData->MenuData.autoDestroy) - { - /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - if (ListData->MenuListsAttr.header_toggle) - { - if (g_title_timer) - { - tim_delete(g_title_timer); - g_title_timer = NULL; - } - } - /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - winDelete (win); - FREE_MEMORY ((void*) ListData, sizeof (ListWinInfo)); - } + if (ListData->MenuData.autoDestroy) + { + /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + if (ListData->MenuListsAttr.header_toggle) + { + if (g_title_timer) + { + tim_delete(g_title_timer); + g_title_timer = NULL; + } + } + /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + winDelete (win); + FREE_MEMORY ((void*) ListData, sizeof (ListWinInfo)); + } return Status; } void listsDestroy(T_MFW_HND win) { - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - ListWinInfo * ListData = (ListWinInfo *)win_data->user; + T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; + ListWinInfo * ListData = (ListWinInfo *)win_data->user; - /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - if (ListData->MenuListsAttr.header_toggle) - { - if(g_title_timer) - { - tim_delete(g_title_timer); - g_title_timer = NULL; - } - } - /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + /* START: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ + if (ListData->MenuListsAttr.header_toggle) + { + if(g_title_timer) + { + tim_delete(g_title_timer); + g_title_timer = NULL; + } + } + /* END: 05-June-2006, x0045876 (OMAPS00060424 - Header Toggle) */ - winDelete (win); - FREE_MEMORY ((void*) ListData, sizeof (ListWinInfo)); - + winDelete (win); + FREE_MEMORY ((void*) ListData, sizeof (ListWinInfo)); } -