wgui_categories_multimedia.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:176k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * wgui_categories_multimedia.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * Multimedia related categories.
- *
- * [Category221] Empty Screen
- * [Category222] View Image Screen
- * [Category223] Play Audio Screen
- * [Category224] Play Video Full Screen
- * [Category225] Play Video Standard Screen (With title & softkey)
- *
- * [Category331][SUB] Emptry Sublcd Screen
- * [Category332][SUB] Image Icon Sublcd Screen
- * [Category333][SUB] Play Audio Sublcd Screen
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #ifndef MMI_ON_HARDWARE_P
- #undef __DRM_SUPPORT__
- #undef __DRM_V01__
- #endif /* MMI_ON_HARDWARE_P */
- /* cat 222 profiling */
- // #define CAT222_DECODE_TIME_TEST
- #include "MMI_features.h"
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- /* framework related include */
- #include "EventsGprot.h"
- #include "CustDataProts.h"
- #include "CustMenuRes.h"
- #include "GlobalDefs.h"
- #include "FrameworkStruct.h"
- #include "EventsDef.h"
- #include "Unicodexdcl.h"
- #include "DebugInitDef.h"
- #include "fat_fs.h"
- #include "SettingProfile.h" /* for error tone */
- #ifdef __DRM_SUPPORT__
- #include "Fs_errcode.h"
- #include "Drm_gprot.h"
- #endif /* __DRM_SUPPORT__ */
- /* gui related include */
- #include "gdi_include.h" /* include for graphic lib */
- #include "lcd_if.h"
- #include "gui_themes.h"
- #include "wgui.h"
- #include "wgui_softkeys.h"
- #include "wgui_fixed_menus.h"
- #include "wgui_fixed_menuitems.h"
- #include "wgui_dynamic_menus.h"
- #include "wgui_dynamic_menuitems.h"
- #include "wgui_categories.h"
- #include "wgui_categories_sublcd.h"
- #include "wgui_categories_multimedia.h"
- #include "wgui_categories_inputs.h" /* MULTILINE_INPUTBOX_HEIGHT_PAD */
- #include "wgui_status_icons.h"
- #include "CommonScreens.h" /* DisplayPopup() */
- #include "PhoneSetupGprots.h" /* PhnsetGetDefEncodingType() */
- #include "Conversions.h" /* char set conversion */
- #include "ScrMemMgrGprot.h" /* screen memeory manager */
- #include "wgui_draw_manager.h"
- #ifdef __MMI_TOUCH_SCREEN__
- #include "wgui_touch_screen.h"
- #endif
- #include "WallpaperDefs.h" /* Image size error string */
- #include "GpioInc.h" /* backlight on/off */
- #include "FileMgr.h"
- #include "FileManagerDef.h"
- #include "FileManagerGProt.h"
- #include "SubLCDHistoryGprot.h" /* sublcd function */
- #ifdef CAT222_DECODE_TIME_TEST
- #include "kal_release.h" /* for KAL time API */
- #include "kal_nucleus.h"
- #endif /* CAT222_DECODE_TIME_TEST */
- #ifdef __MMI_VIDEO_PLAYER__
- #include "med_api.h" /* media task */
- #include "med_main.h" /* media task */
- #include "mdi_datatype.h"
- #include "mdi_video.h" /* video lib */
- #include "mdi_audio.h"
- #include "lcd_sw_rnd.h"
- #include "gdi_include.h"
- #include "VdoPlyImgEnum.h" /* sublcd video icon */
- #endif /* __MMI_VIDEO_PLAYER__ */
- #ifdef __MMI_TVOUT__
- #include "mdi_tv.h" /* mdi tvout */
- #include "WallpaperDefs.h" /* some header for phonsetup.h */
- #include "DownloadDefs.h" /* some header for phonsetup.h */
- #include "PhoneSetup.h" /* tvout display style */
- #endif /* __MMI_TVOUT__ */
- #ifdef __MMI_SWFLASH__
- #include "mdi_swflash.h"
- #include "mmi_phnset_dispchar.h"
- #endif
- /****************************************************************************
- * Define
- *****************************************************************************/
- /****************************************************************************
- * Global Variable
- *****************************************************************************/
- extern S16 status_icon;
- extern S32 wgui_image_clip_x1;
- extern S32 wgui_image_clip_x2;
- extern S32 wgui_image_clip_y1;
- extern S32 wgui_image_clip_y2;
- extern U8 wgui_category_screen_no_buttons;
- extern BOOL r2lMMIFlag;
- extern U16 title_bg_id;
- extern gdi_handle wgui_layer_1;
- extern gdi_handle wgui_base_layer;
- #ifdef __MMI_SWFLASH__
- extern S8 *idle_screen_wallpaper_name;
- #endif
- /****************************************************************************
- * Global Function
- *****************************************************************************/
- extern void wgui_set_animation_image_y(S32 x, S32 y, PU8 img);
- extern void wgui_show_transparent_animation(void);
- extern void set_main_LCD_time_duration_hide_function(void (*f) (S32 x1, S32 y1, S32 x2, S32 y2)); /* 101705 */
- #ifdef __MMI_AUDIO_PLAYER__
- extern int mmi_audply_exit_subLCD(void);
- extern int mmi_audply_redraw_subLCD(BOOL);
- extern BOOL mmi_audply_is_playing(void);
- #endif /* __MMI_AUDIO_PLAYER__ */
- #ifdef __MMI_FM_RADIO__
- extern int mmi_fmrdo_exit_subLCD(void);
- extern int mmi_fmrdo_redraw_subLCD(BOOL);
- extern BOOL mmi_fmrdo_is_power_on(void);
- #endif /* __MMI_FM_RADIO__ */
- #ifdef __MMI_VIDEO_PLAYER__
- mdi_video_info_struct wgui_video_info;
- #endif
- #ifdef __MMI_SWFLASH__
- extern void PhnsetWallpaperBadFileCallBack(U16 imgID);
- extern void dm_category_33_controlled_area(dm_coordinates *coordinate);
- extern pBOOL mmi_bootup_get_active_flight_mode(void);
- extern void ShowCategory33Screen_ext(
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *history_buffer);
- extern void ExitCategory33Screen(void);
- #endif
- /****************************************************************************
- * Local Variable
- *****************************************************************************/
- /* [Category 221] */
- static FuncPtr cat221_redraw_content_callback = NULL;
- static gdi_color cat221_background_color;
- /* [Category 222] */
- static PS8 cat222_file_name_ptr;
- static U16 cat222_title_icon;
- static U16 cat222_title;
- static PS8 cat222_button_str_ptr; /* will use subMenu's data buffer to store */
- static void (*cat222_decode_result_callback) (GDI_RESULT);
- static BOOL cat222_is_short_filename;
- static GDI_HANDLE cat222_anim_handle;
- static S32 cat222_img_width;
- static S32 cat222_img_height;
- #ifdef __MMI_TVOUT__
- static BOOL cat222_is_fullscr_tvout = FALSE;
- #endif
- /* [Category 223] */
- static BOOL cat223_display_duration = FALSE;
- /* [Category Vdoply] */
- #ifdef __MMI_VIDEO_PLAYER__
- static U16 cat_vdoply_video_repeat_count;
- static U8 cat_vdoply_audio_volumn;
- static BOOL cat_vdoply_video_is_visual_update;
- static BOOL cat_vdoply_video_is_play_audio;
- static BOOL cat_vdoply_video_is_lcd_no_sleep;
- static BOOL cat_vdoply_is_video_open;
- static BOOL cat_vdoply_is_video_play;
- static MDI_RESULT cat_vdoply_is_video_play_result = -1;
- static BOOL cat_vdoply_is_video_force_stop; /* force stop flag */
- static BOOL cat_vdoply_is_video_from_id;
- static GDI_HANDLE cat_vdoply_video_layer = GDI_ERROR_HANDLE;
- #ifdef __MMI_SUBLCD__
- static BOOL cat_vdoply_is_sublcd_display = FALSE; /* must init */
- #endif
- static void (*cat_vdoply_play_finish_callback) (MDI_RESULT result);
- static U8 cat_vdoply_is_full_screen;
- #endif /* __MMI_VIDEO_PLAYER__ */
- /* [Category 229 ] */
- #ifdef __MMI_SWFLASH__
- extern mdi_swflash_info_struct wgui_swflash_info;
- static U16 cat_swflash_repeat_count;
- static U8 cat_swflash_audio_volumn;
- static MMI_BOOL cat_swflash_is_audio_on;
- static MMI_BOOL cat_swflash_is_vibrate_on;
- static MMI_BOOL cat_swflash_is_interaction_on;
- static MMI_BOOL cat_swflash_is_lcd_no_sleep;
- static MMI_BOOL cat_swflash_is_open;
- static MMI_BOOL cat_swflash_is_play;
- static MMI_BOOL cat_swflash_is_from_id;
- static GDI_HANDLE cat_swflash_layer = GDI_ERROR_HANDLE;
- static void (*cat_swflash_play_finish_callback) (MDI_RESULT);
- static U8 cat_swflash_is_full_screen;
- static MDI_RESULT cat_swflash_play_ret;
- #endif /* __MMI_SWFLASH__ */
- #ifdef __MMI_SWFLASH__
- static S32 g_mmi_idle_bg_media_type = 0;
- #endif
- /****************************************************************************
- * Local Function
- *****************************************************************************/
- /* [Category 221] */
- static void ExitCategory221Screen(void);
- /* [Category 222] */
- static void ExitCategory222Screen(void);
- static void Cat222DecodeImage(void);
- static void Cat222DrawTitle(void);
- #ifdef __MMI_TVOUT__
- static void Cat222ToggleTVDisplay(void);
- #endif
- /* [Category 223] */
- static void ExitCategory223Screen(void);
- static void DrawCate223CategoryControlArea(dm_coordinates *coordinate);
- static void Cat223DrawDurationBar(void);
- static void Cat223InitDruration(UI_time *t, U32 duration);
- static void Cat223HideDurationDisplay(S32 x1, S32 y1, S32 x2, S32 y2);
- #ifdef __MMI_VIDEO_PLAYER__
- /* [Category Video Play Screen] */
- static void ShowCategoryVdoplyScreen(BOOL is_fullscreen,
- U16 title_str,
- U16 title_icon,
- U16 lsk_str,
- U16 lsk_icon,
- U16 rsk_str,
- U16 rsk_icon,
- U16 video_id,
- PS8 video_filename,
- U16 repeat_count,
- BOOL is_visual_update,
- BOOL is_play_audio,
- BOOL is_lcd_no_sleep,
- GDI_COLOR bg_color, void (*play_finish_callback) (MDI_RESULT), void *gui_buffer);
- static void ExitCategoryVdoplyScreen(void);
- static void StopCategoryVdoplyVideo(void);
- static void PauseCategoryVdoplyVideo(void);
- static void ResumeCategoryVdoplyVideo(void);
- static void CatVdoplyPlayFinishCallback(MDI_RESULT result);
- #ifdef __MMI_SWFLASH__
- extern void DrawCateSWFlashCategoryControlArea(dm_coordinates *coordinate);
- extern void ExitCategory34Screen(void);
- #endif
- #ifdef __MMI_SUBLCD__
- static void EnterCategoryVdoplySubScreen(void);
- static void ExitCategoryVdoplySubScreen(void);
- #endif /* __MMI_SUBLCD__ */
- static void CatVdoplyVolUp(void);
- static void CatVdoplyVolDown(void);
- #endif /* __MMI_VIDEO_PLAYER__ */
- #ifdef __MMI_SUBLCD__
- /* [Category 331] [SUB] */
- static void ExitCategory331Screen(void);
- /* [Category 331] [SUB] */
- static void ExitCategory332Screen(void);
- /* [Category 333] [SUB] */
- static U8 *GetCategory333History(U8 *history_buffer);
- static S32 GetCategory333HistorySize(void);
- static void ExitCategory333Screen(void);
- static void RedrawCategory333Screen(void);
- #endif /* __MMI_SUBLCD__ */
- void cat226_hide_button_full_screen(void *button_object);
- #ifdef __MMI_SWFLASH__
- static void ExitCategorySWFlashScreen(void);
- #endif
- /****************************************************************************
- *
- * MultiMedia Related [MainLCD] Categories
- *
- *****************************************************************************/
- /*****************************************************************************
- * [Category221]
- *
- * This category is basic frame with caption and softkeys.
- *
- * **********************
- * * Caption *
- * **********************
- * * *
- * * *
- * * *
- * * <----------- Empty. Will hook call back function to redraw.
- * * *
- * * *
- * * *
- * ********* *********
- * * LSK * * RSK *
- * **********************
- *
- *****************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * DrawCate221CategoryControlArea
- * DESCRIPTION
- * This function is used to draw the category controlled area of category221 screen
- * PARAMETERS
- * coordinate [IN/OUT] Coordinates of category controlled area.
- * RETURNS
- * void
- *****************************************************************************/
- void DrawCate221CategoryControlArea(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_title_string != 0 || MMI_title_icon != 0)
- {
- #if defined(__MMI_SCREEN_ROTATE__)
- if (!mmi_frm_is_screen_width_height_swapped())
- {
- show_title_status_icon();
- }
- #else /* defined(__MMI_SCREEN_ROTATE__) */
- show_title_status_icon();
- #endif /* defined(__MMI_SCREEN_ROTATE__) */
- draw_title();
- }
- /* fill background */
- gdi_layer_reset_clip();
- /* if has title - draw content region only */
- if (MMI_title_string != 0 || MMI_title_icon != 0)
- {
- gdi_draw_solid_rect(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- (MMI_title_y + MMI_title_height) + MMI_content_height - 1,
- cat221_background_color);
- }
- else
- {
- gdi_draw_solid_rect(
- 0,
- 0,
- UI_device_width - 1,
- (MMI_title_y + MMI_title_height) + MMI_content_height - 1,
- cat221_background_color);
- }
- /* redraw callback function */
- if (cat221_redraw_content_callback != NULL)
- {
- cat221_redraw_content_callback();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory221Screen
- * DESCRIPTION
- * Show category 221 screen.
- * PARAMETERS
- * title [IN] Title string id
- * title_icon [IN] Title image id
- * left_softkey [IN] Lsk string id
- * left_softkey_icon [IN] Lsk image id
- * right_softkey [IN] Rsk string id
- * right_softkey_icon [IN] Rsk image id
- * background_color [IN] Background color for content region
- * redraw_content_callback [IN] Callback function to redraw context (PS.This redraw callback pointer is used for framework to update content region when theme update.PS. MMI Framework will not call redraw function anymore. The pointer is useless)
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory221Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- gdi_color background_color,
- FuncPtr redraw_content_callback)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- cat221_background_color = background_color;
- cat221_redraw_content_callback = redraw_content_callback;
- /* hide status if will not draw title bar */
- #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) /* 041205 Calvin modieid */
- if (title == 0 && title_icon == 0)
- {
- hide_status_icon_bar(0);
- }
- #endif /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */
- /* lock */
- gui_lock_double_buffer();
- MMI_menu_shortcut_number = -1;
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- /* init title */
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- gui_unlock_double_buffer();
- ExitCategoryFunction = ExitCategory221Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_register_category_controlled_callback(DrawCate221CategoryControlArea);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY221_ID;
- dm_data.s32flags = 0;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory221Screen
- * DESCRIPTION
- * Exit category 221
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void ExitCategory221Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearHighlightHandler();
- reset_softkeys();
- #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) /* 041205 Calvin modieid */
- show_status_icon_bar(0);
- #endif
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * [Category222]
- *
- * This category is for view image from file.
- *
- * **********************
- * * Caption *
- * **********************
- * * *
- * * *
- * * *
- * * (Image) *
- * * *
- * * *
- * * *
- * ********* *********
- * * LSK * * RSK *
- * **********************
- *
- *****************************************************************************/
- /****************************************************************************
- * Two View Mode. Turn on ONLY one style.
- * (1) CAT222_IMAGE_FIT_FULLSCREEN_SIZE.
- * Image will fit full screen size. This is useful when view wallpapre that it will not shink.
- *
- * (2) CAT222_IMAGE_FIT_CONTENT_SIZE
- * Image will fit content region, and will have a photo like display.
- *****************************************************************************/
- #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) /* 041205 Calvin modieid */
- // #define CAT222_IMAGE_FIT_FULLSCREEN_SIZE
- #define CAT222_IMAGE_FIT_CONTENT_SIZE
- #define CAT222_IMAGE_SPACING (5) /* spacing between image and LCM boundry */
- #else /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */
- // #define CAT222_IMAGE_FIT_FULLSCREEN_SIZE
- #define CAT222_IMAGE_FIT_CONTENT_SIZE
- #define CAT222_IMAGE_SPACING (4) /* spacing between image and LCM boundry */
- #endif /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */
- void DrawCate222CategoryControlArea(dm_coordinates *coordinate);
- /*****************************************************************************
- * FUNCTION
- * cat222_get_image_handle
- * DESCRIPTION
- * get the animation handle for cat 222
- * PARAMETERS
- * void
- * RETURNS
- * gdi_handle
- *****************************************************************************/
- gdi_handle cat222_get_image_handle(void)//070706
- {
- return (gdi_handle)cat222_anim_handle;
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory222Screen
- * DESCRIPTION
- * Show Category 222 Screen.
- * PARAMETERS
- * title [IN] )
- * title_icon [IN] Title image id
- * left_softkey [IN] Lsk string id
- * left_softkey_icon [IN] Lsk image id
- * right_softkey [IN] Rsk string id
- * right_softkey_icon [IN] Rsk image id
- * background_color [IN] Background color for content region
- * button_string [IN] String on LSK region. (If this pointer is not NULL, the string will draw on lsk region.)
- * file_name_ptr [IN] Filename to be decode.
- * is_short_filename [IN] File name is short or not.
- * decode_result_callback [IN] Decode result callback function
- * EX: It may be used as show index/total number.(?)
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory222Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- gdi_color background_color,
- S8 *button_string,
- S8 *file_name_ptr,
- BOOL is_short_filename,
- void (*decode_result_callback) (GDI_RESULT))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cat222_file_name_ptr = file_name_ptr;
- cat222_title_icon = title_icon;
- cat222_title = title;
- cat222_is_short_filename = is_short_filename;
- cat222_decode_result_callback = decode_result_callback;
- cat222_anim_handle = GDI_NULL_HANDLE;
- if (button_string != NULL)
- {
- cat222_button_str_ptr = (S8*) (subMenuDataPtrs[0]); /* use submenu's data buffer, not a good solution */
- memset(cat222_button_str_ptr, 0, MAX_SUB_MENU_SIZE);
- pfnUnicodeStrncpy(cat222_button_str_ptr, button_string, (MAX_SUB_MENU_SIZE / ENCODING_LENGTH) - 1);
- }
- else
- {
- cat222_button_str_ptr = NULL;
- }
- MMI_menu_shortcut_number = -1;
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- #ifdef __MMI_TVOUT__
- SetKeyHandler(Cat222ToggleTVDisplay, KEY_STAR, KEY_EVENT_UP);
- #endif
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- ExitCategoryFunction = ExitCategory222Screen;
- dm_setup_category_functions(UI_dummy_function, dm_get_category_history, dm_get_category_history_size);
- dm_register_category_controlled_callback(DrawCate222CategoryControlArea);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY222_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND | DM_NO_BLT;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- /* Draw Image */
- Cat222DecodeImage();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory222Screen
- * DESCRIPTION
- * Exit Category 222 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void ExitCategory222Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* restore TV out mode */
- #ifdef __MMI_TVOUT__
- if (cat222_is_fullscr_tvout)
- {
- if (mdi_tvout_is_enable())
- {
- /* restore back to GDI */
- mdi_tvout_set_owner(MDI_TV_OWNER_GDI);
- /* restore back to start mode1 */
- mdi_tvout_set_mode(
- MDI_TV_MODE_LCD_SCR,
- 0, /* layer_width */
- 0); /* layer_height */
- }
- }
- #endif /* __MMI_TVOUT__ */
- if (cat222_anim_handle != GDI_NULL_HANDLE)
- {
- gdi_image_stop_animation(cat222_anim_handle);
- }
- ClearHighlightHandler();
- reset_softkeys();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * DrawCate222CategoryControlArea
- * DESCRIPTION
- * This function is used to draw the category controlled area of category222 screen
- * PARAMETERS
- * coordinate [IN/OUT] Coordinates of category controlled area.
- * RETURNS
- * void
- *****************************************************************************/
- void DrawCate222CategoryControlArea(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 str_height;
- S32 str_width;
- S32 spacing;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cat222_button_str_ptr != NULL)
- {
- gdi_layer_push_text_clip();
- gdi_layer_set_text_clip(0, UI_device_width - MMI_button_bar_height, UI_device_width - 1, UI_device_height - 1);
- /* draw button string */
- gui_set_font(&MMI_medium_font);
- gui_measure_string((UI_string_type) cat222_button_str_ptr, &str_width, &str_height);
- spacing = (MMI_button_bar_height - str_height) >> 1;
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(spacing + str_width, UI_device_height - MMI_button_bar_height + spacing);
- }
- else
- {
- gui_move_text_cursor(spacing, UI_device_height - MMI_button_bar_height + spacing);
- }
- gui_set_text_color(gui_color(0, 0, 0));
- gui_print_text((UI_string_type) cat222_button_str_ptr);
- gdi_layer_pop_text_clip();
- }
- Cat222DrawTitle();
- }
- /*****************************************************************************
- * FUNCTION
- * Cat222DrawTitle
- * DESCRIPTION
- * draw cat 222 title
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void Cat222DrawTitle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 str_len;
- S32 index;
- S8 buf_filename_no_ext[(FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH];
- S8 buf_filename_dest[(FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* clear background */
- gdi_draw_solid_rect(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- UI_device_height - MMI_button_bar_height - 1,
- GDI_COLOR_WHITE);
- if (cat222_title == 0)
- {
- /* display filename */
- str_len = pfnUnicodeStrlen(cat222_file_name_ptr);
- /* find file name - by finding "\" */
- for (index = str_len * 2 - 2; index >= 2; index -= 2)
- {
- if (pfnUnicodeStrncmp((PS8) & cat222_file_name_ptr[index], (PS8) L"\", 1) == 0)
- {
- index += 2;
- break;
- }
- }
- pfnUnicodeStrcpy((PS8) buf_filename_no_ext, (PS8) (&(cat222_file_name_ptr[index])));
- mmi_fmgr_hide_ext_name(buf_filename_no_ext);
- /* short name encoding */
- if (cat222_is_short_filename)
- {
- mmi_chset_mixed_text_to_ucs2_str(
- (U8*) buf_filename_dest,
- sizeof(buf_filename_dest),
- (U8*) buf_filename_no_ext,
- PhnsetGetDefEncodingType());
- ChangeTitle(cat222_title_icon, (PU8) (buf_filename_dest));
- }
- else
- {
- ChangeTitle(cat222_title_icon, (PU8) (buf_filename_no_ext));
- }
- }
- draw_title();
- }
- /*****************************************************************************
- * FUNCTION
- * Cat222DecodeImage
- * DESCRIPTION
- * Decode Image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void Cat222DecodeImage(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 image_width;
- S32 image_height;
- S32 display_wnd_width;
- S32 display_wnd_height;
- #if defined(CAT222_IMAGE_FIT_CONTENT_SIZE)
- S32 rect_height = 0;
- S32 rect_width = 0;
- S32 rect_offset_x = 0;
- S32 rect_offset_y = 0;
- #endif /* defined(CAT222_IMAGE_FIT_CONTENT_SIZE) */
- S32 offset_x = 0;
- S32 offset_y = 0;
- GDI_RESULT result = 0;
- S32 str_len;
- U16 image_type;
- UI_string_type err_str_ptr;
- FS_HANDLE fs_handle;
- U32 file_size;
- S32 line_height;
- #ifdef CAT222_DECODE_TIME_TEST
- kal_uint32 start_tick;
- kal_uint32 end_tick;
- kal_uint32 decode_ms;
- S8 decode_timer_buf[30];
- S8 buf_filename_no_ext[(FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH]; /* 101705 */
- S32 str_width;
- S32 str_height;
- #endif /* CAT222_DECODE_TIME_TEST */
- #if defined(CAT222_IMAGE_FIT_FULLSCREEN_SIZE) || defined(CAT222_IMAGE_FIT_CONTENT_SIZE)
- S32 resized_offset_x;
- S32 resized_offset_y;
- S32 resized_width;
- S32 resized_height;
- #endif /* defined(CAT222_IMAGE_FIT_FULLSCREEN_SIZE) || defined(CAT222_IMAGE_FIT_CONTENT_SIZE) */
- #ifdef __MMI_TVOUT__
- S32 tvout_resized_offset_x;
- S32 tvout_resized_offset_y;
- S32 tvout_resized_width;
- S32 tvout_resized_height;
- S32 tvout_max_width;
- S32 tvout_max_height;
- GDI_HANDLE tvout_layer;
- #endif /* __MMI_TVOUT__ */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* init */
- err_str_ptr = NULL;
- /* lock */
- gdi_layer_lock_frame_buffer();
- /* push clip */
- gdi_layer_push_clip();
- gdi_layer_push_text_clip();
- gdi_layer_set_clip(
- CAT222_IMAGE_SPACING,
- (MMI_title_y + MMI_title_height) + CAT222_IMAGE_SPACING,
- UI_device_width - CAT222_IMAGE_SPACING - 1,
- (MMI_title_y + MMI_title_height) + MMI_content_height - CAT222_IMAGE_SPACING - 1);
- /* get time tick before decoding */
- #ifdef CAT222_DECODE_TIME_TEST
- kal_get_time(&start_tick);
- #endif
- /* Decode file */
- /* temp solution, waiting for decoder has resizer for gif and bmp */
- image_type = gdi_image_get_type_from_file(cat222_file_name_ptr);
- /* get file size */
- fs_handle = FS_Open((U16*) cat222_file_name_ptr, FS_READ_ONLY);
- if (fs_handle < 0)
- {
- /* open file failed */
- result = -1;
- err_str_ptr = (UI_string_type) GetString(FMGR_FS_FILE_NOT_FOUND_TEXT);
- }
- else
- {
- FS_GetFileSize(fs_handle, (kal_uint32*) & file_size);
- FS_Close(fs_handle);
- }
- #ifndef CAT222_DECODE_TIME_TEST
- /* check file size limit and image siz limit */
- if (result >= 0)
- {
- switch (image_type)
- {
- case GDI_IMAGE_TYPE_SVG_FILE:
- if (file_size > 200 * 1024) /* file size check - 200k */
- {
- err_str_ptr = (UI_string_type) GetString(STR_ID_FMGR_FILE_TOO_LARGE_NO_DISPLAY);
- result = -1;
- }
- break;
- case GDI_IMAGE_TYPE_JPG_FILE:
- /* decoder will timeout if file too large, we dont need to protect here */
- break;
- case GDI_IMAGE_TYPE_BMP_FILE:
- case GDI_IMAGE_TYPE_WBMP_FILE:
- #if defined(MT6228) || defined(MT6229)
- if (file_size > 1536 * 1024) /* 1.5M */
- #else
- if (file_size > 512 * 1024) /* file size check - 512k */
- #endif
- {
- err_str_ptr = (UI_string_type) GetString(STR_ID_FMGR_FILE_TOO_LARGE_NO_DISPLAY);
- result = -1;
- }
- break;
- case GDI_IMAGE_TYPE_GIF_FILE:
- break;
- }
- }
- #endif /* CAT222_DECODE_TIME_TEST */
- /* get file dimension */
- if (result >= 0)
- {
- result = gdi_image_get_dimension_file((PS8) cat222_file_name_ptr, &image_width, &image_height);
- if (((image_width <= 0) || (image_height <= 0)) || result < 0)
- {
- result = -1;
- err_str_ptr = (UI_string_type) GetString(STR_ID_FMGR_INVALID_IMAGE_FORMAT);
- }
- else
- {
- cat222_img_width = image_width;
- cat222_img_height = image_height;
- }
- }
- #if defined(CAT222_IMAGE_FIT_FULLSCREEN_SIZE)
- display_wnd_width = UI_device_width;
- display_wnd_height = UI_device_height;
- #elif defined(CAT222_IMAGE_FIT_CONTENT_SIZE)
- display_wnd_width = UI_device_width - CAT222_IMAGE_SPACING * 2;
- display_wnd_height = MMI_content_height - CAT222_IMAGE_SPACING * 2;
- #endif /* CAT222_TIME_FIT_XXX_SIZE */
- #ifndef CAT222_DECODE_TIME_TEST
- /* check file size limit and image siz limit */
- if (result >= 0)
- {
- switch (image_type)
- {
- case GDI_IMAGE_TYPE_SVG_FILE:
- case GDI_IMAGE_TYPE_JPG_FILE:
- case GDI_IMAGE_TYPE_BMP_FILE:
- case GDI_IMAGE_TYPE_WBMP_FILE:
- break;
- case GDI_IMAGE_TYPE_GIF_FILE:
- /* image size check */
- #if defined(MT6228) || defined(MT6229)
- if (image_width * image_height > 640 * 480 * 4)
- #else
- if (image_width * image_height > 640 * 480)
- #endif
- {
- err_str_ptr = (UI_string_type) GetString(STR_ID_FMGR_IMAGE_TOO_LARGE_NO_DISPLAY);
- result = -1;
- }
- break;
- }
- }
- #endif /* CAT222_DECODE_TIME_TEST */
- /* clear gdi working buffer */
- gdi_image_clear_work_buffer();
- if (result >= 0)
- {
- if (TRUE)
- {
- if ((display_wnd_width >= image_width) && (display_wnd_height >= image_height))
- {
- #if defined(CAT222_IMAGE_FIT_FULLSCREEN_SIZE)
- /* align preview window at the center of screen */
- offset_x = (display_wnd_width - image_width) >> 1;
- offset_y = (display_wnd_height - image_height) >> 1;
- /* set clip region as content region */
- gdi_layer_set_clip(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- (MMI_title_y + MMI_title_height) + MMI_content_height - 1);
- if (image_type == GDI_IMAGE_TYPE_GIF_FILE || image_type == GDI_IMAGE_TYPE_M3D_FILE || image_type == GDI_IMAGE_TYPE_SVG_FILE)
- {
- result = gdi_image_draw_animation_file(
- offset_x,
- offset_y,
- (PS8) cat222_file_name_ptr,
- &cat222_anim_handle);
- }
- else
- {
- result = gdi_image_draw_file(offset_x, offset_y, (PS8) cat222_file_name_ptr);
- }
- #elif defined(CAT222_IMAGE_FIT_CONTENT_SIZE)
- /* align preview window at the center of screen */
- offset_x = ((display_wnd_width - image_width + 1) >> 1) + CAT222_IMAGE_SPACING;
- offset_y =
- ((display_wnd_height - image_height + 1) >> 1) + (MMI_title_y + MMI_title_height) +
- CAT222_IMAGE_SPACING;
- /* set clip region as content region */
- gdi_layer_set_clip(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- (MMI_title_y + MMI_title_height) + MMI_content_height - 1);
- if (image_type == GDI_IMAGE_TYPE_GIF_FILE || image_type == GDI_IMAGE_TYPE_M3D_FILE || image_type == GDI_IMAGE_TYPE_SVG_FILE)
- {
- result = gdi_image_draw_animation_file(
- offset_x,
- offset_y,
- (PS8) cat222_file_name_ptr,
- &cat222_anim_handle);
- }
- else
- {
- result = gdi_image_draw_file(offset_x, offset_y, (PS8) cat222_file_name_ptr);
- }
- rect_offset_x = offset_x;
- rect_offset_y = offset_y;
- resized_width = rect_width = image_width;
- resized_height = rect_height = image_height;
- #endif /* CAT222_TIME_FIT_XXX_SIZE */
- }
- else
- {
- #if defined(CAT222_IMAGE_FIT_FULLSCREEN_SIZE)
- gdi_image_util_fit_bbox(
- display_wnd_width,
- display_wnd_height,
- image_width,
- image_height,
- &resized_offset_x,
- &resized_offset_y,
- &resized_width,
- &resized_height);
- gdi_layer_set_clip(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- (MMI_title_y + MMI_title_height) + MMI_content_height - 1);
- if (image_type == GDI_IMAGE_TYPE_GIF_FILE || image_type == GDI_IMAGE_TYPE_M3D_FILE || image_type == GDI_IMAGE_TYPE_SVG_FILE)
- {
- result = gdi_image_draw_animation_resized_file(
- resized_offset_x,
- resized_offset_y,
- resized_width,
- resized_height,
- (PS8) cat222_file_name_ptr);
- }
- else
- {
- result = gdi_image_draw_resized_file(
- resized_offset_x,
- resized_offset_y,
- resized_width,
- resized_height,
- (PS8) cat222_file_name_ptr);
- }
- #elif defined(CAT222_IMAGE_FIT_CONTENT_SIZE)
- gdi_image_util_fit_bbox(
- display_wnd_width,
- display_wnd_height,
- image_width,
- image_height,
- &resized_offset_x,
- &resized_offset_y,
- &resized_width,
- &resized_height);
- offset_x = resized_offset_x + CAT222_IMAGE_SPACING;
- offset_y = resized_offset_y + (MMI_title_y + MMI_title_height) + CAT222_IMAGE_SPACING;
- gdi_layer_set_clip(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- (MMI_title_y + MMI_title_height) + MMI_content_height - 1);
- rect_offset_x = offset_x;
- rect_offset_y = offset_y;
- rect_width = resized_width;
- rect_height = resized_height;
- gdi_layer_set_clip(
- rect_offset_x - 3,
- rect_offset_y - 3,
- rect_offset_x + rect_width + 2,
- rect_offset_y + rect_height + 2);
- if (image_type == GDI_IMAGE_TYPE_GIF_FILE || image_type == GDI_IMAGE_TYPE_M3D_FILE || image_type == GDI_IMAGE_TYPE_SVG_FILE)
- {
- result = gdi_image_draw_animation_resized_file(
- offset_x,
- offset_y,
- resized_width,
- resized_height,
- (PS8) cat222_file_name_ptr,
- &cat222_anim_handle);
- }
- else
- {
- result = gdi_image_draw_resized_file(
- offset_x,
- offset_y,
- resized_width,
- resized_height,
- (PS8) cat222_file_name_ptr);
- }
- #endif /* CAT222_TIME_FIT_XXX_SIZE */
- }
- }
- else /* not jpeg file */
- {
- #if defined(CAT222_IMAGE_FIT_FULLSCREEN_SIZE)
- offset_x = (display_wnd_width - image_width) >> 1;
- offset_y = (display_wnd_height - image_height) >> 1;
- /* set clip region as content region */
- gdi_layer_set_clip(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- (MMI_title_y + MMI_title_height) + MMI_content_height - 1);
- /* stop all animation and draw file */
- gdi_image_stop_animation_all();
- result = gdi_image_draw_animation_file(offset_x, offset_y, (PS8) cat222_file_name_ptr, &cat222_anim_handle);
- #elif defined(CAT222_IMAGE_FIT_CONTENT_SIZE)
- /* align image at the center of screen */
- offset_x = ((display_wnd_width - image_width + 1) >> 1) + CAT222_IMAGE_SPACING;
- offset_y =
- ((display_wnd_height - image_height + 1) >> 1) + (MMI_title_y + MMI_title_height) +
- CAT222_IMAGE_SPACING;
- if (offset_x < CAT222_IMAGE_SPACING)
- {
- rect_offset_x = CAT222_IMAGE_SPACING;
- rect_width = display_wnd_width;
- }
- else
- {
- rect_offset_x = offset_x;
- rect_width = image_width;
- }
- if (offset_y < ((MMI_title_y + MMI_title_height) + CAT222_IMAGE_SPACING))
- {
- rect_offset_y = (MMI_title_y + MMI_title_height) + CAT222_IMAGE_SPACING;
- rect_height = display_wnd_height;
- }
- else
- {
- rect_offset_y = offset_y;
- rect_height = image_height;
- }
- gdi_layer_set_clip(
- CAT222_IMAGE_SPACING,
- (MMI_title_y + MMI_title_height) + CAT222_IMAGE_SPACING,
- UI_device_width - CAT222_IMAGE_SPACING - 1,
- (MMI_title_y + MMI_title_height) + MMI_content_height - CAT222_IMAGE_SPACING - 1);
- /* stop all animation and draw file */
- gdi_image_stop_animation_all();
- result = gdi_image_draw_animation_file(offset_x, offset_y, (PS8) cat222_file_name_ptr, &cat222_anim_handle);
- #endif /* CAT222_TIME_FIT_XXX_SIZE */
- } /* image type */
- }
- #ifdef __MMI_TVOUT__
- /* prepare decode to TV-Out */
- if (cat222_is_fullscr_tvout == TRUE)
- {
- /* set TV out mode */
- if (mdi_tvout_is_enable())
- {
- /* calculate size */
- /* TODO: Mdi_tv shall provide an interface to get max size */
- tvout_max_width = 320;
- tvout_max_height = 240;
- if ((tvout_max_width >= image_width) && (tvout_max_height >= image_height))
- {
- tvout_resized_width = image_width;
- tvout_resized_height = image_height;
- }
- else
- {
- gdi_image_util_fit_bbox(
- tvout_max_width,
- tvout_max_height,
- image_width,
- image_height,
- &tvout_resized_offset_x,
- &tvout_resized_offset_y,
- &tvout_resized_width,
- &tvout_resized_height);
- }
- /* if is fullscreen, we shall set to owner MMI Owner draw, to avoid GDI's update */
- mdi_tvout_set_owner(MDI_TV_OWNER_APP);
- /* set mode to owner draw */
- mdi_tvout_set_mode(
- MDI_TV_MODE_OWNER_DRAW,
- tvout_resized_width, /* layer_width */
- tvout_resized_height); /* layer_height */
- tvout_layer = mdi_tvout_get_active_layer();
- gdi_layer_push_and_set_active(tvout_layer);
- gdi_layer_reset_clip();
- result = gdi_image_draw_resized_file(
- 0,
- 0,
- tvout_resized_width,
- tvout_resized_height,
- (PS8) cat222_file_name_ptr);
- gdi_layer_pop_and_restore_active();
- /* blt to TV */
- mdi_tvout_blt();
- }
- }
- #endif /* __MMI_TVOUT__ */
- /* calc decode time and print on screen */
- #ifdef CAT222_DECODE_TIME_TEST
- if (result >= 0)
- {
- kal_get_time(&end_tick);
- decode_ms = kal_ticks_to_milli_secs(end_tick - start_tick);
- /* print to a tmp buffer */
- sprintf(buf_filename_no_ext, "%d ms", decode_ms);
- AnsiiToUnicodeString((kal_char*) (decode_timer_buf), (kal_char*) buf_filename_no_ext);
- gui_measure_string((UI_string_type) decode_timer_buf, &str_width, &str_height);
- offset_x = (UI_device_width - str_width) >> 1;
- offset_y = ((MMI_content_height - str_height) >> 1) + (MMI_title_y + MMI_title_height);
- gui_reset_text_clip();
- gui_set_text_color(gui_color(0, 0, 0));
- gui_set_text_border_color(gui_color(255, 255, 255));
- gui_move_text_cursor(offset_x, offset_y);
- gui_print_bordered_text((UI_string_type) decode_timer_buf);
- }
- #endif /* CAT222_DECODE_TIME_TEST */
- if (result >= 0)
- {
- #if defined(CAT222_IMAGE_FIT_CONTENT_SIZE)
- /* if is fit content size mode, draw a rect to make the image like a photo */
- gdi_layer_set_clip(
- 0,
- (MMI_title_y + MMI_title_height),
- UI_device_width - 1,
- (MMI_title_y + MMI_title_height) + MMI_content_height - 1);
- gdi_draw_rect(
- rect_offset_x - 3,
- rect_offset_y - 3,
- rect_offset_x + rect_width + 2,
- rect_offset_y + rect_height + 2,
- GDI_COLOR_BLACK);
- #endif /* defined(CAT222_IMAGE_FIT_CONTENT_SIZE) */
- }
- else
- {
- /* print error string */
- if (err_str_ptr == NULL)
- {
- if (result == GDI_JPEG_ERR_IMAGE_TOO_LARGE)
- {
- err_str_ptr = (UI_string_type) GetString(FMGR_FS_OUT_OF_BUFFERS_TEXT);
- }
- else if (result == GDI_JPEG_ERR_DECODE_TIME_OUT)
- {
- err_str_ptr = (UI_string_type) GetString(STR_ID_FMGR_SYSTEM_BUSY_TO_DECODE);
- }
- else
- {
- err_str_ptr = (UI_string_type) GetString(STR_ID_FMGR_INVALID_IMAGE_FORMAT);
- }
- }
- gdi_draw_solid_rect(
- offset_x,
- offset_y,
- offset_x + resized_width - 1,
- offset_y + resized_height - 1,
- GDI_COLOR_WHITE);
- MMI_message_string = err_str_ptr;
- /* show error string in multi-line input box */
- str_len = pfnUnicodeStrlen((PS8) MMI_message_string);
- create_multiline_inputbox_set_buffer(MMI_message_string, str_len, str_len, 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 | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE;
- MMI_multiline_inputbox.text_font = &MMI_medium_font;
- /* resize to content size and call show_xx_no_draw function to calc its line count */
- resize_multiline_inputbox(UI_device_width - 2, MMI_content_height);
- show_multiline_inputbox_no_draw();
- line_height = get_multiline_inputbox_line_height();
- /* resize and move to both vertical and horizontal center align */
- resize_multiline_inputbox(
- UI_device_width - 2,
- (MMI_multiline_inputbox.n_lines * line_height) + MULTILINE_INPUTBOX_HEIGHT_PAD + MMI_multiline_inputbox.text_y);
- move_multiline_inputbox(
- 1,
- MMI_title_height + MMI_title_y + ((MMI_content_height - MMI_multiline_inputbox.height) >> 1));
- show_multiline_inputbox();
- }
- /* pop and blt */
- gdi_layer_pop_text_clip();
- gdi_layer_pop_clip();
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_base_layer(0, 0, UI_device_width - 1, UI_device_height - 1);
- /* call decode result callback */
- if (cat222_decode_result_callback != NULL)
- {
- cat222_decode_result_callback(result);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * Cat222ToggleTVDisplay
- * DESCRIPTION
- * Toggle TVout display
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void Cat222ToggleTVDisplay(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 tvout_max_width;
- S32 tvout_max_height;
- S32 tvout_resized_width;
- S32 tvout_resized_height;
- S32 tvout_resized_offset_x;
- S32 tvout_resized_offset_y;
- S32 result;
- GDI_HANDLE tvout_layer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mdi_tvout_is_enable())
- {
- if (cat222_is_fullscr_tvout)
- {
- /* restore back to GDI */
- mdi_tvout_set_owner(MDI_TV_OWNER_GDI);
- /* restore back to start mode1 */
- mdi_tvout_set_mode(
- MDI_TV_MODE_LCD_SCR,
- 0, /* layer_width */
- 0); /* layer_height */
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- cat222_is_fullscr_tvout = FALSE;
- }
- else
- {
- /* calculate size */
- /* TODO: Mdi_tv shall provide an interface to get max size */
- tvout_max_width = 320;
- tvout_max_height = 240;
- if ((tvout_max_width >= cat222_img_width) && (tvout_max_height >= cat222_img_height))
- {
- tvout_resized_width = cat222_img_width;
- tvout_resized_height = cat222_img_height;
- }
- else
- {
- gdi_image_util_fit_bbox(
- tvout_max_width,
- tvout_max_height,
- cat222_img_width,
- cat222_img_height,
- &tvout_resized_offset_x,
- &tvout_resized_offset_y,
- &tvout_resized_width,
- &tvout_resized_height);
- }
- /* if is fullscreen, we shall set to owner MMI Owner draw, to avoid GDI's update */
- mdi_tvout_set_owner(MDI_TV_OWNER_APP);
- /* set mode to owner draw */
- mdi_tvout_set_mode(
- MDI_TV_MODE_OWNER_DRAW,
- tvout_resized_width, /* layer_width */
- tvout_resized_height); /* layer_height */
- tvout_layer = mdi_tvout_get_active_layer();
- gdi_layer_push_and_set_active(tvout_layer);
- gdi_layer_reset_clip();
- result = gdi_image_draw_resized_file(
- 0,
- 0,
- tvout_resized_width,
- tvout_resized_height,
- (PS8) cat222_file_name_ptr);
- gdi_layer_pop_and_restore_active();
- /* blt to TV */
- mdi_tvout_blt();
- cat222_is_fullscr_tvout = TRUE;
- }
- }
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * [Category223]
- *
- * This category is for play audio.
- *
- * **********************
- * * Caption *
- * **********************
- * * *
- * * *
- * * (Icon) *
- * * *
- * * *
- * * 00:00:00 *
- * * *
- * ********* *********
- * * LSK * * RSK *
- * **********************
- *
- *****************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * ShowCategory223Screen
- * DESCRIPTION
- * Show sategory 223 screen.
- * PARAMETERS
- * title [IN] Title string id
- * title_icon [IN] Title image id
- * left_softkey [IN] Lsk string id
- * left_softkey_icon [IN] Lsk image id
- * right_softkey [IN] Rsk string id
- * right_softkey_icon [IN] Rsk image id
- * message_icon [IN] Notification message icon
- * flag [IN] Time display type
- * duration [IN] Audio duration
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory223Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U16 message_icon,
- U16 flag,
- U32 duration,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 l, y, h, available_height, title_height = 0;
- S32 iwidth, iheight;
- PU8 image;
- UI_time t;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_stop_list_highlight_effect();
- #endif
- ADD_SCREEN_STRINGS((4, title, left_softkey, right_softkey, message));
- ADD_SCREEN_IMAGES((4, title_icon, left_softkey_icon, right_softkey_icon, message_icon));
- UI_UNUSED_PARAMETER(history_buffer);
- gui_lock_double_buffer();
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- entry_full_screen();
- #endif
- MMI_menu_shortcut_number = -1;
- clear_category_screen_key_handlers();
- clear_left_softkey();
- clear_right_softkey();
- dm_data.s32flags = 0;
- if ((left_softkey == 0) && (left_softkey_icon == 0) && (right_softkey == 0) && (right_softkey_icon == 0))
- {
- dm_data.s32flags = DM_NO_SOFTKEY;
- }
- else
- {
- dm_data.s32flags = 0;
- wgui_category_screen_no_buttons = 0;
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- }
- if ((title == 0) && (title_icon == 0))
- {
- status_icon = 1;
- ShowStatusIconsTitle();
- }
- else if (!((title == 0xffff) && (title_icon == 0xffff)))
- {
- status_icon = 2;
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- }
- else
- {
- status_icon = 0;
- }
- image = (PU8) get_image(message_icon);
- gui_measure_image(image, &iwidth, &iheight);
- available_height = MMI_content_height;
- if (dm_data.s32flags & DM_NO_SOFTKEY)
- {
- available_height += MMI_button_bar_height;
- }
- switch (status_icon)
- {
- case 0:
- title_height = 0;
- available_height += MMI_status_bar_height;
- break;
- case 1:
- title_height = MMI_title_height + MMI_status_bar_height;
- break;
- case 2:
- title_height = MMI_title_y + MMI_title_height;
- break;
- }
- l = 70; /* width of time display */
- h = 20; /* height of time display */
- wgui_image_clip_x1 = 0;
- wgui_image_clip_x2 = UI_device_width - 1;
- wgui_image_clip_y1 = title_height;
- if (dm_data.s32flags & DM_NO_SOFTKEY)
- {
- wgui_image_clip_y2 = UI_device_height - 1;
- }
- else
- {
- wgui_image_clip_y2 = UI_device_height - MMI_button_bar_height - 1;
- }
- Cat223InitDruration(&t, (U32) (duration * 0.004615 + 0.5));
- set_main_LCD_time_duration_hide_function(Cat223HideDurationDisplay);
- set_time_duration(&t, duration);
- cat223_display_duration = MMI_TRUE;
- if (image == NULL)
- {
- y = title_height + (available_height >> 1) - (h >> 1);
- set_time_display(flag, (UI_device_width - l) / 2, y, l, h);
- }
- else
- {
- y = title_height + (available_height >> 1) - ((h + iheight + 4) >> 1);
- if (category_screen_layout_flags & WGUI_ORDER_IMAGE_TEXT)
- {
- wgui_set_animation_image_y((UI_device_width >> 1), y + 2, image);
- y = y + iheight + 4;
- set_time_display(flag, (UI_device_width - l) / 2, y, l, h);
- }
- else
- {
- y = title_height + ((available_height - iheight - h) >> 1);
- set_time_display(flag, (UI_device_width - l) / 2, y, l, h);
- y = title_height + available_height - iheight;
- wgui_set_animation_image_y((UI_device_width >> 1), y, image);
- }
- }
- gui_unlock_double_buffer();
- ExitCategoryFunction = ExitCategory223Screen;
- 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_CATEGORY223_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_register_category_controlled_callback(DrawCate223CategoryControlArea);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory223Screen
- * DESCRIPTION
- * Exit category 223
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void ExitCategory223Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_hide_animations();
- wgui_category_screen_no_buttons = 0;
- category_screen_layout_flags = 0;
- close_main_LCD_time_display();
- }
- /*****************************************************************************
- * FUNCTION
- * DrawCate223CategoryControlArea
- * DESCRIPTION
- * This function is used to draw the category controlled area of category223 screen
- * PARAMETERS
- * coordinate [IN/OUT] Coordinates of category controlled area.
- * RETURNS
- * void
- *****************************************************************************/
- static void DrawCate223CategoryControlArea(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_hide_animations();
- if (status_icon == 1)
- {
- show_status_icons();
- }
- else if (status_icon == 2)
- {
- show_title_status_icon();
- draw_title();
- }
- gui_set_clip(wgui_image_clip_x1, wgui_image_clip_y1, wgui_image_clip_x2, wgui_image_clip_y2);
- wgui_show_transparent_animation();
- if (cat223_display_duration == MMI_TRUE)
- {
- Cat223DrawDurationBar();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * Cat223DrawDurationBar
- * DESCRIPTION
- * Draw duration bar
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void Cat223DrawDurationBar(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- time_display_duration();
- }
- /*****************************************************************************
- * FUNCTION
- * Cat223InitDruration
- * DESCRIPTION
- * Init duration parameters
- * PARAMETERS
- * t [?]
- * duration [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void Cat223InitDruration(UI_time *t, U32 duration)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 buf1, buf2;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- t->DayIndex = 0;
- buf1 = duration / 60;
- t->nSec = duration - buf1 * 60;
- buf2 = buf1 / 60;
- t->nMin = buf1 - buf2 * 60;
- t->nHour = (U8) buf2;
- }
- /*****************************************************************************
- * FUNCTION
- * Cat223HideDurationDisplay
- * DESCRIPTION
- * Hide duration display
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void Cat223HideDurationDisplay(S32 x1, S32 y1, S32 x2, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c = *current_MMI_theme->datetime_bar_duration_background_color;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_push_clip();
- gui_set_clip(x1, y1, x2, y2);
- gui_fill_rectangle(x1, y1, x2, y2, c);
- gui_pop_clip();
- }
- /*****************************************************************************
- * [Category224]
- *
- * This category is for play a video clip. Can be full screen or standard MMI style.
- *
- * **********************
- * * *
- * * *
- * * *
- * * *
- * * *
- * * (Fullscreen Video) *
- * * *
- * * *
- * * *
- * * *
- * * *
- * **********************
- *
- *****************************************************************************/
- #ifdef __MMI_VIDEO_PLAYER__
- //#define BLACK_BUFFER_SIZE ((GDI_LCD_WIDTH*GDI_LCD_HEIGHT*GDI_MAINLCD_BIT_PER_PIXEL)>>3)//061506 double buffer
- static U8 *status_icon_buf = NULL;
- static GDI_HANDLE status_icon_layer = GDI_ERROR_HANDLE;
- U8 *gBlack_buf = NULL;
- static gdi_handle *gBlack_layer = NULL;
- /*****************************************************************************
- * FUNCTION
- * ShowCategory224Screen
- * DESCRIPTION
- * Show Category 224 Screen. Play video in full screen
- * PARAMETERS
- * video_id [IN] Video ID
- * video_filename [IN] Video filename
- * repeat_count [IN] Repeat count, 0 means infinite
- * is_visual_update [IN] Update visual to LCM or not
- * is_play_audio [IN] Play audio or not
- * is_lcd_no_sleep [IN] Will let lcd no sleep. This shall always TRUE unless u will handle lcd sleeping event
- * bg_color [IN] Backgroud color
- * play_finish_callback [IN] Play finish call back hdlr
- * gui_buffer [IN] Gui_buffer, use to detemin if it is newly enter
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory224Screen(
- U16 video_id,
- PS8 video_filename,
- U16 repeat_count,
- BOOL is_visual_update,
- BOOL is_play_audio,
- BOOL is_lcd_no_sleep,
- GDI_COLOR bg_color,
- void (*play_finish_callback) (MDI_RESULT),
- void *gui_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_VIDEO_PLAYER__
- ShowCategoryVdoplyScreen(
- TRUE, /* is_fullscreen *//* cat224 is fullscreen display */
- 0, /* title_str */
- 0, /* title_icon */
- 0, /* lsk_str */
- 0, /* lsk_icon */
- 0, /* rsk_str */
- 0, /* rsk_icon */
- video_id, /* video_id */
- video_filename, /* video_filename */
- repeat_count, /* repeat_count */
- is_visual_update, /* is_visual_update */
- is_play_audio, /* is_play_audio */
- is_lcd_no_sleep, /* is_lcd_no_sleep */
- bg_color, /* bg_color */
- play_finish_callback, /* play_finish_callback */
- gui_buffer); /* gui_buffer */
- #endif /* __MMI_VIDEO_PLAYER__ */
- }
- /*****************************************************************************
- * FUNCTION
- * StopCategory224Video
- * DESCRIPTION
- * Stop Category224 screen's video
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void StopCategory224Video(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopCategoryVdoplyVideo();
- }
- /*****************************************************************************
- * FUNCTION
- * PauseCategory224Video
- * DESCRIPTION
- * Pause Category224 screen's video
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PauseCategory224Video(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PauseCategoryVdoplyVideo();
- }
- /*****************************************************************************
- * FUNCTION
- * ResumeCategory224Video
- * DESCRIPTION
- * Resume Category224 screen's video
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ResumeCategory224Video(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ResumeCategoryVdoplyVideo();
- }
- /*****************************************************************************
- * [ShowCategory225Screen]
- *
- * Play video screen with title and softkey
- *
- * **********************
- * * Title *
- * **********************
- * * *
- * * *
- * * *
- * * (Video) *
- * * *
- * * *
- * * *
- * ******** ********
- * * LSK * * RSK *
- * **********************
- *
- *****************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * ShowCategory225Screen
- * DESCRIPTION
- * Show Generic Play Video Category.
- * PARAMETERS
- * title_str [IN] Title string id
- * title_icon [IN] Title icon id
- * lsk_str [IN] Lsk str id
- * lsk_icon [IN] Lsk icon id
- * rsk_str [IN] Lsk str id
- * rsk_icon [IN] Lsk icon id
- * video_id [IN] Video ID
- * video_filename [IN] Video filename
- * repeat_count [IN] Repeat count, 0 means infinite
- * is_visual_update [IN] Update visual to LCM or not
- * is_play_audio [IN] Play audio or not
- * is_lcd_no_sleep [IN] Will let lcd no sleep. This shall always TRUE unless u will handle lcd sleeping event
- * bg_color [IN] Backgroud color
- * play_finish_callback [IN] Play finish call back hdlr
- * gui_buffer [IN] Gui_buffer, use to detemin if it is newly enter
- * RETURNS
- * void
- *****************************************************************************/
- extern void ShowCategory225Screen(
- U16 title_str,
- U16 title_icon,
- U16 lsk_str,
- U16 lsk_icon,
- U16 rsk_str,
- U16 rsk_icon,
- U16 video_id,
- PS8 video_filename,
- U16 repeat_count,
- BOOL is_visual_update,
- BOOL is_play_audio,
- BOOL is_lcd_no_sleep,
- GDI_COLOR bg_color,
- void (*play_finish_callback) (MDI_RESULT),
- void *gui_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_VIDEO_PLAYER__
- ShowCategoryVdoplyScreen(
- FALSE, /* is_fullscreen */
- title_str, /* title_str */
- title_icon, /* title_icon */
- lsk_str, /* lsk_str */
- lsk_icon, /* lsk_icon */
- rsk_str, /* rsk_str */
- rsk_icon, /* rsk_icon */
- video_id, /* video_id */
- video_filename, /* video_filename */
- repeat_count, /* repeat_count */
- is_visual_update, /* is_visual_update */
- is_play_audio, /* is_play_audio */
- is_lcd_no_sleep, /* is_lcd_no_sleep */
- bg_color, /* bg_color */
- play_finish_callback, /* play_finish_callback */
- gui_buffer); /* gui_buffer */
- #endif /* __MMI_VIDEO_PLAYER__ */
- }
- /*****************************************************************************
- * FUNCTION
- * DrawCateVdoCategoryControlArea
- * DESCRIPTION
- * draw vdo contro area
- * PARAMETERS
- * coordinate [IN/OUT] Coord
- * RETURNS
- * void
- *****************************************************************************/
- void DrawCateVdoCategoryControlArea(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 resized_width, resized_height;
- S32 resized_offset_x, resized_offset_y;
- S32 content_width, content_height;
- S32 content_offset_x, content_offset_y;
- MDI_RESULT video_ret;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!cat_vdoply_is_full_screen)
- {
- content_width = MMI_content_width;
- content_height = MMI_content_height;
- content_offset_x = MMI_content_x;
- content_offset_y = MMI_content_y;
- }
- else
- {
- content_width = UI_device_width;
- content_height = UI_device_height;
- content_offset_x = 0;
- content_offset_y = 0;
- }
- /* 061506 double buffer Start */
- /*******************************************************************************
- * Special status icon handle with double buffer
- *******************************************************************************/
- if (wgui_is_touch_title_bar_buttons())
- {
- #if defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
- U32 icon_flag;
- if (get_status_icon_bar_layer(0)==GDI_ERROR_HANDLE)
- {
- status_icon_buf = mmi_frm_scrmem_alloc(STATUS_ICON_BAR_DOUBLE_BUFFER_SIZE);
- MMI_ASSERT(status_icon_buf != NULL);
- gdi_layer_create_double_using_outside_memory(0, 0, UI_device_width, MMI_status_bar_height, &status_icon_layer, status_icon_buf, STATUS_ICON_BAR_DOUBLE_BUFFER_SIZE);
- MMI_ASSERT(status_icon_layer != GDI_ERROR_HANDLE);
- dm_add_blt_layer(status_icon_layer, DM_LAYER_TOP);
- gdi_layer_push_and_set_active(status_icon_layer);
- gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
- gdi_layer_clear(GDI_COLOR_TRANSPARENT);
- gdi_layer_pop_and_restore_active();
- }
- set_status_icon_bar_layer(0, status_icon_layer);
- icon_flag = get_status_icon_bar_type(0);
- icon_flag |= STATUS_ICON_BAR_ENABLE_DOUBLE_BUFFER;
- set_status_icon_bar_type(0, icon_flag);
- show_status_icons();
- #endif
- }
- /* 061506 double buffer End */
- /********************************************************************************
- * Create Video Layer