wgui_categories.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:657k
源码类别:
MTK
开发平台:
C/C++
- void Cat230DrawIndex(void)
- {
- S32 width, height, iwidth, iheight;
- color bg_color, text_color;
- U8 i;
- gui_reset_clip();
- gui_reset_text_clip();
- gui_lock_double_buffer();
- gui_set_font(&MMI_default_font);
- gui_measure_image(get_image(LEFT_ARROW_UP), &iwidth, &iheight);
- for (i=0; i<Cat230NumberofIndex; i++)
- {
- width = height = 0;
- if (i == Cat230HighlightedIndex)
- {
- bg_color = Cat230Index_bg_highlight;
- text_color = Cat230Index_fg_highlight;
- }
- else
- {
- bg_color = Cat230Index_bg;
- text_color = Cat230Index_fg;
- }
- //draw background
- gdi_draw_solid_rect(0, MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*i, UI_device_width-1, MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*(i+1)-1, gdi_act_color_from_rgb(bg_color.alpha, bg_color.r, bg_color.g, bg_color.b));
- //draw fg text
- gui_measure_string((UI_string_type)Cat230IndexInfoString[i], &width, &height);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(((UI_device_width - width) >> 1) + width, MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*i + ((CAT230_INDEX_HEIGHT-height)>>1));
- }
- else
- {
- gui_move_text_cursor((UI_device_width - width) >> 1, MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*i + ((CAT230_INDEX_HEIGHT-height)>>1));
- }
- gui_set_text_color(text_color);
- gui_print_text((UI_string_type)Cat230IndexInfoString[i]);
- //draw left arrow
- #ifdef __MMI_TOUCH_SCREEN__
- if (Cat230PenEvent == CAT230_TOUCH_ON_LEFT_ARROW_DOWN && i == Cat230HighlightedIndex)
- {
- gui_show_transparent_image(
- CAT230_ARROW_OFFSET,
- MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*i + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1,
- get_image(LEFT_ARROW_DOWN),
- 0);
- }
- else
- #endif
- {
- gui_show_transparent_image(
- CAT230_ARROW_OFFSET,
- MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*i + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1,
- get_image(LEFT_ARROW_UP),
- 0);
- }
- //draw right arrow
- #ifdef __MMI_TOUCH_SCREEN__
- if (Cat230PenEvent == CAT230_TOUCH_ON_RIGHT_ARROW_DOWN && i == Cat230HighlightedIndex)
- {
- gui_show_transparent_image(
- UI_device_width - iwidth - 1 - CAT230_ARROW_OFFSET,
- MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*i + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1,
- get_image(RIGHT_ARROW_DOWN),
- 0);
- }
- else
- #endif
- {
- gui_show_transparent_image(
- UI_device_width - iwidth - 1 - CAT230_ARROW_OFFSET,
- MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*i + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1,
- get_image(RIGHT_ARROW_UP),
- 0);
- }
- }
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, MMI_status_bar_height+CAT230_TITLE_HEIGHT, UI_device_width-1, Cat230Paint_y-1);
- }
- static void Cat230RedrawPaint_WC(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color dynamic_time_bg = {255, 113, 21, 255};
- color dynamic_time_fg = {0, 0, 0, 255};
- color static_time_bg = {82, 22, 48, 255};
- color static_time_fg = {255, 255, 255, 255};
- color city_bg = {0, 0, 0, 255};
- color city_fg = {255, 255, 255, 255};
- color hint_fg = {150, 150, 150, 255};
- color dynamic_line = {255, 0, 0, 255};
- color static_line = {0, 0, 0, 255};
- S32 width = 0;
- S32 height = 0;
- S32 width1 = 0;
- S32 height1 = 0;
- S32 start_y = 0;
- cat230_paint_wc_info_struct wc_info;
- MMI_ASSERT(Cat230GetPaintInfo!=NULL);
- Cat230GetPaintInfo((void *)(&wc_info));
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 060706 NITZ category Calvin Start */
- if (!wc_info.need_redraw)
- {
- return;
- }
- /* 060706 NITZ category Calvin End */
- gui_reset_clip();
- gui_reset_text_clip();
- gui_lock_double_buffer();
- gui_set_font(&MMI_small_font);
- //draw dynamic time
- start_y = Cat230Paint_y;
- gui_measure_string((UI_string_type)wc_info.dynamic_string, &width, &height);
- gdi_draw_solid_rect(0, start_y, UI_device_width-1, start_y+CAT230_TIME_HEIGHT-1, gdi_act_color_from_rgb(dynamic_time_bg.alpha, dynamic_time_bg.r, dynamic_time_bg.g, dynamic_time_bg.b));
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(((UI_device_width - width) >> 1) + width, start_y + ((CAT230_TIME_HEIGHT-height)>>1));
- }
- else
- {
- gui_move_text_cursor((UI_device_width - width) >> 1, start_y + ((CAT230_TIME_HEIGHT-height)>>1));
- }
- gui_set_text_color(dynamic_time_fg);
- gui_print_text((UI_string_type)wc_info.dynamic_string);
- //draw city
- start_y = UI_device_height-MMI_button_bar_height-CAT230_TIME_HEIGHT-CAT230_CITY_HEIGHT;
- gui_measure_string((UI_string_type)wc_info.hint_string, &width, &height);
- gui_measure_string((UI_string_type)wc_info.city_string, &width1, &height1);
- gdi_draw_solid_rect(0, start_y, UI_device_width-1, start_y+CAT230_CITY_HEIGHT-1, gdi_act_color_from_rgb(city_bg.alpha, city_bg.r, city_bg.g, city_bg.b));
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(((UI_device_width - (width+5+width1)) >> 1) + width+5+width1, start_y + ((CAT230_CITY_HEIGHT-height)>>1));
- }
- else
- {
- gui_move_text_cursor((UI_device_width - (width+5+width1)) >> 1, start_y + ((CAT230_CITY_HEIGHT-height)>>1));
- }
- gui_set_text_color(hint_fg);
- gui_print_text((UI_string_type)wc_info.hint_string);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(((UI_device_width - (width+5+width1)) >> 1) + width, start_y + ((CAT230_CITY_HEIGHT-height1)>>1));
- }
- else
- {
- gui_move_text_cursor(((UI_device_width - (width+5+width1)) >> 1) + width+5, start_y + ((CAT230_CITY_HEIGHT-height1)>>1));
- }
- gui_set_text_color(city_fg);
- gui_print_text((UI_string_type)wc_info.city_string);
- //draw static time
- start_y = UI_device_height-MMI_button_bar_height-CAT230_TIME_HEIGHT;
- gui_measure_string((UI_string_type)wc_info.static_string, &width, &height);
- gdi_draw_solid_rect(0, start_y, UI_device_width-1, start_y+CAT230_TIME_HEIGHT-1, gdi_act_color_from_rgb(static_time_bg.alpha, static_time_bg.r, static_time_bg.g, static_time_bg.b));
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(((UI_device_width - width) >> 1) + width, start_y + ((CAT230_TIME_HEIGHT-height)>>1));
- }
- else
- {
- gui_move_text_cursor((UI_device_width - width) >> 1, start_y + ((CAT230_TIME_HEIGHT-height)>>1));
- }
- gui_set_text_color(static_time_fg);
- gui_print_text((UI_string_type)wc_info.static_string);
- //draw map
- start_y = Cat230Paint_y + CAT230_TIME_HEIGHT;
- if (Cat230FirstEnter == MMI_TRUE)
- {
- dm_create_layer(0, start_y, UI_device_width, Cat230Paint_height-CAT230_TIME_HEIGHT*2-CAT230_CITY_HEIGHT, &Cat230PaintLayer, DM_LAYER_BOTTOM);
- gdi_layer_push_and_set_active(Cat230PaintLayer);
- gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
- gdi_layer_clear(GDI_COLOR_TRANSPARENT);
- gdi_layer_reset_clip();
- /* draw fix list backgroud */
- gdi_image_draw_id(0, 0, WORLD_CLOCK_IMAGE1);
- gdi_layer_pop_and_restore_active();
- Cat230FirstEnter = MMI_FALSE;
- }
- //draw line indication
- gdi_layer_push_clip();
- gdi_layer_set_clip(0, start_y, UI_device_width-1, UI_device_height-MMI_button_bar_height-CAT230_TIME_HEIGHT-CAT230_CITY_HEIGHT-1);
- gdi_draw_solid_rect(0, start_y, UI_device_width-1, UI_device_height-MMI_button_bar_height-CAT230_TIME_HEIGHT-CAT230_CITY_HEIGHT-1, GDI_COLOR_TRANSPARENT);
- gui_draw_vertical_line(start_y, UI_device_height-MMI_button_bar_height-CAT230_TIME_HEIGHT-CAT230_CITY_HEIGHT-1, wc_info.static_x, static_line);
- gui_draw_horizontal_line(0, UI_device_width-1, start_y+wc_info.static_y, static_line);
- gui_draw_vertical_line(start_y, UI_device_height-MMI_button_bar_height-CAT230_TIME_HEIGHT-CAT230_CITY_HEIGHT-1, wc_info.dynamic_x, dynamic_line);
- gui_draw_horizontal_line(0, UI_device_width-1, start_y+wc_info.dynamic_y, dynamic_line);
- gdi_layer_pop_clip();
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, Cat230Paint_y, UI_device_width-1, Cat230Paint_y+Cat230Paint_height-1);
- }
- static void RedrawCategory230Screen(void)
- {
- Cat230DrawTitle();
- Cat230DrawIndex();
- MMI_ASSERT(Cat230RedrawPaint!=NULL);
- Cat230RedrawPaint();
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategoryControlledArea230Screen
- * DESCRIPTION
- * redraw category200
- * PARAMETERS
- * coordinate [?]
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategoryControlledArea230Screen(dm_coordinates *coordinate)
- {
- RedrawCategory230Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory230Screen
- * DESCRIPTION
- * category screen of phone search
- * PARAMETERS
- * title [IN] Title string
- * number_of_index [IN] number of index
- * highlighted_index [IN] highlighted index
- * screen_type [IN] screen type
- * left_key_handler [IN] function pointer to app left key handler
- * left_key_handler [IN] function pointer to app right key handler
- * redraw_paint [IN] function pointer to redraw non-index area
- * get_paint_info [IN] function pointer to get info of non-index area
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory230Screen(
- U8 *title,
- U8 number_of_index,
- U8 **index_info,
- U8 highlighted_index,
- U8 screen_type,
- void (*left_key_handler) (U8 index_num),
- void (*right_key_handler) (U8 index_num),
- //void (*redraw_paint) (void),
- void (*get_paint_info) (void *paint_info))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat230TitleString = title;
- Cat230NumberofIndex = number_of_index;
- for(i=0; i<MAX_CAT230_INDEX; i++)
- {
- Cat230IndexInfoString[i] = index_info[i];
- }
- Cat230HighlightedIndex = highlighted_index;
- Cat230AppLeftKeyHandler = left_key_handler;
- Cat230AppRightKeyHandler = right_key_handler;
- Cat230RedrawPaint = Cat230RedrawPaintArray[screen_type];
- #ifdef __MMI_TOUCH_SCREEN__
- Cat230PaintPenEventHandler = Cat230PaintPenEventHandlerArray[screen_type];
- #endif
- Cat230GetPaintInfo = get_paint_info;
- Cat230Paint_y = MMI_status_bar_height + CAT230_TITLE_HEIGHT + CAT230_INDEX_HEIGHT*Cat230NumberofIndex;
- Cat230Paint_height = UI_device_height - Cat230Paint_y - MMI_button_bar_height;
- //Cat230FirstEnter = MMI_TRUE;
- SetupCategoryKeyHandlers();
- dm_register_category_controlled_callback(RedrawCategoryControlledArea230Screen);
- SetKeyHandler(Cat230HandleKeyLeft, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(Cat230HandleKeyLeft, KEY_LEFT_ARROW, KEY_LONG_PRESS);
- SetKeyHandler(Cat230HandleKeyRight, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(Cat230HandleKeyRight, KEY_RIGHT_ARROW, KEY_LONG_PRESS);
- SetKeyHandler(Cat230HandleKeyUp, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(Cat230HandleKeyUp, KEY_UP_ARROW, KEY_LONG_PRESS);
- SetKeyHandler(Cat230HandleKeyDown, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(Cat230HandleKeyDown, KEY_DOWN_ARROW, KEY_LONG_PRESS);
- #ifdef __MMI_TOUCH_SCREEN__
- wgui_register_category_screen_control_area_pen_handlers(Cat230PenDownHandler, MMI_PEN_EVENT_DOWN);
- wgui_register_category_screen_control_area_pen_handlers(Cat230PenUpHandler, MMI_PEN_EVENT_UP);
- wgui_register_category_screen_control_area_pen_handlers(Cat230PenRepeatHandler, MMI_PEN_EVENT_REPEAT);
- wgui_register_category_screen_control_area_pen_handlers(Cat230PenMoveHandler, MMI_PEN_EVENT_MOVE);
- #endif /* __MMI_TOUCH_SCREEN__ */
- /* 060706 NITZ category Calvin Start */
- ExitCategoryFunction = ExitCategory230Screen;
- RedrawCategoryFunction = dm_redraw_category_screen;
- GetCategoryHistory = GetCategory230History;
- GetCategoryHistorySize = GetCategory230HistorySize;
- /* 060706 NITZ category Calvin End */
- dm_data.s32CatId = MMI_CATEGORY230_ID;
- dm_data.s32ScrId = GetActiveScreenId();
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- #endif
- /* 052206 NITZ category Calvin End */
- /*****************************************************************************
- * FUNCTION
- * DrawCatEMSCategoryControlledArea
- * DESCRIPTION
- *
- * PARAMETERS
- * coordinates [?]
- * RETURNS
- * void
- *****************************************************************************/
- void DrawCatEMSCategoryControlledArea(dm_coordinates *coordinates)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- show_singleline_inputbox();
- } /* end of DrawCatEMSCategoryControlledArea */
- /***************************************************************************
- Function Name: EMS_matrix_highlight_handler
- ***************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * EMS_matrix_highlight_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_matrix_highlight_handler(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- extern color MMI_white_color;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_menu_shortcut_number = item_index + 1;
- MMI_highlighted_item_text = get_item_text(item_index);
- MMI_singleline_inputbox.text = (U8*) MMI_highlighted_item_text;
- //PMT START FIX HINDI ISSUES 20060604
- //It is necessary to set the last_position_p also when the text pointer is changed.
- MMI_singleline_inputbox.last_position_p =
- MMI_singleline_inputbox.text + (gui_strlen((UI_string_type) MMI_singleline_inputbox.text) << 1);
- /* PMT START FIX HINDI ISSUES 20060604 */
- gui_fill_rectangle(
- MMI_singleline_inputbox.x,
- MMI_singleline_inputbox.y,
- MMI_singleline_inputbox.x + MMI_singleline_inputbox.width,
- MMI_singleline_inputbox.y + MMI_singleline_inputbox.height,
- MMI_white_color);
- redraw_singleline_inputbox();
- MMI_matrix_highlight_handler(item_index);
- }
- /***************************************************************************
- Function Name: ShowCategoryEMSScreen
- ***************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * ShowCategoryEMSScreen
- * DESCRIPTION
- *
- * PARAMETERS
- * title [IN]
- * title_icon [IN]
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN]
- * right_softkey_icon [IN]
- * num_of_symbols [IN]
- * symbols [?]
- * descriptions [?]
- * highlighted_item [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategoryEMSScreen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 num_of_symbols,
- MMI_ID_TYPE *symbols,
- MMI_ID_TYPE *descriptions,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 i, symbol_width = 0, symbol_height = 0, width = 0, height = 0;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- MMI_menu_shortcut_number = -1;
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- MMI_title_string = get_string(title);
- create_fixed_icontext_menuitems();
- associate_fixed_icontext_matrix();
- for (i = 0; i < num_of_symbols; i++)
- {
- PU8 img = (PU8) get_image(symbols[i]);
- add_fixed_icontext_item((UI_string_type) get_string(descriptions[i]), img);
- gui_measure_image(img, &symbol_width, &symbol_height);
- if (symbol_width > width)
- {
- width = symbol_width;
- }
- if (symbol_height > height)
- {
- height = symbol_width;
- }
- }
- configure_fixed_matrix(width, height, 0, 0);
- MMI_fixed_matrix_menu.height =
- MMI_fixed_matrix_menu.n_rows * (MMI_fixed_matrix_menu.width / MMI_fixed_matrix_menu.n_columns);
- MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_FOCUSSED_ANIMATE | UI_MENUITEM_DISABLE_TEXT_DISPLAY;
- register_fixed_matrix_loop_keys();
- register_fixed_matrix_highlight_handler(EMS_matrix_highlight_handler);
- MMI_current_menu_type = MATRIX_MENU_EMS;
- MMI_fixed_matrix_menu.flags |= UI_MATRIX_MENU_LOOP;
- h_flag = set_matrix_menu_category_history(MMI_CATEGORY22_ID, history_buffer);
- if (h_flag)
- {
- MMI_highlighted_item_text = get_item_text(MMI_fixed_matrix_menu.highlighted_item);
- create_singleline_inputbox_set_buffer(
- (UI_string_type) MMI_highlighted_item_text,
- gui_strlen((UI_string_type) MMI_highlighted_item_text) + 1,
- gui_strlen((UI_string_type) MMI_highlighted_item_text),
- gui_strlen((UI_string_type) MMI_highlighted_item_text));
- set_singleline_inputbox_mask(0);
- MMI_singleline_inputbox.flags |=
- (UI_SINGLE_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW |
- UI_SINGLE_LINE_INPUT_BOX_CENTER_JUSTIFY);
- fixed_matrix_goto_item_no_redraw(MMI_fixed_matrix_menu.highlighted_item);
- }
- else
- {
- MMI_highlighted_item_text = get_item_text(highlighted_item);
- create_singleline_inputbox_set_buffer(
- (UI_string_type) MMI_highlighted_item_text,
- gui_strlen((UI_string_type) MMI_highlighted_item_text) + 1,
- gui_strlen((UI_string_type) MMI_highlighted_item_text),
- gui_strlen((UI_string_type) MMI_highlighted_item_text));
- set_singleline_inputbox_mask(0);
- MMI_singleline_inputbox.flags |=
- (UI_SINGLE_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW |
- UI_SINGLE_LINE_INPUT_BOX_CENTER_JUSTIFY);
- fixed_matrix_goto_item_no_redraw(highlighted_item);
- }
- MMI_disable_title_shortcut_display = 1;
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory22Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY_EMS_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_register_category_controlled_callback(DrawCatEMSCategoryControlledArea);
- dm_redraw_category_screen();
- } /* end of ShowCategoryEMSScreen */
- /*****************************************************************************
- * FUNCTION
- * GetCategory400History
- * DESCRIPTION
- *
- * PARAMETERS
- * history_buffer [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 *GetCategory400History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return history_buffer;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory400HistorySize
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- S32 GetCategory400HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory400Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory400Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color cb = gui_color(0, 0, 0);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- gdi_layer_push_clip();
- gdi_layer_set_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
- clear_screen();
- show_title_status_icon();
- draw_title();
- gui_draw_rectangle(
- MMI_content_x,
- MMI_content_y,
- MMI_content_x + MMI_content_width - 1,
- MMI_content_y + MMI_content_height - 1,
- cb);
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- gdi_layer_pop_clip();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory400Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory400Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_disable_title_shortcut_display = 0;
- disable_menu_shortcut_box_display = 0;
- reset_softkeys();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory400Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * title [IN]
- * title_icon [IN]
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN]
- * right_softkey_icon [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory400Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_disable_title_shortcut_display = 1;
- disable_menu_shortcut_box_display = 1;
- gdi_layer_lock_frame_buffer();
- clear_category_screen_key_handlers();
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory400Screen;
- RedrawCategoryFunction = RedrawCategory400Screen;
- GetCategoryHistory = GetCategory400History;
- GetCategoryHistorySize = GetCategory400HistorySize;
- RedrawCategory400Screen();
- }
- #if (defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)) || defined(__MMI_SMART_MESSAGE_MT__)
- /*****************************************************************************
- * FUNCTION
- * mmi_nsm2_category275_draw_tile
- * DESCRIPTION
- *
- * PARAMETERS
- * strID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_nsm2_category275_draw_tile(U32 strID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 iwidth, iheight, character_height, tx, w, iwidth2;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- /* ADDED FOR NSM PHASE-II */
- MMI_title_string = get_string((MMI_ID_TYPE) strID);
- gdi_layer_push_clip();
- if ((gOnFullScreen & MMI_IN_FULL_SCREEN) && !(gOnFullScreen & MMI_LEAVE_FULL_IDLE_SCREEN) &&
- !(gOnFullScreen & MMI_IN_NORMAL_SCREEN_WITHOUT_STATUSBAR))
- {
- gdi_layer_set_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
- /* PMT VIKAS START 20050707 */
- #if defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
- /* To show proper Title & title image display */
- ShowStatusIconsTitle();
- arrange_status_icons();
- show_status_icons();
- gdi_layer_set_clip(
- MMI_title_x,
- MMI_title_y,
- MMI_title_x + MMI_title_width - 1,
- MMI_title_y + MMI_title_height - 1);
- /* gui_draw_filled_area(MMI_title_x,MMI_title_y,MMI_title_x+MMI_title_width-1,MMI_title_height-1,current_MMI_theme->title_filler); */
- gui_draw_filled_area(
- MMI_title_x,
- MMI_title_y,
- MMI_title_x + MMI_title_width - 1,
- MMI_title_y + MMI_title_height - 1,
- current_UI_theme->window_title_theme->active_filler);
- #else /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__) */
- gdi_layer_set_clip(MMI_title_x, 0, MMI_title_x + MMI_title_width - 1, MMI_title_height - 1);
- /* PMT NEERAJ START 20050616 */
- gui_draw_filled_area(
- MMI_title_x,
- 0,
- MMI_title_x + MMI_title_width - 1,
- MMI_title_height - 1,
- current_UI_theme->window_title_theme->active_filler);
- /* PMT NEERAJ END 20050616 */
- #endif /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__) */
- /* PMT VIKAS END 20050707 */
- }
- else
- {
- gdi_layer_set_clip(0, MMI_title_y, UI_device_width - 1, MMI_title_y + MMI_title_height - 1);
- /* PMT VIKAS START 20050707 */
- #if defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
- /* Draw title image. */
- gui_draw_filled_area(
- MMI_title_x,
- MMI_title_y,
- MMI_title_x + MMI_title_width - 1,
- MMI_title_y + MMI_title_height - 1,
- current_UI_theme->window_title_theme->active_filler);
- #else /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__) */
- /* PMT NEERAJ START 20050616 */
- gui_draw_filled_area(
- MMI_title_x,
- MMI_title_y,
- MMI_title_x + MMI_title_width - 1,
- MMI_title_y + MMI_title_height - 1,
- current_UI_theme->window_title_theme->active_filler);
- /* /PMT NEERAJ END 20050616 */
- #endif /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__) */
- /* PMT VIKAS END 20050707 */
- }
- if (MMI_title_icon != NULL)
- {
- gui_measure_image(MMI_title_icon, &iwidth, &iheight);
- /* MTK Elvis for R2L characters */
- if (!r2lMMIFlag)
- {
- gui_show_transparent_image(
- MMI_title_x + 1,
- MMI_title_y + ((MMI_title_height >> 1) - (iheight >> 1)),
- MMI_title_icon,
- gui_transparent_color(0, 0, 0));
- if ((iwidth == 0) || (iheight == 0))
- {
- tx = 2;
- }
- else
- {
- tx = iwidth + 3;
- }
- }
- else
- {
- gui_show_transparent_image(
- MMI_title_width - iwidth - 1,
- MMI_title_y + ((MMI_title_height >> 1) - (iheight >> 1)),
- MMI_title_icon,
- gui_transparent_color(0, 0, 0));
- if ((iwidth == 0) || (iheight == 0))
- {
- tx = MMI_title_width - 2;
- }
- else
- {
- tx = MMI_title_width - iwidth - 3;
- }
- }
- /* MTK end */
- }
- else
- {
- /* MTK Elvis for R2L characters */
- if (!r2lMMIFlag)
- {
- tx = 2;
- }
- else
- {
- tx = MMI_title_width - 2;
- }
- /* MTK end */
- }
- if (MMI_title_icon2 != NULL)
- {
- gui_measure_image(MMI_title_icon2, &iwidth2, &iheight);
- if (iwidth2 > 0 && iheight > 0)
- {
- gui_show_transparent_image(
- MMI_title_x + MMI_title_width - iwidth2 - 1 /* leave one pixel */ ,
- MMI_title_y + ((MMI_title_height >> 1) - (iheight >> 1)),
- MMI_title_icon2,
- gui_transparent_color(0, 0, 0));
- }
- }
- if (MMI_title_string != NULL) /* Fix for long titles */
- {
- /* MTK Elvis for R2L characters */
- S32 tw;
- if (!r2lMMIFlag)
- {
- tw = MMI_title_width - tx;
- }
- else
- {
- tw = tx;
- }
- /* MTK end */
- gui_set_font((UI_font_type) (current_MMI_theme->window_title_font));
- gui_measure_string(MMI_title_string, &w, &character_height);
- w += 2; /* for bordered text display */
- gui_set_text_color(*current_MMI_theme->title_text_color);
- if ((gOnFullScreen & MMI_IN_FULL_SCREEN || gOnFullScreen & MMI_LEAVE_FULL_SCREEN) &&
- !(gOnFullScreen & MMI_LEAVE_FULL_IDLE_SCREEN))
- /* PMT VIKAS START 20050707 */
- #if defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
- /* to move at right point */
- gui_move_text_cursor(MMI_title_x + tx, MMI_title_y + ((MMI_title_height >> 1) - (character_height >> 1)));
- #else /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__) */
- gui_move_text_cursor(MMI_title_x + tx, ((MMI_title_height >> 1) - (character_height >> 1)));
- #endif /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__) */
- /* PMT VIKAS END 20050707 */
- else
- {
- gui_move_text_cursor(MMI_title_x + tx, MMI_title_y + ((MMI_title_height >> 1) - (character_height >> 1)));
- }
- if (MMI_title_icon2 && iwidth2 > 0 && iheight > 0)
- {
- tw -= (iwidth2 + 1 + 4);
- if (w < tw)
- {
- S32 _tx = tx;
- tx = tx + (tw >> 1) - (w >> 1);
- if (tx < _tx)
- {
- tx = _tx;
- }
- }
- }
- else if (!MMI_disable_title_shortcut_display && MMI_menu_shortcut_number >= 0)
- {
- tw -= MMI_menu_shortcut_box.width;
- if (w < tw)
- {
- S32 _tx = tx;
- /* MTK Elvis for R2L characters */
- if (!r2lMMIFlag)
- {
- tx = tx + (tw >> 1) - (w >> 1);
- if (tx < _tx)
- {
- tx = _tx;
- }
- }
- else
- {
- tx = tx - ((tw >> 1) - (w >> 1));
- if (tx > _tx)
- {
- tx = _tx;
- }
- }
- /* MTK end */
- }
- }
- else
- {
- if (w < tw)
- {
- S32 _tx = tx;
- /* MTK Elvis for R2L characters */
- if (!r2lMMIFlag)
- {
- tx = tx + (tw >> 1) - (w >> 1);
- if (tx < _tx)
- {
- tx = _tx;
- }
- }
- else
- {
- tx = tx - ((tw >> 1) - (w >> 1));
- if (tx > _tx)
- {
- tx = _tx;
- }
- }
- /* MTK end */
- }
- }
- #if defined(__MMI_DEFAULT_THEME_3__) || defined(__MMI_DEFAULT_THEME_1__)
- gui_set_text_border_color(*current_MMI_theme->title_text_border_color);
- if ((gOnFullScreen & MMI_IN_FULL_SCREEN || gOnFullScreen & MMI_LEAVE_FULL_SCREEN) &&
- !(gOnFullScreen & MMI_LEAVE_FULL_IDLE_SCREEN))
- /* PMT VIKAS START 20050707 */
- #if defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
- /* To print title text on title bar with title icon. */
- gui_print_truncated_borderd_text(
- MMI_title_x + tx,
- MMI_title_y + ((MMI_title_height >> 1) - (character_height >> 1)),
- tw,
- MMI_title_string);
- #else /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__) */
- gui_print_truncated_borderd_text(
- MMI_title_x + tx,
- ((MMI_title_height >> 1) - (character_height >> 1)),
- tw,
- MMI_title_string);
- #endif /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) || defined(__MMI_UI_DALMATIAN_MAINMENU__) || defined(__MMI_UI_DALMATIAN_FIXEDLIST__) || defined(__MMI_UI_DALMATIAN_EDITOR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__) */
- /* PMT VIKAS END 20050707 */
- else
- {
- gui_print_truncated_borderd_text(
- MMI_title_x + tx,
- MMI_title_y + ((MMI_title_height >> 1) - (character_height >> 1)),
- tw,
- MMI_title_string);
- }
- #else /* defined(__MMI_DEFAULT_THEME_3__) || defined(__MMI_DEFAULT_THEME_1__) */
- if ((gOnFullScreen & MMI_IN_FULL_SCREEN || gOnFullScreen & MMI_LEAVE_FULL_SCREEN) &&
- !(gOnFullScreen & MMI_LEAVE_FULL_IDLE_SCREEN))
- {
- gui_print_truncated_text(
- MMI_title_x + tx,
- ((MMI_title_height >> 1) - (character_height >> 1)),
- tw,
- MMI_title_string);
- }
- else
- {
- gui_print_truncated_text(
- MMI_title_x + tx,
- MMI_title_y + ((MMI_title_height >> 1) - (character_height >> 1)),
- tw,
- MMI_title_string);
- }
- #endif /* defined(__MMI_DEFAULT_THEME_3__) || defined(__MMI_DEFAULT_THEME_1__) */
- }
- gdi_layer_pop_clip();
- gdi_layer_unlock_frame_buffer();
- if (MMI_title_icon2 == NULL)
- {
- gui_hide_menu_shortcut();
- show_menu_shortcut();
- }
- if ((gOnFullScreen & MMI_IN_FULL_SCREEN || gOnFullScreen & MMI_LEAVE_FULL_SCREEN) &&
- !(gOnFullScreen & MMI_LEAVE_FULL_IDLE_SCREEN))
- {
- gdi_layer_blt_previous(MMI_title_x, 0, MMI_title_x + MMI_title_width - 1, MMI_title_height - 1);
- }
- else
- {
- gdi_layer_blt_previous(
- MMI_title_x,
- MMI_title_y,
- MMI_title_x + MMI_title_width - 1,
- MMI_title_y + MMI_title_height - 1);
- }
- }
- extern U8 gNSMBuffer[];
- /*****************************************************************************
- * FUNCTION
- * mmi_nsm2_category275_draw_inbox_header
- * DESCRIPTION
- *
- * PARAMETERS
- * yy [IN]
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_nsm2_category275_draw_inbox_header(S32 yy, S32 x1, S32 y1, S32 x2, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 pic_offset;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- pic_offset = ((LCD_WIDTH - current_MMI_theme->scrollbar_size) >> 1) - 36; /* To align nsm picture in centre */
- gui_show_image(x1 + pic_offset, y1 + MMI_multiline_inputbox.text_offset_y + 1, (U8*) gNSMBuffer);
- }
- #endif /* (defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)) || defined(__MMI_SMART_MESSAGE_MT__) */
- #if (defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__))
- extern nsm_msg_struct g_nsm_msg_context; /* PMT JAI : 06012005 */
- /*****************************************************************************
- * FUNCTION
- * mmi_nsm2_category275_draw_header
- * DESCRIPTION
- *
- * PARAMETERS
- * identifier [IN]
- * y_offset [IN]
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_nsm2_category275_draw_header(U32 identifier, S32 y_offset, S32 x1, S32 y1, S32 x2, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 pic_offset;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- pic_offset = ((LCD_WIDTH - current_MMI_theme->scrollbar_size) >> 1) - 36;
- gui_show_image(x1 + pic_offset, y1 + MMI_multiline_inputbox.text_offset_y + 1, (U8*) g_nsm_msg_context.picbuffer);
- }
- #endif /* (defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)) */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory354Screen
- * DESCRIPTION
- * Displays the category354 screen ( List menu with two text rows )
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon displayed with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Left softkey icon
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Right softkey icon
- * number_of_items [IN] Number of items in the menu
- * list_of_items1 [IN] String array1 of items
- * list_of_items2 [IN] String array2 of items
- * list_of_icons [IN] Array of icons
- * highlighted_item [IN] Default item to be highlighted (if there is no history)
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory354Screen(
- U8 *title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 number_of_items,
- U8 **list_of_items1,
- U8 **list_of_items2,
- U16 *list_of_icons,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 i;
- S32 img_width, img_height;
- S32 str_width, str_height;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- create_fixed_icontext_list_menuitems(2, 1);
- associate_fixed_icontext_list_list();
- ShowListCategoryScreen(
- (UI_string_type) title,
- get_image(title_icon),
- get_string(left_softkey),
- get_image(left_softkey_icon),
- get_string(right_softkey),
- get_image(right_softkey_icon),
- number_of_items);
- /* we need two lines */
- resize_fixed_icontext_list_menuitems(0, get_menu_item_height() << 1);
- gdi_image_get_dimension_id(list_of_icons[0], &img_width, &img_height);
- gui_measure_string((UI_string_type) list_of_items1[0], &str_width, &str_height);
- set_fixed_icontext_list_icon_coordinates(0, 1, 1, img_width, img_height);
- set_fixed_icontext_list_text_coordinates(
- 0,
- 20,
- (get_menu_item_height() - str_height) >> 1,
- MMI_fixed_icontext_list_menuitem.width - 20,
- get_menu_item_height());
- set_fixed_icontext_list_text_coordinates(
- 1,
- 20,
- get_menu_item_height() + ((get_menu_item_height() - str_height) >> 1),
- MMI_fixed_icontext_list_menuitem.width - 20,
- get_menu_item_height());
- for (i = 0; i < number_of_items; i++)
- {
- fixed_icontext_list_item_insert(i);
- add_fixed_icontext_list_item_icon(i, 0, wgui_get_list_menu_icon(i, list_of_icons[i]));
- add_fixed_icontext_list_item_text(i, 0, (UI_string_type) list_of_items1[i]);
- add_fixed_icontext_list_item_text(i, 1, (UI_string_type) list_of_items2[i]);
- wgui_pop_up_description_strings[i].text_strings[0] = NULL;
- }
- MMI_fixed_icontext_list_menuitem.flags &= ~UI_MENUITEM_CENTER_TEXT_Y;
- MMI_fixed_icontext_list_menuitem.flags &= ~UI_MENUITEM_CENTER_ICON_Y;
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_MARQUEE_SCROLL;
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_AUTO_CHOOSE_MARQUEE;
- h_flag = set_list_menu_category_history(MMI_CATEGORY52_ID, history_buffer);
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- MMI_title_string = (UI_string_type) title;
- MMI_title_icon = (PU8) get_image(title_icon);
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory354Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_data.s32flags = 0;
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY52_ID;
- dm_data.s32flags = 0;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- } /* end of ShowCategory354Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory354Screen
- * DESCRIPTION
- * Exits the category354 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory354Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_Y;
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_CENTER_ICON_Y;
- MMI_fixed_icontext_list_menuitem.flags &= ~UI_MENUITEM_MARQUEE_SCROLL;
- MMI_fixed_icontext_list_menuitem.flags &= ~UI_MENUITEM_AUTO_CHOOSE_MARQUEE;
- }
- /* PMT Pankaj Start ---- For Editable Equalizer Settings Support. */
- #ifdef __MMI_EDITABLE_AUDIO_EQUALIZER__
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory334Screen
- * DESCRIPTION
- * Redraws the category334 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory334Screen()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 aud_eq_bg_img = NULL;
- PU8 aud_eq_active_bar_img = NULL;
- PU8 aud_eq_sound_level_ind_img = NULL;
- S32 index;
- S32 width = 0, height = 0, width_active = 0, height_active = 0;
- long start_x_slider, middle_point_y_of_bar;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- clear_screen();
- show_title_status_icon();
- draw_title();
- /* get the images required */
- aud_eq_bg_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_BG);
- aud_eq_active_bar_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_ACTIVE_BAR);
- aud_eq_sound_level_ind_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_VAL_INDICATOR);
- /* calcualte how much one pixel represents in a bar */
- temp_float_var = (float)256 / (float)g_audio_equalizer_scrollable_ht;
- one_pixel_represents = 10 * temp_float_var;
- gdi_layer_push_clip();
- /* show the background image */
- if (!wgui_category_screen_no_buttons)
- {
- gdi_layer_set_clip(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- (UI_device_height - MMI_button_bar_height));
- gui_show_transparent_image(0, (MMI_title_y + MMI_title_height), aud_eq_bg_img, gui_transparent_color(0, 0, 0));
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- }
- else
- {
- gdi_layer_set_clip(0, (MMI_title_y + MMI_title_height), UI_device_width - 1, (UI_device_height - 1));
- gui_show_transparent_image(0, (MMI_title_y + MMI_title_height), aud_eq_bg_img, gui_transparent_color(0, 0, 0));
- }
- /* measure the slider image. */
- gui_measure_image(aud_eq_sound_level_ind_img, &width, &height);
- /* show the active bar...the x coordinate is based on the difference in width of the active and inactive bar. */
- gui_measure_image(aud_eq_active_bar_img, &width_active, &height_active);
- gui_show_image(
- g_audio_equalizer_bar_start_x - (width_active - g_audio_equalizer_bar_width) / 2 + g_audio_equalizer_current_setting_info.active_bar * (g_audio_equalizer_bar_width + g_audio_equalizer_dist_btw_bars),
- (MMI_title_y + MMI_title_height + g_audio_equalizer_bar_start_y),
- aud_eq_active_bar_img);
- //show the indicator for sound levels.
- //calculate the middle point of a bar
- middle_point_y_of_bar =
- MMI_title_y + MMI_title_height + g_audio_equalizer_bar_start_y + (g_audio_equalizer_bar_height - 1) / 2;
- start_x_slider = g_audio_equalizer_bar_start_x - (width - g_audio_equalizer_bar_width) / 2;
- for (index = 0; index < NUM_OF_BARS_IN_A_SETTING; index++)
- {
- long y_coord =
- middle_point_y_of_bar -
- (long)((float)g_audio_equalizer_current_setting_info.sound_level[index] / one_pixel_represents) -
- height / 2;
- if (g_audio_equalizer_current_setting_info.sound_level[index] == 0 ||
- g_audio_equalizer_current_setting_info.sound_level[index] > 0)
- {
- y_coord++;
- }
- gui_show_image(start_x_slider, y_coord, aud_eq_sound_level_ind_img);
- start_x_slider += (g_audio_equalizer_bar_width + g_audio_equalizer_dist_btw_bars);
- }
- gdi_layer_pop_clip();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory334Screen
- * DESCRIPTION
- * Exitss the category334 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory334Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- #ifdef __MMI_DRAW_MANAGER__
- /*****************************************************************************
- * FUNCTION
- * dm_category_334_controlled_area
- * DESCRIPTION
- * Redraws the category334 screen using Draw Manager
- * PARAMETERS
- * coordinate [?]
- * RETURNS
- * void
- *****************************************************************************/
- void dm_category_334_controlled_area(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- RedrawCategory334Screen();
- }
- #endif /* __MMI_DRAW_MANAGER__ */
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * category334_get_bar_index
- * DESCRIPTION
- * Gets the bar index of the bar which contains the input point.
- * PARAMETERS
- * point [IN]
- * RETURNS
- * S8 index of the bar
- *****************************************************************************/
- S8 category334_get_bar_index(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 i, j;
- S16 dx;
- S32 width, height;
- PU8 aud_eq_sound_level_ind_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_VAL_INDICATOR);
- mmi_pen_polygon_area_struct bar_area;
- mmi_pen_point_struct bar_vertex[4];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_measure_image(aud_eq_sound_level_ind_img, &width, &height);
- /* the limits of the width of a bar are taken as the width of the slider. slider width is assumed to be the maximum, bcos it should be. */
- if (width < g_audio_equalizer_bar_width)
- {
- width = g_audio_equalizer_bar_width;
- }
- /* set bar area */
- bar_area.num = 4;
- bar_area.points = (mmi_pen_point_struct*) & bar_vertex;
- bar_vertex[0].x = (S16) g_audio_equalizer_bar_start_x - (width - g_audio_equalizer_bar_width) / 2;
- bar_vertex[0].y = (S16) MMI_title_y + MMI_title_height + g_audio_equalizer_bar_start_y;
- bar_vertex[1].x = bar_vertex[0].x + width - 1;
- bar_vertex[1].y = bar_vertex[0].y;
- bar_vertex[2].x = bar_vertex[1].x;
- bar_vertex[2].y = bar_vertex[0].y + g_audio_equalizer_bar_height - 1;
- bar_vertex[3].x = bar_vertex[0].x;
- bar_vertex[3].y = bar_vertex[2].y;
- dx = (S16) g_audio_equalizer_bar_width + g_audio_equalizer_dist_btw_bars;
- for (i = 0; i < NUM_OF_BARS_IN_A_SETTING; i++)
- {
- if (mmi_pen_check_inside_polygon(&bar_area, point))
- {
- return i;
- }
- for (j = 0; j < 4; j++)
- {
- bar_vertex[j].x += dx;
- }
- }
- return (S8) - 1;
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * wgui_audio_equalizer_activate_bar
- * DESCRIPTION
- * Activates the bar having index same as the input argument.
- * PARAMETERS
- * bar_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_audio_equalizer_activate_bar(U8 bar_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- long start_x_img, start_y_img, middle_pt_y_in_bar;
- S16 dx;
- S32 bar_width, width, height, width_active, height_active;
- PU8 aud_eq_active_bar_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_ACTIVE_BAR);
- PU8 aud_eq_sound_level_ind_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_VAL_INDICATOR);
- PU8 aud_eq_bg_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_BG);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- gdi_layer_push_clip();
- /* miscellaneous calculations */
- gui_measure_image(aud_eq_sound_level_ind_img, &width, &height);
- bar_width = g_audio_equalizer_bar_width;
- if (width > g_audio_equalizer_bar_width)
- {
- bar_width = width;
- }
- dx = (S16) g_audio_equalizer_bar_width + g_audio_equalizer_dist_btw_bars;
- /* inactivate the already active bar. */
- start_x_img =
- g_audio_equalizer_bar_start_x - (bar_width - g_audio_equalizer_bar_width) / 2 +
- dx * g_audio_equalizer_current_setting_info.active_bar;
- start_y_img = MMI_title_y + MMI_title_height + g_audio_equalizer_bar_start_y;
- middle_pt_y_in_bar = start_y_img + (g_audio_equalizer_bar_height - 1) / 2;
- gdi_layer_set_clip(
- start_x_img,
- start_y_img,
- start_x_img + bar_width - 1,
- start_y_img + g_audio_equalizer_bar_height - 1);
- /* 1. show the inactive bar in place of active bar... */
- gui_show_transparent_image(0, MMI_title_y + MMI_title_height, aud_eq_bg_img, gui_transparent_color(0, 0, 0));
- /* 2. show the slider control */
- start_x_img =
- g_audio_equalizer_bar_start_x - (width - g_audio_equalizer_bar_width) / 2 +
- dx * g_audio_equalizer_current_setting_info.active_bar;
- start_y_img =
- middle_pt_y_in_bar -
- (long)((float)g_audio_equalizer_current_setting_info.
- sound_level[g_audio_equalizer_current_setting_info.active_bar] / one_pixel_represents + height / 2);
- if (g_audio_equalizer_current_setting_info.sound_level[g_audio_equalizer_current_setting_info.active_bar] >= 0)
- {
- start_y_img++;
- }
- gui_show_image(start_x_img, start_y_img, aud_eq_sound_level_ind_img);
- /* activate the new bar */
- g_audio_equalizer_current_setting_info.active_bar = bar_index;
- start_x_img =
- g_audio_equalizer_bar_start_x - (bar_width - g_audio_equalizer_bar_width) / 2 +
- dx * g_audio_equalizer_current_setting_info.active_bar;
- start_y_img = MMI_title_y + MMI_title_height + g_audio_equalizer_bar_start_y;
- gdi_layer_set_clip(
- start_x_img,
- start_y_img,
- start_x_img + bar_width - 1,
- start_y_img + g_audio_equalizer_bar_height - 1);
- /* Step 1.paste the inactive bar image.... */
- gui_show_transparent_image(0, MMI_title_y + MMI_title_height, aud_eq_bg_img, gui_transparent_color(0, 0, 0));
- /* Step 2.paste the active bar image */
- gui_measure_image(aud_eq_active_bar_img, &width_active, &height_active);
- start_x_img =
- g_audio_equalizer_bar_start_x - (width_active - g_audio_equalizer_bar_width) / 2 +
- dx * g_audio_equalizer_current_setting_info.active_bar;
- gui_show_image(start_x_img, start_y_img, aud_eq_active_bar_img);
- /* Step 3.paste the slider */
- start_x_img =
- g_audio_equalizer_bar_start_x - (width - g_audio_equalizer_bar_width) / 2 +
- dx * g_audio_equalizer_current_setting_info.active_bar;
- start_y_img =
- middle_pt_y_in_bar -
- (long)((float)g_audio_equalizer_current_setting_info.
- sound_level[g_audio_equalizer_current_setting_info.active_bar] / one_pixel_represents + height / 2);
- if (g_audio_equalizer_current_setting_info.sound_level[g_audio_equalizer_current_setting_info.active_bar] >= 0)
- {
- start_y_img++;
- }
- gui_show_image(start_x_img, start_y_img, aud_eq_sound_level_ind_img);
- gdi_layer_pop_clip();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_audio_equalizer_change_sound_level
- * DESCRIPTION
- * change the sound level on the screen using the sound level value.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_audio_equalizer_change_sound_level(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 aud_eq_active_bar_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_ACTIVE_BAR);
- PU8 aud_eq_sound_level_ind_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_VAL_INDICATOR);
- PU8 aud_eq_bg_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_BG);
- long start_x_img, start_y_img, middle_pt_y_in_bar;
- S32 bar_width, width, height, width_active, height_active;
- S16 dx = (S16) (g_audio_equalizer_bar_width + g_audio_equalizer_dist_btw_bars);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- gdi_layer_push_clip();
- /* miscellaneous calculations */
- gui_measure_image(aud_eq_sound_level_ind_img, &width, &height);
- bar_width = g_audio_equalizer_bar_width;
- if (width > g_audio_equalizer_bar_width)
- {
- bar_width = width;
- }
- /* firt paste the inactive image on the active bar. */
- start_x_img =
- g_audio_equalizer_bar_start_x - (bar_width - g_audio_equalizer_bar_width) / 2 +
- dx * g_audio_equalizer_current_setting_info.active_bar;
- start_y_img = MMI_title_y + MMI_title_height + g_audio_equalizer_bar_start_y;
- middle_pt_y_in_bar = start_y_img + (g_audio_equalizer_bar_height - 1) / 2;
- gdi_layer_set_clip(
- start_x_img,
- start_y_img,
- start_x_img + bar_width - 1,
- start_y_img + g_audio_equalizer_bar_height - 1);
- gui_show_transparent_image(0, MMI_title_y + MMI_title_height, aud_eq_bg_img, gui_transparent_color(0, 0, 0));
- /* paste the active bar image on the already active bar */
- gui_measure_image(aud_eq_active_bar_img, &width_active, &height_active);
- start_x_img =
- g_audio_equalizer_bar_start_x - (width_active - g_audio_equalizer_bar_width) / 2 +
- dx * g_audio_equalizer_current_setting_info.active_bar;
- gui_show_image(start_x_img, start_y_img, aud_eq_active_bar_img);
- /* paste the slider */
- start_x_img =
- g_audio_equalizer_bar_start_x - (width - g_audio_equalizer_bar_width) / 2 +
- dx * g_audio_equalizer_current_setting_info.active_bar;
- start_y_img =
- middle_pt_y_in_bar -
- (long)((float)g_audio_equalizer_current_setting_info.
- sound_level[g_audio_equalizer_current_setting_info.active_bar] / one_pixel_represents + height / 2);
- if (g_audio_equalizer_current_setting_info.sound_level[g_audio_equalizer_current_setting_info.active_bar] >= 0)
- {
- start_y_img++;
- }
- gui_show_image(start_x_img, start_y_img, aud_eq_sound_level_ind_img);
- gdi_layer_pop_clip();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * category334_pen_down_handler
- * DESCRIPTION
- * Handler for pen down event.
- * PARAMETERS
- * point [IN]
- * RETURNS
- * MMI_BOOL
- *****************************************************************************/
- MMI_BOOL category334_pen_down_handler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 bar_index;
- S16 dx;
- S32 width, height;
- PU8 aud_eq_sound_level_ind_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_VAL_INDICATOR);
- mmi_pen_polygon_area_struct area;
- mmi_pen_point_struct vertex[4];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* measure the slider image. */
- gui_measure_image(aud_eq_sound_level_ind_img, &width, &height);
- if (width < g_audio_equalizer_bar_width)
- {
- width = (S32) g_audio_equalizer_bar_width;
- }
- /* set bar area */
- dx = (S16) g_audio_equalizer_bar_width + g_audio_equalizer_dist_btw_bars;
- area.num = 4;
- area.points = (mmi_pen_point_struct*) & vertex;
- vertex[0].x = (S16) g_audio_equalizer_bar_start_x - (width - g_audio_equalizer_bar_width) / 2;
- vertex[0].y = (S16) MMI_title_y + MMI_title_height + g_audio_equalizer_bar_start_y;
- vertex[1].x = vertex[0].x + dx * (NUM_OF_BARS_IN_A_SETTING - 1) + width - 1;
- vertex[1].y = vertex[0].y;
- vertex[2].x = vertex[1].x;
- vertex[2].y = vertex[0].y + g_audio_equalizer_bar_height - 1;
- vertex[3].x = vertex[0].x;
- vertex[3].y = vertex[2].y;
- /* check if hit in the bar area: */
- if (!mmi_pen_check_inside_polygon(&area, point))
- {
- return FALSE;
- }
- //now since the pen down has been done in the bar area.
- //check whether some frequency bar has been hit or not...if hit then activate it(if not activated earlier).
- if ((bar_index = category334_get_bar_index(point)) != (S8) - 1)
- {
- S16 middle_pt_y_in_bar, slider_center_y, slider_start_y, slider_end_y, start_x;
- /* activate the bar if not active... */
- if (bar_index != g_audio_equalizer_current_setting_info.active_bar)
- {
- wgui_audio_equalizer_activate_bar(bar_index);
- }
- //change the sound level if the bar has been hit at a place which is different from original sound level of the bar
- //1. check if the pen down been done on the slider itself or some other place on the bar.
- //get the original position of the slider from sound level.
- middle_pt_y_in_bar = vertex[0].y + (g_audio_equalizer_bar_height - 1) / 2;
- slider_center_y =
- middle_pt_y_in_bar -
- (S16) ((float)g_audio_equalizer_current_setting_info.sound_level[bar_index] / one_pixel_represents);
- slider_start_y = slider_center_y - height / 2;
- slider_end_y = slider_center_y + height / 2;
- start_x = vertex[0].x + dx * bar_index;
- if (((point.x >= start_x) && (point.x < start_x + width)) &&
- ((point.y >= slider_start_y) && (point.y <= slider_end_y)))
- {
- return TRUE; /* we don't need to do anything in this case since pen down is on the slider itself */
- } /* if hit on the slider area. */
- else /* if hit somewhere else on the bar.then the slider is to be shifted to new position. */
- {
- /* find the difference between new and original. */
- S16 difference;
- /* modify point.y if it is between the start y of the bar and the start y + height/2, where height is height of the slider. */
- if (point.y < middle_pt_y_in_bar - (g_audio_equalizer_scrollable_ht) / 2)
- {
- point.y = middle_pt_y_in_bar - (g_audio_equalizer_scrollable_ht) / 2;
- }
- else if (point.y > middle_pt_y_in_bar + (g_audio_equalizer_scrollable_ht) / 2)
- {
- point.y = middle_pt_y_in_bar + (g_audio_equalizer_scrollable_ht) / 2;
- }
- /* find the difference between the place hit and the currenly occupied coordinates of slider. */
- difference = slider_center_y - point.y;
- mmi_settings_audio_equalizer_change_sound_level((S16) ((float)difference * one_pixel_represents));
- return TRUE;
- }
- }
- else
- {
- return FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * category334_pen_move_handler
- * DESCRIPTION
- * Handler for pen move event.
- * PARAMETERS
- * point [IN]
- * RETURNS
- * MMI_BOOL
- *****************************************************************************/
- MMI_BOOL category334_pen_move_handler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 bar_start_x, bar_start_y, middle_pt_y_in_bar, dx;
- S32 width, height;
- PU8 aud_eq_sound_level_ind_img = (PU8) GetImage(SOUND_EFFECT_AUDIO_EQ_VAL_INDICATOR);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* measure the slider image. */
- gui_measure_image(aud_eq_sound_level_ind_img, &width, &height);
- if (width < g_audio_equalizer_bar_width)
- {
- width = (S32) g_audio_equalizer_bar_width;
- }
- dx = (S16) (g_audio_equalizer_bar_width + g_audio_equalizer_dist_btw_bars);
- bar_start_x =
- g_audio_equalizer_bar_start_x - (width - g_audio_equalizer_bar_width) / 2 +
- dx * g_audio_equalizer_current_setting_info.active_bar;
- bar_start_y = MMI_title_y + MMI_title_height + g_audio_equalizer_bar_start_y;
- //check that whether the point is inside the active bar area.
- //the concept being used is that the slider movement is to be done only in case the point is with in bar area
- //and only vertical component is to be used for movement.
- middle_pt_y_in_bar = bar_start_y + (g_audio_equalizer_bar_height - 1) / 2;
- if (point.x >= bar_start_x && point.x < bar_start_x + width &&
- point.y >= (middle_pt_y_in_bar - g_audio_equalizer_scrollable_ht / 2) &&
- point.y <= (middle_pt_y_in_bar + g_audio_equalizer_scrollable_ht / 2))
- {
- /* 1. Find the the middle point of the slider present on the bar. */
- S16 mid_pt_slider =
- middle_pt_y_in_bar -
- (S16) ((float)g_audio_equalizer_current_setting_info.
- sound_level[g_audio_equalizer_current_setting_info.active_bar] / one_pixel_represents);
- if (mid_pt_slider != point.y) /* the case when the sound level is to be modified and the slider shifted. */
- {
- mmi_settings_audio_equalizer_change_sound_level((S16)
- ((float)(mid_pt_slider - point.y) * one_pixel_represents));
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- else
- {
- return FALSE;
- }
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory334Screen
- * DESCRIPTION
- * Show category funciton for equalizer screen
- * PARAMETERS
- * title [IN]
- * title_icon [IN]
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN]
- * right_softkey_icon [IN]
- * values [?]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory334Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- signed char *values,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_DRAW_MANAGER__
- dm_data_struct dm_data;
- #endif
- S8 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(history_buffer);
- gdi_layer_lock_frame_buffer();
- SetupCategoryKeyHandlers();
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- MMI_menu_shortcut_number = -1;
- if ((left_softkey == 0) && (left_softkey_icon == 0) && (right_softkey == 0) && (right_softkey_icon == 0))
- {
- wgui_category_screen_no_buttons = 1;
- }
- else
- {
- wgui_category_screen_no_buttons = 0;
- }
- for (index = 0; index < NUM_OF_BARS_IN_A_SETTING; index++)
- {
- g_audio_equalizer_current_setting_info.sound_level[index] = 10 * values[index];
- }
- gdi_layer_unlock_frame_buffer();
- #ifndef __MMI_DRAW_MANAGER__
- ExitCategoryFunction = ExitCategory334Screen;
- RedrawCategoryFunction = RedrawCategory334Screen;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- RedrawCategoryFunction();
- #else /* __MMI_DRAW_MANAGER__ */
- #if (defined __MMI_TOUCH_SCREEN__) && (defined __MMI_DRAW_MANAGER__)
- wgui_register_category_screen_control_area_pen_handlers(category334_pen_down_handler, MMI_PEN_EVENT_DOWN);
- wgui_register_category_screen_control_area_pen_handlers(category334_pen_move_handler, MMI_PEN_EVENT_MOVE);
- #endif /* (defined __MMI_TOUCH_SCREEN__) && (defined __MMI_DRAW_MANAGER__) */
- ExitCategoryFunction = ExitCategory334Screen;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- RedrawCategoryFunction = dm_redraw_category_screen;
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY334_ID;
- dm_data.s32flags = 0;
- dm_setup_data(&dm_data);
- dm_register_category_controlled_callback(dm_category_334_controlled_area);
- dm_redraw_category_screen();
- #endif /* __MMI_DRAW_MANAGER__ */
- }
- #endif /* __MMI_EDITABLE_AUDIO_EQUALIZER__ */
- /* PMT Pankaj End ---- For Editable Equalizer Settings Support. */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory401Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * percentage [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory401Screen(U16 percentage)
- {
- #if (defined(__MTK_TARGET__) && !defined(__MAUI_BASIC__) && !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI))
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 bar_width = 0, bar_height = 0;
- S32 bar_x = 0, bar_y = 0;
- S32 fill_width = 0;
- S32 str_width = 0, str_height = 0;
- S32 str_x = 0, str_y = 0;
- U8 *bar_bg_image = nfb_progress_images[0];
- U16 digit[3], idx = 0;
- S32 digit_width[3];
- S32 digit_height[3];
- static U8 isInited = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (bmt_is_wdt_power() == KAL_TRUE || BMT.PWRon == RTCPWRON)
- {
- return;
- }
- if (!isInited)
- {
- isInited = 1;
- gdi_init();
- custom_cfg_gpio_set_level(GPIO_DEV_LED_MAINLCD, 5);
- setup_UI_wrappers();
- }
- gdi_layer_lock_frame_buffer();
- gdi_layer_clear(GDI_COLOR_WHITE);
- gdi_layer_push_clip();
- gdi_layer_reset_clip();
- /* percentage images */
- /* decide which images are used */
- if (percentage == 100)
- {
- digit[2] = 1;
- digit[1] = 0;
- digit[0] = 0;
- }
- else if (percentage == 0)
- {
- digit[2] = 0;
- digit[1] = 0;
- digit[0] = 0;
- }
- else if (percentage > 0 && percentage < 100)
- {
- digit[2] = 0;
- digit[1] = percentage / 10;
- digit[0] = percentage - (digit[1] * 10);
- }
- else
- {
- MMI_ASSERT(percentage <= 100);
- }
- /* calculate digit image width and height */
- gdi_image_get_dimension(nfb_progress_images[11], &str_width, &str_height);
- for (idx = 2; idx > 0; idx--)
- {
- if (digit[idx] != 0 || digit[2] == 1)
- {
- gdi_image_get_dimension(nfb_progress_images[digit[idx] + 1], &digit_width[idx], &digit_height[idx]);
- str_width += digit_width[idx];
- }
- }
- gdi_image_get_dimension(nfb_progress_images[digit[0] + 1], &digit_width[0], &digit_height[0]);
- /* decide digit images position */
- str_x = (UI_device_width - str_width) >> 1;
- str_y = (UI_device_height >> 1) + 2;
- /* show the digit images */
- for (idx = 2; idx > 0; idx--)
- {
- if (digit[idx] != 0 || digit[2] == 1)
- {
- gdi_image_draw(str_x, str_y, nfb_progress_images[digit[idx] + 1]);
- str_x += digit_width[idx];
- }
- }
- gdi_image_draw(str_x, str_y, nfb_progress_images[digit[0] + 1]);
- str_x += digit_width[0];
- gdi_image_draw(str_x, str_y, nfb_progress_images[11]);
- /* Progress bar background image */
- gdi_image_get_dimension(bar_bg_image, &bar_width, &bar_height);
- bar_x = (UI_device_width - bar_width - 2 /* gap */ ) >> 1;
- bar_y = (UI_device_height >> 1) - bar_height;
- gdi_layer_set_clip(bar_x, bar_y, bar_x + bar_width - 1, bar_y + bar_height - 1);
- /* Progress bar fill area */
- fill_width = ((bar_width - (MMI_CAT401_X_OFFSET << 1)) * (S32) percentage) / 100;
- gdi_draw_solid_rect(
- bar_x + MMI_CAT401_X_OFFSET,
- bar_y,
- bar_x + MMI_CAT401_X_OFFSET + fill_width - 1,
- bar_y + bar_height - 1,
- GDI_COLOR_RED);
- gdi_image_draw(bar_x, bar_y, bar_bg_image);
- gdi_layer_pop_clip();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- #endif /* (defined(__MTK_TARGET__) && !defined(__MAUI_BASIC__) && !defined(__L1_STANDALONE__) && !defined(EMPTY_MMI)) */
- }
- /*****************************************************************************
- * FUNCTION
- * cat201_register_language_changed_indicator
- * DESCRIPTION
- *
- * PARAMETERS
- * FuncPtr [IN]
- * RETURNS
- * void
- *****************************************************************************/
- BOOL(*wgui_check_language_changed) (U8 input_type) = NULL;
- void cat201_register_language_changed_indicator(BOOL(*FuncPtr) (U8 input_type))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_check_language_changed = FuncPtr;
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory201Screen
- * DESCRIPTION
- * exit function of category201
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- /* Begin AP input mode set */
- extern U8 MMI_AP_set_input_mode_set;
- /* End AP input mode set */
- void ExitCategory201Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- set_MMI_current_input_type();
- reset_multitaps();
- reset_dynamic_list();
- reset_pop_up_descriptions();
- wgui_close_inputbox();
- /* Begin AP input mode set */
- if (MMI_AP_set_input_mode_set)
- {
- wgui_unset_AP_required_input_mode_set_flag();
- }
- /* End AP input mode set */
- cat200_search_function = NULL;
- wgui_check_language_changed = NULL;
- wgui_reset_multiline_inputbox_register_up_down_key_funcptr();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory201HistorySize
- * DESCRIPTION
- * Gets the history buffer size of category 200
- * PARAMETERS
- * void
- * RETURNS
- * size in U8s of the history buffer
- *****************************************************************************/
- S32 GetCategory201HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* MTK Terry for History issue */
- return (((sizeof(list_menu_category_history) + 3) / 4) * 4 + sizeof(multiline_inputbox_category_history));
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory201History
- * DESCRIPTION
- * Gets the history buffer of category200
- * PARAMETERS
- * history_buffer [?]
- * RETURNS
- * return history buffer
- *****************************************************************************/
- U8 *GetCategory201History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* MTK Terry for History Issue */
- S32 s;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_list_menu_category_history(MMI_CATEGORY201_ID, history_buffer);
- s = sizeof(list_menu_category_history);
- s = (s + 3) / 4;
- s *= 4;
- get_multiline_inputbox_category_history(MMI_CATEGORY201_ID, (U8*) (history_buffer + s), MMI_current_input_type);
- return (history_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * SetCategory201RightSoftkeyFunction
- * DESCRIPTION
- *
- * PARAMETERS
- * f [IN]
- * k [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory201RightSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(k);
- wgui_inputbox_RSK_function = f;
- }
- /* MTK Leo add, virtual keypad */
- /*****************************************************************************
- * FUNCTION
- * cat201_virtual_keypad_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void cat201_virtual_keypad_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_TOUCH_SCREEN__)
- mmi_pen_editor_resize_multiline_input_box_for_vk();
- #endif
- }
- /* MTK Leo add for category201 */
- /*****************************************************************************
- * FUNCTION
- * refresh_category201_search_list_change_list
- * DESCRIPTION
- * input call back function of category200 multi tap
- * PARAMETERS
- * no_entries [IN]
- * UI_character_type(?) [IN] Inp
- * RETURNS
- * void
- *****************************************************************************/
- void refresh_category201_search_list_change_list(S32 no_entries)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 shortcut_width;
- S32 max_entries = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.highlighted_item = 0;
- MMI_fixed_list_menu.n_items = no_entries;
- MMI_fixed_list_menu.displayed_items = no_entries;
- if (wgui_check_application_present)
- {
- wgui_check_application_present(&max_entries);
- }
- shortcut_width = set_menu_item_count(max_entries) + 7; /* number of element increases at the run time */
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - shortcut_width, MMI_title_y);
- #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
- show_softkey_background();
- #endif
- if (no_entries > 0)
- {
- dynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- draw_title(); /* 110805 quick search Calvin added */
- }
- else
- {
- gui_fixed_icontext_menuitem_stop_scroll();
- gui_pop_up_description_stop_scroll();
- MMI_menu_shortcut_number = 0;
- draw_title();
- wgui_current_pop_up_description_index = -1;
- }
- show_dynamic_list();
- }
- /*****************************************************************************
- * FUNCTION
- * refresh_category201_search_list
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void refresh_category201_search_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 no_entries = 0;
- U8 *name = MMI_multiline_inputbox.text;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- no_entries = cat200_search_function(name);
- load_dynamic_item_buffer(no_entries);
- if (no_entries >= 0)
- {
- refresh_category201_search_list_change_list(no_entries);
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- }
- /* MTK Leo end */
- /*****************************************************************************
- * FUNCTION
- * cat201_register_key_func
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void cat201_register_key_func(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* when first word is highlighted, user should not be able to go to last item by pressing up arrow key. */
- if (MMI_fixed_list_menu.highlighted_item != 0)
- {
- SetKeyHandler(dynamic_list_goto_previous_item, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(dynamic_list_goto_previous_item, KEY_VOL_UP, KEY_EVENT_DOWN);
- }
- SetKeyHandler(dynamic_list_goto_next_item, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(dynamic_list_goto_next_item, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory201Screen
- * DESCRIPTION
- * category screen of phone search
- * PARAMETERS
- * title [IN] Title id
- * title_icon [IN] Title icon
- * left_softkey [IN] Left soft key label
- * left_softkey_icon [IN] Left soft key icon
- * right_softkey [IN] Right soft key label
- * right_softkey_icon [IN] Right soft key icon
- * number_of_items [IN] Number of items
- * get_item_func [IN]
- * get_hint_func [IN]
- * highlighted_item [IN] Highlighted item index
- * search_image [IN] Seach image
- * buffer [IN] Buffer
- * buffer_max_length [IN]
- * input_type [IN]
- * history_buffer [IN] Histpry buffer
- * required_input_mode_set [?]
- * top_msg(?) [IN] Message display below title bar
- * list_of_items(?) [IN] List of items
- * max_buffer_legth(?) [IN] Max size of buffer length
- * list_of_icons1(?) [IN] List of icons
- * RETURNS
- * void
- *****************************************************************************/
- extern U8 wgui_multiline_inputbox_input_type;
- extern void cat5_virtual_keypad_callback(void);
- extern void wgui_redraw_input_information_bar(void);
- void ShowCategory201Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 number_of_items,
- GetItemFuncPtr get_item_func,
- GetHintFuncPtr get_hint_func,
- S32 highlighted_item,
- U16 search_image,
- U8 *buffer,
- S32 buffer_max_length,
- S16 input_type,
- U8 *history_buffer,
- S16 *required_input_mode_set)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- U8 h_flag;
- S32 temp_w = 0, temp_h = 0;
- U8 *img = NULL;
- S32 input_box_width = 0;
- BOOL languageChanged = FALSE;
- S32 iwidth, iheight, max_entries = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- MMI_menu_shortcut_number = -1;
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- /* Begin AP input mode set */
- if (required_input_mode_set != NULL)
- {
- wgui_fill_AP_required_input_mode_set(required_input_mode_set);
- wgui_set_AP_required_input_mode_set_flag();
- }
- /* End AP input mode set */
- #ifdef __MMI_T9__
- InuptMethodEnterCategory5();
- #elif defined __MMI_ZI__
- ZiInuptMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 start
- #elif defined __MMI_CSTAR__
- CstarInputMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 end
- #elif defined __MMI_KA__
- KonkaInuptMethodEnterCategory5();
- #elif defined __MMI_ITAP__
- /* under construction !*/
- #endif
- create_fixed_icontext_menuitems();
- MMI_current_menu_type = LIST_MENU;
- associate_fixed_icontext_list();
- MMI_disable_title_shortcut_display = 1;
- if (history_buffer)
- {
- if (wgui_multiline_inputbox_input_type != 0)
- {
- languageChanged = wgui_check_language_changed((U8) wgui_multiline_inputbox_input_type);
- }
- }
- init_dynamic_item_buffer(number_of_items, get_item_func, get_hint_func, UI_dummy_function);
- MMI_fixed_list_menu.n_items = number_of_items;
- if (wgui_check_application_present)
- {
- wgui_check_application_present(&max_entries);
- }
- /*
- * shortcut_width=set_menu_item_count(max_entries)+7; //number of element increases at the run time
- * resize_menu_shortcut_handler(shortcut_width,MMI_title_height);
- * move_menu_shortcut_handler(UI_device_width-shortcut_width, MMI_title_y);
- * register_hide_menu_shortcut(gui_redraw_menu_shortcut);
- */
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_ALIGN_TO_TOP | UI_LIST_MENU_DISABLE_SCROLLBAR;
- register_fixed_list_highlight_handler(dynamic_list_highlight_handler);
- img = (U8*) GetImage(search_image);
- gui_measure_image(img, &temp_w, &temp_h);
- input_box_width = (UI_device_width - (5 + temp_w + 1) - 4);
- h_flag = set_list_menu_category_history(MMI_CATEGORY201_ID, history_buffer);
- if (h_flag)
- {
- S32 s = sizeof(list_menu_category_history);
- s = (s + 3) / 4;
- s *= 4;
- MMI_fixed_list_menu.item_measure_function(NULL, MMI_fixed_list_menu.common_item_data, &iwidth, &iheight);
- MMI_fixed_list_menu.height = iheight * MMI_fixed_list_menu.displayed_items + 10; /* need to handle this in more cleaner way, it is 22X4 +10 =98, as we only show 4 rows */
- if (wgui_multiline_inputbox_input_type != 0)
- {
- if (languageChanged)
- {
- MMI_fixed_list_menu.highlighted_item = 0;
- }
- }
- dynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- wgui_setup_inputbox_ext(
- 0,
- 0,
- UI_device_width - temp_w,
- temp_h,
- buffer,
- buffer_max_length,
- MMI_CATEGORY201_ID,
- get_string(right_softkey),
- get_image(right_softkey_icon),
- input_type,
- history_buffer + s,
- 1,
- UI_MULTI_LINE_INPUT_BOX_AUTO_DISABLE_SCROLLBAR,
- 0,
- 0,
- 0,
- 0,
- NULL);
- if (wgui_multiline_inputbox_input_type != 0)
- {
- if (languageChanged)
- {
- multiline_inputbox_delete_all_characters();
- set_right_softkey_function(GoBackHistory, KEY_EVENT_UP);
- }
- }
- /* MTK Terry for history issue */
- if (cat200_search_function)
- {
- //S32 no_entries;
- //no_entries = /*cat200_search_function((U8*)MMI_multiline_inputbox.text)*/number_of_items;
- //load_dynamic_item_buffer(no_entries );
- //refresh_search_list_change_list_ext(no_entries,MMI_fixed_list_menu.highlighted_item);
- }
- }
- else
- {
- wgui_setup_inputbox_ext(
- 0,
- 0,
- UI_device_width - temp_w,
- temp_h,
- buffer,
- buffer_max_length,
- MMI_CATEGORY201_ID,
- get_string(right_softkey),
- get_image(right_softkey_icon),
- input_type,
- NULL,
- 1,
- UI_MULTI_LINE_INPUT_BOX_AUTO_DISABLE_SCROLLBAR,
- 0,
- 0,
- 0,
- 0,
- NULL);
- dynamic_list_goto_item_no_redraw(highlighted_item);
- }
- /* multiline inputbox */
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- MMI_multiline_inputbox.change_callback = refresh_category201_search_list;
- cat200_search_img = search_image;
- wgui_set_multiline_inputbox_register_up_down_key_funcptr(cat201_register_key_func);
- register_hide_multitap(category5_hide_multitap);
- /* up and down keys are handled by list menu */
- register_dynamic_list_keys();
- MMI_title_string = (UI_string_type) (get_string(title));
- MMI_title_icon = (PU8) (get_image(title_icon));
- resize_dynamic_icontext_menuitems_to_list_width();
- set_fixed_icontext_positions(MMI_ICONTEXT_MENUITEM_HEIGHT + 2, 0, 1, 0);//111106 dynamic icontext
- if (h_flag)
- {
- set_dynamic_pop_up_descriptions(MMI_fixed_list_menu.highlighted_item);
- if (MMI_fixed_list_menu.highlighted_item <= 0)
- {
- ClearKeyHandler(KEY_UP_ARROW, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_DOWN);
- }
- }
- else
- {
- set_dynamic_pop_up_descriptions(highlighted_item);
- }
- wgui_multiline_inputbox_input_type = 0;
- wgui_singleline_inputbox_LSK_label_icon = get_image(left_softkey_icon);
- wgui_singleline_inputbox_LSK_label_string = get_string(left_softkey);
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory201Screen;
- dm_setup_category_functions(dm_redraw_category_screen, GetCategory201History, GetCategory201HistorySize);
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_data.s32flags |= DM_SHOW_VKPAD;
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY201_ID;
- dm_setup_data(&dm_data);
- #ifdef __MMI_TOUCH_SCREEN__
- dm_register_vkpad_callback(cat201_virtual_keypad_callback);
- #endif
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategoryControlledArea201Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategoryControlledArea201Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- wgui_redraw_input_information_bar();
- show_dynamic_list();
- #if defined(__MMI_TOUCH_SCREEN__)
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- redraw_multiline_inputbox();
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- #ifdef __MMI_UI_TWO_LINE_MENUITEM_STYLES__
- /*****************************************************************************
- * FUNCTION
- * ShowCategory273Screen
- * DESCRIPTION
- * A category to display thumbnail images in menu item.
- * * PARAMETERS
- * * title IN Title for the screen
- * * title_icon IN Icon shown with the title
- * * left_softkey IN Left softkey label
- * * left_softkey_icon IN Icon for the Left softkey
- * * right_softkey IN right softkey label
- * * right_softkey_icon IN Icon for the right softkey
- * * number_of_items IN number of items to be displayed
- * * get_item_func IN function pointer to get next displayed items
- * * get_display_style_func IN function pointer to get the display style of next item
- * * get_properties_func IN function pointer to get the properties to highlighted menu item
- * * highlighted_item IN index of item to be highlighted
- * * history_buffer IN history buffer
- * * disable_data_cache IN whether caching of dynamic data is disabled
- * * flush_data_callback IN callback function invoked before data is reloaded
- * *
- * * RETURNS
- * * void
- * PARAMETERS
- * title [IN]
- * title_icon [IN]
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN]
- * right_softkey_icon [IN]
- * number_of_items [IN]
- * get_item_func [IN]
- * get_display_style_func [IN]
- * get_properties_func [IN]
- * highlighted_item [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory273Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 number_of_items,
- GetItemFuncPtr get_item_func,
- wgui_get_display_style get_display_style_func,
- wgui_get_two_line_menu_item_properties get_properties_func,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 shortcut_width;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- wgui_set_pfn_to_get_display_style(get_display_style_func);
- wgui_set_pfn_to_get_current_menu_item_properties(get_properties_func);
- gui_add_cleanup_hook(wgui_two_line_reset_all_pointers);//060606 2 line Calvin
- if (history_buffer)
- {
- wgui_two_line_disable_complete_callback();
- }
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- MMI_menu_shortcut_number = -1;
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- create_fixed_icontext_menuitems();
- MMI_current_menu_type = LIST_MENU;
- resize_fixed_list(MMI_content_width, MMI_content_height);
- associate_fixed_icontext_list();
- #ifdef __MMI_TOUCH_SCREEN__
- gui_set_fixed_list_menu_item_pen_function(
- &MMI_fixed_list_menu,
- gui_fixed_icontext_menuitem_translate_pen_event,
- MMI_TRUE,
- MMI_FALSE);
- #endif /* __MMI_TOUCH_SCREEN__ */
- init_dynamic_item_buffer(number_of_items, get_item_func, NULL, UI_dummy_function);
- MMI_fixed_list_menu.n_items = number_of_items;
- register_dynamic_list_shortcut_handler();
- register_dynamic_list_keys();
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, (MMI_title_height));
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
- register_hide_menu_shortcut(draw_title);
- resize_fixed_icontext_menuitems(0, MMI_MENUITEM_HEIGHT);
- set_fixed_icontext_positions(MMI_ICONTEXT_MENUITEM_HEIGHT + 2, 0, 1, 0);
- // TODO: temp removed
- register_fixed_list_highlight_handler(dynamic_list_highlight_handler);
- h_flag = set_list_menu_category_history(MMI_CATEGORY273_ID, history_buffer);
- dynamic_list_goto_item_no_redraw(h_flag ? MMI_fixed_list_menu.highlighted_item : highlighted_item);
- set_dynamic_pop_up_descriptions(h_flag ? MMI_fixed_list_menu.highlighted_item : highlighted_item);
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory273Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY273_ID;
- dm_data.s32flags = 0;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- } /* end of ShowCategory273Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory273Screen
- * DESCRIPTION
- * Exits the Category 273 Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory273Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_dynamic_list();
- reset_pop_up_descriptions();
- dynamic_item_text_align_left = FALSE;
- #ifdef __MMI_UI_HINTS_IN_MENUITEM__
- reset_all_force_flags_for_hints();
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_unblock_list_effect();
- #endif
- #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */
- }
- #endif /* __MMI_UI_TWO_LINE_MENUITEM_STYLES__ */
- /* barcode */
- extern void register_multiline_inputbox_hilite_keys(void);//110606 compile warning
- #ifdef __MMI_TOUCH_SCREEN__
- extern void register_multiline_inputbox_hilite_pen_event_handler(void);
- #endif
- /*****************************************************************************
- * FUNCTION
- * ShowCategory228Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * title [IN]
- * title_icon [IN]
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN]
- * right_softkey_icon [IN]
- * buffer [?]
- * buffer_size [IN]
- * hilite_str_list [?]
- * hilite_str_number [IN]
- * hilite_cb [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory228Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *buffer,
- S32 buffer_size,
- HILITE_STR hilite_str_list[],
- U16 hilite_str_number,
- void (*hilite_cb) (S32 idx),
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 l;
- S16 input_type = 0;
- U8 h = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- MMI_menu_shortcut_number = -1;
- MMI_disable_title_shortcut_display = 1;
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- l = gui_strlen((UI_string_type) buffer);
- create_multiline_inputbox_set_buffer((UI_string_type) buffer, buffer_size, l, 0);
- register_multiline_inputbox_viewer_keys();
- register_multiline_inputbox_hilite_keys();
- MMI_multiline_inputbox.hilite_list = hilite_str_list;
- MMI_multiline_inputbox.hilite_str_number = hilite_str_number;
- MMI_multiline_inputbox.current_hilite_idx = 0;
- #ifdef __MMI_TOUCH_SCREEN__
- register_multiline_inputbox_hilite_pen_event_handler();
- #endif
- MMI_multiline_inputbox.flags |=
- (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE |
- UI_MULTI_LINE_INPUT_BOX_WORD_HIGHLIGHT);
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND;
- #endif
- MMI_multiline_inputbox.hilite_cb = hilite_cb;
- h = set_multiline_inputbox_category_history(MMI_CATEGORY228_ID, history_buffer, &input_type);
- if (hilite_str_number != 0)
- {
- if (h)
- {
- gui_multi_line_input_box_go_to_hilite(
- &MMI_multiline_inputbox,
- (U16)MMI_multiline_inputbox.current_hilite_idx,
- MMI_TRUE);
- }
- else
- {
- gui_multi_line_input_box_go_to_hilite(&MMI_multiline_inputbox, 0, MMI_FALSE);
- }
- }
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory74Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY228_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- void ExitCategory402Screen(void);
- /*****************************************************************************
- * FUNCTION
- * Cat402ScrolTextBg
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN] start x
- * y1 [IN] start y
- * x2 [IN] end x
- * y2 [IN] end y
- * RETURNS
- * void
- *****************************************************************************/
- void Cat402ScrolTextBg(S32 x1, S32 y1, S32 x2, S32 y2)
- {
- gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_WHITE);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory402Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * title [?]
- * title_icon [IN]
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN]
- * right_softkey_icon [IN]
- * string [?]
- * percentage [IN]
- * progress_string [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory402Screen(
- U8 *title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *string,
- U16 percentage,
- U8 *progress_string)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- color text_color = gui_color(0, 0, 0);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_title_string = (UI_string_type) title;
- MMI_title_icon = (PU8) get_image(title_icon);
- MMI_menu_shortcut_number = -1;
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- dm_add_scroll_text((UI_string_type) string, NULL, Cat402ScrolTextBg, text_color, text_color);
- Cat402PercentageBarId = dm_add_percentage_bar(
- percentage,
- progress_string,
- UI_COLOR_RED,
- IMG_PERCENTAGE_BAR_BG_IMAGE,
- IMG_PERCENTAGE_BAR_LEFT_IMAGE,
- IMG_PERCENTAGE_BAR_RIGHT_IMAGE);
- ExitCategoryFunction = ExitCategory402Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY402_ID;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * UpdateCategory402Value
- * DESCRIPTION
- *
- * PARAMETERS
- * value [IN]
- * string [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UpdateCategory402Value(U16 value, U8 *string)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- dm_update_percentage_bar_value(Cat402PercentageBarId, value, string);
- dm_redraw_percentage_bar(Cat402PercentageBarId);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory402Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory402Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Cat402PercentageBarId = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory501Screen
- * DESCRIPTION
- * Displays the category501 screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon shown with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the Left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * message_str [IN] Message string
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory501Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8* message_str,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ShowCategory7Screen(
- title,
- title_icon,
- left_softkey,
- left_softkey_icon,
- right_softkey,
- right_softkey_icon,
- message_str,
- history_buffer);
- } /* end of ShowCategory501Screen */