Wallpaper.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:121k
源码类别:
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:
- * ---------
- * Wallpaper.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for wallpaper
- *
- * 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!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- /*****************************************************************************
- * Include
- *****************************************************************************/
- /* Include: MMI header file */
- #include "MMI_features.h"
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- #include "Unicodexdcl.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "NVRAMEnum.h"
- #include "DownloadProtos.h"
- #include "CommonScreens.h"
- #include "EventsGprot.h"
- #include "historyGprot.h"
- #include "ProtocolEvents.h"
- #include "MainMenuDef.h"
- #include "TimerEvents.h"
- #include "GlobalDefs.h"
- #include "SettingProt.h"
- #include "wgui_inline_edit.h"
- #include "DebugInitDef.h"
- #include "HistoryGprot.h"
- #include "WPSSProtos.h"
- #include "SettingGprots.h"
- #ifdef __MMI_POWER_ON_OFF_DISPLAY__
- /* MUST be allocated before WallpaperDefs.h */
- #include "PowerOnOffDisplayDefs.h"
- #endif /* __MMI_POWER_ON_OFF_DISPLAY__ */
- #include "ScreenSaverDefs.h"
- #include "WallpaperDefs.h"
- #include "SettingDefs.h"
- #include "SettingProfile.h"
- #include "DownloadDefs.h"
- #include "DownloadProtos.h"
- #include "PhoneSetup.h"
- #include "FileManagerGProt.h"
- #ifdef __MMI_THEMES_V2_SUPPORT__
- #include "ThemeManager.h"
- #endif
- #include "gdi_include.h"
- #ifdef __MMI_FILE_MANAGER__
- #include "FileMgr.h"
- #endif
- #include "Conversions.h"
- #include "SimDetectionGprot.h"
- #include "IdleAppDef.h"
- #include "wgui_categories.h"
- #include "wgui_categories_idlescreen.h"
- #include "wgui_categories_sublcd.h"
- #include "wgui_categories_multimedia.h" /* ShowCategory222Screen() */
- /*****************************************************************************
- * External Function
- *****************************************************************************/
- /*****************************************************************************
- * Local Variable
- *****************************************************************************/
- /* Store END key handler function pointer */
- /* When previewing the user define wallpaper & Screen saver */
- /* Press END key shall to release file path buffer and execute stored END key handler */
- FuncPtr phnset_wpfp = NULL;
- static PS8 error_str_ptr;
- static U8 wp_item_amount;
- static FuncPtr CallbackWpSsLSK = NULL;
- /*****************************************************************************
- * Global Variable
- *****************************************************************************/
- MMI_ID_TYPE idle_screen_wallpaper_ID;
- MMI_ID_TYPE idle_screen_cache_id;
- #ifndef __MMI_FILE_MANAGER__
- S8 *idle_screen_wallpaper_name_original;
- S8 *idle_screen_screensaver_name;
- S8 *idle_screen_wallpaper_name;
- S8 *idle_screen_cache_name;
- #else /* __MMI_FILE_MANAGER__ */
- PHNSET_WPSS_FILENAME_STRUCT phnset_wpss_filename;
- const U16 PHNSET_PREDEFINED_WP_PATH_JPG[] = L"Z:\@USER\UserWP.JPG ";
- const U16 PHNSET_PREDEFINED_WP_PATH_PBM[] = L"Z:\@USER\UserWP.PBM ";
- /* store the image id of wallpaper */
- S8 *idle_screen_wallpaper_name_original = (S8 *) phnset_wpss_filename.wallpaper;
- S8 *idle_screen_screensaver_name = (S8 *) phnset_wpss_filename.screensave;
- S8 *idle_screen_wallpaper_name;
- S8 *idle_screen_cache_name;
- /* Dynamic alloc memory for file path buffer */
- S8 *phnset_dispchar_strp = NULL;
- U8 phnset_dispchar_temp[(FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH];
- #ifdef __MMI_SUB_WALLPAPER__
- PHNSET_WPSS_FILENAME_STRUCT phnset_wpss_sub_filename;
- S8 *idle_screen_wallpaper_sub_name = (S8 *) phnset_wpss_sub_filename.wallpaper; /* diamond, 2005/05/09 for sub-LCD wallpaper */
- #endif /* __MMI_SUB_WALLPAPER__ */
- #endif /* __MMI_FILE_MANAGER__ */
- /*****************************************************************************
- * Global Function
- *****************************************************************************/
- void PhnsetWpUsrDefPreView(void);
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- void wgui_set_wallpaper_change(void);
- #endif
- /*****************************************************************************
- * Extern Function
- *****************************************************************************/
- extern U8 PhnsetGetDefEncodingType(void);
- /*****************************************************************************
- * Local Function
- *****************************************************************************/
- static U8 PhnsetConstSysWallpaperList(U8 **pSysWallpaperStrList, U16 *pSysWallpaperImgIDList, U16 *HighliteItem);
- static void DispIdleScrWPBadFilePopup(void);
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetWallpaper
- * DESCRIPTION
- * This function is highlight handler for Setting->Phonesetup->IdleScreenDisplay->Wallpaper.
- * Following Functions: EntryPhnsetWallpaperFixRotate
- * EntryPhnsetWallpaperSel
- * EntryPhnsetWallpaperSys
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetWallpaper(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- #if (defined (__DAILY_WALLPAPER__) )
- /* Go to menu with 2 items: Fix, Rotate */
- SetKeyHandler(EntryPhnsetWallpaperFixRotate, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(EntryPhnsetWallpaperFixRotate, KEY_EVENT_UP);
- #elif (defined(__MMI_FILE_MANAGER__) && !defined(__MMI_FILE_MANAGER_HIDE_MENU__) )
- /* Direct enter system wallpaper list menu */
- SetLeftSoftkeyFunction(EntryPhnsetWallpaperSys, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetWallpaperSys, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- g_phnset_cntx_p->ScrAnchor = SCR_IDLE_SCR_DISP; /* SCR_WALLPAPER_SYSTEM_LIST; */
- /* Go to menu with 2 items: System, Download */
- SetLeftSoftkeyFunction(EntryPhnsetWallpaperSel, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetWallpaperSel, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- g_phnset_cntx_p->ScrAnchor = SCR_MAIN_WALLPAPER;
- #else
- /* Direct enter system wallpaper list menu */
- SetLeftSoftkeyFunction(EntryPhnsetWallpaperSys, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetWallpaperSys, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- g_phnset_cntx_p->ScrAnchor = SCR_WALLPAPER_SYSTEM_LIST;
- #endif
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetMainWallpaper
- * DESCRIPTION
- * This function is highlight handler for Setting->Phonesetup->IdleScreenDisplay->Wallpaper.
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetMainWallpaper(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_WP;
- HighlightPhnsetWallpaper();
- }
- #ifdef __MMI_SUB_WALLPAPER__
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetSubWallpaper
- * DESCRIPTION
- * This function is highlight handler for Setting->Phonesetup->IdleScreenDisplay->sublcd Wallpaper.
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetSubWallpaper(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_SUB_WP;
- HighlightPhnsetWallpaper();
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- #ifdef __DAILY_WALLPAPER__
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetWallpaperFix
- * DESCRIPTION
- * This function is highlight handler for Setting->Phonesetup->IdleScreenDisplay->Wallpaper->Fix
- * Following Functions: EntryPhnsetWallpaperSel
- * EntryPhnsetWallpaperSys
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetWallpaperFix(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- #if defined(__MMI_FILE_MANAGER__)
- /* Go to menu with 2 items: System, Download */
- SetKeyHandler(EntryPhnsetWallpaperSel, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(EntryPhnsetWallpaperSel, KEY_EVENT_UP);
- g_phnset_cntx_p->ScrAnchor = SCR_MAIN_WALLPAPER_FIX;
- #else /* defined(__MMI_FILE_MANAGER__) */
- /* Direct go to system wallpaper list */
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(EntryPhnsetWallpaperSys, KEY_EVENT_UP);
- g_phnset_cntx_p->ScrAnchor = SCR_WALLPAPER_SYSTEM_LIST;
- #endif /* defined(__MMI_FILE_MANAGER__) */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetWallpaperRotate
- * DESCRIPTION
- * This function is highlight handler for Setting->Phonesetup->IdleScreenDisplay->Wallpaper->Rotate
- * Following Functions: PhnsetWallpaperRotateLSK
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetWallpaperRotate(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PhnsetGetWallpaperRotateStatus() == MMI_TRUE)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(PhnsetWallpaperRotateLSK, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWallpaperRotateLSK
- * DESCRIPTION
- * This function is Left softkey handler for Setting->Phonesetup->IdleScreenDisplay->Wallpaper->Rotate
- * Functionality: Toggle Rotate Status
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWallpaperRotateLSK(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U8 status;
- U16 index = GetCurrHiliteID();
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PhnsetGetWallpaperRotateStatus() == MMI_TRUE) /* Toggle */
- {
- status = MMI_FALSE;
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- }
- else
- {
- status = MMI_TRUE;
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- }
- WriteValue(NVRAM_WALLPAPER_ROTATE_STATUS, &status, DS_BYTE, &error);
- Category52ChangeItemDescription(index, hintData[index]);
- RedrawCategoryFunction();
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetWallpaperRotate
- * DESCRIPTION
- * This function is Hint handler for Wallpaper Rotate status
- * Functionality: Show hint for rotate status
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetWallpaperRotate(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PhnsetGetWallpaperRotateStatus() == MMI_TRUE)
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- }
- else
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetWallpaperRotateStatus
- * DESCRIPTION
- * This function is to query rotate status
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * T/F
- *****************************************************************************/
- BOOL PhnsetGetWallpaperRotateStatus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 status = 0x0;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_WALLPAPER_ROTATE_STATUS, (void*)&status, DS_BYTE, &error);
- if (status == 0x0 || error != NVRAM_READ_SUCCESS)
- {
- return MMI_FALSE;
- }
- else
- {
- return MMI_TRUE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetWallpaperFixRotate
- * DESCRIPTION
- * This function is Entry function for Setting->Phonesetup->IdleScreenDisplay->Wallpaper
- * when __DAILY_WALLPAPER__ is ON
- * Functionality: Display "Fix/Rotate" Screen
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetWallpaperFixRotate(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem;
- U16 nDispAttribute; /* Stores display attribue */
- U8 *IdleScrDispType[MAX_SUB_MENUS];
- U16 WallpaperSelectList[MAX_SUB_MENUS]; /* = { STR_WALLPAPER_SYSTEM, STR_WALLPAPER_DOWNLOAD }; */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_MAIN_WALLPAPER_FIX, NULL, EntryPhnsetWallpaperFixRotate, NULL);
- SetHiliteHandler(MENU_SETTING_WALLPAPER_FIX, HighlightPhnsetWallpaperFix);
- SetHiliteHandler(MENU_SETTING_WALLPAPER_ROTATE, HighlightPhnsetWallpaperRotate);
- guiBuffer = GetCurrGuiBuffer(SCR_MAIN_WALLPAPER_FIX);
- nNumofItem = GetNumOfChild(MENU_SETTING_WALLPAPER);
- nDispAttribute = GetDispAttributeOfItem(MENU_SETTING_WALLPAPER);
- GetSequenceStringIds(MENU_SETTING_WALLPAPER, WallpaperSelectList);
- SetParentHandler(MENU_SETTING_WALLPAPER);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ConstructHintsList(MENU_SETTING_WALLPAPER, IdleScrDispType);
- ShowCategory52Screen(
- STR_WALLPAPER_CAPTION,
- IMG_SCR_SETTING_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- WallpaperSelectList,
- (PU16) gIndexIconsImageList,
- IdleScrDispType,
- 1,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWallPaperDailyChange
- * DESCRIPTION
- * This function is to change wallpaper to next one in system folder
- * Functionality: ex: Referenced by DateTimerIndication
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWallPaperDailyChange(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 curWallpaperId;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- curWallpaperId = PhnsetGetCurWallPaperIdx();
- if (curWallpaperId == 0xFF)
- {
- #ifdef __MMI_SUB_WALLPAPER__
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_WP;
- #endif
- PhnsetRstWallpaperDefault();
- if (g_idle_context.IsOnIdleScreen)
- {
- EntryIdleScreen();
- }
- return;
- }
- if ((curWallpaperId + 1) > PhnsetGetWallpaperIdxBound())
- {
- curWallpaperId = 0;
- }
- else
- {
- curWallpaperId++;
- }
- PhnsetSetDisplayFromAT(curWallpaperId, MMI_PHNSET_TYPE_WP);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetCurWallPaperIdx
- * DESCRIPTION
- * This function is to get the current wallpaper index in gSystemWallpaperList
- * Functionality: ex: Referenced by PhnsetWallPaperDailyChange
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * U8 index
- *****************************************************************************/
- U8 PhnsetGetCurWallPaperIdx(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 idx = 0;
- U16 SysWpIDList[MAX_WALLPAPER_NUMBERS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PhnsetConstSysWallpaperList(NULL, SysWpIDList, NULL);
- for (idx = 0; idx < (MAX_SYSTEM_WALLPAPER + MAXIMUM_FULLSCREEN_FACTORY_IMAGES); idx++)
- {
- if (g_phnset_cntx_p->curtWpID == SysWpIDList[idx])
- {
- break;
- }
- }
- if (idx >= (MAX_SYSTEM_WALLPAPER + MAXIMUM_FULLSCREEN_FACTORY_IMAGES))
- {
- idx = 0xFF; /* Not Found! */
- }
- return idx;
- }
- #else /* __DAILY_WALLPAPER__ */
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetCurWallPaperIdx
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- U16 PhnsetGetCurWallPaperIdx(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 idx;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_dispchar_get_img_id(NVRAM_FUNANDGAMES_SETWALLPAPER, &(idx));
- return idx;
- }
- #endif /* __DAILY_WALLPAPER__ */
- /*****************************************************************************
- * FUNCTION
- * PhnsetConstSysWallpaperList
- * DESCRIPTION
- * This function is to construct wallpaper system folder list,
- * for Setting->Phonesetup->IdleScreenDisplay->Wallpaper (->Fix) ->System
- * PARAMETERS
- * pSysWallpaperStrList [IN]
- * pSysWallpaperImgIDList [?]
- * HighliteItem [?]
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- static U8 PhnsetConstSysWallpaperList(U8 **pSysWallpaperStrList, U16 *pSysWallpaperImgIDList, U16 *HighliteItem)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- DYNIMAGEINFO *Info;
- U8 i, wp_max = 0;
- U16 strID = 0, imgID = 0;
- U8 index_other = 0;
- #ifdef __MMI_SWFLASH__
- U8 index_swflash = 0;
- #endif
- U8 index_img = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /*
- * SYSTEM WALLPAPER
- */
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_WP)
- {
- U8 max_wp_img = MAX_WALLPAPER_IMG - MAX_OTHER_WALLPAPER - MAX_DISPCHAR_SWFLASH;
- U8 max_wp_other = MAX_OTHER_WALLPAPER;
- U8 max_wp_swflash = MAX_DISPCHAR_SWFLASH;
- #ifdef __MMI_THEMES_V2_SUPPORT__
- if(!mmi_tm_get_current_theme_wallapaper())
- {
- max_wp_other -= 2;
- }
- else
- {
- max_wp_other --;
- }
- #endif /* __MMI_THEMES_V2_SUPPORT__ */
- /* Layout
- *
- *
- * -- Normal Images --
- * -- Normal Images -- SVG
- * -- Normal Images -- M3D
- * -- Analog clock --
- * -- Digital clock --
- * -- Theme --
- * -- SWFLASH --
- *
- * -- Factory images--
- *
- */
- /*
- * Build-in images
- */
- for (i = 0; i < (max_wp_img + max_wp_other + max_wp_swflash); i++)
- {
- if (i < max_wp_img)
- {
- imgID = IMG_ID_PHNSET_WP_START + i;
- }
- else if (max_wp_other &&
- i >= max_wp_img &&
- i < (max_wp_img + max_wp_other))
- {
- imgID = IMG_ID_DISPCHAR_OTHER_START + (i - max_wp_img) + 1;
- }
- else if(max_wp_swflash)
- {
- imgID = IMG_ID_DISPCHAR_SWFLASH_START + (i - (max_wp_img + max_wp_other));
- }
- /* normal/SVG/M3D images*/
- if (imgID >= IMG_ID_PHNSET_WP_START && imgID <= IMG_ID_PHNSET_WP_MAX)
- {
- strID = STR_ID_PHNSET_DISPCHAR_IMGID_START + index_img;
- ++index_img;
- }
- else if ( imgID > IMG_ID_DISPCHAR_OTHER_START && imgID < IMG_ID_DISPCHAR_OTHER_MAX)
- {
- #if !defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
- #ifdef __MMI_ANALOG_CLOCK__
- /* Analog clock */
- if (imgID == IMG_ID_DISPCHAR_ANALOG_CLK)
- {
- strID = STR_ID_PHNSET_DISPCHAR_ANALOG;
- }
- #endif /* __MMI_ANALOG_CLOCK__ */
- #ifdef __MMI_DIGITAL_CLOCK__
- /* Digital clock */
- if (imgID == IMG_ID_DISPCHAR_DIGITAL_CLK)
- {
- strID = STR_ID_PHNSET_DISPCHAR_DIGITAL;
- }
- #endif /* __MMI_DIGITAL_CLOCK__ */
- #endif /* !__MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- #ifdef __MMI_THEMES_V2_SUPPORT__
- /* Theme */
- if (mmi_tm_get_current_theme_wallapaper() &&
- imgID == IMG_ID_DISPCHAR_THEME_WALLPAPER)
- {
- strID = STR_ID_DISPCHAR_THEME_WALLPAPER;
- }
- #endif /* __MMI_THEMES_V2_SUPPORT__ */
- ++index_other;
- }
- #ifdef __MMI_SWFLASH__
- else if (imgID >= IMG_ID_DISPCHAR_SWFLASH_START && imgID <= IMG_ID_DISPCHAR_SWFLASH_MAX)
- {
- strID = STR_ID_DISPCHAR_SWFLASH_START + index_swflash;
- ++index_swflash;
- }
- #endif /* __MMI_SWFLASH__*/
- if (pSysWallpaperImgIDList)
- {
- pSysWallpaperImgIDList[i] = imgID;
- }
- if (pSysWallpaperStrList)
- {
- pSysWallpaperStrList[i] = (PU8) GetString(strID);
- }
- if (HighliteItem && g_phnset_cntx_p->curtWpID == pSysWallpaperImgIDList[i])
- {
- *HighliteItem = i;
- g_phnset_cntx_p->curHightlightItem = i;
- }
- }
- wp_max = i;
- MMI_ASSERT(index_other == max_wp_other);
- #ifdef __MMI_SWFLASH__
- MMI_ASSERT(index_swflash == max_wp_swflash);
- #endif
- /*
- * FACTORY WALLPAPER
- */
- g_phnset_cntx_p->WPFctyImgNum = GetFullScreenFactoryImagesInfo(&Info);
- for (i = 0; i < g_phnset_cntx_p->WPFctyImgNum; i++)
- {
- strID = STR_ID_PHNSET_DISPCHAR_IMGID_START + index_img + i;
- if (pSysWallpaperImgIDList)
- {
- pSysWallpaperImgIDList[wp_max + i] = Info[i].ImagesId;
- }
- if (pSysWallpaperStrList)
- {
- pSysWallpaperStrList[wp_max + i] = (PU8) GetString(strID);
- }
- if (HighliteItem)
- if (g_phnset_cntx_p->curtWpID == Info[i].ImagesId)
- {
- *HighliteItem = wp_max + i;
- g_phnset_cntx_p->curHightlightItem = wp_max + i;
- }
- }
- wp_max += i;
- }/* Main Wallpaper */
- #ifdef __MMI_SUB_WALLPAPER__
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SUB_WP)
- {
- for (i = 0; i < MAX_SUB_WALLPAPER_IMG; i++)
- {
- strID = STR_ID_PHNSET_DISPCHAR_IMGID_START + i;
- if (pSysWallpaperImgIDList)
- {
- pSysWallpaperImgIDList[i] = IMG_ID_PHNSET_SUB_WP_START + i;
- }
- if (pSysWallpaperStrList)
- {
- pSysWallpaperStrList[i] = (PU8) GetString(strID);
- }
- if (HighliteItem)
- if (g_phnset_cntx_p->curtSubWpID == pSysWallpaperImgIDList[i])
- {
- *HighliteItem = i;
- g_phnset_cntx_p->curHightlightItem = i;
- }
- }
- wp_max = i;
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- else
- {
- MMI_ASSERT(0);
- }
- return (wp_max);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetWallpaperSys
- * DESCRIPTION
- * This function is to entry function for Setting->Phonesetup->IdleScreenDisplay->Wallpaper (->Fix) ->System
- * Functionality: Display system wallpaper list
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetWallpaperSys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_WALLPAPER_SYSTEM_LIST, NULL, EntryPhnsetWallpaperSys, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_WALLPAPER_SYSTEM_LIST);
- RegisterHighlightHandler(PhnsetWallpaperSysHiliteHandler);
- wp_item_amount = PhnsetConstSysWallpaperList(
- subMenuDataPtrs,
- g_phnset_cntx_p->SysWPSSList,
- (U16*) & (g_phnset_cntx_p->curHightlightItem));
- g_phnset_cntx_p->WPSSPreviewScrFlag = 1;
- if (g_phnset_cntx_p->curtWpID == 0)
- g_phnset_cntx_p->curHightlightItem = 0;
- ShowCategory36Screen(
- STR_WALLPAPER_SELECT_CAPTION,
- IMG_SCR_SETTING_CAPTION,
- STR_GLOBAL_VIEW,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- wp_item_amount,
- subMenuDataPtrs,
- (U16) g_phnset_cntx_p->curHightlightItem,
- guiBuffer);
- SetLeftSoftkeyFunction(EntryPhnsetWallpaperSysView, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetWallpaperSysView, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWallpaperSysHiliteHandler
- * DESCRIPTION
- * This function is Highlight hanlder when scrolling at wallpaper list screen
- * for Setting->Phonesetup->IdleScreenDisplay->Wallpaper (->Fix) ->System
- * PARAMETERS
- * nIndex [IN]
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWallpaperSysHiliteHandler(S32 nIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->curHightlightItem = (U16) nIndex;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetWallpaperSysView
- * DESCRIPTION
- * This function is Entry function to preview wallpaper
- * for Setting->Phonesetup->IdleScreenDisplay->Wallpaper (->Fix) ->System/Download -> View
- * Follow functions: PhnsetWallpaperSysViewPre
- * PhnsetWallpaperSysViewNext
- * PhnsetWallpaperSet
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetWallpaperSysView(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 wallpaperName;
- U8 *guiBuffer;
- U16 wallpaperId = g_phnset_cntx_p->SysWPSSList[g_phnset_cntx_p->curHightlightItem];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- guiBuffer = GetCurrGuiBuffer(SCR_WALLPAPER_VIEW);
- g_phnset_cntx_p->isCorrectSet = 0;
- if (g_phnset_cntx_p->WPSSPreviewScrFlag)
- {
- EntryNewScreen(SCR_WALLPAPER_VIEW, ExitPhnsetWallpaperSysView, EntryPhnsetWallpaperSysView, NULL);
- }
- wallpaperName = (PU8) PhnsetGetWallpaperNameById(wallpaperId);
- wgui_set_touch_title_bar_buttons(); /* enable the display of title bar buttons */
- #if defined(__MMI_TOUCH_SCREEN__)
- register_touch_button_handlers(NULL, PhnsetWallpaperSysViewPre, NULL, PhnsetWallpaperSysViewNext);
- #endif
- #if !defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
- #ifdef __MMI_ANALOG_CLOCK__
- /* Category 86 if to View the Analog Clock */
- if ((wallpaperId == IMG_ID_DISPCHAR_ANALOG_CLK))
- {
- ShowCategory86Screen(
- STR_ID_PHNSET_DISPCHAR_ANALOG,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- IMG_ID_DISPCHAR_ANALOG_CLK,
- NULL,
- guiBuffer,
- 0);
- }
- else
- #endif /* __MMI_ANALOG_CLOCK__ */
- #ifdef __MMI_DIGITAL_CLOCK__
- /* Category 128 to view Digital Clock */
- if (wallpaperId == IMG_ID_DISPCHAR_DIGITAL_CLK)
- {
- ShowCategory128Screen(
- STR_ID_PHNSET_DISPCHAR_DIGITAL,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- IMG_ID_DISPCHAR_DIGITAL_CLK,
- 1,
- 1,
- 1,
- guiBuffer,
- 0);
- }
- else
- #endif /* __MMI_DIGITAL_CLOCK__ */
- #endif /* !__MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- #ifdef __MMI_SWFLASH__
- if (PhnsetGetDisplayType(wallpaperId) == PHNSET_TYPE_DISP_SWFLASH)
- {
- ShowCategory229Screen(
- wallpaperName, /* title_str */
- IMG_SCR_SETTING_CAPTION, /* title_icon */
- STR_GLOBAL_OK, /* lsk_str */
- IMG_GLOBAL_OK, /* lsk_icon */
- STR_GLOBAL_BACK, /* rsk_str */
- IMG_GLOBAL_BACK, /* rsk_icon */
- wallpaperId, /* resource_id */
- NULL, /* resource_filename */
- 1, /* repeat_count */
- MMI_FALSE, /* is_play_audio */
- MMI_FALSE, /* is_vibrate_on */
- MMI_FALSE, /* is_interaction_on */
- MMI_TRUE, /* is_lcd_no_sleep */
- MMI_TRUE, /* is_full_screen */
- GDI_COLOR_WHITE, /* bg_color */
- PhnsetWpSsPlayCallBack,
- guiBuffer);
- }
- else
- #endif
- /* For Normal Viewing */
- {
- ShowCategory129Screen(
- wallpaperName,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- wallpaperId,
- guiBuffer);
- }
- SetLeftSoftkeyFunction(PhnsetWallpaperSet, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* change the key handler for KEY UP event to KEY DOWN event. */
- SetKeyHandler(PhnsetWallpaperSysViewPre, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(PhnsetWallpaperSysViewNext, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitPhnsetWallpaperSysView
- * DESCRIPTION
- * This function is Exit function for preview wallpaper
- * for Setting->Phonesetup->IdleScreenDisplay->Wallpaper (->Fix) ->System/Download -> View
- * Functionality: Add to history
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitPhnsetWallpaperSysView(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->isCorrectSet)
- {
- DeleteUptoScrID(g_phnset_cntx_p->ScrAnchor);
- }
- g_phnset_cntx_p->WPSSPreviewScrFlag = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWallpaperSysViewPre
- * DESCRIPTION
- * This function is to view previous wallpaper
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWallpaperSysViewPre(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExitCategoryFunction();
- if (g_phnset_cntx_p->curHightlightItem <= 0)
- {
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_WP)
- {
- g_phnset_cntx_p->curHightlightItem = wp_item_amount;
- }
- #ifdef __MMI_SUB_WALLPAPER__
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SUB_WP)
- {
- g_phnset_cntx_p->curHightlightItem = MAX_SUB_WALLPAPER_IMG;
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- else
- {
- MMI_ASSERT(MMI_FALSE);
- }
- }
- g_phnset_cntx_p->curHightlightItem--;
- g_phnset_cntx_p->WPSSPreviewScrFlag = 0;
- EntryPhnsetWallpaperSysView();
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWallpaperSysViewNext
- * DESCRIPTION
- * This function is to view next wallpaper
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWallpaperSysViewNext(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExitCategoryFunction();
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_WP)
- {
- if (wp_item_amount && (g_phnset_cntx_p->curHightlightItem >= wp_item_amount - 1))
- {
- g_phnset_cntx_p->curHightlightItem = -1;
- }
- }
- #ifdef __MMI_SUB_WALLPAPER__
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SUB_WP)
- {
- if (g_phnset_cntx_p->curHightlightItem >= MAX_SUB_WALLPAPER_IMG - 1)
- {
- g_phnset_cntx_p->curHightlightItem = -1;
- }
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- else
- {
- MMI_ASSERT(0);
- }
- g_phnset_cntx_p->curHightlightItem++;
- g_phnset_cntx_p->WPSSPreviewScrFlag = 0;
- EntryPhnsetWallpaperSysView();
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWallpaperSet
- * DESCRIPTION
- * This function is Left softkey handler for set/preview wallpaper
- * Functionality: Save to nvram, change globol variable gCurrentWallpaper
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWallpaperSet(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PhnsetSetWallpaperByImgID(g_phnset_cntx_p->SysWPSSList[g_phnset_cntx_p->curHightlightItem]);
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_WP)
- {
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- wgui_set_wallpaper_change(); /* 012006 wallpaper Calvin */
- #endif
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetWallpaperSet:Set Main ID=%d n", g_phnset_cntx_p->curtWpID));
- }
- #ifdef __MMI_SUB_WALLPAPER__
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SUB_WP)
- {
- SUBLCD_UpdateWallpaper();
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetWallpaperSet:Set Sub ID=%d n", g_phnset_cntx_p->curtSubWpID));
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- else
- {
- MMI_ASSERT(0);
- }
- g_phnset_cntx_p->isCorrectSet = 1;
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * ThemeManagerSetWallpaper
- * DESCRIPTION
- * ...
- * * PARAMETERS
- * a IN/OUT void
- * b IN void
- * RETURNS
- * void
- *****************************************************************************/
- void ThemeManagerSetWallpaper(U16 nId)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_FILE_MANAGER__
- S16 error;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->curtWpID = nId;
- mmi_dispchar_set_img_id(NVRAM_FUNANDGAMES_SETWALLPAPER, &(g_phnset_cntx_p->curtWpID));
- #ifdef __MMI_FILE_MANAGER__
- if (nId == 0)
- {
- ReadRecord(NVRAM_EF_WPSS_FILENAME_LID, 1, &phnset_wpss_filename, sizeof(phnset_wpss_filename), &error);
- g_phnset_cntx_p->isShort = phnset_wpss_filename.isWPShort;
- PhnsetSetWallpaperByFileName((S8*) phnset_wpss_filename.wallpaper);
- }
- else
- #endif /* __MMI_FILE_MANAGER__ */
- {
- /* MMI_TRUE for SetIdleScreenWallpaperID means create another layer for wallpaper
- * while MMI_FALSE means use current layer
- */
- SetIdleScreenWallpaperID(nId, MMI_TRUE);
- }
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "ThemeManagerSetWallpaper:Set Main ID=%d n", g_phnset_cntx_p->curtWpID));
- }
- #if defined(__MMI_FILE_MANAGER__)
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetWallpaperSys
- * DESCRIPTION
- * This function is Highlight handler for Setting->Phonesetup->IdleScreenDisplay->Wallpaper->System
- * Following Function: EntryPhnsetWallpaperSys
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetWallpaperSys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(EntryPhnsetWallpaperSys, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetWallpaperSys, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetWallpaperSel
- * DESCRIPTION
- * This function is Entry function for Setting->Phonesetup->IdleScreenDisplay->Wallpaper (->Fix)
- * Following Function: Show (System/Download) Menu
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetWallpaperSel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem;
- U16 WallpaperSelectList[MAX_SUB_MENUS]; /* = { STR_WALLPAPER_SYSTEM, STR_WALLPAPER_DOWNLOAD }; */
- U16 title = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_WP)
- {
- title = (U16) STR_SETTING_WALLPAPER;
- }
- #ifdef __MMI_SUB_WALLPAPER__
- else
- {
- title = (U16) STR_SETTING_WALLPAPER_SUB;
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- EntryNewScreen(SCR_MAIN_WALLPAPER, NULL, EntryPhnsetWallpaperSel, NULL);
- g_phnset_cntx_p->ScrAnchor = SCR_MAIN_WALLPAPER;
- guiBuffer = GetCurrGuiBuffer(SCR_MAIN_WALLPAPER);
- #ifdef __DAILY_WALLPAPER__
- nNumofItem = GetNumOfChild(MENU_SETTING_WALLPAPER_FIX);
- GetSequenceStringIds(MENU_SETTING_WALLPAPER_FIX, WallpaperSelectList);
- SetParentHandler(MENU_SETTING_WALLPAPER_FIX);
- #else /* __DAILY_WALLPAPER__ */
- nNumofItem = GetNumOfChild(MENU_SETTING_WALLPAPER);
- GetSequenceStringIds(MENU_SETTING_WALLPAPER, WallpaperSelectList);
- SetParentHandler(MENU_SETTING_WALLPAPER);
- #endif /* __DAILY_WALLPAPER__ */
- SetHiliteHandler(MENU_SETTING_WALLPAPER_SYSTEM, HighlightPhnsetWallpaperSys);
- #if defined(__MMI_FILE_MANAGER__)
- SetHiliteHandler(MENU_SETTING_WALLPAPER_DOWNLOAD, HighlightPhnsetWallpaperFmgr);
- #endif
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory15Screen(
- title,
- IMG_SCR_SETTING_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- WallpaperSelectList,
- (PU16) gIndexIconsImageList,
- 1,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* defined(__MMI_FILE_MANAGER__) */
- #ifdef __MMI_FILE_MANAGER__
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetWallpaperFmgr
- * DESCRIPTION
- * This function is Highlight handler for Setting->Phonesetup->IdleScreenDisplay->Wallpaper->User Define
- * Following Function: EntryPhnsetWallpaperFmgr
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetWallpaperFmgr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(EntryPhnsetWallpaperFmgr, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetWallpaperFmgr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWallpaperForwardFromFmgr
- * DESCRIPTION
- * This function is call back function for file manager
- * Following Function:
- * PARAMETERS
- * path [?]
- * is_short [IN]
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWallpaperForwardFromFmgr(void *path, FMGR_FILTER *filter, int is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetWallpaperForwardFromFmgr:path=%s, is_short=%d n", path, is_short));
- if (!FMGR_FILTER_IS_SET(filter, FMGR_TYPE_GIF) &&
- #ifdef JPG_DECODE
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_JPG) &&
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_JPEG) &&
- #endif /* JPG_DECODE */
- #if defined(GDI_USING_PNG)
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_PNG) &&
- #endif
- #ifdef M3D_MMI_SUPPORT
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_M3D) &&
- #endif
- #ifdef SVG_SUPPORT
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_SVG) &&
- #endif
- #ifdef __MMI_SWFLASH__
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_CMP) &&
- #endif
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_BMP))
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_UNSUPPORTED_FORMAT), IMG_GLOBAL_ERROR, 0, 1000, ERROR_TONE);
- return;
- }
- if (path)
- {
- /* Prevent memory leck, after buffer is free, set pointer to NULL */
- ASSERT(phnset_dispchar_strp == NULL);
- g_phnset_cntx_p->isShort = (S32) is_short;
- phnset_dispchar_strp = OslMalloc(FMGR_PATH_BUFFER_SIZE);
- if (phnset_dispchar_strp)
- {
- pfnUnicodeStrcpy((S8*) phnset_dispchar_strp, (S8*) path);
- }
- else
- {
- GoBackToHistory(SCR_IDLE_SCR_DISP);
- return;
- }
- if (mmi_fmgr_forwardable_path((PS8) phnset_dispchar_strp))
- {
- error_str_ptr = (PS8) GetString(STR_ID_PHNSET_DISPCHAR_INVALID_PATH);
- DispIdleScrWPBadFilePopup();
- PhnsetWpUsrDefFreeBuf();
- return;
- }
- /* file limitation check - limitation is define in file manager util */
- if (!mmi_fmgr_util_file_limit_check(FMGR_LIMIT_WALLPAPER, (PS8) phnset_dispchar_strp, &error_str_ptr))
- {
- DispIdleScrWPBadFilePopup();
- PhnsetWpUsrDefFreeBuf();
- return;
- }
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_WP;
- g_phnset_cntx_p->ScrAnchor = GetCurrScrnId();
- PhnsetWpUsrDefPreView();
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetSubWallpaperForwardFromFmgr
- * DESCRIPTION
- * This function is call back function for file manager
- * Following Function:
- * PARAMETERS
- * path [?]
- * is_short [IN]
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SUB_WALLPAPER__
- void PhnsetSubWallpaperForwardFromFmgr(void *path, FMGR_FILTER *filter, int is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSubWallpaperForwardFromFmgr:path=%s, is_short=%d n", path,
- is_short));
- if (!FMGR_FILTER_IS_SET(filter, FMGR_TYPE_GIF) &&
- #ifdef JPG_DECODE
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_JPG) &&
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_JPEG) &&
- #endif /* JPG_DECODE */
- #if defined(GDI_USING_PNG)
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_PNG) &&
- #endif
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_BMP))
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_UNSUPPORTED_FORMAT), IMG_GLOBAL_ERROR, 0, 1000, ERROR_TONE);
- return;
- }
- g_phnset_cntx_p->isShort = (S32) is_short;
- if (path)
- {
- /* Prevent memory leck, after buffer is free, set pointer to NULL */
- ASSERT(phnset_dispchar_strp == NULL);
- phnset_dispchar_strp = OslMalloc(FMGR_PATH_BUFFER_SIZE);
- if (phnset_dispchar_strp)
- {
- pfnUnicodeStrcpy((S8*) phnset_dispchar_strp, (S8*) path);
- }
- else
- {
- GoBackToHistory(SCR_IDLE_SCR_DISP);
- return;
- }
- if (mmi_fmgr_forwardable_path((PS8) phnset_dispchar_strp))
- {
- error_str_ptr = (PS8) GetString(STR_ID_PHNSET_DISPCHAR_INVALID_PATH);
- DispIdleScrWPBadFilePopup();
- PhnsetWpUsrDefFreeBuf();
- return;
- }
- /* file limitation check - limitation is define in file manager util */
- if (!mmi_fmgr_util_file_limit_check(FMGR_LIMIT_SUB_WALLPAPER, (PS8) phnset_dispchar_strp, &error_str_ptr))
- {
- DispIdleScrWPBadFilePopup();
- PhnsetWpUsrDefFreeBuf();
- return;
- }
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_SUB_WP;
- g_phnset_cntx_p->ScrAnchor = GetCurrScrnId();
- PhnsetWpUsrDefPreView();
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
- }
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- /*****************************************************************************
- * FUNCTION
- * PhnsetWpUsrDefFreeBuf
- * DESCRIPTION
- * This function is to free file name string buffer
- * Following Function:
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWpUsrDefFreeBuf(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (phnset_dispchar_strp)
- {
- OslMfree(phnset_dispchar_strp);
- phnset_dispchar_strp = NULL;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWpUsrDefSelect
- * DESCRIPTION
- * This function is LSK handler for set user defined wallpaper/screen saver
- * Following Function:
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWpUsrDefSelect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mmi_fmgr_forwardable_path((PS8) phnset_dispchar_strp))
- {
- error_str_ptr = (PS8) GetString(STR_ID_PHNSET_DISPCHAR_INVALID_PATH);
- DispIdleScrWPBadFilePopup();
- PhnsetWpUsrDefFreeBuf();
- return;
- }
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_WP)
- {
- PhnsetSetWallpaperByFileName((S8*) phnset_dispchar_strp);
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- wgui_set_wallpaper_change();
- #endif
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetWpUsrDefSelect:main phnset_dispchar_strp=%sn",
- phnset_dispchar_strp));
- }
- #ifdef __MMI_SUB_WALLPAPER__
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SUB_WP)
- {
- PhnsetSetWallpaperByFileName((S8*) phnset_dispchar_strp);
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetWpUsrDefSelect:sub phnset_dispchar_strp=%sn",
- phnset_dispchar_strp));
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SS)
- {
- PhnsetSetScrSvrByFileName((S8*) phnset_dispchar_strp);
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetWpUsrDefSelect:ss phnset_dispchar_strp=%sn",
- phnset_dispchar_strp));
- }
- else
- {
- ASSERT(0);
- }
- if (IsScreenPresent(SCR_MAIN_WALLPAPER) || IsScreenPresent(SCR_MAIN_SCREENSAVER))
- {
- fmgr_reset_app_select(); /* not forword from fmgr */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWpUsrDefPreViewScrDelCB
- * DESCRIPTION
- * This function is RSK handler for set user define wallpaper/screensaver
- * Following Function:
- * PARAMETERS
- * ptr [?]
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- U8 PhnsetWpUsrDefPreViewScrDelCB(void *ptr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PhnsetWpUsrDefFreeBuf();
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWpUsrDefGoBack
- * DESCRIPTION
- * This function is RSK handler for set user define wallpaper/screensaver
- * Following Function:
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWpUsrDefGoBack(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PhnsetWpUsrDefFreeBuf();
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWpUsrDefPreViewENDKeyHdlr
- * DESCRIPTION
- * This function is to END key handler for wallpaper/screen preview screen
- * Following Function:
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWpUsrDefPreViewENDKeyHdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Has to free the file name string buffer */
- PhnsetWpUsrDefFreeBuf();
- /* Execute the stored END key handler */
- if (phnset_wpfp)
- {
- (*phnset_wpfp) ();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitPhnsetWpUsrDefPreView
- * DESCRIPTION
- * Exit handler of PhnsetWpUsrDefPreView
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitPhnsetWpUsrDefPreView(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->isCorrectSet)
- {
- PhnsetWpUsrDefFreeBuf();
- DeleteUptoScrID(g_phnset_cntx_p->ScrAnchor);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWpUsrDefPreView
- * DESCRIPTION
- * This function is to preview user define wallpaper/screensaver
- * Following Function:
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWpUsrDefPreView(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *gui_buffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_IDLE_SCR_DISP_WP_PREVIEW, ExitPhnsetWpUsrDefPreView, PhnsetWpUsrDefPreView, NULL);
- gui_buffer = GetCurrGuiBuffer(SCR_IDLE_SCR_DISP_WP_PREVIEW);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetWpUsrDefPreView: phnset_dispchar_strp=%sn", phnset_dispchar_strp));
- CallbackWpSsLSK = PhnsetWpUsrDefSelect;
- g_phnset_cntx_p->isCorrectSet = 0;
- #if defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) && defined(__MTK_TARGET__)
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SS
- && mmi_fmgr_get_file_group(phnset_dispchar_strp) == FMGR_GROUP_VIDEO)
- {
- ShowCategory225Screen(
- STR_GLOBAL_VIEW, /* title_str */
- IMG_SCR_SETTING_CAPTION, /* title_icon */
- STR_GLOBAL_OK, /* lsk_str */
- IMG_GLOBAL_OK, /* lsk_icon */
- STR_GLOBAL_BACK, /* rsk_str */
- IMG_GLOBAL_BACK, /* rsk_icon */
- 0, /* video_id */
- (S8*) phnset_dispchar_strp, /* video_filename */
- 1, /* repeat_count */
- TRUE, /* is_visual_update */
- FALSE, /* is_play_audio */
- TRUE, /* is_lcd_no_sleep */
- GDI_COLOR_WHITE, /* bg_color */
- PhnsetWpSsPlayCallBack,
- gui_buffer);
- }
- else
- #endif /* defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) && defined(__MTK_TARGET__) */
- {
- #ifdef __MMI_SWFLASH__
- if (mmi_fmgr_get_file_group(phnset_dispchar_strp) == FMGR_GROUP_SWFLASH)
- {
- ShowCategory229Screen(
- (U8 *)GetString(STR_GLOBAL_VIEW), /* title_str */
- IMG_SCR_SETTING_CAPTION, /* title_icon */
- STR_GLOBAL_OK, /* lsk_str */
- IMG_GLOBAL_OK, /* lsk_icon */
- STR_GLOBAL_BACK, /* rsk_str */
- IMG_GLOBAL_BACK, /* rsk_icon */
- 0, /* resource_id */
- phnset_dispchar_strp, /* resource_filename */
- 1, /* repeat_count */
- MMI_FALSE, /* is_play_audio */
- MMI_FALSE, /* is_vibrate_on */
- MMI_FALSE, /* is_interaction_on */
- MMI_TRUE, /* is_lcd_no_sleep */
- MMI_FALSE, /* is_full_screen */
- GDI_COLOR_WHITE, /* bg_color */
- PhnsetWpSsPlayCallBack,
- gui_buffer);
- }
- else
- #endif
- ShowCategory222Screen(
- STR_GLOBAL_VIEW,
- GetRootTitleIcon(MENU_SETTING_WALLPAPER),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- GDI_COLOR_WHITE,
- NULL,
- (S8*) phnset_dispchar_strp,
- FALSE,
- PhnsetWpSsPlayCallBack);
- }
- SetDelScrnIDCallbackHandler(SCR_IDLE_SCR_DISP_WP_PREVIEW, PhnsetWpUsrDefPreViewScrDelCB);
- phnset_wpfp = GetKeyHandler(KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(PhnsetWpUsrDefPreViewENDKeyHdlr, KEY_END, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(PhnsetWpUsrDefGoBack, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(CallbackWpSsLSK, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWallpaperSelectFmgrCallBack
- * DESCRIPTION
- * This function is call back function for IdleScreenDisplay->Wallpaper->User Define
- * Following Function:
- * PARAMETERS
- * path [?]
- * is_short [IN]
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWallpaperSelectFmgrCallBack(void *path, int is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (path)
- {
- if (mmi_fmgr_forwardable_path((PS8) path))
- {
- error_str_ptr = (PS8) GetString(STR_ID_PHNSET_DISPCHAR_INVALID_PATH);
- DispIdleScrWPBadFilePopup();
- PhnsetWpUsrDefFreeBuf();
- return;
- }
- if ((g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_WP
- && !mmi_fmgr_util_file_limit_check(FMGR_LIMIT_WALLPAPER, (PS8) path, &error_str_ptr))
- #ifdef __MMI_SUB_WALLPAPER__
- || (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SUB_WP
- && !mmi_fmgr_util_file_limit_check(FMGR_LIMIT_SUB_WALLPAPER, (PS8) path, &error_str_ptr))
- #endif /* __MMI_SUB_WALLPAPER__ */
- || (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SS
- && !mmi_fmgr_util_file_limit_check(FMGR_LIMIT_SCREEN_SAVER, (PS8) path, &error_str_ptr)))
- {
- DispIdleScrWPBadFilePopup();
- PhnsetWpUsrDefFreeBuf();
- return;
- }
- /* Prevent memory leck, after buffer is free, set pointer to NULL */
- ASSERT(phnset_dispchar_strp == NULL);
- g_phnset_cntx_p->isShort = (S32) is_short;
- phnset_dispchar_strp = OslMalloc(FMGR_PATH_BUFFER_SIZE);
- if (phnset_dispchar_strp)
- {
- pfnUnicodeStrcpy((S8*) phnset_dispchar_strp, (S8*) path);
- }
- else
- {
- GoBackToHistory(SCR_IDLE_SCR_DISP);
- return;
- }
- PhnsetWpUsrDefPreView();
- }
- else
- {
- GoBackToHistory(g_phnset_cntx_p->ScrAnchor);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetWallpaperFmgr
- * DESCRIPTION
- * This function is Entry function for Setting->Phonesetup->IdleScreenDisplay->Wallpaper (->Fix) -> User Define
- * Follow functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetWallpaperFmgr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #if ( defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- FMGR_FILTER filter;
- U8 option = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- FMGR_FILTER_INIT(&filter);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_BMP);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_GIF);
- #ifdef JPG_DECODE
- FMGR_FILTER_SET(&filter, FMGR_TYPE_JPG);
- #endif
- #if defined(GDI_USING_PNG)
- FMGR_FILTER_SET(&filter, FMGR_TYPE_PNG);
- #endif
- #ifdef __MMI_SUB_WALLPAPER__
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SUB_WP)
- option = 0;
- #endif
- if (option)
- {
- #ifdef SVG_SUPPORT
- FMGR_FILTER_SET(&filter, FMGR_TYPE_SVG);
- #endif
- #ifdef M3D_MMI_SUPPORT
- FMGR_FILTER_SET(&filter, FMGR_TYPE_M3D);
- #endif
- #ifdef __MMI_SWFLASH__
- FMGR_FILTER_SET(&filter, FMGR_TYPE_CMP);
- #endif
- }
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER_DOT);
- #if defined(__MTK_TARGET__)
- #if defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) || defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__)
- if (
- #if defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__)
- g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SS
- #if defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__)
- || g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF
- || g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON
- #endif /* defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) */
- #else /* defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) */
- #if defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__)
- g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF || g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON
- #endif
- #endif /* defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) */
- )
- {
- #ifdef MP4_CODEC
- FMGR_FILTER_SET(&filter, FMGR_TYPE_3GP);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_MP4);
- #endif /* MP4_CODEC */
- #ifdef MJPG_SUPPORT
- FMGR_FILTER_SET(&filter, FMGR_TYPE_AVI);
- #endif
- }
- #endif /* defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) || defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) */
- #endif /* defined(__MTK_TARGET__) */
- #ifdef __MMI_POWER_ON_OFF_DISPLAY__
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON || g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF)
- {
- mmi_fmgr_select_path_and_enter(
- APP_SETTINGS,
- FMGR_SELECT_FILE | FMGR_SELECT_REPEAT,
- filter,
- (S8*) L"root",
- PhnsetPwrOnOffSelectFmgrCallBack);
- }
- else
- #endif /* __MMI_POWER_ON_OFF_DISPLAY__ */
- mmi_fmgr_select_path_and_enter(
- APP_SETTINGS,
- FMGR_SELECT_FILE | FMGR_SELECT_REPEAT,
- filter,
- (S8*) L"root",
- PhnsetWallpaperSelectFmgrCallBack);
- #endif /* ( defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- }
- #endif /* __MMI_FILE_MANAGER__ */
- /*****************************************************************************
- * FUNCTION
- * DispIdleScrWPBadFilePopup
- * DESCRIPTION
- * This function is call back function for showcategories33screen,
- * If display user defined image got problem in idle screen, this function will be executed
- * Follow functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void DispIdleScrWPBadFilePopup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (error_str_ptr)
- {
- DisplayPopup((PU8) error_str_ptr, IMG_GLOBAL_ERROR, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_IDLE_WP_DECODE_ERR),
- IMG_GLOBAL_ERROR,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- }
- error_str_ptr = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWallpaperBadFileCallBack
- * DESCRIPTION
- * This function is call back function for showcategories33screen,
- * If display user defined image got problem in idle screen, this function will be executed
- * Follow functions:
- * PARAMETERS
- * imgID [IN]
- * a(?) [IN/OUT] Void
- * b(?) [IN] Void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWallpaperBadFileCallBack(U16 imgID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- error_str_ptr = NULL;
- StartTimer(IDLE_SHOW_BADFILE_WARNING_TIMER, 1000, PhnsetRstWallpaperDefault);
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_WP;
- }
- #ifdef __MMI_SUB_WALLPAPER__
- /*****************************************************************************
- * FUNCTION
- * PhnsetWallpaperSubBadFileCallBack
- * DESCRIPTION
- *
- * PARAMETERS
- * imgID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWallpaperSubBadFileCallBack(U16 imgID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- error_str_ptr = NULL;
- StartTimer(IDLE_SHOW_SUB_BADFILE_WARNING_TIMER, 1000, PhnsetRstSubWallpaperDefault);
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_SUB_WP;
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetDisplayType
- * DESCRIPTION
- *
- * PARAMETERS
- * id [IN]
- * RETURNS
- *
- *****************************************************************************/
- PHNSET_TYPE_DISP PhnsetGetDisplayType(U16 id)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((id >= IMG_ID_PHNSET_WP_START && id <= IMG_ID_PHNSET_WP_MAX)
- #ifdef __MMI_SUB_WALLPAPER__
- || (id >= IMG_ID_PHNSET_SUB_WP_START && id <= IMG_ID_PHNSET_SUB_WP_MAX)
- #endif
- || (id >= IMG_ID_PHNSET_SS_START && id <= IMG_ID_PHNSET_SS_MAX)
- #if !defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
- #ifdef __MMI_ANALOG_CLOCK__
- || (id == IMG_ID_DISPCHAR_ANALOG_CLK)
- #endif
- #ifdef __MMI_DIGITAL_CLOCK__
- || (id == IMG_ID_DISPCHAR_DIGITAL_CLK)
- #endif
- #endif /* !__MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- #ifdef __MMI_THEMES_V2_SUPPORT__
- || (id == IMG_ID_DISPCHAR_THEME_WALLPAPER)
- || (id == IMG_ID_DISPCHAR_THEME_SCREENSAVER)
- #endif
- #ifdef __MMI_POWER_ON_OFF_DISPLAY__
- || (id >= IMG_ID_PHNSET_ON_START && id <= IMG_ID_PHNSET_ON_MAX)
- || (id >= IMG_ID_PHNSET_OFF_START && id <= IMG_ID_PHNSET_OFF_MAX)
- #else /* __MMI_POWER_ON_OFF_DISPLAY__ */
- || (id == IMG_ID_PHNSET_ON_ANIMATION_DEFAULT) || (id == IMG_ID_PHNSET_OFF_ANIMATION_DEFAULT)
- #endif /* __MMI_POWER_ON_OFF_DISPLAY__ */
- )
- {
- return PHNSET_TYPE_DISP_IMAGE;
- }
- #ifdef __MMI_SWFLASH__
- else if (id >= IMG_ID_DISPCHAR_SWFLASH_START && id <= IMG_ID_DISPCHAR_SWFLASH_MAX)
- {
- return PHNSET_TYPE_DISP_SWFLASH;
- }
- #endif
- #if defined(__MMI_VIDEO_PLAYER__) && defined(__MTK_TARGET__)
- else if ((id >= IMG_ID_PHNSET_SS_VDO_START && id <= IMG_ID_PHNSET_SS_VDO_MAX)
- #ifdef __MMI_POWER_ON_OFF_DISPLAY__
- || (id >= IMG_ID_PHNSET_ON_VDO_START && id <= IMG_ID_PHNSET_ON_VDO_MAX)
- || (id >= IMG_ID_PHNSET_OFF_VDO_START && id <= IMG_ID_PHNSET_OFF_VDO_MAX)
- #endif /* __MMI_POWER_ON_OFF_DISPLAY__ */
- )
- return PHNSET_TYPE_DISP_VIDEO;
- #endif /* defined(__MMI_VIDEO_PLAYER__) && defined(__MTK_TARGET__) */
- else if (id == 0x00)
- {
- return PHNSET_TYPE_DISP_USER;
- }
- else
- {
- return PHNSET_TYPE_DISP_INVALID;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWpSsPlayCallBack
- * DESCRIPTION
- *
- * PARAMETERS
- * result [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWpSsPlayCallBack(S32 result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetWpSsPlayCallBack: result=%dn", result));
- if (result >= 0)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- #ifdef __MMI_FILE_MANAGER__
- if (phnset_dispchar_strp)
- {
- CallbackWpSsLSK = PhnsetWpUsrDefSelect;
- }
- else
- #endif /* __MMI_FILE_MANAGER__ */
- {
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SS)
- {
- CallbackWpSsLSK = PhnsetScrSvrSysViewLskHdlr;
- }
- else
- {
- //ASSERT(0);
- }
- }
- }
- else
- {
- ChangeLeftSoftkey(0, 0);
- ChangeRightSoftkey(0, 0);
- CallbackWpSsLSK = UI_dummy_function;
- error_str_ptr = GetString(STR_GLOBAL_UNSUPPORTED_FORMAT);
- DispIdleScrWPBadFilePopup();
- #ifdef __MMI_FILE_MANAGER__
- PhnsetWpUsrDefFreeBuf();
- #endif
- /* delete to file select screen again */
- DeleteNHistory(1);
- }
- SetLeftSoftkeyFunction(CallbackWpSsLSK, KEY_EVENT_UP);
- }
- /*
- * Externel Interfaces
- */
- /*****************************************************************************
- * FUNCTION
- * PhnsetRstWallpaperDefault
- * DESCRIPTION
- * This function is to set wallpaper to default one
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] ImageId
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetRstWallpaperDefault(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->curtWpID = RstGetWallpaperImgIdDefault();
- #ifdef MMI_ON_WIN32
- g_phnset_cntx_p->curtWpID = IMG_ID_PHNSET_WP_START;
- #endif /* MMI_ON_WIN32 */
- if (!mmi_bootup_is_in_power_on_period())
- {
- DispIdleScrWPBadFilePopup();
- }
- mmi_dispchar_set_img_id(NVRAM_FUNANDGAMES_SETWALLPAPER, &(g_phnset_cntx_p->curtWpID));
- SetIdleScreenWallpaperID(g_phnset_cntx_p->curtWpID, MMI_TRUE);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetRstWallpaperDefault: Main, ID=%dn", g_phnset_cntx_p->curtWpID));
- }
- #ifdef __MMI_SUB_WALLPAPER__
- /*****************************************************************************
- * FUNCTION
- * PhnsetRstSubWallpaperDefault
- * DESCRIPTION
- * This function is to set sub wallpaper to default one
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void
- * b(?) [IN] ImageId
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetRstSubWallpaperDefault(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->curtSubWpID = RstGetWallpaperSubImgIdDefault(); /* RstGetWallpaperImgIdDefault(); */
- mmi_dispchar_set_img_id(NVRAM_SETWALLPAPER_SUB, &(g_phnset_cntx_p->curtSubWpID));
- SUBLCD_SetIdleScreenWallpaperID(g_phnset_cntx_p->curtSubWpID);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetRstSubWallpaperDefault: Sub, ID=%dn",
- g_phnset_cntx_p->curtSubWpID));
- if (!mmi_bootup_is_in_power_on_period())
- {
- DispIdleScrWPBadFilePopup();
- }
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- /*****************************************************************************
- * FUNCTION
- * PhnsetReadWallpaper
- * DESCRIPTION
- * This function is to Read wallpaper from Nvram, and set as current wallpaper
- * Functionality: Referenced at InitNvramData when bootup
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void *
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetReadWallpaper(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_FILE_MANAGER__
- S16 error;
- #endif
- PHNSET_TYPE_DISP type;
- phnset_wpss_type_enum temp_type = g_phnset_cntx_p->wpss_type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_WP;
- mmi_dispchar_get_img_id(NVRAM_FUNANDGAMES_SETWALLPAPER, &(g_phnset_cntx_p->curtWpID));
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetReadWallpaper: Main ID=%dn", g_phnset_cntx_p->curtWpID));
- if ((type = PhnsetGetDisplayType(g_phnset_cntx_p->curtWpID)) == PHNSET_TYPE_DISP_INVALID)
- {
- PhnsetRstWallpaperDefault();
- }
- #ifdef __MMI_FILE_MANAGER__
- else if (type == PHNSET_TYPE_DISP_USER)
- {
- ReadRecord(NVRAM_EF_WPSS_FILENAME_LID, 1, &phnset_wpss_filename, sizeof(phnset_wpss_filename), &error);
- if (error == NVRAM_READ_SUCCESS ||
- mmi_fmgr_util_file_limit_check(FMGR_LIMIT_WALLPAPER, (PS8) phnset_wpss_filename.wallpaper, &error_str_ptr))
- {
- g_phnset_cntx_p->isShort = phnset_wpss_filename.isWPShort;
- PhnsetSetWallpaperByFileName((S8*) phnset_wpss_filename.wallpaper);
- }
- else
- {
- memset(&phnset_wpss_filename, 0, sizeof(phnset_wpss_filename));
- PhnsetRstWallpaperDefault();
- }
- }
- #endif /* __MMI_FILE_MANAGER__ */
- else
- {
- PhnsetSetWallpaperByImgID(g_phnset_cntx_p->curtWpID);
- }
- #ifdef __MMI_SUB_WALLPAPER__
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_SUB_WP;
- mmi_dispchar_get_img_id(NVRAM_SETWALLPAPER_SUB, &(g_phnset_cntx_p->curtSubWpID));
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetReadWallpaper: Sub ID=%dn", g_phnset_cntx_p->curtSubWpID));
- if ((type = PhnsetGetDisplayType(g_phnset_cntx_p->curtSubWpID)) == PHNSET_TYPE_DISP_INVALID)
- {
- PhnsetRstSubWallpaperDefault();
- }
- #ifdef __MMI_FILE_MANAGER__
- else if (type == PHNSET_TYPE_DISP_USER)
- {
- ReadRecord(NVRAM_EF_WPSS_FILENAME_LID, 3, &phnset_wpss_sub_filename, sizeof(phnset_wpss_sub_filename), &error);
- if (error == NVRAM_READ_SUCCESS)
- {
- SUBLCD_SetIdleScreenWallpaperName((UI_string_type) phnset_wpss_sub_filename.wallpaper);
- }
- else
- {
- memset(&phnset_wpss_sub_filename, 0, sizeof(phnset_wpss_sub_filename));
- PhnsetRstSubWallpaperDefault();
- SUBLCD_SetIdleScreenWallpaperID(g_phnset_cntx_p->curtWpID);
- }
- }
- #endif /* __MMI_FILE_MANAGER__ */
- else
- {
- SUBLCD_SetIdleScreenWallpaperID(g_phnset_cntx_p->curtSubWpID);
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- g_phnset_cntx_p->wpss_type = temp_type;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetFileNamePointer
- * DESCRIPTION
- * To find the pointer of path
- * PARAMETERS
- * path [IN]
- * a(?) [IN/OUT] Void *
- * b(?) [IN]
- * RETURNS
- * PS8 wallpaper name string pointer
- *****************************************************************************/
- PS8 PhnsetGetFileNamePointer(PS8 path)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 len;
- U16 deter = 0x005C; /* '' */
- S16 *p = (S16*) path;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- len = (U16) pfnUnicodeStrlen(path);
- for (; len > 0; len--)
- {
- if (*(p + len) == deter)
- {
- return (PS8) (p + len + 1);
- }
- }
- return NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetCurWallpaperName
- * DESCRIPTION
- * This function is to get current name string pointer of wallpaper
- * Functionality: ex: Referenced by hint windows
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void *
- * b(?) [IN]
- * RETURNS
- * PS8 wallpaper name string pointer
- *****************************************************************************/
- PS8 PhnsetGetCurWallpaperName(void)
- {
- #ifdef __MMI_FILE_MANAGER__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->curtWpID == 0)
- {
- if (phnset_wpss_filename.isWPShort == 1)
- {
- U8 type, *temp = phnset_dispchar_temp;
- PS8 p;
- /* rename short name file should pass converted short name to editor,
- so that the display will be the same as in File Manager */
- p = PhnsetGetFileNamePointer((PS8) phnset_wpss_filename.wallpaper);
- type = PhnsetGetDefEncodingType();
- mmi_chset_mixed_text_to_ucs2_str(
- (U8*) temp,
- (FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH,
- (U8*) p,
- (mmi_chset_enum) type);
- p = (PS8) & temp[0];
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetCurWallpaperName: path=%s, encode=%dn", p, type));
- return p;
- }
- else
- {
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetCurWallpaperName: path=%sn",
- phnset_wpss_filename.wallpaper));
- return PhnsetGetFileNamePointer((PS8) phnset_wpss_filename.wallpaper);
- }
- }
- else
- #endif /* __MMI_FILE_MANAGER__ */
- return PhnsetGetWallpaperNameById(g_phnset_cntx_p->curtWpID);
- }
- #ifdef __MMI_SUB_WALLPAPER__
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetCurSubWallpaperName
- * DESCRIPTION
- * This function is to get current name string pointer of sublcd wallpaper
- * Functionality: ex: Referenced by hint windows
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void *
- * b(?) [IN]
- * RETURNS
- * PS8 wallpaper name string pointer
- *****************************************************************************/
- PS8 PhnsetGetCurSubWallpaperName(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->curtSubWpID == 0)
- {
- if (phnset_wpss_sub_filename.isWPShort == 1)
- {
- U8 temp[(FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH], type;
- PS8 p;
- /* rename short name file should pass converted short name to editor,
- so that the display will be the same as in File Manager */
- p = PhnsetGetFileNamePointer((S8*) phnset_wpss_sub_filename.wallpaper);
- type = PhnsetGetDefEncodingType();
- mmi_chset_mixed_text_to_ucs2_str(
- (U8*) temp,
- (FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH,
- (U8*) p,
- (mmi_chset_enum) type);
- p = (PS8) & temp[0];
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetCurSubWallpaperName: path=%s, encode=%dn", p, type));
- return p;
- }
- else
- {
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetCurSubWallpaperName: path=%sn",
- phnset_wpss_sub_filename.wallpaper));
- return PhnsetGetFileNamePointer((PS8) phnset_wpss_sub_filename.wallpaper);
- }
- }
- else
- {
- return PhnsetGetWallpaperNameById(g_phnset_cntx_p->curtSubWpID);
- }
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetWallpaperNameById
- * DESCRIPTION
- * This function is to translate image ID to name string pointer
- * Functionality: ex: Referenced by hint windows
- * PARAMETERS
- * Id [IN]
- * a(?) [IN/OUT]
- * b(?) [IN] U16 image ID
- * RETURNS
- * Wallpaper Name as PS8 passed as U16 as its ID
- *****************************************************************************/
- PS8 PhnsetGetWallpaperNameById(U16 Id)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PS8 pstr = NULL;
- U32 strID;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (Id >= IMG_ID_PHNSET_WP_START && Id <= IMG_ID_PHNSET_WP_MAX)
- {
- /* System Wallpaper Range */
- strID = STR_ID_PHNSET_DISPCHAR_IMGID_START + (Id - IMG_ID_PHNSET_WP_START);
- pstr = GetString((U16) strID);
- }
- #ifdef __MMI_SUB_WALLPAPER__
- else if (Id >= IMG_ID_PHNSET_SUB_WP_START && Id <= IMG_ID_PHNSET_SUB_WP_MAX)
- {
- strID = STR_ID_PHNSET_DISPCHAR_IMGID_START + (Id - IMG_ID_PHNSET_SUB_WP_START);
- pstr = GetString((U16) strID);
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- else if ((strID = getFactoryImageRelativeIndex(Id)) != 0)
- {
- /* Factory Wallpaper Range */
- DYNIMAGEINFO *Info;
- U8 i;
- U8 noFactImages = GetFullScreenFactoryImagesInfo(&Info);
- for (i = 0; i < noFactImages; i++)
- {
- if (Id == Info[i].ImagesId)
- {
- strID = STR_ID_PHNSET_DISPCHAR_IMGID_START + IMG_ID_PHNSET_WP_MAX + i;
- break;
- }
- }
- pstr = GetString((U16) strID);
- }
- #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- #ifdef __MMI_ANALOG_CLOCK__
- else if (Id == IMG_ID_DISPCHAR_ANALOG_CLK)
- {
- /* Analog Clock Wallpaper */
- strID = STR_ID_PHNSET_DISPCHAR_ANALOG;
- pstr = GetString((U16) strID);
- }
- #endif /* __MMI_ANALOG_CLOCK__ */
- #ifdef __MMI_DIGITAL_CLOCK__
- else if (Id == IMG_ID_DISPCHAR_DIGITAL_CLK)
- {
- /* Digital Clock Wallpaper */
- strID = STR_ID_PHNSET_DISPCHAR_DIGITAL;
- pstr = GetString((U16) strID);
- }
- #endif /* __MMI_DIGITAL_CLOCK__ */
- #endif /* !__MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- #ifdef __MMI_THEMES_V2_SUPPORT__
- else if (Id == IMG_ID_DISPCHAR_THEME_WALLPAPER)
- {
- /* Digital Clock Wallpaper */
- strID = STR_ID_DISPCHAR_THEME_WALLPAPER;
- pstr = GetString((U16) strID);
- }
- #endif /* __MMI_THEMES_V2_SUPPORT__ */
- #ifdef __MMI_SWFLASH__
- else if (Id >= IMG_ID_DISPCHAR_SWFLASH_START && Id <= IMG_ID_DISPCHAR_SWFLASH_MAX)
- {
- strID = STR_ID_DISPCHAR_SWFLASH_START + (Id - IMG_ID_DISPCHAR_SWFLASH_START);
- pstr = GetString((U16) strID);
- }
- #endif /* __MMI_SWFLASH__ */
- return pstr;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetWallpaperByImgID
- * DESCRIPTION
- * This function is to set current wallpaper using index by AT command
- * PARAMETERS
- * imgID [IN]
- * a(?) [IN/OUT]
- * b(?) [IN] U16 image ID
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetSetWallpaperByImgID(U16 imgID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_WP)
- {
- g_phnset_cntx_p->curtWpID = imgID;
- mmi_dispchar_set_img_id(NVRAM_FUNANDGAMES_SETWALLPAPER, &(g_phnset_cntx_p->curtWpID));
- SetIdleScreenWallpaperID(g_phnset_cntx_p->curtWpID, MMI_FALSE);
- #if defined(__MMI_SWFLASH__ ) && defined(__MMI_WALLPAPER_ON_BOTTOM__)
- if (PhnsetGetDisplayType(g_phnset_cntx_p->curtWpID) == PHNSET_TYPE_DISP_SWFLASH)
- {
- U16 default_id;
- mmi_dispchar_get_img_id(RESTORE_DEFAULT_FUNANDGAMES_SETWALLPAPER, &(default_id));
- SetListWallpaperID(default_id);
- }
- #endif /* __MMI_SWFLASH__ */
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSetWallpaperByImgID: Main, ID=%dn", g_phnset_cntx_p->curtWpID));
- if (g_idle_context.IsOnIdleScreen)
- {
- EntryIdleScreen();
- }
- }
- #ifdef __MMI_SUB_WALLPAPER__
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SUB_WP)
- {
- g_phnset_cntx_p->curtSubWpID = imgID;
- mmi_dispchar_set_img_id(NVRAM_SETWALLPAPER_SUB, &(g_phnset_cntx_p->curtSubWpID));
- SUBLCD_SetIdleScreenWallpaperID(g_phnset_cntx_p->curtSubWpID);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSetWallpaperByImgID: sUB, ID=%dn",
- g_phnset_cntx_p->curtSubWpID));
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- else
- {
- MMI_ASSERT(0);
- }
- g_phnset_cntx_p->isCorrectSet = 1;
- }
- #ifdef __MMI_FILE_MANAGER__
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetWallpaperByFileName
- * DESCRIPTION
- * This function is to set current wallpaper using index by AT command
- * PARAMETERS
- * path [?]
- * a(?) [IN/OUT]
- * b(?) [IN] U16 image ID
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetSetWallpaperByFileName(S8 *path)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->isCorrectSet = 1;
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_WP)
- {
- if (g_phnset_cntx_p->isShort)
- {
- phnset_wpss_filename.isWPShort = 1;
- }
- else
- {
- phnset_wpss_filename.isWPShort = 0;
- }
- g_phnset_cntx_p->curtWpID = 0;
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSetWallpaperByFileName: Main, isWPShort=%d, path=%sn",
- phnset_wpss_filename.isWPShort, phnset_wpss_filename.wallpaper));
- pfnUnicodeStrcpy((S8*) phnset_wpss_filename.wallpaper, (S8*) path);
- mmi_dispchar_set_img_id(NVRAM_FUNANDGAMES_SETWALLPAPER, &(g_phnset_cntx_p->curtWpID));
- WriteRecord(NVRAM_EF_WPSS_FILENAME_LID, 1, &phnset_wpss_filename, sizeof(phnset_wpss_filename), &error);
- SetIdleScreenWallpaperName((UI_string_type) phnset_wpss_filename.wallpaper);
- #if defined(__MMI_SWFLASH__ ) && defined(__MMI_WALLPAPER_ON_BOTTOM__)
- if ((g_phnset_cntx_p->curtWpID == 0 && mmi_fmgr_get_file_group((PS8) phnset_wpss_filename.wallpaper) == FMGR_GROUP_SWFLASH) ||
- (g_phnset_cntx_p->curtWpID != 0 && PhnsetGetDisplayType(g_phnset_cntx_p->curtWpID) == PHNSET_TYPE_DISP_SWFLASH))
- {
- U16 default_id;
- mmi_dispchar_get_img_id(RESTORE_DEFAULT_FUNANDGAMES_SETWALLPAPER, &(default_id));
- SetListWallpaperID(default_id);
- }
- else
- #endif /* __MMI_SWFLASH__ */
- wgui_save_wallpaper_to_speedup(MMI_FALSE);
- if (g_idle_context.IsOnIdleScreen)
- {
- EntryIdleScreen();
- }
- }
- #ifdef __MMI_SUB_WALLPAPER__
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_SUB_WP)
- {
- if (g_phnset_cntx_p->isShort)
- {
- phnset_wpss_sub_filename.isWPShort = 1;
- }
- else
- {
- phnset_wpss_sub_filename.isWPShort = 0;
- }
- g_phnset_cntx_p->curtSubWpID = 0;
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSetWallpaperByFileName: Sub, isWPShort=%d, path=%sn",
- phnset_wpss_sub_filename.isWPShort, phnset_wpss_sub_filename.wallpaper));
- pfnUnicodeStrcpy((S8*) phnset_wpss_sub_filename.wallpaper, (S8*) path);
- mmi_dispchar_set_img_id(NVRAM_SETWALLPAPER_SUB, &(g_phnset_cntx_p->curtSubWpID));
- WriteRecord(NVRAM_EF_WPSS_FILENAME_LID, 3, &phnset_wpss_sub_filename, sizeof(phnset_wpss_sub_filename), &error);
- SUBLCD_SetIdleScreenWallpaperName((UI_string_type) path);
- SUBLCD_UpdateWallpaper();
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- else
- {
- MMI_ASSERT(0);
- }
- }
- #endif /* __MMI_FILE_MANAGER__ */
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetDisplayFromAT
- * DESCRIPTION
- * This function is to set current wallpaper using index by AT command
- * PARAMETERS
- * idx [IN]
- * type [IN]
- * a(?) [IN/OUT]
- * b(?) [IN] U16 image ID
- * RETURNS
- * void
- *****************************************************************************/
- BOOL PhnsetSetDisplayFromAT(U8 idx, U8 type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 SysWpIDList[MAX_WALLPAPER_IMG];
- U8 max_idx = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- switch (type)
- {
- case MMI_PHNSET_TYPE_WP:
- #ifdef __MMI_SUB_WALLPAPER__
- case MMI_PHNSET_TYPE_SUB_WP:
- #endif
- {
- phnset_wpss_type_enum tmp_type = g_phnset_cntx_p->wpss_type;
- g_phnset_cntx_p->wpss_type = (phnset_wpss_type_enum) type;
- max_idx = PhnsetConstSysWallpaperList(NULL, SysWpIDList, NULL);
- g_phnset_cntx_p->wpss_type = tmp_type;
- if (idx < max_idx) /* unsigned comparison with 0 is always true: '>=' */
- {
- g_phnset_cntx_p->curtWpID = SysWpIDList[idx];
- mmi_dispchar_set_img_id(NVRAM_FUNANDGAMES_SETWALLPAPER, &(g_phnset_cntx_p->curtWpID));
- mmi_dispchar_set_img_id(RESTORE_DEFAULT_FUNANDGAMES_SETWALLPAPER, &(g_phnset_cntx_p->curtWpID));
- SetIdleScreenWallpaperID(g_phnset_cntx_p->curtWpID, MMI_FALSE);
- if (g_idle_context.IsOnIdleScreen)
- {
- EntryIdleScreen();
- }
- }
- else
- {
- return MMI_FALSE;
- }
- }
- break;
- case MMI_PHNSET_TYPE_SS:
- {
- max_idx = PhnsetConstSysScrSvrList(NULL, SysWpIDList, NULL);
- if (idx < max_idx) /* unsigned comparison with 0 is always true: '>=' */
- {
- g_phnset_cntx_p->curSsID = SysWpIDList[idx];
- mmi_dispchar_set_img_id(NVRAM_CURRENT_SCREENSVER_ID, &(g_phnset_cntx_p->curSsID));
- mmi_dispchar_set_img_id(RESTORE_DEFAULT_CURRENT_SCREENSVER_ID, &(g_phnset_cntx_p->curSsID));
- }
- else
- {
- return MMI_FALSE;
- }
- }
- break;
- #ifdef __MMI_POWER_ON_OFF_DISPLAY__
- case MMI_PHNSET_TYPE_PWRON:
- case MMI_PHNSET_TYPE_PWROFF:
- {
- phnset_wpss_type_enum tmp_type = g_phnset_cntx_p->wpss_type;
- g_phnset_cntx_p->wpss_type = (phnset_wpss_type_enum) type;
- max_idx = PhnsetConstSysPwrOnOffList(NULL, SysWpIDList, NULL);
- g_phnset_cntx_p->wpss_type = tmp_type;
- if (idx < max_idx) /* unsigned comparison with 0 is always true: '>=' */
- {
- if (type == MMI_PHNSET_TYPE_PWRON)
- {
- g_phnset_cntx_p->curtPwrOnID = SysWpIDList[idx];
- mmi_dispchar_set_img_id(NVRAM_CURRENT_POWER_ON_DISPLAY, &(g_phnset_cntx_p->curtPwrOnID));
- mmi_dispchar_set_img_id(NVRAM_RESTORE_POWER_ON_DISPLAY, &(g_phnset_cntx_p->curtPwrOnID));
- }
- else
- {
- g_phnset_cntx_p->curtPwrOffID = SysWpIDList[idx];
- mmi_dispchar_set_img_id(NVRAM_CURRENT_POWER_OFF_DISPLAY, &(g_phnset_cntx_p->curtPwrOffID));
- mmi_dispchar_set_img_id(NVRAM_RESTORE_POWER_OFF_DISPLAY, &(g_phnset_cntx_p->curtPwrOffID));
- }
- }
- else
- {
- return MMI_FALSE;
- }
- }
- break;
- #endif /* __MMI_POWER_ON_OFF_DISPLAY__ */
- }
- return MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetATDisplayBound
- * DESCRIPTION
- * This function is to get index boundary by AT command
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN] U16 image ID
- * RETURNS
- * U8 boundary
- *****************************************************************************/
- U8 PhnsetGetATDisplayBound(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return MMI_PHNSET_TYPE_MAX + 3;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetWallpaperIdxBound
- * DESCRIPTION
- * This function is to get index boundary by AT command
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN] U16 image ID
- * RETURNS
- * U8 boundary
- *****************************************************************************/
- U8 PhnsetGetWallpaperIdxBound()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- DYNIMAGEINFO *Info;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (MAX_WALLPAPER_IMG + GetFullScreenFactoryImagesInfo(&Info));
- }
- #ifdef __MMI_THEMES_V2_SUPPORT__
- /*****************************************************************************
- * FUNCTION
- * PhnsetIsWPCurrentTheme
- * DESCRIPTION
- * To check if the wallpaper is the current theme.
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- BOOL PhnsetIsWPCurrentTheme(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->curtWpID == IMG_ID_DISPCHAR_THEME_WALLPAPER)
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- #endif /* __MMI_THEMES_V2_SUPPORT__ */
- #ifdef __USB_IN_NORMAL_MODE__
- /*****************************************************************************
- * FUNCTION
- * PhnsetWPUseDefault
- * DESCRIPTION
- * Use default build-in wallpaper
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWPUseDefault(void)
- {
- #ifdef __MMI_FILE_MANAGER__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PHNSET_TYPE_DISP type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((type = PhnsetGetDisplayType(g_phnset_cntx_p->curtWpID)) == PHNSET_TYPE_DISP_USER
- && (mmi_usb_check_path_exported((S8*) phnset_wpss_filename.wallpaper)))
- {
- g_phnset_cntx_p->curtWpID = RstGetWallpaperImgIdDefault();
- SetIdleScreenWallpaperID(g_phnset_cntx_p->curtWpID, MMI_TRUE);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetWPUseDefault: Main, ID=%dn", g_phnset_cntx_p->curtWpID));
- }
- #ifdef __MMI_SUB_WALLPAPER__
- if ((type = PhnsetGetDisplayType(g_phnset_cntx_p->curtSubWpID)) == PHNSET_TYPE_DISP_USER
- && (mmi_usb_check_path_exported((S8*) phnset_wpss_sub_filename.wallpaper)))
- {
- g_phnset_cntx_p->curtSubWpID = RstGetWallpaperSubImgIdDefault();
- SUBLCD_SetIdleScreenWallpaperID(g_phnset_cntx_p->curtSubWpID);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetWPUseDefault: Main, ID=%dn", g_phnset_cntx_p->curtSubWpID));
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- #endif /* __MMI_FILE_MANAGER__ */
- }
- #endif /* __USB_IN_NORMAL_MODE__ */