gui_inputs.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:662k
源码类别:
MTK
开发平台:
C/C++
- /* To use this flag, turn ON EMS_DISPLAY_SPECIAL_CHARACTERS also (outside this file) */
- #define MULTILINE_INPUTBOX_DISPLAY_SPECIAL_CHARACTERS 0
- #define MULTILINE_INPUTBOX_USE_GSM_EXTENDED 1
- #if(MULTILINE_INPUTBOX_DISPLAY_SPECIAL_CHARACTERS)
- extern const U8 EMS_CR_display_character[];
- extern const U8 EMS_LF_display_character[];
- extern const U8 EMS_ESC_display_character[];
- #endif /* (MULTILINE_INPUTBOX_DISPLAY_SPECIAL_CHARACTERS) */
- UI_character_type multi_line_input_box_break_characters[] = { ' ',
- /*
- * '.',
- * ',',
- * '\',
- * '/',
- * '-',
- * ':',
- * ';',
- * '?',
- * '!',
- * '|',
- * '+',
- * '=',
- * '_',
- */
- 'n'
- };
- /* Linear search. Should be improved to something else */
- #define UI_MULTI_LINE_INPUT_BOX_BREAK_CHARACTER(c,flag)
- { S32 _ii_;
- flag=0;
- for(_ii_=0;_ii_<UI_MULTI_LINE_INPUT_BOX_NUMBER_OF_BREAK_CHARACTERS;_ii_++)
- { if((UI_character_type)c==(UI_character_type)multi_line_input_box_break_characters[_ii_])
- { flag=1;
- break;
- }
- }
- }
- #define UI_MULTI_LINE_INPUT_BOX_SPACE_CHARACTER(c) (((UI_character_type)(c)==(UI_character_type)' ')?(1):(0))
- /* Basic Latin,Latin 1,Latin Extended A, Latin Extended B */
- /* Cyrillic */
- /* Latin Extended Additional */
- /* Combining Marks */
- /* Basic Arabic */
- /* Arabic Presentation Forms-A */
- /* Arabic Presentation Forms-B */
- #define UI_MULTI_LINE_INPUT_BOX_ALPHABETIC_CHARACTER(c)
- ((((UI_character_type)(c)<=(UI_character_type)0x0240) ||
- ( ((UI_character_type)(c)>=(UI_character_type)0x0400) && ((UI_character_type)(c)<=(UI_character_type)0x04FF) ) ||
- ( ((UI_character_type)(c)>=(UI_character_type)0x1E00) && ((UI_character_type)(c)<=(UI_character_type)0x1EFF) ) ||
- ( ((UI_character_type)(c)>=(UI_character_type)0x0300) && ((UI_character_type)(c)<=(UI_character_type)0x036F) ) ||
- ( ((UI_character_type)(c)>=(UI_character_type)0x0621) && ((UI_character_type)(c)<=(UI_character_type)0x0653) ) ||
- ( ((UI_character_type)(c)>=(UI_character_type)0xFB50) && ((UI_character_type)(c)<=(UI_character_type)0xFDFF) ) ||
- ( ((UI_character_type)(c)>=(UI_character_type)0xFE70) && ((UI_character_type)(c)<=(UI_character_type)0xFEFF) ) )?(1):(0))
- #define UI_MULTI_LINE_INPUT_BOX_MOVE_TEXT_CURSOR(x,y)
- {
- UI_text_x=x;
- UI_text_y=y;
- }
- #define UI_MULTI_LINE_INPUT_BOX_SET_TEXT_COLOR(c)
- {
- UI_text_color=c;
- }
- #define UI_MULTI_LINE_INPUT_BOX_DRAW_CURSOR(x,y,height,c)
- {
- gui_fill_rectangle((x)-1,( y),(x),(y)+(height)-1,c);
- }
- #define MULTI_LINE_INPUT_BOX_CHARACTER_WIDTH_CACHE_SIZE ((UI_device_width)>>1)
- #define UI_TEST_GRP_SEP_CHARACTER(c) (((UI_character_type)(c)==(UI_character_type)0x1D)?(1):(0))
- #define UI_TEST_FILE_SEP_CHARACTER(c) (((UI_character_type)(c)==(UI_character_type)0x1C)?(1):(0))
- #define UI_TEST_SENDER_TRUNCATE_SEP_CHARACTER(c) (((UI_character_type)(c)==(UI_character_type)0x1E)?(1):(0))
- #define UI_TEST_RECEIVER_TRUNCATE_SEP_CHARACTER(c) (((UI_character_type)(c)==(UI_character_type)0x1F)?(1):(0))
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_show_cursor
- * DESCRIPTION
- * show cursor of multiline input box
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * x [IN]
- * y [IN]
- * height [IN]
- * clip_x1 [IN]
- * clip_y1 [IN]
- * clip_x2 [IN]
- * clip_y2 [IN]
- * RETURNS
- * void
- *****************************************************************************/
- /* MTK Elvis to fix the cursor clip issue */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #if(UI_BLINKING_CURSOR_SUPPORT)
- /* under construction !*/
- #else
- /* under construction !*/
- #endif
- /* under construction !*/
- #endif /* 0 */
- void gui_multi_line_input_box_show_cursor(
- multi_line_input_box *b,
- S32 x,
- S32 y,
- S32 height,
- S32 clip_x1,
- S32 clip_y1,
- S32 clip_x2,
- S32 clip_y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c = b->cursor_color;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W06.06 Fix Cursor Clipping issue when storing cursor area to bmp */
- gdi_layer_push_clip();
- gdi_layer_set_clip(clip_x1, clip_y1, clip_x2, clip_y2);
- if (x > clip_x2)
- {
- x = clip_x2;
- }
- x--;
- if (x < clip_x1)
- {
- x = clip_x1;
- }
- if (y < clip_y1)
- {
- height -= (clip_y1 - y);
- y = clip_y1 + 1;
- }
- if ((y + height - 1) > clip_y2)
- {
- height -= (y + height - 1) - clip_y2;
- }
- #if(UI_BLINKING_CURSOR_SUPPORT)
- UI_inputbox_show_cursor(x, y, x + 1, y + height - 1, c);
- #else
- gui_fill_rectangle(x, y, x + 1, y + height - 1, c);
- #endif
- gdi_layer_pop_clip();
- }
- /* MTK end */
- /*****************************************************************************
- * FUNCTION
- * gui_set_multi_line_input_box_current_theme
- * DESCRIPTION
- * Applies the current theme to the multi-line inputbox
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_multi_line_input_box_current_theme(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->normal_filler = current_multi_line_input_box_theme->normal_filler;
- b->disabled_filler = current_multi_line_input_box_theme->disabled_filler;
- b->focussed_filler = current_multi_line_input_box_theme->selected_filler;
- b->text_filler = NULL; /* Disabled by default */
- b->special_text_color = current_multi_line_input_box_theme->special_text_color;
- b->normal_text_color = current_multi_line_input_box_theme->normal_text_color;
- b->disabled_text_color = current_multi_line_input_box_theme->disabled_text_color;
- b->focussed_text_color = current_multi_line_input_box_theme->selected_text_color;
- b->selector_color = current_multi_line_input_box_theme->selection_color;
- b->selected_text_color = current_multi_line_input_box_theme->selection_text_color;
- b->cursor_color = current_multi_line_input_box_theme->cursor_color;
- b->text_font = current_multi_line_input_box_theme->text_font;
- b->mask_character = current_multi_line_input_box_theme->mask_character;
- b->text_gap = current_multi_line_input_box_theme->text_gap;
- b->flags |= current_multi_line_input_box_theme->flags;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_multi_line_input_box_theme
- * DESCRIPTION
- * Applies the given theme to the multi-line inputbox
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * t [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_multi_line_input_box_theme(multi_line_input_box *b, UI_multi_line_input_box_theme *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->normal_filler = t->normal_filler;
- b->disabled_filler = t->disabled_filler;
- b->focussed_filler = t->selected_filler;
- b->text_filler = NULL; /* Disabled by default */
- b->special_text_color = t->special_text_color;
- b->normal_text_color = t->normal_text_color;
- b->disabled_text_color = t->disabled_text_color;
- b->focussed_text_color = t->selected_text_color;
- b->boundary_color = t->boundary_color;
- b->selector_color = t->selection_color;
- b->selected_text_color = t->selection_text_color;
- b->cursor_color = t->cursor_color;
- b->text_font = t->text_font;
- b->text_gap = t->text_gap;
- b->mask_character = t->mask_character;
- b->flags |= t->flags;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_clear
- * DESCRIPTION
- * Initilize the multi-line inputbox to default
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_multi_line_input_box_clear(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (b->text == NULL)
- {
- b->text_length = 0;
- b->allocated_length = 0;
- b->available_length = 0;
- return;
- }
- else
- {
- b->text[0] = ' ';
- b->text[1] = 0;
- b->text_length = 2;
- }
- b->cursor_p = b->text;
- b->last_position_p = b->text;
- b->UCS2_count = 0;
- b->GSM_ext_count = 0;
- if (b->flags & UI_MULTI_LINE_INPUT_BOX_USE_ENCODING_BASED_LENGTH)
- {
- b->available_length = b->allocated_length;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_multi_line_input_box
- * DESCRIPTION
- * Creates a multi-line inputbox object
- * Starts with an empty string
- *
- * See also gui_destroy_multi_line_input_box()
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object (pre-allocated)
- * x [IN] Is the left-top corner
- * y [IN] Is the left-top corner
- * width [IN] Is the width of the multi-line inputbox
- * height [IN] Is the height of the multi-line inputbox
- * length [IN] Is the length of the buffer (auto-allocated)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_multi_line_input_box(multi_line_input_box *b, S32 x, S32 y, S32 width, S32 height, U32 length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x;
- b->y = y;
- b->width = width;
- b->height = height;
- b->text = (UI_buffer_type) gui_malloc(length * sizeof(UI_character_type));
- b->allocated_length = length;
- b->available_length = length;
- gui_multi_line_input_box_clear(b); /* show multi line input box to defualt values */
- b->flags = 0;
- b->UCS2_count = 0;
- b->GSM_ext_count = 0;
- b->editor_changed = 0; /* Gurinder - Variable Added In MultiLine Inputbox */
- b->cursor_p = b->text;
- b->n_lines = 0;
- b->cursor_line_position_counter = 0;
- b->cursor_x = 0;
- b->cursor_y = 0;
- b->text_offset_x = 0;
- b->text_offset_y = 0;
- /* set theme of multiline input box */
- gui_set_multi_line_input_box_current_theme(b);
- b->text_x = 2 + b->text_gap;
- b->text_y = 2;
- b->text_x2_gap_width = 0;
- b->edit_width = b->width - (b->text_x + b->text_x2_gap_width);
- b->edit_height = b->height - (b->text_y * 2);
- b->overflow_callback = UI_dummy_function;
- b->change_callback = UI_dummy_function;
- b->validation_callback = UI_dummy_validation_function;
- /* create vertial scroll bar */
- gui_create_vertical_scrollbar(
- &b->vbar,
- b->x + b->width - current_multi_line_input_box_theme->vbar_width - 1,
- b->y + 1,
- current_multi_line_input_box_theme->vbar_width,
- b->height - 2);
- if (!(b->flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR))
- {
- b->edit_width -= b->vbar.width;
- }
- b->min_text_height = 0;
- b->max_empty_text_height = 0;
- b->min_line_height = 0;
- b->header_height = 0;
- b->footer_height = 0;
- gui_multi_line_input_box_register_infobar_callback(b,NULL,NULL,0);
- b->header_callback = NULL;
- b->footer_callback = NULL;
- b->icon_callback = NULL;
- b->change_event_handler = NULL;
- #ifdef __MMI_TOUCH_SCREEN__
- b->pen_scroll_delay_time = 0;
- b->pen_scroll_after_delay = -1;
- memset(&(b->pen_state), 0, sizeof(gui_multi_line_input_box_pen_state_struct));
- #endif /* __MMI_TOUCH_SCREEN__ */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_multi_line_input_box_use_buffer
- * DESCRIPTION
- * Creates a multi-line inputbox object with a user specifed buffer
- * Starts with an empty string
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object (pre-allocated)
- * x [IN] Is the left-top corner
- * y [IN] Is the left-top corner
- * width [IN] Is the width of the multi-line inputbox
- * height [IN] Is the height of the multi-line inputbox
- * buffer [IN] Is a pointer to the text buffer to use (pre-allocated)
- * length [IN] Is the length of the buffer
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_multi_line_input_box_use_buffer(
- multi_line_input_box *b,
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- UI_string_type buffer,
- S32 length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x;
- b->y = y;
- b->width = width;
- b->height = height;
- b->text = (UI_buffer_type) buffer;
- b->allocated_length = length;
- b->available_length = length;
- b->flags = 0;
- gui_multi_line_input_box_clear(b);
- b->UCS2_count = 0;
- b->GSM_ext_count = 0;
- b->editor_changed = 0; /* Justin WCSS editor */
- b->cursor_p = b->text;
- b->n_lines = 0;
- b->cursor_line_position_counter = 0;
- b->cursor_x = 0;
- b->cursor_y = 0;
- b->text_offset_x = 0;
- b->text_offset_y = 0;
- /* set theme of multiline input box */
- gui_set_multi_line_input_box_current_theme(b);
- b->text_x = 2 + b->text_gap;
- b->text_y = 2;
- b->text_x2_gap_width = 0;
- b->edit_width = b->width - (b->text_x + b->text_x2_gap_width);
- b->edit_height = b->height - (b->text_y * 2);
- b->overflow_callback = UI_dummy_function;
- b->change_callback = UI_dummy_function;
- b->validation_callback = UI_dummy_validation_function;
- /* create vertical scroll bar */
- gui_create_vertical_scrollbar(
- &b->vbar,
- b->x + b->width - current_multi_line_input_box_theme->vbar_width - 1,
- b->y + 1,
- current_multi_line_input_box_theme->vbar_width,
- b->height - 2);
- if (!(b->flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR))
- {
- b->edit_width -= b->vbar.width;
- }
- b->min_text_height = 0;
- b->max_empty_text_height = 0;
- b->min_line_height = 0;
- b->header_height = 0;
- b->footer_height = 0;
- gui_multi_line_input_box_register_infobar_callback(b,NULL,NULL,0);
- b->header_callback = NULL;
- b->footer_callback = NULL;
- b->icon_callback = NULL;
- b->change_event_handler = NULL;
- #ifdef __MMI_TOUCH_SCREEN__
- b->pen_scroll_delay_time = 0;
- b->pen_scroll_after_delay = -1;
- memset(&(b->pen_state), 0, sizeof(gui_multi_line_input_box_pen_state_struct));
- #endif /* __MMI_TOUCH_SCREEN__ */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_multi_line_input_box_set_buffer
- * DESCRIPTION
- * Creates a multi-line inputbox object,
- * Starts with a given string and allows the user to edit it.
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object (pre-allocated)
- * x [IN] Is the left-top corner
- * y [IN] Is the left-top corner
- * width [IN] Is the width of the multi-line inputbox
- * height [IN] Is the height of the multi-line inputbox
- * buffer [IN] Is the buffer to use (pre-allocated)
- * length [IN] Is the length of the buffer (buffer size)
- * text_length [IN] Is the number of characters in the text
- * edit_position [IN] Is the start position of the cursor
- * Note(?) [IN] The buffer should contain a valid string.
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_multi_line_input_box_set_buffer(
- multi_line_input_box *b,
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- UI_string_type buffer,
- S32 length,
- S32 text_length,
- S32 edit_position)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /* MTK Elvis to init this parameter */
- UI_character_type dummy_c = ' ';
- /* MTK end */
- UI_buffer_type text;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x;
- b->y = y;
- b->width = width;
- b->height = height;
- b->text = (UI_buffer_type) buffer;
- b->allocated_length = length;
- b->available_length = length;
- b->text_length = text_length;
- b->flags = 0;
- b->ext_flags = 0;
- b->UCS2_count = 0;
- b->GSM_ext_count = 0;
- b->editor_changed = 0; /* Justin WCSS editor */
- b->n_lines = 0;
- b->cursor_line_position_counter = 0;
- b->cursor_x = 0;
- b->cursor_y = 0;
- b->text_offset_x = 0;
- b->text_offset_y = 0;
- b->cursor_p = b->text;
- b->show_action_flag = 1;
- if (b->text != NULL)
- {
- text = b->text;
- UI_STRING_GET_NEXT_CHARACTER(text, dummy_c);
- text = b->text;
- for (i = 0; i < edit_position; i++)
- {
- UI_STRING_GET_NEXT_CHARACTER(text, dummy_c);
- UI_TEST_UCS2_INCREMENT_COUNT(dummy_c, b->UCS2_count);
- if (UI_STRING_END_OF_STRING_CHARACTER(dummy_c))
- {
- break;
- }
- if (UI_TEST_GSM_EXTENDED(dummy_c))
- {
- b->GSM_ext_count++;
- }
- }
- b->cursor_p = text;
- for (i = edit_position; !UI_STRING_END_OF_STRING_CHARACTER(dummy_c); i++)
- {
- UI_STRING_GET_NEXT_CHARACTER(text, dummy_c);
- UI_TEST_UCS2_INCREMENT_COUNT(dummy_c, b->UCS2_count);
- if (UI_TEST_GSM_EXTENDED(dummy_c))
- {
- b->GSM_ext_count++;
- }
- }
- b->last_position_p = b->cursor_p;
- }
- /* set theme of multiline input bx */
- gui_set_multi_line_input_box_current_theme(b);
- b->text_x = 2 + b->text_gap;
- b->text_y = 2;
- b->text_x2_gap_width = 0;
- b->edit_width = b->width - (b->text_x + b->text_x2_gap_width);
- b->edit_height = b->height - (b->text_y * 2);
- b->overflow_callback = UI_dummy_function;
- b->change_callback = UI_dummy_function;
- b->validation_callback = UI_dummy_validation_function;
- if (!(b->flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR))
- {
- gui_create_vertical_scrollbar(
- &b->vbar,
- b->x + b->width - current_multi_line_input_box_theme->vbar_width - 1,
- b->y + 1,
- current_multi_line_input_box_theme->vbar_width,
- b->height - 2);
- b->edit_width -= b->vbar.width;
- }
- b->min_text_height = 0;
- b->max_empty_text_height = 0;
- b->min_line_height = 0;
- b->header_height = 0;
- b->footer_height = 0;
- gui_multi_line_input_box_register_infobar_callback(b,NULL,NULL,0);
- b->header_callback = NULL;
- b->footer_callback = NULL;
- b->icon_callback = NULL;
- b->change_event_handler = NULL;
- /* barcode */
- b->current_hilite_idx = 0;
- b->curr_hilite_text_offset_y = 0;
- b->hilite_list = NULL;
- b->hilite_cb = NULL;
- #ifdef __MMI_TOUCH_SCREEN__
- b->pen_scroll_delay_time = 0;
- b->pen_scroll_after_delay = -1;
- memset(&(b->pen_state), 0, sizeof(gui_multi_line_input_box_pen_state_struct));
- #endif /* __MMI_TOUCH_SCREEN__ */
- #if defined(__UI_PAGING_IN_MULTILINE_EDITOR__)
- b->last_page_flag = 0;
- #endif
- }
- //Gurinder - 5/5/2004 Inline Multiline Box History Control
- //Duplicate Function With No Position Reset.
- /*****************************************************************************
- * FUNCTION
- * gui_create_multi_line_input_box_set_buffer_no_text_reset
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * x [IN]
- * y [IN]
- * width [IN]
- * height [IN]
- * buffer [IN]
- * length [IN]
- * text_length [IN]
- * edit_position [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_multi_line_input_box_set_buffer_no_text_reset(
- multi_line_input_box *b,
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- UI_string_type buffer,
- S32 length,
- S32 text_length,
- S32 edit_position)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- UI_character_type dummy_c = 0;
- UI_buffer_type text;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x;
- b->y = y;
- b->width = width;
- b->height = height;
- b->text = (UI_buffer_type) buffer;
- b->allocated_length = length;
- b->available_length = length;
- b->text_length = text_length;
- b->flags = 0;
- b->UCS2_count = 0;
- b->GSM_ext_count = 0;
- b->cursor_p = b->text;
- if (b->text != NULL)
- {
- text = b->text;
- for (i = 0; i < edit_position; i++)
- {
- UI_STRING_GET_NEXT_CHARACTER(text, dummy_c);
- UI_TEST_UCS2_INCREMENT_COUNT(dummy_c, b->UCS2_count);
- if (UI_STRING_END_OF_STRING_CHARACTER(dummy_c))
- {
- break;
- }
- if (UI_TEST_GSM_EXTENDED(dummy_c))
- {
- b->GSM_ext_count++;
- }
- }
- b->cursor_p = text;
- for (i = edit_position; !UI_STRING_END_OF_STRING_CHARACTER(dummy_c); i++)
- {
- UI_STRING_GET_NEXT_CHARACTER(text, dummy_c);
- UI_TEST_UCS2_INCREMENT_COUNT(dummy_c, b->UCS2_count);
- if (UI_TEST_GSM_EXTENDED(dummy_c))
- {
- b->GSM_ext_count++;
- }
- }
- b->last_position_p = b->cursor_p;
- }
- /* set theme of multiline input bx */
- gui_set_multi_line_input_box_current_theme(b);
- b->text_x = 2 + b->text_gap;
- b->text_y = 2;
- b->text_x2_gap_width = 0;
- b->edit_width = b->width - (b->text_x + b->text_x2_gap_width);
- b->edit_height = b->height - (b->text_y * 2);
- b->overflow_callback = UI_dummy_function;
- b->change_callback = UI_dummy_function;
- b->validation_callback = UI_dummy_validation_function;
- gui_create_vertical_scrollbar(
- &b->vbar,
- b->x + b->width - current_multi_line_input_box_theme->vbar_width - 1,
- b->y + 1,
- current_multi_line_input_box_theme->vbar_width,
- b->height - 2);
- if (!(b->flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR))
- {
- b->edit_width -= b->vbar.width;
- }
- b->min_text_height = 0;
- b->max_empty_text_height = 0;
- b->min_line_height = 0;
- b->header_height = 0;
- b->footer_height = 0;
- gui_multi_line_input_box_register_infobar_callback(b,NULL,NULL,0);
- b->header_callback = NULL;
- b->footer_callback = NULL;
- b->icon_callback = NULL;
- b->change_event_handler = NULL;
- #ifdef __MMI_TOUCH_SCREEN__
- b->pen_scroll_delay_time = 0;
- b->pen_scroll_after_delay = -1;
- memset(&(b->pen_state), 0, sizeof(gui_multi_line_input_box_pen_state_struct));
- #endif /* __MMI_TOUCH_SCREEN__ */
- }
- /*****************************************************************************
- * FUNCTION
- * gui_move_multi_line_input_box
- * DESCRIPTION
- * Moves a multi-line input box
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * x [IN] Is the new position (left-top corner)
- * y [IN] Is the new position (left-top corner)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_move_multi_line_input_box(multi_line_input_box *b, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x;
- b->y = y;
- gui_move_vertical_scrollbar(&b->vbar, b->x + b->width - b->vbar.width, b->y + 1);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_resize_multi_line_input_box
- * DESCRIPTION
- * Moves a multi-line input box
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * width [IN]
- * height [IN]
- * x(?) [IN] Is the new position (left-top corner)
- * y(?) [IN] Is the new position (left-top corner)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_resize_multi_line_input_box(multi_line_input_box *b, S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->width = width;
- b->height = height;
- b->edit_width = b->width - (b->text_x + b->text_x2_gap_width);
- b->edit_height = b->height - (b->text_y * 2);
- gui_move_vertical_scrollbar(&b->vbar, b->x + b->width - b->vbar.width - 1, b->y + 1);
- gui_resize_vertical_scrollbar(&b->vbar, b->vbar.width, b->height - 2);
- if (!(b->flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR))
- {
- b->edit_width -= b->vbar.width;
- }
- b->flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
- gui_show_multi_line_input_box(b); /* show multiline input box */
- b->flags &= ~UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_test_overflow
- * DESCRIPTION
- * check for overflow of multiline input box
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * RETURNS
- * byte
- *****************************************************************************/
- U8 gui_multi_line_input_box_test_overflow(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((b->last_position_p - b->text) >= (b->available_length))
- {
- return (1);
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_test_first_position
- * DESCRIPTION
- * check forif cursor is at first position of multiline input box
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * RETURNS
- * byte
- *****************************************************************************/
- U8 gui_multi_line_input_box_test_first_position(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (b->cursor_p == b->text)
- {
- return (1);
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_test_last_position
- * DESCRIPTION
- * check forif cursor is at last position of multiline input box
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * RETURNS
- * byte
- *****************************************************************************/
- U8 gui_multi_line_input_box_test_last_position(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type dummy_c = 0;
- UI_buffer_type current_text_p = b->cursor_p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_STRING_GET_NEXT_CHARACTER(current_text_p, dummy_c);
- UI_UNUSED_PARAMETER(dummy_c);
- if (current_text_p == b->last_position_p)
- {
- return (1);
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_test_last_position_overflow
- * DESCRIPTION
- * check forif cursor is at last position of multiline input box
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * RETURNS
- * byte
- *****************************************************************************/
- U8 gui_multi_line_input_box_test_last_position_overflow(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 flag1 = 0;
- U8 flag2 = 0;
- UI_character_type dummy_c = 0;
- UI_buffer_type current_text_p = b->cursor_p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_STRING_GET_NEXT_CHARACTER(current_text_p, dummy_c);
- UI_UNUSED_PARAMETER(dummy_c);
- if (current_text_p == b->last_position_p)
- {
- flag1 = 1;
- }
- if ((b->last_position_p - b->text) >= (b->available_length))
- {
- flag2 = 1;
- }
- if (flag1 && flag2)
- {
- return (1);
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_get_text_length
- * DESCRIPTION
- * return the text length of multiline input box
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * RETURNS
- * byte
- *****************************************************************************/
- S32 gui_multi_line_input_box_get_text_length(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (((b->text_length) >> 1) - 1);
- }
- #if defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__)
- /****************WCSS Related Functions***********************/
- /* Cursor position previously set by WCSS editor.
- This variable is used to avoid unnecessary input method switching
- when cursor is not moved. */
- static UI_buffer_type WCSS_cursor_pos = NULL;
- extern U8 *cat115buffer;
- extern void change_input_mode(void);
- extern void (*inputbox_change_mode) (void);
- extern void change_multiline_inputbox_input_mode(void);
- /* Set # Key Depeding Upon The Value Of Status Parameter. */
- /*****************************************************************************
- * FUNCTION
- * gui_set_WCSS_input_method_change_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * status [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void gui_set_WCSS_input_method_change_handler(U8 status)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (status)
- {
- SetKeyHandler(wgui_handle_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- }
- else
- {
- SetKeyHandler(UI_dummy_function, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = UI_dummy_function;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_reset_WCSS_cursor_position
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void gui_reset_WCSS_cursor_position(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- WCSS_cursor_pos = NULL;
- }
- /* Change the input method on cursor movement. */
- /*****************************************************************************
- * FUNCTION
- * gui_change_WCSS_input_method
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_change_WCSS_input_method(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!(b->flags & UI_MULTI_LINE_WCSS_INPUT_BOX_ENABLE))
- {
- return;
- }
- /* Prevent gui_show_multi_line_input_box() invokes this function recursively */
- WCSS_input_change_enable = 0;
- while (WCSS_cursor_pos != b->cursor_p &&
- (b->cursor_p - b->text) < (b->allocated_length - 2) /* out-of-edit area */ )
- {
- U16 temp_var;
- U8 input_method;
- UI_buffer_type prv_cursor_pos = WCSS_cursor_pos;
- temp_var = ((b->cursor_p - b->text) >> 1);
- /* If c appears in the head of input format */
- if (temp_var == 0)
- {
- while (cat115buffer[temp_var] == 0xFF)
- {
- gui_multi_line_input_box_next(b);
- temp_var = ((b->cursor_p - b->text) >> 1);
- }
- }
- /* Set WCSS_cursor_pos if input mode is chaged here */
- if (MMI_active_multitap == -1 || WCSS_Esc_Char)
- {
- WCSS_cursor_pos = b->cursor_p;
- }
- if (cat115buffer[temp_var] == 0xFF)
- {
- if (MMI_active_multitap == -1 || WCSS_Esc_Char)
- {
- /* It always invokes gui_change_WCSS_input_method again (recursive) */
- if (prv_cursor_pos > b->cursor_p)
- {
- gui_multi_line_input_box_previous(b);
- }
- else
- {
- gui_multi_line_input_box_next(b);
- }
- }
- else
- {
- break;
- }
- }
- temp_var = ((b->cursor_p - b->text) >> 1);
- input_method = cat115buffer[temp_var] & 0x1F;
- if (MMI_active_multitap == -1 || WCSS_Esc_Char)
- {
- /* If switch from 'm' to 'm', do not switch input method automatically. */
- if (!(cat115buffer[temp_var] & PIXTEL_UI_ALL_INPUT_METHODS_ALLOWED) ||
- !prv_cursor_pos ||
- !(cat115buffer[(prv_cursor_pos - b->text) >> 1] & PIXTEL_UI_ALL_INPUT_METHODS_ALLOWED))
- {
- /* If entry category115 from history (prv_cursor_pos = WCSS_cursor_pos was set to NULL),
- we should not change the input method according the WCSS input format string to
- keep the previous input method in history */
- if (prv_cursor_pos /* not first time in category screen */ ||
- is_fisrt_entry_WCSS_editor /* input method was not set in history */ )
- {
- if (MMI_current_input_mode != (input_method & (~PIXTEL_UI_WCSS_STAR_INPUT)))
- {
- MMI_current_input_mode = input_method & (~PIXTEL_UI_WCSS_STAR_INPUT);
- change_multiline_inputbox_mode(MMI_current_input_mode);
- set_MMI_current_input_type();
- change_multiline_information_bar_input_method();
- }
- }
- is_fisrt_entry_WCSS_editor = MMI_FALSE;
- /* Fix for 'N'. */
- if (MMI_current_input_type == INPUT_TYPE_NUMERIC_CHANGEABLE)
- {
- ClearKeyHandler(KEY_STAR, KEY_EVENT_UP);
- ClearKeyHandler(KEY_STAR, KEY_EVENT_DOWN);
- /* Tricky. set_MMI_current_input_type() change INPUT_MODE_123 to INPUT_TYPE_NUMERIC_CHANGEABLE */
- MMI_current_input_type = INPUT_TYPE_NUMERIC;
- }
- }
- if (((input_method & 0xFF) == INPUT_MODE_MULTITAP_UPPERCASE_ABC || (input_method & 0xFF) == INPUT_MODE_MULTITAP_LOWERCASE_ABC) && cat115buffer[temp_var] & PIXTEL_UI_ALL_INPUT_METHODS_ALLOWED) /* 'm' and 'M', not 'x' or 'X' */
- {
- MMI_allow_only_english_input_modes = 1; /* Only support english input */
- gui_set_WCSS_input_method_change_handler(1);
- }
- else
- {
- gui_set_WCSS_input_method_change_handler(0);
- }
- WCSS_Esc_Char = 0;
- }
- if (cat115buffer[((b->cursor_p - b->text) >> 1)] != 0xFF)
- {
- break;
- }
- }
- /* hjf: set again because cursor position is changed */
- if (MMI_active_multitap == -1 || WCSS_Esc_Char)
- WCSS_cursor_pos = b->cursor_p;
- WCSS_input_change_enable = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_WCSS_check_next_multitap_input
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 gui_WCSS_check_next_multitap_input(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 temp_var;
- U8 input_method;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temp_var = ((b->cursor_p - b->text) >> 1);
- while (cat115buffer[temp_var] == 0xFF)
- {
- temp_var++;
- }
- input_method = cat115buffer[temp_var] & 0x1F;
- if (input_method == INPUT_MODE_123 || input_method == INPUT_MODE_123_SYMBOLS) /* Add Here Other Input Method For Which Multitap is not require. */
- {
- return 0;
- }
- else
- {
- return 1;
- }
- }
- //Wrapper function for WCSS_input_change_enable Variable use to Enable Input Method Change
- //While deleting the characters.
- /*****************************************************************************
- * FUNCTION
- * gui_WCSS_input_method_change_enable
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- U8 gui_WCSS_input_method_change_enable(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return WCSS_input_change_enable;
- }
- /****************************WCSS Related Functions**************************/
- #endif /* defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__) */
- /* Set The Editor Chnaged Variable To True On Contents Change. */
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_change
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_multi_line_input_box_change(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->editor_changed = 1;
- }
- /* bar code */
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_go_to_hilite
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * idx [IN]
- * by_pen [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_multi_line_input_box_go_to_hilite(multi_line_input_box *b, U16 idx, MMI_BOOL need_scroll_to_pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (idx <= b->hilite_str_number - 1)
- {
- b->highlight_start_position = (UI_buffer_type) (b->hilite_list[idx].str_addr);
- b->highlight_end_position = (UI_buffer_type) (b->hilite_list[idx].str_addr + b->hilite_list[idx].length * 2);
- }
- b->flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
- gui_show_multi_line_input_box(b); /* show multiline input box */
- b->flags &= ~UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
- if (need_scroll_to_pos)
- {
- if(b->text_height > b->edit_height)
- {
- S32 highy = -b->curr_hilite_text_offset_y;
- S32 oy = -b->text_offset_y;
- //b->text_offset_y = b->curr_hilite_text_offset_y;
- // check if highlight begin is above the windows begin
- if( highy < oy)
- {
- // move window begin to highlight begin
- b->text_offset_y = b->curr_hilite_text_offset_y;
- }
- // check if highlight end is below the window end
- else if(oy+b->edit_height < highy + b->max_line_height*2)
- {
- // move window begin to the hightlight end - window height
- b->text_offset_y = - ( highy + b->max_line_height*2 -b->edit_height);
- }
- }
- }
- gui_show_multi_line_input_box(b);
- gui_BLT_double_buffer(b->x, b->y, b->x + b->width, b->y + b->height);
- b->hilite_cb(b->current_hilite_idx);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_go_to_pre_hilite
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_multi_line_input_box_go_to_pre_hilite(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (b->current_hilite_idx > 0)
- {
- b->current_hilite_idx--;
- b->highlight_start_position = (UI_buffer_type) (b->hilite_list[b->current_hilite_idx].str_addr);
- b->highlight_end_position =
- (UI_buffer_type) (b->hilite_list[b->current_hilite_idx].str_addr +
- b->hilite_list[b->current_hilite_idx].length * 2);
- }
- b->flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
- gui_show_multi_line_input_box(b); /* show multiline input box */
- b->flags &= ~UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
- if(b->text_height > b->edit_height)
- {
- b->text_offset_y = b->curr_hilite_text_offset_y;
- }
- gui_show_multi_line_input_box(b);
- gui_BLT_double_buffer(b->x, b->y, b->x + b->width, b->y + b->height);
- b->hilite_cb(b->current_hilite_idx);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_go_to_next_hilite
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_multi_line_input_box_go_to_next_hilite(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (b->current_hilite_idx < b->hilite_str_number - 1)
- {
- b->current_hilite_idx++;
- b->highlight_start_position = (UI_buffer_type) (b->hilite_list[b->current_hilite_idx].str_addr);
- b->highlight_end_position =
- (UI_buffer_type) (b->hilite_list[b->current_hilite_idx].str_addr +
- b->hilite_list[b->current_hilite_idx].length * 2);
- }
- b->flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
- gui_show_multi_line_input_box(b); /* show multiline input box */
- b->flags &= ~UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
- if(b->text_height > b->edit_height)
- {
- b->text_offset_y = b->curr_hilite_text_offset_y;
- }
- gui_show_multi_line_input_box(b);
- gui_BLT_double_buffer(b->x, b->y, b->x + b->width, b->y + b->height);
- b->hilite_cb(b->current_hilite_idx);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_is_pos_inside_hilite_ext
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * current_pos [IN]
- * hilite_idx [?]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL gui_multi_line_input_box_is_pos_inside_hilite_ext(
- multi_line_input_box *b,
- UI_buffer_type current_pos,
- U16 *hilite_idx)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 hilite_no = b->hilite_str_number;
- U16 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < hilite_no; i++)
- {
- if (((S8*)current_pos >= b->hilite_list[i].str_addr) &&
- ((S8*)current_pos < b->hilite_list[i].str_addr + b->hilite_list[i].length * 2))
- {
- *hilite_idx = i;
- return MMI_TRUE;
- }
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_is_pos_inside_hilite
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * current_pos [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL gui_multi_line_input_box_is_pos_inside_hilite(multi_line_input_box *b, UI_buffer_type current_pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 hilite_idx = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (gui_multi_line_input_box_is_pos_inside_hilite_ext(b, current_pos, &hilite_idx));
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multi_line_input_box_is_pen_down_in_hilite
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL gui_multi_line_input_box_is_pen_down_in_hilite(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_buffer_type current_pos = b->cursor_p;
- U16 idx = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gui_multi_line_input_box_is_pos_inside_hilite_ext(b, current_pos, &idx))
- {
- b->current_hilite_idx = idx;
- return MMI_TRUE;
- }
- else
- {
- return MMI_FALSE;
- }
- }
- /***Ritesh started here***/
- #ifdef __UI_PAGING_IN_MULTILINE_EDITOR__
- /*****************************************************************************
- * FUNCTION
- * gui_paging_multi_line_input_box_get_next_page_callback
- * DESCRIPTION
- * callback function for demand of next page by multiline editor
- * PARAMETERS
- * b [IN] (instance of multi_line_input_box)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_paging_multi_line_input_box_get_next_page_callback(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 page_index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memcpy(b->text, b->page_details[PAGE_ZERO].shared_data, b->page_details[PAGE_ZERO].shared_no_of_bytes);
- for (page_index = 0; page_index < GUI_NO_OF_PAGES - 1; page_index++)
- {
- memcpy(
- b->text + (GUI_PAGE_SIZE_IN_UCS2 * page_index) + b->page_details[PAGE_ZERO].shared_no_of_bytes,
- b->text + b->previous_shared_bytes + (GUI_PAGE_SIZE_IN_UCS2 * (page_index + 1)),
- GUI_PAGE_SIZE_IN_UCS2);
- }
- b->previous_shared_bytes = b->page_details[PAGE_ZERO].shared_no_of_bytes;
- b->start_id++;
- b->end_id++;
- b->page_details[PAGE_ZERO].page_id = b->start_id;
- gui_paging_multiline_input_box_get_page(
- b->end_id,
- b->end_id,
- b->text + (GUI_PAGE_SIZE_IN_UCS2 * PAGE_THREE) + b->page_details[PAGE_ZERO].shared_no_of_bytes);
- show_multiline_inputbox_no_draw();
- }
- /*****************************************************************************
- * FUNCTION
- * gui_paging_multi_line_input_box_get_previous_page_callback
- * DESCRIPTION
- * callback function for previous page
- * PARAMETERS
- * b [IN] (instance of multi_line_input_box)
- * RETURNS
- * void
- *****************************************************************************/
- void gui_paging_multi_line_input_box_get_previous_page_callback(multi_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 page_index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (b->page_details[0].page_id > 0)
- {
- b->page_zero_prev_height = b->page_details[PAGE_ZERO].page_height;
- for (page_index = GUI_NO_OF_PAGES - 1; page_index != 0; page_index--)
- {
- memcpy(
- b->text + (GUI_PAGE_SIZE_IN_UCS2 * page_index) + b->previous_shared_bytes,
- b->text + (b->previous_shared_bytes * ENCODING_LENGTH) + (GUI_PAGE_SIZE_IN_UCS2 * (page_index - 1)),
- GUI_PAGE_SIZE_IN_UCS2 - b->previous_shared_bytes);
- memcpy(
- b->text + (GUI_PAGE_SIZE_IN_UCS2 * page_index),
- b->text + (GUI_PAGE_SIZE_IN_UCS2 * (page_index - 1)) + b->previous_shared_bytes,
- b->previous_shared_bytes);
- }
- gui_paging_multiline_input_box_get_page(b->start_id - 1, b->start_id - 1, b->text);
- b->previous_shared_bytes = 0;
- show_multiline_inputbox_no_draw();
- b->start_id--;
- b->end_id--;
- }
- }
- #endif /* __UI_PAGING_IN_MULTILINE_EDITOR__ */
- /***** ritesh ended here*****/
- /*****************************************************************************
- * FUNCTION
- * gui_show_multi_line_input_box
- * DESCRIPTION
- * Displays the multi-line inputbox
- * PARAMETERS
- * b [IN] Is the multi-line inputbox object
- * RETURNS
- * void
- *****************************************************************************/
- extern U8 EMS_object_width_cache[];
- extern U8 EMS_object_height_cache[];
- extern U16 EMS_object_str_cache[];
- /* Gurinder - Extern Decleration - 15/4/2004 */
- extern void (*wgui_inline_edit_DONE_function) (void);
- //START FARHAD PMT 20050211
- //START TARUN PMT 20050128
- //#ifdef __MMI_HINDI_ALG__
- //extern BOOL cancelWidth;
- //#endif
- //END TARUN PMT 20050128
- //END FARHAD PMT 20050211
- //MTK modify for stacked character
- //START PMTFARHAD 20050224
- #if defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__)
- extern S32 HINDI_PRESENT;
- extern S32 ARABIC_PRESENT;
- #endif /* defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__) */
- /* END PMTFARHAD 20050224 */
- void gui_show_multi_line_input_box(multi_line_input_box *b)
- {
- gui_show_multi_line_input_box_ext(b, (-1), (-1));
- }
- /*****************************************************************************
- * FUNCTION
- * gui_show_multi_line_input_box_ext
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * move_to_x [IN]
- * move_to_y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_show_multi_line_input_box_ext(multi_line_input_box *b, S32 move_to_x, S32 move_to_y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1; /* x1,y1 -> left-top corner of the editor windows */
- S32 x2, y2; /* x2,y2 -> right-bottom of the editor windows */
- UI_buffer_type current_text_p, line_start_text_p, line_break_text_p;
- UI_buffer_type previous_line_start_text_p, previous_text_p = NULL;
- UI_buffer_type current_cursor_p = b->cursor_p; /* points to the character at which the cursor is positioned */
- UI_buffer_type previous_cursor_p = b->cursor_p;
- pBOOL is_cursor_show = MMI_FALSE; //hjf , to avoid cursor to display two place. for BIDI, some case will cause two cursor
- S32 character_width = 0, character_height;
- UI_character_type current_character = 0, pre2_character = 0, pre_character = 0, dummy_c = 0;
- S32 text_gap = b->text_gap;
- S32 tx = 0, ty, xx, yy, temp_d;
- color selector_color = b->selector_color;
- color selected_text_color = b->selected_text_color;
- S32 reserve_line_height_for_hilite; // hjf, using in barcode
- S32 current_line_width, previous_line_width;
- S32 current_line_height=0, previous_line_height, saved_line_height = 1;
- S32 current_line_character_counter = 0;
- S32 current_line_break_character_counter;
- U8 done = 0;
- S32 edit_width, edit_height;
- U8 *character_widths_cache = EMS_object_width_cache;
- U8 *character_heights_cache = EMS_object_height_cache;
- U16 *character_str_cache = EMS_object_str_cache;
- U32 flags = b->flags;
- U8 break_character_flag;
- S32 line_counter = 0;
- U8 multitap_flag = 0;
- U8 overwrite_flag = 0;
- S32 set_cursor_flag = 0;
- UI_buffer_type temp_text_p;
- U8 next_line_found_flag = 0;
- S32 mask_character_width = 0, mask_character_height;
- U8 word_highlight = 0;
- S32 xtx, yty = 0;
- S32 l_clip = 0;
- PMT_BIDI_TYPES default_direction = BIDI_L;
- S32 vbar_x = 0, vbar_button_x = 0;
- gui_input_richtext_struct rich_text;
- #if defined(__UI_PAGING_IN_MULTILINE_EDITOR__)
- U8 shared_data_count, check_flag = 0;
- #endif
- /* PMT LANGUAGE START 20051221 */
- #if defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__)
- U16 unicode = 0;
- U16 clFill = 0;
- #endif /* defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__) */
- //PMT LANGUAGE END 20051221
- //MTK Arabic connectivity issue
- #if defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__
- UI_buffer_type temp_p;
- UI_character_type next_char = 0;
- S32 nLen;
- #endif /* defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__ */
- /* MTK end */
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_EDITOR__
- S32 image_width, image_height;
- #endif
- /* PMT VIKAS END 20050707 */
- #ifdef __MMI_BIDI_ALG__
- U16 logical_cur_pos;
- U8 *temp_text_pt;
- U8 *temp_cursor_p;
- U8 *temp_pre_cursor_p;
- U16 visual_str_len;
- U16 visual_cur_pos;
- U16 logical_hilight_start;
- U16 logical_hilight_end;
- U16 visual_hilight_start;
- U16 visual_hilight_end;
- UI_buffer_type temp_hilight_start;
- UI_buffer_type temp_hilight_end;
- PMT_BIDI_TYPES default_line_direction = BIDI_L;
- pBOOL reverse_flag;
- S32 num_char;
- U32 iCount;
- pBOOL arabic_char_flag = MMI_FALSE;
- U8 lastest_char_type;
- UI_character_type test_current_character;
- /* PMT NO_AR_SL_DU START 20050909 */
- S32 text_len;
- PU8 ptr_text_buffer;
- pBOOL BIDI_done_flag = MMI_FALSE;
- UI_buffer_type saved_current_text_p;
- /* MTK begin chat issue 2005.10.27 */
- #ifdef __MMI_MESSAGES_CHAT__
- pBOOL Show_Chat_NickName = MMI_FALSE;
- #endif
- /* MTK End */
- #endif /* __MMI_BIDI_ALG__ */
- BOOL draw_separator; /* Used by UI_MULTI_LINE_INPUT_BOX_DRAW_SEPARATOR */
- /* MTK for Chinese Characters Display */
- U8 break_flag;
- /* MTK end */
- S32 current_cluster_width = 0;
- #ifdef __MMI_HINDI_ALG__
- U16 disp_cluster[MAX_EDITOR_DISP_LEN];
- /* START FARHAD PMT 20050211 */
- PU8 temp_hindi_cursor_p = b->text;
- /* END FARHAD PMT 20050211 */
- S32 cluster_width = 0;
- S32 cursor_width = 0;
- PU8 move_cursor_prev_p = b->text;
- PU8 move_cursor_curr_p = b->text;
- PU8 move_cursor_disp_prev_p = b->text;
- PU8 move_cursor_disp_curr_p = b->text;
- S32 skip_moves = 1; /* for skipping by cluster */
- S32 saved_skip_moves = 1;
- S32 display_skip_moves = 1; /* for skipping by cluster while display */
- S32 saved_display_skip_moves = 0;
- S32 hindi_cluster_counter;
- UI_buffer_type hindi_line_brk_p;
- S32 cluster_width_filler[50];
- S32 cluster_filler_count = 0;
- #endif /* __MMI_HINDI_ALG__ */
- /****** ritesh started here****/
- #if defined(__UI_PAGING_IN_MULTILINE_EDITOR__)
- U8 count_flag = 0; /*jump_to_offset_flag = 0;*/
- S32 total_page_height = 0; /* ritesh */
- S32 char_count = 0;
- U8 page_index = 0;
- #endif /* defined(__UI_PAGING_IN_MULTILINE_EDITOR__) */
- /***** ritesh ended here****/
- #if defined(__MMI_LANG_VIETNAMESE__)
- /* U16 next_unicode = 0; */
- viet_tone_mark tone_mark = VIET_TONE_NONE;
- viet_vowel_letter viet_vowel = VIET_VOWEL_NONE;
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PMT RAKESH START 20061006 */
- #if defined __MMI_HINDI_ALG__
- overwrite_current_language_for_hindi_rules_based_on_input_method();
- #endif
- /* PMT RAKESH END 20061006 */
- #if defined(__UI_PAGING_IN_MULTILINE_EDITOR__)
- b->edit_height_displayed_lines = 0; /* ritesh */
- #endif
- if(b->hilite_cb)
- reserve_line_height_for_hilite = 1;
- else
- reserve_line_height_for_hilite = 0;
- #if defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__)
- HINDI_PRESENT = 0;
- ARABIC_PRESENT = 0;
- while ((b->text[clFill] != ' ' || b->text[clFill + 1] != ' ') && !HINDI_PRESENT)
- {
- unicode = b->text[clFill];
- unicode |= (b->text[clFill + 1] << 8);
- if (UI_HINDI_CHARACTER_UCS2_RANGE(unicode))
- {
- HINDI_PRESENT = 1;
- ARABIC_PRESENT = 0;
- }
- else if (IS_ARABIC_CHARACTER(unicode))
- {
- ARABIC_PRESENT = 1;
- HINDI_PRESENT = 0;
- }
- clFill += 2;
- clFill += 2;
- }
- #endif /* defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__) */
- #if defined (__MMI_LANG_ARABIC__) || defined (__MMI_LANG_PERSIAN__)
- if ((b->text_length / ENCODING_LENGTH) - 1 != 0)
- {
- if (!(b->flags & UI_MULTI_LINE_INPUT_BOX_VIEW_MODE || (b->flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW)))
- {
- pfnUnicodeStrncpy((S8*) shaping_str, (const S8*)b->text, (b->text_length / ENCODING_LENGTH) - 1);
- unshaped_text_len = text_len = (b->text_length / 2) - 1;
- OrgToSha[text_len] = 0xffff;
- #ifdef __MMI_ZI__
- #ifdef __MMI_ZI_V7__
- #if defined(__MMI_ZI_ARABIC__) && defined(__MMI_ZI_PERSIAN__)
- ZiStringShapeEx(ZI8_LANG_FA, (U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL); /* 19 is the Arabic id */
- #elif defined(__MMI_ZI_PERSIAN__)
- ZiStringShapeEx(ZI8_LANG_FA, (U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL); /* 19 is the Arabic id */
- #elif defined(__MMI_ZI_ARABIC__)
- ZiStringShapeEx(ZI8_LANG_AR, (U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL); /* 19 is the Arabic id */
- #endif
- #else /* __MMI_ZI_V7__ */
- ArabicStringShape2((U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL);
- #endif /* __MMI_ZI_V7__ */
- #else /* __MMI_ZI__ */
- ArabicShapeEngine2((U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL);
- #endif /* __MMI_ZI__ */
- }
- else
- {
- pfnUnicodeStrncpy((S8*) shaping_str, (const S8*)b->text, (b->text_length / ENCODING_LENGTH) - 1);
- unshaped_text_len = text_len = (b->text_length / 2) - 1;
- OrgToSha[text_len] = 0xffff;
- #ifdef __MMI_ZI__
- #ifdef __MMI_ZI_V7__
- #if defined(__MMI_ZI_ARABIC__) && defined(__MMI_ZI_PERSIAN__)
- ZiStringShapeEx(ZI8_LANG_FA, (U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL); /* 19 is the Arabic id */
- #elif defined(__MMI_ZI_PERSIAN__)
- ZiStringShapeEx(ZI8_LANG_FA, (U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL); /* 19 is the Arabic id */
- #elif defined(__MMI_ZI_ARABIC__)
- ZiStringShapeEx(ZI8_LANG_AR, (U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL); /* 19 is the Arabic id */
- #endif
- #else /* __MMI_ZI_V7__ */
- ArabicStringShape2((U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL);
- #endif /* __MMI_ZI_V7__ */
- #else /* __MMI_ZI__ */
- ArabicShapeEngine2((U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL);
- #endif /* __MMI_ZI__ */
- #ifdef __MMI_HINDI_ALG__
- move_cursor_prev_p = b->text;
- move_cursor_curr_p = b->text;
- move_cursor_disp_prev_p = b->text;
- move_cursor_disp_curr_p = b->text;
- #endif /* __MMI_HINDI_ALG__ */
- }
- }
- #endif /* defined (__MMI_LANG_ARABIC__) || defined (__MMI_LANG_PERSIAN__) */
- /* #if defined __MMI_LANG_HINDI__ && defined __MMI_LANG_ARABIC__
- U16 unicode = 0;
- U16 clFill = 0;
- HINDI_PRESENT = 0;
- ARABIC_PRESENT = 0;
- while( (b->text[clFill] != ' ' || b->text[clFill+1] != ' ') && !HINDI_PRESENT )
- {
- unicode = b->text[clFill];
- unicode |= (b->text[clFill+1]<<8);
- if(UI_HINDI_CHARACTER_UCS2_RANGE(unicode))
- {
- HINDI_PRESENT = 1;
- ARABIC_PRESENT = 0;
- }
- clFill+=2;
- }
- #endif */
- //PMT LANGUAGE END 20051221
- //END PMTFARHAD 20050224
- /* Current implementation does not support icon_callback on overwrite mode */
- MMI_DBG_ASSERT(!(flags & UI_MULTI_LINE_INPUT_BOX_OVERWRITE_MODE) || !b->icon_callback);
- /* Setup rich text context */
- MMI_DBG_ASSERT((flags & UI_MULTI_LINE_INPUT_BOX_VIEW_MODE) || !(flags & UI_MULTI_LINE_INPUT_BOX_RICHTEXT));
- rich_text.default_color = rich_text.curr_color = b->normal_text_color;
- /* USAT */
- rich_text.default_text_bg_color = rich_text.curr_text_bg_color = gui_richtext_default_text_bg_color;
- rich_text.draw_text_bg_color = 0;
- if (flags & UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY)
- {
- rich_text.default_alignment = GUI_INPUT_ALIGN_CENTER;
- }
- else if (flags & UI_MULTI_LINE_INPUT_BOX_RIGHT_JUSTIFY)
- {
- rich_text.default_alignment = GUI_INPUT_ALIGN_RIGHT;
- }
- else
- {
- rich_text.default_alignment = GUI_INPUT_ALIGN_LEFT;
- }
- rich_text.curr_alignment = rich_text.default_alignment;
- rich_text.line_begin_font = rich_text.curr_font = *b->text_font;
- rich_text.line_begin_border = rich_text.curr_border = 0;
- /* USAT */
- rich_text.line_begin_strikethrough = rich_text.curr_strikethrough = 0;
- rich_text.more_line_spacing = 0;
- rich_text.line_separator = 0;
- /* Setup runtime variables */
- if (r2lMMIFlag)
- {
- if (b->flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR)
- {
- x1 = b->x;
- }
- else if (b->flags & UI_MULTI_LINE_INPUT_BOX_AUTO_DISABLE_SCROLLBAR)
- {
- if (b->vbar.scale < b->vbar.range)
- {
- x1 = b->x + b->vbar.width;//hjf it should not - 5;
- }
- else
- {
- x1 = b->x;
- }
- }
- else
- {
- x1 = b->x + b->vbar.width;//hjf it should not - 5;
- }
- }
- else
- {
- x1 = b->x;
- }
- y1 = b->y;
- x2 = b->x + b->width - 1; /* b->width contains the width of vbar */
- y2 = y1 + b->height - 1;
- edit_width = b->edit_width;
- edit_height = b->edit_height;
- if (((-1) != move_to_x) || ((-1) != move_to_y))
- {
- flags &= ~UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
- }
- #ifdef __MMI_HINDI_ALG__
- memset(disp_cluster, 0, sizeof(disp_cluster));
- #endif
- #if defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__)
- /*
- * Evertime the cursor position is changed, GUI will invoke the current function,
- * there is no other place to hook it cleanly.
- * However, it's protected by the flag UI_MULTI_LINE_WCSS_INPUT_BOX_ENABLE
- */
- if (b->flags & UI_MULTI_LINE_WCSS_INPUT_BOX_ENABLE && gui_WCSS_input_method_change_enable())
- {
- /* gui_change_WCSS_input_method() will change cursor position */
- gui_change_WCSS_input_method(b);
- current_cursor_p = b->cursor_p;
- previous_cursor_p = b->cursor_p;
- }
- #endif /* defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__) */ /* MMI_WCSS_INPUT_FORMAT_SUPPORT_ */
- /* Pixtel - Gurinder 2/4/6 - Use Auto Scrollbar if current multi line box is Inscreen */
- #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
- if (MMI_multi_line_inputbox_present)
- {
- b->flags |= UI_MULTI_LINE_INPUT_BOX_AUTO_DISABLE_SCROLLBAR;
- b->flags |= UI_MULTI_LINE_INPUT_BOX_INSIDE_INLINE_MENU;
- l_clip = y2 - (MMI_content_height + MMI_content_y - 1);
- if (l_clip < 0)
- {
- l_clip = 0;
- }
- }
- #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */
- if (!(flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW)) /* If not disable draw then do it.. */
- {
- UI_filled_area f;
- S32 l_height = 0;
- if (flags & UI_MULTI_LINE_INPUT_BOX_STATE_FOCUSSED)
- {
- f = *b->focussed_filler;
- rich_text.default_color = rich_text.curr_color = b->focussed_text_color;
- }
- else if (flags & UI_MULTI_LINE_INPUT_BOX_STATE_DISABLED)
- {
- f = *b->disabled_filler;
- rich_text.default_color = rich_text.curr_color = b->disabled_text_color;
- }
- else
- {
- f = *b->normal_filler;
- rich_text.default_color = rich_text.curr_color = b->normal_text_color;
- }
- #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
- if (MMI_multi_line_inputbox_present == 1)
- {
- /* Inline Multiline Edit Infobar Height Change. - Gurinder - 12/5/2004 */
- l_height = INFORMATION_BAR_HEIGHT + 2;
- /* Gurinder 7/14/2004 - Inscreen Multiline Title Enable/Disable */
- #if(!INSCREEN_MUTLILINE_TITLE_ENABLE)
- if (b->flags & UI_MULTI_LINE_INPUT_BOX_VIEW_MODE)
- {
- l_height = 0;
- }
- #endif /* (!INSCREEN_MUTLILINE_TITLE_ENABLE) */
- }
- #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */
- gui_push_clip();
- if (flags & UI_MULTI_LINE_INPUT_BOX_USE_PRESET_CLIPPING)
- {
- gui_set_clip_preset(b->x, y1 - l_height, x2 + 2, y2 + 2 - l_clip);
- }
- else
- {
- /* MTK Terry instead y2+1-l_clip with y2-l_clip for overlap soft key area */
- gui_set_clip(b->x, y1 - l_height, x2 + 2, y2 - l_clip);
- }
- if (!(flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND)) /* if not disable background then do .. */
- {
- if (!(flags & UI_MULTI_LINE_INPUT_BOX_INCLUDE_INFO_AREA)) /* if not include info_area then do .. */
- {
- /* Draw standard background filler */
- /* 070405 Calvin Start */
- if (r2lMMIFlag)
- {
- if ((wgui_is_wallpaper_on_bottom() == MMI_TRUE) &&
- (flags & UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND))
- {
- gdi_draw_solid_rect(b->x, y1 - l_height, x2 /* +b->vbar.width */ , y2, GDI_COLOR_TRANSPARENT);
- }
- else
- {
- gui_draw_filled_area(b->x, y1 - l_height, x2 /* +b->vbar.width */ , y2, &f);
- }
- }
- else
- {
- if ((wgui_is_wallpaper_on_bottom() == MMI_TRUE) &&
- (flags & UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND))
- {
- gdi_draw_solid_rect(x1, y1 - l_height, x2, y2, GDI_COLOR_TRANSPARENT);
- }
- else
- {
- gui_draw_filled_area(x1, y1 - l_height, x2, y2, &f);
- }
- }
- /* 070405 Calvin End */
- /*
- * Draw b->text_filler for text area only.
- * (typically when b->header_height or b->footer_callback is non-zero)
- */
- if (b->text_filler)
- {
- /*
- * This filler can only be used in View Mode such that b->text_height can be pre-computed
- * * at the first time in something like show_multiline_inputbox_no_draw().
- */
- S32 text_border_y1, text_border_y2;
- MMI_DBG_ASSERT((flags & UI_MULTI_LINE_INPUT_BOX_VIEW_MODE) != 0 && l_clip == 0);
- text_border_y1 = y1 + b->text_y + b->text_offset_y + b->header_height - 1;
- text_border_y2 = y1 + b->text_y + b->text_offset_y + b->text_height - b->footer_height;
- /* If text_height is large, we should shrink the filling area */
- if (text_border_y1 < 0)
- {
- text_border_y1 = 0;
- }
- if (text_border_y2 >= UI_device_height)
- {
- text_border_y2 = UI_device_height - 1;
- }
- gui_push_clip();
- if ((f.flags & UI_FILLED_AREA_DOUBLE_BORDER) == UI_FILLED_AREA_DOUBLE_BORDER)
- {
- gui_set_clip(x1 + 2, y1 + 2, x2 - 2, y2 - 2);
- }
- else if (f.flags & UI_FILLED_AREA_BORDER)
- {
- gui_set_clip(x1 + 1, y1 + 1, x2 - 1, y2 - 1);
- }
- gui_draw_filled_area(
- x1 + b->text_x + b->text_offset_x - 1,
- text_border_y1,
- x1 + b->text_x + b->text_offset_x + b->edit_width,
- text_border_y2,
- b->text_filler);
- gui_pop_clip();
- }
- }
- else /* if including info_area then do .. */
- {
- gui_set_clip(b->x, y1 - wgui_inputbox_information_bar_height - l_height, x2, y2 - l_clip);
- f.flags = UI_FILLED_AREA_TYPE_BITMAP;
- f.b = get_image(WGUI_VOLUME_LEVEL1); /* test */
- /* 070405 Calvin Start */
- if ((wgui_is_wallpaper_on_bottom() == MMI_TRUE) &&
- (flags & UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND))
- {
- gdi_draw_solid_rect(
- b->x,
- y1 - wgui_inputbox_information_bar_height - l_height,
- x2,
- y2,
- GDI_COLOR_TRANSPARENT);
- }
- else
- {
- gui_draw_filled_area(b->x, y1 - wgui_inputbox_information_bar_height - l_height, x2, y2, &f);
- }
- /* 070405 Calvin End */
- if (r2lMMIFlag)
- {
- gui_draw_rectangle(b->x, y1 - l_height, x2 /* +b->vbar.width */ , y2, b->boundary_color);
- }
- else
- {
- gui_draw_rectangle(x1, y1 - l_height, x2, y2, b->boundary_color);
- }
- if (flags & UI_MULTI_LINE_INPUT_BOX_USE_PRESET_CLIPPING)
- {
- gui_set_clip_preset(x1, y1 - l_height, x2 + 2, y2 + 2 - l_clip);
- }
- else
- {
- gui_set_clip(x1, y1 - l_height, x2 + 2, y2 + 2 - l_clip);
- }
- }
- }
- #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
- if (MMI_multi_line_inputbox_present)
- {
- /* Gurinder 6/5/2004 - Show Information Bar / Caption String */
- if (!(b->flags & UI_MULTI_LINE_INPUT_BOX_VIEW_MODE))
- {
- //Show Information Bar
- //START TARUN PMT 20040927 ADDED : Check the flag before redrawing the info bar
- if (wgui_inputbox_information_flag)
- {
- wgui_redraw_input_information_bar();
- }
- /* END TARUN PMT 20040927 */
- }
- #if(INSCREEN_MUTLILINE_TITLE_ENABLE)
- /* Gurinder 7/14/2004 - Inscreen Multiline Title Enable/Disable */
- else
- {
- /* Show Signature Text.... */
- gui_draw_inscreen_multi_line_input_box_title(x1, y1 - l_height + 1, x2 - 2, y1 - 1);
- }
- #endif /* (INSCREEN_MUTLILINE_TITLE_ENABLE) */
- }
- #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */
- }
- #ifdef __MMI_BIDI_ALG__
- if (!(flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW) && (((b->text_length >> 1) - 1) != 0))
- {
- bidi_get_char_type(b->text, (U8*) & default_direction);
- if (default_direction == BIDI_R || default_direction == AL)
- {
- default_direction = BIDI_R;
- }
- else
- {
- default_direction = BIDI_L;
- }
- for (iCount = 0; iCount < (U32) ((b->text_length >> 1) - 1); iCount++)
- {
- bidi_get_char_type((U8*) (b->text + iCount * ENCODING_LENGTH), (U8*) & lastest_char_type);
- if ((lastest_char_type == AL) || (lastest_char_type == AN) || (lastest_char_type == BIDI_R))
- {
- arabic_char_flag = MMI_TRUE;
- break;
- }
- }
- if (arabic_char_flag)
- {
- /*
- * Tricky: icon is not supported in Arabic because text order is rearranged.
- * Set icon_callback to NULL to disable icon in cursor movement, delete character, and display.
- * Otherwise, we have to modify BIDI to support 'icon_callback'.
- */
- b->icon_callback = NULL;
- }
- }
- #endif /* __MMI_BIDI_ALG__ */
- //hjf recalculate the x boundary
- if (!(flags & UI_EMS_INPUT_BOX_DISABLE_SCROLLBAR))
- {
- x2 -= b->vbar.width;
- }
- edit_width = (x2 - x1 - 2);
- if (b->text != NULL)
- {
- /* START PMTFARHAD 20050224 */
- #if defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__)
- PMT_BIDI_TYPES temp_default_direction = BIDI_L;
- temp_default_direction = default_direction;
- bidi_get_char_type(b->text, (U8*) & default_direction);
- if ((default_direction == AL) || (default_direction == AN) || (default_direction == BIDI_R))
- {
- ARABIC_PRESENT = 1;
- }
- default_direction = temp_default_direction;
- #endif /* defined __MMI_LANG_HINDI__ && defined __MMI_LANG_ARABIC__ */
- /* END PMTFARHAD 20050224 */
- #ifdef __UI_PAGING_IN_MULTILINE_EDITOR__
- if (b->ext_flags & GUI_MULTI_LINE_INPUT_BOX_VIEW_PAGING_MODE)
- {
- switch (b->font_style)
- {
- case FONT_DEFAULT:
- rich_text.curr_font.italic = rich_text.curr_font.bold = 0;
- break;
- case FONT_BOLD:
- rich_text.curr_font.bold = 1;
- rich_text.curr_font.italic = 0;
- break;
- case FONT_ITALIC:
- rich_text.curr_font.italic = 1;
- rich_text.curr_font.bold = 0;
- break;
- }
- }
- #endif /* __UI_PAGING_IN_MULTILINE_EDITOR__ */
- gui_set_font(&rich_text.curr_font); /* set text font */
- previous_line_height = character_height = gui_get_character_height();
- if (b->min_line_height > previous_line_height)
- {
- previous_line_height = character_height = b->min_line_height;
- }
- if (flags & UI_MULTI_LINE_INPUT_BOX_MASK_CHARACTERS)
- {
- gui_measure_character(b->mask_character, &mask_character_width, &mask_character_height);
- }
- /* Setup clipping for text and icon */
- if (!(flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW)) /* if not disable draw then do ... */
- {
- UI_filled_area f;
- S32 clip_x1, clip_y1, clip_x2, clip_y2;
- U32 chk_flags;
- if (flags & UI_MULTI_LINE_INPUT_BOX_STATE_FOCUSSED)
- {
- f = *b->focussed_filler;
- }
- else if (flags & UI_MULTI_LINE_INPUT_BOX_STATE_DISABLED)
- {
- f = *b->disabled_filler;
- }
- else
- {
- f = *b->normal_filler;
- }
- chk_flags = f.flags;
- /* Clipping is poped after the editor has finished drawing */
- gui_push_text_clip();
- gui_push_clip();
- if ((chk_flags & UI_FILLED_AREA_DOUBLE_BORDER) == UI_FILLED_AREA_DOUBLE_BORDER)
- {
- clip_x1 = x1 + 2;
- clip_y1 = y1 + 2;
- clip_x2 = x2 - 2;
- clip_y2 = y2 - ((l_clip > 2) ? l_clip : 2);
- }
- else if (chk_flags & UI_FILLED_AREA_BORDER)
- {
- clip_x1 = x1 + 1;
- clip_y1 = y1 + 1;
- clip_x2 = x2 - 1;
- clip_y2 = y2 - ((l_clip > 1) ? l_clip : 1);
- }
- else
- {
- clip_x1 = x1;
- clip_y1 = y1;
- clip_x2 = x2;
- clip_y2 = y2 - l_clip;
- }
- if (flags & UI_MULTI_LINE_INPUT_BOX_USE_PRESET_CLIPPING)
- {
- gui_set_text_clip_preset(clip_x1, clip_y1, clip_x2, clip_y2);
- gui_set_clip_preset(clip_x1, clip_y1, clip_x2, clip_y2);
- }
- else
- {
- gui_set_text_clip(clip_x1, clip_y1, clip_x2, clip_y2);
- gui_set_clip(clip_x1, clip_y1, clip_x2, clip_y2);
- }
- }
- if (previous_cursor_p != b->text)
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(previous_cursor_p, dummy_c);
- }
- previous_line_start_text_p = line_start_text_p = b->text;
- if (flags & UI_MULTI_LINE_INPUT_BOX_STATE_MULTITAP)
- {
- #ifdef __MMI_BIDI_ALG__
- if (arabic_char_flag)
- {
- multitap_flag = 0;
- }
- else
- #endif /* __MMI_BIDI_ALG__ */
- multitap_flag = 1;
- }
- if (flags & UI_MULTI_LINE_INPUT_BOX_OVERWRITE_MODE)
- {
- overwrite_flag = 1;
- }
- xx = x1 + b->text_x + b->text_offset_x;
- yy = y1 + b->text_y + b->text_offset_y;
- ty = b->header_height;
- b->max_line_height = 0;
- #if defined(__MMI_LANG_VIETNAMESE__)
- /* W05.38 Fix Viet Tone Cursor Moving Issue */
- if ((flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW) && (((b->text_length >> 1) - 1) != 0))
- {
- UI_buffer_type temp_cursor_p = b->cursor_p;
- UI_character_type temp_tone, temp_vowel;
- UI_STRING_GET_NEXT_CHARACTER(temp_cursor_p, temp_tone);
- if ((temp_tone >= 0x0300) && (temp_tone <= 0x0323))
- {
- temp_cursor_p = b->cursor_p;
- UI_STRING_GET_PREVIOUS_CHARACTER(temp_cursor_p, temp_vowel); /* get next character */
- viet_vowel = mmi_viet_vowel_letter(temp_vowel);
- if (VIET_VOWEL_NONE != viet_vowel)
- {
- tone_mark = mmi_viet_tone_mark(temp_tone);
- if (VIET_TONE_NONE != tone_mark)
- {
- dummy_c = mmi_viet_combine_vowel_tone(viet_vowel, tone_mark);
- UI_STRING_GET_NEXT_CHARACTER(b->cursor_p, dummy_c);
- }
- }
- }
- }
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- /* Fix cursor position if it's inside a control sequence of an icon */
- if ((flags & UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW) &&
- !(flags & UI_MULTI_LINE_INPUT_BOX_VIEW_MODE) && b->icon_callback)
- {
- UI_buffer_type temp_cursor_p = b->cursor_p;
- UI_buffer_type new_cursor_p = NULL;
- S32 pre_char_cnt, fit_char_cnt;
- for (pre_char_cnt = 1; pre_char_cnt <= MMI_MULTILINE_ICON_MAX_STRING_LEN; pre_char_cnt++)
- {
- temp_cursor_p -= 2;
- if (temp_cursor_p < b->text)
- {
- break;
- }
- if ((fit_char_cnt = b->icon_callback(temp_cursor_p, MMI_FALSE, NULL, NULL, 0, 0)) > 0)
- {
- if (fit_char_cnt > pre_char_cnt)
- {
- new_cursor_p = temp_cursor_p + fit_char_cnt * 2;
- break;
- }
- }
- }
- if (new_cursor_p)
- {
- current_cursor_p = previous_cursor_p = b->cursor_p = new_cursor_p;
- }
- }
- while (!done && (edit_width >= 0)) /* Compute line by line */
- {
- /* number of characters consumed by b->icon_callback */
- S32 char_cnt_for_control_seq = 0;
- #ifdef __MMI_HINDI_ALG__
- S32 idx = 0;
- #endif
- /* Restore the text_gap and line spacing */
- text_gap = b->text_gap;
- rich_text.more_line_spacing = 0;
- rich_text.line_separator = 0;
- previous_line_width = current_line_width = 0;
- #ifdef __MMI_HINDI_ALG__
- saved_skip_moves = skip_moves = 1;
- #endif
- current_cluster_width = 0;
- #ifdef __MMI_HINDI_ALG__
- cluster_filler_count = 0;
- #endif
- previous_line_height = current_line_height = gui_get_character_height() + 1;
- if (b->min_line_height > current_line_height)
- {
- previous_line_height = current_line_height = b->min_line_height;
- }
- current_line_character_counter = 0;
- current_line_break_character_counter = 0;
- /* MTK for Chinese Characters Display */
- break_flag = 0;
- /* MTK end */
- previous_text_p = line_break_text_p = current_text_p = line_start_text_p;
- #ifdef __MMI_HINDI_ALG__
- move_cursor_prev_p = line_start_text_p; /* TARUN 20041122 */
- #endif
- draw_separator = FALSE;
- /*
- * Backup the font at the beginning of line
- * Alignment is setup in the first pass only, and color is set in the second pass only.
- */
- rich_text.line_begin_font = rich_text.curr_font;
- rich_text.line_begin_border = rich_text.curr_border;
- /* USAT */
- rich_text.line_begin_strikethrough = rich_text.curr_strikethrough;
- /* First pass. Determine the line positions */
- while (current_line_width < (edit_width - 1)
- && current_line_character_counter< 128 ) // because EMS_object_height_cache[128]
- {
- previous_text_p = current_text_p;
- #ifdef __MMI_HINDI_ALG__
- /* only one movement first time */
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "pixtel_UI_show_multi_line_input_box:[skip_moves] :%d",
- skip_moves));
- while (skip_moves--)
- #endif /* __MMI_HINDI_ALG__ */
- {
- UI_STRING_GET_NEXT_CHARACTER(current_text_p, current_character); /* get next character */
- }
- /* MTK Arabic connectivity issue */
- #if defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__
- //??hjf this part should check the shaped chars not original data
- temp_p = current_text_p;
- UI_STRING_GET_NEXT_CHARACTER(temp_p, next_char);
- if (IS_ARABIC_CHARACTER(current_character) && IS_ARABIC_CHARACTER(next_char))
- {
- text_gap = 0;
- }
- else
- {
- text_gap = b->text_gap;
- }
- #endif /* defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__ */
- /* MTK end */
- /* W06.09 Touch Screen With Keypad V1 */
- #if defined(__MMI_FULL_SCREEN_EDITOR__) || defined(__MMI_TOUCH_SCREEN__)
- /* MTK Terry for password display for __MMI_FULL_SCREEN_EDITOR__ */
- if (flags & UI_MULTI_LINE_INPUT_BOX_MASK_CHARACTERS)
- {
- if ((flags & UI_MULTI_LINE_INPUT_BOX_STATE_MULTITAP) && (previous_text_p == previous_cursor_p))
- {
- gui_measure_character(current_character, &mask_character_width, &mask_character_height);
- }
- else
- {
- gui_measure_character(b->mask_character, &mask_character_width, &mask_character_height);
- }
- }
- #endif /* defined(__MMI_FULL_SCREEN_EDITOR__) || defined(__MMI_TOUCH_SCREEN__) */
- #if defined(__MMI_LANG_VIETNAMESE__)
- if ((current_character > 0x0040) && (current_character < 0x01B1))
- {
- UI_STRING_GET_NEXT_CHARACTER(current_text_p, dummy_c); /* get next character */
- tone_mark = mmi_viet_tone_mark(dummy_c);
- if (VIET_TONE_NONE != tone_mark)
- {
- viet_vowel = mmi_viet_vowel_letter(current_character);
- if (VIET_VOWEL_NONE != viet_vowel)
- {
- current_character = mmi_viet_combine_vowel_tone(viet_vowel, tone_mark);
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(current_text_p, dummy_c);
- }
- }
- else
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(current_text_p, dummy_c);
- }
- }
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- #if defined(__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__)
- if (IS_ARABIC_CHARACTER(current_character))
- {
- U32 idx = (current_text_p - b->text) / 2 - 1;
- U32 ligature_move = 0;
- UI_character_type dummy_c_arabic = 0;
- current_character = (UI_character_type) shaping_str[OrgToSha[idx]];
- while (idx < unshaped_text_len - 1)
- {
- if (OrgToSha[idx] == OrgToSha[idx + 1])
- {
- ligature_move++;
- }
- else
- {
- break;
- }
- idx++;
- }
- while (ligature_move > 0)
- {
- UI_STRING_GET_NEXT_CHARACTER(current_text_p, dummy_c);
- /* previous_text_p+=2; */
- ligature_move--;
- }
- }
- #endif /* defined(__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__) */
- if ((flags & UI_MULTI_LINE_INPUT_BOX_DRAW_SEPARATOR) && UI_TEST_ESC_CHARACTER(current_character))
- {
- /* START TARUN PMT 20050128 */
- #ifdef __MMI_HINDI_ALG__
- skip_moves = 1; /* If not required to move cursor ,char count should be incremented */
- #endif
- /* END TARUN PMT 20050128 */
- current_cluster_width = 0;
- #ifdef __MMI_BIDI_ALG__
- if (arabic_char_flag)
- {
- character_height = gui_get_character_height() + 3;
- }
- else
- #endif /* __MMI_BIDI_ALG__ */
- character_height = gui_get_character_height() + 2; /* reserve one more pixel */
- draw_separator = TRUE;
- }
- else
- #if(MULTILINE_INPUTBOX_DISPLAY_SPECIAL_CHARACTERS)
- if (UI_TEST_CR_CHARACTER(current_character) ||
- UI_TEST_LF_CHARACTER(current_character) || UI_TEST_ESC_CHARACTER(current_character))
- {
- /* START TARUN PMT 20050128 */
- #ifdef __MMI_HINDI_ALG__
- skip_moves = 1; /* If not required to move cursor ,char count should be incremented */
- #endif
- /* END TARUN PMT 20050128 */
- current_cluster_width = 10; /* TARUN 20041122 */
- character_height = 10;
- }
- else
- {
- #endif /* (MULTILINE_INPUTBOX_DISPLAY_SPECIAL_CHARACTERS) */
- #if(MULTILINE_INPUTBOX_USE_CRLF_COMBINATION)
- if (UI_TEST_CR_CHARACTER(current_character) && UI_TEST_LF_CHARACTER(*current_text_p))
- {
- /* START TARUN PMT 20050128 */
- #ifdef __MMI_HINDI_ALG__
- skip_moves = 1; /* If not required to move cursor ,char count should be incremented */
- #endif
- /* END TARUN PMT 20050128 */
- current_cluster_width = 0; /* TARUN 20041122 */
- character_height = gui_get_character_height();
- }
- else
- #endif /* (MULTILINE_INPUTBOX_USE_CRLF_COMBINATION) */
- if (flags & UI_MULTI_LINE_INPUT_BOX_MASK_CHARACTERS)
- {
- /* START TARUN PMT 20050128 */
- #ifdef __MMI_HINDI_ALG__
- skip_moves = 1; /* If not required to move cursor ,char count should be incremented */
- #endif
- /* END TARUN PMT 20050128 */
- current_cluster_width = mask_character_width; /* TARUN 20041122 */
- character_height = mask_character_height;
- }
- else if (char_cnt_for_control_seq > 0)
- {
- #ifdef __MMI_HINDI_ALG__
- skip_moves = 1; /* If not required to move cursor ,char count should be incremented */
- #endif
- text_gap = 0;
- current_cluster_width = 0;
- character_height = character_heights_cache[current_line_character_counter-1]; /* hjf should reuse last char's height */
- }
- else if ((flags & UI_MULTI_LINE_INPUT_BOX_RICHTEXT) && GUI_INPUT_IS_MARKER(current_character))
- {
- BOOL change_font = MMI_FALSE;
- text_gap = 0;
- current_cluster_width = 0;
- /* We do not want to assign 'current_line_height' because we might change to small font */
- character_height = 1;
- #ifdef __MMI_HINDI_ALG__
- skip_moves = 1; /* If not required to move cursor ,char count should be incremented */
- #endif
- switch (current_character)
- {
- case GUI_INPUT_MARKER_RESET_ALL:
- /* Reset font format and alignment (no color) */
- rich_text.curr_alignment = rich_text.default_alignment;
- rich_text.curr_font = *b->text_font;
- rich_text.curr_border = 0;
- /* USAT */
- rich_text.curr_strikethrough = 0;
- rich_text.more_line_spacing = 0;
- rich_text.line_separator = 0;
- change_font = MMI_TRUE;
- break;
- case GUI_INPUT_MARKER_RESET_PARAGRAPH:
- rich_text.curr_alignment = rich_text.default_alignment;
- rich_text.more_line_spacing = 0;
- rich_text.line_separator = 0;
- break;
- case GUI_INPUT_MARKER_RESET_FORMAT:
- rich_text.curr_font = *b->text_font;
- rich_text.curr_border = 0;
- /* USAT */
- rich_text.curr_strikethrough = 0;
- change_font = MMI_TRUE;
- break;
- case GUI_INPUT_MARKER_RESET_COLOR:
- /* Do not change color because characters is not drawn in the first pass */
- break;
- default:
- /* UAT */
- if ((current_character >= GUI_INPUT_MARKER_W3C_COLOR_BEGIN &&
- current_character <= GUI_INPUT_MARKER_W3C_COLOR_END) ||
- (current_character >= GUI_INPUT_MARKER_COLOR_BEGIN &&
- current_character <= GUI_INPUT_MARKER_COLOR_END) ||
- (current_character >= GUI_INPUT_MARKER_W3C_BORDER_COLOR_BEGIN &&
- current_character <= GUI_INPUT_MARKER_W3C_BORDER_COLOR_END) ||
- (current_character >= GUI_INPUT_MARKER_BORDER_COLOR_BEGIN &&
- current_character <= GUI_INPUT_MARKER_BORDER_COLOR_END) ||
- (current_character >= GUI_INPUT_MARKER_TEXT_BACKGROUND_COLOR_BEGIN &&
- current_character <= GUI_INPUT_MARKER_TEXT_BACKGROUND_COLOR_END))
- {
- /* Do not change color because characters is not drawn in the first pass */
- }
- else if (GUI_INPUT_IS_FORMAT_MARKER(current_character))
- {
- if (GUI_INPUT_CHECK_FORMAT_MARKER(current_character, GUI_INPUT_MARKER_BOLD))
- {
- rich_text.curr_font.bold = 1;
- change_font = MMI_TRUE;
- }
- if (GUI_INPUT_CHECK_FORMAT_MARKER(current_character, GUI_INPUT_MARKER_ITALIC))
- {
- rich_text.curr_font.italic = 1;
- change_font = MMI_TRUE;
- }
- if (GUI_INPUT_CHECK_FORMAT_MARKER(current_character, GUI_INPUT_MARKER_UNDERLINE))
- {
- rich_text.curr_font.underline = 1;
- change_font = MMI_TRUE;
- }
- /* USAT */
- if (GUI_INPUT_CHECK_FORMAT_MARKER
- (current_character, GUI_INPUT_MARKER_STRIKETHROUGH))
- {
- rich_text.curr_strikethrough = 1;
- }
- if (GUI_INPUT_CHECK_FORMAT_MARKER(current_character, GUI_INPUT_MARKER_BORDER))
- {
- /* We do not increase font size for bordered font because text gap is already enlarged */
- rich_text.curr_border = 1;
- }
- if (GUI_INPUT_CHECK_SIZE_MARKER(current_character, GUI_INPUT_MARKER_SMALL))
- {
- rich_text.curr_font.size = SMALL_FONT;
- change_font = MMI_TRUE;
- }
- else if (GUI_INPUT_CHECK_SIZE_MARKER(current_character, GUI_INPUT_MARKER_MEDIUM))
- {
- rich_text.curr_font.size = MEDIUM_FONT;
- change_font = MMI_TRUE;
- }
- else if (GUI_INPUT_CHECK_SIZE_MARKER(current_character, GUI_INPUT_MARKER_LARGE))
- {
- rich_text.curr_font.size = LARGE_FONT;
- change_font = MMI_TRUE;
- }
- }
- else if (GUI_INPUT_IS_PARAGRAPH_MARKER(current_character))
- {
- if (GUI_INPUT_CHECK_ALIGN_MARKER(current_character, GUI_INPUT_MARKER_ALIGN_LEFT))
- {
- rich_text.curr_alignment = GUI_INPUT_ALIGN_LEFT;
- }
- else if (GUI_INPUT_CHECK_ALIGN_MARKER
- (current_character, GUI_INPUT_MARKER_ALIGN_CENTER))
- {
- rich_text.curr_alignment = GUI_INPUT_ALIGN_CENTER;
- }
- else if (GUI_INPUT_CHECK_ALIGN_MARKER
- (current_character, GUI_INPUT_MARKER_ALIGN_RIGHT))
- {
- rich_text.curr_alignment = GUI_INPUT_ALIGN_RIGHT;
- }
- if (GUI_INPUT_CHECK_LINE_SPACING_MARKER
- (current_character, GUI_INPUT_MARKER_LINE_SPACING_1))
- {
- rich_text.more_line_spacing = 1;
- }
- else if (GUI_INPUT_CHECK_LINE_SPACING_MARKER
- (current_character, GUI_INPUT_MARKER_LINE_SPACING_2))
- {
- rich_text.more_line_spacing = 2;
- }
- else if (GUI_INPUT_CHECK_LINE_SPACING_MARKER
- (current_character, GUI_INPUT_MARKER_LINE_SPACING_3))
- {
- rich_text.more_line_spacing = 3;
- }
- else if (GUI_INPUT_CHECK_LINE_SPACING_MARKER
- (current_character, GUI_INPUT_MARKER_LINE_SPACING_4))
- {
- rich_text.more_line_spacing = 4;
- }
- else if (GUI_INPUT_CHECK_LINE_SPACING_MARKER
- (current_character, GUI_INPUT_MARKER_LINE_SPACING_5))
- {
- rich_text.more_line_spacing = 5;
- }
- else if (GUI_INPUT_CHECK_LINE_SPACING_MARKER
- (current_character, GUI_INPUT_MARKER_LINE_SPACING_6))
- {
- rich_text.more_line_spacing = 6;
- }
- else if (GUI_INPUT_CHECK_LINE_SPACING_MARKER
- (current_character, GUI_INPUT_MARKER_LINE_SPACING_7))
- {
- rich_text.more_line_spacing = 7;
- }
- if (GUI_INPUT_CHECK_PARAGRAPH_MARKER
- (current_character, GUI_INPUT_MARKER_LINE_SEPARATOR))
- {
- rich_text.line_separator = 1;
- }
- /* Reserve minimum line spacing for line separator */
- if (rich_text.line_separator && rich_text.more_line_spacing < 3)
- {
- rich_text.more_line_spacing = 3;
- }
- }
- break;
- }
- if (change_font)
- {
- gui_set_font(&rich_text.curr_font);
- }
- }
- else if (b->icon_callback &&
- (char_cnt_for_control_seq =
- b->icon_callback(
- previous_text_p,
- MMI_FALSE,
- ¤t_cluster_width,
- &character_height,
- 0,
- 0)) > 0)
- {
- #ifdef __MMI_HINDI_ALG__
- skip_moves = 1; /* If not required to move cursor ,char count should be incremented */
- #endif
- }
- else
- {
- #ifdef __MMI_HINDI_ALG__
- /* MTK Terry for Cursor Height Issue */
- if (UI_HINDI_CHARACTER_UCS2_RANGE(current_character))
- {
- character_height = gui_get_character_height();
- }
- else
- {
- gui_measure_character(current_character, ¤t_cluster_width, &character_height);
- }
- #else /* __MMI_HINDI_ALG__ */
- gui_measure_character(current_character, ¤t_cluster_width, &character_height);
- #endif /* __MMI_HINDI_ALG__ */
- if (!RequireToMoveCursor(pre_character, current_character))
- {
- current_cluster_width = 0;
- #ifdef __MMI_HINDI_ALG__
- skip_moves = 1; /* If not required to move cursor ,char count should be incremented */
- /* START TARUN PMT 20050128 */