# HG changeset patch # User Mychaela Falconia # Date 1605323891 0 # Node ID 70ea7526b59e83c41c5d8b66f52b257140e93fd6 # Parent 62480f59796281be94f16148b62b12d54ad63f71 bmi/AUI*.c: bogotab fixes diff -r 62480f597962 -r 70ea7526b59e src/ui/bmi/AUICalcEditor.c --- a/src/ui/bmi/AUICalcEditor.c Tue Nov 10 07:12:03 2020 +0000 +++ b/src/ui/bmi/AUICalcEditor.c Sat Nov 14 03:18:11 2020 +0000 @@ -11,25 +11,24 @@ $Project name: Basic MMI $Project code: BMI (6349) - $Module: MMI - $File: AUICalcEditor.c - $Revision: 1.0 + $Module: MMI + $File: AUICalcEditor.c + $Revision: 1.0 - $Author: Condat(UK) - $Date: 22/02/01 + $Author: Condat(UK) + $Date: 22/02/01 ******************************************************************************** Description: Editor for calculator, or generic floating-point number input - ******************************************************************************** $History: AUICalcEditor.c - xrashmic 20 Oct, 2005 MMI-SPR-33845 - To display BACK softkey when no more character are left in the calculator editor + xrashmic 20 Oct, 2005 MMI-SPR-33845 + To display BACK softkey when no more character are left in the calculator editor 14/11/02 Original Condat(UK) BMI version. $End @@ -108,24 +107,24 @@ typedef struct { - T_MMI_CONTROL mmi_control; - T_MFW_HND parent; // The parent window - T_MFW_HND win; // The edit window - T_MFW_HND kbd; // The keyboard handler - T_MFW_HND kbd_long; // The longpress keyboard handler - T_MFW_HND timer; // The timer for timeouts + T_MMI_CONTROL mmi_control; + T_MFW_HND parent; // The parent window + T_MFW_HND win; // The edit window + T_MFW_HND kbd; // The keyboard handler + T_MFW_HND kbd_long; // The longpress keyboard handler + T_MFW_HND timer; // The timer for timeouts - T_ED_DATA *editor; /* The ATB editor */ - T_AUI_EDITOR_DATA editor_data; /* The MMI editor data, provided by caller */ - T_AUI_ENTRY_DATA *entry_data; /* The MMI text entry data */ + T_ED_DATA *editor; /* The ATB editor */ + T_AUI_EDITOR_DATA editor_data; /* The MMI editor data, provided by caller */ + T_AUI_ENTRY_DATA *entry_data; /* The MMI text entry data */ - BOOL haveTitle; /* TRUE if a title is supplied */ - T_ATB_TEXT title; /* Title of editor */ - BOOL haveResult; /* TRUE if a result is supplied */ - T_ATB_TEXT result; /* Text of result */ + BOOL haveTitle; /* TRUE if a title is supplied */ + T_ATB_TEXT title; /* Title of editor */ + BOOL haveResult; /* TRUE if a result is supplied */ + T_ATB_TEXT result; /* Text of result */ - BOOL doNextLongPress; /* Flag used to notice/not notice long keypress */ - BOOL hasDecimalPoint; /* Ensures only one decimal point per number */ + BOOL doNextLongPress; /* Flag used to notice/not notice long keypress */ + BOOL hasDecimalPoint; /* Ensures only one decimal point per number */ } T_AUI_CALC_DATA; @@ -137,17 +136,15 @@ static int AUI_calc_KbdLongCb(T_MFW_EVENT event, T_MFW_KBD *keyboard); - - /******************************************************************************* - $Function: AUI_calc_Start + $Function: AUI_calc_Start - $Description: Start the Calc editor. + $Description: Start the Calc editor. - $Returns: None. + $Returns: None. - $Arguments: None. + $Arguments: None. *******************************************************************************/ @@ -164,48 +161,48 @@ /******************************************************************************* - $Function: AUI_calc_Create + $Function: AUI_calc_Create - $Description: Create the Calc editor. + $Description: Create the Calc editor. - $Returns: Pointer to the editor's window. + $Returns: Pointer to the editor's window. - $Arguments: parent - The parent window. + $Arguments: parent - The parent window. *******************************************************************************/ static T_MFW_HND AUI_calc_Create(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data) { - T_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)ALLOC_MEMORY(sizeof (T_AUI_CALC_DATA)); - T_MFW_WIN *win_data; + T_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)ALLOC_MEMORY(sizeof (T_AUI_CALC_DATA)); + T_MFW_WIN *win_data; TRACE_FUNCTION ("AUI_calc_Create()"); - /* Create window handler */ + /* Create window handler */ - data->win = win_create(parent, 0, E_WIN_VISIBLE, (T_MFW_CB)AUI_calc_WinCb); // Create window + data->win = win_create(parent, 0, E_WIN_VISIBLE, (T_MFW_CB)AUI_calc_WinCb); // Create window - if (data->win==NULL) // Make sure window exists + if (data->win==NULL) // Make sure window exists { - return NULL; + return NULL; } - /* Connect the dialog data to the MFW-window */ + /* Connect the dialog data to the MFW-window */ - data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_calc_ExecCb; /* Setup the destination for events */ - data->mmi_control.data = data; - data->parent = parent; - win_data = ((T_MFW_HDR *)data->win)->data; - win_data->user = (void *)data; + data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_calc_ExecCb; /* Setup the destination for events */ + data->mmi_control.data = data; + data->parent = parent; + win_data = ((T_MFW_HDR *)data->win)->data; + win_data->user = (void *)data; - data->kbd = kbd_create(data->win, KEY_ALL,(T_MFW_CB)AUI_calc_KbdCb); - data->kbd_long = kbd_create(data->win, KEY_ALL|KEY_LONG,(T_MFW_CB)AUI_calc_KbdLongCb); - data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0); + data->kbd = kbd_create(data->win, KEY_ALL,(T_MFW_CB)AUI_calc_KbdCb); + data->kbd_long = kbd_create(data->win, KEY_ALL|KEY_LONG,(T_MFW_CB)AUI_calc_KbdLongCb); + data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0); - data->editor_data = *editor_data; - data->entry_data = AUI_entry_Create(data->win, data->editor, E_CALC_UPDATE); + data->editor_data = *editor_data; + data->entry_data = AUI_entry_Create(data->win, data->editor, E_CALC_UPDATE); - SEND_EVENT(data->win, E_CALC_INIT, 0, 0); + SEND_EVENT(data->win, E_CALC_INIT, 0, 0); /* Return window handle */ @@ -215,38 +212,38 @@ /******************************************************************************* - $Function: AUI_calc_Destroy + $Function: AUI_calc_Destroy - $Description: Destroy the Calc editor. + $Description: Destroy the Calc editor. - $Returns: None. + $Returns: None. - $Arguments: window - The editor window. + $Arguments: window - The editor window. *******************************************************************************/ void AUI_calc_Destroy(T_MFW_HND win) { - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)win_data->user; + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)win_data->user; if (data) { - AUI_entry_Destroy(data->entry_data); + AUI_entry_Destroy(data->entry_data); win_delete (data->win); - /* Free memory allocated to store result */ + /* Free memory allocated to store result */ - if (data->haveResult) - { - FREE_MEMORY(data->result.data, data->result.len*sizeof(char)); - } + if (data->haveResult) + { + FREE_MEMORY(data->result.data, data->result.len*sizeof(char)); + } - /* Free editor memory */ + /* Free editor memory */ - ATB_edit_Destroy(data->editor); - FREE_MEMORY ((void *)data, sizeof (T_AUI_CALC_DATA)); + ATB_edit_Destroy(data->editor); + FREE_MEMORY ((void *)data, sizeof (T_AUI_CALC_DATA)); } return; @@ -255,404 +252,404 @@ /******************************************************************************* - $Function: AUI_calc_ExecCb + $Function: AUI_calc_ExecCb - $Description: Dialog function for Calc editor. + $Description: Dialog function for Calc editor. - $Returns: None. + $Returns: None. - $Arguments: None. + $Arguments: None. *******************************************************************************/ static void AUI_calc_ExecCb(T_MFW_HND win, USHORT event, SHORT value, void *parameter) { - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)win_data->user; - T_MFW_HND parent_win = data->parent; - USHORT textIndex; - T_ATB_TEXT text; - /* Store these in case editor is destroyed on callback */ - USHORT Identifier = data->editor_data.Identifier; - T_AUI_EDIT_CB Callback = data->editor_data.Callback; - UBYTE destroyEditor = data->editor_data.destroyEditor; + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)win_data->user; + T_MFW_HND parent_win = data->parent; + USHORT textIndex; + T_ATB_TEXT text; + /* Store these in case editor is destroyed on callback */ + USHORT Identifier = data->editor_data.Identifier; + T_AUI_EDIT_CB Callback = data->editor_data.Callback; + UBYTE destroyEditor = data->editor_data.destroyEditor; TRACE_FUNCTION ("AUI_calc_ExecCb()"); switch (event) { - /* Initialise */ + /* Initialise */ case E_CALC_INIT: - TRACE_EVENT("E_CALC_INIT"); - ATB_edit_Init(data->editor); + TRACE_EVENT("E_CALC_INIT"); + ATB_edit_Init(data->editor); - data->haveTitle = FALSE; - data->haveResult = FALSE; + data->haveTitle = FALSE; + data->haveResult = FALSE; - /* If we require an output line, shrink editor to fit it at bottom - * NB TitleString is assumed here to be a numeric string of ascii digits */ + /* If we require an output line, shrink editor to fit it at bottom + * NB TitleString is assumed here to be a numeric string of ascii digits */ - if (data->editor_data.TitleString) - { - data->haveResult = TRUE; - text.dcs = ATB_DCS_ASCII; - text.data = data->editor_data.TitleString; - text.len = ATB_string_Length(&text); + if (data->editor_data.TitleString) + { + data->haveResult = TRUE; + text.dcs = ATB_DCS_ASCII; + text.data = data->editor_data.TitleString; + text.len = ATB_string_Length(&text); - data->result.data = ALLOC_MEMORY(text.len*sizeof(char)); - ATB_string_Copy(&data->result, &text); + data->result.data = ALLOC_MEMORY(text.len*sizeof(char)); + ATB_string_Copy(&data->result, &text); - /* Change size of editor to fit result line in */ - data->editor_data.editor_attr.win_size.sy -= ATB_display_StringHeight(&data->result, NULL); - } + /* Change size of editor to fit result line in */ + data->editor_data.editor_attr.win_size.sy -= ATB_display_StringHeight(&data->result, NULL); + } - /* Set up title */ + /* Set up title */ - if (data->editor_data.TitleId!=NULL) - { - data->haveTitle = TRUE; - data->title.data = (UBYTE *)MmiRsrcGetText(data->editor_data.TitleId); - } + if (data->editor_data.TitleId!=NULL) + { + data->haveTitle = TRUE; + data->title.data = (UBYTE *)MmiRsrcGetText(data->editor_data.TitleId); + } - /* If title exists, get its dcs and length */ + /* If title exists, get its dcs and length */ - if (data->haveTitle) - { - if (data->title.data[0]==0x80) - { - data->title.data += 2; /* Skip over two unicode indicator bytes */ - data->title.dcs = ATB_DCS_UNICODE; - } + if (data->haveTitle) + { + if (data->title.data[0]==0x80) + { + data->title.data += 2; /* Skip over two unicode indicator bytes */ + data->title.dcs = ATB_DCS_UNICODE; + } #ifdef EASY_TEXT_ENABLED - else if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - { - data->title.dcs = ATB_DCS_UNICODE; - } + else if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + { + data->title.dcs = ATB_DCS_UNICODE; + } #endif - else - { - data->title.dcs = ATB_DCS_ASCII; - } + else + { + data->title.dcs = ATB_DCS_ASCII; + } - data->title.len = ATB_string_Length(&data->title); - } + data->title.len = ATB_string_Length(&data->title); + } - /* Check to see if number already has decimal point */ + /* Check to see if number already has decimal point */ - data->hasDecimalPoint = FALSE; + data->hasDecimalPoint = FALSE; - for (textIndex = 0; textIndexeditor->attr->text.len; textIndex++) - { - if (ATB_string_GetChar(&data->editor->attr->text, textIndex)==UNICODE_FULLSTOP) - { - data->hasDecimalPoint = TRUE; - } - } + for (textIndex = 0; textIndexeditor->attr->text.len; textIndex++) + { + if (ATB_string_GetChar(&data->editor->attr->text, textIndex)==UNICODE_FULLSTOP) + { + data->hasDecimalPoint = TRUE; + } + } - /* Show the window */ - win_show(data->win); - break; + /* Show the window */ + win_show(data->win); + break; - case E_CALC_UPDATE: - TRACE_EVENT("E_CALC_UPDATE"); - win_show(data->win); - break; + case E_CALC_UPDATE: + TRACE_EVENT("E_CALC_UPDATE"); + win_show(data->win); + break; - case E_CALC_DEINIT: - TRACE_EVENT("E_CALC_DEINIT"); + case E_CALC_DEINIT: + TRACE_EVENT("E_CALC_DEINIT"); - if (Callback) - (Callback) (parent_win, Identifier, value); + if (Callback) + (Callback) (parent_win, Identifier, value); - if (destroyEditor) - AUI_calc_Destroy(data->win); + if (destroyEditor) + AUI_calc_Destroy(data->win); - break; + break; - } + } return; } /******************************************************************************* - $Function: AUI_calc_WinCb + $Function: AUI_calc_WinCb - $Description: Calc editor window event handler. + $Description: Calc editor window event handler. - $Returns: None. + $Returns: None. - $Arguments: event - the event - win - the editor window + $Arguments: event - the event + win - the editor window *******************************************************************************/ static int AUI_calc_WinCb(T_MFW_EVENT event, T_MFW_WIN *win_data) { - T_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)win_data->user; - T_ED_DATA *editor = data->editor; - T_ATB_WIN_SIZE *win_size = &data->editor->attr->win_size; - T_DS_TEXTFORMAT format; -// USHORT titleLen; // RAVI + T_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)win_data->user; + T_ED_DATA *editor = data->editor; + T_ATB_WIN_SIZE *win_size = &data->editor->attr->win_size; + T_DS_TEXTFORMAT format; +// USHORT titleLen; // RAVI - TRACE_EVENT("AUI_calc_WinCb"); + TRACE_EVENT("AUI_calc_WinCb"); - if (!data) - return MFW_EVENT_CONSUMED; + if (!data) + return MFW_EVENT_CONSUMED; switch(event) { - case E_WIN_VISIBLE: /* window is visible */ + case E_WIN_VISIBLE: /* window is visible */ if (win_data->flags & E_WIN_VISIBLE) - { - if (editor->update==ED_UPDATE_TRIVIAL) - { - TRACE_EVENT("Only updating editor."); - ATB_edit_Show(data->editor); - } - else - { - TRACE_EVENT("Updating whole screen."); + { + if (editor->update==ED_UPDATE_TRIVIAL) + { + TRACE_EVENT("Only updating editor."); + ATB_edit_Show(data->editor); + } + else + { + TRACE_EVENT("Updating whole screen."); - ATB_edit_Show(data->editor); + ATB_edit_Show(data->editor); - /* Set the colour for drawing title */ + /* Set the colour for drawing title */ - resources_setTitleColour(COLOUR_EDITOR); + resources_setTitleColour(COLOUR_EDITOR); - /* TITLE */ + /* TITLE */ - dspl_Clear(0,0, SCREEN_SIZE_X-1, win_size->py-1); + dspl_Clear(0,0, SCREEN_SIZE_X-1, win_size->py-1); - if (data->haveTitle) - { - ATB_display_SetFormatAttr(&format, 0, FALSE); - ATB_display_Text(0,0,&format, &data->title); - } + if (data->haveTitle) + { + ATB_display_SetFormatAttr(&format, 0, FALSE); + ATB_display_Text(0,0,&format, &data->title); + } - /* RESULT */ + /* RESULT */ - if (data->haveResult) - { - resources_setHLColour(COLOUR_EDITOR); - ATB_display_SetFormatAttr(&format, 0, FALSE); - dspl_Clear( win_size->px, win_size->py+win_size->sy, win_size->px+win_size->sx, - win_size->py+win_size->sy+ATB_display_StringHeight(&data->result, &format)); + if (data->haveResult) + { + resources_setHLColour(COLOUR_EDITOR); + ATB_display_SetFormatAttr(&format, 0, FALSE); + dspl_Clear( win_size->px, win_size->py+win_size->sy, win_size->px+win_size->sx, + win_size->py+win_size->sy+ATB_display_StringHeight(&data->result, &format)); - ATB_display_Text(win_size->px+win_size->sx-ATB_display_StringWidth(&data->result, &format), - win_size->py+win_size->sy,&format, &data->result); - } + ATB_display_Text(win_size->px+win_size->sx-ATB_display_StringWidth(&data->result, &format), + win_size->py+win_size->sy,&format, &data->result); + } - /* Display Soft Keys */ - //xrashmic 20 Oct, 2005 MMI-SPR-33845 - //Need to display the alternate right softkey when the editor is does not contain any character other than 0. - if (data->editor_data.editor_attr.text.len == data->editor_data.min_enter && (data->editor_data.editor_attr.text.data[0] == '0')) - { - /* entered less than the required number of chars: Alternate Softkey appears */ - displaySoftKeys(data->editor_data.LeftSoftKey,data->editor_data.AltRightSoftKey); - } - else - { - /* entered sufficient number of chars: Normal Softkey appears */ - displaySoftKeys(data->editor_data.LeftSoftKey, data->editor_data.RightSoftKey); - } - } - } + /* Display Soft Keys */ + //xrashmic 20 Oct, 2005 MMI-SPR-33845 + //Need to display the alternate right softkey when the editor is does not contain any character other than 0. + if (data->editor_data.editor_attr.text.len == data->editor_data.min_enter && (data->editor_data.editor_attr.text.data[0] == '0')) + { + /* entered less than the required number of chars: Alternate Softkey appears */ + displaySoftKeys(data->editor_data.LeftSoftKey,data->editor_data.AltRightSoftKey); + } + else + { + /* entered sufficient number of chars: Normal Softkey appears */ + displaySoftKeys(data->editor_data.LeftSoftKey, data->editor_data.RightSoftKey); + } + } + } break; } - data->editor->update = ED_UPDATE_DEFAULT; + data->editor->update = ED_UPDATE_DEFAULT; - return MFW_EVENT_CONSUMED; + return MFW_EVENT_CONSUMED; } /******************************************************************************* - $Function: AUI_calc_KbdCb + $Function: AUI_calc_KbdCb - $Description: Calc editor keyboard event handler + $Description: Calc editor keyboard event handler - $Returns: None. + $Returns: None. - $Arguments: event - The keyboard event - keyboard - The keypress info + $Arguments: event - The keyboard event + keyboard - The keypress info *******************************************************************************/ static int AUI_calc_KbdCb(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_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)win_data->user; - ED_RES result; + T_MFW_HND win = mfw_parent (mfw_header()); + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)win_data->user; + ED_RES result; - TRACE_FUNCTION("AUI_calc_KbdCb()"); + TRACE_FUNCTION("AUI_calc_KbdCb()"); /* Suppress unwanted long keypresses */ - data->doNextLongPress = TRUE; /* next Key_long event is correct */ - data->editor->update = ED_UPDATE_DEFAULT; /* Default behaviour is just to update text */ + data->doNextLongPress = TRUE; /* next Key_long event is correct */ + data->editor->update = ED_UPDATE_DEFAULT; /* Default behaviour is just to update text */ - switch (keyboard->code) - { + switch (keyboard->code) + { #ifdef COLOURDISPLAY - case KCD_MNUSELECT: - if (data->editor_data.Callback) - (data->editor_data.Callback) (data->parent, data->editor_data.Identifier, INFO_KCD_SELECT); - break; + case KCD_MNUSELECT: + if (data->editor_data.Callback) + (data->editor_data.Callback) (data->parent, data->editor_data.Identifier, INFO_KCD_SELECT); + break; #endif /* COLOURDISPLAY */ - case KCD_STAR: - if (data->editor_data.Callback) - (data->editor_data.Callback) (data->parent, data->editor_data.Identifier, INFO_KCD_STAR); - break; + case KCD_STAR: + if (data->editor_data.Callback) + (data->editor_data.Callback) (data->parent, data->editor_data.Identifier, INFO_KCD_STAR); + break; - case KCD_HASH: - /* Insert decimal point, if the number doesn't have one already */ - if (!data->hasDecimalPoint) - { - data->hasDecimalPoint = TRUE; - AUI_entry_EditChar(data->entry_data, UNICODE_FULLSTOP, FALSE); - win_show(data->win); - } - break; + case KCD_HASH: + /* Insert decimal point, if the number doesn't have one already */ + if (!data->hasDecimalPoint) + { + data->hasDecimalPoint = TRUE; + AUI_entry_EditChar(data->entry_data, UNICODE_FULLSTOP, FALSE); + win_show(data->win); + } + break; - case KCD_LEFT: - if (data->editor_data.editor_attr.text.len < data->editor_data.min_enter) - { - /* Entered less than the required number of chars */ - if (data->editor_data.AltLeftSoftKey!=TxtNull) - { - /* an alternate softkey is defined: execute it */ - SEND_EVENT (win, E_CALC_DEINIT, INFO_KCD_ALTERNATELEFT, NULL); - } - } - else if (data->editor_data.LeftSoftKey!=TxtNull) - { - /* Left Softkey is enabled (and entered sufficient number of chars): execute it */ - SEND_EVENT (win, E_CALC_DEINIT, INFO_KCD_LEFT, NULL); - } - break; + case KCD_LEFT: + if (data->editor_data.editor_attr.text.len < data->editor_data.min_enter) + { + /* Entered less than the required number of chars */ + if (data->editor_data.AltLeftSoftKey!=TxtNull) + { + /* an alternate softkey is defined: execute it */ + SEND_EVENT (win, E_CALC_DEINIT, INFO_KCD_ALTERNATELEFT, NULL); + } + } + else if (data->editor_data.LeftSoftKey!=TxtNull) + { + /* Left Softkey is enabled (and entered sufficient number of chars): execute it */ + SEND_EVENT (win, E_CALC_DEINIT, INFO_KCD_LEFT, NULL); + } + break; - case KCD_HUP: - SEND_EVENT(data->win, E_CALC_DEINIT, INFO_KCD_HUP, 0); - break; + case KCD_HUP: + SEND_EVENT(data->win, E_CALC_DEINIT, INFO_KCD_HUP, 0); + break; - case KCD_RIGHT: - /* If we're deleting the decimal point... */ - if (ATB_edit_GetCursorChar(data->editor, -1)==UNICODE_FULLSTOP) - { - data->hasDecimalPoint = FALSE; - } + case KCD_RIGHT: + /* If we're deleting the decimal point... */ + if (ATB_edit_GetCursorChar(data->editor, -1)==UNICODE_FULLSTOP) + { + data->hasDecimalPoint = FALSE; + } - /* If we've just got a zero, delete it so we can exit with next call to ATB_edit_DeleteLeft() */ + /* If we've just got a zero, delete it so we can exit with next call to ATB_edit_DeleteLeft() */ - if (ATB_edit_GetCursorChar(data->editor, -1)==ATB_char_Unicode('0')) - { - ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ - } + if (ATB_edit_GetCursorChar(data->editor, -1)==ATB_char_Unicode('0')) + { + ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ + } - /* Perform normal delete */ - result = ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */ + /* Perform normal delete */ + result = ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */ - /* If buffer is now empty, insert '0' */ - if (data->editor->attr->text.len==0 && result!=ED_DONE) - { - AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('0'), FALSE); - } + /* If buffer is now empty, insert '0' */ + if (data->editor->attr->text.len==0 && result!=ED_DONE) + { + AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('0'), FALSE); + } - /* If we've deleted on an empty buffer, exit editor */ - if (result==ED_DONE) - { - SEND_EVENT(data->win, E_CALC_DEINIT, INFO_KCD_RIGHT, 0); - } - else - { - win_show(data->win); - } - break; + /* If we've deleted on an empty buffer, exit editor */ + if (result==ED_DONE) + { + SEND_EVENT(data->win, E_CALC_DEINIT, INFO_KCD_RIGHT, 0); + } + else + { + win_show(data->win); + } + break; - /* 0 - 9 */ + /* 0 - 9 */ - case KCD_0: - case KCD_1: - case KCD_2: - case KCD_3: - case KCD_4: - case KCD_5: - case KCD_6: - case KCD_7: - case KCD_8: - case KCD_9: - /* Remove leading zero */ - if (data->editor->attr->text.len==1 && ATB_edit_GetCursorChar(data->editor, -1)==ATB_char_Unicode('0')) - { - ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ - } + case KCD_0: + case KCD_1: + case KCD_2: + case KCD_3: + case KCD_4: + case KCD_5: + case KCD_6: + case KCD_7: + case KCD_8: + case KCD_9: + /* Remove leading zero */ + if (data->editor->attr->text.len==1 && ATB_edit_GetCursorChar(data->editor, -1)==ATB_char_Unicode('0')) + { + ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ + } - /* Insert the digit */ - AUI_entry_EventKey(data->entry_data, event, keyboard); - win_show(data->win); - break; - } + /* Insert the digit */ + AUI_entry_EventKey(data->entry_data, event, keyboard); + win_show(data->win); + break; + } - return MFW_EVENT_CONSUMED; + return MFW_EVENT_CONSUMED; } /******************************************************************************* - $Function: AUI_calc_KbdLongCb + $Function: AUI_calc_KbdLongCb - $Description: Calc editor long keypress event handler + $Description: Calc editor long keypress event handler - $Returns: None. + $Returns: None. - $Arguments: event - The keyboard event - keyboard - The keypress info + $Arguments: event - The keyboard event + keyboard - The keypress info *******************************************************************************/ static int AUI_calc_KbdLongCb(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_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)win_data->user; - ED_RES result; + T_MFW_HND win = mfw_parent (mfw_header()); + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_CALC_DATA *data = (T_AUI_CALC_DATA *)win_data->user; + ED_RES result; /* Suppress unwanted long keypresses */ - if ( data->doNextLongPress ) - data->doNextLongPress = FALSE; /* mark Key_long event as consumed but do current long press */ - else - return MFW_EVENT_CONSUMED; /* don't do current long press */ + if ( data->doNextLongPress ) + data->doNextLongPress = FALSE; /* mark Key_long event as consumed but do current long press */ + else + return MFW_EVENT_CONSUMED; /* don't do current long press */ - switch (keyboard->code) - { - case KCD_RIGHT: - /* Long press of RSK deletes buffer */ - result = ATB_edit_ClearAll(data->editor); + switch (keyboard->code) + { + case KCD_RIGHT: + /* Long press of RSK deletes buffer */ + result = ATB_edit_ClearAll(data->editor); - /* If buffer is now empty, insert '0' */ - if (data->editor->attr->text.len==0 && result!=ED_DONE) - { - AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('0'), FALSE); - } + /* If buffer is now empty, insert '0' */ + if (data->editor->attr->text.len==0 && result!=ED_DONE) + { + AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('0'), FALSE); + } - /* If we've deleted on an empty buffer, exit editor */ - if (result==ED_DONE) - { - SEND_EVENT(data->win, E_CALC_DEINIT, INFO_KCD_RIGHT, 0); - } - else - { - win_show(data->win); - } - break; - } + /* If we've deleted on an empty buffer, exit editor */ + if (result==ED_DONE) + { + SEND_EVENT(data->win, E_CALC_DEINIT, INFO_KCD_RIGHT, 0); + } + else + { + win_show(data->win); + } + break; + } - return MFW_EVENT_CONSUMED; + return MFW_EVENT_CONSUMED; } diff -r 62480f597962 -r 70ea7526b59e src/ui/bmi/AUIEditor.c --- a/src/ui/bmi/AUIEditor.c Tue Nov 10 07:12:03 2020 +0000 +++ b/src/ui/bmi/AUIEditor.c Sat Nov 14 03:18:11 2020 +0000 @@ -11,17 +11,17 @@ $Project name: Basic MMI $Project code: BMI (6349) - $Module: MMI - $File: AUIEditor.c - $Revision: 1.0 - - $Author: Condat(UK) - $Date: 22/02/01 + $Module: MMI + $File: AUIEditor.c + $Revision: 1.0 + + $Author: Condat(UK) + $Date: 22/02/01 ******************************************************************************** Description: - Generic MMI Editor. + Generic MMI Editor. ******************************************************************************** @@ -35,40 +35,40 @@ Changes: Added new display zone which is located one line above the softkeys. - Mar 14, 2006 DR: OMAPS00061468 - x0035544. - Description: SAT 27.22.4.22.2 SET UP IDLE MODE TEXT (Icon support) fails - Solution : In the function AUI_edit_SetDefault() set the default value for - display_type to SAT_ICON_NONE. - - Jan 16, 2006 DR: OMAPS00061460 - Shashi Shekar B.S. - Description: SAT Icon support - Solution : SAT icon support added. + Mar 14, 2006 DR: OMAPS00061468 - x0035544. + Description: SAT 27.22.4.22.2 SET UP IDLE MODE TEXT (Icon support) fails + Solution : In the function AUI_edit_SetDefault() set the default value for + display_type to SAT_ICON_NONE. + + Jan 16, 2006 DR: OMAPS00061460 - Shashi Shekar B.S. + Description: SAT Icon support + Solution : SAT icon support added. Dec-20-2004 MMI-SPR-27382 xreddymn Added NULL window handle check for AUI_edit_Destroy - Sep 2, 2004 REF: CRR 21370 xkundadu - Description: Giving wrong expected result by long press on "#" key - Fix: When user presses long on '#' key it will display 'p'. - Changed the long press of '*' key to display 'w'. - - Jul 22,2004 CRR:21605 xrashmic - SASKEN - Description: After deleting all the characters in the editor the case does not change to - sentence case. - Fix: After deleting a character, check if editor is empty and then set the case to - sentence case only if the user has not modified the case. - - - Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN - Description: By Long press on Left/Right key at 'Message Editor' screen, - cursor not scrolling continuously - Fix: The Long press of left/right key is now handled in AUI_edit_KbdLongCB. - The continuous long press of a key was being ignored for all keys. Now - only for left and right keys this is handled, for rest of the keys the continuos - long press is ignored. - - - 31/01/02 Original Condat(UK) BMI version. + Sep 2, 2004 REF: CRR 21370 xkundadu + Description: Giving wrong expected result by long press on "#" key + Fix: When user presses long on '#' key it will display 'p'. + Changed the long press of '*' key to display 'w'. + + Jul 22,2004 CRR:21605 xrashmic - SASKEN + Description: After deleting all the characters in the editor the case does not change to + sentence case. + Fix: After deleting a character, check if editor is empty and then set the case to + sentence case only if the user has not modified the case. + + + Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN + Description: By Long press on Left/Right key at 'Message Editor' screen, + cursor not scrolling continuously + Fix: The Long press of left/right key is now handled in AUI_edit_KbdLongCB. + The continuous long press of a key was being ignored for all keys. Now + only for left and right keys this is handled, for rest of the keys the continuos + long press is ignored. + + + 31/01/02 Original Condat(UK) BMI version. $End @@ -162,12 +162,11 @@ #endif - #ifndef MFW_EVENT_PASSED #define MFW_EVENT_PASSED 0 #endif -#define TRACE_AUIEditor // Def/undef this to show/hide the trace_events for this file +#define TRACE_AUIEditor // Def/undef this to show/hide the trace_events for this file static void AUI_edit_ClearPredText(T_AUI_EDITOR_INFO *data); @@ -203,13 +202,13 @@ /******************************************************************************* - $Function: AUI_edit_Start - - $Description: Start the editor. - - $Returns: None. - - $Arguments: None. + $Function: AUI_edit_Start + + $Description: Start the editor. + + $Returns: None. + + $Arguments: None. *******************************************************************************/ @@ -227,32 +226,32 @@ /******************************************************************************* - $Function: AUI_edit_QuickStart - - $Description: Start the editor. - - $Returns: Dialog handler for the editor. - - $Arguments: win - the parent window - TitleId - the text id of the title (or NULL) - TitleString - the text string of the title (or NULL) - buffer - the unicode input buffer - len - maximum length of the text entered - editor_info - the T_AUI_EDITOR_DATA structure (allocated but empty) + $Function: AUI_edit_QuickStart + + $Description: Start the editor. + + $Returns: Dialog handler for the editor. + + $Arguments: win - the parent window + TitleId - the text id of the title (or NULL) + TitleString - the text string of the title (or NULL) + buffer - the unicode input buffer + len - maximum length of the text entered + editor_info - the T_AUI_EDITOR_DATA structure (allocated but empty) *******************************************************************************/ T_MFW_HND AUI_edit_QuickStart(T_MFW_HND win, USHORT TitleId, UBYTE *TitleString, USHORT *buffer, USHORT len, - T_AUI_EDITOR_DATA *editor_info, T_AUI_EDIT_CB editor_cb) + T_AUI_EDITOR_DATA *editor_info, T_AUI_EDIT_CB editor_cb) { TRACE_FUNCTION ("AUI_edit_QuickStart()"); - AUI_edit_SetDisplay(editor_info, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT); - AUI_edit_SetEvents(editor_info, 0, TRUE, FOREVER, editor_cb); - AUI_edit_SetBuffer(editor_info, ATB_DCS_UNICODE, (UBYTE *)buffer, len); - AUI_edit_SetTextStr(editor_info, TxtSoftOK, TxtDelete, TitleId, TitleString); - AUI_edit_SetAltTextStr(editor_info, 0, NULL, TRUE, TxtSoftBack); + AUI_edit_SetDisplay(editor_info, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT); + AUI_edit_SetEvents(editor_info, 0, TRUE, FOREVER, editor_cb); + AUI_edit_SetBuffer(editor_info, ATB_DCS_UNICODE, (UBYTE *)buffer, len); + AUI_edit_SetTextStr(editor_info, TxtSoftOK, TxtDelete, TitleId, TitleString); + AUI_edit_SetAltTextStr(editor_info, 0, NULL, TRUE, TxtSoftBack); /* create the dialog handler */ return AUI_edit_Start(win, editor_info); /* start the common editor */ } @@ -260,53 +259,53 @@ /******************************************************************************* - $Function: AUI_edit_Create - - $Description: Create the editor. - - $Returns: Pointer to the editor's window. - - $Arguments: parent - The parent window. + $Function: AUI_edit_Create + + $Description: Create the editor. + + $Returns: Pointer to the editor's window. + + $Arguments: parent - The parent window. *******************************************************************************/ static T_MFW_HND AUI_edit_Create(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data) { - T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)ALLOC_MEMORY (sizeof (T_AUI_EDITOR_INFO)); - T_MFW_WIN *win_data; + T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)ALLOC_MEMORY (sizeof (T_AUI_EDITOR_INFO)); + T_MFW_WIN *win_data; TRACE_FUNCTION ("AUI_edit_Create()"); - /* Create window handler */ - - data->win = win_create(parent, 0, E_WIN_VISIBLE, (T_MFW_CB)AUI_edit_WinCb); // Create window - - if (data->win==NULL) // Make sure window exists + /* Create window handler */ + + data->win = win_create(parent, 0, E_WIN_VISIBLE, (T_MFW_CB)AUI_edit_WinCb); // Create window + + if (data->win==NULL) // Make sure window exists { - return NULL; + return NULL; } - /* Connect the dialog data to the MFW-window */ - - data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_edit_ExecCb; /* Setup the destination for events */ - data->mmi_control.data = data; - data->parent = parent; - win_data = ((T_MFW_HDR *)data->win)->data; - win_data->user = (void *)data; - - data->kbd = kbd_create(data->win, KEY_ALL,(T_MFW_CB)AUI_edit_KbdCb); - data->kbd_long = kbd_create(data->win, KEY_ALL|KEY_LONG,(T_MFW_CB)AUI_edit_KbdLongCb); - data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0); - - data->editor_data = *editor_data; - - // Jul 22,2004 CRR:21605 xrashmic - SASKEN - // The initial value of this variable should be false. i.e the user has still not changed the case. - CaseChanged=FALSE; - - AUI_edit_Init(data->win); - - SEND_EVENT(data->win, E_ED_INIT, 0, 0); + /* Connect the dialog data to the MFW-window */ + + data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_edit_ExecCb; /* Setup the destination for events */ + data->mmi_control.data = data; + data->parent = parent; + win_data = ((T_MFW_HDR *)data->win)->data; + win_data->user = (void *)data; + + data->kbd = kbd_create(data->win, KEY_ALL,(T_MFW_CB)AUI_edit_KbdCb); + data->kbd_long = kbd_create(data->win, KEY_ALL|KEY_LONG,(T_MFW_CB)AUI_edit_KbdLongCb); + data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0); + + data->editor_data = *editor_data; + + // Jul 22,2004 CRR:21605 xrashmic - SASKEN + // The initial value of this variable should be false. i.e the user has still not changed the case. + CaseChanged=FALSE; + + AUI_edit_Init(data->win); + + SEND_EVENT(data->win, E_ED_INIT, 0, 0); /* Return window handle */ @@ -316,97 +315,97 @@ /******************************************************************************* - $Function: AUI_edit_Init - - $Description: Initialise the editor. - - $Returns: Pointer to the editor's window. - - $Arguments: win - The editor window + $Function: AUI_edit_Init + + $Description: Initialise the editor. + + $Returns: Pointer to the editor's window. + + $Arguments: win - The editor window *******************************************************************************/ static void AUI_edit_Init(T_MFW_HND win) { - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; - T_ATB_TEXT text={0,0,NULL}; - - TRACE_FUNCTION("AUI_edit_Init()"); - - data->editor->update = ED_UPDATE_FULL; - data->predText.len = 0; /* Blank out predictive text buffer */ - - /* Set up title information */ - - data->hasTitle = FALSE; - data->title.len = 0; /* Blank out title buffer */ - - if (data->editor_data.TitleId!=NULL) - { - data->hasTitle = TRUE; - text.data = (UBYTE *)GET_TEXT(data->editor_data.TitleId); - } - else if (data->editor_data.TitleString!=NULL) - { - data->hasTitle = TRUE; - text.data = data->editor_data.TitleString; - } - - /* If title exists, get its dcs and length */ - - if (data->hasTitle) - { - if (text.data[0]==0x80) - { - text.data += 2; /* Skip over two unicode indicator bytes */ - text.dcs = ATB_DCS_UNICODE; - } + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; + T_ATB_TEXT text={0,0,NULL}; + + TRACE_FUNCTION("AUI_edit_Init()"); + + data->editor->update = ED_UPDATE_FULL; + data->predText.len = 0; /* Blank out predictive text buffer */ + + /* Set up title information */ + + data->hasTitle = FALSE; + data->title.len = 0; /* Blank out title buffer */ + + if (data->editor_data.TitleId!=NULL) + { + data->hasTitle = TRUE; + text.data = (UBYTE *)GET_TEXT(data->editor_data.TitleId); + } + else if (data->editor_data.TitleString!=NULL) + { + data->hasTitle = TRUE; + text.data = data->editor_data.TitleString; + } + + /* If title exists, get its dcs and length */ + + if (data->hasTitle) + { + if (text.data[0]==0x80) + { + text.data += 2; /* Skip over two unicode indicator bytes */ + text.dcs = ATB_DCS_UNICODE; + } #ifdef EASY_TEXT_ENABLED - else if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - { - text.dcs = ATB_DCS_UNICODE; - } + else if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + { + text.dcs = ATB_DCS_UNICODE; + } #endif - else - { - text.dcs = ATB_DCS_ASCII; - } - - text.len = ATB_string_Length(&text); - - /* Allocate memory for the title and copy the text there */ - data->title.data = (UBYTE *)ALLOC_MEMORY((text.len + 1)*ATB_string_Size(&text)); - - ATB_string_Copy(&data->title, &text); - } + else + { + text.dcs = ATB_DCS_ASCII; + } + + text.len = ATB_string_Length(&text); + + /* Allocate memory for the title and copy the text there */ + data->title.data = (UBYTE *)ALLOC_MEMORY((text.len + 1)*ATB_string_Size(&text)); + + ATB_string_Copy(&data->title, &text); + } /* Set up correct parameters for easytext */ #ifdef EASY_TEXT_ENABLED - if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) - { - /* Allocate word buffer memory */ - - data->predText.data = (UBYTE *)ALLOC_MEMORY((ED_PREDTEXT_MAX+1)*sizeof(UBYTE)); - data->predText.dcs = ATB_DCS_ASCII; - data->predText.len = 0; - - FFS_flashData.PredTextAvailable = TRUE; - Initialize_Dict(Mmi_getCurrentLanguage()/*SPR1508*/, 0); - ResetDictSearch(); - } + if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) + { + /* Allocate word buffer memory */ + + data->predText.data = (UBYTE *)ALLOC_MEMORY((ED_PREDTEXT_MAX+1)*sizeof(UBYTE)); + data->predText.dcs = ATB_DCS_ASCII; + data->predText.len = 0; + + FFS_flashData.PredTextAvailable = TRUE; + Initialize_Dict(Mmi_getCurrentLanguage()/*SPR1508*/, 0); + ResetDictSearch(); + } #endif - /* Initialise editor */ - - ATB_edit_Init(data->editor); - - /* Initialise text entry */ - - data->entry_data = AUI_entry_Create(data->win, data->editor, E_ED_UPDATE); - - /* If there's a timeout, create the timer */ + /* Initialise editor */ + + ATB_edit_Init(data->editor); + + /* Initialise text entry */ + + data->entry_data = AUI_entry_Create(data->win, data->editor, E_ED_UPDATE); + + /* If there's a timeout, create the timer */ if (data->editor_data.timeout && (data->editor_data.timeout != FOREVER)) { @@ -420,7 +419,7 @@ /* Title timer, if required, is set up in WinCb */ - data->title_timer = NULL; + data->title_timer = NULL; return; } @@ -428,75 +427,75 @@ /******************************************************************************* - $Function: AUI_edit_Destroy - - $Description: Destroy the editor. - - $Returns: None. - - $Arguments: window - The editor window. + $Function: AUI_edit_Destroy + + $Description: Destroy the editor. + + $Returns: None. + + $Arguments: window - The editor window. *******************************************************************************/ void AUI_edit_Destroy(T_MFW_HND win) { - T_MFW_WIN *win_data; - T_AUI_EDITOR_INFO *data; + T_MFW_WIN *win_data; + T_AUI_EDITOR_INFO *data; #ifdef TRACE_AUIEditor TRACE_FUNCTION ("AUI_edit_Destroy()"); #endif - if (win == NULL) - { + if (win == NULL) + { #ifdef TRACE_AUIEditor - TRACE_EVENT ("Error : Called with NULL Pointer"); + TRACE_EVENT ("Error : Called with NULL Pointer"); #endif - return; - } - // xreddymn Dec-21-2004 MMI-SPR-27382: Added NULL window handle check for AUI_edit_Destroy - win_data = ((T_MFW_HDR *)win)->data; - if(win_data == NULL) return; - data = (T_AUI_EDITOR_INFO *)win_data->user; + return; + } + // xreddymn Dec-21-2004 MMI-SPR-27382: Added NULL window handle check for AUI_edit_Destroy + win_data = ((T_MFW_HDR *)win)->data; + if(win_data == NULL) return; + data = (T_AUI_EDITOR_INFO *)win_data->user; if (data) { - /* Free memory allocated for easytext buffer */ + /* Free memory allocated for easytext buffer */ #ifdef EASY_TEXT_ENABLED - if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA) && data->predText.data ) - { - TRACE_EVENT("Freeing predictive text buffer"); - FREE_MEMORY((void *)data->predText.data, (ED_PREDTEXT_MAX+1)*sizeof(UBYTE)); - } + if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA) && data->predText.data ) + { + TRACE_EVENT("Freeing predictive text buffer"); + FREE_MEMORY((void *)data->predText.data, (ED_PREDTEXT_MAX+1)*sizeof(UBYTE)); + } #endif - /* Free memory allocated for title */ - - if (data->hasTitle) - { - FREE_MEMORY(data->title.data, (data->title.len + 1)*ATB_string_Size(&data->title)); - } - - /* Delete timers */ - - if (data->timer) - { - tim_delete(data->timer); - data->timer = NULL; - } - if (data->title_timer) - { - tim_delete(data->title_timer); - data->title_timer = NULL; - } + /* Free memory allocated for title */ + + if (data->hasTitle) + { + FREE_MEMORY(data->title.data, (data->title.len + 1)*ATB_string_Size(&data->title)); + } + + /* Delete timers */ + + if (data->timer) + { + tim_delete(data->timer); + data->timer = NULL; + } + if (data->title_timer) + { + tim_delete(data->title_timer); + data->title_timer = NULL; + } win_delete (data->win); - /* Free editor memory */ - - AUI_entry_Destroy(data->entry_data); - ATB_edit_Destroy(data->editor); - FREE_MEMORY ((void *)data, sizeof (T_AUI_EDITOR_INFO)); + /* Free editor memory */ + + AUI_entry_Destroy(data->entry_data); + ATB_edit_Destroy(data->editor); + FREE_MEMORY ((void *)data, sizeof (T_AUI_EDITOR_INFO)); } return; @@ -505,27 +504,27 @@ /******************************************************************************* - $Function: AUI_edit_ExecCb - - $Description: Dialog function for editor. - - $Returns: None. - - $Arguments: None. + $Function: AUI_edit_ExecCb + + $Description: Dialog function for editor. + + $Returns: None. + + $Arguments: None. *******************************************************************************/ static void AUI_edit_ExecCb(T_MFW_HND win, USHORT event, USHORT value, void *parameter) { - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; - - T_MFW_HND parent_win = data->parent; - USHORT alphachar; - /* Store these in case editor is destroyed on callback */ - USHORT Identifier = data->editor_data.Identifier; - T_AUI_EDIT_CB Callback = data->editor_data.Callback; - UBYTE destroyEditor = data->editor_data.destroyEditor; + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; + + T_MFW_HND parent_win = data->parent; + USHORT alphachar; + /* Store these in case editor is destroyed on callback */ + USHORT Identifier = data->editor_data.Identifier; + T_AUI_EDIT_CB Callback = data->editor_data.Callback; + UBYTE destroyEditor = data->editor_data.destroyEditor; /* Mar 08, 2006 REF:ER OMAPS00065168 */ #ifdef NEPTUNE_BOARD @@ -538,22 +537,22 @@ switch (event) { - /* Initialise */ + /* Initialise */ case E_ED_INIT: - TRACE_EVENT("E_ED_INIT"); - win_show(data->win); - break; - - /* Destroy the editor */ - - case E_ED_DESTROY: - AUI_edit_Destroy(data->win); - break; - - /* De-initialise editor */ + TRACE_EVENT("E_ED_INIT"); + win_show(data->win); + break; + + /* Destroy the editor */ + + case E_ED_DESTROY: + AUI_edit_Destroy(data->win); + break; + + /* De-initialise editor */ case E_ED_DEINIT: - TRACE_EVENT("E_ED_DEINIT"); + TRACE_EVENT("E_ED_DEINIT"); /* Mar 08, 2006 REF:ER OMAPS00065168 */ /* Stop playing ring tone on key press */ @@ -564,50 +563,50 @@ vsi_t_sleep(0,10); /* small delay */ #endif - if (Callback) - (Callback) (parent_win, Identifier, value); - - if(destroyEditor) - AUI_edit_Destroy(data->win); + if (Callback) + (Callback) (parent_win, Identifier, value); + + if(destroyEditor) + AUI_edit_Destroy(data->win); break; - /* Insert a character */ - - case E_ED_INSERT: - alphachar = (USHORT)value; - /* If value is set, insert character */ - if (alphachar!=NULL) - { - ATB_edit_Char(data->editor, alphachar, TRUE); + /* Insert a character */ + + case E_ED_INSERT: + alphachar = (USHORT)value; + /* If value is set, insert character */ + if (alphachar!=NULL) + { + ATB_edit_Char(data->editor, alphachar, TRUE); #ifdef EASY_TEXT_ENABLED - if(FFS_flashData.PredTextAvailable && FFS_flashData.PredTextSelected && ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) - { - if ((alphachar == UNICODE_FULLSTOP) ||(alphachar == UNICODE_EXCLAMATION) - || (alphachar == UNICODE_QUESTION)) - { - ATB_edit_Char(data->editor, UNICODE_SPACE, TRUE); - } - } + if(FFS_flashData.PredTextAvailable && FFS_flashData.PredTextSelected && ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) + { + if ((alphachar == UNICODE_FULLSTOP) ||(alphachar == UNICODE_EXCLAMATION) + || (alphachar == UNICODE_QUESTION)) + { + ATB_edit_Char(data->editor, UNICODE_SPACE, TRUE); + } + } #endif - } - else - /* If parameter is set, insert string */ - if (parameter!=NULL) - { - ATB_edit_InsertString(data->editor, (T_ATB_TEXT *)parameter); - } - win_show(data->win); - break; - - /* Update word wrap & redraw editor window */ - - case E_ED_UPDATE: - //ATB_edit_Refresh(data->editor); /* SPR#2342 - SH */ - win_show(data->win); - break; + } + else + /* If parameter is set, insert string */ + if (parameter!=NULL) + { + ATB_edit_InsertString(data->editor, (T_ATB_TEXT *)parameter); + } + win_show(data->win); + break; + + /* Update word wrap & redraw editor window */ + + case E_ED_UPDATE: + //ATB_edit_Refresh(data->editor); /* SPR#2342 - SH */ + win_show(data->win); + break; default: - break; + break; } return; } @@ -615,56 +614,54 @@ /******************************************************************************* - $Function: AUI_edit_WinCb - - $Description: Editor window event handler. - - $Returns: None. - - $Arguments: event - the event - win - the editor window + $Function: AUI_edit_WinCb + + $Description: Editor window event handler. + + $Returns: None. + + $Arguments: event - the event + win - the editor window *******************************************************************************/ static int AUI_edit_WinCb(T_MFW_EVENT event, T_MFW_WIN *win_data) { - T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; - T_ED_DATA *editor = data->editor; - USHORT scrollBarSize; - USHORT scrollBarPos; - SHORT editX = editor->attr->win_size.px; - SHORT editY = editor->attr->win_size.py; - SHORT editWidth = editor->attr->win_size.sx; - SHORT editHeight = editor->attr->win_size.sy; - char lengthIndC[12]; - - /* Strings for the header */ - T_ATB_TEXT string; - USHORT stringWidth; - USHORT stringHeight; - T_ATB_TEXT title; - USHORT titleWidth; - USHORT titleHeight; - - USHORT textLen; - - - - - T_DS_TEXTFORMAT format; - BOOL showIcons; /* Flag that stores whether icons (e.g. alignment icons) should be shown */ - - USHORT leftSK; - USHORT rightSK; - USHORT textIndex; - T_ATB_TEXT newTitle; - USHORT lastSpace; - USHORT character; + T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; + T_ED_DATA *editor = data->editor; + USHORT scrollBarSize; + USHORT scrollBarPos; + SHORT editX = editor->attr->win_size.px; + SHORT editY = editor->attr->win_size.py; + SHORT editWidth = editor->attr->win_size.sx; + SHORT editHeight = editor->attr->win_size.sy; + char lengthIndC[12]; + + /* Strings for the header */ + T_ATB_TEXT string; + USHORT stringWidth; + USHORT stringHeight; + T_ATB_TEXT title; + USHORT titleWidth; + USHORT titleHeight; + + USHORT textLen; + + + T_DS_TEXTFORMAT format; + BOOL showIcons; /* Flag that stores whether icons (e.g. alignment icons) should be shown */ + + USHORT leftSK; + USHORT rightSK; + USHORT textIndex; + T_ATB_TEXT newTitle; + USHORT lastSpace; + USHORT character; // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 #ifdef FF_MMI_SAT_ICON - SHORT titleIconWidth = 0; - SHORT iconX; - SHORT iconY; + SHORT titleIconWidth = 0; + SHORT iconX; + SHORT iconY; #endif #ifdef TRACE_AUIEditor @@ -672,408 +669,406 @@ #endif if (!data) - return MFW_EVENT_CONSUMED; + return MFW_EVENT_CONSUMED; switch(event) { - case E_WIN_VISIBLE: /* window is visible */ + case E_WIN_VISIBLE: /* window is visible */ if (win_data->flags & E_WIN_VISIBLE) - { + { // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 #ifdef FF_MMI_SAT_ICON - if (editor->attr->TitleIcon.data != NULL) - { - if (editor->attr->TitleIcon.width > TITLE_ICON_WIDTH) - { - titleIconWidth = TITLE_ICON_WIDTH; - } - else - { - titleIconWidth = editor->attr->TitleIcon.width; - } - } - else - { - titleIconWidth = 0; - } + if (editor->attr->TitleIcon.data != NULL) + { + if (editor->attr->TitleIcon.width > TITLE_ICON_WIDTH) + { + titleIconWidth = TITLE_ICON_WIDTH; + } + else + { + titleIconWidth = editor->attr->TitleIcon.width; + } + } + else + { + titleIconWidth = 0; + } #endif - textLen = data->editor->attr->text.len; - ATB_edit_LineGet(data->editor, data->editor->winStartLine); - - - if (editor->update==ED_UPDATE_TRIVIAL) + textLen = data->editor->attr->text.len; + ATB_edit_LineGet(data->editor, data->editor->winStartLine); + + + if (editor->update==ED_UPDATE_TRIVIAL) editor->update = ED_UPDATE_DEFAULT; - TRACE_EVENT("Updating whole screen."); - - - - - /* Show the edited text */ - /* Don't update editor text if in ED_UPDATE_PARTIAL */ - - if (editor->update!=ED_UPDATE_PARTIAL) - { - ATB_edit_Show(data->editor); - } - - /* Set the colour for drawing title and scrollbar */ - - resources_setTitleColour(COLOUR_EDITOR); - - /* TITLE */ - - if (data->editor_data.zone_id & ZONE_TITLE) - { - dspl_Clear(0,0, SCREEN_SIZE_X-1, editY-1); - - /* Display the title, if it exists */ - - string.len = 0; - string.dcs = ATB_DCS_ASCII; - title.len = 0; - title.dcs = ATB_DCS_ASCII; - - if (data->hasTitle) - { - title.data = data->title.data; - title.len = data->title.len; - title.dcs = data->title.dcs; - } - - /* Uppercase/lowercase indicator */ - - if (!ATB_edit_Mode(editor, ED_MODE_READONLY)) - { - switch(ATB_edit_GetCasePref(editor)) - { - case ED_CASEPREF_ALPHA_UC: - case ED_CASEPREF_ALPHANUM_UC: - string.data = (UBYTE *)ED_IND_UPPER; - break; - - case ED_CASEPREF_ALPHA_LC: - case ED_CASEPREF_ALPHANUM_LC: - string.data = (UBYTE *)ED_IND_LOWER; - break; - - case ED_CASEPREF_ALPHANUM: - if (ATB_edit_GetCase(editor)==ED_CASE_UPPER) - string.data = (UBYTE *)ED_IND_UPPER; - else if (ATB_edit_GetCase(editor)==ED_CASE_LOWER) - string.data = (UBYTE *)ED_IND_LOWER; - else if (ATB_edit_GetCase(editor)==ED_CASE_CAPS) - string.data = (UBYTE *)ED_IND_CAPS; - else - string.data = (UBYTE *)ED_IND_NUM; - break; - - case ED_CASEPREF_NUM: - string.data = (UBYTE *)ED_IND_NUM; - break; - - default: - string.data = (UBYTE *)ED_IND_NONE; - break; - } - - string.len = ATB_string_Length(&string); + TRACE_EVENT("Updating whole screen."); + + + /* Show the edited text */ + /* Don't update editor text if in ED_UPDATE_PARTIAL */ + + if (editor->update!=ED_UPDATE_PARTIAL) + { + ATB_edit_Show(data->editor); + } + + /* Set the colour for drawing title and scrollbar */ + + resources_setTitleColour(COLOUR_EDITOR); + + /* TITLE */ + + if (data->editor_data.zone_id & ZONE_TITLE) + { + dspl_Clear(0,0, SCREEN_SIZE_X-1, editY-1); + + /* Display the title, if it exists */ + + string.len = 0; + string.dcs = ATB_DCS_ASCII; + title.len = 0; + title.dcs = ATB_DCS_ASCII; + + if (data->hasTitle) + { + title.data = data->title.data; + title.len = data->title.len; + title.dcs = data->title.dcs; + } + + /* Uppercase/lowercase indicator */ + + if (!ATB_edit_Mode(editor, ED_MODE_READONLY)) + { + switch(ATB_edit_GetCasePref(editor)) + { + case ED_CASEPREF_ALPHA_UC: + case ED_CASEPREF_ALPHANUM_UC: + string.data = (UBYTE *)ED_IND_UPPER; + break; + + case ED_CASEPREF_ALPHA_LC: + case ED_CASEPREF_ALPHANUM_LC: + string.data = (UBYTE *)ED_IND_LOWER; + break; + + case ED_CASEPREF_ALPHANUM: + if (ATB_edit_GetCase(editor)==ED_CASE_UPPER) + string.data = (UBYTE *)ED_IND_UPPER; + else if (ATB_edit_GetCase(editor)==ED_CASE_LOWER) + string.data = (UBYTE *)ED_IND_LOWER; + else if (ATB_edit_GetCase(editor)==ED_CASE_CAPS) + string.data = (UBYTE *)ED_IND_CAPS; + else + string.data = (UBYTE *)ED_IND_NUM; + break; + + case ED_CASEPREF_NUM: + string.data = (UBYTE *)ED_IND_NUM; + break; + + default: + string.data = (UBYTE *)ED_IND_NONE; + break; + } + + string.len = ATB_string_Length(&string); #ifdef EASY_TEXT_ENABLED - /* Display predicted word in header */ - - if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected) - { - if (ATB_edit_CapitaliseWord(data->editor)) /* Word is capitalised */ - string.data = (UBYTE *)ED_IND_CAPS; - else - string.data = (UBYTE *)ED_IND_LOWER; - string.len = ATB_string_Length(&string); - - if(data->predText.len!=0) - { - title.data = data->predText.data; - title.len = data->predText.len; - title.dcs = data->predText.dcs; - } - } + /* Display predicted word in header */ + + if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected) + { + if (ATB_edit_CapitaliseWord(data->editor)) /* Word is capitalised */ + string.data = (UBYTE *)ED_IND_CAPS; + else + string.data = (UBYTE *)ED_IND_LOWER; + string.len = ATB_string_Length(&string); + + if(data->predText.len!=0) + { + title.data = data->predText.data; + title.len = data->predText.len; + title.dcs = data->predText.dcs; + } + } #endif - if (ATB_edit_Mode(editor, ED_MODE_ALPHA) && title.len==0) - { - /* SPR#1995 - SH - 'size' includes null terminator, so - * remaining characters is size-1 */ + if (ATB_edit_Mode(editor, ED_MODE_ALPHA) && title.len==0) + { + /* SPR#1995 - SH - 'size' includes null terminator, so + * remaining characters is size-1 */ #ifdef LSCREEN - sprintf(lengthIndC, "%d/%d", textLen, editor->attr->size-1); + sprintf(lengthIndC, "%d/%d", textLen, editor->attr->size-1); #else - sprintf(lengthIndC, "%d", editor->attr->size-textLen-1); + sprintf(lengthIndC, "%d", editor->attr->size-textLen-1); #endif - title.data = (UBYTE *)lengthIndC; - title.len = ATB_string_Length(&title); - } - } - - /* Draw the string to the right of the editor - the case/format indicator, and icons (if appropriate) */ - - stringWidth = 0; - stringHeight = 0; - showIcons = FALSE; - - if (string.len) - { - TRACE_EVENT("Displaying string on right"); - ATB_display_SetFormatAttr(&format, 0, FALSE); /* Set format to format at cursor */ - stringWidth = ATB_display_StringWidth(&string, &format)+2; - stringHeight = ATB_display_StringHeight(&string, &format); - ATB_display_Text(SCREEN_SIZE_X-stringWidth+2,0, &format, &string); - showIcons = TRUE; /* If showing case, show icons */ - } + title.data = (UBYTE *)lengthIndC; + title.len = ATB_string_Length(&title); + } + } + + /* Draw the string to the right of the editor - the case/format indicator, and icons (if appropriate) */ + + stringWidth = 0; + stringHeight = 0; + showIcons = FALSE; + + if (string.len) + { + TRACE_EVENT("Displaying string on right"); + ATB_display_SetFormatAttr(&format, 0, FALSE); /* Set format to format at cursor */ + stringWidth = ATB_display_StringWidth(&string, &format)+2; + stringHeight = ATB_display_StringHeight(&string, &format); + ATB_display_Text(SCREEN_SIZE_X-stringWidth+2,0, &format, &string); + showIcons = TRUE; /* If showing case, show icons */ + } #ifdef EASY_TEXT_ENABLED - /* Display ezitext icon to the left of the case indicator */ - - if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected == TRUE) - { - if (data->predText.len==0) // Show icons only if there's no predicted text entry currently - showIcons = TRUE; - else - showIcons = FALSE; - } + /* Display ezitext icon to the left of the case indicator */ + + if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected == TRUE) + { + if (data->predText.len==0) // Show icons only if there's no predicted text entry currently + showIcons = TRUE; + else + showIcons = FALSE; + } #endif - /* Show icons to the left of the case indicator */ - - if (showIcons) - { + /* Show icons to the left of the case indicator */ + + if (showIcons) + { #ifdef EASY_TEXT_ENABLED - /* Display ezitext icon to the left of the case indicator */ - if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected == TRUE) - { - stringWidth += 8; - dspl_BitBlt(SCREEN_SIZE_X-stringWidth+2, - 0,8,8,0,(char*)TextIconeZiTextSmall,0); - } + /* Display ezitext icon to the left of the case indicator */ + if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected == TRUE) + { + stringWidth += 8; + dspl_BitBlt(SCREEN_SIZE_X-stringWidth+2, + 0,8,8,0,(char*)TextIconeZiTextSmall,0); + } #endif - if (stringHeight(SCREEN_SIZE_X-stringWidth-2)) - { - /* Create timer if it doesn't exist */ - - if (!data->title_timer) - { - data->title_timer = tim_create(data->win, 3000, (T_MFW_CB)AUI_edit_TitleTimerCb); - data->title_pos = 0; - data->title_next_pos = 0; - tim_start(data->title_timer); - } - - titleWidth = 0; - textIndex = data->title_pos; - lastSpace = 0; - - while (titleWidth<(SCREEN_SIZE_X-stringWidth-2) && textIndextitle_next_pos = 0; - else - { - /* Word wrap to last space, if there was one */ - - if (lastSpace>0) - textIndex = lastSpace; - data->title_next_pos = textIndex; - } - - TRACE_EVENT_P1("Next position: %d", data->title_next_pos); - - newTitle.len = textIndex-data->title_pos; - newTitle.data = (UBYTE *)ALLOC_MEMORY((newTitle.len+1)*ATB_string_Size(&title)); - newTitle.dcs = title.dcs; - - for (textIndex=0; textIndextitle_pos+textIndex)); - } - ATB_string_SetChar(&newTitle, newTitle.len, UNICODE_EOLN); + if (stringHeight(SCREEN_SIZE_X-stringWidth-2)) + { + /* Create timer if it doesn't exist */ + + if (!data->title_timer) + { + data->title_timer = tim_create(data->win, 3000, (T_MFW_CB)AUI_edit_TitleTimerCb); + data->title_pos = 0; + data->title_next_pos = 0; + tim_start(data->title_timer); + } + + titleWidth = 0; + textIndex = data->title_pos; + lastSpace = 0; + + while (titleWidth<(SCREEN_SIZE_X-stringWidth-2) && textIndextitle_next_pos = 0; + else + { + /* Word wrap to last space, if there was one */ + + if (lastSpace>0) + textIndex = lastSpace; + data->title_next_pos = textIndex; + } + + TRACE_EVENT_P1("Next position: %d", data->title_next_pos); + + newTitle.len = textIndex-data->title_pos; + newTitle.data = (UBYTE *)ALLOC_MEMORY((newTitle.len+1)*ATB_string_Size(&title)); + newTitle.dcs = title.dcs; + + for (textIndex=0; textIndextitle_pos+textIndex)); + } + ATB_string_SetChar(&newTitle, newTitle.len, UNICODE_EOLN); // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 #ifdef FF_MMI_SAT_ICON - /* Check if the icon is self-explanatory, GSM 11.14, Sec 6.5.4, 12.32. - If the icon is to displayed, move the text by icon width. */ - if (editor->attr->TitleIcon.selfExplanatory == FALSE) - ATB_display_Text(titleIconWidth+1,0,&format, &newTitle); + /* Check if the icon is self-explanatory, GSM 11.14, Sec 6.5.4, 12.32. + If the icon is to displayed, move the text by icon width. */ + if (editor->attr->TitleIcon.selfExplanatory == FALSE) + ATB_display_Text(titleIconWidth+1,0,&format, &newTitle); #else - ATB_display_Text(0,0,&format, &newTitle); + ATB_display_Text(0,0,&format, &newTitle); #endif - FREE_MEMORY((UBYTE *)newTitle.data, (newTitle.len+1)*ATB_string_Size(&title)); - } - else + FREE_MEMORY((UBYTE *)newTitle.data, (newTitle.len+1)*ATB_string_Size(&title)); + } + else // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 #ifdef FF_MMI_SAT_ICON - { - /* Check if the icon is self-explanatory, GSM 11.14, Sec 6.5.4, 12.32. - If the icon is to displayed, move the text by icon width. */ - if (editor->attr->TitleIcon.selfExplanatory == FALSE) - ATB_display_Text(titleIconWidth+1,0,&format, &title); - } + { + /* Check if the icon is self-explanatory, GSM 11.14, Sec 6.5.4, 12.32. + If the icon is to displayed, move the text by icon width. */ + if (editor->attr->TitleIcon.selfExplanatory == FALSE) + ATB_display_Text(titleIconWidth+1,0,&format, &title); + } #else - ATB_display_Text(0,0,&format, &title); + ATB_display_Text(0,0,&format, &title); #endif #ifdef EASY_TEXT_ENABLED - /* Provides a cursor in the predicted word, so the user can tell which of the characters - * entered are being used to select the word. */ - - if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected && data->predText.len!=0) - { - ATB_display_Cursor(&data->predText, data->predTextChar.pos, ED_CURSOR_BLOCK, - data->predTextChar.lineWidth, 0, data->predTextChar.width, data->predTextChar.height); - } + /* Provides a cursor in the predicted word, so the user can tell which of the characters + * entered are being used to select the word. */ + + if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected && data->predText.len!=0) + { + ATB_display_Cursor(&data->predText, data->predTextChar.pos, ED_CURSOR_BLOCK, + data->predTextChar.lineWidth, 0, data->predTextChar.width, data->predTextChar.height); + } #endif - } + } // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 #ifdef FF_MMI_SAT_ICON - if(editor->attr->TitleIcon.data != NULL) - { - - if (titleHeight == 0) - titleHeight = TITLE_ICON_HEIGHT; - - /* Display '?' icon if the size is bigger, - else display the icon*/ - if ((editor->attr->TitleIcon.width > TITLE_ICON_WIDTH) || (editor->attr->TitleIcon.height > TITLE_ICON_HEIGHT)) - { - /* iconY calculates place hoilder to place the icon - at the center of the screen. */ - iconX = 1; - iconY = 1+ ((titleHeight-2) / 2) - (10 / 2); - dspl_BitBlt2(iconX, iconY, 8, - 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); - } - else - { - /* iconY calculates place hoilder to place the icon - at the center of the screen. */ - iconX = 1; - iconY = 1+ ((titleHeight-2) / 2) - (editor->attr->TitleIcon.height / 2); - dspl_BitBlt2(iconX, iconY, editor->attr->TitleIcon.width, editor->attr->TitleIcon.height, - (void*)editor->attr->TitleIcon.data, 0, BMP_FORMAT_256_COLOUR); - } - } + if(editor->attr->TitleIcon.data != NULL) + { + + if (titleHeight == 0) + titleHeight = TITLE_ICON_HEIGHT; + + /* Display '?' icon if the size is bigger, + else display the icon*/ + if ((editor->attr->TitleIcon.width > TITLE_ICON_WIDTH) || (editor->attr->TitleIcon.height > TITLE_ICON_HEIGHT)) + { + /* iconY calculates place hoilder to place the icon + at the center of the screen. */ + iconX = 1; + iconY = 1+ ((titleHeight-2) / 2) - (10 / 2); + dspl_BitBlt2(iconX, iconY, 8, + 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); + } + else + { + /* iconY calculates place hoilder to place the icon + at the center of the screen. */ + iconX = 1; + iconY = 1+ ((titleHeight-2) / 2) - (editor->attr->TitleIcon.height / 2); + dspl_BitBlt2(iconX, iconY, editor->attr->TitleIcon.width, editor->attr->TitleIcon.height, + (void*)editor->attr->TitleIcon.data, 0, BMP_FORMAT_256_COLOUR); + } + } #endif - /* Draw line on top */ - - if (stringHeight>titleHeight) - titleHeight = stringHeight; - - /* Non colour display - draw line between title texts*/ + /* Draw line on top */ + + if (stringHeight>titleHeight) + titleHeight = stringHeight; + + /* Non colour display - draw line between title texts*/ #ifndef LSCREEN - if (titleHeight>0) - { - if (stringWidth==0) - stringWidth = 1; /* Make sure end of line is on-screen */ - dspl_DrawLine(titleWidth, titleHeight/2, SCREEN_SIZE_X-stringWidth, titleHeight/2); /* Line between title & indicator */ - } + if (titleHeight>0) + { + if (stringWidth==0) + stringWidth = 1; /* Make sure end of line is on-screen */ + dspl_DrawLine(titleWidth, titleHeight/2, SCREEN_SIZE_X-stringWidth, titleHeight/2); /* Line between title & indicator */ + } #endif - } - - /* SCROLLBAR */ - - if (data->editor_data.zone_id & ZONE_SCROLLBAR) - { - dspl_Clear(editX+editWidth, editY, editX+editWidth+ED_SCROLLBAR_WIDTH-1, editY+editHeight-1); - - /* Vertical scrollbar - only show if editor is taller than view size */ - - if (editor->totalHeight > 0 && editor->viewHeighttotalHeight) - { - dspl_DrawLine(editX+editWidth, editY, editX+editWidth, editY+editHeight-1); - scrollBarSize = editor->viewHeight * editHeight / editor->totalHeight; - if (scrollBarSize>editHeight) - scrollBarSize = editHeight; - scrollBarPos = editor->viewStartPos * editHeight / editor->totalHeight; - - dspl_DrawLine(editX+editWidth+1, editY+scrollBarPos, editX+editWidth+1, - editY+scrollBarPos+scrollBarSize); - dspl_DrawLine(editX+editWidth+2, editY+scrollBarPos, editX+editWidth+2, - editY+scrollBarPos+scrollBarSize); - } - } - - /* SOFTKEYS */ - - if (data->editor_data.zone_id & ZONE_SOFTKEYS) - { + } + + /* SCROLLBAR */ + + if (data->editor_data.zone_id & ZONE_SCROLLBAR) + { + dspl_Clear(editX+editWidth, editY, editX+editWidth+ED_SCROLLBAR_WIDTH-1, editY+editHeight-1); + + /* Vertical scrollbar - only show if editor is taller than view size */ + + if (editor->totalHeight > 0 && editor->viewHeighttotalHeight) + { + dspl_DrawLine(editX+editWidth, editY, editX+editWidth, editY+editHeight-1); + scrollBarSize = editor->viewHeight * editHeight / editor->totalHeight; + if (scrollBarSize>editHeight) + scrollBarSize = editHeight; + scrollBarPos = editor->viewStartPos * editHeight / editor->totalHeight; + + dspl_DrawLine(editX+editWidth+1, editY+scrollBarPos, editX+editWidth+1, + editY+scrollBarPos+scrollBarSize); + dspl_DrawLine(editX+editWidth+2, editY+scrollBarPos, editX+editWidth+2, + editY+scrollBarPos+scrollBarSize); + } + } + + /* SOFTKEYS */ + + if (data->editor_data.zone_id & ZONE_SOFTKEYS) + { #ifdef EASY_TEXT_ENABLED - /* If a word is being entered, display OK and Delete */ - - if (ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT) && data->predText.len!=0 && FFS_flashData.PredTextSelected == TRUE) - { - leftSK = TxtSoftOK; - rightSK = TxtDelete; - } - else + /* If a word is being entered, display OK and Delete */ + + if (ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT) && data->predText.len!=0 && FFS_flashData.PredTextSelected == TRUE) + { + leftSK = TxtSoftOK; + rightSK = TxtDelete; + } + else #endif - { - /* Entered less than the required number of chars: Alternate Left Softkey appears */ - if (textLen < data->editor_data.min_enter) - { - leftSK = data->editor_data.AltLeftSoftKey; - } - else - { - leftSK = data->editor_data.LeftSoftKey; - } - /* Buffer is empty and alternative rsk enabled: alternative rsk appears */ - if (textLen==0 && data->editor_data.change_rsk_on_empty) - { - rightSK = data->editor_data.AltRightSoftKey; - } - else - { - rightSK = data->editor_data.RightSoftKey; - } - } - displaySoftKeys(leftSK, rightSK); - } - - /* Finished drawing screen */ - } + { + /* Entered less than the required number of chars: Alternate Left Softkey appears */ + if (textLen < data->editor_data.min_enter) + { + leftSK = data->editor_data.AltLeftSoftKey; + } + else + { + leftSK = data->editor_data.LeftSoftKey; + } + /* Buffer is empty and alternative rsk enabled: alternative rsk appears */ + if (textLen==0 && data->editor_data.change_rsk_on_empty) + { + rightSK = data->editor_data.AltRightSoftKey; + } + else + { + rightSK = data->editor_data.RightSoftKey; + } + } + displaySoftKeys(leftSK, rightSK); + } + + /* Finished drawing screen */ + } break; default: @@ -1081,7 +1076,7 @@ // break; // RAVI } - data->editor->update = ED_UPDATE_DEFAULT; + data->editor->update = ED_UPDATE_DEFAULT; return MFW_EVENT_CONSUMED; } @@ -1089,536 +1084,536 @@ /******************************************************************************* - $Function: AUI_edit_KbdCb - - $Description: Editor keyboard event handler - - $Returns: None. - - $Arguments: event - the keyboard event - keyboard + $Function: AUI_edit_KbdCb + + $Description: Editor keyboard event handler + + $Returns: None. + + $Arguments: event - the keyboard event + keyboard *******************************************************************************/ static int AUI_edit_KbdCb(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_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; -#if (BOARD != 61) && defined(EASY_TEXT_ENABLED) - T_ATB_TEXT *PredText = &data->predText; - USHORT character; + T_MFW_HND win = mfw_parent (mfw_header()); + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; +#if (BOARD != 61) && defined(EASY_TEXT_ENABLED) + T_ATB_TEXT *PredText = &data->predText; + USHORT character; #endif - ED_RES result; - - TRACE_FUNCTION("AUI_edit_KbdCb()"); + ED_RES result; + + TRACE_FUNCTION("AUI_edit_KbdCb()"); /* Suppress unwanted long keypresses */ - data->doNextLongPress = TRUE; /* next Key_long event is correct */ - - /* Restart the timer */ + data->doNextLongPress = TRUE; /* next Key_long event is correct */ + + /* Restart the timer */ if (data->timer !=NULL) - { - tim_stop(data->timer); - tim_start(data->timer); - } + { + tim_stop(data->timer); + tim_start(data->timer); + } #ifdef EASY_TEXT_ENABLED - if (FFS_flashData.PredTextSelected==FALSE || !ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) - { - /* Predictive text is off */ + if (FFS_flashData.PredTextSelected==FALSE || !ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) + { + /* Predictive text is off */ #endif - switch (keyboard->code) - { - /* UP key */ - - case KCD_MNUUP: - /* For DSample, up and down move cursor up and down a line in all modes */ + switch (keyboard->code) + { + /* UP key */ + + case KCD_MNUUP: + /* For DSample, up and down move cursor up and down a line in all modes */ #ifdef LSCREEN - ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); - - /* For other samples, up and down move left and right when not in read only mode */ + ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); + + /* For other samples, up and down move left and right when not in read only mode */ #else - if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* Acts as up key in read-only mode */ - { - ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); - } - else - { - ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); - } + if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* Acts as up key in read-only mode */ + { + ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); + } + else + { + ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); + } #endif - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ - win_show(data->win); - break; - - /* DOWN key */ - - case KCD_MNUDOWN: - /* For DSample, up and down move cursor up and down a line in all modes */ + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ + win_show(data->win); + break; + + /* DOWN key */ + + case KCD_MNUDOWN: + /* For DSample, up and down move cursor up and down a line in all modes */ #ifdef LSCREEN - ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); - - /* For other samples, up and down move left and right when not in read only mode */ + ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); + + /* For other samples, up and down move left and right when not in read only mode */ #else - if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* Act as down key in read-only mode */ - { - ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); - } - else - { - ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Otherwise, move cursor left */ - } + if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* Act as down key in read-only mode */ + { + ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); + } + else + { + ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Otherwise, move cursor left */ + } #endif - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ - win_show(data->win); - break; - - /* For DSample, left and right keys move cursor left and right */ + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ + win_show(data->win); + break; + + /* For DSample, left and right keys move cursor left and right */ #ifdef LSCREEN - /* MENU LEFT */ - - case KCD_MNULEFT: - ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ - win_show(data->win); - break; - - /* MENU RIGHT */ - - case KCD_MNURIGHT: - ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ - win_show(data->win); - break; + /* MENU LEFT */ + + case KCD_MNULEFT: + ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ + win_show(data->win); + break; + + /* MENU RIGHT */ + + case KCD_MNURIGHT: + ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ + win_show(data->win); + break; #endif - /* LEFT SOFT KEY */ - - case KCD_LEFT: - if (data->editor_data.editor_attr.text.len < data->editor_data.min_enter) - { - /* Entered less than the required number of chars */ - if (data->editor_data.AltLeftSoftKey!=TxtNull) - { - /* an alternate softkey is defined: execute it */ - SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_ALTERNATELEFT, NULL); - } - } - else if (data->editor_data.LeftSoftKey!=TxtNull) - { - /* Left Softkey is enabled (and entered sufficient number of chars): execute it - * get the orginal text back into the editor instead of the hide buffer ( only filled with '*') */ - if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) - { - ATB_edit_HiddenExit(data->editor); - } - SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_LEFT, NULL); - } - break; - - /* HANGUP key */ + /* LEFT SOFT KEY */ + + case KCD_LEFT: + if (data->editor_data.editor_attr.text.len < data->editor_data.min_enter) + { + /* Entered less than the required number of chars */ + if (data->editor_data.AltLeftSoftKey!=TxtNull) + { + /* an alternate softkey is defined: execute it */ + SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_ALTERNATELEFT, NULL); + } + } + else if (data->editor_data.LeftSoftKey!=TxtNull) + { + /* Left Softkey is enabled (and entered sufficient number of chars): execute it + * get the orginal text back into the editor instead of the hide buffer ( only filled with '*') */ + if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) + { + ATB_edit_HiddenExit(data->editor); + } + SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_LEFT, NULL); + } + break; + + /* HANGUP key */ case KCD_HUP: - if (data->editor_data.RightSoftKey NEQ TxtNull) /* Right softkey is enabled: execute it */ - { - SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_HUP, NULL); /* Deinitialise the editor */ + if (data->editor_data.RightSoftKey NEQ TxtNull) /* Right softkey is enabled: execute it */ + { + SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_HUP, NULL); /* Deinitialise the editor */ + } + break; + + /* SEND KEY */ + + case KCD_CALL: + if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) + { + /* Send this event to generate an MO call in SMS editor */ + SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_CALL, NULL); + } + break; + + /* RIGHT SOFT KEY */ + + case KCD_RIGHT: + TRACE_EVENT("KCD_RIGHT"); + if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* in read only mode, */ + { + TRACE_EVENT("SENDING DEINIT EVENT"); + SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); /* just deinitialise editor */ } - break; - - /* SEND KEY */ - - case KCD_CALL: - if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) - { - /* Send this event to generate an MO call in SMS editor */ - SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_CALL, NULL); - } - break; - - /* RIGHT SOFT KEY */ - - case KCD_RIGHT: - TRACE_EVENT("KCD_RIGHT"); - if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* in read only mode, */ - { - TRACE_EVENT("SENDING DEINIT EVENT"); - SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); /* just deinitialise editor */ - } - else /* otherwise, RSK acts as clear key */ + else /* otherwise, RSK acts as clear key */ { - /* If multitap is in progress, delete current character - * rather than previous character */ - - if (data->editor->multitap) - { - AUI_entry_StopMultitap(data->entry_data); /* Cancel multitap */ - result = ATB_edit_DeleteRight(data->editor, TRUE); /* SPR#2342 - SH */ - } - else - { - result = ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */ - } - - /* If we delete from first character in the editor, exit editor */ - if (result==ED_DONE) - { - SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); - } - else - { - win_show(data->win); - } + /* If multitap is in progress, delete current character + * rather than previous character */ + + if (data->editor->multitap) + { + AUI_entry_StopMultitap(data->entry_data); /* Cancel multitap */ + result = ATB_edit_DeleteRight(data->editor, TRUE); /* SPR#2342 - SH */ + } + else + { + result = ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */ + } + + /* If we delete from first character in the editor, exit editor */ + if (result==ED_DONE) + { + SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); + } + else + { + win_show(data->win); + } } - break; - - /* Switch text mode: uppercase, lowercase */ - case KCD_HASH: - if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) - { - // Jul 22,2004 CRR:21605 xrashmic - SASKEN - // The user has explicitly changed the case. When - // the editor becomes empty, we should not reset the - // case to sentence case - CaseChanged=TRUE; - switch(ATB_edit_GetCase(data->editor)) - { - case ED_CASE_LOWER: - // Jul 22,2004 CRR:21605 xrashmic - SASKEN - // The user has changed the case to sentence case. - // when the editor becomes empty, we have to reset - // the case to sentence case. - CaseChanged=FALSE; - ATB_edit_SetCase(data->editor, ED_CASE_CAPS); - break; - case ED_CASE_CAPS: - ATB_edit_SetCase(data->editor, ED_CASE_UPPER); - break; - case ED_CASE_UPPER: - ATB_edit_SetCase(data->editor, ED_CASE_LOWER); - - /* If easy text selected, switch to it */ + break; + + /* Switch text mode: uppercase, lowercase */ + case KCD_HASH: + if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) + { + // Jul 22,2004 CRR:21605 xrashmic - SASKEN + // The user has explicitly changed the case. When + // the editor becomes empty, we should not reset the + // case to sentence case + CaseChanged=TRUE; + switch(ATB_edit_GetCase(data->editor)) + { + case ED_CASE_LOWER: + // Jul 22,2004 CRR:21605 xrashmic - SASKEN + // The user has changed the case to sentence case. + // when the editor becomes empty, we have to reset + // the case to sentence case. + CaseChanged=FALSE; + ATB_edit_SetCase(data->editor, ED_CASE_CAPS); + break; + case ED_CASE_CAPS: + ATB_edit_SetCase(data->editor, ED_CASE_UPPER); + break; + case ED_CASE_UPPER: + ATB_edit_SetCase(data->editor, ED_CASE_LOWER); + + /* If easy text selected, switch to it */ #ifdef EASY_TEXT_ENABLED - if (ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextAvailable) - { - FFS_flashData.PredTextSelected = TRUE; - } + if (ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextAvailable) + { + FFS_flashData.PredTextSelected = TRUE; + } #endif - break; - case ED_CASE_NUM: - ATB_edit_SetCase(data->editor, ED_CASE_LOWER); - break; - } - } - else - { - /* SPR#1788 - SH - Forbid '#' entry in read only mode */ - if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) - AUI_entry_EventKey(data->entry_data, event, keyboard); - } - - win_show(data->win); - break; - - case (KCD_STAR): - /* If we're in apha mode and not in read-only mode, display the symbol screen */ - if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA) && !ATB_edit_Mode(data->editor, ED_MODE_READONLY)) - { - AUI_symbol_Start (data->win, E_ED_INSERT); - } - else - { - /* SPR#1788 - SH - Allow '*' to be entered in numeric mode */ - if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) - AUI_entry_EventKey(data->entry_data, event, keyboard); - } - - win_show(data->win); - break; - - /* KEY ENTRY 0 - 9 */ - - case KCD_0: - case KCD_1: - case KCD_2: - case KCD_3: - case KCD_4: - case KCD_5: - case KCD_6: - case KCD_7: - case KCD_8: - case KCD_9: + break; + case ED_CASE_NUM: + ATB_edit_SetCase(data->editor, ED_CASE_LOWER); + break; + } + } + else + { + /* SPR#1788 - SH - Forbid '#' entry in read only mode */ + if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) + AUI_entry_EventKey(data->entry_data, event, keyboard); + } + + win_show(data->win); + break; + + case (KCD_STAR): + /* If we're in apha mode and not in read-only mode, display the symbol screen */ + if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA) && !ATB_edit_Mode(data->editor, ED_MODE_READONLY)) + { + AUI_symbol_Start (data->win, E_ED_INSERT); + } + else + { + /* SPR#1788 - SH - Allow '*' to be entered in numeric mode */ + if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) + AUI_entry_EventKey(data->entry_data, event, keyboard); + } + + win_show(data->win); + break; + + /* KEY ENTRY 0 - 9 */ + + case KCD_0: + case KCD_1: + case KCD_2: + case KCD_3: + case KCD_4: + case KCD_5: + case KCD_6: + case KCD_7: + case KCD_8: + case KCD_9: if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) - { + { AUI_entry_EventKey(data->entry_data, event, keyboard); win_show(data->win); - } - break; - } + } + break; + } #ifdef EASY_TEXT_ENABLED - } - else - - /* Short key press in EasyText */ - - { - if(FFS_flashData.PredTextAvailable == TRUE) - { - switch (keyboard->code) + } + else + + /* Short key press in EasyText */ + + { + if(FFS_flashData.PredTextAvailable == TRUE) + { + switch (keyboard->code) { - case KCD_MNUUP: - if(PredText->len==0) - { + case KCD_MNUUP: + if(PredText->len==0) + { #ifdef LSCREEN - ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); - - /* For other samples, up and down move left and right when not in read only mode */ + ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); + + /* For other samples, up and down move left and right when not in read only mode */ #else - ATB_edit_MoveCursor(data->editor,ctrlRight, TRUE); + ATB_edit_MoveCursor(data->editor,ctrlRight, TRUE); #endif - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ - win_show(data->win); - } - break; - - case KCD_MNUDOWN: - if(PredText->len==0) - { + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ + win_show(data->win); + } + break; + + case KCD_MNUDOWN: + if(PredText->len==0) + { #ifdef LSCREEN - ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); - - /* For other samples, up and down move left and right when not in read only mode */ + ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); + + /* For other samples, up and down move left and right when not in read only mode */ #else - ATB_edit_MoveCursor(data->editor,ctrlLeft, TRUE); + ATB_edit_MoveCursor(data->editor,ctrlLeft, TRUE); #endif - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ - win_show(data->win); - } - break; + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ + win_show(data->win); + } + break; #ifdef LSCREEN - case KCD_MNURIGHT: - if(PredText->len==0) - { - ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ - win_show(data->win); - } - break; - - case KCD_MNULEFT: - if(PredText->len==0) - { - ATB_edit_MoveCursor(data->editor,ctrlLeft, TRUE); - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ - win_show(data->win); - } - break; + case KCD_MNURIGHT: + if(PredText->len==0) + { + ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ + win_show(data->win); + } + break; + + case KCD_MNULEFT: + if(PredText->len==0) + { + ATB_edit_MoveCursor(data->editor,ctrlLeft, TRUE); + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ + win_show(data->win); + } + break; #endif - case KCD_LEFT: - if(PredText->len==0) - { - if (data->editor_data.LeftSoftKey NEQ TxtNull) - { - SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_LEFT, NULL); - } - } - else - { - if ((data->editor_data.editor_attr.text.len + PredText->len) < data->editor_data.editor_attr.size) - { - if (ATB_string_GetChar(PredText,0)!=UNICODE_STAR) - { - /* Capitalise first letter of words and the letter 'I' */ - - if (ATB_edit_CapitaliseWord(data->editor) || (PredText->len==1 && ATB_string_GetChar(PredText, 0)==ATB_char_Unicode('i'))) - { - ATB_string_SetChar(PredText, 0, ATB_edit_FindCapital(ATB_string_GetChar(PredText, 0)));/*SPR1508*/ - } - character = ATB_edit_GetCursorChar(data->editor, -1); - - if ( character != UNICODE_SPACE && character != UNICODE_EOLN) - { - ATB_string_MoveRight(PredText,0,1,ED_PREDTEXT_MAX); - ATB_string_SetChar(PredText, 0, UNICODE_SPACE); - } - ATB_edit_InsertString(data->editor,PredText); - } - } - ResetDictSearch(); - AUI_edit_ClearPredText(data); - ATB_edit_SetCase(data->editor, ED_CASE_LOWER); - win_show(data->win); - } - break; - - case KCD_HUP: - if (data->editor_data.RightSoftKey NEQ TxtNull) /* Right softkey is enabled: execute it */ - { - SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_HUP, NULL); - } - break; - - case KCD_RIGHT: - if(PredText->len==0) - { - if(ATB_string_GetChar(&data->editor_data.editor_attr.text, 0)!=UNICODE_EOLN) - { - ATB_edit_Char(data->editor,ctrlBack,TRUE); - win_show(data->win); - } - else - { - /* leave editor if buffer already empty */ - SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); - } - } - else - { - if (PredText->len==1) - { - DictBackSpace((char *)data->predText.data); - AUI_edit_ClearPredText(data); - ATB_edit_SetCase(data->editor, ED_CASE_LOWER); - } - else - { - DictBackSpace((char *)data->predText.data); - data->predTextChar.pos--; /* char deleted, move cursor pos back */ - AUI_edit_CalcPredText(data); - } - win_show(data->win); - } - break; - - case KCD_2: - case KCD_3: - case KCD_4: - case KCD_5: - case KCD_6: - case KCD_7: - case KCD_8: - case KCD_9: - if (PredText->len==0) - { - AUI_edit_ClearPredText(data); - } - if (DictAlphaKeyPress(keyboard->code,(char *)PredText->data)) - { - PredText->len = ATB_string_Length(PredText); - data->predTextChar.pos++; /* The keypress was used to find a word, advance cursor */ - AUI_edit_CalcPredText(data); - } - win_show(data->win); - break; - - case KCD_HASH: - switch(ATB_edit_GetCase(data->editor)) - { - /* Press # once to switch into capitalise mode */ - case ED_CASE_CAPS: - ATB_edit_SetCase(data->editor, ED_CASE_LOWER); - /* Switch out of easy text mode, if we're not entering a word */ - if (PredText->len==0) - { - FFS_flashData.PredTextSelected = FALSE; - } - break; - default: - ATB_edit_SetCase(data->editor, ED_CASE_CAPS); - break; - } - win_show(data->win); - break; - - case KCD_STAR: - if (PredText->len==0) - { - AUI_symbol_Start (data->win, E_ED_INSERT); - } - else - { - int i; - MoreCandidates((char *)PredText->data, &i); - AUI_edit_CalcPredText(data); - win_show(data->win); - } - break; - - case KCD_0: - case KCD_1: - if (PredText->len!=0) - { - if ((data->editor_data.editor_attr.text.len + PredText->len) < MAX_MSG_LEN) - { - /* If char b4 cursor full stop/question/exclamation (or last char space and char b4 full stop) */ - if (ATB_edit_CapitaliseWord(data->editor) || (PredText->len==1 && ATB_string_GetChar(PredText,0)==ATB_char_Unicode('i'))) - ATB_string_SetChar(PredText, 0, ATB_edit_FindCapital(ATB_string_GetChar(PredText, 0)));/*SPR1508*/ - - /* Capitalise first letter of char. If char before cursor not space, insert space */ - character = ATB_edit_GetCursorChar(data->editor, -1); - - if (ATB_string_GetChar(PredText, 0) != UNICODE_STAR) - { - if (keyboard->code == KCD_1) - { - /* Insert space at end of string */ - ATB_string_SetChar(PredText, PredText->len, UNICODE_SPACE); - PredText->len++; - ATB_string_SetChar(PredText, PredText->len, UNICODE_EOLN); - - if ( character!=UNICODE_SPACE && character!=UNICODE_EOLN) - { - /* Insert space at start of string */ - ATB_string_MoveRight(PredText, 0, 1, ED_PREDTEXT_MAX); - ATB_string_SetChar(PredText, 0, UNICODE_SPACE); - } - } - else - { - /* Insert space and full stop at end of string */ - ATB_string_SetChar(PredText, PredText->len, UNICODE_FULLSTOP); - PredText->len++; - ATB_string_SetChar(PredText, PredText->len, UNICODE_SPACE); - PredText->len++; - ATB_string_SetChar(PredText, PredText->len, UNICODE_EOLN); - - if ( character!=UNICODE_SPACE && character!=UNICODE_EOLN) - { - /* Insert space at start of string */ - ATB_string_MoveRight(PredText, 0, 1, ED_PREDTEXT_MAX); - ATB_string_SetChar(PredText, 0, UNICODE_SPACE); - } - } - ATB_edit_InsertString(data->editor, PredText); - } - } - AUI_edit_ClearPredText(data); - ResetDictSearch(); - ATB_edit_SetCase(data->editor, ED_CASE_LOWER); - win_show(data->win); - } - break; - - /* Any key */ - - default: - if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* ignore normal keys if in read-only mode */ - { - AUI_entry_EventKey(data->entry_data, event, keyboard); - ATB_edit_Char(data->editor,ctrlBack,TRUE); - win_show(data->win); - } - break; - } - } - } + case KCD_LEFT: + if(PredText->len==0) + { + if (data->editor_data.LeftSoftKey NEQ TxtNull) + { + SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_LEFT, NULL); + } + } + else + { + if ((data->editor_data.editor_attr.text.len + PredText->len) < data->editor_data.editor_attr.size) + { + if (ATB_string_GetChar(PredText,0)!=UNICODE_STAR) + { + /* Capitalise first letter of words and the letter 'I' */ + + if (ATB_edit_CapitaliseWord(data->editor) || (PredText->len==1 && ATB_string_GetChar(PredText, 0)==ATB_char_Unicode('i'))) + { + ATB_string_SetChar(PredText, 0, ATB_edit_FindCapital(ATB_string_GetChar(PredText, 0)));/*SPR1508*/ + } + character = ATB_edit_GetCursorChar(data->editor, -1); + + if ( character != UNICODE_SPACE && character != UNICODE_EOLN) + { + ATB_string_MoveRight(PredText,0,1,ED_PREDTEXT_MAX); + ATB_string_SetChar(PredText, 0, UNICODE_SPACE); + } + ATB_edit_InsertString(data->editor,PredText); + } + } + ResetDictSearch(); + AUI_edit_ClearPredText(data); + ATB_edit_SetCase(data->editor, ED_CASE_LOWER); + win_show(data->win); + } + break; + + case KCD_HUP: + if (data->editor_data.RightSoftKey NEQ TxtNull) /* Right softkey is enabled: execute it */ + { + SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_HUP, NULL); + } + break; + + case KCD_RIGHT: + if(PredText->len==0) + { + if(ATB_string_GetChar(&data->editor_data.editor_attr.text, 0)!=UNICODE_EOLN) + { + ATB_edit_Char(data->editor,ctrlBack,TRUE); + win_show(data->win); + } + else + { + /* leave editor if buffer already empty */ + SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); + } + } + else + { + if (PredText->len==1) + { + DictBackSpace((char *)data->predText.data); + AUI_edit_ClearPredText(data); + ATB_edit_SetCase(data->editor, ED_CASE_LOWER); + } + else + { + DictBackSpace((char *)data->predText.data); + data->predTextChar.pos--; /* char deleted, move cursor pos back */ + AUI_edit_CalcPredText(data); + } + win_show(data->win); + } + break; + + case KCD_2: + case KCD_3: + case KCD_4: + case KCD_5: + case KCD_6: + case KCD_7: + case KCD_8: + case KCD_9: + if (PredText->len==0) + { + AUI_edit_ClearPredText(data); + } + if (DictAlphaKeyPress(keyboard->code,(char *)PredText->data)) + { + PredText->len = ATB_string_Length(PredText); + data->predTextChar.pos++; /* The keypress was used to find a word, advance cursor */ + AUI_edit_CalcPredText(data); + } + win_show(data->win); + break; + + case KCD_HASH: + switch(ATB_edit_GetCase(data->editor)) + { + /* Press # once to switch into capitalise mode */ + case ED_CASE_CAPS: + ATB_edit_SetCase(data->editor, ED_CASE_LOWER); + /* Switch out of easy text mode, if we're not entering a word */ + if (PredText->len==0) + { + FFS_flashData.PredTextSelected = FALSE; + } + break; + default: + ATB_edit_SetCase(data->editor, ED_CASE_CAPS); + break; + } + win_show(data->win); + break; + + case KCD_STAR: + if (PredText->len==0) + { + AUI_symbol_Start (data->win, E_ED_INSERT); + } + else + { + int i; + MoreCandidates((char *)PredText->data, &i); + AUI_edit_CalcPredText(data); + win_show(data->win); + } + break; + + case KCD_0: + case KCD_1: + if (PredText->len!=0) + { + if ((data->editor_data.editor_attr.text.len + PredText->len) < MAX_MSG_LEN) + { + /* If char b4 cursor full stop/question/exclamation (or last char space and char b4 full stop) */ + if (ATB_edit_CapitaliseWord(data->editor) || (PredText->len==1 && ATB_string_GetChar(PredText,0)==ATB_char_Unicode('i'))) + ATB_string_SetChar(PredText, 0, ATB_edit_FindCapital(ATB_string_GetChar(PredText, 0)));/*SPR1508*/ + + /* Capitalise first letter of char. If char before cursor not space, insert space */ + character = ATB_edit_GetCursorChar(data->editor, -1); + + if (ATB_string_GetChar(PredText, 0) != UNICODE_STAR) + { + if (keyboard->code == KCD_1) + { + /* Insert space at end of string */ + ATB_string_SetChar(PredText, PredText->len, UNICODE_SPACE); + PredText->len++; + ATB_string_SetChar(PredText, PredText->len, UNICODE_EOLN); + + if ( character!=UNICODE_SPACE && character!=UNICODE_EOLN) + { + /* Insert space at start of string */ + ATB_string_MoveRight(PredText, 0, 1, ED_PREDTEXT_MAX); + ATB_string_SetChar(PredText, 0, UNICODE_SPACE); + } + } + else + { + /* Insert space and full stop at end of string */ + ATB_string_SetChar(PredText, PredText->len, UNICODE_FULLSTOP); + PredText->len++; + ATB_string_SetChar(PredText, PredText->len, UNICODE_SPACE); + PredText->len++; + ATB_string_SetChar(PredText, PredText->len, UNICODE_EOLN); + + if ( character!=UNICODE_SPACE && character!=UNICODE_EOLN) + { + /* Insert space at start of string */ + ATB_string_MoveRight(PredText, 0, 1, ED_PREDTEXT_MAX); + ATB_string_SetChar(PredText, 0, UNICODE_SPACE); + } + } + ATB_edit_InsertString(data->editor, PredText); + } + } + AUI_edit_ClearPredText(data); + ResetDictSearch(); + ATB_edit_SetCase(data->editor, ED_CASE_LOWER); + win_show(data->win); + } + break; + + /* Any key */ + + default: + if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* ignore normal keys if in read-only mode */ + { + AUI_entry_EventKey(data->entry_data, event, keyboard); + ATB_edit_Char(data->editor,ctrlBack,TRUE); + win_show(data->win); + } + break; + } + } + } #endif return MFW_EVENT_CONSUMED; @@ -1627,285 +1622,285 @@ /******************************************************************************* - $Function: AUI_edit_KbdLongCb - - $Description: Editor keyboard event handler for long keypresses - - $Returns: None. - - $Arguments: event - the keyboard event - keyboard + $Function: AUI_edit_KbdLongCb + + $Description: Editor keyboard event handler for long keypresses + + $Returns: None. + + $Arguments: event - the keyboard event + keyboard *******************************************************************************/ static int AUI_edit_KbdLongCb(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_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; - -#if (BOARD != 61) && defined(EASY_TEXT_ENABLED) - T_ATB_TEXT *PredText = &data->predText; + T_MFW_HND win = mfw_parent (mfw_header()); + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; + +#if (BOARD != 61) && defined(EASY_TEXT_ENABLED) + T_ATB_TEXT *PredText = &data->predText; #endif - ED_RES result; + ED_RES result; #ifdef TRACE_AUIEditor - TRACE_FUNCTION("AUI_edit_KbdLongCb()"); + TRACE_FUNCTION("AUI_edit_KbdLongCb()"); #endif /* Suppress unwanted long keypresses */ - if ( data->doNextLongPress ) - data->doNextLongPress = FALSE; /* mark Key_long event as consumed but do current long press */ - // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN - // Description: By Long press on Left/Right key at 'Message Editor' screen, - // cursor not scrolling continuously - // Fix: The continuous long press of a key was being ignored for all keys. - // Now only for left and right keys this is handled. - else if(!(keyboard->code==KCD_MNULEFT ||keyboard->code== KCD_MNURIGHT)) - { - return MFW_EVENT_CONSUMED; /* don't do current long press */ - } - - /* Restart the timer */ + if ( data->doNextLongPress ) + data->doNextLongPress = FALSE; /* mark Key_long event as consumed but do current long press */ + // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN + // Description: By Long press on Left/Right key at 'Message Editor' screen, + // cursor not scrolling continuously + // Fix: The continuous long press of a key was being ignored for all keys. + // Now only for left and right keys this is handled. + else if(!(keyboard->code==KCD_MNULEFT ||keyboard->code== KCD_MNURIGHT)) + { + return MFW_EVENT_CONSUMED; /* don't do current long press */ + } + + /* Restart the timer */ if (data->timer !=NULL) - { - tim_stop(data->timer); - tim_start(data->timer); - } + { + tim_stop(data->timer); + tim_start(data->timer); + } #ifdef EASY_TEXT_ENABLED - if (FFS_flashData.PredTextSelected == FALSE || !ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) { - /* Predictive text is off */ + if (FFS_flashData.PredTextSelected == FALSE || !ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) { + /* Predictive text is off */ #endif - switch (keyboard->code) - { - // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN - // Description: By Long press on Left/Right key at 'Message Editor' screen, - // cursor not scrolling continuously - // Fix: The Long press of left/right key is now handled in AUI_edit_KbdLongCB. - case KCD_MNULEFT: - ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ - win_show(data->win); - break; - case KCD_MNURIGHT: - ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ - win_show(data->win); - break; - - case KCD_RIGHT: - result = ATB_edit_ClearAll(data->editor); /* Otherwise, clear the editor */ - - /* If buffer is empty, right soft key causes exit from editor */ - if (result==ED_DONE) - { - SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); - } - else - { - win_show(data->win); - } - break; - - /* KEY ENTRY 0 */ - - case KCD_0: - /* Alpha mode: insert a '0' */ - if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) - { - if (keyboard->code<=KCD_HASH) - { - ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ - AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap - win_show(data->win); - } - } - - /* Number mode: insert a '+'*/ - else if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* ignore normal keys if in read-only mode */ - { - if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) /* in hidden mode do not allow entering of '+' */ - { - ATB_edit_DeleteLeft(data->editor, TRUE); /* remove the '0'. SPR#2342 - SH */ - } - else - { - ATB_edit_Char(data->editor,ctrlBack,FALSE); /* remove the '0' */ - ATB_edit_Char(data->editor,UNICODE_PLUS,TRUE); /* insert the '+' */ - } - win_show(data->win); - } - break; - case (KCD_STAR): - /* MZ cq11414 add Pause Character */ - ATB_edit_DeleteLeft(data->editor, FALSE); - - //Sep 2, 2004 REF: CRR 21370 xkundadu - //Changed the long press of '*' key to display 'w' - AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('w'), FALSE); - win_show(data->win); - break; - - case (KCD_HASH): - - /* In alphanumeric mode, a long hold of # selects number case */ - if (ATB_edit_GetCasePref(data->editor)==ED_CASEPREF_ALPHANUM) - ATB_edit_SetCase(data->editor, ED_CASE_NUM); - else - { - /* MZ cq11414 add Wait Character */ - ATB_edit_DeleteLeft(data->editor, FALSE); - - //Sep 2, 2004 REF: CRR 21370 xkundadu - //Changed the long press of '#' key to display 'p' - AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('p'), FALSE); - } - win_show(data->win); - break; - - /* KEY ENTRY 1 - 9 */ - - case KCD_1: - case KCD_2: - case KCD_3: - case KCD_4: - case KCD_5: - case KCD_6: - case KCD_7: - case KCD_8: - case KCD_9: - /* Insert equivalent numeric character, only possible in Alpha modes */ - if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) - { - if (keyboard->code<=KCD_HASH) - { - ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ - AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap - win_show(data->win); - } - } - break; - - } + switch (keyboard->code) + { + // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN + // Description: By Long press on Left/Right key at 'Message Editor' screen, + // cursor not scrolling continuously + // Fix: The Long press of left/right key is now handled in AUI_edit_KbdLongCB. + case KCD_MNULEFT: + ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ + win_show(data->win); + break; + case KCD_MNURIGHT: + ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ + win_show(data->win); + break; + + case KCD_RIGHT: + result = ATB_edit_ClearAll(data->editor); /* Otherwise, clear the editor */ + + /* If buffer is empty, right soft key causes exit from editor */ + if (result==ED_DONE) + { + SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); + } + else + { + win_show(data->win); + } + break; + + /* KEY ENTRY 0 */ + + case KCD_0: + /* Alpha mode: insert a '0' */ + if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) + { + if (keyboard->code<=KCD_HASH) + { + ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ + AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap + win_show(data->win); + } + } + + /* Number mode: insert a '+'*/ + else if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* ignore normal keys if in read-only mode */ + { + if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) /* in hidden mode do not allow entering of '+' */ + { + ATB_edit_DeleteLeft(data->editor, TRUE); /* remove the '0'. SPR#2342 - SH */ + } + else + { + ATB_edit_Char(data->editor,ctrlBack,FALSE); /* remove the '0' */ + ATB_edit_Char(data->editor,UNICODE_PLUS,TRUE); /* insert the '+' */ + } + win_show(data->win); + } + break; + case (KCD_STAR): + /* MZ cq11414 add Pause Character */ + ATB_edit_DeleteLeft(data->editor, FALSE); + + //Sep 2, 2004 REF: CRR 21370 xkundadu + //Changed the long press of '*' key to display 'w' + AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('w'), FALSE); + win_show(data->win); + break; + + case (KCD_HASH): + + /* In alphanumeric mode, a long hold of # selects number case */ + if (ATB_edit_GetCasePref(data->editor)==ED_CASEPREF_ALPHANUM) + ATB_edit_SetCase(data->editor, ED_CASE_NUM); + else + { + /* MZ cq11414 add Wait Character */ + ATB_edit_DeleteLeft(data->editor, FALSE); + + //Sep 2, 2004 REF: CRR 21370 xkundadu + //Changed the long press of '#' key to display 'p' + AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('p'), FALSE); + } + win_show(data->win); + break; + + /* KEY ENTRY 1 - 9 */ + + case KCD_1: + case KCD_2: + case KCD_3: + case KCD_4: + case KCD_5: + case KCD_6: + case KCD_7: + case KCD_8: + case KCD_9: + /* Insert equivalent numeric character, only possible in Alpha modes */ + if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) + { + if (keyboard->code<=KCD_HASH) + { + ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ + AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap + win_show(data->win); + } + } + break; + + } #ifdef EASY_TEXT_ENABLED - } - else - { - if(FFS_flashData.PredTextAvailable == TRUE) - { - switch (keyboard->code) - { - // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN - // Description: By Long press on Left/Right key at 'Message Editor' - // screen, cursor not scrolling continuously - // Fix: The Long press of left/right key is now handled in - // AUI_edit_KbdLongCB. - case KCD_MNULEFT: - ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ - win_show(data->win); - break; - case KCD_MNURIGHT: - ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ - data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ - win_show(data->win); - break; - - case KCD_RIGHT: /*empty predictive text string */ - if(PredText->len!=0) - { - PredText->len = 0; - ATB_string_SetChar(PredText, 0, UNICODE_EOLN); - ResetDictSearch(); - win_show(data->win); - } - else /*empty whole editor */ - { - if(data->editor_data.editor_attr.text.len > 0 ) - { - ATB_edit_ClearAll(data->editor); - win_show(data->win); - } - else - { - /* leave editor if buffer already empty */ - SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); - } - } - break; - - case(KCD_STAR): - AUI_symbol_Start(data->win, E_ED_INSERT); - break; - - case (KCD_HASH): - break; - - /* KEY ENTRY 1 - 9 */ - - case KCD_0: - case KCD_1: - case KCD_2: - case KCD_3: - case KCD_4: - case KCD_5: - case KCD_6: - case KCD_7: - case KCD_8: - case KCD_9: - if(PredText->len==0) - { - /* Insert equivalent numeric character, only possible in Alpha modes */ - if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) - { - if (keyboard->code<=KCD_HASH) - { - ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ - AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap - } - } - win_show(data->win); - } - break; - } - } - } - #endif - - return MFW_EVENT_CONSUMED; + } + else + { + if(FFS_flashData.PredTextAvailable == TRUE) + { + switch (keyboard->code) + { + // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN + // Description: By Long press on Left/Right key at 'Message Editor' + // screen, cursor not scrolling continuously + // Fix: The Long press of left/right key is now handled in + // AUI_edit_KbdLongCB. + case KCD_MNULEFT: + ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ + win_show(data->win); + break; + case KCD_MNURIGHT: + ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ + data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ + win_show(data->win); + break; + + case KCD_RIGHT: /*empty predictive text string */ + if(PredText->len!=0) + { + PredText->len = 0; + ATB_string_SetChar(PredText, 0, UNICODE_EOLN); + ResetDictSearch(); + win_show(data->win); + } + else /*empty whole editor */ + { + if(data->editor_data.editor_attr.text.len > 0 ) + { + ATB_edit_ClearAll(data->editor); + win_show(data->win); + } + else + { + /* leave editor if buffer already empty */ + SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); + } + } + break; + + case(KCD_STAR): + AUI_symbol_Start(data->win, E_ED_INSERT); + break; + + case (KCD_HASH): + break; + + /* KEY ENTRY 1 - 9 */ + + case KCD_0: + case KCD_1: + case KCD_2: + case KCD_3: + case KCD_4: + case KCD_5: + case KCD_6: + case KCD_7: + case KCD_8: + case KCD_9: + if(PredText->len==0) + { + /* Insert equivalent numeric character, only possible in Alpha modes */ + if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) + { + if (keyboard->code<=KCD_HASH) + { + ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ + AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap + } + } + win_show(data->win); + } + break; + } + } + } + #endif + + return MFW_EVENT_CONSUMED; } /******************************************************************************* - $Function: AUI_edit_TimerCb - - $Description: Callback function for the editor info timer. - - $Returns: None. - - $Arguments: event - the event type - timer - the timer + $Function: AUI_edit_TimerCb + + $Description: Callback function for the editor info timer. + + $Returns: None. + + $Arguments: event - the event type + timer - the timer *******************************************************************************/ static int AUI_edit_TimerCb (T_MFW_EVENT event, T_MFW_TIM *timer) { - T_MFW_HND win = mfw_parent (mfw_header()); - - - -// T_MFW_HND parent_win = data->parent; // RAVI -// USHORT Identifier = data->editor_data.Identifier; // RAVI -// T_AUI_EDIT_CB Callback = data->editor_data.Callback; // RAVI - - TRACE_FUNCTION("AUI_edit_TimerCb"); + T_MFW_HND win = mfw_parent (mfw_header()); + + + +// T_MFW_HND parent_win = data->parent; // RAVI +// USHORT Identifier = data->editor_data.Identifier; // RAVI +// T_AUI_EDIT_CB Callback = data->editor_data.Callback; // RAVI + + TRACE_FUNCTION("AUI_edit_TimerCb"); #if 0 AUI_edit_Destroy(data->win); @@ -1913,7 +1908,7 @@ if (Callback) (Callback) (parent_win, Identifier, INFO_TIMEOUT); #else - SEND_EVENT (win, E_ED_DEINIT, INFO_TIMEOUT, NULL); + SEND_EVENT (win, E_ED_DEINIT, INFO_TIMEOUT, NULL); #endif return MFW_EVENT_CONSUMED; @@ -1921,42 +1916,42 @@ /******************************************************************************* - $Function: AUI_edit_TitleTimerCb - - $Description: Callback function for the editor title timer. Recalculates title_pos so that - the next part of the string is displayed. - - $Returns: None. - - $Arguments: event - the event type - timer - the timer + $Function: AUI_edit_TitleTimerCb + + $Description: Callback function for the editor title timer. Recalculates title_pos so that + the next part of the string is displayed. + + $Returns: None. + + $Arguments: event - the event type + timer - the timer *******************************************************************************/ static int AUI_edit_TitleTimerCb (T_MFW_EVENT event, T_MFW_TIM *timer) { - /* Use the mfwHeader property of the timer to get the window */ - T_MFW_HND win = mfw_parent(timer->mfwHeader); - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; - - TRACE_FUNCTION("AUI_edit_TitleTimerCb"); - - /* SPR#1597 - SH - Since there may be multiple timers running at once, only - call win_show if the window is focussed. */ - - if (winIsFocussed(win)) - { - if (data->title_next_pos!=data->title_pos) - { - data->title_pos = data->title_next_pos; - } - - data->editor->update = ED_UPDATE_PARTIAL; /* Don't update editor text */ - win_show(data->win); - - tim_start(data->title_timer); - } + /* Use the mfwHeader property of the timer to get the window */ + T_MFW_HND win = mfw_parent(timer->mfwHeader); + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; + + TRACE_FUNCTION("AUI_edit_TitleTimerCb"); + + /* SPR#1597 - SH - Since there may be multiple timers running at once, only + call win_show if the window is focussed. */ + + if (winIsFocussed(win)) + { + if (data->title_next_pos!=data->title_pos) + { + data->title_pos = data->title_next_pos; + } + + data->editor->update = ED_UPDATE_PARTIAL; /* Don't update editor text */ + win_show(data->win); + + tim_start(data->title_timer); + } return MFW_EVENT_CONSUMED; } @@ -1964,166 +1959,166 @@ /******************************************************************************* - $Function: AUI_edit_CalcPredText - - $Description: Calculate properties of predicted text string. - - $Returns: None. - - $Arguments: data - The AUI editor data + $Function: AUI_edit_CalcPredText + + $Description: Calculate properties of predicted text string. + + $Returns: None. + + $Arguments: data - The AUI editor data *******************************************************************************/ static void AUI_edit_CalcPredText(T_AUI_EDITOR_INFO *data) { - USHORT character; - T_ATB_TEXT dummy; - - data->predText.len = ATB_string_Length(&data->predText); - - /* Get position of current entry */ - dummy.data = data->predText.data; - dummy.dcs = data->predText.dcs; - dummy.len = data->predTextChar.pos; - data->predTextChar.lineWidth = ATB_display_StringWidth(&dummy, &data->predTextChar.format); - data->predTextChar.lineHeight = ATB_display_StringHeight(&dummy, &data->predTextChar.format); - - /* Get width and height of current character */ - character = ATB_string_GetChar(&data->predText, data->predTextChar.pos); - data->predTextChar.width = ATB_display_GetCharWidth(character, &data->predTextChar.format); - data->predTextChar.height = ATB_display_GetCharHeight(character, &data->predTextChar.format); - - return; + USHORT character; + T_ATB_TEXT dummy; + + data->predText.len = ATB_string_Length(&data->predText); + + /* Get position of current entry */ + dummy.data = data->predText.data; + dummy.dcs = data->predText.dcs; + dummy.len = data->predTextChar.pos; + data->predTextChar.lineWidth = ATB_display_StringWidth(&dummy, &data->predTextChar.format); + data->predTextChar.lineHeight = ATB_display_StringHeight(&dummy, &data->predTextChar.format); + + /* Get width and height of current character */ + character = ATB_string_GetChar(&data->predText, data->predTextChar.pos); + data->predTextChar.width = ATB_display_GetCharWidth(character, &data->predTextChar.format); + data->predTextChar.height = ATB_display_GetCharHeight(character, &data->predTextChar.format); + + return; } /******************************************************************************* - $Function: AUI_edit_ClearPredText - - $Description: Clear the predictive text buffer - - $Returns: None. - - $Arguments: data - The AUI editor data + $Function: AUI_edit_ClearPredText + + $Description: Clear the predictive text buffer + + $Returns: None. + + $Arguments: data - The AUI editor data *******************************************************************************/ static void AUI_edit_ClearPredText(T_AUI_EDITOR_INFO *data) { - data->predText.len = 0; - ATB_string_SetChar(&data->predText,0,UNICODE_EOLN); - memset(&data->predTextChar, 0, sizeof(T_ED_CHAR)); - return; + data->predText.len = 0; + ATB_string_SetChar(&data->predText,0,UNICODE_EOLN); + memset(&data->predTextChar, 0, sizeof(T_ED_CHAR)); + return; } /******************************************************************************* - $Function: AUI_edit_InsertString - - $Description: Insert a string into the editor - - $Returns: Pointer to the editor's window. - - $Arguments: win - The editor window - string - The string to insert - dcs - The dcs of the string + $Function: AUI_edit_InsertString + + $Description: Insert a string into the editor + + $Returns: Pointer to the editor's window. + + $Arguments: win - The editor window + string - The string to insert + dcs - The dcs of the string *******************************************************************************/ void AUI_edit_InsertString(T_MFW_HND win, UBYTE *string, T_ATB_DCS dcs) { - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; - T_ATB_TEXT text; - - text.data = string; - text.dcs = dcs; - text.len = ATB_string_Length(&text); + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; + T_ATB_TEXT text; + + text.data = string; + text.dcs = dcs; + text.len = ATB_string_Length(&text); ATB_edit_InsertString(data->editor, &text); - return; + return; } /******************************************************************************* - $Function: AUI_edit_InsertChar - - $Description: Insert a character into the editor - - $Returns: Pointer to the editor's window. - - $Arguments: win - The editor window - character - The character to insert + $Function: AUI_edit_InsertChar + + $Description: Insert a character into the editor + + $Returns: Pointer to the editor's window. + + $Arguments: win - The editor window + character - The character to insert *******************************************************************************/ void AUI_edit_InsertChar(T_MFW_HND win, USHORT character) { - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; ATB_edit_Char(data->editor, character, TRUE); - return; + return; } /******************************************************************************* - $Function: AUI_edit_GetSpecificWindowSIze - - $Description: Sets up window size - - $Returns: None. - - $Arguments: attr - The ATB editor attributes - zone_id - Specifies the window size (See ZONE_... in header file) + $Function: AUI_edit_GetSpecificWindowSIze + + $Description: Sets up window size + + $Returns: None. + + $Arguments: attr - The ATB editor attributes + zone_id - Specifies the window size (See ZONE_... in header file) *******************************************************************************/ #ifndef LSCREEN //Sizes defined for CSAMPLE editore -#define BOOKDETAILS_EDITOR_SIZE 0, 0, SCREEN_SIZE_X-4, Mmi_layout_line(LAST_LINE_TOP) -#define NUMBER_EDITOR_SIZE 0, 12, SCREEN_SIZE_X , MNU3LINE -#define PHONEBOOK_DLG_EDITOR_SIZE 4, Mmi_layout_line(3)+2, SCREEN_SIZE_X-4, SCREEN_SIZE_Y-(Mmi_layout_line(3)+2) -#define BOOKSDN_EDITOR_SIZE 34, Mmi_layout_line(3)+2, 50, Mmi_layout_line(1)+2 +#define BOOKDETAILS_EDITOR_SIZE 0, 0, SCREEN_SIZE_X-4, Mmi_layout_line(LAST_LINE_TOP) +#define NUMBER_EDITOR_SIZE 0, 12, SCREEN_SIZE_X , MNU3LINE +#define PHONEBOOK_DLG_EDITOR_SIZE 4, Mmi_layout_line(3)+2, SCREEN_SIZE_X-4, SCREEN_SIZE_Y-(Mmi_layout_line(3)+2) +#define BOOKSDN_EDITOR_SIZE 34, Mmi_layout_line(3)+2, 50, Mmi_layout_line(1)+2 //MMIbooksearchwindow -//#define BOOKSEARCH_EDITOR_SIZE 0, Mmi_layout_line(SECOND_LAST_LINE_TOP), SCREEN_SIZE_X, Mmi_layout_line(1) +//#define BOOKSEARCH_EDITOR_SIZE 0, Mmi_layout_line(SECOND_LAST_LINE_TOP), SCREEN_SIZE_X, Mmi_layout_line(1) //MMICall -#define CALL_EDITOR_SIZE 4,28,SCREEN_SIZE_X-4, 20 -#define CALLSCRATCHPAD_EDITOR_SIZE 6, Mmi_layout_line(2),SCREEN_SIZE_X-6, 16 +#define CALL_EDITOR_SIZE 4,28,SCREEN_SIZE_X-4, 20 +#define CALLSCRATCHPAD_EDITOR_SIZE 6, Mmi_layout_line(2),SCREEN_SIZE_X-6, 16 //MMIServices -#define SERVICE_CREATE_EDITOR_SIZE 4,Mmi_layout_line(1)+2,SCREEN_SIZE_X-4, MNU3LINE -#define PASSWORD_EDITOR_SIZE 0, 12, SCREEN_SIZE_X , 13 -#define EM_EDITOR_SIZE 0, 0, SCREEN_SIZE_X-4, Mmi_layout_line(LAST_LINE_TOP) +#define SERVICE_CREATE_EDITOR_SIZE 4,Mmi_layout_line(1)+2,SCREEN_SIZE_X-4, MNU3LINE +#define PASSWORD_EDITOR_SIZE 0, 12, SCREEN_SIZE_X , 13 +#define EM_EDITOR_SIZE 0, 0, SCREEN_SIZE_X-4, Mmi_layout_line(LAST_LINE_TOP) //From MMIIdle //GW Changed window height from 30 (27?) to 24. -#define WIN_DIALLING_SIZE 0,Mmi_layout_line_icons(2), SCREEN_SIZE_X,24 -#define WIN_DIALLING_C_SIZE 0,Mmi_layout_line_icons(1),SCREEN_SIZE_X,32 +#define WIN_DIALLING_SIZE 0,Mmi_layout_line_icons(2), SCREEN_SIZE_X,24 +#define WIN_DIALLING_C_SIZE 0,Mmi_layout_line_icons(1),SCREEN_SIZE_X,32 //Positions for editor windows in mmismssend -#define PHNO_EDITOR_SIZE 0, (Mmi_layout_line(1)+2), SCREEN_SIZE_X, 20 +#define PHNO_EDITOR_SIZE 0, (Mmi_layout_line(1)+2), SCREEN_SIZE_X, 20 //NB defines below used twice, second time START/SIZE_Y was same as START/SIZE_Y above -#define CENTRE_EDITOR_SIZE 0, Mmi_layout_line(1), SCREEN_SIZE_X, MNU3LINE+3 +#define CENTRE_EDITOR_SIZE 0, Mmi_layout_line(1), SCREEN_SIZE_X, MNU3LINE+3 //And for MMIServices - moved here from mmiservices.c -#define SAT_EDITOR_SIZE 6,30,SCREEN_SIZE_X-6, 20 - -#define RPWD_EDITOR_SIZE 0,12,SCREEN_SIZE_X,13 +#define SAT_EDITOR_SIZE 6,30,SCREEN_SIZE_X-6, 20 + +#define RPWD_EDITOR_SIZE 0,12,SCREEN_SIZE_X,13 //MMIBookCallDetails -#define PHB_EDITOR_SIZE 4,0,SCREEN_SIZE_X-4, ALLBUT2LINE +#define PHB_EDITOR_SIZE 4,0,SCREEN_SIZE_X-4, ALLBUT2LINE //MMIPins -#define PIN_EDIT_RESET_SIZE 12,20,84-12,16 +#define PIN_EDIT_RESET_SIZE 12,20,84-12,16 //MMITimeDate #define TIMEDATE_EDITOR_AREA_SIZE 0,10,70,10 #endif @@ -2131,628 +2126,628 @@ #ifndef LSCREEN static void setSize(T_ATB_WIN_SIZE *win, int px, int py, int sx, int sy) { - win->px = px; win->py = py; - win->sx = sx; win->sy = sy; + win->px = px; win->py = py; + win->sx = sx; win->sy = sy; } #endif void AUI_edit_GetSpecificWindowSize(T_ED_ATTR* attr, int zone_id ) { - switch (zone_id) - { - case ZONE_SMALL_EDITOR: - attr->win_size.px = 6; - attr->win_size.py = Mmi_layout_IconHeight()*2; - attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; - attr->win_size.sy = Mmi_layout_line_height()*2+4; - break; - - case ZONE_BOTTOM_LINE: - attr->win_size.px = 0; - attr->win_size.py = SCREEN_SIZE_Y - Mmi_layout_line_height() - Mmi_layout_softkeyHeight(); - attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; - attr->win_size.sy = Mmi_layout_line_height(); - break; - - case ZONE_BOTTOM_LINE_FIND: //used for phonebook search - attr->win_size.px = dspl_GetTextExtent(MmiRsrcGetText(TxtFind),0); - attr->win_size.py = SCREEN_SIZE_Y - Mmi_layout_line_height() - Mmi_layout_softkeyHeight(); - attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; - attr->win_size.sy = Mmi_layout_line_height(); - break; + switch (zone_id) + { + case ZONE_SMALL_EDITOR: + attr->win_size.px = 6; + attr->win_size.py = Mmi_layout_IconHeight()*2; + attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; + attr->win_size.sy = Mmi_layout_line_height()*2+4; + break; + + case ZONE_BOTTOM_LINE: + attr->win_size.px = 0; + attr->win_size.py = SCREEN_SIZE_Y - Mmi_layout_line_height() - Mmi_layout_softkeyHeight(); + attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; + attr->win_size.sy = Mmi_layout_line_height(); + break; + + case ZONE_BOTTOM_LINE_FIND: //used for phonebook search + attr->win_size.px = dspl_GetTextExtent(MmiRsrcGetText(TxtFind),0); + attr->win_size.py = SCREEN_SIZE_Y - Mmi_layout_line_height() - Mmi_layout_softkeyHeight(); + attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; + attr->win_size.sy = Mmi_layout_line_height(); + break; #ifndef LSCREEN - case BOOKDETAILS_EDITOR: setSize(&attr->win_size,BOOKDETAILS_EDITOR_SIZE); break; - case NUMBER_EDITOR: setSize(&attr->win_size,NUMBER_EDITOR_SIZE); break; - case PHONEBOOK_DLG_EDITOR: setSize(&attr->win_size,PHONEBOOK_DLG_EDITOR_SIZE); break; - case BOOKSDN_EDITOR: setSize(&attr->win_size,BOOKSDN_EDITOR_SIZE); break; - // case BOOKSEARCH_EDITOR: setSize(&attr->win_size,BOOKSEARCH_EDITOR_SIZE); break; - case CALL_EDITOR: setSize(&attr->win_size,CALL_EDITOR_SIZE); break; - case CALLSCRATCHPAD_EDITOR: setSize(&attr->win_size,CALLSCRATCHPAD_EDITOR_SIZE); break; - case SERVICE_CREATE_EDITOR: setSize(&attr->win_size,SERVICE_CREATE_EDITOR_SIZE); break; - case PASSWORD_EDITOR: setSize(&attr->win_size,PASSWORD_EDITOR_SIZE); break; - case EM_CREATE_EDITOR: setSize(&attr->win_size,EM_EDITOR_SIZE); break;/*SPR#1840*/ - - case WIN_DIALLING: - case WIN_DIALLING_CB: - if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - setSize(&attr->win_size,WIN_DIALLING_C_SIZE); - else - setSize(&attr->win_size,WIN_DIALLING_SIZE); - break; - case WIN_DIALLING_SMS: - if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - { - setSize(&attr->win_size,0,Mmi_layout_line_icons(1),SCREEN_SIZE_X,24);/*SPR#1840*/ - } - else - setSize(&attr->win_size,WIN_DIALLING_SIZE); - break; - case WIN_DIALLING_SAT: - if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - setSize(&attr->win_size,WIN_DIALLING_C_SIZE); - else - setSize(&attr->win_size,WIN_DIALLING_SIZE); - break; - - case PHNO_EDITOR: setSize(&attr->win_size,PHNO_EDITOR_SIZE); break; - case CENTRE_EDITOR: setSize(&attr->win_size,CENTRE_EDITOR_SIZE); break; - case SAT_EDITOR : setSize(&attr->win_size,SAT_EDITOR_SIZE); break; - case RPWD_EDITOR: setSize(&attr->win_size,RPWD_EDITOR_SIZE); break; - case PHB_EDITOR: setSize(&attr->win_size,PHB_EDITOR_SIZE); break; - case PIN_EDIT_RESET: setSize(&attr->win_size,PIN_EDIT_RESET_SIZE); break; - case TIMEDATE_EDITOR_AREA: setSize(&attr->win_size,TIMEDATE_EDITOR_AREA_SIZE); break; + case BOOKDETAILS_EDITOR: setSize(&attr->win_size,BOOKDETAILS_EDITOR_SIZE); break; + case NUMBER_EDITOR: setSize(&attr->win_size,NUMBER_EDITOR_SIZE); break; + case PHONEBOOK_DLG_EDITOR: setSize(&attr->win_size,PHONEBOOK_DLG_EDITOR_SIZE); break; + case BOOKSDN_EDITOR: setSize(&attr->win_size,BOOKSDN_EDITOR_SIZE); break; + // case BOOKSEARCH_EDITOR: setSize(&attr->win_size,BOOKSEARCH_EDITOR_SIZE); break; + case CALL_EDITOR: setSize(&attr->win_size,CALL_EDITOR_SIZE); break; + case CALLSCRATCHPAD_EDITOR: setSize(&attr->win_size,CALLSCRATCHPAD_EDITOR_SIZE); break; + case SERVICE_CREATE_EDITOR: setSize(&attr->win_size,SERVICE_CREATE_EDITOR_SIZE); break; + case PASSWORD_EDITOR: setSize(&attr->win_size,PASSWORD_EDITOR_SIZE); break; + case EM_CREATE_EDITOR: setSize(&attr->win_size,EM_EDITOR_SIZE); break;/*SPR#1840*/ + + case WIN_DIALLING: + case WIN_DIALLING_CB: + if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + setSize(&attr->win_size,WIN_DIALLING_C_SIZE); + else + setSize(&attr->win_size,WIN_DIALLING_SIZE); + break; + case WIN_DIALLING_SMS: + if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + { + setSize(&attr->win_size,0,Mmi_layout_line_icons(1),SCREEN_SIZE_X,24);/*SPR#1840*/ + } + else + setSize(&attr->win_size,WIN_DIALLING_SIZE); + break; + case WIN_DIALLING_SAT: + if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + setSize(&attr->win_size,WIN_DIALLING_C_SIZE); + else + setSize(&attr->win_size,WIN_DIALLING_SIZE); + break; + + case PHNO_EDITOR: setSize(&attr->win_size,PHNO_EDITOR_SIZE); break; + case CENTRE_EDITOR: setSize(&attr->win_size,CENTRE_EDITOR_SIZE); break; + case SAT_EDITOR : setSize(&attr->win_size,SAT_EDITOR_SIZE); break; + case RPWD_EDITOR: setSize(&attr->win_size,RPWD_EDITOR_SIZE); break; + case PHB_EDITOR: setSize(&attr->win_size,PHB_EDITOR_SIZE); break; + case PIN_EDIT_RESET: setSize(&attr->win_size,PIN_EDIT_RESET_SIZE); break; + case TIMEDATE_EDITOR_AREA: setSize(&attr->win_size,TIMEDATE_EDITOR_AREA_SIZE); break; #endif - default: - break; - } + default: + break; + } } /******************************************************************************* - $Function: AUI_edit_CalculateWindow - - $Description: Sets up window size - - $Returns: None. - - $Arguments: attr - The ATB editor attributes - zone_id - Specifies the window size (See ZONE_... in header file) - SPR#1559 - SH - this is now a pointer to the zone_id, allowing - the zone_id to be modified by this function + $Function: AUI_edit_CalculateWindow + + $Description: Sets up window size + + $Returns: None. + + $Arguments: attr - The ATB editor attributes + zone_id - Specifies the window size (See ZONE_... in header file) + SPR#1559 - SH - this is now a pointer to the zone_id, allowing + the zone_id to be modified by this function *******************************************************************************/ void AUI_edit_CalculateWindow(T_ED_ATTR* attr, int *zone_id_pointer ) { - int zone_id = *zone_id_pointer; - - attr->win_size.px = 0; - attr->win_size.py = 0; - attr->win_size.sx = SCREEN_SIZE_X; - attr->win_size.sy = SCREEN_SIZE_Y; - - if (zone_id == ZONE_BORDER_EDITOR) - { //Leave border on left/right of screen. - attr->win_size.px = 4; - attr->win_size.sx = attr->win_size.sx - 2*attr->win_size.px; - zone_id = ZONE_FULLSOFTKEYS; - *zone_id_pointer = zone_id; - } - else if ((zone_id != 0x0000) && ((zone_id &0xF000)==0xF000))/*SPR#1840*/ - { - AUI_edit_GetSpecificWindowSize(attr,zone_id); - return; - } - else if (zone_id == 0) - { - zone_id = ZONE_FULLSOFTKEYS; - *zone_id_pointer = zone_id; - } - - if (zone_id & ZONE_ICONS) - attr->win_size.py = attr->win_size.py + Mmi_layout_IconHeight(); - - if (zone_id & ZONE_SOFTKEYS) - attr->win_size.sy = attr->win_size.sy - Mmi_layout_softkeyHeight(); - - if (zone_id & ZONE_TITLE) - attr->win_size.py = attr->win_size.py + Mmi_layout_TitleHeight(); - - if (zone_id & ZONE_CASE_ABC) - attr->win_size.sy = attr->win_size.sy - Mmi_layout_line_height(); - - if (zone_id & ZONE_SCROLLBAR) - attr->win_size.sx = attr->win_size.sx - ED_SCROLLBAR_WIDTH; - - attr->win_size.sy = attr->win_size.sy - attr->win_size.py; - - if ((zone_id & ZONE_FULLSCREEN) == ZONE_FULLSCREEN) - return; - - /*Else window is not entire screen */ - - switch (zone_id & ZONE_FULL_HEIGHT) - { - case ZONE_FULL_HEIGHT: - break; - case ZONE_TOPHALF_HEIGHT: - attr->win_size.sy = attr->win_size.sy/2; - break; - case ZONE_MIDDLE_HEIGHT: - attr->win_size.sy = attr->win_size.sy/2; - attr->win_size.py = attr->win_size.py+attr->win_size.sy/2; - break; - case ZONE_BOTTOMHALF_HEIGHT: - attr->win_size.sy = attr->win_size.sy/2; - attr->win_size.py = attr->win_size.py+attr->win_size.sy; - break; - case ZONE_BOTTOMTWOLINES_HEIGHT: - attr->win_size.py = attr->win_size.py+attr->win_size.sy-Mmi_layout_line_height()*2; - attr->win_size.sy = Mmi_layout_line_height()*2; - break; - /* xreddymn OMAPS00075852 May-15-2006 - * This display zone is located one line above the softkeys. - */ - case ZONE_MIDDLETWOLINES_HEIGHT: - attr->win_size.py = attr->win_size.py+attr->win_size.sy-Mmi_layout_line_height()*3; - attr->win_size.sy = Mmi_layout_line_height()*2; - break; - default: - //No action - break; - } - - switch (zone_id & ZONE_FULL_WIDTH) - { - case ZONE_FULL_WIDTH: - break; - case ZONE_LEFTHALF_WIDTH: - attr->win_size.sx = attr->win_size.sx/2; - break; - case ZONE_MIDDLE_WIDTH : - attr->win_size.sx = attr->win_size.sx/2; - attr->win_size.px = attr->win_size.px+attr->win_size.sx/2; - break; - case ZONE_RIGHTHALF_WIDTH: - attr->win_size.sx = attr->win_size.sx/2; - attr->win_size.px = attr->win_size.px+attr->win_size.sx; - break; - default: - //No action - break; - } + int zone_id = *zone_id_pointer; + + attr->win_size.px = 0; + attr->win_size.py = 0; + attr->win_size.sx = SCREEN_SIZE_X; + attr->win_size.sy = SCREEN_SIZE_Y; + + if (zone_id == ZONE_BORDER_EDITOR) + { //Leave border on left/right of screen. + attr->win_size.px = 4; + attr->win_size.sx = attr->win_size.sx - 2*attr->win_size.px; + zone_id = ZONE_FULLSOFTKEYS; + *zone_id_pointer = zone_id; + } + else if ((zone_id != 0x0000) && ((zone_id &0xF000)==0xF000))/*SPR#1840*/ + { + AUI_edit_GetSpecificWindowSize(attr,zone_id); + return; + } + else if (zone_id == 0) + { + zone_id = ZONE_FULLSOFTKEYS; + *zone_id_pointer = zone_id; + } + + if (zone_id & ZONE_ICONS) + attr->win_size.py = attr->win_size.py + Mmi_layout_IconHeight(); + + if (zone_id & ZONE_SOFTKEYS) + attr->win_size.sy = attr->win_size.sy - Mmi_layout_softkeyHeight(); + + if (zone_id & ZONE_TITLE) + attr->win_size.py = attr->win_size.py + Mmi_layout_TitleHeight(); + + if (zone_id & ZONE_CASE_ABC) + attr->win_size.sy = attr->win_size.sy - Mmi_layout_line_height(); + + if (zone_id & ZONE_SCROLLBAR) + attr->win_size.sx = attr->win_size.sx - ED_SCROLLBAR_WIDTH; + + attr->win_size.sy = attr->win_size.sy - attr->win_size.py; + + if ((zone_id & ZONE_FULLSCREEN) == ZONE_FULLSCREEN) + return; + + /*Else window is not entire screen */ + + switch (zone_id & ZONE_FULL_HEIGHT) + { + case ZONE_FULL_HEIGHT: + break; + case ZONE_TOPHALF_HEIGHT: + attr->win_size.sy = attr->win_size.sy/2; + break; + case ZONE_MIDDLE_HEIGHT: + attr->win_size.sy = attr->win_size.sy/2; + attr->win_size.py = attr->win_size.py+attr->win_size.sy/2; + break; + case ZONE_BOTTOMHALF_HEIGHT: + attr->win_size.sy = attr->win_size.sy/2; + attr->win_size.py = attr->win_size.py+attr->win_size.sy; + break; + case ZONE_BOTTOMTWOLINES_HEIGHT: + attr->win_size.py = attr->win_size.py+attr->win_size.sy-Mmi_layout_line_height()*2; + attr->win_size.sy = Mmi_layout_line_height()*2; + break; + /* xreddymn OMAPS00075852 May-15-2006 + * This display zone is located one line above the softkeys. + */ + case ZONE_MIDDLETWOLINES_HEIGHT: + attr->win_size.py = attr->win_size.py+attr->win_size.sy-Mmi_layout_line_height()*3; + attr->win_size.sy = Mmi_layout_line_height()*2; + break; + default: + //No action + break; + } + + switch (zone_id & ZONE_FULL_WIDTH) + { + case ZONE_FULL_WIDTH: + break; + case ZONE_LEFTHALF_WIDTH: + attr->win_size.sx = attr->win_size.sx/2; + break; + case ZONE_MIDDLE_WIDTH : + attr->win_size.sx = attr->win_size.sx/2; + attr->win_size.px = attr->win_size.px+attr->win_size.sx/2; + break; + case ZONE_RIGHTHALF_WIDTH: + attr->win_size.sx = attr->win_size.sx/2; + attr->win_size.px = attr->win_size.px+attr->win_size.sx; + break; + default: + //No action + break; + } } /******************************************************************************* - $Function: AUI_edit_SetDefault - - $Description: Sets up standard editor attributes. - - $Returns: None. - - $Arguments: editor_data - The MMI editor data that is to be modified. + $Function: AUI_edit_SetDefault + + $Description: Sets up standard editor attributes. + + $Returns: None. + + $Arguments: editor_data - The MMI editor data that is to be modified. *******************************************************************************/ void AUI_edit_SetDefault(T_AUI_EDITOR_DATA *editor_data) { - /* Set everything to zero... */ - /* SPR#1559 - Move CalculateWindow to below */ - - memset(editor_data, 0, sizeof(T_AUI_EDITOR_DATA)); - - /* Except these things... */ - - editor_data->editor_attr.colour = COLOUR_EDITOR; - editor_data->editor_attr.font = EDITOR_FONT; - editor_data->editor_attr.cursor = ED_CURSOR_BAR; - editor_data->editor_attr.mode = ED_MODE_ALPHA; - editor_data->editor_attr.text.dcs = ATB_DCS_ASCII; - editor_data->timeout = FOREVER; - editor_data->destroyEditor = TRUE; - editor_data->zone_id = ZONE_FULL_SK_TITLE; + /* Set everything to zero... */ + /* SPR#1559 - Move CalculateWindow to below */ + + memset(editor_data, 0, sizeof(T_AUI_EDITOR_DATA)); + + /* Except these things... */ + + editor_data->editor_attr.colour = COLOUR_EDITOR; + editor_data->editor_attr.font = EDITOR_FONT; + editor_data->editor_attr.cursor = ED_CURSOR_BAR; + editor_data->editor_attr.mode = ED_MODE_ALPHA; + editor_data->editor_attr.text.dcs = ATB_DCS_ASCII; + editor_data->timeout = FOREVER; + editor_data->destroyEditor = TRUE; + editor_data->zone_id = ZONE_FULL_SK_TITLE; // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 #ifdef FF_MMI_SAT_ICON - editor_data->editor_attr.TitleIcon.data = NULL; - editor_data->editor_attr.TitleIcon.width = 0; - editor_data->editor_attr.TitleIcon.height = 0; - editor_data->editor_attr.TitleIcon.isTitle = FALSE; + editor_data->editor_attr.TitleIcon.data = NULL; + editor_data->editor_attr.TitleIcon.width = 0; + editor_data->editor_attr.TitleIcon.height = 0; + editor_data->editor_attr.TitleIcon.isTitle = FALSE; //x0035544 Mar 14, 2006 DR:OMAPS00061468 //set the default value for display_type to SAT_ICON_NONE - editor_data->editor_attr.TitleIcon.display_type = SAT_ICON_NONE; - editor_data->editor_attr.TitleIcon.selfExplanatory = FALSE; + editor_data->editor_attr.TitleIcon.display_type = SAT_ICON_NONE; + editor_data->editor_attr.TitleIcon.selfExplanatory = FALSE; #endif - /* SPR#1559 - SH - CalculateWindow moved here; pointer to zone_id used */ - AUI_edit_CalculateWindow(&editor_data->editor_attr, &editor_data->zone_id); - - ATB_display_ClearFormat(&editor_data->editor_attr.startFormat); - return; + /* SPR#1559 - SH - CalculateWindow moved here; pointer to zone_id used */ + AUI_edit_CalculateWindow(&editor_data->editor_attr, &editor_data->zone_id); + + ATB_display_ClearFormat(&editor_data->editor_attr.startFormat); + return; } /******************************************************************************* - $Function: AUI_edit_SetDisplay - - $Description: Sets up standard editor attributes. - - $Returns: None. - - $Arguments: editor_data - The MMI editor data that is to be modified. - zone_id - Type of editor screen (see header file for ZONE_...) - colour - Colour of the editor + $Function: AUI_edit_SetDisplay + + $Description: Sets up standard editor attributes. + + $Returns: None. + + $Arguments: editor_data - The MMI editor data that is to be modified. + zone_id - Type of editor screen (see header file for ZONE_...) + colour - Colour of the editor *******************************************************************************/ void AUI_edit_SetDisplay(T_AUI_EDITOR_DATA *editor_data, int zone_id, int colour, UBYTE font ) { - /* SPR#1559 - SH - Use pointer to zone_id */ - AUI_edit_CalculateWindow(&editor_data->editor_attr, &zone_id); - editor_data->zone_id = zone_id; - editor_data->editor_attr.colour = colour; - editor_data->editor_attr.font = font; - - return; + /* SPR#1559 - SH - Use pointer to zone_id */ + AUI_edit_CalculateWindow(&editor_data->editor_attr, &zone_id); + editor_data->zone_id = zone_id; + editor_data->editor_attr.colour = colour; + editor_data->editor_attr.font = font; + + return; } /******************************************************************************* - $Function: AUI_edit_SetEvents - - $Description: Sets up standard editor attributes. - - $Returns: None. - - $Arguments: editor_data - The MMI editor data that is to be modified. + $Function: AUI_edit_SetEvents + + $Description: Sets up standard editor attributes. + + $Returns: None. + + $Arguments: editor_data - The MMI editor data that is to be modified. *******************************************************************************/ void AUI_edit_SetEvents(T_AUI_EDITOR_DATA *editor_data, USHORT Identifier, BOOL destroyEditor, ULONG timeout, T_AUI_EDIT_CB Callback) { - if (editor_data) - { - editor_data->Identifier = Identifier; - editor_data->destroyEditor = destroyEditor; - editor_data->timeout = timeout; - editor_data->Callback = Callback; - } - return; + if (editor_data) + { + editor_data->Identifier = Identifier; + editor_data->destroyEditor = destroyEditor; + editor_data->timeout = timeout; + editor_data->Callback = Callback; + } + return; } /******************************************************************************* - $Function: AUI_edit_SetMode - - $Description: Sets up standard editor attributes. - - $Returns: None. - - $Arguments: editor_data - The MMI editor data that is to be modified. - mode - Editor mode (see header file for ED_MODE_...) - cursor - Editor cursor (see header file for ED_CURSOR_...) + $Function: AUI_edit_SetMode + + $Description: Sets up standard editor attributes. + + $Returns: None. + + $Arguments: editor_data - The MMI editor data that is to be modified. + mode - Editor mode (see header file for ED_MODE_...) + cursor - Editor cursor (see header file for ED_CURSOR_...) *******************************************************************************/ void AUI_edit_SetMode(T_AUI_EDITOR_DATA *editor_data, USHORT mode, USHORT cursor ) { - if (editor_data) - { - editor_data->editor_attr.mode = mode; - editor_data->editor_attr.cursor = cursor; - } - - return; + if (editor_data) + { + editor_data->editor_attr.mode = mode; + editor_data->editor_attr.cursor = cursor; + } + + return; } /******************************************************************************* - $Function: AUI_edit_SetBuffer - - $Description: Sets up standard editor attributes. - - $Returns: None. - - $Arguments: editor_data - The MMI editor data that is to be modified. - dcs - Data coding scheme of text (see ATB_DCS_...) - text - The text in the appropriate coding scheme - size - Maximum size of the edit buffer in characters + $Function: AUI_edit_SetBuffer + + $Description: Sets up standard editor attributes. + + $Returns: None. + + $Arguments: editor_data - The MMI editor data that is to be modified. + dcs - Data coding scheme of text (see ATB_DCS_...) + text - The text in the appropriate coding scheme + size - Maximum size of the edit buffer in characters *******************************************************************************/ void AUI_edit_SetBuffer(T_AUI_EDITOR_DATA *editor_data, UBYTE dcs, UBYTE *text, USHORT size) { - if (editor_data) - { - editor_data->editor_attr.text.dcs = dcs; - editor_data->editor_attr.text.data = text; - editor_data->editor_attr.text.len = ATB_string_Length(&editor_data->editor_attr.text); - editor_data->editor_attr.size = size; - } - - return; + if (editor_data) + { + editor_data->editor_attr.text.dcs = dcs; + editor_data->editor_attr.text.data = text; + editor_data->editor_attr.text.len = ATB_string_Length(&editor_data->editor_attr.text); + editor_data->editor_attr.size = size; + } + + return; } /******************************************************************************* - $Function: AUI_edit_SetTextStr - - $Description: Sets up standard editor attributes. - - $Returns: None. - - $Arguments: editor_data - The MMI editor data that is to be modified. - LeftSoftKey, RightSoftKey - Text IDs of the softkeys - TitleId - Text ID for the title - TextString - Text string for the title, used if TitleId is 0 + $Function: AUI_edit_SetTextStr + + $Description: Sets up standard editor attributes. + + $Returns: None. + + $Arguments: editor_data - The MMI editor data that is to be modified. + LeftSoftKey, RightSoftKey - Text IDs of the softkeys + TitleId - Text ID for the title + TextString - Text string for the title, used if TitleId is 0 *******************************************************************************/ void AUI_edit_SetTextStr(T_AUI_EDITOR_DATA *editor_data, USHORT LeftSoftKey, USHORT RightSoftKey, USHORT TitleId, UBYTE *TitleString) { - if (editor_data) - { - editor_data->LeftSoftKey = LeftSoftKey; - editor_data->RightSoftKey = RightSoftKey; - editor_data->AltRightSoftKey = RightSoftKey; - editor_data->TitleId = TitleId; - editor_data->TitleString = TitleString; - } - - return; + if (editor_data) + { + editor_data->LeftSoftKey = LeftSoftKey; + editor_data->RightSoftKey = RightSoftKey; + editor_data->AltRightSoftKey = RightSoftKey; + editor_data->TitleId = TitleId; + editor_data->TitleString = TitleString; + } + + return; } /******************************************************************************* - $Function: AUI_edit_SetAltTextStr - - $Description: Sets up standard editor attributes. - - $Returns: None. - - $Arguments: editor_data - The MMI editor data that is to be modified. - min_enter - No of characters needed to be entered - AltLeftSoftKey - Text ID of alternate left softkey - change_rsk_on_empty - TRUE if alternative right soft key is used for - empty buffer - AltRightSoftKey - Text ID of alternative right softkey + $Function: AUI_edit_SetAltTextStr + + $Description: Sets up standard editor attributes. + + $Returns: None. + + $Arguments: editor_data - The MMI editor data that is to be modified. + min_enter - No of characters needed to be entered + AltLeftSoftKey - Text ID of alternate left softkey + change_rsk_on_empty - TRUE if alternative right soft key is used for + empty buffer + AltRightSoftKey - Text ID of alternative right softkey *******************************************************************************/ void AUI_edit_SetAltTextStr(T_AUI_EDITOR_DATA *editor_data, UBYTE min_enter, USHORT AltLeftSoftKey, BOOL change_rsk_on_empty, USHORT AltRightSoftKey) { - if (editor_data) - { - editor_data->AltLeftSoftKey = AltLeftSoftKey; - editor_data->min_enter = min_enter; - editor_data->AltRightSoftKey = AltRightSoftKey; - editor_data->change_rsk_on_empty = change_rsk_on_empty; - } - - return; + if (editor_data) + { + editor_data->AltLeftSoftKey = AltLeftSoftKey; + editor_data->min_enter = min_enter; + editor_data->AltRightSoftKey = AltRightSoftKey; + editor_data->change_rsk_on_empty = change_rsk_on_empty; + } + + return; } /******************************************************************************* - $Function: AUI_edit_SetFormatStr - - $Description: Sets up standard editor attributes. - - $Returns: None. - - $Arguments: editor_data - The MMI editor data that is to be modified. - formatstr - The formatted input string - preformat - TRUE if format codes are to be inserted into text - before editing - filler - If preformat is true, this character will be used to - pad out the provided string + $Function: AUI_edit_SetFormatStr + + $Description: Sets up standard editor attributes. + + $Returns: None. + + $Arguments: editor_data - The MMI editor data that is to be modified. + formatstr - The formatted input string + preformat - TRUE if format codes are to be inserted into text + before editing + filler - If preformat is true, this character will be used to + pad out the provided string *******************************************************************************/ void AUI_edit_SetFormatStr(T_AUI_EDITOR_DATA *editor_data, char *formatstr, BOOL preformat, char filler) { - USHORT textIndex; - USHORT formatIndex; -// USHORT character; // RAVI - - TRACE_FUNCTION("AUI_edit_SetFormatStr()"); - - if (editor_data) - { - editor_data->editor_attr.FormatString = formatstr; - - /* SPR#1983 - SH - *m and *M strings are freeform, no preformatting required */ - if (preformat && strcmp(formatstr, "*m")!=0 && strcmp(formatstr, "*M")!=0) - { - formatIndex = 0; - textIndex = 0; - - /* SPR#1983 - SH - Ensure formatting doesn't write over null terminator */ - while (formatstr[formatIndex]!=0 && - !strchr("123456789*", formatstr[formatIndex]) && /* Exit at delimited field */ - textIndex<(editor_data->editor_attr.size-1)) - { - /* Encountered fixed character */ - if (formatstr[formatIndex]=='\\') - { - formatIndex++; - ATB_string_SetChar(&editor_data->editor_attr.text, textIndex, ATB_char_Unicode(formatstr[formatIndex])); - } - /* If editor text has run out, fill the rest with our filler character */ - else if (textIndex>editor_data->editor_attr.text.len) - { - ATB_string_SetChar(&editor_data->editor_attr.text, textIndex, ATB_char_Unicode(filler)); - } - if(formatstr[formatIndex]!=0) /*a0393213 lint warnings removal - 'Possible access of out-of-bounds pointer'*/ - { - formatIndex++; - textIndex++; - } - } - } - } - - return; + USHORT textIndex; + USHORT formatIndex; +// USHORT character; // RAVI + + TRACE_FUNCTION("AUI_edit_SetFormatStr()"); + + if (editor_data) + { + editor_data->editor_attr.FormatString = formatstr; + + /* SPR#1983 - SH - *m and *M strings are freeform, no preformatting required */ + if (preformat && strcmp(formatstr, "*m")!=0 && strcmp(formatstr, "*M")!=0) + { + formatIndex = 0; + textIndex = 0; + + /* SPR#1983 - SH - Ensure formatting doesn't write over null terminator */ + while (formatstr[formatIndex]!=0 && + !strchr("123456789*", formatstr[formatIndex]) && /* Exit at delimited field */ + textIndex<(editor_data->editor_attr.size-1)) + { + /* Encountered fixed character */ + if (formatstr[formatIndex]=='\\') + { + formatIndex++; + ATB_string_SetChar(&editor_data->editor_attr.text, textIndex, ATB_char_Unicode(formatstr[formatIndex])); + } + /* If editor text has run out, fill the rest with our filler character */ + else if (textIndex>editor_data->editor_attr.text.len) + { + ATB_string_SetChar(&editor_data->editor_attr.text, textIndex, ATB_char_Unicode(filler)); + } + if(formatstr[formatIndex]!=0) /*a0393213 lint warnings removal - 'Possible access of out-of-bounds pointer'*/ + { + formatIndex++; + textIndex++; + } + } + } + } + + return; } /******************************************************************************* - $Function: AUI_edit_SetFormatAttr - - $Description: Sets up standard editor attributes. - - $Returns: None. - - $Arguments: editor_data - The MMI editor data that is to be modified. - startFormat - Pointer to text formatting data structure + $Function: AUI_edit_SetFormatAttr + + $Description: Sets up standard editor attributes. + + $Returns: None. + + $Arguments: editor_data - The MMI editor data that is to be modified. + startFormat - Pointer to text formatting data structure *******************************************************************************/ void AUI_edit_SetFormatAttr(T_AUI_EDITOR_DATA *editor_data, UBYTE attr) { - if (editor_data) - { - editor_data->editor_attr.startFormat.attr = attr; - } - - return; + if (editor_data) + { + editor_data->editor_attr.startFormat.attr = attr; + } + + return; } /******************************************************************************* - $Function: AUI_edit_SetAttr - - $Description: Set some standard editor attributes - - $Returns: None. - - $Arguments: attr - The editor attr + $Function: AUI_edit_SetAttr + + $Description: Set some standard editor attributes + + $Returns: None. + + $Arguments: attr - The editor attr *******************************************************************************/ void AUI_edit_SetAttr(T_ED_ATTR *attr, int zone_id, ULONG colour, UBYTE font, USHORT mode, USHORT cursor, T_ATB_DCS dcs, UBYTE *text, USHORT size) { - /* Populate the structure with the parameters - */ - /* SPR#1559 - SH - Use pointer to zone_id */ - AUI_edit_CalculateWindow(attr, &zone_id ); - attr->colour = colour; - attr->font = font; - attr->mode = mode; - attr->cursor = cursor; - attr->text.dcs = dcs; - attr->text.data = text; - attr->text.len = ATB_string_Length(&attr->text); - attr->size = size; - - return; + /* Populate the structure with the parameters + */ + /* SPR#1559 - SH - Use pointer to zone_id */ + AUI_edit_CalculateWindow(attr, &zone_id ); + attr->colour = colour; + attr->font = font; + attr->mode = mode; + attr->cursor = cursor; + attr->text.dcs = dcs; + attr->text.data = text; + attr->text.len = ATB_string_Length(&attr->text); + attr->size = size; + + return; } /* API - 08/07/03 - CQ10728 - Query your own number with a D1 SIM*/ /******************************************************************************* - $Function: AUI_Edit_Display_Only - - $Description: Sets up the display requirements for the Editor & also shows it - - $Returns: None. - - $Arguments: win - parent window, LSK - Left Soft Key, RSK - Right Soft Key - string1 - String details, string2 - String details, Title - Editor title string + $Function: AUI_Edit_Display_Only + + $Description: Sets up the display requirements for the Editor & also shows it + + $Returns: None. + + $Arguments: win - parent window, LSK - Left Soft Key, RSK - Right Soft Key + string1 - String details, string2 - String details, Title - Editor title string *******************************************************************************/ void AUI_Edit_Display_Only(T_MFW_HND win, int LSK, int RSK, char *string1, char *string2, int Title) { - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; - - T_AUI_EDITOR_DATA display_editor_info; - - int size = MAX_RO_EDITOR_LEN; - - AUI_edit_SetDefault(&display_editor_info); - - /* Include title for colour display */ + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; + + T_AUI_EDITOR_DATA display_editor_info; + + int size = MAX_RO_EDITOR_LEN; + + AUI_edit_SetDefault(&display_editor_info); + + /* Include title for colour display */ #ifdef COLOURDISPLAY - AUI_edit_SetDisplay(&display_editor_info, ZONE_FULL_SK_TITLE_SCROLL, COLOUR_EDITOR, EDITOR_FONT); + AUI_edit_SetDisplay(&display_editor_info, ZONE_FULL_SK_TITLE_SCROLL, COLOUR_EDITOR, EDITOR_FONT); #else /* COLOURDISPLAY */ - AUI_edit_SetDisplay(&display_editor_info, ZONE_FULL_SK_SCROLL, COLOUR_EDITOR, EDITOR_FONT); + AUI_edit_SetDisplay(&display_editor_info, ZONE_FULL_SK_SCROLL, COLOUR_EDITOR, EDITOR_FONT); #endif /* COLOURDISPLAY */ - AUI_edit_SetMode(&display_editor_info, ED_MODE_ALPHA | ED_MODE_READONLY, ED_CURSOR_NONE); - AUI_edit_SetEvents(&display_editor_info, 0, FALSE, FOREVER, (T_AUI_EDIT_CB) AUI_Edit_Display_Only_CB); - AUI_edit_SetTextStr(&display_editor_info, LSK, RSK, Title, NULL); - - /* SPR#2672 - SH - Allocate buffer dynamically */ - - data->displayBuffer = (char *)ALLOC_MEMORY(size); - - strcpy(data->displayBuffer, string1); - - if(string2 != NULL) - { - strcat(data->displayBuffer, "\n"); - strcat(data->displayBuffer, string2); - } - - if (data->displayBuffer[0]==(char)0x80) - { - AUI_edit_SetBuffer(&display_editor_info, ATB_DCS_UNICODE, (UBYTE *)&data->displayBuffer[2], size/2); - } - else - { - AUI_edit_SetBuffer(&display_editor_info, ATB_DCS_ASCII, (UBYTE *)&data->displayBuffer[0], size); - } - - data->win = AUI_edit_Start(win,&display_editor_info); /* start the editor */ + AUI_edit_SetMode(&display_editor_info, ED_MODE_ALPHA | ED_MODE_READONLY, ED_CURSOR_NONE); + AUI_edit_SetEvents(&display_editor_info, 0, FALSE, FOREVER, (T_AUI_EDIT_CB) AUI_Edit_Display_Only_CB); + AUI_edit_SetTextStr(&display_editor_info, LSK, RSK, Title, NULL); + + /* SPR#2672 - SH - Allocate buffer dynamically */ + + data->displayBuffer = (char *)ALLOC_MEMORY(size); + + strcpy(data->displayBuffer, string1); + + if(string2 != NULL) + { + strcat(data->displayBuffer, "\n"); + strcat(data->displayBuffer, string2); + } + + if (data->displayBuffer[0]==(char)0x80) + { + AUI_edit_SetBuffer(&display_editor_info, ATB_DCS_UNICODE, (UBYTE *)&data->displayBuffer[2], size/2); + } + else + { + AUI_edit_SetBuffer(&display_editor_info, ATB_DCS_ASCII, (UBYTE *)&data->displayBuffer[0], size); + } + + data->win = AUI_edit_Start(win,&display_editor_info); /* start the editor */ } /******************************************************************************* - $Function: AUI_Edit_Display_Only_CB - - $Description: Handles the key call back from the Read only Editor - - $Returns: None. + $Function: AUI_Edit_Display_Only_CB + + $Description: Handles the key call back from the Read only Editor + + $Returns: None. $Arguments: *******************************************************************************/ static void AUI_Edit_Display_Only_CB(T_MFW_HND win, USHORT Identifier, SHORT reason) { - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_AUI_EDITOR_INFO * data = (T_AUI_EDITOR_INFO *)win_data->user; + T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; + T_AUI_EDITOR_INFO * data = (T_AUI_EDITOR_INFO *)win_data->user; TRACE_EVENT("AUI_Edit_Display_Only_CB"); - switch(reason) - { - case INFO_KCD_RIGHT: - case INFO_KCD_HUP: - TRACE_EVENT("INFO_KCD_RIGHT/HUP"); - AUI_Edit_Display_Only_Destroy(data->win); - break; - - default: - TRACE_EVENT("Err: Default"); - break; - - } + switch(reason) + { + case INFO_KCD_RIGHT: + case INFO_KCD_HUP: + TRACE_EVENT("INFO_KCD_RIGHT/HUP"); + AUI_Edit_Display_Only_Destroy(data->win); + break; + + default: + TRACE_EVENT("Err: Default"); + break; + + } } /******************************************************************************* - $Function: AUI_Edit_Display_Only_Destroy - - $Description: Destroy the Read only information Editor - - $Returns: none - - $Arguments: own_window - current window handler + $Function: AUI_Edit_Display_Only_Destroy + + $Description: Destroy the Read only information Editor + + $Returns: none + + $Arguments: own_window - current window handler *******************************************************************************/ @@ -2761,45 +2756,45 @@ T_MFW_WIN * win_data; T_AUI_EDITOR_INFO * data; -// USHORT i; // RAVI +// USHORT i; // RAVI TRACE_FUNCTION ("SmsRead_R_TEXTEDT2_destroy()"); if (own_window) - { - win_data = ((T_MFW_HDR *)own_window)->data; - data = (T_AUI_EDITOR_INFO *)win_data->user; - - if (data) - { - /* - * Delete WIN handler - */ - - /* SPR#2672 - SH - Delete buffer */ - - if (data->displayBuffer!=NULL) - { - FREE_MEMORY((void *)data->displayBuffer, MAX_RO_EDITOR_LEN); - } - - /* SPR#1428 - SH - New Editor changes */ + { + win_data = ((T_MFW_HDR *)own_window)->data; + data = (T_AUI_EDITOR_INFO *)win_data->user; + + if (data) + { + /* + * Delete WIN handler + */ + + /* SPR#2672 - SH - Delete buffer */ + + if (data->displayBuffer!=NULL) + { + FREE_MEMORY((void *)data->displayBuffer, MAX_RO_EDITOR_LEN); + } + + /* SPR#1428 - SH - New Editor changes */ #ifdef NEW_EDITOR - AUI_edit_Destroy(data->win); + AUI_edit_Destroy(data->win); #else /* NEW_EDITOR */ - editor_destroy(data->win); + editor_destroy(data->win); #endif /* NEW_EDITOR */ - win_delete (data->win); - - FREE_MEMORY ((void *)data, sizeof (T_AUI_EDITOR_INFO)); - - - } - else - { - TRACE_EVENT ("SmsRead_R_TEXTEDT2_destroy() called twice"); - } - } + win_delete (data->win); + + FREE_MEMORY ((void *)data, sizeof (T_AUI_EDITOR_INFO)); + + + } + else + { + TRACE_EVENT ("SmsRead_R_TEXTEDT2_destroy() called twice"); + } + } } /* API - 08/07/03 - CQ10728 END*/ diff -r 62480f597962 -r 70ea7526b59e src/ui/bmi/AUIPinEditor.c --- a/src/ui/bmi/AUIPinEditor.c Tue Nov 10 07:12:03 2020 +0000 +++ b/src/ui/bmi/AUIPinEditor.c Sat Nov 14 03:18:11 2020 +0000 @@ -11,12 +11,12 @@ $Project name: Basic MMI $Project code: BMI (6349) - $Module: MMI - $File: AUIPinEditor.c - $Revision: 1.0 + $Module: MMI + $File: AUIPinEditor.c + $Revision: 1.0 - $Author: Condat(UK) - $Date: 22/02/01 + $Author: Condat(UK) + $Date: 22/02/01 ******************************************************************************** @@ -34,21 +34,21 @@ The password mode to be turned on while entering the gsm string to unblock PUK during bootup - July 09, 2005 REF : MMI - 22565 - a0876501 - Description: Proper display of IMEI with CD byte. - Solution: Increased the IMEI length from 16 to 18. + July 09, 2005 REF : MMI - 22565 - a0876501 + Description: Proper display of IMEI with CD byte. + Solution: Increased the IMEI length from 16 to 18. - June 16, 2005 REF: CRR 31267 x0021334 - Description: Handset ignore the initializtion of the PIN1/PIN2 - Fix: Cheking is done to ascertain if PIN1/PIN2 are initialised. If not, appropriate - message is displayed to the user. + June 16, 2005 REF: CRR 31267 x0021334 + Description: Handset ignore the initializtion of the PIN1/PIN2 + Fix: Cheking is done to ascertain if PIN1/PIN2 are initialised. If not, appropriate + message is displayed to the user. - May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg - Description: IMEI retreival by posting a call to ACI sAT_xx API - Solution: The direct call to cl_get_imeisv() is replaced with the - call to the mmi_imei_retrieve() which inturn calls sAT_Dn() and - retrieves the IMEI info and stores it onto the global - variable "imei" + May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg + Description: IMEI retreival by posting a call to ACI sAT_xx API + Solution: The direct call to cl_get_imeisv() is replaced with the + call to the mmi_imei_retrieve() which inturn calls sAT_Dn() and + retrieves the IMEI info and stores it onto the global + variable "imei" 14/11/02 Original Condat(UK) BMI version. $End @@ -128,32 +128,32 @@ #include "AUIPinEditor.h" //Nov 17, 2005 REF : OMAPS00045901 - a0876501 -#define IMEI_DISP_LEN 18 /* IMEI display now includes CD byte. Hence the size has been increased from 16 to 18 */ +#define IMEI_DISP_LEN 18 /* IMEI display now includes CD byte. Hence the size has been increased from 16 to 18 */ typedef struct { - T_MMI_CONTROL mmi_control; - T_MFW_HND parent; // The parent window - T_MFW_HND win; // The edit window - T_MFW_HND kbd; // The keyboard handler - T_MFW_HND kbd_long; // The longpress keyboard handler - T_MFW_HND timer; // The timer for timeouts + T_MMI_CONTROL mmi_control; + T_MFW_HND parent; // The parent window + T_MFW_HND win; // The edit window + T_MFW_HND kbd; // The keyboard handler + T_MFW_HND kbd_long; // The longpress keyboard handler + T_MFW_HND timer; // The timer for timeouts - T_ED_DATA *editor; /* The ATB editor */ - T_AUI_EDITOR_DATA editor_data; /* The MMI editor data, provided by caller */ - T_AUI_ENTRY_DATA *entry_data; /* The MMI text entry data */ + T_ED_DATA *editor; /* The ATB editor */ + T_AUI_EDITOR_DATA editor_data; /* The MMI editor data, provided by caller */ + T_AUI_ENTRY_DATA *entry_data; /* The MMI text entry data */ - BOOL haveTitle; /* TRUE if a title is supplied */ - T_ATB_TEXT title; /* Title of editor */ + BOOL haveTitle; /* TRUE if a title is supplied */ + T_ATB_TEXT title; /* Title of editor */ - BOOL hidden; + BOOL hidden; - BOOL doNextLongPress; /* Flag used to notice/not notice long keypress */ - BOOL enteredMinChars; /* Set to TRUE when at least min_enter characters have been entered */ - BOOL enteredSomeChars; /* Set to TRUE if the length of the entered data is non-zero */ - UBYTE emergency_call; /* Set to TRUE if number is an emergency call number */ - UBYTE ss_string; - char imei[IMEI_DISP_LEN];/* IMEI display now includes CD byte. Hence the size has been increased from 16 to 18 */ + BOOL doNextLongPress; /* Flag used to notice/not notice long keypress */ + BOOL enteredMinChars; /* Set to TRUE when at least min_enter characters have been entered */ + BOOL enteredSomeChars; /* Set to TRUE if the length of the entered data is non-zero */ + UBYTE emergency_call; /* Set to TRUE if number is an emergency call number */ + UBYTE ss_string; + char imei[IMEI_DISP_LEN];/* IMEI display now includes CD byte. Hence the size has been increased from 16 to 18 */ } T_AUI_PIN_DATA; @@ -164,10 +164,10 @@ typedef struct { - U8 pin_id; - char puk_code[AUI_MAX_PIN + 1]; - char new_pin[AUI_MAX_PIN + 1]; - char cnf_pin[AUI_MAX_PIN + 1]; + U8 pin_id; + char puk_code[AUI_MAX_PIN + 1]; + char new_pin[AUI_MAX_PIN + 1]; + char cnf_pin[AUI_MAX_PIN + 1]; } T_AUI_PINS; /* LOCAL FUNCTION PROTOTYPES */ @@ -181,17 +181,15 @@ static BOOL AUI_pin_StripSSUnblock(char *cmd_string, T_AUI_PINS *pin_data); - - /******************************************************************************* - $Function: AUI_pin_Start + $Function: AUI_pin_Start - $Description: Start the PIN editor. + $Description: Start the PIN editor. - $Returns: None. + $Returns: None. - $Arguments: None. + $Arguments: None. *******************************************************************************/ @@ -209,53 +207,53 @@ /******************************************************************************* - $Function: AUI_pin_Create + $Function: AUI_pin_Create - $Description: Create the PIN editor. + $Description: Create the PIN editor. - $Returns: Pointer to the editor's window. + $Returns: Pointer to the editor's window. - $Arguments: parent - The parent window. + $Arguments: parent - The parent window. *******************************************************************************/ static T_MFW_HND AUI_pin_Create(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data) { - T_AUI_PIN_DATA *data; - T_MFW_WIN *win_data; + T_AUI_PIN_DATA *data; + T_MFW_WIN *win_data; TRACE_FUNCTION ("AUI_pin_Create()"); TRACE_EVENT_P1("Memory left (start): %d", mfwCheckMemoryLeft()); - data = (T_AUI_PIN_DATA *)ALLOC_MEMORY(sizeof (T_AUI_PIN_DATA)); - TRACE_EVENT_P1("Memory left (data): %d", mfwCheckMemoryLeft()); + data = (T_AUI_PIN_DATA *)ALLOC_MEMORY(sizeof (T_AUI_PIN_DATA)); + TRACE_EVENT_P1("Memory left (data): %d", mfwCheckMemoryLeft()); - /* Create window handler */ + /* Create window handler */ - data->win = win_create(parent, 0, E_WIN_VISIBLE, (T_MFW_CB)AUI_pin_WinCb); // Create window - TRACE_EVENT_P1("Memory left (win): %d", mfwCheckMemoryLeft()); + data->win = win_create(parent, 0, E_WIN_VISIBLE, (T_MFW_CB)AUI_pin_WinCb); // Create window + TRACE_EVENT_P1("Memory left (win): %d", mfwCheckMemoryLeft()); - if (data->win==NULL) // Make sure window exists + if (data->win==NULL) // Make sure window exists { - return NULL; + return NULL; } - /* Connect the dialog data to the MFW-window */ + /* Connect the dialog data to the MFW-window */ - data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_pin_ExecCb; /* Setup the destination for events */ - data->mmi_control.data = data; - data->parent = parent; - win_data = ((T_MFW_HDR *)data->win)->data; - win_data->user = (void *)data; + data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_pin_ExecCb; /* Setup the destination for events */ + data->mmi_control.data = data; + data->parent = parent; + win_data = ((T_MFW_HDR *)data->win)->data; + win_data->user = (void *)data; - data->kbd = kbd_create(data->win, KEY_ALL,(T_MFW_CB)AUI_pin_KbdCb); - data->kbd_long = kbd_create(data->win, KEY_ALL|KEY_LONG,(T_MFW_CB)AUI_pin_KbdLongCb); - data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0); + data->kbd = kbd_create(data->win, KEY_ALL,(T_MFW_CB)AUI_pin_KbdCb); + data->kbd_long = kbd_create(data->win, KEY_ALL|KEY_LONG,(T_MFW_CB)AUI_pin_KbdLongCb); + data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0); TRACE_EVENT_P1("Memory left (editor): %d", mfwCheckMemoryLeft()); - data->editor_data = *editor_data; - data->entry_data = AUI_entry_Create(data->win, data->editor, E_PIN_UPDATE); + data->editor_data = *editor_data; + data->entry_data = AUI_entry_Create(data->win, data->editor, E_PIN_UPDATE); TRACE_EVENT_P1("Memory left (entry): %d", mfwCheckMemoryLeft()); - SEND_EVENT(data->win, E_PIN_INIT, 0, 0); + SEND_EVENT(data->win, E_PIN_INIT, 0, 0); /* Return window handle */ @@ -265,50 +263,50 @@ /******************************************************************************* - $Function: AUI_pin_Destroy + $Function: AUI_pin_Destroy - $Description: Destroy the PIN editor. + $Description: Destroy the PIN editor. - $Returns: None. + $Returns: None. - $Arguments: window - The editor window. + $Arguments: window - The editor window. *******************************************************************************/ void AUI_pin_Destroy(T_MFW_HND win) { - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; - TRACE_FUNCTION("AUI_pin_Destroy"); - TRACE_EVENT_P1("Memory left at start: %d", mfwCheckMemoryLeft()); + TRACE_FUNCTION("AUI_pin_Destroy"); + TRACE_EVENT_P1("Memory left at start: %d", mfwCheckMemoryLeft()); if (data) { - /* Free memory allocated for title */ + /* Free memory allocated for title */ - if (data->haveTitle) - { - FREE_MEMORY(data->title.data, (data->title.len+1)*ATB_string_Size(&data->title)); - TRACE_EVENT_P1("Memory left (title dest): %d", mfwCheckMemoryLeft()); - } + if (data->haveTitle) + { + FREE_MEMORY(data->title.data, (data->title.len+1)*ATB_string_Size(&data->title)); + TRACE_EVENT_P1("Memory left (title dest): %d", mfwCheckMemoryLeft()); + } - /* Free text entry memory */ + /* Free text entry memory */ - AUI_entry_Destroy(data->entry_data); - TRACE_EVENT_P1("Memory left (entry dest): %d", mfwCheckMemoryLeft()); - /* Delete window */ + AUI_entry_Destroy(data->entry_data); + TRACE_EVENT_P1("Memory left (entry dest): %d", mfwCheckMemoryLeft()); + /* Delete window */ win_delete (data->win); - TRACE_EVENT_P1("Memory left (win dest): %d", mfwCheckMemoryLeft()); - /* Free editor memory */ + TRACE_EVENT_P1("Memory left (win dest): %d", mfwCheckMemoryLeft()); + /* Free editor memory */ - ATB_edit_Destroy(data->editor); - TRACE_EVENT_P1("Memory left (editor dest): %d", mfwCheckMemoryLeft()); - /* Free Memory */ + ATB_edit_Destroy(data->editor); + TRACE_EVENT_P1("Memory left (editor dest): %d", mfwCheckMemoryLeft()); + /* Free Memory */ - FREE_MEMORY ((void *)data, sizeof (T_AUI_PIN_DATA)); - TRACE_EVENT_P1("Memory left (data dest): %d", mfwCheckMemoryLeft()); + FREE_MEMORY ((void *)data, sizeof (T_AUI_PIN_DATA)); + TRACE_EVENT_P1("Memory left (data dest): %d", mfwCheckMemoryLeft()); } return; @@ -317,302 +315,302 @@ /******************************************************************************* - $Function: AUI_pin_ExecCb + $Function: AUI_pin_ExecCb - $Description: Dialog function for PIN editor. + $Description: Dialog function for PIN editor. - $Returns: None. + $Returns: None. - $Arguments: None. + $Arguments: None. *******************************************************************************/ static void AUI_pin_ExecCb(T_MFW_HND win, USHORT event, SHORT value, void *parameter) { - T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; - T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; - T_MFW_HND parent_win = data->parent; - T_ATB_TEXT text={0,0,NULL}; - /* Store these in case editor is destroyed on callback */ - USHORT Identifier = data->editor_data.Identifier; - T_AUI_EDIT_CB Callback = data->editor_data.Callback; - UBYTE destroyEditor = data->editor_data.destroyEditor; - T_AUI_PINS *pin_unblock_data; + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; + T_MFW_HND parent_win = data->parent; + T_ATB_TEXT text={0,0,NULL}; + /* Store these in case editor is destroyed on callback */ + USHORT Identifier = data->editor_data.Identifier; + T_AUI_EDIT_CB Callback = data->editor_data.Callback; + UBYTE destroyEditor = data->editor_data.destroyEditor; + T_AUI_PINS *pin_unblock_data; TRACE_FUNCTION ("AUI_pin_ExecCb()"); switch (event) { - /* Initialise */ + /* Initialise */ case E_PIN_INIT: - TRACE_EVENT("E_PIN_INIT"); - ATB_edit_Init(data->editor); + TRACE_EVENT("E_PIN_INIT"); + ATB_edit_Init(data->editor); - data->haveTitle = FALSE; + data->haveTitle = FALSE; - /* If we require an output line, shrink editor to fit it at bottom - * NB TitleString is assumed here to be a numeric string of ascii digits */ + /* If we require an output line, shrink editor to fit it at bottom + * NB TitleString is assumed here to be a numeric string of ascii digits */ - if (data->editor_data.TitleString) - { - data->haveTitle = TRUE; - text.data = data->editor_data.TitleString; - } + if (data->editor_data.TitleString) + { + data->haveTitle = TRUE; + text.data = data->editor_data.TitleString; + } - /* Set up title */ + /* Set up title */ - if (data->editor_data.TitleId!=NULL) - { - data->haveTitle = TRUE; - text.data = (UBYTE *)MmiRsrcGetText(data->editor_data.TitleId); - } + if (data->editor_data.TitleId!=NULL) + { + data->haveTitle = TRUE; + text.data = (UBYTE *)MmiRsrcGetText(data->editor_data.TitleId); + } - /* If title exists, get its dcs and length */ + /* If title exists, get its dcs and length */ - if (data->haveTitle) - { - if (text.data[0]==0x80) - { - text.data += 2; /* Skip over two unicode indicator bytes */ - text.dcs = ATB_DCS_UNICODE; - } + if (data->haveTitle) + { + if (text.data[0]==0x80) + { + text.data += 2; /* Skip over two unicode indicator bytes */ + text.dcs = ATB_DCS_UNICODE; + } #ifdef EASY_TEXT_ENABLED - else if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) - { - text.dcs = ATB_DCS_UNICODE; - } + else if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) + { + text.dcs = ATB_DCS_UNICODE; + } #endif - else - { - text.dcs = ATB_DCS_ASCII; - } + else + { + text.dcs = ATB_DCS_ASCII; + } - text.len = ATB_string_Length(&text); - /* Allocate memory for the title and copy the text there */ - data->title.data = (UBYTE *)ALLOC_MEMORY((text.len+1)*ATB_string_Size(&text)); - TRACE_EVENT_P1("Memory left (title): %d", mfwCheckMemoryLeft()); - ATB_string_Copy(&data->title, &text); - } + text.len = ATB_string_Length(&text); + /* Allocate memory for the title and copy the text there */ + data->title.data = (UBYTE *)ALLOC_MEMORY((text.len+1)*ATB_string_Size(&text)); + TRACE_EVENT_P1("Memory left (title): %d", mfwCheckMemoryLeft()); + ATB_string_Copy(&data->title, &text); + } - /* Set flag if min_enter characters are in buffer */ + /* Set flag if min_enter characters are in buffer */ - if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) - data->enteredMinChars = TRUE; - else - data->enteredMinChars = FALSE; + if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) + data->enteredMinChars = TRUE; + else + data->enteredMinChars = FALSE; - /* Set flag if some characters are in the buffer */ - if (data->editor_data.editor_attr.text.len > 0 ) - data->enteredSomeChars = TRUE; - else - data->enteredSomeChars = FALSE; + /* Set flag if some characters are in the buffer */ + if (data->editor_data.editor_attr.text.len > 0 ) + data->enteredSomeChars = TRUE; + else + data->enteredSomeChars = FALSE; - /* Show the window */ - win_show(data->win); - break; + /* Show the window */ + win_show(data->win); + break; - case E_PIN_UPDATE: - TRACE_EVENT("E_PIN_UPDATE"); - win_show(data->win); - break; + case E_PIN_UPDATE: + TRACE_EVENT("E_PIN_UPDATE"); + win_show(data->win); + break; - case E_PIN_DEINIT: - TRACE_EVENT("E_PIN_DEINIT"); + case E_PIN_DEINIT: + TRACE_EVENT("E_PIN_DEINIT"); - if (Callback) - (Callback) (parent_win, Identifier, value); + if (Callback) + (Callback) (parent_win, Identifier, value); - if (destroyEditor) - AUI_pin_Destroy(data->win); + if (destroyEditor) + AUI_pin_Destroy(data->win); - break; + break; - case E_PUK1_COMPLETE: - TRACE_EVENT("E_PIN_COMPLETE"); + case E_PUK1_COMPLETE: + TRACE_EVENT("E_PIN_COMPLETE"); - pin_unblock_data = (T_AUI_PINS *)parameter; + pin_unblock_data = (T_AUI_PINS *)parameter; - sim_unblock_pin(pin_unblock_data->pin_id, - pin_unblock_data->puk_code, - pin_unblock_data->new_pin); /* unblock pin1 */ + sim_unblock_pin(pin_unblock_data->pin_id, + pin_unblock_data->puk_code, + pin_unblock_data->new_pin); /* unblock pin1 */ - if (destroyEditor) - AUI_pin_Destroy(data->win); + if (destroyEditor) + AUI_pin_Destroy(data->win); - break; + break; - } + } return; } /******************************************************************************* - $Function: AUI_pin_WinCb + $Function: AUI_pin_WinCb - $Description: PIN editor window event handler. + $Description: PIN editor window event handler. - $Returns: None. + $Returns: None. - $Arguments: event - the event - win - the editor window + $Arguments: event - the event + win - the editor window *******************************************************************************/ static int AUI_pin_WinCb(T_MFW_EVENT event, T_MFW_WIN *win_data) { - T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; - T_ED_DATA *editor = data->editor; - T_ATB_WIN_SIZE *win_size = &data->editor->attr->win_size; - T_ATB_TEXT text; - T_DS_TEXTFORMAT format; - // USHORT titleLen; // RAVI + T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; + T_ED_DATA *editor = data->editor; + T_ATB_WIN_SIZE *win_size = &data->editor->attr->win_size; + T_ATB_TEXT text; + T_DS_TEXTFORMAT format; + // USHORT titleLen; // RAVI - if (!data) - return MFW_EVENT_CONSUMED; + if (!data) + return MFW_EVENT_CONSUMED; switch(event) { - case E_WIN_VISIBLE: /* window is visible */ + case E_WIN_VISIBLE: /* window is visible */ if (win_data->flags & E_WIN_VISIBLE) - { - if (editor->update==ED_UPDATE_TRIVIAL) - { - TRACE_EVENT("Only updating editor."); - ATB_edit_Show(data->editor); - } - else - { - TRACE_EVENT("Updating whole screen."); + { + if (editor->update==ED_UPDATE_TRIVIAL) + { + TRACE_EVENT("Only updating editor."); + ATB_edit_Show(data->editor); + } + else + { + TRACE_EVENT("Updating whole screen."); - ATB_edit_Show(data->editor); + ATB_edit_Show(data->editor); - /* Set the colour for drawing title */ + /* Set the colour for drawing title */ - resources_setTitleColour(COLOUR_EDITOR); + resources_setTitleColour(COLOUR_EDITOR); - /* TITLE - only display if update type is FULL or DEFAULT*/ + /* TITLE - only display if update type is FULL or DEFAULT*/ - if (editor->update!=ED_UPDATE_PARTIAL) - { - dspl_Clear(0,0, SCREEN_SIZE_X-1, win_size->py-1); + if (editor->update!=ED_UPDATE_PARTIAL) + { + dspl_Clear(0,0, SCREEN_SIZE_X-1, win_size->py-1); - if (data->haveTitle) - { - ATB_display_SetFormatAttr(&format, 0, FALSE); + if (data->haveTitle) + { + ATB_display_SetFormatAttr(&format, 0, FALSE); - /* Display "Emergency?" prompt in title if emergency call */ - if (data->emergency_call) - { - text.dcs = data->title.dcs; - text.data = (UBYTE *)MmiRsrcGetText(TxtEmergency); - text.len = ATB_string_Length(&text); - ATB_display_Text(0,0,&format, &text); - } - /* Otherwise, show title */ - else - { - ATB_display_Text(0,0,&format, &data->title); - } - } - } + /* Display "Emergency?" prompt in title if emergency call */ + if (data->emergency_call) + { + text.dcs = data->title.dcs; + text.data = (UBYTE *)MmiRsrcGetText(TxtEmergency); + text.len = ATB_string_Length(&text); + ATB_display_Text(0,0,&format, &text); + } + /* Otherwise, show title */ + else + { + ATB_display_Text(0,0,&format, &data->title); + } + } + } - /* Display Soft Keys */ + /* Display Soft Keys */ - if (data->emergency_call) - { - displaySoftKeys(TxtSoftCall, data->editor_data.RightSoftKey); - } - else - { - if (data->editor_data.editor_attr.text.len < data->editor_data.min_enter) - { - /* entered less than the required number of chars: Alternate Softkey appears */ - if (data->editor_data.editor_attr.text.len > 0) - displaySoftKeys(data->editor_data.AltLeftSoftKey,data->editor_data.RightSoftKey); - else - displaySoftKeys(data->editor_data.AltLeftSoftKey,TxtNull); - } - else - { - /* entered sufficient number of chars: Normal Softkey appears */ + if (data->emergency_call) + { + displaySoftKeys(TxtSoftCall, data->editor_data.RightSoftKey); + } + else + { + if (data->editor_data.editor_attr.text.len < data->editor_data.min_enter) + { + /* entered less than the required number of chars: Alternate Softkey appears */ + if (data->editor_data.editor_attr.text.len > 0) + displaySoftKeys(data->editor_data.AltLeftSoftKey,data->editor_data.RightSoftKey); + else + displaySoftKeys(data->editor_data.AltLeftSoftKey,TxtNull); + } + else + { + /* entered sufficient number of chars: Normal Softkey appears */ - if (data->editor_data.editor_attr.text.len > 0) - displaySoftKeys(data->editor_data.LeftSoftKey,data->editor_data.RightSoftKey); - else - displaySoftKeys(data->editor_data.LeftSoftKey, TxtNull); - } - } - } - } + if (data->editor_data.editor_attr.text.len > 0) + displaySoftKeys(data->editor_data.LeftSoftKey,data->editor_data.RightSoftKey); + else + displaySoftKeys(data->editor_data.LeftSoftKey, TxtNull); + } + } + } + } break; } - data->editor->update = ED_UPDATE_DEFAULT; + data->editor->update = ED_UPDATE_DEFAULT; - /* x0045876, 14-Aug-2006 (WR - non-void function "AUI_pin_WinCb" should return a value) */ - return MFW_EVENT_CONSUMED ; + /* x0045876, 14-Aug-2006 (WR - non-void function "AUI_pin_WinCb" should return a value) */ + return MFW_EVENT_CONSUMED ; } /******************************************************************************* - $Function: AUI_pin_KbdCb + $Function: AUI_pin_KbdCb - $Description: PIN editor keyboard event handler + $Description: PIN editor keyboard event handler - $Returns: None. + $Returns: None. - $Arguments: event - the keyboard event - keyboard + $Arguments: event - the keyboard event + keyboard *******************************************************************************/ static int AUI_pin_KbdCb(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_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; -// ED_RES result; // RAVI - UBYTE *edit_data_buf; - BOOL bRetVal; - T_AUI_PINS pin_unblock_data; - T_DISPLAY_DATA display_info; + T_MFW_HND win = mfw_parent (mfw_header()); + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; +// ED_RES result; // RAVI + UBYTE *edit_data_buf; + BOOL bRetVal; + T_AUI_PINS pin_unblock_data; + T_DISPLAY_DATA display_info; - TRACE_FUNCTION("AUI_pin_KbdCb()"); + TRACE_FUNCTION("AUI_pin_KbdCb()"); /* Suppress unwanted long keypresses */ - data->doNextLongPress = TRUE; /* next Key_long event is correct */ - data->editor->update = ED_UPDATE_DEFAULT; /* Default behaviour is just to update text */ + data->doNextLongPress = TRUE; /* next Key_long event is correct */ + data->editor->update = ED_UPDATE_DEFAULT; /* Default behaviour is just to update text */ - switch (keyboard->code) - { - case KCD_STAR: - /* Only possible when the first digit is a '*' */ - if ((data->editor_data.editor_attr.text.len==0) || - (data->ss_string)) - { - if (data->editor_data.editor_attr.text.len==0) - { - data->hidden = FALSE; - data->ss_string = TRUE; - /* The string should now be visible on screen */ - if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) - { - data->hidden = TRUE; - ATB_edit_ResetMode(data->editor, ED_MODE_HIDDEN); - } - } + switch (keyboard->code) + { + case KCD_STAR: + /* Only possible when the first digit is a '*' */ + if ((data->editor_data.editor_attr.text.len==0) || + (data->ss_string)) + { + if (data->editor_data.editor_attr.text.len==0) + { + data->hidden = FALSE; + data->ss_string = TRUE; + /* The string should now be visible on screen */ + if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) + { + data->hidden = TRUE; + ATB_edit_ResetMode(data->editor, ED_MODE_HIDDEN); + } + } - AUI_entry_EventKey(data->entry_data, event, keyboard); - win_show(data->win); - } - //xrashmic 1 Jul, 2006 OMAPS00075784 + AUI_entry_EventKey(data->entry_data, event, keyboard); + win_show(data->win); + } + //xrashmic 1 Jul, 2006 OMAPS00075784 //The password mode to be turned on while entering the gsm string to //unblock PUK during bootup - if(data->editor_data.editor_attr.text.len >=4 ) + if(data->editor_data.editor_attr.text.len >=4 ) { if((strncmp((char*)data->editor_data.editor_attr.text.data, "**05*", 5) == 0) || (strncmp((char*)data->editor_data.editor_attr.text.data, "**052*", 6) == 0) || @@ -622,14 +620,14 @@ ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); } } - break; + break; - case KCD_HASH: - /* Send SS string if we're entering one */ - if(data->ss_string) - { - AUI_entry_EventKey(data->entry_data, event, keyboard); - //xrashmic 1 Jul, 2006 OMAPS00075784 + case KCD_HASH: + /* Send SS string if we're entering one */ + if(data->ss_string) + { + AUI_entry_EventKey(data->entry_data, event, keyboard); + //xrashmic 1 Jul, 2006 OMAPS00075784 //The password mode to be turned on while entering the gsm string to //unblock PUK during bootup @@ -648,162 +646,162 @@ } } - edit_data_buf = ALLOC_MEMORY(data->editor_data.editor_attr.size); + edit_data_buf = ALLOC_MEMORY(data->editor_data.editor_attr.size); - strcpy((char *)edit_data_buf, (char *)data->editor_data.editor_attr.text.data); + strcpy((char *)edit_data_buf, (char *)data->editor_data.editor_attr.text.data); - switch (AUI_pin_CheckSSString(data)) - { - case MFW_SS_MMI: -// May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg -// replace the call to get_imei() with callNumber + switch (AUI_pin_CheckSSString(data)) + { + case MFW_SS_MMI: +// May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg +// replace the call to get_imei() with callNumber #ifdef FF_MMI_ATC_MIGRATION - mmi_imei_retrieve(); + mmi_imei_retrieve(); #else - get_imei((char*)data->imei); - showIMEI(win,(char*)data->imei); + get_imei((char*)data->imei); + showIMEI(win,(char*)data->imei); #endif - ATB_edit_ClearAll(data->editor); + ATB_edit_ClearAll(data->editor); - /* Set back to the default */ - data->ss_string = FALSE; + /* Set back to the default */ + data->ss_string = FALSE; - if (data->hidden == TRUE) - { - /* go back in the hide mode */ - ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); - } + if (data->hidden == TRUE) + { + /* go back in the hide mode */ + ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); + } - FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size); - win_show(data->win); - return MFW_EVENT_CONSUMED; -// break; // RAVI + FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size); + win_show(data->win); + return MFW_EVENT_CONSUMED; +// break; // RAVI - case MFW_SS_SIM_UNBLCK_PIN: - bRetVal = AUI_pin_StripSSUnblock((char *)edit_data_buf, &pin_unblock_data); + case MFW_SS_SIM_UNBLCK_PIN: + bRetVal = AUI_pin_StripSSUnblock((char *)edit_data_buf, &pin_unblock_data); - FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size); + FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size); - if (bRetVal == FALSE) - { - /* - ** Clear the entered string, reset the editor and display a "failed" dialog - */ - ATB_edit_ClearAll(data->editor); + if (bRetVal == FALSE) + { + /* + ** Clear the entered string, reset the editor and display a "failed" dialog + */ + ATB_edit_ClearAll(data->editor); - /* Set back to the default */ - data->ss_string = FALSE; + /* Set back to the default */ + data->ss_string = FALSE; - if (data->hidden == TRUE) - { - /* go back in the hide mode */ - ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); - } + if (data->hidden == TRUE) + { + /* go back in the hide mode */ + ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); + } - dlg_initDisplayData_TextId(&display_info, TxtNull, TxtNull, TxtFailed, TxtNull, COLOUR_POPUP); - dlg_initDisplayData_events(&display_info, NULL, THREE_SECS, 0); - info_dialog(0, &display_info); + dlg_initDisplayData_TextId(&display_info, TxtNull, TxtNull, TxtFailed, TxtNull, COLOUR_POPUP); + dlg_initDisplayData_events(&display_info, NULL, THREE_SECS, 0); + info_dialog(0, &display_info); - } - else - { - SEND_EVENT (win, E_PUK1_COMPLETE, INFO_KCD_LEFT, &pin_unblock_data); - } + } + else + { + SEND_EVENT (win, E_PUK1_COMPLETE, INFO_KCD_LEFT, &pin_unblock_data); + } - return MFW_EVENT_CONSUMED; -// break; // RAVI + return MFW_EVENT_CONSUMED; +// break; // RAVI - default: - /* xreddymn OMAPS00083495 Jul-04-2006 - * Display error dialog for BPM strings that are not handled. - */ - ATB_edit_ClearAll(data->editor); - data->ss_string = FALSE; - if (data->hidden == TRUE) - { - ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); - } - dlg_initDisplayData_TextId(&display_info, TxtNull, TxtNull, TxtNotAllowed, TxtNull, COLOUR_POPUP); - dlg_initDisplayData_events(&display_info, NULL, THREE_SECS, 0); - info_dialog(0, &display_info); - FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size); - break; - } - win_show(data->win); + default: + /* xreddymn OMAPS00083495 Jul-04-2006 + * Display error dialog for BPM strings that are not handled. + */ + ATB_edit_ClearAll(data->editor); + data->ss_string = FALSE; + if (data->hidden == TRUE) + { + ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); + } + dlg_initDisplayData_TextId(&display_info, TxtNull, TxtNull, TxtNotAllowed, TxtNull, COLOUR_POPUP); + dlg_initDisplayData_events(&display_info, NULL, THREE_SECS, 0); + info_dialog(0, &display_info); + FREE_MEMORY((void *)edit_data_buf, data->editor_data.editor_attr.size); + break; + } + win_show(data->win); - } - else if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) - { - if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) - { - ATB_edit_HiddenExit(data->editor); - } - SEND_EVENT (win, E_PIN_DEINIT, INFO_KCD_LEFT, NULL); - } + } + else if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) + { + if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) + { + ATB_edit_HiddenExit(data->editor); + } + SEND_EVENT (win, E_PIN_DEINIT, INFO_KCD_LEFT, NULL); + } - break; + break; #ifdef COLOURDISPLAY - /* Menu select has same effect as left soft key */ - case KCD_MNUSELECT: + /* Menu select has same effect as left soft key */ + case KCD_MNUSELECT: #endif /* COLOURDISPLAY */ - case KCD_LEFT: - /* Make an emergency call if an appropriate number entered */ - if ( data->emergency_call ) - { - /* Copy the actual typed text into the buffer */ - if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) - { - ATB_edit_HiddenExit(data->editor); - } - SEND_EVENT (win, E_PIN_DEINIT, INFO_EMERGENCY, NULL); - } - /* Submit PIN if sufficient characters entered */ - else if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) - { - // June 16, 2005 REF: CRR 31267 x0021334 - // If PIN1/PUK1 =0, Show info dialog that SIM is blocked - if (pin1Flag EQ TRUE) - { - dlg_initDisplayData_TextId(&display_info, NULL, NULL, TxtSimBlocked, TxtDealer, COLOUR_STATUS); - dlg_initDisplayData_events(&display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_LEFT | KEY_RIGHT); - info_dialog (NULL, &display_info); - break; - } - /* Left Softkey is enabled (and entered sufficient number of chars): execute it. */ - /* Copy the actual typed text into the buffer */ - if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) - { - ATB_edit_HiddenExit(data->editor); - } - SEND_EVENT (win, E_PIN_DEINIT, INFO_KCD_LEFT, NULL); - } - break; + case KCD_LEFT: + /* Make an emergency call if an appropriate number entered */ + if ( data->emergency_call ) + { + /* Copy the actual typed text into the buffer */ + if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) + { + ATB_edit_HiddenExit(data->editor); + } + SEND_EVENT (win, E_PIN_DEINIT, INFO_EMERGENCY, NULL); + } + /* Submit PIN if sufficient characters entered */ + else if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) + { + // June 16, 2005 REF: CRR 31267 x0021334 + // If PIN1/PUK1 =0, Show info dialog that SIM is blocked + if (pin1Flag EQ TRUE) + { + dlg_initDisplayData_TextId(&display_info, NULL, NULL, TxtSimBlocked, TxtDealer, COLOUR_STATUS); + dlg_initDisplayData_events(&display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_LEFT | KEY_RIGHT); + info_dialog (NULL, &display_info); + break; + } + /* Left Softkey is enabled (and entered sufficient number of chars): execute it. */ + /* Copy the actual typed text into the buffer */ + if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) + { + ATB_edit_HiddenExit(data->editor); + } + SEND_EVENT (win, E_PIN_DEINIT, INFO_KCD_LEFT, NULL); + } + break; - case KCD_HUP: - break; + case KCD_HUP: + break; - case KCD_CALL: - /* Make an emergency call if an appropriate number entered */ - if ( data->emergency_call ) - { - /* Copy the actual typed text into the buffer */ - if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) - { - ATB_edit_HiddenExit(data->editor); - } - SEND_EVENT (win, E_PIN_DEINIT, INFO_EMERGENCY, NULL); - } - break; + case KCD_CALL: + /* Make an emergency call if an appropriate number entered */ + if ( data->emergency_call ) + { + /* Copy the actual typed text into the buffer */ + if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) + { + ATB_edit_HiddenExit(data->editor); + } + SEND_EVENT (win, E_PIN_DEINIT, INFO_EMERGENCY, NULL); + } + break; - case KCD_RIGHT: - if(data->editor_data.editor_attr.text.len!=0) - { - //xrashmic 1 Jul, 2006 OMAPS00075784 + case KCD_RIGHT: + if(data->editor_data.editor_attr.text.len!=0) + { + //xrashmic 1 Jul, 2006 OMAPS00075784 //The password mode to be turned on while entering the gsm string to //unblock PUK during bootup - if(ATB_edit_Mode(data->editor, ED_MODE_HIDDEN) && + if(ATB_edit_Mode(data->editor, ED_MODE_HIDDEN) && (((data->editor_data.editor_attr.text.len == 5) && ((strncmp((char*)data->editor_data.editor_attr.text.data, "**05*", 5) == 0) || (strncmp((char*)data->editor_data.editor_attr.text.data, "**04*", 5) == 0))) || @@ -814,237 +812,236 @@ ATB_edit_ResetMode(data->editor, ED_MODE_HIDDEN); } - ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */ + ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */ - /* For a SS string */ - if ( !ATB_edit_Mode(data->editor,ED_MODE_HIDDEN) ) - { - if (data->editor_data.editor_attr.text.len==0 && data->ss_string) - { - data->ss_string = FALSE; - if (data->hidden == TRUE) - { - /* The string should not be visible on screen */ - ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); - } - } - } + /* For a SS string */ + if ( !ATB_edit_Mode(data->editor,ED_MODE_HIDDEN) ) + { + if (data->editor_data.editor_attr.text.len==0 && data->ss_string) + { + data->ss_string = FALSE; + if (data->hidden == TRUE) + { + /* The string should not be visible on screen */ + ATB_edit_SetMode(data->editor, ED_MODE_HIDDEN); + } + } + } - /* is it a emergency call number ?!*/ - AUI_pin_CheckEmergency(data); - win_show(data->win); - } - break; + /* is it a emergency call number ?!*/ + AUI_pin_CheckEmergency(data); + win_show(data->win); + } + break; - case KCD_0: - case KCD_1: - case KCD_2: - case KCD_3: - case KCD_4: - case KCD_5: - case KCD_6: - case KCD_7: - case KCD_8: - case KCD_9: - /* xreddymn OMAPS00083495 Jul-04-2006 - * Limit PIN1, PIN2 entries to 8 digits. - */ - if(((data->editor_data.Identifier==PIN1_REQ) || - (data->editor_data.Identifier==PIN2_REQ)) && - (data->editor_data.editor_attr.text.len>=8) && - (!data->ss_string)) - return MFW_EVENT_CONSUMED; - else - { - AUI_entry_EventKey(data->entry_data, event, keyboard); - /* is it a emergency call number ?!*/ - AUI_pin_CheckEmergency(data); - win_show(data->win); - } - break; - } + case KCD_0: + case KCD_1: + case KCD_2: + case KCD_3: + case KCD_4: + case KCD_5: + case KCD_6: + case KCD_7: + case KCD_8: + case KCD_9: + /* xreddymn OMAPS00083495 Jul-04-2006 + * Limit PIN1, PIN2 entries to 8 digits. + */ + if(((data->editor_data.Identifier==PIN1_REQ) || + (data->editor_data.Identifier==PIN2_REQ)) && + (data->editor_data.editor_attr.text.len>=8) && + (!data->ss_string)) + return MFW_EVENT_CONSUMED; + else + { + AUI_entry_EventKey(data->entry_data, event, keyboard); + /* is it a emergency call number ?!*/ + AUI_pin_CheckEmergency(data); + win_show(data->win); + } + break; + } - return MFW_EVENT_CONSUMED; + return MFW_EVENT_CONSUMED; } /******************************************************************************* - $Function: AUI_pin_KbdLongCb + $Function: AUI_pin_KbdLongCb - $Description: PIN editor long keypress keyboard event handler + $Description: PIN editor long keypress keyboard event handler - $Returns: None. + $Returns: None. - $Arguments: event - the keyboard event - keyboard + $Arguments: event - the keyboard event + keyboard *******************************************************************************/ static int AUI_pin_KbdLongCb(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_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; - ED_RES result; + T_MFW_HND win = mfw_parent (mfw_header()); + T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; + T_AUI_PIN_DATA *data = (T_AUI_PIN_DATA *)win_data->user; + ED_RES result; /* Suppress unwanted long keypresses */ - if ( data->doNextLongPress ) - data->doNextLongPress = FALSE; /* mark Key_long event as consumed but do current long press */ - else - return MFW_EVENT_CONSUMED; /* don't do current long press */ + if ( data->doNextLongPress ) + data->doNextLongPress = FALSE; /* mark Key_long event as consumed but do current long press */ + else + return MFW_EVENT_CONSUMED; /* don't do current long press */ - switch (keyboard->code) - { - case KCD_RIGHT: - /* Long press of RSK deletes buffer */ - result = ATB_edit_ClearAll(data->editor); + switch (keyboard->code) + { + case KCD_RIGHT: + /* Long press of RSK deletes buffer */ + result = ATB_edit_ClearAll(data->editor); - /* If we've deleted on an empty buffer, exit editor */ - if (result==ED_DONE) - { - SEND_EVENT(data->win, E_PIN_DEINIT, INFO_KCD_RIGHT, 0); - } - else - { - win_show(data->win); - } - break; - } + /* If we've deleted on an empty buffer, exit editor */ + if (result==ED_DONE) + { + SEND_EVENT(data->win, E_PIN_DEINIT, INFO_KCD_RIGHT, 0); + } + else + { + win_show(data->win); + } + break; + } - return MFW_EVENT_CONSUMED; + return MFW_EVENT_CONSUMED; } /******************************************************************************* - $Function: AUI_pin_CheckEmergency + $Function: AUI_pin_CheckEmergency - $Description: Check number to see if it's an emergency number + $Description: Check number to see if it's an emergency number - $Returns: None. + $Returns: None. - $Arguments: data - The editor data + $Arguments: data - The editor data *******************************************************************************/ static UBYTE AUI_pin_CheckEmergency(T_AUI_PIN_DATA *data) { - UBYTE previous_emergency = data->emergency_call; - UBYTE previous_entered = data->enteredMinChars; - UBYTE previous_someentered = data->enteredSomeChars; - UBYTE emergency_call; + UBYTE previous_emergency = data->emergency_call; + UBYTE previous_entered = data->enteredMinChars; + UBYTE previous_someentered = data->enteredSomeChars; + UBYTE emergency_call; - /*SPR#2235 - DS - If the edit mode is 'hidden' then pass - *the 'hidden buffer' as the parameter to cm_check_emergency. - *If the edit mode is not 'hidden' then pass the normal editor - *text buffer as the parameter. - */ - if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) - emergency_call = cm_check_emergency(data->editor->hiddenText->data); - else - emergency_call = cm_check_emergency(data->editor_data.editor_attr.text.data); + /*SPR#2235 - DS - If the edit mode is 'hidden' then pass + *the 'hidden buffer' as the parameter to cm_check_emergency. + *If the edit mode is not 'hidden' then pass the normal editor + *text buffer as the parameter. + */ + if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) + emergency_call = cm_check_emergency(data->editor->hiddenText->data); + else + emergency_call = cm_check_emergency(data->editor_data.editor_attr.text.data); - if(emergency_call == TRUE) - { - TRACE_EVENT(" it is a emergency number !"); - data->emergency_call = TRUE; - } - else - { - data->emergency_call = FALSE; - } + if(emergency_call == TRUE) + { + TRACE_EVENT(" it is a emergency number !"); + data->emergency_call = TRUE; + } + else + { + data->emergency_call = FALSE; + } - /* Check if we've entered min_enter characters */ + /* Check if we've entered min_enter characters */ - if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) - data->enteredMinChars = TRUE; - else - data->enteredMinChars = FALSE; + if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) + data->enteredMinChars = TRUE; + else + data->enteredMinChars = FALSE; - if (data->editor_data.editor_attr.text.len > 0) - data->enteredSomeChars = TRUE; - else - data->enteredSomeChars = FALSE; + if (data->editor_data.editor_attr.text.len > 0) + data->enteredSomeChars = TRUE; + else + data->enteredSomeChars = FALSE; - /* Check if the softkeys have changed */ + /* Check if the softkeys have changed */ - if (data->emergency_call!=previous_emergency) - { - data->editor->update = ED_UPDATE_FULL; /* Update softkeys, title and editor */ - } - else if (data->enteredMinChars!=previous_entered || data->enteredSomeChars!=previous_someentered) - { - data->editor->update = ED_UPDATE_PARTIAL; /* Update softkeys and editor */ - } - else - { - data->editor->update = ED_UPDATE_TRIVIAL; /* Just update editor */ - } + if (data->emergency_call!=previous_emergency) + { + data->editor->update = ED_UPDATE_FULL; /* Update softkeys, title and editor */ + } + else if (data->enteredMinChars!=previous_entered || data->enteredSomeChars!=previous_someentered) + { + data->editor->update = ED_UPDATE_PARTIAL; /* Update softkeys and editor */ + } + else + { + data->editor->update = ED_UPDATE_TRIVIAL; /* Just update editor */ + } - return data->emergency_call; + return data->emergency_call; } /******************************************************************************* - $Function: AUI_pin_CheckSSString + $Function: AUI_pin_CheckSSString - $Description: Check number to see if it's an ss string + $Description: Check number to see if it's an ss string - $Returns: None. + $Returns: None. - $Arguments: event - the keyboard event - keyboard + $Arguments: event - the keyboard event + keyboard *******************************************************************************/ T_MFW_SS_RETURN AUI_pin_CheckSSString(T_AUI_PIN_DATA *data) { - return ss_check_ss_string(data->editor_data.editor_attr.text.data); + return ss_check_ss_string(data->editor_data.editor_attr.text.data); } static BOOL AUI_pin_StripSSUnblock(char *cmd_string, T_AUI_PINS *pin_data) { - T_MFW_SS_RETURN retVal; - char *rest; - T_KSD_SEQPARAM ss_params; + T_MFW_SS_RETURN retVal; + char *rest; + T_KSD_SEQPARAM ss_params; - TRACE_EVENT_P2("AUI_pin_StripSSUnblock : &cmd_string = 0x%08lx, &pin_data = 0x%08lx", cmd_string, pin_data); + TRACE_EVENT_P2("AUI_pin_StripSSUnblock : &cmd_string = 0x%08lx, &pin_data = 0x%08lx", cmd_string, pin_data); - /* - ** The incoming parameters chould not be NULL - */ - if ((cmd_string == NULL) || - (pin_data == NULL)) - return FALSE; + /* + ** The incoming parameters chould not be NULL + */ + if ((cmd_string == NULL) || + (pin_data == NULL)) + return FALSE; - retVal = ss_decode((UBYTE *)cmd_string, &rest, &ss_params); + retVal = ss_decode((UBYTE *)cmd_string, &rest, &ss_params); - if (retVal == MFW_SS_SIM_UNBLCK_PIN) - { - if (ss_params.ublk.ssCd == KSD_SS_PIN1) - { - pin_data->pin_id = MFW_SIM_PUK1; - strcpy(pin_data->puk_code, (char *)ss_params.ublk.puk); - strcpy(pin_data->new_pin, (char *)ss_params.ublk.pin); - strcpy(pin_data->cnf_pin, (char *)ss_params.ublk.pin); + if (retVal == MFW_SS_SIM_UNBLCK_PIN) + { + if (ss_params.ublk.ssCd == KSD_SS_PIN1) + { + pin_data->pin_id = MFW_SIM_PUK1; + strcpy(pin_data->puk_code, (char *)ss_params.ublk.puk); + strcpy(pin_data->new_pin, (char *)ss_params.ublk.pin); + strcpy(pin_data->cnf_pin, (char *)ss_params.ublk.pin); - return TRUE; - } - else - { - TRACE_EVENT("AUI_pin_StripSSUnblock : Not unblocking PIN1"); - return FALSE; - } - } - else - { - TRACE_EVENT_P1("AUI_pin_StripSSUnblock : ss_decode returned %d", retVal); - return FALSE; - } + return TRUE; + } + else + { + TRACE_EVENT("AUI_pin_StripSSUnblock : Not unblocking PIN1"); + return FALSE; + } + } + else + { + TRACE_EVENT_P1("AUI_pin_StripSSUnblock : ss_decode returned %d", retVal); + return FALSE; + } } - diff -r 62480f597962 -r 70ea7526b59e src/ui/bmi/AUISymbol.c --- a/src/ui/bmi/AUISymbol.c Tue Nov 10 07:12:03 2020 +0000 +++ b/src/ui/bmi/AUISymbol.c Sat Nov 14 03:18:11 2020 +0000 @@ -1,6 +1,6 @@ /******************************************************************************* - CONDAT (UK) + CONDAT (UK) ******************************************************************************** @@ -9,13 +9,13 @@ ******************************************************************************** - $Project name: Basic MMI - $Project code: BMI - $Module: MMI - $File: AUISymbol.c - $Revision: 1.0 + $Project name: Basic MMI + $Project code: BMI + $Module: MMI + $File: AUISymbol.c + $Revision: 1.0 - $Author: Condat(UK) + $Author: Condat(UK) $Date: ******************************************************************************** @@ -28,11 +28,11 @@ $History: AUISymbol.c - Mar 23, 2005 REF: CRR 28490 xnkulkar - Description: Golite- 5-way navigation behaves wrongly while selecting special characters - in the text editor screen.The background screen goes blank when the special - characters screen comes up. - Solution: Commented 'dspl_ClearAll()' to make the behaviour consistent with normal variant. + Mar 23, 2005 REF: CRR 28490 xnkulkar + Description: Golite- 5-way navigation behaves wrongly while selecting special characters + in the text editor screen.The background screen goes blank when the special + characters screen comes up. + Solution: Commented 'dspl_ClearAll()' to make the behaviour consistent with normal variant. $End @@ -109,25 +109,25 @@ //data structure for punctuation symbols selection screen typedef struct { - T_MMI_CONTROL mmi_control; - T_MFW_HND parent; - T_MFW_HND win; - T_ED_DATA *editor; - T_MFW_HND kbd; + T_MMI_CONTROL mmi_control; + T_MFW_HND parent; + T_MFW_HND win; + T_ED_DATA *editor; + T_MFW_HND kbd; - T_AUI_EDITOR_DATA editor_data; - USHORT cursor_position; - USHORT output_symbol; - USHORT return_event; + T_AUI_EDITOR_DATA editor_data; + USHORT cursor_position; + USHORT output_symbol; + USHORT return_event; } T_AUI_SYMBOL_INFO; //events in main editor screen typedef enum { - EDITOR_INIT, - EDITOR_DEINIT, - EDITOR_UPDATE + EDITOR_INIT, + EDITOR_DEINIT, + EDITOR_UPDATE } T_SYMBOL_EVENTS; /********************************************************************* @@ -149,54 +149,54 @@ /******************************************************************************* - $Function: AUI_symbol_Destroy + $Function: AUI_symbol_Destroy - $Description: Destroy thesymbol screen + $Description: Destroy thesymbol screen - $Returns: None. + $Returns: None. - $Arguments: window handle + $Arguments: window handle *******************************************************************************/ void AUI_symbol_Destroy (T_MFW_HND window) { - T_MFW_WIN *win = ((T_MFW_HDR *)window)->data; - T_AUI_SYMBOL_INFO *data = (T_AUI_SYMBOL_INFO *)win->user; + T_MFW_WIN *win = ((T_MFW_HDR *)window)->data; + T_AUI_SYMBOL_INFO *data = (T_AUI_SYMBOL_INFO *)win->user; TRACE_FUNCTION ("AUI_symbol_Destroy()"); /* Send character to editor window */ - SEND_EVENT (data->parent, data->return_event, (SHORT)data->output_symbol, NULL); + SEND_EVENT (data->parent, data->return_event, (SHORT)data->output_symbol, NULL); if (data) - { /*SPR 2520, need to destroy ATB editor*/ - ATB_edit_Destroy( data->editor); + { /*SPR 2520, need to destroy ATB editor*/ + ATB_edit_Destroy( data->editor); - /* Delete WIN Handler */ - win_delete (data->win); + /* Delete WIN Handler */ + win_delete (data->win); /* Free Memory */ - FREE_MEMORY ((void *)data, sizeof (T_AUI_SYMBOL_INFO)); - } + FREE_MEMORY ((void *)data, sizeof (T_AUI_SYMBOL_INFO)); + } else { - TRACE_EVENT ("AUI_symbol_Destroy() called twice"); - return ; - } + TRACE_EVENT ("AUI_symbol_Destroy() called twice"); + return ; + } } /******************************************************************************* - $Function: AUI_symbol_Start + $Function: AUI_symbol_Start - $Description: Starts the symbol screen + $Description: Starts the symbol screen - $Returns: handle + $Returns: handle - $Arguments: parent window, editor data + $Arguments: parent window, editor data *******************************************************************************/ T_MFW_HND AUI_symbol_Start (T_MFW_HND parent, USHORT return_event) @@ -209,22 +209,22 @@ win = AUI_symbol_Create (parent); if (win NEQ NULL) - { - SEND_EVENT (win, EDITOR_INIT, return_event, 0); - } + { + SEND_EVENT (win, EDITOR_INIT, return_event, 0); + } return win; } /******************************************************************************* - $Function: LatinEditorcreate + $Function: LatinEditorcreate - $Description: Creation of a symbol screen + $Description: Creation of a symbol screen - $Returns: handle of new window + $Returns: handle of new window - $Arguments: parent window + $Arguments: parent window *******************************************************************************/ @@ -246,69 +246,69 @@ /* Connect the dialog data to the MFW-window */ - data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_symbol_ExecCb; - data->mmi_control.data = data; - data->parent = parent; - win = ((T_MFW_HDR *)data->win)->data; - win->user = (void *)data; + data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_symbol_ExecCb; + data->mmi_control.data = data; + data->parent = parent; + win = ((T_MFW_HDR *)data->win)->data; + win->user = (void *)data; - return data->win; + return data->win; } /******************************************************************************* - $Function: AUI_symbol_ExecCb + $Function: AUI_symbol_ExecCb - $Description: handles events for symbol window + $Description: handles events for symbol window - $Returns: None. + $Returns: None. - $Arguments: window, event, value, editor data + $Arguments: window, event, value, editor data *******************************************************************************/ static void AUI_symbol_ExecCb (T_MFW_HND win, USHORT event, USHORT value, void *parameter) { - T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; - T_AUI_SYMBOL_INFO * data = (T_AUI_SYMBOL_INFO *)win_data->user; + T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; + T_AUI_SYMBOL_INFO * data = (T_AUI_SYMBOL_INFO *)win_data->user; - // T_MFW_HND parent_win = data->parent; // RAVI - // USHORT Identifier = data->editor_data.Identifier; // RAVI - // T_AUI_EDIT_CB Callback = data->editor_data.Callback; // RAVI + // T_MFW_HND parent_win = data->parent; // RAVI + // USHORT Identifier = data->editor_data.Identifier; // RAVI + // T_AUI_EDIT_CB Callback = data->editor_data.Callback; // RAVI - /* List of symbols */ - /*SPR 1955, replaced £ sign with our ASCII code for it*/ - /*SPR2175, added previously un-enterable symbols into symbol table*/ - static char symStr[] = ". , ? ! : ; - + # * ( ) \' \" _ @ & $ \x9C % / < > = \x8F \x86 \xA5 \xA4 \x2 \x7 \x4 \x9D \xe8 \xE2 \xEF \xEA \xE3 \x5 \xe4 \xe9 \xF0 \x92 \x91 \x01 \xAD \xA8 \x06"; + /* List of symbols */ + /*SPR 1955, replaced 0xA3 sign with our ASCII code for it*/ + /*SPR2175, added previously un-enterable symbols into symbol table*/ + static char symStr[] = ". , ? ! : ; - + # * ( ) \' \" _ @ & $ \x9C % / < > = \x8F \x86 \xA5 \xA4 \x2 \x7 \x4 \x9D \xe8 \xE2 \xEF \xEA \xE3 \x5 \xe4 \xe9 \xF0 \x92 \x91 \x01 \xAD \xA8 \x06"; TRACE_FUNCTION ("AUI_symbol_ExecCb()"); switch (event) - { + { case EDITOR_INIT: - /* Get the return event that has been passed */ + /* Get the return event that has been passed */ - data->return_event = value; + data->return_event = value; /* Create the keyboard handler */ - data->kbd = kbdCreate (data->win, KEY_ALL,(T_MFW_CB)AUI_symbol_KbdCb); + data->kbd = kbdCreate (data->win, KEY_ALL,(T_MFW_CB)AUI_symbol_KbdCb); /* Initialise editor variables */ - AUI_edit_SetDefault(&data->editor_data); - AUI_edit_SetDisplay(&data->editor_data, ZONE_MIDDLE_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); - AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_ASCII, (UBYTE *)symStr, strlen(symStr)+1); - AUI_edit_SetMode(&data->editor_data, ED_MODE_ALPHA, ED_CURSOR_BLOCK); - data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0); + AUI_edit_SetDefault(&data->editor_data); + AUI_edit_SetDisplay(&data->editor_data, ZONE_MIDDLE_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); + AUI_edit_SetBuffer(&data->editor_data, ATB_DCS_ASCII, (UBYTE *)symStr, strlen(symStr)+1); + AUI_edit_SetMode(&data->editor_data, ED_MODE_ALPHA, ED_CURSOR_BLOCK); + data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0); ATB_edit_Init(data->editor); - ATB_edit_Char(data->editor, ctrlTop, TRUE); + ATB_edit_Char(data->editor, ctrlTop, TRUE); win_show(data->win); - break; + break; case EDITOR_DEINIT: - AUI_symbol_Destroy (data->win); + AUI_symbol_Destroy (data->win); break; default: @@ -319,35 +319,35 @@ /******************************************************************************* - $Function: AUI_symbol_WinCb + $Function: AUI_symbol_WinCb - $Description: Editor window event handler. + $Description: Editor window event handler. - $Returns: status int + $Returns: status int - $Arguments: event, window + $Arguments: event, window *******************************************************************************/ static int AUI_symbol_WinCb (T_MFW_EVENT event, T_MFW_WIN * win) { T_AUI_SYMBOL_INFO * data = (T_AUI_SYMBOL_INFO *)win->user; - TRACE_FUNCTION ("AUI_symbol__win_cb()"); + TRACE_FUNCTION ("AUI_symbol__win_cb()"); if (!data) - { - return MFW_EVENT_CONSUMED; - } + { + return MFW_EVENT_CONSUMED; + } switch (event) - { + { case E_WIN_VISIBLE: /* window is visible */ if (win->flags & E_WIN_VISIBLE) { // Mar 23, 2005 REF: CRR 28490 xnkulkar // Description: Golite- 5-way navigation behaves wrongly while selecting special characters -// in the text editor screen.The background screen goes blank when the special -// characters screen comes up. +// in the text editor screen.The background screen goes blank when the special +// characters screen comes up. // Solution: Commented 'dspl_ClearAll()' to make the behaviour consistent with normal variant. //#ifndef COLOURDISPLAY /* Clear Screen */ @@ -355,37 +355,37 @@ //#endif /* Print the information */ - ATB_edit_Show(data->editor); + ATB_edit_Show(data->editor); - // change by Sasken ( Deepa M D) on March 26th 2004 - // Issue Number : MMI-SPR-12817 - // Subject: Wrong softkey in the symbol table. - // Bug : While selecting the symbols in the editor - // for the sms write screen, the softkey dispalyed - // was "Options" instead of "Select" - // Solution: Commenting the compilation flags COLOURDISPLAY. + // change by Sasken ( Deepa M D) on March 26th 2004 + // Issue Number : MMI-SPR-12817 + // Subject: Wrong softkey in the symbol table. + // Bug : While selecting the symbols in the editor + // for the sms write screen, the softkey dispalyed + // was "Options" instead of "Select" + // Solution: Commenting the compilation flags COLOURDISPLAY. //#ifndef COLOURDISPLAY /* Print the softkeys */ - displaySoftKeys(TxtSoftSelect, TxtSoftBack); + displaySoftKeys(TxtSoftSelect, TxtSoftBack); //#endif } break; default: return MFW_EVENT_REJECTED; - } - return MFW_EVENT_CONSUMED; + } + return MFW_EVENT_CONSUMED; } /******************************************************************************* - $Function: AUI_symbol__kbd_cb + $Function: AUI_symbol__kbd_cb - $Description: Symbol screen keyboard event handler + $Description: Symbol screen keyboard event handler - $Returns: None. + $Returns: None. - $Arguments: event, keyborad data + $Arguments: event, keyborad data *******************************************************************************/ @@ -402,26 +402,26 @@ /* Use left and right keys in colour display, not up and down */ #ifdef COLOURDISPLAY - case KCD_MNURIGHT: + case KCD_MNURIGHT: ATB_edit_Char(data->editor,ctrlRight, FALSE); ATB_edit_Char(data->editor,ctrlRight, TRUE); ATB_edit_Show(data->editor); break; case KCD_MNULEFT: - ATB_edit_Char(data->editor,ctrlLeft, FALSE); - ATB_edit_Char(data->editor,ctrlLeft, TRUE); - ATB_edit_Show(data->editor); + ATB_edit_Char(data->editor,ctrlLeft, FALSE); + ATB_edit_Char(data->editor,ctrlLeft, TRUE); + ATB_edit_Show(data->editor); break; - case KCD_MNUUP: + case KCD_MNUUP: ATB_edit_Char(data->editor,ctrlUp, TRUE); ATB_edit_Show(data->editor); break; case KCD_MNUDOWN: - ATB_edit_Char(data->editor,ctrlDown, TRUE); - ATB_edit_Show(data->editor); + ATB_edit_Char(data->editor,ctrlDown, TRUE); + ATB_edit_Show(data->editor); break; #else case KCD_MNUUP: @@ -431,39 +431,39 @@ break; case KCD_MNUDOWN: - ATB_edit_Char(data->editor,ctrlLeft, FALSE); - ATB_edit_Char(data->editor,ctrlLeft, TRUE); - ATB_edit_Show(data->editor); + ATB_edit_Char(data->editor,ctrlLeft, FALSE); + ATB_edit_Char(data->editor,ctrlLeft, TRUE); + ATB_edit_Show(data->editor); break; #endif #ifdef COLOURDISPLAY - case KCD_MNUSELECT: + case KCD_MNUSELECT: #endif case KCD_LEFT: - data->output_symbol = ATB_string_GetChar(&data->editor_data.editor_attr.text, data->editor->cursor.pos); - AUI_symbol_Destroy(data->win); - return MFW_EVENT_CONSUMED; + data->output_symbol = ATB_string_GetChar(&data->editor_data.editor_attr.text, data->editor->cursor.pos); + AUI_symbol_Destroy(data->win); + return MFW_EVENT_CONSUMED; // break; // RAVI - case KCD_HUP: + case KCD_HUP: case KCD_RIGHT: data->output_symbol = NULL; - AUI_symbol_Destroy(data->win); - return MFW_EVENT_CONSUMED; + AUI_symbol_Destroy(data->win); + return MFW_EVENT_CONSUMED; // break; // RAVI } - /* If we've landed on a space or an end-of-string, move cursor left */ + /* If we've landed on a space or an end-of-string, move cursor left */ - if ( ( ATB_edit_GetCursorChar(data->editor, 0)==UNICODE_SPACE - || ATB_edit_GetCursorChar(data->editor, 0)==UNICODE_EOLN ) - && data->editor->cursor.pos>0 ) - { - ATB_edit_Char(data->editor, ctrlLeft, TRUE); + if ( ( ATB_edit_GetCursorChar(data->editor, 0)==UNICODE_SPACE + || ATB_edit_GetCursorChar(data->editor, 0)==UNICODE_EOLN ) + && data->editor->cursor.pos>0 ) + { + ATB_edit_Char(data->editor, ctrlLeft, TRUE); // Apr 27, 2004 REF: CRR MMI-SPR-12353 Rashmi C N(Sasken) -// When we encounter a white space the coordinates were updated but not the screen, hence an ATB_edit_Show is needed at this point - ATB_edit_Show(data->editor); - } +// When we encounter a white space the coordinates were updated but not the screen, hence an ATB_edit_Show is needed at this point + ATB_edit_Show(data->editor); + } return MFW_EVENT_CONSUMED; } diff -r 62480f597962 -r 70ea7526b59e src/ui/bmi/AUITextEntry.c --- a/src/ui/bmi/AUITextEntry.c Tue Nov 10 07:12:03 2020 +0000 +++ b/src/ui/bmi/AUITextEntry.c Sat Nov 14 03:18:11 2020 +0000 @@ -11,12 +11,12 @@ $Project name: Basic MMI $Project code: BMI (6349) - $Module: MMI - $File: AUITextEntry.c - $Revision: 1.0 + $Module: MMI + $File: AUITextEntry.c + $Revision: 1.0 - $Author: Condat(UK) - $Date: 22/02/01 + $Author: Condat(UK) + $Date: 22/02/01 ******************************************************************************** @@ -110,63 +110,63 @@ static UBYTE editAlpha [12][KEY_PAD_MAX] = { - {'.', ',', '+', '-', '=', '0'}, /*Key 0*/ + {'.', ',', '+', '-', '=', '0'}, /*Key 0*/ - {' ' ,'?', '!', ';', ':', '1'}, /*Key 1*/ - /* a grave a umlaut*/ - {'a', 'b', 'c', '2', '\x85', '\x84'}, /*Key 2*/ - /* e-grave e-acute*/ - {'d', 'e', 'f', '3', '\x8a', '\x83'}, /*Key 3*/ - /* i-grave*/ - {'g', 'h', 'i', '4', '\x8d', '@'}, /*Key 4*/ + {' ' ,'?', '!', ';', ':', '1'}, /*Key 1*/ + /* a grave a umlaut*/ + {'a', 'b', 'c', '2', '\x85', '\x84'}, /*Key 2*/ + /* e-grave e-acute*/ + {'d', 'e', 'f', '3', '\x8a', '\x83'}, /*Key 3*/ + /* i-grave*/ + {'g', 'h', 'i', '4', '\x8d', '@'}, /*Key 4*/ /**/ - {'j', 'k', 'l', '5', '&', '*'}, /*Key 5*/ - /* o-grave o-umlaut*/ - {'m', 'n', 'o', '6', '\x95', '\x94'}, /*Key 6*/ - /* SS*/ - {'p', 'q', 'r', 's', '7', '\xe1'}, /*Key 7*/ - /* u-grave u-umlaut*/ - {'t', 'u', 'v', '8', '\x97', '\x82'}, /*Key 8*/ - /**/ - {'w', 'x', 'y', 'z', '9', '#'}, /*Key 9*/ + {'j', 'k', 'l', '5', '&', '*'}, /*Key 5*/ + /* o-grave o-umlaut*/ + {'m', 'n', 'o', '6', '\x95', '\x94'}, /*Key 6*/ + /* SS*/ + {'p', 'q', 'r', 's', '7', '\xe1'}, /*Key 7*/ + /* u-grave u-umlaut*/ + {'t', 'u', 'v', '8', '\x97', '\x82'}, /*Key 8*/ + /**/ + {'w', 'x', 'y', 'z', '9', '#'}, /*Key 9*/ - {'*', '*', '*', '*', '*', '*'}, /*Key star, not actually used for multitap*/ + {'*', '*', '*', '*', '*', '*'}, /*Key star, not actually used for multitap*/ - {'#', '#', '#', '#', '#', '#'} /*Key hash, not actually used for multitap*/ + {'#', '#', '#', '#', '#', '#'} /*Key hash, not actually used for multitap*/ }; /* Alpha mode characters for multi-tap - upper case */ static UBYTE editAlphaU [12][KEY_PAD_MAX] = { - {'.', ',', '+', '-', '=', '0'}, /*Key 0*/ + {'.', ',', '+', '-', '=', '0'}, /*Key 0*/ - {' ', '?', '!', ';', ':', '1'}, /*Key 1*/ -/* A-umlaut cedilla*/ - {'A', 'B', 'C', '2', '\x8e', '\x81'}, /*Key 2*/ -/* E-acute*/ - {'D', 'E', 'F', '3', '\x90', ' '}, /*Key 3*/ + {' ', '?', '!', ';', ':', '1'}, /*Key 1*/ +/* A-umlaut cedilla*/ + {'A', 'B', 'C', '2', '\x8e', '\x81'}, /*Key 2*/ +/* E-acute*/ + {'D', 'E', 'F', '3', '\x90', ' '}, /*Key 3*/ - {'G', 'H', 'I', '4', '@', ' '}, /*Key 4*/ + {'G', 'H', 'I', '4', '@', ' '}, /*Key 4*/ - {'J', 'K', 'L', '5', '&', '*'}, /*Key 5*/ -/* O-umlaut */ - {'M', 'N', 'O', '6', '\x99', ' '}, /*Key 6*/ - /* SS*/ - {'P', 'Q', 'R', 'S', '7', '\xe1'}, /*Key 7*/ -/* U-umlaut*/ - {'T', 'U', 'V', '8', '\x9A', ' '}, /*Key 8*/ + {'J', 'K', 'L', '5', '&', '*'}, /*Key 5*/ +/* O-umlaut */ + {'M', 'N', 'O', '6', '\x99', ' '}, /*Key 6*/ + /* SS*/ + {'P', 'Q', 'R', 'S', '7', '\xe1'}, /*Key 7*/ +/* U-umlaut*/ + {'T', 'U', 'V', '8', '\x9A', ' '}, /*Key 8*/ - {'W', 'X', 'Y', 'Z', '9', '#'}, /*Key 9*/ + {'W', 'X', 'Y', 'Z', '9', '#'}, /*Key 9*/ - {'*', '*', '*' ,'*', '*', '*'}, /*Key star, not actually used for multitap*/ + {'*', '*', '*' ,'*', '*', '*'}, /*Key star, not actually used for multitap*/ - {'#', '#', '#', '#', '#', '#'} /*Key hash, not actually used for multitap*/ + {'#', '#', '#', '#', '#', '#'} /*Key hash, not actually used for multitap*/ }; /* API - 01/09/03 - SPR2371 - END*/ -static void *MMIdata; /* Temporary storage for MMI pointer */ +static void *MMIdata; /* Temporary storage for MMI pointer */ /******************************************************************************* @@ -179,29 +179,29 @@ /******************************************************************************* - $Function: AUI_entry_Create + $Function: AUI_entry_Create - $Description: Initialises the text entry data. Allocates memory. Creates the timer. + $Description: Initialises the text entry data. Allocates memory. Creates the timer. - $Returns: Pointer to the data. + $Returns: Pointer to the data. - $Arguments: win - The window in which the editor is displayed - editor - The editor - update - The event to be sent to the window in order to update it + $Arguments: win - The window in which the editor is displayed + editor - The editor + update - The event to be sent to the window in order to update it *******************************************************************************/ T_AUI_ENTRY_DATA *AUI_entry_Create(T_MFW_HND win, T_ED_DATA *editor, U32 update) { - T_AUI_ENTRY_DATA *entry_data = (T_AUI_ENTRY_DATA *)mfwAlloc(sizeof(T_AUI_ENTRY_DATA)); + T_AUI_ENTRY_DATA *entry_data = (T_AUI_ENTRY_DATA *)mfwAlloc(sizeof(T_AUI_ENTRY_DATA)); - entry_data->win = win; - entry_data->update = update; - entry_data->editor = editor; - /* SPR#1597 - SH - Always create this timer */ - entry_data->editTim = tim_create(win, 1000, (MfwCb) AUI_entry_Timer); - entry_data->Level = KEY_PAD_MAX-1; - entry_data->Key = KCD_MAX; + entry_data->win = win; + entry_data->update = update; + entry_data->editor = editor; + /* SPR#1597 - SH - Always create this timer */ + entry_data->editTim = tim_create(win, 1000, (MfwCb) AUI_entry_Timer); + entry_data->Level = KEY_PAD_MAX-1; + entry_data->Key = KCD_MAX; return entry_data; } @@ -209,13 +209,13 @@ /******************************************************************************* - $Function: AUI_entry_Destroy + $Function: AUI_entry_Destroy - $Description: Frees memory associated with text entry. + $Description: Frees memory associated with text entry. - $Returns: none. + $Returns: none. - $Arguments: entry_data - The text entry data + $Arguments: entry_data - The text entry data *******************************************************************************/ @@ -233,36 +233,36 @@ /******************************************************************************* - $Function: AUI_entry_EditChar + $Function: AUI_entry_EditChar - $Description: Sends a character to the text editor. + $Description: Sends a character to the text editor. - $Returns: None. + $Returns: None. - $Arguments: data - The editor data - alphachar - Character to be inserted, or NULL if key tables are to - be used - multitap - TRUE if multitap is in progress + $Arguments: data - The editor data + alphachar - Character to be inserted, or NULL if key tables are to + be used + multitap - TRUE if multitap is in progress *******************************************************************************/ USHORT AUI_entry_EditChar (T_AUI_ENTRY_DATA *entry_data, USHORT alphachar, BOOL multitap) { - T_ED_DATA *editor = entry_data->editor; + T_ED_DATA *editor = entry_data->editor; - TRACE_FUNCTION("AUITextEntry: AUI_entry_EditChar()"); + TRACE_FUNCTION("AUITextEntry: AUI_entry_EditChar()"); - /* If character is not provided, get it from the key table */ + /* If character is not provided, get it from the key table */ - if (alphachar==NULL) - { - alphachar = AUI_entry_GetKeyChar(entry_data, ATB_edit_GetCasePref(editor)); + if (alphachar==NULL) + { + alphachar = AUI_entry_GetKeyChar(entry_data, ATB_edit_GetCasePref(editor)); - if (!(ATB_edit_Mode(entry_data->editor, ED_MODE_ALPHA) && entry_data->Key!=KCD_MAX)) - alphachar = UNICODE_SPACE; - } + if (!(ATB_edit_Mode(entry_data->editor, ED_MODE_ALPHA) && entry_data->Key!=KCD_MAX)) + alphachar = UNICODE_SPACE; + } - ATB_edit_MultiTap(editor, alphachar, multitap); + ATB_edit_MultiTap(editor, alphachar, multitap); return alphachar; } @@ -270,27 +270,27 @@ /******************************************************************************* - $Function: AUI_entry_EditDigit + $Function: AUI_entry_EditDigit - $Description: Sends a numeric digit/symbol to the editor + $Description: Sends a numeric digit/symbol to the editor - $Returns: None. + $Returns: None. - $Arguments: data - The editor data - code - The key code of the digit to be inserted + $Arguments: data - The editor data + code - The key code of the digit to be inserted *******************************************************************************/ USHORT AUI_entry_EditDigit (T_AUI_ENTRY_DATA *entry_data, UBYTE code) { - T_ED_DATA *editor = entry_data->editor; - USHORT alphachar; + T_ED_DATA *editor = entry_data->editor; + USHORT alphachar; - TRACE_FUNCTION("AUITextEntry: AUI_entry_EditDigit()"); + TRACE_FUNCTION("AUITextEntry: AUI_entry_EditDigit()"); - alphachar = ATB_char_Unicode(editControls[code]); + alphachar = ATB_char_Unicode(editControls[code]); - ATB_edit_MultiTap(editor, alphachar, FALSE); + ATB_edit_MultiTap(editor, alphachar, FALSE); return alphachar; } @@ -300,9 +300,9 @@ $Function: AUI_entry_Timer - $Description: executes the timer event from the edit component + $Description: executes the timer event from the edit component - $Returns: none. + $Returns: none. $Arguments: @@ -310,24 +310,24 @@ static int AUI_entry_Timer (MfwEvt event, MfwTim *timer) { - T_AUI_ENTRY_DATA *entry_data = (T_AUI_ENTRY_DATA *)MMIdata; + T_AUI_ENTRY_DATA *entry_data = (T_AUI_ENTRY_DATA *)MMIdata; - TRACE_FUNCTION("AUIEditor: AUI_entry_Timer()"); + TRACE_FUNCTION("AUIEditor: AUI_entry_Timer()"); /* SPR#2174 - SH - Only display character if we're still in multi-tap */ if (entry_data->editor->multitap) { - if (ATB_edit_Mode(entry_data->editor, ED_MODE_ALPHA)) - { - AUI_entry_EditChar(entry_data, NULL, FALSE); + if (ATB_edit_Mode(entry_data->editor, ED_MODE_ALPHA)) + { + AUI_entry_EditChar(entry_data, NULL, FALSE); - entry_data->Level = KEY_PAD_MAX-1; - entry_data->Key = KCD_MAX; - } + entry_data->Level = KEY_PAD_MAX-1; + entry_data->Key = KCD_MAX; + } - SEND_EVENT(entry_data->win, entry_data->update,0,0); - } + SEND_EVENT(entry_data->win, entry_data->update,0,0); + } return 1; } @@ -335,27 +335,27 @@ /******************************************************************************* - $Function: AUI_entry_StopMultitap + $Function: AUI_entry_StopMultitap - $Description: Stops a multitap operation going on, cancelling the timer - SPR#2174 - SH - Added + $Description: Stops a multitap operation going on, cancelling the timer + SPR#2174 - SH - Added - $Returns: none. + $Returns: none. - $Arguments: entry_data - The entry data + $Arguments: entry_data - The entry data *******************************************************************************/ void AUI_entry_StopMultitap(T_AUI_ENTRY_DATA *entry_data) { - TRACE_FUNCTION("AUIEditor: AUI_entry_StopMultitap()"); + TRACE_FUNCTION("AUIEditor: AUI_entry_StopMultitap()"); - timStop(entry_data->editTim); + timStop(entry_data->editTim); entry_data->editor->multitap = FALSE; entry_data->Level = KEY_PAD_MAX-1; - entry_data->Key = KCD_MAX; + entry_data->Key = KCD_MAX; return; } @@ -363,11 +363,11 @@ /******************************************************************************* - $Function: AUI_entry_EventKey + $Function: AUI_entry_EventKey - $Description: Process a keypress event. + $Description: Process a keypress event. - $Returns: The character that is entered, or NULL. + $Returns: The character that is entered, or NULL. $Arguments: @@ -375,26 +375,26 @@ USHORT AUI_entry_EventKey (T_AUI_ENTRY_DATA *entry_data, MfwEvt event, MfwKbd *key) { - T_ED_DATA *editor = entry_data->editor; - USHORT alphachar; // The character entered + T_ED_DATA *editor = entry_data->editor; + USHORT alphachar; // The character entered - TRACE_FUNCTION("AUIEditor: AUI_entry_EventKey"); + TRACE_FUNCTION("AUIEditor: AUI_entry_EventKey"); - alphachar = AUI_entry_Keypress(entry_data, event, key); + alphachar = AUI_entry_Keypress(entry_data, event, key); - ATB_edit_Refresh(editor); + ATB_edit_Refresh(editor); - return alphachar; + return alphachar; } /******************************************************************************* - $Function: AUI_entry_Keypress + $Function: AUI_entry_Keypress - $Description: Process a keypress event + $Description: Process a keypress event - $Returns: The character that is entered, or NULL. + $Returns: The character that is entered, or NULL. $Arguments: @@ -402,162 +402,162 @@ static USHORT AUI_entry_Keypress(T_AUI_ENTRY_DATA *entry_data, MfwEvt event, MfwKbd *key) { - T_ED_DATA *editor = entry_data->editor; - USHORT alphachar; /* Current multi-tap character */ - T_ED_CASE_PREF casePref; + T_ED_DATA *editor = entry_data->editor; + USHORT alphachar; /* Current multi-tap character */ + T_ED_CASE_PREF casePref; - TRACE_FUNCTION("AUIEditor: AUI_entry_KeypressFormat()"); + TRACE_FUNCTION("AUIEditor: AUI_entry_KeypressFormat()"); - alphachar = NULL; + alphachar = NULL; - if (key->code!=KCD_HUP && editor->cursor.pos<(editor->attr->size-1)) /* SPR#1995 - SH */ - { - /* Multi-tap: The user presses a different key, meaning the previous character must be entered */ + if (key->code!=KCD_HUP && editor->cursor.pos<(editor->attr->size-1)) /* SPR#1995 - SH */ + { + /* Multi-tap: The user presses a different key, meaning the previous character must be entered */ - if (entry_data->Key != KCD_MAX && entry_data->Key != key->code) - { - timStop(entry_data->editTim); + if (entry_data->Key != KCD_MAX && entry_data->Key != key->code) + { + timStop(entry_data->editTim); - AUI_entry_EditChar(entry_data, alphachar, FALSE); // Show character, not multi-tap - entry_data->Level = KEY_PAD_MAX-1; - entry_data->Key = KCD_MAX; - } + AUI_entry_EditChar(entry_data, alphachar, FALSE); // Show character, not multi-tap + entry_data->Level = KEY_PAD_MAX-1; + entry_data->Key = KCD_MAX; + } - casePref = ATB_edit_GetCasePref(editor); /* Work out the format character that will govern the format of this keypress */ + casePref = ATB_edit_GetCasePref(editor); /* Work out the format character that will govern the format of this keypress */ - if (editor->cursor.pos < (editor->attr->size-1) && casePref!=ED_CASEPREF_NONE) /* SPR#1995 - SH */ // Make sure we can still show a character + if (editor->cursor.pos < (editor->attr->size-1) && casePref!=ED_CASEPREF_NONE) /* SPR#1995 - SH */ // Make sure we can still show a character { - if (key->code <= KCD_HASH) /* SPR#1788 - SH - Now accept 0-9, * and # */ - { - entry_data->Key = key->code; // Store the key pressed + if (key->code <= KCD_HASH) /* SPR#1788 - SH - Now accept 0-9, * and # */ + { + entry_data->Key = key->code; // Store the key pressed - /* Numeric */ + /* Numeric */ - if (casePref==ED_CASEPREF_NUM) // A numeric digit is expected - { - alphachar = AUI_entry_GetKeyChar(entry_data, casePref); - entry_data->Level = KEY_PAD_MAX-1; // Reset multi-tap settings - entry_data->Key = KCD_MAX; - AUI_entry_EditChar(entry_data, alphachar, FALSE); // Show character, not multi-tap# - } + if (casePref==ED_CASEPREF_NUM) // A numeric digit is expected + { + alphachar = AUI_entry_GetKeyChar(entry_data, casePref); + entry_data->Level = KEY_PAD_MAX-1; // Reset multi-tap settings + entry_data->Key = KCD_MAX; + AUI_entry_EditChar(entry_data, alphachar, FALSE); // Show character, not multi-tap# + } - /* Multi-tap alphanumeric */ + /* Multi-tap alphanumeric */ - else // Valid format codes - { - alphachar = NULL; + else // Valid format codes + { + alphachar = NULL; - entry_data->Level++; // Increment through list of symbols - if (entry_data->Level > (KEY_PAD_MAX-1)) // List wraps round - entry_data->Level = 0; + entry_data->Level++; // Increment through list of symbols + if (entry_data->Level > (KEY_PAD_MAX-1)) // List wraps round + entry_data->Level = 0; - alphachar = AUI_entry_GetKeyChar(entry_data, casePref); + alphachar = AUI_entry_GetKeyChar(entry_data, casePref); - if (alphachar!=NULL) // If we've found a character, and string isn't max size - { - AUI_entry_EditChar(entry_data, alphachar, TRUE); // Add character, multi-tap - /* Need to store this handle, so timer can get access to - * entry_data on callback */ - MMIdata = (void *)entry_data; - timStart(entry_data->editTim); - } - else - entry_data->Key = KCD_MAX;/*a0393213 warnings removal-KEY_MAX changed to KCD_MAX*/ - } - } - } - } - return alphachar; + if (alphachar!=NULL) // If we've found a character, and string isn't max size + { + AUI_entry_EditChar(entry_data, alphachar, TRUE); // Add character, multi-tap + /* Need to store this handle, so timer can get access to + * entry_data on callback */ + MMIdata = (void *)entry_data; + timStart(entry_data->editTim); + } + else + entry_data->Key = KCD_MAX;/*a0393213 warnings removal-KEY_MAX changed to KCD_MAX*/ + } + } + } + } + return alphachar; } /******************************************************************************* - $Function: AUI_entry_GetKeyChar + $Function: AUI_entry_GetKeyChar - $Description: Return the character to be entered, based on the keypress + $Description: Return the character to be entered, based on the keypress - $Returns: the unicode character to be entered into the text + $Returns: the unicode character to be entered into the text - $Arguments: case - the preference for the case of the output + $Arguments: case - the preference for the case of the output *******************************************************************************/ USHORT AUI_entry_GetKeyChar(T_AUI_ENTRY_DATA *entry_data, T_ED_CASE_PREF casePref) { - T_ED_DATA *editor = entry_data->editor; - USHORT alphachar; - USHORT safetycounter; /* Stops searching forever to find compatible character */ - BOOL valid; /* flag to indicate whether character is accepted */ - USHORT upper; - USHORT lower; - UBYTE caseSel = ATB_edit_GetCase(editor); /* The case selected by the user */ + T_ED_DATA *editor = entry_data->editor; + USHORT alphachar; + USHORT safetycounter; /* Stops searching forever to find compatible character */ + BOOL valid; /* flag to indicate whether character is accepted */ + USHORT upper; + USHORT lower; + UBYTE caseSel = ATB_edit_GetCase(editor); /* The case selected by the user */ - TRACE_FUNCTION("AUI_entry_GetKeyChar"); + TRACE_FUNCTION("AUI_entry_GetKeyChar"); - if (casePref==ED_CASEPREF_NUM || (casePref==ED_CASEPREF_ALPHANUM && caseSel==ED_CASE_NUM)) - { - alphachar = editControls[entry_data->Key]; - if (entry_data->Key<=KCD_HASH) - alphachar = alphachar << 8; // Gives us the ascii in the upper byte of the unicode - } - else - { - valid = FALSE; - alphachar = NULL; - safetycounter = 0; + if (casePref==ED_CASEPREF_NUM || (casePref==ED_CASEPREF_ALPHANUM && caseSel==ED_CASE_NUM)) + { + alphachar = editControls[entry_data->Key]; + if (entry_data->Key<=KCD_HASH) + alphachar = alphachar << 8; // Gives us the ascii in the upper byte of the unicode + } + else + { + valid = FALSE; + alphachar = NULL; + safetycounter = 0; - while (!valid && safetycounterKey][entry_data->Level]; - lower = (USHORT)editAlpha[entry_data->Key][entry_data->Level]; + while (!valid && safetycounterKey][entry_data->Level]; + lower = (USHORT)editAlpha[entry_data->Key][entry_data->Level]; - switch(casePref) - { - case ED_CASEPREF_ALPHANUM: - if (caseSel==ED_CASE_UPPER || caseSel==ED_CASE_CAPS) - alphachar = upper; - else - alphachar = lower; - valid = TRUE; - break; + switch(casePref) + { + case ED_CASEPREF_ALPHANUM: + if (caseSel==ED_CASE_UPPER || caseSel==ED_CASE_CAPS) + alphachar = upper; + else + alphachar = lower; + valid = TRUE; + break; - case ED_CASEPREF_ALPHANUM_UC: - alphachar = upper; - valid = TRUE; - break; + case ED_CASEPREF_ALPHANUM_UC: + alphachar = upper; + valid = TRUE; + break; - case ED_CASEPREF_ALPHANUM_LC: - alphachar = lower; - valid = TRUE; - break; + case ED_CASEPREF_ALPHANUM_LC: + alphachar = lower; + valid = TRUE; + break; - case ED_CASEPREF_ALPHA_UC: - alphachar = upper; - valid = !ATB_char_IsNumeric(alphachar); - break; + case ED_CASEPREF_ALPHA_UC: + alphachar = upper; + valid = !ATB_char_IsNumeric(alphachar); + break; - case ED_CASEPREF_ALPHA_LC: - alphachar = lower; - valid = !ATB_char_IsNumeric(alphachar); - break; - } + case ED_CASEPREF_ALPHA_LC: + alphachar = lower; + valid = !ATB_char_IsNumeric(alphachar); + break; + } - if (!valid) - { // find the next one that is, - alphachar = NULL; - safetycounter++; // (but don't search forever) - entry_data->Level++; - if (entry_data->Level > (KEY_PAD_MAX-1)) - entry_data->Level = 0; - } - } + if (!valid) + { // find the next one that is, + alphachar = NULL; + safetycounter++; // (but don't search forever) + entry_data->Level++; + if (entry_data->Level > (KEY_PAD_MAX-1)) + entry_data->Level = 0; + } + } - alphachar = ATB_char_Unicode(alphachar); /* SPR#2342 - SH - Convert from unicode properly */ - } + alphachar = ATB_char_Unicode(alphachar); /* SPR#2342 - SH - Convert from unicode properly */ + } - TRACE_EVENT_P1(">>> alphachar = %d", alphachar); + TRACE_EVENT_P1(">>> alphachar = %d", alphachar); - return alphachar; + return alphachar; }