|
发表于 2009-8-20 09:28:00
|
显示全部楼层
// 换墙纸的函数,写到idleapp.c里面,在收到换墙纸的消息后调用此函数:
void mmi_wallpaper_next_imgid(void)
{
U8 wp_item_amount = GetCurrentSysWallpaperInfo();
if( g_phnset_cntx_p->curHightlightItem >= wp_item_amount -1 )
{
g_phnset_cntx_p->curHightlightItem = 0;
if( SetUserDefineWallpaper() == 1 ) // set user define fail
{
g_phnset_cntx_p->curHightlightItem = -1;
return;
}
}
else
{
g_phnset_cntx_p->curHightlightItem++;
}
PhnsetSetWallpaperByImgID(g_phnset_cntx_p->SysWPSSList[g_phnset_cntx_p->curHightlightItem]);
}
// 写到wallpaper.c里面,共识获取当前的墙纸信息的一个wrapper,主要是为了g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_WP;句话,否则就会出现问题;
U8 GetCurrentSysWallpaperInfo(void)
{
U8 ret ;
g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_WP;
ret = PhnsetConstSysWallpaperList( NULL, g_phnset_cntx_p->SysWPSSList, (U16*) & (g_phnset_cntx_p-curHightlightItem));
return ret ;
}
// 写到wallpaper.c里面,用来设置用户自定义的墙纸
U8 SetUserDefineWallpaper(void)
{
if (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);
return 1;
}
return 0;
}
希望对你有帮助! |
|