FreeCalypso > hg > fc-tourmaline
diff src/ui/bmi/AUISymbol.c @ 135:70ea7526b59e
bmi/AUI*.c: bogotab fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 14 Nov 2020 03:18:11 +0000 |
parents | c0052fe355d3 |
children |
line wrap: on
line diff
--- 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; }