wgui_categories.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:657k
源码类别:
MTK
开发平台:
C/C++
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_slide_control[0].change_callback = f1;
- MMI_slide_control[1].change_callback = f2;
- } /* end of RegisterCategory88ChangeCallbacks */
- /*****************************************************************************
- * FUNCTION
- * category88_keyboard_key_handler
- * DESCRIPTION
- * keyboard handler of category88(Only for Win32 environment)
- * PARAMETERS
- * vkey_code [IN] Key code to identify the key
- * key_state [IN] The state of key
- * RETURNS
- * void
- *****************************************************************************/
- void category88_keyboard_key_handler(S32 vkey_code, S32 key_state)
- {
- #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (key_state)
- {
- switch (vkey_code)
- {
- case 37:
- wgui_slide_control_previous();
- break;
- case 39:
- wgui_slide_control_next();
- break;
- case 38:
- category88_handle_up_key();
- break;
- case 40:
- category88_handle_down_key();
- break;
- }
- }
- #else /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- UI_UNUSED_PARAMETER(vkey_code);
- UI_UNUSED_PARAMETER(key_state);
- #endif /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- } /* end of category88_keyboard_key_handler */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory88Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * title [IN]
- * title_icon [IN]
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN]
- * right_softkey_icon [IN]
- * bg_image_id [IN]
- * n_items [IN]
- * string_list [IN]
- * lower_limit [?]
- * upper_limit [?]
- * current_value [IN]
- * cb_func [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory88Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U16 bg_image_id,
- U16 n_items,
- U8 **string_list,
- S32 *lower_limit,
- S32 *upper_limit,
- S32 **current_value,
- void (**cb_func) (S32 value),
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 idx = 0;
- dm_data_struct dm_data;
- U8 h_flag;
- /* slide_control *current_focus=&MMI_slide_control[0];//010206 Calvin */
- color c = *(current_MMI_theme->UI_black_color);
- color wc = *(current_MMI_theme->UI_white_color);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(n_items <= MMI_MAX_SLIDE_CONTROL);
- dm_reset_context();
- UI_UNUSED_PARAMETER(history_buffer);
- MMI_ASSERT(lower_limit != NULL);
- MMI_ASSERT(upper_limit != NULL);
- MMI_ASSERT(current_value != NULL);
- 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);
- MMI_title_icon = get_image(title_icon);
- h_flag = set_slide_control_category_history((U16) (MMI_CATEGORY88_1ITEM_ID + n_items - 1), (U8*) history_buffer);
- if (h_flag)
- {
- /* the number of slide controls should be the same as the number kept in history */
- MMI_ASSERT(h_flag == n_items);
- for (idx = 0; idx < n_items; idx++)
- {
- *current_value[idx] = *MMI_slide_control_value[idx];
- }
- }
- else
- {
- for (idx = 0; idx < n_items; idx++)
- {
- MMI_slide_control_value[idx] = (current_value[idx]);
- }
- MMI_current_slide_control = &MMI_slide_control[0];
- MMI_current_slide_control_value = (S32*) MMI_slide_control_value[0];
- }
- /* Avoid NULL pointer in global context */
- MMI_ASSERT(MMI_current_slide_control && MMI_current_slide_control_value);
- for (idx = 0; idx < n_items; idx++)
- {
- if (string_list)
- {
- dm_add_string((UI_string_type) string_list[idx], &MMI_default_font, c, wc, NULL);
- if (cb_func != NULL)
- {
- dm_add_slide_control(
- lower_limit[idx],
- upper_limit[idx],
- *current_value[idx],
- cb_func[idx],
- string_list[idx]);
- }
- else
- {
- dm_add_slide_control(lower_limit[idx], upper_limit[idx], *current_value[idx], NULL, string_list[idx]);
- }
- }
- else
- {
- if (cb_func != NULL)
- {
- dm_add_slide_control(lower_limit[idx], upper_limit[idx], *current_value[idx], cb_func[idx], NULL);
- }
- else
- {
- dm_add_slide_control(lower_limit[idx], upper_limit[idx], *current_value[idx], NULL, NULL);
- }
- }
- }
- if (bg_image_id != 0)
- {
- dm_add_image(get_image(bg_image_id), NULL, NULL);
- }
- SetKeyHandler(wgui_slide_control_previous, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(wgui_slide_control_next, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(category88_handle_up_key, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(category88_handle_down_key, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- SetKeyHandler(category88_handle_up_key, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(category88_handle_down_key, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- register_keyboard_key_handler(category88_keyboard_key_handler);
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory88Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_data.s32CatId = MMI_CATEGORY88_1ITEM_ID + n_items - 1;
- dm_data.s32ScrId = GetActiveScreenId();
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory88Screen
- * DESCRIPTION
- * Exits the Double Slide control screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory88Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_message_string = NULL;
- MMI_message_string2 = NULL;
- reset_softkeys();
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory87Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * title [IN]
- * title_icon [IN]
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN]
- * right_softkey_icon [IN]
- * l_limit [IN]
- * u_limit [IN]
- * current_value [?]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory87Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 l_limit,
- S32 u_limit,
- S32 *current_value,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 lower_limit[1], upper_limit[1];
- S32 *curr_value[1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- lower_limit[0] = l_limit;
- upper_limit[0] = u_limit;
- curr_value[0] = current_value;
- ShowCategory88Screen(
- title,
- title_icon,
- left_softkey,
- left_softkey_icon,
- right_softkey,
- right_softkey_icon,
- 0,
- 1,
- NULL,
- lower_limit,
- upper_limit,
- curr_value,
- NULL,
- history_buffer);
- } /* end of ShowCategory87Screen */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory89Screen
- * DESCRIPTION
- * Displays the Numbered Items screen(with description)
- * 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_items [IN] Array of items
- * list_of_descriptions [IN] Array of Pop up description strings
- * flags [IN] Flags (see explanation below)
- * highlighted_item [IN] Default item to be highlighted (if there is no history)
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory89Screen(
- U16 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_items,
- U8 **list_of_descriptions,
- S32 flags,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 i;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- create_fixed_icontext_list_menuitems(2, 0);
- GUI_current_fixed_icontext_list_menuitem_column = 1;
- set_fixed_icontext_list_text_coordinates(0, 1, 0, 30, MMI_MENUITEM_HEIGHT);
- /* Need to modify */
- set_fixed_icontext_list_text_coordinates(
- 1,
- 30,
- 0,
- UI_device_width - 30 - 4 - MMI_fixed_list_menu.vbar.width,
- MMI_MENUITEM_HEIGHT);
- associate_fixed_icontext_list_list();
- ShowListCategoryScreen(
- get_string(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);
- for (i = 0; i < number_of_items; i++)
- {
- fixed_icontext_list_item_insert(i);
- gui_itoa(i + 1, (UI_string_type) category89_string_list[i], 10);
- gui_strcat((UI_string_type) category89_string_list[i], (UI_string_type) ". ");
- add_fixed_icontext_list_item_text(i, 0, (UI_string_type) category89_string_list[i]);
- add_fixed_icontext_list_item_text(i, 1, (UI_string_type) list_of_items[i]);
- if (list_of_descriptions == NULL)
- {
- wgui_pop_up_description_strings[i].text_strings[0] = NULL;
- }
- else
- {
- wgui_pop_up_description_strings[i].text_strings[0] = (UI_string_type) list_of_descriptions[i];
- }
- }
- h_flag = set_list_menu_category_history(MMI_CATEGORY89_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);
- }
- set_pop_up_descriptions(1, number_of_items, MMI_fixed_list_menu.highlighted_item);
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitListCategoryScreen;
- 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_CATEGORY89_ID;
- dm_data.s32flags = 0;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory89Screen
- * DESCRIPTION
- * Exits the Numbered Items screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory89Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GUI_current_fixed_icontext_list_menuitem_column = 0;
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_pop_up_descriptions();
- reset_fixed_list();
- }
- #ifdef __MMI_CALORIE__
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* __MMI_CALORIE__ */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory119Screen
- * DESCRIPTION
- * Displays the category119 screen
- * PARAMETERS
- * 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
- * message [?]
- * message_icon [IN]
- * history_buffer [IN] History buffer
- * icon(?) [IN] Message Icon
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory119Screen(
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *message,
- U16 message_icon,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 l;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(history_buffer);
- 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_message_string = (UI_string_type) message;
- l = gui_strlen(MMI_message_string);
- create_multiline_inputbox_set_buffer(MMI_message_string, l, l, 0);
- MMI_multiline_inputbox.flags |=
- (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY |
- UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR);
- dm_add_image(get_image(message_icon), NULL, NULL);
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory119Screen;
- 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_CATEGORY119_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- } /* end of ShowCategory119Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory119Screen
- * DESCRIPTION
- * Exits the category119 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory119Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_hide_animations();
- } /* end of ExitCategory119Screen */
- /*****************************************************************************
- * FUNCTION
- * cat129_clear_icon_bg
- * DESCRIPTION
- * Clear button background function
- * PARAMETERS
- * button [IN] Button pointer
- * RETURNS
- * void
- *****************************************************************************/
- void cat129_clear_icon_bg(void *button)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- icontext_button *b = (icontext_button*) button;
- S32 x1 = b->x;
- S32 y1 = b->y;
- S32 x2 = b->x + b->width - 1;
- S32 y2 = b->y + b->height - 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- //gdi_layer_set_clip(x1, y1, x2, y2);
- //gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
- //gdi_layer_pop_clip();
- gdi_layer_set_clip(x1, y1, x2 + 1, y2 + 1);
- gdi_draw_solid_rect(MMI_title_x, MMI_title_y, MMI_title_x + MMI_title_width - 1, MMI_title_y + MMI_title_height - 1, GDI_COLOR_TRANSPARENT); /* 061705 Calvin added */
- if (title_bg_id != 0)
- {
- gdi_image_draw_id(MMI_title_x, MMI_title_y, title_bg_id);
- }
- else
- {
- 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);
- }
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * cat129_get_image_handle
- * DESCRIPTION
- * get the animation handle for cat 129
- * PARAMETERS
- * void
- * RETURNS
- * gdi_handle
- *****************************************************************************/
- gdi_handle cat129_get_image_handle(void)//070706
- {
- return dm_get_image_handle(0);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory129Screen
- * DESCRIPTION
- * Displays the category129 screen
- * 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
- * message_icon [IN]
- * history_buffer [IN] History buffer
- * image(?) [IN] Animation image
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory129Screen(
- U8 *title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U16 message_icon,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- U16 btn_prev_item_id = 0, btn_next_item_id = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(history_buffer);
- 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 = (UI_string_type) title;
- MMI_title_icon = (PU8) get_image(title_icon);
- MMI_message_string = (UI_string_type) NULL;
- /* MTK Leo start, use new layer instead of scr_bg layer to draw wallpaper */
- /*
- * #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- * dm_get_scr_bg_image(&idle_scr_bg_ID, &idle_scr_bg_filename, &idle_scr_bg_x, &idle_scr_bg_y, &idle_scr_bg_opacity);
- * dm_set_scr_bg_image(message_icon, NULL, -1, -1, 255);
- * #else
- */
- dm_add_image(get_image(message_icon), NULL, NULL);
- wgui_set_wallpaper_on_bottom(MMI_TRUE);
- // #endif
- // MTK Leo end
- //PMT HIMANSHU START 20050815
- //check if the title bar buttons are enabled for the particular screen.
- if (wgui_is_touch_title_bar_buttons())
- {
- btn_prev_item_id = dm_add_button(
- NULL,
- get_image(LEFT_RED_ARROW),
- get_image(LEFT_RED_ARROW),
- cat129_clear_icon_bg);
- btn_next_item_id = dm_add_button(
- NULL,
- get_image(RIGHT_RED_ARROW),
- get_image(RIGHT_RED_ARROW),
- cat129_clear_icon_bg);
- title_bg_id = IMAGE_VIEW_TITLEBAR_BG; /* for showing different title bar. */
- }
- /* PMT HIMANSHU END 20050815 */
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory129Screen;
- #if defined(__MMI_TOUCH_SCREEN__)
- if (wgui_is_touch_title_bar_buttons())
- {
- /* register the handler for pen event down istead of pen event up */
- dm_register_button_functions(btn_prev_item_id, KEY_EVENT_UP, gMMI_touch_title_button1_down_handler);
- dm_register_button_functions(btn_next_item_id, KEY_EVENT_UP, gMMI_touch_title_button2_down_handler);
- }
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- dm_setup_category_functions(dm_redraw_category_screen, dummy_get_history, dummy_get_history_size);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY129_ID;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- } /* end of ShowCategory129Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory129Screen
- * DESCRIPTION
- * Exits the category129 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory129Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_hide_animations();
- title_bg_id = 0;
- wgui_reset_touch_title_bar_buttons();
- /* MTK Leo start, use new layer instead of scr_bg layer to draw wallpaper */
- /*
- * #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- * if (wgui_is_wallpaper_change())
- * {
- * U8 dummy_opacity;
- * dm_get_scr_bg_image(&idle_scr_bg_ID, &idle_scr_bg_filename, &idle_scr_bg_x, &idle_scr_bg_y, &dummy_opacity);
- * dm_set_scr_bg_image(idle_scr_bg_ID, idle_scr_bg_filename, idle_scr_bg_x, idle_scr_bg_y, idle_scr_bg_opacity);
- * wgui_reset_wallpaper_change();
- * }
- * else
- * {
- * dm_set_scr_bg_image_no_draw(idle_scr_bg_ID, idle_scr_bg_filename, idle_scr_bg_x, idle_scr_bg_y, idle_scr_bg_opacity);
- * }
- * #endif
- */
- } /* end of ExitCategory129Screen */
- /*****************************************************************************
- * FUNCTION
- * set_list_menu_category140_history
- * DESCRIPTION
- * Sets the history data for the list menu of category140 (check box list)
- * from the given history buffer
- * PARAMETERS
- * history_ID [IN] The ID used by category screens
- * history_buffer [IN] Buffer from which history data is taken
- * RETURNS
- * byte Returns true if the history ID is valid
- *****************************************************************************/
- U8 set_list_menu_category140_history(U16 history_ID, U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (history_buffer != NULL)
- {
- list_menu_category_history_cat140 *h = (list_menu_category_history_cat140*) history_buffer;
- if (history_valid(h->history_ID, history_ID))
- {
- MMI_fixed_list_menu.highlighted_item = h->highlighted_item;
- MMI_fixed_list_menu.first_displayed_item = h->first_displayed_item;
- MMI_fixed_list_menu.last_displayed_item = h->last_displayed_item;
- MMI_fixed_list_menu.displayed_items = h->displayed_items;
- MMI_fixed_list_menu.flags = h->flags;
- item_checked = h->state;
- for (i = 0; i < h->no_of_items; i++)
- {
- if (h->list_of_states[i] == 1)
- {
- MMI_fixed_twostate_menuitems[i].flags |= UI_MENUITEM_STATE_SELECTED;
- }
- else
- {
- MMI_fixed_twostate_menuitems[i].flags &= ~UI_MENUITEM_STATE_SELECTED;
- }
- }
- return (1);
- }
- }
- return (0);
- } /* end of set_list_menu_category140_history */
- /*****************************************************************************
- * FUNCTION
- * get_list_menu_category_history140
- * DESCRIPTION
- * Gets the history data for the list menu of category140 (check box list)
- * from the given history buffer
- * PARAMETERS
- * history_ID [IN] The ID used by category screens
- * history_buffer [IN] Buffer from which history data is taken
- * RETURNS
- * void
- *****************************************************************************/
- void get_list_menu_category_history140(U16 history_ID, U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (history_buffer != NULL)
- {
- U16 hID = (U16) (history_ID | 0x8000);
- S32 i = 0;
- list_menu_category_history_cat140 *h = (list_menu_category_history_cat140*) history_buffer;
- h->history_ID = hID;
- h->highlighted_item = (S16) MMI_fixed_list_menu.highlighted_item;
- h->first_displayed_item = (S16) MMI_fixed_list_menu.first_displayed_item;
- h->last_displayed_item = (S16) MMI_fixed_list_menu.last_displayed_item;
- h->displayed_items = (S16) MMI_fixed_list_menu.displayed_items;
- h->flags = MMI_fixed_list_menu.flags;
- h->no_of_items = MMI_fixed_list_menu.n_items;
- h->state = (S8) item_checked;
- for (i = 0; i < MMI_fixed_list_menu.n_items; i++)
- {
- if (MMI_fixed_twostate_menuitems[i].flags & UI_MENUITEM_STATE_SELECTED)
- {
- h->list_of_states[i] = 1;
- }
- else
- {
- h->list_of_states[i] = 0;
- }
- }
- }
- } /* end of get_list_menu_category_history140 */
- /*****************************************************************************
- * FUNCTION
- * GetCategory140HistorySize
- * DESCRIPTION
- * Gets the history buffer size for Category140 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 GetCategory140HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (sizeof(list_menu_category_history_cat140));
- } /* end of GetCategory140HistorySize */
- /*****************************************************************************
- * FUNCTION
- * GetCategory140History
- * DESCRIPTION
- * Gets the history buffer for Category140 screen
- * PARAMETERS
- * history_buffer [IN] History_buffer is a pointer to the buffer where the history data is to be stored (pre-allocated)
- * RETURNS
- * void
- *****************************************************************************/
- U8 *GetCategory140History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_list_menu_category_history140(MMI_CATEGORY140_ID, history_buffer);
- return (history_buffer);
- } /* end of GetCategory140History */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory140Screen
- * DESCRIPTION
- * Displays the Category140 screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon displayed with the title
- * number_of_items [IN] Number of items in the menu
- * list_of_items [IN] Array of items
- * list_of_states [?]
- * highlighted_item [IN] Default item to be highlighted (if there is no history)
- * history_buffer [IN] History buffer
- * left_softkey_icon(?) [IN] Left softkey icon
- * left_softkey(?) [IN] Left softkey label
- * right_softkey_icon(?) [IN] Right softkey icon
- * right_softkey(?) [IN] Right softkey label
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory140Screen(
- U16 title,
- U16 title_icon,
- S32 number_of_items,
- U8 **list_of_items,
- U8 *list_of_states,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 i;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- create_fixed_twostate_menuitems(get_image(CHECKBOX_ON_IMAGE_ID), get_image(CHECKBOX_OFF_IMAGE_ID));
- associate_fixed_twostate_list();
- ShowListCategoryScreen(
- get_string(title),
- get_image(title_icon),
- get_string(STR_GLOBAL_OK),
- get_image(0),
- get_string(STR_GLOBAL_DONE),
- get_image(0),
- number_of_items);
- resize_fixed_twostate_menuitems(0, MMI_MENUITEM_HEIGHT);
- set_fixed_twostate_positions(MMI_MENUITEM_HEIGHT, 0, 1, 0);
- set_left_softkey_function(toggle_check_list_handle_left_softkey_up, KEY_EVENT_UP);
- checklist_category_menu_item_states = list_of_states;
- h_flag = set_list_menu_category140_history(MMI_CATEGORY140_ID, history_buffer);
- if (h_flag)
- {
- for (i = 0; i < number_of_items; i++)
- {
- if (MMI_fixed_twostate_menuitems[i].flags & UI_MENUITEM_STATE_SELECTED)
- {
- list_of_states[i] = 1;
- }
- else
- {
- list_of_states[i] = 0;
- }
- }
- }
- for (i = 0; i < number_of_items; i++)
- {
- add_fixed_twostate_item((UI_string_type) list_of_items[i]);
- if (list_of_states[i])
- {
- select_fixed_twostate_item(i);
- }
- }
- register_fixed_list_highlight_handler(toggle_check_list_highlight_handler);
- if (h_flag && item_checked)
- { /* 2004-02-18, Check status in history if history is not null */
- change_right_softkey(STR_GLOBAL_DONE, 0);
- set_right_softkey_function(checkbox_toggle_DONE_RSK_function, KEY_EVENT_UP);
- }
- else
- {
- change_right_softkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- set_right_softkey_function(checkbox_toggle_BACK_RSK_function, KEY_EVENT_UP);
- item_checked = 0;
- }
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- resize_fixed_twostate_menuitems_to_list_width();
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitListCategoryScreen;
- dm_setup_category_functions(dm_redraw_category_screen, GetCategory140History, GetCategory140HistorySize);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY140_ID;
- dm_data.s32flags = 0;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- } /* end of ShowCategory140Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory140Screen
- * DESCRIPTION
- * Exits the category140 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory140Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- } /* end of ExitCategory140Screen */
- /* structure usedto store one big line in to two lines */
- typedef struct _split_lines
- {
- U8 str_line1[126];
- U8 str_line2[126];
- U8 no_of_lines;
- } SPILTLINES;
- SPILTLINES *split_buffer = NULL;
- /*****************************************************************************
- * FUNCTION
- * ShowCategory141Screen
- * DESCRIPTION
- * Displays the Category141 screen
- * 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
- * message [IN] Notification message
- * message_icon [IN]
- * history_buffer [IN] History buffer
- * image(?) [IN] Notification image
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory141Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *message,
- U16 message_icon,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 l;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(history_buffer);
- 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();
- gui_set_font(&MMI_medium_font);
- if (title == 0)
- {
- wgui_switch_title_with_status_bar = 1;
- ShowStatusIconsTitle();
- }
- else
- {
- MMI_title_string = get_string(title);
- MMI_title_icon = get_image(title_icon);
- wgui_switch_title_with_status_bar = 0;
- }
- l = gui_strlen((UI_string_type) message);
- create_multiline_inputbox_set_buffer((UI_string_type) message, l, l, 0);
- MMI_multiline_inputbox.flags |=
- UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY |
- UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE |
- UI_MULTI_LINE_INPUT_BOX_AUTO_DISABLE_SCROLLBAR | UI_MULTI_LINE_INPUT_BOX_USE_ENCODING_BASED_LENGTH;
- dm_add_image(get_image(message_icon), NULL, NULL);
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory141Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- if (wgui_switch_title_with_status_bar == 1)
- {
- dm_data.s32CatId = MMI_CATEGORY141_STATUS_ICON_ID;
- }
- else
- {
- dm_data.s32CatId = MMI_CATEGORY141_ID;
- }
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory141Screen
- * DESCRIPTION
- * Exits the Message Received screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory141Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_switch_title_with_status_bar)
- {
- close_status_icons();
- wgui_switch_title_with_status_bar = 0;
- }
- gui_hide_animations();
- } /* end of ExitCategory141Screen */
- /*****************************************************************************
- * FUNCTION
- * category_142_redraw_highlighted_item
- * DESCRIPTION
- * Redraw the highlighted item(selected image) of category 142.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void category_142_redraw_highlighted_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 index, img_width, img_height, vbar_x = 0, vbar_button_x = 0;
- PU8 img;
- color c;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (animation_handle != GDI_ERROR_HANDLE)
- {
- gdi_image_stop_animation(animation_handle);
- }
- if (category_142_image_list != NULL)
- {
- if (category_142_image_list_index != NULL)
- {
- index = *category_142_image_list_index;
- }
- else
- {
- index = 0;
- }
- if (!wgui_switch_title_with_status_bar && (category_142_list_of_titles != NULL))
- {
- MMI_title_string = (UI_string_type) category_142_list_of_titles[index];
- draw_title();
- }
- c = gui_color(255, 255, 255);
- gdi_layer_push_clip();
- if (r2lMMIFlag)
- {
- gdi_layer_set_clip(
- current_MMI_theme->scrollbar_size,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- UI_device_height - MMI_button_bar_height - 1);
- }
- else
- {
- gdi_layer_set_clip(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - current_MMI_theme->scrollbar_size - 1,
- UI_device_height - MMI_button_bar_height - 1);
- }
- gui_fill_rectangle(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- UI_device_height - MMI_button_bar_height - 1,
- c);
- if (category_142_image_list[index])
- {
- img = get_image(category_142_image_list[index]);
- }
- else
- {
- img = category_142_image_file_name_list[index];
- }
- gui_measure_image(img, &img_width, &img_height);
- if (r2lMMIFlag)
- {
- if (gdi_image_draw_animation((UI_device_width - img_width + current_MMI_theme->scrollbar_size) >> 1, (UI_device_height - img_height) >> 1, (U8*) img, &animation_handle) < 0) /* 033105 Calvin modified */
- {
- animation_handle = GDI_ERROR_HANDLE;
- }
- }
- else
- {
- if (gdi_image_draw_animation((UI_device_width - img_width) >> 1, (UI_device_height - img_height) >> 1, (U8*) img, &animation_handle) < 0) /* 033105 Calvin modified */
- {
- animation_handle = GDI_ERROR_HANDLE;
- }
- }
- gdi_layer_pop_clip();
- /* Uncomment below line for auto-disable scrollbar */
- /* if(category_142_image_list_n_items>1) */
- {
- gui_set_vertical_scrollbar_range(&category142_vbar, category_142_image_list_n_items);
- gui_set_vertical_scrollbar_scale(&category142_vbar, 1);
- gui_set_vertical_scrollbar_value(&category142_vbar, index);
- if (r2lMMIFlag)
- {
- vbar_x = category142_vbar.x;
- vbar_button_x = category142_vbar.scroll_button.x;
- category142_vbar.x = category142_vbar.x + category142_vbar.width - (UI_device_width - 1);
- category142_vbar.scroll_button.x =
- category142_vbar.scroll_button.x + category142_vbar.scroll_button.width - (UI_device_width - 1);
- gui_show_vertical_scrollbar(&category142_vbar);
- }
- else
- {
- gui_show_vertical_scrollbar(&category142_vbar);
- }
- if (r2lMMIFlag)
- {
- category142_vbar.x = vbar_x;
- category142_vbar.scroll_button.x = vbar_button_x;
- }
- }
- }
- gdi_layer_blt_previous(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- UI_device_height - MMI_button_bar_height);
- } /* end of category_142_redraw_highlighted_item */
- /*****************************************************************************
- * FUNCTION
- * category_142_highlight_handler
- * DESCRIPTION
- * hightlight handler of category 142
- * PARAMETERS
- * index [IN] The index of highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void category_142_highlight_handler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_menu_shortcut_number = index + 1;
- if (!menu_shortcut_handler_display)
- {
- gui_redraw_menu_shortcut();
- }
- MMI_list_highlight_handler(index);
- } /* end of category_142_highlight_handler */
- /*****************************************************************************
- * FUNCTION
- * category_142_goto_item
- * DESCRIPTION
- * go to specific item of category 142
- * PARAMETERS
- * index [IN] The index of item to go
- * RETURNS
- * void
- *****************************************************************************/
- void category_142_goto_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (category_142_image_list_index != NULL)
- {
- if (index < 0)
- {
- return; /* index=0; */
- }
- if (index > (category_142_image_list_n_items - 1))
- {
- return; /* index=category_142_image_list_n_items-1; */
- }
- *category_142_image_list_index = index;
- }
- category_142_highlight_handler(index);
- category_142_redraw_highlighted_item();
- } /* end of category_142_goto_item */
- /*****************************************************************************
- * FUNCTION
- * category_142_goto_previous_item
- * DESCRIPTION
- * go to previous item of category142
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void category_142_goto_previous_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 index = *category_142_image_list_index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index--;
- if (index < 0)
- {
- index = category_142_image_list_n_items - 1;
- }
- *category_142_image_list_index = index;
- category_142_redraw_highlighted_item();
- category_142_highlight_handler(index);
- } /* end of category_142_goto_previous_item */
- /*****************************************************************************
- * FUNCTION
- * category_142_goto_next_item
- * DESCRIPTION
- * go to next item of category142
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void category_142_goto_next_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 index = *category_142_image_list_index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index++;
- if (index > (category_142_image_list_n_items - 1))
- {
- index = 0;
- }
- *category_142_image_list_index = index;
- category_142_redraw_highlighted_item();
- category_142_highlight_handler(index);
- } /* end of category_142_goto_next_item */
- /*****************************************************************************
- * FUNCTION
- * category_142_key_handler
- * DESCRIPTION
- * handle key handlers of catefory 142
- * PARAMETERS
- * vkey_code [IN] To identify the key
- * key_state [IN] The state of the key
- * RETURNS
- * void
- *****************************************************************************/
- void category_142_key_handler(S32 vkey_code, S32 key_state)
- {
- #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (key_state)
- {
- switch (vkey_code)
- {
- case 37: /* left */
- break;
- case 39: /* right */
- break;
- case 38:
- category_142_goto_previous_item();
- break;
- case 40:
- category_142_goto_next_item();
- break;
- }
- }
- #else /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- UI_UNUSED_PARAMETER(vkey_code);
- UI_UNUSED_PARAMETER(key_state);
- #endif /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- } /* end of category_142_key_handler */
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * category_142_pen_down_hdlr
- * DESCRIPTION
- *
- * PARAMETERS
- * pos [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL category_142_pen_down_hdlr(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_scrollbar_pen_enum scrollbar_event;
- gui_pen_event_param_struct scrollbar_param;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PEN_CHECK_BOUND
- (pos.x, pos.y, category142_vbar.x, category142_vbar.y, category142_vbar.width, category142_vbar.height))
- {
- gui_vertical_scrollbar_translate_pen_event(
- &category142_vbar,
- MMI_PEN_EVENT_DOWN,
- pos.x,
- pos.y,
- &scrollbar_event,
- &scrollbar_param);
- if (scrollbar_event == GUI_SCROLLBAR_PEN_JUMP_TO_I)
- {
- category_142_goto_item((S32) scrollbar_param._u.i);
- }
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * category_142_pen_move_hdlr
- * DESCRIPTION
- *
- * PARAMETERS
- * pos [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL category_142_pen_move_hdlr(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_scrollbar_pen_enum scrollbar_event;
- gui_pen_event_param_struct scrollbar_param;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PEN_CHECK_BOUND
- (pos.x, pos.y, category142_vbar.x, category142_vbar.y, category142_vbar.width, category142_vbar.height))
- {
- gui_vertical_scrollbar_translate_pen_event(
- &category142_vbar,
- MMI_PEN_EVENT_MOVE,
- pos.x,
- pos.y,
- &scrollbar_event,
- &scrollbar_param);
- if (scrollbar_event == GUI_SCROLLBAR_PEN_JUMP_TO_I)
- {
- category_142_goto_item((S32) scrollbar_param._u.i);
- }
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * category_142_pen_repeat_hdlr
- * DESCRIPTION
- *
- * PARAMETERS
- * pos [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL category_142_pen_repeat_hdlr(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_scrollbar_pen_enum scrollbar_event;
- gui_pen_event_param_struct scrollbar_param;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PEN_CHECK_BOUND
- (pos.x, pos.y, category142_vbar.x, category142_vbar.y, category142_vbar.width, category142_vbar.height))
- {
- gui_vertical_scrollbar_translate_pen_event(
- &category142_vbar,
- MMI_PEN_EVENT_REPEAT,
- pos.x,
- pos.y,
- &scrollbar_event,
- &scrollbar_param);
- if (scrollbar_event == GUI_SCROLLBAR_PEN_JUMP_TO_I)
- {
- category_142_goto_item((S32) scrollbar_param._u.i);
- }
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * category_142_pen_up_hdlr
- * DESCRIPTION
- *
- * PARAMETERS
- * pos [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL category_142_pen_up_hdlr(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_scrollbar_pen_enum scrollbar_event;
- gui_pen_event_param_struct scrollbar_param;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PEN_CHECK_BOUND
- (pos.x, pos.y, category142_vbar.x, category142_vbar.y, category142_vbar.width, category142_vbar.height))
- {
- gui_vertical_scrollbar_translate_pen_event(
- &category142_vbar,
- MMI_PEN_EVENT_UP,
- pos.x,
- pos.y,
- &scrollbar_event,
- &scrollbar_param);
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * category_142_pen_abort_hdlr
- * DESCRIPTION
- *
- * PARAMETERS
- * pos [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL category_142_pen_abort_hdlr(mmi_pen_point_struct pos)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_scrollbar_pen_enum scrollbar_event;
- gui_pen_event_param_struct scrollbar_param;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PEN_CHECK_BOUND
- (pos.x, pos.y, category142_vbar.x, category142_vbar.y, category142_vbar.width, category142_vbar.height))
- {
- gui_vertical_scrollbar_translate_pen_event(
- &category142_vbar,
- MMI_PEN_EVENT_ABORT,
- pos.x,
- pos.y,
- &scrollbar_event,
- &scrollbar_param);
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * DrawCate142CategoryControlArea
- * DESCRIPTION
- *
- * PARAMETERS
- * coordinate [?]
- * RETURNS
- * void
- *****************************************************************************/
- void DrawCate142CategoryControlArea(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- category_142_redraw_highlighted_item();
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory142Screen
- * DESCRIPTION
- * Displays the picture list screen
- * 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
- * list_of_titles [IN] List of string to displayed as image title
- * list_of_images [IN] List of image IDs
- * file_list_of_images [IN] List of image file name
- * n_items [IN] Number of images
- * index [IN] Currently displayed image index
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory142Screen(
- U8 *title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 **list_of_titles,
- U16 *list_of_images,
- U8 **file_list_of_images,
- S32 n_items,
- S32 *index,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(history_buffer);
- 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();
- if (title == NULL)
- {
- wgui_switch_title_with_status_bar = 1;
- ShowStatusIconsTitle();
- }
- else
- {
- MMI_title_icon = get_image(title_icon);
- wgui_switch_title_with_status_bar = 0;
- }
- MMI_menu_shortcut_number = *index + 1;
- category_142_image_list_index = index;
- h_flag = set_object_list_category_history(MMI_CATEGORY142_ID, history_buffer, category_142_image_list_index);
- if (h_flag)
- {
- *index = *category_142_image_list_index;
- }
- category_142_list_of_titles = list_of_titles;
- MMI_title_string = (UI_string_type) title;
- category_142_image_list = list_of_images;
- category_142_image_file_name_list = file_list_of_images;
- category_142_image_list_n_items = n_items;
- gui_create_vertical_scrollbar(
- &category142_vbar,
- UI_device_width - current_MMI_theme->scrollbar_size,
- (MMI_title_y + MMI_title_height),
- current_MMI_theme->scrollbar_size,
- MMI_content_height);
- /* register shortcut handler */
- if (n_items > 1)
- {
- S32 shortcut_width;
- MMI_disable_title_shortcut_display = 0;
- register_fixed_list_shortcut_handler();
- shortcut_width = set_menu_item_count(n_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(gui_redraw_menu_shortcut);
- register_keyboard_key_handler(category_142_key_handler);
- register_menu_shortcut_keys();
- register_menu_shortcut_handler(category_142_goto_item);
- SetKeyHandler(category_142_goto_previous_item, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(category_142_goto_next_item, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(category_142_goto_previous_item, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(category_142_goto_next_item, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- #ifdef __MMI_TOUCH_SCREEN__
- wgui_register_category_screen_control_area_pen_handlers(category_142_pen_down_hdlr, MMI_PEN_EVENT_DOWN);
- wgui_register_category_screen_control_area_pen_handlers(category_142_pen_move_hdlr, MMI_PEN_EVENT_MOVE);
- wgui_register_category_screen_control_area_pen_handlers(category_142_pen_repeat_hdlr, MMI_PEN_EVENT_REPEAT);
- wgui_register_category_screen_control_area_pen_handlers(category_142_pen_up_hdlr, MMI_PEN_EVENT_UP);
- wgui_register_category_screen_control_area_pen_handlers(category_142_pen_abort_hdlr, MMI_PEN_EVENT_ABORT);
- #endif /* __MMI_TOUCH_SCREEN__ */
- }
- else
- {
- MMI_disable_title_shortcut_display = 1;
- }
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory142Screen;
- dm_setup_category_functions(dm_redraw_category_screen, GetCategory142History, dm_get_category_history_size);
- dm_register_category_controlled_callback(DrawCate142CategoryControlArea);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- if (wgui_switch_title_with_status_bar == 1)
- {
- dm_data.s32CatId = MMI_CATEGORY142_STATUS_ICON_ID;
- }
- else
- {
- dm_data.s32CatId = MMI_CATEGORY142_ID;
- }
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- } /* end of ShowCategory142Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory142Screen
- * DESCRIPTION
- * Exits the picture list screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory142Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_switch_title_with_status_bar)
- {
- close_status_icons();
- wgui_switch_title_with_status_bar = 0;
- }
- category_142_image_list = NULL;
- category_142_image_file_name_list = NULL;
- category_142_image_list_index = NULL;
- category_142_image_list_n_items = 0;
- category_142_list_of_titles = NULL;
- animation_handle = GDI_ERROR_HANDLE;
- gui_hide_animations();
- } /* end of ExitCategory142Screen */
- /*****************************************************************************
- * FUNCTION
- * GetCategory142History
- * DESCRIPTION
- * Gets the history buffer for the picture list screen
- * PARAMETERS
- * history_buffer [IN] Buffer to store history
- * RETURNS
- * U8* pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory142History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_object_list_category_history(MMI_CATEGORY142_ID, history_buffer, category_142_image_list_index);
- return (history_buffer);
- }
- extern void gui_fixed_icontext_list_menuitem_scroll_handler(void);
- /*****************************************************************************
- * FUNCTION
- * DrawCate150CategoryControlArea
- * DESCRIPTION
- *
- * PARAMETERS
- * coordinate [?]
- * RETURNS
- * void
- *****************************************************************************/
- void DrawCate150CategoryControlArea(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < MMI_fixed_list_menu.n_items; i++)
- {
- MMI_fixed_list_menu.item_remove_highlight_function(
- MMI_fixed_list_menu.items[i],
- MMI_fixed_list_menu.common_item_data);
- }
- move_fixed_list(coordinate->s16X, coordinate->s16Y);
- show_fixed_list();
- gui_cancel_timer(gui_fixed_icontext_list_menuitem_scroll_handler);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory150Screen
- * DESCRIPTION
- * Displays the category screen 153
- * 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
- * list_of_items1 [IN] Strings of item1
- * list_of_items2 [IN] Strings if item2
- * highlighted_item [IN] Highlighted index
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory150Screen(
- U16 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,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 i, w;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- create_fixed_icontext_list_menuitems(2, 0);
- /* This might be a problem for draw manager. */
- w = UI_device_width - MMI_fixed_list_menu.vbar.width - 4;
- //PMT HIMANSHU START 20051028
- // set_fixed_icontext_list_text_coordinates(0,2,0,w>>1,18);
- //---
- set_fixed_icontext_list_text_coordinates(0, 2, 0, (w >> 1), MMI_MENUITEM_HEIGHT);
- set_fixed_icontext_list_text_coordinates(1, (w >> 1), 0, (w >> 1), MMI_MENUITEM_HEIGHT);
- associate_fixed_icontext_list_list();
- ShowListCategoryScreen(
- get_string(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);
- if (wgui_is_disable_shortcut_display() == MMI_TRUE)
- {
- MMI_disable_title_shortcut_display = 1;
- disable_menu_shortcut_box_display = 1;
- }
- MMI_fixed_icontext_list_menuitem.flags |= (UI_MENUITEM_RIGHT_JUSTIFY_COL2 | UI_MENUITEM_DISABLE_TEXT_CLIP);
- for (i = 0; i < number_of_items; i++)
- {
- fixed_icontext_list_item_insert(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]);
- }
- h_flag = set_list_menu_category_history(MMI_CATEGORY150_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);
- }
- resize_fixed_icontext_list_menuitems_to_list_width();
- for (i = 0; i < MMI_fixed_list_menu.n_items; i++)
- {
- MMI_fixed_list_menu.item_remove_highlight_function(
- MMI_fixed_list_menu.items[i],
- MMI_fixed_list_menu.common_item_data);
- }
- gui_cancel_timer(gui_fixed_icontext_list_menuitem_scroll_handler);
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitListCategoryScreen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_register_category_controlled_callback(DrawCate150CategoryControlArea);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY150_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- } /* end of ShowCategory150Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory150Screen
- * DESCRIPTION
- * Exits the Games high scores category screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory150Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_icontext_list_menuitem_theme.flags &= ~(UI_MENUITEM_RIGHT_JUSTIFY_COL2 | UI_MENUITEM_DISABLE_TEXT_CLIP);
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- if (wgui_is_disable_shortcut_display() == MMI_TRUE)
- {
- wgui_reset_disable_shortcut_display();
- MMI_disable_title_shortcut_display = 0;
- disable_menu_shortcut_box_display = 0;
- }
- } /* end of ExitCategory150Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory152Screen
- * DESCRIPTION
- * Exit category152 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory152Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- reset_softkeys();
- } /* end of ExitCategory152Screen */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory152Screen
- * DESCRIPTION
- * Displays the category screen 152
- * 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
- * message [IN] Message
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory152Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *message,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 l;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(history_buffer);
- 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 = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- MMI_message_string = (UI_string_type) (message);
- l = gui_strlen(MMI_message_string);
- create_multiline_inputbox_set_buffer(MMI_message_string, l, l, 0);
- MMI_multiline_inputbox.flags |=
- (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND |
- UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR);
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND;
- #endif
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND | DM_LEFT_ALIGN_TITLE;
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory152Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dummy_get_history, dummy_get_history_size);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY152_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- } /* end of ShowCategory152Screen */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory153Screen
- * DESCRIPTION
- * Displays the category screen 153
- * 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
- * list_of_items1 [IN] Strings of item1
- * list_of_items2 [IN] Strings if item2
- * highlighted_item [IN] Highlighted index
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory153Screen(
- U16 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,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- highlighted_item = -1;
- /* 071205 Calvin Start */
- /* gdi_layer_lock_frame_buffer(); */
- wgui_set_disable_shortcut_display();
- ShowCategory150Screen(
- title,
- title_icon,
- left_softkey,
- left_softkey_icon,
- right_softkey,
- right_softkey_icon,
- number_of_items,
- list_of_items1,
- list_of_items2,
- highlighted_item,
- history_buffer);
- /* Disable pen on list menu */
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_PEN;
- /* gdi_layer_unlock_frame_buffer(); */
- /* 071205 Calvin End */
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- clear_key_handlers();
- } /* end of ShowCategory153Screen */
- /*****************************************************************************
- * FUNCTION
- * DrawCate154CategoryControlArea
- * DESCRIPTION
- *
- * PARAMETERS
- * coordinate [?]
- * RETURNS
- * void
- *****************************************************************************/
- void DrawCate154CategoryControlArea(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 w1, h1, w2, h2, x;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_reset_clip();
- gui_set_font(current_UI_theme->multi_line_input_box_theme->text_font);
- gui_measure_string(MMI_message_string, &w1, &h1);
- gui_measure_string(MMI_message_string2, &w2, &h2);
- gui_set_text_color(*(current_MMI_theme->UI_black_color));
- if (Category154Align)
- {
- x = 2;
- }
- else
- {
- x = (UI_device_width >> 1) - (w1 >> 1);
- if (x < 2)
- {
- x = 2;
- }
- }
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x + gui_get_string_width((UI_string_type) MMI_message_string), category_154_message1_y);
- }
- else
- {
- gui_move_text_cursor(x, category_154_message1_y);
- }
- gui_set_line_height(h1);
- gui_print_text(MMI_message_string);
- if (Category154Align)
- {
- x = 2;
- }
- else
- {
- x = (UI_device_width >> 1) - (w2 >> 1);
- if (x < 2)
- {
- x = 2;
- }
- }
- if (r2lMMIFlag)
- {
- if (gui_get_string_width((UI_string_type) MMI_message_string2) >= UI_device_width)
- {
- x = UI_device_width - 1;
- }
- else
- {
- x += gui_get_string_width((UI_string_type) MMI_message_string2);
- }
- }
- gui_print_truncated_text(x, category_154_message2_y, UI_device_width - 2, MMI_message_string2);
- gdi_layer_set_clip(
- 0,
- (MMI_title_y + MMI_title_height) + 1,
- UI_device_width - 1,
- UI_device_height - MMI_button_bar_height - 1);
- wgui_show_transparent_animation();
- }
- /*****************************************************************************
- * FUNCTION
- * Setcategory154LeftAlign
- * DESCRIPTION
- * Set content of category154 left alignment
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void Setcategory154LeftAlign(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Category154Align = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * ChangeCategory154Data
- * DESCRIPTION
- * Change data of category154
- * PARAMETERS
- * message1 [IN] Data pointer of message1
- * message2 [IN] Data pointer of message2
- * message_icon [IN] Id of message icon
- * RETURNS
- * void
- *****************************************************************************/
- void ChangeCategory154Data(U8 *message1, U8 *message2, U16 message_icon)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 w1, h1, w2, h2, w3, h3, y, th, rh;
- PU8 image;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_message_string = (UI_string_type) message1;
- MMI_message_string2 = (UI_string_type) message2;
- gui_set_font(current_UI_theme->multi_line_input_box_theme->text_font);
- gui_measure_string(MMI_message_string, &w1, &h1);
- gui_measure_string(MMI_message_string2, &w2, &h2);
- image = get_image(message_icon);
- gui_measure_image(image, &w3, &h3);
- th = h1 + h2 + h3 + 2;
- y = (MMI_title_y + MMI_title_height) + 1 + ((MMI_content_height - 1) >> 1) - (th >> 1);
- if (th < MMI_content_height)
- {
- rh = (MMI_content_height - th) >> 2;
- }
- else
- {
- rh = 0;
- }
- y -= rh;
- if (y < ((MMI_title_y + MMI_title_height) + 1))
- {
- y = (MMI_title_y + MMI_title_height) + 1;
- }
- category_154_message1_y = y;
- category_154_message2_y = y + h1;
- y += h1 + h2 + rh + 2;
- wgui_set_animation_image_y((UI_device_width >> 1), y, image);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory154Screen
- * DESCRIPTION
- * Displays the Message Received 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
- * message1 [IN] Notification message 1
- * message2 [IN] Notification message 2
- * message_icon [IN]
- * history_buffer [IN] History buffer
- * MMI_ID_TYPE(?) [IN] Image Notification image
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory154Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *message1,
- U8 *message2,
- U16 message_icon,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 w1, h1, w2, h2, w3, h3, y, th, rh;
- PU8 image;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(history_buffer);
- 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();
- if (title == 0)
- {
- wgui_switch_title_with_status_bar = 1;
- ShowStatusIconsTitle();
- }
- else
- {
- MMI_title_string = get_string(title);
- MMI_title_icon = get_image(title_icon);
- wgui_switch_title_with_status_bar = 0;
- }
- MMI_message_string = (UI_string_type) message1;
- MMI_message_string2 = (UI_string_type) message2;
- gui_set_font(current_UI_theme->multi_line_input_box_theme->text_font);
- gui_measure_string(MMI_message_string, &w1, &h1);
- gui_measure_string(MMI_message_string2, &w2, &h2);
- image = get_image(message_icon);
- gui_measure_image(image, &w3, &h3);
- th = h1 + 1 + h2 + 2 + h3;
- y = (MMI_title_y + MMI_title_height) + 1 + ((MMI_content_height - 1) >> 1) - (th >> 1);
- if (th < MMI_content_height)
- {
- rh = (MMI_content_height - th) >> 2;
- }
- else
- {
- rh = 0;
- }
- y -= rh;
- if (y < ((MMI_title_y + MMI_title_height) + 1))
- {
- y = (MMI_title_y + MMI_title_height) + 1;
- }
- category_154_message1_y = y;
- category_154_message2_y = y + h1 + 1;
- y += h1 + 1 + h2 + rh + 2;
- wgui_set_animation_image_y((UI_device_width >> 1), y, image);
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory154Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dummy_get_history, dummy_get_history_size);
- dm_register_category_controlled_callback(DrawCate154CategoryControlArea);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- if (wgui_switch_title_with_status_bar == 1)
- {
- dm_data.s32CatId = MMI_CATEGORY154_STATUS_ICON_ID;
- }
- else
- {
- dm_data.s32CatId = MMI_CATEGORY154_ID;
- }
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory154Screen
- * DESCRIPTION
- * Exits the Message Received screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory154Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_switch_title_with_status_bar)
- {
- close_status_icons();
- wgui_switch_title_with_status_bar = 0;
- }
- Category154Align = 0;
- MMI_message_string = NULL;
- MMI_message_string2 = NULL;
- gui_hide_animations();
- }
- #if defined(__MMI_SMART_MESSAGE_MT__) || (defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__))
- /* category 154 message 1 */
- UI_string_type category_620_message1 = NULL;
- /* category 154 message 2 */
- UI_string_type category_620_message2 = NULL;
- /* category 154 message 1 y postition */
- S32 category_620_message1_y = 0;
- /* category 154 message 2 y position */
- S32 category_620_message2_y = 0;
- U8 Category620Align = 0;
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory620Screen
- * DESCRIPTION
- * Redraws the Message Received screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory620Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 w1, h1, w2, h2, x;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- gui_hide_animations();
- clear_screen();
- if (wgui_switch_title_with_status_bar)
- {
- show_status_icons();
- }
- else
- {
- draw_title();
- }
- gdi_layer_reset_clip();
- gui_set_font(current_UI_theme->multi_line_input_box_theme->text_font);
- gui_measure_string(category_620_message1, &w1, &h1);
- gui_measure_string(category_620_message2, &w2, &h2);
- gui_set_text_color(*(current_MMI_theme->UI_black_color));
- if (Category620Align)
- {
- x = 2;
- }
- else
- {
- x = (UI_device_width >> 1) - (w1 >> 1);
- if (x < 2)
- {
- x = 2;
- }
- }
- gui_move_text_cursor(x, category_620_message1_y);
- gui_set_line_height(h1);
- gui_print_text(category_620_message1);
- if (Category620Align)
- {
- x = 2;
- }
- else
- {
- x = (UI_device_width >> 1) - (w2 >> 1);
- if (x < 2)
- {
- x = 2;
- }
- }
- gui_print_truncated_text(x, category_620_message2_y, UI_device_width - 2, category_620_message2);
- gdi_layer_set_clip(
- 0,
- (MMI_title_y + MMI_title_height) + 1,
- UI_device_width - 1,
- UI_device_height - MMI_button_bar_height - 1);
- wgui_show_transparent_animation();
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * Setcategory620LeftAlign
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void Setcategory620LeftAlign(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Category620Align = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * ChangeCategory620Data
- * DESCRIPTION
- *
- * PARAMETERS
- * message1 [?]
- * message2 [?]
- * message_icon_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ChangeCategory620Data(U8 *message1, U8 *message2, U8 *message_icon_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 w1, h1, w2, h2, w3, h3, y, th, rh;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- category_620_message1 = (UI_string_type) message1;
- category_620_message2 = (UI_string_type) message2;
- gui_set_font(current_UI_theme->multi_line_input_box_theme->text_font);
- gui_measure_string(category_620_message1, &w1, &h1);
- gui_measure_string(category_620_message2, &w2, &h2);
- gui_measure_image((PU8) message_icon_buffer, &w3, &h3);
- th = h1 + h2 + h3 + 2;
- y = (MMI_title_y + MMI_title_height) + 1 + ((MMI_content_height - 1) >> 1) - (th >> 1);
- if (th < MMI_content_height)
- {
- rh = (MMI_content_height - th) >> 2;
- }
- else
- {
- rh = 0;
- }
- y -= rh;
- if (y < ((MMI_title_y + MMI_title_height) + 1))
- {
- y = (MMI_title_y + MMI_title_height) + 1;
- }
- category_620_message1_y = y;
- category_620_message2_y = y + h1;
- y += h1 + h2 + rh + 2;
- wgui_set_animation_image_y((UI_device_width >> 1), y, (PU8) message_icon_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory620Screen
- * DESCRIPTION
- * Displays the Message Received 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
- * message1 [IN] Notification message 1
- * message2 [IN] Notification message 2
- * message_icon_buffer [?]
- * history_buffer [IN] History buffer
- * IMAGE_Bufferimage(?) [IN] Notification image
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory620Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *message1,
- U8 *message2,
- U8 *message_icon_buffer,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- UI_UNUSED_PARAMETER(history_buffer);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- dm_reset_context();
- 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();
- if (title == 0)
- {
- wgui_switch_title_with_status_bar = 1;
- ShowStatusIconsTitle();
- }
- else
- {
- MMI_title_string = get_string(title);
- MMI_title_icon = get_image(title_icon);
- wgui_switch_title_with_status_bar = 0;
- }
- dm_add_image((PU8) message_icon_buffer, NULL, NULL);
- dm_add_string((UI_string_type) message1, &MMI_medium_font, UI_COLOR_BLACK, UI_COLOR_BLACK, NULL);
- dm_add_string((UI_string_type) message2, &MMI_medium_font, UI_COLOR_BLACK, UI_COLOR_BLACK, NULL);
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory620Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dummy_get_history, dummy_get_history_size);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY620_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory620Screen
- * DESCRIPTION
- * Exits the Message Received screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory620Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_switch_title_with_status_bar)
- {
- close_status_icons();
- wgui_switch_title_with_status_bar = 0;
- }
- Category620Align = 0;
- category_620_message1 = NULL;
- category_620_message2 = NULL;
- gui_hide_animations();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory620HistorySize
- * DESCRIPTION
- * Gets the history buffer size for the Message Received screen
- * PARAMETERS
- * void
- * RETURNS
- * size in U8s of the history buffer
- *****************************************************************************/
- S32 GetCategory620HistorySize(void)